From 41bb9c121204f2c705f1c32cb71e53c5a128c861 Mon Sep 17 00:00:00 2001 From: dzhelezov Date: Fri, 10 Dec 2021 15:46:47 +0100 Subject: [PATCH 1/3] bump to 5.0.0-alpha.14 and bugfix --- .env | 2 +- db/migrations/1639147106950-Initial.js | 29 ++ package-lock.json | 588 +++++++++++++++++-------- package.json | 8 +- src/mappings/index.ts | 108 ++--- src/mappings/utils/consolidator.ts | 6 +- src/mappings/utils/types.ts | 9 +- src/server-extension.ts | 6 +- src/types/balances.ts | 18 + src/types/index.ts | 4 + 10 files changed, 533 insertions(+), 245 deletions(-) create mode 100644 db/migrations/1639147106950-Initial.js create mode 100644 src/types/balances.ts diff --git a/.env b/.env index 3539636f..9e4f706b 100644 --- a/.env +++ b/.env @@ -7,7 +7,7 @@ DB_NAME=hydra DB_USER=postgres DB_PASS=postgres DB_HOST=localhost -DB_PORT=27364 +DB_PORT=5432 DEBUG=index-builder:* TYPEORM_LOGGING=error diff --git a/db/migrations/1639147106950-Initial.js b/db/migrations/1639147106950-Initial.js new file mode 100644 index 00000000..9598990a --- /dev/null +++ b/db/migrations/1639147106950-Initial.js @@ -0,0 +1,29 @@ +const { MigrationInterface, QueryRunner } = require("typeorm"); + +module.exports = class Initial1639147106950 { + name = 'Initial1639147106950' + + async up(queryRunner) { + await queryRunner.query(`CREATE TABLE "remark_entity" ("id" character varying NOT NULL, "value" text NOT NULL, "caller" text NOT NULL, "block_number" text NOT NULL, "interaction" text, CONSTRAINT "PK_47fe6cc1a357ef713548bfb9c9c" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "failed_entity" ("id" character varying NOT NULL, "value" text NOT NULL, "reason" text NOT NULL, "interaction" text, CONSTRAINT "PK_df628d98d9ba1555d905ee20d6b" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE TABLE "emote" ("id" character varying NOT NULL, "caller" text NOT NULL, "value" text NOT NULL, "nft_id" character varying NOT NULL, CONSTRAINT "PK_c08d432f6b22ef550be511163ac" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE INDEX "IDX_463234b85d428ddde1bce27182" ON "emote" ("nft_id") `); + await queryRunner.query(`CREATE TABLE "nft_entity" ("name" text, "instance" text, "transferable" integer, "issuer" text, "sn" text, "id" character varying NOT NULL, "metadata" text, "current_owner" text, "price" numeric, "burned" boolean, "block_number" numeric, "events" jsonb, "collection_id" character varying NOT NULL, CONSTRAINT "PK_ed09c6a38c0f0a867d5a7b63f0d" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE INDEX "IDX_4b98bf4d630de0037475b9bbb7" ON "nft_entity" ("collection_id") `); + await queryRunner.query(`CREATE TABLE "collection_entity" ("version" text, "name" text, "max" integer, "issuer" text, "symbol" text, "id" character varying NOT NULL, "metadata" text, "current_owner" text, "events" jsonb, "block_number" numeric, CONSTRAINT "PK_5d44e140c4fcb3d961f9e83405f" PRIMARY KEY ("id"))`); + await queryRunner.query(`ALTER TABLE "emote" ADD CONSTRAINT "FK_463234b85d428ddde1bce271829" FOREIGN KEY ("nft_id") REFERENCES "nft_entity"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "nft_entity" ADD CONSTRAINT "FK_4b98bf4d630de0037475b9bbb7a" FOREIGN KEY ("collection_id") REFERENCES "collection_entity"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "nft_entity" DROP CONSTRAINT "FK_4b98bf4d630de0037475b9bbb7a"`); + await queryRunner.query(`ALTER TABLE "emote" DROP CONSTRAINT "FK_463234b85d428ddde1bce271829"`); + await queryRunner.query(`DROP TABLE "collection_entity"`); + await queryRunner.query(`DROP INDEX "public"."IDX_4b98bf4d630de0037475b9bbb7"`); + await queryRunner.query(`DROP TABLE "nft_entity"`); + await queryRunner.query(`DROP INDEX "public"."IDX_463234b85d428ddde1bce27182"`); + await queryRunner.query(`DROP TABLE "emote"`); + await queryRunner.query(`DROP TABLE "failed_entity"`); + await queryRunner.query(`DROP TABLE "remark_entity"`); + } +} diff --git a/package-lock.json b/package-lock.json index 18a867b6..2a1d49b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -186,6 +186,18 @@ "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", "dev": true }, + "@noble/hashes": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-0.4.1.tgz", + "integrity": "sha512-Qxy9mZoDf5SyFrQ8hpWHeMZ2Scmb9BAz/lt23sKdr/QHnACW9dD6S+/WVJHd3R/BPoNHcUYWXoXXe74cxSEYoA==", + "dev": true + }, + "@noble/secp256k1": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.3.0.tgz", + "integrity": "sha512-wuFthUc6Ul4xflhY5u1+p1bDILPzVEisekxt5M+iLg4R+gG6+k2jnRR19sC9fMtzlsN5sKloBwprziDS0XlmyQ==", + "dev": true + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -210,22 +222,22 @@ } }, "@oclif/command": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@oclif/command/-/command-1.8.0.tgz", - "integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==", + "version": "1.8.12", + "resolved": "https://registry.npmjs.org/@oclif/command/-/command-1.8.12.tgz", + "integrity": "sha512-Qv+5kUdydIUM00HN0m/xuEB+SxI+5lI4bap1P5I4d8ZLqtwVi7Q6wUZpDM5QqVvRkay7p4TiYXRXw1rfXYwEjw==", "requires": { - "@oclif/config": "^1.15.1", - "@oclif/errors": "^1.3.3", - "@oclif/parser": "^3.8.3", - "@oclif/plugin-help": "^3", + "@oclif/config": "^1.18.2", + "@oclif/errors": "^1.3.5", + "@oclif/parser": "^3.8.6", + "@oclif/plugin-help": "3.2.16", "debug": "^4.1.1", "semver": "^7.3.2" } }, "@oclif/config": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/@oclif/config/-/config-1.17.0.tgz", - "integrity": "sha512-Lmfuf6ubjQ4ifC/9bz1fSCHc6F6E653oyaRXxg+lgT4+bYf9bk+nqrUpAbrXyABkCqgIBiFr3J4zR/kiFdE1PA==", + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/@oclif/config/-/config-1.18.2.tgz", + "integrity": "sha512-cE3qfHWv8hGRCP31j7fIS7BfCflm/BNZ2HNqHexH+fDrdF2f1D5S8VmXWLC77ffv3oDvWyvE9AZeR0RfmHCCaA==", "requires": { "@oclif/errors": "^1.3.3", "@oclif/parser": "^3.8.0", @@ -253,134 +265,70 @@ "integrity": "sha512-Ups2dShK52xXa8w6iBWLgcjPJWjais6KPJQq3gQ/88AY6BXoTX+MIGFPrWQO1KLMiQfoTpcLnUwloN4brrVUHw==" }, "@oclif/parser": { - "version": "3.8.5", - "resolved": "https://registry.npmjs.org/@oclif/parser/-/parser-3.8.5.tgz", - "integrity": "sha512-yojzeEfmSxjjkAvMRj0KzspXlMjCfBzNRPkWw8ZwOSoNWoJn+OCS/m/S+yfV6BvAM4u2lTzX9Y5rCbrFIgkJLg==", + "version": "3.8.6", + "resolved": "https://registry.npmjs.org/@oclif/parser/-/parser-3.8.6.tgz", + "integrity": "sha512-tXb0NKgSgNxmf6baN6naK+CCwOueaFk93FG9u202U7mTBHUKsioOUlw1SG/iPi9aJM3WE4pHLXmty59pci0OEw==", "requires": { "@oclif/errors": "^1.2.2", "@oclif/linewrap": "^1.0.0", - "chalk": "^2.4.2", - "tslib": "^1.9.3" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - } + "chalk": "^4.1.0", + "tslib": "^2.0.0" } }, "@oclif/plugin-help": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-3.2.3.tgz", - "integrity": "sha512-l2Pd0lbOMq4u/7xsl9hqISFqyR9gWEz/8+05xmrXFr67jXyS6EUCQB+mFBa0wepltrmJu0sAFg9AvA2mLaMMqQ==", + "version": "3.2.16", + "resolved": "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-3.2.16.tgz", + "integrity": "sha512-O78iV+NhBQtviIhVEVuI21vZ9nRr9B5pR+P60oB5XFvvPKkSkV5Culih42mYU30VuWiaiWlg7+OdA4pmSPEpwg==", "requires": { - "@oclif/command": "^1.5.20", - "@oclif/config": "^1.15.1", - "@oclif/errors": "^1.2.2", - "chalk": "^4.1.0", + "@oclif/command": "1.8.11", + "@oclif/config": "1.18.2", + "@oclif/errors": "1.3.5", + "chalk": "^4.1.2", "indent-string": "^4.0.0", - "lodash.template": "^4.4.0", + "lodash": "^4.17.21", "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "widest-line": "^3.1.0", - "wrap-ansi": "^4.0.0" + "wrap-ansi": "^6.2.0" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" + "@oclif/command": { + "version": "1.8.11", + "resolved": "https://registry.npmjs.org/@oclif/command/-/command-1.8.11.tgz", + "integrity": "sha512-2fGLMvi6J5+oNxTaZfdWPMWY8oW15rYj0V8yLzmZBAEjfzjLqLIzJE9IlNccN1zwRqRHc1bcISSRDdxJ56IS/Q==", + "requires": { + "@oclif/config": "^1.18.2", + "@oclif/errors": "^1.3.5", + "@oclif/parser": "^3.8.6", + "debug": "^4.1.1", + "semver": "^7.3.2" } }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" + "@oclif/plugin-help": { + "version": "3.2.14", + "resolved": "https://registry.npmjs.org/@oclif/plugin-help/-/plugin-help-3.2.14.tgz", + "integrity": "sha512-NP5qmE2YfcW3MmXjcrxiqKe9Hf3G0uK/qNc0zAMYKU4crFyIsWj7dBfQVFZSb28YXGioOOpjMzG1I7VMxKF38Q==", + "requires": { + "@oclif/command": "^1.8.9", + "@oclif/config": "^1.18.2", + "@oclif/errors": "^1.3.5", + "chalk": "^4.1.2", + "indent-string": "^4.0.0", + "lodash": "^4.17.21", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "widest-line": "^3.1.0", + "wrap-ansi": "^6.2.0" } }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, "wrap-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz", - "integrity": "sha512-uMTsj9rDb0/7kk1PbcbCcwvHUxp60fGDB/NNXpVa0Q+ic/e7y5+BwTxKfQ33VYgDppSwi/FBzpetYzo8s6tfbg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } } } @@ -493,15 +441,153 @@ } }, "@polkadot/types-known": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-6.5.1.tgz", - "integrity": "sha512-eIgk836zlA5KnhK6UotXYr/I9O12xxhNcKXTcA+8NY6ek2xQWlT9VGuMk4wTF4qU1sV/fhOFIDeoNrT7AgSagg==", + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-6.11.1.tgz", + "integrity": "sha512-Vl4WJu56dNvMoXwJ+v9xO0rlWLocb/1KMNczG8UklxrAMfkkgCDIxGjkx/TpgCEfBLxBYavu9MQqQZhJulSP8g==", "dev": true, "requires": { - "@babel/runtime": "^7.15.4", - "@polkadot/networks": "^7.6.1", - "@polkadot/types": "6.5.1", - "@polkadot/util": "^7.6.1" + "@babel/runtime": "^7.16.3", + "@polkadot/networks": "^8.1.2", + "@polkadot/types": "6.11.1", + "@polkadot/util": "^8.1.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz", + "integrity": "sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@polkadot/networks": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-8.1.2.tgz", + "integrity": "sha512-OPjEjEdlErZW0dv1WNIEAaOja8g2ynscwM4pQbVWzbpACuM1xziPgfDF74M0R8fMOxr5EJOVbKsvOSBytw+TDg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3" + } + }, + "@polkadot/types": { + "version": "6.11.1", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-6.11.1.tgz", + "integrity": "sha512-utdAL7XrZmKWTk7iT/cUdr1FD4oaDT9OhZ1yRxilEiMk58QZg4Ntm8POH1Sq/l8/JvLcheE0qy1uZhxK3FS0Rw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3", + "@polkadot/types-known": "6.11.1", + "@polkadot/util": "^8.1.2", + "@polkadot/util-crypto": "^8.1.2", + "rxjs": "^7.4.0" + } + }, + "@polkadot/util": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-8.1.2.tgz", + "integrity": "sha512-s1Q6J7I2sxDdk8S9SA1wVSMRUN+6YGpAUehl1zE/VKtHUzxtZfX/M7dmZgNpARi8kmk7/0J61ZuIaFb0Cq81jw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3", + "@polkadot/x-bigint": "8.1.2", + "@polkadot/x-global": "8.1.2", + "@polkadot/x-textdecoder": "8.1.2", + "@polkadot/x-textencoder": "8.1.2", + "@types/bn.js": "^4.11.6", + "bn.js": "^4.12.0", + "ip-regex": "^4.3.0" + } + }, + "@polkadot/util-crypto": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-8.1.2.tgz", + "integrity": "sha512-sqyz4zLyBleBmoaNkGaAQsNXVktqmHJ3XiuYgt9KJ7hIZjP7wjJMLZWzyOKVaL1w5/hUNTRzVuTGiA8GD62ByA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3", + "@noble/hashes": "0.4.1", + "@noble/secp256k1": "^1.3.0", + "@polkadot/networks": "8.1.2", + "@polkadot/util": "8.1.2", + "@polkadot/wasm-crypto": "^4.5.1", + "@polkadot/x-bigint": "8.1.2", + "@polkadot/x-noble-hashes": "8.1.2", + "@polkadot/x-noble-secp256k1": "8.1.2", + "@polkadot/x-randomvalues": "8.1.2", + "ed2curve": "^0.3.0", + "micro-base": "^0.9.0", + "tweetnacl": "^1.0.3" + } + }, + "@polkadot/wasm-crypto": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-4.5.1.tgz", + "integrity": "sha512-Cr21ais3Kq3aedIHZ3J1tjgeD/+K8FCiwEawr0oRywNBSJR8wyuZMePs4swR/6xm8wbBkpqoBVHz/UQHqqQJmA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3", + "@polkadot/wasm-crypto-asmjs": "^4.5.1", + "@polkadot/wasm-crypto-wasm": "^4.5.1" + } + }, + "@polkadot/wasm-crypto-asmjs": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-4.5.1.tgz", + "integrity": "sha512-DOdRiWhxVvmqTvp+E9z1j+Yr0zDOGsDvqnT/eNw0Dl1FVUOImsEa7FKns/urASmcxCVEE1jtUWSnij29jrORMQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3" + } + }, + "@polkadot/wasm-crypto-wasm": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-4.5.1.tgz", + "integrity": "sha512-hPwke85HxpgG/RAlwdCE8u5w7bThvWg399mlB+XjogXMxOUWBZSgq2XYbgzROUXx27inK9nStF4Pnc4zJnqs9A==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3" + } + }, + "@polkadot/x-global": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.1.2.tgz", + "integrity": "sha512-prHFu2okMOrOvF4JtCjuHZ742yqim2ip6SuZqSEHrkbQPewXYquC51nXkscJygheTpQgrNt3dBuk5Y8jFWjUHg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3" + } + }, + "@polkadot/x-randomvalues": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-8.1.2.tgz", + "integrity": "sha512-hYTGMLXIpAKRiEPcguv0e+ZXIfqUxl8TJQ8qItB/PxE58s1Xa9F+0lAuSCCAzfuJFBn6Qzr3nBkuGx+T/cTz9w==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3", + "@polkadot/x-global": "8.1.2" + } + }, + "@polkadot/x-textdecoder": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-8.1.2.tgz", + "integrity": "sha512-NuQepvIqEIeWPMdGry/ReJAEtXwWRt0qrX0xwYIoY7V1rR8vDVX66Q5YtG/i7/JLBydgabXA1GCj5k4sRpwakA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3", + "@polkadot/x-global": "8.1.2" + } + }, + "@polkadot/x-textencoder": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-8.1.2.tgz", + "integrity": "sha512-8m+RvtxPEd4/vfHWuhTQyE/RbjN3NTbbrTQ0SMAPRM04NGauKXJOVA5A7WBJYJsj6bDlSaWSavOMJSzO5NKE8w==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3", + "@polkadot/x-global": "8.1.2" + } + } } }, "@polkadot/util": { @@ -568,6 +654,36 @@ "@babel/runtime": "^7.15.3" } }, + "@polkadot/x-bigint": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-8.1.2.tgz", + "integrity": "sha512-MI9D/gXQQLqrdp66InZtkGDa+FYsrc+Dq0DzsRkGRE0hjX75C7OretNLm7zMG7IQYjiuBQkH8tnTE7I8k/KwDw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3", + "@polkadot/x-global": "8.1.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz", + "integrity": "sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@polkadot/x-global": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.1.2.tgz", + "integrity": "sha512-prHFu2okMOrOvF4JtCjuHZ742yqim2ip6SuZqSEHrkbQPewXYquC51nXkscJygheTpQgrNt3dBuk5Y8jFWjUHg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3" + } + } + } + }, "@polkadot/x-global": { "version": "7.6.1", "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-7.6.1.tgz", @@ -576,6 +692,46 @@ "@babel/runtime": "^7.15.4" } }, + "@polkadot/x-noble-hashes": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-noble-hashes/-/x-noble-hashes-8.1.2.tgz", + "integrity": "sha512-Vj0d2ueyFgPnc4SrPP8oEQlp++DDHXMhNlSi7vupWBoehXoKnDpIb7UjZcL78lg+dF8U3/2iSb6DgfHS0lAK5w==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz", + "integrity": "sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + } + } + }, + "@polkadot/x-noble-secp256k1": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-noble-secp256k1/-/x-noble-secp256k1-8.1.2.tgz", + "integrity": "sha512-6fSXJDmEHxWmNQ55tnZTx6xbH1sFgCjJLxyIwLcqJuH9rgaNALloWbGvcG8C3NVbqh3REQRSC20vfabqVjrCpQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz", + "integrity": "sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + } + } + }, "@polkadot/x-randomvalues": { "version": "7.6.1", "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-7.6.1.tgz", @@ -604,15 +760,35 @@ } }, "@polkadot/x-ws": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-7.6.1.tgz", - "integrity": "sha512-nP8vHlL17SIuVinphuVbj2o3mfRWUTJqlhAYlA5RjO/sZ9TwYMvGTvL/1bOAfWdp/l451WLEWJtzSipzrVGBsg==", + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-7.9.2.tgz", + "integrity": "sha512-+yppMsZtvDztVOSmkqAQuhR6TfV1Axa6ergAsWb52DrfXvFP5geqtARsI6ZdDgMsE3qHSVQTcJz8vgNOr5+ztQ==", "dev": true, "requires": { - "@babel/runtime": "^7.15.4", - "@polkadot/x-global": "7.6.1", + "@babel/runtime": "^7.16.3", + "@polkadot/x-global": "7.9.2", "@types/websocket": "^1.0.4", "websocket": "^1.0.34" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.16.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz", + "integrity": "sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@polkadot/x-global": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-7.9.2.tgz", + "integrity": "sha512-JX5CrGWckHf1P9xKXq4vQCAuMUbL81l2hOWX7xeP8nv4caHEpmf5T1wD1iMdQBL5PFifo6Pg0V6/oZBB+bts7A==", + "dev": true, + "requires": { + "@babel/runtime": "^7.16.3" + } + } } }, "@protobufjs/aspromise": { @@ -680,9 +856,9 @@ "integrity": "sha512-Wh2Oxi9JkK79Y728yDEeY7JelcY1cGiQTbzVIRMFLT2tjkkoQ69goAGXdh9QmM/ANAVrHQkBUNJOLd5oAg//oQ==" }, "@subsquid/hydra-cli": { - "version": "5.0.0-alpha.5", - "resolved": "https://registry.npmjs.org/@subsquid/hydra-cli/-/hydra-cli-5.0.0-alpha.5.tgz", - "integrity": "sha512-XBPTVtJ2YpDoOwjZ9cY4DhpP+MDGqmYHjzW1r7JuFHErcWBxO6wy2dEtaZHxxvhPePxGFqIumxoJvS7J1EVuqg==", + "version": "5.0.0-alpha.14", + "resolved": "https://registry.npmjs.org/@subsquid/hydra-cli/-/hydra-cli-5.0.0-alpha.14.tgz", + "integrity": "sha512-P5kzqmCbjVzRMaKyL3vhwv0bEUqsjx+aDcmIzXlFetY3bnaFjxkNGLMyFSf+AnAaYuWiytdu8Gy1xdOOl98PxQ==", "dev": true, "requires": { "@inquirer/input": "^0.0.13-alpha.0", @@ -695,11 +871,13 @@ "@octokit/auth-oauth-device": "^3.1.2", "@subsquid/openreader": "^0.2.0", "chalk": "^4.1.2", + "cli-select": "^1.1.2", "cli-ux": "^5.6.3", "dotenv": "^10.0.0", "execa": "^4.1.0", "node-fetch": "^2.6.1", "pgtools": "^0.3.2", + "query-string": "^7.0.1", "simple-git": "^2.44.0", "tslib": "^2.3.1" }, @@ -884,19 +1062,19 @@ } }, "@subsquid/hydra-common": { - "version": "5.0.0-alpha.5", - "resolved": "https://registry.npmjs.org/@subsquid/hydra-common/-/hydra-common-5.0.0-alpha.5.tgz", - "integrity": "sha512-Vuz930AxWhA3+AYEAyt0mPJjsAKnHDjz3Ix/habZbE/8zuomtNYzjlR5j70uDE448BiRxen8w0pk4pz5qSiJow==" + "version": "5.0.0-alpha.14", + "resolved": "https://registry.npmjs.org/@subsquid/hydra-common/-/hydra-common-5.0.0-alpha.14.tgz", + "integrity": "sha512-PUPxQSar9gItl3HpHkmW76+QYnlz77lJk3GsNUJz2m7rie+moEYwyAOCDLE/6/n5PlQdbYiack8xmtyQIxlRnQ==" }, "@subsquid/hydra-processor": { - "version": "5.0.0-alpha.5", - "resolved": "https://registry.npmjs.org/@subsquid/hydra-processor/-/hydra-processor-5.0.0-alpha.5.tgz", - "integrity": "sha512-Z8EknZtW9Xq34OA4q54eR5l54A1RhLyAByI3OdXxGGeUP/EY4pMxqxbgMEhnK4f9UpzyktzkTu3gfBYyyNL6/w==", + "version": "5.0.0-alpha.14", + "resolved": "https://registry.npmjs.org/@subsquid/hydra-processor/-/hydra-processor-5.0.0-alpha.14.tgz", + "integrity": "sha512-GtYy2PzCiTXvtq4pxYONn5MAfSKpSWUBflIXrZayGHXwIoqitubume0T5Tq3glOPgqlSdJnYifZG/jtQeP8uqA==", "requires": { "@oclif/command": "^1.8.0", "@oclif/config": "^1", "@oclif/errors": "^1.3.5", - "@subsquid/hydra-common": "^5.0.0-alpha.5", + "@subsquid/hydra-common": "^5.0.0-alpha.14", "chalk": "^4.1.2", "delay": "~5.0.0", "dotenv": "^10.0.0", @@ -904,6 +1082,7 @@ "express": "^4.17.1", "graphql": "^15.6.1", "graphql-request": "^3.5.0", + "lodash": "^4.17.21", "p-immediate": "^3.2.0", "p-retry": "~4.6.1", "p-throttle": "~4.1.1", @@ -918,9 +1097,9 @@ } }, "@subsquid/hydra-typegen": { - "version": "5.0.0-alpha.5", - "resolved": "https://registry.npmjs.org/@subsquid/hydra-typegen/-/hydra-typegen-5.0.0-alpha.5.tgz", - "integrity": "sha512-LEvI0XH4JtX4ug35L9S0jcdvizm0/Dhz075/C6ruS6kkptiqM72PjvMpBHh0A4H8fivQfQdePFeUVHbNEVqB7Q==", + "version": "5.0.0-alpha.14", + "resolved": "https://registry.npmjs.org/@subsquid/hydra-typegen/-/hydra-typegen-5.0.0-alpha.14.tgz", + "integrity": "sha512-k4SSW9ETXWn5wUtapwZUpxJHhPesjB+41loHYIfbc7CA1E1k/2iqQ8W0Abrp4sYy7jkk6pcjPynC2ANacPLOVw==", "dev": true, "requires": { "@oclif/command": "^1.8.0", @@ -1523,6 +1702,23 @@ "string-width": "^4.2.0" } }, + "cli-select": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cli-select/-/cli-select-1.1.2.tgz", + "integrity": "sha512-PSvWb8G0PPmBNDcz/uM2LkZN3Nn5JmhUl465tTfynQAXjKzFpmHbxStM6X/+awKp5DJuAaHMzzMPefT0suGm1w==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + } + } + }, "cli-spinners": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", @@ -1530,15 +1726,15 @@ "dev": true }, "cli-ux": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/cli-ux/-/cli-ux-5.6.3.tgz", - "integrity": "sha512-/oDU4v8BiDjX2OKcSunGH0iGDiEtj2rZaGyqNuv9IT4CgcSMyVWAMfn0+rEHaOc4n9ka78B0wo1+N1QX89f7mw==", + "version": "5.6.6", + "resolved": "https://registry.npmjs.org/cli-ux/-/cli-ux-5.6.6.tgz", + "integrity": "sha512-4wUB34zoFklcZV0z5YiOM5IqVMMt9c3TK3QYRK3dqyk3XoRC0ybiWDWHfsMDjkKrzsVTw95rXn9NrzSHbae4pg==", "dev": true, "requires": { - "@oclif/command": "^1.6.0", - "@oclif/errors": "^1.2.1", + "@oclif/command": "^1.8.9", + "@oclif/errors": "^1.3.5", "@oclif/linewrap": "^1.0.0", - "@oclif/screen": "^1.0.3", + "@oclif/screen": "^1.0.4", "ansi-escapes": "^4.3.0", "ansi-styles": "^4.2.0", "cardinal": "^2.1.1", @@ -1551,7 +1747,7 @@ "indent-string": "^4.0.0", "is-wsl": "^2.2.0", "js-yaml": "^3.13.1", - "lodash": "^4.17.11", + "lodash": "^4.17.21", "natural-orderby": "^2.0.1", "object-treeify": "^1.1.4", "password-prompt": "^1.1.2", @@ -1777,6 +1973,12 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, "delay": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", @@ -1863,9 +2065,9 @@ } }, "envalid": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/envalid/-/envalid-7.2.1.tgz", - "integrity": "sha512-NU0ty82LSvHF+Uio9cLNKhrDyivFv7GSvhOu91WbtOOyNKRzXWeDZaopldXJkGBAZ5UuquqXp6VBUXuTfXrUrw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/envalid/-/envalid-7.2.2.tgz", + "integrity": "sha512-bl/3VF5PhoF26HlDWiE0NRRHUbKT/+UDP/+0JtOFmhUwK3cUPS7JgWYGbE8ArvA61T+SyNquxscLCS6y4Wnpdw==", "requires": { "tslib": "2.3.1" }, @@ -2144,6 +2346,12 @@ "to-regex-range": "^5.0.1" } }, + "filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=", + "dev": true + }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -2300,9 +2508,9 @@ } }, "graphql-request": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.6.1.tgz", - "integrity": "sha512-Nm1EasrAQVZllyNTlHDLnLZjlhC6eRWnWP6KH//ytnAL08pjlLkdI2K+s6OV92p45hn5b/kUlLbDwACmRoLwrQ==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.7.0.tgz", + "integrity": "sha512-dw5PxHCgBneN2DDNqpWu8QkbbJ07oOziy8z+bK/TAXufsOLaETuVO4GkXrbs0WjhdKhBMN3BkpN/RIvUHkmNUQ==", "requires": { "cross-fetch": "^3.0.6", "extract-files": "^9.0.0", @@ -2352,7 +2560,8 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true }, "hash-base": { "version": "3.1.0", @@ -2439,9 +2648,9 @@ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", + "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==" }, "indent-string": { "version": "4.0.0", @@ -2620,13 +2829,13 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash._reinterpolate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=" + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true }, "lodash.assign": { "version": "4.2.0", @@ -2648,6 +2857,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "dev": true, "requires": { "lodash._reinterpolate": "^3.0.0", "lodash.templatesettings": "^4.0.0" @@ -2657,6 +2867,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", + "dev": true, "requires": { "lodash._reinterpolate": "^3.0.0" } @@ -2715,6 +2926,12 @@ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, + "micro-base": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/micro-base/-/micro-base-0.9.0.tgz", + "integrity": "sha512-4+tOMKidYT5nQ6/UNmYrGVO5PMcnJdfuR4NC8HK8s2H61B4itOhA9yrsjBdqGV7ecdtej36x3YSIfPLRmPrspg==", + "dev": true + }, "micromatch": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", @@ -3317,6 +3534,18 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" }, + "query-string": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.0.1.tgz", + "integrity": "sha512-uIw3iRvHnk9to1blJCG3BTc+Ro56CBowJXKmNNAm3RulvPBzWLRqKSiiDk+IplJhsydwtuNMHi8UGQFcCLVfkA==", + "dev": true, + "requires": { + "decode-uri-component": "^0.2.0", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + } + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -3588,15 +3817,15 @@ } }, "signal-exit": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", - "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", "dev": true }, "simple-git": { - "version": "2.47.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-2.47.0.tgz", - "integrity": "sha512-+HfCpqPBEZTPWiW9fPdbiPJDslM22MLqrktfzNKyI2pWaJa6DhfNVx4Mds04KZzVv5vjC9/ksw3y5gVf8ECWDg==", + "version": "2.48.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-2.48.0.tgz", + "integrity": "sha512-z4qtrRuaAFJS4PUd0g+xy7aN4y+RvEt/QTJpR184lhJguBA1S/LsVlvE/CM95RsYMOFJG3NGGDjqFCzKU19S/A==", "dev": true, "requires": { "@kwsites/file-exists": "^1.1.1", @@ -3636,9 +3865,15 @@ } }, "spdx-license-ids": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz", - "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "dev": true + }, + "split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", "dev": true }, "split2": { @@ -3660,6 +3895,12 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, + "strict-uri-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", + "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=", + "dev": true + }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3705,6 +3946,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "requires": { "has-flag": "^3.0.0" } diff --git a/package.json b/package.json index d00ec47d..2b008338 100644 --- a/package.json +++ b/package.json @@ -18,16 +18,16 @@ "dependencies": { "@polkadot/types": "^6.5.1", "@subsquid/openreader": "^0.2.0", - "@subsquid/hydra-common": "5.0.0-alpha.5", - "@subsquid/hydra-processor": "5.0.0-alpha.5", + "@subsquid/hydra-common": "5.0.0-alpha.14", + "@subsquid/hydra-processor": "5.0.0-alpha.14", "inflected": "^2.1.0", "class-validator": "^0.13.1", "type-graphql": "^1.1.1", "typeorm": "0.2.38" }, "devDependencies": { - "@subsquid/hydra-cli": "5.0.0-alpha.5", - "@subsquid/hydra-typegen": "5.0.0-alpha.5", + "@subsquid/hydra-cli": "5.0.0-alpha.14", + "@subsquid/hydra-typegen": "5.0.0-alpha.14", "@types/inflected": "^1.1.29", "@types/pg": "^8.6.1", "typescript": "~4.4.2" diff --git a/src/mappings/index.ts b/src/mappings/index.ts index a9828526..3e82a4b2 100644 --- a/src/mappings/index.ts +++ b/src/mappings/index.ts @@ -56,60 +56,60 @@ export async function handleRemark(extrinsic: ExtrinsicContext & StoreContext): -export async function balancesTransfer({ - store, - event, - block, - extrinsic, -}: EventContext & StoreContext): Promise { - - const [from, to, value] = new Balances.TransferEvent(event).params - const tip = extrinsic?.tip || 0n - - const fromAcc = await getOrCreate(store, Account, from.toHex()) - fromAcc.wallet = from.toHuman() - fromAcc.balance = fromAcc.balance || 0n - fromAcc.balance -= value.toBigInt() - fromAcc.balance -= tip - await store.save(fromAcc) - - const toAcc = await getOrCreate(store, Account, to.toHex()) - toAcc.wallet = to.toHuman() - toAcc.balance = toAcc.balance || 0n - toAcc.balance += value.toBigInt() - await store.save(toAcc) - - const hbFrom = new HistoricalBalance() - hbFrom.account = fromAcc; - hbFrom.balance = fromAcc.balance; - hbFrom.timestamp = new Date(block.timestamp) - await store.save(hbFrom) - - const hbTo = new HistoricalBalance() - hbTo.account = toAcc; - hbTo.balance = toAcc.balance; - hbTo.timestamp = new Date(block.timestamp) - await store.save(hbTo) -} - - -async function getOrCreate( - store: DatabaseManager, - entityConstructor: EntityConstructor, - id: string -): Promise { - - let e = await store.get(entityConstructor, { - where: { id }, - }) - - if (e == null) { - e = new entityConstructor() - e.id = id - } - - return e -} +// export async function balancesTransfer({ +// store, +// event, +// block, +// extrinsic, +// }: EventContext & StoreContext): Promise { + +// const [from, to, value] = new Balances.TransferEvent(event).params +// const tip = extrinsic?.tip || 0n + +// const fromAcc = await getOrCreate(store, Account, from.toHex()) +// fromAcc.wallet = from.toHuman() +// fromAcc.balance = fromAcc.balance || 0n +// fromAcc.balance -= value.toBigInt() +// fromAcc.balance -= tip +// await store.save(fromAcc) + +// const toAcc = await getOrCreate(store, Account, to.toHex()) +// toAcc.wallet = to.toHuman() +// toAcc.balance = toAcc.balance || 0n +// toAcc.balance += value.toBigInt() +// await store.save(toAcc) + +// const hbFrom = new HistoricalBalance() +// hbFrom.account = fromAcc; +// hbFrom.balance = fromAcc.balance; +// hbFrom.timestamp = new Date(block.timestamp) +// await store.save(hbFrom) + +// const hbTo = new HistoricalBalance() +// hbTo.account = toAcc; +// hbTo.balance = toAcc.balance; +// hbTo.timestamp = new Date(block.timestamp) +// await store.save(hbTo) +// } + + +// async function getOrCreate( +// store: DatabaseManager, +// entityConstructor: EntityConstructor, +// id: string +// ): Promise { + +// let e = await store.get(entityConstructor, { +// where: { id }, +// }) + +// if (e == null) { +// e = new entityConstructor() +// e.id = id +// } + +// return e +// } type EntityConstructor = { diff --git a/src/mappings/utils/consolidator.ts b/src/mappings/utils/consolidator.ts index 1781bbe0..32f3618b 100644 --- a/src/mappings/utils/consolidator.ts +++ b/src/mappings/utils/consolidator.ts @@ -1,5 +1,5 @@ import { RmrkInteraction } from './types' -import { CollectionEntity, NFTEntity } from '../../types' +import { CollectionEntity, NFTEntity } from '../../generated/model' import { ExtraCall } from './extract' // import { decodeAddress } from '@polkadot/util-crypto' type Entity = CollectionEntity | NFTEntity @@ -9,7 +9,7 @@ export function exists(entity: T | undefined): boolean { } export function isBurned(nft: NFTEntity) { - return nft.burned + return nft.burned ?? false } export function isTransferable(nft: NFTEntity) { @@ -60,7 +60,7 @@ export function isPositiveOrElseError(entity: BigInt | number, excludeZero?: boo const isBalanceTransfer = ({section, method}: ExtraCall) => section === 'balances' && method === 'transfer' -const canBuy = (nft: NFTEntity) => (call: ExtraCall) => isBalanceTransfer(call) && isOwner(nft, call.args[0]) && BigInt(call.args[1]) >= BigInt(nft.price) +const canBuy = (nft: NFTEntity) => (call: ExtraCall) => isBalanceTransfer(call) && isOwner(nft, call.args[0]) && BigInt(call.args[1]) >= BigInt(nft.price ?? 0) export function isBuyLegalOrElseError(entity: NFTEntity, extraCalls: ExtraCall[]) { const result = extraCalls.some(canBuy(entity)) diff --git a/src/mappings/utils/types.ts b/src/mappings/utils/types.ts index 1b08a81c..e4c2a181 100644 --- a/src/mappings/utils/types.ts +++ b/src/mappings/utils/types.ts @@ -1,5 +1,4 @@ -import { CollectionEntity, NFTEntity } from '../../types' -import { Event } from '../../types' +import { CollectionEntity, NFTEntity, Event } from '../../generated/model' import { RemarkResult } from './extract' export enum RmrkEvent { @@ -18,13 +17,13 @@ export const getNftId = (nft: any, blocknumber?: string | number): string => { } export function eventFrom(interaction: RmrkEvent, { blockNumber, caller, timestamp }: RemarkResult, meta: string): Event { - return { + return new Event({}, { interaction, blockNumber, caller, - timestamp, + timestamp: (+timestamp), meta - } + }) } export interface RmrkInteraction { diff --git a/src/server-extension.ts b/src/server-extension.ts index 5719908a..bedb44e4 100644 --- a/src/server-extension.ts +++ b/src/server-extension.ts @@ -1,7 +1,5 @@ import {Field, ObjectType, Query, Resolver} from "type-graphql" import type {EntityManager} from "typeorm" -import {HistoricalBalance} from "./generated/model" - @ObjectType() export class Hello { @@ -22,8 +20,6 @@ export class HelloResolver { @Query(() => Hello) async hello(): Promise { - const tx = await this.tx() - let count = await tx.getRepository(HistoricalBalance).count() - return new Hello(`Hello, we've seen ${count} transfers!`) + return new Hello(`Hey, this is you custom API extension`) } } diff --git a/src/types/balances.ts b/src/types/balances.ts new file mode 100644 index 00000000..6aaaab46 --- /dev/null +++ b/src/types/balances.ts @@ -0,0 +1,18 @@ +import {create} from './_registry' +import {AccountId32} from '@polkadot/types/interfaces' +import {u128} from '@polkadot/types' +import {SubstrateEvent} from '@subsquid/hydra-common' + +export namespace Balances { + /** + * Transfer succeeded. + */ + export class TransferEvent { + constructor(private event: SubstrateEvent) {} + + get params(): [AccountId32, AccountId32, u128] { + return [create('AccountId32', this.event.params[0].value), create('AccountId32', this.event.params[1].value), create('u128', this.event.params[2].value)] + } + } + +} diff --git a/src/types/index.ts b/src/types/index.ts index 8296f1a1..9531abf3 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,2 +1,6 @@ export * from './System' +<<<<<<< HEAD +======= +export * from './Balances' +>>>>>>> 7b0321a (bump to 5.0.0-alpha.14 and bugfix) export * from './Utility' From 742ea266e448bd960d420b395734938a6a10ff68 Mon Sep 17 00:00:00 2001 From: dzhelezov Date: Fri, 10 Dec 2021 16:23:07 +0100 Subject: [PATCH 2/3] revert back DB_PORT --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 9e4f706b..3539636f 100644 --- a/.env +++ b/.env @@ -7,7 +7,7 @@ DB_NAME=hydra DB_USER=postgres DB_PASS=postgres DB_HOST=localhost -DB_PORT=5432 +DB_PORT=27364 DEBUG=index-builder:* TYPEORM_LOGGING=error From a52d14848131a286ee95c195e586a074f61fde0d Mon Sep 17 00:00:00 2001 From: dzhelezov Date: Fri, 10 Dec 2021 16:26:57 +0100 Subject: [PATCH 3/3] fix merge leftovers --- src/mappings/index.ts | 1 - src/types/index.ts | 4 ---- 2 files changed, 5 deletions(-) diff --git a/src/mappings/index.ts b/src/mappings/index.ts index 3e82a4b2..677d6c67 100644 --- a/src/mappings/index.ts +++ b/src/mappings/index.ts @@ -1,6 +1,5 @@ import { DatabaseManager, EventContext, StoreContext, ExtrinsicContext } from '@subsquid/hydra-common' import { CollectionEntity, NFTEntity } from '../generated/model' -import { Balances } from '../types' import { getRemarksFrom, RemarkResult } from './utils'; import { Collection, eventFrom, getNftId, NFT, RmrkEvent, RmrkInteraction } from './utils/types'; diff --git a/src/types/index.ts b/src/types/index.ts index 9531abf3..8296f1a1 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,6 +1,2 @@ export * from './System' -<<<<<<< HEAD -======= -export * from './Balances' ->>>>>>> 7b0321a (bump to 5.0.0-alpha.14 and bugfix) export * from './Utility'