Compare commits

..
121 Commits
Author SHA1 Message Date
Github Actions 282b39d27a [CI Skip] release/stable 4.6.1
skip-checks: true
2021-04-19 06:07:35 +00:00
Jaco f21e3d317a 4.6.1 (#3407) 2021-04-19 07:56:46 +02:00
Github Actions c2af7cf8f2 [CI Skip] release/beta 4.5.2-8
skip-checks: true
2021-04-18 09:29:51 +00:00
Jaco 0958a4c693 Bump common (#3405)
* Bump common

* Bumps
2021-04-18 11:19:47 +02:00
Github Actions c687181130 [CI Skip] release/beta 4.5.2-7
skip-checks: true
2021-04-16 16:03:07 +00:00
Jaco 685f1ec0b6 Update .123trigger 2021-04-16 17:53:22 +02:00
Jaco e0069b6f7d statemint known-types (#3404) 2021-04-16 17:39:21 +02:00
Github Actions cf48762ff2 [CI Skip] release/beta 4.5.2-6
skip-checks: true
2021-04-15 12:27:19 +00:00
Jaco 31a7545a19 Bump common (#3403) 2021-04-15 14:18:06 +02:00
Github Actions 5cd8e8fb97 [CI Skip] release/beta 4.5.2-5
skip-checks: true
2021-04-14 07:15:18 +00:00
Jaco 96e4090174 Simplify/harden session derives (#3401) 2021-04-14 09:05:35 +02:00
Github Actions 0bbebab90b [CI Skip] release/beta 4.5.2-4
skip-checks: true
2021-04-14 06:26:22 +00:00
Jaco 57dac0ef47 Assert keypair validity in signing operations (#3400) 2021-04-14 08:17:10 +02:00
Github Actions 6c3d24551b [CI Skip] release/beta 4.5.2-3
skip-checks: true
2021-04-13 18:44:11 +00:00
Jaco e7dc6d7a5a Expose internalError on submittables (#3399) 2021-04-13 20:33:59 +02:00
Github Actions a63b7f611e [CI Skip] release/beta 4.5.2-2
skip-checks: true
2021-04-13 10:33:28 +00:00
Jaco 82e15dc36d Explicitly handle isReadyOrError (when only using isReady) (#3395) 2021-04-13 12:24:26 +02:00
Github Actions 6f96037cb5 [CI Skip] release/beta 4.5.2-1
skip-checks: true
2021-04-13 09:08:55 +00:00
Jaco b6da84b8b2 Beefy subscribeJustifications (#3393)
* Beefy subscribeJustifications

* Add payload info

* Update RPC description
2021-04-13 10:59:23 +02:00
Github Actions 41209f074c [CI Skip] release/beta 4.5.2-0
skip-checks: true
2021-04-12 13:17:40 +00:00
Jaco Greeff c47964c942 Updated xcm types (#3391)
* Updated xcm types

* Move NetworkId

* Update DoubleEncodedCall

* trigger

* Xcm is an enum
2021-04-12 15:09:33 +02:00
Github Actions 5f13a634e5 [CI Skip] release/stable 4.5.1
skip-checks: true
2021-04-12 06:30:52 +00:00
Jaco Greeff 40af520fe7 4.5.1 (#3390) 2021-04-12 08:21:37 +02:00
Github Actions 1e506e0f8c [CI Skip] release/beta 4.4.2-7
skip-checks: true
2021-04-11 13:29:10 +00:00
Jaco Greeff 96ea5803d4 Adjust Westend known & detection (#3386) 2021-04-11 15:19:05 +02:00
Jaco Greeff 7d99459f50 Bump deps (#3389) 2021-04-11 15:15:01 +02:00
Github Actions 8fa090f435 [CI Skip] release/beta 4.4.2-6
skip-checks: true
2021-04-09 20:11:40 +00:00
Jaco Greeff d3c60d197c PalletId type 2021-04-09 23:01:11 +03:00
Github Actions ad8550f7f5 [CI Skip] release/beta 4.4.2-5
skip-checks: true
2021-04-09 19:51:56 +00:00
Jaco Greeff a899aa439d Adjust slot types based on constants (#3385) 2021-04-09 21:40:24 +02:00
Github Actions e0e075b350 [CI Skip] release/beta 4.4.2-4
skip-checks: true
2021-04-09 04:48:56 +00:00
Jaco Greeff 34ff14547e Westend runtime 50 upgrade block (& v30 session keys) (#3382)
* Westend runtime 50 upgrade block (& v30 session keys)

* Revery beefy keys

* Defer 7B keys to 51
2021-04-09 06:39:40 +02:00
Github Actions 681a80d456 [CI Skip] release/beta 4.4.2-3
skip-checks: true
2021-04-08 12:17:03 +00:00
Jaco Greeff ed5f2673ce Detect Keys, inject SessionKeys (#3380) 2021-04-08 14:07:39 +02:00
Github Actions 43e87603e2 [CI Skip] release/beta 4.4.2-2
skip-checks: true
2021-04-08 09:02:42 +00:00
Jaco Greeff d056416b47 Bump deps (#3379) 2021-04-08 10:52:20 +02:00
Github Actions 1bcf94131d [CI Skip] release/beta 4.4.2-1
skip-checks: true
2021-04-08 05:45:13 +00:00
Jaco Greeff 17b607b6c3 Update Rococo session key (& small para type cleanups) (#3378) 2021-04-08 08:35:24 +03:00
Github Actions 5a16d1dd8b [CI Skip] release/beta 4.4.2-0
skip-checks: true
2021-04-07 14:18:01 +00:00
Jaco Greeff 144b74306a Update parachain types (#3376)
* Update parachain types

* Remove retiring flag
2021-04-07 16:09:38 +02:00
Jaco Greeff 16b9fa956d Adjust ParaInfo types (#3372) 2021-04-07 15:53:57 +02:00
Github Actions b6af4b9877 [CI Skip] release/stable 4.4.1
skip-checks: true
2021-04-05 11:30:23 +00:00
Jaco Greeff 3f368e721d 4.4 (#3371)
* 4.4

* CHANGELOG
2021-04-05 13:20:18 +02:00
Github Actions 22b4257636 [CI Skip] release/beta 4.3.2-2
skip-checks: true
2021-04-03 06:15:11 +00:00
Jaco Greeff ca7a631032 Add cumulus ServiceQuality type (#3368) 2021-04-03 08:04:42 +02:00
Github Actions da5bbd17af [CI Skip] release/beta 4.3.2-1
skip-checks: true
2021-03-30 09:52:02 +00:00
Jaco Greeff b58f3f5c3e Multilocation update (X5-X8) (#3362) 2021-03-30 11:42:27 +02:00
Github Actions 8c30194f59 [CI Skip] release/beta 4.3.2-0
skip-checks: true
2021-03-30 09:03:06 +00:00
Jaco Greeff dc9ec37490 Add Polkadot 29 upgrade block (#3361) 2021-03-30 10:53:30 +02:00
Github Actions 5175e77eec [CI Skip] release/stable 4.3.1
skip-checks: true
2021-03-29 09:40:47 +00:00
Jaco Greeff 9553c5467c 4.3 (#3359) 2021-03-29 12:30:49 +03:00
Github Actions a1f07e3274 [CI Skip] release/beta 4.2.2-4
skip-checks: true
2021-03-24 11:04:59 +00:00
Jaco Greeff 58deb2eb14 Session index without staking (#3352)
* Session index without staking

* Fix ordering
2021-03-24 11:55:36 +01:00
Github Actions 83caad7f1b [CI Skip] release/beta 4.2.2-3
skip-checks: true
2021-03-24 10:08:26 +00:00
Jaco Greeff 26c3cc9126 Make council optional with treasury proposals (#3351) 2021-03-24 10:58:03 +01:00
Github Actions 1a231dfb0d [CI Skip] release/beta 4.2.2-2
skip-checks: true
2021-03-23 09:48:48 +00:00
Jaco Greeff 712d0425d0 Update ParaInfo types (#3348) 2021-03-23 10:38:28 +01:00
Github Actions eaa5db517f [CI Skip] release/beta 4.2.2-1
skip-checks: true
2021-03-22 16:12:29 +00:00
Jaco Greeff 88c3850d1b Warn on deprecated contracts interfaces (#3346) 2021-03-22 17:03:49 +01:00
Github Actions 943df72ae9 [CI Skip] release/beta 4.2.2-0
skip-checks: true
2021-03-22 15:58:36 +00:00
Veliko 67ab11a036 Abi constructor takes different parameters (#3347)
The Abi constructor used to take the registry as a parameter, now it takes registry.getChainProperties() and this change introduced hard to debug behaviour
2021-03-22 16:48:15 +01:00
Github Actions c87ef7526b [CI Skip] release/stable 4.2.1
skip-checks: true
2021-03-22 08:39:17 +00:00
Jaco Greeff bccf2d52ad 4.2 (#3344) 2021-03-22 09:29:38 +01:00
Github Actions be6dbdd3e4 [CI Skip] release/beta 4.1.2-8
skip-checks: true
2021-03-21 16:37:49 +00:00
Jaco Greeff 3c34ee9897 Bump metadata (#3343) 2021-03-21 17:27:41 +01:00
Github Actions 9ad97813e3 [CI Skip] release/beta 4.1.2-7
skip-checks: true
2021-03-20 17:28:19 +00:00
Jaco Greeff 028f04e47f Optimize society multi-derive (#3342)
* Optimize society multi-derive

* isVoting flag

* isDefenderVoter
2021-03-20 18:18:49 +01:00
Github Actions 4974c9247f [CI Skip] release/beta 4.1.2-6
skip-checks: true
2021-03-20 10:22:42 +00:00
Jaco Greeff 1ffe6a11bf SignedBlock (justifications field) (#3340) 2021-03-20 11:13:56 +01:00
Github Actions 19699ea445 [CI Skip] release/beta 4.1.2-5
skip-checks: true
2021-03-20 09:11:02 +00:00
Jaco Greeff d98ccfb12a Ensure metadata private fields are not accessed (#3341) 2021-03-20 10:01:03 +01:00
Github Actions 41cb056b0f [CI Skip] release/beta 4.1.2-4
skip-checks: true
2021-03-20 08:10:05 +00:00
Jaco Greeff 48bda0bdea Rococo types (detected, now explicit) (#3339)
* Rococo types (detected, now explicit)

* Bumps
2021-03-20 08:59:57 +01:00
Github Actions 1b393c7b67 [CI Skip] release/beta 4.1.2-3
skip-checks: true
2021-03-18 16:17:51 +00:00
Jaco Greeff f52e518b7b Adjust extended derives with as-defined instances (#3336) 2021-03-18 17:08:18 +01:00
Github Actions 08970cff88 [CI Skip] release/beta 4.1.2-2
skip-checks: true
2021-03-17 08:06:55 +00:00
Jaco Greeff 6d38ca6453 Update .123trigger 2021-03-17 08:57:36 +01:00
Github Actions 60db4bc66b [CI Skip] release/beta 4.1.2-1
skip-checks: true
2021-03-16 13:48:13 +00:00
Jaco Greeff 0661237b28 Bump deps (#3326) 2021-03-16 14:38:17 +01:00
Github Actions 6ccac712a8 [CI Skip] release/beta 4.1.2-0
skip-checks: true
2021-03-16 07:41:09 +00:00
Jaco Greeff 3d4877940c Update .123trigger 2021-03-16 08:31:40 +01:00
VelikoandJaco Greeff 70fc95ef27 Fix contractEvents in ContractSubmittableResult (#3324)
* fix the autoaggregation of contract events 

apparently, the system event for contract emitted events has had its name changed

* fix the autoaggregation of contract events

apparently, the system event for contract emitted events has had its name changed

* Update packages/api-contract/src/base/Contract.ts

* Apply suggestions from code review

Co-authored-by: Jaco Greeff <jacogr@gmail.com>
2021-03-15 22:16:35 +01:00
Github Actions 463f65d25c [CI Skip] release/stable 4.1.1
skip-checks: true
2021-03-15 11:51:46 +00:00
Jaco Greeff 09d176c82e 4.1 (#3321) 2021-03-15 12:42:20 +01:00
Github Actions fce96baf3d [CI Skip] release/beta 4.0.4-16
skip-checks: true
2021-03-15 11:18:57 +00:00
Jaco Greeff c6785c533f Use at-block registry/types for derive block/header (#3320)
* Use at-block registry/types for derive block/header

* Also apply to subscribe
2021-03-15 12:08:25 +01:00
Github Actions 64de021149 [CI Skip] release/beta 4.0.4-15
skip-checks: true
2021-03-15 10:13:45 +00:00
Jaco Greeff de9e17a1a0 Add Mmr RPCs (#3318)
* Add Mmr RPCs

* blockHash
2021-03-15 11:03:18 +01:00
Github Actions 987bccea2e [CI Skip] release/beta 4.0.4-14
skip-checks: true
2021-03-15 09:46:29 +00:00
Jaco GreeffandXiliang Chen 1434b86b8f Update to latest Substrate metadata (#3316)
* Update to latest Substrate metadata

* Update contract Schedule

* Update CHANGELOG.md

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>

* CHANGELOG

* Updates

Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
2021-03-15 10:36:05 +01:00
Github Actions a398b2201f [CI Skip] release/beta 4.0.4-13
skip-checks: true
2021-03-15 08:44:13 +00:00
Jaco Greeff f015837c38 Allow ConsensusEngineId toString with non-ascii (#3315)
* Allow ConsensusEngineId toString with non-ascii

* Add number test
2021-03-15 09:34:16 +01:00
Github Actions 5b51588995 [CI Skip] release/beta 4.0.4-12
skip-checks: true
2021-03-12 15:31:59 +00:00
Jaco Greeff 7383e521e5 Kusama 2029 upgrade block (#3310) 2021-03-12 16:23:41 +01:00
Github Actions b10f05786c [CI Skip] release/beta 4.0.4-11
skip-checks: true
2021-03-11 13:03:32 +00:00
Jaco Greeff a212351528 Re-add old slot types (#3305) 2021-03-11 13:55:11 +01:00
Github Actions 55c01af260 [CI Skip] release/beta 4.0.4-10
skip-checks: true
2021-03-11 07:49:11 +00:00
Jaco Greeff 1cf6ffad2b Updata HostConfig for parachains (#3302) 2021-03-11 08:39:24 +01:00
Github Actions 00d0ab9de1 [CI Skip] release/beta 4.0.4-9
skip-checks: true
2021-03-10 21:27:04 +00:00
Jaco Greeff b38e60a9a7 ValidatorIndex for shared 2021-03-10 22:17:30 +01:00
Github Actions 29f7e46439 [CI Skip] release/beta 4.0.4-8
skip-checks: true
2021-03-10 21:10:51 +00:00
Jaco Greeff fa0add8564 Adjust to new auction types (#3297)
* Adjust to new auction types

* Update BitVec fields, Babe types
2021-03-10 22:00:57 +01:00
Github Actions 5bec38c404 [CI Skip] release/beta 4.0.4-7
skip-checks: true
2021-03-10 16:33:36 +00:00
Jaco Greeff 43b66b6507 Remove createBlueprint (use createContract) (#3300) 2021-03-10 17:24:59 +01:00
Github Actions 7e370b3a23 [CI Skip] release/beta 4.0.4-6
skip-checks: true
2021-03-10 16:06:13 +00:00
Jaco Greeff 2b270a3c9f Fix author extraction (both POW & BABE) (#3299)
* Fix author extaction for Babeb session-end

* Fix extraction from Seal
2021-03-10 16:55:59 +01:00
Github Actions cf0d9a2d3f [CI Skip] release/beta 4.0.4-5
skip-checks: true
2021-03-09 15:49:41 +00:00
Jaco Greeff 5d70622819 Extend signer payload with any additional extension fields (#3269)
* Extend payload with additional fields

* Extras

* Adjust
2021-03-09 16:38:33 +01:00
Github Actions fcebdb6d6f [CI Skip] release/beta 4.0.4-4
skip-checks: true
2021-03-09 15:28:51 +00:00
Jaco Greeff 3d020b5159 Check types against fallbacks (#3293)
* Check types against fallbacks

* Only enable fallback check for latest
2021-03-09 16:17:49 +01:00
Github Actions 530d1bcd03 [CI Skip] release/beta 4.0.4-3
skip-checks: true
2021-03-09 14:48:18 +00:00
Jaco Greeff a4151c2941 Adjust for latest types (#3291) 2021-03-09 15:40:06 +01:00
Github Actions a801d30fb6 [CI Skip] release/beta 4.0.4-2
skip-checks: true
2021-03-09 10:00:17 +00:00
Jaco Greeff 1fe9b605dd Bump substrate metadata (#3289) 2021-03-09 10:49:42 +01:00
Github Actions ecfd822d94 [CI Skip] release/beta 4.0.4-1
skip-checks: true
2021-03-09 09:30:33 +00:00
Jaco Greeff a5e4d68993 Remove jest confix for rxjs (#3288) 2021-03-09 10:20:26 +01:00
Github Actions ca5c002d37 [CI Skip] release/beta 4.0.4-0
skip-checks: true
2021-03-09 08:27:13 +00:00
Jaco Greeff 6e28760da4 Remove explicit RpcCore interface (apply in API itself) (#3284)
* Remove explicit RpcCore interface (apply in API itself)

* Simplify

* Adjust test linting

* casting

* Remove stray eslint

* Re-add enable
2021-03-09 09:17:30 +01:00
Github Actions a253c4edb5 [CI Skip] release/stable 4.0.3
skip-checks: true
2021-03-08 21:20:51 +00:00
Jaco Greeff 7c96525d35 4.0.3 (#3287) 2021-03-08 22:11:42 +01:00
Zeke MostovandJaco Greeff 3f0457efc2 fix: Allow sudo for polkadot indexed proxy enum (#3286)
* fix: Allow sudo for polkadot indexed proxy enum

* Update packages/types-known/src/spec/polkadot.ts

Co-authored-by: Jaco Greeff <jacogr@gmail.com>
2021-03-08 22:00:35 +01:00
116 changed files with 4575 additions and 2739 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
26 29
1.4.2 1.4.2
1.6.2 1.6.2
1.11.2 1.11.2
@@ -17,5 +17,5 @@
3.9.2 3.9.2
3.9.3 3.9.3
3.10.2 3.10.2
4.0.2
4.0.2 4.0.3
+103
View File
@@ -1,5 +1,108 @@
# CHANGELOG # CHANGELOG
## 4.6.1 Apr 19, 2021
Upgrade priority: Low. Recommended if used in a Node.js 15.x environment.
Changes:
- Assert keypair validity in signing operations
- Expose `internalError` on submittable results (e.g. event decoding errors)
- Simplify session derives for old/new
- Add statemint to known types
- Add support for `rpc.beefy.subscribeJustifications`
- Update Xcm types
- Explicitly handle `isReadyOrError` with `Api.create`
- Add Kusama upgrade block for 2030
## 4.5.1 Apr 12, 2021
Upgrade priority: Low. Recommended with usage with the Rococo testnet.
Changes:
- Update parachain types as per latest Polkadot
- Cater for `Keys` with `BEEFY` session keys
- Update `Keys` injection to allow for on-chain type detection
- Add `Westend` known upgrade block for runtime 50
- Align types with latest Substrate master
- Adjust keepalive `system_health` timer
## 4.4.1 Apr 5, 2021
Upgrade priority: Low. Recommended with usage with the Rococo testnet.
Changes:
- Add `ServiceQuality` type for Cumulus
- Adjust XCM MultiLocation type (X5 to X8 junctions)
- Add Polkadot 29 upgrade block
## 4.3.1 Mar 29, 2021
Upgrade priority: Low.
Contributed:
- Fix documentation on ABI parameters (Thanks to https://github.com/vminkov)
Changes:
- Warn on usage of deprecated contract interfaces
- Update `ParaInfo` type
- Council should be optional in treasury derives
- Allow extraction of session derives indexes with no staking
## 4.2.1 Mar 22, 2021
Upgrade priority: Low. Recommended when tracking the latest updates from Substrate.
Contributed:
- Fix contract even decoding on Substrate 3 (Thanks to https://github.com/vminkov)
Changes:
- Adjust `Extender{Header, SignedBlock}` types to ensure at-block `Header` types are used
- Explicit definition for new Rococo triple refcount `AccountData` types
- Convert metadata private class fields to ES-private
- Adjust `SignedBlock` type for new `justifications` field
- Optimize society derive for multi accounts
- Bump metadata to latest substrate version
## 4.1.1 Mar 15, 2021
Upgrade priority: Low. Recommended when tracking the latest updates from Substrate.
Changes:
- Fix author extraction for last block in a session
- Expand `SignerPayload` to inject/expose custom signed extensions
- `ConsensusEngineId` formats non-Ascii engines correctly
- Allow `getBlock/Header` derives to use as-at registry (instead of latest)
- Cleanup `RpcCore` augmentation (removing TS warnings on typegen chains)
- Add upgrade block for Kusama 2029
- Ensure that type alias overrides also apply to map keys
- Check type generation against fallbacks (build-time only sanity check)
- Add `mmr_generateProof` RPC
- Align types with latest substrate master
- Apply latest Polkadot auctions/crowdloan/parachains/slots types
## 4.0.3 Mar 8, 2021
Upgrade priority: Low. Recommended if you use the API to sync the full chain, most notably Polkadot.
Contributed:
- Re-add unused historical `SudoBalances` to `ProxyType` (Thanks to https://github.com/emostov)
## 4.0.2 Mar 8, 2021 ## 4.0.2 Mar 8, 2021
Upgrade priority: High. Required if you are using 4.0.1 in a Node.js environment. Upgrade priority: High. Required if you are using 4.0.1 in a Node.js environment.
+4 -3
View File
@@ -3,7 +3,8 @@
const config = require('@polkadot/dev/config/jest.cjs'); const config = require('@polkadot/dev/config/jest.cjs');
module.exports = Object.assign({}, config, { module.exports = {
...config,
moduleNameMapper: { moduleNameMapper: {
'@polkadot/api-(contract|derive)(.*)$': '<rootDir>/packages/api-$1/src/$2', '@polkadot/api-(contract|derive)(.*)$': '<rootDir>/packages/api-$1/src/$2',
// eslint-disable-next-line sort-keys // eslint-disable-next-line sort-keys
@@ -26,5 +27,5 @@ module.exports = Object.assign({}, config, {
'<rootDir>/packages/types/build', '<rootDir>/packages/types/build',
'<rootDir>/packages/types-known/build' '<rootDir>/packages/types-known/build'
], ],
transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/|rxjs/_esm5)'] transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)']
}); };
+8 -8
View File
@@ -8,7 +8,7 @@
"packages/*" "packages/*"
], ],
"resolutions": { "resolutions": {
"typescript": "^4.2.3" "typescript": "^4.2.4"
}, },
"scripts": { "scripts": {
"build": "yarn build:interfaces && polkadot-dev-build-ts", "build": "yarn build:interfaces && polkadot-dev-build-ts",
@@ -25,14 +25,14 @@
"test:watch": "polkadot-dev-run-test --watch" "test:watch": "polkadot-dev-run-test --watch"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.13.8", "@babel/core": "^7.13.15",
"@babel/register": "^7.13.8", "@babel/register": "^7.13.14",
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/dev": "^0.62.5", "@polkadot/dev": "^0.62.8",
"@polkadot/ts": "^0.3.61", "@polkadot/ts": "^0.3.62",
"@polkadot/typegen": "workspace:packages/typegen", "@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^26.0.20", "@types/jest": "^26.0.22",
"copyfiles": "^2.4.1" "copyfiles": "^2.4.1"
}, },
"version": "4.0.2" "version": "4.6.1"
} }
+1 -1
View File
@@ -8,7 +8,7 @@ import { Abi } from '@polkadot/api-contract';
const wsProvider = new WsProvider(<...Node Url...>); const wsProvider = new WsProvider(<...Node Url...>);
const api = await ApiPromise.create({ provider: wsProvider }); const api = await ApiPromise.create({ provider: wsProvider });
const abi = new Abi(api.registry, <...JSON ABI...>); const abi = new Abi(<...JSON ABI...>, api.registry.getChainProperties());
api.tx.contracts api.tx.contracts
.call(<contract addr>, <value>, <max gas>, abi.messages.<method name>(<...params...>)) .call(<contract addr>, <value>, <max gas>, abi.messages.<method name>(<...params...>))
+6 -6
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/api-contract", "name": "@polkadot/api-contract",
"version": "4.0.2", "version": "4.6.1",
"type": "module", "type": "module",
"description": "Interfaces for interacting with contracts and contract ABIs", "description": "Interfaces for interacting with contracts and contract ABIs",
"main": "index.js", "main": "index.js",
@@ -16,11 +16,11 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/api": "4.0.2", "@polkadot/api": "4.6.1",
"@polkadot/types": "4.0.2", "@polkadot/types": "4.6.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.2.1",
"@polkadot/x-rxjs": "^6.0.5", "@polkadot/x-rxjs": "^6.2.1",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
} }
} }
+14 -22
View File
@@ -3,14 +3,14 @@
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { EventRecord, Hash } from '@polkadot/types/interfaces'; import type { EventRecord } from '@polkadot/types/interfaces';
import type { AnyJson, CodecArg, ISubmittableResult } from '@polkadot/types/types'; import type { AnyJson, CodecArg, ISubmittableResult } from '@polkadot/types/types';
import type { AbiConstructor, BlueprintOptions } from '../types'; import type { AbiConstructor, BlueprintOptions } from '../types';
import type { MapConstructorExec } from './types'; import type { MapConstructorExec } from './types';
import { SubmittableResult } from '@polkadot/api'; import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base'; import { ApiBase } from '@polkadot/api/base';
import { assert, compactAddLength, isFunction, isUndefined, isWasm, stringCamelCase, u8aToU8a } from '@polkadot/util'; import { assert, compactAddLength, isFunction, isUndefined, isWasm, logger, stringCamelCase, u8aToU8a } from '@polkadot/util';
import { blake2AsU8a } from '@polkadot/util-crypto'; import { blake2AsU8a } from '@polkadot/util-crypto';
import { Abi } from '../Abi'; import { Abi } from '../Abi';
@@ -20,6 +20,8 @@ import { Blueprint } from './Blueprint';
import { Contract } from './Contract'; import { Contract } from './Contract';
import { createBluePrintTx, EMPTY_SALT, encodeSalt } from './util'; import { createBluePrintTx, EMPTY_SALT, encodeSalt } from './util';
const l = logger('Code');
export class CodeSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult { export class CodeSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
public readonly blueprint?: Blueprint<ApiType>; public readonly blueprint?: Blueprint<ApiType>;
public readonly contract?: Contract<ApiType>; public readonly contract?: Contract<ApiType>;
@@ -55,18 +57,8 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
}); });
} }
/** public get tx (): MapConstructorExec<ApiType> {
* @description Deploy the code bundle, creating a Blueprint. return this.#tx;
* @deprecated Use the `code.tx.<constructor>(...) format to put code and deploy
*/
public createBlueprint (): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> {
return this.api.tx.contracts
.putCode(compactAddLength(this.code))
.withResultTransform((result: ISubmittableResult) =>
new CodeSubmittableResult(result, applyOnEvent(result, ['CodeStored'], ([record]: EventRecord[]) =>
new Blueprint<ApiType>(this.api, this.abi, record.event.data[0] as Hash, this._decorateMethod)
))
);
} }
/** /**
@@ -74,26 +66,26 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
* @deprecated Use the `code.tx.<constructor>(...) format to put code and deploy * @deprecated Use the `code.tx.<constructor>(...) format to put code and deploy
*/ */
public createContract (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> { public createContract (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> {
return this.#instantiate(constructorOrId, options, params); l.warn('.createContract is deprecated, use code.tx.<constructorName>(...) instead (where code refers to this instance)');
}
public get tx (): MapConstructorExec<ApiType> { return this.#instantiate(constructorOrId, options, params);
return this.#tx;
} }
#instantiate = (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => { #instantiate = (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
return isFunction(this.api.tx.contracts.instantiateWithCode) return isFunction(this.api.tx.contracts.instantiateWithCode)
? this.#instantiateSingle(constructorOrId, options, params) ? this.#instantiateCurrent(constructorOrId, options, params)
: this.#instantiateBatch(constructorOrId, options, params); : this.#instantiatePrev(constructorOrId, options, params);
} }
#instantiateSingle = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => { #instantiateCurrent = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
return this.api.tx.contracts return this.api.tx.contracts
.instantiateWithCode(value, gasLimit, compactAddLength(this.code), this.abi.findConstructor(constructorOrId).toU8a(params), encodeSalt(salt)) .instantiateWithCode(value, gasLimit, compactAddLength(this.code), this.abi.findConstructor(constructorOrId).toU8a(params), encodeSalt(salt))
.withResultTransform(this.#transformEvents); .withResultTransform(this.#transformEvents);
} }
#instantiateBatch = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => { #instantiatePrev = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
assert(isFunction(this.api.tx.utility?.batch), 'Your chain does not include the utility pallet, for contracts v2 deployment, this is required');
const encodedSalt = encodeSalt(salt); const encodedSalt = encodeSalt(salt);
const withSalt = this.api.tx.contracts.instantiate.meta.args.length === 5; const withSalt = this.api.tx.contracts.instantiate.meta.args.length === 5;
const encoded = this.abi.findConstructor(constructorOrId).toU8a(params, withSalt ? EMPTY_SALT : encodedSalt); const encoded = this.abi.findConstructor(constructorOrId).toU8a(params, withSalt ? EMPTY_SALT : encodedSalt);
+11 -6
View File
@@ -23,6 +23,7 @@ import { Base } from './Base';
// As per Rust, 5 * GAS_PER_SEC // As per Rust, 5 * GAS_PER_SEC
const MAX_CALL_GAS = new BN(5_000_000_000_000).subn(1); const MAX_CALL_GAS = new BN(5_000_000_000_000).subn(1);
const ERROR_NO_CALL = 'Your node does not expose the contracts.call RPC. This is most probably due to a runtime configuration.'; const ERROR_NO_CALL = 'Your node does not expose the contracts.call RPC. This is most probably due to a runtime configuration.';
const l = logger('Contract'); const l = logger('Contract');
function createQuery <ApiType extends ApiTypes> (fn: (origin: string | AccountId | Uint8Array, options: ContractOptions, params: CodecArg[]) => ContractCallResult<ApiType, ContractCallOutcome>): ContractQuery<ApiType> { function createQuery <ApiType extends ApiTypes> (fn: (origin: string | AccountId | Uint8Array, options: ContractOptions, params: CodecArg[]) => ContractCallResult<ApiType, ContractCallOutcome>): ContractQuery<ApiType> {
@@ -39,11 +40,14 @@ function createTx <ApiType extends ApiTypes> (fn: (options: ContractOptions, par
: fn(...extractOptions(options, params)); : fn(...extractOptions(options, params));
} }
function createWithId <T> (fn: (messageOrId: AbiMessage | string | number, options: ContractOptions, params: CodecArg[]) => T): ContractGeneric<ContractOptions, T> { function createWithId <T> (fn: (messageOrId: AbiMessage | string | number, options: ContractOptions, params: CodecArg[]) => T, warn?: string): ContractGeneric<ContractOptions, T> {
return (messageOrId: AbiMessage | string | number, options: BigInt | string | number | BN | ContractOptions, ...params: CodecArg[]): T => return (messageOrId: AbiMessage | string | number, options: BigInt | string | number | BN | ContractOptions, ...params: CodecArg[]): T => {
isOptions(options) warn && l.warn(warn);
return isOptions(options)
? fn(messageOrId, options, params) ? fn(messageOrId, options, params)
: fn(messageOrId, ...extractOptions(options, params)); : fn(messageOrId, ...extractOptions(options, params));
};
} }
export class ContractSubmittableResult extends SubmittableResult { export class ContractSubmittableResult extends SubmittableResult {
@@ -109,8 +113,8 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
super(api, abi, decorateMethod); super(api, abi, decorateMethod);
this.address = this.registry.createType('AccountId', address); this.address = this.registry.createType('AccountId', address);
this.exec = createWithId(this.#exec); this.exec = createWithId(this.#exec, '.exec is deprecated, use contract.tx.<messageName>(...) instead (where contract refers to this instance)');
this.read = createWithId(this.#read); this.read = createWithId(this.#read, '.read is deprecated, use contract.query.<messageName>(...) instead (where contract refers to this instance)');
this.abi.messages.forEach((m): void => { this.abi.messages.forEach((m): void => {
const messageName = stringCamelCase(m.identifier); const messageName = stringCamelCase(m.identifier);
@@ -156,7 +160,8 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
return this.api.tx.contracts return this.api.tx.contracts
.call(this.address, value, this.#getGas(gasLimit), this.abi.findMessage(messageOrId).toU8a(params)) .call(this.address, value, this.#getGas(gasLimit), this.abi.findMessage(messageOrId).toU8a(params))
.withResultTransform((result: ISubmittableResult) => .withResultTransform((result: ISubmittableResult) =>
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractExecution'], (records: EventRecord[]) => // ContractEmitted is the current generation, ContractExecution is the previous generation
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractEmitted', 'ContractExecution'], (records: EventRecord[]) =>
records records
.map(({ event: { data: [, data] } }): DecodedEvent | null => { .map(({ event: { data: [, data] } }): DecodedEvent | null => {
try { try {
@@ -37,7 +37,9 @@ async function checkContract (api: ApiPromise, pairs: TestKeyringMap): Promise<v
} }
async function main (): Promise<void> { async function main (): Promise<void> {
const api = await ApiPromise.create(); const api = await ApiPromise.create({
hasher: (data: Uint8Array): Uint8Array => data
});
const pairs = createTestPairs(); const pairs = createTestPairs();
// eslint-disable-next-line @typescript-eslint/no-floating-promises // eslint-disable-next-line @typescript-eslint/no-floating-promises
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-contract', version: '4.0.2' }; export const packageInfo = { name: '@polkadot/api-contract', version: '4.6.1' };
+1 -1
View File
@@ -12,7 +12,7 @@ import BN from 'bn.js';
import { createTypeUnsafe } from '@polkadot/types/create'; import { createTypeUnsafe } from '@polkadot/types/create';
import { isBigInt, isBn, isNumber, isString } from '@polkadot/util'; import { isBigInt, isBn, isNumber, isString } from '@polkadot/util';
type ContractEvents = 'CodeStored' | 'ContractExecution' | 'Instantiated'; type ContractEvents = 'CodeStored' | 'ContractEmitted' | 'ContractExecution' | 'Instantiated';
type TOptions = BlueprintOptions | ContractOptions; type TOptions = BlueprintOptions | ContractOptions;
+10 -10
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/api-derive", "name": "@polkadot/api-derive",
"version": "4.0.2", "version": "4.6.1",
"type": "module", "type": "module",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.", "description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"main": "index.js", "main": "index.js",
@@ -16,17 +16,17 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/api": "4.0.2", "@polkadot/api": "4.6.1",
"@polkadot/rpc-core": "4.0.2", "@polkadot/rpc-core": "4.6.1",
"@polkadot/types": "4.0.2", "@polkadot/types": "4.6.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.2.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.2.1",
"@polkadot/x-rxjs": "^6.0.5", "@polkadot/x-rxjs": "^6.2.1",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5", "@polkadot/keyring": "^6.2.1",
"@polkadot/rpc-provider": "4.0.2" "@polkadot/rpc-provider": "4.6.1"
} }
} }
+6 -2
View File
@@ -37,12 +37,16 @@ export function bounties (instanceId: string, api: ApiInterfaceRx): () => Observ
return memo(instanceId, (): Observable<DeriveBounties> => return memo(instanceId, (): Observable<DeriveBounties> =>
combineLatest([ combineLatest([
bountyBase.bountyCount<BountyIndex>(), bountyBase.bountyCount<BountyIndex>(),
api.query.council ? api.query.council.proposalCount<ProposalIndex>() : of(0) api.query.council
? api.query.council.proposalCount<ProposalIndex>()
: of(0)
]).pipe( ]).pipe(
switchMap(() => switchMap(() =>
combineLatest([ combineLatest([
bountyBase.bounties.keys<[BountyIndex]>(), bountyBase.bounties.keys<[BountyIndex]>(),
api.derive.council ? api.derive.council.proposals() : of([]) api.derive.council
? api.derive.council.proposals()
: of([])
]) ])
), ),
switchMap(([keys, proposals]): Observable<Result> => { switchMap(([keys, proposals]): Observable<Result> => {
+3 -2
View File
@@ -3,11 +3,12 @@
import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import type { SignedBlockExtended } from '../type/types';
import { combineLatest, of } from '@polkadot/x-rxjs'; import { combineLatest, of } from '@polkadot/x-rxjs';
import { catchError, map } from '@polkadot/x-rxjs/operators'; import { catchError, map } from '@polkadot/x-rxjs/operators';
import { SignedBlockExtended } from '../type'; import { createSignedBlockExtended } from '../type';
import { memo } from '../util'; import { memo } from '../util';
/** /**
@@ -33,7 +34,7 @@ export function getBlock (instanceId: string, api: ApiInterfaceRx): (hash: Uint8
: of([]) : of([])
]).pipe( ]).pipe(
map(([signedBlock, events, validators]): SignedBlockExtended => map(([signedBlock, events, validators]): SignedBlockExtended =>
new SignedBlockExtended(api.registry, signedBlock, events, validators) createSignedBlockExtended(api.registry, signedBlock, events, validators)
), ),
catchError((): Observable<undefined> => catchError((): Observable<undefined> =>
// where rpc.chain.getHeader throws, we will land here - it can happen that // where rpc.chain.getHeader throws, we will land here - it can happen that
+3 -2
View File
@@ -3,11 +3,12 @@
import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import type { HeaderExtended } from '../type/types';
import { combineLatest, of } from '@polkadot/x-rxjs'; import { combineLatest, of } from '@polkadot/x-rxjs';
import { catchError, map } from '@polkadot/x-rxjs/operators'; import { catchError, map } from '@polkadot/x-rxjs/operators';
import { HeaderExtended } from '../type'; import { createHeaderExtended } from '../type';
import { memo } from '../util'; import { memo } from '../util';
/** /**
@@ -33,7 +34,7 @@ export function getHeader (instanceId: string, api: ApiInterfaceRx): (hash: Uint
: of([]) : of([])
]).pipe( ]).pipe(
map(([header, validators]): HeaderExtended => map(([header, validators]): HeaderExtended =>
new HeaderExtended(api.registry, header, validators) createHeaderExtended(header.registry, header, validators)
), ),
catchError((): Observable<undefined> => catchError((): Observable<undefined> =>
// where rpc.chain.getHeader throws, we will land here - it can happen that // where rpc.chain.getHeader throws, we will land here - it can happen that
@@ -5,12 +5,12 @@ import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { Vec } from '@polkadot/types'; import type { Vec } from '@polkadot/types';
import type { EventRecord, SignedBlock } from '@polkadot/types/interfaces'; import type { EventRecord, SignedBlock } from '@polkadot/types/interfaces';
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import type { HeaderExtended } from '../type'; import type { HeaderExtended, SignedBlockExtended } from '../type/types';
import { combineLatest, of } from '@polkadot/x-rxjs'; import { combineLatest, of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators'; import { map, switchMap } from '@polkadot/x-rxjs/operators';
import { SignedBlockExtended } from '../type'; import { createSignedBlockExtended } from '../type';
import { memo } from '../util'; import { memo } from '../util';
/** /**
@@ -30,7 +30,7 @@ export function subscribeNewBlocks (instanceId: string, api: ApiInterfaceRx): ()
); );
}), }),
map(([block, events, header]) => map(([block, events, header]) =>
new SignedBlockExtended(api.registry, block, events, header.validators) createSignedBlockExtended(block.registry, block, events, header.validators)
) )
) )
); );
@@ -3,11 +3,12 @@
import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import type { HeaderExtended } from '../type/types';
import { combineLatest, of } from '@polkadot/x-rxjs'; import { combineLatest, of } from '@polkadot/x-rxjs';
import { map } from '@polkadot/x-rxjs/operators'; import { map } from '@polkadot/x-rxjs/operators';
import { HeaderExtended } from '../type'; import { createHeaderExtended } from '../type';
import { memo } from '../util'; import { memo } from '../util';
/** /**
@@ -34,7 +35,7 @@ export function subscribeNewHeads (instanceId: string, api: ApiInterfaceRx): ()
map(([header, validators]): HeaderExtended => { map(([header, validators]): HeaderExtended => {
header.createdAtHash = header.hash; header.createdAtHash = header.hash;
return new HeaderExtended(api.registry, header, validators); return createHeaderExtended(header.registry, header, validators);
}) })
) )
); );
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-derive', version: '4.0.2' }; export const packageInfo = { name: '@polkadot/api-derive', version: '4.6.1' };
+24 -9
View File
@@ -13,7 +13,7 @@ import { map } from '@polkadot/x-rxjs/operators';
import { memo } from '../util'; import { memo } from '../util';
// parse into Indexes // parse into Indexes
function parse ([activeEra, activeEraStart, currentEra, currentIndex, validatorCount]: [EraIndex, Option<Moment>, EraIndex, SessionIndex, u32]): DeriveSessionIndexes { function parse ([currentIndex, activeEra, activeEraStart, currentEra, validatorCount]: [SessionIndex, EraIndex, Option<Moment>, EraIndex, u32]): DeriveSessionIndexes {
return { return {
activeEra, activeEra,
activeEraStart, activeEraStart,
@@ -24,42 +24,57 @@ function parse ([activeEra, activeEraStart, currentEra, currentIndex, validatorC
} }
// query based on latest // query based on latest
function query (api: ApiInterfaceRx): Observable<DeriveSessionIndexes> { function queryStaking (api: ApiInterfaceRx): Observable<DeriveSessionIndexes> {
return api.queryMulti<[Option<ActiveEraInfo>, Option<EraIndex>, SessionIndex, u32]>([ return api.queryMulti<[SessionIndex, Option<ActiveEraInfo>, Option<EraIndex>, u32]>([
api.query.session.currentIndex,
api.query.staking.activeEra, api.query.staking.activeEra,
api.query.staking.currentEra, api.query.staking.currentEra,
api.query.session.currentIndex,
api.query.staking.validatorCount api.query.staking.validatorCount
]).pipe( ]).pipe(
map(([activeOpt, currentEra, currentIndex, validatorCount]): DeriveSessionIndexes => { map(([currentIndex, activeOpt, currentEra, validatorCount]): DeriveSessionIndexes => {
const { index, start } = activeOpt.unwrapOrDefault(); const { index, start } = activeOpt.unwrapOrDefault();
return parse([ return parse([
currentIndex,
index, index,
start, start,
currentEra.unwrapOrDefault(), currentEra.unwrapOrDefault(),
currentIndex,
validatorCount validatorCount
]); ]);
}) })
); );
} }
// query based on latest
function querySession (api: ApiInterfaceRx): Observable<DeriveSessionIndexes> {
return api.query.session.currentIndex().pipe(
map((currentIndex): DeriveSessionIndexes => parse([
currentIndex,
api.registry.createType('EraIndex'),
api.registry.createType('Option<Moment>'),
api.registry.createType('EraIndex'),
api.registry.createType('u32')
]))
);
}
// empty set when none is available // empty set when none is available
function empty (api: ApiInterfaceRx): Observable<DeriveSessionIndexes> { function empty (api: ApiInterfaceRx): Observable<DeriveSessionIndexes> {
return of(parse([ return of(parse([
api.registry.createType('SessionIndex', 1),
api.registry.createType('EraIndex'), api.registry.createType('EraIndex'),
api.registry.createType('Option<Moment>'), api.registry.createType('Option<Moment>'),
api.registry.createType('EraIndex'), api.registry.createType('EraIndex'),
api.registry.createType('SessionIndex', 1),
api.registry.createType('u32') api.registry.createType('u32')
])); ]));
} }
export function indexes (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionIndexes> { export function indexes (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionIndexes> {
return memo(instanceId, (): Observable<DeriveSessionIndexes> => return memo(instanceId, (): Observable<DeriveSessionIndexes> =>
api.query.session && api.query.staking api.query.session
? query(api) ? api.query.staking
? queryStaking(api)
: querySession(api)
: empty(api) : empty(api)
); );
} }
+15 -55
View File
@@ -2,71 +2,31 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { u64 } from '@polkadot/types';
import type { SessionIndex } from '@polkadot/types/interfaces';
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveSessionIndexes, DeriveSessionInfo } from '../types'; import type { DeriveSessionInfo } from '../types';
import { map } from '@polkadot/x-rxjs/operators'; import { map } from '@polkadot/x-rxjs/operators';
import { memo } from '../util'; import { memo } from '../util';
type ResultType = [boolean, u64, SessionIndex];
type Result = [ResultType, DeriveSessionIndexes];
function createDerive (api: ApiInterfaceRx, [[hasBabe, epochDuration, sessionsPerEra], { activeEra, activeEraStart, currentEra, currentIndex, validatorCount }]: Result): DeriveSessionInfo {
return {
activeEra,
activeEraStart,
currentEra,
currentIndex,
eraLength: api.registry.createType('BlockNumber', sessionsPerEra.mul(epochDuration)),
isEpoch: hasBabe,
sessionLength: epochDuration,
sessionsPerEra,
validatorCount
};
}
function queryAura (api: ApiInterfaceRx): Observable<DeriveSessionInfo> {
return api.derive.session.indexes().pipe(
map((indexes): DeriveSessionInfo =>
createDerive(api, [
[
false,
api.registry.createType('u64', 1),
// we may have aura without staking (permissioned)
api.consts.staking?.sessionsPerEra || api.registry.createType('SessionIndex', 1)
],
indexes
])
)
);
}
function queryBabe (api: ApiInterfaceRx): Observable<DeriveSessionInfo> {
return api.derive.session.indexes().pipe(
map((indexes) =>
createDerive(api, [
[
true,
api.consts.babe.epochDuration,
// we may have babe without staking (permissioned)
api.consts.staking?.sessionsPerEra || api.registry.createType('SessionIndex', 1)
],
indexes
])
)
);
}
/** /**
* @description Retrieves all the session and era query and calculates specific values on it as the length of the session and eras * @description Retrieves all the session and era query and calculates specific values on it as the length of the session and eras
*/ */
export function info (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionInfo> { export function info (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionInfo> {
return memo(instanceId, (): Observable<DeriveSessionInfo> => return memo(instanceId, (): Observable<DeriveSessionInfo> =>
api.consts.babe api.derive.session.indexes().pipe(
? queryBabe(api) map((indexes) => {
: queryAura(api) const sessionLength = api.consts?.babe?.epochDuration || api.registry.createType('u64', 1);
const sessionsPerEra = api.consts?.staking?.sessionsPerEra || api.registry.createType('SessionIndex', 1);
return {
...indexes,
eraLength: api.registry.createType('BlockNumber', sessionsPerEra.mul(sessionLength)),
isEpoch: !!api.query.babe,
sessionLength,
sessionsPerEra
};
})
)
); );
} }
+2 -2
View File
@@ -44,7 +44,7 @@ function queryBabe (api: ApiInterfaceRx): Observable<[DeriveSessionInfo, ResultS
combineLatest([ combineLatest([
of(info), of(info),
// we may have no staking, but have babe (permissioned) // we may have no staking, but have babe (permissioned)
api.query.staking api.query.staking?.erasStartSessionIndex
? api.queryMulti<ResultSlots>([ ? api.queryMulti<ResultSlots>([
api.query.babe.currentSlot, api.query.babe.currentSlot,
api.query.babe.epochIndex, api.query.babe.epochIndex,
@@ -69,7 +69,7 @@ function queryBabe (api: ApiInterfaceRx): Observable<[DeriveSessionInfo, ResultS
*/ */
export function progress (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionProgress> { export function progress (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionProgress> {
return memo(instanceId, (): Observable<DeriveSessionProgress> => return memo(instanceId, (): Observable<DeriveSessionProgress> =>
api.consts.babe api.query.babe
? queryBabe(api).pipe( ? queryBabe(api).pipe(
map(([info, slots]: [DeriveSessionInfo, ResultSlotsFlat]): DeriveSessionProgress => map(([info, slots]: [DeriveSessionInfo, ResultSlotsFlat]): DeriveSessionProgress =>
createDerive(api, info, slots) createDerive(api, info, slots)
+3 -20
View File
@@ -2,9 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { bool, Option, Vec } from '@polkadot/types'; import type { AccountId } from '@polkadot/types/interfaces';
import type { AccountId, Balance, BlockNumber, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces';
import type { ITuple } from '@polkadot/types/types';
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveSocietyMember } from '../types'; import type { DeriveSocietyMember } from '../types';
@@ -12,28 +10,13 @@ import { map } from '@polkadot/x-rxjs/operators';
import { memo } from '../util'; import { memo } from '../util';
type Result = [Vec<ITuple<[BlockNumber, Balance]>>, StrikeCount, Option<SocietyVote>, bool, Option<VouchingStatus>];
/** /**
* @description Get the member info for a society * @description Get the member info for a society
*/ */
export function member (instanceId: string, api: ApiInterfaceRx): (accountId: AccountId) => Observable<DeriveSocietyMember> { export function member (instanceId: string, api: ApiInterfaceRx): (accountId: AccountId) => Observable<DeriveSocietyMember> {
return memo(instanceId, (accountId: AccountId): Observable<DeriveSocietyMember> => return memo(instanceId, (accountId: AccountId): Observable<DeriveSocietyMember> =>
api.queryMulti<Result>([ api.derive.society._members([accountId]).pipe(
[api.query.society.payouts, accountId], map(([result]) => result)
[api.query.society.strikes, accountId],
[api.query.society.defenderVotes, accountId],
[api.query.society.suspendedMembers, accountId],
[api.query.society.vouching, accountId]
]).pipe(
map(([payouts, strikes, defenderVotes, suspended, vouching]: Result): DeriveSocietyMember => ({
accountId,
isSuspended: suspended.isTrue,
payouts,
strikes,
vote: defenderVotes.unwrapOr(undefined),
vouching: vouching.unwrapOr(undefined)
}))
) )
); );
} }
+33 -10
View File
@@ -2,28 +2,51 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { AccountId } from '@polkadot/types/interfaces'; import type { bool, Option, Vec } from '@polkadot/types';
import type { AccountId, Balance, BlockNumber, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces';
import type { ITuple } from '@polkadot/types/types';
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveSocietyMember } from '../types'; import type { DeriveSocietyMember } from '../types';
import { combineLatest } from '@polkadot/x-rxjs'; import { combineLatest, of } from '@polkadot/x-rxjs';
import { switchMap } from '@polkadot/x-rxjs/operators'; import { map, switchMap } from '@polkadot/x-rxjs/operators';
import { memo } from '../util'; import { memo } from '../util';
type Result = [AccountId[], Vec<ITuple<[BlockNumber, Balance]>>[], StrikeCount[], Option<SocietyVote>[], bool[], Option<VouchingStatus>[]];
export function _members (instanceId: string, api: ApiInterfaceRx): (accountIds: AccountId[]) => Observable<DeriveSocietyMember[]> {
return memo(instanceId, (accountIds: AccountId[]): Observable<DeriveSocietyMember[]> =>
combineLatest<Result>([
of(accountIds),
api.query.society.payouts.multi(accountIds),
api.query.society.strikes.multi(accountIds),
api.query.society.defenderVotes.multi(accountIds),
api.query.society.suspendedMembers.multi(accountIds),
api.query.society.vouching.multi(accountIds)
]).pipe(
map(([accountIds, payouts, strikes, defenderVotes, suspended, vouching]) =>
accountIds.map((accountId, index) => ({
accountId,
isDefenderVoter: defenderVotes[index].isSome,
isSuspended: suspended[index].isTrue,
payouts: payouts[index],
strikes: strikes[index],
vote: defenderVotes[index].unwrapOr(undefined),
vouching: vouching[index].unwrapOr(undefined)
}))
)
)
);
}
/** /**
* @description Get the member info for a society * @description Get the member info for a society
*/ */
export function members (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSocietyMember[]> { export function members (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSocietyMember[]> {
return memo(instanceId, (): Observable<DeriveSocietyMember[]> => return memo(instanceId, (): Observable<DeriveSocietyMember[]> =>
api.query.society.members<AccountId[]>().pipe( api.query.society.members<AccountId[]>().pipe(
switchMap((members): Observable<DeriveSocietyMember[]> => switchMap((members) => api.derive.society._members(members))
combineLatest(
members.map((accountId): Observable<DeriveSocietyMember> =>
api.derive.society.member(accountId)
)
)
)
) )
); );
} }
@@ -61,7 +61,9 @@ function retrieveProposals (api: ApiInterfaceRx, proposalCount: ProposalIndex, a
return combineLatest([ return combineLatest([
api.query.treasury.proposals.multi<Option<TreasuryProposal>>(allIds), api.query.treasury.proposals.multi<Option<TreasuryProposal>>(allIds),
api.derive.council.proposals() api.derive.council
? api.derive.council.proposals()
: of([] as DeriveCollectiveProposal[])
]).pipe( ]).pipe(
map(([allProposals, councilProposals]: [Option<TreasuryProposal>[], DeriveCollectiveProposal[]]): DeriveTreasuryProposals => map(([allProposals, councilProposals]: [Option<TreasuryProposal>[], DeriveCollectiveProposal[]]): DeriveTreasuryProposals =>
parseResult(api, { allIds, allProposals, approvalIds, councilProposals, proposalCount }) parseResult(api, { allIds, allProposals, approvalIds, councilProposals, proposalCount })
+29 -32
View File
@@ -2,44 +2,41 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { AccountId, Header } from '@polkadot/types/interfaces'; import type { AccountId, Header } from '@polkadot/types/interfaces';
import type { Constructor, Registry } from '@polkadot/types/types'; import type { Registry } from '@polkadot/types/types';
import type { HeaderExtended } from './types';
import { Struct } from '@polkadot/types';
import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions';
import { extractAuthor } from './util'; import { extractAuthor } from './util';
// We can ignore the properties, added via Struct.with export function createHeaderExtended (registry: Registry, header?: Header, validators?: AccountId[]): HeaderExtended {
const _Header = Struct.with(runtimeTypes.types.Header as any) as Constructor<Header>; // an instance of the base extrinsic for us to extend
const HeaderBase = registry.createClass('Header');
/** class Implementation extends HeaderBase implements HeaderExtended {
* @name HeaderExtended readonly #author?: AccountId;
* @description readonly #validators?: AccountId[];
* A [[Block]] header with an additional `author` field that indicates the block author
*/
export class HeaderExtended extends _Header {
readonly #author?: AccountId;
readonly #validators?: AccountId[];
constructor (registry: Registry, header?: Header, validators?: AccountId[]) { constructor (registry: Registry, header?: Header, validators?: AccountId[]) {
super(registry, header); super(registry, header);
this.#author = extractAuthor(this.digest, validators); this.#author = extractAuthor(this.digest, validators);
this.#validators = validators; this.#validators = validators;
this.createdAtHash = header?.createdAtHash; this.createdAtHash = header?.createdAtHash;
}
/**
* @description Convenience method, returns the author for the block
*/
public get author (): AccountId | undefined {
return this.#author;
}
/**
* @description Convenience method, returns the validators for the block
*/
public get validators (): AccountId[] | undefined {
return this.#validators;
}
} }
/** return new Implementation(registry, header, validators);
* @description Convenience method, returns the author for the block
*/
public get author (): AccountId | undefined {
return this.#author;
}
/**
* @description Convenience method, returns the validators for the block
*/
public get validators (): AccountId[] | undefined {
return this.#validators;
}
} }
@@ -1,24 +1,12 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors // Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { AccountId, DispatchError, DispatchInfo, Event, EventRecord, Extrinsic, SignedBlock } from '@polkadot/types/interfaces'; import type { AccountId, DispatchError, DispatchInfo, EventRecord, Extrinsic, SignedBlock } from '@polkadot/types/interfaces';
import type { Constructor, Registry } from '@polkadot/types/types'; import type { Registry } from '@polkadot/types/types';
import type { SignedBlockExtended, TxWithEvent } from './types';
import { Struct } from '@polkadot/types';
import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions';
import { extractAuthor } from './util'; import { extractAuthor } from './util';
// We can ignore the properties, added via Struct.with
const _SignedBlock = Struct.with(runtimeTypes.types.SignedBlock as any) as Constructor<SignedBlock>;
interface TxWithEvent {
dispatchError?: DispatchError;
dispatchInfo?: DispatchInfo;
events: Event[];
extrinsic: Extrinsic;
}
function mapExtrinsics (extrinsics: Extrinsic[], records: EventRecord[]): TxWithEvent[] { function mapExtrinsics (extrinsics: Extrinsic[], records: EventRecord[]): TxWithEvent[] {
return extrinsics.map((extrinsic, index): TxWithEvent => { return extrinsics.map((extrinsic, index): TxWithEvent => {
let dispatchError: DispatchError | undefined; let dispatchError: DispatchError | undefined;
@@ -43,43 +31,45 @@ function mapExtrinsics (extrinsics: Extrinsic[], records: EventRecord[]): TxWith
}); });
} }
/** export function createSignedBlockExtended (registry: Registry, block?: SignedBlock, events?: EventRecord[], validators?: AccountId[]): SignedBlockExtended {
* @name SignedBlockExtended // an instance of the base extrinsic for us to extend
* @description const SignedBlockBase = registry.createClass('SignedBlock');
* A [[Block]] header with an additional `author` field that indicates the block author
*/
export class SignedBlockExtended extends _SignedBlock {
readonly #author?: AccountId;
readonly #events: EventRecord[];
readonly #extrinsics: TxWithEvent[];
constructor (registry: Registry, block?: SignedBlock, events?: EventRecord[], validators?: AccountId[]) { class Implementation extends SignedBlockBase implements SignedBlockExtended {
super(registry, block); readonly #author?: AccountId;
readonly #events: EventRecord[];
readonly #extrinsics: TxWithEvent[];
this.#author = extractAuthor(this.block.header.digest, validators); constructor (registry: Registry, block?: SignedBlock, events?: EventRecord[], validators?: AccountId[]) {
this.#events = events || ([] as EventRecord[]); super(registry, block);
this.#extrinsics = mapExtrinsics(this.block.extrinsics, this.#events);
this.createdAtHash = block?.createdAtHash; this.#author = extractAuthor(this.block.header.digest, validators);
this.#events = events || ([] as EventRecord[]);
this.#extrinsics = mapExtrinsics(this.block.extrinsics, this.#events);
this.createdAtHash = block?.createdAtHash;
}
/**
* @description Convenience method, returns the author for the block
*/
public get author (): AccountId | undefined {
return this.#author;
}
/**
* @description Convenience method, returns the events associated with the block
*/
public get events (): EventRecord[] {
return this.#events;
}
/**
* @description Returns the extrinsics and their events, mapped
*/
public get extrinsics (): TxWithEvent[] {
return this.#extrinsics;
}
} }
/** return new Implementation(registry, block, events, validators);
* @description Convenience method, returns the author for the block
*/
public get author (): AccountId | undefined {
return this.#author;
}
/**
* @description Convenience method, returns the events associated with the block
*/
public get events (): EventRecord[] {
return this.#events;
}
/**
* @description Returns the extrinsics and their events, mapped
*/
public get extrinsics (): TxWithEvent[] {
return this.#extrinsics;
}
} }
+2 -2
View File
@@ -1,5 +1,5 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors // Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
export { HeaderExtended } from './HeaderExtended'; export { createHeaderExtended } from './HeaderExtended';
export { SignedBlockExtended } from './SignedBlockExtended'; export { createSignedBlockExtended } from './SignedBlockExtended';
+22
View File
@@ -0,0 +1,22 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AccountId, DispatchError, DispatchInfo, Event, EventRecord, Extrinsic, Header, SignedBlock } from '@polkadot/types/interfaces';
export interface HeaderExtended extends Header {
readonly author: AccountId | undefined;
readonly validators: AccountId[] | undefined;
}
export interface SignedBlockExtended extends SignedBlock {
readonly author: AccountId | undefined;
readonly events: EventRecord[];
readonly extrinsics: TxWithEvent[];
}
export interface TxWithEvent {
dispatchError?: DispatchError;
dispatchInfo?: DispatchInfo;
events: Event[];
extrinsic: Extrinsic;
}
+32 -9
View File
@@ -5,20 +5,43 @@ import type { AccountId, Digest } from '@polkadot/types/interfaces';
export function extractAuthor (digest: Digest, sessionValidators: AccountId[] = []): AccountId | undefined { export function extractAuthor (digest: Digest, sessionValidators: AccountId[] = []): AccountId | undefined {
const [citem] = digest.logs.filter(({ type }) => type === 'Consensus'); const [citem] = digest.logs.filter(({ type }) => type === 'Consensus');
const [pitem] = digest.logs.filter(({ type }) => type === 'PreRuntime');
const [sitem] = digest.logs.filter(({ type }) => type === 'Seal');
if (citem) { let accountId: AccountId | undefined;
const [engine, data] = citem.asConsensus;
return engine.extractAuthor(data, sessionValidators); // This is critical to be first for BABE (before Consensus)
} else { // If not first, we end up dropping the author at session-end
const [pitem] = digest.logs.filter(({ type }) => type === 'PreRuntime'); if (pitem) {
try {
if (pitem) {
const [engine, data] = pitem.asPreRuntime; const [engine, data] = pitem.asPreRuntime;
return engine.extractAuthor(data, sessionValidators); accountId = engine.extractAuthor(data, sessionValidators);
} catch {
// ignore
} }
} }
return undefined; if (!accountId && citem) {
try {
const [engine, data] = citem.asConsensus;
accountId = engine.extractAuthor(data, sessionValidators);
} catch {
// ignore
}
}
// SEAL, still used in e.g. Kulupu for pow
if (!accountId && sitem) {
try {
const [engine, data] = sitem.asSeal;
accountId = engine.extractAuthor(data, sessionValidators);
} catch {
// ignore
}
}
return accountId;
} }
+2
View File
@@ -12,6 +12,7 @@ export * from './elections/types';
export * from './parachains/types'; export * from './parachains/types';
export * from './session/types'; export * from './session/types';
export * from './staking/types'; export * from './staking/types';
export * from './type/types';
export interface DeriveBalancesAccountData { export interface DeriveBalancesAccountData {
freeBalance: Balance; freeBalance: Balance;
@@ -107,6 +108,7 @@ export interface DeriveSocietyCandidate {
export interface DeriveSocietyMember { export interface DeriveSocietyMember {
accountId: AccountId; accountId: AccountId;
isDefenderVoter: boolean;
isSuspended: boolean; isSuspended: boolean;
payouts: [BlockNumber, Balance][]; payouts: [BlockNumber, Balance][];
strikes: StrikeCount; strikes: StrikeCount;
+12 -12
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/api", "name": "@polkadot/api",
"version": "4.0.2", "version": "4.6.1",
"type": "module", "type": "module",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC", "description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"main": "index.js", "main": "index.js",
@@ -16,17 +16,17 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/api-derive": "4.0.2", "@polkadot/api-derive": "4.6.1",
"@polkadot/keyring": "^6.0.5", "@polkadot/keyring": "^6.2.1",
"@polkadot/metadata": "4.0.2", "@polkadot/metadata": "4.6.1",
"@polkadot/rpc-core": "4.0.2", "@polkadot/rpc-core": "4.6.1",
"@polkadot/rpc-provider": "4.0.2", "@polkadot/rpc-provider": "4.6.1",
"@polkadot/types": "4.0.2", "@polkadot/types": "4.6.1",
"@polkadot/types-known": "4.0.2", "@polkadot/types-known": "4.6.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.2.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.2.1",
"@polkadot/x-rxjs": "^6.0.5", "@polkadot/x-rxjs": "^6.2.1",
"bn.js": "^4.11.9", "bn.js": "^4.11.9",
"eventemitter3": "^4.0.7" "eventemitter3": "^4.0.7"
} }
+76 -32
View File
@@ -3,7 +3,7 @@
import type { Vec, u16, u32, u64, u8 } from '@polkadot/types'; import type { Vec, u16, u32, u64, u8 } from '@polkadot/types';
import type { Codec } from '@polkadot/types/types'; import type { Codec } from '@polkadot/types/types';
import type { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime'; import type { Balance, BalanceOf, BlockNumber, LockIdentifier, Moment, PalletId, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime';
import type { SessionIndex } from '@polkadot/types/interfaces/session'; import type { SessionIndex } from '@polkadot/types/interfaces/session';
import type { EraIndex } from '@polkadot/types/interfaces/staking'; import type { EraIndex } from '@polkadot/types/interfaces/staking';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
@@ -16,11 +16,9 @@ declare module '@polkadot/api/types/consts' {
babe: { babe: {
[key: string]: Codec; [key: string]: Codec;
/** /**
* The number of **slots** that an epoch takes. We couple sessions to * The amount of time, in slots, that each epoch should last.
* epochs, i.e. we start a new session once the new epoch begins. * NOTE: Currently it is not possible to change the epoch duration after
* NOTE: Currently it is not possible to change the epoch duration * the chain has started. Attempting to do so will brick block production.
* after the chain has started. Attempting to do so will brick block
* production.
**/ **/
epochDuration: u64 & AugmentedConst<ApiType>; epochDuration: u64 & AugmentedConst<ApiType>;
/** /**
@@ -205,11 +203,57 @@ declare module '@polkadot/api/types/consts' {
candidacyBond: BalanceOf & AugmentedConst<ApiType>; candidacyBond: BalanceOf & AugmentedConst<ApiType>;
desiredMembers: u32 & AugmentedConst<ApiType>; desiredMembers: u32 & AugmentedConst<ApiType>;
desiredRunnersUp: u32 & AugmentedConst<ApiType>; desiredRunnersUp: u32 & AugmentedConst<ApiType>;
moduleId: LockIdentifier & AugmentedConst<ApiType>; palletId: LockIdentifier & AugmentedConst<ApiType>;
termDuration: BlockNumber & AugmentedConst<ApiType>; termDuration: BlockNumber & AugmentedConst<ApiType>;
votingBondBase: BalanceOf & AugmentedConst<ApiType>; votingBondBase: BalanceOf & AugmentedConst<ApiType>;
votingBondFactor: BalanceOf & AugmentedConst<ApiType>; votingBondFactor: BalanceOf & AugmentedConst<ApiType>;
}; };
gilt: {
[key: string]: Codec;
/**
* Portion of the queue which is free from ordering and just a FIFO.
*
* Must be no greater than `MaxQueueLen`.
**/
fifoQueueLen: u32 & AugmentedConst<ApiType>;
/**
* The number of blocks between consecutive attempts to issue more gilts in an effort to
* get to the target amount to be frozen.
*
* A larger value results in fewer storage hits each block, but a slower period to get to
* the target.
**/
intakePeriod: BlockNumber & AugmentedConst<ApiType>;
/**
* The maximum amount of bids that can be turned into issued gilts each block. A larger
* value here means less of the block available for transactions should there be a glut of
* bids to make into gilts to reach the target.
**/
maxIntakeBids: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of items that may be in each duration queue.
**/
maxQueueLen: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount of funds that may be offered to freeze for a gilt. Note that this
* does not actually limit the amount which may be frozen in a gilt since gilts may be
* split up in order to satisfy the desired amount of funds under gilts.
*
* It should be at least big enough to ensure that there is no possible storage spam attack
* or queue-filling attack.
**/
minFreeze: BalanceOf & AugmentedConst<ApiType>;
/**
* The base period for the duration queues. This is the common multiple across all
* supported freezing durations that can be bid upon.
**/
period: BlockNumber & AugmentedConst<ApiType>;
/**
* Number of duration queues in total. This sets the maximum duration supported, which is
* this value multiplied by `Period`.
**/
queueCount: u32 & AugmentedConst<ApiType>;
};
identity: { identity: {
[key: string]: Codec; [key: string]: Codec;
/** /**
@@ -251,7 +295,7 @@ declare module '@polkadot/api/types/consts' {
lottery: { lottery: {
[key: string]: Codec; [key: string]: Codec;
maxCalls: u32 & AugmentedConst<ApiType>; maxCalls: u32 & AugmentedConst<ApiType>;
moduleId: ModuleId & AugmentedConst<ApiType>; palletId: PalletId & AugmentedConst<ApiType>;
}; };
multisig: { multisig: {
[key: string]: Codec; [key: string]: Codec;
@@ -272,15 +316,20 @@ declare module '@polkadot/api/types/consts' {
proxy: { proxy: {
[key: string]: Codec; [key: string]: Codec;
/** /**
* `AnnouncementDepositBase` metadata shadow. * The base amount of currency needed to reserve for creating an announcement.
*
* This is held when a new storage item holding a `Balance` is created (typically 16 bytes).
**/ **/
announcementDepositBase: BalanceOf & AugmentedConst<ApiType>; announcementDepositBase: BalanceOf & AugmentedConst<ApiType>;
/** /**
* `AnnouncementDepositFactor` metadata shadow. * The amount of currency needed per announcement made.
*
* This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes)
* into a pre-existing storage value.
**/ **/
announcementDepositFactor: BalanceOf & AugmentedConst<ApiType>; announcementDepositFactor: BalanceOf & AugmentedConst<ApiType>;
/** /**
* `MaxPending` metadata shadow. * The maximum amount of time-delayed announcements that are allowed to be pending.
**/ **/
maxPending: u32 & AugmentedConst<ApiType>; maxPending: u32 & AugmentedConst<ApiType>;
/** /**
@@ -289,10 +338,17 @@ declare module '@polkadot/api/types/consts' {
maxProxies: u16 & AugmentedConst<ApiType>; maxProxies: u16 & AugmentedConst<ApiType>;
/** /**
* The base amount of currency needed to reserve for creating a proxy. * The base amount of currency needed to reserve for creating a proxy.
*
* This is held for an additional storage item whose value size is
* `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes.
**/ **/
proxyDepositBase: BalanceOf & AugmentedConst<ApiType>; proxyDepositBase: BalanceOf & AugmentedConst<ApiType>;
/** /**
* The amount of currency needed per proxy added. * The amount of currency needed per proxy added.
*
* This is held for adding 32 bytes plus an instance of `ProxyType` more into a pre-existing
* storage value. Thus, when configuring `ProxyDepositFactor` one should take into account
* `32 + proxy_type.encode().len()` bytes of data.
**/ **/
proxyDepositFactor: BalanceOf & AugmentedConst<ApiType>; proxyDepositFactor: BalanceOf & AugmentedConst<ApiType>;
}; };
@@ -325,6 +381,10 @@ declare module '@polkadot/api/types/consts' {
* The number of blocks between membership challenges. * The number of blocks between membership challenges.
**/ **/
challengePeriod: BlockNumber & AugmentedConst<ApiType>; challengePeriod: BlockNumber & AugmentedConst<ApiType>;
/**
* Maximum candidate intake per round.
**/
maxCandidateIntake: u32 & AugmentedConst<ApiType>;
/** /**
* The number of times a member may vote the wrong way (or not at all, when they are a skeptic) * The number of times a member may vote the wrong way (or not at all, when they are a skeptic)
* before they become suspended. * before they become suspended.
@@ -333,7 +393,7 @@ declare module '@polkadot/api/types/consts' {
/** /**
* The societies's module id * The societies's module id
**/ **/
moduleId: ModuleId & AugmentedConst<ApiType>; palletId: PalletId & AugmentedConst<ApiType>;
/** /**
* The amount of incentive paid within each period. Doesn't include VoterTip. * The amount of incentive paid within each period. Doesn't include VoterTip.
**/ **/
@@ -355,21 +415,9 @@ declare module '@polkadot/api/types/consts' {
**/ **/
bondingDuration: EraIndex & AugmentedConst<ApiType>; bondingDuration: EraIndex & AugmentedConst<ApiType>;
/** /**
* The number of blocks before the end of the era from which election submissions are allowed. * Maximum number of nominations per nominator.
*
* Setting this to zero will disable the offchain compute and only on-chain seq-phragmen will
* be used.
*
* This is bounded by being within the last session. Hence, setting it to a value more than the
* length of a session will be pointless.
**/ **/
electionLookahead: BlockNumber & AugmentedConst<ApiType>; maxNominations: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of balancing iterations to run in the offchain submission.
*
* If set to 0, balance_solution will not be executed at all.
**/
maxIterations: u32 & AugmentedConst<ApiType>;
/** /**
* The maximum number of nominators rewarded for each validator. * The maximum number of nominators rewarded for each validator.
* *
@@ -377,10 +425,6 @@ declare module '@polkadot/api/types/consts' {
* their reward. This used to limit the i/o cost for the nominator payout. * their reward. This used to limit the i/o cost for the nominator payout.
**/ **/
maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>; maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
/**
* The threshold of improvement that should be provided for a new solution to be accepted.
**/
minSolutionScoreBump: Perbill & AugmentedConst<ApiType>;
/** /**
* Number of sessions per era. * Number of sessions per era.
**/ **/
@@ -478,7 +522,7 @@ declare module '@polkadot/api/types/consts' {
/** /**
* The treasury's module id, used for deriving its sovereign account ID. * The treasury's module id, used for deriving its sovereign account ID.
**/ **/
moduleId: ModuleId & AugmentedConst<ApiType>; palletId: PalletId & AugmentedConst<ApiType>;
/** /**
* Fraction of a proposal's value that should be bonded in order to place the proposal. * Fraction of a proposal's value that should be bonded in order to place the proposal.
* An accepted proposal gets these back. A rejected proposal does not. * An accepted proposal gets these back. A rejected proposal does not.
@@ -496,7 +540,7 @@ declare module '@polkadot/api/types/consts' {
vesting: { vesting: {
[key: string]: Codec; [key: string]: Codec;
/** /**
* The minimum amount to be transferred to create a new vesting schedule. * The minimum amount transferred to call `vested_transfer`.
**/ **/
minVestedTransfer: BalanceOf & AugmentedConst<ApiType>; minVestedTransfer: BalanceOf & AugmentedConst<ApiType>;
}; };
+130 -73
View File
@@ -7,18 +7,10 @@ declare module '@polkadot/api/types/errors' {
export interface AugmentedErrors<ApiType> { export interface AugmentedErrors<ApiType> {
assets: { assets: {
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
/**
* Transfer amount should be non-zero.
**/
AmountZero: AugmentedError<ApiType>;
/** /**
* Invalid metadata given. * Invalid metadata given.
**/ **/
BadMetadata: AugmentedError<ApiType>; BadMetadata: AugmentedError<ApiType>;
/**
* Some internal state is broken.
**/
BadState: AugmentedError<ApiType>;
/** /**
* Invalid witness data given. * Invalid witness data given.
**/ **/
@@ -47,22 +39,26 @@ declare module '@polkadot/api/types/errors' {
* The signing account has no permission to do the operation. * The signing account has no permission to do the operation.
**/ **/
NoPermission: AugmentedError<ApiType>; NoPermission: AugmentedError<ApiType>;
/**
* No provider reference exists to allow a non-zero balance of a non-self-sufficient asset.
**/
NoProvider: AugmentedError<ApiType>;
/** /**
* A mint operation lead to an overflow. * A mint operation lead to an overflow.
**/ **/
Overflow: AugmentedError<ApiType>; Overflow: AugmentedError<ApiType>;
/** /**
* Attempt to destroy an asset class when non-zombie, reference-bearing accounts exist. * No approval exists that would allow the transfer.
**/ **/
RefsLeft: AugmentedError<ApiType>; Unapproved: AugmentedError<ApiType>;
/**
* Too many zombie accounts in use.
**/
TooManyZombies: AugmentedError<ApiType>;
/** /**
* The given asset ID is unknown. * The given asset ID is unknown.
**/ **/
Unknown: AugmentedError<ApiType>; Unknown: AugmentedError<ApiType>;
/**
* The source account would not survive the transfer and it needs to stay alive.
**/
WouldDie: AugmentedError<ApiType>;
}; };
authorship: { authorship: {
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
@@ -95,6 +91,21 @@ declare module '@polkadot/api/types/errors' {
**/ **/
UnclesAlreadySet: AugmentedError<ApiType>; UnclesAlreadySet: AugmentedError<ApiType>;
}; };
babe: {
[key: string]: AugmentedError<ApiType>;
/**
* A given equivocation report is valid but already previously reported.
**/
DuplicateOffenceReport: AugmentedError<ApiType>;
/**
* An equivocation proof provided as part of an equivocation report is invalid.
**/
InvalidEquivocationProof: AugmentedError<ApiType>;
/**
* A key ownership proof provided as part of an equivocation report is invalid.
**/
InvalidKeyOwnershipProof: AugmentedError<ApiType>;
};
balances: { balances: {
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
/** /**
@@ -585,6 +596,42 @@ declare module '@polkadot/api/types/errors' {
**/ **/
UnableToVote: AugmentedError<ApiType>; UnableToVote: AugmentedError<ApiType>;
}; };
gilt: {
[key: string]: AugmentedError<ApiType>;
/**
* The amount of the bid is less than the minimum allowed.
**/
AmountTooSmall: AugmentedError<ApiType>;
/**
* The queue for the bid's duration is full and the amount bid is too low to get in through
* replacing an existing bid.
**/
BidTooLow: AugmentedError<ApiType>;
/**
* The duration is the bid is greater than the number of queues.
**/
DurationTooBig: AugmentedError<ApiType>;
/**
* The duration of the bid is less than one.
**/
DurationTooSmall: AugmentedError<ApiType>;
/**
* Gilt not yet at expiry date.
**/
NotExpired: AugmentedError<ApiType>;
/**
* The given bid for retraction is not found.
**/
NotFound: AugmentedError<ApiType>;
/**
* Not the owner of the gilt.
**/
NotOwner: AugmentedError<ApiType>;
/**
* Gilt index is unknown.
**/
Unknown: AugmentedError<ApiType>;
};
grandpa: { grandpa: {
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
/** /**
@@ -696,6 +743,64 @@ declare module '@polkadot/api/types/errors' {
**/ **/
InvalidKey: AugmentedError<ApiType>; InvalidKey: AugmentedError<ApiType>;
}; };
indices: {
[key: string]: AugmentedError<ApiType>;
/**
* The index was not available.
**/
InUse: AugmentedError<ApiType>;
/**
* The index was not already assigned.
**/
NotAssigned: AugmentedError<ApiType>;
/**
* The index is assigned to another account.
**/
NotOwner: AugmentedError<ApiType>;
/**
* The source and destination accounts are identical.
**/
NotTransfer: AugmentedError<ApiType>;
/**
* The index is permanent and may not be freed/changed.
**/
Permanent: AugmentedError<ApiType>;
};
lottery: {
[key: string]: AugmentedError<ApiType>;
/**
* A lottery has already ended.
**/
AlreadyEnded: AugmentedError<ApiType>;
/**
* You are already participating in the lottery with this call.
**/
AlreadyParticipating: AugmentedError<ApiType>;
/**
* Failed to encode calls
**/
EncodingFailed: AugmentedError<ApiType>;
/**
* A lottery is already in progress.
**/
InProgress: AugmentedError<ApiType>;
/**
* The call is not valid for an open lottery.
**/
InvalidCall: AugmentedError<ApiType>;
/**
* A lottery has not been configured.
**/
NotConfigured: AugmentedError<ApiType>;
/**
* An overflow has occurred.
**/
Overflow: AugmentedError<ApiType>;
/**
* Too many calls for a single lottery.
**/
TooManyCalls: AugmentedError<ApiType>;
};
multisig: { multisig: {
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
/** /**
@@ -1000,10 +1105,6 @@ declare module '@polkadot/api/types/errors' {
* A nomination target was supplied that was blocked or otherwise not a validator. * A nomination target was supplied that was blocked or otherwise not a validator.
**/ **/
BadTarget: AugmentedError<ApiType>; BadTarget: AugmentedError<ApiType>;
/**
* The call is not allowed at the given time due to restrictions of election period.
**/
CallNotAllowed: AugmentedError<ApiType>;
/** /**
* Duplicate index. * Duplicate index.
**/ **/
@@ -1060,61 +1161,6 @@ declare module '@polkadot/api/types/errors' {
* Can not rebond without unlocking chunks. * Can not rebond without unlocking chunks.
**/ **/
NoUnlockChunk: AugmentedError<ApiType>; NoUnlockChunk: AugmentedError<ApiType>;
/**
* Error while building the assignment type from the compact. This can happen if an index
* is invalid, or if the weights _overflow_.
**/
OffchainElectionBogusCompact: AugmentedError<ApiType>;
/**
* The submitted result has unknown edges that are not among the presented winners.
**/
OffchainElectionBogusEdge: AugmentedError<ApiType>;
/**
* The election size is invalid.
**/
OffchainElectionBogusElectionSize: AugmentedError<ApiType>;
/**
* One of the submitted nominators has an edge to which they have not voted on chain.
**/
OffchainElectionBogusNomination: AugmentedError<ApiType>;
/**
* One of the submitted nominators is not an active nominator on chain.
**/
OffchainElectionBogusNominator: AugmentedError<ApiType>;
/**
* The claimed score does not match with the one computed from the data.
**/
OffchainElectionBogusScore: AugmentedError<ApiType>;
/**
* A self vote must only be originated from a validator to ONLY themselves.
**/
OffchainElectionBogusSelfVote: AugmentedError<ApiType>;
/**
* One of the submitted winners is not an active candidate on chain (index is out of range
* in snapshot).
**/
OffchainElectionBogusWinner: AugmentedError<ApiType>;
/**
* Incorrect number of winners were presented.
**/
OffchainElectionBogusWinnerCount: AugmentedError<ApiType>;
/**
* The submitted result is received out of the open window.
**/
OffchainElectionEarlySubmission: AugmentedError<ApiType>;
/**
* One of the submitted nominators has an edge which is submitted before the last non-zero
* slash of the target.
**/
OffchainElectionSlashedNomination: AugmentedError<ApiType>;
/**
* The submitted result is not as good as the one stored on chain.
**/
OffchainElectionWeakSubmission: AugmentedError<ApiType>;
/**
* The snapshot data of the current window is missing.
**/
SnapshotUnavailable: AugmentedError<ApiType>;
/** /**
* Too many nomination targets supplied. * Too many nomination targets supplied.
**/ **/
@@ -1197,6 +1243,17 @@ declare module '@polkadot/api/types/errors' {
**/ **/
WrongProposalWeight: AugmentedError<ApiType>; WrongProposalWeight: AugmentedError<ApiType>;
}; };
technicalMembership: {
[key: string]: AugmentedError<ApiType>;
/**
* Already a member.
**/
AlreadyMember: AugmentedError<ApiType>;
/**
* Not a member.
**/
NotMember: AugmentedError<ApiType>;
};
tips: { tips: {
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
/** /**
+56 -15
View File
@@ -9,12 +9,13 @@ import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/coll
import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { PropIndex, ReferendumIndex } from '@polkadot/types/interfaces/democracy'; import type { PropIndex, ReferendumIndex } from '@polkadot/types/interfaces/democracy';
import type { VoteThreshold } from '@polkadot/types/interfaces/elections'; import type { VoteThreshold } from '@polkadot/types/interfaces/elections';
import type { ActiveIndex } from '@polkadot/types/interfaces/gilt';
import type { AuthorityList } from '@polkadot/types/interfaces/grandpa'; import type { AuthorityList } from '@polkadot/types/interfaces/grandpa';
import type { RegistrarIndex } from '@polkadot/types/interfaces/identity'; import type { RegistrarIndex } from '@polkadot/types/interfaces/identity';
import type { CallIndex } from '@polkadot/types/interfaces/lottery'; import type { CallIndex } from '@polkadot/types/interfaces/lottery';
import type { Kind, OpaqueTimeSlot } from '@polkadot/types/interfaces/offences'; import type { Kind, OpaqueTimeSlot } from '@polkadot/types/interfaces/offences';
import type { ProxyType } from '@polkadot/types/interfaces/proxy'; import type { ProxyType } from '@polkadot/types/interfaces/proxy';
import type { AccountId, AccountIndex, AssetId, Balance, BlockNumber, CallHash, Hash, PhantomData } from '@polkadot/types/interfaces/runtime'; import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber, CallHash, Hash, PhantomData } from '@polkadot/types/interfaces/runtime';
import type { TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { TaskAddress } from '@polkadot/types/interfaces/scheduler';
import type { IdentificationTuple, SessionIndex } from '@polkadot/types/interfaces/session'; import type { IdentificationTuple, SessionIndex } from '@polkadot/types/interfaces/session';
import type { ElectionCompute, EraIndex } from '@polkadot/types/interfaces/staking'; import type { ElectionCompute, EraIndex } from '@polkadot/types/interfaces/staking';
@@ -27,10 +28,25 @@ declare module '@polkadot/api/types/events' {
export interface AugmentedEvents<ApiType> { export interface AugmentedEvents<ApiType> {
assets: { assets: {
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
/**
* An approval for account `delegate` was cancelled by `owner`.
* \[id, owner, delegate\]
**/
ApprovalCancelled: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId]>;
/**
* (Additional) funds have been approved for transfer to a destination account.
* \[asset_id, source, delegate, amount\]
**/
ApprovedTransfer: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>;
/** /**
* Some asset `asset_id` was frozen. \[asset_id\] * Some asset `asset_id` was frozen. \[asset_id\]
**/ **/
AssetFrozen: AugmentedEvent<ApiType, [AssetId]>; AssetFrozen: AugmentedEvent<ApiType, [AssetId]>;
/**
* An asset has had its attributes changed by the `Force` origin.
* \[id\]
**/
AssetStatusChanged: AugmentedEvent<ApiType, [AssetId]>;
/** /**
* Some asset `asset_id` was thawed. \[asset_id\] * Some asset `asset_id` was thawed. \[asset_id\]
**/ **/
@@ -51,10 +67,6 @@ declare module '@polkadot/api/types/events' {
* Some asset class was force-created. \[asset_id, owner\] * Some asset class was force-created. \[asset_id, owner\]
**/ **/
ForceCreated: AugmentedEvent<ApiType, [AssetId, AccountId]>; ForceCreated: AugmentedEvent<ApiType, [AssetId, AccountId]>;
/**
* Some assets was transferred by an admin. \[asset_id, from, to, amount\]
**/
ForceTransferred: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>;
/** /**
* Some account `who` was frozen. \[asset_id, who\] * Some account `who` was frozen. \[asset_id, who\]
**/ **/
@@ -64,13 +76,13 @@ declare module '@polkadot/api/types/events' {
**/ **/
Issued: AugmentedEvent<ApiType, [AssetId, AccountId, TAssetBalance]>; Issued: AugmentedEvent<ApiType, [AssetId, AccountId, TAssetBalance]>;
/** /**
* The maximum amount of zombies allowed has changed. \[asset_id, max_zombies\] * Metadata has been cleared for an asset. \[asset_id\]
**/ **/
MaxZombiesChanged: AugmentedEvent<ApiType, [AssetId, u32]>; MetadataCleared: AugmentedEvent<ApiType, [AssetId]>;
/** /**
* New metadata has been set for an asset. \[asset_id, name, symbol, decimals\] * New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\]
**/ **/
MetadataSet: AugmentedEvent<ApiType, [AssetId, Bytes, Bytes, u8]>; MetadataSet: AugmentedEvent<ApiType, [AssetId, Bytes, Bytes, u8, bool]>;
/** /**
* The owner changed \[asset_id, owner\] * The owner changed \[asset_id, owner\]
**/ **/
@@ -87,6 +99,12 @@ declare module '@polkadot/api/types/events' {
* Some assets were transferred. \[asset_id, from, to, amount\] * Some assets were transferred. \[asset_id, from, to, amount\]
**/ **/
Transferred: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>; Transferred: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, TAssetBalance]>;
/**
* An `amount` was transferred in its entirety from `owner` to `destination` by
* the approved `delegate`.
* \[id, owner, delegate, destination\]
**/
TransferredApproved: AugmentedEvent<ApiType, [AssetId, AccountId, AccountId, AccountId, TAssetBalance]>;
}; };
balances: { balances: {
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
@@ -415,6 +433,29 @@ declare module '@polkadot/api/types/events' {
**/ **/
SeatHolderSlashed: AugmentedEvent<ApiType, [AccountId, Balance]>; SeatHolderSlashed: AugmentedEvent<ApiType, [AccountId, Balance]>;
}; };
gilt: {
[key: string]: AugmentedEvent<ApiType>;
/**
* A bid was successfully placed.
* \[ who, amount, duration \]
**/
BidPlaced: AugmentedEvent<ApiType, [AccountId, BalanceOf, u32]>;
/**
* A bid was successfully removed (before being accepted as a gilt).
* \[ who, amount, duration \]
**/
BidRetracted: AugmentedEvent<ApiType, [AccountId, BalanceOf, u32]>;
/**
* A bid was accepted as a gilt. The balance may not be released until expiry.
* \[ index, expiry, who, amount \]
**/
GiltIssued: AugmentedEvent<ApiType, [ActiveIndex, BlockNumber, AccountId, BalanceOf]>;
/**
* An expired gilt has been thawed.
* \[ index, who, original_amount, additional_amount \]
**/
GiltThawed: AugmentedEvent<ApiType, [ActiveIndex, AccountId, BalanceOf, BalanceOf]>;
};
grandpa: { grandpa: {
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
/** /**
@@ -728,13 +769,9 @@ declare module '@polkadot/api/types/events' {
**/ **/
Slash: AugmentedEvent<ApiType, [AccountId, Balance]>; Slash: AugmentedEvent<ApiType, [AccountId, Balance]>;
/** /**
* A new solution for the upcoming election has been stored. \[compute\] * A new set of stakers was elected.
**/ **/
SolutionStored: AugmentedEvent<ApiType, [ElectionCompute]>; StakingElection: AugmentedEvent<ApiType, []>;
/**
* A new set of stakers was elected with the given \[compute\].
**/
StakingElection: AugmentedEvent<ApiType, [ElectionCompute]>;
/** /**
* An account has unbonded this amount. \[stash, amount\] * An account has unbonded this amount. \[stash, amount\]
**/ **/
@@ -782,6 +819,10 @@ declare module '@polkadot/api/types/events' {
* A new \[account\] was created. * A new \[account\] was created.
**/ **/
NewAccount: AugmentedEvent<ApiType, [AccountId]>; NewAccount: AugmentedEvent<ApiType, [AccountId]>;
/**
* On on-chain remark happened. \[origin, remark_hash\]
**/
Remarked: AugmentedEvent<ApiType, [AccountId, Hash]>;
}; };
technicalCommittee: { technicalCommittee: {
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
+64 -55
View File
@@ -3,15 +3,16 @@
import type { Bytes, Data, Option, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types'; import type { Bytes, Data, Option, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types';
import type { AnyNumber, ITuple, Observable } from '@polkadot/types/types'; import type { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
import type { AssetBalance, AssetDetails, AssetMetadata } from '@polkadot/types/interfaces/assets'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDetails, AssetMetadata } from '@polkadot/types/interfaces/assets';
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import type { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe'; import type { BabeAuthorityWeight, BabeEpochConfiguration, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
import type { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances'; import type { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
import type { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective'; import type { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { CodeHash, ContractInfo, DeletedContract, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts'; import type { CodeHash, ContractInfo, DeletedContract, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts';
import type { PreimageStatus, PropIndex, Proposal, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy'; import type { PreimageStatus, PropIndex, Proposal, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy';
import type { VoteThreshold } from '@polkadot/types/interfaces/elections'; import type { VoteThreshold } from '@polkadot/types/interfaces/elections';
import type { ActiveGilt, ActiveGiltsTotal, ActiveIndex, GiltBid } from '@polkadot/types/interfaces/gilt';
import type { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa'; import type { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa';
import type { RegistrarInfo, Registration } from '@polkadot/types/interfaces/identity'; import type { RegistrarInfo, Registration } from '@polkadot/types/interfaces/identity';
import type { AuthIndex } from '@polkadot/types/interfaces/imOnline'; import type { AuthIndex } from '@polkadot/types/interfaces/imOnline';
@@ -23,7 +24,7 @@ import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber,
import type { Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import type { Keys, SessionIndex } from '@polkadot/types/interfaces/session'; import type { Keys, SessionIndex } from '@polkadot/types/interfaces/session';
import type { Bid, BidKind, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; import type { Bid, BidKind, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import type { ActiveEraInfo, ElectionPhase, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, ReadySolution, RewardDestination, RoundSnapshot, SeatHolder, SlashingSpans, SolutionOrSnapshotSize, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs, Voter } from '@polkadot/types/interfaces/staking'; import type { ActiveEraInfo, ElectionPhase, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, ReadySolution, RewardDestination, RoundSnapshot, SeatHolder, SlashingSpans, SolutionOrSnapshotSize, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs, Voter } from '@polkadot/types/interfaces/staking';
import type { AccountInfo, ConsumedWeight, DigestOf, EventIndex, EventRecord, LastRuntimeUpgradeInfo, Phase } from '@polkadot/types/interfaces/system'; import type { AccountInfo, ConsumedWeight, DigestOf, EventIndex, EventRecord, LastRuntimeUpgradeInfo, Phase } from '@polkadot/types/interfaces/system';
import type { Bounty, BountyIndex, OpenTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import type { Bounty, BountyIndex, OpenTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
@@ -39,6 +40,11 @@ declare module '@polkadot/api/types/storage' {
* The number of units of assets held by any given account. * The number of units of assets held by any given account.
**/ **/
account: AugmentedQueryDoubleMap<ApiType, (key1: AssetId | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<AssetBalance>, [AssetId, AccountId]> & QueryableStorageEntry<ApiType, [AssetId, AccountId]>; account: AugmentedQueryDoubleMap<ApiType, (key1: AssetId | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<AssetBalance>, [AssetId, AccountId]> & QueryableStorageEntry<ApiType, [AssetId, AccountId]>;
/**
* Approved balance transfers. First balance is the amount approved for transfer. Second
* is the amount of `T::Currency` reserved for storing this.
**/
approvals: AugmentedQueryDoubleMap<ApiType, (key1: AssetId | AnyNumber | Uint8Array, key2: AssetApprovalKey | { owner?: any; delegate?: any } | string | Uint8Array) => Observable<Option<AssetApproval>>, [AssetId, AssetApprovalKey]> & QueryableStorageEntry<ApiType, [AssetId, AssetApprovalKey]>;
/** /**
* Details of an asset. * Details of an asset.
**/ **/
@@ -79,10 +85,22 @@ declare module '@polkadot/api/types/storage' {
* Current slot number. * Current slot number.
**/ **/
currentSlot: AugmentedQuery<ApiType, () => Observable<Slot>, []> & QueryableStorageEntry<ApiType, []>; currentSlot: AugmentedQuery<ApiType, () => Observable<Slot>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The configuration for the current epoch. Should never be `None` as it is initialized in genesis.
**/
epochConfig: AugmentedQuery<ApiType, () => Observable<Option<BabeEpochConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* Current epoch index. * Current epoch index.
**/ **/
epochIndex: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>; epochIndex: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The block numbers when the last and current epoch have started, respectively `N-1` and
* `N`.
* NOTE: We track this is in order to annotate the block number when a given pool of
* entropy was fixed (i.e. it was known to chain observers). Since epochs are defined in
* slots, which may be skipped, the block numbers may not line up with the slot numbers.
**/
epochStart: AugmentedQuery<ApiType, () => Observable<ITuple<[BlockNumber, BlockNumber]>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* The slot at which the first epoch actually started. This is 0 * The slot at which the first epoch actually started. This is 0
* until the first block of the chain. * until the first block of the chain.
@@ -106,13 +124,18 @@ declare module '@polkadot/api/types/storage' {
**/ **/
nextAuthorities: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>>, []> & QueryableStorageEntry<ApiType, []>; nextAuthorities: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* Next epoch configuration, if changed. * The configuration for the next epoch, `None` if the config will not change
* (you can fallback to `EpochConfig` instead in that case).
**/ **/
nextEpochConfig: AugmentedQuery<ApiType, () => Observable<Option<NextConfigDescriptor>>, []> & QueryableStorageEntry<ApiType, []>; nextEpochConfig: AugmentedQuery<ApiType, () => Observable<Option<BabeEpochConfiguration>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* Next epoch randomness. * Next epoch randomness.
**/ **/
nextRandomness: AugmentedQuery<ApiType, () => Observable<Randomness>, []> & QueryableStorageEntry<ApiType, []>; nextRandomness: AugmentedQuery<ApiType, () => Observable<Randomness>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Pending epoch configuration change that will be applied when the next epoch is enacted.
**/
pendingEpochConfigChange: AugmentedQuery<ApiType, () => Observable<Option<NextConfigDescriptor>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* The epoch randomness for the *current* epoch. * The epoch randomness for the *current* epoch.
* *
@@ -396,6 +419,29 @@ declare module '@polkadot/api/types/storage' {
**/ **/
voting: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Voter>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>; voting: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Voter>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
}; };
gilt: {
[key: string]: QueryableStorageEntry<ApiType>;
/**
* The currently active gilts, indexed according to the order of creation.
**/
active: AugmentedQuery<ApiType, (arg: ActiveIndex | AnyNumber | Uint8Array) => Observable<Option<ActiveGilt>>, [ActiveIndex]> & QueryableStorageEntry<ApiType, [ActiveIndex]>;
/**
* Information relating to the gilts currently active.
**/
activeTotal: AugmentedQuery<ApiType, () => Observable<ActiveGiltsTotal>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The queues of bids ready to become gilts. Indexed by duration (in `Period`s).
**/
queues: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<GiltBid>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The totals of items and balances within each queue. Saves a lot of storage reads in the
* case of sparsely packed queues.
*
* The vector is indexed by duration in `Period`s, offset by one, so information on the queue
* whose duration is one `Period` would be storage `0`.
**/
queueTotals: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[u32, BalanceOf]>>>, []> & QueryableStorageEntry<ApiType, []>;
};
grandpa: { grandpa: {
[key: string]: QueryableStorageEntry<ApiType>; [key: string]: QueryableStorageEntry<ApiType>;
/** /**
@@ -464,12 +510,17 @@ declare module '@polkadot/api/types/storage' {
**/ **/
authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>, [SessionIndex, ValidatorId]> & QueryableStorageEntry<ApiType, [SessionIndex, ValidatorId]>; authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>, [SessionIndex, ValidatorId]> & QueryableStorageEntry<ApiType, [SessionIndex, ValidatorId]>;
/** /**
* The block number after which it's ok to send heartbeats in current session. * The block number after which it's ok to send heartbeats in the current
* session.
* *
* At the beginning of each session we set this to a value that should * At the beginning of each session we set this to a value that should fall
* fall roughly in the middle of the session duration. * roughly in the middle of the session duration. The idea is to first wait for
* The idea is to first wait for the validators to produce a block * the validators to produce a block in the current session, so that the
* in the current session, so that the heartbeat later on will not be necessary. * heartbeat later on will not be necessary.
*
* This value will only be used as a fallback if we fail to get a proper session
* progress estimate from `NextSessionRotation`, as those estimates should be
* more accurate then the value we calculate for `HeartbeatAfter`.
**/ **/
heartbeatAfter: AugmentedQuery<ApiType, () => Observable<BlockNumber>, []> & QueryableStorageEntry<ApiType, []>; heartbeatAfter: AugmentedQuery<ApiType, () => Observable<BlockNumber>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
@@ -771,13 +822,6 @@ declare module '@polkadot/api/types/storage' {
* The earliest era for which we have a pending, unapplied slash. * The earliest era for which we have a pending, unapplied slash.
**/ **/
earliestUnappliedSlash: AugmentedQuery<ApiType, () => Observable<Option<EraIndex>>, []> & QueryableStorageEntry<ApiType, []>; earliestUnappliedSlash: AugmentedQuery<ApiType, () => Observable<Option<EraIndex>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Flag to control the execution of the offchain election. When `Open(_)`, we accept
* solutions to be submitted.
*
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
**/
eraElectionStatus: AugmentedQuery<ApiType, () => Observable<ElectionStatus>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* Rewards for the last `HISTORY_DEPTH` eras. * Rewards for the last `HISTORY_DEPTH` eras.
* If reward hasn't been set or has been removed then 0 reward is returned. * If reward hasn't been set or has been removed then 0 reward is returned.
@@ -852,13 +896,6 @@ declare module '@polkadot/api/types/storage' {
* invulnerables) and restricted to testnets. * invulnerables) and restricted to testnets.
**/ **/
invulnerables: AugmentedQuery<ApiType, () => Observable<Vec<AccountId>>, []> & QueryableStorageEntry<ApiType, []>; invulnerables: AugmentedQuery<ApiType, () => Observable<Vec<AccountId>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* True if the current **planned** session is final. Note that this does not take era
* forcing into account.
*
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
**/
isCurrentSessionFinal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* Map from all (unlocked) "controller" accounts to the info regarding the staking. * Map from all (unlocked) "controller" accounts to the info regarding the staking.
**/ **/
@@ -879,20 +916,6 @@ declare module '@polkadot/api/types/storage' {
* Where the reward payment should be made. Keyed by stash. * Where the reward payment should be made. Keyed by stash.
**/ **/
payee: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<RewardDestination>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>; payee: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<RewardDestination>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
/**
* The next validator set. At the end of an era, if this is available (potentially from the
* result of an offchain worker), it is immediately used. Otherwise, the on-chain election
* is executed.
*
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
**/
queuedElected: AugmentedQuery<ApiType, () => Observable<Option<ElectionResult>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The score of the current [`QueuedElected`].
*
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
**/
queuedScore: AugmentedQuery<ApiType, () => Observable<Option<ElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* Slashing spans for stash accounts. * Slashing spans for stash accounts.
**/ **/
@@ -903,20 +926,6 @@ declare module '@polkadot/api/types/storage' {
* The rest of the slashed value is handled by the `Slash`. * The rest of the slashed value is handled by the `Slash`.
**/ **/
slashRewardFraction: AugmentedQuery<ApiType, () => Observable<Perbill>, []> & QueryableStorageEntry<ApiType, []>; slashRewardFraction: AugmentedQuery<ApiType, () => Observable<Perbill>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Snapshot of nominators at the beginning of the current election window. This should only
* have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`.
*
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
**/
snapshotNominators: AugmentedQuery<ApiType, () => Observable<Option<Vec<AccountId>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Snapshot of validators at the beginning of the current election window. This should only
* have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`.
*
* TWO_PHASE_NOTE: should be removed once we switch to multi-phase.
**/
snapshotValidators: AugmentedQuery<ApiType, () => Observable<Option<Vec<AccountId>>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* Records information about the maximum slash of a stash within a slashing span, * Records information about the maximum slash of a stash within a slashing span,
* as well as how much reward has been paid out. * as well as how much reward has been paid out.
@@ -926,7 +935,7 @@ declare module '@polkadot/api/types/storage' {
* True if network has been upgraded to this version. * True if network has been upgraded to this version.
* Storage version of the pallet. * Storage version of the pallet.
* *
* This is set to v5.0.0 for new networks. * This is set to v6.0.0 for new networks.
**/ **/
storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>, []> & QueryableStorageEntry<ApiType, []>; storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
@@ -1022,10 +1031,10 @@ declare module '@polkadot/api/types/storage' {
**/ **/
parentHash: AugmentedQuery<ApiType, () => Observable<Hash>, []> & QueryableStorageEntry<ApiType, []>; parentHash: AugmentedQuery<ApiType, () => Observable<Hash>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* True if we have upgraded so that AccountInfo contains two types of `RefCount`. False * True if we have upgraded so that AccountInfo contains three types of `RefCount`. False
* (default) if not. * (default) if not.
**/ **/
upgradedToDualRefCount: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>; upgradedToTripleRefCount: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* True if we have upgraded so that `type RefCount` is `u32`. False (default) if not. * True if we have upgraded so that `type RefCount` is `u32`. False (default) if not.
**/ **/
+15 -1
View File
@@ -6,6 +6,7 @@ import type { Bytes, HashMap, Json, Null, Option, StorageKey, Text, U256, U64, V
import type { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types'; import type { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { EpochAuthorship } from '@polkadot/types/interfaces/babe'; import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';
import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
@@ -14,6 +15,7 @@ import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth'; import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa'; import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';
import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
@@ -63,6 +65,12 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
**/ **/
epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>; epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;
}; };
beefy: {
/**
* Returns the block most recently finalized by BEEFY, alongside side its justification.
**/
subscribeJustifications: AugmentedRpc<() => Observable<BeefySignedCommitment>>;
};
chain: { chain: {
/** /**
* Get header and body of a relay chain block * Get header and body of a relay chain block
@@ -133,7 +141,7 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
/** /**
* Instructs the manual-seal authorship task to finalize a block * Instructs the manual-seal authorship task to finalize a block
**/ **/
finalizeBlock: AugmentedRpc<(hash: BlockHash | string | Uint8Array, justification?: Justification | string | Uint8Array) => Observable<bool>>; finalizeBlock: AugmentedRpc<(hash: BlockHash | string | Uint8Array, justification?: Justification) => Observable<bool>>;
}; };
eth: { eth: {
/** /**
@@ -315,6 +323,12 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
**/ **/
subscribeJustifications: AugmentedRpc<() => Observable<JustificationNotification>>; subscribeJustifications: AugmentedRpc<() => Observable<JustificationNotification>>;
}; };
mmr: {
/**
* Generate MMR proof for given leaf index.
**/
generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<MmrLeafProof>>;
};
net: { net: {
/** /**
* Returns true if client is actively listening for network connections. Otherwise false. * Returns true if client is actively listening for network connections. Otherwise false.
+254 -119
View File
@@ -3,22 +3,23 @@
import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u16, u32, u64, u8 } from '@polkadot/types'; import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u16, u32, u64, u8 } from '@polkadot/types';
import type { AnyNumber, ITuple } from '@polkadot/types/types'; import type { AnyNumber, ITuple } from '@polkadot/types/types';
import type { TAssetBalance } from '@polkadot/types/interfaces/assets'; import type { AssetDestroyWitness, TAssetBalance } from '@polkadot/types/interfaces/assets';
import type { BabeEquivocationProof } from '@polkadot/types/interfaces/babe'; import type { BabeEquivocationProof, NextConfigDescriptor } from '@polkadot/types/interfaces/babe';
import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective'; import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective';
import type { CodeHash, Schedule } from '@polkadot/types/interfaces/contracts'; import type { CodeHash, Schedule } from '@polkadot/types/interfaces/contracts';
import type { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy'; import type { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy';
import type { Renouncing } from '@polkadot/types/interfaces/elections'; import type { Renouncing } from '@polkadot/types/interfaces/elections';
import type { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics'; import type { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
import type { ActiveIndex } from '@polkadot/types/interfaces/gilt';
import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa'; import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
import type { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity'; import type { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity';
import type { Heartbeat } from '@polkadot/types/interfaces/imOnline'; import type { Heartbeat } from '@polkadot/types/interfaces/imOnline';
import type { ProxyType } from '@polkadot/types/interfaces/proxy'; import type { ProxyType } from '@polkadot/types/interfaces/proxy';
import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime'; import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Perquintill, Weight } from '@polkadot/types/interfaces/runtime';
import type { Period, Priority } from '@polkadot/types/interfaces/scheduler'; import type { Period, Priority } from '@polkadot/types/interfaces/scheduler';
import type { Keys } from '@polkadot/types/interfaces/session'; import type { Keys } from '@polkadot/types/interfaces/session';
import type { SocietyJudgement } from '@polkadot/types/interfaces/society'; import type { SocietyJudgement } from '@polkadot/types/interfaces/society';
import type { CompactAssignments, ElectionScore, ElectionSize, EraIndex, RawSolution, RewardDestination, SolutionOrSnapshotSize, ValidatorIndex, ValidatorPrefs } from '@polkadot/types/interfaces/staking'; import type { EraIndex, RawSolution, RewardDestination, SolutionOrSnapshotSize, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
import type { Key } from '@polkadot/types/interfaces/system'; import type { Key } from '@polkadot/types/interfaces/system';
import type { BountyIndex } from '@polkadot/types/interfaces/treasury'; import type { BountyIndex } from '@polkadot/types/interfaces/treasury';
import type { Timepoint } from '@polkadot/types/interfaces/utility'; import type { Timepoint } from '@polkadot/types/interfaces/utility';
@@ -29,6 +30,29 @@ declare module '@polkadot/api/types/submittable' {
export interface AugmentedSubmittables<ApiType> { export interface AugmentedSubmittables<ApiType> {
assets: { assets: {
[key: string]: SubmittableExtrinsicFunction<ApiType>; [key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Approve an amount of asset for transfer by a delegated third-party account.
*
* Origin must be Signed.
*
* Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account
* for the purpose of holding the approval. If some non-zero amount of assets is already
* approved from signing account to `delegate`, then it is topped up or unreserved to
* meet the right value.
*
* NOTE: The signing account does not need to own `amount` of assets at the point of
* making this call.
*
* - `id`: The identifier of the asset.
* - `delegate`: The account to delegate permission to transfer asset.
* - `amount`: The amount of asset that may be transferred by `delegate`. If there is
* already an approval in place, then this acts additively.
*
* Emits `ApprovedTransfer` on success.
*
* Weight: `O(1)`
**/
approveTransfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, delegate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/** /**
* Reduce the balance of `who` by as much as possible up to `amount` assets of `id`. * Reduce the balance of `who` by as much as possible up to `amount` assets of `id`.
* *
@@ -47,24 +71,50 @@ declare module '@polkadot/api/types/submittable' {
* Modes: Post-existence of `who`; Pre & post Zombie-status of `who`. * Modes: Post-existence of `who`; Pre & post Zombie-status of `who`.
**/ **/
burn: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>; burn: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Cancel all of some asset approved for delegated transfer by a third-party account.
*
* Origin must be Signed and there must be an approval in place between signer and
* `delegate`.
*
* Unreserves any deposit previously reserved by `approve_transfer` for the approval.
*
* - `id`: The identifier of the asset.
* - `delegate`: The account delegated permission to transfer asset.
*
* Emits `ApprovalCancelled` on success.
*
* Weight: `O(1)`
**/
cancelApproval: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, delegate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource]>;
/**
* Clear the metadata for an asset.
*
* Origin must be Signed and the sender should be the Owner of the asset `id`.
*
* Any deposit is freed for the asset owner.
*
* - `id`: The identifier of the asset to clear.
*
* Emits `MetadataCleared`.
*
* Weight: `O(1)`
**/
clearMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>]>;
/** /**
* Issue a new class of fungible assets from a public origin. * Issue a new class of fungible assets from a public origin.
* *
* This new asset class has no assets initially. * This new asset class has no assets initially and its owner is the origin.
* *
* The origin must be Signed and the sender must have sufficient funds free. * The origin must be Signed and the sender must have sufficient funds free.
* *
* Funds of sender are reserved according to the formula: * Funds of sender are reserved by `AssetDeposit`.
* `AssetDepositBase + AssetDepositPerZombie * max_zombies`.
* *
* Parameters: * Parameters:
* - `id`: The identifier of the new asset. This must not be currently in use to identify * - `id`: The identifier of the new asset. This must not be currently in use to identify
* an existing asset. * an existing asset.
* - `owner`: The owner of this class of assets. The owner has full superuser permissions * - `admin`: The admin of this class of assets. The admin is the initial address of each
* over this asset, but may later change and configure the permissions using `transfer_ownership` * member of the asset class's admin team.
* and `set_team`.
* - `max_zombies`: The total number of accounts which may hold assets in this class yet
* have no existential deposit.
* - `min_balance`: The minimum balance of this new asset that any single account must * - `min_balance`: The minimum balance of this new asset that any single account must
* have. If an account's balance is reduced below this, then it collapses to zero. * have. If an account's balance is reduced below this, then it collapses to zero.
* *
@@ -72,20 +122,79 @@ declare module '@polkadot/api/types/submittable' {
* *
* Weight: `O(1)` * Weight: `O(1)`
**/ **/
create: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: u32 | AnyNumber | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, u32, TAssetBalance]>; create: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, TAssetBalance]>;
/** /**
* Destroy a class of fungible assets owned by the sender. * Destroy a class of fungible assets.
* *
* The origin must be Signed and the sender must be the owner of the asset `id`. * The origin must conform to `ForceOrigin` or must be Signed and the sender must be the
* owner of the asset `id`.
* *
* - `id`: The identifier of the asset to be destroyed. This must identify an existing * - `id`: The identifier of the asset to be destroyed. This must identify an existing
* asset. * asset.
* *
* Emits `Destroyed` event when successful. * Emits `Destroyed` event when successful.
* *
* Weight: `O(z)` where `z` is the number of zombie accounts. * Weight: `O(c + p + a)` where:
* - `c = (witness.accounts - witness.sufficients)`
* - `s = witness.sufficients`
* - `a = witness.approvals`
**/ **/
destroy: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, zombiesWitness: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>; destroy: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, witness: AssetDestroyWitness | { accounts?: any; sufficients?: any; approvals?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, AssetDestroyWitness]>;
/**
* Alter the attributes of a given asset.
*
* Origin must be `ForceOrigin`.
*
* - `id`: The identifier of the asset.
* - `owner`: The new Owner of this asset.
* - `issuer`: The new Issuer of this asset.
* - `admin`: The new Admin of this asset.
* - `freezer`: The new Freezer of this asset.
* - `min_balance`: The minimum balance of this new asset that any single account must
* have. If an account's balance is reduced below this, then it collapses to zero.
* - `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient
* value to account for the state bloat associated with its balance storage. If set to
* `true`, then non-zero balances may be stored without a `consumer` reference (and thus
* an ED in the Balances pallet or whatever else is used to control user-account state
* growth).
* - `is_frozen`: Whether this asset class is frozen except for permissioned/admin
* instructions.
*
* Emits `AssetStatusChanged` with the identity of the asset.
*
* Weight: `O(1)`
**/
forceAssetStatus: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array, isSufficient: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, LookupSource, LookupSource, Compact<TAssetBalance>, bool, bool]>;
/**
* Cancel all of some asset approved for delegated transfer by a third-party account.
*
* Origin must be either ForceOrigin or Signed origin with the signer being the Admin
* account of the asset `id`.
*
* Unreserves any deposit previously reserved by `approve_transfer` for the approval.
*
* - `id`: The identifier of the asset.
* - `delegate`: The account delegated permission to transfer asset.
*
* Emits `ApprovalCancelled` on success.
*
* Weight: `O(1)`
**/
forceCancelApproval: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, delegate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource]>;
/**
* Clear the metadata for an asset.
*
* Origin must be ForceOrigin.
*
* Any deposit is returned.
*
* - `id`: The identifier of the asset to clear.
*
* Emits `MetadataCleared`.
*
* Weight: `O(1)`
**/
forceClearMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>]>;
/** /**
* Issue a new class of fungible assets from a privileged origin. * Issue a new class of fungible assets from a privileged origin.
* *
@@ -109,20 +218,24 @@ declare module '@polkadot/api/types/submittable' {
* *
* Weight: `O(1)` * Weight: `O(1)`
**/ **/
forceCreate: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: Compact<u32> | AnyNumber | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<u32>, Compact<TAssetBalance>]>; forceCreate: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, isSufficient: bool | boolean | Uint8Array, minBalance: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, bool, Compact<TAssetBalance>]>;
/** /**
* Destroy a class of fungible assets. * Force the metadata for an asset to some value.
* *
* The origin must conform to `ForceOrigin`. * Origin must be ForceOrigin.
* *
* - `id`: The identifier of the asset to be destroyed. This must identify an existing * Any deposit is left alone.
* asset.
* *
* Emits `Destroyed` event when successful. * - `id`: The identifier of the asset to update.
* - `name`: The user friendly name of this asset. Limited in length by `StringLimit`.
* - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`.
* - `decimals`: The number of decimals this asset uses to represent one unit.
* *
* Weight: `O(1)` * Emits `MetadataSet`.
*
* Weight: `O(N + S)` where N and S are the length of the name and symbol respectively.
**/ **/
forceDestroy: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, zombiesWitness: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>; forceSetMetadata: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, name: Bytes | string | Uint8Array, symbol: Bytes | string | Uint8Array, decimals: u8 | AnyNumber | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Bytes, Bytes, u8, bool]>;
/** /**
* Move some assets from one account to another. * Move some assets from one account to another.
* *
@@ -185,30 +298,9 @@ declare module '@polkadot/api/types/submittable' {
* Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`. * Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`.
**/ **/
mint: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>; mint: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Set the maximum number of zombie accounts for an asset.
*
* Origin must be Signed and the sender should be the Owner of the asset `id`.
*
* Funds of sender are reserved according to the formula:
* `AssetDepositBase + AssetDepositPerZombie * max_zombies` taking into account
* any already reserved funds.
*
* - `id`: The identifier of the asset to update zombie count.
* - `max_zombies`: The new number of zombies allowed for this asset.
*
* Emits `MaxZombiesChanged`.
*
* Weight: `O(1)`
**/
setMaxZombies: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, maxZombies: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, Compact<u32>]>;
/** /**
* Set the metadata for an asset. * Set the metadata for an asset.
* *
* NOTE: There is no `unset_metadata` call. Simply pass an empty name, symbol,
* and 0 decimals to this function to remove the metadata of an asset and
* return your deposit.
*
* Origin must be Signed and the sender should be the Owner of the asset `id`. * Origin must be Signed and the sender should be the Owner of the asset `id`.
* *
* Funds of sender are reserved according to the formula: * Funds of sender are reserved according to the formula:
@@ -220,7 +312,7 @@ declare module '@polkadot/api/types/submittable' {
* - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. * - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`.
* - `decimals`: The number of decimals this asset uses to represent one unit. * - `decimals`: The number of decimals this asset uses to represent one unit.
* *
* Emits `MaxZombiesChanged`. * Emits `MetadataSet`.
* *
* Weight: `O(1)` * Weight: `O(1)`
**/ **/
@@ -286,12 +378,54 @@ declare module '@polkadot/api/types/submittable' {
* of sender; Account pre-existence of `target`. * of sender; Account pre-existence of `target`.
**/ **/
transfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>; transfer: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/**
* Transfer some asset balance from a previously delegated account to some third-party
* account.
*
* Origin must be Signed and there must be an approval in place by the `owner` to the
* signer.
*
* If the entire amount approved for transfer is transferred, then any deposit previously
* reserved by `approve_transfer` is unreserved.
*
* - `id`: The identifier of the asset.
* - `owner`: The account which previously approved for a transfer of at least `amount` and
* from which the asset balance will be withdrawn.
* - `destination`: The account to which the asset balance of `amount` will be transferred.
* - `amount`: The amount of assets to transfer.
*
* Emits `TransferredApproved` on success.
*
* Weight: `O(1)`
**/
transferApproved: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, destination: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, LookupSource, Compact<TAssetBalance>]>;
/**
* Move some assets from the sender account to another, keeping the sender account alive.
*
* Origin must be Signed.
*
* - `id`: The identifier of the asset to have some amount transferred.
* - `target`: The account to be credited.
* - `amount`: The amount by which the sender's balance of assets should be reduced and
* `target`'s balance increased. The amount actually transferred may be slightly greater in
* the case that the transfer would otherwise take the sender balance above zero but below
* the minimum balance. Must be greater than zero.
*
* Emits `Transferred` with the actual amount transferred. If this takes the source balance
* to below the minimum for the asset, then the amount transferred is increased to take it
* to zero.
*
* Weight: `O(1)`
* Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status
* of sender; Account pre-existence of `target`.
**/
transferKeepAlive: AugmentedSubmittable<(id: Compact<AssetId> | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<TAssetBalance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<AssetId>, LookupSource, Compact<TAssetBalance>]>;
/** /**
* Change the Owner of an asset. * Change the Owner of an asset.
* *
* Origin must be Signed and the sender should be the Owner of the asset `id`. * Origin must be Signed and the sender should be the Owner of the asset `id`.
* *
* - `id`: The identifier of the asset to be frozen. * - `id`: The identifier of the asset.
* - `owner`: The new Owner of this asset. * - `owner`: The new Owner of this asset.
* *
* Emits `OwnerChanged`. * Emits `OwnerChanged`.
@@ -309,6 +443,13 @@ declare module '@polkadot/api/types/submittable' {
}; };
babe: { babe: {
[key: string]: SubmittableExtrinsicFunction<ApiType>; [key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Plan an epoch config change. The epoch config change is recorded and will be enacted on
* the next call to `enact_epoch_change`. The config will be activated one epoch after.
* Multiple calls to this method will replace any existing planned config change that had
* not been enacted yet.
**/
planConfigChange: AugmentedSubmittable<(config: NextConfigDescriptor | { V0: any } | { V1: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NextConfigDescriptor]>;
/** /**
* Report authority equivocation/misbehavior. This method will verify * Report authority equivocation/misbehavior. This method will verify
* the equivocation proof and validate the given key ownership proof * the equivocation proof and validate the given key ownership proof
@@ -571,7 +712,7 @@ declare module '@polkadot/api/types/submittable' {
* * `gas_limit`: The gas limit enforced when executing the constructor. * * `gas_limit`: The gas limit enforced when executing the constructor.
* * `code`: The contract code to deploy in raw bytes. * * `code`: The contract code to deploy in raw bytes.
* * `data`: The input data to pass to the contract constructor. * * `data`: The input data to pass to the contract constructor.
* * `salt`: Used for the address derivation. See [`Self::contract_address`]. * * `salt`: Used for the address derivation. See [`Pallet::contract_address`].
* *
* Instantiation is executed as follows: * Instantiation is executed as follows:
* *
@@ -586,7 +727,10 @@ declare module '@polkadot/api/types/submittable' {
/** /**
* Updates the schedule for metering contracts. * Updates the schedule for metering contracts.
* *
* The schedule must have a greater version than the stored schedule. * The schedule's version cannot be less than the version of the stored schedule.
* If a schedule does not change the instruction weights the version does not
* need to be increased. Therefore we allow storing a schedule that has the same
* version as the stored one.
**/ **/
updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; enablePrintln?: any; limits?: any; instructionWeights?: any; hostFnWeights?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Schedule]>; updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; enablePrintln?: any; limits?: any; instructionWeights?: any; hostFnWeights?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Schedule]>;
}; };
@@ -1187,6 +1331,54 @@ declare module '@polkadot/api/types/submittable' {
**/ **/
vote: AugmentedSubmittable<(votes: Vec<AccountId> | (AccountId | string | Uint8Array)[], value: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId>, Compact<BalanceOf>]>; vote: AugmentedSubmittable<(votes: Vec<AccountId> | (AccountId | string | Uint8Array)[], value: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId>, Compact<BalanceOf>]>;
}; };
gilt: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
/**
* Place a bid for a gilt to be issued.
*
* Origin must be Signed, and account must have at least `amount` in free balance.
*
* - `amount`: The amount of the bid; these funds will be reserved. If the bid is
* successfully elevated into an issued gilt, then these funds will continue to be
* reserved until the gilt expires. Must be at least `MinFreeze`.
* - `duration`: The number of periods for which the funds will be locked if the gilt is
* issued. It will expire only after this period has elapsed after the point of issuance.
* Must be greater than 1 and no more than `QueueCount`.
*
* Complexities:
* - `Queues[duration].len()` (just take max).
**/
placeBid: AugmentedSubmittable<(amount: Compact<BalanceOf> | AnyNumber | Uint8Array, duration: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BalanceOf>, u32]>;
/**
* Retract a previously placed bid.
*
* Origin must be Signed, and the account should have previously issued a still-active bid
* of `amount` for `duration`.
*
* - `amount`: The amount of the previous bid.
* - `duration`: The duration of the previous bid.
**/
retractBid: AugmentedSubmittable<(amount: Compact<BalanceOf> | AnyNumber | Uint8Array, duration: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BalanceOf>, u32]>;
/**
* Set target proportion of gilt-funds.
*
* Origin must be `AdminOrigin`.
*
* - `target`: The target proportion of effective issued funds that should be under gilts
* at any one time.
**/
setTarget: AugmentedSubmittable<(target: Compact<Perquintill> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<Perquintill>]>;
/**
* Remove an active but expired gilt. Reserved funds under gilt are freed and balance is
* adjusted to ensure that the funds grow or shrink to maintain the equivalent proportion
* of effective total issued funds.
*
* Origin must be Signed and the account must be the owner of the gilt of the given index.
*
* - `index`: The index of the gilt to be thawed.
**/
thaw: AugmentedSubmittable<(index: Compact<ActiveIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<ActiveIndex>]>;
};
grandpa: { grandpa: {
[key: string]: SubmittableExtrinsicFunction<ApiType>; [key: string]: SubmittableExtrinsicFunction<ApiType>;
/** /**
@@ -1905,7 +2097,7 @@ declare module '@polkadot/api/types/submittable' {
**/ **/
proxy: AugmentedSubmittable<(real: AccountId | string | Uint8Array, forceProxyType: Option<ProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId, Option<ProxyType>, Call]>; proxy: AugmentedSubmittable<(real: AccountId | string | Uint8Array, forceProxyType: Option<ProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId, Option<ProxyType>, Call]>;
/** /**
* Dispatch the given `call` from an account that the sender is authorised for through * Dispatch the given `call` from an account that the sender is authorized for through
* `add_proxy`. * `add_proxy`.
* *
* Removes any corresponding announcement(s). * Removes any corresponding announcement(s).
@@ -2962,70 +3154,6 @@ declare module '@polkadot/api/types/submittable' {
* # </weight> * # </weight>
**/ **/
setValidatorCount: AugmentedSubmittable<(updated: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>; setValidatorCount: AugmentedSubmittable<(updated: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
/**
* Submit an election result to the chain. If the solution:
*
* 1. is valid.
* 2. has a better score than a potentially existing solution on chain.
*
* then, it will be _put_ on chain.
*
* A solution consists of two pieces of data:
*
* 1. `winners`: a flat vector of all the winners of the round.
* 2. `assignments`: the compact version of an assignment vector that encodes the edge
* weights.
*
* Both of which may be computed using _phragmen_, or any other algorithm.
*
* Additionally, the submitter must provide:
*
* - The `score` that they claim their solution has.
*
* Both validators and nominators will be represented by indices in the solution. The
* indices should respect the corresponding types ([`ValidatorIndex`] and
* [`NominatorIndex`]). Moreover, they should be valid when used to index into
* [`SnapshotValidators`] and [`SnapshotNominators`]. Any invalid index will cause the
* solution to be rejected. These two storage items are set during the election window and
* may be used to determine the indices.
*
* A solution is valid if:
*
* 0. It is submitted when [`EraElectionStatus`] is `Open`.
* 1. Its claimed score is equal to the score computed on-chain.
* 2. Presents the correct number of winners.
* 3. All indexes must be value according to the snapshot vectors. All edge values must
* also be correct and should not overflow the granularity of the ratio type (i.e. 256
* or billion).
* 4. For each edge, all targets are actually nominated by the voter.
* 5. Has correct self-votes.
*
* A solutions score is consisted of 3 parameters:
*
* 1. `min { support.total }` for each support of a winner. This value should be maximized.
* 2. `sum { support.total }` for each support of a winner. This value should be minimized.
* 3. `sum { support.total^2 }` for each support of a winner. This value should be
* minimized (to ensure less variance)
*
* # <weight>
* The transaction is assumed to be the longest path, a better solution.
* - Initial solution is almost the same.
* - Worse solution is retraced in pre-dispatch-checks which sets its own weight.
* # </weight>
**/
submitElectionSolution: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<ValidatorIndex>, CompactAssignments, ElectionScore, EraIndex, ElectionSize]>;
/**
* Unsigned version of `submit_election_solution`.
*
* Note that this must pass the [`ValidateUnsigned`] check which only allows transactions
* from the local node to be included. In other words, only the block author can include a
* transaction in the block.
*
* # <weight>
* See [`submit_election_solution`].
* # </weight>
**/
submitElectionSolutionUnsigned: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<ValidatorIndex>, CompactAssignments, ElectionScore, EraIndex, ElectionSize]>;
/** /**
* Schedule a portion of the stash to be unlocked ready for transfer out after the bond * Schedule a portion of the stash to be unlocked ready for transfer out after the bond
* period ends. If this leaves an amount actively bonded less than * period ends. If this leaves an amount actively bonded less than
@@ -3207,11 +3335,18 @@ declare module '@polkadot/api/types/submittable' {
* *
* # <weight> * # <weight>
* - `O(1)` * - `O(1)`
* - Base Weight: 0.665 µs, independent of remark length.
* - No DB operations.
* # </weight> * # </weight>
**/ **/
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>; remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Make some on-chain remark and emit event.
*
* # <weight>
* - `O(b)` where b is the length of the remark.
* - 1 event.
* # </weight>
**/
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/** /**
* Set the new changes trie configuration. * Set the new changes trie configuration.
* *
@@ -3739,7 +3874,7 @@ declare module '@polkadot/api/types/submittable' {
* Unlock any vested funds of the sender account. * Unlock any vested funds of the sender account.
* *
* The dispatch origin for this call must be _Signed_ and the sender must have funds still * The dispatch origin for this call must be _Signed_ and the sender must have funds still
* locked under this module. * locked under this pallet.
* *
* Emits either `VestingCompleted` or `VestingUpdated`. * Emits either `VestingCompleted` or `VestingUpdated`.
* *
@@ -3757,7 +3892,7 @@ declare module '@polkadot/api/types/submittable' {
* The dispatch origin for this call must be _Signed_. * The dispatch origin for this call must be _Signed_.
* *
* - `target`: The account whose vested funds should be unlocked. Must have funds still * - `target`: The account whose vested funds should be unlocked. Must have funds still
* locked under this module. * locked under this pallet.
* *
* Emits either `VestingCompleted` or `VestingUpdated`. * Emits either `VestingCompleted` or `VestingUpdated`.
* *
+6 -4
View File
@@ -79,7 +79,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
protected _rpc?: DecoratedRpc<ApiType, RpcInterface>; protected _rpc?: DecoratedRpc<ApiType, RpcInterface>;
protected _rpcCore: RpcCore; protected _rpcCore: RpcCore & RpcInterface;
protected _runtimeChain?: Text; protected _runtimeChain?: Text;
@@ -136,6 +136,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
this.#instanceId = `${++instanceCounter}`; this.#instanceId = `${++instanceCounter}`;
this.#registry = options.source?.registry || options.registry || new TypeRegistry(); this.#registry = options.source?.registry || options.registry || new TypeRegistry();
this._rx.registry = this.#registry;
const thisProvider = options.source const thisProvider = options.source
? options.source._rpcCore.provider.clone() ? options.source._rpcCore.provider.clone()
@@ -144,10 +145,11 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
this._decorateMethod = decorateMethod; this._decorateMethod = decorateMethod;
this._options = options; this._options = options;
this._type = type; this._type = type;
this._rpcCore = new RpcCore(this.#instanceId, this.#registry, thisProvider, this._options.rpc);
// The RPC interface decorates the known interfaces on init
this._rpcCore = new RpcCore(this.#instanceId, this.#registry, thisProvider, this._options.rpc) as (RpcCore & RpcInterface);
this._isConnected = new BehaviorSubject(this._rpcCore.provider.isConnected); this._isConnected = new BehaviorSubject(this._rpcCore.provider.isConnected);
this._rx.hasSubscriptions = this._rpcCore.provider.hasSubscriptions; this._rx.hasSubscriptions = this._rpcCore.provider.hasSubscriptions;
this._rx.registry = this.#registry;
} }
/** /**
@@ -281,7 +283,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
}); });
} }
protected _decorateRpc<ApiType extends ApiTypes> (rpc: RpcCore, decorateMethod: DecorateMethod<ApiType>, input: Partial<DecoratedRpc<ApiType, RpcInterface>> = {}): DecoratedRpc<ApiType, RpcInterface> { protected _decorateRpc<ApiType extends ApiTypes> (rpc: RpcCore & RpcInterface, decorateMethod: DecorateMethod<ApiType>, input: Partial<DecoratedRpc<ApiType, RpcInterface>> = {}): DecoratedRpc<ApiType, RpcInterface> {
return rpc.sections.reduce((out, _sectionName): DecoratedRpc<ApiType, RpcInterface> => { return rpc.sections.reduce((out, _sectionName): DecoratedRpc<ApiType, RpcInterface> => {
const sectionName = _sectionName as keyof DecoratedRpc<ApiType, RpcInterface>; const sectionName = _sectionName as keyof DecoratedRpc<ApiType, RpcInterface>;
+3 -3
View File
@@ -18,10 +18,10 @@ import { cryptoWaitReady } from '@polkadot/util-crypto';
import { of } from '@polkadot/x-rxjs'; import { of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators'; import { map, switchMap } from '@polkadot/x-rxjs/operators';
import { detectedCapabilities } from './capabilities';
import { Decorate } from './Decorate'; import { Decorate } from './Decorate';
import { detectedCapabilities } from './util';
const KEEPALIVE_INTERVAL = 15000; const KEEPALIVE_INTERVAL = 10000;
const DEFAULT_BLOCKNUMBER = { unwrap: () => BN_ZERO }; const DEFAULT_BLOCKNUMBER = { unwrap: () => BN_ZERO };
const l = logger('api/init'); const l = logger('api/init');
@@ -321,7 +321,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
} }
this.#healthTimer = setInterval((): void => { this.#healthTimer = setInterval((): void => {
this._rpcCore.system.health().toPromise().catch(() => null); this._rpcCore.system.health().toPromise().catch((error) => l.warn(`Health keepalive check failed: ${(error as Error).message}`));
}, KEEPALIVE_INTERVAL); }, KEEPALIVE_INTERVAL);
} catch (_error) { } catch (_error) {
const error = new Error(`FATAL: Unable to initialize the API: ${(_error as Error).message}`); const error = new Error(`FATAL: Unable to initialize the API: ${(_error as Error).message}`);
+181
View File
@@ -0,0 +1,181 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { bool, Raw, u32 } from '@polkadot/types';
import type { Releases } from '@polkadot/types/interfaces';
import type { InterfaceTypes } from '@polkadot/types/types';
import { assert, compactFromU8a } from '@polkadot/util';
import { combineLatest, Observable, of } from '@polkadot/x-rxjs';
import { map, take } from '@polkadot/x-rxjs/operators';
// the order and types needs to map with the all array setup below
type ExtractedQ = [bool | null, bool | null, bool | null, Releases | null];
type ExtractedR = [Raw | null];
type ExtractedC = [u32 | null, u32 | null];
type DetectedKeys = keyof Pick<InterfaceTypes, 'AccountInfo' | 'ValidatorPrefs'>;
type DetectedValues = keyof InterfaceTypes;
interface DetectedTypes extends Record<DetectedKeys, DetectedValues> {
AccountInfo: 'AccountInfoWithRefCount' | 'AccountInfoWithDualRefCount' | 'AccountInfoWithTripleRefCount',
Keys: 'SessionKeys1' | 'SessionKeys2' | 'SessionKeys3' | 'SessionKeys4' | 'SessionKeys5' | 'SessionKeys6' | 'SessionKeys7' | 'SessionKeys8' | 'SessionKeys9' | 'SessionKeys10';
RefCount: 'u8' | 'u32',
SlotRange: Record<string, unknown>;
ValidatorPrefs: 'ValidatorPrefsWithBlocked' | 'ValidatorPrefsWithCommission';
WinningData: string;
}
interface AvailableMap<T> {
filtered: T[];
included: boolean[];
original: T[];
}
interface Constants {
accountIdLength: number;
}
const NumberMap = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'];
function mapCapabilities ({ accountIdLength }: Constants, [leasePeriodsPerSlot, slotRangeCount]: ExtractedC, [systemRefcount32, systemRefcountDual, systemRefcountTriple, stakingVersion]: ExtractedQ, [keys]: ExtractedR): Partial<DetectedTypes> {
const types: Partial<DetectedTypes> = {};
// AccountInfo
if (systemRefcountTriple && systemRefcountTriple.isTrue) {
types.AccountInfo = 'AccountInfoWithTripleRefCount';
} else if (systemRefcountDual && systemRefcountDual.isTrue) {
types.AccountInfo = 'AccountInfoWithDualRefCount';
} else {
types.AccountInfo = 'AccountInfoWithRefCount';
if (!systemRefcount32 || systemRefcount32.isFalse) {
types.RefCount = 'u8';
}
}
// ValidatorPrefs
if (stakingVersion) {
if (stakingVersion.index >= 4) { // v1 = index 0, V5 = index 4
types.ValidatorPrefs = 'ValidatorPrefsWithBlocked';
} else {
types.ValidatorPrefs = 'ValidatorPrefsWithCommission';
}
}
// Keys
if (keys) {
try {
const [offset, numItems] = compactFromU8a(keys);
const tupleLength = (keys.length - offset) / numItems.toNumber();
const numIds = tupleLength / accountIdLength;
const numIdsRound = Math.floor(numIds);
assert(numIds >= 2 && numIds <= 11, `Detected ${numIds} in Keys, should be >= 2 and <= 11`);
if (numIdsRound !== numIds) {
// Beefy?
if ((((numIdsRound - 1) * accountIdLength) + 33) === tupleLength) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
types.Keys = `SessionKeys${numIdsRound - 1}B`;
} else {
assert(false, `Expected integer number of keys, found ${numIds.toFixed(2)}`);
}
} else {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
types.Keys = `SessionKeys${numIds - 1}`;
}
} catch (error) {
console.error(error);
}
}
// auctions
if (leasePeriodsPerSlot && slotRangeCount) {
const _enum: string[] = [];
for (let i = 0; leasePeriodsPerSlot.gtn(i); i++) {
for (let j = i; leasePeriodsPerSlot.gtn(j); j++) {
_enum.push(`${NumberMap[i]}${NumberMap[j]}`);
}
}
types.SlotRange = { _enum };
types.WinningData = `[WinningDataEntry; ${slotRangeCount.toNumber()}]`;
}
return types;
}
function filterEntries <T> (original: T[]): AvailableMap<T> {
const included = original.map((c) => !!c);
const filtered = original.filter((_, index) => included[index]);
return { filtered, included, original };
}
function extractResults <R, T = unknown> (results: unknown[], map: AvailableMap<T>): R {
let offset = -1;
return map.included.map((isIncluded) =>
isIncluded
? results[++offset]
: null
) as unknown as R;
}
/**
* @description Query the chain for the specific capabilities
*/
export function detectedCapabilities (api: ApiInterfaceRx, blockHash?: Uint8Array | string | undefined): Observable<Partial<DetectedTypes>> {
const consts = filterEntries([
api.consts.auctions?.leasePeriodsPerSlot,
api.consts.auctions?.slotRangeCount
]);
const queries = filterEntries([
api.query.system?.upgradedToU32RefCount,
api.query.system?.upgradedToDualRefCount,
api.query.system?.upgradedToTripleRefCount,
api.query.staking?.storageVersion
]);
const raws = filterEntries([
api.query.session?.queuedKeys
]);
return combineLatest([
consts.filtered.length
? blockHash
// FIXME consts don't have .at as of yet...
? of([])
: of(consts.filtered)
: of([]),
queries.filtered.length
? blockHash
? combineLatest(queries.filtered.map((c) => c.at(blockHash)))
: api.queryMulti(queries.filtered)
: of([]),
raws.filtered.length
? blockHash
? combineLatest(raws.filtered.map((k) => api.rpc.state.getStorage.raw(k.key(), blockHash)))
: combineLatest(raws.filtered.map((k) => api.rpc.state.getStorage.raw(k.key())))
: of([])
]).pipe(
map(([cResults, qResults, rResults]): Partial<DetectedTypes> =>
mapCapabilities(
{
accountIdLength: api.registry.createType('AccountId').encodedLength
},
extractResults<ExtractedC>(cResults, consts),
extractResults<ExtractedQ>(qResults, queries),
extractResults<ExtractedR>(rResults, raws)
)
),
take(1)
);
}
-82
View File
@@ -1,82 +0,0 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { bool } from '@polkadot/types';
import type { Releases } from '@polkadot/types/interfaces';
import type { InterfaceTypes } from '@polkadot/types/types';
import { combineLatest, Observable, of } from '@polkadot/x-rxjs';
import { map, take } from '@polkadot/x-rxjs/operators';
// the order and types needs to map with the all array setup below
type Extracted = [bool | null, bool | null, bool | null, Releases | null];
type DetectedKeys = keyof Pick<InterfaceTypes, 'AccountInfo' | 'ValidatorPrefs'>;
type DetectedValues = keyof InterfaceTypes;
interface DetectedTypes extends Record<DetectedKeys, DetectedValues> {
AccountInfo: 'AccountInfoWithRefCount' | 'AccountInfoWithDualRefCount' | 'AccountInfoWithTripleRefCount',
RefCount: 'u8' | 'u32',
ValidatorPrefs: 'ValidatorPrefsWithBlocked' | 'ValidatorPrefsWithCommission';
}
function mapCapabilities ([systemRefcount32, systemRefcountDual, systemRefcountTriple, stakingVersion]: Extracted): Partial<DetectedTypes> {
const types: Partial<DetectedTypes> = {};
// AccountInfo
if (systemRefcountTriple && systemRefcountTriple.isTrue) {
types.AccountInfo = 'AccountInfoWithTripleRefCount';
} else if (systemRefcountDual && systemRefcountDual.isTrue) {
types.AccountInfo = 'AccountInfoWithDualRefCount';
} else {
types.AccountInfo = 'AccountInfoWithRefCount';
if (!systemRefcount32 || systemRefcount32.isFalse) {
types.RefCount = 'u8';
}
}
// ValidatorPrefs
if (stakingVersion) {
if (stakingVersion.index >= 4) { // v1 = index 0, V5 = index 4
types.ValidatorPrefs = 'ValidatorPrefsWithBlocked';
} else {
types.ValidatorPrefs = 'ValidatorPrefsWithCommission';
}
}
return types;
}
/**
* @description Query the chain for the specific capabilities
*/
export function detectedCapabilities (api: ApiInterfaceRx, blockHash?: Uint8Array | string | undefined): Observable<Partial<DetectedTypes>> {
const all = [
api.query.system?.upgradedToU32RefCount,
api.query.system?.upgradedToDualRefCount,
api.query.system?.upgradedToTripleRefCount,
api.query.staking?.storageVersion
];
const included = all.map((c) => !!c);
const filtered = all.filter((_, index) => included[index]);
return (
filtered.length
? blockHash
? combineLatest(filtered.map((c) => c.at(blockHash)))
: api.queryMulti(filtered)
: of([])
).pipe(
map((results): Partial<DetectedTypes> => {
let offset = -1;
return mapCapabilities(
included.map((isIncluded) => isIncluded ? results[++offset] : null) as Extracted
);
}),
take(1)
);
}
+1 -1
View File
@@ -3,12 +3,12 @@
// Simple non-runnable checks to test type definitions in the editor itself // Simple non-runnable checks to test type definitions in the editor itself
import type { HeaderExtended } from '@polkadot/api-derive/types';
import type { StorageKey } from '@polkadot/types'; import type { StorageKey } from '@polkadot/types';
import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces'; import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces';
import type { AnyTuple, IExtrinsic, IMethod } from '@polkadot/types/types'; import type { AnyTuple, IExtrinsic, IMethod } from '@polkadot/types/types';
import { ApiPromise } from '@polkadot/api'; import { ApiPromise } from '@polkadot/api';
import { HeaderExtended } from '@polkadot/api-derive';
import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs'; import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs';
import { createTypeUnsafe, TypeRegistry } from '@polkadot/types/create'; import { createTypeUnsafe, TypeRegistry } from '@polkadot/types/create';
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api', version: '4.0.2' }; export const packageInfo = { name: '@polkadot/api', version: '4.6.1' };
+18 -10
View File
@@ -211,7 +211,19 @@ export class ApiPromise extends ApiBase<'promise'> {
* ``` * ```
*/ */
public static create (options?: ApiOptions): Promise<ApiPromise> { public static create (options?: ApiOptions): Promise<ApiPromise> {
return new ApiPromise(options).isReady; const instance = new ApiPromise(options);
if (options && options.throwOnConnect) {
return instance.isReadyOrError;
}
// Swallow any rejections on isReadyOrError
// (in Node 15.x this creates issues, when not being looked at)
instance.isReadyOrError.catch(() => {
// ignore
});
return instance.isReady;
} }
/** /**
@@ -235,18 +247,14 @@ export class ApiPromise extends ApiBase<'promise'> {
super(options, 'promise', decorateMethod); super(options, 'promise', decorateMethod);
this.#isReadyPromise = new Promise((resolve): void => { this.#isReadyPromise = new Promise((resolve): void => {
super.once('ready', (): void => { super.once('ready', () => resolve(this));
resolve(this);
});
}); });
this.#isReadyOrErrorPromise = new Promise((resolve, reject): void => { this.#isReadyOrErrorPromise = new Promise((resolve, reject): void => {
super.once('ready', (): void => { const tracker = promiseTracker(resolve, reject);
resolve(this);
}); super.once('ready', () => tracker.resolve(this));
super.once('error', (e): void => { super.once('error', (e) => tracker.reject(e));
reject(e);
});
}); });
} }
+5 -1
View File
@@ -32,14 +32,17 @@ export class SubmittableResult implements ISubmittableResult {
public readonly dispatchInfo?: DispatchInfo; public readonly dispatchInfo?: DispatchInfo;
public readonly internalError?: Error;
public readonly events: EventRecord[]; public readonly events: EventRecord[];
public readonly status: ExtrinsicStatus; public readonly status: ExtrinsicStatus;
constructor ({ dispatchError, dispatchInfo, events, status }: SubmittableResultValue) { constructor ({ dispatchError, dispatchInfo, events, internalError, status }: SubmittableResultValue) {
this.dispatchError = dispatchError || extractError(events); this.dispatchError = dispatchError || extractError(events);
this.dispatchInfo = dispatchInfo || extractInfo(events); this.dispatchInfo = dispatchInfo || extractInfo(events);
this.events = events || []; this.events = events || [];
this.internalError = internalError;
this.status = status; this.status = status;
} }
@@ -85,6 +88,7 @@ export class SubmittableResult implements ISubmittableResult {
dispatchError: this.dispatchError?.toHuman(), dispatchError: this.dispatchError?.toHuman(),
dispatchInfo: this.dispatchInfo?.toHuman(), dispatchInfo: this.dispatchInfo?.toHuman(),
events: this.events.map((event) => event.toHuman(isExtended)), events: this.events.map((event) => event.toHuman(isExtended)),
internalError: this.internalError?.message.toString(),
status: this.status.toHuman(isExtended) status: this.status.toHuman(isExtended)
}; };
} }
+4 -1
View File
@@ -11,7 +11,7 @@ import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, Submittable
import { assert, isBn, isFunction, isNumber, isString, isU8a } from '@polkadot/util'; import { assert, isBn, isFunction, isNumber, isString, isU8a } from '@polkadot/util';
import { of } from '@polkadot/x-rxjs'; import { of } from '@polkadot/x-rxjs';
import { first, map, mapTo, mergeMap, switchMap, tap } from '@polkadot/x-rxjs/operators'; import { catchError, first, map, mapTo, mergeMap, switchMap, tap } from '@polkadot/x-rxjs/operators';
import { ApiBase } from '../base'; import { ApiBase } from '../base';
import { filterEvents, isKeyringPair } from '../util'; import { filterEvents, isKeyringPair } from '../util';
@@ -242,6 +242,9 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
events: filterEvents(hash, block, events, status), events: filterEvents(hash, block, events, status),
status status
})) }))
),
catchError((internalError: Error) =>
of(this.#transformResult(new SubmittableResult({ internalError, status })))
) )
); );
} }
+1
View File
@@ -10,6 +10,7 @@ export interface SubmittableResultValue {
dispatchError?: DispatchError; dispatchError?: DispatchError;
dispatchInfo?: DispatchInfo; dispatchInfo?: DispatchInfo;
events?: EventRecord[]; events?: EventRecord[];
internalError?: Error;
status: ExtrinsicStatus; status: ExtrinsicStatus;
} }
+4
View File
@@ -69,6 +69,10 @@ export interface ApiOptions extends RegisteredTypes {
* @description The source object to use for runtime information (only used when cloning) * @description The source object to use for runtime information (only used when cloning)
*/ */
source?: ApiBase<any>; source?: ApiBase<any>;
/**
* @description Throws an error when the initial connection fails (same as isReadyOrError)
*/
throwOnConnect?: boolean;
} }
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic // A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
+7 -7
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/metadata", "name": "@polkadot/metadata",
"version": "4.0.2", "version": "4.6.1",
"type": "module", "type": "module",
"description": "Helpers to extract information from runtime metadata", "description": "Helpers to extract information from runtime metadata",
"main": "index.js", "main": "index.js",
@@ -16,14 +16,14 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/types": "4.0.2", "@polkadot/types": "4.6.1",
"@polkadot/types-known": "4.0.2", "@polkadot/types-known": "4.6.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.2.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.2.1",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5" "@polkadot/keyring": "^6.2.1"
} }
} }
+19 -19
View File
@@ -33,18 +33,18 @@ export class MetadataVersioned extends Struct {
}, value as Map<unknown, unknown>); }, value as Map<unknown, unknown>);
} }
private _assertVersion (version: number): boolean { #assertVersion = (version: number): boolean => {
assert(this.version <= version, `Cannot convert metadata from v${this.version} to v${version}`); assert(this.version <= version, `Cannot convert metadata from v${this.version} to v${version}`);
return this.version === version; return this.version === version;
} };
private _getVersion<T extends MetaMapped, F extends MetaMapped> (version: MetaVersions, fromPrev: (registry: Registry, input: F, metaVersion: number) => T): T { #getVersion = <T extends MetaMapped, F extends MetaMapped>(version: MetaVersions, fromPrev: (registry: Registry, input: F, metaVersion: number) => T): T => {
const asCurr = `asV${version}` as MetaAsX; const asCurr = `asV${version}` as MetaAsX;
const asPrev = `asV${version - 1}` as MetaAsX; const asPrev = `asV${version - 1}` as MetaAsX;
if (this._assertVersion(version)) { if (this.#assertVersion(version)) {
return this._metadata[asCurr] as T; return this.#metadata()[asCurr] as T;
} }
if (!this.#converted.has(version)) { if (!this.#converted.has(version)) {
@@ -52,6 +52,13 @@ export class MetadataVersioned extends Struct {
} }
return this.#converted.get(version) as T; return this.#converted.get(version) as T;
};
/**
* @description the metadata wrapped
*/
#metadata = (): MetadataAll => {
return this.get('metadata') as MetadataAll;
} }
/** /**
@@ -68,30 +75,30 @@ export class MetadataVersioned extends Struct {
* @description Returns the wrapped metadata as a V9 object * @description Returns the wrapped metadata as a V9 object
*/ */
public get asV9 (): MetadataV9 { public get asV9 (): MetadataV9 {
this._assertVersion(9); this.#assertVersion(9);
return this._metadata.asV9; return this.#metadata().asV9;
} }
/** /**
* @description Returns the wrapped values as a V10 object * @description Returns the wrapped values as a V10 object
*/ */
public get asV10 (): MetadataV10 { public get asV10 (): MetadataV10 {
return this._getVersion(10, toV10); return this.#getVersion(10, toV10);
} }
/** /**
* @description Returns the wrapped values as a V11 object * @description Returns the wrapped values as a V11 object
*/ */
public get asV11 (): MetadataV11 { public get asV11 (): MetadataV11 {
return this._getVersion(11, toV11); return this.#getVersion(11, toV11);
} }
/** /**
* @description Returns the wrapped values as a V12 object * @description Returns the wrapped values as a V12 object
*/ */
public get asV12 (): MetadataV12 { public get asV12 (): MetadataV12 {
return this._getVersion(12, toV12); return this.#getVersion(12, toV12);
} }
/** /**
@@ -99,7 +106,7 @@ export class MetadataVersioned extends Struct {
*/ */
public get asLatest (): MetadataLatest { public get asLatest (): MetadataLatest {
// This is non-existent & latest - applied here to do the module-specific type conversions // This is non-existent & latest - applied here to do the module-specific type conversions
return this._getVersion(13, toLatest); return this.#getVersion(13, toLatest);
} }
/** /**
@@ -109,18 +116,11 @@ export class MetadataVersioned extends Struct {
return this.get('magicNumber') as MagicNumber; return this.get('magicNumber') as MagicNumber;
} }
/**
* @description the metadata wrapped
*/
private get _metadata (): MetadataAll {
return this.get('metadata') as MetadataAll;
}
/** /**
* @description the metadata version this structure represents * @description the metadata version this structure represents
*/ */
public get version (): number { public get version (): number {
return this._metadata.index; return this.#metadata().index;
} }
public getUniqTypes (throwError: boolean): string[] { public getUniqTypes (throwError: boolean): string[] {
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/metadata', version: '4.0.2' }; export const packageInfo = { name: '@polkadot/metadata', version: '4.6.1' };
+11 -4
View File
@@ -5,6 +5,7 @@ import type { Codec, Registry } from '@polkadot/types/types';
import type { MetadataInterface } from '../types'; import type { MetadataInterface } from '../types';
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
import { assert, hexToU8a, u8aToHex } from '@polkadot/util';
import { Metadata } from '../Metadata'; import { Metadata } from '../Metadata';
import { getUniqTypes } from './getUniqTypes'; import { getUniqTypes } from './getUniqTypes';
@@ -47,19 +48,25 @@ export function toLatest<Modules extends Codec> (registry: Registry, version: nu
} }
/** @internal */ /** @internal */
export function defaultValues (registry: Registry, rpcData: string, withThrow = true): void { export function defaultValues (registry: Registry, rpcData: string, withThrow = true, withFallbackCheck = false): void {
describe('storage with default values', (): void => { describe('storage with default values', (): void => {
const metadata = new Metadata(registry, rpcData); const metadata = new Metadata(registry, rpcData);
metadata.asLatest.modules.filter(({ storage }): boolean => storage.isSome).forEach((mod): void => { metadata.asLatest.modules.filter(({ storage }): boolean => storage.isSome).forEach((mod): void => {
mod.storage.unwrap().items.forEach(({ fallback, name, type }): void => { mod.storage.unwrap().items.forEach(({ fallback, modifier, name, type }): void => {
const inner = unwrapStorageType(type); const inner = unwrapStorageType(type, modifier.isOptional);
const location = `${mod.name.toString()}.${name.toString()}: ${inner}`; const location = `${mod.name.toString()}.${name.toString()}: ${inner}`;
it(`creates default types for ${location}`, (): void => { it(`creates default types for ${location}`, (): void => {
expect((): void => { expect((): void => {
try { try {
registry.createType(inner, fallback); const type = registry.createType(inner, hexToU8a(fallback.toHex()));
if (withFallbackCheck) {
const [hexType, hexOrig] = [u8aToHex(type.toU8a()), u8aToHex(fallback.toU8a(true))];
assert(hexType === hexOrig, `Fallback does not match (${((hexOrig.length - 2) / 2) - ((hexType.length - 2) / 2)} bytes missing): ${hexType} !== ${hexOrig}`);
}
} catch (error) { } catch (error) {
const message = `${location}:: ${(error as Error).message}`; const message = `${location}:: ${(error as Error).message}`;
+1 -1
View File
@@ -14,5 +14,5 @@ describe('MetadataV12 (substrate)', (): void => {
toLatest(registry, 12, substrateData); toLatest(registry, 12, substrateData);
defaultValues(registry, substrateData); defaultValues(registry, substrateData, true, true);
}); });
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+20 -22
View File
@@ -20,22 +20,24 @@ const KNOWN_ORIGINS: Record<string, string> = {
* Find and apply the correct type override * Find and apply the correct type override
* @internal * @internal
**/ **/
function setTypeOverride (sectionTypes: OverrideModuleType, type: Type): void { function setTypeOverride (sectionTypes: OverrideModuleType, ...types: Type[]): void {
const override = Object.keys(sectionTypes).find((aliased) => type.eq(aliased)); types.forEach((type): void => {
const override = Object.keys(sectionTypes).find((aliased) => type.eq(aliased));
if (override) { if (override) {
type.setOverride(sectionTypes[override]); type.setOverride(sectionTypes[override]);
} else { } else {
// FIXME: NOT happy with this approach, but gets over the initial hump cased by (Vec<Announcement>,BalanceOf) // FIXME: NOT happy with this approach, but gets over the initial hump cased by (Vec<Announcement>,BalanceOf)
const orig = type.toString(); const orig = type.toString();
const alias = Object.entries(sectionTypes).reduce((result: string, [from, to]): string => const alias = Object.entries(sectionTypes).reduce((result: string, [from, to]): string =>
[['<', '>'], ['<', ','], [',', '>'], ['(', ')'], ['(', ','], [',', ','], [',', ')']].reduce((result, [one, two]): string => [['<', '>'], ['<', ','], [',', '>'], ['(', ')'], ['(', ','], [',', ','], [',', ')']].reduce((result, [one, two]): string =>
result.replace(`${one}${from}${two}`, `${one}${to}${two}`), result), orig); result.replace(`${one}${from}${two}`, `${one}${to}${two}`), result), orig);
if (orig !== alias) { if (orig !== alias) {
type.setOverride(alias); type.setOverride(alias);
}
} }
} });
} }
/** /**
@@ -81,18 +83,14 @@ function convertEvents (registry: Registry, events: EventMetadataV12[], sectionT
function convertStorage (registry: Registry, { items, prefix }: StorageMetadataV12, sectionTypes: OverrideModuleType): StorageMetadataLatest { function convertStorage (registry: Registry, { items, prefix }: StorageMetadataV12, sectionTypes: OverrideModuleType): StorageMetadataLatest {
return registry.createType('StorageMetadataLatest', { return registry.createType('StorageMetadataLatest', {
items: items.map((s): StorageEntryMetadataLatest => { items: items.map((s): StorageEntryMetadataLatest => {
let resultType: Type; if (s.type.isDoubleMap) {
setTypeOverride(sectionTypes, s.type.asDoubleMap.value, s.type.asDoubleMap.key1, s.type.asDoubleMap.key2);
if (s.type.isMap) { } else if (s.type.isMap) {
resultType = s.type.asMap.value; setTypeOverride(sectionTypes, s.type.asMap.value, s.type.asMap.key);
} else if (s.type.isDoubleMap) {
resultType = s.type.asDoubleMap.value;
} else { } else {
resultType = s.type.asPlain; setTypeOverride(sectionTypes, s.type.asPlain);
} }
setTypeOverride(sectionTypes, resultType);
return registry.createType('StorageEntryMetadataLatest', s); return registry.createType('StorageEntryMetadataLatest', s);
}), }),
prefix prefix
+8 -8
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/rpc-core", "name": "@polkadot/rpc-core",
"version": "4.0.2", "version": "4.6.1",
"type": "module", "type": "module",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js", "main": "index.js",
@@ -16,14 +16,14 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/metadata": "4.0.2", "@polkadot/metadata": "4.6.1",
"@polkadot/rpc-provider": "4.0.2", "@polkadot/rpc-provider": "4.6.1",
"@polkadot/types": "4.0.2", "@polkadot/types": "4.6.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.2.1",
"@polkadot/x-rxjs": "^6.0.5" "@polkadot/x-rxjs": "^6.2.1"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5" "@polkadot/keyring": "^6.2.1"
} }
} }
+4 -2
View File
@@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors // Copyright 2017-2021 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { RpcInterface } from '@polkadot/rpc-core/types.jsonrpc';
import { createTestPairs } from '@polkadot/keyring/testingPairs'; import { createTestPairs } from '@polkadot/keyring/testingPairs';
import { MockProvider } from '@polkadot/rpc-provider/mock'; import { MockProvider } from '@polkadot/rpc-provider/mock';
import { TypeRegistry } from '@polkadot/types/create'; import { TypeRegistry } from '@polkadot/types/create';
@@ -9,11 +11,11 @@ import { RpcCore } from '.';
describe('Cached Observables', (): void => { describe('Cached Observables', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
let rpc: RpcCore; let rpc: RpcCore & RpcInterface;
const keyring = createTestPairs(); const keyring = createTestPairs();
beforeEach((): void => { beforeEach((): void => {
rpc = new RpcCore('123', registry, new MockProvider(registry)); rpc = new RpcCore('123', registry, new MockProvider(registry)) as (RpcCore & RpcInterface);
}); });
it('creates a single observable for subscriptions (multiple calls)', (): void => { it('creates a single observable for subscriptions (multiple calls)', (): void => {
+3 -38
View File
@@ -79,7 +79,7 @@ function isTreatAsHex (key: StorageKey): boolean {
* const rpc = new Rpc(provider); * const rpc = new Rpc(provider);
* ``` * ```
*/ */
export class RpcCore implements RpcInterface { export class RpcCore {
#instanceId: string; #instanceId: string;
#registryDefault: Registry; #registryDefault: Registry;
@@ -94,42 +94,6 @@ export class RpcCore implements RpcInterface {
public readonly sections: string[] = []; public readonly sections: string[] = [];
// Ok, this is quite horrible - we really should not be using the ! here, but we are actually assigning
// these via the createInterfaces inside the constructor. However... this is not quite visible. The reason
// why we don't do for individual assignments is to allow user-defined RPCs to also be defined
public readonly author!: RpcInterface['author'];
public readonly babe!: RpcInterface['babe'];
public readonly chain!: RpcInterface['chain'];
public readonly childstate!: RpcInterface['childstate'];
public readonly contracts!: RpcInterface['contracts'];
public readonly engine!: RpcInterface['engine'];
public readonly eth!: RpcInterface['eth'];
public readonly grandpa!: RpcInterface['grandpa'];
public readonly net!: RpcInterface['net'];
public readonly offchain!: RpcInterface['offchain'];
public readonly payment!: RpcInterface['payment'];
public readonly rpc!: RpcInterface['rpc'];
public readonly state!: RpcInterface['state'];
public readonly syncstate!: RpcInterface['syncstate'];
public readonly system!: RpcInterface['system'];
public readonly web3!: RpcInterface['web3'];
/** /**
* @constructor * @constructor
* Default constructor for the Api Object * Default constructor for the Api Object
@@ -148,6 +112,7 @@ export class RpcCore implements RpcInterface {
// these are the base keys (i.e. part of jsonrpc) // these are the base keys (i.e. part of jsonrpc)
this.sections.push(...sectionNames); this.sections.push(...sectionNames);
// decorate all interfaces, defined and user on this instance
this.addUserInterfaces(userRpc); this.addUserInterfaces(userRpc);
} }
@@ -187,7 +152,7 @@ export class RpcCore implements RpcInterface {
this.sections.forEach((sectionName): void => { this.sections.forEach((sectionName): void => {
(this as Record<string, unknown>)[sectionName as Section] ||= {}; (this as Record<string, unknown>)[sectionName as Section] ||= {};
const section = this[sectionName as Section] as Record<string, unknown>; const section = (this as Record<string, unknown>)[sectionName as Section] as Record<string, unknown>;
Object Object
.entries({ .entries({
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.0.2' }; export const packageInfo = { name: '@polkadot/rpc-core', version: '4.6.1' };
+3 -2
View File
@@ -1,6 +1,7 @@
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors // Copyright 2017-2021 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { RpcInterface } from '@polkadot/rpc-core/types.jsonrpc';
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import { MockProvider } from '@polkadot/rpc-provider/mock'; import { MockProvider } from '@polkadot/rpc-provider/mock';
@@ -11,10 +12,10 @@ import { RpcCore } from '.';
describe('replay', (): void => { describe('replay', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
let rpc: RpcCore; let rpc: RpcCore & RpcInterface;
beforeEach((): void => { beforeEach((): void => {
rpc = new RpcCore('653', registry, new MockProvider(registry)); rpc = new RpcCore('653', registry, new MockProvider(registry)) as (RpcCore & RpcInterface);
}); });
it('subscribes via the rpc section', (done): void => { it('subscribes via the rpc section', (done): void => {
+11 -11
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/rpc-provider", "name": "@polkadot/rpc-provider",
"version": "4.0.2", "version": "4.6.1",
"type": "module", "type": "module",
"description": "Transport providers for the API", "description": "Transport providers for the API",
"main": "index.js", "main": "index.js",
@@ -16,20 +16,20 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/types": "4.0.2", "@polkadot/types": "4.6.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.2.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.2.1",
"@polkadot/x-fetch": "^6.0.5", "@polkadot/x-fetch": "^6.2.1",
"@polkadot/x-global": "^6.0.5", "@polkadot/x-global": "^6.2.1",
"@polkadot/x-ws": "^6.0.5", "@polkadot/x-ws": "^6.2.1",
"bn.js": "^4.11.9", "bn.js": "^4.11.9",
"eventemitter3": "^4.0.7" "eventemitter3": "^4.0.7"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5", "@polkadot/keyring": "^6.2.1",
"@polkadot/metadata": "4.0.2", "@polkadot/metadata": "4.6.1",
"mock-socket": "^9.0.3", "mock-socket": "^9.0.3",
"nock": "^13.0.10" "nock": "^13.0.11"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.0.2' }; export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.6.1' };
+11 -11
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/typegen", "name": "@polkadot/typegen",
"version": "4.0.2", "version": "4.6.1",
"type": "module", "type": "module",
"description": "Type generation scripts", "description": "Type generation scripts",
"main": "index.js", "main": "index.js",
@@ -23,20 +23,20 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme",
"dependencies": { "dependencies": {
"@babel/core": "^7.13.8", "@babel/core": "^7.13.15",
"@babel/register": "^7.13.8", "@babel/register": "^7.13.14",
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/api": "4.0.2", "@polkadot/api": "4.6.1",
"@polkadot/metadata": "4.0.2", "@polkadot/metadata": "4.6.1",
"@polkadot/rpc-provider": "4.0.2", "@polkadot/rpc-provider": "4.6.1",
"@polkadot/types": "4.0.2", "@polkadot/types": "4.6.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.2.1",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
"websocket": "^1.0.33", "websocket": "^1.0.34",
"yargs": "^16.2.0" "yargs": "^16.2.0"
}, },
"devDependencies": { "devDependencies": {
"@types/websocket": "^1.0.2", "@types/websocket": "^1.0.2",
"@types/yargs": "^16.0.0" "@types/yargs": "^16.0.1"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/typegen', version: '4.0.2' }; export const packageInfo = { name: '@polkadot/typegen', version: '4.6.1' };
+5 -5
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/types-known", "name": "@polkadot/types-known",
"version": "4.0.2", "version": "4.6.1",
"type": "module", "type": "module",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js", "main": "index.js",
@@ -16,10 +16,10 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/networks": "^6.0.5", "@polkadot/networks": "^6.2.1",
"@polkadot/types": "4.0.2", "@polkadot/types": "4.6.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.2.1",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
}, },
"devDependencies": { "devDependencies": {
+13 -1
View File
@@ -6,7 +6,10 @@ import type { OverrideModuleType } from '@polkadot/types/types';
// type overrides for modules (where duplication between modules exist) // type overrides for modules (where duplication between modules exist)
const typesModules: Record<string, OverrideModuleType> = { const typesModules: Record<string, OverrideModuleType> = {
assets: { assets: {
Balance: 'TAssetBalance' Approval: 'AssetApproval',
ApprovalKey: 'AssetApprovalKey',
Balance: 'TAssetBalance',
DestroyWitness: 'AssetDestroyWitness'
}, },
babe: { babe: {
EquivocationProof: 'BabeEquivocationProof' EquivocationProof: 'BabeEquivocationProof'
@@ -57,6 +60,9 @@ const typesModules: Record<string, OverrideModuleType> = {
scheduler: { scheduler: {
ValidatorIndex: 'ParaValidatorIndex' ValidatorIndex: 'ParaValidatorIndex'
}, },
shared: {
ValidatorIndex: 'ParaValidatorIndex'
},
society: { society: {
Judgement: 'SocietyJudgement', Judgement: 'SocietyJudgement',
Vote: 'SocietyVote' Vote: 'SocietyVote'
@@ -66,6 +72,12 @@ const typesModules: Record<string, OverrideModuleType> = {
}, },
treasury: { treasury: {
Proposal: 'TreasuryProposal' Proposal: 'TreasuryProposal'
},
xcm: {
Outcome: 'XcmOutcome'
},
xcmPallet: {
Outcome: 'XcmOutcome'
} }
}; };
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types-known', version: '4.0.2' }; export const packageInfo = { name: '@polkadot/types-known', version: '4.6.1' };
+2
View File
@@ -9,6 +9,7 @@ import node from './node';
import nodeTemplate from './node-template'; import nodeTemplate from './node-template';
import polkadot from './polkadot'; import polkadot from './polkadot';
import rococo from './rococo'; import rococo from './rococo';
import statemint from './statemint';
import westend from './westend'; import westend from './westend';
// Type overrides for specific spec types & versions as given in runtimeVersion // Type overrides for specific spec types & versions as given in runtimeVersion
@@ -19,6 +20,7 @@ const typesSpec: Record<string, OverrideVersionedType[]> = {
'node-template': nodeTemplate, 'node-template': nodeTemplate,
polkadot, polkadot,
rococo, rococo,
statemint,
westend westend
}; };
+9 -2
View File
@@ -8,7 +8,7 @@ import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = { const sharedTypes = {
AccountInfo: 'AccountInfoWithDualRefCount', AccountInfo: 'AccountInfoWithDualRefCount',
Address: 'MultiAddress', Address: 'MultiAddress',
Keys: 'SessionKeys6', Keys: 'SessionKeys7B',
LookupSource: 'MultiAddress', LookupSource: 'MultiAddress',
ProxyType: { ProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy'] _enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy']
@@ -165,7 +165,14 @@ const versioned: OverrideVersionedType[] = [
} }
}, },
{ {
minmax: [2028, undefined], minmax: [2028, 2029],
types: {
...sharedTypes,
Keys: 'SessionKeys6'
}
},
{
minmax: [2030, undefined],
types: { types: {
...sharedTypes ...sharedTypes
} }
+10 -3
View File
@@ -8,7 +8,7 @@ import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = { const sharedTypes = {
AccountInfo: 'AccountInfoWithDualRefCount', AccountInfo: 'AccountInfoWithDualRefCount',
Address: 'MultiAddress', Address: 'MultiAddress',
Keys: 'SessionKeys6', Keys: 'SessionKeys7B',
LookupSource: 'MultiAddress', LookupSource: 'MultiAddress',
ProxyType: { ProxyType: {
_enum: { _enum: {
@@ -16,7 +16,7 @@ const sharedTypes = {
NonTransfer: 1, NonTransfer: 1,
Governance: 2, Governance: 2,
Staking: 3, Staking: 3,
// SudoBalances: 4, UnusedSudoBalances: 4,
IdentityJudgement: 5, IdentityJudgement: 5,
CancelProxy: 6 CancelProxy: 6
} }
@@ -69,7 +69,14 @@ const versioned: OverrideVersionedType[] = [
} }
}, },
{ {
minmax: [28, undefined], minmax: [28, 29],
types: {
...sharedTypes,
Keys: 'SessionKeys6'
}
},
{
minmax: [30, undefined],
types: { types: {
...sharedTypes ...sharedTypes
} }
+17 -5
View File
@@ -9,11 +9,8 @@ import type { OverrideVersionedType } from '@polkadot/types/types';
/* eslint-disable sort-keys */ /* eslint-disable sort-keys */
const sharedTypes = { const sharedTypes = {
AccountInfo: 'AccountInfoWithDualRefCount',
Address: 'MultiAddress',
FullIdentification: '()', // No staking, only session (as per config) FullIdentification: '()', // No staking, only session (as per config)
LookupSource: 'MultiAddress', Keys: 'SessionKeys7B'
Keys: 'SessionKeys6'
}; };
const versioned: OverrideVersionedType[] = [ const versioned: OverrideVersionedType[] = [
@@ -21,12 +18,27 @@ const versioned: OverrideVersionedType[] = [
minmax: [0, 200], minmax: [0, 200],
types: { types: {
...sharedTypes, ...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount',
Address: 'AccountId', Address: 'AccountId',
LookupSource: 'AccountId' LookupSource: 'AccountId'
} }
}, },
{ {
minmax: [201, undefined], minmax: [201, 214],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount'
}
},
{
minmax: [215, 228],
types: {
...sharedTypes,
Keys: 'SessionKeys6'
}
},
{
minmax: [229, undefined],
types: { types: {
...sharedTypes ...sharedTypes
} }
@@ -0,0 +1,28 @@
// Copyright 2017-2021 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable sort-keys */
import type { OverrideVersionedType } from '@polkadot/types/types';
// these are override types for Polkadot
const versioned: OverrideVersionedType[] = [
{
minmax: [0, undefined],
types: {
TAssetBalance: 'u128',
ProxyType: {
_enum: {
Any: 0,
NonTransfer: 1,
CancelProxy: 2,
Assets: 3,
AssetOwner: 4,
AssetManager: 5
}
}
}
}
];
export default versioned;
+20 -9
View File
@@ -6,15 +6,10 @@
import type { OverrideVersionedType } from '@polkadot/types/types'; import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = { const sharedTypes = {
AccountInfo: 'AccountInfoWithDualRefCount', Keys: 'SessionKeys7B',
Address: 'MultiAddress',
Keys: 'SessionKeys6',
LookupSource: 'MultiAddress',
ProxyType: { ProxyType: {
_enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy' _enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy']
] }
},
ValidatorPrefs: 'ValidatorPrefsWithBlocked'
}; };
const addrAccountIdTypes = { const addrAccountIdTypes = {
@@ -73,7 +68,23 @@ const versioned: OverrideVersionedType[] = [
} }
}, },
{ {
minmax: [48, undefined], minmax: [48, 49],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount',
Keys: 'SessionKeys6'
}
},
{
// 50 was supposed to have Beefy, didn't
minmax: [50, 50],
types: {
...sharedTypes,
Keys: 'SessionKeys6'
}
},
{
minmax: [51, undefined],
types: { types: {
...sharedTypes ...sharedTypes
} }
+1 -1
View File
@@ -12,7 +12,7 @@ const upgrades: ChainUpgradesRaw = [
[2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011], [2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011],
[2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022], [2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022],
[3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027], [3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027],
[6137912, 2028] [6137912, 2028], [6561855, 2029], [7100891, 2030]
]; ];
export default upgrades; export default upgrades;
@@ -8,7 +8,7 @@ const upgrades: ChainUpgradesRaw = [
[244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12], [244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
[528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17], [528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26], [1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
[3613564, 27], [3899547, 28] [3613564, 27], [3899547, 28], [4345767, 29]
]; ];
export default upgrades; export default upgrades;
+2 -1
View File
@@ -8,7 +8,8 @@ const upgrades: ChainUpgradesRaw = [
[879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29], [879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35], [1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44], [1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49] [2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
[5124076, 50]
]; ];
export default upgrades; export default upgrades;
+7 -7
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/types", "name": "@polkadot/types",
"version": "4.0.2", "version": "4.6.1",
"type": "module", "type": "module",
"description": "Implementation of the Parity codec", "description": "Implementation of the Parity codec",
"main": "index.js", "main": "index.js",
@@ -16,15 +16,15 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.9", "@babel/runtime": "^7.13.10",
"@polkadot/metadata": "4.0.2", "@polkadot/metadata": "4.6.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.2.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.2.1",
"@polkadot/x-rxjs": "^6.0.5", "@polkadot/x-rxjs": "^6.2.1",
"@types/bn.js": "^4.11.6", "@types/bn.js": "^4.11.6",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5" "@polkadot/keyring": "^6.2.1"
} }
} }
+198 -76
View File
@@ -2,21 +2,22 @@
/* eslint-disable */ /* eslint-disable */
import type { BitVec, Bool, Bytes, Compact, Data, DoNotConstruct, I128, I16, I256, I32, I64, I8, Json, Null, Option, Raw, StorageKey, Text, Type, U128, U16, U256, U32, U64, U8, USize, Vec, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types'; import type { BitVec, Bool, Bytes, Compact, Data, DoNotConstruct, I128, I16, I256, I32, I64, I8, Json, Null, Option, Raw, StorageKey, Text, Type, U128, U16, U256, U32, U64, U8, USize, Vec, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types';
import type { AssetBalance, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
import type { BeefyCommitment, BeefyNextAuthoritySet, BeefyPayload, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims'; import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims';
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective'; import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus'; import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, DeletedContract, Gas, HostFnWeights, HostFnWeightsTo264, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, DeletedContract, Gas, HostFnWeights, HostFnWeightsTo264, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi'; import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
import type { DeployData, FundIndex, FundInfo, LastContribution } from '@polkadot/types/interfaces/crowdloan'; import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy'; import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections'; import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine'; import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
@@ -30,19 +31,20 @@ import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityJudg
import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline'; import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery'; import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery';
import type { DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV12, DoubleMapTypeV9, ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV9, MapTypeLatest, MapTypeV10, MapTypeV11, MapTypeV12, MapTypeV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV9, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; import type { DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV12, DoubleMapTypeV9, ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV9, MapTypeLatest, MapTypeV10, MapTypeV11, MapTypeV12, MapTypeV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV9, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AbstractFungible, AbstractNonFungible, AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Balances, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, ConcreteFungible, ConcreteNonFungible, CoreAssignment, CoreIndex, CoreOccupied, DepositAsset, DepositReserveAsset, DoubleVoteReport, DownwardMessage, ExchangeAsset, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InitiateReserveWithdraw, InitiateTeleport, Junction, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiAsset, MultiLocation, NetworkId, NewBidder, NewBidderOption, Order, OriginKind, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueryHolding, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayChainHash, RelayTo, RelayedFrom, Remark, ReserveAssetDeposit, Retriable, Scheduling, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, SystemInherentData, TeleportAsset, Transact, TransientValidationData, UpwardMessage, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry, WithdrawAsset, Xcm, XcmError, XcmResult } from '@polkadot/types/interfaces/parachains'; import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayChainHash, Remark, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, SystemInherentData, TransientValidationData, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { Approvals } from '@polkadot/types/interfaces/poll'; import type { Approvals } from '@polkadot/types/interfaces/poll';
import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy';
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import type { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys7, SessionKeys8, SessionKeys9, ValidatorCount } from '@polkadot/types/interfaces/session'; import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking'; import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state'; import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state';
@@ -52,6 +54,7 @@ import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatu
import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
import type { VestingInfo } from '@polkadot/types/interfaces/vesting'; import type { VestingInfo } from '@polkadot/types/interfaces/vesting';
import type { AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, DoubleEncodedCall, Junction, MultiAsset, MultiAssetAbstractFungible, MultiAssetAbstractNonFungible, MultiAssetConcreteFungible, MultiAssetConcreteNonFungible, MultiLocation, NetworkId, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, Xcm, XcmAssetEffects, XcmError, XcmHrmpChannelAccepted, XcmHrmpChannelClosing, XcmHrmpNewChannelOpenRequest, XcmOrder, XcmOrderBuyExecution, XcmOrderDepositAsset, XcmOrderDepositReserveAsset, XcmOrderExchangeAsset, XcmOrderInitiateReserveWithdraw, XcmOrderInitiateTeleport, XcmOrderQueryHolding, XcmOriginKind, XcmOutcome, XcmQueryResponse, XcmRelayedFrom, XcmReserveAssetDeposit, XcmResponse, XcmTeleportAsset, XcmTransact, XcmTransferAsset, XcmTransferReserveAsset, XcmWithdrawAsset } from '@polkadot/types/interfaces/xcm';
declare module '@polkadot/types/types/registry' { declare module '@polkadot/types/types/registry' {
export interface InterfaceTypes { export interface InterfaceTypes {
@@ -120,6 +123,7 @@ declare module '@polkadot/types/types/registry' {
'Compact<TAssetBalance>': Compact<TAssetBalance>; 'Compact<TAssetBalance>': Compact<TAssetBalance>;
'Compact<TAssetDepositBalance>': Compact<TAssetDepositBalance>; 'Compact<TAssetDepositBalance>': Compact<TAssetDepositBalance>;
'Compact<TransactionPriority>': Compact<TransactionPriority>; 'Compact<TransactionPriority>': Compact<TransactionPriority>;
'Compact<TrieIndex>': Compact<TrieIndex>;
'Compact<u128>': Compact<u128>; 'Compact<u128>': Compact<u128>;
'Compact<U128>': Compact<U128>; 'Compact<U128>': Compact<U128>;
'Compact<u16>': Compact<u16>; 'Compact<u16>': Compact<u16>;
@@ -137,14 +141,13 @@ declare module '@polkadot/types/types/registry' {
'Compact<USize>': Compact<USize>; 'Compact<USize>': Compact<USize>;
'Compact<ValidatorCount>': Compact<ValidatorCount>; 'Compact<ValidatorCount>': Compact<ValidatorCount>;
'Compact<ValidatorIndex>': Compact<ValidatorIndex>; 'Compact<ValidatorIndex>': Compact<ValidatorIndex>;
'Compact<ValidatorSetId>': Compact<ValidatorSetId>;
'Compact<VoteIndex>': Compact<VoteIndex>; 'Compact<VoteIndex>': Compact<VoteIndex>;
'Compact<VoteWeight>': Compact<VoteWeight>; 'Compact<VoteWeight>': Compact<VoteWeight>;
'Compact<Weight>': Compact<Weight>; 'Compact<Weight>': Compact<Weight>;
'Option<AbridgedCandidateReceipt>': Option<AbridgedCandidateReceipt>; 'Option<AbridgedCandidateReceipt>': Option<AbridgedCandidateReceipt>;
'Option<AbridgedHostConfiguration>': Option<AbridgedHostConfiguration>; 'Option<AbridgedHostConfiguration>': Option<AbridgedHostConfiguration>;
'Option<AbridgedHrmpChannel>': Option<AbridgedHrmpChannel>; 'Option<AbridgedHrmpChannel>': Option<AbridgedHrmpChannel>;
'Option<AbstractFungible>': Option<AbstractFungible>;
'Option<AbstractNonFungible>': Option<AbstractNonFungible>;
'Option<AccountData>': Option<AccountData>; 'Option<AccountData>': Option<AccountData>;
'Option<AccountId>': Option<AccountId>; 'Option<AccountId>': Option<AccountId>;
'Option<AccountId32Junction>': Option<AccountId32Junction>; 'Option<AccountId32Junction>': Option<AccountId32Junction>;
@@ -175,7 +178,10 @@ declare module '@polkadot/types/types/registry' {
'Option<ApplyExtrinsicResult>': Option<ApplyExtrinsicResult>; 'Option<ApplyExtrinsicResult>': Option<ApplyExtrinsicResult>;
'Option<ApprovalFlag>': Option<ApprovalFlag>; 'Option<ApprovalFlag>': Option<ApprovalFlag>;
'Option<Approvals>': Option<Approvals>; 'Option<Approvals>': Option<Approvals>;
'Option<AssetApproval>': Option<AssetApproval>;
'Option<AssetApprovalKey>': Option<AssetApprovalKey>;
'Option<AssetBalance>': Option<AssetBalance>; 'Option<AssetBalance>': Option<AssetBalance>;
'Option<AssetDestroyWitness>': Option<AssetDestroyWitness>;
'Option<AssetDetails>': Option<AssetDetails>; 'Option<AssetDetails>': Option<AssetDetails>;
'Option<AssetId>': Option<AssetId>; 'Option<AssetId>': Option<AssetId>;
'Option<AssetInstance>': Option<AssetInstance>; 'Option<AssetInstance>': Option<AssetInstance>;
@@ -196,6 +202,7 @@ declare module '@polkadot/types/types/registry' {
'Option<AvailabilityBitfieldRecord>': Option<AvailabilityBitfieldRecord>; 'Option<AvailabilityBitfieldRecord>': Option<AvailabilityBitfieldRecord>;
'Option<BabeAuthorityWeight>': Option<BabeAuthorityWeight>; 'Option<BabeAuthorityWeight>': Option<BabeAuthorityWeight>;
'Option<BabeBlockWeight>': Option<BabeBlockWeight>; 'Option<BabeBlockWeight>': Option<BabeBlockWeight>;
'Option<BabeEpochConfiguration>': Option<BabeEpochConfiguration>;
'Option<BabeEquivocationProof>': Option<BabeEquivocationProof>; 'Option<BabeEquivocationProof>': Option<BabeEquivocationProof>;
'Option<BabeWeight>': Option<BabeWeight>; 'Option<BabeWeight>': Option<BabeWeight>;
'Option<BackedCandidate>': Option<BackedCandidate>; 'Option<BackedCandidate>': Option<BackedCandidate>;
@@ -203,8 +210,12 @@ declare module '@polkadot/types/types/registry' {
'Option<BalanceLock>': Option<BalanceLock>; 'Option<BalanceLock>': Option<BalanceLock>;
'Option<BalanceLockTo212>': Option<BalanceLockTo212>; 'Option<BalanceLockTo212>': Option<BalanceLockTo212>;
'Option<BalanceOf>': Option<BalanceOf>; 'Option<BalanceOf>': Option<BalanceOf>;
'Option<Balances>': Option<Balances>;
'Option<BalanceStatus>': Option<BalanceStatus>; 'Option<BalanceStatus>': Option<BalanceStatus>;
'Option<BeefyCommitment>': Option<BeefyCommitment>;
'Option<BeefyKey>': Option<BeefyKey>;
'Option<BeefyNextAuthoritySet>': Option<BeefyNextAuthoritySet>;
'Option<BeefyPayload>': Option<BeefyPayload>;
'Option<BeefySignedCommitment>': Option<BeefySignedCommitment>;
'Option<Bid>': Option<Bid>; 'Option<Bid>': Option<Bid>;
'Option<Bidder>': Option<Bidder>; 'Option<Bidder>': Option<Bidder>;
'Option<BidKind>': Option<BidKind>; 'Option<BidKind>': Option<BidKind>;
@@ -247,8 +258,6 @@ declare module '@polkadot/types/types/registry' {
'Option<CompactAssignmentsTo257>': Option<CompactAssignmentsTo257>; 'Option<CompactAssignmentsTo257>': Option<CompactAssignmentsTo257>;
'Option<CompactScore>': Option<CompactScore>; 'Option<CompactScore>': Option<CompactScore>;
'Option<CompactScoreCompact>': Option<CompactScoreCompact>; 'Option<CompactScoreCompact>': Option<CompactScoreCompact>;
'Option<ConcreteFungible>': Option<ConcreteFungible>;
'Option<ConcreteNonFungible>': Option<ConcreteNonFungible>;
'Option<Consensus>': Option<Consensus>; 'Option<Consensus>': Option<Consensus>;
'Option<ConsensusEngineId>': Option<ConsensusEngineId>; 'Option<ConsensusEngineId>': Option<ConsensusEngineId>;
'Option<ConsumedWeight>': Option<ConsumedWeight>; 'Option<ConsumedWeight>': Option<ConsumedWeight>;
@@ -297,9 +306,6 @@ declare module '@polkadot/types/types/registry' {
'Option<DefunctVoter>': Option<DefunctVoter>; 'Option<DefunctVoter>': Option<DefunctVoter>;
'Option<Delegations>': Option<Delegations>; 'Option<Delegations>': Option<Delegations>;
'Option<DeletedContract>': Option<DeletedContract>; 'Option<DeletedContract>': Option<DeletedContract>;
'Option<DeployData>': Option<DeployData>;
'Option<DepositAsset>': Option<DepositAsset>;
'Option<DepositReserveAsset>': Option<DepositReserveAsset>;
'Option<Digest>': Option<Digest>; 'Option<Digest>': Option<Digest>;
'Option<DigestItem>': Option<DigestItem>; 'Option<DigestItem>': Option<DigestItem>;
'Option<DigestOf>': Option<DigestOf>; 'Option<DigestOf>': Option<DigestOf>;
@@ -314,7 +320,10 @@ declare module '@polkadot/types/types/registry' {
'Option<DispatchResult>': Option<DispatchResult>; 'Option<DispatchResult>': Option<DispatchResult>;
'Option<DispatchResultOf>': Option<DispatchResultOf>; 'Option<DispatchResultOf>': Option<DispatchResultOf>;
'Option<DispatchResultTo198>': Option<DispatchResultTo198>; 'Option<DispatchResultTo198>': Option<DispatchResultTo198>;
'Option<DisputeStatement>': Option<DisputeStatement>;
'Option<DisputeStatementSet>': Option<DisputeStatementSet>;
'Option<DoNotConstruct>': Option<DoNotConstruct>; 'Option<DoNotConstruct>': Option<DoNotConstruct>;
'Option<DoubleEncodedCall>': Option<DoubleEncodedCall>;
'Option<DoubleMapTypeLatest>': Option<DoubleMapTypeLatest>; 'Option<DoubleMapTypeLatest>': Option<DoubleMapTypeLatest>;
'Option<DoubleMapTypeV10>': Option<DoubleMapTypeV10>; 'Option<DoubleMapTypeV10>': Option<DoubleMapTypeV10>;
'Option<DoubleMapTypeV11>': Option<DoubleMapTypeV11>; 'Option<DoubleMapTypeV11>': Option<DoubleMapTypeV11>;
@@ -331,6 +340,7 @@ declare module '@polkadot/types/types/registry' {
'Option<ElectionSize>': Option<ElectionSize>; 'Option<ElectionSize>': Option<ElectionSize>;
'Option<ElectionStatus>': Option<ElectionStatus>; 'Option<ElectionStatus>': Option<ElectionStatus>;
'Option<EncodedFinalityProofs>': Option<EncodedFinalityProofs>; 'Option<EncodedFinalityProofs>': Option<EncodedFinalityProofs>;
'Option<EncodedJustification>': Option<EncodedJustification>;
'Option<EpochAuthorship>': Option<EpochAuthorship>; 'Option<EpochAuthorship>': Option<EpochAuthorship>;
'Option<EraIndex>': Option<EraIndex>; 'Option<EraIndex>': Option<EraIndex>;
'Option<EraPoints>': Option<EraPoints>; 'Option<EraPoints>': Option<EraPoints>;
@@ -384,12 +394,12 @@ declare module '@polkadot/types/types/registry' {
'Option<EvmAccount>': Option<EvmAccount>; 'Option<EvmAccount>': Option<EvmAccount>;
'Option<EvmLog>': Option<EvmLog>; 'Option<EvmLog>': Option<EvmLog>;
'Option<EvmVicinity>': Option<EvmVicinity>; 'Option<EvmVicinity>': Option<EvmVicinity>;
'Option<ExchangeAsset>': Option<ExchangeAsset>;
'Option<ExitError>': Option<ExitError>; 'Option<ExitError>': Option<ExitError>;
'Option<ExitFatal>': Option<ExitFatal>; 'Option<ExitFatal>': Option<ExitFatal>;
'Option<ExitReason>': Option<ExitReason>; 'Option<ExitReason>': Option<ExitReason>;
'Option<ExitRevert>': Option<ExitRevert>; 'Option<ExitRevert>': Option<ExitRevert>;
'Option<ExitSucceed>': Option<ExitSucceed>; 'Option<ExitSucceed>': Option<ExitSucceed>;
'Option<ExplicitDisputeStatement>': Option<ExplicitDisputeStatement>;
'Option<Exposure>': Option<Exposure>; 'Option<Exposure>': Option<Exposure>;
'Option<ExtendedBalance>': Option<ExtendedBalance>; 'Option<ExtendedBalance>': Option<ExtendedBalance>;
'Option<Extrinsic>': Option<Extrinsic>; 'Option<Extrinsic>': Option<Extrinsic>;
@@ -430,6 +440,7 @@ declare module '@polkadot/types/types/registry' {
'Option<FundInfo>': Option<FundInfo>; 'Option<FundInfo>': Option<FundInfo>;
'Option<Gas>': Option<Gas>; 'Option<Gas>': Option<Gas>;
'Option<GiltBid>': Option<GiltBid>; 'Option<GiltBid>': Option<GiltBid>;
'Option<GlobalValidationData>': Option<GlobalValidationData>;
'Option<GlobalValidationSchedule>': Option<GlobalValidationSchedule>; 'Option<GlobalValidationSchedule>': Option<GlobalValidationSchedule>;
'Option<GrandpaEquivocation>': Option<GrandpaEquivocation>; 'Option<GrandpaEquivocation>': Option<GrandpaEquivocation>;
'Option<GrandpaEquivocationProof>': Option<GrandpaEquivocationProof>; 'Option<GrandpaEquivocationProof>': Option<GrandpaEquivocationProof>;
@@ -486,14 +497,14 @@ declare module '@polkadot/types/types/registry' {
'Option<Index>': Option<Index>; 'Option<Index>': Option<Index>;
'Option<IndicesLookupSource>': Option<IndicesLookupSource>; 'Option<IndicesLookupSource>': Option<IndicesLookupSource>;
'Option<IndividualExposure>': Option<IndividualExposure>; 'Option<IndividualExposure>': Option<IndividualExposure>;
'Option<InitiateReserveWithdraw>': Option<InitiateReserveWithdraw>;
'Option<InitiateTeleport>': Option<InitiateTeleport>;
'Option<InstructionWeights>': Option<InstructionWeights>; 'Option<InstructionWeights>': Option<InstructionWeights>;
'Option<InvalidDisputeStatementKind>': Option<InvalidDisputeStatementKind>;
'Option<InvalidTransaction>': Option<InvalidTransaction>; 'Option<InvalidTransaction>': Option<InvalidTransaction>;
'Option<Json>': Option<Json>; 'Option<Json>': Option<Json>;
'Option<Junction>': Option<Junction>; 'Option<Junction>': Option<Junction>;
'Option<Justification>': Option<Justification>; 'Option<Justification>': Option<Justification>;
'Option<JustificationNotification>': Option<JustificationNotification>; 'Option<JustificationNotification>': Option<JustificationNotification>;
'Option<Justifications>': Option<Justifications>;
'Option<Key>': Option<Key>; 'Option<Key>': Option<Key>;
'Option<KeyOwnerProof>': Option<KeyOwnerProof>; 'Option<KeyOwnerProof>': Option<KeyOwnerProof>;
'Option<Keys>': Option<Keys>; 'Option<Keys>': Option<Keys>;
@@ -532,6 +543,8 @@ declare module '@polkadot/types/types/registry' {
'Option<MetadataV11>': Option<MetadataV11>; 'Option<MetadataV11>': Option<MetadataV11>;
'Option<MetadataV12>': Option<MetadataV12>; 'Option<MetadataV12>': Option<MetadataV12>;
'Option<MetadataV9>': Option<MetadataV9>; 'Option<MetadataV9>': Option<MetadataV9>;
'Option<MmrLeafProof>': Option<MmrLeafProof>;
'Option<MmrRootHash>': Option<MmrRootHash>;
'Option<ModuleConstantMetadataLatest>': Option<ModuleConstantMetadataLatest>; 'Option<ModuleConstantMetadataLatest>': Option<ModuleConstantMetadataLatest>;
'Option<ModuleConstantMetadataV10>': Option<ModuleConstantMetadataV10>; 'Option<ModuleConstantMetadataV10>': Option<ModuleConstantMetadataV10>;
'Option<ModuleConstantMetadataV11>': Option<ModuleConstantMetadataV11>; 'Option<ModuleConstantMetadataV11>': Option<ModuleConstantMetadataV11>;
@@ -549,16 +562,21 @@ declare module '@polkadot/types/types/registry' {
'Option<MortalEra>': Option<MortalEra>; 'Option<MortalEra>': Option<MortalEra>;
'Option<MultiAddress>': Option<MultiAddress>; 'Option<MultiAddress>': Option<MultiAddress>;
'Option<MultiAsset>': Option<MultiAsset>; 'Option<MultiAsset>': Option<MultiAsset>;
'Option<MultiAssetAbstractFungible>': Option<MultiAssetAbstractFungible>;
'Option<MultiAssetAbstractNonFungible>': Option<MultiAssetAbstractNonFungible>;
'Option<MultiAssetConcreteFungible>': Option<MultiAssetConcreteFungible>;
'Option<MultiAssetConcreteNonFungible>': Option<MultiAssetConcreteNonFungible>;
'Option<MultiDisputeStatementSet>': Option<MultiDisputeStatementSet>;
'Option<MultiLocation>': Option<MultiLocation>; 'Option<MultiLocation>': Option<MultiLocation>;
'Option<Multiplier>': Option<Multiplier>; 'Option<Multiplier>': Option<Multiplier>;
'Option<Multisig>': Option<Multisig>; 'Option<Multisig>': Option<Multisig>;
'Option<MultiSignature>': Option<MultiSignature>; 'Option<MultiSignature>': Option<MultiSignature>;
'Option<MultiSigner>': Option<MultiSigner>;
'Option<NetworkId>': Option<NetworkId>; 'Option<NetworkId>': Option<NetworkId>;
'Option<NetworkState>': Option<NetworkState>; 'Option<NetworkState>': Option<NetworkState>;
'Option<NetworkStatePeerset>': Option<NetworkStatePeerset>; 'Option<NetworkStatePeerset>': Option<NetworkStatePeerset>;
'Option<NetworkStatePeersetInfo>': Option<NetworkStatePeersetInfo>; 'Option<NetworkStatePeersetInfo>': Option<NetworkStatePeersetInfo>;
'Option<NewBidder>': Option<NewBidder>; 'Option<NewBidder>': Option<NewBidder>;
'Option<NewBidderOption>': Option<NewBidderOption>;
'Option<NextAuthority>': Option<NextAuthority>; 'Option<NextAuthority>': Option<NextAuthority>;
'Option<NextConfigDescriptor>': Option<NextConfigDescriptor>; 'Option<NextConfigDescriptor>': Option<NextConfigDescriptor>;
'Option<NextConfigDescriptorV1>': Option<NextConfigDescriptorV1>; 'Option<NextConfigDescriptorV1>': Option<NextConfigDescriptorV1>;
@@ -581,17 +599,17 @@ declare module '@polkadot/types/types/registry' {
'Option<OpenTipFinderTo225>': Option<OpenTipFinderTo225>; 'Option<OpenTipFinderTo225>': Option<OpenTipFinderTo225>;
'Option<OpenTipTip>': Option<OpenTipTip>; 'Option<OpenTipTip>': Option<OpenTipTip>;
'Option<OpenTipTo225>': Option<OpenTipTo225>; 'Option<OpenTipTo225>': Option<OpenTipTo225>;
'Option<Order>': Option<Order>;
'Option<Origin>': Option<Origin>; 'Option<Origin>': Option<Origin>;
'Option<OriginCaller>': Option<OriginCaller>; 'Option<OriginCaller>': Option<OriginCaller>;
'Option<OriginKind>': Option<OriginKind>;
'Option<OutboundHrmpMessage>': Option<OutboundHrmpMessage>; 'Option<OutboundHrmpMessage>': Option<OutboundHrmpMessage>;
'Option<Owner>': Option<Owner>; 'Option<Owner>': Option<Owner>;
'Option<PalletId>': Option<PalletId>;
'Option<PalletsOrigin>': Option<PalletsOrigin>; 'Option<PalletsOrigin>': Option<PalletsOrigin>;
'Option<PalletVersion>': Option<PalletVersion>; 'Option<PalletVersion>': Option<PalletVersion>;
'Option<ParachainDispatchOrigin>': Option<ParachainDispatchOrigin>; 'Option<ParachainDispatchOrigin>': Option<ParachainDispatchOrigin>;
'Option<ParachainInherentData>': Option<ParachainInherentData>; 'Option<ParachainInherentData>': Option<ParachainInherentData>;
'Option<ParachainProposal>': Option<ParachainProposal>; 'Option<ParachainProposal>': Option<ParachainProposal>;
'Option<ParachainsInherentData>': Option<ParachainsInherentData>;
'Option<ParaGenesisArgs>': Option<ParaGenesisArgs>; 'Option<ParaGenesisArgs>': Option<ParaGenesisArgs>;
'Option<ParaId>': Option<ParaId>; 'Option<ParaId>': Option<ParaId>;
'Option<ParaInfo>': Option<ParaInfo>; 'Option<ParaInfo>': Option<ParaInfo>;
@@ -630,7 +648,6 @@ declare module '@polkadot/types/types/registry' {
'Option<Points>': Option<Points>; 'Option<Points>': Option<Points>;
'Option<Precommits>': Option<Precommits>; 'Option<Precommits>': Option<Precommits>;
'Option<PrefabWasmModule>': Option<PrefabWasmModule>; 'Option<PrefabWasmModule>': Option<PrefabWasmModule>;
'Option<PrefabWasmModuleReserved>': Option<PrefabWasmModuleReserved>;
'Option<PrefixedStorageKey>': Option<PrefixedStorageKey>; 'Option<PrefixedStorageKey>': Option<PrefixedStorageKey>;
'Option<PreimageStatus>': Option<PreimageStatus>; 'Option<PreimageStatus>': Option<PreimageStatus>;
'Option<PreimageStatusAvailable>': Option<PreimageStatusAvailable>; 'Option<PreimageStatusAvailable>': Option<PreimageStatusAvailable>;
@@ -645,7 +662,6 @@ declare module '@polkadot/types/types/registry' {
'Option<ProxyDefinition>': Option<ProxyDefinition>; 'Option<ProxyDefinition>': Option<ProxyDefinition>;
'Option<ProxyState>': Option<ProxyState>; 'Option<ProxyState>': Option<ProxyState>;
'Option<ProxyType>': Option<ProxyType>; 'Option<ProxyType>': Option<ProxyType>;
'Option<QueryHolding>': Option<QueryHolding>;
'Option<QueuedParathread>': Option<QueuedParathread>; 'Option<QueuedParathread>': Option<QueuedParathread>;
'Option<Randomness>': Option<Randomness>; 'Option<Randomness>': Option<Randomness>;
'Option<Raw>': Option<Raw>; 'Option<Raw>': Option<Raw>;
@@ -679,15 +695,12 @@ declare module '@polkadot/types/types/registry' {
'Option<RegistrationJudgement>': Option<RegistrationJudgement>; 'Option<RegistrationJudgement>': Option<RegistrationJudgement>;
'Option<RelayChainBlockNumber>': Option<RelayChainBlockNumber>; 'Option<RelayChainBlockNumber>': Option<RelayChainBlockNumber>;
'Option<RelayChainHash>': Option<RelayChainHash>; 'Option<RelayChainHash>': Option<RelayChainHash>;
'Option<RelayedFrom>': Option<RelayedFrom>;
'Option<RelayTo>': Option<RelayTo>;
'Option<Releases>': Option<Releases>; 'Option<Releases>': Option<Releases>;
'Option<Remark>': Option<Remark>; 'Option<Remark>': Option<Remark>;
'Option<Renouncing>': Option<Renouncing>; 'Option<Renouncing>': Option<Renouncing>;
'Option<ReportedRoundStates>': Option<ReportedRoundStates>; 'Option<ReportedRoundStates>': Option<ReportedRoundStates>;
'Option<Reporter>': Option<Reporter>; 'Option<Reporter>': Option<Reporter>;
'Option<ReportIdOf>': Option<ReportIdOf>; 'Option<ReportIdOf>': Option<ReportIdOf>;
'Option<ReserveAssetDeposit>': Option<ReserveAssetDeposit>;
'Option<Retriable>': Option<Retriable>; 'Option<Retriable>': Option<Retriable>;
'Option<RewardDestination>': Option<RewardDestination>; 'Option<RewardDestination>': Option<RewardDestination>;
'Option<RewardPoint>': Option<RewardPoint>; 'Option<RewardPoint>': Option<RewardPoint>;
@@ -711,18 +724,25 @@ declare module '@polkadot/types/types/registry' {
'Option<SealV0>': Option<SealV0>; 'Option<SealV0>': Option<SealV0>;
'Option<SeatHolder>': Option<SeatHolder>; 'Option<SeatHolder>': Option<SeatHolder>;
'Option<SeedOf>': Option<SeedOf>; 'Option<SeedOf>': Option<SeedOf>;
'Option<ServiceQuality>': Option<ServiceQuality>;
'Option<SessionIndex>': Option<SessionIndex>; 'Option<SessionIndex>': Option<SessionIndex>;
'Option<SessionInfo>': Option<SessionInfo>; 'Option<SessionInfo>': Option<SessionInfo>;
'Option<SessionInfoValidatorGroup>': Option<SessionInfoValidatorGroup>; 'Option<SessionInfoValidatorGroup>': Option<SessionInfoValidatorGroup>;
'Option<SessionKeys1>': Option<SessionKeys1>; 'Option<SessionKeys1>': Option<SessionKeys1>;
'Option<SessionKeys10>': Option<SessionKeys10>;
'Option<SessionKeys10B>': Option<SessionKeys10B>;
'Option<SessionKeys2>': Option<SessionKeys2>; 'Option<SessionKeys2>': Option<SessionKeys2>;
'Option<SessionKeys3>': Option<SessionKeys3>; 'Option<SessionKeys3>': Option<SessionKeys3>;
'Option<SessionKeys4>': Option<SessionKeys4>; 'Option<SessionKeys4>': Option<SessionKeys4>;
'Option<SessionKeys5>': Option<SessionKeys5>; 'Option<SessionKeys5>': Option<SessionKeys5>;
'Option<SessionKeys6>': Option<SessionKeys6>; 'Option<SessionKeys6>': Option<SessionKeys6>;
'Option<SessionKeys6B>': Option<SessionKeys6B>;
'Option<SessionKeys7>': Option<SessionKeys7>; 'Option<SessionKeys7>': Option<SessionKeys7>;
'Option<SessionKeys7B>': Option<SessionKeys7B>;
'Option<SessionKeys8>': Option<SessionKeys8>; 'Option<SessionKeys8>': Option<SessionKeys8>;
'Option<SessionKeys8B>': Option<SessionKeys8B>;
'Option<SessionKeys9>': Option<SessionKeys9>; 'Option<SessionKeys9>': Option<SessionKeys9>;
'Option<SessionKeys9B>': Option<SessionKeys9B>;
'Option<SetId>': Option<SetId>; 'Option<SetId>': Option<SetId>;
'Option<SetIndex>': Option<SetIndex>; 'Option<SetIndex>': Option<SetIndex>;
'Option<SiField>': Option<SiField>; 'Option<SiField>': Option<SiField>;
@@ -730,6 +750,8 @@ declare module '@polkadot/types/types/registry' {
'Option<SignedAvailabilityBitfield>': Option<SignedAvailabilityBitfield>; 'Option<SignedAvailabilityBitfield>': Option<SignedAvailabilityBitfield>;
'Option<SignedAvailabilityBitfields>': Option<SignedAvailabilityBitfields>; 'Option<SignedAvailabilityBitfields>': Option<SignedAvailabilityBitfields>;
'Option<SignedBlock>': Option<SignedBlock>; 'Option<SignedBlock>': Option<SignedBlock>;
'Option<SignedBlockWithJustification>': Option<SignedBlockWithJustification>;
'Option<SignedBlockWithJustifications>': Option<SignedBlockWithJustifications>;
'Option<SignerPayload>': Option<SignerPayload>; 'Option<SignerPayload>': Option<SignerPayload>;
'Option<SigningContext>': Option<SigningContext>; 'Option<SigningContext>': Option<SigningContext>;
'Option<SiLookupTypeId>': Option<SiLookupTypeId>; 'Option<SiLookupTypeId>': Option<SiLookupTypeId>;
@@ -803,16 +825,15 @@ declare module '@polkadot/types/types/registry' {
'Option<TaskAddress>': Option<TaskAddress>; 'Option<TaskAddress>': Option<TaskAddress>;
'Option<TAssetBalance>': Option<TAssetBalance>; 'Option<TAssetBalance>': Option<TAssetBalance>;
'Option<TAssetDepositBalance>': Option<TAssetDepositBalance>; 'Option<TAssetDepositBalance>': Option<TAssetDepositBalance>;
'Option<TeleportAsset>': Option<TeleportAsset>;
'Option<Text>': Option<Text>; 'Option<Text>': Option<Text>;
'Option<Timepoint>': Option<Timepoint>; 'Option<Timepoint>': Option<Timepoint>;
'Option<TombstoneContractInfo>': Option<TombstoneContractInfo>; 'Option<TombstoneContractInfo>': Option<TombstoneContractInfo>;
'Option<Transact>': Option<Transact>;
'Option<TransactionPriority>': Option<TransactionPriority>; 'Option<TransactionPriority>': Option<TransactionPriority>;
'Option<TransactionValidityError>': Option<TransactionValidityError>; 'Option<TransactionValidityError>': Option<TransactionValidityError>;
'Option<TransientValidationData>': Option<TransientValidationData>; 'Option<TransientValidationData>': Option<TransientValidationData>;
'Option<TreasuryProposal>': Option<TreasuryProposal>; 'Option<TreasuryProposal>': Option<TreasuryProposal>;
'Option<TrieId>': Option<TrieId>; 'Option<TrieId>': Option<TrieId>;
'Option<TrieIndex>': Option<TrieIndex>;
'Option<Type>': Option<Type>; 'Option<Type>': Option<Type>;
'Option<u128>': Option<u128>; 'Option<u128>': Option<u128>;
'Option<U128>': Option<U128>; 'Option<U128>': Option<U128>;
@@ -849,7 +870,9 @@ declare module '@polkadot/types/types/registry' {
'Option<ValidatorPrefsTo196>': Option<ValidatorPrefsTo196>; 'Option<ValidatorPrefsTo196>': Option<ValidatorPrefsTo196>;
'Option<ValidatorPrefsWithBlocked>': Option<ValidatorPrefsWithBlocked>; 'Option<ValidatorPrefsWithBlocked>': Option<ValidatorPrefsWithBlocked>;
'Option<ValidatorPrefsWithCommission>': Option<ValidatorPrefsWithCommission>; 'Option<ValidatorPrefsWithCommission>': Option<ValidatorPrefsWithCommission>;
'Option<ValidatorSetId>': Option<ValidatorSetId>;
'Option<ValidatorSignature>': Option<ValidatorSignature>; 'Option<ValidatorSignature>': Option<ValidatorSignature>;
'Option<ValidDisputeStatementKind>': Option<ValidDisputeStatementKind>;
'Option<ValidityAttestation>': Option<ValidityAttestation>; 'Option<ValidityAttestation>': Option<ValidityAttestation>;
'Option<VecInboundHrmpMessage>': Option<VecInboundHrmpMessage>; 'Option<VecInboundHrmpMessage>': Option<VecInboundHrmpMessage>;
'Option<VersionedMultiAsset>': Option<VersionedMultiAsset>; 'Option<VersionedMultiAsset>': Option<VersionedMultiAsset>;
@@ -881,16 +904,35 @@ declare module '@polkadot/types/types/registry' {
'Option<WinnersDataTuple>': Option<WinnersDataTuple>; 'Option<WinnersDataTuple>': Option<WinnersDataTuple>;
'Option<WinningData>': Option<WinningData>; 'Option<WinningData>': Option<WinningData>;
'Option<WinningDataEntry>': Option<WinningDataEntry>; 'Option<WinningDataEntry>': Option<WinningDataEntry>;
'Option<WithdrawAsset>': Option<WithdrawAsset>;
'Option<WithdrawReasons>': Option<WithdrawReasons>; 'Option<WithdrawReasons>': Option<WithdrawReasons>;
'Option<Xcm>': Option<Xcm>; 'Option<Xcm>': Option<Xcm>;
'Option<XcmAssetEffects>': Option<XcmAssetEffects>;
'Option<XcmError>': Option<XcmError>; 'Option<XcmError>': Option<XcmError>;
'Option<XcmResult>': Option<XcmResult>; 'Option<XcmHrmpChannelAccepted>': Option<XcmHrmpChannelAccepted>;
'Option<XcmHrmpChannelClosing>': Option<XcmHrmpChannelClosing>;
'Option<XcmHrmpNewChannelOpenRequest>': Option<XcmHrmpNewChannelOpenRequest>;
'Option<XcmOrder>': Option<XcmOrder>;
'Option<XcmOrderBuyExecution>': Option<XcmOrderBuyExecution>;
'Option<XcmOrderDepositAsset>': Option<XcmOrderDepositAsset>;
'Option<XcmOrderDepositReserveAsset>': Option<XcmOrderDepositReserveAsset>;
'Option<XcmOrderExchangeAsset>': Option<XcmOrderExchangeAsset>;
'Option<XcmOrderInitiateReserveWithdraw>': Option<XcmOrderInitiateReserveWithdraw>;
'Option<XcmOrderInitiateTeleport>': Option<XcmOrderInitiateTeleport>;
'Option<XcmOrderQueryHolding>': Option<XcmOrderQueryHolding>;
'Option<XcmOriginKind>': Option<XcmOriginKind>;
'Option<XcmOutcome>': Option<XcmOutcome>;
'Option<XcmQueryResponse>': Option<XcmQueryResponse>;
'Option<XcmRelayedFrom>': Option<XcmRelayedFrom>;
'Option<XcmReserveAssetDeposit>': Option<XcmReserveAssetDeposit>;
'Option<XcmResponse>': Option<XcmResponse>;
'Option<XcmTeleportAsset>': Option<XcmTeleportAsset>;
'Option<XcmTransact>': Option<XcmTransact>;
'Option<XcmTransferAsset>': Option<XcmTransferAsset>;
'Option<XcmTransferReserveAsset>': Option<XcmTransferReserveAsset>;
'Option<XcmWithdrawAsset>': Option<XcmWithdrawAsset>;
'Vec<AbridgedCandidateReceipt>': Vec<AbridgedCandidateReceipt>; 'Vec<AbridgedCandidateReceipt>': Vec<AbridgedCandidateReceipt>;
'Vec<AbridgedHostConfiguration>': Vec<AbridgedHostConfiguration>; 'Vec<AbridgedHostConfiguration>': Vec<AbridgedHostConfiguration>;
'Vec<AbridgedHrmpChannel>': Vec<AbridgedHrmpChannel>; 'Vec<AbridgedHrmpChannel>': Vec<AbridgedHrmpChannel>;
'Vec<AbstractFungible>': Vec<AbstractFungible>;
'Vec<AbstractNonFungible>': Vec<AbstractNonFungible>;
'Vec<AccountData>': Vec<AccountData>; 'Vec<AccountData>': Vec<AccountData>;
'Vec<AccountId>': Vec<AccountId>; 'Vec<AccountId>': Vec<AccountId>;
'Vec<AccountId32Junction>': Vec<AccountId32Junction>; 'Vec<AccountId32Junction>': Vec<AccountId32Junction>;
@@ -921,7 +963,10 @@ declare module '@polkadot/types/types/registry' {
'Vec<ApplyExtrinsicResult>': Vec<ApplyExtrinsicResult>; 'Vec<ApplyExtrinsicResult>': Vec<ApplyExtrinsicResult>;
'Vec<ApprovalFlag>': Vec<ApprovalFlag>; 'Vec<ApprovalFlag>': Vec<ApprovalFlag>;
'Vec<Approvals>': Vec<Approvals>; 'Vec<Approvals>': Vec<Approvals>;
'Vec<AssetApproval>': Vec<AssetApproval>;
'Vec<AssetApprovalKey>': Vec<AssetApprovalKey>;
'Vec<AssetBalance>': Vec<AssetBalance>; 'Vec<AssetBalance>': Vec<AssetBalance>;
'Vec<AssetDestroyWitness>': Vec<AssetDestroyWitness>;
'Vec<AssetDetails>': Vec<AssetDetails>; 'Vec<AssetDetails>': Vec<AssetDetails>;
'Vec<AssetId>': Vec<AssetId>; 'Vec<AssetId>': Vec<AssetId>;
'Vec<AssetInstance>': Vec<AssetInstance>; 'Vec<AssetInstance>': Vec<AssetInstance>;
@@ -942,6 +987,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<AvailabilityBitfieldRecord>': Vec<AvailabilityBitfieldRecord>; 'Vec<AvailabilityBitfieldRecord>': Vec<AvailabilityBitfieldRecord>;
'Vec<BabeAuthorityWeight>': Vec<BabeAuthorityWeight>; 'Vec<BabeAuthorityWeight>': Vec<BabeAuthorityWeight>;
'Vec<BabeBlockWeight>': Vec<BabeBlockWeight>; 'Vec<BabeBlockWeight>': Vec<BabeBlockWeight>;
'Vec<BabeEpochConfiguration>': Vec<BabeEpochConfiguration>;
'Vec<BabeEquivocationProof>': Vec<BabeEquivocationProof>; 'Vec<BabeEquivocationProof>': Vec<BabeEquivocationProof>;
'Vec<BabeWeight>': Vec<BabeWeight>; 'Vec<BabeWeight>': Vec<BabeWeight>;
'Vec<BackedCandidate>': Vec<BackedCandidate>; 'Vec<BackedCandidate>': Vec<BackedCandidate>;
@@ -949,8 +995,12 @@ declare module '@polkadot/types/types/registry' {
'Vec<BalanceLock>': Vec<BalanceLock>; 'Vec<BalanceLock>': Vec<BalanceLock>;
'Vec<BalanceLockTo212>': Vec<BalanceLockTo212>; 'Vec<BalanceLockTo212>': Vec<BalanceLockTo212>;
'Vec<BalanceOf>': Vec<BalanceOf>; 'Vec<BalanceOf>': Vec<BalanceOf>;
'Vec<Balances>': Vec<Balances>;
'Vec<BalanceStatus>': Vec<BalanceStatus>; 'Vec<BalanceStatus>': Vec<BalanceStatus>;
'Vec<BeefyCommitment>': Vec<BeefyCommitment>;
'Vec<BeefyKey>': Vec<BeefyKey>;
'Vec<BeefyNextAuthoritySet>': Vec<BeefyNextAuthoritySet>;
'Vec<BeefyPayload>': Vec<BeefyPayload>;
'Vec<BeefySignedCommitment>': Vec<BeefySignedCommitment>;
'Vec<Bid>': Vec<Bid>; 'Vec<Bid>': Vec<Bid>;
'Vec<Bidder>': Vec<Bidder>; 'Vec<Bidder>': Vec<Bidder>;
'Vec<BidKind>': Vec<BidKind>; 'Vec<BidKind>': Vec<BidKind>;
@@ -993,8 +1043,6 @@ declare module '@polkadot/types/types/registry' {
'Vec<CompactAssignmentsTo257>': Vec<CompactAssignmentsTo257>; 'Vec<CompactAssignmentsTo257>': Vec<CompactAssignmentsTo257>;
'Vec<CompactScore>': Vec<CompactScore>; 'Vec<CompactScore>': Vec<CompactScore>;
'Vec<CompactScoreCompact>': Vec<CompactScoreCompact>; 'Vec<CompactScoreCompact>': Vec<CompactScoreCompact>;
'Vec<ConcreteFungible>': Vec<ConcreteFungible>;
'Vec<ConcreteNonFungible>': Vec<ConcreteNonFungible>;
'Vec<Consensus>': Vec<Consensus>; 'Vec<Consensus>': Vec<Consensus>;
'Vec<ConsensusEngineId>': Vec<ConsensusEngineId>; 'Vec<ConsensusEngineId>': Vec<ConsensusEngineId>;
'Vec<ConsumedWeight>': Vec<ConsumedWeight>; 'Vec<ConsumedWeight>': Vec<ConsumedWeight>;
@@ -1043,9 +1091,6 @@ declare module '@polkadot/types/types/registry' {
'Vec<DefunctVoter>': Vec<DefunctVoter>; 'Vec<DefunctVoter>': Vec<DefunctVoter>;
'Vec<Delegations>': Vec<Delegations>; 'Vec<Delegations>': Vec<Delegations>;
'Vec<DeletedContract>': Vec<DeletedContract>; 'Vec<DeletedContract>': Vec<DeletedContract>;
'Vec<DeployData>': Vec<DeployData>;
'Vec<DepositAsset>': Vec<DepositAsset>;
'Vec<DepositReserveAsset>': Vec<DepositReserveAsset>;
'Vec<Digest>': Vec<Digest>; 'Vec<Digest>': Vec<Digest>;
'Vec<DigestItem>': Vec<DigestItem>; 'Vec<DigestItem>': Vec<DigestItem>;
'Vec<DigestOf>': Vec<DigestOf>; 'Vec<DigestOf>': Vec<DigestOf>;
@@ -1060,7 +1105,10 @@ declare module '@polkadot/types/types/registry' {
'Vec<DispatchResult>': Vec<DispatchResult>; 'Vec<DispatchResult>': Vec<DispatchResult>;
'Vec<DispatchResultOf>': Vec<DispatchResultOf>; 'Vec<DispatchResultOf>': Vec<DispatchResultOf>;
'Vec<DispatchResultTo198>': Vec<DispatchResultTo198>; 'Vec<DispatchResultTo198>': Vec<DispatchResultTo198>;
'Vec<DisputeStatement>': Vec<DisputeStatement>;
'Vec<DisputeStatementSet>': Vec<DisputeStatementSet>;
'Vec<DoNotConstruct>': Vec<DoNotConstruct>; 'Vec<DoNotConstruct>': Vec<DoNotConstruct>;
'Vec<DoubleEncodedCall>': Vec<DoubleEncodedCall>;
'Vec<DoubleMapTypeLatest>': Vec<DoubleMapTypeLatest>; 'Vec<DoubleMapTypeLatest>': Vec<DoubleMapTypeLatest>;
'Vec<DoubleMapTypeV10>': Vec<DoubleMapTypeV10>; 'Vec<DoubleMapTypeV10>': Vec<DoubleMapTypeV10>;
'Vec<DoubleMapTypeV11>': Vec<DoubleMapTypeV11>; 'Vec<DoubleMapTypeV11>': Vec<DoubleMapTypeV11>;
@@ -1077,6 +1125,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<ElectionSize>': Vec<ElectionSize>; 'Vec<ElectionSize>': Vec<ElectionSize>;
'Vec<ElectionStatus>': Vec<ElectionStatus>; 'Vec<ElectionStatus>': Vec<ElectionStatus>;
'Vec<EncodedFinalityProofs>': Vec<EncodedFinalityProofs>; 'Vec<EncodedFinalityProofs>': Vec<EncodedFinalityProofs>;
'Vec<EncodedJustification>': Vec<EncodedJustification>;
'Vec<EpochAuthorship>': Vec<EpochAuthorship>; 'Vec<EpochAuthorship>': Vec<EpochAuthorship>;
'Vec<EraIndex>': Vec<EraIndex>; 'Vec<EraIndex>': Vec<EraIndex>;
'Vec<EraPoints>': Vec<EraPoints>; 'Vec<EraPoints>': Vec<EraPoints>;
@@ -1130,12 +1179,12 @@ declare module '@polkadot/types/types/registry' {
'Vec<EvmAccount>': Vec<EvmAccount>; 'Vec<EvmAccount>': Vec<EvmAccount>;
'Vec<EvmLog>': Vec<EvmLog>; 'Vec<EvmLog>': Vec<EvmLog>;
'Vec<EvmVicinity>': Vec<EvmVicinity>; 'Vec<EvmVicinity>': Vec<EvmVicinity>;
'Vec<ExchangeAsset>': Vec<ExchangeAsset>;
'Vec<ExitError>': Vec<ExitError>; 'Vec<ExitError>': Vec<ExitError>;
'Vec<ExitFatal>': Vec<ExitFatal>; 'Vec<ExitFatal>': Vec<ExitFatal>;
'Vec<ExitReason>': Vec<ExitReason>; 'Vec<ExitReason>': Vec<ExitReason>;
'Vec<ExitRevert>': Vec<ExitRevert>; 'Vec<ExitRevert>': Vec<ExitRevert>;
'Vec<ExitSucceed>': Vec<ExitSucceed>; 'Vec<ExitSucceed>': Vec<ExitSucceed>;
'Vec<ExplicitDisputeStatement>': Vec<ExplicitDisputeStatement>;
'Vec<Exposure>': Vec<Exposure>; 'Vec<Exposure>': Vec<Exposure>;
'Vec<ExtendedBalance>': Vec<ExtendedBalance>; 'Vec<ExtendedBalance>': Vec<ExtendedBalance>;
'Vec<Extrinsic>': Vec<Extrinsic>; 'Vec<Extrinsic>': Vec<Extrinsic>;
@@ -1176,6 +1225,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<FundInfo>': Vec<FundInfo>; 'Vec<FundInfo>': Vec<FundInfo>;
'Vec<Gas>': Vec<Gas>; 'Vec<Gas>': Vec<Gas>;
'Vec<GiltBid>': Vec<GiltBid>; 'Vec<GiltBid>': Vec<GiltBid>;
'Vec<GlobalValidationData>': Vec<GlobalValidationData>;
'Vec<GlobalValidationSchedule>': Vec<GlobalValidationSchedule>; 'Vec<GlobalValidationSchedule>': Vec<GlobalValidationSchedule>;
'Vec<GrandpaEquivocation>': Vec<GrandpaEquivocation>; 'Vec<GrandpaEquivocation>': Vec<GrandpaEquivocation>;
'Vec<GrandpaEquivocationProof>': Vec<GrandpaEquivocationProof>; 'Vec<GrandpaEquivocationProof>': Vec<GrandpaEquivocationProof>;
@@ -1232,14 +1282,14 @@ declare module '@polkadot/types/types/registry' {
'Vec<Index>': Vec<Index>; 'Vec<Index>': Vec<Index>;
'Vec<IndicesLookupSource>': Vec<IndicesLookupSource>; 'Vec<IndicesLookupSource>': Vec<IndicesLookupSource>;
'Vec<IndividualExposure>': Vec<IndividualExposure>; 'Vec<IndividualExposure>': Vec<IndividualExposure>;
'Vec<InitiateReserveWithdraw>': Vec<InitiateReserveWithdraw>;
'Vec<InitiateTeleport>': Vec<InitiateTeleport>;
'Vec<InstructionWeights>': Vec<InstructionWeights>; 'Vec<InstructionWeights>': Vec<InstructionWeights>;
'Vec<InvalidDisputeStatementKind>': Vec<InvalidDisputeStatementKind>;
'Vec<InvalidTransaction>': Vec<InvalidTransaction>; 'Vec<InvalidTransaction>': Vec<InvalidTransaction>;
'Vec<Json>': Vec<Json>; 'Vec<Json>': Vec<Json>;
'Vec<Junction>': Vec<Junction>; 'Vec<Junction>': Vec<Junction>;
'Vec<Justification>': Vec<Justification>; 'Vec<Justification>': Vec<Justification>;
'Vec<JustificationNotification>': Vec<JustificationNotification>; 'Vec<JustificationNotification>': Vec<JustificationNotification>;
'Vec<Justifications>': Vec<Justifications>;
'Vec<Key>': Vec<Key>; 'Vec<Key>': Vec<Key>;
'Vec<KeyOwnerProof>': Vec<KeyOwnerProof>; 'Vec<KeyOwnerProof>': Vec<KeyOwnerProof>;
'Vec<Keys>': Vec<Keys>; 'Vec<Keys>': Vec<Keys>;
@@ -1278,6 +1328,8 @@ declare module '@polkadot/types/types/registry' {
'Vec<MetadataV11>': Vec<MetadataV11>; 'Vec<MetadataV11>': Vec<MetadataV11>;
'Vec<MetadataV12>': Vec<MetadataV12>; 'Vec<MetadataV12>': Vec<MetadataV12>;
'Vec<MetadataV9>': Vec<MetadataV9>; 'Vec<MetadataV9>': Vec<MetadataV9>;
'Vec<MmrLeafProof>': Vec<MmrLeafProof>;
'Vec<MmrRootHash>': Vec<MmrRootHash>;
'Vec<ModuleConstantMetadataLatest>': Vec<ModuleConstantMetadataLatest>; 'Vec<ModuleConstantMetadataLatest>': Vec<ModuleConstantMetadataLatest>;
'Vec<ModuleConstantMetadataV10>': Vec<ModuleConstantMetadataV10>; 'Vec<ModuleConstantMetadataV10>': Vec<ModuleConstantMetadataV10>;
'Vec<ModuleConstantMetadataV11>': Vec<ModuleConstantMetadataV11>; 'Vec<ModuleConstantMetadataV11>': Vec<ModuleConstantMetadataV11>;
@@ -1295,16 +1347,21 @@ declare module '@polkadot/types/types/registry' {
'Vec<MortalEra>': Vec<MortalEra>; 'Vec<MortalEra>': Vec<MortalEra>;
'Vec<MultiAddress>': Vec<MultiAddress>; 'Vec<MultiAddress>': Vec<MultiAddress>;
'Vec<MultiAsset>': Vec<MultiAsset>; 'Vec<MultiAsset>': Vec<MultiAsset>;
'Vec<MultiAssetAbstractFungible>': Vec<MultiAssetAbstractFungible>;
'Vec<MultiAssetAbstractNonFungible>': Vec<MultiAssetAbstractNonFungible>;
'Vec<MultiAssetConcreteFungible>': Vec<MultiAssetConcreteFungible>;
'Vec<MultiAssetConcreteNonFungible>': Vec<MultiAssetConcreteNonFungible>;
'Vec<MultiDisputeStatementSet>': Vec<MultiDisputeStatementSet>;
'Vec<MultiLocation>': Vec<MultiLocation>; 'Vec<MultiLocation>': Vec<MultiLocation>;
'Vec<Multiplier>': Vec<Multiplier>; 'Vec<Multiplier>': Vec<Multiplier>;
'Vec<Multisig>': Vec<Multisig>; 'Vec<Multisig>': Vec<Multisig>;
'Vec<MultiSignature>': Vec<MultiSignature>; 'Vec<MultiSignature>': Vec<MultiSignature>;
'Vec<MultiSigner>': Vec<MultiSigner>;
'Vec<NetworkId>': Vec<NetworkId>; 'Vec<NetworkId>': Vec<NetworkId>;
'Vec<NetworkState>': Vec<NetworkState>; 'Vec<NetworkState>': Vec<NetworkState>;
'Vec<NetworkStatePeerset>': Vec<NetworkStatePeerset>; 'Vec<NetworkStatePeerset>': Vec<NetworkStatePeerset>;
'Vec<NetworkStatePeersetInfo>': Vec<NetworkStatePeersetInfo>; 'Vec<NetworkStatePeersetInfo>': Vec<NetworkStatePeersetInfo>;
'Vec<NewBidder>': Vec<NewBidder>; 'Vec<NewBidder>': Vec<NewBidder>;
'Vec<NewBidderOption>': Vec<NewBidderOption>;
'Vec<NextAuthority>': Vec<NextAuthority>; 'Vec<NextAuthority>': Vec<NextAuthority>;
'Vec<NextConfigDescriptor>': Vec<NextConfigDescriptor>; 'Vec<NextConfigDescriptor>': Vec<NextConfigDescriptor>;
'Vec<NextConfigDescriptorV1>': Vec<NextConfigDescriptorV1>; 'Vec<NextConfigDescriptorV1>': Vec<NextConfigDescriptorV1>;
@@ -1327,17 +1384,17 @@ declare module '@polkadot/types/types/registry' {
'Vec<OpenTipFinderTo225>': Vec<OpenTipFinderTo225>; 'Vec<OpenTipFinderTo225>': Vec<OpenTipFinderTo225>;
'Vec<OpenTipTip>': Vec<OpenTipTip>; 'Vec<OpenTipTip>': Vec<OpenTipTip>;
'Vec<OpenTipTo225>': Vec<OpenTipTo225>; 'Vec<OpenTipTo225>': Vec<OpenTipTo225>;
'Vec<Order>': Vec<Order>;
'Vec<Origin>': Vec<Origin>; 'Vec<Origin>': Vec<Origin>;
'Vec<OriginCaller>': Vec<OriginCaller>; 'Vec<OriginCaller>': Vec<OriginCaller>;
'Vec<OriginKind>': Vec<OriginKind>;
'Vec<OutboundHrmpMessage>': Vec<OutboundHrmpMessage>; 'Vec<OutboundHrmpMessage>': Vec<OutboundHrmpMessage>;
'Vec<Owner>': Vec<Owner>; 'Vec<Owner>': Vec<Owner>;
'Vec<PalletId>': Vec<PalletId>;
'Vec<PalletsOrigin>': Vec<PalletsOrigin>; 'Vec<PalletsOrigin>': Vec<PalletsOrigin>;
'Vec<PalletVersion>': Vec<PalletVersion>; 'Vec<PalletVersion>': Vec<PalletVersion>;
'Vec<ParachainDispatchOrigin>': Vec<ParachainDispatchOrigin>; 'Vec<ParachainDispatchOrigin>': Vec<ParachainDispatchOrigin>;
'Vec<ParachainInherentData>': Vec<ParachainInherentData>; 'Vec<ParachainInherentData>': Vec<ParachainInherentData>;
'Vec<ParachainProposal>': Vec<ParachainProposal>; 'Vec<ParachainProposal>': Vec<ParachainProposal>;
'Vec<ParachainsInherentData>': Vec<ParachainsInherentData>;
'Vec<ParaGenesisArgs>': Vec<ParaGenesisArgs>; 'Vec<ParaGenesisArgs>': Vec<ParaGenesisArgs>;
'Vec<ParaId>': Vec<ParaId>; 'Vec<ParaId>': Vec<ParaId>;
'Vec<ParaInfo>': Vec<ParaInfo>; 'Vec<ParaInfo>': Vec<ParaInfo>;
@@ -1376,7 +1433,6 @@ declare module '@polkadot/types/types/registry' {
'Vec<Points>': Vec<Points>; 'Vec<Points>': Vec<Points>;
'Vec<Precommits>': Vec<Precommits>; 'Vec<Precommits>': Vec<Precommits>;
'Vec<PrefabWasmModule>': Vec<PrefabWasmModule>; 'Vec<PrefabWasmModule>': Vec<PrefabWasmModule>;
'Vec<PrefabWasmModuleReserved>': Vec<PrefabWasmModuleReserved>;
'Vec<PrefixedStorageKey>': Vec<PrefixedStorageKey>; 'Vec<PrefixedStorageKey>': Vec<PrefixedStorageKey>;
'Vec<PreimageStatus>': Vec<PreimageStatus>; 'Vec<PreimageStatus>': Vec<PreimageStatus>;
'Vec<PreimageStatusAvailable>': Vec<PreimageStatusAvailable>; 'Vec<PreimageStatusAvailable>': Vec<PreimageStatusAvailable>;
@@ -1391,7 +1447,6 @@ declare module '@polkadot/types/types/registry' {
'Vec<ProxyDefinition>': Vec<ProxyDefinition>; 'Vec<ProxyDefinition>': Vec<ProxyDefinition>;
'Vec<ProxyState>': Vec<ProxyState>; 'Vec<ProxyState>': Vec<ProxyState>;
'Vec<ProxyType>': Vec<ProxyType>; 'Vec<ProxyType>': Vec<ProxyType>;
'Vec<QueryHolding>': Vec<QueryHolding>;
'Vec<QueuedParathread>': Vec<QueuedParathread>; 'Vec<QueuedParathread>': Vec<QueuedParathread>;
'Vec<Randomness>': Vec<Randomness>; 'Vec<Randomness>': Vec<Randomness>;
'Vec<Raw>': Vec<Raw>; 'Vec<Raw>': Vec<Raw>;
@@ -1425,15 +1480,12 @@ declare module '@polkadot/types/types/registry' {
'Vec<RegistrationJudgement>': Vec<RegistrationJudgement>; 'Vec<RegistrationJudgement>': Vec<RegistrationJudgement>;
'Vec<RelayChainBlockNumber>': Vec<RelayChainBlockNumber>; 'Vec<RelayChainBlockNumber>': Vec<RelayChainBlockNumber>;
'Vec<RelayChainHash>': Vec<RelayChainHash>; 'Vec<RelayChainHash>': Vec<RelayChainHash>;
'Vec<RelayedFrom>': Vec<RelayedFrom>;
'Vec<RelayTo>': Vec<RelayTo>;
'Vec<Releases>': Vec<Releases>; 'Vec<Releases>': Vec<Releases>;
'Vec<Remark>': Vec<Remark>; 'Vec<Remark>': Vec<Remark>;
'Vec<Renouncing>': Vec<Renouncing>; 'Vec<Renouncing>': Vec<Renouncing>;
'Vec<ReportedRoundStates>': Vec<ReportedRoundStates>; 'Vec<ReportedRoundStates>': Vec<ReportedRoundStates>;
'Vec<Reporter>': Vec<Reporter>; 'Vec<Reporter>': Vec<Reporter>;
'Vec<ReportIdOf>': Vec<ReportIdOf>; 'Vec<ReportIdOf>': Vec<ReportIdOf>;
'Vec<ReserveAssetDeposit>': Vec<ReserveAssetDeposit>;
'Vec<Retriable>': Vec<Retriable>; 'Vec<Retriable>': Vec<Retriable>;
'Vec<RewardDestination>': Vec<RewardDestination>; 'Vec<RewardDestination>': Vec<RewardDestination>;
'Vec<RewardPoint>': Vec<RewardPoint>; 'Vec<RewardPoint>': Vec<RewardPoint>;
@@ -1457,18 +1509,25 @@ declare module '@polkadot/types/types/registry' {
'Vec<SealV0>': Vec<SealV0>; 'Vec<SealV0>': Vec<SealV0>;
'Vec<SeatHolder>': Vec<SeatHolder>; 'Vec<SeatHolder>': Vec<SeatHolder>;
'Vec<SeedOf>': Vec<SeedOf>; 'Vec<SeedOf>': Vec<SeedOf>;
'Vec<ServiceQuality>': Vec<ServiceQuality>;
'Vec<SessionIndex>': Vec<SessionIndex>; 'Vec<SessionIndex>': Vec<SessionIndex>;
'Vec<SessionInfo>': Vec<SessionInfo>; 'Vec<SessionInfo>': Vec<SessionInfo>;
'Vec<SessionInfoValidatorGroup>': Vec<SessionInfoValidatorGroup>; 'Vec<SessionInfoValidatorGroup>': Vec<SessionInfoValidatorGroup>;
'Vec<SessionKeys1>': Vec<SessionKeys1>; 'Vec<SessionKeys1>': Vec<SessionKeys1>;
'Vec<SessionKeys10>': Vec<SessionKeys10>;
'Vec<SessionKeys10B>': Vec<SessionKeys10B>;
'Vec<SessionKeys2>': Vec<SessionKeys2>; 'Vec<SessionKeys2>': Vec<SessionKeys2>;
'Vec<SessionKeys3>': Vec<SessionKeys3>; 'Vec<SessionKeys3>': Vec<SessionKeys3>;
'Vec<SessionKeys4>': Vec<SessionKeys4>; 'Vec<SessionKeys4>': Vec<SessionKeys4>;
'Vec<SessionKeys5>': Vec<SessionKeys5>; 'Vec<SessionKeys5>': Vec<SessionKeys5>;
'Vec<SessionKeys6>': Vec<SessionKeys6>; 'Vec<SessionKeys6>': Vec<SessionKeys6>;
'Vec<SessionKeys6B>': Vec<SessionKeys6B>;
'Vec<SessionKeys7>': Vec<SessionKeys7>; 'Vec<SessionKeys7>': Vec<SessionKeys7>;
'Vec<SessionKeys7B>': Vec<SessionKeys7B>;
'Vec<SessionKeys8>': Vec<SessionKeys8>; 'Vec<SessionKeys8>': Vec<SessionKeys8>;
'Vec<SessionKeys8B>': Vec<SessionKeys8B>;
'Vec<SessionKeys9>': Vec<SessionKeys9>; 'Vec<SessionKeys9>': Vec<SessionKeys9>;
'Vec<SessionKeys9B>': Vec<SessionKeys9B>;
'Vec<SetId>': Vec<SetId>; 'Vec<SetId>': Vec<SetId>;
'Vec<SetIndex>': Vec<SetIndex>; 'Vec<SetIndex>': Vec<SetIndex>;
'Vec<SiField>': Vec<SiField>; 'Vec<SiField>': Vec<SiField>;
@@ -1476,6 +1535,8 @@ declare module '@polkadot/types/types/registry' {
'Vec<SignedAvailabilityBitfield>': Vec<SignedAvailabilityBitfield>; 'Vec<SignedAvailabilityBitfield>': Vec<SignedAvailabilityBitfield>;
'Vec<SignedAvailabilityBitfields>': Vec<SignedAvailabilityBitfields>; 'Vec<SignedAvailabilityBitfields>': Vec<SignedAvailabilityBitfields>;
'Vec<SignedBlock>': Vec<SignedBlock>; 'Vec<SignedBlock>': Vec<SignedBlock>;
'Vec<SignedBlockWithJustification>': Vec<SignedBlockWithJustification>;
'Vec<SignedBlockWithJustifications>': Vec<SignedBlockWithJustifications>;
'Vec<SignerPayload>': Vec<SignerPayload>; 'Vec<SignerPayload>': Vec<SignerPayload>;
'Vec<SigningContext>': Vec<SigningContext>; 'Vec<SigningContext>': Vec<SigningContext>;
'Vec<SiLookupTypeId>': Vec<SiLookupTypeId>; 'Vec<SiLookupTypeId>': Vec<SiLookupTypeId>;
@@ -1549,16 +1610,15 @@ declare module '@polkadot/types/types/registry' {
'Vec<TaskAddress>': Vec<TaskAddress>; 'Vec<TaskAddress>': Vec<TaskAddress>;
'Vec<TAssetBalance>': Vec<TAssetBalance>; 'Vec<TAssetBalance>': Vec<TAssetBalance>;
'Vec<TAssetDepositBalance>': Vec<TAssetDepositBalance>; 'Vec<TAssetDepositBalance>': Vec<TAssetDepositBalance>;
'Vec<TeleportAsset>': Vec<TeleportAsset>;
'Vec<Text>': Vec<Text>; 'Vec<Text>': Vec<Text>;
'Vec<Timepoint>': Vec<Timepoint>; 'Vec<Timepoint>': Vec<Timepoint>;
'Vec<TombstoneContractInfo>': Vec<TombstoneContractInfo>; 'Vec<TombstoneContractInfo>': Vec<TombstoneContractInfo>;
'Vec<Transact>': Vec<Transact>;
'Vec<TransactionPriority>': Vec<TransactionPriority>; 'Vec<TransactionPriority>': Vec<TransactionPriority>;
'Vec<TransactionValidityError>': Vec<TransactionValidityError>; 'Vec<TransactionValidityError>': Vec<TransactionValidityError>;
'Vec<TransientValidationData>': Vec<TransientValidationData>; 'Vec<TransientValidationData>': Vec<TransientValidationData>;
'Vec<TreasuryProposal>': Vec<TreasuryProposal>; 'Vec<TreasuryProposal>': Vec<TreasuryProposal>;
'Vec<TrieId>': Vec<TrieId>; 'Vec<TrieId>': Vec<TrieId>;
'Vec<TrieIndex>': Vec<TrieIndex>;
'Vec<Type>': Vec<Type>; 'Vec<Type>': Vec<Type>;
'Vec<u128>': Vec<u128>; 'Vec<u128>': Vec<u128>;
'Vec<U128>': Vec<U128>; 'Vec<U128>': Vec<U128>;
@@ -1595,7 +1655,9 @@ declare module '@polkadot/types/types/registry' {
'Vec<ValidatorPrefsTo196>': Vec<ValidatorPrefsTo196>; 'Vec<ValidatorPrefsTo196>': Vec<ValidatorPrefsTo196>;
'Vec<ValidatorPrefsWithBlocked>': Vec<ValidatorPrefsWithBlocked>; 'Vec<ValidatorPrefsWithBlocked>': Vec<ValidatorPrefsWithBlocked>;
'Vec<ValidatorPrefsWithCommission>': Vec<ValidatorPrefsWithCommission>; 'Vec<ValidatorPrefsWithCommission>': Vec<ValidatorPrefsWithCommission>;
'Vec<ValidatorSetId>': Vec<ValidatorSetId>;
'Vec<ValidatorSignature>': Vec<ValidatorSignature>; 'Vec<ValidatorSignature>': Vec<ValidatorSignature>;
'Vec<ValidDisputeStatementKind>': Vec<ValidDisputeStatementKind>;
'Vec<ValidityAttestation>': Vec<ValidityAttestation>; 'Vec<ValidityAttestation>': Vec<ValidityAttestation>;
'Vec<VecInboundHrmpMessage>': Vec<VecInboundHrmpMessage>; 'Vec<VecInboundHrmpMessage>': Vec<VecInboundHrmpMessage>;
'Vec<VersionedMultiAsset>': Vec<VersionedMultiAsset>; 'Vec<VersionedMultiAsset>': Vec<VersionedMultiAsset>;
@@ -1627,16 +1689,35 @@ declare module '@polkadot/types/types/registry' {
'Vec<WinnersDataTuple>': Vec<WinnersDataTuple>; 'Vec<WinnersDataTuple>': Vec<WinnersDataTuple>;
'Vec<WinningData>': Vec<WinningData>; 'Vec<WinningData>': Vec<WinningData>;
'Vec<WinningDataEntry>': Vec<WinningDataEntry>; 'Vec<WinningDataEntry>': Vec<WinningDataEntry>;
'Vec<WithdrawAsset>': Vec<WithdrawAsset>;
'Vec<WithdrawReasons>': Vec<WithdrawReasons>; 'Vec<WithdrawReasons>': Vec<WithdrawReasons>;
'Vec<Xcm>': Vec<Xcm>; 'Vec<Xcm>': Vec<Xcm>;
'Vec<XcmAssetEffects>': Vec<XcmAssetEffects>;
'Vec<XcmError>': Vec<XcmError>; 'Vec<XcmError>': Vec<XcmError>;
'Vec<XcmResult>': Vec<XcmResult>; 'Vec<XcmHrmpChannelAccepted>': Vec<XcmHrmpChannelAccepted>;
'Vec<XcmHrmpChannelClosing>': Vec<XcmHrmpChannelClosing>;
'Vec<XcmHrmpNewChannelOpenRequest>': Vec<XcmHrmpNewChannelOpenRequest>;
'Vec<XcmOrder>': Vec<XcmOrder>;
'Vec<XcmOrderBuyExecution>': Vec<XcmOrderBuyExecution>;
'Vec<XcmOrderDepositAsset>': Vec<XcmOrderDepositAsset>;
'Vec<XcmOrderDepositReserveAsset>': Vec<XcmOrderDepositReserveAsset>;
'Vec<XcmOrderExchangeAsset>': Vec<XcmOrderExchangeAsset>;
'Vec<XcmOrderInitiateReserveWithdraw>': Vec<XcmOrderInitiateReserveWithdraw>;
'Vec<XcmOrderInitiateTeleport>': Vec<XcmOrderInitiateTeleport>;
'Vec<XcmOrderQueryHolding>': Vec<XcmOrderQueryHolding>;
'Vec<XcmOriginKind>': Vec<XcmOriginKind>;
'Vec<XcmOutcome>': Vec<XcmOutcome>;
'Vec<XcmQueryResponse>': Vec<XcmQueryResponse>;
'Vec<XcmRelayedFrom>': Vec<XcmRelayedFrom>;
'Vec<XcmReserveAssetDeposit>': Vec<XcmReserveAssetDeposit>;
'Vec<XcmResponse>': Vec<XcmResponse>;
'Vec<XcmTeleportAsset>': Vec<XcmTeleportAsset>;
'Vec<XcmTransact>': Vec<XcmTransact>;
'Vec<XcmTransferAsset>': Vec<XcmTransferAsset>;
'Vec<XcmTransferReserveAsset>': Vec<XcmTransferReserveAsset>;
'Vec<XcmWithdrawAsset>': Vec<XcmWithdrawAsset>;
AbridgedCandidateReceipt: AbridgedCandidateReceipt; AbridgedCandidateReceipt: AbridgedCandidateReceipt;
AbridgedHostConfiguration: AbridgedHostConfiguration; AbridgedHostConfiguration: AbridgedHostConfiguration;
AbridgedHrmpChannel: AbridgedHrmpChannel; AbridgedHrmpChannel: AbridgedHrmpChannel;
AbstractFungible: AbstractFungible;
AbstractNonFungible: AbstractNonFungible;
AccountData: AccountData; AccountData: AccountData;
AccountId: AccountId; AccountId: AccountId;
AccountId32Junction: AccountId32Junction; AccountId32Junction: AccountId32Junction;
@@ -1667,7 +1748,10 @@ declare module '@polkadot/types/types/registry' {
ApplyExtrinsicResult: ApplyExtrinsicResult; ApplyExtrinsicResult: ApplyExtrinsicResult;
ApprovalFlag: ApprovalFlag; ApprovalFlag: ApprovalFlag;
Approvals: Approvals; Approvals: Approvals;
AssetApproval: AssetApproval;
AssetApprovalKey: AssetApprovalKey;
AssetBalance: AssetBalance; AssetBalance: AssetBalance;
AssetDestroyWitness: AssetDestroyWitness;
AssetDetails: AssetDetails; AssetDetails: AssetDetails;
AssetId: AssetId; AssetId: AssetId;
AssetInstance: AssetInstance; AssetInstance: AssetInstance;
@@ -1688,6 +1772,7 @@ declare module '@polkadot/types/types/registry' {
AvailabilityBitfieldRecord: AvailabilityBitfieldRecord; AvailabilityBitfieldRecord: AvailabilityBitfieldRecord;
BabeAuthorityWeight: BabeAuthorityWeight; BabeAuthorityWeight: BabeAuthorityWeight;
BabeBlockWeight: BabeBlockWeight; BabeBlockWeight: BabeBlockWeight;
BabeEpochConfiguration: BabeEpochConfiguration;
BabeEquivocationProof: BabeEquivocationProof; BabeEquivocationProof: BabeEquivocationProof;
BabeWeight: BabeWeight; BabeWeight: BabeWeight;
BackedCandidate: BackedCandidate; BackedCandidate: BackedCandidate;
@@ -1695,8 +1780,12 @@ declare module '@polkadot/types/types/registry' {
BalanceLock: BalanceLock; BalanceLock: BalanceLock;
BalanceLockTo212: BalanceLockTo212; BalanceLockTo212: BalanceLockTo212;
BalanceOf: BalanceOf; BalanceOf: BalanceOf;
Balances: Balances;
BalanceStatus: BalanceStatus; BalanceStatus: BalanceStatus;
BeefyCommitment: BeefyCommitment;
BeefyKey: BeefyKey;
BeefyNextAuthoritySet: BeefyNextAuthoritySet;
BeefyPayload: BeefyPayload;
BeefySignedCommitment: BeefySignedCommitment;
Bid: Bid; Bid: Bid;
Bidder: Bidder; Bidder: Bidder;
BidKind: BidKind; BidKind: BidKind;
@@ -1739,8 +1828,6 @@ declare module '@polkadot/types/types/registry' {
CompactAssignmentsTo257: CompactAssignmentsTo257; CompactAssignmentsTo257: CompactAssignmentsTo257;
CompactScore: CompactScore; CompactScore: CompactScore;
CompactScoreCompact: CompactScoreCompact; CompactScoreCompact: CompactScoreCompact;
ConcreteFungible: ConcreteFungible;
ConcreteNonFungible: ConcreteNonFungible;
Consensus: Consensus; Consensus: Consensus;
ConsensusEngineId: ConsensusEngineId; ConsensusEngineId: ConsensusEngineId;
ConsumedWeight: ConsumedWeight; ConsumedWeight: ConsumedWeight;
@@ -1789,9 +1876,6 @@ declare module '@polkadot/types/types/registry' {
DefunctVoter: DefunctVoter; DefunctVoter: DefunctVoter;
Delegations: Delegations; Delegations: Delegations;
DeletedContract: DeletedContract; DeletedContract: DeletedContract;
DeployData: DeployData;
DepositAsset: DepositAsset;
DepositReserveAsset: DepositReserveAsset;
Digest: Digest; Digest: Digest;
DigestItem: DigestItem; DigestItem: DigestItem;
DigestOf: DigestOf; DigestOf: DigestOf;
@@ -1806,7 +1890,10 @@ declare module '@polkadot/types/types/registry' {
DispatchResult: DispatchResult; DispatchResult: DispatchResult;
DispatchResultOf: DispatchResultOf; DispatchResultOf: DispatchResultOf;
DispatchResultTo198: DispatchResultTo198; DispatchResultTo198: DispatchResultTo198;
DisputeStatement: DisputeStatement;
DisputeStatementSet: DisputeStatementSet;
DoNotConstruct: DoNotConstruct; DoNotConstruct: DoNotConstruct;
DoubleEncodedCall: DoubleEncodedCall;
DoubleMapTypeLatest: DoubleMapTypeLatest; DoubleMapTypeLatest: DoubleMapTypeLatest;
DoubleMapTypeV10: DoubleMapTypeV10; DoubleMapTypeV10: DoubleMapTypeV10;
DoubleMapTypeV11: DoubleMapTypeV11; DoubleMapTypeV11: DoubleMapTypeV11;
@@ -1823,6 +1910,7 @@ declare module '@polkadot/types/types/registry' {
ElectionSize: ElectionSize; ElectionSize: ElectionSize;
ElectionStatus: ElectionStatus; ElectionStatus: ElectionStatus;
EncodedFinalityProofs: EncodedFinalityProofs; EncodedFinalityProofs: EncodedFinalityProofs;
EncodedJustification: EncodedJustification;
EpochAuthorship: EpochAuthorship; EpochAuthorship: EpochAuthorship;
EraIndex: EraIndex; EraIndex: EraIndex;
EraPoints: EraPoints; EraPoints: EraPoints;
@@ -1876,12 +1964,12 @@ declare module '@polkadot/types/types/registry' {
EvmAccount: EvmAccount; EvmAccount: EvmAccount;
EvmLog: EvmLog; EvmLog: EvmLog;
EvmVicinity: EvmVicinity; EvmVicinity: EvmVicinity;
ExchangeAsset: ExchangeAsset;
ExitError: ExitError; ExitError: ExitError;
ExitFatal: ExitFatal; ExitFatal: ExitFatal;
ExitReason: ExitReason; ExitReason: ExitReason;
ExitRevert: ExitRevert; ExitRevert: ExitRevert;
ExitSucceed: ExitSucceed; ExitSucceed: ExitSucceed;
ExplicitDisputeStatement: ExplicitDisputeStatement;
Exposure: Exposure; Exposure: Exposure;
ExtendedBalance: ExtendedBalance; ExtendedBalance: ExtendedBalance;
Extrinsic: Extrinsic; Extrinsic: Extrinsic;
@@ -1922,6 +2010,7 @@ declare module '@polkadot/types/types/registry' {
FundInfo: FundInfo; FundInfo: FundInfo;
Gas: Gas; Gas: Gas;
GiltBid: GiltBid; GiltBid: GiltBid;
GlobalValidationData: GlobalValidationData;
GlobalValidationSchedule: GlobalValidationSchedule; GlobalValidationSchedule: GlobalValidationSchedule;
GrandpaEquivocation: GrandpaEquivocation; GrandpaEquivocation: GrandpaEquivocation;
GrandpaEquivocationProof: GrandpaEquivocationProof; GrandpaEquivocationProof: GrandpaEquivocationProof;
@@ -1978,14 +2067,14 @@ declare module '@polkadot/types/types/registry' {
Index: Index; Index: Index;
IndicesLookupSource: IndicesLookupSource; IndicesLookupSource: IndicesLookupSource;
IndividualExposure: IndividualExposure; IndividualExposure: IndividualExposure;
InitiateReserveWithdraw: InitiateReserveWithdraw;
InitiateTeleport: InitiateTeleport;
InstructionWeights: InstructionWeights; InstructionWeights: InstructionWeights;
InvalidDisputeStatementKind: InvalidDisputeStatementKind;
InvalidTransaction: InvalidTransaction; InvalidTransaction: InvalidTransaction;
Json: Json; Json: Json;
Junction: Junction; Junction: Junction;
Justification: Justification; Justification: Justification;
JustificationNotification: JustificationNotification; JustificationNotification: JustificationNotification;
Justifications: Justifications;
Key: Key; Key: Key;
KeyOwnerProof: KeyOwnerProof; KeyOwnerProof: KeyOwnerProof;
Keys: Keys; Keys: Keys;
@@ -2024,6 +2113,8 @@ declare module '@polkadot/types/types/registry' {
MetadataV11: MetadataV11; MetadataV11: MetadataV11;
MetadataV12: MetadataV12; MetadataV12: MetadataV12;
MetadataV9: MetadataV9; MetadataV9: MetadataV9;
MmrLeafProof: MmrLeafProof;
MmrRootHash: MmrRootHash;
ModuleConstantMetadataLatest: ModuleConstantMetadataLatest; ModuleConstantMetadataLatest: ModuleConstantMetadataLatest;
ModuleConstantMetadataV10: ModuleConstantMetadataV10; ModuleConstantMetadataV10: ModuleConstantMetadataV10;
ModuleConstantMetadataV11: ModuleConstantMetadataV11; ModuleConstantMetadataV11: ModuleConstantMetadataV11;
@@ -2041,16 +2132,21 @@ declare module '@polkadot/types/types/registry' {
MortalEra: MortalEra; MortalEra: MortalEra;
MultiAddress: MultiAddress; MultiAddress: MultiAddress;
MultiAsset: MultiAsset; MultiAsset: MultiAsset;
MultiAssetAbstractFungible: MultiAssetAbstractFungible;
MultiAssetAbstractNonFungible: MultiAssetAbstractNonFungible;
MultiAssetConcreteFungible: MultiAssetConcreteFungible;
MultiAssetConcreteNonFungible: MultiAssetConcreteNonFungible;
MultiDisputeStatementSet: MultiDisputeStatementSet;
MultiLocation: MultiLocation; MultiLocation: MultiLocation;
Multiplier: Multiplier; Multiplier: Multiplier;
Multisig: Multisig; Multisig: Multisig;
MultiSignature: MultiSignature; MultiSignature: MultiSignature;
MultiSigner: MultiSigner;
NetworkId: NetworkId; NetworkId: NetworkId;
NetworkState: NetworkState; NetworkState: NetworkState;
NetworkStatePeerset: NetworkStatePeerset; NetworkStatePeerset: NetworkStatePeerset;
NetworkStatePeersetInfo: NetworkStatePeersetInfo; NetworkStatePeersetInfo: NetworkStatePeersetInfo;
NewBidder: NewBidder; NewBidder: NewBidder;
NewBidderOption: NewBidderOption;
NextAuthority: NextAuthority; NextAuthority: NextAuthority;
NextConfigDescriptor: NextConfigDescriptor; NextConfigDescriptor: NextConfigDescriptor;
NextConfigDescriptorV1: NextConfigDescriptorV1; NextConfigDescriptorV1: NextConfigDescriptorV1;
@@ -2073,17 +2169,17 @@ declare module '@polkadot/types/types/registry' {
OpenTipFinderTo225: OpenTipFinderTo225; OpenTipFinderTo225: OpenTipFinderTo225;
OpenTipTip: OpenTipTip; OpenTipTip: OpenTipTip;
OpenTipTo225: OpenTipTo225; OpenTipTo225: OpenTipTo225;
Order: Order;
Origin: Origin; Origin: Origin;
OriginCaller: OriginCaller; OriginCaller: OriginCaller;
OriginKind: OriginKind;
OutboundHrmpMessage: OutboundHrmpMessage; OutboundHrmpMessage: OutboundHrmpMessage;
Owner: Owner; Owner: Owner;
PalletId: PalletId;
PalletsOrigin: PalletsOrigin; PalletsOrigin: PalletsOrigin;
PalletVersion: PalletVersion; PalletVersion: PalletVersion;
ParachainDispatchOrigin: ParachainDispatchOrigin; ParachainDispatchOrigin: ParachainDispatchOrigin;
ParachainInherentData: ParachainInherentData; ParachainInherentData: ParachainInherentData;
ParachainProposal: ParachainProposal; ParachainProposal: ParachainProposal;
ParachainsInherentData: ParachainsInherentData;
ParaGenesisArgs: ParaGenesisArgs; ParaGenesisArgs: ParaGenesisArgs;
ParaId: ParaId; ParaId: ParaId;
ParaInfo: ParaInfo; ParaInfo: ParaInfo;
@@ -2122,7 +2218,6 @@ declare module '@polkadot/types/types/registry' {
Points: Points; Points: Points;
Precommits: Precommits; Precommits: Precommits;
PrefabWasmModule: PrefabWasmModule; PrefabWasmModule: PrefabWasmModule;
PrefabWasmModuleReserved: PrefabWasmModuleReserved;
PrefixedStorageKey: PrefixedStorageKey; PrefixedStorageKey: PrefixedStorageKey;
PreimageStatus: PreimageStatus; PreimageStatus: PreimageStatus;
PreimageStatusAvailable: PreimageStatusAvailable; PreimageStatusAvailable: PreimageStatusAvailable;
@@ -2137,7 +2232,6 @@ declare module '@polkadot/types/types/registry' {
ProxyDefinition: ProxyDefinition; ProxyDefinition: ProxyDefinition;
ProxyState: ProxyState; ProxyState: ProxyState;
ProxyType: ProxyType; ProxyType: ProxyType;
QueryHolding: QueryHolding;
QueuedParathread: QueuedParathread; QueuedParathread: QueuedParathread;
Randomness: Randomness; Randomness: Randomness;
Raw: Raw; Raw: Raw;
@@ -2171,15 +2265,12 @@ declare module '@polkadot/types/types/registry' {
RegistrationJudgement: RegistrationJudgement; RegistrationJudgement: RegistrationJudgement;
RelayChainBlockNumber: RelayChainBlockNumber; RelayChainBlockNumber: RelayChainBlockNumber;
RelayChainHash: RelayChainHash; RelayChainHash: RelayChainHash;
RelayedFrom: RelayedFrom;
RelayTo: RelayTo;
Releases: Releases; Releases: Releases;
Remark: Remark; Remark: Remark;
Renouncing: Renouncing; Renouncing: Renouncing;
ReportedRoundStates: ReportedRoundStates; ReportedRoundStates: ReportedRoundStates;
Reporter: Reporter; Reporter: Reporter;
ReportIdOf: ReportIdOf; ReportIdOf: ReportIdOf;
ReserveAssetDeposit: ReserveAssetDeposit;
Retriable: Retriable; Retriable: Retriable;
RewardDestination: RewardDestination; RewardDestination: RewardDestination;
RewardPoint: RewardPoint; RewardPoint: RewardPoint;
@@ -2203,18 +2294,25 @@ declare module '@polkadot/types/types/registry' {
SealV0: SealV0; SealV0: SealV0;
SeatHolder: SeatHolder; SeatHolder: SeatHolder;
SeedOf: SeedOf; SeedOf: SeedOf;
ServiceQuality: ServiceQuality;
SessionIndex: SessionIndex; SessionIndex: SessionIndex;
SessionInfo: SessionInfo; SessionInfo: SessionInfo;
SessionInfoValidatorGroup: SessionInfoValidatorGroup; SessionInfoValidatorGroup: SessionInfoValidatorGroup;
SessionKeys1: SessionKeys1; SessionKeys1: SessionKeys1;
SessionKeys10: SessionKeys10;
SessionKeys10B: SessionKeys10B;
SessionKeys2: SessionKeys2; SessionKeys2: SessionKeys2;
SessionKeys3: SessionKeys3; SessionKeys3: SessionKeys3;
SessionKeys4: SessionKeys4; SessionKeys4: SessionKeys4;
SessionKeys5: SessionKeys5; SessionKeys5: SessionKeys5;
SessionKeys6: SessionKeys6; SessionKeys6: SessionKeys6;
SessionKeys6B: SessionKeys6B;
SessionKeys7: SessionKeys7; SessionKeys7: SessionKeys7;
SessionKeys7B: SessionKeys7B;
SessionKeys8: SessionKeys8; SessionKeys8: SessionKeys8;
SessionKeys8B: SessionKeys8B;
SessionKeys9: SessionKeys9; SessionKeys9: SessionKeys9;
SessionKeys9B: SessionKeys9B;
SetId: SetId; SetId: SetId;
SetIndex: SetIndex; SetIndex: SetIndex;
SiField: SiField; SiField: SiField;
@@ -2222,6 +2320,8 @@ declare module '@polkadot/types/types/registry' {
SignedAvailabilityBitfield: SignedAvailabilityBitfield; SignedAvailabilityBitfield: SignedAvailabilityBitfield;
SignedAvailabilityBitfields: SignedAvailabilityBitfields; SignedAvailabilityBitfields: SignedAvailabilityBitfields;
SignedBlock: SignedBlock; SignedBlock: SignedBlock;
SignedBlockWithJustification: SignedBlockWithJustification;
SignedBlockWithJustifications: SignedBlockWithJustifications;
SignerPayload: SignerPayload; SignerPayload: SignerPayload;
SigningContext: SigningContext; SigningContext: SigningContext;
SiLookupTypeId: SiLookupTypeId; SiLookupTypeId: SiLookupTypeId;
@@ -2295,16 +2395,15 @@ declare module '@polkadot/types/types/registry' {
TaskAddress: TaskAddress; TaskAddress: TaskAddress;
TAssetBalance: TAssetBalance; TAssetBalance: TAssetBalance;
TAssetDepositBalance: TAssetDepositBalance; TAssetDepositBalance: TAssetDepositBalance;
TeleportAsset: TeleportAsset;
Text: Text; Text: Text;
Timepoint: Timepoint; Timepoint: Timepoint;
TombstoneContractInfo: TombstoneContractInfo; TombstoneContractInfo: TombstoneContractInfo;
Transact: Transact;
TransactionPriority: TransactionPriority; TransactionPriority: TransactionPriority;
TransactionValidityError: TransactionValidityError; TransactionValidityError: TransactionValidityError;
TransientValidationData: TransientValidationData; TransientValidationData: TransientValidationData;
TreasuryProposal: TreasuryProposal; TreasuryProposal: TreasuryProposal;
TrieId: TrieId; TrieId: TrieId;
TrieIndex: TrieIndex;
Type: Type; Type: Type;
u128: u128; u128: u128;
U128: U128; U128: U128;
@@ -2341,7 +2440,9 @@ declare module '@polkadot/types/types/registry' {
ValidatorPrefsTo196: ValidatorPrefsTo196; ValidatorPrefsTo196: ValidatorPrefsTo196;
ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked; ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked;
ValidatorPrefsWithCommission: ValidatorPrefsWithCommission; ValidatorPrefsWithCommission: ValidatorPrefsWithCommission;
ValidatorSetId: ValidatorSetId;
ValidatorSignature: ValidatorSignature; ValidatorSignature: ValidatorSignature;
ValidDisputeStatementKind: ValidDisputeStatementKind;
ValidityAttestation: ValidityAttestation; ValidityAttestation: ValidityAttestation;
VecInboundHrmpMessage: VecInboundHrmpMessage; VecInboundHrmpMessage: VecInboundHrmpMessage;
VersionedMultiAsset: VersionedMultiAsset; VersionedMultiAsset: VersionedMultiAsset;
@@ -2373,10 +2474,31 @@ declare module '@polkadot/types/types/registry' {
WinnersDataTuple: WinnersDataTuple; WinnersDataTuple: WinnersDataTuple;
WinningData: WinningData; WinningData: WinningData;
WinningDataEntry: WinningDataEntry; WinningDataEntry: WinningDataEntry;
WithdrawAsset: WithdrawAsset;
WithdrawReasons: WithdrawReasons; WithdrawReasons: WithdrawReasons;
Xcm: Xcm; Xcm: Xcm;
XcmAssetEffects: XcmAssetEffects;
XcmError: XcmError; XcmError: XcmError;
XcmResult: XcmResult; XcmHrmpChannelAccepted: XcmHrmpChannelAccepted;
XcmHrmpChannelClosing: XcmHrmpChannelClosing;
XcmHrmpNewChannelOpenRequest: XcmHrmpNewChannelOpenRequest;
XcmOrder: XcmOrder;
XcmOrderBuyExecution: XcmOrderBuyExecution;
XcmOrderDepositAsset: XcmOrderDepositAsset;
XcmOrderDepositReserveAsset: XcmOrderDepositReserveAsset;
XcmOrderExchangeAsset: XcmOrderExchangeAsset;
XcmOrderInitiateReserveWithdraw: XcmOrderInitiateReserveWithdraw;
XcmOrderInitiateTeleport: XcmOrderInitiateTeleport;
XcmOrderQueryHolding: XcmOrderQueryHolding;
XcmOriginKind: XcmOriginKind;
XcmOutcome: XcmOutcome;
XcmQueryResponse: XcmQueryResponse;
XcmRelayedFrom: XcmRelayedFrom;
XcmReserveAssetDeposit: XcmReserveAssetDeposit;
XcmResponse: XcmResponse;
XcmTeleportAsset: XcmTeleportAsset;
XcmTransact: XcmTransact;
XcmTransferAsset: XcmTransferAsset;
XcmTransferReserveAsset: XcmTransferReserveAsset;
XcmWithdrawAsset: XcmWithdrawAsset;
} }
} }
+97 -22
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { Address, Balance, BlockNumber, Call, ExtrinsicEra, Hash, Index, RuntimeVersion } from '../interfaces'; import type { Address, Balance, BlockNumber, Call, ExtrinsicEra, Hash, Index, RuntimeVersion } from '../interfaces';
import type { Codec, Constructor, ISignerPayload, SignerPayloadJSON, SignerPayloadRaw } from '../types'; import type { Codec, InterfaceTypes, ISignerPayload, Registry, SignerPayloadJSON, SignerPayloadRaw } from '../types';
import { u8aToHex } from '@polkadot/util'; import { u8aToHex } from '@polkadot/util';
@@ -26,9 +26,7 @@ export interface SignerPayloadType extends Codec {
version: u8; version: u8;
} }
// We explicitly cast the type here to get the actual TypeScript exports right const knownTypes: Record<string, keyof InterfaceTypes> = {
// We can ignore the properties, added via Struct.with
const _Payload = Struct.with({
address: 'Address', address: 'Address',
blockHash: 'Hash', blockHash: 'Hash',
blockNumber: 'BlockNumber', blockNumber: 'BlockNumber',
@@ -40,33 +38,106 @@ const _Payload = Struct.with({
signedExtensions: 'Vec<Text>', signedExtensions: 'Vec<Text>',
tip: 'Compact<Balance>', tip: 'Compact<Balance>',
version: 'u8' version: 'u8'
}) as unknown as Constructor<SignerPayloadType>; };
/** /**
* @name GenericSignerPayload * @name GenericSignerPayload
* @description * @description
* A generic signer payload that can be used for serialization between API and signer * A generic signer payload that can be used for serialization between API and signer
*/ */
export class GenericSignerPayload extends _Payload implements ISignerPayload { export class GenericSignerPayload extends Struct implements ISignerPayload, SignerPayloadType {
private readonly _extraTypes: Record<string, keyof InterfaceTypes>;
constructor (registry: Registry, value?: string | { [x: string]: any; } | Map<unknown, unknown> | unknown[]) {
const extensionTypes = {
...registry.getSignedExtensionTypes(),
...registry.getSignedExtensionExtra()
};
super(registry, {
...extensionTypes,
...knownTypes
}, value);
// add all extras that are not in the base types
this._extraTypes = Object.entries(extensionTypes).reduce<Record<string, keyof InterfaceTypes>>((map, [key, type]) => {
if (!knownTypes[key]) {
map[key] = type;
}
return map;
}, {});
}
get address (): Address {
return this.get('address') as Address;
}
get blockHash (): Hash {
return this.get('blockHash') as Hash;
}
get blockNumber (): BlockNumber {
return this.get('blockNumber') as BlockNumber;
}
get era (): ExtrinsicEra {
return this.get('era') as ExtrinsicEra;
}
get genesisHash (): Hash {
return this.get('genesisHash') as Hash;
}
get method (): Call {
return this.get('method') as Call;
}
get nonce (): Compact<Index> {
return this.get('nonce') as Compact<Index>;
}
get runtimeVersion (): RuntimeVersion {
return this.get('runtimeVersion') as RuntimeVersion;
}
get signedExtensions (): Vec<Text> {
return this.get('signedExtensions') as Vec<Text>;
}
get tip (): Compact<Balance> {
return this.get('tip') as Compact<Balance>;
}
get version (): u8 {
return this.get('version') as u8;
}
/** /**
* @description Creates an representation of the structure as an ISignerPayload JSON * @description Creates an representation of the structure as an ISignerPayload JSON
*/ */
public toPayload (): SignerPayloadJSON { public toPayload (): SignerPayloadJSON {
const { address, blockHash, blockNumber, era, genesisHash, method, nonce, runtimeVersion: { specVersion, transactionVersion }, signedExtensions, tip, version } = this;
return { return {
address: address.toString(), // add any explicit overrides we may have
blockHash: blockHash.toHex(), ...(Object.keys(this._extraTypes).reduce<Record<string, string>>((map, key) => {
blockNumber: blockNumber.toHex(), map[key] = (this.get(key) as Codec).toHex();
era: era.toHex(),
genesisHash: genesisHash.toHex(), return map;
method: method.toHex(), }, {})),
nonce: nonce.toHex(), // the known defaults as managed explicitly and has different
signedExtensions: signedExtensions.map((e) => e.toString()), // formatting in cases, e.g. we mostly expose a hex format here
specVersion: specVersion.toHex(), address: this.address.toString(),
tip: tip.toHex(), blockHash: this.blockHash.toHex(),
transactionVersion: transactionVersion.toHex(), blockNumber: this.blockNumber.toHex(),
version: version.toNumber() era: this.era.toHex(),
genesisHash: this.genesisHash.toHex(),
method: this.method.toHex(),
nonce: this.nonce.toHex(),
signedExtensions: this.signedExtensions.map((e) => e.toString()),
specVersion: this.runtimeVersion.specVersion.toHex(),
tip: this.tip.toHex(),
transactionVersion: this.runtimeVersion.transactionVersion.toHex(),
version: this.version.toNumber()
}; };
} }
@@ -75,8 +146,12 @@ export class GenericSignerPayload extends _Payload implements ISignerPayload {
*/ */
public toRaw (): SignerPayloadRaw { public toRaw (): SignerPayloadRaw {
const payload = this.toPayload(); const payload = this.toPayload();
// NOTE Explicitly pass the bare flag so the method is encoded un-prefixed (non-decodable, for signing only) const data = u8aToHex(
const data = u8aToHex(this.registry.createType('ExtrinsicPayload', payload, { version: payload.version }).toU8a({ method: true })); this.registry
.createType('ExtrinsicPayload', payload, { version: payload.version })
// NOTE Explicitly pass the bare flag so the method is encoded un-prefixed (non-decodable, for signing only)
.toU8a({ method: true })
);
return { return {
address: payload.address, address: payload.address,
@@ -6,7 +6,7 @@ import type { Address, Balance, Call, Index } from '../../interfaces/runtime';
import type { ExtrinsicPayloadValue, IExtrinsicSignature, IKeyringPair, Registry, SignatureOptions } from '../../types'; import type { ExtrinsicPayloadValue, IExtrinsicSignature, IKeyringPair, Registry, SignatureOptions } from '../../types';
import type { ExtrinsicSignatureOptions } from '../types'; import type { ExtrinsicSignatureOptions } from '../types';
import { isU8a, u8aConcat, u8aToHex } from '@polkadot/util'; import { assert, isU8a, u8aConcat, u8aToHex } from '@polkadot/util';
import { Compact } from '../../codec/Compact'; import { Compact } from '../../codec/Compact';
import { Enum } from '../../codec/Enum'; import { Enum } from '../../codec/Enum';
@@ -155,6 +155,8 @@ export class GenericExtrinsicSignatureV4 extends Struct implements IExtrinsicSig
* @description Generate a payload and applies the signature from a keypair * @description Generate a payload and applies the signature from a keypair
*/ */
public sign (method: Call, account: IKeyringPair, options: SignatureOptions): IExtrinsicSignature { public sign (method: Call, account: IKeyringPair, options: SignatureOptions): IExtrinsicSignature {
assert(account && account.addressRaw, `Expected a valid keypair for signing, found ${JSON.stringify(account)}`);
const signer = toAddress(this.registry, account.addressRaw); const signer = toAddress(this.registry, account.addressRaw);
const payload = this.createPayload(method, options); const payload = this.createPayload(method, options);
const signature = this.registry.createType('ExtrinsicSignature', payload.sign(account)); const signature = this.registry.createType('ExtrinsicSignature', payload.sign(account));
@@ -166,6 +168,8 @@ export class GenericExtrinsicSignatureV4 extends Struct implements IExtrinsicSig
* @description Generate a payload and applies a fake signature * @description Generate a payload and applies a fake signature
*/ */
public signFake (method: Call, address: Address | Uint8Array | string, options: SignatureOptions): IExtrinsicSignature { public signFake (method: Call, address: Address | Uint8Array | string, options: SignatureOptions): IExtrinsicSignature {
assert(address, `Expected a valid address for signing, found ${JSON.stringify(address)}`);
const signer = toAddress(this.registry, address); const signer = toAddress(this.registry, address);
const payload = this.createPayload(method, options); const payload = this.createPayload(method, options);
const signature = this.registry.createType('ExtrinsicSignature', u8aConcat(this.#fakePrefix, new Uint8Array(64).fill(0x42))); const signature = this.registry.createType('ExtrinsicSignature', u8aConcat(this.#fakePrefix, new Uint8Array(64).fill(0x42)));
@@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/types authors & contributors // Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { hexToBn } from '@polkadot/util';
import { CID_AURA, CID_BABE, CID_GRPA, GenericConsensusEngineId as ConsensusEngineId } from './ConsensusEngineId'; import { CID_AURA, CID_BABE, CID_GRPA, GenericConsensusEngineId as ConsensusEngineId } from './ConsensusEngineId';
describe('ConsensusEngineId', (): void => { describe('ConsensusEngineId', (): void => {
@@ -12,4 +14,9 @@ describe('ConsensusEngineId', (): void => {
it('reverses an id to string for babe', (): void => { it('reverses an id to string for babe', (): void => {
expect(ConsensusEngineId.idToString(CID_BABE)).toEqual('BABE'); expect(ConsensusEngineId.idToString(CID_BABE)).toEqual('BABE');
}); });
it('reverses a non-ASCII id to a hex string', (): void => {
expect(ConsensusEngineId.idToString(hexToBn('0x01020304', { isLe: true }))).toEqual('0x01020304');
expect(ConsensusEngineId.idToString(0x04030201)).toEqual('0x01020304');
});
}); });
@@ -5,7 +5,7 @@ import type { AccountId } from '../interfaces/runtime';
import BN from 'bn.js'; import BN from 'bn.js';
import { bnToBn } from '@polkadot/util'; import { bnToU8a, isAscii, u8aToHex, u8aToString } from '@polkadot/util';
import { Bytes } from '../primitive/Bytes'; import { Bytes } from '../primitive/Bytes';
import { u32 } from '../primitive/U32'; import { u32 } from '../primitive/U32';
@@ -24,10 +24,11 @@ export const CID_POW = 0x5f776f70; // 'pow_'
*/ */
export class GenericConsensusEngineId extends u32 { export class GenericConsensusEngineId extends u32 {
public static idToString (input: number | BN): string { public static idToString (input: number | BN): string {
return bnToBn(input) const u8a = bnToU8a(input);
.toArray('le')
.map((code): string => String.fromCharCode(code)) return isAscii(u8a)
.join(''); ? u8aToString(u8a)
: u8aToHex(u8a);
} }
public static stringToId (input: string): number { public static stringToId (input: string): number {
@@ -9,10 +9,23 @@ import type { Definitions } from '../../types';
export default { export default {
rpc: {}, rpc: {},
types: { types: {
AssetApprovalKey: {
owner: 'AccountId',
delegate: 'AccountId'
},
AssetApproval: {
amount: 'TAssetBalance',
deposit: 'TAssetDepositBalance'
},
AssetBalance: { AssetBalance: {
balance: 'TAssetBalance', balance: 'TAssetBalance',
isFrozen: 'bool', isFrozen: 'bool',
isZombie: 'bool' isSufficient: 'bool'
},
AssetDestroyWitness: {
accounts: 'Compact<u32>',
sufficients: 'Compact<u32>',
approvals: 'Compact<u32>'
}, },
AssetDetails: { AssetDetails: {
owner: 'AccountId', owner: 'AccountId',
@@ -21,16 +34,19 @@ export default {
freezer: 'AccountId', freezer: 'AccountId',
supply: 'TAssetBalance', supply: 'TAssetBalance',
deposit: 'TAssetDepositBalance', deposit: 'TAssetDepositBalance',
maxZombies: 'u32',
minBalance: 'TAssetBalance', minBalance: 'TAssetBalance',
zombies: 'u32', isSufficient: 'bool',
accounts: 'u32' accounts: 'u32',
sufficients: 'u32',
approvals: 'u32',
isFrozen: 'bool'
}, },
AssetMetadata: { AssetMetadata: {
deposit: 'TAssetDepositBalance', deposit: 'TAssetDepositBalance',
name: 'Vec<u8>', name: 'Vec<u8>',
symbol: 'Vec<u8>', symbol: 'Vec<u8>',
decimals: 'u8' decimals: 'u8',
isFrozen: 'bool'
}, },
TAssetBalance: 'u64', TAssetBalance: 'u64',
TAssetDepositBalance: 'BalanceOf' TAssetDepositBalance: 'BalanceOf'
+26 -4
View File
@@ -1,14 +1,33 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */ /* eslint-disable */
import type { Bytes, Struct, bool, u32, u64, u8 } from '@polkadot/types'; import type { Bytes, Compact, Struct, bool, u32, u64, u8 } from '@polkadot/types';
import type { AccountId, BalanceOf } from '@polkadot/types/interfaces/runtime'; import type { AccountId, BalanceOf } from '@polkadot/types/interfaces/runtime';
/** @name AssetApproval */
export interface AssetApproval extends Struct {
readonly amount: TAssetBalance;
readonly deposit: TAssetDepositBalance;
}
/** @name AssetApprovalKey */
export interface AssetApprovalKey extends Struct {
readonly owner: AccountId;
readonly delegate: AccountId;
}
/** @name AssetBalance */ /** @name AssetBalance */
export interface AssetBalance extends Struct { export interface AssetBalance extends Struct {
readonly balance: TAssetBalance; readonly balance: TAssetBalance;
readonly isFrozen: bool; readonly isFrozen: bool;
readonly isZombie: bool; readonly isSufficient: bool;
}
/** @name AssetDestroyWitness */
export interface AssetDestroyWitness extends Struct {
readonly accounts: Compact<u32>;
readonly sufficients: Compact<u32>;
readonly approvals: Compact<u32>;
} }
/** @name AssetDetails */ /** @name AssetDetails */
@@ -19,10 +38,12 @@ export interface AssetDetails extends Struct {
readonly freezer: AccountId; readonly freezer: AccountId;
readonly supply: TAssetBalance; readonly supply: TAssetBalance;
readonly deposit: TAssetDepositBalance; readonly deposit: TAssetDepositBalance;
readonly maxZombies: u32;
readonly minBalance: TAssetBalance; readonly minBalance: TAssetBalance;
readonly zombies: u32; readonly isSufficient: bool;
readonly accounts: u32; readonly accounts: u32;
readonly sufficients: u32;
readonly approvals: u32;
readonly isFrozen: bool;
} }
/** @name AssetMetadata */ /** @name AssetMetadata */
@@ -31,6 +52,7 @@ export interface AssetMetadata extends Struct {
readonly name: Bytes; readonly name: Bytes;
readonly symbol: Bytes; readonly symbol: Bytes;
readonly decimals: u8; readonly decimals: u8;
readonly isFrozen: bool;
} }
/** @name TAssetBalance */ /** @name TAssetBalance */
@@ -19,6 +19,10 @@ export default {
_enum: ['PrimarySlots', 'PrimaryAndSecondaryPlainSlots', 'PrimaryAndSecondaryVRFSlots'] _enum: ['PrimarySlots', 'PrimaryAndSecondaryPlainSlots', 'PrimaryAndSecondaryVRFSlots']
}, },
BabeAuthorityWeight: 'u64', BabeAuthorityWeight: 'u64',
BabeEpochConfiguration: {
c: '(u64, u64)',
allowedSlots: 'AllowedSlots'
},
BabeBlockWeight: 'u32', BabeBlockWeight: 'u32',
BabeEquivocationProof: { BabeEquivocationProof: {
offender: 'AuthorityId', offender: 'AuthorityId',
@@ -19,6 +19,12 @@ export interface BabeAuthorityWeight extends u64 {}
/** @name BabeBlockWeight */ /** @name BabeBlockWeight */
export interface BabeBlockWeight extends u32 {} export interface BabeBlockWeight extends u32 {}
/** @name BabeEpochConfiguration */
export interface BabeEpochConfiguration extends Struct {
readonly c: ITuple<[u64, u64]>;
readonly allowedSlots: AllowedSlots;
}
/** @name BabeEquivocationProof */ /** @name BabeEquivocationProof */
export interface BabeEquivocationProof extends Struct { export interface BabeEquivocationProof extends Struct {
readonly offender: AuthorityId; readonly offender: AuthorityId;
@@ -0,0 +1,41 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { Definitions } from '../../types';
export default {
rpc: {
subscribeJustifications: {
description: 'Returns the block most recently finalized by BEEFY, alongside side its justification.',
params: [],
pubsub: [
'justifications',
'subscribeJustifications',
'unsubscribeJustifications'
],
type: 'BeefySignedCommitment'
}
},
types: {
BeefyCommitment: {
payload: 'BeefyPayload',
blockNumber: 'BlockNumber',
validatorSetId: 'ValidatorSetId'
},
BeefySignedCommitment: {
commitment: 'BeefyCommitment',
signatures: 'Vec<Option<Signature>>'
},
BeefyNextAuthoritySet: {
id: 'u64',
len: 'u32',
root: 'H256'
},
BeefyPayload: 'MmrRootHash',
MmrRootHash: 'H256',
ValidatorSetId: 'u64'
}
} as Definitions;
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export * from './types';
@@ -0,0 +1,37 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Option, Struct, Vec, u32, u64 } from '@polkadot/types';
import type { Signature } from '@polkadot/types/interfaces/extrinsics';
import type { BlockNumber, H256 } from '@polkadot/types/interfaces/runtime';
/** @name BeefyCommitment */
export interface BeefyCommitment extends Struct {
readonly payload: BeefyPayload;
readonly blockNumber: BlockNumber;
readonly validatorSetId: ValidatorSetId;
}
/** @name BeefyNextAuthoritySet */
export interface BeefyNextAuthoritySet extends Struct {
readonly id: u64;
readonly len: u32;
readonly root: H256;
}
/** @name BeefyPayload */
export interface BeefyPayload extends MmrRootHash {}
/** @name BeefySignedCommitment */
export interface BeefySignedCommitment extends Struct {
readonly commitment: BeefyCommitment;
readonly signatures: Vec<Option<Signature>>;
}
/** @name MmrRootHash */
export interface MmrRootHash extends H256 {}
/** @name ValidatorSetId */
export interface ValidatorSetId extends u64 {}
export type PHANTOM_BEEFY = 'beefy';
@@ -70,7 +70,8 @@ export default {
codeHash: 'CodeHash', codeHash: 'CodeHash',
rentAllowance: 'Balance', rentAllowance: 'Balance',
deductBlock: 'BlockNumber', deductBlock: 'BlockNumber',
lastWrite: 'Option<BlockNumber>' lastWrite: 'Option<BlockNumber>',
_reserved: 'Option<Null>'
}, },
CodeHash: 'Hash', CodeHash: 'Hash',
ContractCallRequest: { ContractCallRequest: {
@@ -231,6 +232,7 @@ export default {
instantiatePerCodeByte: 'Weight', instantiatePerCodeByte: 'Weight',
instantiatePerInputByte: 'Weight', instantiatePerInputByte: 'Weight',
instantiatePerOutputByte: 'Weight', instantiatePerOutputByte: 'Weight',
instantiatePerSaltByte: 'Weight',
hashSha2256: 'Weight', hashSha2256: 'Weight',
hashSha2256PerByte: 'Weight', hashSha2256PerByte: 'Weight',
hashKeccak256: 'Weight', hashKeccak256: 'Weight',
@@ -238,7 +240,8 @@ export default {
hashBlake2256: 'Weight', hashBlake2256: 'Weight',
hashBlake2256PerByte: 'Weight', hashBlake2256PerByte: 'Weight',
hashBlake2128: 'Weight', hashBlake2128: 'Weight',
hashBlake2128PerByte: 'Weight' hashBlake2128PerByte: 'Weight',
rentParams: 'Weight'
}, },
InstructionWeights: { InstructionWeights: {
i64const: 'u32', i64const: 'u32',
@@ -318,10 +321,11 @@ export default {
scheduleVersion: 'Compact<u32>', scheduleVersion: 'Compact<u32>',
initial: 'Compact<u32>', initial: 'Compact<u32>',
maximum: 'Compact<u32>', maximum: 'Compact<u32>',
_reserved: 'PrefabWasmModuleReserved', refcount: 'Compact<u64>',
code: 'Bytes' _reserved: 'Option<Null>',
code: 'Bytes',
originalCodeLen: 'u32'
}, },
PrefabWasmModuleReserved: 'Option<Null>',
ScheduleTo212: { ScheduleTo212: {
version: 'u32', version: 'u32',
putCodePerByteCost: 'Gas', putCodePerByteCost: 'Gas',
@@ -14,6 +14,7 @@ export interface AliveContractInfo extends Struct {
readonly rentAllowance: Balance; readonly rentAllowance: Balance;
readonly deductBlock: BlockNumber; readonly deductBlock: BlockNumber;
readonly lastWrite: Option<BlockNumber>; readonly lastWrite: Option<BlockNumber>;
readonly _reserved: Option<Null>;
} }
/** @name CodeHash */ /** @name CodeHash */
@@ -157,6 +158,7 @@ export interface HostFnWeights extends Struct {
readonly instantiatePerCodeByte: Weight; readonly instantiatePerCodeByte: Weight;
readonly instantiatePerInputByte: Weight; readonly instantiatePerInputByte: Weight;
readonly instantiatePerOutputByte: Weight; readonly instantiatePerOutputByte: Weight;
readonly instantiatePerSaltByte: Weight;
readonly hashSha2256: Weight; readonly hashSha2256: Weight;
readonly hashSha2256PerByte: Weight; readonly hashSha2256PerByte: Weight;
readonly hashKeccak256: Weight; readonly hashKeccak256: Weight;
@@ -165,6 +167,7 @@ export interface HostFnWeights extends Struct {
readonly hashBlake2256PerByte: Weight; readonly hashBlake2256PerByte: Weight;
readonly hashBlake2128: Weight; readonly hashBlake2128: Weight;
readonly hashBlake2128PerByte: Weight; readonly hashBlake2128PerByte: Weight;
readonly rentParams: Weight;
} }
/** @name HostFnWeightsTo264 */ /** @name HostFnWeightsTo264 */
@@ -301,13 +304,12 @@ export interface PrefabWasmModule extends Struct {
readonly scheduleVersion: Compact<u32>; readonly scheduleVersion: Compact<u32>;
readonly initial: Compact<u32>; readonly initial: Compact<u32>;
readonly maximum: Compact<u32>; readonly maximum: Compact<u32>;
readonly _reserved: PrefabWasmModuleReserved; readonly refcount: Compact<u64>;
readonly _reserved: Option<Null>;
readonly code: Bytes; readonly code: Bytes;
readonly originalCodeLen: u32;
} }
/** @name PrefabWasmModuleReserved */
export interface PrefabWasmModuleReserved extends Option<Null> {}
/** @name Schedule */ /** @name Schedule */
export interface Schedule extends Struct { export interface Schedule extends Struct {
readonly version: u32; readonly version: u32;
@@ -13,26 +13,22 @@ export default {
LastContribution: { LastContribution: {
_enum: { _enum: {
Never: 'Null', Never: 'Null',
PreEnding: 'AuctionIndex', PreEnding: 'u32',
Ending: 'BlockNumber' Ending: 'BlockNumber'
} }
}, },
DeployData: {
codeHash: 'Hash',
codeSize: 'u32',
initialHeadData: 'HeadData'
},
FundInfo: { FundInfo: {
parachain: 'Option<ParaId>', depositor: 'AccountId',
owner: 'AccountId', verifier: 'Option<MultiSigner>',
deposit: 'Balance', deposit: 'Balance',
raised: 'Balance', raised: 'Balance',
end: 'BlockNumber', end: 'BlockNumber',
cap: 'Balance', cap: 'Balance',
lastContribution: 'LastContribution', lastContribution: 'LastContribution',
firstSlot: 'BlockNumber', firstSlot: 'LeasePeriod',
lastSlot: 'BlockNumber', lastSlot: 'LeasePeriod',
deployData: 'Option<DeployData>' trieIndex: 'TrieIndex'
} },
TrieIndex: 'u32'
} }
} as Definitions; } as Definitions;
@@ -2,40 +2,36 @@
/* eslint-disable */ /* eslint-disable */
import type { Enum, Option, Struct, u32 } from '@polkadot/types'; import type { Enum, Option, Struct, u32 } from '@polkadot/types';
import type { AuctionIndex, HeadData, ParaId } from '@polkadot/types/interfaces/parachains'; import type { LeasePeriod } from '@polkadot/types/interfaces/parachains';
import type { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; import type { AccountId, Balance, BlockNumber, MultiSigner } from '@polkadot/types/interfaces/runtime';
/** @name DeployData */
export interface DeployData extends Struct {
readonly codeHash: Hash;
readonly codeSize: u32;
readonly initialHeadData: HeadData;
}
/** @name FundIndex */ /** @name FundIndex */
export interface FundIndex extends u32 {} export interface FundIndex extends u32 {}
/** @name FundInfo */ /** @name FundInfo */
export interface FundInfo extends Struct { export interface FundInfo extends Struct {
readonly parachain: Option<ParaId>; readonly depositor: AccountId;
readonly owner: AccountId; readonly verifier: Option<MultiSigner>;
readonly deposit: Balance; readonly deposit: Balance;
readonly raised: Balance; readonly raised: Balance;
readonly end: BlockNumber; readonly end: BlockNumber;
readonly cap: Balance; readonly cap: Balance;
readonly lastContribution: LastContribution; readonly lastContribution: LastContribution;
readonly firstSlot: BlockNumber; readonly firstSlot: LeasePeriod;
readonly lastSlot: BlockNumber; readonly lastSlot: LeasePeriod;
readonly deployData: Option<DeployData>; readonly trieIndex: TrieIndex;
} }
/** @name LastContribution */ /** @name LastContribution */
export interface LastContribution extends Enum { export interface LastContribution extends Enum {
readonly isNever: boolean; readonly isNever: boolean;
readonly isPreEnding: boolean; readonly isPreEnding: boolean;
readonly asPreEnding: AuctionIndex; readonly asPreEnding: u32;
readonly isEnding: boolean; readonly isEnding: boolean;
readonly asEnding: BlockNumber; readonly asEnding: BlockNumber;
} }
/** @name TrieIndex */
export interface TrieIndex extends u32 {}
export type PHANTOM_CROWDLOAN = 'crowdloan'; export type PHANTOM_CROWDLOAN = 'crowdloan';
@@ -24,6 +24,7 @@ export { default as grandpa } from './grandpa/definitions';
export { default as identity } from './identity/definitions'; export { default as identity } from './identity/definitions';
export { default as imOnline } from './imOnline/definitions'; export { default as imOnline } from './imOnline/definitions';
export { default as lottery } from './lottery/definitions'; export { default as lottery } from './lottery/definitions';
export { default as mmr } from './mmr/definitions';
export { default as offences } from './offences/definitions'; export { default as offences } from './offences/definitions';
export { default as proxy } from './proxy/definitions'; export { default as proxy } from './proxy/definitions';
export { default as recovery } from './recovery/definitions'; export { default as recovery } from './recovery/definitions';
@@ -41,11 +42,13 @@ export { default as vesting } from './vesting/definitions';
// polkadot-specific types // polkadot-specific types
export { default as attestations } from './attestations/definitions'; export { default as attestations } from './attestations/definitions';
export { default as beefy } from './beefy/definitions';
export { default as claims } from './claims/definitions'; export { default as claims } from './claims/definitions';
export { default as crowdloan } from './crowdloan/definitions'; export { default as crowdloan } from './crowdloan/definitions';
export { default as parachains } from './parachains/definitions'; export { default as parachains } from './parachains/definitions';
export { default as poll } from './poll/definitions'; export { default as poll } from './poll/definitions';
export { default as purchase } from './purchase/definitions'; export { default as purchase } from './purchase/definitions';
export { default as xcm } from './xcm/definitions';
// scale-info & contracts // scale-info & contracts
export { default as contractsAbi } from './contractsAbi/definitions'; export { default as contractsAbi } from './contractsAbi/definitions';
@@ -0,0 +1,35 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { Definitions } from '../../types';
export default {
rpc: {
generateProof: {
description: 'Generate MMR proof for given leaf index.',
params: [
{
name: 'leafIndex',
type: 'u64'
},
{
name: 'at',
type: 'BlockHash',
isHistoric: true,
isOptional: true
}
],
type: 'MmrLeafProof'
}
},
types: {
MmrLeafProof: {
blockHash: 'BlockHash',
leaf: 'Bytes',
proof: 'Bytes'
}
}
} as Definitions;
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export * from './types';
@@ -0,0 +1,14 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Bytes, Struct } from '@polkadot/types';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
/** @name MmrLeafProof */
export interface MmrLeafProof extends Struct {
readonly blockHash: BlockHash;
readonly leaf: Bytes;
readonly proof: Bytes;
}
export type PHANTOM_MMR = 'mmr';
@@ -24,11 +24,18 @@ const proposeTypes = {
} }
}; };
const cumulusTypes = {
ServiceQuality: {
_enum: ['Ordered', 'Fast']
}
};
export default { export default {
rpc: {}, rpc: {},
types: { types: {
...proposeTypes, ...cumulusTypes,
...hrmpTypes, ...hrmpTypes,
...proposeTypes,
...slotTypes, ...slotTypes,
AbridgedCandidateReceipt: { AbridgedCandidateReceipt: {
parachainIndex: 'ParaId', parachainIndex: 'ParaId',
@@ -97,13 +104,14 @@ export default {
}, },
CandidateDescriptor: { CandidateDescriptor: {
paraId: 'ParaId', paraId: 'ParaId',
relayParent: 'Hash', relayParent: 'RelayChainHash',
collatorId: 'CollatorId', collatorId: 'CollatorId',
persistedValidationDataHash: 'Hash', persistedValidationDataHash: 'Hash',
povHash: 'Hash', povHash: 'Hash',
erasureRoot: 'Hash', erasureRoot: 'Hash',
signature: 'CollatorSignature', signature: 'CollatorSignature',
paraHead: 'Hash' paraHead: 'Hash',
validationCodeHash: 'Hash'
}, },
CandidateHash: 'Hash', CandidateHash: 'Hash',
CandidatePendingAvailability: { CandidatePendingAvailability: {
@@ -119,6 +127,11 @@ export default {
descriptor: 'CandidateDescriptor', descriptor: 'CandidateDescriptor',
commitmentsHash: 'Hash' commitmentsHash: 'Hash'
}, },
GlobalValidationData: {
maxCodeSize: 'u32',
maxHeadDataSize: 'u32',
blockNumber: 'BlockNumber'
},
CollatorId: 'H256', CollatorId: 'H256',
CollatorSignature: 'Signature', CollatorSignature: 'Signature',
CommittedCandidateReceipt: { CommittedCandidateReceipt: {
@@ -138,6 +151,36 @@ export default {
Parachain: 'Null' Parachain: 'Null'
} }
}, },
DisputeStatementSet: {
candidateHash: 'CandidateHash',
session: 'SessionIndex',
statements: 'Vec<(DisputeStatement, ValidatorIndex, ValidatorSignature)>'
},
MultiDisputeStatementSet: 'Vec<DisputeStatementSet>',
DisputeStatement: {
_enum: {
Valid: 'ValidDisputeStatementKind',
Invalid: 'InvalidDisputeStatementKind'
}
},
ValidDisputeStatementKind: {
_enum: [
'Explicit',
'BackingSeconded',
'BackingValid',
'ApprovalChecking'
]
},
InvalidDisputeStatementKind: {
_enum: [
'Explicit'
]
},
ExplicitDisputeStatement: {
valid: 'bool',
candidateHash: 'CandidateHash',
session: 'SessionIndex'
},
DoubleVoteReport: { DoubleVoteReport: {
identity: 'ValidatorId', identity: 'ValidatorId',
first: '(Statement, ValidatorSignature)', first: '(Statement, ValidatorSignature)',
@@ -184,6 +227,7 @@ export default {
threadAvailabilityPeriod: 'BlockNumber', threadAvailabilityPeriod: 'BlockNumber',
schedulingLookahead: 'u32', schedulingLookahead: 'u32',
maxValidatorsPerCore: 'Option<u32>', maxValidatorsPerCore: 'Option<u32>',
maxValidators: 'Option<u32>',
disputePeriod: 'SessionIndex', disputePeriod: 'SessionIndex',
noShowSlots: 'u32', noShowSlots: 'u32',
nDelayTranches: 'u32', nDelayTranches: 'u32',
@@ -223,6 +267,12 @@ export default {
downwardMessages: 'Vec<InboundDownwardMessage>', downwardMessages: 'Vec<InboundDownwardMessage>',
horizontalMessages: 'BTreeMap<ParaId, VecInboundHrmpMessage>' horizontalMessages: 'BTreeMap<ParaId, VecInboundHrmpMessage>'
}, },
ParachainsInherentData: {
bitfields: 'SignedAvailabilityBitfields',
backedCandidates: 'Vec<BackedCandidate>',
disputes: 'MultiDisputeStatementSet',
parentHeader: 'Header'
},
ParaGenesisArgs: { ParaGenesisArgs: {
genesisHead: 'Bytes', genesisHead: 'Bytes',
validationCode: 'Bytes', validationCode: 'Bytes',
@@ -230,7 +280,9 @@ export default {
}, },
ParaId: 'u32', ParaId: 'u32',
ParaInfo: { ParaInfo: {
scheduling: 'Scheduling' manager: 'AccountId',
deposit: 'Balance',
locked: 'bool'
}, },
ParaLifecycle: { ParaLifecycle: {
_enum: ['Onboarding', 'Parathread', 'Parachain', 'UpgradingToParachain', 'DowngradingToParathread', 'OutgoingParathread', 'OutgoingParachain'] _enum: ['Onboarding', 'Parathread', 'Parachain', 'UpgradingToParachain', 'DowngradingToParathread', 'OutgoingParathread', 'OutgoingParachain']
@@ -335,200 +387,6 @@ export default {
Explicit: 'ValidatorSignature' Explicit: 'ValidatorSignature'
} }
}, },
VersionedXcm: {
_enum: {
V0: 'Xcm'
}
},
WithdrawAsset: {
assets: 'Vec<MultiAsset>',
effects: 'Vec<Order>'
},
ReserveAssetDeposit: {
assets: 'Vec<MultiAsset>',
effects: 'Vec<Order>'
},
TeleportAsset: {
assets: 'Vec<MultiAsset>',
effects: 'Vec<Order>'
},
Balances: {
queryId: 'Compact<u64>',
assets: 'Vec<MultiAsset>'
},
Transact: {
originType: 'OriginKind',
call: 'Vec<u8>'
},
RelayTo: {
dest: 'MultiLocation',
inner: 'VersionedXcm'
},
RelayedFrom: {
superorigin: 'MultiLocation',
inner: 'VersionedXcm'
},
Xcm: {
_enum: {
WithdrawAsset: 'WithdrawAsset',
ReserveAssetDeposit: 'ReserveAssetDeposit',
TeleportAsset: 'TeleportAsset',
Balances: 'Balances',
Transact: 'Transact',
RelayTo: 'RelayTo',
RelayedFrom: 'RelayedFrom'
}
},
XcmError: {
_enum: ['Undefined', 'Unimplemented', 'UnhandledXcmVersion', 'UnhandledXcmMessage', 'UnhandledEffect', 'EscalationOfPrivilege', 'UntrustedReserveLocation', 'UntrustedTeleportLocation', 'DestinationBufferOverflow', 'CannotReachDestination', 'MultiLocationFull', 'FailedToDecode', 'BadOrigin']
},
XcmResult: {
_enum: {
Ok: '()',
Err: 'XcmError'
}
},
OriginKind: {
_enum: ['Native', 'SovereignAccount', 'Superuser']
},
NetworkId: {
_enum: {
Any: 'Null',
Named: 'Vec<u8>',
Polkadot: 'Null',
Kusama: 'Null'
}
},
MultiLocation: {
_enum: {
Null: 'Null',
X1: 'Junction',
X2: '(Junction, Junction)',
X3: '(Junction, Junction, Junction)',
X4: '(Junction, Junction, Junction, Junction)'
}
},
AccountId32Junction: {
network: 'NetworkId',
id: 'AccountId'
},
AccountIndex64Junction: {
network: 'NetworkId',
index: 'Compact<u64>'
},
AccountKey20Junction: {
network: 'NetworkId',
index: '[u8; 20]'
},
Junction: {
_enum: {
Parent: 'Null',
Parachain: 'Compact<u32>',
AccountId32: 'AccountId32Junction',
AccountIndex64: 'AccountIndex64Junction',
AccountKey20: 'AccountKey20Junction',
PalletInstance: 'u8',
GeneralIndex: 'Compact<u128>',
GeneralKey: 'Vec<u8>',
OnlyChild: 'Null'
}
},
VersionedMultiLocation: {
_enum: {
V0: 'MultiLocation'
}
},
AssetInstance: {
_enum: {
Undefined: 'Null',
Index8: 'u8',
Index16: 'Compact<u16>',
Index32: 'Compact<u32>',
Index64: 'Compact<u64>',
Index128: 'Compact<u128>',
Array4: '[u8; 4]',
Array8: '[u8; 8]',
Array16: '[u8; 16]',
Array32: '[u8; 32]',
Blob: 'Vec<u8>'
}
},
AbstractFungible: {
id: 'Vec<u8>',
instance: 'Compact<u128>'
},
AbstractNonFungible: {
class: 'Vec<u8>',
instance: 'AssetInstance'
},
ConcreteFungible: {
id: 'MultiLocation',
amount: 'Compact<u128>'
},
ConcreteNonFungible: {
class: 'MultiLocation',
instance: 'AssetInstance'
},
MultiAsset: {
_enum: {
None: 'Null',
All: 'Null',
AllFungible: 'Null',
AllNonFungible: 'Null',
AllAbstractFungible: 'Vec<u8>',
AllAbstractNonFungible: 'Vec<u8>',
AllConcreteFungible: 'MultiLocation',
AllConcreteNonFungible: 'MultiLocation',
AbstractFungible: 'AbstractFungible',
AbstractNonFungible: 'AbstractNonFungible',
ConcreteFungible: 'ConcreteFungible',
ConcreteNonFungible: 'ConcreteNonFungible'
}
},
VersionedMultiAsset: {
_enum: {
V0: 'MultiAsset'
}
},
DepositAsset: {
assets: 'Vec<MultiAsset>',
dest: 'MultiLocation'
},
DepositReserveAsset: {
assets: 'Vec<MultiAsset>',
dest: 'MultiLocation',
effects: 'Vec<Order>'
},
ExchangeAsset: {
give: 'Vec<MultiAsset>',
receive: 'Vec<MultiAsset>'
},
InitiateReserveWithdraw: {
assets: 'Vec<MultiAsset>',
reserve: 'MultiLocation',
effects: 'Vec<Order>'
},
InitiateTeleport: {
assets: 'Vec<MultiAsset>',
dest: 'MultiLocation',
effects: 'Vec<Order>'
},
QueryHolding: {
queryId: 'Compact<u64>',
dest: 'MultiLocation',
assets: 'Vec<MultiAsset>'
},
Order: {
_enum: {
Null: 'Null',
DepositAsset: 'DepositAsset',
DepositReserveAsset: 'DepositReserveAsset',
ExchangeAsset: 'ExchangeAsset',
InitiateReserveWithdraw: 'InitiateReserveWithdraw',
InitiateTeleport: 'InitiateTeleport',
QueryHolding: 'QueryHolding'
}
},
MessagingStateSnapshot: { MessagingStateSnapshot: {
relayDispatchQueueSize: '(u32, u32)', relayDispatchQueueSize: '(u32, u32)',
egressChannels: 'Vec<MessagingStateSnapshotEgressEntry>' egressChannels: 'Vec<MessagingStateSnapshotEgressEntry>'
@@ -6,8 +6,7 @@
const SLOT_RANGE_COUNT = 10; const SLOT_RANGE_COUNT = 10;
export default { const oldTypes = {
AuctionIndex: 'u32',
Bidder: { Bidder: {
_enum: { _enum: {
New: 'NewBidder', New: 'NewBidder',
@@ -30,19 +29,23 @@ export default {
codeSize: 'u32', codeSize: 'u32',
initialHeadData: 'HeadData' initialHeadData: 'HeadData'
}, },
LeasePeriod: 'BlockNumber',
LeasePeriodOf: 'BlockNumber',
NewBidder: { NewBidder: {
who: 'AccountId', who: 'AccountId',
sub: 'SubId' sub: 'SubId'
}, },
NewBidderOption: 'Option<NewBidder>', SubId: 'u32'
};
export default {
...oldTypes,
AuctionIndex: 'u32',
LeasePeriod: 'BlockNumber',
LeasePeriodOf: 'BlockNumber',
SlotRange: { SlotRange: {
_enum: ['ZeroZero', 'ZeroOne', 'ZeroTwo', 'ZeroThree', 'OneOne', 'OneTwo', 'OneThree', 'TwoTwo', 'TwoThree', 'ThreeThree'] _enum: ['ZeroZero', 'ZeroOne', 'ZeroTwo', 'ZeroThree', 'OneOne', 'OneTwo', 'OneThree', 'TwoTwo', 'TwoThree', 'ThreeThree']
}, },
SubId: 'u32',
WinningData: `[WinningDataEntry; ${SLOT_RANGE_COUNT}]`, WinningData: `[WinningDataEntry; ${SLOT_RANGE_COUNT}]`,
WinningDataEntry: 'Option<Bidder>', WinningDataEntry: 'Option<(AccountId, ParaId, BalanceOf)>',
WinnersData: 'Vec<WinnersDataTuple>', WinnersData: 'Vec<WinnersDataTuple>',
WinnersDataTuple: '(NewBidderOption, ParaId, BalanceOf, SlotRange)' WinnersDataTuple: '(AccountId, ParaId, BalanceOf, SlotRange)'
}; };

Some files were not shown because too many files have changed in this diff Show More