From abd8887856552405bf089e6ecd1b35184b76c911 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Thu, 5 Nov 2020 18:01:07 +0100 Subject: [PATCH 01/16] added polkadot-js types --- polkadot-js/alphanet-types.json | 26 ++++++++++++++++++++++++++ polkadot-js/parachain-types.json | 26 ++++++++++++++++++++++++++ polkadot-js/standalone-types.json | 26 ++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 polkadot-js/alphanet-types.json create mode 100644 polkadot-js/parachain-types.json create mode 100644 polkadot-js/standalone-types.json diff --git a/polkadot-js/alphanet-types.json b/polkadot-js/alphanet-types.json new file mode 100644 index 0000000000..1ef59c3499 --- /dev/null +++ b/polkadot-js/alphanet-types.json @@ -0,0 +1,26 @@ +{ + "AccountId": "EthereumAccountId", + "Address": "AccountId", + "Balance": "u128", + "RefCount": "u8", + // mapping the lookup + "LookupSource": "AccountId", + "Account": { + "nonce": "U256", + "balance": "u128", + }, + "Transaction": { + "nonce": "U256", + "action": "String", + "gas_price": "u64", + "gas_limit": "u64", + "value": "U256", + "input": "Vec", + "signature": "Signature", + }, + "Signature": { + "v": "u64", + "r": "H256", + "s": "H256", + }, + } diff --git a/polkadot-js/parachain-types.json b/polkadot-js/parachain-types.json new file mode 100644 index 0000000000..1ef59c3499 --- /dev/null +++ b/polkadot-js/parachain-types.json @@ -0,0 +1,26 @@ +{ + "AccountId": "EthereumAccountId", + "Address": "AccountId", + "Balance": "u128", + "RefCount": "u8", + // mapping the lookup + "LookupSource": "AccountId", + "Account": { + "nonce": "U256", + "balance": "u128", + }, + "Transaction": { + "nonce": "U256", + "action": "String", + "gas_price": "u64", + "gas_limit": "u64", + "value": "U256", + "input": "Vec", + "signature": "Signature", + }, + "Signature": { + "v": "u64", + "r": "H256", + "s": "H256", + }, + } diff --git a/polkadot-js/standalone-types.json b/polkadot-js/standalone-types.json new file mode 100644 index 0000000000..1ef59c3499 --- /dev/null +++ b/polkadot-js/standalone-types.json @@ -0,0 +1,26 @@ +{ + "AccountId": "EthereumAccountId", + "Address": "AccountId", + "Balance": "u128", + "RefCount": "u8", + // mapping the lookup + "LookupSource": "AccountId", + "Account": { + "nonce": "U256", + "balance": "u128", + }, + "Transaction": { + "nonce": "U256", + "action": "String", + "gas_price": "u64", + "gas_limit": "u64", + "value": "U256", + "input": "Vec", + "signature": "Signature", + }, + "Signature": { + "v": "u64", + "r": "H256", + "s": "H256", + }, + } From 7a6cc224d06d3545336db794ba656ddf6f067891 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Thu, 5 Nov 2020 18:18:39 +0100 Subject: [PATCH 02/16] lint --- polkadot-js/alphanet-types.json | 50 +++++++++++++++---------------- polkadot-js/parachain-types.json | 50 +++++++++++++++---------------- polkadot-js/standalone-types.json | 50 +++++++++++++++---------------- 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/polkadot-js/alphanet-types.json b/polkadot-js/alphanet-types.json index 1ef59c3499..935d10b00e 100644 --- a/polkadot-js/alphanet-types.json +++ b/polkadot-js/alphanet-types.json @@ -1,26 +1,26 @@ { - "AccountId": "EthereumAccountId", - "Address": "AccountId", - "Balance": "u128", - "RefCount": "u8", - // mapping the lookup - "LookupSource": "AccountId", - "Account": { - "nonce": "U256", - "balance": "u128", - }, - "Transaction": { - "nonce": "U256", - "action": "String", - "gas_price": "u64", - "gas_limit": "u64", - "value": "U256", - "input": "Vec", - "signature": "Signature", - }, - "Signature": { - "v": "u64", - "r": "H256", - "s": "H256", - }, - } + "AccountId": "EthereumAccountId", + "Address": "AccountId", + "Balance": "u128", + "RefCount": "u8", + // mapping the lookup + "LookupSource": "AccountId", + "Account": { + "nonce": "U256", + "balance": "u128" + }, + "Transaction": { + "nonce": "U256", + "action": "String", + "gas_price": "u64", + "gas_limit": "u64", + "value": "U256", + "input": "Vec", + "signature": "Signature" + }, + "Signature": { + "v": "u64", + "r": "H256", + "s": "H256" + } +} diff --git a/polkadot-js/parachain-types.json b/polkadot-js/parachain-types.json index 1ef59c3499..935d10b00e 100644 --- a/polkadot-js/parachain-types.json +++ b/polkadot-js/parachain-types.json @@ -1,26 +1,26 @@ { - "AccountId": "EthereumAccountId", - "Address": "AccountId", - "Balance": "u128", - "RefCount": "u8", - // mapping the lookup - "LookupSource": "AccountId", - "Account": { - "nonce": "U256", - "balance": "u128", - }, - "Transaction": { - "nonce": "U256", - "action": "String", - "gas_price": "u64", - "gas_limit": "u64", - "value": "U256", - "input": "Vec", - "signature": "Signature", - }, - "Signature": { - "v": "u64", - "r": "H256", - "s": "H256", - }, - } + "AccountId": "EthereumAccountId", + "Address": "AccountId", + "Balance": "u128", + "RefCount": "u8", + // mapping the lookup + "LookupSource": "AccountId", + "Account": { + "nonce": "U256", + "balance": "u128" + }, + "Transaction": { + "nonce": "U256", + "action": "String", + "gas_price": "u64", + "gas_limit": "u64", + "value": "U256", + "input": "Vec", + "signature": "Signature" + }, + "Signature": { + "v": "u64", + "r": "H256", + "s": "H256" + } +} diff --git a/polkadot-js/standalone-types.json b/polkadot-js/standalone-types.json index 1ef59c3499..935d10b00e 100644 --- a/polkadot-js/standalone-types.json +++ b/polkadot-js/standalone-types.json @@ -1,26 +1,26 @@ { - "AccountId": "EthereumAccountId", - "Address": "AccountId", - "Balance": "u128", - "RefCount": "u8", - // mapping the lookup - "LookupSource": "AccountId", - "Account": { - "nonce": "U256", - "balance": "u128", - }, - "Transaction": { - "nonce": "U256", - "action": "String", - "gas_price": "u64", - "gas_limit": "u64", - "value": "U256", - "input": "Vec", - "signature": "Signature", - }, - "Signature": { - "v": "u64", - "r": "H256", - "s": "H256", - }, - } + "AccountId": "EthereumAccountId", + "Address": "AccountId", + "Balance": "u128", + "RefCount": "u8", + // mapping the lookup + "LookupSource": "AccountId", + "Account": { + "nonce": "U256", + "balance": "u128" + }, + "Transaction": { + "nonce": "U256", + "action": "String", + "gas_price": "u64", + "gas_limit": "u64", + "value": "U256", + "input": "Vec", + "signature": "Signature" + }, + "Signature": { + "v": "u64", + "r": "H256", + "s": "H256" + } +} From 217ad8eba120b84c0e814c177368805ef0857979 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Thu, 5 Nov 2020 18:21:24 +0100 Subject: [PATCH 03/16] turn lint on save on --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0281d35460..07c5d0ae14 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "editor.formatOnSave": false, + "editor.formatOnSave": true, "editor.rulers": [100], "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" From 7fe079e1b638a56aff6904139fe8c1bbdb80d074 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Fri, 6 Nov 2020 14:29:48 +0100 Subject: [PATCH 04/16] remove parachain types and comments --- polkadot-js/alphanet-types.json | 1 - polkadot-js/parachain-types.json | 26 -------------------------- polkadot-js/standalone-types.json | 1 - 3 files changed, 28 deletions(-) delete mode 100644 polkadot-js/parachain-types.json diff --git a/polkadot-js/alphanet-types.json b/polkadot-js/alphanet-types.json index 935d10b00e..40ba01d70a 100644 --- a/polkadot-js/alphanet-types.json +++ b/polkadot-js/alphanet-types.json @@ -3,7 +3,6 @@ "Address": "AccountId", "Balance": "u128", "RefCount": "u8", - // mapping the lookup "LookupSource": "AccountId", "Account": { "nonce": "U256", diff --git a/polkadot-js/parachain-types.json b/polkadot-js/parachain-types.json deleted file mode 100644 index 935d10b00e..0000000000 --- a/polkadot-js/parachain-types.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "AccountId": "EthereumAccountId", - "Address": "AccountId", - "Balance": "u128", - "RefCount": "u8", - // mapping the lookup - "LookupSource": "AccountId", - "Account": { - "nonce": "U256", - "balance": "u128" - }, - "Transaction": { - "nonce": "U256", - "action": "String", - "gas_price": "u64", - "gas_limit": "u64", - "value": "U256", - "input": "Vec", - "signature": "Signature" - }, - "Signature": { - "v": "u64", - "r": "H256", - "s": "H256" - } -} diff --git a/polkadot-js/standalone-types.json b/polkadot-js/standalone-types.json index 935d10b00e..40ba01d70a 100644 --- a/polkadot-js/standalone-types.json +++ b/polkadot-js/standalone-types.json @@ -3,7 +3,6 @@ "Address": "AccountId", "Balance": "u128", "RefCount": "u8", - // mapping the lookup "LookupSource": "AccountId", "Account": { "nonce": "U256", From 4bd7b9915a6511cd8e68d2b200964c45abc41c92 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Tue, 10 Nov 2020 16:46:22 +0100 Subject: [PATCH 05/16] added new types --- polkadot-js/alphanet-types.json | 58 +++++++++++++++++++++++++++---- polkadot-js/standalone-types.json | 58 +++++++++++++++++++++++++++---- 2 files changed, 104 insertions(+), 12 deletions(-) diff --git a/polkadot-js/alphanet-types.json b/polkadot-js/alphanet-types.json index 40ba01d70a..60c8d40db9 100644 --- a/polkadot-js/alphanet-types.json +++ b/polkadot-js/alphanet-types.json @@ -8,18 +8,64 @@ "nonce": "U256", "balance": "u128" }, + "TransactionCondition":{ + "_enum": { + "block": "u64", + "time": "u64" + } + }, "Transaction": { - "nonce": "U256", "action": "String", - "gas_price": "u64", + "block_hash": "Option", + "block_number": "Option", + "chain_id": "Option", + "condition": "Option", + "creates": "Option", + "from": "H160", + "gas": "U256", + "gas_price": "U256", "gas_limit": "u64", - "value": "U256", - "input": "Vec", - "signature": "Signature" + "hash": "H256", + "input": "Bytes", + "nonce": "U256", + "public_key": "Option", + "r": "U256", + "raw": "Bytes", + "s": "U256", + "signature": "Signature", + "standard_v": "U256", + "to": "Option", + "transaction_index": "Option", + "v": "U256", + "value": "U256" }, "Signature": { "v": "u64", "r": "H256", "s": "H256" + }, + "TransactionStatus": { + "transaction_hash": "H256", + "transaction_index": "u32", + "from": "H160", + "to": "Option", + "contract_address": "Option", + "logs": "Vec", + "logs_bloom": "Bloom", + }, + "Receipt": { + "transaction_hash": "Option", + "transaction_index": "Option", + "block_hash": "Option", + "from": "Option", + "to": "Option", + "block_number": "Option", + "cumulative_gas_used": "U256", + "gas_used": "Option", + "contract_address": "Option", + "logs": "Vec", + "state_root": "Option", + "logs_bloom": "H2048", + "status_code": "Option", } -} +} \ No newline at end of file diff --git a/polkadot-js/standalone-types.json b/polkadot-js/standalone-types.json index 40ba01d70a..60c8d40db9 100644 --- a/polkadot-js/standalone-types.json +++ b/polkadot-js/standalone-types.json @@ -8,18 +8,64 @@ "nonce": "U256", "balance": "u128" }, + "TransactionCondition":{ + "_enum": { + "block": "u64", + "time": "u64" + } + }, "Transaction": { - "nonce": "U256", "action": "String", - "gas_price": "u64", + "block_hash": "Option", + "block_number": "Option", + "chain_id": "Option", + "condition": "Option", + "creates": "Option", + "from": "H160", + "gas": "U256", + "gas_price": "U256", "gas_limit": "u64", - "value": "U256", - "input": "Vec", - "signature": "Signature" + "hash": "H256", + "input": "Bytes", + "nonce": "U256", + "public_key": "Option", + "r": "U256", + "raw": "Bytes", + "s": "U256", + "signature": "Signature", + "standard_v": "U256", + "to": "Option", + "transaction_index": "Option", + "v": "U256", + "value": "U256" }, "Signature": { "v": "u64", "r": "H256", "s": "H256" + }, + "TransactionStatus": { + "transaction_hash": "H256", + "transaction_index": "u32", + "from": "H160", + "to": "Option", + "contract_address": "Option", + "logs": "Vec", + "logs_bloom": "Bloom", + }, + "Receipt": { + "transaction_hash": "Option", + "transaction_index": "Option", + "block_hash": "Option", + "from": "Option", + "to": "Option", + "block_number": "Option", + "cumulative_gas_used": "U256", + "gas_used": "Option", + "contract_address": "Option", + "logs": "Vec", + "state_root": "Option", + "logs_bloom": "H2048", + "status_code": "Option", } -} +} \ No newline at end of file From f8b2ccadedc9f5271f7e0e29e12c64882bb82a9c Mon Sep 17 00:00:00 2001 From: joelamouche Date: Tue, 10 Nov 2020 16:50:53 +0100 Subject: [PATCH 06/16] added rpc types --- package-lock.json | 573 ++++++++++++++++++++++++++++++ polkadot-js/frontier-rpc-types.ts | 65 ++++ 2 files changed, 638 insertions(+) create mode 100644 package-lock.json create mode 100644 polkadot-js/frontier-rpc-types.ts diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..91144a1c09 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,573 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@babel/runtime": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@polkadot/metadata": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-2.6.1.tgz", + "integrity": "sha512-pgKjWc0pF/2CKb06vjLdXjWzX7vgLwI6vXgJ/k4bSLHPJIryYKDp0fp0W+B11dkSzwbjL99sJoiGue6UXfeMeg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.1", + "@polkadot/types": "2.6.1", + "@polkadot/types-known": "2.6.1", + "@polkadot/util": "^4.0.1", + "@polkadot/util-crypto": "^4.0.1", + "bn.js": "^5.1.3" + } + }, + "@polkadot/networks": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-4.0.1.tgz", + "integrity": "sha512-GzEcVo+lWEdKZ6bK5R33zTGBMLQtf/9GwAf27Acxa23xk6aI5fpSHXcUm5ilUyD9vmNoRH3WnhfgVrTJ7uWe+Q==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.1" + } + }, + "@polkadot/types": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-2.6.1.tgz", + "integrity": "sha512-pb3VVOsEKaD7M3tFta9UtDL5zM+2/rsmstwBatA71b53Glr5XPxYtT8LI7dqjHZVLjHxKsYRKtTUhuNB7onQ8w==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.1", + "@polkadot/metadata": "2.6.1", + "@polkadot/util": "^4.0.1", + "@polkadot/util-crypto": "^4.0.1", + "@types/bn.js": "^4.11.6", + "bn.js": "^5.1.3", + "memoizee": "^0.4.14", + "rxjs": "^6.6.3" + } + }, + "@polkadot/types-known": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-2.6.1.tgz", + "integrity": "sha512-ZyWFzvuMS1umuhDYExqr9r0/69ME6QkIOgxfhXh9Ag4rkIlH+J0i+YO2H6F11zT+gqGPvqL8Vn2w8XlNjGNwcQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.1", + "@polkadot/types": "2.6.1", + "@polkadot/util": "^4.0.1", + "bn.js": "^5.1.3" + } + }, + "@polkadot/util": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-4.0.1.tgz", + "integrity": "sha512-t8INPSJZI0eWhobpaR+Ul2h8dKtaw+P8UiAL1Q5WeSD0iaVA2IbJvYacdztvkN1AZEcNgbFSMSDKZmzIKBxHpg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.1", + "@polkadot/x-textdecoder": "4.0.1", + "@polkadot/x-textencoder": "4.0.1", + "@types/bn.js": "^4.11.6", + "bn.js": "^5.1.3", + "camelcase": "^5.3.1", + "ip-regex": "^4.2.0" + } + }, + "@polkadot/util-crypto": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-4.0.1.tgz", + "integrity": "sha512-D5gzmvtsZPVZejkngQB4DpKF3WyFxhWtT8DpwkgIxIvOkbS0FvVXCISqSfauh8ZnfrAp4677Ha4YZ3sCKemS5g==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.1", + "@polkadot/networks": "4.0.1", + "@polkadot/util": "4.0.1", + "@polkadot/wasm-crypto": "^2.0.1", + "@polkadot/x-randomvalues": "4.0.1", + "base-x": "^3.0.8", + "blakejs": "^1.1.0", + "bn.js": "^5.1.3", + "create-hash": "^1.2.0", + "elliptic": "^6.5.3", + "js-sha3": "^0.8.0", + "pbkdf2": "^3.1.1", + "scryptsy": "^2.1.0", + "tweetnacl": "^1.0.3", + "xxhashjs": "^0.2.2" + } + }, + "@polkadot/wasm-crypto": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-2.0.1.tgz", + "integrity": "sha512-Vb0q4NToCRHXYJwhLWc4NTy77+n1dtJmkiE1tt8j1pmY4IJ4UL25yBxaS8NCS1LGqofdUYK1wwgrHiq5A78PFA==", + "dev": true + }, + "@polkadot/x-randomvalues": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-4.0.1.tgz", + "integrity": "sha512-Oe1LaoE2pQZGQweqRjF8TVXx+6K1Zxe1+IjvCUbwnDOSthn3Q+Tywf9S3Wn+yME6ul08J14GlGtyoHJMLgmqFQ==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.1" + } + }, + "@polkadot/x-textdecoder": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-4.0.1.tgz", + "integrity": "sha512-kRn9PY8Ffm8+g55UPbgEwGhVTDA9dFP3hmo9RD1DFXZkB0PyETDB37dr8YVC4C1LXAIBINBhrgjCMlSbJoUwuw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.1" + } + }, + "@polkadot/x-textencoder": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-4.0.1.tgz", + "integrity": "sha512-2C1TpImfWDy6R7Bymq2luPo50VZioQE7ruM3pgKAr2ogZIu8KnlilI5V84qWkzVsqU3G3Dk0yqXUXPZqDdDA2g==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.1" + } + }, + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.14.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz", + "integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==", + "dev": true + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", + "dev": true + }, + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cuint": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cuint/-/cuint-0.2.2.tgz", + "integrity": "sha1-QICG1AlVDCYxFVYZ6fp7ytw7mRs=", + "dev": true + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + }, + "dependencies": { + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + } + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", + "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", + "dev": true + } + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ip-regex": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz", + "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A==", + "dev": true + }, + "is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "dev": true + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "dev": true, + "requires": { + "es5-ext": "~0.10.2" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memoizee": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", + "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.45", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.5" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "dev": true + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", + "dev": true + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rxjs": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "scryptsy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", + "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "dev": true, + "requires": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "xxhashjs": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz", + "integrity": "sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw==", + "dev": true, + "requires": { + "cuint": "^0.2.2" + } + } + } +} diff --git a/polkadot-js/frontier-rpc-types.ts b/polkadot-js/frontier-rpc-types.ts new file mode 100644 index 0000000000..4210d42c99 --- /dev/null +++ b/polkadot-js/frontier-rpc-types.ts @@ -0,0 +1,65 @@ +// Copyright 2017-2020 @polkadot/apps-config authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { DefinitionRpc, DefinitionRpcParam } from '@polkadot/types/types'; + +export default function (): Record> { + function generateDescription (description:string, returnType:string, params:DefinitionRpcParam[] = []):DefinitionRpc { + return { + description, + params, + type: returnType + }; + } + + const numberParam: DefinitionRpcParam = { isOptional: true, name: 'number', type: 'BlockNumber' }; + const hashParam: DefinitionRpcParam = { name: 'hash', type: 'H256' }; + const reqParam: DefinitionRpcParam = { name: 'request', type: 'CallRequest' }; + const blockParam: DefinitionRpcParam = { name: 'block', type: 'BlockNumber' }; + const addressParam: DefinitionRpcParam = { name: 'address', type: 'H160' }; + const indexParam: DefinitionRpcParam = { name: 'index', type: 'U256' }; + + return { + eth: { + accounts: generateDescription('Returns accounts list.', 'Vec'), + blockNumber: generateDescription('Returns balance of the given account.', 'U256'), + call: generateDescription('Call contract, returning the output data.', 'Bytes', [reqParam, numberParam]), + chainId: generateDescription('Returns the chain ID used for transaction signing at the current best block. None is returned if not available.', 'U64'), + coinbase: generateDescription('Returns block author.', 'H160'), + estimateGas: generateDescription('Estimate gas needed for execution of given contract.', 'U256', [reqParam, numberParam]), + gasPrice: generateDescription('Returns current gas_price.', 'U256'), + getBalance: generateDescription('Returns balance of the given account.', 'U256', [addressParam, numberParam]), + getBlockByHash: generateDescription('Returns block with given hash.', 'RichBlock', [hashParam, { isOptional: true, name: 'full', type: 'bool' }]), + getBlockByNumber: generateDescription('Returns block with given number.', 'RichBlock', [blockParam, { isOptional: true, name: 'full', type: 'bool' }]), + getBlockTransactionCountByHash: generateDescription('Returns the number of transactions in a block with given hash.', 'U256', [hashParam]), + getBlockTransactionCountByNumber: generateDescription('Returns the number of transactions in a block with given block number.', 'U256', [blockParam]), + getCode: generateDescription('Returns the code at given address at given time (block number).', 'Bytes', [addressParam, numberParam]), + getLogs: generateDescription('Returns logs matching given filter object.', 'Vec', [{ name: 'filter', type: 'Filter' }]), + getStorageAt: generateDescription('Returns content of the storage at given address.', 'H256', [addressParam, indexParam, numberParam]), + getTransactionByBlockHashAndIndex: generateDescription('Returns transaction at given block hash and index.', 'Transaction', [hashParam, indexParam]), + getTransactionByBlockNumberAndIndex: generateDescription('Returns transaction by given block number and index.', 'Transaction', [numberParam, indexParam]), + getTransactionByHash: generateDescription('Get transaction by its hash.', 'Transaction', [hashParam]), + getTransactionCount: generateDescription('Returns the number of transactions sent from given address at given time (block number).', 'U256', [hashParam, numberParam]), + getTransactionReceipt: generateDescription('Returns transaction receipt by transaction hash.', 'Receipt', [hashParam]), + getUncleByBlockHashAndIndex: generateDescription('Returns an uncles at given block and index.', 'RichBlock', [hashParam, indexParam]), + getUncleByBlockNumberAndIndex: generateDescription('Returns an uncles at given block and index.', 'RichBlock', [numberParam, indexParam]), + getUncleCountByBlockHash: generateDescription('Returns the number of uncles in a block with given hash.', 'U256', [hashParam]), + getUncleCountByBlockNumber: generateDescription('Returns the number of uncles in a block with given block number.', 'U256', [numberParam]), + getWork: generateDescription('Returns the hash of the current block, the seedHash, and the boundary condition to be met.', 'Work'), + hashrate: generateDescription('Returns the number of hashes per second that the node is mining with.', 'U256'), + mining: generateDescription('Returns true if client is actively mining new blocks.', 'bool'), + protocolVersion: generateDescription('Returns protocol version encoded as a string (quotes are necessary).', 'u64'), + sendRawTransaction: generateDescription('Sends signed transaction, returning its hash.', 'BoxFuture', [{ name: 'bytes', type: 'Bytes' }]), + submitHashrate: generateDescription('Used for submitting mining hashrate.', 'bool', [indexParam, hashParam]), + submitWork: generateDescription('Used for submitting a proof-of-work solution.', 'bool', [{ name: '_', type: 'H64' }, { name: '_', type: 'H256' }, { name: '_', type: 'H256' }]), + subscribe: generateDescription('Subscribe to Eth subscription.', '', [{ name: '_metadata', type: 'Self::Metadata' }, { name: 'subscriber', type: 'Subscriber' }, { name: 'kind', type: 'Kind' }, { isOptional: true, name: 'params', type: 'Params' }]), + syncing: generateDescription('Returns an object with data about the sync status or false. (wtf?)', 'SyncStatus'), + unsubscribe: generateDescription('nsubscribe from existing Eth subscription.', '', [{ name: '_metadata', type: 'Self::Metadata' }, { name: 'subscription_id', type: 'Self::SubscriptionId' }]) + }, + net: { + listening: generateDescription('Returns true if client is actively listening for network connections. Otherwise false.', 'bool'), + peerCount: generateDescription('Returns number of peers connected to node.', 'String'), + version: generateDescription('Returns protocol version.', 'String') + } + }; +} From 0f8b5d27c6aeb083fa095f341dd801c2568870e7 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Tue, 10 Nov 2020 16:59:29 +0100 Subject: [PATCH 07/16] lint --- polkadot-js/alphanet-types.json | 6 +- polkadot-js/frontier-rpc-types.ts | 203 +++++++++++++++++++++++------- polkadot-js/standalone-types.json | 6 +- 3 files changed, 162 insertions(+), 53 deletions(-) diff --git a/polkadot-js/alphanet-types.json b/polkadot-js/alphanet-types.json index ddc98d1b13..6fea75a00e 100644 --- a/polkadot-js/alphanet-types.json +++ b/polkadot-js/alphanet-types.json @@ -8,7 +8,7 @@ "nonce": "U256", "balance": "u128" }, - "TransactionCondition":{ + "TransactionCondition": { "_enum": { "block": "u64", "time": "u64" @@ -51,7 +51,7 @@ "to": "Option", "contract_address": "Option", "logs": "Vec", - "logs_bloom": "Bloom", + "logs_bloom": "Bloom" }, "Receipt": { "transaction_hash": "Option", @@ -66,6 +66,6 @@ "logs": "Vec", "state_root": "Option", "logs_bloom": "H2048", - "status_code": "Option", + "status_code": "Option" } } diff --git a/polkadot-js/frontier-rpc-types.ts b/polkadot-js/frontier-rpc-types.ts index 4210d42c99..489f2ea3e2 100644 --- a/polkadot-js/frontier-rpc-types.ts +++ b/polkadot-js/frontier-rpc-types.ts @@ -1,65 +1,174 @@ // Copyright 2017-2020 @polkadot/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { DefinitionRpc, DefinitionRpcParam } from '@polkadot/types/types'; +import { DefinitionRpc, DefinitionRpcParam } from "@polkadot/types/types"; export default function (): Record> { - function generateDescription (description:string, returnType:string, params:DefinitionRpcParam[] = []):DefinitionRpc { + function generateDescription( + description: string, + returnType: string, + params: DefinitionRpcParam[] = [] + ): DefinitionRpc { return { description, params, - type: returnType + type: returnType, }; } - const numberParam: DefinitionRpcParam = { isOptional: true, name: 'number', type: 'BlockNumber' }; - const hashParam: DefinitionRpcParam = { name: 'hash', type: 'H256' }; - const reqParam: DefinitionRpcParam = { name: 'request', type: 'CallRequest' }; - const blockParam: DefinitionRpcParam = { name: 'block', type: 'BlockNumber' }; - const addressParam: DefinitionRpcParam = { name: 'address', type: 'H160' }; - const indexParam: DefinitionRpcParam = { name: 'index', type: 'U256' }; + const numberParam: DefinitionRpcParam = { isOptional: true, name: "number", type: "BlockNumber" }; + const hashParam: DefinitionRpcParam = { name: "hash", type: "H256" }; + const reqParam: DefinitionRpcParam = { name: "request", type: "CallRequest" }; + const blockParam: DefinitionRpcParam = { name: "block", type: "BlockNumber" }; + const addressParam: DefinitionRpcParam = { name: "address", type: "H160" }; + const indexParam: DefinitionRpcParam = { name: "index", type: "U256" }; return { eth: { - accounts: generateDescription('Returns accounts list.', 'Vec'), - blockNumber: generateDescription('Returns balance of the given account.', 'U256'), - call: generateDescription('Call contract, returning the output data.', 'Bytes', [reqParam, numberParam]), - chainId: generateDescription('Returns the chain ID used for transaction signing at the current best block. None is returned if not available.', 'U64'), - coinbase: generateDescription('Returns block author.', 'H160'), - estimateGas: generateDescription('Estimate gas needed for execution of given contract.', 'U256', [reqParam, numberParam]), - gasPrice: generateDescription('Returns current gas_price.', 'U256'), - getBalance: generateDescription('Returns balance of the given account.', 'U256', [addressParam, numberParam]), - getBlockByHash: generateDescription('Returns block with given hash.', 'RichBlock', [hashParam, { isOptional: true, name: 'full', type: 'bool' }]), - getBlockByNumber: generateDescription('Returns block with given number.', 'RichBlock', [blockParam, { isOptional: true, name: 'full', type: 'bool' }]), - getBlockTransactionCountByHash: generateDescription('Returns the number of transactions in a block with given hash.', 'U256', [hashParam]), - getBlockTransactionCountByNumber: generateDescription('Returns the number of transactions in a block with given block number.', 'U256', [blockParam]), - getCode: generateDescription('Returns the code at given address at given time (block number).', 'Bytes', [addressParam, numberParam]), - getLogs: generateDescription('Returns logs matching given filter object.', 'Vec', [{ name: 'filter', type: 'Filter' }]), - getStorageAt: generateDescription('Returns content of the storage at given address.', 'H256', [addressParam, indexParam, numberParam]), - getTransactionByBlockHashAndIndex: generateDescription('Returns transaction at given block hash and index.', 'Transaction', [hashParam, indexParam]), - getTransactionByBlockNumberAndIndex: generateDescription('Returns transaction by given block number and index.', 'Transaction', [numberParam, indexParam]), - getTransactionByHash: generateDescription('Get transaction by its hash.', 'Transaction', [hashParam]), - getTransactionCount: generateDescription('Returns the number of transactions sent from given address at given time (block number).', 'U256', [hashParam, numberParam]), - getTransactionReceipt: generateDescription('Returns transaction receipt by transaction hash.', 'Receipt', [hashParam]), - getUncleByBlockHashAndIndex: generateDescription('Returns an uncles at given block and index.', 'RichBlock', [hashParam, indexParam]), - getUncleByBlockNumberAndIndex: generateDescription('Returns an uncles at given block and index.', 'RichBlock', [numberParam, indexParam]), - getUncleCountByBlockHash: generateDescription('Returns the number of uncles in a block with given hash.', 'U256', [hashParam]), - getUncleCountByBlockNumber: generateDescription('Returns the number of uncles in a block with given block number.', 'U256', [numberParam]), - getWork: generateDescription('Returns the hash of the current block, the seedHash, and the boundary condition to be met.', 'Work'), - hashrate: generateDescription('Returns the number of hashes per second that the node is mining with.', 'U256'), - mining: generateDescription('Returns true if client is actively mining new blocks.', 'bool'), - protocolVersion: generateDescription('Returns protocol version encoded as a string (quotes are necessary).', 'u64'), - sendRawTransaction: generateDescription('Sends signed transaction, returning its hash.', 'BoxFuture', [{ name: 'bytes', type: 'Bytes' }]), - submitHashrate: generateDescription('Used for submitting mining hashrate.', 'bool', [indexParam, hashParam]), - submitWork: generateDescription('Used for submitting a proof-of-work solution.', 'bool', [{ name: '_', type: 'H64' }, { name: '_', type: 'H256' }, { name: '_', type: 'H256' }]), - subscribe: generateDescription('Subscribe to Eth subscription.', '', [{ name: '_metadata', type: 'Self::Metadata' }, { name: 'subscriber', type: 'Subscriber' }, { name: 'kind', type: 'Kind' }, { isOptional: true, name: 'params', type: 'Params' }]), - syncing: generateDescription('Returns an object with data about the sync status or false. (wtf?)', 'SyncStatus'), - unsubscribe: generateDescription('nsubscribe from existing Eth subscription.', '', [{ name: '_metadata', type: 'Self::Metadata' }, { name: 'subscription_id', type: 'Self::SubscriptionId' }]) + accounts: generateDescription("Returns accounts list.", "Vec"), + blockNumber: generateDescription("Returns balance of the given account.", "U256"), + call: generateDescription("Call contract, returning the output data.", "Bytes", [ + reqParam, + numberParam, + ]), + chainId: generateDescription( + "Returns the chain ID used for transaction signing at the current best block. None is returned if not available.", + "U64" + ), + coinbase: generateDescription("Returns block author.", "H160"), + estimateGas: generateDescription( + "Estimate gas needed for execution of given contract.", + "U256", + [reqParam, numberParam] + ), + gasPrice: generateDescription("Returns current gas_price.", "U256"), + getBalance: generateDescription("Returns balance of the given account.", "U256", [ + addressParam, + numberParam, + ]), + getBlockByHash: generateDescription("Returns block with given hash.", "RichBlock", [ + hashParam, + { isOptional: true, name: "full", type: "bool" }, + ]), + getBlockByNumber: generateDescription("Returns block with given number.", "RichBlock", [ + blockParam, + { isOptional: true, name: "full", type: "bool" }, + ]), + getBlockTransactionCountByHash: generateDescription( + "Returns the number of transactions in a block with given hash.", + "U256", + [hashParam] + ), + getBlockTransactionCountByNumber: generateDescription( + "Returns the number of transactions in a block with given block number.", + "U256", + [blockParam] + ), + getCode: generateDescription( + "Returns the code at given address at given time (block number).", + "Bytes", + [addressParam, numberParam] + ), + getLogs: generateDescription("Returns logs matching given filter object.", "Vec", [ + { name: "filter", type: "Filter" }, + ]), + getStorageAt: generateDescription( + "Returns content of the storage at given address.", + "H256", + [addressParam, indexParam, numberParam] + ), + getTransactionByBlockHashAndIndex: generateDescription( + "Returns transaction at given block hash and index.", + "Transaction", + [hashParam, indexParam] + ), + getTransactionByBlockNumberAndIndex: generateDescription( + "Returns transaction by given block number and index.", + "Transaction", + [numberParam, indexParam] + ), + getTransactionByHash: generateDescription("Get transaction by its hash.", "Transaction", [ + hashParam, + ]), + getTransactionCount: generateDescription( + "Returns the number of transactions sent from given address at given time (block number).", + "U256", + [hashParam, numberParam] + ), + getTransactionReceipt: generateDescription( + "Returns transaction receipt by transaction hash.", + "Receipt", + [hashParam] + ), + getUncleByBlockHashAndIndex: generateDescription( + "Returns an uncles at given block and index.", + "RichBlock", + [hashParam, indexParam] + ), + getUncleByBlockNumberAndIndex: generateDescription( + "Returns an uncles at given block and index.", + "RichBlock", + [numberParam, indexParam] + ), + getUncleCountByBlockHash: generateDescription( + "Returns the number of uncles in a block with given hash.", + "U256", + [hashParam] + ), + getUncleCountByBlockNumber: generateDescription( + "Returns the number of uncles in a block with given block number.", + "U256", + [numberParam] + ), + getWork: generateDescription( + "Returns the hash of the current block, the seedHash, and the boundary condition to be met.", + "Work" + ), + hashrate: generateDescription( + "Returns the number of hashes per second that the node is mining with.", + "U256" + ), + mining: generateDescription("Returns true if client is actively mining new blocks.", "bool"), + protocolVersion: generateDescription( + "Returns protocol version encoded as a string (quotes are necessary).", + "u64" + ), + sendRawTransaction: generateDescription( + "Sends signed transaction, returning its hash.", + "BoxFuture", + [{ name: "bytes", type: "Bytes" }] + ), + submitHashrate: generateDescription("Used for submitting mining hashrate.", "bool", [ + indexParam, + hashParam, + ]), + submitWork: generateDescription("Used for submitting a proof-of-work solution.", "bool", [ + { name: "_", type: "H64" }, + { name: "_", type: "H256" }, + { name: "_", type: "H256" }, + ]), + subscribe: generateDescription("Subscribe to Eth subscription.", "", [ + { name: "_metadata", type: "Self::Metadata" }, + { name: "subscriber", type: "Subscriber" }, + { name: "kind", type: "Kind" }, + { isOptional: true, name: "params", type: "Params" }, + ]), + syncing: generateDescription( + "Returns an object with data about the sync status or false. (wtf?)", + "SyncStatus" + ), + unsubscribe: generateDescription("nsubscribe from existing Eth subscription.", "", [ + { name: "_metadata", type: "Self::Metadata" }, + { name: "subscription_id", type: "Self::SubscriptionId" }, + ]), }, net: { - listening: generateDescription('Returns true if client is actively listening for network connections. Otherwise false.', 'bool'), - peerCount: generateDescription('Returns number of peers connected to node.', 'String'), - version: generateDescription('Returns protocol version.', 'String') - } + listening: generateDescription( + "Returns true if client is actively listening for network connections. Otherwise false.", + "bool" + ), + peerCount: generateDescription("Returns number of peers connected to node.", "String"), + version: generateDescription("Returns protocol version.", "String"), + }, }; } diff --git a/polkadot-js/standalone-types.json b/polkadot-js/standalone-types.json index ddc98d1b13..6fea75a00e 100644 --- a/polkadot-js/standalone-types.json +++ b/polkadot-js/standalone-types.json @@ -8,7 +8,7 @@ "nonce": "U256", "balance": "u128" }, - "TransactionCondition":{ + "TransactionCondition": { "_enum": { "block": "u64", "time": "u64" @@ -51,7 +51,7 @@ "to": "Option", "contract_address": "Option", "logs": "Vec", - "logs_bloom": "Bloom", + "logs_bloom": "Bloom" }, "Receipt": { "transaction_hash": "Option", @@ -66,6 +66,6 @@ "logs": "Vec", "state_root": "Option", "logs_bloom": "H2048", - "status_code": "Option", + "status_code": "Option" } } From d045272194261581fe2c1122ef3a4a87b8d03d63 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Tue, 10 Nov 2020 17:50:18 +0100 Subject: [PATCH 08/16] skip lines --- polkadot-js/frontier-rpc-types.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/polkadot-js/frontier-rpc-types.ts b/polkadot-js/frontier-rpc-types.ts index 489f2ea3e2..a337fd6d90 100644 --- a/polkadot-js/frontier-rpc-types.ts +++ b/polkadot-js/frontier-rpc-types.ts @@ -32,7 +32,8 @@ export default function (): Record> { numberParam, ]), chainId: generateDescription( - "Returns the chain ID used for transaction signing at the current best block. None is returned if not available.", + "Returns the chain ID used for transaction signing at " + + "the current best block. None is returned if not available.", "U64" ), coinbase: generateDescription("Returns block author.", "H160"), @@ -121,7 +122,8 @@ export default function (): Record> { [numberParam] ), getWork: generateDescription( - "Returns the hash of the current block, the seedHash, and the boundary condition to be met.", + "Returns the hash of the current block, the seedHash," + + " and the boundary condition to be met.", "Work" ), hashrate: generateDescription( From 098d3dff5909151612ca184da16f3159cad883f5 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Fri, 13 Nov 2020 17:23:40 +0100 Subject: [PATCH 09/16] update types --- polkadot-js/alphanet-types.json | 16 ++++++++-------- polkadot-js/standalone-types.json | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/polkadot-js/alphanet-types.json b/polkadot-js/alphanet-types.json index 6fea75a00e..76382f896d 100644 --- a/polkadot-js/alphanet-types.json +++ b/polkadot-js/alphanet-types.json @@ -15,7 +15,6 @@ } }, "Transaction": { - "action": "String", "block_hash": "Option", "block_number": "Option", "chain_id": "Option", @@ -24,7 +23,6 @@ "from": "H160", "gas": "U256", "gas_price": "U256", - "gas_limit": "u64", "hash": "H256", "input": "Bytes", "nonce": "U256", @@ -32,18 +30,12 @@ "r": "U256", "raw": "Bytes", "s": "U256", - "signature": "Signature", "standard_v": "U256", "to": "Option", "transaction_index": "Option", "v": "U256", "value": "U256" }, - "Signature": { - "v": "u64", - "r": "H256", - "s": "H256" - }, "TransactionStatus": { "transaction_hash": "H256", "transaction_index": "u32", @@ -67,5 +59,13 @@ "state_root": "Option", "logs_bloom": "H2048", "status_code": "Option" + }, + "ExitReason": { + "_enum": { + "ExitSucceed": "bool", + "ExitError": "bool", + "ExitRevert": "bool", + "ExitFatal": "bool" + } } } diff --git a/polkadot-js/standalone-types.json b/polkadot-js/standalone-types.json index 6fea75a00e..76382f896d 100644 --- a/polkadot-js/standalone-types.json +++ b/polkadot-js/standalone-types.json @@ -15,7 +15,6 @@ } }, "Transaction": { - "action": "String", "block_hash": "Option", "block_number": "Option", "chain_id": "Option", @@ -24,7 +23,6 @@ "from": "H160", "gas": "U256", "gas_price": "U256", - "gas_limit": "u64", "hash": "H256", "input": "Bytes", "nonce": "U256", @@ -32,18 +30,12 @@ "r": "U256", "raw": "Bytes", "s": "U256", - "signature": "Signature", "standard_v": "U256", "to": "Option", "transaction_index": "Option", "v": "U256", "value": "U256" }, - "Signature": { - "v": "u64", - "r": "H256", - "s": "H256" - }, "TransactionStatus": { "transaction_hash": "H256", "transaction_index": "u32", @@ -67,5 +59,13 @@ "state_root": "Option", "logs_bloom": "H2048", "status_code": "Option" + }, + "ExitReason": { + "_enum": { + "ExitSucceed": "bool", + "ExitError": "bool", + "ExitRevert": "bool", + "ExitFatal": "bool" + } } } From 4d6435100abe06abb5458df8a1bdf22cb5dd42a9 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Mon, 16 Nov 2020 16:23:23 +0100 Subject: [PATCH 10/16] updated exitReason type --- polkadot-js/alphanet-types.json | 40 +++++++++++++++++++++++++++---- polkadot-js/standalone-types.json | 40 +++++++++++++++++++++++++++---- 2 files changed, 72 insertions(+), 8 deletions(-) diff --git a/polkadot-js/alphanet-types.json b/polkadot-js/alphanet-types.json index 76382f896d..ea2be4832f 100644 --- a/polkadot-js/alphanet-types.json +++ b/polkadot-js/alphanet-types.json @@ -62,10 +62,42 @@ }, "ExitReason": { "_enum": { - "ExitSucceed": "bool", - "ExitError": "bool", - "ExitRevert": "bool", - "ExitFatal": "bool" + "Succeed": "ExitSucceed", + "Error": "ExitError", + "Revert": "ExitRevert", + "verFatal": "ExitFatal" } + }, + "ExitSucceed": { + "_enum": ["Stopped", "Returned", "Suicided"] + }, + "ExitError": { + "_enum": [ + "StackUnderflow", + "StackOverflow", + "InvalidJump", + "InvalidRange", + "DesignatedInvalid", + "CallTooDeep", + "CreateCollision", + "CreateContractLimit", + "OutOfOffset", + "OutOfGas", + "OutOfFund", + "PCUnderflow", + "CreateEmpty", + "Other(Cow<'static, str>)" + ] + }, + "ExitRevert": { + "_enum": ["Reverted"] + }, + "ExitFatal": { + "_enum": [ + "NotSupported", + "UnhandledInterrupt", + "CallErrorAsFatal(ExitError)", + "Other(Cow<'static, str>)" + ] } } diff --git a/polkadot-js/standalone-types.json b/polkadot-js/standalone-types.json index 76382f896d..ea2be4832f 100644 --- a/polkadot-js/standalone-types.json +++ b/polkadot-js/standalone-types.json @@ -62,10 +62,42 @@ }, "ExitReason": { "_enum": { - "ExitSucceed": "bool", - "ExitError": "bool", - "ExitRevert": "bool", - "ExitFatal": "bool" + "Succeed": "ExitSucceed", + "Error": "ExitError", + "Revert": "ExitRevert", + "verFatal": "ExitFatal" } + }, + "ExitSucceed": { + "_enum": ["Stopped", "Returned", "Suicided"] + }, + "ExitError": { + "_enum": [ + "StackUnderflow", + "StackOverflow", + "InvalidJump", + "InvalidRange", + "DesignatedInvalid", + "CallTooDeep", + "CreateCollision", + "CreateContractLimit", + "OutOfOffset", + "OutOfGas", + "OutOfFund", + "PCUnderflow", + "CreateEmpty", + "Other(Cow<'static, str>)" + ] + }, + "ExitRevert": { + "_enum": ["Reverted"] + }, + "ExitFatal": { + "_enum": [ + "NotSupported", + "UnhandledInterrupt", + "CallErrorAsFatal(ExitError)", + "Other(Cow<'static, str>)" + ] } } From 6f090475c8fb5d7ea12654ee50a4f84f1289ffb4 Mon Sep 17 00:00:00 2001 From: Antoine Estienne Date: Mon, 16 Nov 2020 17:20:00 +0100 Subject: [PATCH 11/16] Update alphanet-types.json typo --- polkadot-js/alphanet-types.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polkadot-js/alphanet-types.json b/polkadot-js/alphanet-types.json index ea2be4832f..2e8c75d325 100644 --- a/polkadot-js/alphanet-types.json +++ b/polkadot-js/alphanet-types.json @@ -65,7 +65,7 @@ "Succeed": "ExitSucceed", "Error": "ExitError", "Revert": "ExitRevert", - "verFatal": "ExitFatal" + "Fatal": "ExitFatal" } }, "ExitSucceed": { From 59a5bce0fc4aeb14f0ac510df89de8e6a0bd6d5a Mon Sep 17 00:00:00 2001 From: Antoine Estienne Date: Mon, 16 Nov 2020 18:46:08 +0100 Subject: [PATCH 12/16] Delete package-lock.json --- package-lock.json | 573 ---------------------------------------------- 1 file changed, 573 deletions(-) delete mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 91144a1c09..0000000000 --- a/package-lock.json +++ /dev/null @@ -1,573 +0,0 @@ -{ - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@babel/runtime": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", - "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "@polkadot/metadata": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-2.6.1.tgz", - "integrity": "sha512-pgKjWc0pF/2CKb06vjLdXjWzX7vgLwI6vXgJ/k4bSLHPJIryYKDp0fp0W+B11dkSzwbjL99sJoiGue6UXfeMeg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.12.1", - "@polkadot/types": "2.6.1", - "@polkadot/types-known": "2.6.1", - "@polkadot/util": "^4.0.1", - "@polkadot/util-crypto": "^4.0.1", - "bn.js": "^5.1.3" - } - }, - "@polkadot/networks": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-4.0.1.tgz", - "integrity": "sha512-GzEcVo+lWEdKZ6bK5R33zTGBMLQtf/9GwAf27Acxa23xk6aI5fpSHXcUm5ilUyD9vmNoRH3WnhfgVrTJ7uWe+Q==", - "dev": true, - "requires": { - "@babel/runtime": "^7.12.1" - } - }, - "@polkadot/types": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-2.6.1.tgz", - "integrity": "sha512-pb3VVOsEKaD7M3tFta9UtDL5zM+2/rsmstwBatA71b53Glr5XPxYtT8LI7dqjHZVLjHxKsYRKtTUhuNB7onQ8w==", - "dev": true, - "requires": { - "@babel/runtime": "^7.12.1", - "@polkadot/metadata": "2.6.1", - "@polkadot/util": "^4.0.1", - "@polkadot/util-crypto": "^4.0.1", - "@types/bn.js": "^4.11.6", - "bn.js": "^5.1.3", - "memoizee": "^0.4.14", - "rxjs": "^6.6.3" - } - }, - "@polkadot/types-known": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-2.6.1.tgz", - "integrity": "sha512-ZyWFzvuMS1umuhDYExqr9r0/69ME6QkIOgxfhXh9Ag4rkIlH+J0i+YO2H6F11zT+gqGPvqL8Vn2w8XlNjGNwcQ==", - "dev": true, - "requires": { - "@babel/runtime": "^7.12.1", - "@polkadot/types": "2.6.1", - "@polkadot/util": "^4.0.1", - "bn.js": "^5.1.3" - } - }, - "@polkadot/util": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-4.0.1.tgz", - "integrity": "sha512-t8INPSJZI0eWhobpaR+Ul2h8dKtaw+P8UiAL1Q5WeSD0iaVA2IbJvYacdztvkN1AZEcNgbFSMSDKZmzIKBxHpg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.12.1", - "@polkadot/x-textdecoder": "4.0.1", - "@polkadot/x-textencoder": "4.0.1", - "@types/bn.js": "^4.11.6", - "bn.js": "^5.1.3", - "camelcase": "^5.3.1", - "ip-regex": "^4.2.0" - } - }, - "@polkadot/util-crypto": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-4.0.1.tgz", - "integrity": "sha512-D5gzmvtsZPVZejkngQB4DpKF3WyFxhWtT8DpwkgIxIvOkbS0FvVXCISqSfauh8ZnfrAp4677Ha4YZ3sCKemS5g==", - "dev": true, - "requires": { - "@babel/runtime": "^7.12.1", - "@polkadot/networks": "4.0.1", - "@polkadot/util": "4.0.1", - "@polkadot/wasm-crypto": "^2.0.1", - "@polkadot/x-randomvalues": "4.0.1", - "base-x": "^3.0.8", - "blakejs": "^1.1.0", - "bn.js": "^5.1.3", - "create-hash": "^1.2.0", - "elliptic": "^6.5.3", - "js-sha3": "^0.8.0", - "pbkdf2": "^3.1.1", - "scryptsy": "^2.1.0", - "tweetnacl": "^1.0.3", - "xxhashjs": "^0.2.2" - } - }, - "@polkadot/wasm-crypto": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-2.0.1.tgz", - "integrity": "sha512-Vb0q4NToCRHXYJwhLWc4NTy77+n1dtJmkiE1tt8j1pmY4IJ4UL25yBxaS8NCS1LGqofdUYK1wwgrHiq5A78PFA==", - "dev": true - }, - "@polkadot/x-randomvalues": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-4.0.1.tgz", - "integrity": "sha512-Oe1LaoE2pQZGQweqRjF8TVXx+6K1Zxe1+IjvCUbwnDOSthn3Q+Tywf9S3Wn+yME6ul08J14GlGtyoHJMLgmqFQ==", - "dev": true, - "requires": { - "@babel/runtime": "^7.12.1" - } - }, - "@polkadot/x-textdecoder": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-4.0.1.tgz", - "integrity": "sha512-kRn9PY8Ffm8+g55UPbgEwGhVTDA9dFP3hmo9RD1DFXZkB0PyETDB37dr8YVC4C1LXAIBINBhrgjCMlSbJoUwuw==", - "dev": true, - "requires": { - "@babel/runtime": "^7.12.1" - } - }, - "@polkadot/x-textencoder": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-4.0.1.tgz", - "integrity": "sha512-2C1TpImfWDy6R7Bymq2luPo50VZioQE7ruM3pgKAr2ogZIu8KnlilI5V84qWkzVsqU3G3Dk0yqXUXPZqDdDA2g==", - "dev": true, - "requires": { - "@babel/runtime": "^7.12.1" - } - }, - "@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "14.14.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz", - "integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==", - "dev": true - }, - "base-x": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", - "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "blakejs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", - "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", - "dev": true - }, - "bn.js": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", - "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", - "dev": true - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cuint": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/cuint/-/cuint-0.2.2.tgz", - "integrity": "sha1-QICG1AlVDCYxFVYZ6fp7ytw7mRs=", - "dev": true - }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dev": true, - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" - }, - "dependencies": { - "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", - "dev": true - } - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dev": true, - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", - "dev": true, - "requires": { - "type": "^2.0.0" - }, - "dependencies": { - "type": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", - "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", - "dev": true - } - } - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "ip-regex": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz", - "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A==", - "dev": true - }, - "is-promise": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", - "dev": true - }, - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "dev": true - }, - "lru-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", - "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", - "dev": true, - "requires": { - "es5-ext": "~0.10.2" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "memoizee": { - "version": "0.4.14", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", - "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.45", - "es6-weak-map": "^2.0.2", - "event-emitter": "^0.3.5", - "is-promise": "^2.1", - "lru-queue": "0.1", - "next-tick": "1", - "timers-ext": "^0.1.5" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", - "dev": true - }, - "pbkdf2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "regenerator-runtime": { - "version": "0.13.7", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", - "dev": true - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rxjs": { - "version": "6.6.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", - "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "scryptsy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", - "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "timers-ext": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", - "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", - "dev": true, - "requires": { - "es5-ext": "~0.10.46", - "next-tick": "1" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", - "dev": true - }, - "type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "xxhashjs": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz", - "integrity": "sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw==", - "dev": true, - "requires": { - "cuint": "^0.2.2" - } - } - } -} From 5062ce07f5f6943e613d4ed7c706d44e04236406 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Mon, 16 Nov 2020 19:07:22 +0100 Subject: [PATCH 13/16] generated json file for function descriptions --- .../{ => jsonFiles}/alphanet-types.json | 0 polkadot-js/jsonFiles/frontier-rpc-types.json | 227 ++++++++++++++++++ .../{ => jsonFiles}/standalone-types.json | 0 .../{ => scripts}/frontier-rpc-types.ts | 32 ++- 4 files changed, 257 insertions(+), 2 deletions(-) rename polkadot-js/{ => jsonFiles}/alphanet-types.json (100%) create mode 100644 polkadot-js/jsonFiles/frontier-rpc-types.json rename polkadot-js/{ => jsonFiles}/standalone-types.json (100%) rename polkadot-js/{ => scripts}/frontier-rpc-types.ts (86%) diff --git a/polkadot-js/alphanet-types.json b/polkadot-js/jsonFiles/alphanet-types.json similarity index 100% rename from polkadot-js/alphanet-types.json rename to polkadot-js/jsonFiles/alphanet-types.json diff --git a/polkadot-js/jsonFiles/frontier-rpc-types.json b/polkadot-js/jsonFiles/frontier-rpc-types.json new file mode 100644 index 0000000000..eb6be8979a --- /dev/null +++ b/polkadot-js/jsonFiles/frontier-rpc-types.json @@ -0,0 +1,227 @@ +{ + "eth": { + "accounts": { "description": "Returns accounts list.", "params": [], "type": "Vec" }, + "blockNumber": { + "description": "Returns balance of the given account.", + "params": [], + "type": "U256" + }, + "call": { + "description": "Call contract, returning the output data.", + "params": [ + { "name": "request", "type": "CallRequest" }, + { "isOptional": true, "name": "number", "type": "BlockNumber" } + ], + "type": "Bytes" + }, + "chainId": { + "description": "Returns the chain ID used for transaction signing at the current best block. None is returned if not available.", + "params": [], + "type": "U64" + }, + "coinbase": { "description": "Returns block author.", "params": [], "type": "H160" }, + "estimateGas": { + "description": "Estimate gas needed for execution of given contract.", + "params": [ + { "name": "request", "type": "CallRequest" }, + { "isOptional": true, "name": "number", "type": "BlockNumber" } + ], + "type": "U256" + }, + "gasPrice": { "description": "Returns current gas_price.", "params": [], "type": "U256" }, + "getBalance": { + "description": "Returns balance of the given account.", + "params": [ + { "name": "address", "type": "H160" }, + { "isOptional": true, "name": "number", "type": "BlockNumber" } + ], + "type": "U256" + }, + "getBlockByHash": { + "description": "Returns block with given hash.", + "params": [ + { "name": "hash", "type": "H256" }, + { "isOptional": true, "name": "full", "type": "bool" } + ], + "type": "RichBlock" + }, + "getBlockByNumber": { + "description": "Returns block with given number.", + "params": [ + { "name": "block", "type": "BlockNumber" }, + { "isOptional": true, "name": "full", "type": "bool" } + ], + "type": "RichBlock" + }, + "getBlockTransactionCountByHash": { + "description": "Returns the number of transactions in a block with given hash.", + "params": [{ "name": "hash", "type": "H256" }], + "type": "U256" + }, + "getBlockTransactionCountByNumber": { + "description": "Returns the number of transactions in a block with given block number.", + "params": [{ "name": "block", "type": "BlockNumber" }], + "type": "U256" + }, + "getCode": { + "description": "Returns the code at given address at given time (block number).", + "params": [ + { "name": "address", "type": "H160" }, + { "isOptional": true, "name": "number", "type": "BlockNumber" } + ], + "type": "Bytes" + }, + "getLogs": { + "description": "Returns logs matching given filter object.", + "params": [{ "name": "filter", "type": "Filter" }], + "type": "Vec" + }, + "getStorageAt": { + "description": "Returns content of the storage at given address.", + "params": [ + { "name": "address", "type": "H160" }, + { "name": "index", "type": "U256" }, + { "isOptional": true, "name": "number", "type": "BlockNumber" } + ], + "type": "H256" + }, + "getTransactionByBlockHashAndIndex": { + "description": "Returns transaction at given block hash and index.", + "params": [ + { "name": "hash", "type": "H256" }, + { "name": "index", "type": "U256" } + ], + "type": "Transaction" + }, + "getTransactionByBlockNumberAndIndex": { + "description": "Returns transaction by given block number and index.", + "params": [ + { "isOptional": true, "name": "number", "type": "BlockNumber" }, + { "name": "index", "type": "U256" } + ], + "type": "Transaction" + }, + "getTransactionByHash": { + "description": "Get transaction by its hash.", + "params": [{ "name": "hash", "type": "H256" }], + "type": "Transaction" + }, + "getTransactionCount": { + "description": "Returns the number of transactions sent from given address at given time (block number).", + "params": [ + { "name": "hash", "type": "H256" }, + { "isOptional": true, "name": "number", "type": "BlockNumber" } + ], + "type": "U256" + }, + "getTransactionReceipt": { + "description": "Returns transaction receipt by transaction hash.", + "params": [{ "name": "hash", "type": "H256" }], + "type": "Receipt" + }, + "getUncleByBlockHashAndIndex": { + "description": "Returns an uncles at given block and index.", + "params": [ + { "name": "hash", "type": "H256" }, + { "name": "index", "type": "U256" } + ], + "type": "RichBlock" + }, + "getUncleByBlockNumberAndIndex": { + "description": "Returns an uncles at given block and index.", + "params": [ + { "isOptional": true, "name": "number", "type": "BlockNumber" }, + { "name": "index", "type": "U256" } + ], + "type": "RichBlock" + }, + "getUncleCountByBlockHash": { + "description": "Returns the number of uncles in a block with given hash.", + "params": [{ "name": "hash", "type": "H256" }], + "type": "U256" + }, + "getUncleCountByBlockNumber": { + "description": "Returns the number of uncles in a block with given block number.", + "params": [{ "isOptional": true, "name": "number", "type": "BlockNumber" }], + "type": "U256" + }, + "getWork": { + "description": "Returns the hash of the current block, the seedHash, and the boundary condition to be met.", + "params": [], + "type": "Work" + }, + "hashrate": { + "description": "Returns the number of hashes per second that the node is mining with.", + "params": [], + "type": "U256" + }, + "mining": { + "description": "Returns true if client is actively mining new blocks.", + "params": [], + "type": "bool" + }, + "protocolVersion": { + "description": "Returns protocol version encoded as a string (quotes are necessary).", + "params": [], + "type": "u64" + }, + "sendRawTransaction": { + "description": "Sends signed transaction, returning its hash.", + "params": [{ "name": "bytes", "type": "Bytes" }], + "type": "BoxFuture" + }, + "submitHashrate": { + "description": "Used for submitting mining hashrate.", + "params": [ + { "name": "index", "type": "U256" }, + { "name": "hash", "type": "H256" } + ], + "type": "bool" + }, + "submitWork": { + "description": "Used for submitting a proof-of-work solution.", + "params": [ + { "name": "_", "type": "H64" }, + { "name": "_", "type": "H256" }, + { "name": "_", "type": "H256" } + ], + "type": "bool" + }, + "subscribe": { + "description": "Subscribe to Eth subscription.", + "params": [ + { "name": "_metadata", "type": "Self::Metadata" }, + { "name": "subscriber", "type": "Subscriber" }, + { "name": "kind", "type": "Kind" }, + { "isOptional": true, "name": "params", "type": "Params" } + ], + "type": "" + }, + "syncing": { + "description": "Returns an object with data about the sync status or false. (wtf?)", + "params": [], + "type": "SyncStatus" + }, + "unsubscribe": { + "description": "nsubscribe from existing Eth subscription.", + "params": [ + { "name": "_metadata", "type": "Self::Metadata" }, + { "name": "subscription_id", "type": "Self::SubscriptionId" } + ], + "type": "" + } + }, + "net": { + "listening": { + "description": "Returns true if client is actively listening for network connections. Otherwise false.", + "params": [], + "type": "bool" + }, + "peerCount": { + "description": "Returns number of peers connected to node.", + "params": [], + "type": "String" + }, + "version": { "description": "Returns protocol version.", "params": [], "type": "String" } + } +} diff --git a/polkadot-js/standalone-types.json b/polkadot-js/jsonFiles/standalone-types.json similarity index 100% rename from polkadot-js/standalone-types.json rename to polkadot-js/jsonFiles/standalone-types.json diff --git a/polkadot-js/frontier-rpc-types.ts b/polkadot-js/scripts/frontier-rpc-types.ts similarity index 86% rename from polkadot-js/frontier-rpc-types.ts rename to polkadot-js/scripts/frontier-rpc-types.ts index a337fd6d90..a0f2203aa2 100644 --- a/polkadot-js/frontier-rpc-types.ts +++ b/polkadot-js/scripts/frontier-rpc-types.ts @@ -1,9 +1,36 @@ // Copyright 2017-2020 @polkadot/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { DefinitionRpc, DefinitionRpcParam } from "@polkadot/types/types"; +//import { DefinitionRpc, DefinitionRpcParam } from "@polkadot/types/types"; +export declare type DefinitionTypeType = string; +export declare type DefinitionTypeEnum = { + _enum: DefinitionTypeType[]; +} | { + _enum: Record; +}; +export declare type DefinitionTypeSet = { + _set: Record; +}; +export declare type DefinitionTypeStruct = Record | { + _alias?: Record; +} & Record; +export declare type DefinitionType = string | DefinitionTypeEnum | DefinitionTypeSet | DefinitionTypeStruct; +interface DefinitionRpcParam { + isCached?: boolean; + isHistoric?: boolean; + isOptional?: boolean; + name: string; + type: DefinitionTypeType; +} +interface DefinitionRpc { + alias?: string[]; + description: string; + endpoint?: string; + params: DefinitionRpcParam[]; + type: DefinitionTypeType; +} -export default function (): Record> { +export default function rpcTypes (): Record> { function generateDescription( description: string, returnType: string, @@ -174,3 +201,4 @@ export default function (): Record> { }, }; } +console.log( JSON.stringify(rpcTypes())) From a371363315350c185d779732f7628b49b753fd24 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Tue, 17 Nov 2020 10:39:40 +0100 Subject: [PATCH 14/16] reorganized --- .../{jsonFiles => }/alphanet-types.json | 0 .../{jsonFiles => }/frontier-rpc-types.json | 0 .../{jsonFiles => }/standalone-types.json | 0 .../generate-rpc-types.ts | 50 +++++++++++-------- 4 files changed, 29 insertions(+), 21 deletions(-) rename polkadot-js/{jsonFiles => }/alphanet-types.json (100%) rename polkadot-js/{jsonFiles => }/frontier-rpc-types.json (100%) rename polkadot-js/{jsonFiles => }/standalone-types.json (100%) rename polkadot-js/scripts/frontier-rpc-types.ts => tools/generate-rpc-types.ts (89%) diff --git a/polkadot-js/jsonFiles/alphanet-types.json b/polkadot-js/alphanet-types.json similarity index 100% rename from polkadot-js/jsonFiles/alphanet-types.json rename to polkadot-js/alphanet-types.json diff --git a/polkadot-js/jsonFiles/frontier-rpc-types.json b/polkadot-js/frontier-rpc-types.json similarity index 100% rename from polkadot-js/jsonFiles/frontier-rpc-types.json rename to polkadot-js/frontier-rpc-types.json diff --git a/polkadot-js/jsonFiles/standalone-types.json b/polkadot-js/standalone-types.json similarity index 100% rename from polkadot-js/jsonFiles/standalone-types.json rename to polkadot-js/standalone-types.json diff --git a/polkadot-js/scripts/frontier-rpc-types.ts b/tools/generate-rpc-types.ts similarity index 89% rename from polkadot-js/scripts/frontier-rpc-types.ts rename to tools/generate-rpc-types.ts index a0f2203aa2..7677f824bf 100644 --- a/polkadot-js/scripts/frontier-rpc-types.ts +++ b/tools/generate-rpc-types.ts @@ -3,34 +3,42 @@ //import { DefinitionRpc, DefinitionRpcParam } from "@polkadot/types/types"; export declare type DefinitionTypeType = string; -export declare type DefinitionTypeEnum = { - _enum: DefinitionTypeType[]; -} | { - _enum: Record; -}; +export declare type DefinitionTypeEnum = + | { + _enum: DefinitionTypeType[]; + } + | { + _enum: Record; + }; export declare type DefinitionTypeSet = { _set: Record; }; -export declare type DefinitionTypeStruct = Record | { - _alias?: Record; -} & Record; -export declare type DefinitionType = string | DefinitionTypeEnum | DefinitionTypeSet | DefinitionTypeStruct; +export declare type DefinitionTypeStruct = + | Record + | ({ + _alias?: Record; + } & Record); +export declare type DefinitionType = + | string + | DefinitionTypeEnum + | DefinitionTypeSet + | DefinitionTypeStruct; interface DefinitionRpcParam { - isCached?: boolean; - isHistoric?: boolean; - isOptional?: boolean; - name: string; - type: DefinitionTypeType; + isCached?: boolean; + isHistoric?: boolean; + isOptional?: boolean; + name: string; + type: DefinitionTypeType; } interface DefinitionRpc { - alias?: string[]; - description: string; - endpoint?: string; - params: DefinitionRpcParam[]; - type: DefinitionTypeType; + alias?: string[]; + description: string; + endpoint?: string; + params: DefinitionRpcParam[]; + type: DefinitionTypeType; } -export default function rpcTypes (): Record> { +export default function rpcTypes(): Record> { function generateDescription( description: string, returnType: string, @@ -201,4 +209,4 @@ export default function rpcTypes (): Record Date: Tue, 17 Nov 2020 12:25:49 +0100 Subject: [PATCH 15/16] edit editorconfig to allow long lines in json --- .editorconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 8eba899188..b242724b7c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -29,7 +29,6 @@ max_line_length=100 [*.json] indent_style=space indent_size=2 -max_line_length=100 [*.md] trim_trailing_whitespace=false From 6d51efb50a205719dd3f2d91dbc7cd4860c83c66 Mon Sep 17 00:00:00 2001 From: joelamouche Date: Tue, 17 Nov 2020 15:36:49 +0100 Subject: [PATCH 16/16] prettier json --- polkadot-js/frontier-rpc-types.json | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/polkadot-js/frontier-rpc-types.json b/polkadot-js/frontier-rpc-types.json index eb6be8979a..5d03efe31f 100644 --- a/polkadot-js/frontier-rpc-types.json +++ b/polkadot-js/frontier-rpc-types.json @@ -1,6 +1,10 @@ { "eth": { - "accounts": { "description": "Returns accounts list.", "params": [], "type": "Vec" }, + "accounts": { + "description": "Returns accounts list.", + "params": [], + "type": "Vec" + }, "blockNumber": { "description": "Returns balance of the given account.", "params": [], @@ -19,7 +23,11 @@ "params": [], "type": "U64" }, - "coinbase": { "description": "Returns block author.", "params": [], "type": "H160" }, + "coinbase": { + "description": "Returns block author.", + "params": [], + "type": "H160" + }, "estimateGas": { "description": "Estimate gas needed for execution of given contract.", "params": [ @@ -28,7 +36,11 @@ ], "type": "U256" }, - "gasPrice": { "description": "Returns current gas_price.", "params": [], "type": "U256" }, + "gasPrice": { + "description": "Returns current gas_price.", + "params": [], + "type": "U256" + }, "getBalance": { "description": "Returns balance of the given account.", "params": [ @@ -142,7 +154,9 @@ }, "getUncleCountByBlockNumber": { "description": "Returns the number of uncles in a block with given block number.", - "params": [{ "isOptional": true, "name": "number", "type": "BlockNumber" }], + "params": [ + { "isOptional": true, "name": "number", "type": "BlockNumber" } + ], "type": "U256" }, "getWork": { @@ -222,6 +236,10 @@ "params": [], "type": "String" }, - "version": { "description": "Returns protocol version.", "params": [], "type": "String" } + "version": { + "description": "Returns protocol version.", + "params": [], + "type": "String" + } } }