diff --git a/.env b/.env index 00e19f9e..83698a10 100644 --- a/.env +++ b/.env @@ -3,3 +3,4 @@ DB_PORT=23798 PROCESSOR_PROMETHEUS_PORT=3000 GQL_PORT=4350 SQD_DEBUG=squid:log +ALL_SQD_DEBUG=* diff --git a/.eslintrc b/.eslintrc index 151497b2..394652d5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,6 @@ { "extends": ["eslint-config-unjs"], - "ignorePatterns": ["tests/**", "src/model", "lib/**"], + "ignorePatterns": ["tests/**", "src/model", "src/server-extension", "src/types", "lib/**"], "rules": { "@typescript-eslint/no-inferrable-types": 0, "@typescript-eslint/no-unused-vars": 0, @@ -23,6 +23,7 @@ "unicorn/prefer-code-point": 0, "unicorn/prefer-math-trunc": 0, "unicorn/text-encoding-identifier-case": 0, - "no-useless-constructor": 0 + "no-useless-constructor": 0, + "semi": ["error", "never"] } } diff --git a/.github/workflows/subsquid.yml b/.github/workflows/subsquid.yml index 5d7f8627..74e07854 100644 --- a/.github/workflows/subsquid.yml +++ b/.github/workflows/subsquid.yml @@ -23,4 +23,4 @@ jobs: sqd auth -k ${{ secrets.DEPLOYMENT_KEY }} - name: deploy subsquid id: deploy - run: sqd deploy -u -m ${{ env.VERSION }}.yaml . + run: sqd deploy -o kodadot -u -m ${{ env.VERSION }}.yaml . diff --git a/README.md b/README.md index ecc8e33b..657cdd29 100644 --- a/README.md +++ b/README.md @@ -2,47 +2,53 @@ ![](https://media.tenor.com/eK1dyB3TOLsAAAAC/anime-stick.gif) -KodaDot's [Squid](https://docs.subsquid.io) based data processor for [KodaDot](https://kodadot.xyz) NFT Marketplace. +[Squid](https://docs.subsquid.io) based data used to index, process, and query on top of AssetHub for [KodaDot](https://kodadot.xyz) NFT Marketplace. + +## Hosted Squids + +* Kusama AssetHub Processor (Statemine -> KSM): https://squid.subsquid.io/stick/graphql +* Polkadot AssetHub Processor (Statemint -> DOT): https://squid.subsquid.io/speck/graphql +* Rococo Testnet Processor: 🚧 WIP 🚧 + +## Project structure + +* `src/generated` - model/server definitions created by `codegen`. Do not alter the contents of this directory manually. +* `src/server-extension` - module with custom `type-graphql` based resolvers. +* `src/types` - data type definitions for chain events and extrinsics created by `typegen`. +* `src/mappings` - mapping module. +* `lib` - compiled js files. The structure of this directory must reflect `src`. +* `.env` - environment variables defined here or supplied by a shell. ## Prerequisites -* node 18.x -* docker -* npm -- note that `yarn` package manager is not supported +* Node 18.x +* Docker +* npm +* [just](https://github.com/casey/just) ## Quickly running the sample -Example commands below use [sqd](https://docs.subsquid.io/squid-cli/). -Please [install](https://docs.subsquid.io/squid-cli/installation/) it before proceeding. - ```bash -# 1. Update Squid SDK and install dependencies -npm run update +# 1. Install dependencies npm ci -# 2. Start target Postgres database and detach -sqd up +# 2. Build project +just build -# 3. Build the project and start the processor -sqd process +# 3. Start target Postgres database container +just upd -# 4. The command above will block the terminal -# being busy with fetching the chain data, -# transforming and storing it in the target database. -# -# To start the graphql server open a separate terminal -# and run -sqd serve -``` +# 4. Update database with data objects +just migrate -## Project structure +# 5. Start the processor +just process -* `src/generated` - model/server definitions created by `codegen`. Do not alter the contents of this directory manually. -* `src/server-extension` - module with custom `type-graphql` based resolvers -* `src/types` - data type definitions for chain events and extrinsics created by `typegen`. -* `src/mappings` - mapping module. -* `lib` - compiled js files. The structure of this directory must reflect `src`. -* `.env` - hydra tools are heavily driven by environment variables defined here or supplied by a shell. +# 6. Open a separate terminal and launch the graphql server to query the processed data +just serve + +# 7. Visit localhost:4350/graphql to see the result +``` ## Dev flow @@ -50,37 +56,36 @@ sqd serve Start development by defining the schema of the target database via `schema.graphql`. Schema definition consists of regular graphql type declarations annotated with custom directives. -Full description of `schema.graphql` dialect is available [here](https://docs.subsquid.io/schema-file). +A full description of `schema.graphql` dialect is available [here](https://docs.subsquid.io/schema-file). ### 2. Generate TypeORM classes -Mapping developers use [TypeORM](https://typeorm.io) entities -to interact with the target database during data processing. All necessary entity classes are -generated by the squid framework from `schema.graphql`. This is done by running `npx squid-typeorm-codegen` -or (equivalently) `sqd codegen` command. +Mapping developers use [TypeORM](https://typeorm.io) entities to interact with the target database during data processing. The squid framework generates All necessary entity classes from `schema.graphql`. This is done by running `just codegen` command. ### 3. Generate database migration All database changes are applied through migration files located at `db/migrations`. -`squid-typeorm-migration(1)` tool provides several commands to drive the process. +`squid-typeorm-migration` tool provides several commands to drive the process. It is all [TypeORM](https://typeorm.io/#/migrations) under the hood. ```bash -# Connect to database, analyze its state and generate migration to match the target schema. -# The target schema is derived from entity classes generated earlier. -# Don't forget to compile your entity classes beforehand! -npx squid-typeorm-migration generate +# Connect to the database, analyze its state, and generate a migration to match the target schema. +# Launch Docker instance of the database +just upd -# Create template file for custom database changes -npx squid-typeorm-migration create +# The target schema is derived from entity classes generated earlier. +# Remember to compile your entity classes beforehand! +just update-db # Apply database migrations from `db/migrations` -npx squid-typeorm-migration apply +just migrate # Revert the last performed migration -npx squid-typeorm-migration revert +just revert-db ``` + Available `sqd` shortcuts: + ```bash # Build the project, remove any old migrations, then run `npx squid-typeorm-migration generate` sqd migration:generate @@ -89,7 +94,38 @@ sqd migration:generate sqd migration:apply ``` -### Dev hacks +### Testing + +> Unit test early, unit test often + +> [!NOTE] +> Any code imported from @kodadot [packages has unit test written in the separated repository](https://github.com/kodadot/packages) + +This indexer contains unit tests for utility/parsing functions we wrote. + +Tests are located in the `tests/` directory. +To run the tests, use: + +```bash +npm run test +``` + +> [!WARNING] +> Currently, it is impossible to unit test the whole indexer workflow as a dry run. If you encounter some problem, please head over to the telegram group **HydraDevs** + +## Architecture + +The architecture of this project is following: + +* `src/processable.ts` - definition of Events and Extrinsic to be processed by Squid +* `src/processor.ts` - processor definition +* `src/mappings/index` - the main function that is called by the processor to process events and extrinsic +* `src/mappings/` - mapping functions for each event and extrinsic +* `src/mappings//types.ts` - types for each event and extrinsic +* `src/mappings//getters/.ts` - transformation functions for each event and extrinsic +* `src/mappings/utils` - utility functions used by mappings + +## Misc 1. fast generate event handlers diff --git a/db/migrations/1706015961189-Data.js b/db/migrations/1706015961189-Data.js new file mode 100644 index 00000000..1da79ce6 --- /dev/null +++ b/db/migrations/1706015961189-Data.js @@ -0,0 +1,13 @@ +module.exports = class Data1706015961189 { + name = 'Data1706015961189' + + async up(db) { + await db.query(`ALTER TABLE "collection_entity" ADD "type" character varying(8)`) + await db.query(`ALTER TABLE "collection_entity" ADD "settings" jsonb`) + } + + async down(db) { + await db.query(`ALTER TABLE "collection_entity" DROP COLUMN "type"`) + await db.query(`ALTER TABLE "collection_entity" DROP COLUMN "settings"`) + } +} diff --git a/db/migrations/1706035705537-Data.js b/db/migrations/1706035705537-Data.js new file mode 100644 index 00000000..8f7ac330 --- /dev/null +++ b/db/migrations/1706035705537-Data.js @@ -0,0 +1,11 @@ +module.exports = class Data1706035705537 { + name = 'Data1706035705537' + + async up(db) { + await db.query(`CREATE TABLE "cache_status" ("id" character varying NOT NULL, "last_block_timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_1001e39eb0aa38d043d96f7f4fa" PRIMARY KEY ("id"))`) + } + + async down(db) { + await db.query(`DROP TABLE "cache_status"`) + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 0743f5bc..44a74b5b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: ports: - "${DB_PORT}:5432" # command: ["postgres", "-c", "log_statement=all"] -# volumes: + # volumes: + # - ./assets/${CHAIN}/init.sql:/docker-entrypoint-initdb.d/init.sql # - ./data/db:/var/lib/postgresql/data diff --git a/justfile b/justfile index ac22d900..0ffb4d90 100644 --- a/justfile +++ b/justfile @@ -2,7 +2,7 @@ default := 'squid' types := 'typegen' process: build - node -r dotenv/config lib/processor.js + node --require=dotenv/config lib/processor.js serve: @npx squid-graphql-server @@ -42,9 +42,16 @@ bug: down upd reset: migrate +slow: + sleep 1 + just reset + quickstart: migrate process -quick: build reset process +quick: wipe bug slow process + +wipe: + clear prod TAG: gh pr create --base release-{{TAG}} @@ -55,6 +62,9 @@ migrate: update-db: npx squid-typeorm-migration generate +revert-db: + npx squid-typeorm-migration revert + db: update-db migrate test: @@ -79,7 +89,10 @@ update-deps: npx npm-check-updates -ux exec: - docker exec -it stick-db-1 psql -U postgres -d squid + docker exec -it subsquid_db psql -U postgres -d squid + +dump NAME=default: + docker exec -t subsquid_db pg_dump -U postgres -d squid > {{NAME}}.sql check: codegen build diff --git a/package-lock.json b/package-lock.json index 59097483..edca708f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,39 +1,41 @@ { "name": "@kodadot1/stick", - "version": "0.0.2", + "version": "0.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@kodadot1/stick", - "version": "0.0.2", + "version": "0.2.0", "dependencies": { - "@kodadot1/metasquid": "^0.1.6-rc.0", - "@kodadot1/minipfs": "^0.4.1-rc.0", - "@subsquid/archive-registry": "2.1.14", - "@subsquid/graphql-server": "3.3.2", - "@subsquid/ss58": "0.1.4", - "@subsquid/substrate-processor": "2.4.1", - "@subsquid/typeorm-migration": "0.1.6", - "@subsquid/typeorm-store": "0.2.2", - "dotenv": "^16.0.0", + "@kodadot1/hyperdata": "^0.0.1-rc.4", + "@kodadot1/metasquid": "^0.3.0-rc.0", + "@kodadot1/minipfs": "^0.4.2-rc.0", + "@subsquid/archive-registry": "3.3.0", + "@subsquid/graphql-server": "4.3.1", + "@subsquid/ss58": "2.0.1", + "@subsquid/substrate-processor": "7.2.1", + "@subsquid/typeorm-migration": "1.2.2", + "@subsquid/typeorm-store": "1.2.4", + "dotenv": "^16.4.5", "md5": "^2.3.0", "nanoid": "3.3.4", - "pg": "^8.10.0", + "pg": "^8.11.3", "type-graphql": "^1.2.0-rc.1", - "typeorm": "0.3.15" + "typeorm": "0.3.17" }, "devDependencies": { - "@subsquid/substrate-metadata-explorer": "1.1.2", - "@subsquid/substrate-typegen": "2.2.1", - "@subsquid/typeorm-codegen": "0.3.3", + "@subsquid/substrate-metadata-explorer": "3.1.1", + "@subsquid/substrate-typegen": "8.0.1", + "@subsquid/typeorm-codegen": "1.3.2", "@types/md5": "^2.3.2", "@types/node": "18.11.18", - "@types/pg": "^8.6.6", + "@types/pg": "^8.11.2", "eslint": "^8.38.0", "eslint-config-unjs": "^0.1.0", - "prettier": "^2.8.7", - "typescript": "~5.0.4" + "prettier": "^2.8.8", + "typescript": "~5.0.4", + "vitest": "^1.3.1" }, "engines": { "node": ">=16" @@ -64,9 +66,9 @@ } }, "node_modules/@apollo/usage-reporting-protobuf": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.0.2.tgz", - "integrity": "sha512-GfE8aDqi/lAFut95pjH9IRvH0zGsQ5G/2lYL0ZLZfML7ArX+A4UVHFANQcPCcUYGE6bI6OPhLekg4Vsjf6B1cw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.1.1.tgz", + "integrity": "sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==", "dependencies": { "@apollo/protobufjs": "1.2.7" } @@ -298,6 +300,385 @@ "node": ">=4" } }, + "node_modules/@babel/runtime": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", + "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -378,43 +759,46 @@ } }, "node_modules/@exodus/schemasafe": { - "version": "1.0.0-rc.9", - "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.0.0-rc.9.tgz", - "integrity": "sha512-dGGHpb61hLwifAu7sotuHFDBw6GTdpG8aKC0fsK17EuTzMRvUrH7lEAr6LTJ+sx3AZYed9yZ77rltVDHyg2hRg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.3.0.tgz", + "integrity": "sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==", "dev": true }, "node_modules/@graphql-tools/merge": { - "version": "8.3.18", - "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.18.tgz", - "integrity": "sha512-R8nBglvRWPAyLpZL/f3lxsY7wjnAeE0l056zHhcO/CgpvK76KYUt9oEkR05i8Hmt8DLRycBN0FiotJ0yDQWTVA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-9.0.0.tgz", + "integrity": "sha512-J7/xqjkGTTwOJmaJQJ2C+VDBDOWJL3lKrHJN4yMaRLAJH3PosB7GiPRaSDZdErs0+F77sH2MKs2haMMkywzx7Q==", "dependencies": { - "@graphql-tools/utils": "9.2.1", + "@graphql-tools/utils": "^10.0.0", "tslib": "^2.4.0" }, + "engines": { + "node": ">=16.0.0" + }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, - "node_modules/@graphql-tools/merge/node_modules/@graphql-tools/utils": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", - "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", + "node_modules/@graphql-tools/mock": { + "version": "8.7.20", + "resolved": "https://registry.npmjs.org/@graphql-tools/mock/-/mock-8.7.20.tgz", + "integrity": "sha512-ljcHSJWjC/ZyzpXd5cfNhPI7YljRVvabKHPzKjEs5ElxWu2cdlLGvyNYepApXDsM/OJG/2xuhGM+9GWu5gEAPQ==", "dependencies": { - "@graphql-typed-document-node/core": "^3.1.1", + "@graphql-tools/schema": "^9.0.18", + "@graphql-tools/utils": "^9.2.1", + "fast-json-stable-stringify": "^2.1.0", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, - "node_modules/@graphql-tools/mock": { - "version": "8.7.18", - "resolved": "https://registry.npmjs.org/@graphql-tools/mock/-/mock-8.7.18.tgz", - "integrity": "sha512-ZbXMp86V0DmfgUZhr5aGHtNIS2hBazhvTpPlFCyNOP+RMio3ErKnSsma3T1jV1ZyMo11l7QrxV9Xxn3uA0dv+w==", + "node_modules/@graphql-tools/mock/node_modules/@graphql-tools/merge": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz", + "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==", "dependencies": { - "@graphql-tools/schema": "9.0.16", - "@graphql-tools/utils": "9.2.1", - "fast-json-stable-stringify": "^2.1.0", + "@graphql-tools/utils": "^9.2.1", "tslib": "^2.4.0" }, "peerDependencies": { @@ -422,14 +806,14 @@ } }, "node_modules/@graphql-tools/mock/node_modules/@graphql-tools/schema": { - "version": "9.0.16", - "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.16.tgz", - "integrity": "sha512-kF+tbYPPf/6K2aHG3e1SWIbapDLQaqnIHVRG6ow3onkFoowwtKszvUyOASL6Krcv2x9bIMvd1UkvRf9OaoROQQ==", + "version": "9.0.19", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz", + "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==", "dependencies": { - "@graphql-tools/merge": "8.3.18", - "@graphql-tools/utils": "9.2.1", + "@graphql-tools/merge": "^8.4.1", + "@graphql-tools/utils": "^9.2.1", "tslib": "^2.4.0", - "value-or-promise": "1.0.12" + "value-or-promise": "^1.0.12" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" @@ -447,68 +831,46 @@ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, - "node_modules/@graphql-tools/mock/node_modules/value-or-promise": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", - "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", - "engines": { - "node": ">=12" - } - }, "node_modules/@graphql-tools/schema": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz", - "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-10.0.0.tgz", + "integrity": "sha512-kf3qOXMFcMs2f/S8Y3A8fm/2w+GaHAkfr3Gnhh2LOug/JgpY/ywgFVxO3jOeSpSEdoYcDKLcXVjMigNbY4AdQg==", "dependencies": { - "@graphql-tools/merge": "8.3.1", - "@graphql-tools/utils": "8.9.0", + "@graphql-tools/merge": "^9.0.0", + "@graphql-tools/utils": "^10.0.0", "tslib": "^2.4.0", - "value-or-promise": "1.0.11" - }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/@graphql-tools/schema/node_modules/@graphql-tools/merge": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz", - "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==", - "dependencies": { - "@graphql-tools/utils": "8.9.0", - "tslib": "^2.4.0" + "value-or-promise": "^1.0.12" }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/@graphql-tools/schema/node_modules/@graphql-tools/utils": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz", - "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==", - "dependencies": { - "tslib": "^2.4.0" + "engines": { + "node": ">=16.0.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "node_modules/@graphql-tools/utils": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.12.0.tgz", - "integrity": "sha512-TeO+MJWGXjUTS52qfK4R8HiPoF/R7X+qmgtOYd8DTH0l6b+5Y/tlg5aGeUJefqImRq7nvi93Ms40k/Uz4D5CWw==", + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-10.0.8.tgz", + "integrity": "sha512-yjyA8ycSa1WRlJqyX/aLqXeE5DvF/H02+zXMUFnCzIDrj0UvLMUrxhmVFnMK0Q2n3bh4uuTeY3621m5za9ovXw==", "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "cross-inspect": "1.0.0", + "dset": "^3.1.2", "tslib": "^2.4.0" }, + "engines": { + "node": ">=16.0.0" + }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "node_modules/@graphql-typed-document-node/core": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.1.tgz", - "integrity": "sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "node_modules/@humanwhocodes/config-array": { @@ -572,43 +934,67 @@ "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==" }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/@josephg/resolvable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@josephg/resolvable/-/resolvable-1.0.1.tgz", "integrity": "sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==" }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, "node_modules/@keyv/redis": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@keyv/redis/-/redis-2.5.5.tgz", - "integrity": "sha512-J7dNB6iU18AbkxiN2moPcWUShgOVZtf4ySpsZIXPnuwqrvkF4X0q7nH/+mYJEjJpZwUWg6HjVxXkJYE9C2jMDw==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@keyv/redis/-/redis-2.5.8.tgz", + "integrity": "sha512-WweuUZqZN2ETcseV6r1AEum1qG6eR5poNhkZ4CIpWBOjMasT2ArTKWyIPxxYllKUS2A8wKv1l8+AqH6Jpzk7Ug==", "dependencies": { - "ioredis": "^5.3.0" + "ioredis": "^5.3.2" }, "engines": { "node": ">= 12" } }, + "node_modules/@kodadot1/hyperdata": { + "version": "0.0.1-rc.4", + "resolved": "https://registry.npmjs.org/@kodadot1/hyperdata/-/hyperdata-0.0.1-rc.4.tgz", + "integrity": "sha512-8vBamHWimmZ/ew1Z0iUJPDdW2fkNiPC5S1Ezklsy5BjG0AvA+7t+cwpi2gD33sMrfkzAAHcg30B3EHA98sgUzw==" + }, "node_modules/@kodadot1/metasquid": { - "version": "0.1.6-rc.0", - "resolved": "https://registry.npmjs.org/@kodadot1/metasquid/-/metasquid-0.1.6-rc.0.tgz", - "integrity": "sha512-73cZJs0GtOgQmeMeF0h/t7nniYAue60f9tofd/ogshYUd9sTxRdzlXfemFlTN+78QCrx0TmpUOy3t9/yNIiXxw==", + "version": "0.3.0-rc.0", + "resolved": "https://registry.npmjs.org/@kodadot1/metasquid/-/metasquid-0.3.0-rc.0.tgz", + "integrity": "sha512-RnsxKYKxrRM+S4/tCVpCi1QOIgTS6myevg6bODopNNR7Z3UzyABVPxHWoUjmsaOBuMSAthvNYn03tbCjLax0mA==", "dependencies": { - "scule": "^1.0.0" + "scule": "^1.1.0" }, "engines": { "node": ">=14" }, "peerDependencies": { - "@subsquid/logger": "0.3.x", - "@subsquid/ss58": "0.1.x", - "@subsquid/substrate-processor": ">= 1", + "@subsquid/logger": ">= 1", + "@subsquid/ss58": ">= 2", + "@subsquid/substrate-processor": ">= 7", + "@subsquid/typeorm-store": ">= 1", "typeorm": "0.3.x" } }, "node_modules/@kodadot1/minipfs": { - "version": "0.4.1-rc.0", - "resolved": "https://registry.npmjs.org/@kodadot1/minipfs/-/minipfs-0.4.1-rc.0.tgz", - "integrity": "sha512-pKFUZ1qpNLJ4qt8KwjI7uaNUU46fP3MCNOblplb9NSrK5IIGjV18dTacTMvEbR3BVc1D+MKiehPjdap0iKgqTw==", + "version": "0.4.2-rc.0", + "resolved": "https://registry.npmjs.org/@kodadot1/minipfs/-/minipfs-0.4.2-rc.0.tgz", + "integrity": "sha512-sZievAE9OfG9Islrxa8viHPXCeR4xAHeG3DSyJSOq/RgjNF23vgRCoJukLfuTbEZ6N9zsOSKrOqQlL0Jba44Iw==", "dependencies": { "ofetch": "^1.3.3" } @@ -722,20 +1108,195 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", + "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", + "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", + "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", + "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", + "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", + "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", + "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", + "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", + "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", + "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", + "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", + "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", + "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "node_modules/@sqltools/formatter": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" }, "node_modules/@subsquid/archive-registry": { - "version": "2.1.14", - "resolved": "https://registry.npmjs.org/@subsquid/archive-registry/-/archive-registry-2.1.14.tgz", - "integrity": "sha512-STsM5ys44lV5aW+Ha1go5eLfTCLJGrB603/Ok4JbaruaU23RBTsIyLkI4FK08sSEkeQhX54xR7U/fZX85yjnIA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/archive-registry/-/archive-registry-3.3.0.tgz", + "integrity": "sha512-moXnGNOSmKMHyuDvUiOHbpL7IePSo4XZOW9OnzESIND64eGxlKusIsCi8Nth1DgzbE/UTTFeNJvYKu0v7SOIqw==", "dependencies": { "@subsquid/util-internal": "^1.0.0", "commander": "^10.0.0", "easy-table": "^1.2.0", - "node-fetch": "^2" + "sync-fetch": "^0.5.2" }, "bin": { "squid-archive-registry": "bin/run.js" @@ -747,42 +1308,42 @@ "integrity": "sha512-C89mus6IXnNi0xMQrZqUFBZwLj8tbuq9lye8Gq/lHmmERAUpi6UsWEyLdJLx2mneZzF3JtY8eNiiZ16jmjtvfw==" }, "node_modules/@subsquid/graphql-server": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@subsquid/graphql-server/-/graphql-server-3.3.2.tgz", - "integrity": "sha512-sJbOqvUrIej34bodz2jYPgOCB8GxwdqmMYEkbk6jz4OAwGS103bUYzypAtk35zxJYL9xzFRPhIXrNOaa9glXQw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/graphql-server/-/graphql-server-4.3.1.tgz", + "integrity": "sha512-EEZXaZf3TSK0JD+kcBgr+ENf2WOAjb7EREQP28+9NRWQhtn1s1w3XQNMjjurfyeb5Us/pRODAmfl8jOcXj3CAQ==", "dependencies": { "@apollo/utils.keyvadapter": "~1.1.2", "@apollo/utils.keyvaluecache": "~1.0.2", - "@graphql-tools/merge": "^8", - "@graphql-tools/schema": "^8", - "@graphql-tools/utils": "^8", - "@keyv/redis": "~2.5.5", - "@subsquid/logger": "^0.3.1", - "@subsquid/openreader": "^3.1.7", - "@subsquid/typeorm-config": "^2.0.2", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-commander": "^0.0.2", - "@subsquid/util-internal-http-server": "^0.1.1", - "apollo-server-core": "^3.11.1", - "apollo-server-express": "^3.11.1", + "@graphql-tools/merge": "^9.0.0", + "@graphql-tools/schema": "^10.0.0", + "@graphql-tools/utils": "^10.0.6", + "@keyv/redis": "~2.5.8", + "@subsquid/logger": "^1.3.1", + "@subsquid/openreader": "^4.4.1", + "@subsquid/typeorm-config": "^3.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-commander": "^1.3.1", + "@subsquid/util-internal-http-server": "^1.2.1", + "apollo-server-core": "^3.12.1", + "apollo-server-express": "^3.12.1", "apollo-server-plugin-response-cache": "~3.7.1", - "commander": "^10.0.0", - "dotenv": "^16.0.3", + "commander": "^11.0.0", + "dotenv": "^16.3.1", "express": "^4.18.2", "graphql": "^15.8.0", - "graphql-ws": "^5.11.3", - "keyv": "~4.5.2", - "pg": "^8.9.0", - "ws": "^8.12.0" + "graphql-ws": "^5.14.1", + "keyv": "~4.5.3", + "pg": "^8.11.3", + "ws": "^8.14.2" }, "bin": { "squid-graphql-server": "bin/run.js" }, "peerDependencies": { - "@subsquid/big-decimal": "^0.0.0", + "@subsquid/big-decimal": "^1.0.0", "class-validator": "^0.14.0", "type-graphql": "^1.2.0-rc.1", - "typeorm": "^0.3.11" + "typeorm": "^0.3.17" }, "peerDependenciesMeta": { "@subsquid/big-decimal": { @@ -799,45 +1360,114 @@ } } }, + "node_modules/@subsquid/graphql-server/node_modules/@subsquid/typeorm-config": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-3.3.1.tgz", + "integrity": "sha512-d8n+GHAr05A1cQXBr+kbaU0WeSD7oQk+t7KwkGbC9hh80tkYiweKzQwS4+fJcJCbrpZe+B6mV8WY5eVR9ebZMw==", + "dependencies": { + "@subsquid/util-naming": "^1.2.1" + }, + "peerDependencies": { + "typeorm": "^0.3.17" + }, + "peerDependenciesMeta": { + "typeorm": { + "optional": true + } + } + }, + "node_modules/@subsquid/graphql-server/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "node_modules/@subsquid/graphql-server/node_modules/@subsquid/util-internal-commander": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.1.tgz", + "integrity": "sha512-KeGsOghBU20tM1BzqryOf3MKvrDFSfPuhnl9LhhEC00ysp8rRPyejlw6jIJhO2NRJ+oaUi5jHRdf64/o21N7Lw==", + "peerDependencies": { + "commander": "^11.0.0" + } + }, + "node_modules/@subsquid/graphql-server/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@subsquid/http-client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/http-client/-/http-client-1.3.1.tgz", + "integrity": "sha512-ZBuYNW9IOvigvpntZvM0tzAY5Llr44NYswOzGwJpCjOnWF7EotzeJRMwDH0Zv5hXSMFvX3UBACP+PxmwDvma5A==", + "dependencies": { + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "node-fetch": "^3.3.2" + } + }, + "node_modules/@subsquid/http-client/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "node_modules/@subsquid/http-client/node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, "node_modules/@subsquid/logger": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-0.3.1.tgz", - "integrity": "sha512-Hi0aWeVgK0OZ3L2KxRejLCHIBIs6k3AR8FEb9RCKgQvqHK8DDNuMFANo4obHqXDZpDF+Ef+T050Oz5n4O1u3lA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-1.3.1.tgz", + "integrity": "sha512-OBhelb0HbhqSygq/IxEm9PPX8thQSDiCPV45UlCqWOoQ9UpiROiQLL+2nwt+HAHQq+LlHTzQmGXV43eabrTfwQ==", "dependencies": { - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-json": "^0.2.1", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-json": "^1.2.1", "supports-color": "^8.1.1" } }, "node_modules/@subsquid/openreader": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/@subsquid/openreader/-/openreader-3.1.7.tgz", - "integrity": "sha512-Ma1RAFk4dtmcRfcL/ys9Kq7qaEWvKH0TCbd5vcijwfnPu7GpOhU/3wYtegrwhQiWg1AaDavd9ub9jLPvur0FFQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@subsquid/openreader/-/openreader-4.4.1.tgz", + "integrity": "sha512-Z2M+scuoJx1H3U+KttIEjrSvZ+5K3ioNdWatUS42k9xgOIEMJzDCJM8ZxhqgP/fMTrR9RPjeFqjy6NBS0kgwtg==", "dependencies": { - "@graphql-tools/merge": "^8", + "@graphql-tools/merge": "^9.0.0", "@subsquid/graphiql-console": "^0.3.0", - "@subsquid/logger": "^0.3.1", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-commander": "^0.0.2", - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-http-server": "^0.1.1", - "@subsquid/util-naming": "^0.0.2", - "apollo-server-core": "^3.11.1", - "apollo-server-express": "^3.11.1", - "commander": "^10.0.0", - "deep-equal": "^2.2.0", + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-commander": "^1.3.1", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-http-server": "^1.2.1", + "@subsquid/util-naming": "^1.2.1", + "apollo-server-core": "^3.12.1", + "apollo-server-express": "^3.12.1", + "commander": "^11.0.0", + "deep-equal": "^2.2.2", "express": "^4.18.2", "graphql": "^15.8.0", "graphql-parse-resolve-info": "^4.13.0", - "graphql-ws": "^5.11.3", - "pg": "^8.9.0", - "ws": "^8.12.0" + "graphql-ws": "^5.14.1", + "pg": "^8.11.3", + "ws": "^8.14.2" }, "bin": { "openreader": "bin/main.js" }, "peerDependencies": { - "@subsquid/big-decimal": "^0.0.0" + "@subsquid/big-decimal": "^1.0.0" }, "peerDependenciesMeta": { "@subsquid/big-decimal": { @@ -845,163 +1475,319 @@ } } }, + "node_modules/@subsquid/openreader/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "node_modules/@subsquid/openreader/node_modules/@subsquid/util-internal-commander": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.1.tgz", + "integrity": "sha512-KeGsOghBU20tM1BzqryOf3MKvrDFSfPuhnl9LhhEC00ysp8rRPyejlw6jIJhO2NRJ+oaUi5jHRdf64/o21N7Lw==", + "peerDependencies": { + "commander": "^11.0.0" + } + }, + "node_modules/@subsquid/openreader/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, "node_modules/@subsquid/rpc-client": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/rpc-client/-/rpc-client-2.0.0.tgz", - "integrity": "sha512-El67TER6lmeoaeOlRNELlH2AGpG4YWg8YRnIw3yrfzYhiXsmpX1Hra4XJi53/RxU5tsS1qMON2bd44QbceL27Q==", - "dependencies": { - "@subsquid/util-timeout": "^1.0.0", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@subsquid/rpc-client/-/rpc-client-4.4.2.tgz", + "integrity": "sha512-Zo/KuFNiwKblKCUDpXUNbeshxEpCX44CtBKbzr4f5zFNdwxuH7FjwFnZk4X5YZUVnbcTF6cmqhH5RwRkKBgPfQ==", + "dependencies": { + "@subsquid/http-client": "^1.3.1", + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-binary-heap": "^1.0.0", + "@subsquid/util-internal-counters": "^1.3.1", "websocket": "^1.0.34" } }, + "node_modules/@subsquid/rpc-client/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, "node_modules/@subsquid/scale-codec": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@subsquid/scale-codec/-/scale-codec-1.1.1.tgz", - "integrity": "sha512-gDI0TnF0LXG5+nwXW6TUkTBVfbTcPqtPeAqAwy6Z9EtetHK8IoogkewIILisXcbVun2M66cZR+i/VABbaVy2Sw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/scale-codec/-/scale-codec-4.0.0.tgz", + "integrity": "sha512-aVqcy1KeQiYhL3lRLZJcRVuBOmh88zQKqEdxU/7gJCj/gvBF9+Isd16oE0xuA5xwlGcFHbRfUFSON5EP2Lv8Eg==", "dependencies": { - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-json": "^0.2.1" + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-json": "^1.2.1" } }, + "node_modules/@subsquid/scale-type-system": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/scale-type-system/-/scale-type-system-1.0.1.tgz", + "integrity": "sha512-CjY5nBzGrbRcOH//lOwNHbBjHtHD0t27SirdIAFre/Mp4fLIiv6gEkIgNYu+lwAjMvuFkLkcw7JGmwXvLNepNw==", + "peer": true, + "dependencies": { + "@subsquid/util-internal": "^2.5.2" + }, + "peerDependencies": { + "@subsquid/scale-codec": "^4.0.0" + } + }, + "node_modules/@subsquid/scale-type-system/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "peer": true + }, "node_modules/@subsquid/ss58": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@subsquid/ss58/-/ss58-0.1.4.tgz", - "integrity": "sha512-YM7Wt+upN8M5IZ9tr+yxHafBOWCcvJzXz4rlC62SM7VCP++ErqbBtui03yROussGTSAjBObXgzVljYypG0kawQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/ss58/-/ss58-2.0.1.tgz", + "integrity": "sha512-VmVgR6E8cwpYiQtL+ZbdW0RCguNmwunbX4JYI08vHErxWdLhX4o6v9LClq3L9+5LcKgspzOci9DNt0xzR1keYQ==", "dependencies": { - "@subsquid/ss58-codec": "^0.1.2" + "@subsquid/ss58-codec": "^1.2.2", + "@subsquid/util-internal-hex": "^1.2.1" } }, "node_modules/@subsquid/ss58-codec": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@subsquid/ss58-codec/-/ss58-codec-0.1.2.tgz", - "integrity": "sha512-fyTFjx60m0j4aNJMocNaJBptc/TWh9BCb33gtVPfcPV6gVIPhH37rbHaXz3+9NlnsLAiOuxrzDfbKOcxws/ZdA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@subsquid/ss58-codec/-/ss58-codec-1.2.2.tgz", + "integrity": "sha512-hNYKWqfKd92l2xFSgSiSfK6dHLE/hwWWJ6FIlZ3mS/tgUsEUqTHJabqZ1p+pt0US9P8h+J4Dd58eujPI03peqA==", "dependencies": { "base-x": "^4.0.0", "blake2b": "^2.1.4" } }, - "node_modules/@subsquid/substrate-metadata": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@subsquid/substrate-metadata/-/substrate-metadata-2.2.2.tgz", - "integrity": "sha512-kAikmeXIxyhgf/qdgW4zyPpPXlmGaV1jOddOkx5XHJzxPx/VDyFYd+HJ62cSRRBUv9guPCQbCKT0h6poVFh8ow==", + "node_modules/@subsquid/substrate-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-data/-/substrate-data-3.0.1.tgz", + "integrity": "sha512-zmZGtwYwNi50siU5k0r8YRXlJPNsls1E6y1N+Yv7driNdsolKhXdcHKLoRIaiXRlV/QGkuSh/vNaLxebxiL1TQ==", + "dependencies": { + "@subsquid/scale-codec": "^4.0.0", + "@subsquid/substrate-data-raw": "^0.1.0", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-ingest-tools": "^0.0.2", + "@subsquid/util-internal-range": "^0.0.1", + "@subsquid/util-xxhash": "^1.2.1", + "@substrate/calc": "^0.2.8", + "blake2b": "^2.1.4" + }, + "peerDependencies": { + "@subsquid/rpc-client": "^4.4.2", + "@subsquid/substrate-runtime": "^1.0.1" + } + }, + "node_modules/@subsquid/substrate-data-raw": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-data-raw/-/substrate-data-raw-0.1.0.tgz", + "integrity": "sha512-0540hjZzUgeVjqy7UqKcTPKBsun2eisv9JR0ks3WDHPLabyWy4TolbE1WWqCo4B8wBmLEm5+vTL/BtM/AkHrYg==", "dependencies": { - "@subsquid/scale-codec": "^1.1.1", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-naming": "^0.0.2" + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-ingest-tools": "^0.0.2", + "@subsquid/util-internal-range": "^0.0.1" + }, + "peerDependencies": { + "@subsquid/rpc-client": "^4.4.2" } }, + "node_modules/@subsquid/substrate-data-raw/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "node_modules/@subsquid/substrate-data/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, "node_modules/@subsquid/substrate-metadata-explorer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@subsquid/substrate-metadata-explorer/-/substrate-metadata-explorer-1.1.2.tgz", - "integrity": "sha512-HE8g4PeDTGAXYBCbao7DayHkKzR+h0e7ocsJoEqKaNFO22Brnv9RVkcoUjswcWDWmXQyekS0hQI4O2JgYHy6cA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-metadata-explorer/-/substrate-metadata-explorer-3.1.1.tgz", + "integrity": "sha512-GzlgUMEIcJvtiEYXxPqC6onncbmPKoBdINuyQSNmU7hVVOn5MEJhXAj2kzOnTztCGhM8GnBDebmLf/f7RndgiQ==", "dev": true, "dependencies": { - "@subsquid/logger": "^0.3.1", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-commander": "^0.0.2", - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-http-client": "^0.1.0", - "@subsquid/util-internal-read-lines": "^0.0.2", - "@subsquid/util-internal-resilient-rpc": "^0.0.3", - "commander": "^10.0.0" + "@subsquid/logger": "^1.3.1", + "@subsquid/rpc-client": "^4.4.2", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-commander": "^1.3.1", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-read-lines": "^1.2.1", + "commander": "^11.0.0" }, "bin": { - "squid-substrate-metadata-explorer": "bin/run.js" + "squid-substrate-metadata-explorer": "bin/run.js", + "substrate-metadata-explorer": "bin/run.js" + } + }, + "node_modules/@subsquid/substrate-metadata-explorer/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "dev": true + }, + "node_modules/@subsquid/substrate-metadata-explorer/node_modules/@subsquid/util-internal-commander": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.1.tgz", + "integrity": "sha512-KeGsOghBU20tM1BzqryOf3MKvrDFSfPuhnl9LhhEC00ysp8rRPyejlw6jIJhO2NRJ+oaUi5jHRdf64/o21N7Lw==", + "dev": true, + "peerDependencies": { + "commander": "^11.0.0" + } + }, + "node_modules/@subsquid/substrate-metadata-explorer/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" } }, "node_modules/@subsquid/substrate-processor": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@subsquid/substrate-processor/-/substrate-processor-2.4.1.tgz", - "integrity": "sha512-vFHDbiovCC/BDb03ui55M5Cf638Qcb9YZVKDs2xTltFMpT9lQM1Rs+bpaCne3AqAS5SY03A/PUKNu4jxl8fXTQ==", - "dependencies": { - "@subsquid/logger": "^0.3.1", - "@subsquid/scale-codec": "^1.1.1", - "@subsquid/substrate-metadata": "^2.2.2", - "@subsquid/typeorm-config": "^2.0.2", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-binary-heap": "^0.0.0", - "@subsquid/util-internal-code-printer": "^0.1.1", - "@subsquid/util-internal-counters": "^0.0.2", - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-http-client": "^0.1.0", - "@subsquid/util-internal-prometheus-server": "^0.0.3", - "@subsquid/util-internal-resilient-rpc": "^0.0.3", - "@subsquid/util-xxhash": "^0.1.2", - "blake2b": "^2.1.4", - "prom-client": "^14.1.1" + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-processor/-/substrate-processor-7.2.1.tgz", + "integrity": "sha512-9T/wQIaDt4HfkioFQ8nGMc+/N/mEskiYFhQdvT0FYwdKxr3qbyvsbT2qoZfDS/i9J/d2y/39YKrtCMBKOwf65w==", + "dependencies": { + "@subsquid/http-client": "^1.3.1", + "@subsquid/logger": "^1.3.1", + "@subsquid/rpc-client": "^4.4.2", + "@subsquid/substrate-data": "^3.0.1", + "@subsquid/substrate-data-raw": "^0.1.0", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-archive-client": "^0.0.1", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-json": "^1.2.1", + "@subsquid/util-internal-processor-tools": "^3.1.0" + }, + "peerDependencies": { + "@subsquid/substrate-runtime": "^1.0.1" + } + }, + "node_modules/@subsquid/substrate-processor/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "node_modules/@subsquid/substrate-processor/node_modules/@subsquid/util-internal-archive-client": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-archive-client/-/util-internal-archive-client-0.0.1.tgz", + "integrity": "sha512-Sr+m1vxAArPIdsjyKVOpjU57JlVujBpI8NEeHqeA6twSb40wasOLAeq775WyYFynucltNRSgIiwXBIo0t02D6g==", + "dependencies": { + "@subsquid/http-client": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-range": "^0.0.1" }, "peerDependencies": { - "@subsquid/typeorm-store": "^0.2.2" + "@subsquid/logger": "^1.3.1" }, "peerDependenciesMeta": { - "@subsquid/typeorm-store": { + "@subsquid/logger": { "optional": true } } }, + "node_modules/@subsquid/substrate-runtime": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-runtime/-/substrate-runtime-1.0.1.tgz", + "integrity": "sha512-L7ln2EaIfl99uAbkz3Nw6oIXdpj2yfBk5qUyOJ/nOm5WHGBE3NKw0nIfgnC6EbbsNJKZZfJT0Tm+eRZZlUakug==", + "peer": true, + "dependencies": { + "@subsquid/scale-codec": "^4.0.0", + "@subsquid/scale-type-system": "^1.0.0", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-naming": "^1.2.1", + "@subsquid/util-xxhash": "^1.2.1", + "blake2b": "^2.1.4" + } + }, + "node_modules/@subsquid/substrate-runtime/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "peer": true + }, "node_modules/@subsquid/substrate-typegen": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/substrate-typegen/-/substrate-typegen-2.2.1.tgz", - "integrity": "sha512-kRV5aA4w6jUfiWdcRKUW/zjgtWLMKlai02AwN8BdW1T+6pOk0jI9PFvTbiGWjmqAjTHxCHOuNvhmvzNApl20gg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-typegen/-/substrate-typegen-8.0.1.tgz", + "integrity": "sha512-/Mx6ITDbVVjgPuhW3/JUvEDzN01hrz0lSmjTzX46L2JGamPeCxZfX/HdbwDUb0Ns7zn+Q3e1JOtQoRkC6MVEhA==", "dev": true, "dependencies": { - "@subsquid/logger": "^0.3.1", - "@subsquid/scale-codec": "^1.1.1", - "@subsquid/substrate-metadata": "^2.2.2", - "@subsquid/substrate-metadata-explorer": "^1.1.0", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-code-printer": "^0.1.1", - "@subsquid/util-internal-config": "^1.0.1", - "@subsquid/util-internal-read-lines": "^0.0.2", - "@subsquid/util-naming": "^0.0.2", - "commander": "^10.0.0" + "@subsquid/http-client": "^1.3.1", + "@subsquid/logger": "^1.3.1", + "@subsquid/substrate-metadata-explorer": "^3.1.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-code-printer": "^1.2.1", + "@subsquid/util-internal-config": "^2.2.1", + "@subsquid/util-internal-read-lines": "^1.2.1", + "@subsquid/util-naming": "^1.2.1", + "commander": "^11.0.0" }, "bin": { "squid-substrate-typegen": "bin/run.js" + }, + "peerDependencies": { + "@subsquid/substrate-runtime": "^1.0.0" + } + }, + "node_modules/@subsquid/substrate-typegen/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "dev": true + }, + "node_modules/@subsquid/substrate-typegen/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" } }, "node_modules/@subsquid/typeorm-codegen": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-codegen/-/typeorm-codegen-0.3.3.tgz", - "integrity": "sha512-wKUZjAOp7RaD5lZB5q544vGrRtRbLWn9mf0bCjrLN0DrwlT+lQwZV1BV0JRrStSJreaqyz7rWYWwkAUABn6fGA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-codegen/-/typeorm-codegen-1.3.2.tgz", + "integrity": "sha512-jSDrMjcCa1NiEQICFXHyYENEnjJxmFd2vmyiSXm+CTyqQRMJutqLcZFHx38CHwz15kyCxKK8whDYQglmLvx0cQ==", "dev": true, "dependencies": { - "@subsquid/openreader": "^3.1.7", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-code-printer": "^0.1.1", - "@subsquid/util-naming": "^0.0.2", - "commander": "^10.0.0" + "@subsquid/openreader": "^4.4.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-code-printer": "^1.2.1", + "@subsquid/util-naming": "^1.2.1", + "commander": "^11.0.0" }, "bin": { "squid-typeorm-codegen": "bin/run.js" } }, - "node_modules/@subsquid/typeorm-config": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-2.0.2.tgz", - "integrity": "sha512-LoyWzhFeNSI9fXnhgYF4MizyGuiBVB7t3je9TFsOTCnOTYSIcDKJJkmCDzobDlA8PgkJ5bFLFilxIFKsVFqt4w==", - "dependencies": { - "@subsquid/util-naming": "^0.0.2" - }, - "peerDependencies": { - "typeorm": "^0.3.11" - }, - "peerDependenciesMeta": { - "typeorm": { - "optional": true - } + "node_modules/@subsquid/typeorm-codegen/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "dev": true + }, + "node_modules/@subsquid/typeorm-codegen/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" } }, "node_modules/@subsquid/typeorm-migration": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-migration/-/typeorm-migration-0.1.6.tgz", - "integrity": "sha512-4J4VDJ96zf5b1qF7faHfcaK4x8oNmVXACJwzv/JidloNqt9TUkdkEnlXIpIw1oxijtzWByncnAW9jHU+gcO59Q==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-migration/-/typeorm-migration-1.2.2.tgz", + "integrity": "sha512-G22Eh7AuPHjLB7C30XNT+fVe2bGYmYI2EB/8Sf5kYfS0yCKvev2YWJNcvkyD6eswv8HgrekwEoj3BKjR5wH6yg==", "dependencies": { - "@subsquid/typeorm-config": "^2.0.2", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-code-printer": "^0.1.1", - "commander": "^10.0.0", - "dotenv": "^16.0.3" + "@subsquid/typeorm-config": "^3.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-code-printer": "^1.2.1", + "commander": "^11.0.0", + "dotenv": "^16.3.1" }, "bin": { "squid-typeorm-migration": "bin/squid-typeorm-migration", @@ -1011,164 +1797,213 @@ "squid-typeorm-migration-revert": "bin/squid-typeorm-migration-revert" }, "peerDependencies": { - "typeorm": "^0.3.11" + "typeorm": "^0.3.17" + } + }, + "node_modules/@subsquid/typeorm-migration/node_modules/@subsquid/typeorm-config": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-3.3.1.tgz", + "integrity": "sha512-d8n+GHAr05A1cQXBr+kbaU0WeSD7oQk+t7KwkGbC9hh80tkYiweKzQwS4+fJcJCbrpZe+B6mV8WY5eVR9ebZMw==", + "dependencies": { + "@subsquid/util-naming": "^1.2.1" + }, + "peerDependencies": { + "typeorm": "^0.3.17" + }, + "peerDependenciesMeta": { + "typeorm": { + "optional": true + } + } + }, + "node_modules/@subsquid/typeorm-migration/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "node_modules/@subsquid/typeorm-migration/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@subsquid/typeorm-store": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-store/-/typeorm-store-1.2.4.tgz", + "integrity": "sha512-fcHp9cHEe1T1tVjV125CLbNjs/NIQKFW8bdK/stDn9prxuuwfiAGKvpztU52dKVuyQCUFL+8YTtFt2y1i7ZEBA==", + "dependencies": { + "@subsquid/typeorm-config": "^3.3.1", + "@subsquid/util-internal": "^2.5.2" + }, + "peerDependencies": { + "typeorm": "^0.3.17" } }, - "node_modules/@subsquid/typeorm-store": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-store/-/typeorm-store-0.2.2.tgz", - "integrity": "sha512-mzqiJCPFT/KBuwNuNAK8D3Wmf5Hws27wvYWw/bXAAT47rxAERz3oLMsAs/dSjXT30F63kMcQfJzvp5FOsa3Ohw==", + "node_modules/@subsquid/typeorm-store/node_modules/@subsquid/typeorm-config": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-3.3.1.tgz", + "integrity": "sha512-d8n+GHAr05A1cQXBr+kbaU0WeSD7oQk+t7KwkGbC9hh80tkYiweKzQwS4+fJcJCbrpZe+B6mV8WY5eVR9ebZMw==", "dependencies": { - "@subsquid/typeorm-config": "^2.0.2", - "@subsquid/util-internal": "^1.1.0" + "@subsquid/util-naming": "^1.2.1" }, "peerDependencies": { - "typeorm": "^0.3.11" + "typeorm": "^0.3.17" + }, + "peerDependenciesMeta": { + "typeorm": { + "optional": true + } } }, + "node_modules/@subsquid/typeorm-store/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, "node_modules/@subsquid/util-internal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-1.1.0.tgz", "integrity": "sha512-O6m666RDcWEw4vb3bmeNZKlAa1rGOHQvS0nhZFTBXnxZpqK/pU5N0jrQ7X/3is0pY2RKxFoxTurZjhv4QdxtqA==" }, "node_modules/@subsquid/util-internal-binary-heap": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-binary-heap/-/util-internal-binary-heap-0.0.0.tgz", - "integrity": "sha512-eVtdf442+L10G4lgSHCcxgNzYEcrdZ3WKy7Y7CGkhKLJhKuOlgDtEwklZmh1/lM+37AQn9XnX/VpxTaJ2vA2sg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-binary-heap/-/util-internal-binary-heap-1.0.0.tgz", + "integrity": "sha512-88auuc8yNFmCZugmJSTYzS7WM/nN2obKGQCgrl8Jty5rJUFbqazGSi8icqftKhv6MPtUMJ3PSTRLiTFXAUGnAA==" }, "node_modules/@subsquid/util-internal-code-printer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-code-printer/-/util-internal-code-printer-0.1.1.tgz", - "integrity": "sha512-367YmYeLoLaOiBdlrYElEC4AeM4Kx0XYWM9mA9VBllGvT9qWNnGllaJ+mY9UBhlhWQtCbUnTRtHXhjR5qL8g1w==" - }, - "node_modules/@subsquid/util-internal-commander": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-0.0.2.tgz", - "integrity": "sha512-midCpkwu7NaXGhr0MiyQsJlIj284/0mAFBvVG8gRHqqRqb71GIAQq+aRcUSv8KNnAiRWnXK1OPak+gc40V9btw==", - "peerDependencies": { - "commander": "^10.0.0" - } + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-code-printer/-/util-internal-code-printer-1.2.1.tgz", + "integrity": "sha512-9l0kCm50hQfRjzplIZs9kHooqxczG82fzAexlD6x1SjdLDU1NfYA0uGxgE6pweKydgd7LCb9ICc5gfDvbWtdaw==" }, "node_modules/@subsquid/util-internal-config": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-config/-/util-internal-config-1.0.1.tgz", - "integrity": "sha512-F5jr3OWerUQ+dn0ecCtcizdZunlFN6wXy50SmfLY+x8f8ggXsk3Z2waIxJjOAB4GnuNYyvvQREM7pusjCyN2RQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-config/-/util-internal-config-2.2.1.tgz", + "integrity": "sha512-yOyIzn5Gx4aawtOEkY/Bxvo57WBqU/vRvpG/nsyFWOEEC/opmxH5Tl3hDPdoeF+/+AN6a9AEprGAMK2Wesj8LQ==", "dev": true, "dependencies": { - "@exodus/schemasafe": "^1.0.0-rc.9", + "@exodus/schemasafe": "^1.3.0", "jsonc-parser": "^3.2.0" } }, "node_modules/@subsquid/util-internal-counters": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-counters/-/util-internal-counters-0.0.2.tgz", - "integrity": "sha512-x/O+56bR/X41ZEKjxZy0IqiapKCN9gGJB7G8md+idvGeC15kw8r5pg2Ck9tulB07VQEOqWLNNuvobrfvH0hNkg==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-counters/-/util-internal-counters-1.3.1.tgz", + "integrity": "sha512-bc22t8lEvoCBn31F+B763E81+ZDaL7ufpwr0VLXZzcA5wZ6NEqqRfs4bJtPeBNGEjyeLLrItXWxfjSkR7sGKAg==" }, "node_modules/@subsquid/util-internal-hex": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-hex/-/util-internal-hex-0.0.2.tgz", - "integrity": "sha512-EgqYmZjJ6ox885tXBObEAZQZImpRc5pFzQeOLEh78gGPTc39IH3VI4BG0zaomStvgBx+e25M7Y2cc+ae+ttuXQ==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-hex/-/util-internal-hex-1.2.1.tgz", + "integrity": "sha512-R7TYDsftjguapzWia97WGvcF4s65VKArzSga5i1i4aZSq9Z330kPYpgAUkqDGsJqD/Ki3PTE4cXhuKLRyMHPvg==" }, - "node_modules/@subsquid/util-internal-http-client": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-http-client/-/util-internal-http-client-0.1.0.tgz", - "integrity": "sha512-LOSOX1Yv4t/NA/90qrmmCArOYTntxWV4dcnTXadKXQiM9gPnVNGLCa+Z17HYjBrvZFHDdYglV2F9kOikOqDd/Q==", + "node_modules/@subsquid/util-internal-http-server": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-http-server/-/util-internal-http-server-1.2.1.tgz", + "integrity": "sha512-aQIodM3xWDu8wxllOONU5Fy6hmYYAZzS2PglC2FfdUi6HUxaZ8aCUkjFisG56tglhsoAh/TQSQX1YhCX00MCcg==", "dependencies": { - "@subsquid/logger": "^0.3.1", - "@subsquid/util-internal": "^1.1.0", - "node-fetch": "^3.3.0" + "stoppable": "^1.1.0" } }, - "node_modules/@subsquid/util-internal-http-client/node_modules/node-fetch": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.0.tgz", - "integrity": "sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==", + "node_modules/@subsquid/util-internal-ingest-tools": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-ingest-tools/-/util-internal-ingest-tools-0.0.2.tgz", + "integrity": "sha512-Nx5LDWq9B1sVAXg6qDI0zVmzfwP1Mk5Rrn79OJc4eKLvZTrTIk2vyM5SB4n1kwQk6KRuQYI9dfiNWdcm+9rGfA==", "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-range": "^0.0.1" } }, - "node_modules/@subsquid/util-internal-http-server": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-http-server/-/util-internal-http-server-0.1.1.tgz", - "integrity": "sha512-Vi7hSBSty5qOvrANNsxCtHASpdhRqmJsrp+hVnQ3PhcrZkGRrcu0O7jkVAZfhptzxMZeQ5r/NXDTt4b/qNSvJg==", + "node_modules/@subsquid/util-internal-ingest-tools/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "node_modules/@subsquid/util-internal-json": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-json/-/util-internal-json-1.2.1.tgz", + "integrity": "sha512-Jtbhur/QaRk727fiZ/w8so0M0o4BIkfvnT6zBnC3s1mQ9fKve0Q6aj22gbimpX7Whj6tAGF0Bz8LFhbAethbkA==", "dependencies": { - "stoppable": "^1.1.0" + "@subsquid/util-internal-hex": "^1.2.1" } }, - "node_modules/@subsquid/util-internal-json": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-json/-/util-internal-json-0.2.1.tgz", - "integrity": "sha512-X9bhhKWBcaeZekGEiE15i8xwfq07/aIYDhA+JFdiVT3aygdb9b57V85USuArd6oh3jjHeQ2SBgj6B5rd8m8vlA==", + "node_modules/@subsquid/util-internal-processor-tools": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-3.1.0.tgz", + "integrity": "sha512-uEa8Bw/xvSfiagbK8IFt1OEgR7hacfblPZXH5EV4cAIKoIVOonhnkJEPRWqI3ZaDHl+8Z9p909tlsEd46sXenw==", "dependencies": { - "@subsquid/util-internal-hex": "^0.0.2" + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-counters": "^1.3.1", + "@subsquid/util-internal-prometheus-server": "^1.2.1", + "@subsquid/util-internal-range": "^0.0.1", + "prom-client": "^14.2.0" } }, + "node_modules/@subsquid/util-internal-processor-tools/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, "node_modules/@subsquid/util-internal-prometheus-server": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-prometheus-server/-/util-internal-prometheus-server-0.0.3.tgz", - "integrity": "sha512-Hb40h47V6tnBcCoZYeXERUUlDcrJMajcwhXf4vBpuq6wJMXhBaYwOpP+sr7v0x3wvHfuh1639BRxxbKBVcuOfw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-prometheus-server/-/util-internal-prometheus-server-1.2.1.tgz", + "integrity": "sha512-GhbsEmv0xAkaBaxwZGRavMIO0h68V6LctZIvxsrrPr695bI1mrXKSYDvVvUwLXQ3aDPy9PIQiKdbSjNa60JW6Q==", "dependencies": { - "@subsquid/util-internal-http-server": "^0.1.1" + "@subsquid/util-internal-http-server": "^1.2.1" }, "peerDependencies": { - "prom-client": "^14.1.1" + "prom-client": "^14.2.0" } }, - "node_modules/@subsquid/util-internal-read-lines": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-read-lines/-/util-internal-read-lines-0.0.2.tgz", - "integrity": "sha512-XniSw0MTQXJVAB3pl3ZBylFeFGdPMEwLdWUfOePQYsCH13Y7nat2fJ5W4tK78yJ456UsuB+mw8qS2EuAfcOvfw==", - "dev": true - }, - "node_modules/@subsquid/util-internal-resilient-rpc": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-resilient-rpc/-/util-internal-resilient-rpc-0.0.3.tgz", - "integrity": "sha512-HExQgeQFHEk7HfnjXZZApHtRF2mAsnu90E7hoWTrVnDzsvMTvtX9tPMjQXKXFoyDDb+WQcVs0yqnzl6rhQY2Iw==", + "node_modules/@subsquid/util-internal-range": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-range/-/util-internal-range-0.0.1.tgz", + "integrity": "sha512-9hqlPdTJeR9j9+1L3ymOPC0/qJ2IemGkrHmkTq+gwkjtGKmiXuXw4WLgt0Ps5aeupWKfP7UFy1hDE9DZQFseog==", "dependencies": { - "@subsquid/logger": "^0.3.1", - "@subsquid/rpc-client": "^2.0.0", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-counters": "^0.0.2", - "@subsquid/util-internal-http-client": "^0.1.0", - "@subsquid/util-timeout": "^1.0.0" + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-binary-heap": "^1.0.0" } }, + "node_modules/@subsquid/util-internal-range/node_modules/@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "node_modules/@subsquid/util-internal-read-lines": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-read-lines/-/util-internal-read-lines-1.2.1.tgz", + "integrity": "sha512-Fh7lGlIwFr88pJ39UdkDeQ2z8JEDk13OuoHJHTmgLtThI4kvmDSpVgMdIUUh9nrzFrP/rzlDsvjACTw4D/mTHw==", + "dev": true + }, "node_modules/@subsquid/util-naming": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-naming/-/util-naming-0.0.2.tgz", - "integrity": "sha512-t23kWD5kdRi03HXAhMSO1SesmM6dyD8kmMKfBR5SoFScij0Z2zf4dZ/jQT0bH9V59r4eZvv+NxR5XC+uR8GBAQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-naming/-/util-naming-1.2.1.tgz", + "integrity": "sha512-l5rvAXG7TxMPeB5kFTTZWisgN0DNe1mVBHT2V2/nxUx4sOfYfneWIN/+02YqJI/GHX9FoOTB6ru7WLfQEMhvhg==", "dependencies": { "camelcase": "^6.3.0", "inflected": "^2.1.0" } }, - "node_modules/@subsquid/util-timeout": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-timeout/-/util-timeout-1.0.0.tgz", - "integrity": "sha512-6LiXYuRKIFcuUOsHPL3qN+cYDZJiCPGQFDdBECrZvXM/FtjF6dloX9JS4LJ7lMHsnKsu7v78+ioiUYpk1Jlyug==" - }, "node_modules/@subsquid/util-xxhash": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-xxhash/-/util-xxhash-0.1.2.tgz", - "integrity": "sha512-UQ1opUT0vP2wwCYblM5TvDtvKvPy3LLRI4vVlLPXDelroTa5zkWL3LNTC+Niw4Mvac0u3gpqNDknVdKlKrVvhw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-xxhash/-/util-xxhash-1.2.1.tgz", + "integrity": "sha512-wobgbKK0fd+3ufUVjxcx4zaYII9JY7hbIStyO9M9Q5xrdihiWM5APX27sRuoO8X8oSj34v44JpIMxC8Rbpy3xQ==", "dependencies": { "xxhash-wasm": "^1.0.2", "xxhashjs": "^0.2.2" } }, + "node_modules/@substrate/calc": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@substrate/calc/-/calc-0.2.8.tgz", + "integrity": "sha512-1c3mxf35FBeOswduhy0Wil9s4exHahXFo974qa0Ci2AORX8JTxmwhBb10+3Ls9iWoTFwvgOaFr9v1HeRL5tCig==" + }, "node_modules/@types/accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==", "dependencies": { "@types/node": "*" } @@ -1183,9 +2018,9 @@ } }, "node_modules/@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "dependencies": { "@types/node": "*" } @@ -1195,6 +2030,12 @@ "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, "node_modules/@types/express": { "version": "4.17.14", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", @@ -1225,6 +2066,11 @@ "@types/node": "*" } }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" + }, "node_modules/@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -1249,9 +2095,9 @@ "dev": true }, "node_modules/@types/mime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.4.tgz", + "integrity": "sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw==" }, "node_modules/@types/minimatch": { "version": "5.1.2", @@ -1270,25 +2116,82 @@ "dev": true }, "node_modules/@types/pg": { - "version": "8.6.6", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.6.tgz", - "integrity": "sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.11.2.tgz", + "integrity": "sha512-G2Mjygf2jFMU/9hCaTYxJrwdObdcnuQde1gndooZSOHsNSaCehAuwc7EIuSA34Do8Jx2yZ19KtvW8P0j4EuUXw==", "dev": true, "dependencies": { "@types/node": "*", "pg-protocol": "*", - "pg-types": "^2.2.0" + "pg-types": "^4.0.1" + } + }, + "node_modules/@types/pg/node_modules/pg-types": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.2.tgz", + "integrity": "sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==", + "dev": true, + "dependencies": { + "pg-int8": "1.0.1", + "pg-numeric": "1.0.2", + "postgres-array": "~3.0.1", + "postgres-bytea": "~3.0.0", + "postgres-date": "~2.1.0", + "postgres-interval": "^3.0.0", + "postgres-range": "^1.1.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@types/pg/node_modules/postgres-array": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz", + "integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@types/pg/node_modules/postgres-bytea": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz", + "integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==", + "dev": true, + "dependencies": { + "obuf": "~1.1.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/pg/node_modules/postgres-date": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.1.0.tgz", + "integrity": "sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@types/pg/node_modules/postgres-interval": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz", + "integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==", + "dev": true, + "engines": { + "node": ">=12" } }, "node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + "version": "6.9.10", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==" }, "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "node_modules/@types/semver": { "version": "7.3.13", @@ -1296,10 +2199,11 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==" }, "node_modules/@types/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", "dependencies": { + "@types/http-errors": "*", "@types/mime": "*", "@types/node": "*" } @@ -1612,6 +2516,102 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@vitest/expect": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", + "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", + "dev": true, + "dependencies": { + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", + "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.3.1", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner/node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/runner/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/snapshot": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", + "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", + "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", + "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -1625,9 +2625,9 @@ } }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1645,6 +2645,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1692,7 +2701,7 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-3.3.2.tgz", "integrity": "sha512-L5TiS8E2Hn/Yz7SSnWIVbZw0ZfEIXZCa5VUiVxD9P53JvSrf4aStvsFDlGWPvpIdCR+aly2CfoB79B9/JjKFqg==", - "deprecated": "The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "deprecated": "The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", "apollo-server-env": "^4.2.1" @@ -1702,10 +2711,10 @@ } }, "node_modules/apollo-reporting-protobuf": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-3.3.3.tgz", - "integrity": "sha512-L3+DdClhLMaRZWVmMbBcwl4Ic77CnEBPXLW53F7hkYhkaZD88ivbCVB1w/x5gunO6ZHrdzhjq0FHmTsBvPo7aQ==", - "deprecated": "The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-3.4.0.tgz", + "integrity": "sha512-h0u3EbC/9RpihWOmcSsvTW2O6RXVaD/mPEjfrPkxRPTEPWqncsgOoRJw+wih4OqfH3PvTJvoEIf4LwKrUaqWog==", + "deprecated": "The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { "@apollo/protobufjs": "1.2.6" } @@ -1741,10 +2750,9 @@ "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" }, "node_modules/apollo-server-core": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.11.1.tgz", - "integrity": "sha512-t/eCKrRFK1lYZlc5pHD99iG7Np7CEm3SmbDiONA7fckR3EaB/pdsEdIkIwQ5QBBpT5JLp/nwvrZRVwhaWmaRvw==", - "deprecated": "The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.13.0.tgz", + "integrity": "sha512-v/g6DR6KuHn9DYSdtQijz8dLOkP78I5JSVJzPkARhDbhpH74QNwrQ2PP2URAPPEDJ2EeZNQDX8PvbYkAKqg+kg==", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", "@apollo/utils.logger": "^1.0.0", @@ -1755,11 +2763,11 @@ "@graphql-tools/schema": "^8.0.0", "@josephg/resolvable": "^1.0.0", "apollo-datasource": "^3.3.2", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1", "apollo-server-errors": "^3.3.1", - "apollo-server-plugin-base": "^3.7.1", - "apollo-server-types": "^3.7.1", + "apollo-server-plugin-base": "^3.7.2", + "apollo-server-types": "^3.8.0", "async-retry": "^1.2.1", "fast-json-stable-stringify": "^2.1.0", "graphql-tag": "^2.11.0", @@ -1777,6 +2785,43 @@ "graphql": "^15.3.0 || ^16.0.0" } }, + "node_modules/apollo-server-core/node_modules/@graphql-tools/merge": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz", + "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==", + "dependencies": { + "@graphql-tools/utils": "8.9.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/apollo-server-core/node_modules/@graphql-tools/schema": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz", + "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==", + "dependencies": { + "@graphql-tools/merge": "8.3.1", + "@graphql-tools/utils": "8.9.0", + "tslib": "^2.4.0", + "value-or-promise": "1.0.11" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/apollo-server-core/node_modules/@graphql-tools/utils": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz", + "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==", + "dependencies": { + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, "node_modules/apollo-server-core/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1788,10 +2833,13 @@ "node": ">=10" } }, - "node_modules/apollo-server-core/node_modules/node-abort-controller": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", - "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==" + "node_modules/apollo-server-core/node_modules/value-or-promise": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.11.tgz", + "integrity": "sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==", + "engines": { + "node": ">=12" + } }, "node_modules/apollo-server-env": { "version": "4.2.1", @@ -1809,7 +2857,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-3.3.1.tgz", "integrity": "sha512-xnZJ5QWs6FixHICXHxUfm+ZWqqxrNuPlQ+kj5m6RtEgIpekOPssH/SD9gf2B4HuWV0QozorrygwZnux8POvyPA==", - "deprecated": "The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "deprecated": "The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "engines": { "node": ">=12.0" }, @@ -1818,10 +2866,9 @@ } }, "node_modules/apollo-server-express": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.11.1.tgz", - "integrity": "sha512-x9ngcpXbBlt4naCXTwNtBFb/mOd9OU0wtFXvJkObHF26NsRazu3DxDfEuekA6V1NFOocD+A9jmVMQeQWug5MgA==", - "deprecated": "The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.13.0.tgz", + "integrity": "sha512-iSxICNbDUyebOuM8EKb3xOrpIwOQgKxGbR2diSr4HP3IW8T3njKFOoMce50vr+moOCe1ev8BnLcw9SNbuUtf7g==", "dependencies": { "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.2", @@ -1829,8 +2876,8 @@ "@types/express": "4.17.14", "@types/express-serve-static-core": "4.17.31", "accepts": "^1.3.5", - "apollo-server-core": "^3.11.1", - "apollo-server-types": "^3.7.1", + "apollo-server-core": "^3.13.0", + "apollo-server-types": "^3.8.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "parseurl": "^1.3.3" @@ -1844,12 +2891,12 @@ } }, "node_modules/apollo-server-plugin-base": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-3.7.1.tgz", - "integrity": "sha512-g3vJStmQtQvjGI289UkLMfThmOEOddpVgHLHT2bNj0sCD/bbisj4xKbBHETqaURokteqSWyyd4RDTUe0wAUDNQ==", - "deprecated": "The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-3.7.2.tgz", + "integrity": "sha512-wE8dwGDvBOGehSsPTRZ8P/33Jan6/PmL0y0aN/1Z5a5GcbFhDaaJCjK5cav6npbbGL2DPKK0r6MPXi3k3N45aw==", + "deprecated": "The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { - "apollo-server-types": "^3.7.1" + "apollo-server-types": "^3.8.0" }, "engines": { "node": ">=12.0" @@ -1876,14 +2923,14 @@ } }, "node_modules/apollo-server-types": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-3.7.1.tgz", - "integrity": "sha512-aE9RDVplmkaOj/OduNmGa+0a1B5RIWI0o3zC1zLvBTVWMKTpo0ifVf11TyMkLCY+T7cnZqVqwyShziOyC3FyUw==", - "deprecated": "The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-3.8.0.tgz", + "integrity": "sha512-ZI/8rTE4ww8BHktsVpb91Sdq7Cb71rdSkXELSwdSR0eXu600/sY+1UXhTWdiJvk+Eq5ljqoHLwLbY2+Clq2b9A==", + "deprecated": "The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", "@apollo/utils.logger": "^1.0.0", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1" }, "engines": { @@ -1911,7 +2958,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "is-array-buffer": "^3.0.1" @@ -1989,6 +3035,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", @@ -2009,9 +3064,9 @@ } }, "node_modules/b4a": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.0.tgz", - "integrity": "sha512-fsTxXxj1081Yq5MOQ06gZ5+e2QcSyP2U6NofdOWyq+lrNI4IjkZ+fLVmoQ6uUCiNg1NWePMMVq93vOTdbJmErw==" + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==" }, "node_modules/balanced-match": { "version": "1.0.2", @@ -2141,9 +3196,9 @@ } }, "node_modules/bufferutil": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", - "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", + "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", "hasInstallScript": true, "dependencies": { "node-gyp-build": "^4.3.0" @@ -2181,13 +3236,23 @@ "node": ">= 0.8" } }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2213,6 +3278,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2247,6 +3330,18 @@ "node": "*" } }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, "node_modules/ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -2449,7 +3544,18 @@ "vary": "^1" }, "engines": { - "node": ">= 0.10" + "node": ">= 0.10" + } + }, + "node_modules/cross-inspect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cross-inspect/-/cross-inspect-1.0.0.tgz", + "integrity": "sha512-4PFfn4b5ZN6FMNGSZlyb7wUhuN8wvj8t/VQHZdM4JsDcruGJ8L2kf9zao98QIrBPFCpdk27qst/AGTl7pL3ypQ==", + "dependencies": { + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.0.0" } }, "node_modules/cross-spawn": { @@ -2506,6 +3612,21 @@ "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-2.1.0.tgz", "integrity": "sha512-qTcEYLen3r7ojZNgVUaRggOI+KM7jrKxXeSHhogh/TWxYMeONEMqY+hmkobiYQozsGIyg9OYVzO4ZIfoB4I0pQ==" }, + "node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -2514,16 +3635,29 @@ "ms": "2.0.0" } }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/deep-equal": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.0.tgz", - "integrity": "sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", "dependencies": { - "call-bind": "^1.0.2", - "es-get-iterator": "^1.1.2", - "get-intrinsic": "^1.1.3", + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.5", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.2", "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.1", + "is-array-buffer": "^3.0.2", "is-date-object": "^1.0.5", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", @@ -2531,11 +3665,14 @@ "object-is": "^1.1.5", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", + "regexp.prototype.flags": "^1.5.1", "side-channel": "^1.0.4", "which-boxed-primitive": "^1.0.2", "which-collection": "^1.0.1", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2559,6 +3696,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", @@ -2569,10 +3719,11 @@ } }, "node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -2613,6 +3764,15 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -2638,11 +3798,22 @@ } }, "node_modules/dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "engines": { "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dset": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", + "integrity": "sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==", + "engines": { + "node": ">=4" } }, "node_modules/easy-table": { @@ -2836,6 +4007,44 @@ "ext": "^1.1.2" } }, + "node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -3492,6 +4701,15 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -3509,6 +4727,29 @@ "node": ">= 0.6" } }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, "node_modules/express": { "version": "4.18.2", "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", @@ -3755,10 +4996,27 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { "version": "1.1.5", @@ -3794,19 +5052,41 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-symbol-description": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", @@ -4029,9 +5309,9 @@ } }, "node_modules/graphql-ws": { - "version": "5.11.3", - "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.11.3.tgz", - "integrity": "sha512-fU8zwSgAX2noXAsuFiCZ8BtXeXZOzXyK5u1LloCdacsVth4skdBMPO74EG51lBoWSIZ8beUocdpV8+cQHBODnQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.2.tgz", + "integrity": "sha512-LycmCwhZ+Op2GlHz4BZDsUYHKRiiUz+3r9wbhBATMETNlORQJAaFlAgTFoeRh6xQoQegwYwIylVD1Qns9/DA3w==", "engines": { "node": ">=10" }, @@ -4081,7 +5361,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -4114,6 +5393,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/highlight.js": { "version": "10.7.3", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", @@ -4143,6 +5433,15 @@ "node": ">= 0.8" } }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -4249,9 +5548,9 @@ } }, "node_modules/ioredis": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.0.tgz", - "integrity": "sha512-Id9jKHhsILuIZpHc61QkagfVdUj2Rag5GzG1TGEvRNeM7dtTOjICgjC+tvqYxi//PuX2wjQ+Xjva2ONBuf92Pw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", + "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", "dependencies": { "@ioredis/commands": "^1.1.1", "cluster-key-slot": "^1.1.0", @@ -4547,6 +5846,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", @@ -4728,9 +6039,9 @@ "dev": true }, "node_modules/keyv": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", - "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dependencies": { "json-buffer": "3.0.1" } @@ -4760,6 +6071,22 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -4824,6 +6151,15 @@ "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, "node_modules/lru-cache": { "version": "7.13.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", @@ -4832,6 +6168,18 @@ "node": ">=12" } }, + "node_modules/magic-string": { + "version": "0.30.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", + "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -4855,6 +6203,12 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4915,6 +6269,18 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -4958,6 +6324,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/mlly": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.5.0.tgz", + "integrity": "sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "ufo": "^1.3.2" + } + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -5014,6 +6392,11 @@ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" }, + "node_modules/node-abort-controller": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==" + }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -5057,9 +6440,9 @@ "integrity": "sha512-F5kfEj95kX8tkDhUCYdV8dg3/8Olx/94zB8+ZNthFs6Bz31UpUi8Xh40TN3thLwXgrwXry1pEg9lJ++tLWTcqA==" }, "node_modules/node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.0.tgz", + "integrity": "sha512-PbZERfeFdrHQOOXiAKOY0VPbykZy90ndPKk0d+CFDegTKmWp1VgOTz2xACVbr1BjCWxrQp68CXtvNsveFhqDJg==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -5087,6 +6470,33 @@ "semver": "bin/semver" } }, + "node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -5160,6 +6570,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, "node_modules/ofetch": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.3.tgz", @@ -5189,6 +6605,21 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/open": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", @@ -5369,15 +6800,30 @@ "node": ">=8" } }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/pg": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.10.0.tgz", - "integrity": "sha512-ke7o7qSTMb47iwzOSaZMfeR7xToFdkE71ifIipOAAaLIM0DYzfOAXlgFFmYUIE2BcJtvnVlGCID84ZzCegE8CQ==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz", + "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==", "dependencies": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", - "pg-connection-string": "^2.5.0", - "pg-pool": "^3.6.0", + "pg-connection-string": "^2.6.2", + "pg-pool": "^3.6.1", "pg-protocol": "^1.6.0", "pg-types": "^2.1.0", "pgpass": "1.x" @@ -5385,6 +6831,9 @@ "engines": { "node": ">= 8.0.0" }, + "optionalDependencies": { + "pg-cloudflare": "^1.1.1" + }, "peerDependencies": { "pg-native": ">=3.0.1" }, @@ -5394,10 +6843,16 @@ } } }, + "node_modules/pg-cloudflare": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", + "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "optional": true + }, "node_modules/pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", + "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" }, "node_modules/pg-int8": { "version": "1.0.1", @@ -5407,10 +6862,19 @@ "node": ">=4.0.0" } }, + "node_modules/pg-numeric": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz", + "integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/pg-pool": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.0.tgz", - "integrity": "sha512-clFRf2ksqd+F497kWFyM21tMjeikn60oGDmqMT8UBrynEwVEX/5R5xd2sdvdo1cZCFlguORNpVuqxIj+aK4cfQ==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz", + "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", "peerDependencies": { "pg": ">=8.0" } @@ -5461,13 +6925,70 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, "engines": { - "node": ">=4" + "node": ">=4" + } + }, + "node_modules/postcss": { + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss/node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, "node_modules/postgres-array": { @@ -5505,6 +7026,12 @@ "node": ">=0.10.0" } }, + "node_modules/postgres-range": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.4.tgz", + "integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==", + "dev": true + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -5529,10 +7056,36 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/prom-client": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.1.1.tgz", - "integrity": "sha512-hFU32q7UZQ59bVJQGUtm3I2PrJ3gWvoCkilX9sF165ks1qflhugVCeK+S1JjJYHvyt3o5kj68+q3bchormjnzw==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.2.0.tgz", + "integrity": "sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==", "dependencies": { "tdigest": "^0.1.1" }, @@ -5617,6 +7170,12 @@ "node": ">= 0.8" } }, + "node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -5743,6 +7302,11 @@ "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" }, + "node_modules/regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, "node_modules/regexp-tree": { "version": "0.1.25", "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.25.tgz", @@ -5753,13 +7317,13 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" }, "engines": { "node": ">= 0.4" @@ -5847,6 +7411,38 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rollup": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", + "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.12.0", + "@rollup/rollup-android-arm64": "4.12.0", + "@rollup/rollup-darwin-arm64": "4.12.0", + "@rollup/rollup-darwin-x64": "4.12.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", + "@rollup/rollup-linux-arm64-gnu": "4.12.0", + "@rollup/rollup-linux-arm64-musl": "4.12.0", + "@rollup/rollup-linux-riscv64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-musl": "4.12.0", + "@rollup/rollup-win32-arm64-msvc": "4.12.0", + "@rollup/rollup-win32-ia32-msvc": "4.12.0", + "@rollup/rollup-win32-x64-msvc": "4.12.0", + "fsevents": "~2.3.2" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -5918,9 +7514,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/scule": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/scule/-/scule-1.0.0.tgz", - "integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/scule/-/scule-1.1.0.tgz", + "integrity": "sha512-vRUjqhyM/YWYzT+jsMk6tnl3NkY4A4soJ8uyh3O6Um+JXEQL9ozUCe7pqrxn3CSKokw0hw3nFStfskzpgYwR0g==" }, "node_modules/semver": { "version": "7.5.0", @@ -5989,6 +7585,33 @@ "node": ">= 0.8.0" } }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -6040,6 +7663,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -6049,6 +7690,15 @@ "node": ">=8" } }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -6089,6 +7739,12 @@ "node": ">= 10.x" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, "node_modules/standard-as-callback": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", @@ -6102,6 +7758,12 @@ "node": ">= 0.8" } }, + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true + }, "node_modules/stop-iteration-iterator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", @@ -6200,6 +7862,18 @@ "node": ">=4" } }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -6224,6 +7898,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", + "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", + "dev": true, + "dependencies": { + "js-tokens": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/strip-literal/node_modules/js-tokens": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", + "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "dev": true + }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -6250,6 +7942,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/sync-fetch": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/sync-fetch/-/sync-fetch-0.5.2.tgz", + "integrity": "sha512-6gBqqkHrYvkH65WI2bzrDwrIKmt3U10s4Exnz3dYuE5Ah62FIfNv/F63inrNhu2Nyh3GH5f42GKU3RrSJoaUyQ==", + "dependencies": { + "node-fetch": "^2.6.1" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/synckit": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", @@ -6318,6 +8021,30 @@ "globrex": "^0.1.2" } }, + "node_modules/tinybench": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -6398,6 +8125,15 @@ "node": ">= 0.8.0" } }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -6472,15 +8208,16 @@ } }, "node_modules/typeorm": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.15.tgz", - "integrity": "sha512-R4JSw8QjDP1W+ypeRz/XrCXIqubrLSnNAzJAp9EQSQIPHTv+YmUHZis8g08lOwFpuhqL9m8jkPSz8GWEKlU/ow==", + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.17.tgz", + "integrity": "sha512-UDjUEwIQalO9tWw9O2A4GU+sT3oyoUXheHJy4ft+RFdnRdQctdQ34L9SqE2p7LdwzafHx1maxT+bqXON+Qnmig==", "dependencies": { "@sqltools/formatter": "^1.2.5", "app-root-path": "^3.1.0", "buffer": "^6.0.3", "chalk": "^4.1.2", "cli-highlight": "^2.1.11", + "date-fns": "^2.29.3", "debug": "^4.3.4", "dotenv": "^16.0.3", "glob": "^8.1.0", @@ -6647,9 +8384,9 @@ } }, "node_modules/ufo": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.0.tgz", - "integrity": "sha512-bRn3CsoojyNStCZe0BG0Mt4Nr/4KF+rhFlnNXybgqt5pXHNFRlqinSoQaTrGyzE4X8aHplSb+TorH+COin9Yxw==" + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", + "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==" }, "node_modules/unbox-primitive": { "version": "1.0.2", @@ -6731,9 +8468,9 @@ } }, "node_modules/value-or-promise": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.11.tgz", - "integrity": "sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", + "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", "engines": { "node": ">=12" } @@ -6746,6 +8483,194 @@ "node": ">= 0.8" } }, + "node_modules/vite": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", + "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", + "dev": true, + "dependencies": { + "esbuild": "^0.19.3", + "postcss": "^8.4.35", + "rollup": "^4.2.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", + "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite-node/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/vite-node/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/vitest": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", + "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.3.1", + "@vitest/runner": "1.3.1", + "@vitest/snapshot": "1.3.1", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.2", + "vite": "^5.0.0", + "vite-node": "1.3.1", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "1.3.1", + "@vitest/ui": "1.3.1", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -6846,16 +8771,15 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", "dependencies": { "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "call-bind": "^1.0.4", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -6864,6 +8788,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -6895,9 +8835,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", - "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", "engines": { "node": ">=10.0.0" }, @@ -7035,9 +8975,9 @@ } }, "@apollo/usage-reporting-protobuf": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.0.2.tgz", - "integrity": "sha512-GfE8aDqi/lAFut95pjH9IRvH0zGsQ5G/2lYL0ZLZfML7ArX+A4UVHFANQcPCcUYGE6bI6OPhLekg4Vsjf6B1cw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.1.1.tgz", + "integrity": "sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==", "requires": { "@apollo/protobufjs": "1.2.7" } @@ -7209,6 +9149,175 @@ } } }, + "@babel/runtime": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", + "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", + "requires": { + "regenerator-runtime": "^0.14.0" + } + }, + "@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "dev": true, + "optional": true + }, "@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -7265,51 +9374,49 @@ "dev": true }, "@exodus/schemasafe": { - "version": "1.0.0-rc.9", - "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.0.0-rc.9.tgz", - "integrity": "sha512-dGGHpb61hLwifAu7sotuHFDBw6GTdpG8aKC0fsK17EuTzMRvUrH7lEAr6LTJ+sx3AZYed9yZ77rltVDHyg2hRg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.3.0.tgz", + "integrity": "sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==", "dev": true }, "@graphql-tools/merge": { - "version": "8.3.18", - "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.18.tgz", - "integrity": "sha512-R8nBglvRWPAyLpZL/f3lxsY7wjnAeE0l056zHhcO/CgpvK76KYUt9oEkR05i8Hmt8DLRycBN0FiotJ0yDQWTVA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-9.0.0.tgz", + "integrity": "sha512-J7/xqjkGTTwOJmaJQJ2C+VDBDOWJL3lKrHJN4yMaRLAJH3PosB7GiPRaSDZdErs0+F77sH2MKs2haMMkywzx7Q==", "requires": { - "@graphql-tools/utils": "9.2.1", + "@graphql-tools/utils": "^10.0.0", "tslib": "^2.4.0" - }, - "dependencies": { - "@graphql-tools/utils": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", - "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", - "requires": { - "@graphql-typed-document-node/core": "^3.1.1", - "tslib": "^2.4.0" - } - } } }, "@graphql-tools/mock": { - "version": "8.7.18", - "resolved": "https://registry.npmjs.org/@graphql-tools/mock/-/mock-8.7.18.tgz", - "integrity": "sha512-ZbXMp86V0DmfgUZhr5aGHtNIS2hBazhvTpPlFCyNOP+RMio3ErKnSsma3T1jV1ZyMo11l7QrxV9Xxn3uA0dv+w==", + "version": "8.7.20", + "resolved": "https://registry.npmjs.org/@graphql-tools/mock/-/mock-8.7.20.tgz", + "integrity": "sha512-ljcHSJWjC/ZyzpXd5cfNhPI7YljRVvabKHPzKjEs5ElxWu2cdlLGvyNYepApXDsM/OJG/2xuhGM+9GWu5gEAPQ==", "requires": { - "@graphql-tools/schema": "9.0.16", - "@graphql-tools/utils": "9.2.1", + "@graphql-tools/schema": "^9.0.18", + "@graphql-tools/utils": "^9.2.1", "fast-json-stable-stringify": "^2.1.0", "tslib": "^2.4.0" }, "dependencies": { + "@graphql-tools/merge": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz", + "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==", + "requires": { + "@graphql-tools/utils": "^9.2.1", + "tslib": "^2.4.0" + } + }, "@graphql-tools/schema": { - "version": "9.0.16", - "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.16.tgz", - "integrity": "sha512-kF+tbYPPf/6K2aHG3e1SWIbapDLQaqnIHVRG6ow3onkFoowwtKszvUyOASL6Krcv2x9bIMvd1UkvRf9OaoROQQ==", + "version": "9.0.19", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz", + "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==", "requires": { - "@graphql-tools/merge": "8.3.18", - "@graphql-tools/utils": "9.2.1", + "@graphql-tools/merge": "^8.4.1", + "@graphql-tools/utils": "^9.2.1", "tslib": "^2.4.0", - "value-or-promise": "1.0.12" + "value-or-promise": "^1.0.12" } }, "@graphql-tools/utils": { @@ -7320,56 +9427,35 @@ "@graphql-typed-document-node/core": "^3.1.1", "tslib": "^2.4.0" } - }, - "value-or-promise": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", - "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==" } } }, "@graphql-tools/schema": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz", - "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-10.0.0.tgz", + "integrity": "sha512-kf3qOXMFcMs2f/S8Y3A8fm/2w+GaHAkfr3Gnhh2LOug/JgpY/ywgFVxO3jOeSpSEdoYcDKLcXVjMigNbY4AdQg==", "requires": { - "@graphql-tools/merge": "8.3.1", - "@graphql-tools/utils": "8.9.0", + "@graphql-tools/merge": "^9.0.0", + "@graphql-tools/utils": "^10.0.0", "tslib": "^2.4.0", - "value-or-promise": "1.0.11" - }, - "dependencies": { - "@graphql-tools/merge": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz", - "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==", - "requires": { - "@graphql-tools/utils": "8.9.0", - "tslib": "^2.4.0" - } - }, - "@graphql-tools/utils": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz", - "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==", - "requires": { - "tslib": "^2.4.0" - } - } + "value-or-promise": "^1.0.12" } }, "@graphql-tools/utils": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.12.0.tgz", - "integrity": "sha512-TeO+MJWGXjUTS52qfK4R8HiPoF/R7X+qmgtOYd8DTH0l6b+5Y/tlg5aGeUJefqImRq7nvi93Ms40k/Uz4D5CWw==", + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-10.0.8.tgz", + "integrity": "sha512-yjyA8ycSa1WRlJqyX/aLqXeE5DvF/H02+zXMUFnCzIDrj0UvLMUrxhmVFnMK0Q2n3bh4uuTeY3621m5za9ovXw==", "requires": { + "@graphql-typed-document-node/core": "^3.1.1", + "cross-inspect": "1.0.0", + "dset": "^3.1.2", "tslib": "^2.4.0" } }, "@graphql-typed-document-node/core": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.1.tgz", - "integrity": "sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", "requires": {} }, "@humanwhocodes/config-array": { @@ -7417,31 +9503,51 @@ "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==" }, + "@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.27.8" + } + }, "@josephg/resolvable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@josephg/resolvable/-/resolvable-1.0.1.tgz", "integrity": "sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==" }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, "@keyv/redis": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@keyv/redis/-/redis-2.5.5.tgz", - "integrity": "sha512-J7dNB6iU18AbkxiN2moPcWUShgOVZtf4ySpsZIXPnuwqrvkF4X0q7nH/+mYJEjJpZwUWg6HjVxXkJYE9C2jMDw==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@keyv/redis/-/redis-2.5.8.tgz", + "integrity": "sha512-WweuUZqZN2ETcseV6r1AEum1qG6eR5poNhkZ4CIpWBOjMasT2ArTKWyIPxxYllKUS2A8wKv1l8+AqH6Jpzk7Ug==", "requires": { - "ioredis": "^5.3.0" + "ioredis": "^5.3.2" } }, + "@kodadot1/hyperdata": { + "version": "0.0.1-rc.4", + "resolved": "https://registry.npmjs.org/@kodadot1/hyperdata/-/hyperdata-0.0.1-rc.4.tgz", + "integrity": "sha512-8vBamHWimmZ/ew1Z0iUJPDdW2fkNiPC5S1Ezklsy5BjG0AvA+7t+cwpi2gD33sMrfkzAAHcg30B3EHA98sgUzw==" + }, "@kodadot1/metasquid": { - "version": "0.1.6-rc.0", - "resolved": "https://registry.npmjs.org/@kodadot1/metasquid/-/metasquid-0.1.6-rc.0.tgz", - "integrity": "sha512-73cZJs0GtOgQmeMeF0h/t7nniYAue60f9tofd/ogshYUd9sTxRdzlXfemFlTN+78QCrx0TmpUOy3t9/yNIiXxw==", + "version": "0.3.0-rc.0", + "resolved": "https://registry.npmjs.org/@kodadot1/metasquid/-/metasquid-0.3.0-rc.0.tgz", + "integrity": "sha512-RnsxKYKxrRM+S4/tCVpCi1QOIgTS6myevg6bODopNNR7Z3UzyABVPxHWoUjmsaOBuMSAthvNYn03tbCjLax0mA==", "requires": { - "scule": "^1.0.0" + "scule": "^1.1.0" } }, "@kodadot1/minipfs": { - "version": "0.4.1-rc.0", - "resolved": "https://registry.npmjs.org/@kodadot1/minipfs/-/minipfs-0.4.1-rc.0.tgz", - "integrity": "sha512-pKFUZ1qpNLJ4qt8KwjI7uaNUU46fP3MCNOblplb9NSrK5IIGjV18dTacTMvEbR3BVc1D+MKiehPjdap0iKgqTw==", + "version": "0.4.2-rc.0", + "resolved": "https://registry.npmjs.org/@kodadot1/minipfs/-/minipfs-0.4.2-rc.0.tgz", + "integrity": "sha512-sZievAE9OfG9Islrxa8viHPXCeR4xAHeG3DSyJSOq/RgjNF23vgRCoJukLfuTbEZ6N9zsOSKrOqQlL0Jba44Iw==", "requires": { "ofetch": "^1.3.3" } @@ -7540,20 +9646,117 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, + "@rollup/rollup-android-arm-eabi": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", + "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "dev": true, + "optional": true + }, + "@rollup/rollup-android-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", + "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", + "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-x64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", + "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", + "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", + "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", + "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-riscv64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", + "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", + "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", + "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-arm64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", + "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-ia32-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", + "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-x64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", + "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "dev": true, + "optional": true + }, + "@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "@sqltools/formatter": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" }, "@subsquid/archive-registry": { - "version": "2.1.14", - "resolved": "https://registry.npmjs.org/@subsquid/archive-registry/-/archive-registry-2.1.14.tgz", - "integrity": "sha512-STsM5ys44lV5aW+Ha1go5eLfTCLJGrB603/Ok4JbaruaU23RBTsIyLkI4FK08sSEkeQhX54xR7U/fZX85yjnIA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/archive-registry/-/archive-registry-3.3.0.tgz", + "integrity": "sha512-moXnGNOSmKMHyuDvUiOHbpL7IePSo4XZOW9OnzESIND64eGxlKusIsCi8Nth1DgzbE/UTTFeNJvYKu0v7SOIqw==", "requires": { "@subsquid/util-internal": "^1.0.0", "commander": "^10.0.0", "easy-table": "^1.2.0", - "node-fetch": "^2" + "sync-fetch": "^0.5.2" } }, "@subsquid/graphiql-console": { @@ -7562,211 +9765,450 @@ "integrity": "sha512-C89mus6IXnNi0xMQrZqUFBZwLj8tbuq9lye8Gq/lHmmERAUpi6UsWEyLdJLx2mneZzF3JtY8eNiiZ16jmjtvfw==" }, "@subsquid/graphql-server": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@subsquid/graphql-server/-/graphql-server-3.3.2.tgz", - "integrity": "sha512-sJbOqvUrIej34bodz2jYPgOCB8GxwdqmMYEkbk6jz4OAwGS103bUYzypAtk35zxJYL9xzFRPhIXrNOaa9glXQw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/graphql-server/-/graphql-server-4.3.1.tgz", + "integrity": "sha512-EEZXaZf3TSK0JD+kcBgr+ENf2WOAjb7EREQP28+9NRWQhtn1s1w3XQNMjjurfyeb5Us/pRODAmfl8jOcXj3CAQ==", "requires": { "@apollo/utils.keyvadapter": "~1.1.2", "@apollo/utils.keyvaluecache": "~1.0.2", - "@graphql-tools/merge": "^8", - "@graphql-tools/schema": "^8", - "@graphql-tools/utils": "^8", - "@keyv/redis": "~2.5.5", - "@subsquid/logger": "^0.3.1", - "@subsquid/openreader": "^3.1.7", - "@subsquid/typeorm-config": "^2.0.2", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-commander": "^0.0.2", - "@subsquid/util-internal-http-server": "^0.1.1", - "apollo-server-core": "^3.11.1", - "apollo-server-express": "^3.11.1", + "@graphql-tools/merge": "^9.0.0", + "@graphql-tools/schema": "^10.0.0", + "@graphql-tools/utils": "^10.0.6", + "@keyv/redis": "~2.5.8", + "@subsquid/logger": "^1.3.1", + "@subsquid/openreader": "^4.4.1", + "@subsquid/typeorm-config": "^3.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-commander": "^1.3.1", + "@subsquid/util-internal-http-server": "^1.2.1", + "apollo-server-core": "^3.12.1", + "apollo-server-express": "^3.12.1", "apollo-server-plugin-response-cache": "~3.7.1", - "commander": "^10.0.0", - "dotenv": "^16.0.3", + "commander": "^11.0.0", + "dotenv": "^16.3.1", "express": "^4.18.2", "graphql": "^15.8.0", - "graphql-ws": "^5.11.3", - "keyv": "~4.5.2", - "pg": "^8.9.0", - "ws": "^8.12.0" + "graphql-ws": "^5.14.1", + "keyv": "~4.5.3", + "pg": "^8.11.3", + "ws": "^8.14.2" + }, + "dependencies": { + "@subsquid/typeorm-config": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-3.3.1.tgz", + "integrity": "sha512-d8n+GHAr05A1cQXBr+kbaU0WeSD7oQk+t7KwkGbC9hh80tkYiweKzQwS4+fJcJCbrpZe+B6mV8WY5eVR9ebZMw==", + "requires": { + "@subsquid/util-naming": "^1.2.1" + } + }, + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "@subsquid/util-internal-commander": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.1.tgz", + "integrity": "sha512-KeGsOghBU20tM1BzqryOf3MKvrDFSfPuhnl9LhhEC00ysp8rRPyejlw6jIJhO2NRJ+oaUi5jHRdf64/o21N7Lw==", + "requires": {} + }, + "commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==" + } + } + }, + "@subsquid/http-client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/http-client/-/http-client-1.3.1.tgz", + "integrity": "sha512-ZBuYNW9IOvigvpntZvM0tzAY5Llr44NYswOzGwJpCjOnWF7EotzeJRMwDH0Zv5hXSMFvX3UBACP+PxmwDvma5A==", + "requires": { + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "node-fetch": "^3.3.2" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + } + } } }, "@subsquid/logger": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-0.3.1.tgz", - "integrity": "sha512-Hi0aWeVgK0OZ3L2KxRejLCHIBIs6k3AR8FEb9RCKgQvqHK8DDNuMFANo4obHqXDZpDF+Ef+T050Oz5n4O1u3lA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-1.3.1.tgz", + "integrity": "sha512-OBhelb0HbhqSygq/IxEm9PPX8thQSDiCPV45UlCqWOoQ9UpiROiQLL+2nwt+HAHQq+LlHTzQmGXV43eabrTfwQ==", "requires": { - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-json": "^0.2.1", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-json": "^1.2.1", "supports-color": "^8.1.1" } }, "@subsquid/openreader": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/@subsquid/openreader/-/openreader-3.1.7.tgz", - "integrity": "sha512-Ma1RAFk4dtmcRfcL/ys9Kq7qaEWvKH0TCbd5vcijwfnPu7GpOhU/3wYtegrwhQiWg1AaDavd9ub9jLPvur0FFQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@subsquid/openreader/-/openreader-4.4.1.tgz", + "integrity": "sha512-Z2M+scuoJx1H3U+KttIEjrSvZ+5K3ioNdWatUS42k9xgOIEMJzDCJM8ZxhqgP/fMTrR9RPjeFqjy6NBS0kgwtg==", "requires": { - "@graphql-tools/merge": "^8", + "@graphql-tools/merge": "^9.0.0", "@subsquid/graphiql-console": "^0.3.0", - "@subsquid/logger": "^0.3.1", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-commander": "^0.0.2", - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-http-server": "^0.1.1", - "@subsquid/util-naming": "^0.0.2", - "apollo-server-core": "^3.11.1", - "apollo-server-express": "^3.11.1", - "commander": "^10.0.0", - "deep-equal": "^2.2.0", + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-commander": "^1.3.1", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-http-server": "^1.2.1", + "@subsquid/util-naming": "^1.2.1", + "apollo-server-core": "^3.12.1", + "apollo-server-express": "^3.12.1", + "commander": "^11.0.0", + "deep-equal": "^2.2.2", "express": "^4.18.2", "graphql": "^15.8.0", "graphql-parse-resolve-info": "^4.13.0", - "graphql-ws": "^5.11.3", - "pg": "^8.9.0", - "ws": "^8.12.0" + "graphql-ws": "^5.14.1", + "pg": "^8.11.3", + "ws": "^8.14.2" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "@subsquid/util-internal-commander": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.1.tgz", + "integrity": "sha512-KeGsOghBU20tM1BzqryOf3MKvrDFSfPuhnl9LhhEC00ysp8rRPyejlw6jIJhO2NRJ+oaUi5jHRdf64/o21N7Lw==", + "requires": {} + }, + "commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==" + } } }, "@subsquid/rpc-client": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/rpc-client/-/rpc-client-2.0.0.tgz", - "integrity": "sha512-El67TER6lmeoaeOlRNELlH2AGpG4YWg8YRnIw3yrfzYhiXsmpX1Hra4XJi53/RxU5tsS1qMON2bd44QbceL27Q==", - "requires": { - "@subsquid/util-timeout": "^1.0.0", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@subsquid/rpc-client/-/rpc-client-4.4.2.tgz", + "integrity": "sha512-Zo/KuFNiwKblKCUDpXUNbeshxEpCX44CtBKbzr4f5zFNdwxuH7FjwFnZk4X5YZUVnbcTF6cmqhH5RwRkKBgPfQ==", + "requires": { + "@subsquid/http-client": "^1.3.1", + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-binary-heap": "^1.0.0", + "@subsquid/util-internal-counters": "^1.3.1", "websocket": "^1.0.34" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + } } }, "@subsquid/scale-codec": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@subsquid/scale-codec/-/scale-codec-1.1.1.tgz", - "integrity": "sha512-gDI0TnF0LXG5+nwXW6TUkTBVfbTcPqtPeAqAwy6Z9EtetHK8IoogkewIILisXcbVun2M66cZR+i/VABbaVy2Sw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/scale-codec/-/scale-codec-4.0.0.tgz", + "integrity": "sha512-aVqcy1KeQiYhL3lRLZJcRVuBOmh88zQKqEdxU/7gJCj/gvBF9+Isd16oE0xuA5xwlGcFHbRfUFSON5EP2Lv8Eg==", + "requires": { + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-json": "^1.2.1" + } + }, + "@subsquid/scale-type-system": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/scale-type-system/-/scale-type-system-1.0.1.tgz", + "integrity": "sha512-CjY5nBzGrbRcOH//lOwNHbBjHtHD0t27SirdIAFre/Mp4fLIiv6gEkIgNYu+lwAjMvuFkLkcw7JGmwXvLNepNw==", + "peer": true, "requires": { - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-json": "^0.2.1" + "@subsquid/util-internal": "^2.5.2" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "peer": true + } } }, "@subsquid/ss58": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@subsquid/ss58/-/ss58-0.1.4.tgz", - "integrity": "sha512-YM7Wt+upN8M5IZ9tr+yxHafBOWCcvJzXz4rlC62SM7VCP++ErqbBtui03yROussGTSAjBObXgzVljYypG0kawQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/ss58/-/ss58-2.0.1.tgz", + "integrity": "sha512-VmVgR6E8cwpYiQtL+ZbdW0RCguNmwunbX4JYI08vHErxWdLhX4o6v9LClq3L9+5LcKgspzOci9DNt0xzR1keYQ==", "requires": { - "@subsquid/ss58-codec": "^0.1.2" + "@subsquid/ss58-codec": "^1.2.2", + "@subsquid/util-internal-hex": "^1.2.1" } }, "@subsquid/ss58-codec": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@subsquid/ss58-codec/-/ss58-codec-0.1.2.tgz", - "integrity": "sha512-fyTFjx60m0j4aNJMocNaJBptc/TWh9BCb33gtVPfcPV6gVIPhH37rbHaXz3+9NlnsLAiOuxrzDfbKOcxws/ZdA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@subsquid/ss58-codec/-/ss58-codec-1.2.2.tgz", + "integrity": "sha512-hNYKWqfKd92l2xFSgSiSfK6dHLE/hwWWJ6FIlZ3mS/tgUsEUqTHJabqZ1p+pt0US9P8h+J4Dd58eujPI03peqA==", "requires": { "base-x": "^4.0.0", "blake2b": "^2.1.4" } }, - "@subsquid/substrate-metadata": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@subsquid/substrate-metadata/-/substrate-metadata-2.2.2.tgz", - "integrity": "sha512-kAikmeXIxyhgf/qdgW4zyPpPXlmGaV1jOddOkx5XHJzxPx/VDyFYd+HJ62cSRRBUv9guPCQbCKT0h6poVFh8ow==", + "@subsquid/substrate-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-data/-/substrate-data-3.0.1.tgz", + "integrity": "sha512-zmZGtwYwNi50siU5k0r8YRXlJPNsls1E6y1N+Yv7driNdsolKhXdcHKLoRIaiXRlV/QGkuSh/vNaLxebxiL1TQ==", + "requires": { + "@subsquid/scale-codec": "^4.0.0", + "@subsquid/substrate-data-raw": "^0.1.0", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-ingest-tools": "^0.0.2", + "@subsquid/util-internal-range": "^0.0.1", + "@subsquid/util-xxhash": "^1.2.1", + "@substrate/calc": "^0.2.8", + "blake2b": "^2.1.4" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + } + } + }, + "@subsquid/substrate-data-raw": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-data-raw/-/substrate-data-raw-0.1.0.tgz", + "integrity": "sha512-0540hjZzUgeVjqy7UqKcTPKBsun2eisv9JR0ks3WDHPLabyWy4TolbE1WWqCo4B8wBmLEm5+vTL/BtM/AkHrYg==", + "requires": { + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-ingest-tools": "^0.0.2", + "@subsquid/util-internal-range": "^0.0.1" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + } + } + }, + "@subsquid/substrate-metadata-explorer": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-metadata-explorer/-/substrate-metadata-explorer-3.1.1.tgz", + "integrity": "sha512-GzlgUMEIcJvtiEYXxPqC6onncbmPKoBdINuyQSNmU7hVVOn5MEJhXAj2kzOnTztCGhM8GnBDebmLf/f7RndgiQ==", + "dev": true, "requires": { - "@subsquid/scale-codec": "^1.1.1", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-naming": "^0.0.2" + "@subsquid/logger": "^1.3.1", + "@subsquid/rpc-client": "^4.4.2", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-commander": "^1.3.1", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-read-lines": "^1.2.1", + "commander": "^11.0.0" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "dev": true + }, + "@subsquid/util-internal-commander": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.1.tgz", + "integrity": "sha512-KeGsOghBU20tM1BzqryOf3MKvrDFSfPuhnl9LhhEC00ysp8rRPyejlw6jIJhO2NRJ+oaUi5jHRdf64/o21N7Lw==", + "dev": true, + "requires": {} + }, + "commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true + } } }, - "@subsquid/substrate-metadata-explorer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@subsquid/substrate-metadata-explorer/-/substrate-metadata-explorer-1.1.2.tgz", - "integrity": "sha512-HE8g4PeDTGAXYBCbao7DayHkKzR+h0e7ocsJoEqKaNFO22Brnv9RVkcoUjswcWDWmXQyekS0hQI4O2JgYHy6cA==", - "dev": true, - "requires": { - "@subsquid/logger": "^0.3.1", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-commander": "^0.0.2", - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-http-client": "^0.1.0", - "@subsquid/util-internal-read-lines": "^0.0.2", - "@subsquid/util-internal-resilient-rpc": "^0.0.3", - "commander": "^10.0.0" + "@subsquid/substrate-processor": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-processor/-/substrate-processor-7.2.1.tgz", + "integrity": "sha512-9T/wQIaDt4HfkioFQ8nGMc+/N/mEskiYFhQdvT0FYwdKxr3qbyvsbT2qoZfDS/i9J/d2y/39YKrtCMBKOwf65w==", + "requires": { + "@subsquid/http-client": "^1.3.1", + "@subsquid/logger": "^1.3.1", + "@subsquid/rpc-client": "^4.4.2", + "@subsquid/substrate-data": "^3.0.1", + "@subsquid/substrate-data-raw": "^0.1.0", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-archive-client": "^0.0.1", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-internal-json": "^1.2.1", + "@subsquid/util-internal-processor-tools": "^3.1.0" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "@subsquid/util-internal-archive-client": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-archive-client/-/util-internal-archive-client-0.0.1.tgz", + "integrity": "sha512-Sr+m1vxAArPIdsjyKVOpjU57JlVujBpI8NEeHqeA6twSb40wasOLAeq775WyYFynucltNRSgIiwXBIo0t02D6g==", + "requires": { + "@subsquid/http-client": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-range": "^0.0.1" + } + } } }, - "@subsquid/substrate-processor": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@subsquid/substrate-processor/-/substrate-processor-2.4.1.tgz", - "integrity": "sha512-vFHDbiovCC/BDb03ui55M5Cf638Qcb9YZVKDs2xTltFMpT9lQM1Rs+bpaCne3AqAS5SY03A/PUKNu4jxl8fXTQ==", - "requires": { - "@subsquid/logger": "^0.3.1", - "@subsquid/scale-codec": "^1.1.1", - "@subsquid/substrate-metadata": "^2.2.2", - "@subsquid/typeorm-config": "^2.0.2", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-binary-heap": "^0.0.0", - "@subsquid/util-internal-code-printer": "^0.1.1", - "@subsquid/util-internal-counters": "^0.0.2", - "@subsquid/util-internal-hex": "^0.0.2", - "@subsquid/util-internal-http-client": "^0.1.0", - "@subsquid/util-internal-prometheus-server": "^0.0.3", - "@subsquid/util-internal-resilient-rpc": "^0.0.3", - "@subsquid/util-xxhash": "^0.1.2", - "blake2b": "^2.1.4", - "prom-client": "^14.1.1" + "@subsquid/substrate-runtime": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-runtime/-/substrate-runtime-1.0.1.tgz", + "integrity": "sha512-L7ln2EaIfl99uAbkz3Nw6oIXdpj2yfBk5qUyOJ/nOm5WHGBE3NKw0nIfgnC6EbbsNJKZZfJT0Tm+eRZZlUakug==", + "peer": true, + "requires": { + "@subsquid/scale-codec": "^4.0.0", + "@subsquid/scale-type-system": "^1.0.0", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-hex": "^1.2.1", + "@subsquid/util-naming": "^1.2.1", + "@subsquid/util-xxhash": "^1.2.1", + "blake2b": "^2.1.4" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "peer": true + } } }, "@subsquid/substrate-typegen": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/substrate-typegen/-/substrate-typegen-2.2.1.tgz", - "integrity": "sha512-kRV5aA4w6jUfiWdcRKUW/zjgtWLMKlai02AwN8BdW1T+6pOk0jI9PFvTbiGWjmqAjTHxCHOuNvhmvzNApl20gg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/substrate-typegen/-/substrate-typegen-8.0.1.tgz", + "integrity": "sha512-/Mx6ITDbVVjgPuhW3/JUvEDzN01hrz0lSmjTzX46L2JGamPeCxZfX/HdbwDUb0Ns7zn+Q3e1JOtQoRkC6MVEhA==", "dev": true, "requires": { - "@subsquid/logger": "^0.3.1", - "@subsquid/scale-codec": "^1.1.1", - "@subsquid/substrate-metadata": "^2.2.2", - "@subsquid/substrate-metadata-explorer": "^1.1.0", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-code-printer": "^0.1.1", - "@subsquid/util-internal-config": "^1.0.1", - "@subsquid/util-internal-read-lines": "^0.0.2", - "@subsquid/util-naming": "^0.0.2", - "commander": "^10.0.0" + "@subsquid/http-client": "^1.3.1", + "@subsquid/logger": "^1.3.1", + "@subsquid/substrate-metadata-explorer": "^3.1.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-code-printer": "^1.2.1", + "@subsquid/util-internal-config": "^2.2.1", + "@subsquid/util-internal-read-lines": "^1.2.1", + "@subsquid/util-naming": "^1.2.1", + "commander": "^11.0.0" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "dev": true + }, + "commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true + } } }, "@subsquid/typeorm-codegen": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-codegen/-/typeorm-codegen-0.3.3.tgz", - "integrity": "sha512-wKUZjAOp7RaD5lZB5q544vGrRtRbLWn9mf0bCjrLN0DrwlT+lQwZV1BV0JRrStSJreaqyz7rWYWwkAUABn6fGA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-codegen/-/typeorm-codegen-1.3.2.tgz", + "integrity": "sha512-jSDrMjcCa1NiEQICFXHyYENEnjJxmFd2vmyiSXm+CTyqQRMJutqLcZFHx38CHwz15kyCxKK8whDYQglmLvx0cQ==", "dev": true, "requires": { - "@subsquid/openreader": "^3.1.7", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-code-printer": "^0.1.1", - "@subsquid/util-naming": "^0.0.2", - "commander": "^10.0.0" - } - }, - "@subsquid/typeorm-config": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-2.0.2.tgz", - "integrity": "sha512-LoyWzhFeNSI9fXnhgYF4MizyGuiBVB7t3je9TFsOTCnOTYSIcDKJJkmCDzobDlA8PgkJ5bFLFilxIFKsVFqt4w==", - "requires": { - "@subsquid/util-naming": "^0.0.2" + "@subsquid/openreader": "^4.4.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-code-printer": "^1.2.1", + "@subsquid/util-naming": "^1.2.1", + "commander": "^11.0.0" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==", + "dev": true + }, + "commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true + } } }, "@subsquid/typeorm-migration": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-migration/-/typeorm-migration-0.1.6.tgz", - "integrity": "sha512-4J4VDJ96zf5b1qF7faHfcaK4x8oNmVXACJwzv/JidloNqt9TUkdkEnlXIpIw1oxijtzWByncnAW9jHU+gcO59Q==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-migration/-/typeorm-migration-1.2.2.tgz", + "integrity": "sha512-G22Eh7AuPHjLB7C30XNT+fVe2bGYmYI2EB/8Sf5kYfS0yCKvev2YWJNcvkyD6eswv8HgrekwEoj3BKjR5wH6yg==", "requires": { - "@subsquid/typeorm-config": "^2.0.2", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-code-printer": "^0.1.1", - "commander": "^10.0.0", - "dotenv": "^16.0.3" + "@subsquid/typeorm-config": "^3.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-code-printer": "^1.2.1", + "commander": "^11.0.0", + "dotenv": "^16.3.1" + }, + "dependencies": { + "@subsquid/typeorm-config": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-3.3.1.tgz", + "integrity": "sha512-d8n+GHAr05A1cQXBr+kbaU0WeSD7oQk+t7KwkGbC9hh80tkYiweKzQwS4+fJcJCbrpZe+B6mV8WY5eVR9ebZMw==", + "requires": { + "@subsquid/util-naming": "^1.2.1" + } + }, + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + }, + "commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==" + } } }, "@subsquid/typeorm-store": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-store/-/typeorm-store-0.2.2.tgz", - "integrity": "sha512-mzqiJCPFT/KBuwNuNAK8D3Wmf5Hws27wvYWw/bXAAT47rxAERz3oLMsAs/dSjXT30F63kMcQfJzvp5FOsa3Ohw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-store/-/typeorm-store-1.2.4.tgz", + "integrity": "sha512-fcHp9cHEe1T1tVjV125CLbNjs/NIQKFW8bdK/stDn9prxuuwfiAGKvpztU52dKVuyQCUFL+8YTtFt2y1i7ZEBA==", "requires": { - "@subsquid/typeorm-config": "^2.0.2", - "@subsquid/util-internal": "^1.1.0" + "@subsquid/typeorm-config": "^3.3.1", + "@subsquid/util-internal": "^2.5.2" + }, + "dependencies": { + "@subsquid/typeorm-config": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-3.3.1.tgz", + "integrity": "sha512-d8n+GHAr05A1cQXBr+kbaU0WeSD7oQk+t7KwkGbC9hh80tkYiweKzQwS4+fJcJCbrpZe+B6mV8WY5eVR9ebZMw==", + "requires": { + "@subsquid/util-naming": "^1.2.1" + } + }, + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + } } }, "@subsquid/util-internal": { @@ -7775,133 +10217,145 @@ "integrity": "sha512-O6m666RDcWEw4vb3bmeNZKlAa1rGOHQvS0nhZFTBXnxZpqK/pU5N0jrQ7X/3is0pY2RKxFoxTurZjhv4QdxtqA==" }, "@subsquid/util-internal-binary-heap": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-binary-heap/-/util-internal-binary-heap-0.0.0.tgz", - "integrity": "sha512-eVtdf442+L10G4lgSHCcxgNzYEcrdZ3WKy7Y7CGkhKLJhKuOlgDtEwklZmh1/lM+37AQn9XnX/VpxTaJ2vA2sg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-binary-heap/-/util-internal-binary-heap-1.0.0.tgz", + "integrity": "sha512-88auuc8yNFmCZugmJSTYzS7WM/nN2obKGQCgrl8Jty5rJUFbqazGSi8icqftKhv6MPtUMJ3PSTRLiTFXAUGnAA==" }, "@subsquid/util-internal-code-printer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-code-printer/-/util-internal-code-printer-0.1.1.tgz", - "integrity": "sha512-367YmYeLoLaOiBdlrYElEC4AeM4Kx0XYWM9mA9VBllGvT9qWNnGllaJ+mY9UBhlhWQtCbUnTRtHXhjR5qL8g1w==" - }, - "@subsquid/util-internal-commander": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-0.0.2.tgz", - "integrity": "sha512-midCpkwu7NaXGhr0MiyQsJlIj284/0mAFBvVG8gRHqqRqb71GIAQq+aRcUSv8KNnAiRWnXK1OPak+gc40V9btw==", - "requires": {} + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-code-printer/-/util-internal-code-printer-1.2.1.tgz", + "integrity": "sha512-9l0kCm50hQfRjzplIZs9kHooqxczG82fzAexlD6x1SjdLDU1NfYA0uGxgE6pweKydgd7LCb9ICc5gfDvbWtdaw==" }, "@subsquid/util-internal-config": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-config/-/util-internal-config-1.0.1.tgz", - "integrity": "sha512-F5jr3OWerUQ+dn0ecCtcizdZunlFN6wXy50SmfLY+x8f8ggXsk3Z2waIxJjOAB4GnuNYyvvQREM7pusjCyN2RQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-config/-/util-internal-config-2.2.1.tgz", + "integrity": "sha512-yOyIzn5Gx4aawtOEkY/Bxvo57WBqU/vRvpG/nsyFWOEEC/opmxH5Tl3hDPdoeF+/+AN6a9AEprGAMK2Wesj8LQ==", "dev": true, "requires": { - "@exodus/schemasafe": "^1.0.0-rc.9", + "@exodus/schemasafe": "^1.3.0", "jsonc-parser": "^3.2.0" } }, "@subsquid/util-internal-counters": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-counters/-/util-internal-counters-0.0.2.tgz", - "integrity": "sha512-x/O+56bR/X41ZEKjxZy0IqiapKCN9gGJB7G8md+idvGeC15kw8r5pg2Ck9tulB07VQEOqWLNNuvobrfvH0hNkg==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-counters/-/util-internal-counters-1.3.1.tgz", + "integrity": "sha512-bc22t8lEvoCBn31F+B763E81+ZDaL7ufpwr0VLXZzcA5wZ6NEqqRfs4bJtPeBNGEjyeLLrItXWxfjSkR7sGKAg==" }, "@subsquid/util-internal-hex": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-hex/-/util-internal-hex-0.0.2.tgz", - "integrity": "sha512-EgqYmZjJ6ox885tXBObEAZQZImpRc5pFzQeOLEh78gGPTc39IH3VI4BG0zaomStvgBx+e25M7Y2cc+ae+ttuXQ==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-hex/-/util-internal-hex-1.2.1.tgz", + "integrity": "sha512-R7TYDsftjguapzWia97WGvcF4s65VKArzSga5i1i4aZSq9Z330kPYpgAUkqDGsJqD/Ki3PTE4cXhuKLRyMHPvg==" }, - "@subsquid/util-internal-http-client": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-http-client/-/util-internal-http-client-0.1.0.tgz", - "integrity": "sha512-LOSOX1Yv4t/NA/90qrmmCArOYTntxWV4dcnTXadKXQiM9gPnVNGLCa+Z17HYjBrvZFHDdYglV2F9kOikOqDd/Q==", + "@subsquid/util-internal-http-server": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-http-server/-/util-internal-http-server-1.2.1.tgz", + "integrity": "sha512-aQIodM3xWDu8wxllOONU5Fy6hmYYAZzS2PglC2FfdUi6HUxaZ8aCUkjFisG56tglhsoAh/TQSQX1YhCX00MCcg==", + "requires": { + "stoppable": "^1.1.0" + } + }, + "@subsquid/util-internal-ingest-tools": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-ingest-tools/-/util-internal-ingest-tools-0.0.2.tgz", + "integrity": "sha512-Nx5LDWq9B1sVAXg6qDI0zVmzfwP1Mk5Rrn79OJc4eKLvZTrTIk2vyM5SB4n1kwQk6KRuQYI9dfiNWdcm+9rGfA==", "requires": { - "@subsquid/logger": "^0.3.1", - "@subsquid/util-internal": "^1.1.0", - "node-fetch": "^3.3.0" + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-range": "^0.0.1" }, "dependencies": { - "node-fetch": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.0.tgz", - "integrity": "sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==", - "requires": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - } + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" } } }, - "@subsquid/util-internal-http-server": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-http-server/-/util-internal-http-server-0.1.1.tgz", - "integrity": "sha512-Vi7hSBSty5qOvrANNsxCtHASpdhRqmJsrp+hVnQ3PhcrZkGRrcu0O7jkVAZfhptzxMZeQ5r/NXDTt4b/qNSvJg==", + "@subsquid/util-internal-json": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-json/-/util-internal-json-1.2.1.tgz", + "integrity": "sha512-Jtbhur/QaRk727fiZ/w8so0M0o4BIkfvnT6zBnC3s1mQ9fKve0Q6aj22gbimpX7Whj6tAGF0Bz8LFhbAethbkA==", "requires": { - "stoppable": "^1.1.0" + "@subsquid/util-internal-hex": "^1.2.1" } }, - "@subsquid/util-internal-json": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-json/-/util-internal-json-0.2.1.tgz", - "integrity": "sha512-X9bhhKWBcaeZekGEiE15i8xwfq07/aIYDhA+JFdiVT3aygdb9b57V85USuArd6oh3jjHeQ2SBgj6B5rd8m8vlA==", + "@subsquid/util-internal-processor-tools": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-3.1.0.tgz", + "integrity": "sha512-uEa8Bw/xvSfiagbK8IFt1OEgR7hacfblPZXH5EV4cAIKoIVOonhnkJEPRWqI3ZaDHl+8Z9p909tlsEd46sXenw==", "requires": { - "@subsquid/util-internal-hex": "^0.0.2" + "@subsquid/logger": "^1.3.1", + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-counters": "^1.3.1", + "@subsquid/util-internal-prometheus-server": "^1.2.1", + "@subsquid/util-internal-range": "^0.0.1", + "prom-client": "^14.2.0" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + } } }, "@subsquid/util-internal-prometheus-server": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-prometheus-server/-/util-internal-prometheus-server-0.0.3.tgz", - "integrity": "sha512-Hb40h47V6tnBcCoZYeXERUUlDcrJMajcwhXf4vBpuq6wJMXhBaYwOpP+sr7v0x3wvHfuh1639BRxxbKBVcuOfw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-prometheus-server/-/util-internal-prometheus-server-1.2.1.tgz", + "integrity": "sha512-GhbsEmv0xAkaBaxwZGRavMIO0h68V6LctZIvxsrrPr695bI1mrXKSYDvVvUwLXQ3aDPy9PIQiKdbSjNa60JW6Q==", "requires": { - "@subsquid/util-internal-http-server": "^0.1.1" + "@subsquid/util-internal-http-server": "^1.2.1" } }, - "@subsquid/util-internal-read-lines": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-read-lines/-/util-internal-read-lines-0.0.2.tgz", - "integrity": "sha512-XniSw0MTQXJVAB3pl3ZBylFeFGdPMEwLdWUfOePQYsCH13Y7nat2fJ5W4tK78yJ456UsuB+mw8qS2EuAfcOvfw==", - "dev": true - }, - "@subsquid/util-internal-resilient-rpc": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-resilient-rpc/-/util-internal-resilient-rpc-0.0.3.tgz", - "integrity": "sha512-HExQgeQFHEk7HfnjXZZApHtRF2mAsnu90E7hoWTrVnDzsvMTvtX9tPMjQXKXFoyDDb+WQcVs0yqnzl6rhQY2Iw==", + "@subsquid/util-internal-range": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-range/-/util-internal-range-0.0.1.tgz", + "integrity": "sha512-9hqlPdTJeR9j9+1L3ymOPC0/qJ2IemGkrHmkTq+gwkjtGKmiXuXw4WLgt0Ps5aeupWKfP7UFy1hDE9DZQFseog==", "requires": { - "@subsquid/logger": "^0.3.1", - "@subsquid/rpc-client": "^2.0.0", - "@subsquid/util-internal": "^1.1.0", - "@subsquid/util-internal-counters": "^0.0.2", - "@subsquid/util-internal-http-client": "^0.1.0", - "@subsquid/util-timeout": "^1.0.0" + "@subsquid/util-internal": "^2.5.2", + "@subsquid/util-internal-binary-heap": "^1.0.0" + }, + "dependencies": { + "@subsquid/util-internal": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.2.tgz", + "integrity": "sha512-N7lfZdWEkM35jG5wdGYx25TJKGGLMOx9VInSeRhW9T/3BEmHAuSWI2mIIYnZ8w5L041V8HGo61ijWF6qsXvZjg==" + } } }, + "@subsquid/util-internal-read-lines": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-read-lines/-/util-internal-read-lines-1.2.1.tgz", + "integrity": "sha512-Fh7lGlIwFr88pJ39UdkDeQ2z8JEDk13OuoHJHTmgLtThI4kvmDSpVgMdIUUh9nrzFrP/rzlDsvjACTw4D/mTHw==", + "dev": true + }, "@subsquid/util-naming": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-naming/-/util-naming-0.0.2.tgz", - "integrity": "sha512-t23kWD5kdRi03HXAhMSO1SesmM6dyD8kmMKfBR5SoFScij0Z2zf4dZ/jQT0bH9V59r4eZvv+NxR5XC+uR8GBAQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-naming/-/util-naming-1.2.1.tgz", + "integrity": "sha512-l5rvAXG7TxMPeB5kFTTZWisgN0DNe1mVBHT2V2/nxUx4sOfYfneWIN/+02YqJI/GHX9FoOTB6ru7WLfQEMhvhg==", "requires": { "camelcase": "^6.3.0", "inflected": "^2.1.0" } }, - "@subsquid/util-timeout": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-timeout/-/util-timeout-1.0.0.tgz", - "integrity": "sha512-6LiXYuRKIFcuUOsHPL3qN+cYDZJiCPGQFDdBECrZvXM/FtjF6dloX9JS4LJ7lMHsnKsu7v78+ioiUYpk1Jlyug==" - }, "@subsquid/util-xxhash": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@subsquid/util-xxhash/-/util-xxhash-0.1.2.tgz", - "integrity": "sha512-UQ1opUT0vP2wwCYblM5TvDtvKvPy3LLRI4vVlLPXDelroTa5zkWL3LNTC+Niw4Mvac0u3gpqNDknVdKlKrVvhw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-xxhash/-/util-xxhash-1.2.1.tgz", + "integrity": "sha512-wobgbKK0fd+3ufUVjxcx4zaYII9JY7hbIStyO9M9Q5xrdihiWM5APX27sRuoO8X8oSj34v44JpIMxC8Rbpy3xQ==", "requires": { "xxhash-wasm": "^1.0.2", "xxhashjs": "^0.2.2" } }, + "@substrate/calc": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@substrate/calc/-/calc-0.2.8.tgz", + "integrity": "sha512-1c3mxf35FBeOswduhy0Wil9s4exHahXFo974qa0Ci2AORX8JTxmwhBb10+3Ls9iWoTFwvgOaFr9v1HeRL5tCig==" + }, "@types/accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==", "requires": { "@types/node": "*" } @@ -7916,9 +10370,9 @@ } }, "@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "requires": { "@types/node": "*" } @@ -7928,6 +10382,12 @@ "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" }, + "@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, "@types/express": { "version": "4.17.14", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", @@ -7958,6 +10418,11 @@ "@types/node": "*" } }, + "@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" + }, "@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -7982,9 +10447,9 @@ "dev": true }, "@types/mime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.4.tgz", + "integrity": "sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw==" }, "@types/minimatch": { "version": "5.1.2", @@ -8003,25 +10468,69 @@ "dev": true }, "@types/pg": { - "version": "8.6.6", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.6.tgz", - "integrity": "sha512-O2xNmXebtwVekJDD+02udOncjVcMZQuTEQEMpKJ0ZRf5E7/9JJX3izhKUcUifBkyKpljyUM6BTgy2trmviKlpw==", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.11.2.tgz", + "integrity": "sha512-G2Mjygf2jFMU/9hCaTYxJrwdObdcnuQde1gndooZSOHsNSaCehAuwc7EIuSA34Do8Jx2yZ19KtvW8P0j4EuUXw==", "dev": true, "requires": { "@types/node": "*", "pg-protocol": "*", - "pg-types": "^2.2.0" + "pg-types": "^4.0.1" + }, + "dependencies": { + "pg-types": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.2.tgz", + "integrity": "sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==", + "dev": true, + "requires": { + "pg-int8": "1.0.1", + "pg-numeric": "1.0.2", + "postgres-array": "~3.0.1", + "postgres-bytea": "~3.0.0", + "postgres-date": "~2.1.0", + "postgres-interval": "^3.0.0", + "postgres-range": "^1.1.1" + } + }, + "postgres-array": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz", + "integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==", + "dev": true + }, + "postgres-bytea": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz", + "integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==", + "dev": true, + "requires": { + "obuf": "~1.1.2" + } + }, + "postgres-date": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.1.0.tgz", + "integrity": "sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==", + "dev": true + }, + "postgres-interval": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz", + "integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==", + "dev": true + } } }, "@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + "version": "6.9.10", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==" }, "@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "@types/semver": { "version": "7.3.13", @@ -8029,10 +10538,11 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==" }, "@types/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", "requires": { + "@types/http-errors": "*", "@types/mime": "*", "@types/node": "*" } @@ -8228,6 +10738,77 @@ "eslint-visitor-keys": "^3.3.0" } }, + "@vitest/expect": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", + "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", + "dev": true, + "requires": { + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", + "chai": "^4.3.10" + } + }, + "@vitest/runner": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", + "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", + "dev": true, + "requires": { + "@vitest/utils": "1.3.1", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "dependencies": { + "p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "requires": { + "yocto-queue": "^1.0.0" + } + }, + "yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true + } + } + }, + "@vitest/snapshot": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", + "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", + "dev": true, + "requires": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + } + }, + "@vitest/spy": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", + "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", + "dev": true, + "requires": { + "tinyspy": "^2.2.0" + } + }, + "@vitest/utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", + "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", + "dev": true, + "requires": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + } + }, "accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -8238,9 +10819,9 @@ } }, "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true }, "acorn-jsx": { @@ -8250,6 +10831,12 @@ "dev": true, "requires": {} }, + "acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -8290,9 +10877,9 @@ } }, "apollo-reporting-protobuf": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-3.3.3.tgz", - "integrity": "sha512-L3+DdClhLMaRZWVmMbBcwl4Ic77CnEBPXLW53F7hkYhkaZD88ivbCVB1w/x5gunO6ZHrdzhjq0FHmTsBvPo7aQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-3.4.0.tgz", + "integrity": "sha512-h0u3EbC/9RpihWOmcSsvTW2O6RXVaD/mPEjfrPkxRPTEPWqncsgOoRJw+wih4OqfH3PvTJvoEIf4LwKrUaqWog==", "requires": { "@apollo/protobufjs": "1.2.6" }, @@ -8325,9 +10912,9 @@ } }, "apollo-server-core": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.11.1.tgz", - "integrity": "sha512-t/eCKrRFK1lYZlc5pHD99iG7Np7CEm3SmbDiONA7fckR3EaB/pdsEdIkIwQ5QBBpT5JLp/nwvrZRVwhaWmaRvw==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.13.0.tgz", + "integrity": "sha512-v/g6DR6KuHn9DYSdtQijz8dLOkP78I5JSVJzPkARhDbhpH74QNwrQ2PP2URAPPEDJ2EeZNQDX8PvbYkAKqg+kg==", "requires": { "@apollo/utils.keyvaluecache": "^1.0.1", "@apollo/utils.logger": "^1.0.0", @@ -8338,11 +10925,11 @@ "@graphql-tools/schema": "^8.0.0", "@josephg/resolvable": "^1.0.0", "apollo-datasource": "^3.3.2", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1", "apollo-server-errors": "^3.3.1", - "apollo-server-plugin-base": "^3.7.1", - "apollo-server-types": "^3.7.1", + "apollo-server-plugin-base": "^3.7.2", + "apollo-server-types": "^3.8.0", "async-retry": "^1.2.1", "fast-json-stable-stringify": "^2.1.0", "graphql-tag": "^2.11.0", @@ -8354,6 +10941,34 @@ "whatwg-mimetype": "^3.0.0" }, "dependencies": { + "@graphql-tools/merge": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz", + "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==", + "requires": { + "@graphql-tools/utils": "8.9.0", + "tslib": "^2.4.0" + } + }, + "@graphql-tools/schema": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz", + "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==", + "requires": { + "@graphql-tools/merge": "8.3.1", + "@graphql-tools/utils": "8.9.0", + "tslib": "^2.4.0", + "value-or-promise": "1.0.11" + } + }, + "@graphql-tools/utils": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz", + "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==", + "requires": { + "tslib": "^2.4.0" + } + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -8362,10 +10977,10 @@ "yallist": "^4.0.0" } }, - "node-abort-controller": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", - "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==" + "value-or-promise": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.11.tgz", + "integrity": "sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==" } } }, @@ -8384,9 +10999,9 @@ "requires": {} }, "apollo-server-express": { - "version": "3.11.1", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.11.1.tgz", - "integrity": "sha512-x9ngcpXbBlt4naCXTwNtBFb/mOd9OU0wtFXvJkObHF26NsRazu3DxDfEuekA6V1NFOocD+A9jmVMQeQWug5MgA==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.13.0.tgz", + "integrity": "sha512-iSxICNbDUyebOuM8EKb3xOrpIwOQgKxGbR2diSr4HP3IW8T3njKFOoMce50vr+moOCe1ev8BnLcw9SNbuUtf7g==", "requires": { "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.2", @@ -8394,19 +11009,19 @@ "@types/express": "4.17.14", "@types/express-serve-static-core": "4.17.31", "accepts": "^1.3.5", - "apollo-server-core": "^3.11.1", - "apollo-server-types": "^3.7.1", + "apollo-server-core": "^3.13.0", + "apollo-server-types": "^3.8.0", "body-parser": "^1.19.0", "cors": "^2.8.5", "parseurl": "^1.3.3" } }, "apollo-server-plugin-base": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-3.7.1.tgz", - "integrity": "sha512-g3vJStmQtQvjGI289UkLMfThmOEOddpVgHLHT2bNj0sCD/bbisj4xKbBHETqaURokteqSWyyd4RDTUe0wAUDNQ==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-3.7.2.tgz", + "integrity": "sha512-wE8dwGDvBOGehSsPTRZ8P/33Jan6/PmL0y0aN/1Z5a5GcbFhDaaJCjK5cav6npbbGL2DPKK0r6MPXi3k3N45aw==", "requires": { - "apollo-server-types": "^3.7.1" + "apollo-server-types": "^3.8.0" } }, "apollo-server-plugin-response-cache": { @@ -8420,13 +11035,13 @@ } }, "apollo-server-types": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-3.7.1.tgz", - "integrity": "sha512-aE9RDVplmkaOj/OduNmGa+0a1B5RIWI0o3zC1zLvBTVWMKTpo0ifVf11TyMkLCY+T7cnZqVqwyShziOyC3FyUw==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-3.8.0.tgz", + "integrity": "sha512-ZI/8rTE4ww8BHktsVpb91Sdq7Cb71rdSkXELSwdSR0eXu600/sY+1UXhTWdiJvk+Eq5ljqoHLwLbY2+Clq2b9A==", "requires": { "@apollo/utils.keyvaluecache": "^1.0.1", "@apollo/utils.logger": "^1.0.0", - "apollo-reporting-protobuf": "^3.3.3", + "apollo-reporting-protobuf": "^3.4.0", "apollo-server-env": "^4.2.1" } }, @@ -8445,7 +11060,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dev": true, "requires": { "call-bind": "^1.0.2", "is-array-buffer": "^3.0.1" @@ -8499,6 +11113,12 @@ "es-shim-unscopables": "^1.0.0" } }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, "async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", @@ -8513,9 +11133,9 @@ "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" }, "b4a": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.0.tgz", - "integrity": "sha512-fsTxXxj1081Yq5MOQ06gZ5+e2QcSyP2U6NofdOWyq+lrNI4IjkZ+fLVmoQ6uUCiNg1NWePMMVq93vOTdbJmErw==" + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==" }, "balanced-match": { "version": "1.0.2", @@ -8607,9 +11227,9 @@ "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" }, "bufferutil": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", - "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", + "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", "requires": { "node-gyp-build": "^4.3.0" } @@ -8634,13 +11254,20 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, + "cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true + }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" } }, "callsites": { @@ -8654,6 +11281,21 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" }, + "chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -8678,6 +11320,15 @@ "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==" }, + "check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "requires": { + "get-func-name": "^2.0.2" + } + }, "ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -8832,6 +11483,14 @@ "vary": "^1" } }, + "cross-inspect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cross-inspect/-/cross-inspect-1.0.0.tgz", + "integrity": "sha512-4PFfn4b5ZN6FMNGSZlyb7wUhuN8wvj8t/VQHZdM4JsDcruGJ8L2kf9zao98QIrBPFCpdk27qst/AGTl7pL3ypQ==", + "requires": { + "tslib": "^2.4.0" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -8877,6 +11536,14 @@ "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-2.1.0.tgz", "integrity": "sha512-qTcEYLen3r7ojZNgVUaRggOI+KM7jrKxXeSHhogh/TWxYMeONEMqY+hmkobiYQozsGIyg9OYVzO4ZIfoB4I0pQ==" }, + "date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "requires": { + "@babel/runtime": "^7.21.0" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -8885,16 +11552,26 @@ "ms": "2.0.0" } }, + "deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-equal": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.0.tgz", - "integrity": "sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", "requires": { - "call-bind": "^1.0.2", - "es-get-iterator": "^1.1.2", - "get-intrinsic": "^1.1.3", + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.5", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.2", "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.1", + "is-array-buffer": "^3.0.2", "is-date-object": "^1.0.5", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", @@ -8902,11 +11579,11 @@ "object-is": "^1.1.5", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", + "regexp.prototype.flags": "^1.5.1", "side-channel": "^1.0.4", "which-boxed-primitive": "^1.0.2", "which-collection": "^1.0.1", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.13" } }, "deep-is": { @@ -8924,6 +11601,16 @@ "clone": "^1.0.2" } }, + "define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "requires": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + } + }, "define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", @@ -8931,10 +11618,11 @@ "dev": true }, "define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "requires": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } @@ -8959,6 +11647,12 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true + }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -8978,9 +11672,14 @@ } }, "dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==" + }, + "dset": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", + "integrity": "sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==" }, "easy-table": { "version": "1.2.0", @@ -9143,6 +11842,37 @@ "ext": "^1.1.2" } }, + "esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -9604,6 +12334,15 @@ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, + "estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0" + } + }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -9615,6 +12354,23 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, + "execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + } + }, "express": { "version": "4.18.2", "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", @@ -9816,10 +12572,17 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "function.prototype.name": { "version": "1.1.5", @@ -9843,16 +12606,29 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true + }, "get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, + "get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true + }, "get-symbol-description": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", @@ -10009,9 +12785,9 @@ } }, "graphql-ws": { - "version": "5.11.3", - "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.11.3.tgz", - "integrity": "sha512-fU8zwSgAX2noXAsuFiCZ8BtXeXZOzXyK5u1LloCdacsVth4skdBMPO74EG51lBoWSIZ8beUocdpV8+cQHBODnQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.2.tgz", + "integrity": "sha512-LycmCwhZ+Op2GlHz4BZDsUYHKRiiUz+3r9wbhBATMETNlORQJAaFlAgTFoeRh6xQoQegwYwIylVD1Qns9/DA3w==", "requires": {} }, "has": { @@ -10043,8 +12819,7 @@ "has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" }, "has-symbols": { "version": "1.0.3", @@ -10059,6 +12834,14 @@ "has-symbols": "^1.0.2" } }, + "hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "requires": { + "function-bind": "^1.1.2" + } + }, "highlight.js": { "version": "10.7.3", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", @@ -10082,6 +12865,12 @@ "toidentifier": "1.0.1" } }, + "human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -10153,9 +12942,9 @@ } }, "ioredis": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.0.tgz", - "integrity": "sha512-Id9jKHhsILuIZpHc61QkagfVdUj2Rag5GzG1TGEvRNeM7dtTOjICgjC+tvqYxi//PuX2wjQ+Xjva2ONBuf92Pw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", + "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", "requires": { "@ioredis/commands": "^1.1.1", "cluster-key-slot": "^1.1.0", @@ -10345,6 +13134,12 @@ "call-bind": "^1.0.2" } }, + "is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true + }, "is-string": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", @@ -10486,9 +13281,9 @@ "dev": true }, "keyv": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", - "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "requires": { "json-buffer": "3.0.1" } @@ -10515,6 +13310,16 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, + "local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "requires": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + } + }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -10566,11 +13371,29 @@ "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, + "loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "requires": { + "get-func-name": "^2.0.1" + } + }, "lru-cache": { "version": "7.13.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==" }, + "magic-string": { + "version": "0.30.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.7.tgz", + "integrity": "sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, "md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -10591,6 +13414,12 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -10630,6 +13459,12 @@ "mime-db": "1.52.0" } }, + "mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true + }, "min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -10655,6 +13490,18 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==" }, + "mlly": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.5.0.tgz", + "integrity": "sha512-NPVQvAY1xr1QoVeG0cy8yUYC7FQcOx6evl/RjT1wL5FvzPnzOysoqB/jmx/DhssT2dYa8nxECLAaFI/+gVLhDQ==", + "dev": true, + "requires": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "ufo": "^1.3.2" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -10702,6 +13549,11 @@ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" }, + "node-abort-controller": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==" + }, "node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -10721,9 +13573,9 @@ "integrity": "sha512-F5kfEj95kX8tkDhUCYdV8dg3/8Olx/94zB8+ZNthFs6Bz31UpUi8Xh40TN3thLwXgrwXry1pEg9lJ++tLWTcqA==" }, "node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==" + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.0.tgz", + "integrity": "sha512-PbZERfeFdrHQOOXiAKOY0VPbykZy90ndPKk0d+CFDegTKmWp1VgOTz2xACVbr1BjCWxrQp68CXtvNsveFhqDJg==" }, "normalize-package-data": { "version": "2.5.0", @@ -10745,6 +13597,23 @@ } } }, + "npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "dev": true, + "requires": { + "path-key": "^4.0.0" + }, + "dependencies": { + "path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true + } + } + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -10791,6 +13660,12 @@ "es-abstract": "^1.20.4" } }, + "obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, "ofetch": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.3.tgz", @@ -10817,6 +13692,15 @@ "wrappy": "1" } }, + "onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "requires": { + "mimic-fn": "^4.0.0" + } + }, "open": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", @@ -10951,34 +13835,59 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, "pg": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.10.0.tgz", - "integrity": "sha512-ke7o7qSTMb47iwzOSaZMfeR7xToFdkE71ifIipOAAaLIM0DYzfOAXlgFFmYUIE2BcJtvnVlGCID84ZzCegE8CQ==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz", + "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==", "requires": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", - "pg-connection-string": "^2.5.0", - "pg-pool": "^3.6.0", + "pg-cloudflare": "^1.1.1", + "pg-connection-string": "^2.6.2", + "pg-pool": "^3.6.1", "pg-protocol": "^1.6.0", "pg-types": "^2.1.0", "pgpass": "1.x" } }, + "pg-cloudflare": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", + "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "optional": true + }, "pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", + "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" }, "pg-int8": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" }, + "pg-numeric": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz", + "integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==", + "dev": true + }, "pg-pool": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.0.tgz", - "integrity": "sha512-clFRf2ksqd+F497kWFyM21tMjeikn60oGDmqMT8UBrynEwVEX/5R5xd2sdvdo1cZCFlguORNpVuqxIj+aK4cfQ==", + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz", + "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", "requires": {} }, "pg-protocol": { @@ -11018,12 +13927,42 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, + "pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "requires": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, "pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true }, + "postcss": { + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "dev": true, + "requires": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "dependencies": { + "nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true + } + } + }, "postgres-array": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", @@ -11047,6 +13986,12 @@ "xtend": "^4.0.0" } }, + "postgres-range": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.4.tgz", + "integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==", + "dev": true + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -11059,10 +14004,29 @@ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true }, + "pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "requires": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + } + } + }, "prom-client": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.1.1.tgz", - "integrity": "sha512-hFU32q7UZQ59bVJQGUtm3I2PrJ3gWvoCkilX9sF165ks1qflhugVCeK+S1JjJYHvyt3o5kj68+q3bchormjnzw==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.2.0.tgz", + "integrity": "sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==", "requires": { "tdigest": "^0.1.1" } @@ -11112,6 +14076,12 @@ "unpipe": "1.0.0" } }, + "react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -11206,6 +14176,11 @@ "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" }, + "regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, "regexp-tree": { "version": "0.1.25", "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.25.tgz", @@ -11213,13 +14188,13 @@ "dev": true }, "regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" } }, "regexpp": { @@ -11270,6 +14245,29 @@ "glob": "^7.1.3" } }, + "rollup": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", + "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "dev": true, + "requires": { + "@rollup/rollup-android-arm-eabi": "4.12.0", + "@rollup/rollup-android-arm64": "4.12.0", + "@rollup/rollup-darwin-arm64": "4.12.0", + "@rollup/rollup-darwin-x64": "4.12.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", + "@rollup/rollup-linux-arm64-gnu": "4.12.0", + "@rollup/rollup-linux-arm64-musl": "4.12.0", + "@rollup/rollup-linux-riscv64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-musl": "4.12.0", + "@rollup/rollup-win32-arm64-msvc": "4.12.0", + "@rollup/rollup-win32-ia32-msvc": "4.12.0", + "@rollup/rollup-win32-x64-msvc": "4.12.0", + "@types/estree": "1.0.5", + "fsevents": "~2.3.2" + } + }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -11310,9 +14308,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "scule": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/scule/-/scule-1.0.0.tgz", - "integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/scule/-/scule-1.1.0.tgz", + "integrity": "sha512-vRUjqhyM/YWYzT+jsMk6tnl3NkY4A4soJ8uyh3O6Um+JXEQL9ozUCe7pqrxn3CSKokw0hw3nFStfskzpgYwR0g==" }, "semver": { "version": "7.5.0", @@ -11370,6 +14368,27 @@ "send": "0.18.0" } }, + "set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "requires": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + } + }, + "set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "requires": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + } + }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -11409,12 +14428,30 @@ "object-inspect": "^1.9.0" } }, + "siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, "spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -11452,6 +14489,12 @@ "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==" }, + "stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, "standard-as-callback": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", @@ -11462,6 +14505,12 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, + "std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true + }, "stop-iteration-iterator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", @@ -11532,6 +14581,12 @@ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true }, + "strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true + }, "strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -11547,6 +14602,23 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "strip-literal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", + "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", + "dev": true, + "requires": { + "js-tokens": "^8.0.2" + }, + "dependencies": { + "js-tokens": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", + "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "dev": true + } + } + }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -11561,6 +14633,14 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, + "sync-fetch": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/sync-fetch/-/sync-fetch-0.5.2.tgz", + "integrity": "sha512-6gBqqkHrYvkH65WI2bzrDwrIKmt3U10s4Exnz3dYuE5Ah62FIfNv/F63inrNhu2Nyh3GH5f42GKU3RrSJoaUyQ==", + "requires": { + "node-fetch": "^2.6.1" + } + }, "synckit": { "version": "0.8.5", "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", @@ -11617,6 +14697,24 @@ "globrex": "^0.1.2" } }, + "tinybench": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true + }, + "tinypool": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", + "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "dev": true + }, + "tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -11684,6 +14782,12 @@ "prelude-ls": "^1.2.1" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -11734,15 +14838,16 @@ } }, "typeorm": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.15.tgz", - "integrity": "sha512-R4JSw8QjDP1W+ypeRz/XrCXIqubrLSnNAzJAp9EQSQIPHTv+YmUHZis8g08lOwFpuhqL9m8jkPSz8GWEKlU/ow==", + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.17.tgz", + "integrity": "sha512-UDjUEwIQalO9tWw9O2A4GU+sT3oyoUXheHJy4ft+RFdnRdQctdQ34L9SqE2p7LdwzafHx1maxT+bqXON+Qnmig==", "requires": { "@sqltools/formatter": "^1.2.5", "app-root-path": "^3.1.0", "buffer": "^6.0.3", "chalk": "^4.1.2", "cli-highlight": "^2.1.11", + "date-fns": "^2.29.3", "debug": "^4.3.4", "dotenv": "^16.0.3", "glob": "^8.1.0", @@ -11804,9 +14909,9 @@ "dev": true }, "ufo": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.0.tgz", - "integrity": "sha512-bRn3CsoojyNStCZe0BG0Mt4Nr/4KF+rhFlnNXybgqt5pXHNFRlqinSoQaTrGyzE4X8aHplSb+TorH+COin9Yxw==" + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", + "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==" }, "unbox-primitive": { "version": "1.0.2", @@ -11869,15 +14974,102 @@ "peer": true }, "value-or-promise": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.11.tgz", - "integrity": "sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==" + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", + "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==" }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, + "vite": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.4.tgz", + "integrity": "sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==", + "dev": true, + "requires": { + "esbuild": "^0.19.3", + "fsevents": "~2.3.3", + "postcss": "^8.4.35", + "rollup": "^4.2.0" + } + }, + "vite-node": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", + "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", + "dev": true, + "requires": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "vitest": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", + "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", + "dev": true, + "requires": { + "@vitest/expect": "1.3.1", + "@vitest/runner": "1.3.1", + "@vitest/snapshot": "1.3.1", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.2", + "vite": "^5.0.0", + "vite-node": "1.3.1", + "why-is-node-running": "^2.2.2" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -11957,16 +15149,25 @@ } }, "which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", "requires": { "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "call-bind": "^1.0.4", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.0" + } + }, + "why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "requires": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" } }, "word-wrap": { @@ -11991,9 +15192,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.12.0.tgz", - "integrity": "sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==", + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", "requires": {} }, "xss": { diff --git a/package.json b/package.json index 8db17fd7..537f5bb7 100644 --- a/package.json +++ b/package.json @@ -1,44 +1,48 @@ { "name": "@kodadot1/stick", - "version": "0.0.3", - "description": "GraphQL service for Uniques and Assets on Statemine", + "version": "0.2.0", + "description": "AssetHub block indexer and graphql server", "private": true, "engines": { "node": ">=16" }, "scripts": { "build": "rm -rf lib && tsc", + "test": "vitest run", "update": "npx npm-check-updates --filter /subsquid/ --upgrade && npm i -f", "db:migrate": "npx squid-typeorm-migration apply", "processor:start": "node lib/processor.js", + "lint:fix": "eslint --fix --quiet --ignore-path .gitignore --ext .js,.ts .", "query-node:start": "squid-graphql-server --subscriptions --max-response-size 10000 --dumb-cache in-memory --dumb-cache-ttl 1000 --dumb-cache-size 100 --dumb-cache-max-age 1000" }, "dependencies": { - "@kodadot1/metasquid": "^0.1.6-rc.0", - "@kodadot1/minipfs": "^0.4.1-rc.0", - "@subsquid/archive-registry": "2.1.14", - "@subsquid/graphql-server": "3.3.2", - "@subsquid/ss58": "0.1.4", - "@subsquid/substrate-processor": "2.4.1", - "@subsquid/typeorm-migration": "0.1.6", - "@subsquid/typeorm-store": "0.2.2", - "dotenv": "^16.0.0", + "@kodadot1/hyperdata": "^0.0.1-rc.4", + "@kodadot1/metasquid": "^0.3.0-rc.0", + "@kodadot1/minipfs": "^0.4.2-rc.0", + "@subsquid/archive-registry": "3.3.0", + "@subsquid/graphql-server": "4.3.1", + "@subsquid/ss58": "2.0.1", + "@subsquid/substrate-processor": "7.2.1", + "@subsquid/typeorm-migration": "1.2.2", + "@subsquid/typeorm-store": "1.2.4", + "dotenv": "^16.4.5", "md5": "^2.3.0", "nanoid": "3.3.4", - "pg": "^8.10.0", + "pg": "^8.11.3", "type-graphql": "^1.2.0-rc.1", - "typeorm": "0.3.15" + "typeorm": "0.3.17" }, "devDependencies": { - "@subsquid/substrate-metadata-explorer": "1.1.2", - "@subsquid/substrate-typegen": "2.2.1", - "@subsquid/typeorm-codegen": "0.3.3", + "@subsquid/substrate-metadata-explorer": "3.1.1", + "@subsquid/substrate-typegen": "8.0.1", + "@subsquid/typeorm-codegen": "1.3.2", "@types/md5": "^2.3.2", "@types/node": "18.11.18", - "@types/pg": "^8.6.6", + "@types/pg": "^8.11.2", "eslint": "^8.38.0", "eslint-config-unjs": "^0.1.0", - "prettier": "^2.8.7", - "typescript": "~5.0.4" + "prettier": "^2.8.8", + "typescript": "~5.0.4", + "vitest": "^1.3.1" } } diff --git a/polkadot.json b/polkadot.json new file mode 100644 index 00000000..135bbaef --- /dev/null +++ b/polkadot.json @@ -0,0 +1,104 @@ +{ + "outDir": "src/types/polkadot", + "specVersions": "https://v2.archive.subsquid.io/metadata/asset-hub-polkadot", + "pallets": { + "Assets": { + "events": [ + "Created", + "Destroyed", + "ForceCreated", + "MetadataCleared", + "MetadataSet" + ], + "calls": [], + "storage": [], + "constants": [] + }, + "Uniques": { + "events": [ + "AttributeCleared", + "AttributeSet", + "Burned", + "ClassFrozen", + "ClassMetadataCleared", + "ClassMetadataSet", + "ClassThawed", + "CollectionFrozen", + "CollectionMaxSupplySet", + "CollectionMetadataCleared", + "CollectionMetadataSet", + "CollectionThawed", + "Created", + "Destroyed", + "ForceCreated", + "Frozen", + "Issued", + "ItemBought", + "ItemPriceRemoved", + "ItemPriceSet", + "MetadataCleared", + "MetadataSet", + "OwnerChanged", + "OwnershipAcceptanceChanged", + "TeamChanged", + "Thawed", + "Transferred" + ], + "calls": [], + "storage": [ + "Class", + "InstanceMetadataOf" + ], + "constants": [] + }, + "Nfts": { + "events": [ + "AllApprovalsCancelled", + "ApprovalCancelled", + "AttributeCleared", + "AttributeSet", + "Burned", + "CollectionConfigChanged", + "CollectionLocked", + "CollectionMaxSupplySet", + "CollectionMetadataCleared", + "CollectionMetadataSet", + "CollectionMintSettingsUpdated", + "Created", + "Destroyed", + "ForceCreated", + "Issued", + "ItemAttributesApprovalAdded", + "ItemAttributesApprovalRemoved", + "ItemBought", + "ItemMetadataCleared", + "ItemMetadataSet", + "ItemPriceRemoved", + "ItemPriceSet", + "ItemPropertiesLocked", + "ItemTransferLocked", + "ItemTransferUnlocked", + "NextCollectionIdIncremented", + "OwnerChanged", + "OwnershipAcceptanceChanged", + "PalletAttributeSet", + "PreSignedAttributesSet", + "SwapCancelled", + "SwapClaimed", + "SwapCreated", + "TeamChanged", + "TipSent", + "TransferApproved", + "Transferred" + ], + "calls": [ + "update_mint_settings" + ], + "storage": [ + "Collection", + "ItemMetadataOf" + ], + "constants": [] + } + } +} diff --git a/schema.graphql b/schema.graphql index 5e19899f..1f209f81 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,3 +1,6 @@ +# Entity to represent a collection +# defined on chain as pub type Collection, I: 'static = ()> +# https://github.com/paritytech/polkadot-sdk/blob/b8ad0d1f565659f004165c5244acba78828d0bf7/substrate/frame/nfts/src/lib.rs#L217 type CollectionEntity @entity { attributes: [Attribute!] blockNumber: BigInt @index @@ -26,8 +29,13 @@ type CollectionEntity @entity { updatedAt: DateTime! @index version: Int! volume: BigInt! @index + type: CollectionType + settings: CollectionSettings } +# Entity to group NFTEntity by common metadata +# grouping is done either by NFTEntity.image or NFTEntity.media +# https://github.com/paritytech/polkadot-sdk/blob/b8ad0d1f565659f004165c5244acba78828d0bf7/substrate/frame/nfts/src/lib.rs#L293 type TokenEntity @entity { id: ID! blockNumber: BigInt @@ -45,6 +53,9 @@ type TokenEntity @entity { count: Int! } +# Entity to represent a collection +# defined on chain as pub type Item, I: 'static = ()> +# https://github.com/paritytech/polkadot-sdk/blob/b8ad0d1f565659f004165c5244acba78828d0bf7/substrate/frame/nfts/src/lib.rs#L271 type NFTEntity @entity { attributes: [Attribute!] blockNumber: BigInt @index @@ -71,6 +82,9 @@ type NFTEntity @entity { token: TokenEntity } +# Entity to represent a Metadata +# defined on chain as pub type Metadata, I: 'static = ()> +# https://github.com/paritytech/polkadot-sdk/blob/b8ad0d1f565659f004165c5244acba78828d0bf7/substrate/frame/nfts/src/lib.rs#L283 type MetadataEntity @entity { id: ID! name: String @@ -82,12 +96,27 @@ type MetadataEntity @entity { banner: String } +# Entity to represent an Attribute +# defined on chain as pub type Attribute, I: 'static = ()> +# https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/nfts/src/lib.rs#L305 type Attribute @jsonField { display: String trait: String value: String! } +# Entity to represent a CollectionSettings +# defined on chain as pub type CollectionSettings, I: 'static = ()> +# https://github.com/paritytech/polkadot-sdk/blob/b8ad0d1f565659f004165c5244acba78828d0bf7/substrate/frame/nfts/src/lib.rs#L366 +type CollectionSettings @jsonField { + value: String + startBlock: BigInt + endBlock: BigInt + price: BigInt +} + +# Abstract entity to represent an event +# https://graphql.org/learn/schema/#interfaces interface EventType { id: ID! blockNumber: BigInt @@ -99,6 +128,7 @@ interface EventType { meta: String! } +# Entity to represent an event defined by Interaction type Event implements EventType @entity { id: ID! blockNumber: BigInt @@ -123,6 +153,7 @@ type CollectionEvent implements EventType @entity { # version: Int! } +# Possible on-chain interactions that we listen for enum Interaction { BURN BUY @@ -134,11 +165,32 @@ enum Interaction { UNLIST LOCK CHANGEISSUER + PAY_ROYALTY + # ROYALTY +} + +# Possible collection types +# HolderOf: user can mint if they hold a NFT from a specific collection +# Issuer: only the issuer can mint +# Public: anyone can mint +enum CollectionType { + HolderOf + Issuer + Public } +# Entity to represent a Fungible Asset +# defined on chain as pub type Asset, I: 'static = ()> +# https://github.com/paritytech/polkadot-sdk/blob/99234440f0f8b24f7e4d1d3a0102a9b19a408dd3/substrate/frame/assets/src/lib.rs#L325 type AssetEntity @entity { id: ID! name: String symbol: String decimals: Int } + +# Entity to represent when the cache was last updated +type CacheStatus @entity { + id: ID! + lastBlockTimestamp: DateTime! +} \ No newline at end of file diff --git a/scripts/sub-client.js b/scripts/sub-client.js index 87ba38a3..d6df6bcd 100644 --- a/scripts/sub-client.js +++ b/scripts/sub-client.js @@ -1,5 +1,5 @@ const WebSocket = require('ws') -const { createClient } = require('graphql-ws'); +const { createClient } = require('graphql-ws') const port = process.env.GQL_PORT || 4350 const host = process.env.GQL_HOST || 'localhost' @@ -9,7 +9,7 @@ const proto = process.env.GQL_PROTO || 'ws' const client = createClient({ webSocketImpl: WebSocket, url: `${proto}://${host}:${port}/graphql`, -}); +}) client.subscribe( { @@ -30,13 +30,13 @@ client.subscribe( }, { next: (data) => { - console.log(`New transfers: ${JSON.stringify(data)}`); + console.log(`New transfers: ${JSON.stringify(data)}`) }, error: (error) => { - console.error('error', error); + console.error('error', error) }, complete: () => { - console.log('done!'); + console.log('done!') }, } -); \ No newline at end of file +) \ No newline at end of file diff --git a/speck.yaml b/speck.yaml index 175beee5..4136a0d3 100644 --- a/speck.yaml +++ b/speck.yaml @@ -1,6 +1,6 @@ manifestVersion: subsquid.io/v0.1 name: speck -version: 10 +version: 11 description: 'SubSquid indexer for Uniques and Assets on Statemint' build: deploy: @@ -14,7 +14,7 @@ deploy: - node - lib/processor env: - CHAIN: statemint + CHAIN: polkadot api: cmd: - npx @@ -33,5 +33,5 @@ scale: dedicated: true addons: postgres: - storage: 5G + storage: 2G profile: medium diff --git a/squid.yaml b/squid.yaml index 2243e09c..7a1aa9e7 100644 --- a/squid.yaml +++ b/squid.yaml @@ -1,6 +1,6 @@ manifestVersion: subsquid.io/v0.1 name: stick -version: 9 +version: 10 description: 'SubSquid indexer for Uniques and Assets on Statemine' build: deploy: @@ -14,7 +14,7 @@ deploy: - node - lib/processor env: - CHAIN: statemine + CHAIN: kusama api: cmd: - npx @@ -33,5 +33,5 @@ scale: dedicated: true addons: postgres: - storage: 5G + storage: 2G profile: medium diff --git a/src/environment.ts b/src/environment.ts index 7fc5f663..5b8de476 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -1,18 +1,24 @@ import { lookupArchive } from '@subsquid/archive-registry' -export const CHAIN = process.env.CHAIN || 'statemine' +export type Chain = 'kusama' | 'rococo' | 'polkadot' -// Statemine -const ARCHIVE_URL = lookupArchive('statemine', { release: 'FireSquid' }) -const NODE_URL = 'wss://statemine-rpc.polkadot.io' +export const CHAIN: Chain = process.env.CHAIN as Chain || 'kusama' + +const UNIQUE_STARTING_BLOCK = 323_750 // 618838; +// const _NFT_STARTING_BLOCK = 4_556_552 +export const STARTING_BLOCK = UNIQUE_STARTING_BLOCK + +// Asset Hub +const ARCHIVE_URL = lookupArchive(`asset-hub-${CHAIN}`, { release: 'ArrowSquid' }) +const NODE_URL = `wss://${CHAIN}-asset-hub-rpc.polkadot.io` // Statemint -const DEV_ARCHIVE_URL = lookupArchive('statemint', { release: 'FireSquid' }) -const DEV_NODE_URL = 'wss://statemint-rpc.polkadot.io' +// const DEV_ARCHIVE_URL = lookupArchive('statemint', { release: 'FireSquid' }) +// const DEV_NODE_URL = 'wss://statemint-rpc.polkadot.io' -export const isProd = CHAIN === 'statemine' +export const isProd = CHAIN !== 'rococo' console.log(`Using ${CHAIN} chain ${isProd ? 'production' : 'development'} environment`) -export const getArchiveUrl = (): string => (isProd ? ARCHIVE_URL : DEV_ARCHIVE_URL) -export const getNodeUrl = (): string => (isProd ? NODE_URL : DEV_NODE_URL) +export const getArchiveUrl = (): string => ARCHIVE_URL +export const getNodeUrl = (): string => NODE_URL diff --git a/src/mappings/assets/create.ts b/src/mappings/assets/create.ts new file mode 100644 index 00000000..1381a35a --- /dev/null +++ b/src/mappings/assets/create.ts @@ -0,0 +1,27 @@ +import { getOrCreate } from '@kodadot1/metasquid/entity' +import { AssetEntity as AE } from '../../model' +import { unwrap } from '../utils/extract' +import { debug, pending, success } from '../utils/logger' +import { Action, Context } from '../utils/types' +import { getCreateAssetEvent } from './getters' + +const OPERATION = Action.CREATE + +/** + * Handle the collection create event (Assets.Created) + * Logs Action.CREATE event + * @param context - the context for the event + **/ +export async function handleCollectionCreate(context: Context): Promise { + pending(OPERATION, `[ASSET++]: ${context.block.height}`) + const event = unwrap(context, getCreateAssetEvent) + debug(OPERATION, event) + const final = await getOrCreate(context.store, AE, event.id, {}) + // plsBe(remintable, final); + + final.id = event.id + + success(OPERATION, `[ASSET] ${final.id}`) + await context.store.save(final) + // await createCollectionEvent(final, OPERATION, event, '', context.store); +} diff --git a/src/mappings/assets/forceCreate.ts b/src/mappings/assets/forceCreate.ts new file mode 100644 index 00000000..bbcd545e --- /dev/null +++ b/src/mappings/assets/forceCreate.ts @@ -0,0 +1,29 @@ +import { getOrCreate } from '@kodadot1/metasquid/entity' +import md5 from 'md5' +import { AssetEntity as AE } from '../../model' +import { handleMetadata } from '../shared/metadata' +import { unwrap } from '../utils/extract' +import { versionOf } from '../utils/helper' +import { debug, pending, success } from '../utils/logger' +import { Action, Context } from '../utils/types' +import { getForceCreateAssetEvent } from './getters' + +const OPERATION = Action.CREATE + +/** + * Handle the force collection create event (Assets.ForceCreated) + * Logs Action.CREATE event + * @param context - the context for the event + **/ +export async function handleForceCollectionCreate(context: Context): Promise { + pending(OPERATION, `[FORCE]: ${context.block.height}`) + const event = unwrap(context, getForceCreateAssetEvent) + debug(OPERATION, event) + const final = await getOrCreate(context.store, AE, event.id, {}) + // plsBe(remintable, final); + final.id = event.id + + success(OPERATION, `[ASSET] ${final.id}`) + await context.store.save(final) + // await createCollectionEvent(final, OPERATION, event, '', context.store); +} diff --git a/src/mappings/assets/forceToken.ts b/src/mappings/assets/forceToken.ts index be4c7536..cc5062c6 100644 --- a/src/mappings/assets/forceToken.ts +++ b/src/mappings/assets/forceToken.ts @@ -1,49 +1,79 @@ import { create } from '@kodadot1/metasquid/entity' -import { BlockHandlerContext } from '@subsquid/substrate-processor' +import { Store } from '@subsquid/typeorm-store' +import { CHAIN, Chain } from '../../environment' import { AssetEntity } from '../../model' -import { Store } from '../utils/types' import { pending, success } from '../utils/logger' -import { isProd } from '../../environment' +import { BatchContext } from '../utils/types' + const OPERATION = 'ASSET_REGISTER' as any -export async function forceCreateSystemAsset(context: BlockHandlerContext): Promise { - pending(OPERATION, `${context.block.height}`); - const systemAsset = isProd - ? { +type Asset = { + name: string, + symbol: string, + decimals: number, +} + +const systemAsset: Record = +{ + kusama: { name: 'Kusama', symbol: 'KSM', decimals: 12, - } - : { + }, + polkadot: { name: 'Polkadot', symbol: 'DOT', decimals: 10, - } + }, + rococo: { + name: 'Rococo', + symbol: 'ROC', + decimals: 12, + }, +} + +export const ALLOW_LIST = ['1984'] + +/** + * Forcefully create the system asset + * @param context - BatchContext + */ +export async function forceCreateSystemAsset(context: BatchContext): Promise { + pending(OPERATION, `${context.blocks.at(0)?.header.height}`) + const selected = systemAsset[CHAIN] - const asset = create(AssetEntity, '', systemAsset); - success(OPERATION,`${asset.id} is ${asset.name || ''}`); - await context.store.save(asset); + const asset = create(AssetEntity, '', selected) + success(OPERATION,`${asset.id} is ${asset.name || ''}`) + await context.store.save(asset) } -export async function forceCreateUsdtAsset(context: BlockHandlerContext): Promise { - pending(OPERATION, `${context.block.height}`); +/** + * Forcefully create the USDT asset + * @param context - BatchContext + */ +export async function forceCreateUsdtAsset(context: BatchContext): Promise { + pending(OPERATION, `${context.blocks.at(0)?.header.height}`) const asset = create(AssetEntity, '1984', { name: 'Tether USD', symbol: 'USDt', decimals: 6, - }); - success(OPERATION,`${asset.id} is ${asset.name || ''}`); - await context.store.save(asset); + }) + success(OPERATION,`${asset.id} is ${asset.name || ''}`) + await context.store.save(asset) } -export async function forceCreateRmrkAsset(context: BlockHandlerContext): Promise { - pending(OPERATION, `${context.block.height}`); +/** + * Forcefully create the RMRK asset + * @param context - BatchContext + */ +export async function forceCreateRmrkAsset(context: BatchContext): Promise { + pending(OPERATION, `${context.blocks.at(0)?.header.height}`) const asset = create(AssetEntity, '8', { name: 'RMRK.app', symbol: 'RMRK', decimals: 10, - }); - success(OPERATION,`${asset.id} is ${asset.name || ''}`); - await context.store.save(asset); + }) + success(OPERATION,`${asset.id} is ${asset.name || ''}`) + await context.store.save(asset) } \ No newline at end of file diff --git a/src/mappings/assets/getters/index.ts b/src/mappings/assets/getters/index.ts new file mode 100644 index 00000000..1893e021 --- /dev/null +++ b/src/mappings/assets/getters/index.ts @@ -0,0 +1,19 @@ +import { CHAIN } from '../../../environment' +import { Context } from '../../utils/types' +import { CreateAssetEvent, ForceCreateAssetEvent, SetMetadata } from '../types' + +// eslint-disable-next-line unicorn/prefer-module +const proc = require(`./${CHAIN}`) + +export function getCreateAssetEvent(_ctx: Context): CreateAssetEvent { + const ctx = _ctx.event + return proc.getCreateAssetEvent(ctx) +} +export function getForceCreateAssetEvent(_ctx: Context): ForceCreateAssetEvent { + const ctx = _ctx.event + return proc.getForceCreateAssetEvent(ctx) +} +export function getCreateAssetMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event + return proc.getCreateAssetMetadataEvent(ctx) +} diff --git a/src/mappings/assets/getters/kusama.ts b/src/mappings/assets/getters/kusama.ts new file mode 100644 index 00000000..dc322961 --- /dev/null +++ b/src/mappings/assets/getters/kusama.ts @@ -0,0 +1,49 @@ +import { assets as events } from '../../../types/kusama/events' +import { addressOf, idOf, unHex } from '../../utils/helper' +import { Event } from '../../utils/types' +import { CreateAssetEvent, ForceCreateAssetEvent, SetMetadata } from '../types' + +export function getCreateAssetEvent(ctx: Event): CreateAssetEvent { + const event = events.created + + if (event.v1.is(ctx)) { + const [classId, creator, owner] = event.v1.decode(ctx) + return { id: idOf(classId), caller: addressOf(creator), owner: addressOf(owner) } + } + if (event.v700.is(ctx)) { + const { assetId: classId, creator, owner } = event.v700.decode(ctx) + return { id: idOf(classId), caller: addressOf(creator), owner: addressOf(owner) } + } + + // warn(Interaction.CREATE, 'USING UNSAFE GETTER! PLS UPDATE TYPES!') + const { assetId: classId, creator, owner } = event.v700.decode(ctx) + return { id: idOf(classId), caller: addressOf(creator), owner: addressOf(owner) } +} + +export function getForceCreateAssetEvent(ctx: Event): ForceCreateAssetEvent { + const event = events.forceCreated + if (event.v1.is(ctx)) { + const [classId, owner] = event.v1.decode(ctx) + return { id: idOf(classId), owner: addressOf(owner) } + } + if (event.v700.is(ctx)) { + const { assetId: classId, owner } = event.v700.decode(ctx) + return { id: idOf(classId), owner: addressOf(owner) } + } + + const { assetId: classId, owner } = event.v700.decode(ctx) + return { id: idOf(classId), owner: addressOf(owner) } +} + +export function getCreateAssetMetadataEvent(ctx: Event): SetMetadata { + const event = events.metadataSet + + if (event.v1.is(ctx)) { + const [assetId, name, symbol, decimals, isFrozen] = event.v1.decode(ctx) + return { id: idOf(assetId), name: unHex(name), symbol: unHex(symbol), decimals, isFrozen } + } + + + const { assetId, name, symbol, decimals, isFrozen } = event.v700.decode(ctx) + return { id: idOf(assetId), name: unHex(name), symbol: unHex(symbol), decimals, isFrozen } +} \ No newline at end of file diff --git a/src/mappings/assets/getters/polkadot.ts b/src/mappings/assets/getters/polkadot.ts new file mode 100644 index 00000000..256af166 --- /dev/null +++ b/src/mappings/assets/getters/polkadot.ts @@ -0,0 +1,48 @@ +import { assets as events } from '../../../types/polkadot/events' +import { addressOf, idOf, unHex } from '../../utils/helper' +import { Event } from '../../utils/types' +import { CreateAssetEvent, ForceCreateAssetEvent, SetMetadata } from '../types' + +export function getCreateAssetEvent(ctx: Event): CreateAssetEvent { + const event = events.created + + if (event.v601.is(ctx)) { + const [classId, creator, owner] = event.v601.decode(ctx) + return { id: idOf(classId), caller: addressOf(creator), owner: addressOf(owner) } + } + if (event.v700.is(ctx)) { + const { assetId: classId, creator, owner } = event.v700.decode(ctx) + return { id: idOf(classId), caller: addressOf(creator), owner: addressOf(owner) } + } + + // warn(Interaction.CREATE, 'USING UNSAFE GETTER! PLS UPDATE TYPES!') + const { assetId: classId, creator, owner } = event.v700.decode(ctx) + return { id: idOf(classId), caller: addressOf(creator), owner: addressOf(owner) } +} + +export function getForceCreateAssetEvent(ctx: Event): ForceCreateAssetEvent { + const event = events.forceCreated + if (event.v601.is(ctx)) { + const [classId, owner] = event.v601.decode(ctx) + return { id: idOf(classId), owner: addressOf(owner) } + } + if (event.v700.is(ctx)) { + const { assetId: classId, owner } = event.v700.decode(ctx) + return { id: idOf(classId), owner: addressOf(owner) } + } + + const { assetId: classId, owner } = event.v700.decode(ctx) + return { id: idOf(classId), owner: addressOf(owner) } +} + +export function getCreateAssetMetadataEvent(ctx: Event): SetMetadata { + const event = events.metadataSet + + if (event.v601.is(ctx)) { + const [assetId, name, symbol, decimals, isFrozen] = event.v601.decode(ctx) + return { id: idOf(assetId), name: unHex(name), symbol: unHex(symbol), decimals, isFrozen } + } + + const { assetId, name, symbol, decimals, isFrozen } = event.v700.decode(ctx) + return { id: idOf(assetId), name: unHex(name), symbol: unHex(symbol), decimals, isFrozen } +} diff --git a/src/mappings/assets/index.ts b/src/mappings/assets/index.ts index a7e2f499..65091a1b 100644 --- a/src/mappings/assets/index.ts +++ b/src/mappings/assets/index.ts @@ -1 +1,4 @@ export * from './forceToken' + +// export * from './create' +export * from './setMetadata' diff --git a/src/mappings/assets/setMetadata.ts b/src/mappings/assets/setMetadata.ts new file mode 100644 index 00000000..e73cd53b --- /dev/null +++ b/src/mappings/assets/setMetadata.ts @@ -0,0 +1,37 @@ +import { getOrCreate } from '@kodadot1/metasquid/entity' +import { unwrap } from '../utils/extract' +import { debug } from '../utils/logger' +import { Context } from '../utils/types' +// import { tokenIdOf } from './types' +import { AssetEntity as AE } from '../../model' +import { getCreateAssetMetadataEvent } from './getters' +import { ALLOW_LIST } from './forceToken' + +const OPERATION = 'METADATA' as any + +/** + * Handle the asset metadata set event (Assets.MetadataSet) + * Logs Action.METADATA event + * @param context - the context for the event + **/ +export async function handleAssetMetadataSet(context: Context): Promise { + const event = unwrap(context, getCreateAssetMetadataEvent) + debug(OPERATION, event) + + if (!ALLOW_LIST.includes(event.id)) { + return + } + + const final = await getOrCreate(context.store, AE, event.id, {}) + + // if (!final) { + // warn(OPERATION, `MISSING ${event.collectionId}-${event.sn}`) + // return + // } + + final.decimals = event.decimals + final.name = event.name + final.symbol = event.symbol + + await context.store.save(final) +} diff --git a/src/mappings/assets/types.ts b/src/mappings/assets/types.ts new file mode 100644 index 00000000..a00a8a84 --- /dev/null +++ b/src/mappings/assets/types.ts @@ -0,0 +1,21 @@ +export type WithId = { + id: string +} + +export type BaseAssetEvent = { + id: string + caller: string +} + +export type CreateAssetEvent = BaseAssetEvent & { + owner: string +} + +export type ForceCreateAssetEvent = Omit + +export type SetMetadata = WithId & { + name: string; + symbol: string; + decimals: number; + isFrozen: boolean; +} \ No newline at end of file diff --git a/src/mappings/index.ts b/src/mappings/index.ts new file mode 100644 index 00000000..9d402d11 --- /dev/null +++ b/src/mappings/index.ts @@ -0,0 +1,329 @@ +import { logger } from '@kodadot1/metasquid/logger' + +import { Store } from '@subsquid/typeorm-store' +import { STARTING_BLOCK } from '../environment' +import { NFTEntity as NE } from '../model' +import { Asset, NonFungible, NonFungibleCall, NewNonFungible, Unique } from '../processable' +import * as a from './assets' +import * as n from './nfts' +import * as u from './uniques' +import { BatchContext, Context, SelectedEvent } from './utils/types' +import { updateCache } from './utils/cache' +import { logError } from './utils/logger' + +type HandlerFunction = (item: T, ctx: Context) => Promise + +/** + * Main entry point for processing non-fungibles on unique pallet + * @param item - the event to process + * @param ctx - the context for the event +**/ +export async function uniques(item: T, ctx: Context): Promise { + switch (item.name) { + case Unique.createCollection: + await u.handleCollectionCreate(ctx) + break + case Unique.forceCreateClass: + await u.handleForceCollectionCreate(ctx) + break + case Unique.clearClassMetadata: + await u.handleMetadataSet(ctx) + break + case Unique.setClassMetadata: + await u.handleMetadataSet(ctx) + break + case Unique.setCollectionMaxSupply: + await u.handleCollectionLock(ctx) + break + case Unique.clearCollectionMetadata: + await u.handleMetadataSet(ctx) + break + case Unique.setCollectionMetadata: + await u.handleMetadataSet(ctx) + break + case Unique.setAttribute: + case Unique.clearAttribute: + await u.handleAttributeSet(ctx) + break + case Unique.destroyCollection: + await u.handleCollectionDestroy(ctx) + break + case Unique.burn: + await u.handleTokenBurn(ctx) + break + case Unique.createItem: + await u.handleTokenCreate(ctx) + break + case Unique.sold: + await u.handleTokenBuy(ctx) + break + case Unique.clearPrice: + await u.handleTokenList(ctx) + break + case Unique.setPrice: + await u.handleTokenList(ctx) + break + case Unique.clearMetadata: + await u.handleMetadataSet(ctx) + break + case Unique.setMetadata: + await u.handleMetadataSet(ctx) + break + case Unique.changeIssuer: + await u.handleCollectionOwnerChange(ctx) + break + case Unique.changeTeam: + await u.handleCollectionTeamChange(ctx) + break + case Unique.transfer: + await u.handleTokenTransfer(ctx) + break + default: + throw new Error(`Unknown event ${item.name}`) + } + // return item +} + +/** + * Main entry point for processing non-fungible tokens + * @param item - the event to process + * @param ctx - the context for the event +**/ +export async function nfts(item: T, ctx: Context): Promise { + switch (item.name) { + case NonFungible.createCollection: + await n.handleCollectionCreate(ctx) + break + case NonFungible.clearAttribute: + await n.handleAttributeSet(ctx) + break + case NonFungible.setAttribute: + await n.handleAttributeSet(ctx) + break + case NonFungible.burn: + await n.handleTokenBurn(ctx) + break + case NonFungible.forceCreateCollection: + await n.handleForceCollectionCreate(ctx) + break + case NonFungible.clearCollectionMetadata: + await n.handleMetadataSet(ctx) + break + case NonFungible.setCollectionMetadata: + await n.handleMetadataSet(ctx) + break + case NonFungible.setCollectionMaxSupply: + await n.handleCollectionLock(ctx) + break + case NonFungible.destroyCollection: + await n.handleCollectionDestroy(ctx) + break + case NonFungible.createItem: + await n.handleTokenCreate(ctx) + break + case NonFungible.sold: + await n.handleTokenBuy(ctx) + break + case NonFungible.clearPrice: + await n.handleTokenList(ctx) + break + case NonFungible.setPrice: + await n.handleTokenList(ctx) + break + case NonFungible.clearMetadata: + await n.handleMetadataSet(ctx) + break + case NonFungible.setMetadata: + await n.handleMetadataSet(ctx) + break + case NonFungible.changeIssuer: + await n.handleCollectionOwnerChange(ctx) + break + case NonFungible.changeTeam: + await n.handleCollectionTeamChange(ctx) + break + case NonFungible.transfer: + await n.handleTokenTransfer(ctx) + break + case NonFungibleCall.updateMintSettings: + await n.handleCollectionMintUpdate(ctx) + break + case NewNonFungible.sendTip: + await n.handleTipSend(ctx) + break + default: + throw new Error(`Unknown event ${item.name}`) + } +} + +/** + * Main entry point for processing assets + * @param item - the event to process + * @param ctx - the context for the event +**/ +export async function assets(item: T, ctx: Context): Promise { + switch (item.name) { + case Asset.setMetadata: + await a.handleAssetMetadataSet(ctx) + break + default: + throw new Error(`Unknown event ${item.name}`) + } +} + +/** + * Force create system and USDT assets + * Only call this once, at the start of the processing +**/ +export async function forceAssets(ctx: BatchContext): Promise { + logger.info('Forcing assets') + await a.forceCreateSystemAsset(ctx) + await a.forceCreateUsdtAsset(ctx) +} + +/** + * Smart pattern matching to determine which handler to use + * currently supports Uniques, Nfts, and Assets +**/ +const globalHandler: Record = { + Uniques: uniques, + Nfts: nfts, + Assets: assets, +} + +/** + * mainFrame is the main entry point for processing a batch of blocks +**/ +export async function mainFrame(ctx: BatchContext): Promise { + const start = ctx.blocks[0].header.height + if (STARTING_BLOCK === start) { + await forceAssets(ctx) + } + + logger.info( + `Processing ${ctx.blocks.length} blocks from ${ctx.blocks[0].header.height} to ${ + ctx.blocks[ctx.blocks.length - 1].header.height + }` + ) + + for (const block of ctx.blocks) { + for (let event of block.events) { + logger.debug(`Processing ${event.name}`) + const [pallet] = event.name.split('.') + const handler = globalHandler[pallet] + if (!handler) { + throw new Error(`Unknown pallet ${pallet}`) + } + await handler(event, { + event, + block: block.header, + store: ctx.store, + extrinsic: event.extrinsic, + call: event.call, + }) + // const item = event + } + } + + // const lastDate = new Date(ctx.blocks[ctx.blocks.length - 1].header.timestamp || start) + // await updateCache(lastDate, ctx.store) + + // const { contracts, tokens } = uniqueEntitySets(items) + // const collections = await finalizeCollections(contracts, ctx) + // const finish = await whatToDoWithTokens({ tokens, collections, items }, ctx) + // const complete = await completeTokens(ctx, finish) + + // logger.info(`Batch completed, ${complete.length} tokens saved`) +} + +// function unwrapLog(log: Log, block: BlockData) { +// switch (log.topics[0]) { +// case ERC721_TRANSFER: + +// if (log.address !== Contracts.HueNft) { +// return null +// } +// return handle721Token(log, block) +// default: +// // console.log('unknown log', log.topics[0]) +// return null +// // throw new Error('unknown log') +// } +// } + +type What = { + // tokens: Set, + // collections: EnMap, + // items: ItemStateUpdate[], +} + +export async function whatToDoWithTokens(x: What, ctx: Context) { + // // ctx.store.findBy(CE, {id: In([...collectionMap.keys()])}) + // const knownTokens = await findByIdListAsMap(ctx.store, NE, tokens) + // const events: EventEntity[] = [] + // for (const item of items) { + // logger.debug(`APPLY ${item.interaction} on ${item.id}`) + // let knownToken = knownTokens.get(item.id) ?? create(NE, item.id, {}) + // if (item.applyFrom) { + // const collection = collections.get(item.contract)! + // item.applyFrom(collection) + // } + // if (item.applyTo) { + // knownToken = item.applyTo(knownToken) + // } + // events.push(item.event) + // knownTokens.set(item.id, knownToken) + // } + // const values = [...knownTokens.values()] + // await ctx.store.upsert(values) + // await ctx.store.save(events) + // return knownTokens +} + +type EnMap = Map +// TODO: do only if event was mint. +async function completeTokens(ctx: Context, tokenMap: EnMap) { + // const collections = groupedItemsByCollection(tokenMap.keys()) + // const final: NE[] = [] + // const metadataFutures: Promise>[] = [] + // for (const [contract, ids] of collections.entries()) { + // const list = Array.from(ids) + // const tokens = await multicallMetadataFetch(ctx, contract, list) + // for (const [i, id] of list.entries()) { + // const realId = createTokenId(contract, id) + // const token = tokenMap.get(realId)! + // if (!token.metadata) { + // const metadata = tokens[i] + // token.metadata = metadata + // const getMeta = handleMetadata(metadata, ctx.store).then(m => { + // if (m) { + // token.meta = m + // token.name = m.name + // token.image = m.image + // token.media = m.animationUrl + // } + // return m + // }) + // metadataFutures.push(getMeta) + // final.push(token) + // } + // } + // } + // const metaList = await Promise.all(metadataFutures) + // const filtered = metaList.filter(m => m) as MetadataEntity[] + // logger.debug(`Saving ${filtered.length} metadata`) + // await ctx.store.save(filtered) + // await ctx.store.save(final) + // return final + // } + // async function multicallMetadataFetch(ctx: Context, collection: string, tokens: Array): Promise { + // const tokenIds = tokens.map((id) => [BigInt(id)]) + // const contract = new Multicall(ctx, lastBatchBlock(ctx), MULTICALL_ADDRESS) + // const metadata = await contract.aggregate( + // erc721.functions.tokenURI, + // collection, + // tokenIds, + // MULTICALL_BATCH_SIZE + // ) + // return metadata +} diff --git a/src/mappings/nfts/burn.ts b/src/mappings/nfts/burn.ts index f156d442..4bf93dcf 100644 --- a/src/mappings/nfts/burn.ts +++ b/src/mappings/nfts/burn.ts @@ -10,6 +10,12 @@ import { getBurnTokenEvent } from './getters' const OPERATION = Action.BURN +/** + * Handle the token burn event (Nfts.Burned) + * Marks the token as burned + * Logs Action.BURN event + * @param context - the context for the event +**/ export async function handleTokenBurn(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getBurnTokenEvent) diff --git a/src/mappings/nfts/buy.ts b/src/mappings/nfts/buy.ts index 088e390e..3701f9f6 100644 --- a/src/mappings/nfts/buy.ts +++ b/src/mappings/nfts/buy.ts @@ -9,6 +9,12 @@ import { getBuyTokenEvent } from './getters' const OPERATION = Action.BUY +/** + * Handle the token buy event (Nfts.ItemBought) + * Changes the owner of the token, updates the collection volume, highest sale, floor, owner count and distribution + * Logs Action.BUY event + * @param context - the context for the event +**/ export async function handleTokenBuy(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getBuyTokenEvent) diff --git a/src/mappings/nfts/change.ts b/src/mappings/nfts/change.ts index 6b48a416..84c9720d 100644 --- a/src/mappings/nfts/change.ts +++ b/src/mappings/nfts/change.ts @@ -7,6 +7,12 @@ import { getChangeCollectionOwnerEvent } from './getters' const OPERATION = Action.CHANGEISSUER +/** + * Handle the collection owner change event (Nfts.OwnerChanged) + * Changes the owner of the collection + * Logs Action.CHANGEISSUER event + * @param context - the context for the event + **/ export async function handleCollectionOwnerChange(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getChangeCollectionOwnerEvent) diff --git a/src/mappings/nfts/changeTeam.ts b/src/mappings/nfts/changeTeam.ts index c249d26a..81fedbd2 100644 --- a/src/mappings/nfts/changeTeam.ts +++ b/src/mappings/nfts/changeTeam.ts @@ -7,6 +7,12 @@ import { getChangeTeamEvent } from './getters' const OPERATION = Action.CHANGEISSUER +/** + * Handle the collection team change event (Nfts.TeamChanged) + * Changes the team of the collection + * Logs Action.CHANGEISSUER event + * @param context - the context for the event + **/ export async function handleCollectionTeamChange(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getChangeTeamEvent) diff --git a/src/mappings/nfts/create.ts b/src/mappings/nfts/create.ts index a295173e..4a13e31f 100644 --- a/src/mappings/nfts/create.ts +++ b/src/mappings/nfts/create.ts @@ -10,6 +10,12 @@ import { getCreateCollectionEvent } from './getters' const OPERATION = Action.CREATE +/** + * Handle the collection create event (Nfts.Created) + * Creates a new collection entity + * Logs Action.CREATE event + * @param context - the context for the event + **/ export async function handleCollectionCreate(context: Context): Promise { pending(OPERATION, `[COLECTTION++]: ${context.block.height}`) const event = unwrap(context, getCreateCollectionEvent) diff --git a/src/mappings/nfts/destroy.ts b/src/mappings/nfts/destroy.ts index 751587c8..ac02b195 100644 --- a/src/mappings/nfts/destroy.ts +++ b/src/mappings/nfts/destroy.ts @@ -7,6 +7,12 @@ import { getDestroyCollectionEvent } from './getters' const OPERATION = Action.DESTROY +/** + * Handle the collection destroy event (Nfts.Destroyed) + * Marks the collection as burned + * Logs Action.DESTROY event + * @param context - the context for the event + **/ export async function handleCollectionDestroy(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getDestroyCollectionEvent) diff --git a/src/mappings/nfts/forceCreate.ts b/src/mappings/nfts/forceCreate.ts index 41fe7187..d99c141e 100644 --- a/src/mappings/nfts/forceCreate.ts +++ b/src/mappings/nfts/forceCreate.ts @@ -10,6 +10,12 @@ import { getForceCreateCollectionEvent } from './getters' const OPERATION = Action.CREATE +/** + * Handle the collection force create event (Nfts.ForceCreated) + * Creates a new collection entity + * Logs Action.CREATE event + * @param context - the context for the event + **/ export async function handleForceCollectionCreate(context: Context): Promise { pending(OPERATION, `[FORCE]: ${context.block.height}`) const event = unwrap(context, getForceCreateCollectionEvent) diff --git a/src/mappings/nfts/getters/index.ts b/src/mappings/nfts/getters/index.ts index 8e30b464..463d7872 100644 --- a/src/mappings/nfts/getters/index.ts +++ b/src/mappings/nfts/getters/index.ts @@ -1,4 +1,4 @@ -import { isProd } from '../../../environment' +import { CHAIN } from '../../../environment' import { Context } from '../../utils/types' import { BurnTokenEvent, @@ -14,99 +14,133 @@ import { SetAttribute, SetMetadata, TransferTokenEvent, + UpdateMintSettings, } from '../types' // eslint-disable-next-line unicorn/prefer-module -const proc = isProd ? require('./statemine') : require('./statemint') +const proc = require(`./${CHAIN}`) -export function getCreateCollectionEvent(ctx: Context): CreateCollectionEvent { - return proc.getCreateCollectionEvent(ctx); +export function getCreateCollectionEvent(_ctx: Context): CreateCollectionEvent { + const ctx = _ctx.event + return proc.getCreateCollectionEvent(ctx) } -export function getForceCreateCollectionEvent(ctx: Context): ForceCreateCollectionEvent { - return proc.getForceCreateCollectionEvent(ctx); +export function getForceCreateCollectionEvent(_ctx: Context): ForceCreateCollectionEvent { + const ctx = _ctx.event + return proc.getForceCreateCollectionEvent(ctx) } -export function getCreateTokenEvent(ctx: Context): CreateTokenEvent { - return proc.getCreateTokenEvent(ctx); +export function getCreateTokenEvent(_ctx: Context): CreateTokenEvent { + const ctx = _ctx.event + return proc.getCreateTokenEvent(ctx) } -export function getTransferTokenEvent(ctx: Context): TransferTokenEvent { - return proc.getTransferTokenEvent(ctx); +export function getTransferTokenEvent(_ctx: Context): TransferTokenEvent { + const ctx = _ctx.event + return proc.getTransferTokenEvent(ctx) } -export function getBurnTokenEvent(ctx: Context): BurnTokenEvent { - return proc.getBurnTokenEvent(ctx); +export function getTipSentEvent(_ctx: Context) { + const ctx = _ctx.event + return proc.getTipSentEvent(ctx) } -export function getDestroyCollectionEvent(ctx: Context): DestroyCollectionEvent { - return proc.getDestroyCollectionEvent(ctx); +export function getBurnTokenEvent(_ctx: Context): BurnTokenEvent { + const ctx = _ctx.event + return proc.getBurnTokenEvent(ctx) } -export function getListTokenEvent(ctx: Context): ListTokenEvent { - return proc.getListTokenEvent(ctx); +export function getDestroyCollectionEvent(_ctx: Context): DestroyCollectionEvent { + const ctx = _ctx.event + return proc.getDestroyCollectionEvent(ctx) } -export function getUnListTokenEvent(ctx: Context): ListTokenEvent { - return proc.getUnListTokenEvent(ctx); +export function getListTokenEvent(_ctx: Context): ListTokenEvent { + const ctx = _ctx.event + return proc.getListTokenEvent(ctx) } -export function getPriceTokenEvent(ctx: Context): ListTokenEvent { - return proc.getPriceTokenEvent(ctx); +export function getUnListTokenEvent(_ctx: Context): ListTokenEvent { + const ctx = _ctx.event + return proc.getUnListTokenEvent(ctx) } -export function getBuyTokenEvent(ctx: Context): BuyTokenEvent { - return proc.getBuyTokenEvent(ctx); +export function getPriceTokenEvent(_ctx: Context): ListTokenEvent { + const ctx = _ctx.event + return proc.getPriceTokenEvent(ctx) } -export function getLockCollectionEvent(ctx: Context): LockCollectionEvent { - return proc.getLockCollectionEvent(ctx); +export function getBuyTokenEvent(_ctx: Context): BuyTokenEvent { + const ctx = _ctx.event + return proc.getBuyTokenEvent(ctx) } -export function getChangeCollectionOwnerEvent(ctx: Context): ChangeCollectionOwnerEvent { - return proc.getChangeCollectionOwnerEvent(ctx); +export function getLockCollectionEvent(_ctx: Context): LockCollectionEvent { + const ctx = _ctx.event + return proc.getLockCollectionEvent(ctx) } -export function getClearCollectionMetadataEvent(ctx: Context): SetMetadata { - return proc.getClearCollectionMetadataEvent(ctx); +export function getChangeCollectionOwnerEvent(_ctx: Context): ChangeCollectionOwnerEvent { + const ctx = _ctx.event + return proc.getChangeCollectionOwnerEvent(ctx) } -export function getCreateCollectionMetadataEvent(ctx: Context): SetMetadata { - return proc.getCreateCollectionMetadataEvent(ctx); +export function getClearCollectionMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event + return proc.getClearCollectionMetadataEvent(ctx) } -export function getClearClassMetadataEvent(ctx: Context): SetMetadata { - return proc.getClearClassMetadataEvent(ctx); +export function getCreateCollectionMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event + return proc.getCreateCollectionMetadataEvent(ctx) } -export function getCreateClassMetadataEvent(ctx: Context): SetMetadata { - return proc.getCreateClassMetadataEvent(ctx); +export function getClearClassMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event + return proc.getClearClassMetadataEvent(ctx) } -export function getCreateMetadataEvent(ctx: Context): SetMetadata { - return proc.getCreateMetadataEvent(ctx); +export function getCreateClassMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event + return proc.getCreateClassMetadataEvent(ctx) } -export function getClearMetadataEvent(ctx: Context): SetMetadata { - return proc.getClearMetadataEvent(ctx); +export function getCreateMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event + return proc.getCreateMetadataEvent(ctx) } -export function getMetadataEvent(ctx: Context): SetMetadata { - return proc.getMetadataEvent(ctx); +export function getClearMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event + return proc.getClearMetadataEvent(ctx) } -export function getSetAttributeEvent(ctx: Context): SetAttribute { - return proc.getSetAttributeEvent(ctx); +export function getMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event + return proc.getMetadataEvent(ctx) } -export function getClearAttributeEvent(ctx: Context): SetAttribute { - return proc.getClearAttributeEvent(ctx); +export function getSetAttributeEvent(_ctx: Context): SetAttribute { + const ctx = _ctx.event + return proc.getSetAttributeEvent(ctx) } -export function getAttributeEvent(ctx: Context): SetAttribute { - return proc.getAttributeEvent(ctx); +export function getClearAttributeEvent(_ctx: Context): SetAttribute { + const ctx = _ctx.event + return proc.getClearAttributeEvent(ctx) } -export function getChangeTeamEvent(ctx: Context): ChangeCollectionTeam { - return proc.getChangeTeamEvent(ctx); +export function getAttributeEvent(_ctx: Context): SetAttribute { + const ctx = _ctx.event + return proc.getAttributeEvent(ctx) +} + +export function getChangeTeamEvent(_ctx: Context): ChangeCollectionTeam { + const ctx = _ctx.event + return proc.getChangeTeamEvent(ctx) +} + +export function getUpdateMintCall(_ctx: Context): UpdateMintSettings { + const ctx = _ctx.call + return proc.getUpdateMintCall(ctx) } diff --git a/src/mappings/nfts/getters/kusama.ts b/src/mappings/nfts/getters/kusama.ts new file mode 100644 index 00000000..1e95d253 --- /dev/null +++ b/src/mappings/nfts/getters/kusama.ts @@ -0,0 +1,373 @@ +import { NonFungible } from '../../../processable' +import { nfts as events } from '../../../types/kusama/events' +import { nfts as calls } from '../../../types/kusama/calls' +import { addressOf, onlyValue, unHex } from '../../utils/helper' +import { Event, Call } from '../../utils/types' +import { + BurnTokenEvent, + BuyTokenEvent, + ChangeCollectionOwnerEvent, + ChangeCollectionTeam, + CreateCollectionEvent, + CreateTokenEvent, + DestroyCollectionEvent, + ForceCreateCollectionEvent, + ListTokenEvent, + LockCollectionEvent, + SetAttribute, + SetMetadata, + TransferTokenEvent, + UpdateMintSettings, +} from '../types' + +export function getCreateCollectionEvent(ctx: Event): CreateCollectionEvent { + const event = events.created + + if (event.v9420.is(ctx)) { + const { collection: classId, creator, owner } = event.v9420.decode(ctx) + return { id: classId.toString(), caller: addressOf(creator), owner: addressOf(owner) } + } + + const { collection: classId, creator, owner } = event.v9420.decode(ctx) + return { id: classId.toString(), caller: addressOf(creator), owner: addressOf(owner) } +} + +export function getForceCreateCollectionEvent(ctx: Event): ForceCreateCollectionEvent { + const event = events.forceCreated + + if (event.v9420.is(ctx)) { + const { collection: classId, owner } = event.v9420.decode(ctx) + return { id: classId.toString(), owner: addressOf(owner) } + } + + const { collection: classId, owner } = event.v9420.decode(ctx) + return { id: classId.toString(), owner: addressOf(owner) } +} + +export function getCreateTokenEvent(ctx: Event): CreateTokenEvent { + const event = events.issued + + if (event.v9420.is(ctx)) { + const { collection: classId, item: instanceId, owner } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } + } + + const { collection: classId, item: instanceId, owner } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } +} + +export function getTransferTokenEvent(ctx: Event): TransferTokenEvent { + const event = events.transferred + + if (event.v9420.is(ctx)) { + const { collection: classId, item: instanceId, from, to } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } + } + + const { collection: classId, item: instanceId, from, to } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } +} + +export function getBurnTokenEvent(ctx: Event): BurnTokenEvent { + const event = events.burned + + if (event.v9420.is(ctx)) { + const { collection: classId, item: instanceId, owner } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } + } + + const { collection: classId, item: instanceId, owner } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } +} + +export function getDestroyCollectionEvent(ctx: Event): DestroyCollectionEvent { + const event = events.destroyed + + if (event.v9420.is(ctx)) { + const { collection: classId } = event.v9420.decode(ctx) + return { id: classId.toString() } + } + + + const { collection: classId } = event.v9420.decode(ctx) + return { id: classId.toString() } +} + +export function getListTokenEvent(ctx: Event): ListTokenEvent { + const event = events.itemPriceSet + + if (event.v9420.is(ctx)) { + const { collection: classId, item: instanceId, price } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), price } + } + + + const { collection: classId, item: instanceId, price } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), price } +} + +export function getUnListTokenEvent(ctx: Event): ListTokenEvent { + const event = events.itemPriceRemoved + + if (event.v9420.is(ctx)) { + const { collection: classId, item: instanceId } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), price: 0n } + } + + + const { collection: classId, item: instanceId } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), price: 0n } +} + +export function getPriceTokenEvent(ctx: Event): ListTokenEvent { + if (ctx.name === NonFungible.setPrice) { + return getListTokenEvent(ctx) + } + + return getUnListTokenEvent(ctx) +} + +export function getBuyTokenEvent(ctx: Event): BuyTokenEvent { + const event = events.itemBought + + if (event.v9420.is(ctx)) { + const { collection: classId, item: instanceId, price, seller, buyer } = event.v9420.decode(ctx) + return { + collectionId: classId.toString(), + caller: addressOf(buyer), + sn: instanceId.toString(), + price: BigInt(price ?? 0), + currentOwner: addressOf(seller), + } + } + + const { collection: classId, item: instanceId, price, seller, buyer } = event.v9420.decode(ctx) + return { + collectionId: classId.toString(), + caller: addressOf(buyer), + sn: instanceId.toString(), + price: BigInt(price ?? 0), + currentOwner: addressOf(seller), + } +} + +export function getLockCollectionEvent(ctx: Event): LockCollectionEvent { + const event = events.collectionMaxSupplySet + if (event.v9420.is(ctx)) { + const { collection: classId, maxSupply: max } = event.v9420.decode(ctx) + return { id: classId.toString(), max } + } + + const { collection: classId, maxSupply: max } = event.v9420.decode(ctx) + return { id: classId.toString(), max } +} + +export function getChangeCollectionOwnerEvent(ctx: Event): ChangeCollectionOwnerEvent { + const event = events.ownerChanged + + if (event.v9420.is(ctx)) { + const { collection: classId, newOwner } = event.v9420.decode(ctx) + return { id: classId.toString(), owner: addressOf(newOwner) } + } + + + const { collection: classId, newOwner } = event.v9420.decode(ctx) + return { id: classId.toString(), owner: addressOf(newOwner) } +} + +export function getClearCollectionMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataCleared + + if (event.v9420.is(ctx)) { + const { collection: classId } = event.v9420.decode(ctx) + return { collectionId: classId.toString() } + } + + + const { collection: classId } = event.v9420.decode(ctx) + return { collectionId: classId.toString() } +} + +export function getCreateCollectionMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataSet + + if (event.v9420.is(ctx)) { + const { collection: classId, data } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), metadata: unHex(data) } + } + + + const { collection: classId, data } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), metadata: unHex(data) } +} + +export function getClearClassMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataSet + + if (event.v9420.is(ctx)) { + const { collection: classId, data } = event.v9420.decode(ctx) + return { collectionId: classId.toString() } + } + + + const { collection: classId } = event.v9420.decode(ctx) + return { collectionId: classId.toString() } +} + +export function getCreateClassMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataSet + + if (event.v9420.is(ctx)) { + const { collection: classId, data } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), metadata: unHex(data) } + } + + + const { collection: classId, data } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), metadata: unHex(data) } +} + +export function getCreateMetadataEvent(ctx: Event): SetMetadata { + const event = events.itemMetadataSet + + if (event.v9420.is(ctx)) { + const { collection: classId, item: instanceId, data } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), metadata: unHex(data) } + } + + + const { collection: classId, item: instanceId, data } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), metadata: unHex(data) } +} + +export function getClearMetadataEvent(ctx: Event): SetMetadata { + const event = events.itemMetadataCleared + + if (event.v9420.is(ctx)) { + const { collection: classId, item: instanceId } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString() } + } + + + const { collection: classId, item: instanceId } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString() } +} + +export function getMetadataEvent(ctx: Event): SetMetadata { + switch (ctx.name) { + case NonFungible.setCollectionMetadata: + return getCreateCollectionMetadataEvent(ctx) + case NonFungible.clearCollectionMetadata: + return getClearCollectionMetadataEvent(ctx) + case NonFungible.setMetadata: + return getCreateMetadataEvent(ctx) + case NonFungible.clearMetadata: + return getClearMetadataEvent(ctx) + default: + throw new Error('Unsupported event') + } +} + +function getSetAttributeEvent(ctx: Event): SetAttribute { + const event = events.attributeSet + if (event.v9420.is(ctx)) { + const { collection: classId, maybeItem: instanceId, key, value } = event.v9420.decode(ctx) + return { + collectionId: classId.toString(), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } + } + + + const { collection: classId, maybeItem: instanceId, key, value } = event.v9420.decode(ctx) + return { + collectionId: classId.toString(), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } +} + +function getClearAttributeEvent(ctx: Event): SetAttribute { + const event = events.attributeCleared + + if (event.v9420.is(ctx)) { + const { collection: classId, maybeItem: instanceId, key } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId?.toString(), trait: unHex(key) } + } + + + const { collection: classId, maybeItem: instanceId, key } = event.v9420.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId?.toString(), trait: unHex(key) } +} + +export function getAttributeEvent(ctx: Event): SetAttribute { + switch (ctx.name) { + case NonFungible.setAttribute: + return getSetAttributeEvent(ctx) + case NonFungible.clearAttribute: + return getClearAttributeEvent(ctx) + default: + throw new Error('Unsupported event') + } +} + +export function getChangeTeamEvent(ctx: Event): ChangeCollectionTeam { + const event = events.teamChanged + + if (event.v9420.is(ctx)) { + const { collection: classId, issuer, admin, freezer } = event.v9420.decode(ctx) + return { + id: classId.toString(), + issuer: issuer ? addressOf(issuer) : '', + admin: admin ? addressOf(admin) : '', + freezer: freezer ? addressOf(freezer) : '', + } + } + + + const { collection: classId, issuer, admin, freezer } = event.v9420.decode(ctx) + return { + id: classId.toString(), + issuer: issuer ? addressOf(issuer) : '', + admin: admin ? addressOf(admin) : '', + freezer: freezer ? addressOf(freezer) : '', + } +} + + +export function getTipSentEvent(ctx: Event) { + const event = events.tipSent + + if (event.v9420.is(ctx)) { + const { collection, item, receiver, amount } = event.v9420.decode(ctx) + return { + collection: collection.toString(), + item: item.toString(), + receiver: receiver ? addressOf(receiver) : '', + amount, + } + } + + const { collection, item, receiver, amount } = event.v9420.decode(ctx) + return { + collection: collection.toString(), + item: item.toString(), + receiver: receiver ? addressOf(receiver) : '', + amount, + } +} + +export function getUpdateMintCall(ctx: Call): UpdateMintSettings { + const call = calls.updateMintSettings + + if (call.v9420.is(ctx)) { + const { collection: classId, mintSettings: { mintType, startBlock, endBlock, price } } = call.v9420.decode(ctx) + return { id: classId.toString(), type: mintType, startBlock, endBlock, price } + } + + const { collection: classId, mintSettings: { mintType, startBlock, endBlock, price } } = call.v9420.decode(ctx) + return { id: classId.toString(), type: mintType, startBlock, endBlock, price } +} \ No newline at end of file diff --git a/src/mappings/nfts/getters/polkadot.ts b/src/mappings/nfts/getters/polkadot.ts new file mode 100644 index 00000000..9592ab38 --- /dev/null +++ b/src/mappings/nfts/getters/polkadot.ts @@ -0,0 +1,376 @@ +import { logger } from '@kodadot1/metasquid/logger' +import { NonFungible } from '../../../processable' +import { nfts as events } from '../../../types/polkadot/events' +import { nfts as calls } from '../../../types/polkadot/calls' +import { addressOf, unHex } from '../../utils/helper' +import { Event, Call } from '../../utils/types' +import { + BurnTokenEvent, + BuyTokenEvent, + ChangeCollectionOwnerEvent, + ChangeCollectionTeam, + CreateCollectionEvent, + CreateTokenEvent, + DestroyCollectionEvent, + ForceCreateCollectionEvent, + ListTokenEvent, + LockCollectionEvent, + SetAttribute, + SetMetadata, + TransferTokenEvent, + UpdateMintSettings, +} from '../types' +import { debug } from '../../utils/logger' + +export function getCreateCollectionEvent(ctx: Event): CreateCollectionEvent { + const event = events.created + + if (event.v9430.is(ctx)) { + const { collection: classId, creator, owner } = event.v9430.decode(ctx) + return { id: classId.toString(), caller: addressOf(creator), owner: addressOf(owner) } + } + + const { collection: classId, creator, owner } = event.v9430.decode(ctx) + return { id: classId.toString(), caller: addressOf(creator), owner: addressOf(owner) } +} + +export function getForceCreateCollectionEvent(ctx: Event): ForceCreateCollectionEvent { + const event = events.forceCreated + + if (event.v9430.is(ctx)) { + const { collection: classId, owner } = event.v9430.decode(ctx) + return { id: classId.toString(), owner: addressOf(owner) } + } + + const { collection: classId, owner } = event.v9430.decode(ctx) + return { id: classId.toString(), owner: addressOf(owner) } +} + +export function getCreateTokenEvent(ctx: Event): CreateTokenEvent { + const event = events.issued + + if (event.v9430.is(ctx)) { + const { collection: classId, item: instanceId, owner } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } + } + + const { collection: classId, item: instanceId, owner } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } +} + +export function getTransferTokenEvent(ctx: Event): TransferTokenEvent { + const event = events.transferred + + if (event.v9430.is(ctx)) { + const { collection: classId, item: instanceId, from, to } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } + } + + const { collection: classId, item: instanceId, from, to } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } +} + +export function getBurnTokenEvent(ctx: Event): BurnTokenEvent { + const event = events.burned + + if (event.v9430.is(ctx)) { + const { collection: classId, item: instanceId, owner } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } + } + + const { collection: classId, item: instanceId, owner } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } +} + +export function getDestroyCollectionEvent(ctx: Event): DestroyCollectionEvent { + const event = events.destroyed + + if (event.v9430.is(ctx)) { + const { collection: classId } = event.v9430.decode(ctx) + return { id: classId.toString() } + } + + + const { collection: classId } = event.v9430.decode(ctx) + return { id: classId.toString() } +} + +export function getListTokenEvent(ctx: Event): ListTokenEvent { + const event = events.itemPriceSet + + if (event.v9430.is(ctx)) { + const { collection: classId, item: instanceId, price } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), price } + } + + + const { collection: classId, item: instanceId, price } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), price } +} + +export function getUnListTokenEvent(ctx: Event): ListTokenEvent { + const event = events.itemPriceRemoved + + if (event.v9430.is(ctx)) { + const { collection: classId, item: instanceId } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), price: 0n } + } + + + const { collection: classId, item: instanceId } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), price: 0n } +} + +export function getPriceTokenEvent(ctx: Event): ListTokenEvent { + if (ctx.name === NonFungible.setPrice) { + return getListTokenEvent(ctx) + } + + return getUnListTokenEvent(ctx) +} + +export function getBuyTokenEvent(ctx: Event): BuyTokenEvent { + const event = events.itemBought + + if (event.v9430.is(ctx)) { + const { collection: classId, item: instanceId, price, seller, buyer } = event.v9430.decode(ctx) + return { + collectionId: classId.toString(), + caller: addressOf(buyer), + sn: instanceId.toString(), + price: BigInt(price ?? 0), + currentOwner: addressOf(seller), + } + } + + const { collection: classId, item: instanceId, price, seller, buyer } = event.v9430.decode(ctx) + return { + collectionId: classId.toString(), + caller: addressOf(buyer), + sn: instanceId.toString(), + price: BigInt(price ?? 0), + currentOwner: addressOf(seller), + } +} + +export function getLockCollectionEvent(ctx: Event): LockCollectionEvent { + const event = events.collectionMaxSupplySet + if (event.v9430.is(ctx)) { + const { collection: classId, maxSupply: max } = event.v9430.decode(ctx) + return { id: classId.toString(), max } + } + + const { collection: classId, maxSupply: max } = event.v9430.decode(ctx) + return { id: classId.toString(), max } +} + +export function getChangeCollectionOwnerEvent(ctx: Event): ChangeCollectionOwnerEvent { + const event = events.ownerChanged + + if (event.v9430.is(ctx)) { + const { collection: classId, newOwner } = event.v9430.decode(ctx) + return { id: classId.toString(), owner: addressOf(newOwner) } + } + + + const { collection: classId, newOwner } = event.v9430.decode(ctx) + return { id: classId.toString(), owner: addressOf(newOwner) } +} + +export function getClearCollectionMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataCleared + + if (event.v9430.is(ctx)) { + const { collection: classId } = event.v9430.decode(ctx) + return { collectionId: classId.toString() } + } + + + const { collection: classId } = event.v9430.decode(ctx) + return { collectionId: classId.toString() } +} + +export function getCreateCollectionMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataSet + + if (event.v9430.is(ctx)) { + const { collection: classId, data } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), metadata: unHex(data) } + } + + + const { collection: classId, data } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), metadata: unHex(data) } +} + +export function getClearClassMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataSet + + if (event.v9430.is(ctx)) { + const { collection: classId, data } = event.v9430.decode(ctx) + return { collectionId: classId.toString() } + } + + + const { collection: classId } = event.v9430.decode(ctx) + return { collectionId: classId.toString() } +} + +export function getCreateClassMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataSet + + if (event.v9430.is(ctx)) { + const { collection: classId, data } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), metadata: unHex(data) } + } + + + const { collection: classId, data } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), metadata: unHex(data) } +} + +export function getCreateMetadataEvent(ctx: Event): SetMetadata { + const event = events.itemMetadataSet + + if (event.v9430.is(ctx)) { + const { collection: classId, item: instanceId, data } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), metadata: unHex(data) } + } + + + const { collection: classId, item: instanceId, data } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString(), metadata: unHex(data) } +} + +export function getClearMetadataEvent(ctx: Event): SetMetadata { + const event = events.itemMetadataCleared + + if (event.v9430.is(ctx)) { + const { collection: classId, item: instanceId } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString() } + } + + + const { collection: classId, item: instanceId } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId.toString() } +} + +export function getMetadataEvent(ctx: Event): SetMetadata { + switch (ctx.name) { + case NonFungible.setCollectionMetadata: + return getCreateCollectionMetadataEvent(ctx) + case NonFungible.clearCollectionMetadata: + return getClearCollectionMetadataEvent(ctx) + case NonFungible.setMetadata: + return getCreateMetadataEvent(ctx) + case NonFungible.clearMetadata: + return getClearMetadataEvent(ctx) + default: + throw new Error('Unsupported event') + } +} + +function getSetAttributeEvent(ctx: Event): SetAttribute { + const event = events.attributeSet + if (event.v9430.is(ctx)) { + const { collection: classId, maybeItem: instanceId, key, value } = event.v9430.decode(ctx) + debug('setAttribute' as any, { classId, instanceId, key, value, human: { key: unHex(key), value: unHex(value) } }) + return { + collectionId: classId.toString(), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } + } + + + const { collection: classId, maybeItem: instanceId, key, value } = event.v9430.decode(ctx) + debug('setAttribute' as any, { classId, instanceId, key, value, human: { key: unHex(key), value: unHex(value) } }) + return { + collectionId: classId.toString(), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } +} + +function getClearAttributeEvent(ctx: Event): SetAttribute { + const event = events.attributeCleared + + if (event.v9430.is(ctx)) { + const { collection: classId, maybeItem: instanceId, key } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId?.toString(), trait: unHex(key) } + } + + + const { collection: classId, maybeItem: instanceId, key } = event.v9430.decode(ctx) + return { collectionId: classId.toString(), sn: instanceId?.toString(), trait: unHex(key) } +} + +export function getAttributeEvent(ctx: Event): SetAttribute { + switch (ctx.name) { + case NonFungible.setAttribute: + return getSetAttributeEvent(ctx) + case NonFungible.clearAttribute: + return getClearAttributeEvent(ctx) + default: + throw new Error('Unsupported event') + } +} + +export function getChangeTeamEvent(ctx: Event): ChangeCollectionTeam { + const event = events.teamChanged + + if (event.v9430.is(ctx)) { + const { collection: classId, issuer, admin, freezer } = event.v9430.decode(ctx) + return { + id: classId.toString(), + issuer: issuer ? addressOf(issuer) : '', + admin: admin ? addressOf(admin) : '', + freezer: freezer ? addressOf(freezer) : '', + } + } + + + const { collection: classId, issuer, admin, freezer } = event.v9430.decode(ctx) + return { + id: classId.toString(), + issuer: issuer ? addressOf(issuer) : '', + admin: admin ? addressOf(admin) : '', + freezer: freezer ? addressOf(freezer) : '', + } +} + +export function getTipSentEvent(ctx: Event) { + const event = events.tipSent + + if (event.v9430.is(ctx)) { + const { collection, item, receiver, amount } = event.v9430.decode(ctx) + return { + collection: collection.toString(), + item: item.toString(), + receiver: receiver ? addressOf(receiver) : '', + amount, + } + } + + const { collection, item, receiver, amount } = event.v9430.decode(ctx) + return { + collection: collection.toString(), + item: item.toString(), + receiver: receiver ? addressOf(receiver) : '', + amount, + } +} + +export function getUpdateMintCall(ctx: Call): UpdateMintSettings { + const call = calls.updateMintSettings + + if (call.v9430.is(ctx)) { + const { collection: classId, mintSettings: { mintType, startBlock, endBlock, price } } = call.v9430.decode(ctx) + return { id: classId.toString(), type: mintType, startBlock, endBlock, price } + } + + const { collection: classId, mintSettings: { mintType, startBlock, endBlock, price } } = call.v9430.decode(ctx) + return { id: classId.toString(), type: mintType, startBlock, endBlock, price } +} diff --git a/src/mappings/nfts/getters/statemine.ts b/src/mappings/nfts/getters/statemine.ts deleted file mode 100644 index af7cfba4..00000000 --- a/src/mappings/nfts/getters/statemine.ts +++ /dev/null @@ -1,338 +0,0 @@ -import { Interaction } from '../../../model' -import { NonFungible as Event } from '../../../processable' -import * as events from '../../../types/statemine/events' -import { addressOf } from '../../utils/helper' -import { warn } from '../../utils/logger' -import { Context } from '../../utils/types' -import { - BurnTokenEvent, - BuyTokenEvent, - ChangeCollectionOwnerEvent, - ChangeCollectionTeam, - CreateCollectionEvent, - CreateTokenEvent, - DestroyCollectionEvent, - ForceCreateCollectionEvent, - ListTokenEvent, - LockCollectionEvent, - SetAttribute, - SetMetadata, - TransferTokenEvent, -} from '../types' - -export function getCreateCollectionEvent(ctx: Context): CreateCollectionEvent { - const event = new events.NftsCreatedEvent(ctx) - - if (event.isV9420) { - const { collection: classId, creator, owner } = event.asV9420 - return { id: classId.toString(), caller: addressOf(creator), owner: addressOf(owner) } - } - warn(Interaction.CREATE, 'USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, creator, owner } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString(), caller: addressOf(creator), owner: addressOf(owner) } -} - -export function getForceCreateCollectionEvent(ctx: Context): ForceCreateCollectionEvent { - const event = new events.NftsForceCreatedEvent(ctx) - - if (event.isV9420) { - const { collection: classId, owner } = event.asV9420 - return { id: classId.toString(), owner: addressOf(owner) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, owner } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString(), owner: addressOf(owner) } -} - -export function getCreateTokenEvent(ctx: Context): CreateTokenEvent { - const event = new events.NftsIssuedEvent(ctx) - - if (event.isV9420) { - const { collection: classId, item: instanceId, owner } = event.asV9420 - return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, owner } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } -} - -export function getTransferTokenEvent(ctx: Context): TransferTokenEvent { - const event = new events.NftsTransferredEvent(ctx) - - if (event.isV9420) { - const { collection: classId, item: instanceId, from, to } = event.asV9420 - return { collectionId: classId.toString(), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, from, to } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } -} - -export function getBurnTokenEvent(ctx: Context): BurnTokenEvent { - const event = new events.NftsBurnedEvent(ctx) - - if (event.isV9420) { - const { collection: classId, item: instanceId, owner } = event.asV9420 - return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, owner } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } -} - -export function getDestroyCollectionEvent(ctx: Context): DestroyCollectionEvent { - const event = new events.NftsDestroyedEvent(ctx) - - if (event.isV9420) { - const { collection: classId } = event.asV9420 - return { id: classId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString() } -} - -export function getListTokenEvent(ctx: Context): ListTokenEvent { - const event = new events.NftsItemPriceSetEvent(ctx) - - if (event.isV9420) { - const { collection: classId, item: instanceId, price } = event.asV9420 - return { collectionId: classId.toString(), sn: instanceId.toString(), price } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId.toString(), price } -} - -export function getUnListTokenEvent(ctx: Context): ListTokenEvent { - const event = new events.NftsItemPriceRemovedEvent(ctx) - - if (event.isV9420) { - const { collection: classId, item: instanceId } = event.asV9420 - return { collectionId: classId.toString(), sn: instanceId.toString(), price: 0n } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId.toString(), price: 0n } -} - -export function getPriceTokenEvent(ctx: Context): ListTokenEvent { - if (ctx.event.name === Event.setPrice) { - return getListTokenEvent(ctx) - } - - return getUnListTokenEvent(ctx) -} - -export function getBuyTokenEvent(ctx: Context): BuyTokenEvent { - const event = new events.NftsItemBoughtEvent(ctx) - - if (event.isV9420) { - const { collection: classId, item: instanceId, price, seller, buyer } = event.asV9420 - return { - collectionId: classId.toString(), - caller: addressOf(buyer), - sn: instanceId.toString(), - price: BigInt(price ?? 0), - currentOwner: addressOf(seller), - } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price, seller, buyer } = ctx._chain.decodeEvent(ctx.event) - return { - collectionId: classId.toString(), - caller: addressOf(buyer), - sn: instanceId.toString(), - price: BigInt(price ?? 0), - currentOwner: addressOf(seller), - } -} - -export function getLockCollectionEvent(ctx: Context): LockCollectionEvent { - const event = new events.NftsCollectionMaxSupplySetEvent(ctx) - if (event.isV9420) { - const { collection: classId, maxSupply: max } = event.asV9420 - return { id: classId.toString(), max } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, mamaxSupply: max } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString(), max } -} - -export function getChangeCollectionOwnerEvent(ctx: Context): ChangeCollectionOwnerEvent { - const event = new events.NftsOwnerChangedEvent(ctx) - - if (event.isV9420) { - const { collection: classId, newOwner } = event.asV9420 - return { id: classId.toString(), owner: addressOf(newOwner) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, newOwner } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString(), owner: addressOf(newOwner) } -} - -export function getClearCollectionMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsCollectionMetadataClearedEvent(ctx) - - if (event.isV9420) { - const { collection: classId } = event.asV9420 - return { collectionId: classId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString() } -} - -export function getCreateCollectionMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsCollectionMetadataSetEvent(ctx) - - if (event.isV9420) { - const { collection: classId, data } = event.asV9420 - return { collectionId: classId.toString(), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), metadata: data.toString() } -} - -export function getClearClassMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsCollectionMetadataSetEvent(ctx) - - if (event.isV9420) { - const { collection: classId, data } = event.asV9420 - return { collectionId: classId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString() } -} - -export function getCreateClassMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsCollectionMetadataSetEvent(ctx) - - if (event.isV9420) { - const { collection: classId, data } = event.asV9420 - return { collectionId: classId.toString(), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), metadata: data.toString() } -} - -export function getCreateMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsItemMetadataSetEvent(ctx) - - if (event.isV9420) { - const { collection: classId, item: instanceId, data } = event.asV9420 - return { collectionId: classId.toString(), sn: instanceId.toString(), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId.toString(), metadata: data.toString() } -} - -export function getClearMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsItemMetadataClearedEvent(ctx) - - if (event.isV9420) { - const { collection: classId, item: instanceId } = event.asV9420 - return { collectionId: classId.toString(), sn: instanceId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId.toString() } -} - -export function getMetadataEvent(ctx: Context): SetMetadata { - switch (ctx.event.name) { - case Event.setCollectionMetadata: - return getCreateCollectionMetadataEvent(ctx) - case Event.clearCollectionMetadata: - return getClearCollectionMetadataEvent(ctx) - case Event.setMetadata: - return getCreateMetadataEvent(ctx) - case Event.clearMetadata: - return getClearMetadataEvent(ctx) - default: - throw new Error('Unsupported event') - } -} - -function getSetAttributeEvent(ctx: Context): SetAttribute { - const event = new events.NftsAttributeSetEvent(ctx) - if (event.isV9420) { - const { collection: classId, maybeItem: instanceId, key, value } = event.asV9420 - return { - collectionId: classId.toString(), - sn: instanceId?.toString(), - trait: key.toString(), - value: value.toString(), - } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, maybeItem: instanceId, key, value } = ctx._chain.decodeEvent(ctx.event) - return { - collectionId: classId.toString(), - sn: instanceId?.toString(), - trait: key.toString(), - value: value.toString(), - } -} - -function getClearAttributeEvent(ctx: Context): SetAttribute { - const event = new events.NftsAttributeClearedEvent(ctx) - - if (event.isV9420) { - const { collection: classId, maybeItem: instanceId, key } = event.asV9420 - return { collectionId: classId.toString(), sn: instanceId?.toString(), trait: key.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, maybeItem: instanceId, key } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId?.toString(), trait: key.toString() } -} - -export function getAttributeEvent(ctx: Context): SetAttribute { - switch (ctx.event.name) { - case Event.setAttribute: - return getSetAttributeEvent(ctx) - case Event.clearAttribute: - return getClearAttributeEvent(ctx) - default: - throw new Error('Unsupported event') - } -} - -export function getChangeTeamEvent(ctx: Context): ChangeCollectionTeam { - const event = new events.NftsTeamChangedEvent(ctx) - - if (event.isV9420) { - const { collection: classId, issuer, admin, freezer } = event.asV9420 - return { - id: classId.toString(), - issuer: issuer ? addressOf(issuer) : '', - admin: admin ? addressOf(admin) : '', - freezer: freezer ? addressOf(freezer) : '', - } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, issuer, admin, freezer } = ctx._chain.decodeEvent(ctx.event) - return { - id: classId.toString(), - issuer: issuer ? addressOf(issuer) : '', - admin: admin ? addressOf(admin) : '', - freezer: freezer ? addressOf(freezer) : '', - } -} diff --git a/src/mappings/nfts/getters/statemint.ts b/src/mappings/nfts/getters/statemint.ts deleted file mode 100644 index bb1421c9..00000000 --- a/src/mappings/nfts/getters/statemint.ts +++ /dev/null @@ -1,338 +0,0 @@ -import { Interaction } from '../../../model' -import { NonFungible as Event } from '../../../processable' -import * as events from '../../../types/statemint/events' -import { addressOf } from '../../utils/helper' -import { warn } from '../../utils/logger' -import { Context } from '../../utils/types' -import { - BurnTokenEvent, - BuyTokenEvent, - ChangeCollectionOwnerEvent, - ChangeCollectionTeam, - CreateCollectionEvent, - CreateTokenEvent, - DestroyCollectionEvent, - ForceCreateCollectionEvent, - ListTokenEvent, - LockCollectionEvent, - SetAttribute, - SetMetadata, - TransferTokenEvent, -} from '../types' - -export function getCreateCollectionEvent(ctx: Context): CreateCollectionEvent { - const event = new events.NftsCreatedEvent(ctx) - - if (event.isV9430) { - const { collection: classId, creator, owner } = event.asV9430 - return { id: classId.toString(), caller: addressOf(creator), owner: addressOf(owner) } - } - warn(Interaction.CREATE, 'USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, creator, owner } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString(), caller: addressOf(creator), owner: addressOf(owner) } -} - -export function getForceCreateCollectionEvent(ctx: Context): ForceCreateCollectionEvent { - const event = new events.NftsForceCreatedEvent(ctx) - - if (event.isV9430) { - const { collection: classId, owner } = event.asV9430 - return { id: classId.toString(), owner: addressOf(owner) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, owner } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString(), owner: addressOf(owner) } -} - -export function getCreateTokenEvent(ctx: Context): CreateTokenEvent { - const event = new events.NftsIssuedEvent(ctx) - - if (event.isV9430) { - const { collection: classId, item: instanceId, owner } = event.asV9430 - return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, owner } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } -} - -export function getTransferTokenEvent(ctx: Context): TransferTokenEvent { - const event = new events.NftsTransferredEvent(ctx) - - if (event.isV9430) { - const { collection: classId, item: instanceId, from, to } = event.asV9430 - return { collectionId: classId.toString(), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, from, to } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } -} - -export function getBurnTokenEvent(ctx: Context): BurnTokenEvent { - const event = new events.NftsBurnedEvent(ctx) - - if (event.isV9430) { - const { collection: classId, item: instanceId, owner } = event.asV9430 - return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, owner } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), owner: addressOf(owner), sn: instanceId.toString() } -} - -export function getDestroyCollectionEvent(ctx: Context): DestroyCollectionEvent { - const event = new events.NftsDestroyedEvent(ctx) - - if (event.isV9430) { - const { collection: classId } = event.asV9430 - return { id: classId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString() } -} - -export function getListTokenEvent(ctx: Context): ListTokenEvent { - const event = new events.NftsItemPriceSetEvent(ctx) - - if (event.isV9430) { - const { collection: classId, item: instanceId, price } = event.asV9430 - return { collectionId: classId.toString(), sn: instanceId.toString(), price } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId.toString(), price } -} - -export function getUnListTokenEvent(ctx: Context): ListTokenEvent { - const event = new events.NftsItemPriceRemovedEvent(ctx) - - if (event.isV9430) { - const { collection: classId, item: instanceId } = event.asV9430 - return { collectionId: classId.toString(), sn: instanceId.toString(), price: 0n } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId.toString(), price: 0n } -} - -export function getPriceTokenEvent(ctx: Context): ListTokenEvent { - if (ctx.event.name === Event.setPrice) { - return getListTokenEvent(ctx) - } - - return getUnListTokenEvent(ctx) -} - -export function getBuyTokenEvent(ctx: Context): BuyTokenEvent { - const event = new events.NftsItemBoughtEvent(ctx) - - if (event.isV9430) { - const { collection: classId, item: instanceId, price, seller, buyer } = event.asV9430 - return { - collectionId: classId.toString(), - caller: addressOf(buyer), - sn: instanceId.toString(), - price: BigInt(price ?? 0), - currentOwner: addressOf(seller), - } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price, seller, buyer } = ctx._chain.decodeEvent(ctx.event) - return { - collectionId: classId.toString(), - caller: addressOf(buyer), - sn: instanceId.toString(), - price: BigInt(price ?? 0), - currentOwner: addressOf(seller), - } -} - -export function getLockCollectionEvent(ctx: Context): LockCollectionEvent { - const event = new events.NftsCollectionMaxSupplySetEvent(ctx) - if (event.isV9430) { - const { collection: classId, maxSupply: max } = event.asV9430 - return { id: classId.toString(), max } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, mamaxSupply: max } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString(), max } -} - -export function getChangeCollectionOwnerEvent(ctx: Context): ChangeCollectionOwnerEvent { - const event = new events.NftsOwnerChangedEvent(ctx) - - if (event.isV9430) { - const { collection: classId, newOwner } = event.asV9430 - return { id: classId.toString(), owner: addressOf(newOwner) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, newOwner } = ctx._chain.decodeEvent(ctx.event) - return { id: classId.toString(), owner: addressOf(newOwner) } -} - -export function getClearCollectionMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsCollectionMetadataClearedEvent(ctx) - - if (event.isV9430) { - const { collection: classId } = event.asV9430 - return { collectionId: classId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString() } -} - -export function getCreateCollectionMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsCollectionMetadataSetEvent(ctx) - - if (event.isV9430) { - const { collection: classId, data } = event.asV9430 - return { collectionId: classId.toString(), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), metadata: data.toString() } -} - -export function getClearClassMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsCollectionMetadataSetEvent(ctx) - - if (event.isV9430) { - const { collection: classId, data } = event.asV9430 - return { collectionId: classId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString() } -} - -export function getCreateClassMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsCollectionMetadataSetEvent(ctx) - - if (event.isV9430) { - const { collection: classId, data } = event.asV9430 - return { collectionId: classId.toString(), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), metadata: data.toString() } -} - -export function getCreateMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsItemMetadataSetEvent(ctx) - - if (event.isV9430) { - const { collection: classId, item: instanceId, data } = event.asV9430 - return { collectionId: classId.toString(), sn: instanceId.toString(), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId.toString(), metadata: data.toString() } -} - -export function getClearMetadataEvent(ctx: Context): SetMetadata { - const event = new events.NftsItemMetadataClearedEvent(ctx) - - if (event.isV9430) { - const { collection: classId, item: instanceId } = event.asV9430 - return { collectionId: classId.toString(), sn: instanceId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId.toString() } -} - -export function getMetadataEvent(ctx: Context): SetMetadata { - switch (ctx.event.name) { - case Event.setCollectionMetadata: - return getCreateCollectionMetadataEvent(ctx) - case Event.clearCollectionMetadata: - return getClearCollectionMetadataEvent(ctx) - case Event.setMetadata: - return getCreateMetadataEvent(ctx) - case Event.clearMetadata: - return getClearMetadataEvent(ctx) - default: - throw new Error('Unsupported event') - } -} - -function getSetAttributeEvent(ctx: Context): SetAttribute { - const event = new events.NftsAttributeSetEvent(ctx) - if (event.isV9430) { - const { collection: classId, maybeItem: instanceId, key, value } = event.asV9430 - return { - collectionId: classId.toString(), - sn: instanceId?.toString(), - trait: key.toString(), - value, - } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, maybeItem: instanceId, key, value } = ctx._chain.decodeEvent(ctx.event) - return { - collectionId: classId.toString(), - sn: instanceId?.toString(), - trait: key.toString(), - value, - } -} - -function getClearAttributeEvent(ctx: Context): SetAttribute { - const event = new events.NftsAttributeClearedEvent(ctx) - - if (event.isV9430) { - const { collection: classId, maybeItem: instanceId, key } = event.asV9430 - return { collectionId: classId.toString(), sn: instanceId?.toString(), trait: key.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, maybeItem: instanceId, key } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: classId.toString(), sn: instanceId?.toString(), trait: key.toString() } -} - -export function getAttributeEvent(ctx: Context): SetAttribute { - switch (ctx.event.name) { - case Event.setAttribute: - return getSetAttributeEvent(ctx) - case Event.clearAttribute: - return getClearAttributeEvent(ctx) - default: - throw new Error('Unsupported event') - } -} - -export function getChangeTeamEvent(ctx: Context): ChangeCollectionTeam { - const event = new events.NftsTeamChangedEvent(ctx) - - if (event.isV9430) { - const { collection: classId, issuer, admin, freezer } = event.asV9430 - return { - id: classId.toString(), - issuer: issuer ? addressOf(issuer) : '', - admin: admin ? addressOf(admin) : '', - freezer: freezer ? addressOf(freezer) : '', - } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, issuer, admin, freezer } = ctx._chain.decodeEvent(ctx.event) - return { - id: classId.toString(), - issuer: issuer ? addressOf(issuer) : '', - admin: admin ? addressOf(admin) : '', - freezer: freezer ? addressOf(freezer) : '', - } -} diff --git a/src/mappings/nfts/index.ts b/src/mappings/nfts/index.ts index 58ab7c38..958b9628 100644 --- a/src/mappings/nfts/index.ts +++ b/src/mappings/nfts/index.ts @@ -11,3 +11,5 @@ export * from './mint' export * from './setAttribute' export * from './setMetadata' export * from './transfer' +export * from './updateMintSettings' +export * from './payTips' diff --git a/src/mappings/nfts/list.ts b/src/mappings/nfts/list.ts index 39b7ff98..98d7c8f1 100644 --- a/src/mappings/nfts/list.ts +++ b/src/mappings/nfts/list.ts @@ -9,6 +9,12 @@ import { getPriceTokenEvent } from './getters' const OPERATION = Action.LIST const UNLIST = Action.UNLIST +/** + * Handle the token list event (Nfts.ItemPriceSet) + * Sets the price of the token, updates the collection floor + * Logs Action.LIST event + * @param context - the context for the event + **/ export async function handleTokenList(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getPriceTokenEvent) diff --git a/src/mappings/nfts/lock.ts b/src/mappings/nfts/lock.ts index 387c9e1c..c3a19fe6 100644 --- a/src/mappings/nfts/lock.ts +++ b/src/mappings/nfts/lock.ts @@ -7,6 +7,12 @@ import { getLockCollectionEvent } from './getters' const OPERATION = Action.LOCK +/** + * Handle the collection lock event (Nfts.CollectionMaxSupplySet) + * Sets the max supply of the collection + * Logs Action.LOCK event + * @param context - the context for the event + **/ export async function handleCollectionLock(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getLockCollectionEvent) diff --git a/src/mappings/nfts/mint.ts b/src/mappings/nfts/mint.ts index 34384147..589aff1f 100644 --- a/src/mappings/nfts/mint.ts +++ b/src/mappings/nfts/mint.ts @@ -13,6 +13,12 @@ import { getCreateTokenEvent } from './getters' const OPERATION = Action.MINT +/** + * Handle the token create event (Nfts.Issued) + * Creates a new token + * Logs Action.MINT event + * @param context - the context for the event + **/ export async function handleTokenCreate(context: Context): Promise { pending(OPERATION, context.block.height.toString()) const event = unwrap(context, getCreateTokenEvent) @@ -70,9 +76,15 @@ export async function handleTokenCreate(context: Context): Promise { success(OPERATION, `${final.id}`) await context.store.save(final) await context.store.save(collection) - await createEvent(final, OPERATION, event, '', context.store) + + const destinationAddress = final.issuer !== final.currentOwner ? final.currentOwner : '' - if (final.issuer !== final.currentOwner) { - await createEvent(final, Action.SEND, event, final.currentOwner, context.store, final.issuer) - } + await createEvent( + final, + OPERATION, + event, + destinationAddress, + context.store, + final.issuer !== final.currentOwner ? final.issuer : undefined + ) } diff --git a/src/mappings/nfts/payTips.ts b/src/mappings/nfts/payTips.ts new file mode 100644 index 00000000..b9e86425 --- /dev/null +++ b/src/mappings/nfts/payTips.ts @@ -0,0 +1,31 @@ +import { getOptional } from '@kodadot1/metasquid/entity' +import { NFTEntity as NE } from '../../model' +import { createEvent } from '../shared/event' +import { unwrap } from '../utils/extract' +import { pending, debug } from '../utils/logger' +import { Action, Context, createTokenId } from '../utils/types' +import { getTipSentEvent } from './getters' + +const OPERATION = Action.PAY_ROYALTY + +/** + * Handle the token tip event (Nfts.TipSent) + * Logs Action.PAY_ROYALTY event + * @param context - the context for the event + **/ +export async function handleTipSend(context: Context): Promise { + pending(OPERATION, `${context.block.height}`) + const event = unwrap(context, getTipSentEvent) + debug(OPERATION, event, true) + + const id = createTokenId(event.collection, event.item) + const entity = await getOptional(context.store, NE, id) + + if (entity) { + const meta = { + receiver: String(event.receiver), + amount: String(event.amount), + } + await createEvent(entity, OPERATION, event, meta.amount, context.store, meta.receiver) + } +} diff --git a/src/mappings/nfts/setAttribute.ts b/src/mappings/nfts/setAttribute.ts index 4c343fc8..4ac755dd 100644 --- a/src/mappings/nfts/setAttribute.ts +++ b/src/mappings/nfts/setAttribute.ts @@ -2,10 +2,16 @@ import { getOrFail as get } from '@kodadot1/metasquid/entity' import { CollectionEntity, NFTEntity } from '../../model' import { unwrap } from '../utils/extract' import { Context, isNFT } from '../utils/types' -import { addressOf } from '../utils/helper' +import { addressOf, unHex } from '../utils/helper' import { getAttributeEvent } from './getters' import { attributeFrom, tokenIdOf } from './types' +/** + * Handle the attribute set event (Nfts.AttributeSet, Nfts.AttributeCleared) + * Sets the attribute of the collection or NFT + * Logs NONE event + * @param context - the context for the event + **/ export async function handleAttributeSet(context: Context): Promise { const event = unwrap(context, getAttributeEvent) @@ -18,7 +24,8 @@ export async function handleAttributeSet(context: Context): Promise { } if ('royalty' in final && event.trait === 'royalty') { - final.royalty = final.royalty ?? Number.parseFloat(event.value as string) + const value = unHex(event.value) + final.royalty = final.royalty ?? Number.parseFloat(value || '0') } if ('recipient' in final && event.trait === 'recipient') { @@ -35,9 +42,9 @@ export async function handleAttributeSet(context: Context): Promise { } else { const attribute = final.attributes?.find((attr) => attr.trait === event.trait) if (attribute) { - attribute.value = String(event.value) + attribute.value = unHex(event.value) ?? String(event.value) } else if (event.trait !== 'royalty' && event.trait !== 'recipient') { - const newAttribute = attributeFrom({ trait_type: event.trait, value: String(event.value) }) + const newAttribute = attributeFrom({ trait_type: event.trait, value: unHex(event.value) ?? String(event.value) }) final.attributes?.push(newAttribute) } } diff --git a/src/mappings/nfts/setMetadata.ts b/src/mappings/nfts/setMetadata.ts index 72dfeff3..bb8a28db 100644 --- a/src/mappings/nfts/setMetadata.ts +++ b/src/mappings/nfts/setMetadata.ts @@ -11,6 +11,12 @@ import { tokenIdOf } from './types' import { getMetadataEvent } from './getters' const OPERATION = 'METADATA' as any + +/** + * Handle the metadata set event (Nfts.CollectionMetadataSet, Nfts.ItemMetadataSet, Nfts.ItemMetadataCleared, Nfts.CollectionMetadataCleared) + * Sets the metadata of the collection or nft + * @param context - the context for the event + **/ export async function handleMetadataSet(context: Context): Promise { const event = unwrap(context, getMetadataEvent) debug(OPERATION, event) diff --git a/src/mappings/nfts/transfer.ts b/src/mappings/nfts/transfer.ts index 3f4e0cfd..2590ee31 100644 --- a/src/mappings/nfts/transfer.ts +++ b/src/mappings/nfts/transfer.ts @@ -9,6 +9,12 @@ import { getTransferTokenEvent } from './getters' const OPERATION = Action.SEND +/** + * Handle the token transfer event (Nfts.Transferred) + * Changes the owner of the token, updates the collection owner count and distribution + * Logs Action.SEND event + * @param context - the context for the event + **/ export async function handleTokenTransfer(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getTransferTokenEvent) diff --git a/src/mappings/nfts/types.ts b/src/mappings/nfts/types.ts index 352b0665..a862f267 100644 --- a/src/mappings/nfts/types.ts +++ b/src/mappings/nfts/types.ts @@ -1,5 +1,5 @@ -import { MetadataAttribute } from '@kodadot1/metasquid/types' -import { Attribute } from '../../model' +import { ArchiveCall, ArchiveCallWithOptionalValue, MetadataAttribute, Optional } from '@kodadot1/metasquid/types' +import { Attribute, CollectionSettings } from '../../model' import { createTokenId } from '../utils/types' export type WithId = { @@ -68,7 +68,7 @@ export type SetMetadata = Omit & export type SetAttribute = Omit & { sn?: string trait: string - value?: string | Uint8Array + value?: string } export type ChangeCollectionTeam = WithId & { @@ -77,6 +77,15 @@ export type ChangeCollectionTeam = WithId & { freezer: string } +type MaybeArchiveCall = Pick & { value?: any } + +export type UpdateMintSettings = WithId & { + type: MaybeArchiveCall + startBlock: Optional, + endBlock: Optional, + price: Optional, +} + export const tokenIdOf = (base: BaseTokenEvent): string => createTokenId(base.collectionId, base.sn) export function attributeFrom(attribute: MetadataAttribute): Attribute { @@ -89,3 +98,16 @@ export function attributeFrom(attribute: MetadataAttribute): Attribute { } ) } + + +export function collectionSettingOf(settings: UpdateMintSettings): CollectionSettings { + return new CollectionSettings( + {}, + { + value: String(settings.type.value ?? ''), + startBlock: settings.startBlock, + endBlock: settings.endBlock, + price: settings.price, + } + ) +} \ No newline at end of file diff --git a/src/mappings/nfts/updateMintSettings.ts b/src/mappings/nfts/updateMintSettings.ts new file mode 100644 index 00000000..c2458ba6 --- /dev/null +++ b/src/mappings/nfts/updateMintSettings.ts @@ -0,0 +1,30 @@ +import { getOrFail as get } from '@kodadot1/metasquid/entity' +import { CollectionEntity as CE, CollectionType } from '../../model' +import { unwrap } from '../utils/extract' +import { debug, pending, success } from '../utils/logger' +import { Context } from '../utils/types' +import { getUpdateMintCall } from './getters' +import { collectionSettingOf } from './types' + +const OPERATION = 'UPDATE' as any + +/** + * Handle the collection mint update call (Nfts.update_mint_settings) + * Updates the mint settings of the collection + * Logs Action.UPDATE event + * @param context - the context for the event + **/ +export async function handleCollectionMintUpdate(context: Context): Promise { + pending(OPERATION, `${context.block.height}`) + const event = unwrap(context, getUpdateMintCall) + debug(OPERATION, event) + + const entity = await get(context.store, CE, event.id) + + entity.type = event.type.__kind as CollectionType + entity.settings = collectionSettingOf(event) + + success(OPERATION, `${event.id} by ${event.caller}`) + await context.store.save(entity) +} + \ No newline at end of file diff --git a/src/mappings/shared/metadata.ts b/src/mappings/shared/metadata.ts index 05ee67eb..ef64bca8 100644 --- a/src/mappings/shared/metadata.ts +++ b/src/mappings/shared/metadata.ts @@ -1,11 +1,12 @@ import { create, get } from '@kodadot1/metasquid/entity' -import { Optional, TokenMetadata } from '@kodadot1/metasquid/types' +import { Optional } from '@kodadot1/metasquid/types' +import type { Content } from '@kodadot1/hyperdata' import { logger } from '@kodadot1/metasquid/logger' import { MetadataEntity as Metadata } from '../../model/generated' +import { isEmpty } from '../utils/helper' import { fetchMetadata } from '../utils/metadata' import { Store, attributeFrom } from '../utils/types' -import { isEmpty } from '../utils/helper' export async function handleMetadata(id: string, store: Store): Promise> { const meta = await get(store, Metadata, id) @@ -16,7 +17,7 @@ export async function handleMetadata(id: string, store: Store): Promise(id) + const metadata = await fetchMetadata(id) if (isEmpty(metadata)) { return undefined } @@ -24,8 +25,8 @@ export async function handleMetadata(id: string, store: Store): Promise = { id, description: metadata.description || '', - image: metadata.image || metadata.thumbnailUri || metadata.mediaUri, - animationUrl: metadata.animation_url || metadata.mediaUri, + image: metadata.image || metadata.thumbnail, + animationUrl: metadata.animationUrl, attributes: metadata.attributes?.map(attributeFrom) || [], name: metadata.name || '', type: metadata.type || '', diff --git a/src/mappings/shared/token/burn.ts b/src/mappings/shared/token/burn.ts index 820d32d4..c3de2107 100644 --- a/src/mappings/shared/token/burn.ts +++ b/src/mappings/shared/token/burn.ts @@ -1,18 +1,18 @@ -import { getOptional } from '@kodadot1/metasquid/entity' +import { emOf, getOptional } from '@kodadot1/metasquid/entity' import { Context } from '../../utils/types' import { NFTEntity as NE, TokenEntity as TE } from '../../../model' import { debug } from '../../utils/logger' -import { OPERATION, generateTokenId, mediaOf } from './utils' +import { OPERATION, generateTokenId } from './utils' export async function burnHandler(context: Context, nft: NE): Promise { debug(OPERATION, { handleBurn: `Handle Burn for NFT ${nft.id}` }) - const nftMedia = mediaOf(nft) - if (!nftMedia) { + const tokenId = generateTokenId(nft.collection.id, nft) + if (!tokenId) { return } - const token = await getOptional(context.store, TE, generateTokenId(nft.collection.id, nftMedia)) + const token = await getOptional(context.store, TE, tokenId) if (!token) { return @@ -20,5 +20,5 @@ export async function burnHandler(context: Context, nft: NE): Promise { debug(OPERATION, { BURN: `decrement Token's ${token.id} supply` }) - await context.store.update(TE, token.id, { supply: token.supply - 1, updatedAt: nft.updatedAt }) + await emOf(context.store).update(TE, token.id, { supply: token.supply - 1, updatedAt: nft.updatedAt }) } diff --git a/src/mappings/shared/token/mint.ts b/src/mappings/shared/token/mint.ts index 32b7ad2c..5c9144c2 100644 --- a/src/mappings/shared/token/mint.ts +++ b/src/mappings/shared/token/mint.ts @@ -2,19 +2,19 @@ import { getOptional } from '@kodadot1/metasquid/entity' import { Context } from '../../utils/types' import { CollectionEntity as CE, NFTEntity as NE, TokenEntity as TE } from '../../../model' import { debug } from '../../utils/logger' -import { OPERATION, generateTokenId, mediaOf } from './utils' +import { OPERATION, generateTokenId } from './utils' import { TokenAPI } from './tokenAPI' export async function mintHandler(context: Context, collection: CE, nft: NE): Promise { debug(OPERATION, { mintHandler: `Handle mint for NFT ${nft.id}` }) - const nftMedia = mediaOf(nft) - if (!nftMedia) { + const tokenId = generateTokenId(collection.id, nft) + if (!tokenId) { return } const tokenApi = new TokenAPI(context.store) - const existingToken = await getOptional(context.store, TE, generateTokenId(collection.id, nftMedia)) + const existingToken = await getOptional(context.store, TE, tokenId) return await (existingToken ? tokenApi.addNftToToken(nft, existingToken) : tokenApi.create(collection, nft)) } diff --git a/src/mappings/shared/token/setMetadata.ts b/src/mappings/shared/token/setMetadata.ts index 3f59e14e..44c52ed8 100644 --- a/src/mappings/shared/token/setMetadata.ts +++ b/src/mappings/shared/token/setMetadata.ts @@ -2,15 +2,17 @@ import { getOptional, getWith } from '@kodadot1/metasquid/entity' import { Context } from '../../utils/types' import { CollectionEntity as CE, NFTEntity as NE, TokenEntity as TE } from '../../../model' import { debug, warn } from '../../utils/logger' -import { OPERATION, generateTokenId, mediaOf } from './utils' +import { OPERATION, generateTokenId } from './utils' import { TokenAPI } from './tokenAPI' export async function setMetadataHandler(context: Context, collection: CE, nft: NE): Promise { debug(OPERATION, { handleMetadataSet: `Handle set metadata for NFT ${nft.id}` }) - const nftMedia = mediaOf(nft) - if (!nftMedia) { + + const tokenId = generateTokenId(collection.id, nft) + if (!tokenId) { return } + const tokenAPI = new TokenAPI(context.store) try { @@ -23,6 +25,6 @@ export async function setMetadataHandler(context: Context, collection: CE, nft: return } - const existingToken = await getOptional(context.store, TE, generateTokenId(collection.id, nftMedia)) + const existingToken = await getOptional(context.store, TE, tokenId) return await (existingToken ? tokenAPI.addNftToToken(nft, existingToken) : tokenAPI.create(collection, nft)) } diff --git a/src/mappings/shared/token/tokenAPI.ts b/src/mappings/shared/token/tokenAPI.ts index 5c4b3b15..94737ac9 100644 --- a/src/mappings/shared/token/tokenAPI.ts +++ b/src/mappings/shared/token/tokenAPI.ts @@ -1,19 +1,18 @@ -import { create as createEntity } from '@kodadot1/metasquid/entity' +import { create as createEntity, emOf } from '@kodadot1/metasquid/entity' import md5 from 'md5' import { Store } from '../../utils/types' import { CollectionEntity as CE, NFTEntity as NE, TokenEntity as TE } from '../../../model' import { debug } from '../../utils/logger' -import { OPERATION, generateTokenId, mediaOf, tokenName } from './utils' +import { OPERATION, generateTokenId, tokenName } from './utils' export class TokenAPI { constructor(private store: Store) {} async create(collection: CE, nft: NE): Promise { - const nftMedia = mediaOf(nft) - if (!nftMedia) { + const tokenId = generateTokenId(collection.id, nft) + if (!tokenId) { return } - const tokenId = generateTokenId(collection.id, nftMedia) debug(OPERATION, { createToken: `Create TOKEN ${tokenId} for NFT ${nft.id}` }) const token = createEntity(TE, tokenId, { @@ -33,7 +32,7 @@ export class TokenAPI { }) await this.store.save(token) - await this.store.update(NE, nft.id, { token }) + await emOf(this.store).update(NE, nft.id, { token }) return token } @@ -44,9 +43,9 @@ export class TokenAPI { } debug(OPERATION, { removeNftFromToken: `Unlink NFT ${nft.id} from TOKEN ${token.id}` }) - await this.store.update(NE, nft.id, { token: null }) + await emOf(this.store).update(NE, nft.id, { token: null }) const updatedCount = token.count - 1 - await this.store.update(TE, token.id, { + await emOf(this.store).update(TE, token.id, { supply: token.supply - 1, count: updatedCount, updatedAt: nft.updatedAt, @@ -55,7 +54,7 @@ export class TokenAPI { if (updatedCount === 0) { debug(OPERATION, { deleteEmptyToken: `delete empty token ${token.id}` }) - await this.store.delete(TE, token.id) + await emOf(this.store).delete(TE, token.id) } } @@ -67,7 +66,6 @@ export class TokenAPI { nft.token = token await this.store.save(token) await this.store.save(nft) - return token } } diff --git a/src/mappings/shared/token/utils.ts b/src/mappings/shared/token/utils.ts index 45df6ee2..167c844e 100644 --- a/src/mappings/shared/token/utils.ts +++ b/src/mappings/shared/token/utils.ts @@ -5,19 +5,14 @@ import { CHAIN } from '../../../environment' export const OPERATION = 'TokenEntity' as any -export function generateTokenId(collectionId: string, nftMedia: string): string { - return `${collectionId}-${md5(nftMedia)}` -} - -export const mediaOf = (nft: NE): string | undefined => { - const nftMedia = nft.image ?? nft.media - - if (!nftMedia || nftMedia === '') { +export function generateTokenId(collectionId: string, nft: NE): string | undefined { + if (!nft.image && !nft.media) { warn(OPERATION, `MISSING NFT MEDIA ${nft.id}`) return undefined } - - return nftMedia + const image = nft.image ?? '' + const media = nft.media ?? '' + return `${collectionId}-${md5(image)}:${md5(media)}` } export const collectionsToKeepNameAsIs: Record = { diff --git a/src/mappings/uniques/burn.ts b/src/mappings/uniques/burn.ts index f156d442..603daf7f 100644 --- a/src/mappings/uniques/burn.ts +++ b/src/mappings/uniques/burn.ts @@ -10,6 +10,12 @@ import { getBurnTokenEvent } from './getters' const OPERATION = Action.BURN +/** + * Handle the token burn event (Uniques.Burned) + * Marks the token as burned + * Logs Action.BURN event + * @param context - the context for the event +**/ export async function handleTokenBurn(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getBurnTokenEvent) diff --git a/src/mappings/uniques/buy.ts b/src/mappings/uniques/buy.ts index 088e390e..3ffe3534 100644 --- a/src/mappings/uniques/buy.ts +++ b/src/mappings/uniques/buy.ts @@ -9,6 +9,12 @@ import { getBuyTokenEvent } from './getters' const OPERATION = Action.BUY +/** + * Handle the token buy event (Uniques.ItemBought) + * Changes the owner of the token, updates the collection volume, highest sale, floor, owner count and distribution + * Logs Action.BUY event + * @param context - the context for the event +**/ export async function handleTokenBuy(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getBuyTokenEvent) diff --git a/src/mappings/uniques/change.ts b/src/mappings/uniques/change.ts index 6b48a416..542977e8 100644 --- a/src/mappings/uniques/change.ts +++ b/src/mappings/uniques/change.ts @@ -7,6 +7,12 @@ import { getChangeCollectionOwnerEvent } from './getters' const OPERATION = Action.CHANGEISSUER +/** + * Handle the collection owner change event (Uniques.OwnerChanged) + * Changes the owner of the collection + * Logs Action.CHANGEISSUER event + * @param context - the context for the event + **/ export async function handleCollectionOwnerChange(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getChangeCollectionOwnerEvent) diff --git a/src/mappings/uniques/changeTeam.ts b/src/mappings/uniques/changeTeam.ts index 85ec8be1..5127fbda 100644 --- a/src/mappings/uniques/changeTeam.ts +++ b/src/mappings/uniques/changeTeam.ts @@ -7,6 +7,12 @@ import { getChangeTeamEvent } from './getters' const OPERATION = Action.CHANGEISSUER +/** + * Handle the collection team change event (Uniques.TeamChanged) + * Changes the team of the collection + * Logs Action.CHANGEISSUER event + * @param context - the context for the event + **/ export async function handleCollectionTeamChange(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getChangeTeamEvent) diff --git a/src/mappings/uniques/create.ts b/src/mappings/uniques/create.ts index 51a84227..5f466db9 100644 --- a/src/mappings/uniques/create.ts +++ b/src/mappings/uniques/create.ts @@ -10,6 +10,12 @@ import { getCreateCollectionEvent } from './getters' const OPERATION = Action.CREATE +/** + * Handle the collection create event (Uniques.Created) + * Creates a new collection entity + * Logs Action.CREATE event + * @param context - the context for the event + **/ export async function handleCollectionCreate(context: Context): Promise { pending(OPERATION, `[COLECTTION++]: ${context.block.height}`) const event = unwrap(context, getCreateCollectionEvent) diff --git a/src/mappings/uniques/destroy.ts b/src/mappings/uniques/destroy.ts index 751587c8..e4998e81 100644 --- a/src/mappings/uniques/destroy.ts +++ b/src/mappings/uniques/destroy.ts @@ -7,6 +7,12 @@ import { getDestroyCollectionEvent } from './getters' const OPERATION = Action.DESTROY +/** + * Handle the collection destroy event (Uniques.Destroyed) + * Marks the collection as burned + * Logs Action.DESTROY event + * @param context - the context for the event + **/ export async function handleCollectionDestroy(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getDestroyCollectionEvent) diff --git a/src/mappings/uniques/forceCreate.ts b/src/mappings/uniques/forceCreate.ts index 41fe7187..5150bd4a 100644 --- a/src/mappings/uniques/forceCreate.ts +++ b/src/mappings/uniques/forceCreate.ts @@ -10,6 +10,12 @@ import { getForceCreateCollectionEvent } from './getters' const OPERATION = Action.CREATE +/** + * Handle the collection force create event (Uniques.ForceCreated) + * Creates a new collection entity + * Logs Action.CREATE event + * @param context - the context for the event + **/ export async function handleForceCollectionCreate(context: Context): Promise { pending(OPERATION, `[FORCE]: ${context.block.height}`) const event = unwrap(context, getForceCreateCollectionEvent) diff --git a/src/mappings/uniques/getters/index.ts b/src/mappings/uniques/getters/index.ts index 4c582341..4c18bacf 100644 --- a/src/mappings/uniques/getters/index.ts +++ b/src/mappings/uniques/getters/index.ts @@ -1,4 +1,4 @@ -import { isProd } from '../../../environment' +import { CHAIN } from '../../../environment' import { Context } from '../../utils/types' import { BurnTokenEvent, @@ -17,87 +17,108 @@ import { } from '../types' // eslint-disable-next-line unicorn/prefer-module -const proc = isProd ? require('./statemine') : require('./statemint') +const proc = require(`./${CHAIN}`) -export function getCreateCollectionEvent(ctx: Context): CreateCollectionEvent { +export function getCreateCollectionEvent(_ctx: Context): CreateCollectionEvent { + const ctx = _ctx.event return proc.getCreateCollectionEvent(ctx) } -export function getForceCreateCollectionEvent(ctx: Context): ForceCreateCollectionEvent { +export function getForceCreateCollectionEvent(_ctx: Context): ForceCreateCollectionEvent { + const ctx = _ctx.event return proc.getForceCreateCollectionEvent(ctx) } -export function getCreateTokenEvent(ctx: Context): CreateTokenEvent { +export function getCreateTokenEvent(_ctx: Context): CreateTokenEvent { + const ctx = _ctx.event return proc.getCreateTokenEvent(ctx) } -export function getTransferTokenEvent(ctx: Context): TransferTokenEvent { +export function getTransferTokenEvent(_ctx: Context): TransferTokenEvent { + const ctx = _ctx.event return proc.getTransferTokenEvent(ctx) } -export function getBurnTokenEvent(ctx: Context): BurnTokenEvent { +export function getBurnTokenEvent(_ctx: Context): BurnTokenEvent { + const ctx = _ctx.event return proc.getBurnTokenEvent(ctx) } -export function getDestroyCollectionEvent(ctx: Context): DestroyCollectionEvent { +export function getDestroyCollectionEvent(_ctx: Context): DestroyCollectionEvent { + const ctx = _ctx.event return proc.getDestroyCollectionEvent(ctx) } -export function getListTokenEvent(ctx: Context): ListTokenEvent { +export function getListTokenEvent(_ctx: Context): ListTokenEvent { + const ctx = _ctx.event return proc.getListTokenEvent(ctx) } -export function getUnListTokenEvent(ctx: Context): ListTokenEvent { +export function getUnListTokenEvent(_ctx: Context): ListTokenEvent { + const ctx = _ctx.event return proc.getUnListTokenEvent(ctx) } -export function getPriceTokenEvent(ctx: Context): ListTokenEvent { +export function getPriceTokenEvent(_ctx: Context): ListTokenEvent { + const ctx = _ctx.event return proc.getPriceTokenEvent(ctx) } -export function getBuyTokenEvent(ctx: Context): BuyTokenEvent { +export function getBuyTokenEvent(_ctx: Context): BuyTokenEvent { + const ctx = _ctx.event return proc.getBuyTokenEvent(ctx) } -export function getLockCollectionEvent(ctx: Context): LockCollectionEvent { +export function getLockCollectionEvent(_ctx: Context): LockCollectionEvent { + const ctx = _ctx.event return proc.getLockCollectionEvent(ctx) } -export function getChangeCollectionOwnerEvent(ctx: Context): ChangeCollectionOwnerEvent { +export function getChangeCollectionOwnerEvent(_ctx: Context): ChangeCollectionOwnerEvent { + const ctx = _ctx.event return proc.getChangeCollectionOwnerEvent(ctx) } -export function getClearCollectionMetadataEvent(ctx: Context): SetMetadata { +export function getClearCollectionMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event return proc.getClearCollectionMetadataEvent(ctx) } -export function getCreateCollectionMetadataEvent(ctx: Context): SetMetadata { +export function getCreateCollectionMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event return proc.getCreateCollectionMetadataEvent(ctx) } -export function getClearClassMetadataEvent(ctx: Context): SetMetadata { +export function getClearClassMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event return proc.getClearClassMetadataEvent(ctx) } -export function getCreateClassMetadataEvent(ctx: Context): SetMetadata { +export function getCreateClassMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event return proc.getCreateClassMetadataEvent(ctx) } -export function getCreateMetadataEvent(ctx: Context): SetMetadata { +export function getCreateMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event return proc.getCreateMetadataEvent(ctx) } -export function getClearMetadataEvent(ctx: Context): SetMetadata { +export function getClearMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event return proc.getClearMetadataEvent(ctx) } -export function getMetadataEvent(ctx: Context): SetMetadata { +export function getMetadataEvent(_ctx: Context): SetMetadata { + const ctx = _ctx.event return proc.getMetadataEvent(ctx) } -export function getAttributeEvent(ctx: Context): SetAttribute { +export function getAttributeEvent(_ctx: Context): SetAttribute { + const ctx = _ctx.event return proc.getAttributeEvent(ctx) } -export function getChangeTeamEvent(ctx: Context): ChangeCollectionTeam { +export function getChangeTeamEvent(_ctx: Context): ChangeCollectionTeam { + const ctx = _ctx.event return proc.getChangeTeamEvent(ctx) } diff --git a/src/mappings/uniques/getters/kusama.ts b/src/mappings/uniques/getters/kusama.ts new file mode 100644 index 00000000..6aa69bdf --- /dev/null +++ b/src/mappings/uniques/getters/kusama.ts @@ -0,0 +1,426 @@ +import { Interaction } from '../../../model' +import { uniques as events } from '../../../types/kusama/events' +import { addressOf, idOf, UNIQUE_PREFIX as U, unHex } from '../../utils/helper' +import { warn } from '../../utils/logger' +import { Event } from '../../utils/types' +import { + BurnTokenEvent, + BuyTokenEvent, + ChangeCollectionOwnerEvent, + ChangeCollectionTeam, + CreateCollectionEvent, + CreateTokenEvent, + DestroyCollectionEvent, + ForceCreateCollectionEvent, + ListTokenEvent, + LockCollectionEvent, + SetAttribute, + SetMetadata, + TransferTokenEvent, +} from '../types' +import { Unique } from '../../../processable' + + +export function getCreateCollectionEvent(ctx: Event): CreateCollectionEvent { + const event = events.created + if (event.v1.is(ctx)) { + const [classId, creator, owner] = event.v1.decode(ctx) + return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } + } + if (event.v700.is(ctx)) { + const { class: classId, creator, owner } = event.v700.decode(ctx) + return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, creator, owner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } + } + warn(Interaction.CREATE, 'USING UNSAFE GETTER! PLS UPDATE TYPES!') + const { collection: classId, creator, owner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } +} + +export function getForceCreateCollectionEvent(ctx: Event): ForceCreateCollectionEvent { + const event = events.forceCreated + if (event.v1.is(ctx)) { + const [classId, owner] = event.v1.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(owner) } + } + if (event.v700.is(ctx)) { + const { class: classId, owner } = event.v700.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(owner) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, owner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(owner) } + } + + const { collection: classId, owner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(owner) } +} + +export function getCreateTokenEvent(ctx: Event): CreateTokenEvent { + const event = events.issued + if (event.v1.is(ctx)) { + const [classId, instanceId, owner] = event.v1.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId, owner } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId, owner } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + + const { collection: classId, item: instanceId, owner } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } +} + +export function getTransferTokenEvent(ctx: Event): TransferTokenEvent { + const event = events.transferred + if (event.v1.is(ctx)) { + const [classId, instanceId, from, to] = event.v1.decode(ctx) + return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId, from, to } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId, from, to } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } + } + + const { collection: classId, item: instanceId, from, to } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } +} + +export function getBurnTokenEvent(ctx: Event): BurnTokenEvent { + const event = events.burned + if (event.v1.is(ctx)) { + const [classId, instanceId, owner] = event.v1.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId, owner } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId, owner } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + + const { collection: classId, item: instanceId, owner } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } +} + +export function getDestroyCollectionEvent(ctx: Event): DestroyCollectionEvent { + const event = events.destroyed + if (event.v1.is(ctx)) { + const classId = event.v1.decode(ctx) + return { id: idOf(classId, U) } + } + if (event.v700.is(ctx)) { + const { class: classId } = event.v700.decode(ctx) + return { id: idOf(classId, U) } + } + if (event.v9230.is(ctx)) { + const { collection: classId } = event.v9230.decode(ctx) + return { id: idOf(classId, U) } + } + + + const { collection: classId } = event.v9230.decode(ctx) + return { id: idOf(classId, U) } +} + +export function getListTokenEvent(ctx: Event): ListTokenEvent { + const event = events.itemPriceSet + + if (event.v9270.is(ctx)) { + const { collection: classId, item: instanceId, price } = event.v9270.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), price } + } + + + const { collection: classId, item: instanceId, price } = event.v9270.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), price } +} + +export function getUnListTokenEvent(ctx: Event): ListTokenEvent { + const event = events.itemPriceRemoved + + if (event.v9270.is(ctx)) { + const { collection: classId, item: instanceId } = event.v9270.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), price: 0n } + } + + + const { collection: classId, item: instanceId } = event.v9270.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), price: 0n } +} + +export function getPriceTokenEvent(ctx: Event): ListTokenEvent { + if (ctx.name === Unique.setPrice) { + return getListTokenEvent(ctx) + } + + return getUnListTokenEvent(ctx) +} + +export function getBuyTokenEvent(ctx: Event): BuyTokenEvent { + const event = events.itemBought + + if (event.v9270.is(ctx)) { + const { collection: classId, item: instanceId, price, seller, buyer } = event.v9270.decode(ctx) + return { + collectionId: idOf(classId, U), + caller: addressOf(buyer), + sn: instanceId.toString(), + price: BigInt(price ?? 0), + currentOwner: addressOf(seller), + } + } + + const { collection: classId, item: instanceId, price, seller, buyer } = event.v9270.decode(ctx) + return { + collectionId: idOf(classId, U), + caller: addressOf(buyer), + sn: instanceId.toString(), + price: BigInt(price ?? 0), + currentOwner: addressOf(seller), + } +} + +export function getLockCollectionEvent(ctx: Event): LockCollectionEvent { + const event = events.collectionMaxSupplySet + if (event.v9230.is(ctx)) { + const { collection: classId, maxSupply: max } = event.v9230.decode(ctx) + return { id: idOf(classId, U), max } + } + + const { collection: classId, maxSupply: max } = event.v9230.decode(ctx) + return { id: idOf(classId, U), max } +} + +export function getChangeCollectionOwnerEvent(ctx: Event): ChangeCollectionOwnerEvent { + const event = events.ownerChanged + if (event.v1.is(ctx)) { + const [classId, newOwner] = event.v1.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(newOwner) } + } + if (event.v700.is(ctx)) { + const { class: classId, newOwner } = event.v700.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(newOwner) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, newOwner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(newOwner) } + } + + + const { collection: classId, newOwner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(newOwner) } +} + +export function getClearCollectionMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataCleared + if (event.v9230.is(ctx)) { + const { collection: classId } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U) } + } + + const { collection: classId } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U) } +} + +export function getCreateCollectionMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataSet + if (event.v9230.is(ctx)) { + const { collection: classId, data, isFrozen } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } + } + + + const { collection: classId, data, isFrozen } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } +} + +export function getClearClassMetadataEvent(ctx: Event): SetMetadata { + const event = events.classMetadataCleared + if (event.v1.is(ctx)) { + const classId = event.v1.decode(ctx) + return { collectionId: idOf(classId, U) } + } + if (event.v700.is(ctx)) { + const { class: classId } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U) } + } + + + const { class: classId } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U) } +} + +export function getCreateClassMetadataEvent(ctx: Event): SetMetadata { + const event = events.classMetadataSet + if (event.v1.is(ctx)) { + const [classId, data, isFrozen] = event.v1.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } + } + if (event.v700.is(ctx)) { + const { class: classId, data, isFrozen } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } + } + + + const { class: classId, data, isFrozen } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } +} + +export function getCreateMetadataEvent(ctx: Event): SetMetadata { + const event = events.metadataSet + if (event.v1.is(ctx)) { + const [classId, instanceId, data, isFrozen] = event.v1.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: unHex(data) } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId, data, isFrozen } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: unHex(data) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId, data, isFrozen } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: unHex(data) } + } + + + const { collection: classId, item: instanceId, data, isFrozen } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: unHex(data) } +} + +export function getClearMetadataEvent(ctx: Event): SetMetadata { + const event = events.metadataCleared + if (event.v1.is(ctx)) { + const [classId, instanceId] = event.v1.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString() } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString() } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString() } + } + + + const { collection: classId, item: instanceId } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString() } +} + +export function getMetadataEvent(ctx: Event): SetMetadata { + switch (ctx.name) { + case Unique.clearClassMetadata: + return getClearClassMetadataEvent(ctx) + case Unique.setClassMetadata: + return getCreateClassMetadataEvent(ctx) + case Unique.setCollectionMetadata: + return getCreateCollectionMetadataEvent(ctx) + case Unique.clearCollectionMetadata: + return getClearCollectionMetadataEvent(ctx) + case Unique.setMetadata: + return getCreateMetadataEvent(ctx) + case Unique.clearMetadata: + return getClearMetadataEvent(ctx) + default: + throw new Error('Unsupported event') + } +} + +function getSetAttributeEvent(ctx: Event): SetAttribute { + const event = events.attributeSet + if (event.v1.is(ctx)) { + const [classId, instanceId, key, value] = event.v1.decode(ctx) + return { + collectionId: idOf(classId, U), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } + } + if (event.v700.is(ctx)) { + const { class: classId, maybeInstance: instanceId, key, value } = event.v700.decode(ctx) + return { + collectionId: idOf(classId, U), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } + } + if (event.v9230.is(ctx)) { + const { collection: classId, maybeItem: instanceId, key, value } = event.v9230.decode(ctx) + return { + collectionId: idOf(classId, U), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } + } + + + const { collection: classId, maybeItem: instanceId, key, value } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key), value } +} + +function getClearAttributeEvent(ctx: Event): SetAttribute { + const event = events.attributeCleared + + if (event.v1.is(ctx)) { + const [classId, instanceId, key] = event.v1.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key) } + } + if (event.v700.is(ctx)) { + const { class: classId, maybeInstance: instanceId, key } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, maybeItem: instanceId, key } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key) } + } + + + const { collection: classId, maybeItem: instanceId, key } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key) } +} + +export function getAttributeEvent(ctx: Event): SetAttribute { + switch (ctx.name) { + case Unique.setAttribute: + return getSetAttributeEvent(ctx) + case Unique.clearAttribute: + return getClearAttributeEvent(ctx) + default: + throw new Error('Unsupported event') + } +} + +export function getChangeTeamEvent(ctx: Event): ChangeCollectionTeam { + const event = events.teamChanged + if (event.v1.is(ctx)) { + const [classId, issuer, admin, freezer] = event.v1.decode(ctx) + return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } + } + if (event.v700.is(ctx)) { + const { class: classId, issuer, admin, freezer } = event.v700.decode(ctx) + return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, issuer, admin, freezer } = event.v9230.decode(ctx) + return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } + } + + const { collection: classId, issuer, admin, freezer } = event.v9230.decode(ctx) + return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } +} diff --git a/src/mappings/uniques/getters/polkadot.ts b/src/mappings/uniques/getters/polkadot.ts new file mode 100644 index 00000000..ffcf00d0 --- /dev/null +++ b/src/mappings/uniques/getters/polkadot.ts @@ -0,0 +1,426 @@ +import { Interaction } from '../../../model' +import { uniques as events } from '../../../types/polkadot/events' +import { addressOf, idOf, UNIQUE_PREFIX as U, unHex } from '../../utils/helper' +import { warn } from '../../utils/logger' +import { Event } from '../../utils/types' +import { + BurnTokenEvent, + BuyTokenEvent, + ChangeCollectionOwnerEvent, + ChangeCollectionTeam, + CreateCollectionEvent, + CreateTokenEvent, + DestroyCollectionEvent, + ForceCreateCollectionEvent, + ListTokenEvent, + LockCollectionEvent, + SetAttribute, + SetMetadata, + TransferTokenEvent, +} from '../types' +import { Unique } from '../../../processable' + + +export function getCreateCollectionEvent(ctx: Event): CreateCollectionEvent { + const event = events.created + if (event.v601.is(ctx)) { + const [classId, creator, owner] = event.v601.decode(ctx) + return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } + } + if (event.v700.is(ctx)) { + const { class: classId, creator, owner } = event.v700.decode(ctx) + return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, creator, owner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } + } + warn(Interaction.CREATE, 'USING UNSAFE GETTER! PLS UPDATE TYPES!') + const { collection: classId, creator, owner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } +} + +export function getForceCreateCollectionEvent(ctx: Event): ForceCreateCollectionEvent { + const event = events.forceCreated + if (event.v601.is(ctx)) { + const [classId, owner] = event.v601.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(owner) } + } + if (event.v700.is(ctx)) { + const { class: classId, owner } = event.v700.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(owner) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, owner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(owner) } + } + + const { collection: classId, owner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(owner) } +} + +export function getCreateTokenEvent(ctx: Event): CreateTokenEvent { + const event = events.issued + if (event.v601.is(ctx)) { + const [classId, instanceId, owner] = event.v601.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId, owner } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId, owner } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + + const { collection: classId, item: instanceId, owner } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } +} + +export function getTransferTokenEvent(ctx: Event): TransferTokenEvent { + const event = events.transferred + if (event.v601.is(ctx)) { + const [classId, instanceId, from, to] = event.v601.decode(ctx) + return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId, from, to } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId, from, to } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } + } + + const { collection: classId, item: instanceId, from, to } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } +} + +export function getBurnTokenEvent(ctx: Event): BurnTokenEvent { + const event = events.burned + if (event.v601.is(ctx)) { + const [classId, instanceId, owner] = event.v601.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId, owner } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId, owner } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } + } + + const { collection: classId, item: instanceId, owner } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } +} + +export function getDestroyCollectionEvent(ctx: Event): DestroyCollectionEvent { + const event = events.destroyed + if (event.v601.is(ctx)) { + const classId = event.v601.decode(ctx) + return { id: idOf(classId, U) } + } + if (event.v700.is(ctx)) { + const { class: classId } = event.v700.decode(ctx) + return { id: idOf(classId, U) } + } + if (event.v9230.is(ctx)) { + const { collection: classId } = event.v9230.decode(ctx) + return { id: idOf(classId, U) } + } + + + const { collection: classId } = event.v9230.decode(ctx) + return { id: idOf(classId, U) } +} + +export function getListTokenEvent(ctx: Event): ListTokenEvent { + const event = events.itemPriceSet + + if (event.v9270.is(ctx)) { + const { collection: classId, item: instanceId, price } = event.v9270.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), price } + } + + + const { collection: classId, item: instanceId, price } = event.v9270.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), price } +} + +export function getUnListTokenEvent(ctx: Event): ListTokenEvent { + const event = events.itemPriceRemoved + + if (event.v9270.is(ctx)) { + const { collection: classId, item: instanceId } = event.v9270.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), price: 0n } + } + + + const { collection: classId, item: instanceId } = event.v9270.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), price: 0n } +} + +export function getPriceTokenEvent(ctx: Event): ListTokenEvent { + if (ctx.name === Unique.setPrice) { + return getListTokenEvent(ctx) + } + + return getUnListTokenEvent(ctx) +} + +export function getBuyTokenEvent(ctx: Event): BuyTokenEvent { + const event = events.itemBought + + if (event.v9270.is(ctx)) { + const { collection: classId, item: instanceId, price, seller, buyer } = event.v9270.decode(ctx) + return { + collectionId: idOf(classId, U), + caller: addressOf(buyer), + sn: instanceId.toString(), + price: BigInt(price ?? 0), + currentOwner: addressOf(seller), + } + } + + const { collection: classId, item: instanceId, price, seller, buyer } = event.v9270.decode(ctx) + return { + collectionId: idOf(classId, U), + caller: addressOf(buyer), + sn: instanceId.toString(), + price: BigInt(price ?? 0), + currentOwner: addressOf(seller), + } +} + +export function getLockCollectionEvent(ctx: Event): LockCollectionEvent { + const event = events.collectionMaxSupplySet + if (event.v9230.is(ctx)) { + const { collection: classId, maxSupply: max } = event.v9230.decode(ctx) + return { id: idOf(classId, U), max } + } + + const { collection: classId, maxSupply: max } = event.v9230.decode(ctx) + return { id: idOf(classId, U), max } +} + +export function getChangeCollectionOwnerEvent(ctx: Event): ChangeCollectionOwnerEvent { + const event = events.ownerChanged + if (event.v601.is(ctx)) { + const [classId, newOwner] = event.v601.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(newOwner) } + } + if (event.v700.is(ctx)) { + const { class: classId, newOwner } = event.v700.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(newOwner) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, newOwner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(newOwner) } + } + + + const { collection: classId, newOwner } = event.v9230.decode(ctx) + return { id: idOf(classId, U), owner: addressOf(newOwner) } +} + +export function getClearCollectionMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataCleared + if (event.v9230.is(ctx)) { + const { collection: classId } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U) } + } + + const { collection: classId } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U) } +} + +export function getCreateCollectionMetadataEvent(ctx: Event): SetMetadata { + const event = events.collectionMetadataSet + if (event.v9230.is(ctx)) { + const { collection: classId, data, isFrozen } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } + } + + + const { collection: classId, data, isFrozen } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } +} + +export function getClearClassMetadataEvent(ctx: Event): SetMetadata { + const event = events.classMetadataCleared + if (event.v601.is(ctx)) { + const classId = event.v601.decode(ctx) + return { collectionId: idOf(classId, U) } + } + if (event.v700.is(ctx)) { + const { class: classId } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U) } + } + + + const { class: classId } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U) } +} + +export function getCreateClassMetadataEvent(ctx: Event): SetMetadata { + const event = events.classMetadataSet + if (event.v601.is(ctx)) { + const [classId, data, isFrozen] = event.v601.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } + } + if (event.v700.is(ctx)) { + const { class: classId, data, isFrozen } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } + } + + + const { class: classId, data, isFrozen } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), metadata: unHex(data) } +} + +export function getCreateMetadataEvent(ctx: Event): SetMetadata { + const event = events.metadataSet + if (event.v601.is(ctx)) { + const [classId, instanceId, data, isFrozen] = event.v601.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: unHex(data) } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId, data, isFrozen } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: unHex(data) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId, data, isFrozen } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: unHex(data) } + } + + + const { collection: classId, item: instanceId, data, isFrozen } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: unHex(data) } +} + +export function getClearMetadataEvent(ctx: Event): SetMetadata { + const event = events.metadataCleared + if (event.v601.is(ctx)) { + const [classId, instanceId] = event.v601.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString() } + } + if (event.v700.is(ctx)) { + const { class: classId, instance: instanceId } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString() } + } + if (event.v9230.is(ctx)) { + const { collection: classId, item: instanceId } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString() } + } + + + const { collection: classId, item: instanceId } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId.toString() } +} + +export function getMetadataEvent(ctx: Event): SetMetadata { + switch (ctx.name) { + case Unique.clearClassMetadata: + return getClearClassMetadataEvent(ctx) + case Unique.setClassMetadata: + return getCreateClassMetadataEvent(ctx) + case Unique.setCollectionMetadata: + return getCreateCollectionMetadataEvent(ctx) + case Unique.clearCollectionMetadata: + return getClearCollectionMetadataEvent(ctx) + case Unique.setMetadata: + return getCreateMetadataEvent(ctx) + case Unique.clearMetadata: + return getClearMetadataEvent(ctx) + default: + throw new Error('Unsupported event') + } +} + +function getSetAttributeEvent(ctx: Event): SetAttribute { + const event = events.attributeSet + if (event.v601.is(ctx)) { + const [classId, instanceId, key, value] = event.v601.decode(ctx) + return { + collectionId: idOf(classId, U), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } + } + if (event.v700.is(ctx)) { + const { class: classId, maybeInstance: instanceId, key, value } = event.v700.decode(ctx) + return { + collectionId: idOf(classId, U), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } + } + if (event.v9230.is(ctx)) { + const { collection: classId, maybeItem: instanceId, key, value } = event.v9230.decode(ctx) + return { + collectionId: idOf(classId, U), + sn: instanceId?.toString(), + trait: unHex(key), + value, + } + } + + + const { collection: classId, maybeItem: instanceId, key, value } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key), value: unHex(value) } +} + +function getClearAttributeEvent(ctx: Event): SetAttribute { + const event = events.attributeCleared + + if (event.v601.is(ctx)) { + const [classId, instanceId, key] = event.v601.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key) } + } + if (event.v700.is(ctx)) { + const { class: classId, maybeInstance: instanceId, key } = event.v700.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, maybeItem: instanceId, key } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key) } + } + + + const { collection: classId, maybeItem: instanceId, key } = event.v9230.decode(ctx) + return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: unHex(key) } +} + +export function getAttributeEvent(ctx: Event): SetAttribute { + switch (ctx.name) { + case Unique.setAttribute: + return getSetAttributeEvent(ctx) + case Unique.clearAttribute: + return getClearAttributeEvent(ctx) + default: + throw new Error('Unsupported event') + } +} + +export function getChangeTeamEvent(ctx: Event): ChangeCollectionTeam { + const event = events.teamChanged + if (event.v601.is(ctx)) { + const [classId, issuer, admin, freezer] = event.v601.decode(ctx) + return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } + } + if (event.v700.is(ctx)) { + const { class: classId, issuer, admin, freezer } = event.v700.decode(ctx) + return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } + } + if (event.v9230.is(ctx)) { + const { collection: classId, issuer, admin, freezer } = event.v9230.decode(ctx) + return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } + } + + const { collection: classId, issuer, admin, freezer } = event.v9230.decode(ctx) + return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } +} diff --git a/src/mappings/uniques/getters/statemine.ts b/src/mappings/uniques/getters/statemine.ts deleted file mode 100644 index 3b22c5bc..00000000 --- a/src/mappings/uniques/getters/statemine.ts +++ /dev/null @@ -1,426 +0,0 @@ -import { Interaction } from '../../../model' -import * as events from '../../../types/statemine/events' -import { addressOf, idOf, UNIQUE_PREFIX as U } from '../../utils/helper' -import { warn } from '../../utils/logger' -import { Context } from '../../utils/types' -import { - BurnTokenEvent, - BuyTokenEvent, - ChangeCollectionOwnerEvent, - ChangeCollectionTeam, - CreateCollectionEvent, - CreateTokenEvent, - DestroyCollectionEvent, - ForceCreateCollectionEvent, - ListTokenEvent, - LockCollectionEvent, - SetAttribute, - SetMetadata, - TransferTokenEvent, -} from '../types' -import { Unique as Event } from '../../../processable' - -export function getCreateCollectionEvent(ctx: Context): CreateCollectionEvent { - const event = new events.UniquesCreatedEvent(ctx) - if (event.isV1) { - const [classId, creator, owner] = event.asV1 - return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } - } - if (event.isV700) { - const { class: classId, creator, owner } = event.asV700 - return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } - } - if (event.isV9230) { - const { collection: classId, creator, owner } = event.asV9230 - return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } - } - warn(Interaction.CREATE, 'USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, creator, owner } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } -} - -export function getForceCreateCollectionEvent(ctx: Context): ForceCreateCollectionEvent { - const event = new events.UniquesForceCreatedEvent(ctx) - if (event.isV1) { - const [classId, owner] = event.asV1 - return { id: idOf(classId, U), owner: addressOf(owner) } - } - if (event.isV700) { - const { class: classId, owner } = event.asV700 - return { id: idOf(classId, U), owner: addressOf(owner) } - } - if (event.isV9230) { - const { collection: classId, owner } = event.asV9230 - return { id: idOf(classId, U), owner: addressOf(owner) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, owner } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), owner: addressOf(owner) } -} - -export function getCreateTokenEvent(ctx: Context): CreateTokenEvent { - const event = new events.UniquesIssuedEvent(ctx) - if (event.isV1) { - const [classId, instanceId, owner] = event.asV1 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - if (event.isV700) { - const { class: classId, instance: instanceId, owner } = event.asV700 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - if (event.isV9230) { - const { collection: classId, item: instanceId, owner } = event.asV9230 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, owner } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } -} - -export function getTransferTokenEvent(ctx: Context): TransferTokenEvent { - const event = new events.UniquesTransferredEvent(ctx) - if (event.isV1) { - const [classId, instanceId, from, to] = event.asV1 - return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } - } - if (event.isV700) { - const { class: classId, instance: instanceId, from, to } = event.asV700 - return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } - } - if (event.isV9230) { - const { collection: classId, item: instanceId, from, to } = event.asV9230 - return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, from, to } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } -} - -export function getBurnTokenEvent(ctx: Context): BurnTokenEvent { - const event = new events.UniquesBurnedEvent(ctx) - if (event.isV1) { - const [classId, instanceId, owner] = event.asV1 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - if (event.isV700) { - const { class: classId, instance: instanceId, owner } = event.asV700 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - if (event.isV9230) { - const { collection: classId, item: instanceId, owner } = event.asV9230 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, owner } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } -} - -export function getDestroyCollectionEvent(ctx: Context): DestroyCollectionEvent { - const event = new events.UniquesDestroyedEvent(ctx) - if (event.isV1) { - const classId = event.asV1 - return { id: idOf(classId, U) } - } - if (event.isV700) { - const { class: classId } = event.asV700 - return { id: idOf(classId, U) } - } - if (event.isV9230) { - const { collection: classId } = event.asV9230 - return { id: idOf(classId, U) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U) } -} - -export function getListTokenEvent(ctx: Context): ListTokenEvent { - const event = new events.UniquesItemPriceSetEvent(ctx) - - if (event.isV9270) { - const { collection: classId, item: instanceId, price } = event.asV9270 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), price } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId.toString(), price } -} - -export function getUnListTokenEvent(ctx: Context): ListTokenEvent { - const event = new events.UniquesItemPriceRemovedEvent(ctx) - - if (event.isV9270) { - const { collection: classId, item: instanceId } = event.asV9270 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), price: 0n } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId.toString(), price: 0n } -} - -export function getPriceTokenEvent(ctx: Context): ListTokenEvent { - if (ctx.event.name === Event.setPrice) { - return getListTokenEvent(ctx) - } - - return getUnListTokenEvent(ctx) -} - -export function getBuyTokenEvent(ctx: Context): BuyTokenEvent { - const event = new events.UniquesItemBoughtEvent(ctx) - - if (event.isV9270) { - const { collection: classId, item: instanceId, price, seller, buyer } = event.asV9270 - return { - collectionId: idOf(classId, U), - caller: addressOf(buyer), - sn: instanceId.toString(), - price: BigInt(price ?? 0), - currentOwner: addressOf(seller), - } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price, seller, buyer } = ctx._chain.decodeEvent(ctx.event) - return { - collectionId: idOf(classId, U), - caller: addressOf(buyer), - sn: instanceId.toString(), - price: BigInt(price ?? 0), - currentOwner: addressOf(seller), - } -} - -export function getLockCollectionEvent(ctx: Context): LockCollectionEvent { - const event = new events.UniquesCollectionMaxSupplySetEvent(ctx) - if (event.isV9230) { - const { collection: classId, maxSupply: max } = event.asV9230 - return { id: idOf(classId, U), max } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, mamaxSupply: max } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), max } -} - -export function getChangeCollectionOwnerEvent(ctx: Context): ChangeCollectionOwnerEvent { - const event = new events.UniquesOwnerChangedEvent(ctx) - if (event.isV1) { - const [classId, newOwner] = event.asV1 - return { id: idOf(classId, U), owner: addressOf(newOwner) } - } - if (event.isV700) { - const { class: classId, newOwner } = event.asV700 - return { id: idOf(classId, U), owner: addressOf(newOwner) } - } - if (event.isV9230) { - const { collection: classId, newOwner } = event.asV9230 - return { id: idOf(classId, U), owner: addressOf(newOwner) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, newOwner } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), owner: addressOf(newOwner) } -} - -export function getClearCollectionMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesCollectionMetadataClearedEvent(ctx) - if (event.isV9230) { - const { collection: classId } = event.asV9230 - return { collectionId: idOf(classId, U) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U) } -} - -export function getCreateCollectionMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesCollectionMetadataSetEvent(ctx) - if (event.isV9230) { - const { collection: classId, data, isFrozen } = event.asV9230 - return { collectionId: idOf(classId, U), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), metadata: data.toString() } -} - -export function getClearClassMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesClassMetadataClearedEvent(ctx) - if (event.isV1) { - const classId = event.asV1 - return { collectionId: idOf(classId, U) } - } - if (event.isV700) { - const { class: classId } = event.asV700 - return { collectionId: idOf(classId, U) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U) } -} - -export function getCreateClassMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesClassMetadataSetEvent(ctx) - if (event.isV1) { - const [classId, data, isFrozen] = event.asV1 - return { collectionId: idOf(classId, U), metadata: data.toString() } - } - if (event.isV700) { - const { class: classId, data, isFrozen } = event.asV700 - return { collectionId: idOf(classId, U), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), metadata: data.toString() } -} - -export function getCreateMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesMetadataSetEvent(ctx) - if (event.isV1) { - const [classId, instanceId, data, isFrozen] = event.asV1 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: data.toString() } - } - if (event.isV700) { - const { class: classId, instance: instanceId, data, isFrozen } = event.asV700 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: data.toString() } - } - if (event.isV9230) { - const { collection: classId, item: instanceId, data, isFrozen } = event.asV9230 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: data.toString() } -} - -export function getClearMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesMetadataClearedEvent(ctx) - if (event.isV1) { - const [classId, instanceId] = event.asV1 - return { collectionId: idOf(classId, U), sn: instanceId.toString() } - } - if (event.isV700) { - const { class: classId, instance: instanceId } = event.asV700 - return { collectionId: idOf(classId, U), sn: instanceId.toString() } - } - if (event.isV9230) { - const { collection: classId, item: instanceId } = event.asV9230 - return { collectionId: idOf(classId, U), sn: instanceId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId.toString() } -} - -export function getMetadataEvent(ctx: Context): SetMetadata { - switch (ctx.event.name) { - case Event.clearClassMetadata: - return getClearClassMetadataEvent(ctx) - case Event.setClassMetadata: - return getCreateClassMetadataEvent(ctx) - case Event.setCollectionMetadata: - return getCreateCollectionMetadataEvent(ctx) - case Event.clearCollectionMetadata: - return getClearCollectionMetadataEvent(ctx) - case Event.setMetadata: - return getCreateMetadataEvent(ctx) - case Event.clearMetadata: - return getClearMetadataEvent(ctx) - default: - throw new Error('Unsupported event') - } -} - -function getSetAttributeEvent(ctx: Context): SetAttribute { - const event = new events.UniquesAttributeSetEvent(ctx) - if (event.isV1) { - const [classId, instanceId, key, value] = event.asV1 - return { - collectionId: idOf(classId, U), - sn: instanceId?.toString(), - trait: key.toString(), - value, - } - } - if (event.isV700) { - const { class: classId, maybeInstance: instanceId, key, value } = event.asV700 - return { - collectionId: idOf(classId, U), - sn: instanceId?.toString(), - trait: key.toString(), - value, - } - } - if (event.isV9230) { - const { collection: classId, maybeItem: instanceId, key, value } = event.asV9230 - return { - collectionId: idOf(classId, U), - sn: instanceId?.toString(), - trait: key.toString(), - value, - } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, maybeItem: instanceId, key, value } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString(), value: value.toString() } -} - -function getClearAttributeEvent(ctx: Context): SetAttribute { - const event = new events.UniquesAttributeClearedEvent(ctx) - - if (event.isV1) { - const [classId, instanceId, key] = event.asV1 - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString() } - } - if (event.isV700) { - const { class: classId, maybeInstance: instanceId, key } = event.asV700 - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString() } - } - if (event.isV9230) { - const { collection: classId, maybeItem: instanceId, key } = event.asV9230 - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, maybeItem: instanceId, key } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString() } -} - -export function getAttributeEvent(ctx: Context): SetAttribute { - switch (ctx.event.name) { - case Event.setAttribute: - return getSetAttributeEvent(ctx) - case Event.clearAttribute: - return getClearAttributeEvent(ctx) - default: - throw new Error('Unsupported event') - } -} - -export function getChangeTeamEvent(ctx: Context): ChangeCollectionTeam { - const event = new events.UniquesTeamChangedEvent(ctx) - if (event.isV1) { - const [classId, issuer, admin, freezer] = event.asV1 - return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } - } - if (event.isV700) { - const { class: classId, issuer, admin, freezer } = event.asV700 - return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } - } - if (event.isV9230) { - const { collection: classId, issuer, admin, freezer } = event.asV9230 - return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, issuer, admin, freezer } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } -} diff --git a/src/mappings/uniques/getters/statemint.ts b/src/mappings/uniques/getters/statemint.ts deleted file mode 100644 index c547c831..00000000 --- a/src/mappings/uniques/getters/statemint.ts +++ /dev/null @@ -1,426 +0,0 @@ -import { Interaction } from '../../../model' -import * as events from '../../../types/statemint/events' -import { addressOf, idOf, UNIQUE_PREFIX as U } from '../../utils/helper' -import { warn } from '../../utils/logger' -import { Context } from '../../utils/types' -import { - BurnTokenEvent, - BuyTokenEvent, - ChangeCollectionOwnerEvent, - ChangeCollectionTeam, - CreateCollectionEvent, - CreateTokenEvent, - DestroyCollectionEvent, - ForceCreateCollectionEvent, - ListTokenEvent, - LockCollectionEvent, - SetAttribute, - SetMetadata, - TransferTokenEvent, -} from '../types' -import { Unique as Event } from '../../../processable' - -export function getCreateCollectionEvent(ctx: Context): CreateCollectionEvent { - const event = new events.UniquesCreatedEvent(ctx) - if (event.isV601) { - const [classId, creator, owner] = event.asV601 - return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } - } - if (event.isV700) { - const { class: classId, creator, owner } = event.asV700 - return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } - } - if (event.isV9230) { - const { collection: classId, creator, owner } = event.asV9230 - return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } - } - warn(Interaction.CREATE, 'USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, creator, owner } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), caller: addressOf(creator), owner: addressOf(owner) } -} - -export function getForceCreateCollectionEvent(ctx: Context): ForceCreateCollectionEvent { - const event = new events.UniquesForceCreatedEvent(ctx) - if (event.isV601) { - const [classId, owner] = event.asV601 - return { id: idOf(classId, U), owner: addressOf(owner) } - } - if (event.isV700) { - const { class: classId, owner } = event.asV700 - return { id: idOf(classId, U), owner: addressOf(owner) } - } - if (event.isV9230) { - const { collection: classId, owner } = event.asV9230 - return { id: idOf(classId, U), owner: addressOf(owner) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, owner } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), owner: addressOf(owner) } -} - -export function getCreateTokenEvent(ctx: Context): CreateTokenEvent { - const event = new events.UniquesIssuedEvent(ctx) - if (event.isV601) { - const [classId, instanceId, owner] = event.asV601 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - if (event.isV700) { - const { class: classId, instance: instanceId, owner } = event.asV700 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - if (event.isV9230) { - const { collection: classId, item: instanceId, owner } = event.asV9230 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, owner } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } -} - -export function getTransferTokenEvent(ctx: Context): TransferTokenEvent { - const event = new events.UniquesTransferredEvent(ctx) - if (event.isV601) { - const [classId, instanceId, from, to] = event.asV601 - return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } - } - if (event.isV700) { - const { class: classId, instance: instanceId, from, to } = event.asV700 - return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } - } - if (event.isV9230) { - const { collection: classId, item: instanceId, from, to } = event.asV9230 - return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, from, to } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), caller: addressOf(from), sn: instanceId.toString(), to: addressOf(to) } -} - -export function getBurnTokenEvent(ctx: Context): BurnTokenEvent { - const event = new events.UniquesBurnedEvent(ctx) - if (event.isV601) { - const [classId, instanceId, owner] = event.asV601 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - if (event.isV700) { - const { class: classId, instance: instanceId, owner } = event.asV700 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - if (event.isV9230) { - const { collection: classId, item: instanceId, owner } = event.asV9230 - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, owner } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), owner: addressOf(owner), sn: instanceId.toString() } -} - -export function getDestroyCollectionEvent(ctx: Context): DestroyCollectionEvent { - const event = new events.UniquesDestroyedEvent(ctx) - if (event.isV601) { - const classId = event.asV601 - return { id: idOf(classId, U) } - } - if (event.isV700) { - const { class: classId } = event.asV700 - return { id: idOf(classId, U) } - } - if (event.isV9230) { - const { collection: classId } = event.asV9230 - return { id: idOf(classId, U) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U) } -} - -export function getListTokenEvent(ctx: Context): ListTokenEvent { - const event = new events.UniquesItemPriceSetEvent(ctx) - - if (event.isV9270) { - const { collection: classId, item: instanceId, price } = event.asV9270 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), price } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId.toString(), price } -} - -export function getUnListTokenEvent(ctx: Context): ListTokenEvent { - const event = new events.UniquesItemPriceRemovedEvent(ctx) - - if (event.isV9270) { - const { collection: classId, item: instanceId } = event.asV9270 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), price: 0n } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId.toString(), price: 0n } -} - -export function getPriceTokenEvent(ctx: Context): ListTokenEvent { - if (ctx.event.name === Event.setPrice) { - return getListTokenEvent(ctx) - } - - return getUnListTokenEvent(ctx) -} - -export function getBuyTokenEvent(ctx: Context): BuyTokenEvent { - const event = new events.UniquesItemBoughtEvent(ctx) - - if (event.isV9270) { - const { collection: classId, item: instanceId, price, seller, buyer } = event.asV9270 - return { - collectionId: idOf(classId, U), - caller: addressOf(buyer), - sn: instanceId.toString(), - price: BigInt(price ?? 0), - currentOwner: addressOf(seller), - } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, price, seller, buyer } = ctx._chain.decodeEvent(ctx.event) - return { - collectionId: idOf(classId, U), - caller: addressOf(buyer), - sn: instanceId.toString(), - price: BigInt(price ?? 0), - currentOwner: addressOf(seller), - } -} - -export function getLockCollectionEvent(ctx: Context): LockCollectionEvent { - const event = new events.UniquesCollectionMaxSupplySetEvent(ctx) - if (event.isV9230) { - const { collection: classId, maxSupply: max } = event.asV9230 - return { id: idOf(classId, U), max } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, mamaxSupply: max } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), max } -} - -export function getChangeCollectionOwnerEvent(ctx: Context): ChangeCollectionOwnerEvent { - const event = new events.UniquesOwnerChangedEvent(ctx) - if (event.isV601) { - const [classId, newOwner] = event.asV601 - return { id: idOf(classId, U), owner: addressOf(newOwner) } - } - if (event.isV700) { - const { class: classId, newOwner } = event.asV700 - return { id: idOf(classId, U), owner: addressOf(newOwner) } - } - if (event.isV9230) { - const { collection: classId, newOwner } = event.asV9230 - return { id: idOf(classId, U), owner: addressOf(newOwner) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, newOwner } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), owner: addressOf(newOwner) } -} - -export function getClearCollectionMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesCollectionMetadataClearedEvent(ctx) - if (event.isV9230) { - const { collection: classId } = event.asV9230 - return { collectionId: idOf(classId, U) } - } - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U) } -} - -export function getCreateCollectionMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesCollectionMetadataSetEvent(ctx) - if (event.isV9230) { - const { collection: classId, data, isFrozen } = event.asV9230 - return { collectionId: idOf(classId, U), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), metadata: data.toString() } -} - -export function getClearClassMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesClassMetadataClearedEvent(ctx) - if (event.isV601) { - const classId = event.asV601 - return { collectionId: idOf(classId, U) } - } - if (event.isV700) { - const { class: classId } = event.asV700 - return { collectionId: idOf(classId, U) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U) } -} - -export function getCreateClassMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesClassMetadataSetEvent(ctx) - if (event.isV601) { - const [classId, data, isFrozen] = event.asV601 - return { collectionId: idOf(classId, U), metadata: data.toString() } - } - if (event.isV700) { - const { class: classId, data, isFrozen } = event.asV700 - return { collectionId: idOf(classId, U), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { class: classId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), metadata: data.toString() } -} - -export function getCreateMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesMetadataSetEvent(ctx) - if (event.isV601) { - const [classId, instanceId, data, isFrozen] = event.asV601 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: data.toString() } - } - if (event.isV700) { - const { class: classId, instance: instanceId, data, isFrozen } = event.asV700 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: data.toString() } - } - if (event.isV9230) { - const { collection: classId, item: instanceId, data, isFrozen } = event.asV9230 - return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: data.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId, data, isFrozen } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId.toString(), metadata: data.toString() } -} - -export function getClearMetadataEvent(ctx: Context): SetMetadata { - const event = new events.UniquesMetadataClearedEvent(ctx) - if (event.isV601) { - const [classId, instanceId] = event.asV601 - return { collectionId: idOf(classId, U), sn: instanceId.toString() } - } - if (event.isV700) { - const { class: classId, instance: instanceId } = event.asV700 - return { collectionId: idOf(classId, U), sn: instanceId.toString() } - } - if (event.isV9230) { - const { collection: classId, item: instanceId } = event.asV9230 - return { collectionId: idOf(classId, U), sn: instanceId.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, item: instanceId } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId.toString() } -} - -export function getMetadataEvent(ctx: Context): SetMetadata { - switch (ctx.event.name) { - case Event.clearClassMetadata: - return getClearClassMetadataEvent(ctx) - case Event.setClassMetadata: - return getCreateClassMetadataEvent(ctx) - case Event.setCollectionMetadata: - return getCreateCollectionMetadataEvent(ctx) - case Event.clearCollectionMetadata: - return getClearCollectionMetadataEvent(ctx) - case Event.setMetadata: - return getCreateMetadataEvent(ctx) - case Event.clearMetadata: - return getClearMetadataEvent(ctx) - default: - throw new Error('Unsupported event') - } -} - -function getSetAttributeEvent(ctx: Context): SetAttribute { - const event = new events.UniquesAttributeSetEvent(ctx) - if (event.isV601) { - const [classId, instanceId, key, value] = event.asV601 - return { - collectionId: idOf(classId, U), - sn: instanceId?.toString(), - trait: key.toString(), - value, - } - } - if (event.isV700) { - const { class: classId, maybeInstance: instanceId, key, value } = event.asV700 - return { - collectionId: idOf(classId, U), - sn: instanceId?.toString(), - trait: key.toString(), - value, - } - } - if (event.isV9230) { - const { collection: classId, maybeItem: instanceId, key, value } = event.asV9230 - return { - collectionId: idOf(classId, U), - sn: instanceId?.toString(), - trait: key.toString(), - value, - } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, maybeItem: instanceId, key, value } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString(), value: value.toString() } -} - -function getClearAttributeEvent(ctx: Context): SetAttribute { - const event = new events.UniquesAttributeClearedEvent(ctx) - - if (event.isV601) { - const [classId, instanceId, key] = event.asV601 - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString() } - } - if (event.isV700) { - const { class: classId, maybeInstance: instanceId, key } = event.asV700 - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString() } - } - if (event.isV9230) { - const { collection: classId, maybeItem: instanceId, key } = event.asV9230 - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString() } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, maybeItem: instanceId, key } = ctx._chain.decodeEvent(ctx.event) - return { collectionId: idOf(classId, U), sn: instanceId?.toString(), trait: key.toString() } -} - -export function getAttributeEvent(ctx: Context): SetAttribute { - switch (ctx.event.name) { - case Event.setAttribute: - return getSetAttributeEvent(ctx) - case Event.clearAttribute: - return getClearAttributeEvent(ctx) - default: - throw new Error('Unsupported event') - } -} - -export function getChangeTeamEvent(ctx: Context): ChangeCollectionTeam { - const event = new events.UniquesTeamChangedEvent(ctx) - if (event.isV601) { - const [classId, issuer, admin, freezer] = event.asV601 - return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } - } - if (event.isV700) { - const { class: classId, issuer, admin, freezer } = event.asV700 - return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } - } - if (event.isV9230) { - const { collection: classId, issuer, admin, freezer } = event.asV9230 - return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } - } - - ctx.log.warn('USING UNSAFE GETTER! PLS UPDATE TYPES!') - const { collection: classId, issuer, admin, freezer } = ctx._chain.decodeEvent(ctx.event) - return { id: idOf(classId, U), issuer: addressOf(issuer), admin: addressOf(admin), freezer: addressOf(freezer) } -} diff --git a/src/mappings/uniques/list.ts b/src/mappings/uniques/list.ts index 39b7ff98..71569e54 100644 --- a/src/mappings/uniques/list.ts +++ b/src/mappings/uniques/list.ts @@ -9,6 +9,12 @@ import { getPriceTokenEvent } from './getters' const OPERATION = Action.LIST const UNLIST = Action.UNLIST +/** + * Handle the token list event (Uniques.ItemPriceSet) + * Sets the price of the token, updates the collection floor + * Logs Action.LIST event + * @param context - the context for the event + **/ export async function handleTokenList(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getPriceTokenEvent) diff --git a/src/mappings/uniques/lock.ts b/src/mappings/uniques/lock.ts index 387c9e1c..2833ae9a 100644 --- a/src/mappings/uniques/lock.ts +++ b/src/mappings/uniques/lock.ts @@ -7,6 +7,13 @@ import { getLockCollectionEvent } from './getters' const OPERATION = Action.LOCK + +/** + * Handle the collection lock event (Uniques.CollectionMaxSupplySet) + * Sets the max supply of the collection + * Logs Action.LOCK event + * @param context - the context for the event + **/ export async function handleCollectionLock(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getLockCollectionEvent) diff --git a/src/mappings/uniques/mint.ts b/src/mappings/uniques/mint.ts index 6a450b61..ea7dba77 100644 --- a/src/mappings/uniques/mint.ts +++ b/src/mappings/uniques/mint.ts @@ -13,6 +13,12 @@ import { getCreateTokenEvent } from './getters' const OPERATION = Action.MINT +/** + * Handle the token create event (Uniques.Issued) + * Creates a new token + * Logs Action.MINT event + * @param context - the context for the event + **/ export async function handleTokenCreate(context: Context): Promise { pending(OPERATION, context.block.height.toString()) const event = unwrap(context, getCreateTokenEvent) @@ -65,12 +71,17 @@ export async function handleTokenCreate(context: Context): Promise { await mintHandler(context, collection, final) + const destinationAddress = final.issuer !== final.currentOwner ? final.currentOwner : '' + success(OPERATION, `${final.id}`) await context.store.save(final) await context.store.save(collection) - await createEvent(final, OPERATION, event, '', context.store) - - if (final.issuer !== final.currentOwner) { - await createEvent(final, Action.SEND, event, final.currentOwner, context.store, final.issuer) - } + await createEvent( + final, + OPERATION, + event, + destinationAddress, + context.store, + final.issuer !== final.currentOwner ? final.issuer : undefined + ) } diff --git a/src/mappings/uniques/setAttribute.ts b/src/mappings/uniques/setAttribute.ts index 2fc67136..7bb4d42a 100644 --- a/src/mappings/uniques/setAttribute.ts +++ b/src/mappings/uniques/setAttribute.ts @@ -1,10 +1,17 @@ import { getOrFail as get } from '@kodadot1/metasquid/entity' import { CollectionEntity, NFTEntity } from '../../model' import { unwrap } from '../utils/extract' +import { unHex } from '../utils/helper' import { Context } from '../utils/types' import { getAttributeEvent } from './getters' import { attributeFrom, tokenIdOf } from './types' +/** + * Handle the attribute set event (Uniques.AttributeSet, Uniques.AttributeCleared) + * Sets the attribute of the collection or NFT + * Logs NONE event + * @param context - the context for the event + **/ export async function handleAttributeSet(context: Context): Promise { const event = unwrap(context, getAttributeEvent) @@ -22,9 +29,9 @@ export async function handleAttributeSet(context: Context): Promise { } else { const attribute = final.attributes?.find((attr) => attr.trait === event.trait) if (attribute) { - attribute.value = String(event.value) + attribute.value = unHex(event.value) ?? String(event.value) } else { - const newAttribute = attributeFrom({ trait_type: event.trait, value: String(event.value) }) + const newAttribute = attributeFrom({ trait_type: event.trait, value: unHex(event.value) ?? String(event.value) }) final.attributes?.push(newAttribute) } } diff --git a/src/mappings/uniques/setMetadata.ts b/src/mappings/uniques/setMetadata.ts index aa4103ac..5d7f626b 100644 --- a/src/mappings/uniques/setMetadata.ts +++ b/src/mappings/uniques/setMetadata.ts @@ -12,6 +12,11 @@ import { getMetadataEvent } from './getters' const OPERATION = 'METADATA' as any +/** + * Handle the metadata set event (Uniques.CollectionMetadataSet, Uniques.ItemMetadataSet, Uniques.ItemMetadataCleared, Uniques.CollectionMetadataCleared, Uniques.ClassMetadataSet, Uniques.ClassMetadataCleared, Uniques.MetadataSet) + * Sets the metadata of the collection or nft + * @param context - the context for the event + **/ export async function handleMetadataSet(context: Context): Promise { const event = unwrap(context, getMetadataEvent) debug(OPERATION, event) diff --git a/src/mappings/uniques/transfer.ts b/src/mappings/uniques/transfer.ts index 3f4e0cfd..deadaf86 100644 --- a/src/mappings/uniques/transfer.ts +++ b/src/mappings/uniques/transfer.ts @@ -9,6 +9,12 @@ import { getTransferTokenEvent } from './getters' const OPERATION = Action.SEND +/** + * Handle the token transfer event (Uniques.Transferred) + * Changes the owner of the token, updates the collection owner count and distribution + * Logs Action.SEND event + * @param context - the context for the event + **/ export async function handleTokenTransfer(context: Context): Promise { pending(OPERATION, `${context.block.height}`) const event = unwrap(context, getTransferTokenEvent) diff --git a/src/mappings/uniques/types.ts b/src/mappings/uniques/types.ts index 59c3704f..2ec094c0 100644 --- a/src/mappings/uniques/types.ts +++ b/src/mappings/uniques/types.ts @@ -68,7 +68,7 @@ export type SetMetadata = Omit & export type SetAttribute = Omit & { sn?: string trait: string - value?: string | Uint8Array + value?: string } export type ChangeCollectionTeam = WithId & { diff --git a/src/mappings/utils/cache.ts b/src/mappings/utils/cache.ts index 1dc4c4bd..6a5e6749 100644 --- a/src/mappings/utils/cache.ts +++ b/src/mappings/utils/cache.ts @@ -1,6 +1,16 @@ -import logger, { logError } from './logger' +import { type Content } from '@kodadot1/hyperdata' +import { EntityWithId, create, emOf, getOrCreate } from '@kodadot1/metasquid/entity' +import { CacheStatus, MetadataEntity } from '../../model' +import logger, { logError, pending, success } from './logger' +import { fetchAllMetadata } from './metadata' import { Store } from './types' +const DELAY_MIN = 60 // every 60 minutes +const STATUS_ID = '0' +const METADATA_STATUS_ID = '1' +const METADATA_DELAY_MIN = 15 // every 24 hours +const TO_MINUTES = 60_000 + enum MetadataQuery { missing = `SELECT DISTINCT metadata as id @@ -52,11 +62,86 @@ enum MetadataQuery { `, } +const OPERATION = 'METADATA_CACHE' as any + +/** + * update metadata for item and collection + * @param store - subsquid store to handle the cache + * @param collectionId - the id of the collection +**/ export async function updateItemMetadataByCollection(store: Store, collectionId: string): Promise { try { - const rows = await store.query(MetadataQuery.polyfill, [collectionId]) + const rows = await emOf(store).query(MetadataQuery.polyfill, [collectionId]) logger.info(`[METADATA POLYFILL] ${rows.length} NFTs updated`) } catch (e) { logError(e, (err) => logger.error(`[METADATA POLYFILL] ${err.message}`)) } } + +function getPassedMinutes(timestamp: Date, lastBlockTimestamp: Date): number { + return (timestamp.getTime() - lastBlockTimestamp.getTime()) / TO_MINUTES +} + +/** + * Main entry point for updating the metadata cache + * @param timestamp - the timestamp of the block + * @param store - subsquid store to handle the cache +**/ +export async function updateMetadataCache(timestamp: Date, store: Store): Promise { + const lastUpdate = await getOrCreate(store, CacheStatus, METADATA_STATUS_ID, { id: METADATA_STATUS_ID, lastBlockTimestamp: new Date(0) }) + const passedMins = getPassedMinutes(timestamp, lastUpdate.lastBlockTimestamp) + pending(OPERATION, `${passedMins} MINS SINCE LAST UPDATE`) + if (passedMins >= DELAY_MIN) { + try { + await updateMissingMetadata(store) + lastUpdate.lastBlockTimestamp = timestamp + await store.save(lastUpdate) + // success('[METADATA CACHE UPDATE]'); + } catch (e) { + logError(e, (err) => logger.error(`[METADATA CACHE UPDATE] ${err.message}`)) + } + } +} + +/** + * Main entry point for the cache update + * @param timestamp - the timestamp of the block + * @param store - subsquid store to handle the cache +**/ +export async function updateCache(timestamp: Date, store: Store): Promise { + // const lastUpdate = await getOrCreate(store, CacheStatus, STATUS_ID, { id: STATUS_ID, lastBlockTimestamp: new Date(0) }); + // const passedMins = (timestamp.getTime() - lastUpdate.lastBlockTimestamp.getTime()) / TO_MINUTES; + // logger.info(`[CACHE UPDATE] PASSED TIME - ${passedMins} MINS`); + await updateMetadataCache(timestamp, store) +} + +/** + * update image and media for item and collection + * from the metadata table + * @param store - subsquid store to handle the cache +**/ +async function updateMissingMetadata(store: Store) { + try { + const missing: EntityWithId[] = await emOf(store).query(MetadataQuery.missing) + if (missing.length === 0) { + logger.info('[MISSING METADATA] - NONE') + return + } + + logger.info(`[MISSING METADATA] - ${missing.length}`) + const ids = missing.map((el) => el.id) + const results = await fetchAllMetadata(ids) + const entities = results.map((el) => create(MetadataEntity, el.id, el)) + logger.debug(`[MISSING METADATA] - FOUND ${entities.length}`) + await store.save(entities) + await emOf(store).query(MetadataQuery.nft) + await emOf(store).query(MetadataQuery.collection) + + success(OPERATION, `UPDATED ${entities.length} METADATA`) + } catch (e) { + logError(e, (err) => logger.error(`[MISSING METADATA] ${err.message}`)) + } + // const nft = await emOf(store).query(MetadataQuery.nft); + // const collection = await emOf(store).query(MetadataQuery.collection); + // logger.info(`[CACHE UPDATE] MISSING METADATA - ${missing.length} NFTs, ${nft.length} NFTs, ${collection.length} Collections`); +} \ No newline at end of file diff --git a/src/mappings/utils/extract.ts b/src/mappings/utils/extract.ts index 250d2954..c11eab24 100644 --- a/src/mappings/utils/extract.ts +++ b/src/mappings/utils/extract.ts @@ -1,3 +1,4 @@ +import { ArchiveCallWithOptionalValue } from '@kodadot1/metasquid/types' import { addressOf, onlyValue } from './helper' import { BaseCall, CallWith, Context, UnwrapFunc } from './types' @@ -9,17 +10,32 @@ import { BaseCall, CallWith, Context, UnwrapFunc } from './types' // return { caller, blockNumber, timestamp }; // } +/** + * Extract the base event information from the context + * @param ctx - the context for the event +**/ function toBaseEvent(ctx: Context): BaseCall { - const address = onlyValue(ctx.event.extrinsic?.signature?.address) + const address = onlyValue(ctx.extrinsic?.signature?.address as ArchiveCallWithOptionalValue) const caller = addressOf(address) const blockNumber = ctx.block.height.toString() - const timestamp = new Date(ctx.block.timestamp) + const timestamp = ctx.block.timestamp ? new Date(ctx.block.timestamp) : new Date() return { caller, blockNumber, timestamp } } +/** + * Peform the unwrapping of the event from chain info into usable data + * @param ctx - the context for the event + * @param unwrapFn - the function to extract the event information +**/ export function unwrap(ctx: Context, unwrapFn: UnwrapFunc): CallWith { const baseCall = toBaseEvent(ctx) const unwrapped = unwrapFn(ctx) return { ...baseCall, ...unwrapped } } + +// export function ctxOf>( +// block: SingleArrayType> +// ): Context { + +// } diff --git a/src/mappings/utils/helper.ts b/src/mappings/utils/helper.ts index 85c12728..3656f720 100644 --- a/src/mappings/utils/helper.ts +++ b/src/mappings/utils/helper.ts @@ -1,16 +1,22 @@ +import { emOf } from '@kodadot1/metasquid/entity' +import { ArchiveCallWithOptionalValue, Store } from '@kodadot1/metasquid/types' import * as ss58 from '@subsquid/ss58' import { decodeHex } from '@subsquid/substrate-processor' -import { ArchiveCallWithOptionalValue } from '@kodadot1/metasquid/types' -import { isProd } from '../../environment' -import { Context, SomethingWithOptionalMeta, Store } from './types' +import { CHAIN } from '../../environment' +import { Context, SomethingWithOptionalMeta } from './types' -const codec = isProd ? 'kusama' : 'polkadot' + +const codec = CHAIN export const UNIQUE_PREFIX = 'u' as const export const EMPTY = '' as const type Optional = T | undefined +/** + * Check if an object is empty + * @param obj - the object to check +**/ export function isEmpty(obj: Record): boolean { // eslint-disable-next-line guard-for-in, @typescript-eslint/naming-convention, no-unreachable-loop for (const _ in obj) { @@ -19,26 +25,59 @@ export function isEmpty(obj: Record): boolean { return true } +/** + * Export the value from the archive object { __kind, value } + * @param call - the call to extract the value from +**/ export function onlyValue(call: ArchiveCallWithOptionalValue): string { return call?.value } +/** + * Check if a value is a hex string + * @param value - the value to check +**/ +export function isHex(value: unknown): value is string { + return typeof value === 'string' && value.length % 2 === 0 && /^0x[\da-f]*$/i.test(value) +} + +/** + * Decode an ss58 address from the value + * @param address - the address to decode +**/ export function addressOf(address: Uint8Array | string): string { - const value = typeof address === 'string' ? decodeHex(address) : address + const value = isHex(address) ? decodeHex(address) : address if (!value) { return '' } return ss58.codec(codec).encode(value) } +/** + * Decode a hex value + * @param value - the value to decode +**/ +export function unHex(value: T): T | string { + return isHex(value) ? decodeHex(value).toString() : value +} + +/** + * @deprecated Use the unjs/ufo package + **/ export function camelCase(str: string): string { return str.replace(/(_[a-z])/gi, ($1) => $1.toUpperCase().replace('_', '')) } +/** + * @deprecated unused. + **/ export function metadataOf({ metadata }: SomethingWithOptionalMeta): string { return metadata ?? '' } +/** + * @deprecated use ?? operator. + **/ export function oneOf(one: T, two: T): T { return one || two } @@ -55,11 +94,22 @@ export function str(value: Optional): string { return value?.toString() || '' } +/** + * Prefix the value with the prefix + * @param value - id + * @param prefix - prefix +**/ export function idOf(value: Optional, prefix: string = ''): string { const val = str(value) return prefix && val ? `${prefix}-${val}` : val } +/** + * Return the version of the pallet + * @param context - the context for the event + * @returns 1 if unique, 2 if nfts + * @throws if the pallet is unknown +**/ export function versionOf(context: Context): 1 | 2 { if (isUniquePallet(context)) { return 1 @@ -72,6 +122,9 @@ export function versionOf(context: Context): 1 | 2 { throw new Error(`Unknown pallet: ${context.event.name}`) } +/** + * @deprecated Use the new {@link idOf} with prefix. + */ export function prefixOf(context: Context): string { if (isUniquePallet(context)) { return UNIQUE_PREFIX @@ -80,6 +133,13 @@ export function prefixOf(context: Context): string { return EMPTY } +/** + * Calculate the owner count and distribution for a collection + * @param store - subsquid store to handle database operations + * @param collectionId - the id of the collection + * @param newOwner - the new owner of the nft + * @param originalOwner - the original owner of the nft +**/ export async function calculateCollectionOwnerCountAndDistribution( store: Store, collectionId: string, @@ -104,7 +164,7 @@ export async function calculateCollectionOwnerCountAndDistribution( WHERE collection_id = '${collectionId}' ${originalOwner ? `AND current_owner != '${originalOwner}'` : ''} ` - const [result]: { owner_count: number; distribution: number; adjustment?: number }[] = await store.query(query) + const [result]: { owner_count: number; distribution: number; adjustment?: number }[] = await emOf(store).query(query) const adjustedResults = { ownerCount: result.owner_count - (result.adjustment ?? 0), @@ -114,6 +174,12 @@ export async function calculateCollectionOwnerCountAndDistribution( return adjustedResults } +/** + * Calculate the floor price for a collection + * @param store - subsquid store to handle database operations + * @param collectionId - the id of the collection + * @param nftId - the id of the nft +**/ export async function calculateCollectionFloor( store: Store, collectionId: string, @@ -125,7 +191,7 @@ export async function calculateCollectionFloor( WHERE collection_id = '${collectionId}' AND nft_entity.id <> '${nftId}' ` - const [result]: { floor: bigint; }[] = await store.query(query) + const [result]: { floor: bigint; }[] = await emOf(store).query(query) return { floor: result.floor ?? BigInt(0) diff --git a/src/mappings/utils/logger.ts b/src/mappings/utils/logger.ts index 7f717635..82802db9 100644 --- a/src/mappings/utils/logger.ts +++ b/src/mappings/utils/logger.ts @@ -12,6 +12,11 @@ export const logError = (e: Error | unknown, cb: ErrorCallback) => { } } +/** + * Log a successful action + * @param action - the action being performed + * @param message - the message to log +**/ export const success = (action: Action, message: string) => { logger.info(`💚 [${action}] ${message}`) } @@ -20,14 +25,34 @@ export const error = (e: Error | unknown, action: Action, message: string) => { logError(e, (e) => logger.error(`💔 [${action}] ${e.message} ${message}`)) } +/** + * Log a started action + * @param action - the action being performed + * @param message - the message to log +**/ export const pending = (action: Action, message: string) => { logger.info(`⏳ [${action}] ${message}`) } +/** + * Log a debug message + * @param action - the action being performed + * @param message - the message to log + * @param serialize - whether to serialize the message + * @example + * ```ts + * debug('action', { key: 'value' }, true) + * ``` +**/ export const debug = (action: Action, message: Record, serialize?: boolean) => { logger.debug(`[${action}] ${JSON.stringify(message, serialize ? serializer : undefined, 2)}`) } +/** + * Log a warning message + * @param action - the action being performed + * @param message - the message to log +**/ export const warn = (action: Action, message: string) => { logger.warn(`⚠️ [${action}] ${message}`) } diff --git a/src/mappings/utils/metadata.ts b/src/mappings/utils/metadata.ts index 463338d9..2daf5b4d 100644 --- a/src/mappings/utils/metadata.ts +++ b/src/mappings/utils/metadata.ts @@ -1,3 +1,4 @@ +import { contentFrom, type Content } from '@kodadot1/hyperdata' import { ensure } from '@kodadot1/metasquid' import { EntityWithId, TokenMetadata } from '@kodadot1/metasquid/types' import { $obtain } from '@kodadot1/minipfs' @@ -6,12 +7,17 @@ import logger from './logger' // import { attributeFrom } from './types' export const BASE_URL = 'https://image.w.kodadot.xyz/' -export const fetchMetadata = async (metadata: string): Promise => { +/** + * Fetch the metadata from the IPFS + * @param metadata - the metadata to fetch +**/ +export const fetchMetadata = async (metadata: string): Promise => { try { if (!metadata) { return ensure({}) } - return await $obtain(metadata, ['rmrk', 'infura_kodadot1'], true) + const value = await $obtain(metadata, ['rmrk', 'infura_kodadot1'], true) + return contentFrom(value as any) as T } catch (e) { logger.error(`[MINIPFS] ${e}`) } @@ -19,7 +25,11 @@ export const fetchMetadata = async (metadata: string): Promise => { return ensure({}) } -export const fetchAllMetadata = async ( +/** + * Fetch the list of metadata from the IPFS + * @param metadata - the metadata to fetch +**/ +export const fetchAllMetadata = async ( metadata: string[] ): Promise<(Partial & EntityWithId)[]> => { const res = await Promise.allSettled(metadata.map((meta) => fetchMetadata(meta))) @@ -29,14 +39,19 @@ export const fetchAllMetadata = async ( return fulfilled.map(({ value, id }) => makeCompatibleMetadata(id, value)) } +/** + * Format the metadata to be compatible with the cache model + * @param id - the id of the metadata (CID) + * @param metadata - the metadata to fetch +**/ export const makeCompatibleMetadata = ( id: string, - metadata: TokenMetadata + metadata: Content ): Partial & EntityWithId => ({ id, description: metadata.description || '', - image: metadata.image || metadata.thumbnailUri || metadata.mediaUri, - animationUrl: metadata.animation_url || metadata.mediaUri, + image: metadata.image || metadata.thumbnail, + animationUrl: metadata.animationUrl, attributes: [], // metadata.attributes?.map(attributeFrom) || [], name: metadata.name, type: metadata.type || '', diff --git a/src/mappings/utils/types.ts b/src/mappings/utils/types.ts index 8d20787b..71b8386b 100644 --- a/src/mappings/utils/types.ts +++ b/src/mappings/utils/types.ts @@ -1,7 +1,18 @@ -import { EventHandlerContext } from '@subsquid/substrate-processor' +import { + DataHandlerContext, + SubstrateBatchProcessorFields, + Block as _Block, + Call as _Call, + Event as _Event, + Extrinsic as _Extrinsic, + type SubstrateBatchProcessor as SubstrateProcessor, + BlockHeader +} from '@subsquid/substrate-processor' import { nanoid } from 'nanoid' -import { EntityManager } from 'typeorm' // impsort { Interaction } from '../../model/generated/_interaction'; +import { Store as SquidStore } from '@subsquid/typeorm-store' +import { EntityManager } from 'typeorm' +import { Logger } from '@subsquid/logger' import { Attribute } from '../../model/generated/_attribute' import { Interaction } from '../../model' @@ -12,6 +23,35 @@ export type BaseCall = { blockNumber: string timestamp: Date } +// In case of fire consult this repo: +// https://github.com/subsquid-labs/squid-substrate-template/tree/main + +export const fieldSelection = { + block: { + timestamp: true + }, + extrinsic: { + signature: true, + }, + call: { + name: true, + args: true, + origin: true + }, + event: { + name: true, + args: true, + } +} as const + +export type SelectedFields = typeof fieldSelection + +type Fields = SubstrateBatchProcessorFields> +export type Block = _Block +export type Event = _Event +export type Call = _Call +export type Extrinsic = _Extrinsic + export type CollectionInteraction = Interaction.CREATE | Interaction.DESTROY @@ -56,8 +96,22 @@ export function attributeFrom(attribute: MetadataAttribute): Attribute { ) } -export type Store = EntityManager -export type Context = EventHandlerContext +export type ManagedStore = SquidStore & { em: () => EntityManager } +export type Store = SquidStore // & { em: () => EntityManager } +export type BatchContext = DataHandlerContext +export type SelectedBlock = Pick, 'height' | 'timestamp' | 'hash'> +export type SelectedEvent = Pick +export type SelectedExtrinsic = Pick +export type SelectedCall = Pick + +export type Context = { + store: S + block: SelectedBlock + event: SelectedEvent + extrinsic: SelectedExtrinsic | undefined + call: SelectedCall | undefined + // log: Logger +} export type Optional = T | null diff --git a/src/model/generated/_collectionSettings.ts b/src/model/generated/_collectionSettings.ts new file mode 100644 index 00000000..bfb9f9c9 --- /dev/null +++ b/src/model/generated/_collectionSettings.ts @@ -0,0 +1,60 @@ +import assert from "assert" +import * as marshal from "./marshal" + +export class CollectionSettings { + private _value!: string | undefined | null + private _startBlock!: bigint | undefined | null + private _endBlock!: bigint | undefined | null + private _price!: bigint | undefined | null + + constructor(props?: Partial>, json?: any) { + Object.assign(this, props) + if (json != null) { + this._value = json.value == null ? undefined : marshal.string.fromJSON(json.value) + this._startBlock = json.startBlock == null ? undefined : marshal.bigint.fromJSON(json.startBlock) + this._endBlock = json.endBlock == null ? undefined : marshal.bigint.fromJSON(json.endBlock) + this._price = json.price == null ? undefined : marshal.bigint.fromJSON(json.price) + } + } + + get value(): string | undefined | null { + return this._value + } + + set value(value: string | undefined | null) { + this._value = value + } + + get startBlock(): bigint | undefined | null { + return this._startBlock + } + + set startBlock(value: bigint | undefined | null) { + this._startBlock = value + } + + get endBlock(): bigint | undefined | null { + return this._endBlock + } + + set endBlock(value: bigint | undefined | null) { + this._endBlock = value + } + + get price(): bigint | undefined | null { + return this._price + } + + set price(value: bigint | undefined | null) { + this._price = value + } + + toJSON(): object { + return { + value: this.value, + startBlock: this.startBlock == null ? undefined : marshal.bigint.toJSON(this.startBlock), + endBlock: this.endBlock == null ? undefined : marshal.bigint.toJSON(this.endBlock), + price: this.price == null ? undefined : marshal.bigint.toJSON(this.price), + } + } +} diff --git a/src/model/generated/_collectionType.ts b/src/model/generated/_collectionType.ts new file mode 100644 index 00000000..f5b1538c --- /dev/null +++ b/src/model/generated/_collectionType.ts @@ -0,0 +1,5 @@ +export enum CollectionType { + HolderOf = "HolderOf", + Issuer = "Issuer", + Public = "Public", +} diff --git a/src/model/generated/_interaction.ts b/src/model/generated/_interaction.ts index a85519eb..5f1bba48 100644 --- a/src/model/generated/_interaction.ts +++ b/src/model/generated/_interaction.ts @@ -9,4 +9,5 @@ export enum Interaction { UNLIST = "UNLIST", LOCK = "LOCK", CHANGEISSUER = "CHANGEISSUER", + PAY_ROYALTY = "PAY_ROYALTY", } diff --git a/src/model/generated/cacheStatus.model.ts b/src/model/generated/cacheStatus.model.ts new file mode 100644 index 00000000..8cf22f3d --- /dev/null +++ b/src/model/generated/cacheStatus.model.ts @@ -0,0 +1,14 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_} from "typeorm" + +@Entity_() +export class CacheStatus { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Column_("timestamp with time zone", {nullable: false}) + lastBlockTimestamp!: Date +} diff --git a/src/model/generated/collectionEntity.model.ts b/src/model/generated/collectionEntity.model.ts index fece66a3..455d655e 100644 --- a/src/model/generated/collectionEntity.model.ts +++ b/src/model/generated/collectionEntity.model.ts @@ -4,6 +4,8 @@ import {Attribute} from "./_attribute" import {CollectionEvent} from "./collectionEvent.model" import {MetadataEntity} from "./metadataEntity.model" import {NFTEntity} from "./nftEntity.model" +import {CollectionType} from "./_collectionType" +import {CollectionSettings} from "./_collectionSettings" @Entity_() export class CollectionEntity { @@ -102,4 +104,10 @@ export class CollectionEntity { @Index_() @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) volume!: bigint + + @Column_("varchar", {length: 8, nullable: true}) + type!: CollectionType | undefined | null + + @Column_("jsonb", {transformer: {to: obj => obj == null ? undefined : obj.toJSON(), from: obj => obj == null ? undefined : new CollectionSettings(undefined, obj)}, nullable: true}) + settings!: CollectionSettings | undefined | null } diff --git a/src/model/generated/index.ts b/src/model/generated/index.ts index 2607bd65..fc5e7f8a 100644 --- a/src/model/generated/index.ts +++ b/src/model/generated/index.ts @@ -1,5 +1,7 @@ export * from "./collectionEntity.model" export * from "./_attribute" +export * from "./_collectionType" +export * from "./_collectionSettings" export * from "./tokenEntity.model" export * from "./nftEntity.model" export * from "./metadataEntity.model" @@ -7,3 +9,4 @@ export * from "./event.model" export * from "./_interaction" export * from "./collectionEvent.model" export * from "./assetEntity.model" +export * from "./cacheStatus.model" diff --git a/src/processable.ts b/src/processable.ts index 5aaaa17f..603aca00 100644 --- a/src/processable.ts +++ b/src/processable.ts @@ -1,3 +1,12 @@ +// LIST OF THE EVENTS / CALLS that we are processing +// USAGE: [NameOfThePallet].[EventName] or [NameOfThePallet].[call_name] +// Naming pattern is enforced by SubSquid + +/** + * Unique Pallet Events + * @enum {string} + * @readonly + */ export enum Unique { clearAttribute = 'Uniques.AttributeCleared', setAttribute = 'Uniques.AttributeSet', @@ -36,6 +45,12 @@ export enum Unique { // setAssetMetadata = 'AssetRegistry.MetadataSet', } + +/** + * NFTs Pallet Events + * @enum {string} + * @readonly + */ export enum NonFungible { burn = 'Nfts.Burned', changeIssuer = 'Nfts.OwnerChanged', @@ -62,6 +77,11 @@ export enum NonFungible { transfer = 'Nfts.Transferred', } +/** + * NFTs Pallet new Events + * @enum {string} + * @readonly + */ export enum NewNonFungible { // changeCollectionConfig = 'Nfts.CollectionConfigChanged', // should use extrisnic instead of event // lockCollection = 'Nfts.CollectionLocked', @@ -76,3 +96,25 @@ export enum NewNonFungible { createSwap = 'Nfts.SwapCreated', sendTip = 'Nfts.TipSent', // can be used for marking royaltyPaid } + +/** + * NFTs Pallet Calls + * @enum {string} + * @readonly + */ +export enum NonFungibleCall { + updateMintSettings = 'Nfts.update_mint_settings', +} + +/** + * Assets Pallet Events + * @enum {string} + * @readonly + */ +export enum Asset { + create = 'Assets.Created', + destroy = 'Assets.Destroyed', + forceCreate = 'Assets.ForceCreated', + clearMetadata = 'Assets.ClassMetadataCleared', + setMetadata = 'Assets.MetadataSet', +} \ No newline at end of file diff --git a/src/processor.ts b/src/processor.ts index fb6c994c..86f8eeab 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -1,109 +1,124 @@ -import { SubstrateProcessor } from '@subsquid/substrate-processor' -import { FullTypeormDatabase as Database } from '@subsquid/typeorm-store' +import { + SubstrateBatchProcessor as SubstrateProcessor +} from '@subsquid/substrate-processor' +import { TypeormDatabase as Database } from '@subsquid/typeorm-store' import logger from './mappings/utils/logger' -import { NonFungible, Unique } from './processable' +import { Asset, NonFungible, NonFungibleCall, Unique } from './processable' -import { CHAIN, getArchiveUrl, getNodeUrl, isProd } from './environment' -import * as n from './mappings/nfts' -import * as u from './mappings/uniques' -import * as a from './mappings/assets' +import { CHAIN, getArchiveUrl, getNodeUrl } from './environment' +import { mainFrame } from './mappings' +import { SelectedFields, fieldSelection } from './mappings/utils/types' const database = new Database() -const processor = new SubstrateProcessor(database) +const processor = new SubstrateProcessor() const UNIQUE_STARTING_BLOCK = 323_750 // 618838; -const _NFT_STARTING_BLOCK = 4_556_552 +// const _NFT_STARTING_BLOCK = 4_556_552 const STARTING_BLOCK = UNIQUE_STARTING_BLOCK +const ONLY_ARCHIVE = false -processor.setTypesBundle(CHAIN) +// In case you need custom types +// processor.setTypesBundle(CHAIN) + +// Set the starting block processor.setBlockRange({ from: STARTING_BLOCK }) +// Get this from the environment based on the chain from .env const archive = getArchiveUrl() const chain = getNodeUrl() processor.setDataSource({ archive, - chain, + chain: { + url: chain, + rateLimit: 10 + }, }) -const dummy = async () => {} +// disables RPC ingestion and drastically reduce no of RPC calls +processor.useArchiveOnly(ONLY_ARCHIVE) /** * Uniques nft pallet */ -processor.addEventHandler(Unique.createCollection, u.handleCollectionCreate) -processor.addEventHandler(Unique.clearAttribute, u.handleAttributeSet) -processor.addEventHandler(Unique.setAttribute, u.handleAttributeSet) -processor.addEventHandler(Unique.burn, u.handleTokenBurn) -processor.addEventHandler(Unique.forceCreateClass, u.handleForceCollectionCreate) -// processor.addEventHandler(Unique.freezeClass, dummy); -processor.addEventHandler(Unique.clearClassMetadata, u.handleMetadataSet) -processor.addEventHandler(Unique.setClassMetadata, u.handleMetadataSet) -// processor.addEventHandler(Unique.thawClass, dummy); -// processor.addEventHandler(Unique.freezeCollection, dummy); -processor.addEventHandler(Unique.setCollectionMaxSupply, u.handleCollectionLock) -processor.addEventHandler(Unique.clearCollectionMetadata, u.handleMetadataSet) -processor.addEventHandler(Unique.setCollectionMetadata, u.handleMetadataSet) -processor.addEventHandler(Unique.thawCollection, dummy) -processor.addEventHandler(Unique.destroyCollection, u.handleCollectionDestroy) -// processor.addEventHandler(Unique.freeze, dummy); -processor.addEventHandler(Unique.createItem, u.handleTokenCreate) -processor.addEventHandler(Unique.sold, u.handleTokenBuy) -processor.addEventHandler(Unique.clearPrice, u.handleTokenList) -processor.addEventHandler(Unique.setPrice, u.handleTokenList) -processor.addEventHandler(Unique.clearMetadata, u.handleMetadataSet) -processor.addEventHandler(Unique.setMetadata, u.handleMetadataSet) -processor.addEventHandler(Unique.changeIssuer, u.handleCollectionOwnerChange) -// processor.addEventHandler(Unique.changeOwnershipAcceptance, dummy); -processor.addEventHandler(Unique.changeTeam, u.handleCollectionTeamChange) -// processor.addEventHandler(Unique.thaw, dummy); -processor.addEventHandler(Unique.transfer, u.handleTokenTransfer) +processor.addEvent({ name: [Unique.createCollection], call: true, extrinsic: true }) // u.handleCollectionCreate) +processor.addEvent({ name: [Unique.clearAttribute], call: true, extrinsic: true }) // u.handleAttributeSet) +processor.addEvent({ name: [Unique.setAttribute], call: true, extrinsic: true }) // u.handleAttributeSet) +processor.addEvent({ name: [Unique.burn], call: true, extrinsic: true }) // u.handleTokenBurn) +processor.addEvent({ name: [Unique.forceCreateClass], call: true, extrinsic: true }) // u.handleForceCollectionCreate) +// processor.addEvent({ name: [Unique.freezeClass, dummy); +processor.addEvent({ name: [Unique.clearClassMetadata], call: true, extrinsic: true }) // u.handleMetadataSet) +processor.addEvent({ name: [Unique.setClassMetadata], call: true, extrinsic: true }) // u.handleMetadataSet) +// processor.addEvent({ name: [Unique.thawClass, dummy); +// processor.addEvent({ name: [Unique.freezeCollection, dummy); +processor.addEvent({ name: [Unique.setCollectionMaxSupply], call: true, extrinsic: true }) // u.handleCollectionLock) +processor.addEvent({ name: [Unique.clearCollectionMetadata], call: true, extrinsic: true }) // u.handleMetadataSet) +processor.addEvent({ name: [Unique.setCollectionMetadata], call: true, extrinsic: true }) // u.handleMetadataSet) +// processor.addEvent({ name: [Unique.thawCollection], call: true, extrinsic: true }) // dummy) +processor.addEvent({ name: [Unique.destroyCollection], call: true, extrinsic: true }) // u.handleCollectionDestroy) +// processor.addEvent({ name: [Unique.freeze, dummy); +processor.addEvent({ name: [Unique.createItem], call: true, extrinsic: true }) // u.handleTokenCreate) +processor.addEvent({ name: [Unique.sold], call: true, extrinsic: true }) // u.handleTokenBuy) +processor.addEvent({ name: [Unique.clearPrice], call: true, extrinsic: true }) // u.handleTokenList) +processor.addEvent({ name: [Unique.setPrice], call: true, extrinsic: true }) // u.handleTokenList) +processor.addEvent({ name: [Unique.clearMetadata], call: true, extrinsic: true }) // u.handleMetadataSet) +processor.addEvent({ name: [Unique.setMetadata], call: true, extrinsic: true }) // u.handleMetadataSet) +processor.addEvent({ name: [Unique.changeIssuer], call: true, extrinsic: true }) // u.handleCollectionOwnerChange) +// processor.addEvent({ name: [Unique.changeOwnershipAcceptance, dummy); +processor.addEvent({ name: [Unique.changeTeam], call: true, extrinsic: true }) // u.handleCollectionTeamChange) +// processor.addEvent({ name: [Unique.thaw, dummy); +processor.addEvent({ name: [Unique.transfer], call: true, extrinsic: true }) // u.handleTokenTransfer) /** * NonFungibles nft pallet -*/ -processor.addEventHandler(NonFungible.createCollection, n.handleCollectionCreate) -processor.addEventHandler(NonFungible.clearAttribute, n.handleAttributeSet) -processor.addEventHandler(NonFungible.setAttribute, n.handleAttributeSet) -processor.addEventHandler(NonFungible.burn, n.handleTokenBurn) + */ +processor.addEvent({ name: [NonFungible.createCollection], call: true, extrinsic: true }) // n.handleCollectionCreate) +processor.addEvent({ name: [NonFungible.clearAttribute], call: true, extrinsic: true }) // n.handleAttributeSet) +processor.addEvent({ name: [NonFungible.setAttribute], call: true, extrinsic: true }) // n.handleAttributeSet) +processor.addEvent({ name: [NonFungible.burn], call: true, extrinsic: true }) // n.handleTokenBurn) // Changed -processor.addEventHandler(NonFungible.forceCreateCollection, n.handleForceCollectionCreate) -// processor.addEventHandler(NonFungible.freezeClass, dummy); -processor.addEventHandler(NonFungible.clearCollectionMetadata, n.handleMetadataSet) -processor.addEventHandler(NonFungible.setCollectionMetadata, n.handleMetadataSet) +processor.addEvent({ name: [NonFungible.forceCreateCollection], call: true, extrinsic: true }) // n.handleForceCollectionCreate) +// processor.addEvent({ name: [NonFungible.freezeClass, dummy); +processor.addEvent({ name: [NonFungible.clearCollectionMetadata], call: true, extrinsic: true }) // n.handleMetadataSet) +processor.addEvent({ name: [NonFungible.setCollectionMetadata], call: true, extrinsic: true }) // n.handleMetadataSet) // end changed -// processor.addEventHandler(NonFungible.thawClass, dummy); -// processor.addEventHandler(NonFungible.freezeCollection, dummy); -processor.addEventHandler(NonFungible.setCollectionMaxSupply, n.handleCollectionLock) -processor.addEventHandler(NonFungible.clearCollectionMetadata, n.handleMetadataSet) -processor.addEventHandler(NonFungible.setCollectionMetadata, n.handleMetadataSet) -processor.addEventHandler(NonFungible.thawCollection, dummy) -processor.addEventHandler(NonFungible.destroyCollection, n.handleCollectionDestroy) -// processor.addEventHandler(NonFungible.freeze, dummy); -processor.addEventHandler(NonFungible.createItem, n.handleTokenCreate) -processor.addEventHandler(NonFungible.sold, n.handleTokenBuy) -processor.addEventHandler(NonFungible.clearPrice, n.handleTokenList) -processor.addEventHandler(NonFungible.setPrice, n.handleTokenList) -processor.addEventHandler(NonFungible.clearMetadata, n.handleMetadataSet) -processor.addEventHandler(NonFungible.setMetadata, n.handleMetadataSet) -processor.addEventHandler(NonFungible.changeIssuer, n.handleCollectionOwnerChange) -// processor.addEventHandler(NonFungible.changeOwnershipAcceptance, dummy); -processor.addEventHandler(NonFungible.changeTeam, n.handleCollectionTeamChange) -// processor.addEventHandler(NonFungible.thaw, dummy); -processor.addEventHandler(NonFungible.transfer, n.handleTokenTransfer) +// processor.addEvent({ name: [NonFungible.thawClass, dummy); +// processor.addEvent({ name: [NonFungible.freezeCollection, dummy); +processor.addEvent({ name: [NonFungible.setCollectionMaxSupply], call: true, extrinsic: true }) // n.handleCollectionLock) +processor.addEvent({ name: [NonFungible.clearCollectionMetadata], call: true, extrinsic: true }) // n.handleMetadataSet) +processor.addEvent({ name: [NonFungible.setCollectionMetadata], call: true, extrinsic: true }) // n.handleMetadataSet) +// processor.addEvent({ name: [NonFungible.thawCollection], call: true, extrinsic: true }) // dummy) +processor.addEvent({ name: [NonFungible.destroyCollection], call: true, extrinsic: true }) // n.handleCollectionDestroy) +// processor.addEvent({ name: [NonFungible.freeze, dummy); +processor.addEvent({ name: [NonFungible.createItem], call: true, extrinsic: true }) // n.handleTokenCreate) +processor.addEvent({ name: [NonFungible.sold], call: true, extrinsic: true }) // n.handleTokenBuy) +processor.addEvent({ name: [NonFungible.clearPrice], call: true, extrinsic: true }) // n.handleTokenList) +processor.addEvent({ name: [NonFungible.setPrice], call: true, extrinsic: true }) // n.handleTokenList) +processor.addEvent({ name: [NonFungible.clearMetadata], call: true, extrinsic: true }) // n.handleMetadataSet) +processor.addEvent({ name: [NonFungible.setMetadata], call: true, extrinsic: true }) // n.handleMetadataSet) +processor.addEvent({ name: [NonFungible.changeIssuer], call: true, extrinsic: true }) // n.handleCollectionOwnerChange) +// processor.addEvent({ name: [NonFungible.changeOwnershipAcceptance, dummy); +processor.addEvent({ name: [NonFungible.changeTeam], call: true, extrinsic: true }) // n.handleCollectionTeamChange) +// processor.addEvent({ name: [NonFungible.thaw, dummy); +processor.addEvent({ name: [NonFungible.transfer], call: true, extrinsic: true }) // n.handleTokenTransfer) -/** - * Assets nft pallet -*/ -processor.addPreHook({ range: { from: STARTING_BLOCK, to: STARTING_BLOCK } }, a.forceCreateSystemAsset); -processor.addPreHook({ range: { from: STARTING_BLOCK, to: STARTING_BLOCK } }, a.forceCreateUsdtAsset); +processor.addCall({ name: [NonFungibleCall.updateMintSettings], extrinsic: true }) -if (isProd) { - processor.addPreHook({ range: { from: STARTING_BLOCK, to: STARTING_BLOCK } }, a.forceCreateRmrkAsset); -} +processor.setFields(fieldSelection) +/** + * Assets pallet + */ +// processor.addEvent({ name: [Asset.create], call: true, extrinsic: true }) +// processor.addEvent({ name: [Asset.forceCreate], call: true, extrinsic: true }) +processor.addEvent({ name: [Asset.setMetadata], call: true, extrinsic: true }) +// processor.addEvent({ name: [Asset.clearMetadata], call: true, extrinsic: true }) logger.info(`PROCESSING ~~ ${CHAIN.toUpperCase()} ~~ EVENTS`) -processor.run() +// const handler = async (ctx: DataHandlerContext) => {} + +// mainFrame function is called when the processor is ready to process the data +processor.run(database, mainFrame) + diff --git a/src/types/kusama/assets/events.ts b/src/types/kusama/assets/events.ts new file mode 100644 index 00000000..9970d8dc --- /dev/null +++ b/src/types/kusama/assets/events.ts @@ -0,0 +1,110 @@ +import {sts, Block, Bytes, Option, Result, EventType, RuntimeCtx} from '../support' +import * as v1 from '../v1' +import * as v700 from '../v700' + +export const created = { + name: 'Assets.Created', + /** + * Some asset class was created. \[asset_id, creator, owner\] + */ + v1: new EventType( + 'Assets.Created', + sts.tuple([v1.AssetId, v1.AccountId, v1.AccountId]) + ), + /** + * Some asset class was created. + */ + v700: new EventType( + 'Assets.Created', + sts.struct({ + assetId: sts.number(), + creator: v700.AccountId32, + owner: v700.AccountId32, + }) + ), +} + +export const destroyed = { + name: 'Assets.Destroyed', + /** + * An asset class was destroyed. + */ + v1: new EventType( + 'Assets.Destroyed', + v1.AssetId + ), + /** + * An asset class was destroyed. + */ + v700: new EventType( + 'Assets.Destroyed', + sts.struct({ + assetId: sts.number(), + }) + ), +} + +export const forceCreated = { + name: 'Assets.ForceCreated', + /** + * Some asset class was force-created. \[asset_id, owner\] + */ + v1: new EventType( + 'Assets.ForceCreated', + sts.tuple([v1.AssetId, v1.AccountId]) + ), + /** + * Some asset class was force-created. + */ + v700: new EventType( + 'Assets.ForceCreated', + sts.struct({ + assetId: sts.number(), + owner: v700.AccountId32, + }) + ), +} + +export const metadataSet = { + name: 'Assets.MetadataSet', + /** + * New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\] + */ + v1: new EventType( + 'Assets.MetadataSet', + sts.tuple([v1.AssetId, sts.bytes(), sts.bytes(), sts.number(), sts.boolean()]) + ), + /** + * New metadata has been set for an asset. + */ + v700: new EventType( + 'Assets.MetadataSet', + sts.struct({ + assetId: sts.number(), + name: sts.bytes(), + symbol: sts.bytes(), + decimals: sts.number(), + isFrozen: sts.boolean(), + }) + ), +} + +export const metadataCleared = { + name: 'Assets.MetadataCleared', + /** + * Metadata has been cleared for an asset. \[asset_id\] + */ + v1: new EventType( + 'Assets.MetadataCleared', + v1.AssetId + ), + /** + * Metadata has been cleared for an asset. + */ + v700: new EventType( + 'Assets.MetadataCleared', + sts.struct({ + assetId: sts.number(), + }) + ), +} diff --git a/src/types/kusama/calls.ts b/src/types/kusama/calls.ts new file mode 100644 index 00000000..4928f311 --- /dev/null +++ b/src/types/kusama/calls.ts @@ -0,0 +1 @@ +export * as nfts from './nfts/calls' diff --git a/src/types/kusama/events.ts b/src/types/kusama/events.ts new file mode 100644 index 00000000..8479950d --- /dev/null +++ b/src/types/kusama/events.ts @@ -0,0 +1,3 @@ +export * as assets from './assets/events' +export * as uniques from './uniques/events' +export * as nfts from './nfts/events' diff --git a/src/types/kusama/index.ts b/src/types/kusama/index.ts new file mode 100644 index 00000000..eb79edd1 --- /dev/null +++ b/src/types/kusama/index.ts @@ -0,0 +1,10 @@ +export * as v1 from './v1' +export * as v700 from './v700' +export * as v9230 from './v9230' +export * as v900 from './v900' +export * as v9270 from './v9270' +export * as v9420 from './v9420' +export * as v9430 from './v9430' +export * as events from './events' +export * as calls from './calls' +export * as storage from './storage' diff --git a/src/types/kusama/nfts/calls.ts b/src/types/kusama/nfts/calls.ts new file mode 100644 index 00000000..6c829f7a --- /dev/null +++ b/src/types/kusama/nfts/calls.ts @@ -0,0 +1,24 @@ +import {sts, Block, Bytes, Option, Result, CallType, RuntimeCtx} from '../support' +import * as v9420 from '../v9420' + +export const updateMintSettings = { + name: 'Nfts.update_mint_settings', + /** + * Update mint settings. + * + * Origin must be either `ForceOrigin` or `Signed` and the sender should be the Issuer + * of the `collection`. + * + * - `collection`: The identifier of the collection to change. + * - `mint_settings`: The new mint settings. + * + * Emits `CollectionMintSettingsUpdated` event when successful. + */ + v9420: new CallType( + 'Nfts.update_mint_settings', + sts.struct({ + collection: sts.number(), + mintSettings: v9420.MintSettings, + }) + ), +} diff --git a/src/types/kusama/nfts/events.ts b/src/types/kusama/nfts/events.ts new file mode 100644 index 00000000..f30c16af --- /dev/null +++ b/src/types/kusama/nfts/events.ts @@ -0,0 +1,588 @@ +import {sts, Block, Bytes, Option, Result, EventType, RuntimeCtx} from '../support' +import * as v9420 from '../v9420' +import * as v9430 from '../v9430' + +export const created = { + name: 'Nfts.Created', + /** + * A `collection` was created. + */ + v9420: new EventType( + 'Nfts.Created', + sts.struct({ + collection: sts.number(), + creator: v9420.AccountId32, + owner: v9420.AccountId32, + }) + ), +} + +export const forceCreated = { + name: 'Nfts.ForceCreated', + /** + * A `collection` was force-created. + */ + v9420: new EventType( + 'Nfts.ForceCreated', + sts.struct({ + collection: sts.number(), + owner: v9420.AccountId32, + }) + ), +} + +export const destroyed = { + name: 'Nfts.Destroyed', + /** + * A `collection` was destroyed. + */ + v9420: new EventType( + 'Nfts.Destroyed', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const issued = { + name: 'Nfts.Issued', + /** + * An `item` was issued. + */ + v9420: new EventType( + 'Nfts.Issued', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9420.AccountId32, + }) + ), +} + +export const transferred = { + name: 'Nfts.Transferred', + /** + * An `item` was transferred. + */ + v9420: new EventType( + 'Nfts.Transferred', + sts.struct({ + collection: sts.number(), + item: sts.number(), + from: v9420.AccountId32, + to: v9420.AccountId32, + }) + ), +} + +export const burned = { + name: 'Nfts.Burned', + /** + * An `item` was destroyed. + */ + v9420: new EventType( + 'Nfts.Burned', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9420.AccountId32, + }) + ), +} + +export const itemTransferLocked = { + name: 'Nfts.ItemTransferLocked', + /** + * An `item` became non-transferable. + */ + v9420: new EventType( + 'Nfts.ItemTransferLocked', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const itemTransferUnlocked = { + name: 'Nfts.ItemTransferUnlocked', + /** + * An `item` became transferable. + */ + v9420: new EventType( + 'Nfts.ItemTransferUnlocked', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const itemPropertiesLocked = { + name: 'Nfts.ItemPropertiesLocked', + /** + * `item` metadata or attributes were locked. + */ + v9420: new EventType( + 'Nfts.ItemPropertiesLocked', + sts.struct({ + collection: sts.number(), + item: sts.number(), + lockMetadata: sts.boolean(), + lockAttributes: sts.boolean(), + }) + ), +} + +export const collectionLocked = { + name: 'Nfts.CollectionLocked', + /** + * Some `collection` was locked. + */ + v9420: new EventType( + 'Nfts.CollectionLocked', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const ownerChanged = { + name: 'Nfts.OwnerChanged', + /** + * The owner changed. + */ + v9420: new EventType( + 'Nfts.OwnerChanged', + sts.struct({ + collection: sts.number(), + newOwner: v9420.AccountId32, + }) + ), +} + +export const teamChanged = { + name: 'Nfts.TeamChanged', + /** + * The management team changed. + */ + v9420: new EventType( + 'Nfts.TeamChanged', + sts.struct({ + collection: sts.number(), + issuer: sts.option(() => v9420.AccountId32), + admin: sts.option(() => v9420.AccountId32), + freezer: sts.option(() => v9420.AccountId32), + }) + ), +} + +export const transferApproved = { + name: 'Nfts.TransferApproved', + /** + * An `item` of a `collection` has been approved by the `owner` for transfer by + * a `delegate`. + */ + v9420: new EventType( + 'Nfts.TransferApproved', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9420.AccountId32, + delegate: v9420.AccountId32, + deadline: sts.option(() => sts.number()), + }) + ), +} + +export const approvalCancelled = { + name: 'Nfts.ApprovalCancelled', + /** + * An approval for a `delegate` account to transfer the `item` of an item + * `collection` was cancelled by its `owner`. + */ + v9420: new EventType( + 'Nfts.ApprovalCancelled', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9420.AccountId32, + delegate: v9420.AccountId32, + }) + ), +} + +export const allApprovalsCancelled = { + name: 'Nfts.AllApprovalsCancelled', + /** + * All approvals of an item got cancelled. + */ + v9420: new EventType( + 'Nfts.AllApprovalsCancelled', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9420.AccountId32, + }) + ), +} + +export const collectionConfigChanged = { + name: 'Nfts.CollectionConfigChanged', + /** + * A `collection` has had its config changed by the `Force` origin. + */ + v9420: new EventType( + 'Nfts.CollectionConfigChanged', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const collectionMetadataSet = { + name: 'Nfts.CollectionMetadataSet', + /** + * New metadata has been set for a `collection`. + */ + v9420: new EventType( + 'Nfts.CollectionMetadataSet', + sts.struct({ + collection: sts.number(), + data: sts.bytes(), + }) + ), +} + +export const collectionMetadataCleared = { + name: 'Nfts.CollectionMetadataCleared', + /** + * Metadata has been cleared for a `collection`. + */ + v9420: new EventType( + 'Nfts.CollectionMetadataCleared', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const itemMetadataSet = { + name: 'Nfts.ItemMetadataSet', + /** + * New metadata has been set for an item. + */ + v9420: new EventType( + 'Nfts.ItemMetadataSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + data: sts.bytes(), + }) + ), +} + +export const itemMetadataCleared = { + name: 'Nfts.ItemMetadataCleared', + /** + * Metadata has been cleared for an item. + */ + v9420: new EventType( + 'Nfts.ItemMetadataCleared', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const attributeSet = { + name: 'Nfts.AttributeSet', + /** + * New attribute metadata has been set for a `collection` or `item`. + */ + v9420: new EventType( + 'Nfts.AttributeSet', + sts.struct({ + collection: sts.number(), + maybeItem: sts.option(() => sts.number()), + key: sts.bytes(), + value: sts.bytes(), + namespace: v9420.AttributeNamespace, + }) + ), +} + +export const attributeCleared = { + name: 'Nfts.AttributeCleared', + /** + * Attribute metadata has been cleared for a `collection` or `item`. + */ + v9420: new EventType( + 'Nfts.AttributeCleared', + sts.struct({ + collection: sts.number(), + maybeItem: sts.option(() => sts.number()), + key: sts.bytes(), + namespace: v9420.AttributeNamespace, + }) + ), +} + +export const itemAttributesApprovalAdded = { + name: 'Nfts.ItemAttributesApprovalAdded', + /** + * A new approval to modify item attributes was added. + */ + v9420: new EventType( + 'Nfts.ItemAttributesApprovalAdded', + sts.struct({ + collection: sts.number(), + item: sts.number(), + delegate: v9420.AccountId32, + }) + ), +} + +export const itemAttributesApprovalRemoved = { + name: 'Nfts.ItemAttributesApprovalRemoved', + /** + * A new approval to modify item attributes was removed. + */ + v9420: new EventType( + 'Nfts.ItemAttributesApprovalRemoved', + sts.struct({ + collection: sts.number(), + item: sts.number(), + delegate: v9420.AccountId32, + }) + ), +} + +export const ownershipAcceptanceChanged = { + name: 'Nfts.OwnershipAcceptanceChanged', + /** + * Ownership acceptance has changed for an account. + */ + v9420: new EventType( + 'Nfts.OwnershipAcceptanceChanged', + sts.struct({ + who: v9420.AccountId32, + maybeCollection: sts.option(() => sts.number()), + }) + ), +} + +export const collectionMaxSupplySet = { + name: 'Nfts.CollectionMaxSupplySet', + /** + * Max supply has been set for a collection. + */ + v9420: new EventType( + 'Nfts.CollectionMaxSupplySet', + sts.struct({ + collection: sts.number(), + maxSupply: sts.number(), + }) + ), +} + +export const collectionMintSettingsUpdated = { + name: 'Nfts.CollectionMintSettingsUpdated', + /** + * Mint settings for a collection had changed. + */ + v9420: new EventType( + 'Nfts.CollectionMintSettingsUpdated', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const nextCollectionIdIncremented = { + name: 'Nfts.NextCollectionIdIncremented', + /** + * Event gets emitted when the `NextCollectionId` gets incremented. + */ + v9420: new EventType( + 'Nfts.NextCollectionIdIncremented', + sts.struct({ + nextId: sts.number(), + }) + ), + /** + * Event gets emitted when the `NextCollectionId` gets incremented. + */ + v1000000: new EventType( + 'Nfts.NextCollectionIdIncremented', + sts.struct({ + nextId: sts.option(() => sts.number()), + }) + ), +} + +export const itemPriceSet = { + name: 'Nfts.ItemPriceSet', + /** + * The price was set for the item. + */ + v9420: new EventType( + 'Nfts.ItemPriceSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + price: sts.bigint(), + whitelistedBuyer: sts.option(() => v9420.AccountId32), + }) + ), +} + +export const itemPriceRemoved = { + name: 'Nfts.ItemPriceRemoved', + /** + * The price for the item was removed. + */ + v9420: new EventType( + 'Nfts.ItemPriceRemoved', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const itemBought = { + name: 'Nfts.ItemBought', + /** + * An item was bought. + */ + v9420: new EventType( + 'Nfts.ItemBought', + sts.struct({ + collection: sts.number(), + item: sts.number(), + price: sts.bigint(), + seller: v9420.AccountId32, + buyer: v9420.AccountId32, + }) + ), +} + +export const tipSent = { + name: 'Nfts.TipSent', + /** + * A tip was sent. + */ + v9420: new EventType( + 'Nfts.TipSent', + sts.struct({ + collection: sts.number(), + item: sts.number(), + sender: v9420.AccountId32, + receiver: v9420.AccountId32, + amount: sts.bigint(), + }) + ), +} + +export const swapCreated = { + name: 'Nfts.SwapCreated', + /** + * An `item` swap intent was created. + */ + v9420: new EventType( + 'Nfts.SwapCreated', + sts.struct({ + offeredCollection: sts.number(), + offeredItem: sts.number(), + desiredCollection: sts.number(), + desiredItem: sts.option(() => sts.number()), + price: sts.option(() => v9420.PriceWithDirection), + deadline: sts.number(), + }) + ), +} + +export const swapCancelled = { + name: 'Nfts.SwapCancelled', + /** + * The swap was cancelled. + */ + v9420: new EventType( + 'Nfts.SwapCancelled', + sts.struct({ + offeredCollection: sts.number(), + offeredItem: sts.number(), + desiredCollection: sts.number(), + desiredItem: sts.option(() => sts.number()), + price: sts.option(() => v9420.PriceWithDirection), + deadline: sts.number(), + }) + ), +} + +export const swapClaimed = { + name: 'Nfts.SwapClaimed', + /** + * The swap has been claimed. + */ + v9420: new EventType( + 'Nfts.SwapClaimed', + sts.struct({ + sentCollection: sts.number(), + sentItem: sts.number(), + sentItemOwner: v9420.AccountId32, + receivedCollection: sts.number(), + receivedItem: sts.number(), + receivedItemOwner: v9420.AccountId32, + price: sts.option(() => v9420.PriceWithDirection), + deadline: sts.number(), + }) + ), +} + +export const preSignedAttributesSet = { + name: 'Nfts.PreSignedAttributesSet', + /** + * New attributes have been set for an `item` of the `collection`. + */ + v9420: new EventType( + 'Nfts.PreSignedAttributesSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + namespace: v9420.AttributeNamespace, + }) + ), +} + +export const palletAttributeSet = { + name: 'Nfts.PalletAttributeSet', + /** + * A new attribute in the `Pallet` namespace was set for the `collection` or an `item` + * within that `collection`. + */ + v9420: new EventType( + 'Nfts.PalletAttributeSet', + sts.struct({ + collection: sts.number(), + item: sts.option(() => sts.number()), + attribute: v9420.PalletAttributes, + value: sts.bytes(), + }) + ), + /** + * A new attribute in the `Pallet` namespace was set for the `collection` or an `item` + * within that `collection`. + */ + v9430: new EventType( + 'Nfts.PalletAttributeSet', + sts.struct({ + collection: sts.number(), + item: sts.option(() => sts.number()), + attribute: v9430.PalletAttributes, + value: sts.bytes(), + }) + ), +} diff --git a/src/types/kusama/nfts/storage.ts b/src/types/kusama/nfts/storage.ts new file mode 100644 index 00000000..c59ffb54 --- /dev/null +++ b/src/types/kusama/nfts/storage.ts @@ -0,0 +1,54 @@ +import {sts, Block, Bytes, Option, Result, StorageType, RuntimeCtx} from '../support' +import * as v9420 from '../v9420' + +export const collection = { + /** + * Details of a collection. + */ + v9420: new StorageType('Nfts.Collection', 'Optional', [sts.number()], v9420.Type_348) as CollectionV9420, +} + +/** + * Details of a collection. + */ +export interface CollectionV9420 { + is(block: RuntimeCtx): boolean + get(block: Block, key: number): Promise<(v9420.Type_348 | undefined)> + getMany(block: Block, keys: number[]): Promise<(v9420.Type_348 | undefined)[]> + getKeys(block: Block): Promise + getKeys(block: Block, key: number): Promise + getKeysPaged(pageSize: number, block: Block): AsyncIterable + getKeysPaged(pageSize: number, block: Block, key: number): AsyncIterable + getPairs(block: Block): Promise<[k: number, v: (v9420.Type_348 | undefined)][]> + getPairs(block: Block, key: number): Promise<[k: number, v: (v9420.Type_348 | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: number, v: (v9420.Type_348 | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key: number): AsyncIterable<[k: number, v: (v9420.Type_348 | undefined)][]> +} + +export const itemMetadataOf = { + /** + * Metadata of an item. + */ + v9420: new StorageType('Nfts.ItemMetadataOf', 'Optional', [sts.number(), sts.number()], v9420.Type_358) as ItemMetadataOfV9420, +} + +/** + * Metadata of an item. + */ +export interface ItemMetadataOfV9420 { + is(block: RuntimeCtx): boolean + get(block: Block, key1: number, key2: number): Promise<(v9420.Type_358 | undefined)> + getMany(block: Block, keys: [number, number][]): Promise<(v9420.Type_358 | undefined)[]> + getKeys(block: Block): Promise<[number, number][]> + getKeys(block: Block, key1: number): Promise<[number, number][]> + getKeys(block: Block, key1: number, key2: number): Promise<[number, number][]> + getKeysPaged(pageSize: number, block: Block): AsyncIterable<[number, number][]> + getKeysPaged(pageSize: number, block: Block, key1: number): AsyncIterable<[number, number][]> + getKeysPaged(pageSize: number, block: Block, key1: number, key2: number): AsyncIterable<[number, number][]> + getPairs(block: Block): Promise<[k: [number, number], v: (v9420.Type_358 | undefined)][]> + getPairs(block: Block, key1: number): Promise<[k: [number, number], v: (v9420.Type_358 | undefined)][]> + getPairs(block: Block, key1: number, key2: number): Promise<[k: [number, number], v: (v9420.Type_358 | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: [number, number], v: (v9420.Type_358 | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key1: number): AsyncIterable<[k: [number, number], v: (v9420.Type_358 | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key1: number, key2: number): AsyncIterable<[k: [number, number], v: (v9420.Type_358 | undefined)][]> +} diff --git a/src/types/kusama/storage.ts b/src/types/kusama/storage.ts new file mode 100644 index 00000000..6a7fa0fc --- /dev/null +++ b/src/types/kusama/storage.ts @@ -0,0 +1,2 @@ +export * as uniques from './uniques/storage' +export * as nfts from './nfts/storage' diff --git a/src/types/kusama/support.ts b/src/types/kusama/support.ts new file mode 100644 index 00000000..456dfc2f --- /dev/null +++ b/src/types/kusama/support.ts @@ -0,0 +1,142 @@ +import type {BitSequence, Bytes, QualifiedName, Runtime} from '@subsquid/substrate-runtime' +import * as sts from '@subsquid/substrate-runtime/lib/sts' +import {Option, Result} from '@subsquid/substrate-runtime/lib/sts' +import assert from 'assert' + + +export {sts, Bytes, BitSequence, Option, Result} + + +export interface RuntimeCtx { + _runtime: Runtime +} + + +export interface Block extends RuntimeCtx { + hash: Bytes + height: number +} + + +interface Event { + block: RuntimeCtx + name: QualifiedName + args: unknown +} + + +interface Call { + block: RuntimeCtx + name: QualifiedName + args: unknown +} + + +export class EventType { + constructor(public readonly name: QualifiedName, private type: T) {} + + matches(block: RuntimeCtx): boolean { + return block._runtime.events.checkType(this.name, this.type) + } + + is(event: Event): boolean { + return this.name == event.name && this.matches(event.block) + } + + decode(event: Event): sts.GetType { + assert(this.is(event)) + return event.block._runtime.decodeJsonEventRecordArguments(event) + } +} + + +export class CallType { + constructor(public readonly name: QualifiedName, private type: T) {} + + matches(block: RuntimeCtx): boolean { + return block._runtime.calls.checkType(this.name, this.type) + } + + is(call: Call): boolean { + return this.name == call.name && this.matches(call.block) + } + + decode(call: Call): sts.GetType { + assert(this.is(call)) + return call.block._runtime.decodeJsonCallRecordArguments(call) + } +} + + +export class ConstantType { + constructor(private name: QualifiedName, private type: T) {} + + is(block: RuntimeCtx): boolean { + return block._runtime.checkConstantType(this.name, this.type) + } + + get(block: RuntimeCtx): sts.GetType { + assert(this.is(block)) + return block._runtime.getConstant(this.name) + } +} + + +export class StorageType { + constructor( + private name: QualifiedName, + private modifier: 'Required' | 'Optional' | 'Default', + private key: sts.Type[], + private value: sts.Type + ) {} + + is(block: RuntimeCtx): boolean { + return block._runtime.checkStorageType(this.name, this.modifier, this.key, this.value) + } + + async get(block: Block, ...key: any[]): Promise { + assert(this.is(block)) + return block._runtime.getStorage(block.hash, this.name, ...key) + } + + async getAll(block: Block): Promise { + assert(this.is(block)) + return block._runtime.queryStorage(block.hash, this.name) + } + + async getMany(block: Block, keys: any[]): Promise { + assert(this.is(block)) + return block._runtime.queryStorage(block.hash, this.name, keys) + } + + async getKeys(block: Block, ...args: any[]): Promise { + assert(this.is(block)) + return block._runtime.getStorageKeys(block.hash, this.name, ...args) + } + + async getRawKeys(block: Block, ...args: any[]): Promise { + assert(this.is(block)) + return block._runtime.getStorageRawKeys(block.hash, this.name, ...args) + } + + getKeysPaged(pageSize: number, block: Block, ...args: any[]): AsyncIterable { + assert(this.is(block)) + return block._runtime.getStorageKeysPaged(pageSize, block.hash, this.name, ...args) + } + + async getPairs(block: Block, ...args: any[]): Promise<[key: any, value: any][]> { + assert(this.is(block)) + return block._runtime.getStoragePairs(block.hash, this.name, ...args) + } + + getPairsPaged(pageSize: number, block: Block, ...args: any[]): AsyncIterable<[key: any, value: any][]> { + assert(this.is(block)) + return block._runtime.getStoragePairsPaged(pageSize, block.hash, this.name, ...args) + } + + getDefault(block: Block): any { + assert(this.modifier == 'Default') + assert(this.is(block)) + return block._runtime.getStorageFallback(this.name) + } +} diff --git a/src/types/kusama/uniques/events.ts b/src/types/kusama/uniques/events.ts new file mode 100644 index 00000000..edd0ae65 --- /dev/null +++ b/src/types/kusama/uniques/events.ts @@ -0,0 +1,686 @@ +import {sts, Block, Bytes, Option, Result, EventType, RuntimeCtx} from '../support' +import * as v1 from '../v1' +import * as v700 from '../v700' +import * as v900 from '../v900' +import * as v9230 from '../v9230' +import * as v9270 from '../v9270' + +export const created = { + name: 'Uniques.Created', + /** + * An asset class was created. \[ class, creator, owner \] + */ + v1: new EventType( + 'Uniques.Created', + sts.tuple([v1.ClassId, v1.AccountId, v1.AccountId]) + ), + /** + * An asset class was created. + */ + v700: new EventType( + 'Uniques.Created', + sts.struct({ + class: sts.number(), + creator: v700.AccountId32, + owner: v700.AccountId32, + }) + ), + /** + * A `collection` was created. + */ + v9230: new EventType( + 'Uniques.Created', + sts.struct({ + collection: sts.number(), + creator: v9230.AccountId32, + owner: v9230.AccountId32, + }) + ), +} + +export const forceCreated = { + name: 'Uniques.ForceCreated', + /** + * An asset class was force-created. \[ class, owner \] + */ + v1: new EventType( + 'Uniques.ForceCreated', + sts.tuple([v1.ClassId, v1.AccountId]) + ), + /** + * An asset class was force-created. + */ + v700: new EventType( + 'Uniques.ForceCreated', + sts.struct({ + class: sts.number(), + owner: v700.AccountId32, + }) + ), + /** + * A `collection` was force-created. + */ + v9230: new EventType( + 'Uniques.ForceCreated', + sts.struct({ + collection: sts.number(), + owner: v9230.AccountId32, + }) + ), +} + +export const destroyed = { + name: 'Uniques.Destroyed', + /** + * An asset `class` was destroyed. \[ class \] + */ + v1: new EventType( + 'Uniques.Destroyed', + v1.ClassId + ), + /** + * An asset `class` was destroyed. + */ + v700: new EventType( + 'Uniques.Destroyed', + sts.struct({ + class: sts.number(), + }) + ), + /** + * A `collection` was destroyed. + */ + v9230: new EventType( + 'Uniques.Destroyed', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const issued = { + name: 'Uniques.Issued', + /** + * An asset `instace` was issued. \[ class, instance, owner \] + */ + v1: new EventType( + 'Uniques.Issued', + sts.tuple([v1.ClassId, v1.InstanceId, v1.AccountId]) + ), + /** + * An asset `instance` was issued. + */ + v700: new EventType( + 'Uniques.Issued', + sts.struct({ + class: sts.number(), + instance: sts.number(), + owner: v700.AccountId32, + }) + ), + /** + * An `item` was issued. + */ + v9230: new EventType( + 'Uniques.Issued', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9230.AccountId32, + }) + ), +} + +export const transferred = { + name: 'Uniques.Transferred', + /** + * An asset `instace` was transferred. \[ class, instance, from, to \] + */ + v1: new EventType( + 'Uniques.Transferred', + sts.tuple([v1.ClassId, v1.InstanceId, v1.AccountId, v1.AccountId]) + ), + /** + * An asset `instance` was transferred. + */ + v700: new EventType( + 'Uniques.Transferred', + sts.struct({ + class: sts.number(), + instance: sts.number(), + from: v700.AccountId32, + to: v700.AccountId32, + }) + ), + /** + * An `item` was transferred. + */ + v9230: new EventType( + 'Uniques.Transferred', + sts.struct({ + collection: sts.number(), + item: sts.number(), + from: v9230.AccountId32, + to: v9230.AccountId32, + }) + ), +} + +export const burned = { + name: 'Uniques.Burned', + /** + * An asset `instance` was destroyed. \[ class, instance, owner \] + */ + v1: new EventType( + 'Uniques.Burned', + sts.tuple([v1.ClassId, v1.InstanceId, v1.AccountId]) + ), + /** + * An asset `instance` was destroyed. + */ + v700: new EventType( + 'Uniques.Burned', + sts.struct({ + class: sts.number(), + instance: sts.number(), + owner: v700.AccountId32, + }) + ), + /** + * An `item` was destroyed. + */ + v9230: new EventType( + 'Uniques.Burned', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9230.AccountId32, + }) + ), +} + +export const frozen = { + name: 'Uniques.Frozen', + /** + * Some asset `instance` was frozen. \[ class, instance \] + */ + v1: new EventType( + 'Uniques.Frozen', + sts.tuple([v1.ClassId, v1.InstanceId]) + ), + /** + * Some asset `instance` was frozen. + */ + v700: new EventType( + 'Uniques.Frozen', + sts.struct({ + class: sts.number(), + instance: sts.number(), + }) + ), + /** + * Some `item` was frozen. + */ + v9230: new EventType( + 'Uniques.Frozen', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const thawed = { + name: 'Uniques.Thawed', + /** + * Some asset `instance` was thawed. \[ class, instance \] + */ + v1: new EventType( + 'Uniques.Thawed', + sts.tuple([v1.ClassId, v1.InstanceId]) + ), + /** + * Some asset `instance` was thawed. + */ + v700: new EventType( + 'Uniques.Thawed', + sts.struct({ + class: sts.number(), + instance: sts.number(), + }) + ), + /** + * Some `item` was thawed. + */ + v9230: new EventType( + 'Uniques.Thawed', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const classFrozen = { + name: 'Uniques.ClassFrozen', + /** + * Some asset `class` was frozen. \[ class \] + */ + v1: new EventType( + 'Uniques.ClassFrozen', + v1.ClassId + ), + /** + * Some asset `class` was frozen. + */ + v700: new EventType( + 'Uniques.ClassFrozen', + sts.struct({ + class: sts.number(), + }) + ), +} + +export const classThawed = { + name: 'Uniques.ClassThawed', + /** + * Some asset `class` was thawed. \[ class \] + */ + v1: new EventType( + 'Uniques.ClassThawed', + v1.ClassId + ), + /** + * Some asset `class` was thawed. + */ + v700: new EventType( + 'Uniques.ClassThawed', + sts.struct({ + class: sts.number(), + }) + ), +} + +export const ownerChanged = { + name: 'Uniques.OwnerChanged', + /** + * The owner changed \[ class, new_owner \] + */ + v1: new EventType( + 'Uniques.OwnerChanged', + sts.tuple([v1.ClassId, v1.AccountId]) + ), + /** + * The owner changed. + */ + v700: new EventType( + 'Uniques.OwnerChanged', + sts.struct({ + class: sts.number(), + newOwner: v700.AccountId32, + }) + ), + /** + * The owner changed. + */ + v9230: new EventType( + 'Uniques.OwnerChanged', + sts.struct({ + collection: sts.number(), + newOwner: v9230.AccountId32, + }) + ), +} + +export const teamChanged = { + name: 'Uniques.TeamChanged', + /** + * The management team changed \[ class, issuer, admin, freezer \] + */ + v1: new EventType( + 'Uniques.TeamChanged', + sts.tuple([v1.ClassId, v1.AccountId, v1.AccountId, v1.AccountId]) + ), + /** + * The management team changed. + */ + v700: new EventType( + 'Uniques.TeamChanged', + sts.struct({ + class: sts.number(), + issuer: v700.AccountId32, + admin: v700.AccountId32, + freezer: v700.AccountId32, + }) + ), + /** + * The management team changed. + */ + v9230: new EventType( + 'Uniques.TeamChanged', + sts.struct({ + collection: sts.number(), + issuer: v9230.AccountId32, + admin: v9230.AccountId32, + freezer: v9230.AccountId32, + }) + ), +} + +export const classMetadataSet = { + name: 'Uniques.ClassMetadataSet', + /** + * New metadata has been set for an asset class. \[ class, data, is_frozen \] + */ + v1: new EventType( + 'Uniques.ClassMetadataSet', + sts.tuple([v1.ClassId, sts.bytes(), sts.boolean()]) + ), + /** + * New metadata has been set for an asset class. + */ + v700: new EventType( + 'Uniques.ClassMetadataSet', + sts.struct({ + class: sts.number(), + data: v700.BoundedVec, + isFrozen: sts.boolean(), + }) + ), +} + +export const classMetadataCleared = { + name: 'Uniques.ClassMetadataCleared', + /** + * Metadata has been cleared for an asset class. \[ class \] + */ + v1: new EventType( + 'Uniques.ClassMetadataCleared', + v1.ClassId + ), + /** + * Metadata has been cleared for an asset class. + */ + v700: new EventType( + 'Uniques.ClassMetadataCleared', + sts.struct({ + class: sts.number(), + }) + ), +} + +export const metadataSet = { + name: 'Uniques.MetadataSet', + /** + * New metadata has been set for an asset instance. + * \[ class, instance, data, is_frozen \] + */ + v1: new EventType( + 'Uniques.MetadataSet', + sts.tuple([v1.ClassId, v1.InstanceId, sts.bytes(), sts.boolean()]) + ), + /** + * New metadata has been set for an asset instance. + */ + v700: new EventType( + 'Uniques.MetadataSet', + sts.struct({ + class: sts.number(), + instance: sts.number(), + data: v700.BoundedVec, + isFrozen: sts.boolean(), + }) + ), + /** + * New metadata has been set for an item. + */ + v9230: new EventType( + 'Uniques.MetadataSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + data: v9230.BoundedVec, + isFrozen: sts.boolean(), + }) + ), +} + +export const metadataCleared = { + name: 'Uniques.MetadataCleared', + /** + * Metadata has been cleared for an asset instance. \[ class, instance \] + */ + v1: new EventType( + 'Uniques.MetadataCleared', + sts.tuple([v1.ClassId, v1.InstanceId]) + ), + /** + * Metadata has been cleared for an asset instance. + */ + v700: new EventType( + 'Uniques.MetadataCleared', + sts.struct({ + class: sts.number(), + instance: sts.number(), + }) + ), + /** + * Metadata has been cleared for an item. + */ + v9230: new EventType( + 'Uniques.MetadataCleared', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const attributeSet = { + name: 'Uniques.AttributeSet', + /** + * New attribute metadata has been set for an asset class or instance. + * \[ class, maybe_instance, key, value \] + */ + v1: new EventType( + 'Uniques.AttributeSet', + sts.tuple([v1.ClassId, sts.option(() => v1.InstanceId), sts.bytes(), sts.bytes()]) + ), + /** + * New attribute metadata has been set for an asset class or instance. + */ + v700: new EventType( + 'Uniques.AttributeSet', + sts.struct({ + class: sts.number(), + maybeInstance: sts.option(() => sts.number()), + key: sts.bytes(), + value: sts.bytes(), + }) + ), + /** + * New attribute metadata has been set for a `collection` or `item`. + */ + v9230: new EventType( + 'Uniques.AttributeSet', + sts.struct({ + collection: sts.number(), + maybeItem: sts.option(() => sts.number()), + key: sts.bytes(), + value: sts.bytes(), + }) + ), +} + +export const attributeCleared = { + name: 'Uniques.AttributeCleared', + /** + * Attribute metadata has been cleared for an asset class or instance. + * \[ class, maybe_instance, key, maybe_value \] + */ + v1: new EventType( + 'Uniques.AttributeCleared', + sts.tuple([v1.ClassId, sts.option(() => v1.InstanceId), sts.bytes()]) + ), + /** + * Attribute metadata has been cleared for an asset class or instance. + */ + v700: new EventType( + 'Uniques.AttributeCleared', + sts.struct({ + class: sts.number(), + maybeInstance: sts.option(() => sts.number()), + key: sts.bytes(), + }) + ), + /** + * Attribute metadata has been cleared for a `collection` or `item`. + */ + v9230: new EventType( + 'Uniques.AttributeCleared', + sts.struct({ + collection: sts.number(), + maybeItem: sts.option(() => sts.number()), + key: sts.bytes(), + }) + ), +} + +export const ownershipAcceptanceChanged = { + name: 'Uniques.OwnershipAcceptanceChanged', + /** + * Ownership acceptance has changed for an account. + */ + v900: new EventType( + 'Uniques.OwnershipAcceptanceChanged', + sts.struct({ + who: v900.AccountId32, + maybeClass: sts.option(() => sts.number()), + }) + ), + /** + * Ownership acceptance has changed for an account. + */ + v9230: new EventType( + 'Uniques.OwnershipAcceptanceChanged', + sts.struct({ + who: v9230.AccountId32, + maybeCollection: sts.option(() => sts.number()), + }) + ), +} + +export const collectionFrozen = { + name: 'Uniques.CollectionFrozen', + /** + * Some `collection` was frozen. + */ + v9230: new EventType( + 'Uniques.CollectionFrozen', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const collectionThawed = { + name: 'Uniques.CollectionThawed', + /** + * Some `collection` was thawed. + */ + v9230: new EventType( + 'Uniques.CollectionThawed', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const collectionMetadataSet = { + name: 'Uniques.CollectionMetadataSet', + /** + * New metadata has been set for a `collection`. + */ + v9230: new EventType( + 'Uniques.CollectionMetadataSet', + sts.struct({ + collection: sts.number(), + data: v9230.BoundedVec, + isFrozen: sts.boolean(), + }) + ), +} + +export const collectionMetadataCleared = { + name: 'Uniques.CollectionMetadataCleared', + /** + * Metadata has been cleared for a `collection`. + */ + v9230: new EventType( + 'Uniques.CollectionMetadataCleared', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const collectionMaxSupplySet = { + name: 'Uniques.CollectionMaxSupplySet', + /** + * Max supply has been set for a collection. + */ + v9230: new EventType( + 'Uniques.CollectionMaxSupplySet', + sts.struct({ + collection: sts.number(), + maxSupply: sts.number(), + }) + ), +} + +export const itemPriceSet = { + name: 'Uniques.ItemPriceSet', + /** + * The price was set for the instance. + */ + v9270: new EventType( + 'Uniques.ItemPriceSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + price: sts.bigint(), + whitelistedBuyer: sts.option(() => v9270.AccountId32), + }) + ), +} + +export const itemPriceRemoved = { + name: 'Uniques.ItemPriceRemoved', + /** + * The price for the instance was removed. + */ + v9270: new EventType( + 'Uniques.ItemPriceRemoved', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const itemBought = { + name: 'Uniques.ItemBought', + /** + * An item was bought. + */ + v9270: new EventType( + 'Uniques.ItemBought', + sts.struct({ + collection: sts.number(), + item: sts.number(), + price: sts.bigint(), + seller: v9270.AccountId32, + buyer: v9270.AccountId32, + }) + ), +} diff --git a/src/types/kusama/uniques/storage.ts b/src/types/kusama/uniques/storage.ts new file mode 100644 index 00000000..996af485 --- /dev/null +++ b/src/types/kusama/uniques/storage.ts @@ -0,0 +1,76 @@ +import {sts, Block, Bytes, Option, Result, StorageType, RuntimeCtx} from '../support' +import * as v1 from '../v1' +import * as v9230 from '../v9230' + +export const class_ = { + /** + * Details of an asset class. + */ + v1: new StorageType('Uniques.Class', 'Optional', [v1.ClassId], v1.ClassDetails) as ClassV1, + /** + * Details of a collection. + */ + v9230: new StorageType('Uniques.Class', 'Optional', [sts.number()], v9230.CollectionDetails) as ClassV9230, +} + +/** + * Details of an asset class. + */ +export interface ClassV1 { + is(block: RuntimeCtx): boolean + get(block: Block, key: v1.ClassId): Promise<(v1.ClassDetails | undefined)> + getMany(block: Block, keys: v1.ClassId[]): Promise<(v1.ClassDetails | undefined)[]> + getKeys(block: Block): Promise + getKeys(block: Block, key: v1.ClassId): Promise + getKeysPaged(pageSize: number, block: Block): AsyncIterable + getKeysPaged(pageSize: number, block: Block, key: v1.ClassId): AsyncIterable + getPairs(block: Block): Promise<[k: v1.ClassId, v: (v1.ClassDetails | undefined)][]> + getPairs(block: Block, key: v1.ClassId): Promise<[k: v1.ClassId, v: (v1.ClassDetails | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: v1.ClassId, v: (v1.ClassDetails | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key: v1.ClassId): AsyncIterable<[k: v1.ClassId, v: (v1.ClassDetails | undefined)][]> +} + +/** + * Details of a collection. + */ +export interface ClassV9230 { + is(block: RuntimeCtx): boolean + get(block: Block, key: number): Promise<(v9230.CollectionDetails | undefined)> + getMany(block: Block, keys: number[]): Promise<(v9230.CollectionDetails | undefined)[]> + getKeys(block: Block): Promise + getKeys(block: Block, key: number): Promise + getKeysPaged(pageSize: number, block: Block): AsyncIterable + getKeysPaged(pageSize: number, block: Block, key: number): AsyncIterable + getPairs(block: Block): Promise<[k: number, v: (v9230.CollectionDetails | undefined)][]> + getPairs(block: Block, key: number): Promise<[k: number, v: (v9230.CollectionDetails | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: number, v: (v9230.CollectionDetails | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key: number): AsyncIterable<[k: number, v: (v9230.CollectionDetails | undefined)][]> +} + +export const instanceMetadataOf = { + /** + * Metadata of an asset instance. + */ + v1: new StorageType('Uniques.InstanceMetadataOf', 'Optional', [v1.ClassId, v1.InstanceId], v1.InstanceMetadata) as InstanceMetadataOfV1, +} + +/** + * Metadata of an asset instance. + */ +export interface InstanceMetadataOfV1 { + is(block: RuntimeCtx): boolean + get(block: Block, key1: v1.ClassId, key2: v1.InstanceId): Promise<(v1.InstanceMetadata | undefined)> + getMany(block: Block, keys: [v1.ClassId, v1.InstanceId][]): Promise<(v1.InstanceMetadata | undefined)[]> + getKeys(block: Block): Promise<[v1.ClassId, v1.InstanceId][]> + getKeys(block: Block, key1: v1.ClassId): Promise<[v1.ClassId, v1.InstanceId][]> + getKeys(block: Block, key1: v1.ClassId, key2: v1.InstanceId): Promise<[v1.ClassId, v1.InstanceId][]> + getKeysPaged(pageSize: number, block: Block): AsyncIterable<[v1.ClassId, v1.InstanceId][]> + getKeysPaged(pageSize: number, block: Block, key1: v1.ClassId): AsyncIterable<[v1.ClassId, v1.InstanceId][]> + getKeysPaged(pageSize: number, block: Block, key1: v1.ClassId, key2: v1.InstanceId): AsyncIterable<[v1.ClassId, v1.InstanceId][]> + getPairs(block: Block): Promise<[k: [v1.ClassId, v1.InstanceId], v: (v1.InstanceMetadata | undefined)][]> + getPairs(block: Block, key1: v1.ClassId): Promise<[k: [v1.ClassId, v1.InstanceId], v: (v1.InstanceMetadata | undefined)][]> + getPairs(block: Block, key1: v1.ClassId, key2: v1.InstanceId): Promise<[k: [v1.ClassId, v1.InstanceId], v: (v1.InstanceMetadata | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: [v1.ClassId, v1.InstanceId], v: (v1.InstanceMetadata | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key1: v1.ClassId): AsyncIterable<[k: [v1.ClassId, v1.InstanceId], v: (v1.InstanceMetadata | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key1: v1.ClassId, key2: v1.InstanceId): AsyncIterable<[k: [v1.ClassId, v1.InstanceId], v: (v1.InstanceMetadata | undefined)][]> +} diff --git a/src/types/kusama/v1.ts b/src/types/kusama/v1.ts new file mode 100644 index 00000000..67f35260 --- /dev/null +++ b/src/types/kusama/v1.ts @@ -0,0 +1,61 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export type InstanceId = number + +export interface InstanceMetadata { + deposit: DepositBalance + data: Bytes + isFrozen: boolean +} + +export type DepositBalance = bigint + +export const InstanceMetadata: sts.Type = sts.struct(() => { + return { + deposit: DepositBalance, + data: sts.bytes(), + isFrozen: sts.boolean(), + } +}) + +export const DepositBalance = sts.bigint() + +export type ClassId = number + +export interface ClassDetails { + owner: AccountId + issuer: AccountId + admin: AccountId + freezer: AccountId + totalDeposit: DepositBalance + freeHolding: boolean + instances: number + instanceMetadatas: number + attributes: number + isFrozen: boolean +} + +export type AccountId = Bytes + +export const ClassDetails: sts.Type = sts.struct(() => { + return { + owner: AccountId, + issuer: AccountId, + admin: AccountId, + freezer: AccountId, + totalDeposit: DepositBalance, + freeHolding: sts.boolean(), + instances: sts.number(), + instanceMetadatas: sts.number(), + attributes: sts.number(), + isFrozen: sts.boolean(), + } +}) + +export const InstanceId = sts.number() + +export const ClassId = sts.number() + +export const AccountId = sts.bytes() + +export const AssetId = sts.number() diff --git a/src/types/kusama/v700.ts b/src/types/kusama/v700.ts new file mode 100644 index 00000000..ff344c60 --- /dev/null +++ b/src/types/kusama/v700.ts @@ -0,0 +1,5 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export const BoundedVec = sts.bytes() + +export const AccountId32 = sts.bytes() diff --git a/src/types/kusama/v900.ts b/src/types/kusama/v900.ts new file mode 100644 index 00000000..f599ef29 --- /dev/null +++ b/src/types/kusama/v900.ts @@ -0,0 +1,3 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export const AccountId32 = sts.bytes() diff --git a/src/types/kusama/v9230.ts b/src/types/kusama/v9230.ts new file mode 100644 index 00000000..ba42f2a3 --- /dev/null +++ b/src/types/kusama/v9230.ts @@ -0,0 +1,35 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export interface CollectionDetails { + owner: AccountId32 + issuer: AccountId32 + admin: AccountId32 + freezer: AccountId32 + totalDeposit: bigint + freeHolding: boolean + items: number + itemMetadatas: number + attributes: number + isFrozen: boolean +} + +export type AccountId32 = Bytes + +export const CollectionDetails: sts.Type = sts.struct(() => { + return { + owner: AccountId32, + issuer: AccountId32, + admin: AccountId32, + freezer: AccountId32, + totalDeposit: sts.bigint(), + freeHolding: sts.boolean(), + items: sts.number(), + itemMetadatas: sts.number(), + attributes: sts.number(), + isFrozen: sts.boolean(), + } +}) + +export const BoundedVec = sts.bytes() + +export const AccountId32 = sts.bytes() diff --git a/src/types/kusama/v9270.ts b/src/types/kusama/v9270.ts new file mode 100644 index 00000000..f599ef29 --- /dev/null +++ b/src/types/kusama/v9270.ts @@ -0,0 +1,3 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export const AccountId32 = sts.bytes() diff --git a/src/types/kusama/v9420.ts b/src/types/kusama/v9420.ts new file mode 100644 index 00000000..eb95f1bc --- /dev/null +++ b/src/types/kusama/v9420.ts @@ -0,0 +1,160 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export interface Type_358 { + deposit: ItemMetadataDeposit + data: Bytes +} + +export interface ItemMetadataDeposit { + account?: (AccountId32 | undefined) + amount: bigint +} + +export type AccountId32 = Bytes + +export const Type_358: sts.Type = sts.struct(() => { + return { + deposit: ItemMetadataDeposit, + data: sts.bytes(), + } +}) + +export const ItemMetadataDeposit: sts.Type = sts.struct(() => { + return { + account: sts.option(() => AccountId32), + amount: sts.bigint(), + } +}) + +export interface Type_348 { + owner: AccountId32 + ownerDeposit: bigint + items: number + itemMetadatas: number + itemConfigs: number + attributes: number +} + +export const Type_348: sts.Type = sts.struct(() => { + return { + owner: AccountId32, + ownerDeposit: sts.bigint(), + items: sts.number(), + itemMetadatas: sts.number(), + itemConfigs: sts.number(), + attributes: sts.number(), + } +}) + +export const MintSettings: sts.Type = sts.struct(() => { + return { + mintType: MintType, + price: sts.option(() => sts.bigint()), + startBlock: sts.option(() => sts.number()), + endBlock: sts.option(() => sts.number()), + defaultItemSettings: sts.bigint(), + } +}) + +export const MintType: sts.Type = sts.closedEnum(() => { + return { + HolderOf: sts.number(), + Issuer: sts.unit(), + Public: sts.unit(), + } +}) + +export type MintType = MintType_HolderOf | MintType_Issuer | MintType_Public + +export interface MintType_HolderOf { + __kind: 'HolderOf' + value: number +} + +export interface MintType_Issuer { + __kind: 'Issuer' +} + +export interface MintType_Public { + __kind: 'Public' +} + +export interface MintSettings { + mintType: MintType + price?: (bigint | undefined) + startBlock?: (number | undefined) + endBlock?: (number | undefined) + defaultItemSettings: bigint +} + +export const PalletAttributes: sts.Type = sts.closedEnum(() => { + return { + UsedToClaim: sts.number(), + } +}) + +export type PalletAttributes = PalletAttributes_UsedToClaim + +export interface PalletAttributes_UsedToClaim { + __kind: 'UsedToClaim' + value: number +} + +export const PriceWithDirection: sts.Type = sts.struct(() => { + return { + amount: sts.bigint(), + direction: PriceDirection, + } +}) + +export const PriceDirection: sts.Type = sts.closedEnum(() => { + return { + Receive: sts.unit(), + Send: sts.unit(), + } +}) + +export type PriceDirection = PriceDirection_Receive | PriceDirection_Send + +export interface PriceDirection_Receive { + __kind: 'Receive' +} + +export interface PriceDirection_Send { + __kind: 'Send' +} + +export interface PriceWithDirection { + amount: bigint + direction: PriceDirection +} + +export const AttributeNamespace: sts.Type = sts.closedEnum(() => { + return { + Account: AccountId32, + CollectionOwner: sts.unit(), + ItemOwner: sts.unit(), + Pallet: sts.unit(), + } +}) + +export type AttributeNamespace = AttributeNamespace_Account | AttributeNamespace_CollectionOwner | AttributeNamespace_ItemOwner | AttributeNamespace_Pallet + +export interface AttributeNamespace_Account { + __kind: 'Account' + value: AccountId32 +} + +export interface AttributeNamespace_CollectionOwner { + __kind: 'CollectionOwner' +} + +export interface AttributeNamespace_ItemOwner { + __kind: 'ItemOwner' +} + +export interface AttributeNamespace_Pallet { + __kind: 'Pallet' +} + +export const AccountId32 = sts.bytes() diff --git a/src/types/kusama/v9430.ts b/src/types/kusama/v9430.ts new file mode 100644 index 00000000..ec5e8c32 --- /dev/null +++ b/src/types/kusama/v9430.ts @@ -0,0 +1,19 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export const PalletAttributes: sts.Type = sts.closedEnum(() => { + return { + TransferDisabled: sts.unit(), + UsedToClaim: sts.number(), + } +}) + +export type PalletAttributes = PalletAttributes_TransferDisabled | PalletAttributes_UsedToClaim + +export interface PalletAttributes_TransferDisabled { + __kind: 'TransferDisabled' +} + +export interface PalletAttributes_UsedToClaim { + __kind: 'UsedToClaim' + value: number +} diff --git a/src/types/polkadot/assets/events.ts b/src/types/polkadot/assets/events.ts new file mode 100644 index 00000000..db81d756 --- /dev/null +++ b/src/types/polkadot/assets/events.ts @@ -0,0 +1,110 @@ +import {sts, Block, Bytes, Option, Result, EventType, RuntimeCtx} from '../support' +import * as v601 from '../v601' +import * as v700 from '../v700' + +export const created = { + name: 'Assets.Created', + /** + * Some asset class was created. \[asset_id, creator, owner\] + */ + v601: new EventType( + 'Assets.Created', + sts.tuple([sts.number(), v601.AccountId32, v601.AccountId32]) + ), + /** + * Some asset class was created. + */ + v700: new EventType( + 'Assets.Created', + sts.struct({ + assetId: sts.number(), + creator: v700.AccountId32, + owner: v700.AccountId32, + }) + ), +} + +export const destroyed = { + name: 'Assets.Destroyed', + /** + * An asset class was destroyed. + */ + v601: new EventType( + 'Assets.Destroyed', + sts.number() + ), + /** + * An asset class was destroyed. + */ + v700: new EventType( + 'Assets.Destroyed', + sts.struct({ + assetId: sts.number(), + }) + ), +} + +export const forceCreated = { + name: 'Assets.ForceCreated', + /** + * Some asset class was force-created. \[asset_id, owner\] + */ + v601: new EventType( + 'Assets.ForceCreated', + sts.tuple([sts.number(), v601.AccountId32]) + ), + /** + * Some asset class was force-created. + */ + v700: new EventType( + 'Assets.ForceCreated', + sts.struct({ + assetId: sts.number(), + owner: v700.AccountId32, + }) + ), +} + +export const metadataSet = { + name: 'Assets.MetadataSet', + /** + * New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\] + */ + v601: new EventType( + 'Assets.MetadataSet', + sts.tuple([sts.number(), sts.bytes(), sts.bytes(), sts.number(), sts.boolean()]) + ), + /** + * New metadata has been set for an asset. + */ + v700: new EventType( + 'Assets.MetadataSet', + sts.struct({ + assetId: sts.number(), + name: sts.bytes(), + symbol: sts.bytes(), + decimals: sts.number(), + isFrozen: sts.boolean(), + }) + ), +} + +export const metadataCleared = { + name: 'Assets.MetadataCleared', + /** + * Metadata has been cleared for an asset. \[asset_id\] + */ + v601: new EventType( + 'Assets.MetadataCleared', + sts.number() + ), + /** + * Metadata has been cleared for an asset. + */ + v700: new EventType( + 'Assets.MetadataCleared', + sts.struct({ + assetId: sts.number(), + }) + ), +} diff --git a/src/types/polkadot/calls.ts b/src/types/polkadot/calls.ts new file mode 100644 index 00000000..4928f311 --- /dev/null +++ b/src/types/polkadot/calls.ts @@ -0,0 +1 @@ +export * as nfts from './nfts/calls' diff --git a/src/types/polkadot/events.ts b/src/types/polkadot/events.ts new file mode 100644 index 00000000..8479950d --- /dev/null +++ b/src/types/polkadot/events.ts @@ -0,0 +1,3 @@ +export * as assets from './assets/events' +export * as uniques from './uniques/events' +export * as nfts from './nfts/events' diff --git a/src/types/polkadot/index.ts b/src/types/polkadot/index.ts new file mode 100644 index 00000000..e19e89c2 --- /dev/null +++ b/src/types/polkadot/index.ts @@ -0,0 +1,9 @@ +export * as v601 from './v601' +export * as v700 from './v700' +export * as v9230 from './v9230' +export * as v900 from './v900' +export * as v9270 from './v9270' +export * as v9430 from './v9430' +export * as events from './events' +export * as calls from './calls' +export * as storage from './storage' diff --git a/src/types/polkadot/nfts/calls.ts b/src/types/polkadot/nfts/calls.ts new file mode 100644 index 00000000..039027c0 --- /dev/null +++ b/src/types/polkadot/nfts/calls.ts @@ -0,0 +1,24 @@ +import {sts, Block, Bytes, Option, Result, CallType, RuntimeCtx} from '../support' +import * as v9430 from '../v9430' + +export const updateMintSettings = { + name: 'Nfts.update_mint_settings', + /** + * Update mint settings. + * + * Origin must be either `ForceOrigin` or `Signed` and the sender should be the Issuer + * of the `collection`. + * + * - `collection`: The identifier of the collection to change. + * - `mint_settings`: The new mint settings. + * + * Emits `CollectionMintSettingsUpdated` event when successful. + */ + v9430: new CallType( + 'Nfts.update_mint_settings', + sts.struct({ + collection: sts.number(), + mintSettings: v9430.MintSettings, + }) + ), +} diff --git a/src/types/polkadot/nfts/events.ts b/src/types/polkadot/nfts/events.ts new file mode 100644 index 00000000..a7a50311 --- /dev/null +++ b/src/types/polkadot/nfts/events.ts @@ -0,0 +1,574 @@ +import {sts, Block, Bytes, Option, Result, EventType, RuntimeCtx} from '../support' +import * as v9430 from '../v9430' + +export const created = { + name: 'Nfts.Created', + /** + * A `collection` was created. + */ + v9430: new EventType( + 'Nfts.Created', + sts.struct({ + collection: sts.number(), + creator: v9430.AccountId32, + owner: v9430.AccountId32, + }) + ), +} + +export const forceCreated = { + name: 'Nfts.ForceCreated', + /** + * A `collection` was force-created. + */ + v9430: new EventType( + 'Nfts.ForceCreated', + sts.struct({ + collection: sts.number(), + owner: v9430.AccountId32, + }) + ), +} + +export const destroyed = { + name: 'Nfts.Destroyed', + /** + * A `collection` was destroyed. + */ + v9430: new EventType( + 'Nfts.Destroyed', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const issued = { + name: 'Nfts.Issued', + /** + * An `item` was issued. + */ + v9430: new EventType( + 'Nfts.Issued', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9430.AccountId32, + }) + ), +} + +export const transferred = { + name: 'Nfts.Transferred', + /** + * An `item` was transferred. + */ + v9430: new EventType( + 'Nfts.Transferred', + sts.struct({ + collection: sts.number(), + item: sts.number(), + from: v9430.AccountId32, + to: v9430.AccountId32, + }) + ), +} + +export const burned = { + name: 'Nfts.Burned', + /** + * An `item` was destroyed. + */ + v9430: new EventType( + 'Nfts.Burned', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9430.AccountId32, + }) + ), +} + +export const itemTransferLocked = { + name: 'Nfts.ItemTransferLocked', + /** + * An `item` became non-transferable. + */ + v9430: new EventType( + 'Nfts.ItemTransferLocked', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const itemTransferUnlocked = { + name: 'Nfts.ItemTransferUnlocked', + /** + * An `item` became transferable. + */ + v9430: new EventType( + 'Nfts.ItemTransferUnlocked', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const itemPropertiesLocked = { + name: 'Nfts.ItemPropertiesLocked', + /** + * `item` metadata or attributes were locked. + */ + v9430: new EventType( + 'Nfts.ItemPropertiesLocked', + sts.struct({ + collection: sts.number(), + item: sts.number(), + lockMetadata: sts.boolean(), + lockAttributes: sts.boolean(), + }) + ), +} + +export const collectionLocked = { + name: 'Nfts.CollectionLocked', + /** + * Some `collection` was locked. + */ + v9430: new EventType( + 'Nfts.CollectionLocked', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const ownerChanged = { + name: 'Nfts.OwnerChanged', + /** + * The owner changed. + */ + v9430: new EventType( + 'Nfts.OwnerChanged', + sts.struct({ + collection: sts.number(), + newOwner: v9430.AccountId32, + }) + ), +} + +export const teamChanged = { + name: 'Nfts.TeamChanged', + /** + * The management team changed. + */ + v9430: new EventType( + 'Nfts.TeamChanged', + sts.struct({ + collection: sts.number(), + issuer: sts.option(() => v9430.AccountId32), + admin: sts.option(() => v9430.AccountId32), + freezer: sts.option(() => v9430.AccountId32), + }) + ), +} + +export const transferApproved = { + name: 'Nfts.TransferApproved', + /** + * An `item` of a `collection` has been approved by the `owner` for transfer by + * a `delegate`. + */ + v9430: new EventType( + 'Nfts.TransferApproved', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9430.AccountId32, + delegate: v9430.AccountId32, + deadline: sts.option(() => sts.number()), + }) + ), +} + +export const approvalCancelled = { + name: 'Nfts.ApprovalCancelled', + /** + * An approval for a `delegate` account to transfer the `item` of an item + * `collection` was cancelled by its `owner`. + */ + v9430: new EventType( + 'Nfts.ApprovalCancelled', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9430.AccountId32, + delegate: v9430.AccountId32, + }) + ), +} + +export const allApprovalsCancelled = { + name: 'Nfts.AllApprovalsCancelled', + /** + * All approvals of an item got cancelled. + */ + v9430: new EventType( + 'Nfts.AllApprovalsCancelled', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9430.AccountId32, + }) + ), +} + +export const collectionConfigChanged = { + name: 'Nfts.CollectionConfigChanged', + /** + * A `collection` has had its config changed by the `Force` origin. + */ + v9430: new EventType( + 'Nfts.CollectionConfigChanged', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const collectionMetadataSet = { + name: 'Nfts.CollectionMetadataSet', + /** + * New metadata has been set for a `collection`. + */ + v9430: new EventType( + 'Nfts.CollectionMetadataSet', + sts.struct({ + collection: sts.number(), + data: sts.bytes(), + }) + ), +} + +export const collectionMetadataCleared = { + name: 'Nfts.CollectionMetadataCleared', + /** + * Metadata has been cleared for a `collection`. + */ + v9430: new EventType( + 'Nfts.CollectionMetadataCleared', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const itemMetadataSet = { + name: 'Nfts.ItemMetadataSet', + /** + * New metadata has been set for an item. + */ + v9430: new EventType( + 'Nfts.ItemMetadataSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + data: sts.bytes(), + }) + ), +} + +export const itemMetadataCleared = { + name: 'Nfts.ItemMetadataCleared', + /** + * Metadata has been cleared for an item. + */ + v9430: new EventType( + 'Nfts.ItemMetadataCleared', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const attributeSet = { + name: 'Nfts.AttributeSet', + /** + * New attribute metadata has been set for a `collection` or `item`. + */ + v9430: new EventType( + 'Nfts.AttributeSet', + sts.struct({ + collection: sts.number(), + maybeItem: sts.option(() => sts.number()), + key: sts.bytes(), + value: sts.bytes(), + namespace: v9430.AttributeNamespace, + }) + ), +} + +export const attributeCleared = { + name: 'Nfts.AttributeCleared', + /** + * Attribute metadata has been cleared for a `collection` or `item`. + */ + v9430: new EventType( + 'Nfts.AttributeCleared', + sts.struct({ + collection: sts.number(), + maybeItem: sts.option(() => sts.number()), + key: sts.bytes(), + namespace: v9430.AttributeNamespace, + }) + ), +} + +export const itemAttributesApprovalAdded = { + name: 'Nfts.ItemAttributesApprovalAdded', + /** + * A new approval to modify item attributes was added. + */ + v9430: new EventType( + 'Nfts.ItemAttributesApprovalAdded', + sts.struct({ + collection: sts.number(), + item: sts.number(), + delegate: v9430.AccountId32, + }) + ), +} + +export const itemAttributesApprovalRemoved = { + name: 'Nfts.ItemAttributesApprovalRemoved', + /** + * A new approval to modify item attributes was removed. + */ + v9430: new EventType( + 'Nfts.ItemAttributesApprovalRemoved', + sts.struct({ + collection: sts.number(), + item: sts.number(), + delegate: v9430.AccountId32, + }) + ), +} + +export const ownershipAcceptanceChanged = { + name: 'Nfts.OwnershipAcceptanceChanged', + /** + * Ownership acceptance has changed for an account. + */ + v9430: new EventType( + 'Nfts.OwnershipAcceptanceChanged', + sts.struct({ + who: v9430.AccountId32, + maybeCollection: sts.option(() => sts.number()), + }) + ), +} + +export const collectionMaxSupplySet = { + name: 'Nfts.CollectionMaxSupplySet', + /** + * Max supply has been set for a collection. + */ + v9430: new EventType( + 'Nfts.CollectionMaxSupplySet', + sts.struct({ + collection: sts.number(), + maxSupply: sts.number(), + }) + ), +} + +export const collectionMintSettingsUpdated = { + name: 'Nfts.CollectionMintSettingsUpdated', + /** + * Mint settings for a collection had changed. + */ + v9430: new EventType( + 'Nfts.CollectionMintSettingsUpdated', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const nextCollectionIdIncremented = { + name: 'Nfts.NextCollectionIdIncremented', + /** + * Event gets emitted when the `NextCollectionId` gets incremented. + */ + v9430: new EventType( + 'Nfts.NextCollectionIdIncremented', + sts.struct({ + nextId: sts.number(), + }) + ), + /** + * Event gets emitted when the `NextCollectionId` gets incremented. + */ + v1000000: new EventType( + 'Nfts.NextCollectionIdIncremented', + sts.struct({ + nextId: sts.option(() => sts.number()), + }) + ), +} + +export const itemPriceSet = { + name: 'Nfts.ItemPriceSet', + /** + * The price was set for the item. + */ + v9430: new EventType( + 'Nfts.ItemPriceSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + price: sts.bigint(), + whitelistedBuyer: sts.option(() => v9430.AccountId32), + }) + ), +} + +export const itemPriceRemoved = { + name: 'Nfts.ItemPriceRemoved', + /** + * The price for the item was removed. + */ + v9430: new EventType( + 'Nfts.ItemPriceRemoved', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const itemBought = { + name: 'Nfts.ItemBought', + /** + * An item was bought. + */ + v9430: new EventType( + 'Nfts.ItemBought', + sts.struct({ + collection: sts.number(), + item: sts.number(), + price: sts.bigint(), + seller: v9430.AccountId32, + buyer: v9430.AccountId32, + }) + ), +} + +export const tipSent = { + name: 'Nfts.TipSent', + /** + * A tip was sent. + */ + v9430: new EventType( + 'Nfts.TipSent', + sts.struct({ + collection: sts.number(), + item: sts.number(), + sender: v9430.AccountId32, + receiver: v9430.AccountId32, + amount: sts.bigint(), + }) + ), +} + +export const swapCreated = { + name: 'Nfts.SwapCreated', + /** + * An `item` swap intent was created. + */ + v9430: new EventType( + 'Nfts.SwapCreated', + sts.struct({ + offeredCollection: sts.number(), + offeredItem: sts.number(), + desiredCollection: sts.number(), + desiredItem: sts.option(() => sts.number()), + price: sts.option(() => v9430.PriceWithDirection), + deadline: sts.number(), + }) + ), +} + +export const swapCancelled = { + name: 'Nfts.SwapCancelled', + /** + * The swap was cancelled. + */ + v9430: new EventType( + 'Nfts.SwapCancelled', + sts.struct({ + offeredCollection: sts.number(), + offeredItem: sts.number(), + desiredCollection: sts.number(), + desiredItem: sts.option(() => sts.number()), + price: sts.option(() => v9430.PriceWithDirection), + deadline: sts.number(), + }) + ), +} + +export const swapClaimed = { + name: 'Nfts.SwapClaimed', + /** + * The swap has been claimed. + */ + v9430: new EventType( + 'Nfts.SwapClaimed', + sts.struct({ + sentCollection: sts.number(), + sentItem: sts.number(), + sentItemOwner: v9430.AccountId32, + receivedCollection: sts.number(), + receivedItem: sts.number(), + receivedItemOwner: v9430.AccountId32, + price: sts.option(() => v9430.PriceWithDirection), + deadline: sts.number(), + }) + ), +} + +export const preSignedAttributesSet = { + name: 'Nfts.PreSignedAttributesSet', + /** + * New attributes have been set for an `item` of the `collection`. + */ + v9430: new EventType( + 'Nfts.PreSignedAttributesSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + namespace: v9430.AttributeNamespace, + }) + ), +} + +export const palletAttributeSet = { + name: 'Nfts.PalletAttributeSet', + /** + * A new attribute in the `Pallet` namespace was set for the `collection` or an `item` + * within that `collection`. + */ + v9430: new EventType( + 'Nfts.PalletAttributeSet', + sts.struct({ + collection: sts.number(), + item: sts.option(() => sts.number()), + attribute: v9430.PalletAttributes, + value: sts.bytes(), + }) + ), +} diff --git a/src/types/polkadot/nfts/storage.ts b/src/types/polkadot/nfts/storage.ts new file mode 100644 index 00000000..bd887c46 --- /dev/null +++ b/src/types/polkadot/nfts/storage.ts @@ -0,0 +1,54 @@ +import {sts, Block, Bytes, Option, Result, StorageType, RuntimeCtx} from '../support' +import * as v9430 from '../v9430' + +export const collection = { + /** + * Details of a collection. + */ + v9430: new StorageType('Nfts.Collection', 'Optional', [sts.number()], v9430.Type_353) as CollectionV9430, +} + +/** + * Details of a collection. + */ +export interface CollectionV9430 { + is(block: RuntimeCtx): boolean + get(block: Block, key: number): Promise<(v9430.Type_353 | undefined)> + getMany(block: Block, keys: number[]): Promise<(v9430.Type_353 | undefined)[]> + getKeys(block: Block): Promise + getKeys(block: Block, key: number): Promise + getKeysPaged(pageSize: number, block: Block): AsyncIterable + getKeysPaged(pageSize: number, block: Block, key: number): AsyncIterable + getPairs(block: Block): Promise<[k: number, v: (v9430.Type_353 | undefined)][]> + getPairs(block: Block, key: number): Promise<[k: number, v: (v9430.Type_353 | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: number, v: (v9430.Type_353 | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key: number): AsyncIterable<[k: number, v: (v9430.Type_353 | undefined)][]> +} + +export const itemMetadataOf = { + /** + * Metadata of an item. + */ + v9430: new StorageType('Nfts.ItemMetadataOf', 'Optional', [sts.number(), sts.number()], v9430.Type_363) as ItemMetadataOfV9430, +} + +/** + * Metadata of an item. + */ +export interface ItemMetadataOfV9430 { + is(block: RuntimeCtx): boolean + get(block: Block, key1: number, key2: number): Promise<(v9430.Type_363 | undefined)> + getMany(block: Block, keys: [number, number][]): Promise<(v9430.Type_363 | undefined)[]> + getKeys(block: Block): Promise<[number, number][]> + getKeys(block: Block, key1: number): Promise<[number, number][]> + getKeys(block: Block, key1: number, key2: number): Promise<[number, number][]> + getKeysPaged(pageSize: number, block: Block): AsyncIterable<[number, number][]> + getKeysPaged(pageSize: number, block: Block, key1: number): AsyncIterable<[number, number][]> + getKeysPaged(pageSize: number, block: Block, key1: number, key2: number): AsyncIterable<[number, number][]> + getPairs(block: Block): Promise<[k: [number, number], v: (v9430.Type_363 | undefined)][]> + getPairs(block: Block, key1: number): Promise<[k: [number, number], v: (v9430.Type_363 | undefined)][]> + getPairs(block: Block, key1: number, key2: number): Promise<[k: [number, number], v: (v9430.Type_363 | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: [number, number], v: (v9430.Type_363 | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key1: number): AsyncIterable<[k: [number, number], v: (v9430.Type_363 | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key1: number, key2: number): AsyncIterable<[k: [number, number], v: (v9430.Type_363 | undefined)][]> +} diff --git a/src/types/polkadot/storage.ts b/src/types/polkadot/storage.ts new file mode 100644 index 00000000..6a7fa0fc --- /dev/null +++ b/src/types/polkadot/storage.ts @@ -0,0 +1,2 @@ +export * as uniques from './uniques/storage' +export * as nfts from './nfts/storage' diff --git a/src/types/polkadot/support.ts b/src/types/polkadot/support.ts new file mode 100644 index 00000000..456dfc2f --- /dev/null +++ b/src/types/polkadot/support.ts @@ -0,0 +1,142 @@ +import type {BitSequence, Bytes, QualifiedName, Runtime} from '@subsquid/substrate-runtime' +import * as sts from '@subsquid/substrate-runtime/lib/sts' +import {Option, Result} from '@subsquid/substrate-runtime/lib/sts' +import assert from 'assert' + + +export {sts, Bytes, BitSequence, Option, Result} + + +export interface RuntimeCtx { + _runtime: Runtime +} + + +export interface Block extends RuntimeCtx { + hash: Bytes + height: number +} + + +interface Event { + block: RuntimeCtx + name: QualifiedName + args: unknown +} + + +interface Call { + block: RuntimeCtx + name: QualifiedName + args: unknown +} + + +export class EventType { + constructor(public readonly name: QualifiedName, private type: T) {} + + matches(block: RuntimeCtx): boolean { + return block._runtime.events.checkType(this.name, this.type) + } + + is(event: Event): boolean { + return this.name == event.name && this.matches(event.block) + } + + decode(event: Event): sts.GetType { + assert(this.is(event)) + return event.block._runtime.decodeJsonEventRecordArguments(event) + } +} + + +export class CallType { + constructor(public readonly name: QualifiedName, private type: T) {} + + matches(block: RuntimeCtx): boolean { + return block._runtime.calls.checkType(this.name, this.type) + } + + is(call: Call): boolean { + return this.name == call.name && this.matches(call.block) + } + + decode(call: Call): sts.GetType { + assert(this.is(call)) + return call.block._runtime.decodeJsonCallRecordArguments(call) + } +} + + +export class ConstantType { + constructor(private name: QualifiedName, private type: T) {} + + is(block: RuntimeCtx): boolean { + return block._runtime.checkConstantType(this.name, this.type) + } + + get(block: RuntimeCtx): sts.GetType { + assert(this.is(block)) + return block._runtime.getConstant(this.name) + } +} + + +export class StorageType { + constructor( + private name: QualifiedName, + private modifier: 'Required' | 'Optional' | 'Default', + private key: sts.Type[], + private value: sts.Type + ) {} + + is(block: RuntimeCtx): boolean { + return block._runtime.checkStorageType(this.name, this.modifier, this.key, this.value) + } + + async get(block: Block, ...key: any[]): Promise { + assert(this.is(block)) + return block._runtime.getStorage(block.hash, this.name, ...key) + } + + async getAll(block: Block): Promise { + assert(this.is(block)) + return block._runtime.queryStorage(block.hash, this.name) + } + + async getMany(block: Block, keys: any[]): Promise { + assert(this.is(block)) + return block._runtime.queryStorage(block.hash, this.name, keys) + } + + async getKeys(block: Block, ...args: any[]): Promise { + assert(this.is(block)) + return block._runtime.getStorageKeys(block.hash, this.name, ...args) + } + + async getRawKeys(block: Block, ...args: any[]): Promise { + assert(this.is(block)) + return block._runtime.getStorageRawKeys(block.hash, this.name, ...args) + } + + getKeysPaged(pageSize: number, block: Block, ...args: any[]): AsyncIterable { + assert(this.is(block)) + return block._runtime.getStorageKeysPaged(pageSize, block.hash, this.name, ...args) + } + + async getPairs(block: Block, ...args: any[]): Promise<[key: any, value: any][]> { + assert(this.is(block)) + return block._runtime.getStoragePairs(block.hash, this.name, ...args) + } + + getPairsPaged(pageSize: number, block: Block, ...args: any[]): AsyncIterable<[key: any, value: any][]> { + assert(this.is(block)) + return block._runtime.getStoragePairsPaged(pageSize, block.hash, this.name, ...args) + } + + getDefault(block: Block): any { + assert(this.modifier == 'Default') + assert(this.is(block)) + return block._runtime.getStorageFallback(this.name) + } +} diff --git a/src/types/polkadot/uniques/events.ts b/src/types/polkadot/uniques/events.ts new file mode 100644 index 00000000..6240bb18 --- /dev/null +++ b/src/types/polkadot/uniques/events.ts @@ -0,0 +1,686 @@ +import {sts, Block, Bytes, Option, Result, EventType, RuntimeCtx} from '../support' +import * as v601 from '../v601' +import * as v700 from '../v700' +import * as v900 from '../v900' +import * as v9230 from '../v9230' +import * as v9270 from '../v9270' + +export const created = { + name: 'Uniques.Created', + /** + * An asset class was created. \[ class, creator, owner \] + */ + v601: new EventType( + 'Uniques.Created', + sts.tuple([sts.number(), v601.AccountId32, v601.AccountId32]) + ), + /** + * An asset class was created. + */ + v700: new EventType( + 'Uniques.Created', + sts.struct({ + class: sts.number(), + creator: v700.AccountId32, + owner: v700.AccountId32, + }) + ), + /** + * A `collection` was created. + */ + v9230: new EventType( + 'Uniques.Created', + sts.struct({ + collection: sts.number(), + creator: v9230.AccountId32, + owner: v9230.AccountId32, + }) + ), +} + +export const forceCreated = { + name: 'Uniques.ForceCreated', + /** + * An asset class was force-created. \[ class, owner \] + */ + v601: new EventType( + 'Uniques.ForceCreated', + sts.tuple([sts.number(), v601.AccountId32]) + ), + /** + * An asset class was force-created. + */ + v700: new EventType( + 'Uniques.ForceCreated', + sts.struct({ + class: sts.number(), + owner: v700.AccountId32, + }) + ), + /** + * A `collection` was force-created. + */ + v9230: new EventType( + 'Uniques.ForceCreated', + sts.struct({ + collection: sts.number(), + owner: v9230.AccountId32, + }) + ), +} + +export const destroyed = { + name: 'Uniques.Destroyed', + /** + * An asset `class` was destroyed. \[ class \] + */ + v601: new EventType( + 'Uniques.Destroyed', + sts.number() + ), + /** + * An asset `class` was destroyed. + */ + v700: new EventType( + 'Uniques.Destroyed', + sts.struct({ + class: sts.number(), + }) + ), + /** + * A `collection` was destroyed. + */ + v9230: new EventType( + 'Uniques.Destroyed', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const issued = { + name: 'Uniques.Issued', + /** + * An asset `instance` was issued. \[ class, instance, owner \] + */ + v601: new EventType( + 'Uniques.Issued', + sts.tuple([sts.number(), sts.number(), v601.AccountId32]) + ), + /** + * An asset `instance` was issued. + */ + v700: new EventType( + 'Uniques.Issued', + sts.struct({ + class: sts.number(), + instance: sts.number(), + owner: v700.AccountId32, + }) + ), + /** + * An `item` was issued. + */ + v9230: new EventType( + 'Uniques.Issued', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9230.AccountId32, + }) + ), +} + +export const transferred = { + name: 'Uniques.Transferred', + /** + * An asset `instance` was transferred. \[ class, instance, from, to \] + */ + v601: new EventType( + 'Uniques.Transferred', + sts.tuple([sts.number(), sts.number(), v601.AccountId32, v601.AccountId32]) + ), + /** + * An asset `instance` was transferred. + */ + v700: new EventType( + 'Uniques.Transferred', + sts.struct({ + class: sts.number(), + instance: sts.number(), + from: v700.AccountId32, + to: v700.AccountId32, + }) + ), + /** + * An `item` was transferred. + */ + v9230: new EventType( + 'Uniques.Transferred', + sts.struct({ + collection: sts.number(), + item: sts.number(), + from: v9230.AccountId32, + to: v9230.AccountId32, + }) + ), +} + +export const burned = { + name: 'Uniques.Burned', + /** + * An asset `instance` was destroyed. \[ class, instance, owner \] + */ + v601: new EventType( + 'Uniques.Burned', + sts.tuple([sts.number(), sts.number(), v601.AccountId32]) + ), + /** + * An asset `instance` was destroyed. + */ + v700: new EventType( + 'Uniques.Burned', + sts.struct({ + class: sts.number(), + instance: sts.number(), + owner: v700.AccountId32, + }) + ), + /** + * An `item` was destroyed. + */ + v9230: new EventType( + 'Uniques.Burned', + sts.struct({ + collection: sts.number(), + item: sts.number(), + owner: v9230.AccountId32, + }) + ), +} + +export const frozen = { + name: 'Uniques.Frozen', + /** + * Some asset `instance` was frozen. \[ class, instance \] + */ + v601: new EventType( + 'Uniques.Frozen', + sts.tuple([sts.number(), sts.number()]) + ), + /** + * Some asset `instance` was frozen. + */ + v700: new EventType( + 'Uniques.Frozen', + sts.struct({ + class: sts.number(), + instance: sts.number(), + }) + ), + /** + * Some `item` was frozen. + */ + v9230: new EventType( + 'Uniques.Frozen', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const thawed = { + name: 'Uniques.Thawed', + /** + * Some asset `instance` was thawed. \[ class, instance \] + */ + v601: new EventType( + 'Uniques.Thawed', + sts.tuple([sts.number(), sts.number()]) + ), + /** + * Some asset `instance` was thawed. + */ + v700: new EventType( + 'Uniques.Thawed', + sts.struct({ + class: sts.number(), + instance: sts.number(), + }) + ), + /** + * Some `item` was thawed. + */ + v9230: new EventType( + 'Uniques.Thawed', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const classFrozen = { + name: 'Uniques.ClassFrozen', + /** + * Some asset `class` was frozen. \[ class \] + */ + v601: new EventType( + 'Uniques.ClassFrozen', + sts.number() + ), + /** + * Some asset `class` was frozen. + */ + v700: new EventType( + 'Uniques.ClassFrozen', + sts.struct({ + class: sts.number(), + }) + ), +} + +export const classThawed = { + name: 'Uniques.ClassThawed', + /** + * Some asset `class` was thawed. \[ class \] + */ + v601: new EventType( + 'Uniques.ClassThawed', + sts.number() + ), + /** + * Some asset `class` was thawed. + */ + v700: new EventType( + 'Uniques.ClassThawed', + sts.struct({ + class: sts.number(), + }) + ), +} + +export const ownerChanged = { + name: 'Uniques.OwnerChanged', + /** + * The owner changed \[ class, new_owner \] + */ + v601: new EventType( + 'Uniques.OwnerChanged', + sts.tuple([sts.number(), v601.AccountId32]) + ), + /** + * The owner changed. + */ + v700: new EventType( + 'Uniques.OwnerChanged', + sts.struct({ + class: sts.number(), + newOwner: v700.AccountId32, + }) + ), + /** + * The owner changed. + */ + v9230: new EventType( + 'Uniques.OwnerChanged', + sts.struct({ + collection: sts.number(), + newOwner: v9230.AccountId32, + }) + ), +} + +export const teamChanged = { + name: 'Uniques.TeamChanged', + /** + * The management team changed \[ class, issuer, admin, freezer \] + */ + v601: new EventType( + 'Uniques.TeamChanged', + sts.tuple([sts.number(), v601.AccountId32, v601.AccountId32, v601.AccountId32]) + ), + /** + * The management team changed. + */ + v700: new EventType( + 'Uniques.TeamChanged', + sts.struct({ + class: sts.number(), + issuer: v700.AccountId32, + admin: v700.AccountId32, + freezer: v700.AccountId32, + }) + ), + /** + * The management team changed. + */ + v9230: new EventType( + 'Uniques.TeamChanged', + sts.struct({ + collection: sts.number(), + issuer: v9230.AccountId32, + admin: v9230.AccountId32, + freezer: v9230.AccountId32, + }) + ), +} + +export const classMetadataSet = { + name: 'Uniques.ClassMetadataSet', + /** + * New metadata has been set for an asset class. \[ class, data, is_frozen \] + */ + v601: new EventType( + 'Uniques.ClassMetadataSet', + sts.tuple([sts.number(), v601.BoundedVec, sts.boolean()]) + ), + /** + * New metadata has been set for an asset class. + */ + v700: new EventType( + 'Uniques.ClassMetadataSet', + sts.struct({ + class: sts.number(), + data: v700.BoundedVec, + isFrozen: sts.boolean(), + }) + ), +} + +export const classMetadataCleared = { + name: 'Uniques.ClassMetadataCleared', + /** + * Metadata has been cleared for an asset class. \[ class \] + */ + v601: new EventType( + 'Uniques.ClassMetadataCleared', + sts.number() + ), + /** + * Metadata has been cleared for an asset class. + */ + v700: new EventType( + 'Uniques.ClassMetadataCleared', + sts.struct({ + class: sts.number(), + }) + ), +} + +export const metadataSet = { + name: 'Uniques.MetadataSet', + /** + * New metadata has been set for an asset instance. + * \[ class, instance, data, is_frozen \] + */ + v601: new EventType( + 'Uniques.MetadataSet', + sts.tuple([sts.number(), sts.number(), v601.BoundedVec, sts.boolean()]) + ), + /** + * New metadata has been set for an asset instance. + */ + v700: new EventType( + 'Uniques.MetadataSet', + sts.struct({ + class: sts.number(), + instance: sts.number(), + data: v700.BoundedVec, + isFrozen: sts.boolean(), + }) + ), + /** + * New metadata has been set for an item. + */ + v9230: new EventType( + 'Uniques.MetadataSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + data: v9230.BoundedVec, + isFrozen: sts.boolean(), + }) + ), +} + +export const metadataCleared = { + name: 'Uniques.MetadataCleared', + /** + * Metadata has been cleared for an asset instance. \[ class, instance \] + */ + v601: new EventType( + 'Uniques.MetadataCleared', + sts.tuple([sts.number(), sts.number()]) + ), + /** + * Metadata has been cleared for an asset instance. + */ + v700: new EventType( + 'Uniques.MetadataCleared', + sts.struct({ + class: sts.number(), + instance: sts.number(), + }) + ), + /** + * Metadata has been cleared for an item. + */ + v9230: new EventType( + 'Uniques.MetadataCleared', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const attributeSet = { + name: 'Uniques.AttributeSet', + /** + * New attribute metadata has been set for an asset class or instance. + * \[ class, maybe_instance, key, value \] + */ + v601: new EventType( + 'Uniques.AttributeSet', + sts.tuple([sts.number(), sts.option(() => sts.number()), sts.bytes(), sts.bytes()]) + ), + /** + * New attribute metadata has been set for an asset class or instance. + */ + v700: new EventType( + 'Uniques.AttributeSet', + sts.struct({ + class: sts.number(), + maybeInstance: sts.option(() => sts.number()), + key: sts.bytes(), + value: sts.bytes(), + }) + ), + /** + * New attribute metadata has been set for a `collection` or `item`. + */ + v9230: new EventType( + 'Uniques.AttributeSet', + sts.struct({ + collection: sts.number(), + maybeItem: sts.option(() => sts.number()), + key: sts.bytes(), + value: sts.bytes(), + }) + ), +} + +export const attributeCleared = { + name: 'Uniques.AttributeCleared', + /** + * Attribute metadata has been cleared for an asset class or instance. + * \[ class, maybe_instance, key, maybe_value \] + */ + v601: new EventType( + 'Uniques.AttributeCleared', + sts.tuple([sts.number(), sts.option(() => sts.number()), sts.bytes()]) + ), + /** + * Attribute metadata has been cleared for an asset class or instance. + */ + v700: new EventType( + 'Uniques.AttributeCleared', + sts.struct({ + class: sts.number(), + maybeInstance: sts.option(() => sts.number()), + key: sts.bytes(), + }) + ), + /** + * Attribute metadata has been cleared for a `collection` or `item`. + */ + v9230: new EventType( + 'Uniques.AttributeCleared', + sts.struct({ + collection: sts.number(), + maybeItem: sts.option(() => sts.number()), + key: sts.bytes(), + }) + ), +} + +export const ownershipAcceptanceChanged = { + name: 'Uniques.OwnershipAcceptanceChanged', + /** + * Ownership acceptance has changed for an account. + */ + v900: new EventType( + 'Uniques.OwnershipAcceptanceChanged', + sts.struct({ + who: v900.AccountId32, + maybeClass: sts.option(() => sts.number()), + }) + ), + /** + * Ownership acceptance has changed for an account. + */ + v9230: new EventType( + 'Uniques.OwnershipAcceptanceChanged', + sts.struct({ + who: v9230.AccountId32, + maybeCollection: sts.option(() => sts.number()), + }) + ), +} + +export const collectionFrozen = { + name: 'Uniques.CollectionFrozen', + /** + * Some `collection` was frozen. + */ + v9230: new EventType( + 'Uniques.CollectionFrozen', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const collectionThawed = { + name: 'Uniques.CollectionThawed', + /** + * Some `collection` was thawed. + */ + v9230: new EventType( + 'Uniques.CollectionThawed', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const collectionMetadataSet = { + name: 'Uniques.CollectionMetadataSet', + /** + * New metadata has been set for a `collection`. + */ + v9230: new EventType( + 'Uniques.CollectionMetadataSet', + sts.struct({ + collection: sts.number(), + data: v9230.BoundedVec, + isFrozen: sts.boolean(), + }) + ), +} + +export const collectionMetadataCleared = { + name: 'Uniques.CollectionMetadataCleared', + /** + * Metadata has been cleared for a `collection`. + */ + v9230: new EventType( + 'Uniques.CollectionMetadataCleared', + sts.struct({ + collection: sts.number(), + }) + ), +} + +export const collectionMaxSupplySet = { + name: 'Uniques.CollectionMaxSupplySet', + /** + * Max supply has been set for a collection. + */ + v9230: new EventType( + 'Uniques.CollectionMaxSupplySet', + sts.struct({ + collection: sts.number(), + maxSupply: sts.number(), + }) + ), +} + +export const itemPriceSet = { + name: 'Uniques.ItemPriceSet', + /** + * The price was set for the instance. + */ + v9270: new EventType( + 'Uniques.ItemPriceSet', + sts.struct({ + collection: sts.number(), + item: sts.number(), + price: sts.bigint(), + whitelistedBuyer: sts.option(() => v9270.AccountId32), + }) + ), +} + +export const itemPriceRemoved = { + name: 'Uniques.ItemPriceRemoved', + /** + * The price for the instance was removed. + */ + v9270: new EventType( + 'Uniques.ItemPriceRemoved', + sts.struct({ + collection: sts.number(), + item: sts.number(), + }) + ), +} + +export const itemBought = { + name: 'Uniques.ItemBought', + /** + * An item was bought. + */ + v9270: new EventType( + 'Uniques.ItemBought', + sts.struct({ + collection: sts.number(), + item: sts.number(), + price: sts.bigint(), + seller: v9270.AccountId32, + buyer: v9270.AccountId32, + }) + ), +} diff --git a/src/types/polkadot/uniques/storage.ts b/src/types/polkadot/uniques/storage.ts new file mode 100644 index 00000000..04ea3a24 --- /dev/null +++ b/src/types/polkadot/uniques/storage.ts @@ -0,0 +1,76 @@ +import {sts, Block, Bytes, Option, Result, StorageType, RuntimeCtx} from '../support' +import * as v601 from '../v601' +import * as v9230 from '../v9230' + +export const class_ = { + /** + * Details of an asset class. + */ + v601: new StorageType('Uniques.Class', 'Optional', [sts.number()], v601.ClassDetails) as ClassV601, + /** + * Details of a collection. + */ + v9230: new StorageType('Uniques.Class', 'Optional', [sts.number()], v9230.CollectionDetails) as ClassV9230, +} + +/** + * Details of an asset class. + */ +export interface ClassV601 { + is(block: RuntimeCtx): boolean + get(block: Block, key: number): Promise<(v601.ClassDetails | undefined)> + getMany(block: Block, keys: number[]): Promise<(v601.ClassDetails | undefined)[]> + getKeys(block: Block): Promise + getKeys(block: Block, key: number): Promise + getKeysPaged(pageSize: number, block: Block): AsyncIterable + getKeysPaged(pageSize: number, block: Block, key: number): AsyncIterable + getPairs(block: Block): Promise<[k: number, v: (v601.ClassDetails | undefined)][]> + getPairs(block: Block, key: number): Promise<[k: number, v: (v601.ClassDetails | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: number, v: (v601.ClassDetails | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key: number): AsyncIterable<[k: number, v: (v601.ClassDetails | undefined)][]> +} + +/** + * Details of a collection. + */ +export interface ClassV9230 { + is(block: RuntimeCtx): boolean + get(block: Block, key: number): Promise<(v9230.CollectionDetails | undefined)> + getMany(block: Block, keys: number[]): Promise<(v9230.CollectionDetails | undefined)[]> + getKeys(block: Block): Promise + getKeys(block: Block, key: number): Promise + getKeysPaged(pageSize: number, block: Block): AsyncIterable + getKeysPaged(pageSize: number, block: Block, key: number): AsyncIterable + getPairs(block: Block): Promise<[k: number, v: (v9230.CollectionDetails | undefined)][]> + getPairs(block: Block, key: number): Promise<[k: number, v: (v9230.CollectionDetails | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: number, v: (v9230.CollectionDetails | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key: number): AsyncIterable<[k: number, v: (v9230.CollectionDetails | undefined)][]> +} + +export const instanceMetadataOf = { + /** + * Metadata of an asset instance. + */ + v601: new StorageType('Uniques.InstanceMetadataOf', 'Optional', [sts.number(), sts.number()], v601.InstanceMetadata) as InstanceMetadataOfV601, +} + +/** + * Metadata of an asset instance. + */ +export interface InstanceMetadataOfV601 { + is(block: RuntimeCtx): boolean + get(block: Block, key1: number, key2: number): Promise<(v601.InstanceMetadata | undefined)> + getMany(block: Block, keys: [number, number][]): Promise<(v601.InstanceMetadata | undefined)[]> + getKeys(block: Block): Promise<[number, number][]> + getKeys(block: Block, key1: number): Promise<[number, number][]> + getKeys(block: Block, key1: number, key2: number): Promise<[number, number][]> + getKeysPaged(pageSize: number, block: Block): AsyncIterable<[number, number][]> + getKeysPaged(pageSize: number, block: Block, key1: number): AsyncIterable<[number, number][]> + getKeysPaged(pageSize: number, block: Block, key1: number, key2: number): AsyncIterable<[number, number][]> + getPairs(block: Block): Promise<[k: [number, number], v: (v601.InstanceMetadata | undefined)][]> + getPairs(block: Block, key1: number): Promise<[k: [number, number], v: (v601.InstanceMetadata | undefined)][]> + getPairs(block: Block, key1: number, key2: number): Promise<[k: [number, number], v: (v601.InstanceMetadata | undefined)][]> + getPairsPaged(pageSize: number, block: Block): AsyncIterable<[k: [number, number], v: (v601.InstanceMetadata | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key1: number): AsyncIterable<[k: [number, number], v: (v601.InstanceMetadata | undefined)][]> + getPairsPaged(pageSize: number, block: Block, key1: number, key2: number): AsyncIterable<[k: [number, number], v: (v601.InstanceMetadata | undefined)][]> +} diff --git a/src/types/polkadot/v601.ts b/src/types/polkadot/v601.ts new file mode 100644 index 00000000..925bb66c --- /dev/null +++ b/src/types/polkadot/v601.ts @@ -0,0 +1,51 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export interface InstanceMetadata { + deposit: bigint + data: BoundedVec + isFrozen: boolean +} + +export type BoundedVec = Bytes + +export const InstanceMetadata: sts.Type = sts.struct(() => { + return { + deposit: sts.bigint(), + data: BoundedVec, + isFrozen: sts.boolean(), + } +}) + +export interface ClassDetails { + owner: AccountId32 + issuer: AccountId32 + admin: AccountId32 + freezer: AccountId32 + totalDeposit: bigint + freeHolding: boolean + instances: number + instanceMetadatas: number + attributes: number + isFrozen: boolean +} + +export type AccountId32 = Bytes + +export const ClassDetails: sts.Type = sts.struct(() => { + return { + owner: AccountId32, + issuer: AccountId32, + admin: AccountId32, + freezer: AccountId32, + totalDeposit: sts.bigint(), + freeHolding: sts.boolean(), + instances: sts.number(), + instanceMetadatas: sts.number(), + attributes: sts.number(), + isFrozen: sts.boolean(), + } +}) + +export const BoundedVec = sts.bytes() + +export const AccountId32 = sts.bytes() diff --git a/src/types/polkadot/v700.ts b/src/types/polkadot/v700.ts new file mode 100644 index 00000000..ff344c60 --- /dev/null +++ b/src/types/polkadot/v700.ts @@ -0,0 +1,5 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export const BoundedVec = sts.bytes() + +export const AccountId32 = sts.bytes() diff --git a/src/types/polkadot/v900.ts b/src/types/polkadot/v900.ts new file mode 100644 index 00000000..f599ef29 --- /dev/null +++ b/src/types/polkadot/v900.ts @@ -0,0 +1,3 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export const AccountId32 = sts.bytes() diff --git a/src/types/polkadot/v9230.ts b/src/types/polkadot/v9230.ts new file mode 100644 index 00000000..ba42f2a3 --- /dev/null +++ b/src/types/polkadot/v9230.ts @@ -0,0 +1,35 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export interface CollectionDetails { + owner: AccountId32 + issuer: AccountId32 + admin: AccountId32 + freezer: AccountId32 + totalDeposit: bigint + freeHolding: boolean + items: number + itemMetadatas: number + attributes: number + isFrozen: boolean +} + +export type AccountId32 = Bytes + +export const CollectionDetails: sts.Type = sts.struct(() => { + return { + owner: AccountId32, + issuer: AccountId32, + admin: AccountId32, + freezer: AccountId32, + totalDeposit: sts.bigint(), + freeHolding: sts.boolean(), + items: sts.number(), + itemMetadatas: sts.number(), + attributes: sts.number(), + isFrozen: sts.boolean(), + } +}) + +export const BoundedVec = sts.bytes() + +export const AccountId32 = sts.bytes() diff --git a/src/types/polkadot/v9270.ts b/src/types/polkadot/v9270.ts new file mode 100644 index 00000000..f599ef29 --- /dev/null +++ b/src/types/polkadot/v9270.ts @@ -0,0 +1,3 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export const AccountId32 = sts.bytes() diff --git a/src/types/polkadot/v9430.ts b/src/types/polkadot/v9430.ts new file mode 100644 index 00000000..c42c344f --- /dev/null +++ b/src/types/polkadot/v9430.ts @@ -0,0 +1,165 @@ +import {sts, Result, Option, Bytes, BitSequence} from './support' + +export interface Type_363 { + deposit: ItemMetadataDeposit + data: Bytes +} + +export interface ItemMetadataDeposit { + account?: (AccountId32 | undefined) + amount: bigint +} + +export type AccountId32 = Bytes + +export const Type_363: sts.Type = sts.struct(() => { + return { + deposit: ItemMetadataDeposit, + data: sts.bytes(), + } +}) + +export const ItemMetadataDeposit: sts.Type = sts.struct(() => { + return { + account: sts.option(() => AccountId32), + amount: sts.bigint(), + } +}) + +export interface Type_353 { + owner: AccountId32 + ownerDeposit: bigint + items: number + itemMetadatas: number + itemConfigs: number + attributes: number +} + +export const Type_353: sts.Type = sts.struct(() => { + return { + owner: AccountId32, + ownerDeposit: sts.bigint(), + items: sts.number(), + itemMetadatas: sts.number(), + itemConfigs: sts.number(), + attributes: sts.number(), + } +}) + +export const MintSettings: sts.Type = sts.struct(() => { + return { + mintType: MintType, + price: sts.option(() => sts.bigint()), + startBlock: sts.option(() => sts.number()), + endBlock: sts.option(() => sts.number()), + defaultItemSettings: sts.bigint(), + } +}) + +export const MintType: sts.Type = sts.closedEnum(() => { + return { + HolderOf: sts.number(), + Issuer: sts.unit(), + Public: sts.unit(), + } +}) + +export type MintType = MintType_HolderOf | MintType_Issuer | MintType_Public + +export interface MintType_HolderOf { + __kind: 'HolderOf' + value: number +} + +export interface MintType_Issuer { + __kind: 'Issuer' +} + +export interface MintType_Public { + __kind: 'Public' +} + +export interface MintSettings { + mintType: MintType + price?: (bigint | undefined) + startBlock?: (number | undefined) + endBlock?: (number | undefined) + defaultItemSettings: bigint +} + +export const PalletAttributes: sts.Type = sts.closedEnum(() => { + return { + TransferDisabled: sts.unit(), + UsedToClaim: sts.number(), + } +}) + +export type PalletAttributes = PalletAttributes_TransferDisabled | PalletAttributes_UsedToClaim + +export interface PalletAttributes_TransferDisabled { + __kind: 'TransferDisabled' +} + +export interface PalletAttributes_UsedToClaim { + __kind: 'UsedToClaim' + value: number +} + +export const PriceWithDirection: sts.Type = sts.struct(() => { + return { + amount: sts.bigint(), + direction: PriceDirection, + } +}) + +export const PriceDirection: sts.Type = sts.closedEnum(() => { + return { + Receive: sts.unit(), + Send: sts.unit(), + } +}) + +export type PriceDirection = PriceDirection_Receive | PriceDirection_Send + +export interface PriceDirection_Receive { + __kind: 'Receive' +} + +export interface PriceDirection_Send { + __kind: 'Send' +} + +export interface PriceWithDirection { + amount: bigint + direction: PriceDirection +} + +export const AttributeNamespace: sts.Type = sts.closedEnum(() => { + return { + Account: AccountId32, + CollectionOwner: sts.unit(), + ItemOwner: sts.unit(), + Pallet: sts.unit(), + } +}) + +export type AttributeNamespace = AttributeNamespace_Account | AttributeNamespace_CollectionOwner | AttributeNamespace_ItemOwner | AttributeNamespace_Pallet + +export interface AttributeNamespace_Account { + __kind: 'Account' + value: AccountId32 +} + +export interface AttributeNamespace_CollectionOwner { + __kind: 'CollectionOwner' +} + +export interface AttributeNamespace_ItemOwner { + __kind: 'ItemOwner' +} + +export interface AttributeNamespace_Pallet { + __kind: 'Pallet' +} + +export const AccountId32 = sts.bytes() diff --git a/src/types/statemine/events.ts b/src/types/statemine/events.ts deleted file mode 100644 index e1b10f0b..00000000 --- a/src/types/statemine/events.ts +++ /dev/null @@ -1,2399 +0,0 @@ -import assert from 'assert' -import {Chain, ChainContext, EventContext, Event, Result, Option} from './support' -import * as v9420 from './v9420' -import * as v9430 from './v9430' - -export class NftsAllApprovalsCancelledEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.AllApprovalsCancelled') - this._chain = ctx._chain - this.event = event - } - - /** - * All approvals of an item got cancelled. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.AllApprovalsCancelled') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * All approvals of an item got cancelled. - */ - get asV9420(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsApprovalCancelledEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ApprovalCancelled') - this._chain = ctx._chain - this.event = event - } - - /** - * An approval for a `delegate` account to transfer the `item` of an item - * `collection` was cancelled by its `owner`. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ApprovalCancelled') === '28e2099402db057489fed1d463d382a488f95bb3d119379aef54f500296b1d83' - } - - /** - * An approval for a `delegate` account to transfer the `item` of an item - * `collection` was cancelled by its `owner`. - */ - get asV9420(): {collection: number, item: number, owner: Uint8Array, delegate: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsAttributeClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.AttributeCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Attribute metadata has been cleared for a `collection` or `item`. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.AttributeCleared') === '4d246c14b51f1093b2b931b12ca433d89593c617b09ce2082dfc43ef8671765e' - } - - /** - * Attribute metadata has been cleared for a `collection` or `item`. - */ - get asV9420(): {collection: number, maybeItem: (number | undefined), key: Uint8Array, namespace: v9420.AttributeNamespace} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsAttributeSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.AttributeSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New attribute metadata has been set for a `collection` or `item`. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.AttributeSet') === 'df375b4dee7b64ffeab47159334313f546d6fbe1d31d90f2253a667f6ac2799f' - } - - /** - * New attribute metadata has been set for a `collection` or `item`. - */ - get asV9420(): {collection: number, maybeItem: (number | undefined), key: Uint8Array, value: Uint8Array, namespace: v9420.AttributeNamespace} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsBurnedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Burned') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` was destroyed. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.Burned') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * An `item` was destroyed. - */ - get asV9420(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionConfigChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionConfigChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * A `collection` has had its config changed by the `Force` origin. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.CollectionConfigChanged') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * A `collection` has had its config changed by the `Force` origin. - */ - get asV9420(): {collection: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionLockedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionLocked') - this._chain = ctx._chain - this.event = event - } - - /** - * Some `collection` was locked. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.CollectionLocked') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Some `collection` was locked. - */ - get asV9420(): {collection: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionMaxSupplySetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionMaxSupplySet') - this._chain = ctx._chain - this.event = event - } - - /** - * Max supply has been set for a collection. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.CollectionMaxSupplySet') === '165991456bc3c6a81994ce513fdf36c2303f5220829f5e8caafbf821233135b4' - } - - /** - * Max supply has been set for a collection. - */ - get asV9420(): {collection: number, maxSupply: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionMetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for a `collection`. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.CollectionMetadataCleared') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Metadata has been cleared for a `collection`. - */ - get asV9420(): {collection: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionMetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for a `collection`. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.CollectionMetadataSet') === 'fbd84faf888505e9d8faf18bd544737c4436c745e6318c812a3065bb1a666c44' - } - - /** - * New metadata has been set for a `collection`. - */ - get asV9420(): {collection: number, data: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionMintSettingsUpdatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionMintSettingsUpdated') - this._chain = ctx._chain - this.event = event - } - - /** - * Mint settings for a collection had changed. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.CollectionMintSettingsUpdated') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Mint settings for a collection had changed. - */ - get asV9420(): {collection: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Created') - this._chain = ctx._chain - this.event = event - } - - /** - * A `collection` was created. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.Created') === 'a5c293082b1f3ffb16eaecc5b8d430ca1bb8c7bd090079ebcefcbf303cbfec61' - } - - /** - * A `collection` was created. - */ - get asV9420(): {collection: number, creator: Uint8Array, owner: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsDestroyedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Destroyed') - this._chain = ctx._chain - this.event = event - } - - /** - * A `collection` was destroyed. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.Destroyed') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * A `collection` was destroyed. - */ - get asV9420(): {collection: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsForceCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ForceCreated') - this._chain = ctx._chain - this.event = event - } - - /** - * A `collection` was force-created. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ForceCreated') === '6059bcf1dd7c48dc760f017d00a2c7c6719e745b3de9bde2046cbe26347c562f' - } - - /** - * A `collection` was force-created. - */ - get asV9420(): {collection: number, owner: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsIssuedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Issued') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` was issued. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.Issued') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * An `item` was issued. - */ - get asV9420(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemAttributesApprovalAddedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemAttributesApprovalAdded') - this._chain = ctx._chain - this.event = event - } - - /** - * A new approval to modify item attributes was added. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemAttributesApprovalAdded') === '16137639784e12ee57d143b35251349ede19f9139a7b372c2c033564309a1aaa' - } - - /** - * A new approval to modify item attributes was added. - */ - get asV9420(): {collection: number, item: number, delegate: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemAttributesApprovalRemovedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemAttributesApprovalRemoved') - this._chain = ctx._chain - this.event = event - } - - /** - * A new approval to modify item attributes was removed. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemAttributesApprovalRemoved') === '16137639784e12ee57d143b35251349ede19f9139a7b372c2c033564309a1aaa' - } - - /** - * A new approval to modify item attributes was removed. - */ - get asV9420(): {collection: number, item: number, delegate: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemBoughtEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemBought') - this._chain = ctx._chain - this.event = event - } - - /** - * An item was bought. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemBought') === 'db915144f3a96c73a3031d37c874507dcac06fd77bca9962f672bc9bfb557489' - } - - /** - * An item was bought. - */ - get asV9420(): {collection: number, item: number, price: bigint, seller: Uint8Array, buyer: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemMetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for an item. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemMetadataCleared') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * Metadata has been cleared for an item. - */ - get asV9420(): {collection: number, item: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemMetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for an item. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemMetadataSet') === '83275a0de68e1c50aff60fe3090e27ba46bb68a77375edc5172d160af095826d' - } - - /** - * New metadata has been set for an item. - */ - get asV9420(): {collection: number, item: number, data: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemPriceRemovedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemPriceRemoved') - this._chain = ctx._chain - this.event = event - } - - /** - * The price for the item was removed. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemPriceRemoved') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * The price for the item was removed. - */ - get asV9420(): {collection: number, item: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemPriceSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemPriceSet') - this._chain = ctx._chain - this.event = event - } - - /** - * The price was set for the item. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemPriceSet') === '10d4911c332080c5a5c1e6c248347d1174817ab96906747e2c40df18c5381944' - } - - /** - * The price was set for the item. - */ - get asV9420(): {collection: number, item: number, price: bigint, whitelistedBuyer: (Uint8Array | undefined)} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemPropertiesLockedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemPropertiesLocked') - this._chain = ctx._chain - this.event = event - } - - /** - * `item` metadata or attributes were locked. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemPropertiesLocked') === 'b6965c94a3e24b173446abb1e12a56b541de3d666894c46f3753c4d9029db290' - } - - /** - * `item` metadata or attributes were locked. - */ - get asV9420(): {collection: number, item: number, lockMetadata: boolean, lockAttributes: boolean} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemTransferLockedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemTransferLocked') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` became non-transferable. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemTransferLocked') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * An `item` became non-transferable. - */ - get asV9420(): {collection: number, item: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemTransferUnlockedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemTransferUnlocked') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` became transferable. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.ItemTransferUnlocked') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * An `item` became transferable. - */ - get asV9420(): {collection: number, item: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsNextCollectionIdIncrementedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.NextCollectionIdIncremented') - this._chain = ctx._chain - this.event = event - } - - /** - * Event gets emitted when the `NextCollectionId` gets incremented. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.NextCollectionIdIncremented') === '637ef8f6ab36ea6441937975da16ec6128d3ac503fd8ae7bc04131ff93640dc2' - } - - /** - * Event gets emitted when the `NextCollectionId` gets incremented. - */ - get asV9420(): {nextId: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } - - /** - * Event gets emitted when the `NextCollectionId` gets incremented. - */ - get isV1000000(): boolean { - return this._chain.getEventHash('Nfts.NextCollectionIdIncremented') === 'cd3fe8f02b8e066babd9b85bf60f6760d52be27f9e088f03bf00392c80d5fc5d' - } - - /** - * Event gets emitted when the `NextCollectionId` gets incremented. - */ - get asV1000000(): {nextId: (number | undefined)} { - assert(this.isV1000000) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsOwnerChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.OwnerChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * The owner changed. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.OwnerChanged') === '0331b0b161c2f2db690f574540ade7765af19f5306dc65443561fbaa5825f323' - } - - /** - * The owner changed. - */ - get asV9420(): {collection: number, newOwner: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsOwnershipAcceptanceChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.OwnershipAcceptanceChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * Ownership acceptance has changed for an account. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.OwnershipAcceptanceChanged') === '62f0a146ea419b03ef3bb5c912782af0253639ca8fc47ff318396bedef2230cc' - } - - /** - * Ownership acceptance has changed for an account. - */ - get asV9420(): {who: Uint8Array, maybeCollection: (number | undefined)} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsPalletAttributeSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.PalletAttributeSet') - this._chain = ctx._chain - this.event = event - } - - /** - * A new attribute in the `Pallet` namespace was set for the `collection` or an `item` - * within that `collection`. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.PalletAttributeSet') === '8acc59fe38aad8002f221ac66d2766d6670fb8d76b711134d7089cf69d642d78' - } - - /** - * A new attribute in the `Pallet` namespace was set for the `collection` or an `item` - * within that `collection`. - */ - get asV9420(): {collection: number, item: (number | undefined), attribute: v9420.PalletAttributes, value: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } - - /** - * A new attribute in the `Pallet` namespace was set for the `collection` or an `item` - * within that `collection`. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.PalletAttributeSet') === '468a1a89b31826460104c40759efeb63ceefdd69a6f12d9f82160b20376b0cb6' - } - - /** - * A new attribute in the `Pallet` namespace was set for the `collection` or an `item` - * within that `collection`. - */ - get asV9430(): {collection: number, item: (number | undefined), attribute: v9430.PalletAttributes, value: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsPreSignedAttributesSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.PreSignedAttributesSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New attributes have been set for an `item` of the `collection`. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.PreSignedAttributesSet') === '3187a106d1f5607c0c25a6deef04d48112079b32dd61370affb8b10ee21bdca5' - } - - /** - * New attributes have been set for an `item` of the `collection`. - */ - get asV9420(): {collection: number, item: number, namespace: v9420.AttributeNamespace} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsSwapCancelledEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.SwapCancelled') - this._chain = ctx._chain - this.event = event - } - - /** - * The swap was cancelled. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.SwapCancelled') === '203695181f6ad5b8cfab290f9b1f5673a0bfbdc9ad4b967b47d2f74b981865da' - } - - /** - * The swap was cancelled. - */ - get asV9420(): {offeredCollection: number, offeredItem: number, desiredCollection: number, desiredItem: (number | undefined), price: (v9420.PriceWithDirection | undefined), deadline: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsSwapClaimedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.SwapClaimed') - this._chain = ctx._chain - this.event = event - } - - /** - * The swap has been claimed. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.SwapClaimed') === 'a32b04673263c9758fac7dc7b2ee372deba818fe72f157dd9a3baa5b02f6d66e' - } - - /** - * The swap has been claimed. - */ - get asV9420(): {sentCollection: number, sentItem: number, sentItemOwner: Uint8Array, receivedCollection: number, receivedItem: number, receivedItemOwner: Uint8Array, price: (v9420.PriceWithDirection | undefined), deadline: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsSwapCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.SwapCreated') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` swap intent was created. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.SwapCreated') === '203695181f6ad5b8cfab290f9b1f5673a0bfbdc9ad4b967b47d2f74b981865da' - } - - /** - * An `item` swap intent was created. - */ - get asV9420(): {offeredCollection: number, offeredItem: number, desiredCollection: number, desiredItem: (number | undefined), price: (v9420.PriceWithDirection | undefined), deadline: number} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsTeamChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.TeamChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * The management team changed. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.TeamChanged') === '7d04eb24156118efda8b963ba4549a6d4ad4a1af762296e453e42e231805cd54' - } - - /** - * The management team changed. - */ - get asV9420(): {collection: number, issuer: (Uint8Array | undefined), admin: (Uint8Array | undefined), freezer: (Uint8Array | undefined)} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsTipSentEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.TipSent') - this._chain = ctx._chain - this.event = event - } - - /** - * A tip was sent. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.TipSent') === '6508b276e46d4188520e47ddb8bf0513b8c2e8b4e9dea63e25496bc5ca934424' - } - - /** - * A tip was sent. - */ - get asV9420(): {collection: number, item: number, sender: Uint8Array, receiver: Uint8Array, amount: bigint} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsTransferApprovedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.TransferApproved') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` of a `collection` has been approved by the `owner` for transfer by - * a `delegate`. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.TransferApproved') === '71620a6e85bb8bb5d9e315805e790e3baae8f271dee82324db43d472e2a8d860' - } - - /** - * An `item` of a `collection` has been approved by the `owner` for transfer by - * a `delegate`. - */ - get asV9420(): {collection: number, item: number, owner: Uint8Array, delegate: Uint8Array, deadline: (number | undefined)} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsTransferredEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Transferred') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` was transferred. - */ - get isV9420(): boolean { - return this._chain.getEventHash('Nfts.Transferred') === 'ac8c1c5a1df2a464e3447d13d6c43a813112a33c144f93775b934b08c086bf7a' - } - - /** - * An `item` was transferred. - */ - get asV9420(): {collection: number, item: number, from: Uint8Array, to: Uint8Array} { - assert(this.isV9420) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesAttributeClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.AttributeCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Attribute metadata has been cleared for an asset class or instance. - * \[ class, maybe_instance, key, maybe_value \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.AttributeCleared') === '885b4dbb6c48840d1cb04f9f8a73f65455ff8e630c9692e7b8efbb5abf341a92' - } - - /** - * Attribute metadata has been cleared for an asset class or instance. - * \[ class, maybe_instance, key, maybe_value \] - */ - get asV1(): [number, (number | undefined), Uint8Array] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * Attribute metadata has been cleared for an asset class or instance. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.AttributeCleared') === '91aa106b700026eb59ef1d86cbd22766539a996d1d1d5cb5dbbdc18439ff1283' - } - - /** - * Attribute metadata has been cleared for an asset class or instance. - */ - get asV700(): {class: number, maybeInstance: (number | undefined), key: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * Attribute metadata has been cleared for a `collection` or `item`. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.AttributeCleared') === 'c330ddd00fb87b92c796bc29cff6edf2ce546dd8eb98420ac23c5cbe7b0e11d1' - } - - /** - * Attribute metadata has been cleared for a `collection` or `item`. - */ - get asV9230(): {collection: number, maybeItem: (number | undefined), key: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesAttributeSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.AttributeSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New attribute metadata has been set for an asset class or instance. - * \[ class, maybe_instance, key, value \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.AttributeSet') === '135c19d2cf1f530340d3fe938fdcce6ca358d729cfc69ce595cc57b640136a76' - } - - /** - * New attribute metadata has been set for an asset class or instance. - * \[ class, maybe_instance, key, value \] - */ - get asV1(): [number, (number | undefined), Uint8Array, Uint8Array] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * New attribute metadata has been set for an asset class or instance. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.AttributeSet') === '6ae49a979267c094bc35bda051f5467e62472724b598a2f5ee5720a5111b8623' - } - - /** - * New attribute metadata has been set for an asset class or instance. - */ - get asV700(): {class: number, maybeInstance: (number | undefined), key: Uint8Array, value: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * New attribute metadata has been set for a `collection` or `item`. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.AttributeSet') === 'b7e65dbf62f10e9415ffa560bff4954ffeb28994c9cf350ecd59fe98850d8783' - } - - /** - * New attribute metadata has been set for a `collection` or `item`. - */ - get asV9230(): {collection: number, maybeItem: (number | undefined), key: Uint8Array, value: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesBurnedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Burned') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset `instance` was destroyed. \[ class, instance, owner \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.Burned') === '7b53bb12306431c6ff23a3ea3466183ed1c7f4ecb417f6e8467ae0c63cbc2f88' - } - - /** - * An asset `instance` was destroyed. \[ class, instance, owner \] - */ - get asV1(): [number, number, Uint8Array] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset `instance` was destroyed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Burned') === '448723f6c40490fe04ab8e6d9e382432b7ce5c075d05af60c076b9f6a8a9e510' - } - - /** - * An asset `instance` was destroyed. - */ - get asV700(): {class: number, instance: number, owner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * An `item` was destroyed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Burned') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * An `item` was destroyed. - */ - get asV9230(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesClassFrozenEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ClassFrozen') - this._chain = ctx._chain - this.event = event - } - - /** - * Some asset `class` was frozen. \[ class \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.ClassFrozen') === '0a0f30b1ade5af5fade6413c605719d59be71340cf4884f65ee9858eb1c38f6c' - } - - /** - * Some asset `class` was frozen. \[ class \] - */ - get asV1(): number { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * Some asset `class` was frozen. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ClassFrozen') === '4f045c4df2d4b9045175427f6f6aa548cd3ad56207f700b68254d3b77d944310' - } - - /** - * Some asset `class` was frozen. - */ - get asV700(): {class: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesClassMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ClassMetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for an asset class. \[ class \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.ClassMetadataCleared') === '0a0f30b1ade5af5fade6413c605719d59be71340cf4884f65ee9858eb1c38f6c' - } - - /** - * Metadata has been cleared for an asset class. \[ class \] - */ - get asV1(): number { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * Metadata has been cleared for an asset class. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ClassMetadataCleared') === '4f045c4df2d4b9045175427f6f6aa548cd3ad56207f700b68254d3b77d944310' - } - - /** - * Metadata has been cleared for an asset class. - */ - get asV700(): {class: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesClassMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ClassMetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for an asset class. \[ class, data, is_frozen \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.ClassMetadataSet') === '5792f3fb3e6c02cd51090283e81fd6d6cf13fe8a50876dcc428a6b9314aa3f72' - } - - /** - * New metadata has been set for an asset class. \[ class, data, is_frozen \] - */ - get asV1(): [number, Uint8Array, boolean] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * New metadata has been set for an asset class. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ClassMetadataSet') === '151c432def6b2dc27880b815773b729a1ceb58295a326de4c16e57901c2a9476' - } - - /** - * New metadata has been set for an asset class. - */ - get asV700(): {class: number, data: Uint8Array, isFrozen: boolean} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesClassThawedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ClassThawed') - this._chain = ctx._chain - this.event = event - } - - /** - * Some asset `class` was thawed. \[ class \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.ClassThawed') === '0a0f30b1ade5af5fade6413c605719d59be71340cf4884f65ee9858eb1c38f6c' - } - - /** - * Some asset `class` was thawed. \[ class \] - */ - get asV1(): number { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * Some asset `class` was thawed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ClassThawed') === '4f045c4df2d4b9045175427f6f6aa548cd3ad56207f700b68254d3b77d944310' - } - - /** - * Some asset `class` was thawed. - */ - get asV700(): {class: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionFrozenEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionFrozen') - this._chain = ctx._chain - this.event = event - } - - /** - * Some `collection` was frozen. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionFrozen') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Some `collection` was frozen. - */ - get asV9230(): {collection: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionMaxSupplySetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionMaxSupplySet') - this._chain = ctx._chain - this.event = event - } - - /** - * Max supply has been set for a collection. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionMaxSupplySet') === '165991456bc3c6a81994ce513fdf36c2303f5220829f5e8caafbf821233135b4' - } - - /** - * Max supply has been set for a collection. - */ - get asV9230(): {collection: number, maxSupply: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionMetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for a `collection`. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionMetadataCleared') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Metadata has been cleared for a `collection`. - */ - get asV9230(): {collection: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionMetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for a `collection`. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionMetadataSet') === '63ef75086da73b45ed287cac6640abbebd40222433fb8fae9e4fa1bfa173afc2' - } - - /** - * New metadata has been set for a `collection`. - */ - get asV9230(): {collection: number, data: Uint8Array, isFrozen: boolean} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionThawedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionThawed') - this._chain = ctx._chain - this.event = event - } - - /** - * Some `collection` was thawed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionThawed') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Some `collection` was thawed. - */ - get asV9230(): {collection: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Created') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset class was created. \[ class, creator, owner \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.Created') === 'f968eb148e0dc7739feb64d5c72eea0de823dbf44259d08f9a6218f8117bf19a' - } - - /** - * An asset class was created. \[ class, creator, owner \] - */ - get asV1(): [number, Uint8Array, Uint8Array] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset class was created. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Created') === '7f77877d6861fb103cb861e568c28c6112b4f0daecbb1931ca2b5d4e733fdacd' - } - - /** - * An asset class was created. - */ - get asV700(): {class: number, creator: Uint8Array, owner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * A `collection` was created. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Created') === 'a5c293082b1f3ffb16eaecc5b8d430ca1bb8c7bd090079ebcefcbf303cbfec61' - } - - /** - * A `collection` was created. - */ - get asV9230(): {collection: number, creator: Uint8Array, owner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesDestroyedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Destroyed') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset `class` was destroyed. \[ class \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.Destroyed') === '0a0f30b1ade5af5fade6413c605719d59be71340cf4884f65ee9858eb1c38f6c' - } - - /** - * An asset `class` was destroyed. \[ class \] - */ - get asV1(): number { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset `class` was destroyed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Destroyed') === '4f045c4df2d4b9045175427f6f6aa548cd3ad56207f700b68254d3b77d944310' - } - - /** - * An asset `class` was destroyed. - */ - get asV700(): {class: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * A `collection` was destroyed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Destroyed') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * A `collection` was destroyed. - */ - get asV9230(): {collection: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesForceCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ForceCreated') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset class was force-created. \[ class, owner \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.ForceCreated') === '0379562584d6426ccff49705dfa9dba95ad94215b772fd97d0ad0c4ca0001c12' - } - - /** - * An asset class was force-created. \[ class, owner \] - */ - get asV1(): [number, Uint8Array] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset class was force-created. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ForceCreated') === 'd51b7ff0e8d25eeb64fd1351f5eafbd20c22e12baddedd443f9831da21e235ea' - } - - /** - * An asset class was force-created. - */ - get asV700(): {class: number, owner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * A `collection` was force-created. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.ForceCreated') === '6059bcf1dd7c48dc760f017d00a2c7c6719e745b3de9bde2046cbe26347c562f' - } - - /** - * A `collection` was force-created. - */ - get asV9230(): {collection: number, owner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesFrozenEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Frozen') - this._chain = ctx._chain - this.event = event - } - - /** - * Some asset `instance` was frozen. \[ class, instance \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.Frozen') === 'a09602e40984745a7411a1855af06d133893a422fd68f7bdc4fb6a56bf1a3645' - } - - /** - * Some asset `instance` was frozen. \[ class, instance \] - */ - get asV1(): [number, number] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * Some asset `instance` was frozen. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Frozen') === '4aec04ec96e3cd667bd16926634d063c18da9922e4d645f33692574e196c20dc' - } - - /** - * Some asset `instance` was frozen. - */ - get asV700(): {class: number, instance: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * Some `item` was frozen. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Frozen') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * Some `item` was frozen. - */ - get asV9230(): {collection: number, item: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesIssuedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Issued') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset `instace` was issued. \[ class, instance, owner \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.Issued') === '7b53bb12306431c6ff23a3ea3466183ed1c7f4ecb417f6e8467ae0c63cbc2f88' - } - - /** - * An asset `instace` was issued. \[ class, instance, owner \] - */ - get asV1(): [number, number, Uint8Array] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset `instance` was issued. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Issued') === '448723f6c40490fe04ab8e6d9e382432b7ce5c075d05af60c076b9f6a8a9e510' - } - - /** - * An asset `instance` was issued. - */ - get asV700(): {class: number, instance: number, owner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * An `item` was issued. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Issued') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * An `item` was issued. - */ - get asV9230(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesItemBoughtEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ItemBought') - this._chain = ctx._chain - this.event = event - } - - /** - * An item was bought. - */ - get isV9270(): boolean { - return this._chain.getEventHash('Uniques.ItemBought') === 'db915144f3a96c73a3031d37c874507dcac06fd77bca9962f672bc9bfb557489' - } - - /** - * An item was bought. - */ - get asV9270(): {collection: number, item: number, price: bigint, seller: Uint8Array, buyer: Uint8Array} { - assert(this.isV9270) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesItemPriceRemovedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ItemPriceRemoved') - this._chain = ctx._chain - this.event = event - } - - /** - * The price for the instance was removed. - */ - get isV9270(): boolean { - return this._chain.getEventHash('Uniques.ItemPriceRemoved') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * The price for the instance was removed. - */ - get asV9270(): {collection: number, item: number} { - assert(this.isV9270) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesItemPriceSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ItemPriceSet') - this._chain = ctx._chain - this.event = event - } - - /** - * The price was set for the instance. - */ - get isV9270(): boolean { - return this._chain.getEventHash('Uniques.ItemPriceSet') === '10d4911c332080c5a5c1e6c248347d1174817ab96906747e2c40df18c5381944' - } - - /** - * The price was set for the instance. - */ - get asV9270(): {collection: number, item: number, price: bigint, whitelistedBuyer: (Uint8Array | undefined)} { - assert(this.isV9270) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.MetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for an asset instance. \[ class, instance \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.MetadataCleared') === 'a09602e40984745a7411a1855af06d133893a422fd68f7bdc4fb6a56bf1a3645' - } - - /** - * Metadata has been cleared for an asset instance. \[ class, instance \] - */ - get asV1(): [number, number] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * Metadata has been cleared for an asset instance. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.MetadataCleared') === '4aec04ec96e3cd667bd16926634d063c18da9922e4d645f33692574e196c20dc' - } - - /** - * Metadata has been cleared for an asset instance. - */ - get asV700(): {class: number, instance: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * Metadata has been cleared for an item. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.MetadataCleared') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * Metadata has been cleared for an item. - */ - get asV9230(): {collection: number, item: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.MetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for an asset instance. - * \[ class, instance, data, is_frozen \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.MetadataSet') === '7895150acb61111b7c6318ded185579b696175877e3d9b7bae2664d131eb3e65' - } - - /** - * New metadata has been set for an asset instance. - * \[ class, instance, data, is_frozen \] - */ - get asV1(): [number, number, Uint8Array, boolean] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * New metadata has been set for an asset instance. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.MetadataSet') === '8d2f67e787668073bdb66a4b7bbba97ea22da0860f46bce7884b446fd055419a' - } - - /** - * New metadata has been set for an asset instance. - */ - get asV700(): {class: number, instance: number, data: Uint8Array, isFrozen: boolean} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * New metadata has been set for an item. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.MetadataSet') === 'dc2370253c17fe69445af313af0113a31f244cc51324e5a3b4b0b98804f91a6f' - } - - /** - * New metadata has been set for an item. - */ - get asV9230(): {collection: number, item: number, data: Uint8Array, isFrozen: boolean} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesOwnerChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.OwnerChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * The owner changed \[ class, new_owner \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.OwnerChanged') === '0379562584d6426ccff49705dfa9dba95ad94215b772fd97d0ad0c4ca0001c12' - } - - /** - * The owner changed \[ class, new_owner \] - */ - get asV1(): [number, Uint8Array] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * The owner changed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.OwnerChanged') === '7f21331ba73970553e198c5598e55e9857317b38adaa7f293e914882bdd7385c' - } - - /** - * The owner changed. - */ - get asV700(): {class: number, newOwner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * The owner changed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.OwnerChanged') === '0331b0b161c2f2db690f574540ade7765af19f5306dc65443561fbaa5825f323' - } - - /** - * The owner changed. - */ - get asV9230(): {collection: number, newOwner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesOwnershipAcceptanceChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.OwnershipAcceptanceChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * Ownership acceptance has changed for an account. - */ - get isV900(): boolean { - return this._chain.getEventHash('Uniques.OwnershipAcceptanceChanged') === '78fde0ff8f56c4ebcc47231a34e394471cbf03f4b56f9fa6854cecafab37242d' - } - - /** - * Ownership acceptance has changed for an account. - */ - get asV900(): {who: Uint8Array, maybeClass: (number | undefined)} { - assert(this.isV900) - return this._chain.decodeEvent(this.event) - } - - /** - * Ownership acceptance has changed for an account. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.OwnershipAcceptanceChanged') === '62f0a146ea419b03ef3bb5c912782af0253639ca8fc47ff318396bedef2230cc' - } - - /** - * Ownership acceptance has changed for an account. - */ - get asV9230(): {who: Uint8Array, maybeCollection: (number | undefined)} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesTeamChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.TeamChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * The management team changed \[ class, issuer, admin, freezer \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.TeamChanged') === '608cf8b84887966db26c958a6b826fd41d8e098263ce7eaae9a421f1f8b1bd56' - } - - /** - * The management team changed \[ class, issuer, admin, freezer \] - */ - get asV1(): [number, Uint8Array, Uint8Array, Uint8Array] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * The management team changed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.TeamChanged') === 'ed55b7c512c680f9a9b8f35a0e603e101cd439e8b1c07373e1b6b2ca40d032f7' - } - - /** - * The management team changed. - */ - get asV700(): {class: number, issuer: Uint8Array, admin: Uint8Array, freezer: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * The management team changed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.TeamChanged') === '152cd89e42995f09fd841e2eeec18a6a0ca02740e481dc98e45b182742b5172e' - } - - /** - * The management team changed. - */ - get asV9230(): {collection: number, issuer: Uint8Array, admin: Uint8Array, freezer: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesThawedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Thawed') - this._chain = ctx._chain - this.event = event - } - - /** - * Some asset `instance` was thawed. \[ class, instance \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.Thawed') === 'a09602e40984745a7411a1855af06d133893a422fd68f7bdc4fb6a56bf1a3645' - } - - /** - * Some asset `instance` was thawed. \[ class, instance \] - */ - get asV1(): [number, number] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * Some asset `instance` was thawed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Thawed') === '4aec04ec96e3cd667bd16926634d063c18da9922e4d645f33692574e196c20dc' - } - - /** - * Some asset `instance` was thawed. - */ - get asV700(): {class: number, instance: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * Some `item` was thawed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Thawed') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * Some `item` was thawed. - */ - get asV9230(): {collection: number, item: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesTransferredEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Transferred') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset `instace` was transferred. \[ class, instance, from, to \] - */ - get isV1(): boolean { - return this._chain.getEventHash('Uniques.Transferred') === '5d3fa4f2b87c3626df0e27d53288bc8519502854bcd4a4f83b5b48102417e8d1' - } - - /** - * An asset `instace` was transferred. \[ class, instance, from, to \] - */ - get asV1(): [number, number, Uint8Array, Uint8Array] { - assert(this.isV1) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset `instance` was transferred. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Transferred') === '62805427bf03dcd5763c135e667e4d08319c26623a7eecd16e8463cac99132b0' - } - - /** - * An asset `instance` was transferred. - */ - get asV700(): {class: number, instance: number, from: Uint8Array, to: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * An `item` was transferred. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Transferred') === 'ac8c1c5a1df2a464e3447d13d6c43a813112a33c144f93775b934b08c086bf7a' - } - - /** - * An `item` was transferred. - */ - get asV9230(): {collection: number, item: number, from: Uint8Array, to: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} diff --git a/src/types/statemine/storage.ts b/src/types/statemine/storage.ts deleted file mode 100644 index ba412c23..00000000 --- a/src/types/statemine/storage.ts +++ /dev/null @@ -1,213 +0,0 @@ -import assert from 'assert' -import {Block, BlockContext, Chain, ChainContext, Option, Result, StorageBase} from './support' -import * as v1 from './v1' -import * as v9230 from './v9230' -import * as v9420 from './v9420' - -export class NftsCollectionStorage extends StorageBase { - protected getPrefix() { - return 'Nfts' - } - - protected getName() { - return 'Collection' - } - - /** - * Details of a collection. - */ - get isV9420(): boolean { - return this.getTypeHash() === '2048922b0682bb5b7de7ca9a7e01264f12386f5c3cad9a3e84b1e5a81cd69913' - } - - /** - * Details of a collection. - */ - get asV9420(): NftsCollectionStorageV9420 { - assert(this.isV9420) - return this as any - } -} - -/** - * Details of a collection. - */ -export interface NftsCollectionStorageV9420 { - get(key: number): Promise<(v9420.Type_348 | undefined)> - getAll(): Promise - getMany(keys: number[]): Promise<(v9420.Type_348 | undefined)[]> - getKeys(): Promise - getKeys(key: number): Promise - getKeysPaged(pageSize: number): AsyncIterable - getKeysPaged(pageSize: number, key: number): AsyncIterable - getPairs(): Promise<[k: number, v: v9420.Type_348][]> - getPairs(key: number): Promise<[k: number, v: v9420.Type_348][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: number, v: v9420.Type_348][]> - getPairsPaged(pageSize: number, key: number): AsyncIterable<[k: number, v: v9420.Type_348][]> -} - -export class NftsItemMetadataOfStorage extends StorageBase { - protected getPrefix() { - return 'Nfts' - } - - protected getName() { - return 'ItemMetadataOf' - } - - /** - * Metadata of an item. - */ - get isV9420(): boolean { - return this.getTypeHash() === 'a2ef643060836070ede73871794a2c9da331285c79b5e9e6f9935723f37af9c6' - } - - /** - * Metadata of an item. - */ - get asV9420(): NftsItemMetadataOfStorageV9420 { - assert(this.isV9420) - return this as any - } -} - -/** - * Metadata of an item. - */ -export interface NftsItemMetadataOfStorageV9420 { - get(key1: number, key2: number): Promise<(v9420.Type_358 | undefined)> - getAll(): Promise - getMany(keys: [number, number][]): Promise<(v9420.Type_358 | undefined)[]> - getKeys(): Promise<[number, number][]> - getKeys(key1: number): Promise<[number, number][]> - getKeys(key1: number, key2: number): Promise<[number, number][]> - getKeysPaged(pageSize: number): AsyncIterable<[number, number][]> - getKeysPaged(pageSize: number, key1: number): AsyncIterable<[number, number][]> - getKeysPaged(pageSize: number, key1: number, key2: number): AsyncIterable<[number, number][]> - getPairs(): Promise<[k: [number, number], v: v9420.Type_358][]> - getPairs(key1: number): Promise<[k: [number, number], v: v9420.Type_358][]> - getPairs(key1: number, key2: number): Promise<[k: [number, number], v: v9420.Type_358][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: [number, number], v: v9420.Type_358][]> - getPairsPaged(pageSize: number, key1: number): AsyncIterable<[k: [number, number], v: v9420.Type_358][]> - getPairsPaged(pageSize: number, key1: number, key2: number): AsyncIterable<[k: [number, number], v: v9420.Type_358][]> -} - -export class UniquesClassStorage extends StorageBase { - protected getPrefix() { - return 'Uniques' - } - - protected getName() { - return 'Class' - } - - /** - * Details of an asset class. - */ - get isV1(): boolean { - return this.getTypeHash() === '1e1179cfd57216efc5c1637c0aa0a4ae6eff2649845c501f9d404542ba254ed4' - } - - /** - * Details of an asset class. - */ - get asV1(): UniquesClassStorageV1 { - assert(this.isV1) - return this as any - } - - /** - * Details of a collection. - */ - get isV9230(): boolean { - return this.getTypeHash() === '7d8bf59996f2d3901df3ccd9b19fb3c13d435bb2d2b67820e7ee13c594f1cb1b' - } - - /** - * Details of a collection. - */ - get asV9230(): UniquesClassStorageV9230 { - assert(this.isV9230) - return this as any - } -} - -/** - * Details of an asset class. - */ -export interface UniquesClassStorageV1 { - get(key: number): Promise<(v1.ClassDetails | undefined)> - getAll(): Promise - getMany(keys: number[]): Promise<(v1.ClassDetails | undefined)[]> - getKeys(): Promise - getKeys(key: number): Promise - getKeysPaged(pageSize: number): AsyncIterable - getKeysPaged(pageSize: number, key: number): AsyncIterable - getPairs(): Promise<[k: number, v: v1.ClassDetails][]> - getPairs(key: number): Promise<[k: number, v: v1.ClassDetails][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: number, v: v1.ClassDetails][]> - getPairsPaged(pageSize: number, key: number): AsyncIterable<[k: number, v: v1.ClassDetails][]> -} - -/** - * Details of a collection. - */ -export interface UniquesClassStorageV9230 { - get(key: number): Promise<(v9230.CollectionDetails | undefined)> - getAll(): Promise - getMany(keys: number[]): Promise<(v9230.CollectionDetails | undefined)[]> - getKeys(): Promise - getKeys(key: number): Promise - getKeysPaged(pageSize: number): AsyncIterable - getKeysPaged(pageSize: number, key: number): AsyncIterable - getPairs(): Promise<[k: number, v: v9230.CollectionDetails][]> - getPairs(key: number): Promise<[k: number, v: v9230.CollectionDetails][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: number, v: v9230.CollectionDetails][]> - getPairsPaged(pageSize: number, key: number): AsyncIterable<[k: number, v: v9230.CollectionDetails][]> -} - -export class UniquesInstanceMetadataOfStorage extends StorageBase { - protected getPrefix() { - return 'Uniques' - } - - protected getName() { - return 'InstanceMetadataOf' - } - - /** - * Metadata of an asset instance. - */ - get isV1(): boolean { - return this.getTypeHash() === '36776a13816cab10cc18dd56fcac5cb2817f77f7b82bf520cc24f74ac55e6f6d' - } - - /** - * Metadata of an asset instance. - */ - get asV1(): UniquesInstanceMetadataOfStorageV1 { - assert(this.isV1) - return this as any - } -} - -/** - * Metadata of an asset instance. - */ -export interface UniquesInstanceMetadataOfStorageV1 { - get(key1: number, key2: number): Promise<(v1.InstanceMetadata | undefined)> - getAll(): Promise - getMany(keys: [number, number][]): Promise<(v1.InstanceMetadata | undefined)[]> - getKeys(): Promise<[number, number][]> - getKeys(key1: number): Promise<[number, number][]> - getKeys(key1: number, key2: number): Promise<[number, number][]> - getKeysPaged(pageSize: number): AsyncIterable<[number, number][]> - getKeysPaged(pageSize: number, key1: number): AsyncIterable<[number, number][]> - getKeysPaged(pageSize: number, key1: number, key2: number): AsyncIterable<[number, number][]> - getPairs(): Promise<[k: [number, number], v: v1.InstanceMetadata][]> - getPairs(key1: number): Promise<[k: [number, number], v: v1.InstanceMetadata][]> - getPairs(key1: number, key2: number): Promise<[k: [number, number], v: v1.InstanceMetadata][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: [number, number], v: v1.InstanceMetadata][]> - getPairsPaged(pageSize: number, key1: number): AsyncIterable<[k: [number, number], v: v1.InstanceMetadata][]> - getPairsPaged(pageSize: number, key1: number, key2: number): AsyncIterable<[k: [number, number], v: v1.InstanceMetadata][]> -} diff --git a/src/types/statemine/support.ts b/src/types/statemine/support.ts deleted file mode 100644 index 56d00498..00000000 --- a/src/types/statemine/support.ts +++ /dev/null @@ -1,131 +0,0 @@ - -export type Result = { - __kind: 'Ok' - value: T -} | { - __kind: 'Err' - value: E -} - - -export type Option = { - __kind: 'Some', - value: T -} | { - __kind: 'None' -} - - -export interface Chain { - getEventHash(eventName: string): string - decodeEvent(event: Event): any - getCallHash(name: string): string - decodeCall(call: Call): any - getStorageItemTypeHash(prefix: string, name: string): string | undefined - getStorage(blockHash: string, prefix: string, name: string, ...args: any[]): Promise - queryStorage2(blockHash: string, prefix: string, name: string, keyList?: any[]): Promise - getKeys(blockHash: string, prefix: string, name: string, ...args: any[]): Promise - getPairs(blockHash: string, prefix: string, name: string, ...args: any[]): Promise - getKeysPaged(pageSize: number, blockHash: string, prefix: string, name: string, ...args: any[]): AsyncIterable - getPairsPaged(pageSize: number, blockHash: string, prefix: string, name: string, ...args: any[]): AsyncIterable<[key: any, value: any][]> - getConstantTypeHash(pallet: string, name: string): string | undefined - getConstant(pallet: string, name: string): any -} - - -export interface ChainContext { - _chain: Chain -} - - -export interface Event { - name: string - args: any -} - - -export interface EventContext extends ChainContext { - event: Event -} - - -export interface Call { - name: string - args: any -} - - -export interface CallContext extends ChainContext { - call: Call -} - - -export interface BlockContext extends ChainContext { - block: Block -} - - -export interface Block { - hash: string -} - - -export class StorageBase { - protected readonly _chain: Chain - protected readonly blockHash: string - - constructor(ctx: BlockContext) - constructor(ctx: ChainContext, block: Block) - constructor(ctx: BlockContext, block?: Block) { - block = block || ctx.block - this.blockHash = block.hash - this._chain = ctx._chain - } - - protected getPrefix(): string { - throw new Error('Not implemented') - } - - protected getName(): string { - throw new Error('Not implemented') - } - - protected getTypeHash(): string | undefined { - return this._chain.getStorageItemTypeHash(this.getPrefix(), this.getName()) - } - - /** - * Checks whether the storage item is defined for the current chain version. - */ - get isExists(): boolean { - return this.getTypeHash() != null - } - - protected get(...args: any[]): Promise { - return this._chain.getStorage(this.blockHash, this.getPrefix(), this.getName(), ...args) - } - - protected getMany(keyList: any[]): Promise { - return this._chain.queryStorage2(this.blockHash, this.getPrefix(), this.getName(), keyList) - } - - protected getAll(): Promise { - return this._chain.queryStorage2(this.blockHash, this.getPrefix(), this.getName()) - } - - protected getKeys(...args: any[]): Promise { - return this._chain.getKeys(this.blockHash, this.getPrefix(), this.getName(), ...args) - } - - protected getKeysPaged(pageSize: number, ...args: any[]): AsyncIterable { - return this._chain.getKeysPaged(pageSize, this.blockHash, this.getPrefix(), this.getName(), ...args) - } - - protected getPairs(...args: any[]): Promise<[k: any, v: any][]> { - return this._chain.getPairs(this.blockHash, this.getPrefix(), this.getName(), ...args) - } - - protected getPairsPaged(pageSize: number, ...args: any[]): AsyncIterable<[k: any, v: any][]> { - return this._chain.getPairsPaged(pageSize, this.blockHash, this.getPrefix(), this.getName(), ...args) - } -} diff --git a/src/types/statemine/v1.ts b/src/types/statemine/v1.ts deleted file mode 100644 index df7c5dd9..00000000 --- a/src/types/statemine/v1.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type {Result, Option} from './support' - -export interface ClassDetails { - owner: Uint8Array - issuer: Uint8Array - admin: Uint8Array - freezer: Uint8Array - totalDeposit: bigint - freeHolding: boolean - instances: number - instanceMetadatas: number - attributes: number - isFrozen: boolean -} - -export interface InstanceMetadata { - deposit: bigint - data: Uint8Array - isFrozen: boolean -} diff --git a/src/types/statemine/v9230.ts b/src/types/statemine/v9230.ts deleted file mode 100644 index 489a86b1..00000000 --- a/src/types/statemine/v9230.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type {Result, Option} from './support' - -export interface CollectionDetails { - owner: Uint8Array - issuer: Uint8Array - admin: Uint8Array - freezer: Uint8Array - totalDeposit: bigint - freeHolding: boolean - items: number - itemMetadatas: number - attributes: number - isFrozen: boolean -} diff --git a/src/types/statemine/v9420.ts b/src/types/statemine/v9420.ts deleted file mode 100644 index 3f0fae42..00000000 --- a/src/types/statemine/v9420.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type {Result, Option} from './support' - -export type AttributeNamespace = AttributeNamespace_Pallet | AttributeNamespace_CollectionOwner | AttributeNamespace_ItemOwner | AttributeNamespace_Account - -export interface AttributeNamespace_Pallet { - __kind: 'Pallet' -} - -export interface AttributeNamespace_CollectionOwner { - __kind: 'CollectionOwner' -} - -export interface AttributeNamespace_ItemOwner { - __kind: 'ItemOwner' -} - -export interface AttributeNamespace_Account { - __kind: 'Account' - value: Uint8Array -} - -export type PalletAttributes = PalletAttributes_UsedToClaim - -export interface PalletAttributes_UsedToClaim { - __kind: 'UsedToClaim' - value: number -} - -export interface PriceWithDirection { - amount: bigint - direction: PriceDirection -} - -export interface Type_348 { - owner: Uint8Array - ownerDeposit: bigint - items: number - itemMetadatas: number - itemConfigs: number - attributes: number -} - -export interface Type_358 { - deposit: ItemMetadataDeposit - data: Uint8Array -} - -export type PriceDirection = PriceDirection_Send | PriceDirection_Receive - -export interface PriceDirection_Send { - __kind: 'Send' -} - -export interface PriceDirection_Receive { - __kind: 'Receive' -} - -export interface ItemMetadataDeposit { - account: (Uint8Array | undefined) - amount: bigint -} diff --git a/src/types/statemine/v9430.ts b/src/types/statemine/v9430.ts deleted file mode 100644 index 2d25057c..00000000 --- a/src/types/statemine/v9430.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type {Result, Option} from './support' - -export type PalletAttributes = PalletAttributes_UsedToClaim | PalletAttributes_TransferDisabled - -export interface PalletAttributes_UsedToClaim { - __kind: 'UsedToClaim' - value: number -} - -export interface PalletAttributes_TransferDisabled { - __kind: 'TransferDisabled' -} diff --git a/src/types/statemint/events.ts b/src/types/statemint/events.ts deleted file mode 100644 index abd5630d..00000000 --- a/src/types/statemint/events.ts +++ /dev/null @@ -1,2366 +0,0 @@ -import assert from 'assert' -import {Chain, ChainContext, EventContext, Event, Result, Option} from './support' -import * as v9430 from './v9430' - -export class NftsAllApprovalsCancelledEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.AllApprovalsCancelled') - this._chain = ctx._chain - this.event = event - } - - /** - * All approvals of an item got cancelled. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.AllApprovalsCancelled') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * All approvals of an item got cancelled. - */ - get asV9430(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsApprovalCancelledEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ApprovalCancelled') - this._chain = ctx._chain - this.event = event - } - - /** - * An approval for a `delegate` account to transfer the `item` of an item - * `collection` was cancelled by its `owner`. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ApprovalCancelled') === '28e2099402db057489fed1d463d382a488f95bb3d119379aef54f500296b1d83' - } - - /** - * An approval for a `delegate` account to transfer the `item` of an item - * `collection` was cancelled by its `owner`. - */ - get asV9430(): {collection: number, item: number, owner: Uint8Array, delegate: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsAttributeClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.AttributeCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Attribute metadata has been cleared for a `collection` or `item`. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.AttributeCleared') === '4d246c14b51f1093b2b931b12ca433d89593c617b09ce2082dfc43ef8671765e' - } - - /** - * Attribute metadata has been cleared for a `collection` or `item`. - */ - get asV9430(): {collection: number, maybeItem: (number | undefined), key: Uint8Array, namespace: v9430.AttributeNamespace} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsAttributeSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.AttributeSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New attribute metadata has been set for a `collection` or `item`. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.AttributeSet') === 'df375b4dee7b64ffeab47159334313f546d6fbe1d31d90f2253a667f6ac2799f' - } - - /** - * New attribute metadata has been set for a `collection` or `item`. - */ - get asV9430(): {collection: number, maybeItem: (number | undefined), key: Uint8Array, value: Uint8Array, namespace: v9430.AttributeNamespace} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsBurnedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Burned') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` was destroyed. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.Burned') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * An `item` was destroyed. - */ - get asV9430(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionConfigChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionConfigChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * A `collection` has had its config changed by the `Force` origin. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.CollectionConfigChanged') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * A `collection` has had its config changed by the `Force` origin. - */ - get asV9430(): {collection: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionLockedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionLocked') - this._chain = ctx._chain - this.event = event - } - - /** - * Some `collection` was locked. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.CollectionLocked') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Some `collection` was locked. - */ - get asV9430(): {collection: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionMaxSupplySetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionMaxSupplySet') - this._chain = ctx._chain - this.event = event - } - - /** - * Max supply has been set for a collection. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.CollectionMaxSupplySet') === '165991456bc3c6a81994ce513fdf36c2303f5220829f5e8caafbf821233135b4' - } - - /** - * Max supply has been set for a collection. - */ - get asV9430(): {collection: number, maxSupply: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionMetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for a `collection`. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.CollectionMetadataCleared') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Metadata has been cleared for a `collection`. - */ - get asV9430(): {collection: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionMetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for a `collection`. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.CollectionMetadataSet') === 'fbd84faf888505e9d8faf18bd544737c4436c745e6318c812a3065bb1a666c44' - } - - /** - * New metadata has been set for a `collection`. - */ - get asV9430(): {collection: number, data: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCollectionMintSettingsUpdatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.CollectionMintSettingsUpdated') - this._chain = ctx._chain - this.event = event - } - - /** - * Mint settings for a collection had changed. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.CollectionMintSettingsUpdated') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Mint settings for a collection had changed. - */ - get asV9430(): {collection: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Created') - this._chain = ctx._chain - this.event = event - } - - /** - * A `collection` was created. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.Created') === 'a5c293082b1f3ffb16eaecc5b8d430ca1bb8c7bd090079ebcefcbf303cbfec61' - } - - /** - * A `collection` was created. - */ - get asV9430(): {collection: number, creator: Uint8Array, owner: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsDestroyedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Destroyed') - this._chain = ctx._chain - this.event = event - } - - /** - * A `collection` was destroyed. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.Destroyed') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * A `collection` was destroyed. - */ - get asV9430(): {collection: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsForceCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ForceCreated') - this._chain = ctx._chain - this.event = event - } - - /** - * A `collection` was force-created. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ForceCreated') === '6059bcf1dd7c48dc760f017d00a2c7c6719e745b3de9bde2046cbe26347c562f' - } - - /** - * A `collection` was force-created. - */ - get asV9430(): {collection: number, owner: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsIssuedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Issued') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` was issued. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.Issued') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * An `item` was issued. - */ - get asV9430(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemAttributesApprovalAddedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemAttributesApprovalAdded') - this._chain = ctx._chain - this.event = event - } - - /** - * A new approval to modify item attributes was added. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemAttributesApprovalAdded') === '16137639784e12ee57d143b35251349ede19f9139a7b372c2c033564309a1aaa' - } - - /** - * A new approval to modify item attributes was added. - */ - get asV9430(): {collection: number, item: number, delegate: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemAttributesApprovalRemovedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemAttributesApprovalRemoved') - this._chain = ctx._chain - this.event = event - } - - /** - * A new approval to modify item attributes was removed. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemAttributesApprovalRemoved') === '16137639784e12ee57d143b35251349ede19f9139a7b372c2c033564309a1aaa' - } - - /** - * A new approval to modify item attributes was removed. - */ - get asV9430(): {collection: number, item: number, delegate: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemBoughtEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemBought') - this._chain = ctx._chain - this.event = event - } - - /** - * An item was bought. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemBought') === 'db915144f3a96c73a3031d37c874507dcac06fd77bca9962f672bc9bfb557489' - } - - /** - * An item was bought. - */ - get asV9430(): {collection: number, item: number, price: bigint, seller: Uint8Array, buyer: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemMetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for an item. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemMetadataCleared') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * Metadata has been cleared for an item. - */ - get asV9430(): {collection: number, item: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemMetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for an item. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemMetadataSet') === '83275a0de68e1c50aff60fe3090e27ba46bb68a77375edc5172d160af095826d' - } - - /** - * New metadata has been set for an item. - */ - get asV9430(): {collection: number, item: number, data: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemPriceRemovedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemPriceRemoved') - this._chain = ctx._chain - this.event = event - } - - /** - * The price for the item was removed. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemPriceRemoved') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * The price for the item was removed. - */ - get asV9430(): {collection: number, item: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemPriceSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemPriceSet') - this._chain = ctx._chain - this.event = event - } - - /** - * The price was set for the item. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemPriceSet') === '10d4911c332080c5a5c1e6c248347d1174817ab96906747e2c40df18c5381944' - } - - /** - * The price was set for the item. - */ - get asV9430(): {collection: number, item: number, price: bigint, whitelistedBuyer: (Uint8Array | undefined)} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemPropertiesLockedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemPropertiesLocked') - this._chain = ctx._chain - this.event = event - } - - /** - * `item` metadata or attributes were locked. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemPropertiesLocked') === 'b6965c94a3e24b173446abb1e12a56b541de3d666894c46f3753c4d9029db290' - } - - /** - * `item` metadata or attributes were locked. - */ - get asV9430(): {collection: number, item: number, lockMetadata: boolean, lockAttributes: boolean} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemTransferLockedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemTransferLocked') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` became non-transferable. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemTransferLocked') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * An `item` became non-transferable. - */ - get asV9430(): {collection: number, item: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsItemTransferUnlockedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.ItemTransferUnlocked') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` became transferable. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.ItemTransferUnlocked') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * An `item` became transferable. - */ - get asV9430(): {collection: number, item: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsNextCollectionIdIncrementedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.NextCollectionIdIncremented') - this._chain = ctx._chain - this.event = event - } - - /** - * Event gets emitted when the `NextCollectionId` gets incremented. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.NextCollectionIdIncremented') === '637ef8f6ab36ea6441937975da16ec6128d3ac503fd8ae7bc04131ff93640dc2' - } - - /** - * Event gets emitted when the `NextCollectionId` gets incremented. - */ - get asV9430(): {nextId: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsOwnerChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.OwnerChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * The owner changed. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.OwnerChanged') === '0331b0b161c2f2db690f574540ade7765af19f5306dc65443561fbaa5825f323' - } - - /** - * The owner changed. - */ - get asV9430(): {collection: number, newOwner: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsOwnershipAcceptanceChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.OwnershipAcceptanceChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * Ownership acceptance has changed for an account. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.OwnershipAcceptanceChanged') === '62f0a146ea419b03ef3bb5c912782af0253639ca8fc47ff318396bedef2230cc' - } - - /** - * Ownership acceptance has changed for an account. - */ - get asV9430(): {who: Uint8Array, maybeCollection: (number | undefined)} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsPalletAttributeSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.PalletAttributeSet') - this._chain = ctx._chain - this.event = event - } - - /** - * A new attribute in the `Pallet` namespace was set for the `collection` or an `item` - * within that `collection`. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.PalletAttributeSet') === '468a1a89b31826460104c40759efeb63ceefdd69a6f12d9f82160b20376b0cb6' - } - - /** - * A new attribute in the `Pallet` namespace was set for the `collection` or an `item` - * within that `collection`. - */ - get asV9430(): {collection: number, item: (number | undefined), attribute: v9430.PalletAttributes, value: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsPreSignedAttributesSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.PreSignedAttributesSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New attributes have been set for an `item` of the `collection`. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.PreSignedAttributesSet') === '3187a106d1f5607c0c25a6deef04d48112079b32dd61370affb8b10ee21bdca5' - } - - /** - * New attributes have been set for an `item` of the `collection`. - */ - get asV9430(): {collection: number, item: number, namespace: v9430.AttributeNamespace} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsSwapCancelledEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.SwapCancelled') - this._chain = ctx._chain - this.event = event - } - - /** - * The swap was cancelled. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.SwapCancelled') === '203695181f6ad5b8cfab290f9b1f5673a0bfbdc9ad4b967b47d2f74b981865da' - } - - /** - * The swap was cancelled. - */ - get asV9430(): {offeredCollection: number, offeredItem: number, desiredCollection: number, desiredItem: (number | undefined), price: (v9430.PriceWithDirection | undefined), deadline: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsSwapClaimedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.SwapClaimed') - this._chain = ctx._chain - this.event = event - } - - /** - * The swap has been claimed. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.SwapClaimed') === 'a32b04673263c9758fac7dc7b2ee372deba818fe72f157dd9a3baa5b02f6d66e' - } - - /** - * The swap has been claimed. - */ - get asV9430(): {sentCollection: number, sentItem: number, sentItemOwner: Uint8Array, receivedCollection: number, receivedItem: number, receivedItemOwner: Uint8Array, price: (v9430.PriceWithDirection | undefined), deadline: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsSwapCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.SwapCreated') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` swap intent was created. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.SwapCreated') === '203695181f6ad5b8cfab290f9b1f5673a0bfbdc9ad4b967b47d2f74b981865da' - } - - /** - * An `item` swap intent was created. - */ - get asV9430(): {offeredCollection: number, offeredItem: number, desiredCollection: number, desiredItem: (number | undefined), price: (v9430.PriceWithDirection | undefined), deadline: number} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsTeamChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.TeamChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * The management team changed. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.TeamChanged') === '7d04eb24156118efda8b963ba4549a6d4ad4a1af762296e453e42e231805cd54' - } - - /** - * The management team changed. - */ - get asV9430(): {collection: number, issuer: (Uint8Array | undefined), admin: (Uint8Array | undefined), freezer: (Uint8Array | undefined)} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsTipSentEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.TipSent') - this._chain = ctx._chain - this.event = event - } - - /** - * A tip was sent. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.TipSent') === '6508b276e46d4188520e47ddb8bf0513b8c2e8b4e9dea63e25496bc5ca934424' - } - - /** - * A tip was sent. - */ - get asV9430(): {collection: number, item: number, sender: Uint8Array, receiver: Uint8Array, amount: bigint} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsTransferApprovedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.TransferApproved') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` of a `collection` has been approved by the `owner` for transfer by - * a `delegate`. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.TransferApproved') === '71620a6e85bb8bb5d9e315805e790e3baae8f271dee82324db43d472e2a8d860' - } - - /** - * An `item` of a `collection` has been approved by the `owner` for transfer by - * a `delegate`. - */ - get asV9430(): {collection: number, item: number, owner: Uint8Array, delegate: Uint8Array, deadline: (number | undefined)} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class NftsTransferredEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Nfts.Transferred') - this._chain = ctx._chain - this.event = event - } - - /** - * An `item` was transferred. - */ - get isV9430(): boolean { - return this._chain.getEventHash('Nfts.Transferred') === 'ac8c1c5a1df2a464e3447d13d6c43a813112a33c144f93775b934b08c086bf7a' - } - - /** - * An `item` was transferred. - */ - get asV9430(): {collection: number, item: number, from: Uint8Array, to: Uint8Array} { - assert(this.isV9430) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesAttributeClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.AttributeCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Attribute metadata has been cleared for an asset class or instance. - * \[ class, maybe_instance, key, maybe_value \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.AttributeCleared') === '885b4dbb6c48840d1cb04f9f8a73f65455ff8e630c9692e7b8efbb5abf341a92' - } - - /** - * Attribute metadata has been cleared for an asset class or instance. - * \[ class, maybe_instance, key, maybe_value \] - */ - get asV601(): [number, (number | undefined), Uint8Array] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * Attribute metadata has been cleared for an asset class or instance. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.AttributeCleared') === '91aa106b700026eb59ef1d86cbd22766539a996d1d1d5cb5dbbdc18439ff1283' - } - - /** - * Attribute metadata has been cleared for an asset class or instance. - */ - get asV700(): {class: number, maybeInstance: (number | undefined), key: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * Attribute metadata has been cleared for a `collection` or `item`. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.AttributeCleared') === 'c330ddd00fb87b92c796bc29cff6edf2ce546dd8eb98420ac23c5cbe7b0e11d1' - } - - /** - * Attribute metadata has been cleared for a `collection` or `item`. - */ - get asV9230(): {collection: number, maybeItem: (number | undefined), key: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesAttributeSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.AttributeSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New attribute metadata has been set for an asset class or instance. - * \[ class, maybe_instance, key, value \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.AttributeSet') === '135c19d2cf1f530340d3fe938fdcce6ca358d729cfc69ce595cc57b640136a76' - } - - /** - * New attribute metadata has been set for an asset class or instance. - * \[ class, maybe_instance, key, value \] - */ - get asV601(): [number, (number | undefined), Uint8Array, Uint8Array] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * New attribute metadata has been set for an asset class or instance. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.AttributeSet') === '6ae49a979267c094bc35bda051f5467e62472724b598a2f5ee5720a5111b8623' - } - - /** - * New attribute metadata has been set for an asset class or instance. - */ - get asV700(): {class: number, maybeInstance: (number | undefined), key: Uint8Array, value: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * New attribute metadata has been set for a `collection` or `item`. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.AttributeSet') === 'b7e65dbf62f10e9415ffa560bff4954ffeb28994c9cf350ecd59fe98850d8783' - } - - /** - * New attribute metadata has been set for a `collection` or `item`. - */ - get asV9230(): {collection: number, maybeItem: (number | undefined), key: Uint8Array, value: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesBurnedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Burned') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset `instance` was destroyed. \[ class, instance, owner \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.Burned') === '7b53bb12306431c6ff23a3ea3466183ed1c7f4ecb417f6e8467ae0c63cbc2f88' - } - - /** - * An asset `instance` was destroyed. \[ class, instance, owner \] - */ - get asV601(): [number, number, Uint8Array] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset `instance` was destroyed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Burned') === '448723f6c40490fe04ab8e6d9e382432b7ce5c075d05af60c076b9f6a8a9e510' - } - - /** - * An asset `instance` was destroyed. - */ - get asV700(): {class: number, instance: number, owner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * An `item` was destroyed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Burned') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * An `item` was destroyed. - */ - get asV9230(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesClassFrozenEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ClassFrozen') - this._chain = ctx._chain - this.event = event - } - - /** - * Some asset `class` was frozen. \[ class \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.ClassFrozen') === '0a0f30b1ade5af5fade6413c605719d59be71340cf4884f65ee9858eb1c38f6c' - } - - /** - * Some asset `class` was frozen. \[ class \] - */ - get asV601(): number { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * Some asset `class` was frozen. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ClassFrozen') === '4f045c4df2d4b9045175427f6f6aa548cd3ad56207f700b68254d3b77d944310' - } - - /** - * Some asset `class` was frozen. - */ - get asV700(): {class: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesClassMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ClassMetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for an asset class. \[ class \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.ClassMetadataCleared') === '0a0f30b1ade5af5fade6413c605719d59be71340cf4884f65ee9858eb1c38f6c' - } - - /** - * Metadata has been cleared for an asset class. \[ class \] - */ - get asV601(): number { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * Metadata has been cleared for an asset class. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ClassMetadataCleared') === '4f045c4df2d4b9045175427f6f6aa548cd3ad56207f700b68254d3b77d944310' - } - - /** - * Metadata has been cleared for an asset class. - */ - get asV700(): {class: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesClassMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ClassMetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for an asset class. \[ class, data, is_frozen \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.ClassMetadataSet') === '5792f3fb3e6c02cd51090283e81fd6d6cf13fe8a50876dcc428a6b9314aa3f72' - } - - /** - * New metadata has been set for an asset class. \[ class, data, is_frozen \] - */ - get asV601(): [number, Uint8Array, boolean] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * New metadata has been set for an asset class. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ClassMetadataSet') === '151c432def6b2dc27880b815773b729a1ceb58295a326de4c16e57901c2a9476' - } - - /** - * New metadata has been set for an asset class. - */ - get asV700(): {class: number, data: Uint8Array, isFrozen: boolean} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesClassThawedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ClassThawed') - this._chain = ctx._chain - this.event = event - } - - /** - * Some asset `class` was thawed. \[ class \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.ClassThawed') === '0a0f30b1ade5af5fade6413c605719d59be71340cf4884f65ee9858eb1c38f6c' - } - - /** - * Some asset `class` was thawed. \[ class \] - */ - get asV601(): number { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * Some asset `class` was thawed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ClassThawed') === '4f045c4df2d4b9045175427f6f6aa548cd3ad56207f700b68254d3b77d944310' - } - - /** - * Some asset `class` was thawed. - */ - get asV700(): {class: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionFrozenEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionFrozen') - this._chain = ctx._chain - this.event = event - } - - /** - * Some `collection` was frozen. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionFrozen') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Some `collection` was frozen. - */ - get asV9230(): {collection: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionMaxSupplySetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionMaxSupplySet') - this._chain = ctx._chain - this.event = event - } - - /** - * Max supply has been set for a collection. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionMaxSupplySet') === '165991456bc3c6a81994ce513fdf36c2303f5220829f5e8caafbf821233135b4' - } - - /** - * Max supply has been set for a collection. - */ - get asV9230(): {collection: number, maxSupply: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionMetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for a `collection`. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionMetadataCleared') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Metadata has been cleared for a `collection`. - */ - get asV9230(): {collection: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionMetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for a `collection`. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionMetadataSet') === '63ef75086da73b45ed287cac6640abbebd40222433fb8fae9e4fa1bfa173afc2' - } - - /** - * New metadata has been set for a `collection`. - */ - get asV9230(): {collection: number, data: Uint8Array, isFrozen: boolean} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCollectionThawedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.CollectionThawed') - this._chain = ctx._chain - this.event = event - } - - /** - * Some `collection` was thawed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.CollectionThawed') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * Some `collection` was thawed. - */ - get asV9230(): {collection: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Created') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset class was created. \[ class, creator, owner \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.Created') === 'f968eb148e0dc7739feb64d5c72eea0de823dbf44259d08f9a6218f8117bf19a' - } - - /** - * An asset class was created. \[ class, creator, owner \] - */ - get asV601(): [number, Uint8Array, Uint8Array] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset class was created. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Created') === '7f77877d6861fb103cb861e568c28c6112b4f0daecbb1931ca2b5d4e733fdacd' - } - - /** - * An asset class was created. - */ - get asV700(): {class: number, creator: Uint8Array, owner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * A `collection` was created. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Created') === 'a5c293082b1f3ffb16eaecc5b8d430ca1bb8c7bd090079ebcefcbf303cbfec61' - } - - /** - * A `collection` was created. - */ - get asV9230(): {collection: number, creator: Uint8Array, owner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesDestroyedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Destroyed') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset `class` was destroyed. \[ class \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.Destroyed') === '0a0f30b1ade5af5fade6413c605719d59be71340cf4884f65ee9858eb1c38f6c' - } - - /** - * An asset `class` was destroyed. \[ class \] - */ - get asV601(): number { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset `class` was destroyed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Destroyed') === '4f045c4df2d4b9045175427f6f6aa548cd3ad56207f700b68254d3b77d944310' - } - - /** - * An asset `class` was destroyed. - */ - get asV700(): {class: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * A `collection` was destroyed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Destroyed') === 'a84ae2f0e555d689a7b5b0ee2914bd693902b07afc4f268377240f6ac92495cb' - } - - /** - * A `collection` was destroyed. - */ - get asV9230(): {collection: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesForceCreatedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ForceCreated') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset class was force-created. \[ class, owner \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.ForceCreated') === '0379562584d6426ccff49705dfa9dba95ad94215b772fd97d0ad0c4ca0001c12' - } - - /** - * An asset class was force-created. \[ class, owner \] - */ - get asV601(): [number, Uint8Array] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset class was force-created. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.ForceCreated') === 'd51b7ff0e8d25eeb64fd1351f5eafbd20c22e12baddedd443f9831da21e235ea' - } - - /** - * An asset class was force-created. - */ - get asV700(): {class: number, owner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * A `collection` was force-created. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.ForceCreated') === '6059bcf1dd7c48dc760f017d00a2c7c6719e745b3de9bde2046cbe26347c562f' - } - - /** - * A `collection` was force-created. - */ - get asV9230(): {collection: number, owner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesFrozenEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Frozen') - this._chain = ctx._chain - this.event = event - } - - /** - * Some asset `instance` was frozen. \[ class, instance \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.Frozen') === 'a09602e40984745a7411a1855af06d133893a422fd68f7bdc4fb6a56bf1a3645' - } - - /** - * Some asset `instance` was frozen. \[ class, instance \] - */ - get asV601(): [number, number] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * Some asset `instance` was frozen. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Frozen') === '4aec04ec96e3cd667bd16926634d063c18da9922e4d645f33692574e196c20dc' - } - - /** - * Some asset `instance` was frozen. - */ - get asV700(): {class: number, instance: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * Some `item` was frozen. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Frozen') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * Some `item` was frozen. - */ - get asV9230(): {collection: number, item: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesIssuedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Issued') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset `instance` was issued. \[ class, instance, owner \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.Issued') === '7b53bb12306431c6ff23a3ea3466183ed1c7f4ecb417f6e8467ae0c63cbc2f88' - } - - /** - * An asset `instance` was issued. \[ class, instance, owner \] - */ - get asV601(): [number, number, Uint8Array] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset `instance` was issued. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Issued') === '448723f6c40490fe04ab8e6d9e382432b7ce5c075d05af60c076b9f6a8a9e510' - } - - /** - * An asset `instance` was issued. - */ - get asV700(): {class: number, instance: number, owner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * An `item` was issued. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Issued') === '281c96f4233cbe042ed549cfca1fafa833d625f8d832ed29682ac34cdceb017d' - } - - /** - * An `item` was issued. - */ - get asV9230(): {collection: number, item: number, owner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesItemBoughtEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ItemBought') - this._chain = ctx._chain - this.event = event - } - - /** - * An item was bought. - */ - get isV9270(): boolean { - return this._chain.getEventHash('Uniques.ItemBought') === 'db915144f3a96c73a3031d37c874507dcac06fd77bca9962f672bc9bfb557489' - } - - /** - * An item was bought. - */ - get asV9270(): {collection: number, item: number, price: bigint, seller: Uint8Array, buyer: Uint8Array} { - assert(this.isV9270) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesItemPriceRemovedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ItemPriceRemoved') - this._chain = ctx._chain - this.event = event - } - - /** - * The price for the instance was removed. - */ - get isV9270(): boolean { - return this._chain.getEventHash('Uniques.ItemPriceRemoved') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * The price for the instance was removed. - */ - get asV9270(): {collection: number, item: number} { - assert(this.isV9270) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesItemPriceSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.ItemPriceSet') - this._chain = ctx._chain - this.event = event - } - - /** - * The price was set for the instance. - */ - get isV9270(): boolean { - return this._chain.getEventHash('Uniques.ItemPriceSet') === '10d4911c332080c5a5c1e6c248347d1174817ab96906747e2c40df18c5381944' - } - - /** - * The price was set for the instance. - */ - get asV9270(): {collection: number, item: number, price: bigint, whitelistedBuyer: (Uint8Array | undefined)} { - assert(this.isV9270) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesMetadataClearedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.MetadataCleared') - this._chain = ctx._chain - this.event = event - } - - /** - * Metadata has been cleared for an asset instance. \[ class, instance \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.MetadataCleared') === 'a09602e40984745a7411a1855af06d133893a422fd68f7bdc4fb6a56bf1a3645' - } - - /** - * Metadata has been cleared for an asset instance. \[ class, instance \] - */ - get asV601(): [number, number] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * Metadata has been cleared for an asset instance. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.MetadataCleared') === '4aec04ec96e3cd667bd16926634d063c18da9922e4d645f33692574e196c20dc' - } - - /** - * Metadata has been cleared for an asset instance. - */ - get asV700(): {class: number, instance: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * Metadata has been cleared for an item. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.MetadataCleared') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * Metadata has been cleared for an item. - */ - get asV9230(): {collection: number, item: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesMetadataSetEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.MetadataSet') - this._chain = ctx._chain - this.event = event - } - - /** - * New metadata has been set for an asset instance. - * \[ class, instance, data, is_frozen \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.MetadataSet') === '7895150acb61111b7c6318ded185579b696175877e3d9b7bae2664d131eb3e65' - } - - /** - * New metadata has been set for an asset instance. - * \[ class, instance, data, is_frozen \] - */ - get asV601(): [number, number, Uint8Array, boolean] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * New metadata has been set for an asset instance. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.MetadataSet') === '8d2f67e787668073bdb66a4b7bbba97ea22da0860f46bce7884b446fd055419a' - } - - /** - * New metadata has been set for an asset instance. - */ - get asV700(): {class: number, instance: number, data: Uint8Array, isFrozen: boolean} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * New metadata has been set for an item. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.MetadataSet') === 'dc2370253c17fe69445af313af0113a31f244cc51324e5a3b4b0b98804f91a6f' - } - - /** - * New metadata has been set for an item. - */ - get asV9230(): {collection: number, item: number, data: Uint8Array, isFrozen: boolean} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesOwnerChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.OwnerChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * The owner changed \[ class, new_owner \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.OwnerChanged') === '0379562584d6426ccff49705dfa9dba95ad94215b772fd97d0ad0c4ca0001c12' - } - - /** - * The owner changed \[ class, new_owner \] - */ - get asV601(): [number, Uint8Array] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * The owner changed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.OwnerChanged') === '7f21331ba73970553e198c5598e55e9857317b38adaa7f293e914882bdd7385c' - } - - /** - * The owner changed. - */ - get asV700(): {class: number, newOwner: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * The owner changed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.OwnerChanged') === '0331b0b161c2f2db690f574540ade7765af19f5306dc65443561fbaa5825f323' - } - - /** - * The owner changed. - */ - get asV9230(): {collection: number, newOwner: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesOwnershipAcceptanceChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.OwnershipAcceptanceChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * Ownership acceptance has changed for an account. - */ - get isV900(): boolean { - return this._chain.getEventHash('Uniques.OwnershipAcceptanceChanged') === '78fde0ff8f56c4ebcc47231a34e394471cbf03f4b56f9fa6854cecafab37242d' - } - - /** - * Ownership acceptance has changed for an account. - */ - get asV900(): {who: Uint8Array, maybeClass: (number | undefined)} { - assert(this.isV900) - return this._chain.decodeEvent(this.event) - } - - /** - * Ownership acceptance has changed for an account. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.OwnershipAcceptanceChanged') === '62f0a146ea419b03ef3bb5c912782af0253639ca8fc47ff318396bedef2230cc' - } - - /** - * Ownership acceptance has changed for an account. - */ - get asV9230(): {who: Uint8Array, maybeCollection: (number | undefined)} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesTeamChangedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.TeamChanged') - this._chain = ctx._chain - this.event = event - } - - /** - * The management team changed \[ class, issuer, admin, freezer \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.TeamChanged') === '608cf8b84887966db26c958a6b826fd41d8e098263ce7eaae9a421f1f8b1bd56' - } - - /** - * The management team changed \[ class, issuer, admin, freezer \] - */ - get asV601(): [number, Uint8Array, Uint8Array, Uint8Array] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * The management team changed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.TeamChanged') === 'ed55b7c512c680f9a9b8f35a0e603e101cd439e8b1c07373e1b6b2ca40d032f7' - } - - /** - * The management team changed. - */ - get asV700(): {class: number, issuer: Uint8Array, admin: Uint8Array, freezer: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * The management team changed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.TeamChanged') === '152cd89e42995f09fd841e2eeec18a6a0ca02740e481dc98e45b182742b5172e' - } - - /** - * The management team changed. - */ - get asV9230(): {collection: number, issuer: Uint8Array, admin: Uint8Array, freezer: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesThawedEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Thawed') - this._chain = ctx._chain - this.event = event - } - - /** - * Some asset `instance` was thawed. \[ class, instance \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.Thawed') === 'a09602e40984745a7411a1855af06d133893a422fd68f7bdc4fb6a56bf1a3645' - } - - /** - * Some asset `instance` was thawed. \[ class, instance \] - */ - get asV601(): [number, number] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * Some asset `instance` was thawed. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Thawed') === '4aec04ec96e3cd667bd16926634d063c18da9922e4d645f33692574e196c20dc' - } - - /** - * Some asset `instance` was thawed. - */ - get asV700(): {class: number, instance: number} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * Some `item` was thawed. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Thawed') === 'ac39ace3905de6db862660444374575fb7ed5f403845b475c7f2addc21c71f91' - } - - /** - * Some `item` was thawed. - */ - get asV9230(): {collection: number, item: number} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} - -export class UniquesTransferredEvent { - private readonly _chain: Chain - private readonly event: Event - - constructor(ctx: EventContext) - constructor(ctx: ChainContext, event: Event) - constructor(ctx: EventContext, event?: Event) { - event = event || ctx.event - assert(event.name === 'Uniques.Transferred') - this._chain = ctx._chain - this.event = event - } - - /** - * An asset `instance` was transferred. \[ class, instance, from, to \] - */ - get isV601(): boolean { - return this._chain.getEventHash('Uniques.Transferred') === '5d3fa4f2b87c3626df0e27d53288bc8519502854bcd4a4f83b5b48102417e8d1' - } - - /** - * An asset `instance` was transferred. \[ class, instance, from, to \] - */ - get asV601(): [number, number, Uint8Array, Uint8Array] { - assert(this.isV601) - return this._chain.decodeEvent(this.event) - } - - /** - * An asset `instance` was transferred. - */ - get isV700(): boolean { - return this._chain.getEventHash('Uniques.Transferred') === '62805427bf03dcd5763c135e667e4d08319c26623a7eecd16e8463cac99132b0' - } - - /** - * An asset `instance` was transferred. - */ - get asV700(): {class: number, instance: number, from: Uint8Array, to: Uint8Array} { - assert(this.isV700) - return this._chain.decodeEvent(this.event) - } - - /** - * An `item` was transferred. - */ - get isV9230(): boolean { - return this._chain.getEventHash('Uniques.Transferred') === 'ac8c1c5a1df2a464e3447d13d6c43a813112a33c144f93775b934b08c086bf7a' - } - - /** - * An `item` was transferred. - */ - get asV9230(): {collection: number, item: number, from: Uint8Array, to: Uint8Array} { - assert(this.isV9230) - return this._chain.decodeEvent(this.event) - } -} diff --git a/src/types/statemint/storage.ts b/src/types/statemint/storage.ts deleted file mode 100644 index a2b74207..00000000 --- a/src/types/statemint/storage.ts +++ /dev/null @@ -1,213 +0,0 @@ -import assert from 'assert' -import {Block, BlockContext, Chain, ChainContext, Option, Result, StorageBase} from './support' -import * as v601 from './v601' -import * as v9230 from './v9230' -import * as v9430 from './v9430' - -export class NftsCollectionStorage extends StorageBase { - protected getPrefix() { - return 'Nfts' - } - - protected getName() { - return 'Collection' - } - - /** - * Details of a collection. - */ - get isV9430(): boolean { - return this.getTypeHash() === '2048922b0682bb5b7de7ca9a7e01264f12386f5c3cad9a3e84b1e5a81cd69913' - } - - /** - * Details of a collection. - */ - get asV9430(): NftsCollectionStorageV9430 { - assert(this.isV9430) - return this as any - } -} - -/** - * Details of a collection. - */ -export interface NftsCollectionStorageV9430 { - get(key: number): Promise<(v9430.Type_353 | undefined)> - getAll(): Promise - getMany(keys: number[]): Promise<(v9430.Type_353 | undefined)[]> - getKeys(): Promise - getKeys(key: number): Promise - getKeysPaged(pageSize: number): AsyncIterable - getKeysPaged(pageSize: number, key: number): AsyncIterable - getPairs(): Promise<[k: number, v: v9430.Type_353][]> - getPairs(key: number): Promise<[k: number, v: v9430.Type_353][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: number, v: v9430.Type_353][]> - getPairsPaged(pageSize: number, key: number): AsyncIterable<[k: number, v: v9430.Type_353][]> -} - -export class NftsItemMetadataOfStorage extends StorageBase { - protected getPrefix() { - return 'Nfts' - } - - protected getName() { - return 'ItemMetadataOf' - } - - /** - * Metadata of an item. - */ - get isV9430(): boolean { - return this.getTypeHash() === 'a2ef643060836070ede73871794a2c9da331285c79b5e9e6f9935723f37af9c6' - } - - /** - * Metadata of an item. - */ - get asV9430(): NftsItemMetadataOfStorageV9430 { - assert(this.isV9430) - return this as any - } -} - -/** - * Metadata of an item. - */ -export interface NftsItemMetadataOfStorageV9430 { - get(key1: number, key2: number): Promise<(v9430.Type_363 | undefined)> - getAll(): Promise - getMany(keys: [number, number][]): Promise<(v9430.Type_363 | undefined)[]> - getKeys(): Promise<[number, number][]> - getKeys(key1: number): Promise<[number, number][]> - getKeys(key1: number, key2: number): Promise<[number, number][]> - getKeysPaged(pageSize: number): AsyncIterable<[number, number][]> - getKeysPaged(pageSize: number, key1: number): AsyncIterable<[number, number][]> - getKeysPaged(pageSize: number, key1: number, key2: number): AsyncIterable<[number, number][]> - getPairs(): Promise<[k: [number, number], v: v9430.Type_363][]> - getPairs(key1: number): Promise<[k: [number, number], v: v9430.Type_363][]> - getPairs(key1: number, key2: number): Promise<[k: [number, number], v: v9430.Type_363][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: [number, number], v: v9430.Type_363][]> - getPairsPaged(pageSize: number, key1: number): AsyncIterable<[k: [number, number], v: v9430.Type_363][]> - getPairsPaged(pageSize: number, key1: number, key2: number): AsyncIterable<[k: [number, number], v: v9430.Type_363][]> -} - -export class UniquesClassStorage extends StorageBase { - protected getPrefix() { - return 'Uniques' - } - - protected getName() { - return 'Class' - } - - /** - * Details of an asset class. - */ - get isV601(): boolean { - return this.getTypeHash() === '1e1179cfd57216efc5c1637c0aa0a4ae6eff2649845c501f9d404542ba254ed4' - } - - /** - * Details of an asset class. - */ - get asV601(): UniquesClassStorageV601 { - assert(this.isV601) - return this as any - } - - /** - * Details of a collection. - */ - get isV9230(): boolean { - return this.getTypeHash() === '7d8bf59996f2d3901df3ccd9b19fb3c13d435bb2d2b67820e7ee13c594f1cb1b' - } - - /** - * Details of a collection. - */ - get asV9230(): UniquesClassStorageV9230 { - assert(this.isV9230) - return this as any - } -} - -/** - * Details of an asset class. - */ -export interface UniquesClassStorageV601 { - get(key: number): Promise<(v601.ClassDetails | undefined)> - getAll(): Promise - getMany(keys: number[]): Promise<(v601.ClassDetails | undefined)[]> - getKeys(): Promise - getKeys(key: number): Promise - getKeysPaged(pageSize: number): AsyncIterable - getKeysPaged(pageSize: number, key: number): AsyncIterable - getPairs(): Promise<[k: number, v: v601.ClassDetails][]> - getPairs(key: number): Promise<[k: number, v: v601.ClassDetails][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: number, v: v601.ClassDetails][]> - getPairsPaged(pageSize: number, key: number): AsyncIterable<[k: number, v: v601.ClassDetails][]> -} - -/** - * Details of a collection. - */ -export interface UniquesClassStorageV9230 { - get(key: number): Promise<(v9230.CollectionDetails | undefined)> - getAll(): Promise - getMany(keys: number[]): Promise<(v9230.CollectionDetails | undefined)[]> - getKeys(): Promise - getKeys(key: number): Promise - getKeysPaged(pageSize: number): AsyncIterable - getKeysPaged(pageSize: number, key: number): AsyncIterable - getPairs(): Promise<[k: number, v: v9230.CollectionDetails][]> - getPairs(key: number): Promise<[k: number, v: v9230.CollectionDetails][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: number, v: v9230.CollectionDetails][]> - getPairsPaged(pageSize: number, key: number): AsyncIterable<[k: number, v: v9230.CollectionDetails][]> -} - -export class UniquesInstanceMetadataOfStorage extends StorageBase { - protected getPrefix() { - return 'Uniques' - } - - protected getName() { - return 'InstanceMetadataOf' - } - - /** - * Metadata of an asset instance. - */ - get isV601(): boolean { - return this.getTypeHash() === '36776a13816cab10cc18dd56fcac5cb2817f77f7b82bf520cc24f74ac55e6f6d' - } - - /** - * Metadata of an asset instance. - */ - get asV601(): UniquesInstanceMetadataOfStorageV601 { - assert(this.isV601) - return this as any - } -} - -/** - * Metadata of an asset instance. - */ -export interface UniquesInstanceMetadataOfStorageV601 { - get(key1: number, key2: number): Promise<(v601.InstanceMetadata | undefined)> - getAll(): Promise - getMany(keys: [number, number][]): Promise<(v601.InstanceMetadata | undefined)[]> - getKeys(): Promise<[number, number][]> - getKeys(key1: number): Promise<[number, number][]> - getKeys(key1: number, key2: number): Promise<[number, number][]> - getKeysPaged(pageSize: number): AsyncIterable<[number, number][]> - getKeysPaged(pageSize: number, key1: number): AsyncIterable<[number, number][]> - getKeysPaged(pageSize: number, key1: number, key2: number): AsyncIterable<[number, number][]> - getPairs(): Promise<[k: [number, number], v: v601.InstanceMetadata][]> - getPairs(key1: number): Promise<[k: [number, number], v: v601.InstanceMetadata][]> - getPairs(key1: number, key2: number): Promise<[k: [number, number], v: v601.InstanceMetadata][]> - getPairsPaged(pageSize: number): AsyncIterable<[k: [number, number], v: v601.InstanceMetadata][]> - getPairsPaged(pageSize: number, key1: number): AsyncIterable<[k: [number, number], v: v601.InstanceMetadata][]> - getPairsPaged(pageSize: number, key1: number, key2: number): AsyncIterable<[k: [number, number], v: v601.InstanceMetadata][]> -} diff --git a/src/types/statemint/support.ts b/src/types/statemint/support.ts deleted file mode 100644 index 56d00498..00000000 --- a/src/types/statemint/support.ts +++ /dev/null @@ -1,131 +0,0 @@ - -export type Result = { - __kind: 'Ok' - value: T -} | { - __kind: 'Err' - value: E -} - - -export type Option = { - __kind: 'Some', - value: T -} | { - __kind: 'None' -} - - -export interface Chain { - getEventHash(eventName: string): string - decodeEvent(event: Event): any - getCallHash(name: string): string - decodeCall(call: Call): any - getStorageItemTypeHash(prefix: string, name: string): string | undefined - getStorage(blockHash: string, prefix: string, name: string, ...args: any[]): Promise - queryStorage2(blockHash: string, prefix: string, name: string, keyList?: any[]): Promise - getKeys(blockHash: string, prefix: string, name: string, ...args: any[]): Promise - getPairs(blockHash: string, prefix: string, name: string, ...args: any[]): Promise - getKeysPaged(pageSize: number, blockHash: string, prefix: string, name: string, ...args: any[]): AsyncIterable - getPairsPaged(pageSize: number, blockHash: string, prefix: string, name: string, ...args: any[]): AsyncIterable<[key: any, value: any][]> - getConstantTypeHash(pallet: string, name: string): string | undefined - getConstant(pallet: string, name: string): any -} - - -export interface ChainContext { - _chain: Chain -} - - -export interface Event { - name: string - args: any -} - - -export interface EventContext extends ChainContext { - event: Event -} - - -export interface Call { - name: string - args: any -} - - -export interface CallContext extends ChainContext { - call: Call -} - - -export interface BlockContext extends ChainContext { - block: Block -} - - -export interface Block { - hash: string -} - - -export class StorageBase { - protected readonly _chain: Chain - protected readonly blockHash: string - - constructor(ctx: BlockContext) - constructor(ctx: ChainContext, block: Block) - constructor(ctx: BlockContext, block?: Block) { - block = block || ctx.block - this.blockHash = block.hash - this._chain = ctx._chain - } - - protected getPrefix(): string { - throw new Error('Not implemented') - } - - protected getName(): string { - throw new Error('Not implemented') - } - - protected getTypeHash(): string | undefined { - return this._chain.getStorageItemTypeHash(this.getPrefix(), this.getName()) - } - - /** - * Checks whether the storage item is defined for the current chain version. - */ - get isExists(): boolean { - return this.getTypeHash() != null - } - - protected get(...args: any[]): Promise { - return this._chain.getStorage(this.blockHash, this.getPrefix(), this.getName(), ...args) - } - - protected getMany(keyList: any[]): Promise { - return this._chain.queryStorage2(this.blockHash, this.getPrefix(), this.getName(), keyList) - } - - protected getAll(): Promise { - return this._chain.queryStorage2(this.blockHash, this.getPrefix(), this.getName()) - } - - protected getKeys(...args: any[]): Promise { - return this._chain.getKeys(this.blockHash, this.getPrefix(), this.getName(), ...args) - } - - protected getKeysPaged(pageSize: number, ...args: any[]): AsyncIterable { - return this._chain.getKeysPaged(pageSize, this.blockHash, this.getPrefix(), this.getName(), ...args) - } - - protected getPairs(...args: any[]): Promise<[k: any, v: any][]> { - return this._chain.getPairs(this.blockHash, this.getPrefix(), this.getName(), ...args) - } - - protected getPairsPaged(pageSize: number, ...args: any[]): AsyncIterable<[k: any, v: any][]> { - return this._chain.getPairsPaged(pageSize, this.blockHash, this.getPrefix(), this.getName(), ...args) - } -} diff --git a/src/types/statemint/v601.ts b/src/types/statemint/v601.ts deleted file mode 100644 index df7c5dd9..00000000 --- a/src/types/statemint/v601.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type {Result, Option} from './support' - -export interface ClassDetails { - owner: Uint8Array - issuer: Uint8Array - admin: Uint8Array - freezer: Uint8Array - totalDeposit: bigint - freeHolding: boolean - instances: number - instanceMetadatas: number - attributes: number - isFrozen: boolean -} - -export interface InstanceMetadata { - deposit: bigint - data: Uint8Array - isFrozen: boolean -} diff --git a/src/types/statemint/v9230.ts b/src/types/statemint/v9230.ts deleted file mode 100644 index 489a86b1..00000000 --- a/src/types/statemint/v9230.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type {Result, Option} from './support' - -export interface CollectionDetails { - owner: Uint8Array - issuer: Uint8Array - admin: Uint8Array - freezer: Uint8Array - totalDeposit: bigint - freeHolding: boolean - items: number - itemMetadatas: number - attributes: number - isFrozen: boolean -} diff --git a/src/types/statemint/v9430.ts b/src/types/statemint/v9430.ts deleted file mode 100644 index d4842c1f..00000000 --- a/src/types/statemint/v9430.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type {Result, Option} from './support' - -export type AttributeNamespace = AttributeNamespace_Pallet | AttributeNamespace_CollectionOwner | AttributeNamespace_ItemOwner | AttributeNamespace_Account - -export interface AttributeNamespace_Pallet { - __kind: 'Pallet' -} - -export interface AttributeNamespace_CollectionOwner { - __kind: 'CollectionOwner' -} - -export interface AttributeNamespace_ItemOwner { - __kind: 'ItemOwner' -} - -export interface AttributeNamespace_Account { - __kind: 'Account' - value: Uint8Array -} - -export type PalletAttributes = PalletAttributes_UsedToClaim | PalletAttributes_TransferDisabled - -export interface PalletAttributes_UsedToClaim { - __kind: 'UsedToClaim' - value: number -} - -export interface PalletAttributes_TransferDisabled { - __kind: 'TransferDisabled' -} - -export interface PriceWithDirection { - amount: bigint - direction: PriceDirection -} - -export interface Type_353 { - owner: Uint8Array - ownerDeposit: bigint - items: number - itemMetadatas: number - itemConfigs: number - attributes: number -} - -export interface Type_363 { - deposit: ItemMetadataDeposit - data: Uint8Array -} - -export type PriceDirection = PriceDirection_Send | PriceDirection_Receive - -export interface PriceDirection_Send { - __kind: 'Send' -} - -export interface PriceDirection_Receive { - __kind: 'Receive' -} - -export interface ItemMetadataDeposit { - account: (Uint8Array | undefined) - amount: bigint -} diff --git a/statemint.json b/statemint.json deleted file mode 100644 index 0c5b5919..00000000 --- a/statemint.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "outDir": "src/types/statemint", - "specVersions": "https://statemint.archive.subsquid.io/graphql", - "events": [ - "Uniques.AttributeCleared", - "Uniques.AttributeSet", - "Uniques.Burned", - "Uniques.ClassFrozen", - "Uniques.ClassMetadataCleared", - "Uniques.ClassMetadataSet", - "Uniques.ClassThawed", - "Uniques.CollectionFrozen", - "Uniques.CollectionMaxSupplySet", - "Uniques.CollectionMetadataCleared", - "Uniques.CollectionMetadataSet", - "Uniques.CollectionThawed", - "Uniques.Created", - "Uniques.Destroyed", - "Uniques.ForceCreated", - "Uniques.Frozen", - "Uniques.Issued", - "Uniques.ItemBought", - "Uniques.ItemPriceRemoved", - "Uniques.ItemPriceSet", - "Uniques.MetadataCleared", - "Uniques.MetadataSet", - "Uniques.OwnerChanged", - "Uniques.OwnershipAcceptanceChanged", - "Uniques.TeamChanged", - "Uniques.Thawed", - "Uniques.Transferred", - "Nfts.AllApprovalsCancelled", - "Nfts.ApprovalCancelled", - "Nfts.AttributeCleared", - "Nfts.AttributeSet", - "Nfts.Burned", - "Nfts.CollectionConfigChanged", - "Nfts.CollectionLocked", - "Nfts.CollectionMaxSupplySet", - "Nfts.CollectionMetadataCleared", - "Nfts.CollectionMetadataSet", - "Nfts.CollectionMintSettingsUpdated", - "Nfts.Created", - "Nfts.Destroyed", - "Nfts.ForceCreated", - "Nfts.Issued", - "Nfts.ItemAttributesApprovalAdded", - "Nfts.ItemAttributesApprovalRemoved", - "Nfts.ItemBought", - "Nfts.ItemMetadataCleared", - "Nfts.ItemMetadataSet", - "Nfts.ItemPriceRemoved", - "Nfts.ItemPriceSet", - "Nfts.ItemPropertiesLocked", - "Nfts.ItemTransferLocked", - "Nfts.ItemTransferUnlocked", - "Nfts.NextCollectionIdIncremented", - "Nfts.OwnerChanged", - "Nfts.OwnershipAcceptanceChanged", - "Nfts.PalletAttributeSet", - "Nfts.PreSignedAttributesSet", - "Nfts.SwapCancelled", - "Nfts.SwapClaimed", - "Nfts.SwapCreated", - "Nfts.TeamChanged", - "Nfts.TipSent", - "Nfts.TransferApproved", - "Nfts.Transferred" - ], - "calls": [], - "storage": [ - "Uniques.Class", - "Uniques.InstanceMetadataOf", - "Nfts.Collection", - "Nfts.ItemMetadataOf" - ] -} diff --git a/tests/index.test.ts b/tests/index.test.ts new file mode 100644 index 00000000..1c37b7a1 --- /dev/null +++ b/tests/index.test.ts @@ -0,0 +1,56 @@ +import { describe, expect, it, beforeAll, afterAll, test } from 'vitest' +import { onlyValue, addressOf, unHex } from '../src/mappings/utils/helper' + +describe('Helpers', () => { + // let store: SquidStore; + + beforeAll(() => { + // store = new SquidStore(); + }) + + afterAll(() => {}) + + describe('onlyValue', () => { + it('should return a value', () => { + const value = onlyValue({ __kind: 'HolderOf', value: 1 }) + expect(value).toBe(1) + }) + + it('should not return a value', () => { + const value = onlyValue({ __kind: 'Issuer' } as any) + expect(value).toBe(undefined) + }) + }) + + describe('addressOf', () => { + it('should return a value', () => { + const value = addressOf('0x30658243d02e18551f0d447dad1065db75b01e570fd47eec86805dbea12a28ed') + expect(value).toBe('DfmyFcUiNkVPQdYZuiPLHFWDTSWGk6feN9aHe22ivbFAD6A') + }) + + test('should throw on invalid', () => { + expect.hasAssertions() + try { + addressOf('0x30658243d02e18551f0d447dad1065db75b01e570fd47eec86805dbea12a28e') + } catch (error) { + expect(error.message).toMatch('The expression evaluated to a falsy value') + } + }) + }) + + describe('unHex', () => { + it('should return a value', () => { + const value = unHex('0x42525a20546f6b656e') + expect(value).toBe('BRZ Token') + }) + + test('should throw on invalid', () => { + // expect.hasAssertions() + try { + unHex('0x42525a20546f6b656') + } catch (error) { + expect(error.message).toMatch('The expression evaluated to a falsy value') + } + }) + }) +}) diff --git a/typegen.json b/typegen.json index 1cf75b71..2fe885a3 100644 --- a/typegen.json +++ b/typegen.json @@ -1,77 +1,104 @@ { - "outDir": "src/types/statemine", - "specVersions": "https://statemine.archive.subsquid.io/graphql", - "events": [ - "Uniques.AttributeCleared", - "Uniques.AttributeSet", - "Uniques.Burned", - "Uniques.ClassFrozen", - "Uniques.ClassMetadataCleared", - "Uniques.ClassMetadataSet", - "Uniques.ClassThawed", - "Uniques.CollectionFrozen", - "Uniques.CollectionMaxSupplySet", - "Uniques.CollectionMetadataCleared", - "Uniques.CollectionMetadataSet", - "Uniques.CollectionThawed", - "Uniques.Created", - "Uniques.Destroyed", - "Uniques.ForceCreated", - "Uniques.Frozen", - "Uniques.Issued", - "Uniques.ItemBought", - "Uniques.ItemPriceRemoved", - "Uniques.ItemPriceSet", - "Uniques.MetadataCleared", - "Uniques.MetadataSet", - "Uniques.OwnerChanged", - "Uniques.OwnershipAcceptanceChanged", - "Uniques.TeamChanged", - "Uniques.Thawed", - "Uniques.Transferred", - "Nfts.AllApprovalsCancelled", - "Nfts.ApprovalCancelled", - "Nfts.AttributeCleared", - "Nfts.AttributeSet", - "Nfts.Burned", - "Nfts.CollectionConfigChanged", - "Nfts.CollectionLocked", - "Nfts.CollectionMaxSupplySet", - "Nfts.CollectionMetadataCleared", - "Nfts.CollectionMetadataSet", - "Nfts.CollectionMintSettingsUpdated", - "Nfts.Created", - "Nfts.Destroyed", - "Nfts.ForceCreated", - "Nfts.Issued", - "Nfts.ItemAttributesApprovalAdded", - "Nfts.ItemAttributesApprovalRemoved", - "Nfts.ItemBought", - "Nfts.ItemMetadataCleared", - "Nfts.ItemMetadataSet", - "Nfts.ItemPriceRemoved", - "Nfts.ItemPriceSet", - "Nfts.ItemPropertiesLocked", - "Nfts.ItemTransferLocked", - "Nfts.ItemTransferUnlocked", - "Nfts.NextCollectionIdIncremented", - "Nfts.OwnerChanged", - "Nfts.OwnershipAcceptanceChanged", - "Nfts.PalletAttributeSet", - "Nfts.PreSignedAttributesSet", - "Nfts.SwapCancelled", - "Nfts.SwapClaimed", - "Nfts.SwapCreated", - "Nfts.TeamChanged", - "Nfts.TipSent", - "Nfts.TransferApproved", - "Nfts.Transferred" - ], - "calls": [], - "storage": [ - "Uniques.Class", - "Uniques.InstanceMetadataOf", - "Nfts.Collection", - "Nfts.ItemMetadataOf" - ] + "outDir": "src/types/kusama", + "specVersions": "https://v2.archive.subsquid.io/metadata/asset-hub-kusama", + "pallets": { + "Assets": { + "events": [ + "Created", + "Destroyed", + "ForceCreated", + "MetadataCleared", + "MetadataSet" + ], + "calls": [], + "storage": [], + "constants": [] + }, + "Uniques": { + "events": [ + "AttributeCleared", + "AttributeSet", + "Burned", + "ClassFrozen", + "ClassMetadataCleared", + "ClassMetadataSet", + "ClassThawed", + "CollectionFrozen", + "CollectionMaxSupplySet", + "CollectionMetadataCleared", + "CollectionMetadataSet", + "CollectionThawed", + "Created", + "Destroyed", + "ForceCreated", + "Frozen", + "Issued", + "ItemBought", + "ItemPriceRemoved", + "ItemPriceSet", + "MetadataCleared", + "MetadataSet", + "OwnerChanged", + "OwnershipAcceptanceChanged", + "TeamChanged", + "Thawed", + "Transferred" + ], + "calls": [], + "storage": [ + "Class", + "InstanceMetadataOf" + ], + "constants": [] + }, + "Nfts": { + "events": [ + "AllApprovalsCancelled", + "ApprovalCancelled", + "AttributeCleared", + "AttributeSet", + "Burned", + "CollectionConfigChanged", + "CollectionLocked", + "CollectionMaxSupplySet", + "CollectionMetadataCleared", + "CollectionMetadataSet", + "CollectionMintSettingsUpdated", + "Created", + "Destroyed", + "ForceCreated", + "Issued", + "ItemAttributesApprovalAdded", + "ItemAttributesApprovalRemoved", + "ItemBought", + "ItemMetadataCleared", + "ItemMetadataSet", + "ItemPriceRemoved", + "ItemPriceSet", + "ItemPropertiesLocked", + "ItemTransferLocked", + "ItemTransferUnlocked", + "NextCollectionIdIncremented", + "OwnerChanged", + "OwnershipAcceptanceChanged", + "PalletAttributeSet", + "PreSignedAttributesSet", + "SwapCancelled", + "SwapClaimed", + "SwapCreated", + "TeamChanged", + "TipSent", + "TransferApproved", + "Transferred" + ], + "calls": [ + "update_mint_settings" + ], + "storage": [ + "Collection", + "ItemMetadataOf" + ], + "constants": [] + } + } }