diff --git a/.gitignore b/.gitignore index 7d89e68..cb38cc8 100644 --- a/.gitignore +++ b/.gitignore @@ -110,4 +110,6 @@ moonbeam-signer-win.exe .DS_Store -test/build/ \ No newline at end of file +test/build/ + +payload-*.json \ No newline at end of file diff --git a/README.md b/README.md index 385ab84..ff6222d 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ You will see the updated parachainBond in the apps (chain state) if connecting t Some specific actions are provided as a preconfigured feature: -`npm run cli voteCouncil -- --network --ws
` : creates a vote council payload, prompts for signature and sends it +`npm run cli voteCouncil -- --network --ws --address
` : creates a vote council payload, prompts for signature and sends it `npm run cli voteTechCommittee -- --network --ws --address
` : creates a tech committee vote payload, prompts for signature and sends it diff --git a/package-lock.json b/package-lock.json index bf03035..25d0579 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,9 +15,9 @@ "integrity": "sha512-RUVpT0G2h6rOZwqLDTrKk7ksNv7YpAilTnYe1/Q+eDjxEceRMKVWbCsX7t8h6C1qCFi/1Y8WZjcEPBAFG27GPw==" }, "@babel/runtime": { - "version": "7.16.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz", - "integrity": "sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==", + "version": "7.16.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.5.tgz", + "integrity": "sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==", "requires": { "regenerator-runtime": "^0.13.4" } @@ -45,14 +45,14 @@ } }, "@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==" + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-0.4.5.tgz", + "integrity": "sha512-oK/2b9gHb1CfiFwpPHQs010WgROn4ioilT7TFwxMVwuDaXEJP3QPhyedYbOpgM4JDBgT9n5gaispBQlkaAgT6g==" }, "@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==" + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.3.4.tgz", + "integrity": "sha512-ZVRouDO5mbdCiDg4zCd3ZZABduRtpy4tCnB33Gh9upHe9tRzpiqbRSN1VTjrj/2g8u2c6MBi0YLNnNQpBYOiWg==" }, "@nodelib/fs.scandir": { "version": "2.1.5", @@ -93,58 +93,6 @@ "@polkadot/util-crypto": "^8.1.2", "eventemitter3": "^4.0.7", "rxjs": "^7.4.0" - }, - "dependencies": { - "@polkadot/rpc-core": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-6.12.1.tgz", - "integrity": "sha512-Hb08D9zho3SB1UNlUCmG5q0gdgbOx25JKGLDfSYpD/wtD0Y1Sf2X5cfgtMoSYE3USWiRdCu4BxQkXTiRjPjzJg==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/rpc-provider": "6.12.1", - "@polkadot/types": "6.12.1", - "@polkadot/util": "^8.1.2", - "rxjs": "^7.4.0" - } - }, - "@polkadot/rpc-provider": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-6.12.1.tgz", - "integrity": "sha512-uUHD3fLTOeZYWJoc6DQlhz+MJR33rVelasV+OxFY2nSD9MSNXRwQh+9UKDQBnyxw5B4BZ2QaEGfucDeavXmVDw==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/types": "6.12.1", - "@polkadot/util": "^8.1.2", - "@polkadot/util-crypto": "^8.1.2", - "@polkadot/x-fetch": "^8.1.2", - "@polkadot/x-global": "^8.1.2", - "@polkadot/x-ws": "^8.1.2", - "eventemitter3": "^4.0.7" - } - }, - "@polkadot/types": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-6.12.1.tgz", - "integrity": "sha512-O37cAGUL0xiXTuO3ySweVh0OuFUD6asrd0TfuzGsEp3jAISWdElEHV5QDiftWq8J9Vf8BMgTcP2QLFbmSusxqA==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/types-known": "6.12.1", - "@polkadot/util": "^8.1.2", - "@polkadot/util-crypto": "^8.1.2", - "rxjs": "^7.4.0" - } - }, - "@polkadot/types-known": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-6.12.1.tgz", - "integrity": "sha512-Z8bHpPQy+mqUm0uR1tai6ra0bQIoPmgRcGFYUM+rJtW1kx/6kZLh10HAICjLpPeA1cwLRzaxHRDqH5MCU6OgXw==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/networks": "^8.1.2", - "@polkadot/types": "6.12.1", - "@polkadot/util": "^8.1.2" - } - } } }, "@polkadot/api-derive": { @@ -159,76 +107,92 @@ "@polkadot/util": "^8.1.2", "@polkadot/util-crypto": "^8.1.2", "rxjs": "^7.4.0" + } + }, + "@polkadot/keyring": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-8.3.1.tgz", + "integrity": "sha512-kK33MrF8dnhRrWmix84Y9cJA0xKt+wQAtC7f2KHHggR8KUrZnidM+d+hZAkuGLa84wDqwxX4kZD68OZ9BXE6uQ==", + "requires": { + "@babel/runtime": "^7.16.7", + "@polkadot/util": "8.3.1", + "@polkadot/util-crypto": "8.3.1" }, "dependencies": { - "@polkadot/rpc-core": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-6.12.1.tgz", - "integrity": "sha512-Hb08D9zho3SB1UNlUCmG5q0gdgbOx25JKGLDfSYpD/wtD0Y1Sf2X5cfgtMoSYE3USWiRdCu4BxQkXTiRjPjzJg==", + "@babel/runtime": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/rpc-provider": "6.12.1", - "@polkadot/types": "6.12.1", - "@polkadot/util": "^8.1.2", - "rxjs": "^7.4.0" + "regenerator-runtime": "^0.13.4" } }, - "@polkadot/rpc-provider": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-6.12.1.tgz", - "integrity": "sha512-uUHD3fLTOeZYWJoc6DQlhz+MJR33rVelasV+OxFY2nSD9MSNXRwQh+9UKDQBnyxw5B4BZ2QaEGfucDeavXmVDw==", + "@noble/hashes": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-0.5.7.tgz", + "integrity": "sha512-R9PPYv7TqoYi+enikzZvwRQesGTxR0+jwqzZJGL0uNcf2NFL+lt/uvCCewtXXmr6jWBxiMuNjBfJwKv9UJaCng==" + }, + "@polkadot/networks": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-8.3.1.tgz", + "integrity": "sha512-MG3ryZovtlg3lALeOWQMPEVr+Akr54aYjUMgfrarxpB4Bckw51URfCi/FhrKZRH+VkK1imKJBMDSSEhoA3Rbow==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/types": "6.12.1", - "@polkadot/util": "^8.1.2", - "@polkadot/util-crypto": "^8.1.2", - "@polkadot/x-fetch": "^8.1.2", - "@polkadot/x-global": "^8.1.2", - "@polkadot/x-ws": "^8.1.2", - "eventemitter3": "^4.0.7" + "@babel/runtime": "^7.16.7", + "@polkadot/util": "8.3.1" } }, - "@polkadot/types": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-6.12.1.tgz", - "integrity": "sha512-O37cAGUL0xiXTuO3ySweVh0OuFUD6asrd0TfuzGsEp3jAISWdElEHV5QDiftWq8J9Vf8BMgTcP2QLFbmSusxqA==", + "@polkadot/util-crypto": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-8.3.1.tgz", + "integrity": "sha512-srEHwMwRSfuLxh/J4PRHWVVbROapo3LNkYgKvpbIxf1Ef2rZT/vfzlNtxUHdFwcEioOoo9elxCnV5zVJDZ1whw==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/types-known": "6.12.1", - "@polkadot/util": "^8.1.2", - "@polkadot/util-crypto": "^8.1.2", - "rxjs": "^7.4.0" + "@babel/runtime": "^7.16.7", + "@noble/hashes": "0.5.7", + "@noble/secp256k1": "1.3.4", + "@polkadot/networks": "8.3.1", + "@polkadot/util": "8.3.1", + "@polkadot/wasm-crypto": "^4.5.1", + "@polkadot/x-bigint": "8.3.1", + "@polkadot/x-randomvalues": "8.3.1", + "ed2curve": "^0.3.0", + "micro-base": "^0.10.2", + "tweetnacl": "^1.0.3" } }, - "@polkadot/types-known": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-6.12.1.tgz", - "integrity": "sha512-Z8bHpPQy+mqUm0uR1tai6ra0bQIoPmgRcGFYUM+rJtW1kx/6kZLh10HAICjLpPeA1cwLRzaxHRDqH5MCU6OgXw==", + "@polkadot/x-bigint": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-8.3.1.tgz", + "integrity": "sha512-amHrXrLzuYb8aHQNjJMcokwh0K2hBc74oShR4c+CCDBy3/EEVpiJrCFehWXStTu9T5qoCX6JLlSBjdpZ1i9tzA==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/networks": "^8.1.2", - "@polkadot/types": "6.12.1", - "@polkadot/util": "^8.1.2" + "@babel/runtime": "^7.16.7", + "@polkadot/x-global": "8.3.1" + } + }, + "@polkadot/x-global": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.3.1.tgz", + "integrity": "sha512-bqqbF484jLqe4naPn7rtQJKgWRFtmg0UWIQ5U8qxh4IKZMPAfbMgVtv8+haH8Xf6pjurfSIOIjowySvc8UArVQ==", + "requires": { + "@babel/runtime": "^7.16.7" + } + }, + "@polkadot/x-randomvalues": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-8.3.1.tgz", + "integrity": "sha512-qIni71DMX1bNHuFqQ6C5dbGMB/E3QzmEUjYfvZv/Q8US5REQTVZuniMwtxM4LH4hrhQbRoNH6QyBxxvcwiTy4Q==", + "requires": { + "@babel/runtime": "^7.16.7", + "@polkadot/x-global": "8.3.1" } } } }, - "@polkadot/keyring": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-8.1.2.tgz", - "integrity": "sha512-WsVx9TCJ9H6dmADTyMibwrlSPZrmPlsvFoqrbMTMD04Q7CYZXP46ht3YrF6t81YPQWDoszeDomNuSF2iPXSCTQ==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/util": "8.1.2", - "@polkadot/util-crypto": "8.1.2" - } - }, "@polkadot/networks": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-8.1.2.tgz", - "integrity": "sha512-OPjEjEdlErZW0dv1WNIEAaOja8g2ynscwM4pQbVWzbpACuM1xziPgfDF74M0R8fMOxr5EJOVbKsvOSBytw+TDg==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-8.2.2.tgz", + "integrity": "sha512-PshHrf5wBXib63l03YISnHMf5/fS1/Jv2rEN58EgYy9VK87HBXjT7qQ1Ea/d1cFI2EmfEDvhFsP+u3i6AlejQQ==", "requires": { - "@babel/runtime": "^7.16.3" + "@babel/runtime": "^7.16.5" } }, "@polkadot/rpc-core": { @@ -241,31 +205,6 @@ "@polkadot/types": "6.12.1", "@polkadot/util": "^8.1.2", "rxjs": "^7.4.0" - }, - "dependencies": { - "@polkadot/types": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-6.12.1.tgz", - "integrity": "sha512-O37cAGUL0xiXTuO3ySweVh0OuFUD6asrd0TfuzGsEp3jAISWdElEHV5QDiftWq8J9Vf8BMgTcP2QLFbmSusxqA==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/types-known": "6.12.1", - "@polkadot/util": "^8.1.2", - "@polkadot/util-crypto": "^8.1.2", - "rxjs": "^7.4.0" - } - }, - "@polkadot/types-known": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-6.12.1.tgz", - "integrity": "sha512-Z8bHpPQy+mqUm0uR1tai6ra0bQIoPmgRcGFYUM+rJtW1kx/6kZLh10HAICjLpPeA1cwLRzaxHRDqH5MCU6OgXw==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/networks": "^8.1.2", - "@polkadot/types": "6.12.1", - "@polkadot/util": "^8.1.2" - } - } } }, "@polkadot/rpc-provider": { @@ -281,31 +220,6 @@ "@polkadot/x-global": "^8.1.2", "@polkadot/x-ws": "^8.1.2", "eventemitter3": "^4.0.7" - }, - "dependencies": { - "@polkadot/types": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-6.12.1.tgz", - "integrity": "sha512-O37cAGUL0xiXTuO3ySweVh0OuFUD6asrd0TfuzGsEp3jAISWdElEHV5QDiftWq8J9Vf8BMgTcP2QLFbmSusxqA==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/types-known": "6.12.1", - "@polkadot/util": "^8.1.2", - "@polkadot/util-crypto": "^8.1.2", - "rxjs": "^7.4.0" - } - }, - "@polkadot/types-known": { - "version": "6.12.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-6.12.1.tgz", - "integrity": "sha512-Z8bHpPQy+mqUm0uR1tai6ra0bQIoPmgRcGFYUM+rJtW1kx/6kZLh10HAICjLpPeA1cwLRzaxHRDqH5MCU6OgXw==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/networks": "^8.1.2", - "@polkadot/types": "6.12.1", - "@polkadot/util": "^8.1.2" - } - } } }, "@polkadot/types": { @@ -332,38 +246,98 @@ } }, "@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==", - "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", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-8.3.1.tgz", + "integrity": "sha512-0jkxqDKBd9Tl7DeIrazNOsvo4rVlWIfxU+Xn021rBLjKZwfWICRuEcywpZ8D3AS9ZpUxymb8VAAu77wkCG2j4Q==", + "requires": { + "@babel/runtime": "^7.16.7", + "@polkadot/x-bigint": "8.3.1", + "@polkadot/x-global": "8.3.1", + "@polkadot/x-textdecoder": "8.3.1", + "@polkadot/x-textencoder": "8.3.1", "@types/bn.js": "^4.11.6", "bn.js": "^4.12.0", "ip-regex": "^4.3.0" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@polkadot/x-bigint": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-8.3.1.tgz", + "integrity": "sha512-amHrXrLzuYb8aHQNjJMcokwh0K2hBc74oShR4c+CCDBy3/EEVpiJrCFehWXStTu9T5qoCX6JLlSBjdpZ1i9tzA==", + "requires": { + "@babel/runtime": "^7.16.7", + "@polkadot/x-global": "8.3.1" + } + }, + "@polkadot/x-global": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.3.1.tgz", + "integrity": "sha512-bqqbF484jLqe4naPn7rtQJKgWRFtmg0UWIQ5U8qxh4IKZMPAfbMgVtv8+haH8Xf6pjurfSIOIjowySvc8UArVQ==", + "requires": { + "@babel/runtime": "^7.16.7" + } + } } }, "@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==", - "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", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-8.2.2.tgz", + "integrity": "sha512-bKFE6j1q2Dnz1o1QFvhX2QzkMLi9QHU4a5T7+El5J7OsOxGqssMAVHAmB+YoAuSLqPSQBmZa9CN23IiuJnfsbw==", + "requires": { + "@babel/runtime": "^7.16.5", + "@noble/hashes": "^0.4.5", + "@noble/secp256k1": "^1.3.4", + "@polkadot/networks": "8.2.2", + "@polkadot/util": "8.2.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", + "@polkadot/x-bigint": "8.2.2", + "@polkadot/x-randomvalues": "8.2.2", "ed2curve": "^0.3.0", - "micro-base": "^0.9.0", + "micro-base": "^0.10.0", "tweetnacl": "^1.0.3" + }, + "dependencies": { + "@polkadot/util": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-8.2.2.tgz", + "integrity": "sha512-tiHe0rcQvofd3vUVCRmvfULAv9yBG7s/huv1ZLVY/JGT1JBDonc1HWU3Vdb5MvWpx2R+HHv19ORHyD/LiROE9A==", + "requires": { + "@babel/runtime": "^7.16.5", + "@polkadot/x-bigint": "8.2.2", + "@polkadot/x-global": "8.2.2", + "@polkadot/x-textdecoder": "8.2.2", + "@polkadot/x-textencoder": "8.2.2", + "@types/bn.js": "^4.11.6", + "bn.js": "^4.12.0", + "ip-regex": "^4.3.0" + } + }, + "@polkadot/x-textdecoder": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-8.2.2.tgz", + "integrity": "sha512-HQ/pSl4FREnxK0V7nvEdTwI08Erh6KPLwHZ0rSfUJKVDZ+NwfeW4BW/8xCEJOQIRB948Dqerl0XjEn4xCA+OPg==", + "requires": { + "@babel/runtime": "^7.16.5", + "@polkadot/x-global": "8.2.2" + } + }, + "@polkadot/x-textencoder": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-8.2.2.tgz", + "integrity": "sha512-ZAOwYi/y1wRYb3WoWZMDfYPrmbPSasog2uknt8p9u2WELrrfj4zF/fRnSuMjLUNtvJuKSzj4LUCKHwTY+peSrQ==", + "requires": { + "@babel/runtime": "^7.16.5", + "@polkadot/x-global": "8.2.2" + } + } } }, "@polkadot/wasm-crypto": { @@ -393,83 +367,103 @@ } }, "@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==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-8.2.2.tgz", + "integrity": "sha512-fX3o3FhfQNxdpA5PV4L9PrjjSKG2ZmfFOfv3TrKwsDNtZMktDDcpmW3up53LJ53FszB/WHH6WwKsehmcqAYDIw==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.1.2" + "@babel/runtime": "^7.16.5", + "@polkadot/x-global": "8.2.2" } }, "@polkadot/x-fetch": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-8.1.2.tgz", - "integrity": "sha512-W92VrsApH1I/ams1gJMNJwaTp+WUzF/WPMZ84VSOw/pR+2P002zoMhAqmr8H4kpue2j/uowDpDUyjzp8taGrxg==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-8.2.2.tgz", + "integrity": "sha512-ou8d1Ccf7lt7mssr64ixXYIWOZ4I4ED5sYBeFZg7BJB+MsZnuDOVvuMlItQWh01phMCOxtHWowmh+gOI4w5IWA==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.1.2", + "@babel/runtime": "^7.16.5", + "@polkadot/x-global": "8.2.2", "@types/node-fetch": "^2.5.12", "node-fetch": "^2.6.6" } }, "@polkadot/x-global": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.1.2.tgz", - "integrity": "sha512-prHFu2okMOrOvF4JtCjuHZ742yqim2ip6SuZqSEHrkbQPewXYquC51nXkscJygheTpQgrNt3dBuk5Y8jFWjUHg==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.2.2.tgz", + "integrity": "sha512-eTJ6edgoIKzjfdYN3Y6ZuJUGRAAc8Uc5X8r4/1QmhOy427QbfRKRL/cbcLat1XbyM52aplOvZf31KXTAkMREdQ==", "requires": { - "@babel/runtime": "^7.16.3" - } - }, - "@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==", - "requires": { - "@babel/runtime": "^7.16.3" - } - }, - "@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==", - "requires": { - "@babel/runtime": "^7.16.3" + "@babel/runtime": "^7.16.5" } }, "@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==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-8.2.2.tgz", + "integrity": "sha512-v3dx0xvWHd5t6e41Fte63WFX/t1Fu9ug3tOr/QE6yMFrDSeDW9TzFJKklakc0tXryqW0cL4qZzUdSvguGC2TPA==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.1.2" + "@babel/runtime": "^7.16.5", + "@polkadot/x-global": "8.2.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==", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-8.3.1.tgz", + "integrity": "sha512-xXg9Py9Xu1pOa7eBVxR1THzAtr6NiyVjWjwU13m9K6v+SyLrmwd+PkamBFtOiPPSLuMKtNe7nNZCF8BT+EQefQ==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.1.2" + "@babel/runtime": "^7.16.7", + "@polkadot/x-global": "8.3.1" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@polkadot/x-global": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.3.1.tgz", + "integrity": "sha512-bqqbF484jLqe4naPn7rtQJKgWRFtmg0UWIQ5U8qxh4IKZMPAfbMgVtv8+haH8Xf6pjurfSIOIjowySvc8UArVQ==", + "requires": { + "@babel/runtime": "^7.16.7" + } + } } }, "@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==", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-8.3.1.tgz", + "integrity": "sha512-ceItZCo9nl1jia0eB2RJ5i746SROcETkIzhtHG3ricm9d48FDtTPD59CKRkvyIYRAh92on7x/R7hNfcLvrObxQ==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.1.2" + "@babel/runtime": "^7.16.7", + "@polkadot/x-global": "8.3.1" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@polkadot/x-global": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.3.1.tgz", + "integrity": "sha512-bqqbF484jLqe4naPn7rtQJKgWRFtmg0UWIQ5U8qxh4IKZMPAfbMgVtv8+haH8Xf6pjurfSIOIjowySvc8UArVQ==", + "requires": { + "@babel/runtime": "^7.16.7" + } + } } }, "@polkadot/x-ws": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-8.1.2.tgz", - "integrity": "sha512-9ELWRNbQL5WARAv9/m0mpdPc9ucN/xwgpPrQ4WSK+HMHswwrpmmq8mPlfIhGtw0ys5DQPgXXIYLGP50m0MNshA==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-8.2.2.tgz", + "integrity": "sha512-qsHzmtoFXIN59qKSkycxQ3GGyzUMlvhl+d7yU1NMaoOudJGfniTbIcDFPtee27Ydamb1DwBvkRbKw5IO8Domdg==", "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.1.2", + "@babel/runtime": "^7.16.5", + "@polkadot/x-global": "8.2.2", "@types/websocket": "^1.0.4", "websocket": "^1.0.34" } @@ -503,9 +497,9 @@ } }, "@types/chai": { - "version": "4.2.22", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz", - "integrity": "sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", + "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", "dev": true }, "@types/elliptic": { @@ -561,9 +555,9 @@ } }, "@types/yargs": { - "version": "17.0.7", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.7.tgz", - "integrity": "sha512-OvLKmpKdea1aWtqHv9bxVVcMoT6syAeK+198dfETIFkAevYRGwqh4H+KFxfjUETZuUuE5sQCAFwdOdoHUdo8eg==", + "version": "17.0.8", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.8.tgz", + "integrity": "sha512-wDeUwiUmem9FzsyysEwRukaEdDNcwbROvQ9QGRKaLI6t+IltNzbn4/i4asmB10auvZGQCzSQ6t0GSczEThlUXw==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -582,9 +576,9 @@ "dev": true }, "acorn": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", - "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==" + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==" }, "acorn-walk": { "version": "8.2.0", @@ -1478,9 +1472,9 @@ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, "ignore": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", - "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" }, "inflight": { "version": "1.0.6", @@ -1683,9 +1677,9 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "micro-base": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/micro-base/-/micro-base-0.9.0.tgz", - "integrity": "sha512-4+tOMKidYT5nQ6/UNmYrGVO5PMcnJdfuR4NC8HK8s2H61B4itOhA9yrsjBdqGV7ecdtej36x3YSIfPLRmPrspg==" + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/micro-base/-/micro-base-0.10.2.tgz", + "integrity": "sha512-lqqJrT7lfJtDmmiQ4zRLZuIJBk96t0RAc5pCrrWpL9zDeH5i/SUL85mku9HqzTI/OCZ8EQ3aicbMW+eK5Nyu5w==" }, "micromatch": { "version": "4.0.4", @@ -1882,59 +1876,53 @@ "@babel/runtime": "^7.16.3", "@polkadot/util": "7.9.2", "@polkadot/util-crypto": "7.9.2" - } - }, - "@polkadot/networks": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-7.9.2.tgz", - "integrity": "sha512-4obI1RdW5/7TFwbwKA9oqw8aggVZ65JAUvIFMd2YmMC2T4+NiZLnok0WhRkhZkUnqjLIHXYNwq7Ho1i39dte0g==", - "requires": { - "@babel/runtime": "^7.16.3" - } - }, - "@polkadot/util": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-7.9.2.tgz", - "integrity": "sha512-6ABY6ErgkCsM4C6+X+AJSY4pBGwbKlHZmUtHftaiTvbaj4XuA4nTo3GU28jw8wY0Jh2cJZJvt6/BJ5GVkm5tBA==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/x-textdecoder": "7.9.2", - "@polkadot/x-textencoder": "7.9.2", - "@types/bn.js": "^4.11.6", - "bn.js": "^4.12.0", - "camelcase": "^6.2.1", - "ip-regex": "^4.3.0" - } - }, - "@polkadot/util-crypto": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-7.9.2.tgz", - "integrity": "sha512-nNwqUwP44eCH9jKKcPie+IHLKkg9LMe6H7hXo91hy3AtoslnNrT51tP3uAm5yllhLvswJfnAgnlHq7ybCgqeFw==", - "requires": { - "@babel/runtime": "^7.16.3", - "@polkadot/networks": "7.9.2", - "@polkadot/util": "7.9.2", - "@polkadot/wasm-crypto": "^4.4.1", - "@polkadot/x-randomvalues": "7.9.2", - "blakejs": "^1.1.1", - "bn.js": "^4.12.0", - "create-hash": "^1.2.0", - "ed2curve": "^0.3.0", - "elliptic": "^6.5.4", - "hash.js": "^1.1.7", - "js-sha3": "^0.8.0", - "micro-base": "^0.9.0", - "scryptsy": "^2.1.0", - "tweetnacl": "^1.0.3", - "xxhashjs": "^0.2.2" - } - }, - "@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==", - "requires": { - "@babel/runtime": "^7.16.3" + }, + "dependencies": { + "@polkadot/networks": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-7.9.2.tgz", + "integrity": "sha512-4obI1RdW5/7TFwbwKA9oqw8aggVZ65JAUvIFMd2YmMC2T4+NiZLnok0WhRkhZkUnqjLIHXYNwq7Ho1i39dte0g==", + "requires": { + "@babel/runtime": "^7.16.3" + } + }, + "@polkadot/util": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-7.9.2.tgz", + "integrity": "sha512-6ABY6ErgkCsM4C6+X+AJSY4pBGwbKlHZmUtHftaiTvbaj4XuA4nTo3GU28jw8wY0Jh2cJZJvt6/BJ5GVkm5tBA==", + "requires": { + "@babel/runtime": "^7.16.3", + "@polkadot/x-textdecoder": "7.9.2", + "@polkadot/x-textencoder": "7.9.2", + "@types/bn.js": "^4.11.6", + "bn.js": "^4.12.0", + "camelcase": "^6.2.1", + "ip-regex": "^4.3.0" + } + }, + "@polkadot/util-crypto": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-7.9.2.tgz", + "integrity": "sha512-nNwqUwP44eCH9jKKcPie+IHLKkg9LMe6H7hXo91hy3AtoslnNrT51tP3uAm5yllhLvswJfnAgnlHq7ybCgqeFw==", + "requires": { + "@babel/runtime": "^7.16.3", + "@polkadot/networks": "7.9.2", + "@polkadot/util": "7.9.2", + "@polkadot/wasm-crypto": "^4.4.1", + "@polkadot/x-randomvalues": "7.9.2", + "blakejs": "^1.1.1", + "bn.js": "^4.12.0", + "create-hash": "^1.2.0", + "ed2curve": "^0.3.0", + "elliptic": "^6.5.4", + "hash.js": "^1.1.7", + "js-sha3": "^0.8.0", + "micro-base": "^0.9.0", + "scryptsy": "^2.1.0", + "tweetnacl": "^1.0.3", + "xxhashjs": "^0.2.2" + } + } } }, "@polkadot/x-randomvalues": { @@ -1944,6 +1932,16 @@ "requires": { "@babel/runtime": "^7.16.3", "@polkadot/x-global": "7.9.2" + }, + "dependencies": { + "@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==", + "requires": { + "@babel/runtime": "^7.16.3" + } + } } }, "@polkadot/x-textdecoder": { @@ -1953,6 +1951,16 @@ "requires": { "@babel/runtime": "^7.16.3", "@polkadot/x-global": "7.9.2" + }, + "dependencies": { + "@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==", + "requires": { + "@babel/runtime": "^7.16.3" + } + } } }, "@polkadot/x-textencoder": { @@ -1962,7 +1970,22 @@ "requires": { "@babel/runtime": "^7.16.3", "@polkadot/x-global": "7.9.2" + }, + "dependencies": { + "@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==", + "requires": { + "@babel/runtime": "^7.16.3" + } + } } + }, + "micro-base": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/micro-base/-/micro-base-0.9.0.tgz", + "integrity": "sha512-4+tOMKidYT5nQ6/UNmYrGVO5PMcnJdfuR4NC8HK8s2H61B4itOhA9yrsjBdqGV7ecdtej36x3YSIfPLRmPrspg==" } } }, @@ -2158,13 +2181,6 @@ "resolve": "^1.20.0", "stream-meter": "^1.0.4", "tslib": "2.3.1" - }, - "dependencies": { - "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - } } }, "pkg-fetch": { @@ -2351,11 +2367,11 @@ } }, "rxjs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.4.0.tgz", - "integrity": "sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.1.tgz", + "integrity": "sha512-KExVEeZWxMZnZhUZtsJcFwz8IvPvgu4G2Z2QyqjZQzUGr32KDYuSxrEYO4w3tFFNbfLozcrKUTvTPi+E9ywJkQ==", "requires": { - "tslib": "~2.1.0" + "tslib": "^2.1.0" } }, "safe-buffer": { @@ -2612,9 +2628,9 @@ } }, "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "tunnel-agent": { "version": "0.6.0", @@ -2657,9 +2673,9 @@ } }, "typescript": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", - "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==" + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==" }, "ultron": { "version": "1.1.1", @@ -2794,9 +2810,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yargs": { - "version": "17.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.0.tgz", - "integrity": "sha512-GQl1pWyDoGptFPJx9b9L6kmR33TGusZvXIZUT+BOz9f7X2L94oeAskFYLEg/FkhV06zZPBYLvLZRWeYId29lew==", + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", diff --git a/src/commands/signCommand.ts b/src/commands/signCommand.ts index 04d89f3..c62becb 100644 --- a/src/commands/signCommand.ts +++ b/src/commands/signCommand.ts @@ -1,7 +1,8 @@ import { Argv } from "yargs"; -import { SignArgs, SignPromptArgs } from "../methods/types"; +import { SignAndVerifyArgs, SignArgs, SignPromptArgs } from "../methods/types"; import { sign } from "../methods/sign"; import { isNetworkType } from "../methods/utils"; +import { verifyAndSign } from "../methods/verifyAndSign"; export const signOptions = { type: { @@ -44,6 +45,7 @@ export const signCommand = { }, }; +// TODO this should be an optional arg export const signPromptCommand = { command: "signPrompt [derivePath]", describe: "sign byteCode with a private key - using prompt", @@ -54,3 +56,35 @@ export const signPromptCommand = { await sign(isNetworkType(argv.type), argv.privateKey, true, argv.derivePath); }, }; + +export const verifyAndSignCommand = { + command: "verifyAndSign", + describe: "sign byteCode with a private key and verify against payload file", + builder: (yargs: Argv) => { + return yargs.options({ + ...signOptions, + message: { + describe: "message to be signed", + type: "string" as "string", + default: "0x0", + demandOption: true, + }, + filePath: { + describe: "file path of the saved extrinsic payload", + type: "string", + default: "payload.json", + demandOption: true, + }, + }); + }, + handler: async (argv: SignAndVerifyArgs) => { + await verifyAndSign( + isNetworkType(argv.type), + argv.privateKey, + false, + argv.derivePath, + argv.filePath, + argv.message + ); + }, +}; diff --git a/src/index.ts b/src/index.ts index 741bf86..3a81a40 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import yargs from "yargs"; -import { signCommand, signPromptCommand } from "./commands/signCommand"; +import { verifyAndSignCommand, signCommand, signPromptCommand } from "./commands/signCommand"; import { createAndSendTxCommand } from "./commands/createAndSendCommand"; import { verifyCommand } from "./commands/verifyCommand"; import { getTransactionDataCommand } from "./commands/getTransactionDataCommand"; @@ -12,6 +12,7 @@ const { hideBin } = require("yargs/helpers"); export const cli = yargs(hideBin(process.argv)) .command(signCommand) .command(signPromptCommand) + .command(verifyAndSignCommand) .command(voteCouncilCommand) .command(voteTechCommitteeCommand) .command(verifyCommand) diff --git a/src/methods/createAndSendTx.ts b/src/methods/createAndSendTx.ts index a5266bc..0ebdd13 100644 --- a/src/methods/createAndSendTx.ts +++ b/src/methods/createAndSendTx.ts @@ -3,14 +3,43 @@ import { u8aToHex } from "@polkadot/util"; import { typesBundlePre900 } from "moonbeam-types-bundle"; import { ISubmittableResult, SignerPayloadJSON } from "@polkadot/types/types"; import prompts from "prompts"; -import { moonbeamChains } from "./utils"; +import fs from "fs"; +import { instantiateApi, moonbeamChains } from "./utils"; import { SignerResult, SubmittableExtrinsic } from "@polkadot/api/types"; -import { NetworkArgs, TxArgs, TxParam } from "./types"; +import { + NetworkArgs, + PayloadVerificationInfo, + RegistryPersistantInfo, + TxArgs, + TxParam, +} from "./types"; + +export const getRegistryInfo = async (api: ApiPromise): Promise => { + const [runtimeVersion, chain, chainProps, chainMetadata] = await Promise.all([ + api.rpc.state.getRuntimeVersion(), + api.rpc.system.chain(), + api.rpc.system.properties(), + api.rpc.state.getMetadata(), + ]); + return { + runtimeVersion: { + specName: runtimeVersion.specName.toString(), + specVersion: Number(runtimeVersion.specVersion), + }, + chainName: chain.toString(), + chainProps: { + ss58Format: chainProps.ss58Format.toString(), + tokenSymbol: chainProps.tokenSymbol.toString(), + tokenDecimals: chainProps.tokenDecimals.toString(), + }, + metadataHex: chainMetadata.toHex(), + }; +}; export async function createAndSendTx( txArgs: TxArgs, networkArgs: NetworkArgs, - signatureFunction: (payload: string) => Promise<`0x${string}`> + signatureFunction: (payload: `0x${string}`, filePath: string) => Promise<`0x${string}`> ) { const { tx, params, address, sudo } = txArgs; const { ws, network } = networkArgs; @@ -19,33 +48,38 @@ export async function createAndSendTx( ? (params as TxParam[]) : (params as string).split(","); - let api: ApiPromise; - if (moonbeamChains.includes(network)) { - api = await ApiPromise.create({ - provider: new WsProvider(ws), - typesBundle: typesBundlePre900 as any, - }); - } else { - api = await ApiPromise.create({ - provider: new WsProvider(ws), - }); - } + const api=await instantiateApi(network,ws) + let txExtrinsic: SubmittableExtrinsic<"promise", ISubmittableResult>; if (sudo) { txExtrinsic = await api.tx.sudo.sudo(api.tx[section][method](...splitParams)); } else { txExtrinsic = await api.tx[section][method](...splitParams); } + console.log('txExtrinsic',txExtrinsic.toHex()) const signer = { - signPayload: (payload: SignerPayloadJSON) => { + signPayload: async (payload: SignerPayloadJSON) => { console.log("(sign)", payload); // create the actual payload we will be using const xp = txExtrinsic.registry.createType("ExtrinsicPayload", payload); - console.log("Transaction data to be signed : ", u8aToHex(xp.toU8a(true))); + const payloadHex = u8aToHex(xp.toU8a(true)); + console.log("Transaction data to be signed : ", payloadHex); + + // save tx data in a file + const payloadData: PayloadVerificationInfo = { + payload, + registryInfo: await getRegistryInfo(api), + }; + const data = JSON.stringify(payloadData, null, 2); + const filePath: string = `payload-${payloadHex.substring(0, 10)}...${payloadHex.substring( + payloadHex.length - 10, + payloadHex.length + )}.json`; + fs.writeFileSync(filePath, data); return new Promise(async (resolve) => { - const signature = await signatureFunction(u8aToHex(xp.toU8a(true))); + const signature = await signatureFunction(payloadHex, filePath); resolve({ id: 1, signature }); }); }, @@ -74,7 +108,7 @@ export async function createAndSendTx( }); } export async function createAndSendTxPrompt(txArgs: TxArgs, networkArgs: NetworkArgs) { - return createAndSendTx(txArgs, networkArgs, async (payload: string) => { + return createAndSendTx(txArgs, networkArgs, async (payload: `0x${string}`) => { const response = await prompts({ type: "text", name: "signature", diff --git a/src/methods/getTransactionData.ts b/src/methods/getTransactionData.ts index 31b61e8..21e4e22 100644 --- a/src/methods/getTransactionData.ts +++ b/src/methods/getTransactionData.ts @@ -1,14 +1,17 @@ import { createAndSendTx } from "./createAndSendTx"; import { NetworkArgs, TxArgs } from "./types"; -export async function getTransactionData(txArgs: TxArgs, networkArgs: NetworkArgs) { - return createAndSendTx( - txArgs, - networkArgs, - // Here we don't want to send the signature, - // just see the payload so we return empty signature - async (_: string) => { - return "0x"; - } - ); +export async function getTransactionData(txArgs: TxArgs, networkArgs: NetworkArgs):Promise<{payload:`0x${string}`, filePath:string}> { + return new Promise((res)=>{ + createAndSendTx( + txArgs, + networkArgs, + // Here we don't want to send the signature, + // just see the payload so we return empty signature + async (payload: `0x${string}`, filePath:string) => { + res({payload, filePath}) + return "0x"; + } + ); + }) } diff --git a/src/methods/sign.ts b/src/methods/sign.ts index 3a339ea..6763dab 100644 --- a/src/methods/sign.ts +++ b/src/methods/sign.ts @@ -1,4 +1,4 @@ -import { hexToU8a, stringToU8a, u8aToHex } from "@polkadot/util"; +import { hexToU8a, u8aToHex } from "@polkadot/util"; import { Keyring } from "@polkadot/keyring"; import type { KeyringPair } from "@polkadot/keyring/types"; import type { KeypairType } from "@polkadot/util-crypto/types"; @@ -6,14 +6,13 @@ import { cryptoWaitReady } from "@polkadot/util-crypto"; import prompts from "prompts"; import { NetworkType } from "./types"; -// TODO display payload content export async function sign( type: NetworkType, privKeyOrMnemonic: string, prompt: boolean, derivePath: string, message?: string -): Promise { +): Promise<`0x${string}`> { if (!["ethereum", "sr25519"].includes(type)) { throw new Error("Type is not supported"); } diff --git a/src/methods/types.ts b/src/methods/types.ts index 2c240ca..90c7915 100644 --- a/src/methods/types.ts +++ b/src/methods/types.ts @@ -1,7 +1,12 @@ +import { SignerPayloadJSON } from "@polkadot/types/types"; + // Command Args export interface SignArgs extends SignPromptArgs { message: string; } +export interface SignAndVerifyArgs extends SignArgs { + filePath: string; +} export interface SignPromptArgs { type: string; privateKey: string; @@ -48,3 +53,17 @@ export interface NetworkArgs { } export type NetworkType = "ethereum" | "sr25519"; + +//Registry + +export interface RegistryPersistantInfo { + runtimeVersion: { specName: string; specVersion: number }; + chainName: string; + chainProps: { ss58Format: string; tokenSymbol: string; tokenDecimals: string }; + metadataHex: `0x${string}`; +} + +export interface PayloadVerificationInfo { + payload: SignerPayloadJSON; + registryInfo: RegistryPersistantInfo; +} diff --git a/src/methods/utils.ts b/src/methods/utils.ts index b692222..943cbe9 100644 --- a/src/methods/utils.ts +++ b/src/methods/utils.ts @@ -1,3 +1,5 @@ +import { ApiPromise, WsProvider } from "@polkadot/api"; +import { typesBundlePre900 } from "moonbeam-types-bundle"; import { NetworkType } from "./types"; export const moonbeamChains = ["moonbase", "moonbeam", "moonriver", "moonshadow"]; @@ -16,6 +18,22 @@ export function isNetworkType(type: string): NetworkType { } } +export async function instantiateApi(network:string,ws:string):Promise { + + let api: ApiPromise; + if (moonbeamChains.includes(network)) { + api = await ApiPromise.create({ + provider: new WsProvider(ws), + typesBundle: typesBundlePre900 as any, + }); + } else { + api = await ApiPromise.create({ + provider: new WsProvider(ws), + }); + } + return api +} + export function exit() { process.exit(); } diff --git a/src/methods/verifyAndSign.ts b/src/methods/verifyAndSign.ts new file mode 100644 index 0000000..6c63217 --- /dev/null +++ b/src/methods/verifyAndSign.ts @@ -0,0 +1,42 @@ +import { + u8aToHex, +} from "@polkadot/util"; +import fs from "fs"; +import { Metadata, TypeRegistry } from "@polkadot/types"; +import { NetworkType, PayloadVerificationInfo, RegistryPersistantInfo } from "./types"; + +import { sign } from "./sign"; +import { initRegistry } from "./registryUtils"; + + +export async function verifyAndSign( + type: NetworkType, + privKeyOrMnemonic: string, + prompt: boolean, + derivePath: string, + filePath: string, + message: string +): Promise<`0x${string}`> { + // get the payload data from the file + const rawdata = fs.readFileSync(filePath); + const payloadVerifInfoFromFile: PayloadVerificationInfo = JSON.parse(rawdata as any); + + // Recreate registry + const registry = new TypeRegistry(); + await initRegistry(registry, payloadVerifInfoFromFile.registryInfo); + + // Check the payload against payload info + const hexFromSimpleRegistry = u8aToHex( + registry + .createType("ExtrinsicPayload", payloadVerifInfoFromFile.payload, { + version: payloadVerifInfoFromFile.payload.version, + }) + .toU8a(true) + ); + + if (hexFromSimpleRegistry !== message) { + throw new Error("Payload is not matching payload in filepath"); + } + + return sign(type, privKeyOrMnemonic, prompt, derivePath, message); +} diff --git a/test/createAndSendTx.spec.ts b/test/createAndSendTx.spec.ts index e42ffe5..a3e91dc 100644 --- a/test/createAndSendTx.spec.ts +++ b/test/createAndSendTx.spec.ts @@ -2,11 +2,17 @@ import { ApiPromise, WsProvider } from "@polkadot/api"; import { expect } from "chai"; import { ChildProcess } from "child_process"; import { typesBundlePre900 } from "moonbeam-types-bundle"; -import { clearInterval } from "timers"; +import {getTransactionData} from '../src/methods/getTransactionData' +import {sendSignedTx} from '../src/methods/sendSignedTx' +import {verifyAndSign} from '../src/methods/verifyAndSign' import { createAndSendTx } from "../src/methods/createAndSendTx"; import { ALITH, BALTATHAR, testnetWs } from "../src/methods/utils"; import { createAndFinalizeBlock, startMoonbeamDevNode } from "./dev-node"; -import { testSignCLIPrivateKey } from "./sign.spec"; +import { + testSignCLIPrivateKey, + testSignCLIPrivateKeyWithFilePath, + testSignCLIWithFilePathWithError, +} from "./sign.spec"; var assert = require("assert"); const testAmount = "1000000000000"; @@ -26,6 +32,7 @@ describe("Create and Send Tx Integration Test", function () { // setup network const init = await startMoonbeamDevNode(false); wsUrl = `ws://localhost:${init.wsPort}`; + console.log("wsUrl", wsUrl); api = await ApiPromise.create({ provider: new WsProvider(wsUrl), typesBundle: typesBundlePre900 as any, @@ -70,6 +77,146 @@ describe("Create and Send Tx Integration Test", function () { (Number(initialBalance) + Number(testAmount)).toString().substring(0, 15) ); }); + it.only("should increment Baltathar's account balance - step by step", async function () { + this.timeout(40000); + + // First get initial balance of Baltathar + const initialBalance = await getBalance(BALTATHAR, api); + + // Start producing blocks in parallel + let produceBlocks = true; + setInterval(async () => { + if (produceBlocks) { + await createAndFinalizeBlock(api, undefined, true); + } + }, 500); + + // create and send transfer tx from ALITH + // await createAndSendTx( + // { + // tx: "balances.transfer", + // params: BALTATHAR + "," + testAmount, + // address: ALITH, + // sudo: false, + // }, + // { ws: wsUrl, network: "moonbase" }, + // async (payload: string) => { + // return await testSignCLIPrivateKey(payload); + // } + // ); + const networkArgs={ ws: wsUrl, network: "moonbase" } + let {payload,filePath}=await getTransactionData({ + tx: "balances.transfer", + params: BALTATHAR + "," + testAmount, + address: ALITH, + sudo: false, + },networkArgs + ) + console.log(1) + let signature=await verifyAndSign('ethereum','0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133',false,`/m/44'/60'/0'/0/0`,filePath,payload) + console.log(2) + await sendSignedTx(networkArgs,filePath,signature,"0x740403003cd0a705a2dc65e5b1e1205896baa2be8a07c6e0070010a5d4e8") + console.log(3) + + // Stop producing blocks + produceBlocks = false; + + // Then check incremented balance of Baltathar + const finalBalance = await getBalance(BALTATHAR, api); + assert.equal( + Number(finalBalance).toString().substring(0, 15), + (Number(initialBalance) + Number(testAmount)).toString().substring(0, 15) + ); + }); + it("should increment Baltathar's account balance - use file to verify", async function () { + this.timeout(40000); + + // First get initial balance of Baltathar + const initialBalance = await getBalance(BALTATHAR, api); + + // Start producing blocks in parallel + let produceBlocks = true; + setInterval(async () => { + if (produceBlocks) { + await createAndFinalizeBlock(api, undefined, true); + } + }, 500); + + // create and send transfer tx from ALITH + await createAndSendTx( + { + tx: "balances.transfer", + params: BALTATHAR + "," + testAmount, + address: ALITH, + sudo: false, + }, + { ws: wsUrl, network: "moonbase" }, + async (payload: string, filePath: string) => { + return await testSignCLIPrivateKeyWithFilePath(payload, filePath, wsUrl); + } + ); + + // Stop producing blocks + produceBlocks = false; + + // Then check incremented balance of Baltathar + const finalBalance = await getBalance(BALTATHAR, api); + assert.equal( + Number(finalBalance).toString().substring(0, 15), + (Number(initialBalance) + Number(testAmount)).toString().substring(0, 15) + ); + }); + it("shouldn't increment Baltathar's account balance - use file to verify and fail", async function () { + this.timeout(40000); + + // First get initial balance of Baltathar + const initialBalance = await getBalance(BALTATHAR, api); + + // Start producing blocks in parallel + let produceBlocks = true; + setInterval(async () => { + if (produceBlocks) { + await createAndFinalizeBlock(api, undefined, true); + } + }, 500); + + // create and send transfer tx from ALITH + const error: string = await new Promise((res) => { + createAndSendTx( + { + tx: "balances.transfer", + params: BALTATHAR + "," + testAmount, + address: ALITH, + sudo: false, + }, + { ws: wsUrl, network: "moonbase" }, + async (payload: string, filePath: string) => { + // look for error + console.log("payload", payload); + console.log("payload", payload.substring(0, payload.length - 3) + "zzz"); + res( + await testSignCLIWithFilePathWithError( + payload.substring(0, payload.length - 3) + "zzz", + filePath + ) + ); + return "0x0"; + } + ); + }); + // expect error from the sign cli + expect(error.substring(0, 50)).to.eq("Error: Payload is not matching payload in filepath"); + + // Stop producing blocks + produceBlocks = false; + + // Then check incremented balance of Baltathar + const finalBalance = await getBalance(BALTATHAR, api); + assert.equal( + Number(finalBalance).toString(), //.substring(0, 15), + Number(initialBalance).toString() //.substring(0, 15) + ); + }); // tx expire after 256 blocks in moonbeam it("should increment Baltathar's account balance - immortal tx", async function () { this.timeout(40000); diff --git a/test/sign.spec.ts b/test/sign.spec.ts index 5359a5a..b71fd06 100644 --- a/test/sign.spec.ts +++ b/test/sign.spec.ts @@ -9,15 +9,29 @@ const expectedSignature = const expectedSignatureBaltathar = "0xa85517f8b6c9d88810fff4e734db98adf5ed77547ac4adc3c61e4dbb539a2caa1cbc0cf4b8708bb81bc48a4748c040fcafd7ae9cd1882313df420cdf1eb15a1b01"; -export async function testSign(command: string): Promise<`0x${string}`> { +export async function testSign( + command: string, + lookForError: boolean = false +): Promise<`0x${string}`> { return new Promise((resolve) => { let call = exec(command); - call.stdout?.on("data", function (chunk) { - let message = chunk.toString(); - if (message.substring(0, 12) === "SIGNATURE : ") { - resolve(message.substring(12, message.length - 1)); - } - }); + if (lookForError) { + call.stderr?.on("data", function (chunk) { + let message = chunk.toString(); + if (message.substring(0, 5) === "Error") { + resolve(message); + } + }); + } else { + call.stdout?.on("data", function (chunk) { + let message = chunk.toString(); + if (message.search("SIGNATURE") > -1) { + resolve( + message.substring(message.search("SIGNATURE") + 12, message.search("SIGNATURE") + 144) + ); + } + }); + } }); } @@ -28,6 +42,32 @@ export async function testSignCLIPrivateKey(data: string): Promise<`0x${string}` ); } +export async function testSignCLIPrivateKeyWithFilePath( + data: string, + filePath: string, + wsUrl: string +): Promise<`0x${string}`> { + return testSign( + "npm run cli verifyAndSign -- --type ethereum --privateKey 0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133 --message " + + data + + " --filePath " + + filePath + ); +} + +export async function testSignCLIWithFilePathWithError( + data: string, + filePath: string +): Promise { + return testSign( + "npm run cli verifyAndSign -- --type ethereum --privateKey 0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133 --message " + + data + + " --filePath " + + filePath, + true + ); +} + export async function testSignCLIMnemonic(data: string): Promise<`0x${string}`> { return testSign( `npm run cli sign -- --type ethereum --mnemonic "bottom drive obey lake curtain smoke basket hold race lonely fit walk" --message ` +