Compare commits

..
56 Commits
Author SHA1 Message Date
github-actions[bot] 66159955ac [CI Skip] release/stable 8.0.1
skip-checks: true
2022-04-10 10:34:25 +00:00
Jaco 03c725f637 8.0.1 (#4734) 2022-04-10 13:26:19 +03:00
github-actions[bot] e5708a7e7e [CI Skip] release/beta 7.15.2-15
skip-checks: true
2022-04-09 13:13:27 +00:00
Jaco fb5ce83f74 Add support for apiAt.tx(...) (#4696)
* Add support for apiAt.tx(...)

* CHANGELOG
2022-04-09 16:05:36 +03:00
github-actions[bot] 6c3bd2f408 [CI Skip] release/beta 7.15.2-14
skip-checks: true
2022-04-09 10:11:21 +00:00
Jaco 66e01afe26 Bump metadata (#4732) 2022-04-09 13:02:46 +03:00
github-actions[bot] 71f9bdf368 [CI Skip] release/beta 7.15.2-13
skip-checks: true
2022-04-09 09:26:26 +00:00
Jaco 7af9330026 Add bagList expand(bag: Bag) (#4731) 2022-04-09 12:17:58 +03:00
github-actions[bot] d5aff171e4 [CI Skip] release/beta 7.15.2-12
skip-checks: true
2022-04-09 09:15:46 +00:00
Jaco 543de63af8 Re-use bagList types (#4730) 2022-04-09 12:05:33 +03:00
github-actions[bot] cdcdf589dd [CI Skip] release/beta 7.15.2-11
skip-checks: true
2022-04-09 08:49:12 +00:00
Jaco 1330b58afd Align derive.bagsList.all with multi (#4729) 2022-04-09 11:40:48 +03:00
github-actions[bot] 0b2ec65e88 [CI Skip] release/beta 7.15.2-10
skip-checks: true
2022-04-09 08:37:51 +00:00
Jaco 8840e29063 Bump util to 9.0.1 (#4728) 2022-04-09 11:29:42 +03:00
github-actions[bot] b9925b569d [CI Skip] release/beta 7.15.2-9
skip-checks: true
2022-04-09 06:41:34 +00:00
Jaco 2640b65be9 Fix typegen for cjs imports (#4727) 2022-04-09 09:33:05 +03:00
github-actions[bot] d64a0ca295 [CI Skip] release/beta 7.15.2-8
skip-checks: true
2022-04-08 18:54:24 +00:00
Jaco 79eeed3f9a Return sorted names for api.registry.lookup.names (#4726) 2022-04-08 21:46:03 +03:00
github-actions[bot] d154b535e6 [CI Skip] release/beta 7.15.2-7
skip-checks: true
2022-04-08 15:43:31 +00:00
Jaco 87c2690fc2 Bagslist derive sorted (#4725) 2022-04-08 18:35:14 +03:00
github-actions[bot] 8f0ca37c60 [CI Skip] release/beta 7.15.2-6
skip-checks: true
2022-04-08 13:04:36 +00:00
Jaco f7dd4a3552 Add basic derive.bagsList support (#4723) 2022-04-08 15:56:14 +03:00
github-actions[bot] abcad05a91 [CI Skip] release/beta 7.15.2-5
skip-checks: true
2022-04-08 05:59:53 +00:00
Jaco ba188dcc0d JSONRPC request/response handler opts (#4722)
* JSONRPC request/response handler opts

* Fix test

* CHANGELOG
2022-04-08 08:51:44 +03:00
github-actions[bot] ae2422f350 [CI Skip] release/beta 7.15.2-4
skip-checks: true
2022-04-08 05:45:27 +00:00
Zannis KalampoukisandJaco 576efc0239 fix: typegen supports vectors of slices (#4720)
* fix: typegen supports vectors of slices

* fix linting

* Update packages/typegen/src/util/derived.ts

Co-authored-by: Jaco <jacogr@gmail.com>
2022-04-08 08:37:31 +03:00
github-actions[bot] 111540177f [CI Skip] release/beta 7.15.2-3
skip-checks: true
2022-04-06 10:54:35 +00:00
Josep M Sobrepere 43ee566669 docs: improve rpc-provider README (#4719) 2022-04-06 13:44:56 +03:00
github-actions[bot] 39299188b0 [CI Skip] release/beta 7.15.2-2
skip-checks: true
2022-04-06 09:15:26 +00:00
Jaco 5d13bfb925 Bump @polkadot/* (#4718)
* Bump @polkadot/*

* Bump @substrate/connect

* Adjust
2022-04-06 12:06:42 +03:00
github-actions[bot] c759ff0c12 [CI Skip] release/beta 7.15.2-1
skip-checks: true
2022-04-05 12:29:28 +00:00
Jaco 0cc34dff85 Polkadot 9180 block (#4717) 2022-04-05 15:20:36 +03:00
github-actions[bot] 1682a8f096 [CI Skip] release/beta 7.15.2-0
skip-checks: true
2022-04-05 06:22:59 +00:00
Jaco be572aabf0 Bump @polkadot/dev (#4715) 2022-04-05 09:14:32 +03:00
github-actions[bot] 7a6d19d241 [CI Skip] release/stable 7.15.1
skip-checks: true
2022-04-03 06:07:54 +00:00
Jaco f4a590d7f8 7.15.1 (#4714) 2022-04-03 08:59:31 +03:00
github-actions[bot] 771e5f3bcf [CI Skip] release/beta 7.14.4-9
skip-checks: true
2022-04-02 16:32:54 +00:00
Jaco 1ba427356d Kusama & Westend upgrade blocks (#4713) 2022-04-02 19:24:34 +03:00
github-actions[bot] aad497e9d2 [CI Skip] release/beta 7.14.4-8
skip-checks: true
2022-04-02 10:38:12 +00:00
Jaco 95fc2b2c99 Bump static metadata (#4712) 2022-04-02 13:28:40 +03:00
github-actions[bot] b7b707249b [CI Skip] release/beta 7.14.4-7
skip-checks: true
2022-04-01 08:00:13 +00:00
Jaco ce95e305f3 Bump dev deps (#4711) 2022-04-01 10:50:46 +03:00
github-actions[bot] 4ea793f55e [CI Skip] release/beta 7.14.4-6
skip-checks: true
2022-03-31 13:52:55 +00:00
Jaco bb0b365dfe Lazy crypto init (#4709) 2022-03-31 16:45:09 +03:00
github-actions[bot] 756f817d93 [CI Skip] release/beta 7.14.4-5
skip-checks: true
2022-03-31 07:56:48 +00:00
Jaco df4bda1fc8 Promise cache for metadata from version (improves parallel) (#4708)
* Cache for metadata from version (improves parallel)

* Ordering

* Single waiting placeholder

* Dedupe

* Sprinkle in await

* Tighten up with HexString

* CHANGELOG
2022-03-31 10:46:46 +03:00
github-actions[bot] a98e9543b8 [CI Skip] release/beta 7.14.4-4
skip-checks: true
2022-03-30 15:07:08 +00:00
Jaco 84abaff414 DispatchError.error as [u8; 4] (#4570)
* DispatchError.error as [u8; 4]

* Adjust Error.is

* Adjust

* Adjust

* U8a applies to error only

* CHANGELOG
2022-03-30 17:57:41 +03:00
github-actions[bot] 29d5460cdd [CI Skip] release/beta 7.14.4-3
skip-checks: true
2022-03-30 14:51:41 +00:00
HackFisher e2d0de4f6c Update maxExtrinsic definition (#4703)
Related https://github.com/polkadot-js/api/pull/4702

Sorry thatI shouldn't modify the auto-generated file `types.ts` which was later get reverted by `[CI Skip] release/beta 7.14.4-1`:

https://github.com/polkadot-js/api/commit/6fb6c40c7dd073b7715f9a7fa7628f4b62ab99a8
2022-03-30 17:41:28 +03:00
github-actions[bot] 8e32777efa [CI Skip] release/beta 7.14.4-2
skip-checks: true
2022-03-30 08:26:59 +00:00
Xiliang Chen 39b1de326c implement entriesPaged and keysPages for query at (#4701)
* implement entriesPaged and keysPages for query at

* remove redudent declaration
2022-03-30 11:17:54 +03:00
github-actions[bot] 6fb6c40c7d [CI Skip] release/beta 7.14.4-1
skip-checks: true
2022-03-30 05:02:17 +00:00
HackFisher badb10bdd9 Fix types for maxExtrinsic (#4702)
Ref: https://github.com/paritytech/substrate/blob/41567c30da77a2546a90c1049042ebd7b0b09bc4/frame/system/src/limits.rs#L99-L102
2022-03-30 07:52:05 +03:00
github-actions[bot] 235a7b1aa9 [CI Skip] release/beta 7.14.4-0
skip-checks: true
2022-03-29 04:34:42 +00:00
Josep M Sobrepere b7d65fb506 fix: export substrate-connect WellKnownChain (#4700) 2022-03-29 07:24:57 +03:00
101 changed files with 12516 additions and 11767 deletions
+2
View File
@@ -1,5 +1,7 @@
_book/ _book/
build/ build/
build-cjs/
build-esm/
build-docs/ build-docs/
coverage/ coverage/
docs/.vuepress/dist/ docs/.vuepress/dist/
+38
View File
@@ -1,5 +1,43 @@
# CHANGELOG # CHANGELOG
## 8.0.1 Apr 10, 2022
- **Breaking change** In this major version the commonjs outputs are moved to a sub-folder. Since the export map and main field in package.json does reflect this change, there should be no usage changes. However the packages here will all need to be on the same version for internal linkage.
Contributed:
- Improve `rpc-provider` README (Thanks to https://github.com/josepot)
- Add handling for `Vec<[<Type>;<length>]>` in typegen (Thanks to https://github.com/zannis)
Changes:
- Add support for `apiAt.tx(...)` to construct at a specific point
- Add basic `api.derive.bagsList.*` support
- Return sorted names for `api.registry.lookup.names`
- Optimize JSONRPC requests/response handling
- Output commonjs files under the `cjs/**` root
- Update to latest Substrate, Kusama & Polkadot static metadata
- Add latest Polkadot 9180 upgrade block
- Update to `@polkadot/util` 9.0.1
## 7.15.1 Apr 3, 2022
Contributed:
- Export `WellKnownChain` for `substrate-connect` (Thanks to https://github.com/josepot)
- Add support for `{entries, keys}Paged` in `.at` (Thanks to https://github.com/xlc)
- Align `WeightsPerClass` interface on `maxExtrinsic` (Thanks to https://github.com/HackFisher)
Changes:
- Cater for `DispatchError` with `error` as `[u8; 4]`
- Add in-flight cache for parallel same-version metadata queries
- Cater for lazy `@polkadot/util-crypto` init (adjustment for React Native)
- Update to latest Substrate, Kusama & Polkadot static metadata
- Update latest Westend & Kusama (up to 9180) upgrade blocks
## 7.14.3 Mar 28, 2022 ## 7.14.3 Mar 28, 2022
Changes: Changes:
+5 -3
View File
@@ -1,10 +1,10 @@
2886 Jaco 7.14.3 (#4699) 2908 Jaco 8.0.1 (#4734)
83 Amaury Martiny StatementKind: Regular and Saft (#2303) 83 Amaury Martiny StatementKind: Regular and Saft (#2303)
37 Keith Ingram Update contract types and rpc (#4541) 37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709) 35 Stefanie Doll Updated child storage parameters (#1709)
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970) 20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
16 Xiliang Chen implement entriesPaged and keysPages for query at (#4701)
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054) 15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
15 Xiliang Chen add Authority origin (#3645)
11 Ian He HttpProvider support clone() (#3949) 11 Ian He HttpProvider support clone() (#3949)
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954) 10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
5 Chevdor Fix metadata package link (#3458) 5 Chevdor Fix metadata package link (#3458)
@@ -22,6 +22,7 @@
3 Ewa Kowalska Handle no council for bounties proposals (#3062) 3 Ewa Kowalska Handle no council for bounties proposals (#3062)
3 hamidra add support for n key entries for NMaps (#3886) 3 hamidra add support for n key entries for NMaps (#3886)
3 Hamza Tokuchi more typos (#2532) 3 Hamza Tokuchi more typos (#2532)
3 Josep M Sobrepere docs: improve rpc-provider README (#4719)
3 Julien Eluard Fixed typos about module balances (#1402) 3 Julien Eluard Fixed typos about module balances (#1402)
3 KarishmaBothara Backward compatibility thing (#3511) 3 KarishmaBothara Backward compatibility thing (#3511)
3 Miguel Hervas Adding RT4 Types (#3007) 3 Miguel Hervas Adding RT4 Types (#3007)
@@ -30,6 +31,7 @@
2 Alexander Krupenkin Add [u8; 33] type width for U8aFixed type (#2391) 2 Alexander Krupenkin Add [u8; 33] type width for U8aFixed type (#2391)
2 Branan Riley Add proxy type for Centrifuge (#3940) 2 Branan Riley Add proxy type for Centrifuge (#3940)
2 Caio Add `Range` and `RangeInclusive` types (#3791) 2 Caio Add `Range` and `RangeInclusive` types (#3791)
2 HackFisher Update maxExtrinsic definition (#4703)
2 Jakub Pánik All heads subscription (#1899) 2 Jakub Pánik All heads subscription (#1899)
2 James Lefrère Add `.eq()` usage to docs and fix docs typos (#1405) 2 James Lefrère Add `.eq()` usage to docs and fix docs typos (#1405)
2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230) 2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230)
@@ -65,7 +67,6 @@
1 JesseAbram added 07 Example showing how to make a transfer with allowed block permissions folder in docs (#1062) 1 JesseAbram added 07 Example showing how to make a transfer with allowed block permissions folder in docs (#1062)
1 Joey don't throw error at `onSocketClose` (#4363) 1 Joey don't throw error at `onSocketClose` (#4363)
1 Jordan Allow typegen for custom RPCs (#2876) 1 Jordan Allow typegen for custom RPCs (#2876)
1 Josep M Sobrepere Add smoldot rpc provider (#4672)
1 JQQQ Allow rpc expose definition/ metadata (#3488) 1 JQQQ Allow rpc expose definition/ metadata (#3488)
1 Kian Paimani Update definitions.ts (#2514) 1 Kian Paimani Update definitions.ts (#2514)
1 Krzysztof Jelski Derive for bounties and descriptions (#2925) 1 Krzysztof Jelski Derive for bounties and descriptions (#2925)
@@ -97,4 +98,5 @@
1 Yaroslav Bolyukin Support BTreeMap/BTreeSet in typegen (#4682) 1 Yaroslav Bolyukin Support BTreeMap/BTreeSet in typegen (#4682)
1 yjh fix MetadataVersioned.asV12 (#2983) 1 yjh fix MetadataVersioned.asV12 (#2983)
1 Yuri fixes #3693 Fix uniques return types (#3694) 1 Yuri fixes #3693 Fix uniques return types (#3694)
1 Zannis Kalampoukis fix: typegen supports vectors of slices (#4720)
1 Zeke Mostov fix: Allow sudo for polkadot indexed proxy enum (#3286) 1 Zeke Mostov fix: Allow sudo for polkadot indexed proxy enum (#3286)
+4 -4
View File
@@ -11,7 +11,7 @@
}, },
"sideEffects": false, "sideEffects": false,
"type": "commonjs", "type": "commonjs",
"version": "7.14.3", "version": "8.0.1",
"workspaces": [ "workspaces": [
"packages/*" "packages/*"
], ],
@@ -31,10 +31,10 @@
"test:watch": "polkadot-dev-run-test --watch" "test:watch": "polkadot-dev-run-test --watch"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.8", "@babel/core": "^7.17.9",
"@babel/register": "^7.17.7", "@babel/register": "^7.17.7",
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/dev": "^0.65.101", "@polkadot/dev": "^0.66.1",
"@polkadot/typegen": "workspace:packages/typegen", "@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^27.4.1", "@types/jest": "^27.4.1",
"copyfiles": "^2.4.1" "copyfiles": "^2.4.1"
+9 -9
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/api-base": "7.14.3", "@polkadot/api-base": "8.0.1",
"@polkadot/rpc-augment": "7.14.3", "@polkadot/rpc-augment": "8.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-augment": "7.14.3", "@polkadot/types-augment": "8.0.1",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/util": "^8.7.1" "@polkadot/util": "^9.0.1"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/types-support": "7.14.3" "@polkadot/types-support": "8.0.1"
} }
} }
+29 -23
View File
@@ -135,11 +135,6 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
bounties: { bounties: {
/**
* Percentage of the curator fee that will be reserved upfront as deposit for bounty
* curator.
**/
bountyCuratorDeposit: Permill & AugmentedConst<ApiType>;
/** /**
* The amount held on deposit for placing a bounty proposal. * The amount held on deposit for placing a bounty proposal.
**/ **/
@@ -156,6 +151,21 @@ declare module '@polkadot/api-base/types/consts' {
* Minimum value for a bounty. * Minimum value for a bounty.
**/ **/
bountyValueMinimum: u128 & AugmentedConst<ApiType>; bountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMax: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMin: Option<u128> & AugmentedConst<ApiType>;
/**
* The curator deposit is calculated as a percentage of the curator fee.
*
* This deposit has optional upper and lower bounds with `CuratorDepositMax` and
* `CuratorDepositMin`.
**/
curatorDepositMultiplier: Permill & AugmentedConst<ApiType>;
/** /**
* The amount held on deposit per byte within the tip report reason or bounty description. * The amount held on deposit per byte within the tip report reason or bounty description.
**/ **/
@@ -172,11 +182,6 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
childBounties: { childBounties: {
/**
* Percentage of child-bounty value to be reserved as curator deposit
* when curator fee is zero.
**/
childBountyCuratorDepositBase: Permill & AugmentedConst<ApiType>;
/** /**
* Minimum value for a child-bounty. * Minimum value for a child-bounty.
**/ **/
@@ -279,6 +284,16 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
electionProviderMultiPhase: { electionProviderMultiPhase: {
/**
* The maximum number of electable targets to put in the snapshot.
**/
maxElectableTargets: u16 & AugmentedConst<ApiType>;
/**
* The maximum number of electing voters to put in the snapshot. At the moment, snapshots
* are only over a single block, but once multi-block elections are introduced they will
* take place over multiple blocks.
**/
maxElectingVoters: u32 & AugmentedConst<ApiType>;
/** /**
* Maximum length (bytes) that the mined solution should consume. * Maximum length (bytes) that the mined solution should consume.
* *
@@ -349,15 +364,6 @@ declare module '@polkadot/api-base/types/consts' {
* Duration of the unsigned phase. * Duration of the unsigned phase.
**/ **/
unsignedPhase: u32 & AugmentedConst<ApiType>; unsignedPhase: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of voters to put in the snapshot. At the moment, snapshots are only
* over a single block, but once multi-block elections are introduced they will take place
* over multiple blocks.
*
* Also, note the data type: If the voters are represented by a `u32` in `type
* CompactSolution`, the same `u32` is used here to ensure bounds are respected.
**/
voterSnapshotPerBlock: u32 & AugmentedConst<ApiType>;
/** /**
* Generic const * Generic const
**/ **/
@@ -835,6 +841,10 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
transactionPayment: { transactionPayment: {
/**
* The polynomial that is applied in order to derive fee from length.
**/
lengthToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/** /**
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their * A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
* `priority` * `priority`
@@ -859,10 +869,6 @@ declare module '@polkadot/api-base/types/consts' {
* transactions. * transactions.
**/ **/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>; operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* The fee to be paid for making a transaction; the per-byte portion.
**/
transactionByteFee: u128 & AugmentedConst<ApiType>;
/** /**
* The polynomial that is applied in order to derive fee from weight. * The polynomial that is applied in order to derive fee from weight.
**/ **/
@@ -722,6 +722,10 @@ declare module '@polkadot/api-base/types/events' {
* A proxy was executed correctly, with the given. * A proxy was executed correctly, with the given.
**/ **/
ProxyExecuted: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>; ProxyExecuted: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;
/**
* A proxy was removed.
**/
ProxyRemoved: AugmentedEvent<ApiType, [AccountId32, AccountId32, KusamaRuntimeProxyType, u32]>;
/** /**
* Generic event * Generic event
**/ **/
+18 -12
View File
@@ -4408,10 +4408,13 @@ declare module '@polkadot/api-base/types/submittable' {
**/ **/
forceXcmVersion: AugmentedSubmittable<(location: XcmV1MultiLocation | { parents?: any; interior?: any } | string | Uint8Array, xcmVersion: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmV1MultiLocation, u32]>; forceXcmVersion: AugmentedSubmittable<(location: XcmV1MultiLocation | { parents?: any; interior?: any } | string | Uint8Array, xcmVersion: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmV1MultiLocation, u32]>;
/** /**
* Transfer some assets from the local chain to the sovereign account of a destination chain and forward * Transfer some assets from the local chain to the sovereign account of a destination
* a notification XCM. * chain and forward a notification XCM.
* *
* Fee payment on the destination side is made from the first asset listed in the `assets` vector. * Fee payment on the destination side is made from the asset in the `assets` vector of
* index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight
* is needed than `weight_limit`, then the operation will fail and the assets send may be
* at risk.
* *
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM. * - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
* - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send * - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send
@@ -4428,7 +4431,10 @@ declare module '@polkadot/api-base/types/submittable' {
/** /**
* Teleport some assets from the local chain to some destination chain. * Teleport some assets from the local chain to some destination chain.
* *
* Fee payment on the destination side is made from the first asset listed in the `assets` vector. * Fee payment on the destination side is made from the asset in the `assets` vector of
* index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight
* is needed than `weight_limit`, then the operation will fail and the assets send may be
* at risk.
* *
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM. * - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
* - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send * - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send
@@ -4443,12 +4449,12 @@ declare module '@polkadot/api-base/types/submittable' {
**/ **/
limitedTeleportAssets: AugmentedSubmittable<(dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, beneficiary: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeAssetItem: u32 | AnyNumber | Uint8Array, weightLimit: XcmV2WeightLimit | { Unlimited: any } | { Limited: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation, XcmVersionedMultiLocation, XcmVersionedMultiAssets, u32, XcmV2WeightLimit]>; limitedTeleportAssets: AugmentedSubmittable<(dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, beneficiary: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeAssetItem: u32 | AnyNumber | Uint8Array, weightLimit: XcmV2WeightLimit | { Unlimited: any } | { Limited: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation, XcmVersionedMultiLocation, XcmVersionedMultiAssets, u32, XcmV2WeightLimit]>;
/** /**
* Transfer some assets from the local chain to the sovereign account of a destination chain and forward * Transfer some assets from the local chain to the sovereign account of a destination
* a notification XCM. * chain and forward a notification XCM.
* *
* Fee payment on the destination side is made from the first asset listed in the `assets` vector and * Fee payment on the destination side is made from the asset in the `assets` vector of
* fee-weight is calculated locally and thus remote weights are assumed to be equal to * index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,
* local weights. * with all fees taken as needed from the asset.
* *
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM. * - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
* - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send * - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send
@@ -4465,9 +4471,9 @@ declare module '@polkadot/api-base/types/submittable' {
/** /**
* Teleport some assets from the local chain to some destination chain. * Teleport some assets from the local chain to some destination chain.
* *
* Fee payment on the destination side is made from the first asset listed in the `assets` vector and * Fee payment on the destination side is made from the asset in the `assets` vector of
* fee-weight is calculated locally and thus remote weights are assumed to be equal to * index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,
* local weights. * with all fees taken as needed from the asset.
* *
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM. * - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
* - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send * - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.0.1' };
+29 -23
View File
@@ -135,11 +135,6 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
bounties: { bounties: {
/**
* Percentage of the curator fee that will be reserved upfront as deposit for bounty
* curator.
**/
bountyCuratorDeposit: Permill & AugmentedConst<ApiType>;
/** /**
* The amount held on deposit for placing a bounty proposal. * The amount held on deposit for placing a bounty proposal.
**/ **/
@@ -156,6 +151,21 @@ declare module '@polkadot/api-base/types/consts' {
* Minimum value for a bounty. * Minimum value for a bounty.
**/ **/
bountyValueMinimum: u128 & AugmentedConst<ApiType>; bountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMax: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMin: Option<u128> & AugmentedConst<ApiType>;
/**
* The curator deposit is calculated as a percentage of the curator fee.
*
* This deposit has optional upper and lower bounds with `CuratorDepositMax` and
* `CuratorDepositMin`.
**/
curatorDepositMultiplier: Permill & AugmentedConst<ApiType>;
/** /**
* The amount held on deposit per byte within the tip report reason or bounty description. * The amount held on deposit per byte within the tip report reason or bounty description.
**/ **/
@@ -172,11 +182,6 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
childBounties: { childBounties: {
/**
* Percentage of child-bounty value to be reserved as curator deposit
* when curator fee is zero.
**/
childBountyCuratorDepositBase: Permill & AugmentedConst<ApiType>;
/** /**
* Minimum value for a child-bounty. * Minimum value for a child-bounty.
**/ **/
@@ -279,6 +284,16 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
electionProviderMultiPhase: { electionProviderMultiPhase: {
/**
* The maximum number of electable targets to put in the snapshot.
**/
maxElectableTargets: u16 & AugmentedConst<ApiType>;
/**
* The maximum number of electing voters to put in the snapshot. At the moment, snapshots
* are only over a single block, but once multi-block elections are introduced they will
* take place over multiple blocks.
**/
maxElectingVoters: u32 & AugmentedConst<ApiType>;
/** /**
* Maximum length (bytes) that the mined solution should consume. * Maximum length (bytes) that the mined solution should consume.
* *
@@ -349,15 +364,6 @@ declare module '@polkadot/api-base/types/consts' {
* Duration of the unsigned phase. * Duration of the unsigned phase.
**/ **/
unsignedPhase: u32 & AugmentedConst<ApiType>; unsignedPhase: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of voters to put in the snapshot. At the moment, snapshots are only
* over a single block, but once multi-block elections are introduced they will take place
* over multiple blocks.
*
* Also, note the data type: If the voters are represented by a `u32` in `type
* CompactSolution`, the same `u32` is used here to ensure bounds are respected.
**/
voterSnapshotPerBlock: u32 & AugmentedConst<ApiType>;
/** /**
* Generic const * Generic const
**/ **/
@@ -702,6 +708,10 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
transactionPayment: { transactionPayment: {
/**
* The polynomial that is applied in order to derive fee from length.
**/
lengthToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/** /**
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their * A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
* `priority` * `priority`
@@ -726,10 +736,6 @@ declare module '@polkadot/api-base/types/consts' {
* transactions. * transactions.
**/ **/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>; operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* The fee to be paid for making a transaction; the per-byte portion.
**/
transactionByteFee: u128 & AugmentedConst<ApiType>;
/** /**
* The polynomial that is applied in order to derive fee from weight. * The polynomial that is applied in order to derive fee from weight.
**/ **/
@@ -700,6 +700,10 @@ declare module '@polkadot/api-base/types/events' {
* A proxy was executed correctly, with the given. * A proxy was executed correctly, with the given.
**/ **/
ProxyExecuted: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>; ProxyExecuted: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;
/**
* A proxy was removed.
**/
ProxyRemoved: AugmentedEvent<ApiType, [AccountId32, AccountId32, PolkadotRuntimeProxyType, u32]>;
/** /**
* Generic event * Generic event
**/ **/
+18 -12
View File
@@ -3826,10 +3826,13 @@ declare module '@polkadot/api-base/types/submittable' {
**/ **/
forceXcmVersion: AugmentedSubmittable<(location: XcmV1MultiLocation | { parents?: any; interior?: any } | string | Uint8Array, xcmVersion: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmV1MultiLocation, u32]>; forceXcmVersion: AugmentedSubmittable<(location: XcmV1MultiLocation | { parents?: any; interior?: any } | string | Uint8Array, xcmVersion: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmV1MultiLocation, u32]>;
/** /**
* Transfer some assets from the local chain to the sovereign account of a destination chain and forward * Transfer some assets from the local chain to the sovereign account of a destination
* a notification XCM. * chain and forward a notification XCM.
* *
* Fee payment on the destination side is made from the first asset listed in the `assets` vector. * Fee payment on the destination side is made from the asset in the `assets` vector of
* index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight
* is needed than `weight_limit`, then the operation will fail and the assets send may be
* at risk.
* *
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM. * - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
* - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send * - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send
@@ -3846,7 +3849,10 @@ declare module '@polkadot/api-base/types/submittable' {
/** /**
* Teleport some assets from the local chain to some destination chain. * Teleport some assets from the local chain to some destination chain.
* *
* Fee payment on the destination side is made from the first asset listed in the `assets` vector. * Fee payment on the destination side is made from the asset in the `assets` vector of
* index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight
* is needed than `weight_limit`, then the operation will fail and the assets send may be
* at risk.
* *
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM. * - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
* - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send * - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send
@@ -3861,12 +3867,12 @@ declare module '@polkadot/api-base/types/submittable' {
**/ **/
limitedTeleportAssets: AugmentedSubmittable<(dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, beneficiary: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeAssetItem: u32 | AnyNumber | Uint8Array, weightLimit: XcmV2WeightLimit | { Unlimited: any } | { Limited: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation, XcmVersionedMultiLocation, XcmVersionedMultiAssets, u32, XcmV2WeightLimit]>; limitedTeleportAssets: AugmentedSubmittable<(dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, beneficiary: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeAssetItem: u32 | AnyNumber | Uint8Array, weightLimit: XcmV2WeightLimit | { Unlimited: any } | { Limited: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation, XcmVersionedMultiLocation, XcmVersionedMultiAssets, u32, XcmV2WeightLimit]>;
/** /**
* Transfer some assets from the local chain to the sovereign account of a destination chain and forward * Transfer some assets from the local chain to the sovereign account of a destination
* a notification XCM. * chain and forward a notification XCM.
* *
* Fee payment on the destination side is made from the first asset listed in the `assets` vector and * Fee payment on the destination side is made from the asset in the `assets` vector of
* fee-weight is calculated locally and thus remote weights are assumed to be equal to * index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,
* local weights. * with all fees taken as needed from the asset.
* *
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM. * - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
* - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send * - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send
@@ -3883,9 +3889,9 @@ declare module '@polkadot/api-base/types/submittable' {
/** /**
* Teleport some assets from the local chain to some destination chain. * Teleport some assets from the local chain to some destination chain.
* *
* Fee payment on the destination side is made from the first asset listed in the `assets` vector and * Fee payment on the destination side is made from the asset in the `assets` vector of
* fee-weight is calculated locally and thus remote weights are assumed to be equal to * index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,
* local weights. * with all fees taken as needed from the asset.
* *
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM. * - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
* - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send * - `dest`: Destination context for the assets. Will typically be `X2(Parent, Parachain(..))` to send
+30 -34
View File
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
import type { Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types'; import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime'; import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, PalletStateTrieMigrationMigrationLimits, SpVersionRuntimeVersion } from '@polkadot/types/lookup'; import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/consts' { declare module '@polkadot/api-base/types/consts' {
export interface AugmentedConsts<ApiType extends ApiTypes> { export interface AugmentedConsts<ApiType extends ApiTypes> {
@@ -149,11 +149,6 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
bounties: { bounties: {
/**
* Percentage of the curator fee that will be reserved upfront as deposit for bounty
* curator.
**/
bountyCuratorDeposit: Permill & AugmentedConst<ApiType>;
/** /**
* The amount held on deposit for placing a bounty proposal. * The amount held on deposit for placing a bounty proposal.
**/ **/
@@ -170,6 +165,21 @@ declare module '@polkadot/api-base/types/consts' {
* Minimum value for a bounty. * Minimum value for a bounty.
**/ **/
bountyValueMinimum: u128 & AugmentedConst<ApiType>; bountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMax: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMin: Option<u128> & AugmentedConst<ApiType>;
/**
* The curator deposit is calculated as a percentage of the curator fee.
*
* This deposit has optional upper and lower bounds with `CuratorDepositMax` and
* `CuratorDepositMin`.
**/
curatorDepositMultiplier: Permill & AugmentedConst<ApiType>;
/** /**
* The amount held on deposit per byte within the tip report reason or bounty description. * The amount held on deposit per byte within the tip report reason or bounty description.
**/ **/
@@ -186,11 +196,6 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
childBounties: { childBounties: {
/**
* Percentage of child-bounty value to be reserved as curator deposit
* when curator fee is zero.
**/
childBountyCuratorDepositBase: Permill & AugmentedConst<ApiType>;
/** /**
* Minimum value for a child-bounty. * Minimum value for a child-bounty.
**/ **/
@@ -340,6 +345,16 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
electionProviderMultiPhase: { electionProviderMultiPhase: {
/**
* The maximum number of electable targets to put in the snapshot.
**/
maxElectableTargets: u16 & AugmentedConst<ApiType>;
/**
* The maximum number of electing voters to put in the snapshot. At the moment, snapshots
* are only over a single block, but once multi-block elections are introduced they will
* take place over multiple blocks.
**/
maxElectingVoters: u32 & AugmentedConst<ApiType>;
/** /**
* Maximum length (bytes) that the mined solution should consume. * Maximum length (bytes) that the mined solution should consume.
* *
@@ -410,15 +425,6 @@ declare module '@polkadot/api-base/types/consts' {
* Duration of the unsigned phase. * Duration of the unsigned phase.
**/ **/
unsignedPhase: u32 & AugmentedConst<ApiType>; unsignedPhase: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of voters to put in the snapshot. At the moment, snapshots are only
* over a single block, but once multi-block elections are introduced they will take place
* over multiple blocks.
*
* Also, note the data type: If the voters are represented by a `u32` in `type
* CompactSolution`, the same `u32` is used here to ensure bounds are respected.
**/
voterSnapshotPerBlock: u32 & AugmentedConst<ApiType>;
/** /**
* Generic const * Generic const
**/ **/
@@ -829,16 +835,6 @@ declare module '@polkadot/api-base/types/consts' {
**/ **/
[key: string]: Codec; [key: string]: Codec;
}; };
stateTrieMigration: {
/**
* The maximum limits that the signed migration could use.
**/
signedMigrationMaxLimits: PalletStateTrieMigrationMigrationLimits & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
system: { system: {
/** /**
* Maximum number of block number to block hash mappings to keep (oldest pruned first). * Maximum number of block number to block hash mappings to keep (oldest pruned first).
@@ -915,6 +911,10 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec; [key: string]: Codec;
}; };
transactionPayment: { transactionPayment: {
/**
* The polynomial that is applied in order to derive fee from length.
**/
lengthToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/** /**
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their * A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
* `priority` * `priority`
@@ -939,10 +939,6 @@ declare module '@polkadot/api-base/types/consts' {
* transactions. * transactions.
**/ **/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>; operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* The fee to be paid for making a transaction; the per-byte portion.
**/
transactionByteFee: u128 & AugmentedConst<ApiType>;
/** /**
* The polynomial that is applied in order to derive fee from weight. * The polynomial that is applied in order to derive fee from weight.
**/ **/
@@ -1451,6 +1451,10 @@ declare module '@polkadot/api-base/types/errors' {
* submitter does not have enough funds. * submitter does not have enough funds.
**/ **/
NotEnoughFunds: AugmentedError<ApiType>; NotEnoughFunds: AugmentedError<ApiType>;
/**
* Signed migration is not allowed because the maximum limit is not set yet.
**/
SignedMigrationNotAllowed: AugmentedError<ApiType>;
/** /**
* upper bound of size is exceeded, * upper bound of size is exceeded,
**/ **/
@@ -663,6 +663,10 @@ declare module '@polkadot/api-base/types/events' {
* A proxy was executed correctly, with the given. * A proxy was executed correctly, with the given.
**/ **/
ProxyExecuted: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>; ProxyExecuted: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;
/**
* A proxy was removed.
**/
ProxyRemoved: AugmentedEvent<ApiType, [AccountId32, AccountId32, NodeRuntimeProxyType, u32]>;
/** /**
* Generic event * Generic event
**/ **/
@@ -1282,6 +1282,12 @@ declare module '@polkadot/api-base/types/storage' {
* forward by any of the means provided by this pallet. * forward by any of the means provided by this pallet.
**/ **/
migrationProcess: AugmentedQuery<ApiType, () => Observable<PalletStateTrieMigrationMigrationTask>, []> & QueryableStorageEntry<ApiType, []>; migrationProcess: AugmentedQuery<ApiType, () => Observable<PalletStateTrieMigrationMigrationTask>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The maximum limits that the signed migration could use.
*
* If not set, no signed submission is allowed.
**/
signedMigrationMaxLimits: AugmentedQuery<ApiType, () => Observable<Option<PalletStateTrieMigrationMigrationLimits>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* Generic query * Generic query
**/ **/
+17 -1
View File
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime'; import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportScheduleDispatchTime, FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup'; import type { FrameSupportScheduleDispatchTime, FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletStateTrieMigrationProgress, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/submittable' { declare module '@polkadot/api-base/types/submittable' {
export interface AugmentedSubmittables<ApiType extends ApiTypes> { export interface AugmentedSubmittables<ApiType extends ApiTypes> {
@@ -3795,6 +3795,18 @@ declare module '@polkadot/api-base/types/submittable' {
* The dispatch origin of this call must be [`Config::ControlOrigin`]. * The dispatch origin of this call must be [`Config::ControlOrigin`].
**/ **/
controlAutoMigration: AugmentedSubmittable<(maybeConfig: Option<PalletStateTrieMigrationMigrationLimits> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<PalletStateTrieMigrationMigrationLimits>]>; controlAutoMigration: AugmentedSubmittable<(maybeConfig: Option<PalletStateTrieMigrationMigrationLimits> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<PalletStateTrieMigrationMigrationLimits>]>;
/**
* Forcefully set the progress the running migration.
*
* This is only useful in one case: the next key to migrate is too big to be migrated with
* a signed account, in a parachain context, and we simply want to skip it. A reasonable
* example of this would be `:code:`, which is both very expensive to migrate, and commonly
* used, so probably it is already migrated.
*
* In case you mess things up, you can also, in principle, use this to reset the migration
* process.
**/
forceSetProgress: AugmentedSubmittable<(progressTop: PalletStateTrieMigrationProgress | { ToStart: any } | { LastKey: any } | { Complete: any } | string | Uint8Array, progressChild: PalletStateTrieMigrationProgress | { ToStart: any } | { LastKey: any } | { Complete: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletStateTrieMigrationProgress, PalletStateTrieMigrationProgress]>;
/** /**
* Migrate the list of child keys by iterating each of them one by one. * Migrate the list of child keys by iterating each of them one by one.
* *
@@ -3811,6 +3823,10 @@ declare module '@polkadot/api-base/types/submittable' {
* should only be used in case any keys are leftover due to a bug. * should only be used in case any keys are leftover due to a bug.
**/ **/
migrateCustomTop: AugmentedSubmittable<(keys: Vec<Bytes> | (Bytes | string | Uint8Array)[], witnessSize: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<Bytes>, u32]>; migrateCustomTop: AugmentedSubmittable<(keys: Vec<Bytes> | (Bytes | string | Uint8Array)[], witnessSize: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<Bytes>, u32]>;
/**
* Set the maximum limit of the signed migration.
**/
setSignedMaxLimits: AugmentedSubmittable<(limits: PalletStateTrieMigrationMigrationLimits | { size_?: any; item?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletStateTrieMigrationMigrationLimits]>;
/** /**
* Generic tx * Generic tx
**/ **/
+5 -5
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/rpc-core": "7.14.3", "@polkadot/rpc-core": "8.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/util": "^8.7.1", "@polkadot/util": "^9.0.1",
"rxjs": "^7.5.5" "rxjs": "^7.5.5"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.0.1' };
+2 -2
View File
@@ -74,12 +74,10 @@ export interface StorageEntryBase<ApiType extends ApiTypes, F extends AnyFunctio
* @deprecated Use api.at(<blockHash>) * @deprecated Use api.at(<blockHash>)
*/ */
entriesAt: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>; entriesAt: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
entriesPaged: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
/** /**
* @deprecated Use api.at(<blockHash>) * @deprecated Use api.at(<blockHash>)
*/ */
keysAt: <K extends AnyTuple = A> (hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>; keysAt: <K extends AnyTuple = A> (hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
keysPaged: <K extends AnyTuple = A> (opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
/** /**
* @deprecated The underlying RPC this been marked unsafe and is generally not exposed * @deprecated The underlying RPC this been marked unsafe and is generally not exposed
*/ */
@@ -95,11 +93,13 @@ export interface StorageEntryBase<ApiType extends ApiTypes, F extends AnyFunctio
export interface StorageEntryBaseAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> { export interface StorageEntryBaseAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> {
entries: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>; entries: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
entriesPaged: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
hash: (...args: Parameters<F>) => PromiseOrObs<ApiType, Hash>; hash: (...args: Parameters<F>) => PromiseOrObs<ApiType, Hash>;
is: (key: IStorageKey<AnyTuple>) => key is IStorageKey<A>; is: (key: IStorageKey<AnyTuple>) => key is IStorageKey<A>;
key: (...args: Parameters<F>) => string; key: (...args: Parameters<F>) => string;
keyPrefix: (...args: DropLast<Parameters<F>>) => string; keyPrefix: (...args: DropLast<Parameters<F>>) => string;
keys: <K extends AnyTuple = A> (...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>; keys: <K extends AnyTuple = A> (...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
keysPaged: <K extends AnyTuple = A> (opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
size: (...args: Parameters<F>) => PromiseOrObs<ApiType, u64>; size: (...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
} }
+10 -10
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/api": "7.14.3", "@polkadot/api": "8.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/types-create": "7.14.3", "@polkadot/types-create": "8.0.1",
"@polkadot/util": "^8.7.1", "@polkadot/util": "^9.0.1",
"@polkadot/util-crypto": "^8.7.1", "@polkadot/util-crypto": "^9.0.1",
"rxjs": "^7.5.5" "rxjs": "^7.5.5"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/api-augment": "7.14.3", "@polkadot/api-augment": "8.0.1",
"@polkadot/keyring": "^8.7.1" "@polkadot/keyring": "^9.0.1"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.0.1' };
+15 -15
View File
@@ -20,25 +20,25 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/api": "7.14.3", "@polkadot/api": "8.0.1",
"@polkadot/api-augment": "7.14.3", "@polkadot/api-augment": "8.0.1",
"@polkadot/api-base": "7.14.3", "@polkadot/api-base": "8.0.1",
"@polkadot/rpc-core": "7.14.3", "@polkadot/rpc-core": "8.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/util": "^8.7.1", "@polkadot/util": "^9.0.1",
"@polkadot/util-crypto": "^8.7.1", "@polkadot/util-crypto": "^9.0.1",
"rxjs": "^7.5.5" "rxjs": "^7.5.5"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/api": "7.14.3", "@polkadot/api": "8.0.1",
"@polkadot/api-augment": "7.14.3", "@polkadot/api-augment": "8.0.1",
"@polkadot/rpc-augment": "7.14.3", "@polkadot/rpc-augment": "8.0.1",
"@polkadot/rpc-provider": "7.14.3", "@polkadot/rpc-provider": "8.0.1",
"@polkadot/types-support": "7.14.3" "@polkadot/types-support": "8.0.1"
} }
} }
+72
View File
@@ -0,0 +1,72 @@
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Option } from '@polkadot/types';
import type { PalletBagsListListBag } from '@polkadot/types/lookup';
import type { BN } from '@polkadot/util';
import type { DeriveApi } from '../types';
import type { Bag } from './types';
import { map, of, switchMap } from 'rxjs';
import { BN_ZERO, bnToBn } from '@polkadot/util';
import { memo } from '../util';
function orderBags (ids: BN[], bags: Option<PalletBagsListListBag>[]): Bag[] {
const sorted = ids
.map((id, index) => ({
bag: bags[index].unwrapOr(null),
id,
key: id.toString()
}))
.sort((a, b) => b.id.cmp(a.id))
.map((base, index): Bag => ({
...base,
bagLower: BN_ZERO,
bagUpper: base.id,
index
}));
const max = sorted.length - 1;
return sorted.map((entry, index) =>
index === max
? entry
// We could probably use a .add(BN_ONE) here
: { ...entry, bagLower: sorted[index + 1].bagUpper }
);
}
export function _getIds (instanceId: string, api: DeriveApi): (ids: (BN | number)[]) => Observable<Bag[]> {
return memo(instanceId, (_ids: (BN | number)[]): Observable<Bag[]> => {
const ids = _ids.map((id) => bnToBn(id));
return ids.length
? api.query.listBags.multi<Option<PalletBagsListListBag>[]>(ids).pipe(
map((bags) => orderBags(ids, bags))
)
: of([]);
});
}
export function all (instanceId: string, api: DeriveApi): () => Observable<Bag[]> {
return memo(instanceId, (): Observable<Bag[]> =>
api.query.bagsList.listBags.keys().pipe(
switchMap((keys) =>
api.derive.bagsList._getIds(keys.map(({ args: [id] }) => id))
),
map((list) =>
list.filter(({ bag }) => bag)
)
)
);
}
export function get (instanceId: string, api: DeriveApi): (id: BN | number) => Observable<Bag> {
return memo(instanceId, (id: BN | number): Observable<Bag> =>
api.derive.bagsList._getIds([bnToBn(id)]).pipe(
map((bags) => bags[0])
)
);
}
@@ -0,0 +1,29 @@
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { BN } from '@polkadot/util';
import type { DeriveApi } from '../types';
import type { Bag, BagExpanded } from './types';
import { map, switchMap } from 'rxjs';
import { memo } from '../util';
export function expand (instanceId: string, api: DeriveApi): (bag: Bag) => Observable<BagExpanded> {
return memo(instanceId, (bag: Bag): Observable<BagExpanded> =>
api.derive.bagsList.listNodes(bag.bag).pipe(
map((nodes) => ({ ...bag, nodes }))
)
);
}
export function getExpanded (instanceId: string, api: DeriveApi): (id: BN | number) => Observable<BagExpanded> {
return memo(instanceId, (id: BN | number): Observable<BagExpanded> =>
api.derive.bagsList.get(id).pipe(
switchMap((bag) =>
api.derive.bagsList.expand(bag)
)
)
);
}
@@ -0,0 +1,6 @@
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './get';
export * from './getExpanded';
export * from './listNodes';
@@ -0,0 +1,41 @@
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Option } from '@polkadot/types';
import type { AccountId32 } from '@polkadot/types/interfaces';
import type { PalletBagsListListBag, PalletBagsListListNode } from '@polkadot/types/lookup';
import type { DeriveApi } from '../types';
import { BehaviorSubject, map, of, switchMap, tap, toArray } from 'rxjs';
import { memo } from '../util';
function traverseLinks (api: DeriveApi, head: AccountId32 | string): Observable<PalletBagsListListNode[]> {
const subject = new BehaviorSubject<AccountId32 | string>(head);
return subject.pipe(
switchMap((account) =>
api.query.bagsList.listNodes(account)
),
tap((node: Option<PalletBagsListListNode>): void => {
setTimeout((): void => {
node.isSome && (node.value as PalletBagsListListNode).next.isSome
? subject.next(node.unwrap().next.unwrap())
: subject.complete();
}, 0);
}),
toArray(), // toArray since we want to startSubject to be completed
map((all: Option<PalletBagsListListNode>[]) =>
all.map((o) => o.unwrap())
)
);
}
export function listNodes (instanceId: string, api: DeriveApi): (bag: PalletBagsListListBag | null) => Observable<PalletBagsListListNode[]> {
return memo(instanceId, (bag: PalletBagsListListBag | null): Observable<PalletBagsListListNode[]> =>
bag && bag.head.isSome
? traverseLinks(api, bag.head.unwrap())
: of([])
);
}
+18
View File
@@ -0,0 +1,18 @@
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { PalletBagsListListBag, PalletBagsListListNode } from '@polkadot/types/lookup';
import type { BN } from '@polkadot/util';
export interface Bag {
bag: PalletBagsListListBag | null;
bagUpper: BN;
bagLower: BN;
id: BN;
index: number;
key: string;
}
export interface BagExpanded extends Bag {
nodes: PalletBagsListListNode[];
}
+4
View File
@@ -22,6 +22,10 @@ export { lazyDeriveSection };
// Enable derive only if some of these modules are available // Enable derive only if some of these modules are available
const checks: Record<string, Avail> = { const checks: Record<string, Avail> = {
bagsList: {
instances: ['bagsList'],
methods: []
},
contracts: { contracts: {
instances: ['contracts'], instances: ['contracts'],
methods: [] methods: []
@@ -60,17 +60,17 @@ function _eventTriggerAll (api: DeriveApi, paraId: string | number | BN): Observ
} }
function _getKeysPaged (api: DeriveApi, childKey: string): Observable<StorageKey[]> { function _getKeysPaged (api: DeriveApi, childKey: string): Observable<StorageKey[]> {
const startSubject = new BehaviorSubject<string | undefined>(undefined); const subject = new BehaviorSubject<string | undefined>(undefined);
return startSubject.pipe( return subject.pipe(
switchMap((startKey) => switchMap((startKey) =>
api.rpc.childstate.getKeysPaged(childKey, '0x', PAGE_SIZE_K, startKey) api.rpc.childstate.getKeysPaged(childKey, '0x', PAGE_SIZE_K, startKey)
), ),
tap((keys): void => { tap((keys): void => {
setTimeout((): void => { setTimeout((): void => {
keys.length === PAGE_SIZE_K keys.length === PAGE_SIZE_K
? startSubject.next(keys[PAGE_SIZE_K - 1].toHex()) ? subject.next(keys[PAGE_SIZE_K - 1].toHex())
: startSubject.complete(); : subject.complete();
}, 0); }, 0);
}), }),
toArray(), // toArray since we want to startSubject to be completed toArray(), // toArray since we want to startSubject to be completed
+2 -1
View File
@@ -4,6 +4,7 @@
import type { AnyFunction } from '@polkadot/types/types'; import type { AnyFunction } from '@polkadot/types/types';
import * as accounts from './accounts'; import * as accounts from './accounts';
import * as bagsList from './bagsList';
import * as balances from './balances'; import * as balances from './balances';
import * as bounties from './bounties'; import * as bounties from './bounties';
import * as chain from './chain'; import * as chain from './chain';
@@ -22,7 +23,7 @@ import * as technicalCommittee from './technicalCommittee';
import * as treasury from './treasury'; import * as treasury from './treasury';
import * as tx from './tx'; import * as tx from './tx';
export const derive = { accounts, balances, bounties, chain, contracts, council, crowdloan, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx }; export const derive = { accounts, bagsList, balances, bounties, chain, contracts, council, crowdloan, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx };
type DeriveSection<Section> = { type DeriveSection<Section> = {
[M in keyof Section]: Section[M] extends AnyFunction [M in keyof Section]: Section[M] extends AnyFunction
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.0.1' };
+4 -4
View File
@@ -23,17 +23,17 @@ const ERA_CHUNK_SIZE = 14;
function chunkEras <T> (eras: EraIndex[], fn: (eras: EraIndex[]) => Observable<T[]>): Observable<T[]> { function chunkEras <T> (eras: EraIndex[], fn: (eras: EraIndex[]) => Observable<T[]>): Observable<T[]> {
const chunked = arrayChunk(eras, ERA_CHUNK_SIZE); const chunked = arrayChunk(eras, ERA_CHUNK_SIZE);
let index = 0; let index = 0;
const startSubject = new BehaviorSubject<EraIndex[]>(chunked[index]); const subject = new BehaviorSubject<EraIndex[]>(chunked[index]);
return startSubject.pipe( return subject.pipe(
switchMap(fn), switchMap(fn),
tap((): void => { tap((): void => {
setTimeout((): void => { setTimeout((): void => {
index++; index++;
index === chunked.length index === chunked.length
? startSubject.complete() ? subject.complete()
: startSubject.next(chunked[index]); : subject.next(chunked[index]);
}, 0); }, 0);
}), }),
toArray(), toArray(),
+1
View File
@@ -10,6 +10,7 @@ import type { ExactDerive } from './derive';
export * from './accounts/types'; export * from './accounts/types';
export * from './balances/types'; export * from './balances/types';
export * from './bagsList/types';
export * from './council/types'; export * from './council/types';
export * from './crowdloan/types'; export * from './crowdloan/types';
export * from './democracy/types'; export * from './democracy/types';
+18 -18
View File
@@ -20,29 +20,29 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/api-augment": "7.14.3", "@polkadot/api-augment": "8.0.1",
"@polkadot/api-base": "7.14.3", "@polkadot/api-base": "8.0.1",
"@polkadot/api-derive": "7.14.3", "@polkadot/api-derive": "8.0.1",
"@polkadot/keyring": "^8.7.1", "@polkadot/keyring": "^9.0.1",
"@polkadot/rpc-augment": "7.14.3", "@polkadot/rpc-augment": "8.0.1",
"@polkadot/rpc-core": "7.14.3", "@polkadot/rpc-core": "8.0.1",
"@polkadot/rpc-provider": "7.14.3", "@polkadot/rpc-provider": "8.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-augment": "7.14.3", "@polkadot/types-augment": "8.0.1",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/types-create": "7.14.3", "@polkadot/types-create": "8.0.1",
"@polkadot/types-known": "7.14.3", "@polkadot/types-known": "8.0.1",
"@polkadot/util": "^8.7.1", "@polkadot/util": "^9.0.1",
"@polkadot/util-crypto": "^8.7.1", "@polkadot/util-crypto": "^9.0.1",
"eventemitter3": "^4.0.7", "eventemitter3": "^4.0.7",
"rxjs": "^7.5.5" "rxjs": "^7.5.5"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/api-augment": "7.14.3", "@polkadot/api-augment": "8.0.1",
"@polkadot/types-support": "7.14.3" "@polkadot/types-support": "8.0.1"
} }
} }
+31 -27
View File
@@ -199,18 +199,23 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
return this._rpcCore.provider.hasSubscriptions || !!this._rpcCore.state.queryStorageAt; return this._rpcCore.provider.hasSubscriptions || !!this._rpcCore.state.queryStorageAt;
} }
protected _emptyDecorated (registry: Registry, blockHash?: Uint8Array): ApiDecoration<ApiType> {
return {
consts: {},
errors: {},
events: {},
query: {},
registry,
rx: {
query: {}
},
tx: createSubmittable(this._type, this._rx, this._decorateMethod, registry, blockHash)
} as ApiDecoration<ApiType>;
}
protected _createDecorated (registry: VersionedRegistry<ApiType>, fromEmpty: boolean, decoratedApi: ApiDecoration<ApiType> | null, blockHash?: Uint8Array): FullDecoration<ApiType> { protected _createDecorated (registry: VersionedRegistry<ApiType>, fromEmpty: boolean, decoratedApi: ApiDecoration<ApiType> | null, blockHash?: Uint8Array): FullDecoration<ApiType> {
if (!decoratedApi) { if (!decoratedApi) {
decoratedApi = { decoratedApi = this._emptyDecorated(registry.registry, blockHash);
consts: {},
errors: {},
events: {},
query: {},
registry: registry.registry,
rx: {
query: {}
}
} as ApiDecoration<ApiType>;
} }
if (fromEmpty || !registry.decoratedMeta) { if (fromEmpty || !registry.decoratedMeta) {
@@ -243,16 +248,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
protected _injectMetadata (registry: VersionedRegistry<ApiType>, fromEmpty = false): void { protected _injectMetadata (registry: VersionedRegistry<ApiType>, fromEmpty = false): void {
// clear the decoration, we are redoing it here // clear the decoration, we are redoing it here
if (fromEmpty || !registry.decoratedApi) { if (fromEmpty || !registry.decoratedApi) {
registry.decoratedApi = { registry.decoratedApi = this._emptyDecorated(registry.registry);
consts: {},
errors: {},
events: {},
query: {},
registry: registry.registry,
rx: {
query: {}
}
} as ApiDecoration<ApiType>;
} }
const { decoratedApi, decoratedMeta } = this._createDecorated(registry, fromEmpty, registry.decoratedApi); const { decoratedApi, decoratedMeta } = this._createDecorated(registry, fromEmpty, registry.decoratedApi);
@@ -543,7 +539,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
decorated.entriesPaged = decorateMethod( decorated.entriesPaged = decorateMethod(
memo(this.#instanceId, (opts: PaginationOptions): Observable<[StorageKey, Codec][]> => memo(this.#instanceId, (opts: PaginationOptions): Observable<[StorageKey, Codec][]> =>
this._retrieveMapEntriesPaged(creator, opts))); this._retrieveMapEntriesPaged(creator, undefined, opts)));
decorated.keys = decorateMethod( decorated.keys = decorateMethod(
memo(this.#instanceId, (...args: unknown[]): Observable<StorageKey[]> => memo(this.#instanceId, (...args: unknown[]): Observable<StorageKey[]> =>
@@ -556,7 +552,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
decorated.keysPaged = decorateMethod( decorated.keysPaged = decorateMethod(
memo(this.#instanceId, (opts: PaginationOptions): Observable<StorageKey[]> => memo(this.#instanceId, (opts: PaginationOptions): Observable<StorageKey[]> =>
this._retrieveMapKeysPaged(creator, opts))); this._retrieveMapKeysPaged(creator, undefined, opts)));
} }
if (this.supportMulti && creator.meta.type.isMap) { if (this.supportMulti && creator.meta.type.isMap) {
@@ -610,9 +606,17 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
memo(this.#instanceId, (...args: unknown[]): Observable<[StorageKey, Codec][]> => memo(this.#instanceId, (...args: unknown[]): Observable<[StorageKey, Codec][]> =>
this._retrieveMapEntries(creator, blockHash, args))); this._retrieveMapEntries(creator, blockHash, args)));
decorated.entriesPaged = decorateMethod(
memo(this.#instanceId, (opts: PaginationOptions): Observable<[StorageKey, Codec][]> =>
this._retrieveMapEntriesPaged(creator, blockHash, opts)));
decorated.keys = decorateMethod( decorated.keys = decorateMethod(
memo(this.#instanceId, (...args: unknown[]): Observable<StorageKey[]> => memo(this.#instanceId, (...args: unknown[]): Observable<StorageKey[]> =>
this._retrieveMapKeys(creator, blockHash, args))); this._retrieveMapKeys(creator, blockHash, args)));
decorated.keysPaged = decorateMethod(
memo(this.#instanceId, (opts: PaginationOptions): Observable<StorageKey[]> =>
this._retrieveMapKeysPaged(creator, blockHash, opts)));
} }
if (this.supportMulti && creator.meta.type.isMap) { if (this.supportMulti && creator.meta.type.isMap) {
@@ -703,13 +707,13 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
); );
} }
private _retrieveMapKeysPaged ({ iterKey, meta, method, section }: StorageEntry, opts: PaginationOptions): Observable<StorageKey[]> { private _retrieveMapKeysPaged ({ iterKey, meta, method, section }: StorageEntry, at: Hash | Uint8Array | string | undefined, opts: PaginationOptions): Observable<StorageKey[]> {
assert(iterKey && meta.type.isMap, 'keys can only be retrieved on maps'); assert(iterKey && meta.type.isMap, 'keys can only be retrieved on maps');
const headKey = iterKey(...opts.args).toHex(); const headKey = iterKey(...opts.args).toHex();
const setMeta = (key: StorageKey) => key.setMeta(meta, section, method); const setMeta = (key: StorageKey) => key.setMeta(meta, section, method);
return this._rpcCore.state.getKeysPaged(headKey, opts.pageSize, opts.startKey || headKey).pipe( return this._rpcCore.state.getKeysPaged(headKey, opts.pageSize, opts.startKey || headKey, at).pipe(
map((keys) => keys.map(setMeta)) map((keys) => keys.map(setMeta))
); );
} }
@@ -732,11 +736,11 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
); );
} }
private _retrieveMapEntriesPaged (entry: StorageEntry, opts: PaginationOptions): Observable<[StorageKey, Codec][]> { private _retrieveMapEntriesPaged (entry: StorageEntry, at: Hash | Uint8Array | string | undefined, opts: PaginationOptions): Observable<[StorageKey, Codec][]> {
return this._retrieveMapKeysPaged(entry, opts).pipe( return this._retrieveMapKeysPaged(entry, at, opts).pipe(
switchMap((keys) => switchMap((keys) =>
keys.length keys.length
? this._rpcCore.state.queryStorageAt(keys).pipe( ? this._rpcCore.state.queryStorageAt(keys, at).pipe(
map((valsArr) => map((valsArr) =>
valsArr.map((value, index): [StorageKey, Codec] => [keys[index], value]) valsArr.map((value, index): [StorageKey, Codec] => [keys[index], value])
) )
+59 -57
View File
@@ -4,7 +4,7 @@
import type { Observable, Subscription } from 'rxjs'; import type { Observable, Subscription } from 'rxjs';
import type { Text } from '@polkadot/types'; import type { Text } from '@polkadot/types';
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types'; import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
import type { ChainProperties, Hash, RuntimeVersion, RuntimeVersionPartial } from '@polkadot/types/interfaces'; import type { ChainProperties, Hash, HeaderPartial, RuntimeVersion, RuntimeVersionPartial } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types'; import type { Registry } from '@polkadot/types/types';
import type { BN } from '@polkadot/util'; import type { BN } from '@polkadot/util';
import type { HexString } from '@polkadot/util/types'; import type { HexString } from '@polkadot/util/types';
@@ -35,7 +35,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
#updateSub?: Subscription | null = null; #updateSub?: Subscription | null = null;
#waitingRegistries: Record<string, Promise<VersionedRegistry<ApiType>>> = {}; #waitingRegistries: Record<HexString, Promise<VersionedRegistry<ApiType>>> = {};
constructor (options: ApiOptions, type: ApiTypes, decorateMethod: DecorateMethod<ApiType>) { constructor (options: ApiOptions, type: ApiTypes, decorateMethod: DecorateMethod<ApiType>) {
super(options, type, decorateMethod); super(options, type, decorateMethod);
@@ -120,6 +120,44 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
return this._createDecorated(registry, true, null, u8aHash).decoratedApi; return this._createDecorated(registry, true, null, u8aHash).decoratedApi;
} }
private async _createBlockRegistry (blockHash: Uint8Array, header: HeaderPartial, version: RuntimeVersionPartial): Promise<VersionedRegistry<ApiType>> {
const registry = new TypeRegistry(blockHash);
const metadata = new Metadata(registry,
await firstValueFrom(this._rpcCore.state.getMetadata.raw<HexString>(header.parentHash))
);
this._initRegistry(registry, this._runtimeChain as Text, version, metadata);
// add our new registry
const result = { lastBlockHash: blockHash, metadata, registry, specName: version.specName, specVersion: version.specVersion };
this.#registries.push(result);
return result;
}
private _cacheBlockRegistryProgress (key: HexString, creator: () => Promise<VersionedRegistry<ApiType>>): Promise<VersionedRegistry<ApiType>> {
// look for waiting resolves
let waiting = this.#waitingRegistries[key];
if (isUndefined(waiting)) {
// nothing waiting, construct new
waiting = this.#waitingRegistries[key] = new Promise<VersionedRegistry<ApiType>>((resolve, reject): void => {
creator()
.then((registry): void => {
delete this.#waitingRegistries[key];
resolve(registry);
})
.catch((error): void => {
delete this.#waitingRegistries[key];
reject(error);
});
});
}
return waiting;
}
private _getBlockRegistryViaVersion (blockHash: Uint8Array, version?: RuntimeVersionPartial): VersionedRegistry<ApiType> | null { private _getBlockRegistryViaVersion (blockHash: Uint8Array, version?: RuntimeVersionPartial): VersionedRegistry<ApiType> | null {
if (version) { if (version) {
// check for pre-existing registries. We also check specName, e.g. it // check for pre-existing registries. We also check specName, e.g. it
@@ -139,7 +177,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
return null; return null;
} }
private async _getBlockRegistry (blockHash: Uint8Array): Promise<VersionedRegistry<ApiType>> { private async _getBlockRegistryViaHash (blockHash: Uint8Array): Promise<VersionedRegistry<ApiType>> {
// ensure we have everything required // ensure we have everything required
assert(this._genesisHash && this._runtimeVersion, 'Cannot retrieve data on an uninitialized chain'); assert(this._genesisHash && this._runtimeVersion, 'Cannot retrieve data on an uninitialized chain');
@@ -161,62 +199,28 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
: await firstValueFrom(this._rpcCore.state.getRuntimeVersion.raw(header.parentHash)) : await firstValueFrom(this._rpcCore.state.getRuntimeVersion.raw(header.parentHash))
); );
const existingViaVersion = this._getBlockRegistryViaVersion(blockHash, version); return (
// try to find via version
if (existingViaVersion) { this._getBlockRegistryViaVersion(blockHash, version) ||
return existingViaVersion; // return new or in-flight result
} await this._cacheBlockRegistryProgress(version.toHex(), () => this._createBlockRegistry(blockHash, header, version))
// nothing has been found, construct new
const registry = new TypeRegistry(blockHash);
const metadata = new Metadata(registry,
await firstValueFrom(this._rpcCore.state.getMetadata.raw<HexString>(header.parentHash))
); );
this._initRegistry(registry, this._runtimeChain as Text, version, metadata);
// add our new registry
const result = { lastBlockHash: blockHash, metadata, registry, specName: version.specName, specVersion: version.specVersion };
this.#registries.push(result);
return result;
} }
/** /**
* @description Sets up a registry based on the block hash defined * @description Sets up a registry based on the block hash defined
*/ */
public async getBlockRegistry (blockHash: Uint8Array, knownVersion?: RuntimeVersion): Promise<VersionedRegistry<ApiType>> { public async getBlockRegistry (blockHash: Uint8Array, knownVersion?: RuntimeVersion): Promise<VersionedRegistry<ApiType>> {
const existingViaHash = this.#registries.find(({ lastBlockHash }) => return (
lastBlockHash && u8aEq(lastBlockHash, blockHash) // try to find via blockHash
this.#registries.find(({ lastBlockHash }) =>
lastBlockHash && u8aEq(lastBlockHash, blockHash)
) ||
// try to find via version
this._getBlockRegistryViaVersion(blockHash, knownVersion) ||
// return new or in-flight result
await this._cacheBlockRegistryProgress(u8aToHex(blockHash), () => this._getBlockRegistryViaHash(blockHash))
); );
if (existingViaHash) {
return existingViaHash;
}
const existingViaVersion = this._getBlockRegistryViaVersion(blockHash, knownVersion);
if (existingViaVersion) {
return existingViaVersion;
}
const blockHashHex = u8aToHex(blockHash);
let waiting = this.#waitingRegistries[blockHashHex];
if (isUndefined(waiting)) {
waiting = this._getBlockRegistry(blockHash);
this.#waitingRegistries[blockHashHex] = waiting;
// when we have resolved, remove this from the waiting list
waiting
.then((): void => {
delete this.#waitingRegistries[blockHashHex];
})
.catch(() => undefined);
}
return waiting;
} }
protected async _loadMeta (): Promise<boolean> { protected async _loadMeta (): Promise<boolean> {
@@ -387,12 +391,10 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
this.emit('connected'); this.emit('connected');
try { try {
const [hasMeta, cryptoReady] = await Promise.all([ const cryptoReady = this._options.initWasm === false
this._loadMeta(), ? true
this._options.initWasm === false : await cryptoWaitReady();
? Promise.resolve(true) const hasMeta = await this._loadMeta();
: cryptoWaitReady()
]);
this._subscribeHealth(); this._subscribeHealth();
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.0.1' };
+6 -5
View File
@@ -21,6 +21,7 @@ import { SubmittableResult } from './Result';
interface SubmittableOptions<ApiType extends ApiTypes> { interface SubmittableOptions<ApiType extends ApiTypes> {
api: ApiInterfaceRx; api: ApiInterfaceRx;
apiType: ApiTypes; apiType: ApiTypes;
blockHash?: Uint8Array;
decorateMethod: ApiBase<ApiType>['_decorateMethod']; decorateMethod: ApiBase<ApiType>['_decorateMethod'];
} }
@@ -80,7 +81,7 @@ function optionsOrNonce (partialOptions: Partial<SignerOptions> = {}): Partial<S
: partialOptions; : partialOptions;
} }
export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorateMethod }: SubmittableOptions<ApiType>): Constructor<SubmittableExtrinsic<ApiType>> { export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHash, decorateMethod }: SubmittableOptions<ApiType>): Constructor<SubmittableExtrinsic<ApiType>> {
// an instance of the base extrinsic for us to extend // an instance of the base extrinsic for us to extend
const ExtrinsicBase = api.registry.createClass('Extrinsic'); const ExtrinsicBase = api.registry.createClass('Extrinsic');
@@ -97,10 +98,10 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
// dry run an extrinsic // dry run an extrinsic
public dryRun (account: AddressOrPair, optionsOrHash?: Partial<SignerOptions> | Uint8Array | string): SubmittableDryRunResult<ApiType> { public dryRun (account: AddressOrPair, optionsOrHash?: Partial<SignerOptions> | Uint8Array | string): SubmittableDryRunResult<ApiType> {
if (isString(optionsOrHash) || isU8a(optionsOrHash)) { if (blockHash || isString(optionsOrHash) || isU8a(optionsOrHash)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return // eslint-disable-next-line @typescript-eslint/no-unsafe-return
return decorateMethod( return decorateMethod(
() => api.rpc.system.dryRun(this.toHex(), optionsOrHash) () => api.rpc.system.dryRun(this.toHex(), blockHash || optionsOrHash as string)
); );
} }
@@ -115,10 +116,10 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
// calculate the payment info for this transaction (if signed and submitted) // calculate the payment info for this transaction (if signed and submitted)
public paymentInfo (account: AddressOrPair, optionsOrHash?: Partial<SignerOptions> | Uint8Array | string): SubmittablePaymentResult<ApiType> { public paymentInfo (account: AddressOrPair, optionsOrHash?: Partial<SignerOptions> | Uint8Array | string): SubmittablePaymentResult<ApiType> {
if (isString(optionsOrHash) || isU8a(optionsOrHash)) { if (blockHash || isString(optionsOrHash) || isU8a(optionsOrHash)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return // eslint-disable-next-line @typescript-eslint/no-unsafe-return
return decorateMethod( return decorateMethod(
(): Observable<RuntimeDispatchInfo> => api.rpc.payment.queryInfo(this.toHex(), optionsOrHash) (): Observable<RuntimeDispatchInfo> => api.rpc.payment.queryInfo(this.toHex(), blockHash || optionsOrHash as string)
); );
} }
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { Call, Extrinsic } from '@polkadot/types/interfaces'; import type { Call, Extrinsic } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types-codec/types';
import type { ApiInterfaceRx, ApiTypes } from '../types'; import type { ApiInterfaceRx, ApiTypes } from '../types';
import type { SubmittableExtrinsic } from './types'; import type { SubmittableExtrinsic } from './types';
@@ -10,9 +11,9 @@ import { createClass } from './createClass';
type Creator<ApiType extends ApiTypes> = (extrinsic: Call | Uint8Array | string) => SubmittableExtrinsic<ApiType>; type Creator<ApiType extends ApiTypes> = (extrinsic: Call | Uint8Array | string) => SubmittableExtrinsic<ApiType>;
export function createSubmittable<ApiType extends ApiTypes> (apiType: ApiTypes, api: ApiInterfaceRx, decorateMethod: ApiBase<ApiType>['_decorateMethod']): Creator<ApiType> { export function createSubmittable<ApiType extends ApiTypes> (apiType: ApiTypes, api: ApiInterfaceRx, decorateMethod: ApiBase<ApiType>['_decorateMethod'], registry?: Registry, blockHash?: Uint8Array): Creator<ApiType> {
const Submittable = createClass<ApiType>({ api, apiType, decorateMethod }); const Submittable = createClass<ApiType>({ api, apiType, blockHash, decorateMethod });
return (extrinsic: Call | Extrinsic | Uint8Array | string): SubmittableExtrinsic<ApiType> => return (extrinsic: Call | Extrinsic | Uint8Array | string): SubmittableExtrinsic<ApiType> =>
new Submittable(api.registry, extrinsic); new Submittable(registry || api.registry, extrinsic);
} }
+4 -2
View File
@@ -9,11 +9,12 @@ import type { DecoratedEvents } from '@polkadot/api-base/types/events';
import type { QueryableStorage } from '@polkadot/api-base/types/storage'; import type { QueryableStorage } from '@polkadot/api-base/types/storage';
import type { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types'; import type { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types';
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types'; import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
import type { Hash } from '@polkadot/types/interfaces'; import type { Call, Extrinsic, Hash } from '@polkadot/types/interfaces';
import type { CallFunction, DefinitionRpc, DefinitionRpcSub, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@polkadot/types/types'; import type { CallFunction, DefinitionRpc, DefinitionRpcSub, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@polkadot/types/types';
import type { BN } from '@polkadot/util'; import type { BN } from '@polkadot/util';
import type { HexString } from '@polkadot/util/types'; import type { HexString } from '@polkadot/util/types';
import type { ApiBase } from '../base'; import type { ApiBase } from '../base';
import type { SubmittableExtrinsic } from '../types/submittable';
import type { AllDerives } from '../util/decorate'; import type { AllDerives } from '../util/decorate';
export * from '@polkadot/api-base/types'; export * from '@polkadot/api-base/types';
@@ -96,7 +97,8 @@ export interface ApiDecoration<ApiType extends ApiTypes> {
registry: Registry; registry: Registry;
rx: { rx: {
query: QueryableStorage<'rxjs'>; query: QueryableStorage<'rxjs'>;
} };
tx: (extrinsic: Call | Extrinsic | Uint8Array | string) => SubmittableExtrinsic<ApiType>;
findCall (callIndex: Uint8Array | string): CallFunction; findCall (callIndex: Uint8Array | string): CallFunction;
findError (errorIndex: Uint8Array | string): RegistryError; findError (errorIndex: Uint8Array | string): RegistryError;
+6 -6
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/rpc-core": "7.14.3", "@polkadot/rpc-core": "8.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/util": "^8.7.1" "@polkadot/util": "^9.0.1"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.0.1' };
+8 -8
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/rpc-augment": "7.14.3", "@polkadot/rpc-augment": "8.0.1",
"@polkadot/rpc-provider": "7.14.3", "@polkadot/rpc-provider": "8.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/util": "^8.7.1", "@polkadot/util": "^9.0.1",
"rxjs": "^7.5.5" "rxjs": "^7.5.5"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^8.7.1", "@polkadot/keyring": "^9.0.1",
"@polkadot/rpc-augment": "7.14.3" "@polkadot/rpc-augment": "8.0.1"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.0.1' };
+5 -5
View File
@@ -44,18 +44,18 @@ console.log('latest block Hash', hash);
Instantiating a Provider for the Polkadot Relay Chain: Instantiating a Provider for the Polkadot Relay Chain:
```javascript ```javascript
import { ScProvider } from '@polkadot/rpc-provider'; import { ScProvider, WellKnownChain } from '@polkadot/rpc-provider/substrate-connect';
const provider = new ScProvider(SupportedChains.polkadot); const provider = new ScProvider(WellKnownChain.polkadot);
await provider.connect(); await provider.connect();
const version = await provider.send('chain_getBlockHash', []); const version = await provider.send('chain_getBlockHash', []);
``` ```
Instantiating a Provider for a Polkadot parachain: Instantiating a Provider for a Polkadot parachain:
```javascript ```javascript
import { ScProvider } from '@polkadot/rpc-provider'; import { ScProvider, WellKnownChain } from '@polkadot/rpc-provider/substrate-connect';
const polkadotProvider = new ScProvider(SupportedChains.polkadot); const polkadotProvider = new ScProvider(WellKnownChain.polkadot);
const parachainProvider = new ScProvider(parachainSpec, polkadotProvider); const parachainProvider = new ScProvider(parachainSpec, polkadotProvider);
await parachainProvider.connect(); await parachainProvider.connect();
const version = await parachainProvider.send('chain_getBlockHash', []); const version = await parachainProvider.send('chain_getBlockHash', []);
+11 -11
View File
@@ -20,19 +20,19 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/keyring": "^8.7.1", "@polkadot/keyring": "^9.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-support": "7.14.3", "@polkadot/types-support": "8.0.1",
"@polkadot/util": "^8.7.1", "@polkadot/util": "^9.0.1",
"@polkadot/util-crypto": "^8.7.1", "@polkadot/util-crypto": "^9.0.1",
"@polkadot/x-fetch": "^8.7.1", "@polkadot/x-fetch": "^9.0.1",
"@polkadot/x-global": "^8.7.1", "@polkadot/x-global": "^9.0.1",
"@polkadot/x-ws": "^8.7.1", "@polkadot/x-ws": "^9.0.1",
"@substrate/connect": "0.7.0-alpha.0", "@substrate/connect": "0.7.2",
"eventemitter3": "^4.0.7", "eventemitter3": "^4.0.7",
"mock-socket": "^9.1.2", "mock-socket": "^9.1.2",
"nock": "^13.2.4" "nock": "^13.2.4"
@@ -15,7 +15,7 @@ describe('decodeResponse', (): void => {
it('expects a non-empty input object', (): void => { it('expects a non-empty input object', (): void => {
expect( expect(
() => coder.decodeResponse(undefined as unknown as JsonRpcResponse) () => coder.decodeResponse(undefined as unknown as JsonRpcResponse)
).toThrow(/Empty response/); ).toThrow(/Invalid jsonrpc/);
}); });
it('expects a valid jsonrpc field', (): void => { it('expects a valid jsonrpc field', (): void => {
@@ -13,6 +13,6 @@ describe('encodeJson', (): void => {
it('encodes a valid JsonRPC JSON string', (): void => { it('encodes a valid JsonRPC JSON string', (): void => {
expect( expect(
coder.encodeJson('method', ['params']) coder.encodeJson('method', ['params'])
).toEqual('{"id":1,"jsonrpc":"2.0","method":"method","params":["params"]}'); ).toEqual([1, '{"id":1,"jsonrpc":"2.0","method":"method","params":["params"]}']);
}); });
}); });
@@ -10,19 +10,14 @@ describe('encodeObject', (): void => {
coder = new RpcCoder(); coder = new RpcCoder();
}); });
it('starts with id === 0 (nothing sent)', (): void => {
expect(coder.getId()).toEqual(0);
});
it('encodes a valid JsonRPC object', (): void => { it('encodes a valid JsonRPC object', (): void => {
expect( expect(
coder.encodeObject('method', ['a', 'b']) coder.encodeObject('method', ['a', 'b'])
).toEqual({ ).toEqual([1, {
id: 1, id: 1,
jsonrpc: '2.0', jsonrpc: '2.0',
method: 'method', method: 'method',
params: ['a', 'b'] params: ['a', 'b']
}); }]);
expect(coder.getId()).toEqual(1);
}); });
}); });
+24 -28
View File
@@ -20,27 +20,34 @@ function formatErrorData (data?: string | number): string {
// very nested, pick a number and trim the result display to it // very nested, pick a number and trim the result display to it
return formatted.length <= 256 return formatted.length <= 256
? formatted ? formatted
: `${formatted.substr(0, 255)}…`; : `${formatted.substring(0, 255)}…`;
}
function checkError (error?: JsonRpcResponseBaseError): void {
if (error) {
const { code, data, message } = error;
throw new RpcError(`${code}: ${message}${formatErrorData(data)}`, code, data);
}
} }
/** @internal */ /** @internal */
export class RpcCoder { export class RpcCoder {
#id = 0; #id = 0;
public decodeResponse (response: JsonRpcResponse): unknown { public decodeResponse (response?: JsonRpcResponse): unknown {
assert(response, 'Empty response object received'); assert(response && response.jsonrpc === '2.0', 'Invalid jsonrpc field in decoded object');
assert(response.jsonrpc === '2.0', 'Invalid jsonrpc field in decoded object');
const isSubscription = !isUndefined(response.params) && !isUndefined(response.method); const isSubscription = !isUndefined(response.params) && !isUndefined(response.method);
assert(isNumber(response.id) || (isSubscription && (isNumber(response.params.subscription) || isString(response.params.subscription))), 'Invalid id field in decoded object'); assert(isNumber(response.id) || (isSubscription && (isNumber(response.params.subscription) || isString(response.params.subscription))), 'Invalid id field in decoded object');
this._checkError(response.error); checkError(response.error);
assert(!isUndefined(response.result) || isSubscription, 'No result found in JsonRpc response'); assert(!isUndefined(response.result) || isSubscription, 'No result found in jsonrpc response');
if (isSubscription) { if (isSubscription) {
this._checkError(response.params.error); checkError(response.params.error);
return response.params.result; return response.params.result;
} }
@@ -48,31 +55,20 @@ export class RpcCoder {
return response.result; return response.result;
} }
public encodeJson (method: string, params: unknown[]): string { public encodeJson (method: string, params: unknown[]): [number, string] {
return stringify( const [id, data] = this.encodeObject(method, params);
this.encodeObject(method, params)
); return [id, stringify(data)];
} }
public encodeObject (method: string, params: unknown[]): JsonRpcRequest { public encodeObject (method: string, params: unknown[]): [number, JsonRpcRequest] {
return { const id = ++this.#id;
id: ++this.#id,
return [id, {
id,
jsonrpc: '2.0', jsonrpc: '2.0',
method, method,
params params
}; }];
}
public getId (): number {
return this.#id;
}
private _checkError (error?: JsonRpcResponseBaseError): void {
if (error) {
const { code, data, message } = error;
const fmtMessage = `${code}: ${message}${formatErrorData(data)}`;
throw new RpcError(fmtMessage, code, data);
}
} }
} }
+1 -1
View File
@@ -122,7 +122,7 @@ export class HttpProvider implements ProviderInterface {
public async send <T> (method: string, params: unknown[], isCacheable?: boolean): Promise<T> { public async send <T> (method: string, params: unknown[], isCacheable?: boolean): Promise<T> {
this.#stats.total.requests++; this.#stats.total.requests++;
const body = this.#coder.encodeJson(method, params); const [, body] = this.#coder.encodeJson(method, params);
let resultPromise: Promise<T> | null = isCacheable let resultPromise: Promise<T> | null = isCacheable
? this.#callCache.get(body) as Promise<T> ? this.#callCache.get(body) as Promise<T>
: null; : null;
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.0.1' };
@@ -34,6 +34,7 @@ const subscriptionUnsubscriptionMethods = new Map<string, string>([
const wellKnownChains = new Set(Object.values(WellKnownChain)); const wellKnownChains = new Set(Object.values(WellKnownChain));
const scClients = new WeakMap<ScProvider, ScClient>(); const scClients = new WeakMap<ScProvider, ScClient>();
export { WellKnownChain };
export class ScProvider implements ProviderInterface { export class ScProvider implements ProviderInterface {
readonly #coder: RpcCoder = new RpcCoder(); readonly #coder: RpcCoder = new RpcCoder();
readonly #spec: string | WellKnownChain; readonly #spec: string | WellKnownChain;
@@ -150,14 +151,19 @@ export class ScProvider implements ProviderInterface {
return; return;
} }
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion const stale = staleSubscriptions.pop();
const { id, unsubscribeMethod } = staleSubscriptions.pop()!;
// eslint-disable-next-line @typescript-eslint/no-floating-promises assert(stale, 'Unable to get stale subscription');
Promise.race([
this.send(unsubscribeMethod, [id]).catch(Function.prototype as () => void), const { id, unsubscribeMethod } = stale;
new Promise((resolve) => setTimeout(resolve, 500))
]).then(killStaleSubscriptions); Promise
.race([
this.send(unsubscribeMethod, [id]).catch(() => undefined),
new Promise((resolve) => setTimeout(resolve, 500))
])
.then(killStaleSubscriptions)
.catch(() => undefined);
}; };
hc.start((health) => { hc.start((health) => {
@@ -255,12 +261,10 @@ export class ScProvider implements ProviderInterface {
} }
public async send<T = any> (method: string, params: unknown[]): Promise<T> { public async send<T = any> (method: string, params: unknown[]): Promise<T> {
assert(this.isConnected, 'Provider is not connected'); assert(this.isConnected && this.#chain, 'Provider is not connected');
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion const chain = await this.#chain;
const chain = await this.#chain!; const [id, json] = this.#coder.encodeJson(method, params);
const json = this.#coder.encodeJson(method, params);
const id = this.#coder.getId();
const result = new Promise<T>((resolve, reject): void => { const result = new Promise<T>((resolve, reject): void => {
this.#requests.set(id, (response) => { this.#requests.set(id, (response) => {
@@ -311,8 +315,9 @@ export class ScProvider implements ProviderInterface {
} }
}; };
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion const unsubscribeMethod = subscriptionUnsubscriptionMethods.get(method);
const unsubscribeMethod = subscriptionUnsubscriptionMethods.get(method)!;
assert(unsubscribeMethod, 'Invalid unsubscribe method found');
this.#subscriptions.set(subscriptionId, [cb, { id, unsubscribeMethod }]); this.#subscriptions.set(subscriptionId, [cb, { id, unsubscribeMethod }]);
+6 -8
View File
@@ -295,13 +295,13 @@ export class WsProvider implements ProviderInterface {
public send <T = any> (method: string, params: unknown[], isCacheable?: boolean, subscription?: SubscriptionHandler): Promise<T> { public send <T = any> (method: string, params: unknown[], isCacheable?: boolean, subscription?: SubscriptionHandler): Promise<T> {
this.#stats.total.requests++; this.#stats.total.requests++;
const body = this.#coder.encodeJson(method, params); const [id, body] = this.#coder.encodeJson(method, params);
let resultPromise: Promise<T> | null = isCacheable let resultPromise: Promise<T> | null = isCacheable
? this.#callCache.get(body) as Promise<T> ? this.#callCache.get(body) as Promise<T>
: null; : null;
if (!resultPromise) { if (!resultPromise) {
resultPromise = this.#send(body, method, params, subscription); resultPromise = this.#send(id, body, method, params, subscription);
if (isCacheable) { if (isCacheable) {
this.#callCache.set(body, resultPromise); this.#callCache.set(body, resultPromise);
@@ -313,20 +313,18 @@ export class WsProvider implements ProviderInterface {
return resultPromise; return resultPromise;
} }
async #send <T> (json: string, method: string, params: unknown[], subscription?: SubscriptionHandler): Promise<T> { async #send <T> (id: number, body: string, method: string, params: unknown[], subscription?: SubscriptionHandler): Promise<T> {
return new Promise<T>((resolve, reject): void => { return new Promise<T>((resolve, reject): void => {
try { try {
assert(this.isConnected && !isNull(this.#websocket), 'WebSocket is not connected'); assert(this.isConnected && !isNull(this.#websocket), 'WebSocket is not connected');
const id = this.#coder.getId();
const callback = (error?: Error | null, result?: T): void => { const callback = (error?: Error | null, result?: T): void => {
error error
? reject(error) ? reject(error)
: resolve(result as T); : resolve(result as T);
}; };
l.debug(() => ['calling', method, json]); l.debug(() => ['calling', method, body]);
this.#handlers[id] = { this.#handlers[id] = {
callback, callback,
@@ -335,8 +333,8 @@ export class WsProvider implements ProviderInterface {
start: Date.now(), start: Date.now(),
subscription subscription
}; };
this.#stats.total.bytesSent += json.length; this.#stats.total.bytesSent += body.length;
this.#websocket.send(json); this.#websocket.send(body);
} catch (error) { } catch (error) {
reject(error); reject(error);
} }
+14 -14
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"bin": { "bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs", "polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
@@ -30,20 +30,20 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs" "polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
}, },
"dependencies": { "dependencies": {
"@babel/core": "^7.17.8", "@babel/core": "^7.17.9",
"@babel/register": "^7.17.7", "@babel/register": "^7.17.7",
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/api": "7.14.3", "@polkadot/api": "8.0.1",
"@polkadot/api-augment": "7.14.3", "@polkadot/api-augment": "8.0.1",
"@polkadot/rpc-augment": "7.14.3", "@polkadot/rpc-augment": "8.0.1",
"@polkadot/rpc-provider": "7.14.3", "@polkadot/rpc-provider": "8.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-augment": "7.14.3", "@polkadot/types-augment": "8.0.1",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/types-create": "7.14.3", "@polkadot/types-create": "8.0.1",
"@polkadot/types-support": "7.14.3", "@polkadot/types-support": "8.0.1",
"@polkadot/util": "^8.7.1", "@polkadot/util": "^9.0.1",
"@polkadot/x-ws": "^8.7.1", "@polkadot/x-ws": "^9.0.1",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
"websocket": "^1.0.34", "websocket": "^1.0.34",
"yargs": "^17.4.0" "yargs": "^17.4.0"
+1 -1
View File
@@ -5,7 +5,7 @@ module.exports = function (file) {
let main; let main;
try { try {
main = require(`../${file}.cjs`).main; main = require(`../cjs/${file}.js`).main;
} catch (error) { } catch (error) {
// required for dev-only setups // required for dev-only setups
process.env.JEST_WORKER_ID = '123'; process.env.JEST_WORKER_ID = '123';
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.0.1' };
+24 -13
View File
@@ -8,26 +8,37 @@ import { getSimilarTypes } from './derived';
describe('getSimilarTypes', (): void => { describe('getSimilarTypes', (): void => {
let registry: TypeRegistry; let registry: TypeRegistry;
const mockImports = {
codecTypes: {},
definitions: {},
extrinsicTypes: {},
genericTypes: {},
ignoredTypes: [],
localTypes: {},
lookupTypes: {},
metadataTypes: {},
primitiveTypes: {},
typeToModule: {},
typesTypes: {}
};
beforeAll((): void => { beforeAll((): void => {
registry = new TypeRegistry(); registry = new TypeRegistry();
}); });
it('handles nested Tuples', (): void => { it('handles nested Tuples', (): void => {
expect(getSimilarTypes(registry, {}, '(AccountId, (Balance, u32), u64)', { expect(getSimilarTypes(registry, {}, '(AccountId, (Balance, u32), u64)', mockImports)).toEqual([
codecTypes: {},
definitions: {},
extrinsicTypes: {},
genericTypes: {},
ignoredTypes: [],
localTypes: {},
lookupTypes: {},
metadataTypes: {},
primitiveTypes: {},
typeToModule: {},
typesTypes: {}
})).toEqual([
'ITuple<[AccountId, ITuple<[Balance, u32]>, u64]>', 'ITuple<[AccountId, ITuple<[Balance, u32]>, u64]>',
'[AccountId | string | Uint8Array, ITuple<[Balance, u32]> | [Balance | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], u64 | AnyNumber | Uint8Array]' '[AccountId | string | Uint8Array, ITuple<[Balance, u32]> | [Balance | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array], u64 | AnyNumber | Uint8Array]'
]); ]);
}); });
it('handles vectors of slices', (): void => {
expect(getSimilarTypes(registry, {}, 'Vec<[u8;4]>', mockImports)).toEqual([
'Vec<U8aFixed>'
]);
expect(getSimilarTypes(registry, {}, 'Vec<[Balance;8]>', mockImports)).toEqual([
'Vec<Vec<Balance>>'
]);
});
}); });
+2
View File
@@ -58,6 +58,8 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
); );
possibleTypes.push(`([${subs.join(', ')}])[]`); possibleTypes.push(`([${subs.join(', ')}])[]`);
} else if (subDef.info === TypeDefInfo.VecFixed) {
// TODO: Add possibleTypes so imports work
} else { } else {
throw new Error(`Unhandled subtype in Vec, ${stringify(subDef)}`); throw new Error(`Unhandled subtype in Vec, ${stringify(subDef)}`);
} }
+5 -5
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/util": "^8.7.1" "@polkadot/util": "^9.0.1"
} }
} }
+5 -5
View File
@@ -5,13 +5,13 @@
export default { export default {
/** /**
* Lookup75: kusama_runtime::ProxyType * Lookup76: kusama_runtime::ProxyType
**/ **/
KusamaRuntimeProxyType: { KusamaRuntimeProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction', 'Society'] _enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction', 'Society']
}, },
/** /**
* Lookup252: kusama_runtime::SessionKeys * Lookup253: kusama_runtime::SessionKeys
**/ **/
KusamaRuntimeSessionKeys: { KusamaRuntimeSessionKeys: {
grandpa: 'SpFinalityGrandpaAppPublic', grandpa: 'SpFinalityGrandpaAppPublic',
@@ -22,7 +22,7 @@ export default {
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic' authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
}, },
/** /**
* Lookup326: kusama_runtime::OriginCaller * Lookup327: kusama_runtime::OriginCaller
**/ **/
KusamaRuntimeOriginCaller: { KusamaRuntimeOriginCaller: {
_enum: { _enum: {
@@ -129,7 +129,7 @@ export default {
} }
}, },
/** /**
* Lookup392: kusama_runtime::NposCompactSolution24 * Lookup393: kusama_runtime::NposCompactSolution24
**/ **/
KusamaRuntimeNposCompactSolution24: { KusamaRuntimeNposCompactSolution24: {
votes1: 'Vec<(Compact<u32>,Compact<u16>)>', votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
@@ -158,7 +158,7 @@ export default {
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>' votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
}, },
/** /**
* Lookup747: kusama_runtime::Runtime * Lookup748: kusama_runtime::Runtime
**/ **/
KusamaRuntimeRuntime: 'Null' KusamaRuntimeRuntime: 'Null'
}; };
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -6,7 +6,7 @@ declare module '@polkadot/types/lookup' {
import type { ITuple } from '@polkadot/types-codec/types'; import type { ITuple } from '@polkadot/types-codec/types';
import type { PerU16 } from '@polkadot/types/interfaces/runtime'; import type { PerU16 } from '@polkadot/types/interfaces/runtime';
/** @name KusamaRuntimeProxyType (75) */ /** @name KusamaRuntimeProxyType (76) */
export interface KusamaRuntimeProxyType extends Enum { export interface KusamaRuntimeProxyType extends Enum {
readonly isAny: boolean; readonly isAny: boolean;
readonly isNonTransfer: boolean; readonly isNonTransfer: boolean;
@@ -19,7 +19,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society'; readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society';
} }
/** @name KusamaRuntimeSessionKeys (252) */ /** @name KusamaRuntimeSessionKeys (253) */
export interface KusamaRuntimeSessionKeys extends Struct { export interface KusamaRuntimeSessionKeys extends Struct {
readonly grandpa: SpFinalityGrandpaAppPublic; readonly grandpa: SpFinalityGrandpaAppPublic;
readonly babe: SpConsensusBabeAppPublic; readonly babe: SpConsensusBabeAppPublic;
@@ -29,7 +29,7 @@ declare module '@polkadot/types/lookup' {
readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic; readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
} }
/** @name KusamaRuntimeOriginCaller (326) */ /** @name KusamaRuntimeOriginCaller (327) */
export interface KusamaRuntimeOriginCaller extends Enum { export interface KusamaRuntimeOriginCaller extends Enum {
readonly isSystem: boolean; readonly isSystem: boolean;
readonly asSystem: FrameSupportDispatchRawOrigin; readonly asSystem: FrameSupportDispatchRawOrigin;
@@ -45,7 +45,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet'; readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet';
} }
/** @name KusamaRuntimeNposCompactSolution24 (392) */ /** @name KusamaRuntimeNposCompactSolution24 (393) */
export interface KusamaRuntimeNposCompactSolution24 extends Struct { export interface KusamaRuntimeNposCompactSolution24 extends Struct {
readonly votes1: Vec<ITuple<[Compact<u32>, Compact<u16>]>>; readonly votes1: Vec<ITuple<[Compact<u32>, Compact<u16>]>>;
readonly votes2: Vec<ITuple<[Compact<u32>, ITuple<[Compact<u16>, Compact<PerU16>]>, Compact<u16>]>>; readonly votes2: Vec<ITuple<[Compact<u32>, ITuple<[Compact<u16>, Compact<PerU16>]>, Compact<u16>]>>;
@@ -73,7 +73,7 @@ declare module '@polkadot/types/lookup' {
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>; readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
} }
/** @name KusamaRuntimeRuntime (747) */ /** @name KusamaRuntimeRuntime (748) */
export type KusamaRuntimeRuntime = Null; export type KusamaRuntimeRuntime = Null;
} // declare module } // declare module
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.0.1' };
@@ -53,7 +53,7 @@ import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, Vouching
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, 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, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SignedSubmission, SignedSubmissionOf, SignedSubmissionTo276, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, SubmissionIndicesOf, Supports, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking'; import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, 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, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SignedSubmission, SignedSubmissionOf, SignedSubmissionTo276, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, SubmissionIndicesOf, Supports, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state'; import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModuleU8a, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques'; import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques';
@@ -307,6 +307,7 @@ declare module '@polkadot/types/types/registry' {
DispatchClass: DispatchClass; DispatchClass: DispatchClass;
DispatchError: DispatchError; DispatchError: DispatchError;
DispatchErrorModule: DispatchErrorModule; DispatchErrorModule: DispatchErrorModule;
DispatchErrorModuleU8a: DispatchErrorModuleU8a;
DispatchErrorTo198: DispatchErrorTo198; DispatchErrorTo198: DispatchErrorTo198;
DispatchFeePayment: DispatchFeePayment; DispatchFeePayment: DispatchFeePayment;
DispatchInfo: DispatchInfo; DispatchInfo: DispatchInfo;
File diff suppressed because one or more lines are too long
+7 -7
View File
@@ -20,16 +20,16 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/util": "^8.7.1" "@polkadot/util": "^9.0.1"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-augment": "7.14.3", "@polkadot/types-augment": "8.0.1",
"@polkadot/types-support": "7.14.3", "@polkadot/types-support": "8.0.1",
"@polkadot/util-crypto": "^8.7.1" "@polkadot/util-crypto": "^9.0.1"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '8.0.1' };
+1 -1
View File
@@ -60,7 +60,7 @@ export interface Registry {
createdAtHash?: IU8a; createdAtHash?: IU8a;
findMetaCall (callIndex: Uint8Array): CallFunction; findMetaCall (callIndex: Uint8Array): CallFunction;
findMetaError (errorIndex: Uint8Array | { error: BN, index: BN }): RegistryError; findMetaError (errorIndex: Uint8Array | { error: BN, index: BN } | { error: BN | Uint8Array, index: BN }): RegistryError;
findMetaEvent (eventIndex: Uint8Array): CodecClass<any>; findMetaEvent (eventIndex: Uint8Array): CodecClass<any>;
isLookupType (value: string): boolean; isLookupType (value: string): boolean;
+5 -5
View File
@@ -20,14 +20,14 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/util": "^8.7.1" "@polkadot/util": "^9.0.1"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/types": "7.14.3" "@polkadot/types": "8.0.1"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '8.0.1' };
+7 -7
View File
@@ -20,14 +20,14 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/networks": "^8.7.1", "@polkadot/networks": "^9.0.1",
"@polkadot/types": "7.14.3", "@polkadot/types": "8.0.1",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/types-create": "7.14.3", "@polkadot/types-create": "8.0.1",
"@polkadot/util": "^8.7.1" "@polkadot/util": "^9.0.1"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '8.0.1' };
+1 -1
View File
@@ -15,7 +15,7 @@ const upgrades: ChainUpgradesRaw = [
[6137912, 2028], [6561855, 2029], [7100891, 2030], [7468792, 9010], [7668600, 9030], [6137912, 2028], [6561855, 2029], [7100891, 2030], [7468792, 9010], [7668600, 9030],
[7812476, 9040], [8010981, 9050], [8073833, 9070], [8555825, 9080], [8945245, 9090], [7812476, 9040], [8010981, 9050], [8073833, 9070], [8555825, 9080], [8945245, 9090],
[9611377, 9100], [9625129, 9111], [9866422, 9122], [10403784, 9130], [10960765, 9150], [9611377, 9100], [9625129, 9111], [9866422, 9122], [10403784, 9130], [10960765, 9150],
[11006614, 9151], [11404482, 9160], [11601803, 9170] [11006614, 9151], [11404482, 9160], [11601803, 9170], [12008022, 9180]
]; ];
export default upgrades; export default upgrades;
@@ -10,7 +10,7 @@ const upgrades: ChainUpgradesRaw = [
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26], [1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
[3613564, 27], [3899547, 28], [4345767, 29], [4876134, 30], [5661442, 9050], [3613564, 27], [3899547, 28], [4345767, 29], [4876134, 30], [5661442, 9050],
[6321619, 9080], [6713249, 9090], [7217907, 9100], [7229126, 9110], [7560558, 9122], [6321619, 9080], [6713249, 9090], [7217907, 9100], [7229126, 9110], [7560558, 9122],
[8115869, 9140], [8638103, 9151], [9280179, 9170] [8115869, 9140], [8638103, 9151], [9280179, 9170], [9738717, 9180]
]; ];
export default upgrades; export default upgrades;
+2 -1
View File
@@ -12,7 +12,8 @@ const upgrades: ChainUpgradesRaw = [
[5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010], [5784566, 9030], [5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010], [5784566, 9030],
[5879822, 9031], [5896856, 9032], [5897316, 9033], [6117927, 9050], [6210274, 9070], [5879822, 9031], [5896856, 9032], [5897316, 9033], [6117927, 9050], [6210274, 9070],
[6379314, 9080], [6979141, 9090], [7568453, 9100], [7766394, 9111], [7911691, 9120], [6379314, 9080], [6979141, 9090], [7568453, 9100], [7766394, 9111], [7911691, 9120],
[7968866, 9121], [7982889, 9122] [7968866, 9121], [7982889, 9122], [8514322, 9130], [9091726, 9140], [9091774, 9150],
[9406726, 9160], [9921066, 9170], [10007115, 9180]
]; ];
export default upgrades; export default upgrades;
+3 -3
View File
@@ -20,10 +20,10 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/util": "^8.7.1" "@polkadot/util": "^9.0.1"
} }
} }
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '8.0.1' };
+10 -10
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "7.14.3", "version": "8.0.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.8", "@babel/runtime": "^7.17.9",
"@polkadot/keyring": "^8.7.1", "@polkadot/keyring": "^9.0.1",
"@polkadot/types-augment": "7.14.3", "@polkadot/types-augment": "8.0.1",
"@polkadot/types-codec": "7.14.3", "@polkadot/types-codec": "8.0.1",
"@polkadot/types-create": "7.14.3", "@polkadot/types-create": "8.0.1",
"@polkadot/util": "^8.7.1", "@polkadot/util": "^9.0.1",
"@polkadot/util-crypto": "^8.7.1", "@polkadot/util-crypto": "^9.0.1",
"rxjs": "^7.5.5" "rxjs": "^7.5.5"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^8.7.1", "@polkadot/keyring": "^9.0.1",
"@polkadot/types-support": "7.14.3" "@polkadot/types-support": "8.0.1"
} }
} }
+8 -3
View File
@@ -4,7 +4,7 @@
import type { Codec, CodecClass, IU8a } from '@polkadot/types-codec/types'; import type { Codec, CodecClass, IU8a } from '@polkadot/types-codec/types';
import type { CreateOptions, TypeDef } from '@polkadot/types-create/types'; import type { CreateOptions, TypeDef } from '@polkadot/types-create/types';
import type { ExtDef } from '../extrinsic/signedExtensions/types'; import type { ExtDef } from '../extrinsic/signedExtensions/types';
import type { ChainProperties, DispatchErrorModule, EventMetadataLatest, Hash, MetadataLatest, SiField, SiLookupTypeId, SiVariant } from '../interfaces/types'; import type { ChainProperties, DispatchErrorModule, DispatchErrorModuleU8a, EventMetadataLatest, Hash, MetadataLatest, SiField, SiLookupTypeId, SiVariant } from '../interfaces/types';
import type { CallFunction, CodecHasher, Definitions, DetectCodec, RegisteredTypes, Registry, RegistryError, RegistryTypes } from '../types'; import type { CallFunction, CodecHasher, Definitions, DetectCodec, RegisteredTypes, Registry, RegistryError, RegistryTypes } from '../types';
import { DoNotConstruct, Json, Raw } from '@polkadot/types-codec'; import { DoNotConstruct, Json, Raw } from '@polkadot/types-codec';
@@ -288,10 +288,15 @@ export class TypeRegistry implements Registry {
} }
// finds an error // finds an error
public findMetaError (errorIndex: Uint8Array | DispatchErrorModule): RegistryError { public findMetaError (errorIndex: Uint8Array | DispatchErrorModule | DispatchErrorModuleU8a): RegistryError {
const [section, method] = isU8a(errorIndex) const [section, method] = isU8a(errorIndex)
? [errorIndex[0], errorIndex[1]] ? [errorIndex[0], errorIndex[1]]
: [errorIndex.index.toNumber(), errorIndex.error.toNumber()]; : [
errorIndex.index.toNumber(),
isU8a(errorIndex.error)
? errorIndex.error[0]
: errorIndex.error.toNumber()
];
return assertReturn( return assertReturn(
this.#metadataErrors[`${section}`] && this.#metadataErrors[`${section}`][`${method}`], this.#metadataErrors[`${section}`] && this.#metadataErrors[`${section}`][`${method}`],
@@ -214,6 +214,10 @@ export default {
index: 'u8', index: 'u8',
error: 'u8' error: 'u8'
}, },
DispatchErrorModuleU8a: {
index: 'u8',
error: '[u8; 4]'
},
DispatchErrorTo198: { DispatchErrorTo198: {
module: 'Option<u8>', module: 'Option<u8>',
error: 'u8' error: 'u8'
@@ -395,7 +399,7 @@ export default {
}, },
WeightPerClass: { WeightPerClass: {
baseExtrinsic: 'Weight', baseExtrinsic: 'Weight',
maxExtrinsic: 'Weight', maxExtrinsic: 'Option<Weight>',
maxTotal: 'Option<Weight>', maxTotal: 'Option<Weight>',
reserved: 'Option<Weight>' reserved: 'Option<Weight>'
} }
@@ -125,6 +125,12 @@ export interface DispatchErrorModule extends Struct {
readonly error: u8; readonly error: u8;
} }
/** @name DispatchErrorModuleU8a */
export interface DispatchErrorModuleU8a extends Struct {
readonly index: u8;
readonly error: U8aFixed;
}
/** @name DispatchErrorTo198 */ /** @name DispatchErrorTo198 */
export interface DispatchErrorTo198 extends Struct { export interface DispatchErrorTo198 extends Struct {
readonly module: Option<u8>; readonly module: Option<u8>;
@@ -404,7 +410,7 @@ export interface UnknownTransaction extends Enum {
/** @name WeightPerClass */ /** @name WeightPerClass */
export interface WeightPerClass extends Struct { export interface WeightPerClass extends Struct {
readonly baseExtrinsic: Weight; readonly baseExtrinsic: Weight;
readonly maxExtrinsic: Weight; readonly maxExtrinsic: Option<Weight>;
readonly maxTotal: Option<Weight>; readonly maxTotal: Option<Weight>;
readonly reserved: Option<Weight>; readonly reserved: Option<Weight>;
} }
@@ -373,7 +373,7 @@ export class PortableRegistry extends Struct implements ILookup {
} }
public get names (): string[] { public get names (): string[] {
return Object.values(this.#names); return Object.values(this.#names).sort();
} }
/** /**
@@ -3,11 +3,11 @@
import type { Text, u8 } from '@polkadot/types-codec'; import type { Text, u8 } from '@polkadot/types-codec';
import type { Registry } from '@polkadot/types-codec/types'; import type { Registry } from '@polkadot/types-codec/types';
import type { DispatchErrorModule, MetadataLatest, SiField, SiVariant } from '../../../interfaces'; import type { DispatchErrorModule, DispatchErrorModuleU8a, MetadataLatest, SiField, SiVariant } from '../../../interfaces';
import type { PortableRegistry } from '../../../metadata'; import type { PortableRegistry } from '../../../metadata';
import type { Errors, IsError } from '../types'; import type { Errors, IsError } from '../types';
import { lazyMethod, objectSpread, stringCamelCase } from '@polkadot/util'; import { isU8a, lazyMethod, objectSpread, stringCamelCase } from '@polkadot/util';
import { lazyVariants } from '../../../create/lazy'; import { lazyVariants } from '../../../create/lazy';
import { objectNameToString } from '../util'; import { objectNameToString } from '../util';
@@ -39,9 +39,12 @@ export function decorateErrors (registry: Registry, { lookup, pallets }: Metadat
lazyMethod(result, stringCamelCase(name), () => lazyMethod(result, stringCamelCase(name), () =>
lazyVariants(lookup, errors.unwrap(), objectNameToString, (variant: SiVariant): IsError => ({ lazyVariants(lookup, errors.unwrap(), objectNameToString, (variant: SiVariant): IsError => ({
is: ({ error, index }: DispatchErrorModule) => is: ({ error, index }: DispatchErrorModule | DispatchErrorModuleU8a) =>
index.eq(sectionIndex) && index.eq(sectionIndex) && (
error.eq(variant.index), isU8a(error)
? error[0] === variant.index.toNumber()
: error.eq(variant.index)
),
meta: registry.createTypeUnsafe('ErrorMetadataLatest', [variantToMeta(lookup, variant)]) meta: registry.createTypeUnsafe('ErrorMetadataLatest', [variantToMeta(lookup, variant)])
})) }))
); );
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { AnyTuple, Codec, Registry } from '@polkadot/types-codec/types'; import type { AnyTuple, Codec, Registry } from '@polkadot/types-codec/types';
import type { DispatchErrorModule, ErrorMetadataLatest, EventMetadataLatest, PalletConstantMetadataLatest } from '../../interfaces'; import type { DispatchErrorModule, DispatchErrorModuleU8a, ErrorMetadataLatest, EventMetadataLatest, PalletConstantMetadataLatest } from '../../interfaces';
import type { StorageEntry } from '../../primitive/types'; import type { StorageEntry } from '../../primitive/types';
import type { CallFunction, IEvent } from '../../types'; import type { CallFunction, IEvent } from '../../types';
@@ -13,7 +13,7 @@ export interface ConstantCodec extends Codec {
export interface IsError { export interface IsError {
readonly meta: ErrorMetadataLatest; readonly meta: ErrorMetadataLatest;
is: (moduleError: DispatchErrorModule) => boolean; is: (moduleError: DispatchErrorModule | DispatchErrorModuleU8a) => boolean;
} }
export interface IsEvent <T extends AnyTuple> { export interface IsEvent <T extends AnyTuple> {
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '7.14.3' }; export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '8.0.1' };
@@ -5,7 +5,6 @@ import '@polkadot/types-create/types/augmentRegistry';
import type { Codec, CodecClass } from '@polkadot/types-codec/types'; import type { Codec, CodecClass } from '@polkadot/types-codec/types';
import type { TypeDef } from '@polkadot/types-create/types'; import type { TypeDef } from '@polkadot/types-create/types';
import type { BN } from '@polkadot/util';
import type { ExtDef } from '../extrinsic/signedExtensions/types'; import type { ExtDef } from '../extrinsic/signedExtensions/types';
import type { MetadataLatest } from '../interfaces/metadata'; import type { MetadataLatest } from '../interfaces/metadata';
import type { SiField, SiLookupTypeId } from '../interfaces/scaleInfo'; import type { SiField, SiLookupTypeId } from '../interfaces/scaleInfo';
@@ -27,7 +26,6 @@ declare module '@polkadot/types-codec/types/registry' {
readonly signedExtensions: string[]; readonly signedExtensions: string[];
findMetaCall (callIndex: Uint8Array): CallFunctionExt; findMetaCall (callIndex: Uint8Array): CallFunctionExt;
findMetaError (errorIndex: Uint8Array | { error: BN, index: BN }): RegistryError;
clearCache (): void clearCache (): void

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