Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2ff40f735 | ||
|
|
9c51ea14be | ||
|
|
e3f912cef5 | ||
|
|
21808f0283 | ||
|
|
714380575c | ||
|
|
ec76f2cefd | ||
|
|
2121a1eea0 | ||
|
|
c0e0346987 | ||
|
|
9b5004df9b | ||
|
|
dd7ad37dbf | ||
|
|
92d6f6b98f | ||
|
|
fcb317d65b | ||
|
|
b8d4b034ab | ||
|
|
60398d9f47 | ||
|
|
7a1525d3e2 | ||
|
|
1ee461dd59 | ||
|
|
cfa15f98f7 | ||
|
|
18671cc650 | ||
|
|
a790e8c3ee | ||
|
|
bb6e16eac7 | ||
|
|
23e191eaf7 | ||
|
|
cec0325820 | ||
|
|
ffd8d74e3a | ||
|
|
91a04ad159 | ||
|
|
434f969208 | ||
|
|
34a5cbed90 | ||
|
|
72469ae6da | ||
|
|
14f2a9da39 | ||
|
|
12750bc83d | ||
|
|
9a2b67aa25 | ||
|
|
5e891f68ca | ||
|
|
040e8cbe94 | ||
|
|
1b5a772a4a | ||
|
|
12d8465cf4 | ||
|
|
190f4194cc | ||
|
|
c01a6001fc | ||
|
|
c847920f86 | ||
|
|
67325dbc09 | ||
|
|
63d72e7d36 | ||
|
|
64ddc05bc8 | ||
|
|
d15dec1e58 | ||
|
|
cb283c410b | ||
|
|
7c6ca42c10 | ||
|
|
bd6ad3a2ef | ||
|
|
1a29d7950c | ||
|
|
7049186928 | ||
|
|
dc34974a06 | ||
|
|
932e02e018 | ||
|
|
6f91fbd847 | ||
|
|
af7c4609f2 | ||
|
|
3600a4bdd7 | ||
|
|
3bf4e905e9 | ||
|
|
38984af858 | ||
|
|
60384ad850 | ||
|
|
998f88be05 | ||
|
|
551a081990 | ||
|
|
51e6e528ce | ||
|
|
1f5e939b73 | ||
|
|
3813152b46 | ||
|
|
cfec580956 | ||
|
|
859ce51eab | ||
|
|
aa5cc1eef1 | ||
|
|
2548601c9f | ||
|
|
51ceede446 | ||
|
|
a16ba9f2ac | ||
|
|
9926fcd14f | ||
|
|
fa5ec1b4a8 | ||
|
|
29d9c8a279 | ||
|
|
6a9428943d | ||
|
|
ea9cd6981d | ||
|
|
c7d37c9504 | ||
|
|
a41bc2113d | ||
|
|
e514d9b5a9 | ||
|
|
3b4310a418 | ||
|
|
0ec32636a9 |
@@ -1 +0,0 @@
|
||||
8.12.1
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
40
|
||||
|
||||
1.4.2
|
||||
1.6.2
|
||||
1.11.2
|
||||
1.12.2
|
||||
1.17.2
|
||||
1.31.2
|
||||
|
||||
2.8.2
|
||||
|
||||
3.2.2
|
||||
3.2.3
|
||||
3.3.2
|
||||
3.6.2
|
||||
3.6.3
|
||||
3.6.4
|
||||
3.7.2
|
||||
3.7.3
|
||||
3.9.2
|
||||
3.9.3
|
||||
3.10.2
|
||||
|
||||
4.0.2
|
||||
4.0.3
|
||||
4.6.2
|
||||
4.7.2
|
||||
4.9.2
|
||||
4.11.2
|
||||
4.16.2
|
||||
|
||||
5.3.2
|
||||
5.5.2
|
||||
5.8.2
|
||||
5.8.3
|
||||
|
||||
6.0.2
|
||||
6.0.3
|
||||
6.0.4
|
||||
6.0.5
|
||||
6.1.2
|
||||
|
||||
6.4.2
|
||||
6.5.2
|
||||
6.7.2
|
||||
6.9.2
|
||||
6.10.2
|
||||
6.10.3
|
||||
|
||||
7.0.2
|
||||
|
||||
7.14.2
|
||||
7.14.3
|
||||
8.0.2
|
||||
8.3.2
|
||||
8.4.2
|
||||
8.6.2
|
||||
8.8.2
|
||||
8.11.2
|
||||
8.11.3
|
||||
+1
-2
@@ -6,8 +6,7 @@ const base = require('@polkadot/dev/config/eslint.cjs');
|
||||
module.exports = {
|
||||
...base,
|
||||
ignorePatterns: [
|
||||
...base.ignorePatterns,
|
||||
'**/deno/*.ts'
|
||||
...base.ignorePatterns
|
||||
],
|
||||
parserOptions: {
|
||||
...base.parserOptions,
|
||||
|
||||
+1
-6
@@ -1,12 +1,7 @@
|
||||
_book/
|
||||
build/
|
||||
build-cjs/
|
||||
build-esm/
|
||||
build-deno/
|
||||
build-docs/
|
||||
build-*/
|
||||
coverage/
|
||||
docs/.vuepress/dist/
|
||||
docs/substrate/*.md
|
||||
node_modules/
|
||||
tmp/
|
||||
/import_map.json
|
||||
|
||||
+40
-1
@@ -1,5 +1,44 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 8.14.1 Jul 23, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
- Update `@substrate/connect` with dual ESM/CJS support (Thanks to https://github.com/wirednkod)
|
||||
|
||||
Changes:
|
||||
|
||||
- `{BTree|Hash}Map.toHuman()` now display `Raw` keys as ascii (if detected)
|
||||
- Add `toPrimitive()` to all base `Codec` interfaces (string/boolean/number)
|
||||
- Adjust metadata conversion with `objectSpread` (where missing)
|
||||
- Support for `TransactionPaymentCallApi` runtime interface
|
||||
- Check `registry.getModuleInstances` against metadata paths (fallback)
|
||||
- Update to `@polkadot/util` 10.1.1
|
||||
- Update to latest Kusama metadata (Substrate & Polkadot are current)
|
||||
|
||||
|
||||
## 8.13.1 Jul 16, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Add `derive.chain.subscribeFinalized{Heads, Blocks}` which returns all finalized, no skips
|
||||
- Support Moonbeam author extraction on `derive.chain.*` (w/ shared logic dedupe)
|
||||
- Cater for older `BlockBuilder 2/3/4` & `GrandpaApi 2` runtime interface definitions
|
||||
- Support for `NominationPoolsApi` runtime interface
|
||||
- Support for `DebugRuntimeApi` runtime interface, Frontier-specific
|
||||
- Support for `NimbusApi` runtime interface (& older `AuthorFilterAPI`)
|
||||
- Add additional historic `DispatchError` enum variant for asset chains
|
||||
- Add Kusama 9250 upgrade block
|
||||
- Update to latest Substrate, Polkadot & Kusama metadata
|
||||
|
||||
|
||||
## 8.12.2 Jul 10, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Update to `@polkadot/util` 10.0.2
|
||||
|
||||
|
||||
## 8.12.1 Jul 9, 2022
|
||||
|
||||
Changes:
|
||||
@@ -310,7 +349,7 @@ Changes:
|
||||
- Only explicitly support LSB on `BitVec` types
|
||||
- Change `toHuman()` on `BitVec` to output default LSB
|
||||
- Add `bytes{Sent, Recv}` to provider stats
|
||||
- Clear connection timout on provider `disconnect()`
|
||||
- Clear connection timeout on provider `disconnect()`
|
||||
- Add support for `dev_getBlockStats` RPC
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
3114 Jaco 8.12.1 (#5050)
|
||||
3150 Jaco 8.14.1 (#5102)
|
||||
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
|
||||
37 Keith Ingram Update contract types and rpc (#4541)
|
||||
35 Stefanie Doll Updated child storage parameters (#1709)
|
||||
@@ -7,9 +7,9 @@
|
||||
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
|
||||
11 Ian He HttpProvider support clone() (#3949)
|
||||
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
|
||||
7 Nikos Kontakis Bump substrate connect to 0.7.9 (Add CommonJS Support) (#5088)
|
||||
5 Chevdor Fix metadata package link (#3458)
|
||||
5 Jake Naviasky Fixing approvalFlagsToBools. (#1250)
|
||||
5 Nikos Kontakis Bump substrate connect to 0.7.7 (#4962)
|
||||
4 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
|
||||
4 Alex Wang fix issue that creates duplicate providers (#983)
|
||||
4 Alexander Popiak Add asset id in signing (#4009)
|
||||
|
||||
+10
-6
@@ -11,7 +11,11 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"versions": {
|
||||
"git": "8.14.1",
|
||||
"npm": "8.14.1"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
@@ -30,12 +34,12 @@
|
||||
"test:one": "NODE_OPTIONS=--experimental-vm-modules polkadot-dev-run-test --detectOpenHandles --forceExit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.6",
|
||||
"@babel/register": "^7.18.6",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/dev": "^0.67.65",
|
||||
"@babel/core": "^7.18.9",
|
||||
"@babel/register": "^7.18.9",
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/dev": "^0.67.84",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^28.1.4",
|
||||
"@types/jest": "^28.1.6",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"resolutions": {
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api-base": "8.12.1",
|
||||
"@polkadot/rpc-augment": "8.12.1",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/types-augment": "8.12.1",
|
||||
"@polkadot/types-codec": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1"
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/api-base": "8.14.1",
|
||||
"@polkadot/rpc-augment": "8.14.1",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/types-augment": "8.14.1",
|
||||
"@polkadot/types-codec": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types-support": "8.12.1"
|
||||
"@polkadot/types-support": "8.14.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,13 +463,20 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
};
|
||||
nominationPools: {
|
||||
/**
|
||||
* The minimum pool points-to-balance ratio that must be maintained for it to be `open`.
|
||||
* The maximum pool points-to-balance ratio that an `open` pool can have.
|
||||
*
|
||||
* This is important in the event slashing takes place and the pool's points-to-balance
|
||||
* ratio becomes disproportional.
|
||||
*
|
||||
* Moreover, this relates to the `RewardCounter` type as well, as the arithmetic operations
|
||||
* are a function of number of points, and by setting this value to e.g. 10, you ensure
|
||||
* that the total number of points in the system are at most 10 times the total_issuance of
|
||||
* the chain, in the absolute worse case.
|
||||
*
|
||||
* For a value of 10, the threshold would be a pool points-to-balance ratio of 10:1.
|
||||
* Such a scenario would also be the equivalent of the pool being 90% slashed.
|
||||
**/
|
||||
minPointsToBalance: u32 & AugmentedConst<ApiType>;
|
||||
maxPointsToBalance: u8 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The nomination pool's pallet id.
|
||||
**/
|
||||
|
||||
@@ -945,6 +945,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
MetadataExceedsMaxLen: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The amount does not meet the minimum bond to either join or create a pool.
|
||||
*
|
||||
* The depositor can never unbond to a value less than
|
||||
* `Pallet::depositor_min_bond`. The caller does not have nominating
|
||||
* permissions for the pool. Members can never unbond to a value below `MinJoinBond`.
|
||||
**/
|
||||
MinimumBondNotMet: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -952,10 +956,6 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* other members to be permissionlessly unbonded.
|
||||
**/
|
||||
NotDestroying: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Not enough points. Ty unbonding less.
|
||||
**/
|
||||
NotEnoughPointsToUnbond: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Either a) the caller cannot make a valid kick or b) the pool is not destroying.
|
||||
**/
|
||||
@@ -964,11 +964,6 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* The caller does not have nominating permissions for the pool.
|
||||
**/
|
||||
NotNominator: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The depositor must be the only member in the bonded pool in order to unbond. And the
|
||||
* depositor must be the only member in the sub pools in order to withdraw unbonded.
|
||||
**/
|
||||
NotOnlyPoolMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The pool is not open to join
|
||||
**/
|
||||
@@ -1296,14 +1291,14 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Must vote for at least one candidate.
|
||||
**/
|
||||
NoVotes: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Cannot report self.
|
||||
**/
|
||||
ReportSelf: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Runner cannot re-submit candidacy.
|
||||
**/
|
||||
RunnerUpSubmit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many candidates have been created.
|
||||
**/
|
||||
TooManyCandidates: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Cannot vote more than candidates.
|
||||
**/
|
||||
|
||||
@@ -2129,6 +2129,8 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Additional funds can come from either the free balance of the account, of from the
|
||||
* accumulated rewards, see [`BondExtra`].
|
||||
*
|
||||
* Bonding extra funds implies an automatic payout of all pending rewards as well.
|
||||
**/
|
||||
bondExtra: AugmentedSubmittable<(extra: PalletNominationPoolsBondExtra | { FreeBalance: any } | { Rewards: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletNominationPoolsBondExtra]>;
|
||||
/**
|
||||
@@ -2225,8 +2227,14 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
/**
|
||||
* Set a new state for the pool.
|
||||
*
|
||||
* The dispatch origin of this call must be signed by the state toggler, or the root role
|
||||
* of the pool.
|
||||
* If a pool is already in the `Destroying` state, then under no condition can its state
|
||||
* change again.
|
||||
*
|
||||
* The dispatch origin of this call must be either:
|
||||
*
|
||||
* 1. signed by the state toggler, or the root role of the pool,
|
||||
* 2. if the pool conditions to be open are NOT met (as described by `ok_to_be_open`), and
|
||||
* then the state of the pool can be permissionlessly changed to `Destroying`.
|
||||
**/
|
||||
setState: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, state: PalletNominationPoolsPoolState | 'Open' | 'Blocked' | 'Destroying' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletNominationPoolsPoolState]>;
|
||||
/**
|
||||
@@ -2402,7 +2410,11 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* the outgoing member is slashed.
|
||||
*
|
||||
* If a runner-up is available, then the best runner-up will be removed and replaces the
|
||||
* outgoing member. Otherwise, a new phragmen election is started.
|
||||
* outgoing member. Otherwise, if `rerun_election` is `true`, a new phragmen election is
|
||||
* started, else, nothing happens.
|
||||
*
|
||||
* If `slash_bond` is set to true, the bond of the member being removed is slashed. Else,
|
||||
* it is returned.
|
||||
*
|
||||
* The dispatch origin of this call must be root.
|
||||
*
|
||||
@@ -2413,7 +2425,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* will go into phragmen, we assume full block for now.
|
||||
* # </weight>
|
||||
**/
|
||||
removeMember: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, hasReplacement: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, bool]>;
|
||||
removeMember: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, slashBond: bool | boolean | Uint8Array, rerunElection: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, bool, bool]>;
|
||||
/**
|
||||
* Remove `origin` as a voter.
|
||||
*
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -1154,14 +1154,14 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Must vote for at least one candidate.
|
||||
**/
|
||||
NoVotes: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Cannot report self.
|
||||
**/
|
||||
ReportSelf: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Runner cannot re-submit candidacy.
|
||||
**/
|
||||
RunnerUpSubmit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many candidates have been created.
|
||||
**/
|
||||
TooManyCandidates: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Cannot vote more than candidates.
|
||||
**/
|
||||
|
||||
@@ -2177,7 +2177,11 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* the outgoing member is slashed.
|
||||
*
|
||||
* If a runner-up is available, then the best runner-up will be removed and replaces the
|
||||
* outgoing member. Otherwise, a new phragmen election is started.
|
||||
* outgoing member. Otherwise, if `rerun_election` is `true`, a new phragmen election is
|
||||
* started, else, nothing happens.
|
||||
*
|
||||
* If `slash_bond` is set to true, the bond of the member being removed is slashed. Else,
|
||||
* it is returned.
|
||||
*
|
||||
* The dispatch origin of this call must be root.
|
||||
*
|
||||
@@ -2188,7 +2192,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* will go into phragmen, we assume full block for now.
|
||||
* # </weight>
|
||||
**/
|
||||
removeMember: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, hasReplacement: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, bool]>;
|
||||
removeMember: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, slashBond: bool | boolean | Uint8Array, rerunElection: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, bool, bool]>;
|
||||
/**
|
||||
* Remove `origin` as a voter.
|
||||
*
|
||||
|
||||
@@ -683,13 +683,20 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
};
|
||||
nominationPools: {
|
||||
/**
|
||||
* The minimum pool points-to-balance ratio that must be maintained for it to be `open`.
|
||||
* The maximum pool points-to-balance ratio that an `open` pool can have.
|
||||
*
|
||||
* This is important in the event slashing takes place and the pool's points-to-balance
|
||||
* ratio becomes disproportional.
|
||||
*
|
||||
* Moreover, this relates to the `RewardCounter` type as well, as the arithmetic operations
|
||||
* are a function of number of points, and by setting this value to e.g. 10, you ensure
|
||||
* that the total number of points in the system are at most 10 times the total_issuance of
|
||||
* the chain, in the absolute worse case.
|
||||
*
|
||||
* For a value of 10, the threshold would be a pool points-to-balance ratio of 10:1.
|
||||
* Such a scenario would also be the equivalent of the pool being 90% slashed.
|
||||
**/
|
||||
minPointsToBalance: u32 & AugmentedConst<ApiType>;
|
||||
maxPointsToBalance: u8 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The nomination pool's pallet id.
|
||||
**/
|
||||
|
||||
@@ -855,14 +855,14 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Must vote for at least one candidate.
|
||||
**/
|
||||
NoVotes: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Cannot report self.
|
||||
**/
|
||||
ReportSelf: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Runner cannot re-submit candidacy.
|
||||
**/
|
||||
RunnerUpSubmit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many candidates have been created.
|
||||
**/
|
||||
TooManyCandidates: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Cannot vote more than candidates.
|
||||
**/
|
||||
@@ -1207,6 +1207,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
MetadataExceedsMaxLen: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The amount does not meet the minimum bond to either join or create a pool.
|
||||
*
|
||||
* The depositor can never unbond to a value less than
|
||||
* `Pallet::depositor_min_bond`. The caller does not have nominating
|
||||
* permissions for the pool. Members can never unbond to a value below `MinJoinBond`.
|
||||
**/
|
||||
MinimumBondNotMet: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -1214,10 +1218,6 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* other members to be permissionlessly unbonded.
|
||||
**/
|
||||
NotDestroying: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Not enough points. Ty unbonding less.
|
||||
**/
|
||||
NotEnoughPointsToUnbond: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Either a) the caller cannot make a valid kick or b) the pool is not destroying.
|
||||
**/
|
||||
@@ -1226,11 +1226,6 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* The caller does not have nominating permissions for the pool.
|
||||
**/
|
||||
NotNominator: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The depositor must be the only member in the bonded pool in order to unbond. And the
|
||||
* depositor must be the only member in the sub pools in order to withdraw unbonded.
|
||||
**/
|
||||
NotOnlyPoolMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The pool is not open to join
|
||||
**/
|
||||
@@ -2058,6 +2053,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Invalid witness data given.
|
||||
**/
|
||||
BadWitness: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The provided bid is too low.
|
||||
**/
|
||||
BidTooLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The item or collection is frozen.
|
||||
**/
|
||||
@@ -2090,6 +2089,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* The signing account has no permission to do the operation.
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Item is not for sale.
|
||||
**/
|
||||
NotForSale: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The named owner has not signed ownership of the collection is acceptable.
|
||||
**/
|
||||
@@ -2102,6 +2105,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* The given item ID is unknown.
|
||||
**/
|
||||
UnknownCollection: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given item ID is unknown.
|
||||
**/
|
||||
UnknownItem: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The delegate turned out to be different to what was expected.
|
||||
**/
|
||||
|
||||
@@ -1469,6 +1469,18 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* An `item` was issued.
|
||||
**/
|
||||
Issued: AugmentedEvent<ApiType, [collection: u32, item: u32, owner: AccountId32], { collection: u32, item: u32, owner: AccountId32 }>;
|
||||
/**
|
||||
* An item was bought.
|
||||
**/
|
||||
ItemBought: AugmentedEvent<ApiType, [collection: u32, item: u32, price: u128, seller: AccountId32, buyer: AccountId32], { collection: u32, item: u32, price: u128, seller: AccountId32, buyer: AccountId32 }>;
|
||||
/**
|
||||
* The price for the instance was removed.
|
||||
**/
|
||||
ItemPriceRemoved: AugmentedEvent<ApiType, [collection: u32, item: u32], { collection: u32, item: u32 }>;
|
||||
/**
|
||||
* The price was set for the instance.
|
||||
**/
|
||||
ItemPriceSet: AugmentedEvent<ApiType, [collection: u32, item: u32, price: u128, whitelistedBuyer: Option<AccountId32>], { collection: u32, item: u32, price: u128, whitelistedBuyer: Option<AccountId32> }>;
|
||||
/**
|
||||
* A `collection` has had its attributes changed by the `Force` origin.
|
||||
**/
|
||||
|
||||
@@ -1779,6 +1779,10 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Metadata of an item.
|
||||
**/
|
||||
instanceMetadataOf: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesItemMetadata>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* Price of an asset instance.
|
||||
**/
|
||||
itemPriceOf: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[u128, Option<AccountId32>]>>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* The collection, if any, of which an account is willing to take ownership.
|
||||
**/
|
||||
|
||||
@@ -1937,7 +1937,11 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* the outgoing member is slashed.
|
||||
*
|
||||
* If a runner-up is available, then the best runner-up will be removed and replaces the
|
||||
* outgoing member. Otherwise, a new phragmen election is started.
|
||||
* outgoing member. Otherwise, if `rerun_election` is `true`, a new phragmen election is
|
||||
* started, else, nothing happens.
|
||||
*
|
||||
* If `slash_bond` is set to true, the bond of the member being removed is slashed. Else,
|
||||
* it is returned.
|
||||
*
|
||||
* The dispatch origin of this call must be root.
|
||||
*
|
||||
@@ -1948,7 +1952,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* will go into phragmen, we assume full block for now.
|
||||
* # </weight>
|
||||
**/
|
||||
removeMember: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, hasReplacement: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, bool]>;
|
||||
removeMember: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, slashBond: bool | boolean | Uint8Array, rerunElection: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, bool, bool]>;
|
||||
/**
|
||||
* Remove `origin` as a voter.
|
||||
*
|
||||
@@ -2714,6 +2718,8 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Additional funds can come from either the free balance of the account, of from the
|
||||
* accumulated rewards, see [`BondExtra`].
|
||||
*
|
||||
* Bonding extra funds implies an automatic payout of all pending rewards as well.
|
||||
**/
|
||||
bondExtra: AugmentedSubmittable<(extra: PalletNominationPoolsBondExtra | { FreeBalance: any } | { Rewards: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletNominationPoolsBondExtra]>;
|
||||
/**
|
||||
@@ -2810,8 +2816,14 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
/**
|
||||
* Set a new state for the pool.
|
||||
*
|
||||
* The dispatch origin of this call must be signed by the state toggler, or the root role
|
||||
* of the pool.
|
||||
* If a pool is already in the `Destroying` state, then under no condition can its state
|
||||
* change again.
|
||||
*
|
||||
* The dispatch origin of this call must be either:
|
||||
*
|
||||
* 1. signed by the state toggler, or the root role of the pool,
|
||||
* 2. if the pool conditions to be open are NOT met (as described by `ok_to_be_open`), and
|
||||
* then the state of the pool can be permissionlessly changed to `Destroying`.
|
||||
**/
|
||||
setState: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, state: PalletNominationPoolsPoolState | 'Open' | 'Blocked' | 'Destroying' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletNominationPoolsPoolState]>;
|
||||
/**
|
||||
@@ -4983,6 +4995,18 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Modes: `check_owner.is_some()`.
|
||||
**/
|
||||
burn: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, checkOwner: Option<MultiAddress> | null | Uint8Array | MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<MultiAddress>]>;
|
||||
/**
|
||||
* Allows to buy an item if it's up for sale.
|
||||
*
|
||||
* Origin must be Signed and must not be the owner of the `item`.
|
||||
*
|
||||
* - `collection`: The collection of the item.
|
||||
* - `item`: The item the sender wants to buy.
|
||||
* - `bid_price`: The price the sender is willing to pay.
|
||||
*
|
||||
* Emits `ItemBought` on success.
|
||||
**/
|
||||
buyItem: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, bidPrice: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u128]>;
|
||||
/**
|
||||
* Cancel the prior approval for the transfer of an item by a delegate.
|
||||
*
|
||||
@@ -5271,6 +5295,20 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setMetadata: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Bytes, bool]>;
|
||||
/**
|
||||
* Set (or reset) the price for an item.
|
||||
*
|
||||
* Origin must be Signed and must be the owner of the asset `item`.
|
||||
*
|
||||
* - `collection`: The collection of the item.
|
||||
* - `item`: The item to set the price for.
|
||||
* - `price`: The price for the item. Pass `None`, to reset the price.
|
||||
* - `buyer`: Restricts the buy operation to a specific account.
|
||||
*
|
||||
* Emits `ItemPriceSet` on success if the price is not `None`.
|
||||
* Emits `ItemPriceRemoved` on success if the price is `None`.
|
||||
**/
|
||||
setPrice: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, price: Option<u128> | null | Uint8Array | u128 | AnyNumber, whitelistedBuyer: Option<MultiAddress> | null | Uint8Array | MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<u128>, Option<MultiAddress>]>;
|
||||
/**
|
||||
* Change the Issuer, Admin and Freezer of a collection.
|
||||
*
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/rpc-core": "8.12.1",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1",
|
||||
"rxjs": "^7.5.5"
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/rpc-core": "8.14.1",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1",
|
||||
"rxjs": "^7.5.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api": "8.12.1",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/types-codec": "8.12.1",
|
||||
"@polkadot/types-create": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1",
|
||||
"@polkadot/util-crypto": "^10.0.1",
|
||||
"rxjs": "^7.5.5"
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/api": "8.14.1",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/types-codec": "8.14.1",
|
||||
"@polkadot/types-create": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1",
|
||||
"@polkadot/util-crypto": "^10.1.1",
|
||||
"rxjs": "^7.5.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "8.12.1",
|
||||
"@polkadot/keyring": "^10.0.1"
|
||||
"@polkadot/api-augment": "8.14.1",
|
||||
"@polkadot/keyring": "^10.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, Deco
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { TypeDefInfo } from '@polkadot/types-create';
|
||||
import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
import { assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { convertVersions, enumVersions } from './toLatest';
|
||||
|
||||
@@ -35,7 +35,9 @@ function getLatestMeta (registry: Registry, json: Record<string, unknown>): Cont
|
||||
) as unknown as ContractMetadata;
|
||||
const converter = convertVersions.find(([v]) => metadata[`is${v}`]);
|
||||
|
||||
assert(converter, () => `Unable to convert ABI with version ${metadata.type} to latest`);
|
||||
if (!converter) {
|
||||
throw new Error(`Unable to convert ABI with version ${metadata.type} to latest`);
|
||||
}
|
||||
|
||||
return converter[1](registry, metadata[`as${converter[0]}`]);
|
||||
}
|
||||
@@ -112,7 +114,9 @@ export class Abi {
|
||||
const index = data[0];
|
||||
const event = this.events[index];
|
||||
|
||||
assert(event, () => `Unable to find event with index ${index}`);
|
||||
if (!event) {
|
||||
throw new Error(`Unable to find event with index ${index}`);
|
||||
}
|
||||
|
||||
return event.fromU8a(data.subarray(1));
|
||||
}
|
||||
@@ -142,7 +146,9 @@ export class Abi {
|
||||
#createArgs = (args: ContractMessageParamSpecLatest[], spec: unknown): AbiParam[] => {
|
||||
return args.map(({ label, type }, index): AbiParam => {
|
||||
try {
|
||||
assert(isObject(type), 'Invalid type definition found');
|
||||
if (!isObject(type)) {
|
||||
throw new Error('Invalid type definition found');
|
||||
}
|
||||
|
||||
const displayName = type.displayName.length
|
||||
? type.displayName[type.displayName.length - 1].toString()
|
||||
@@ -233,13 +239,17 @@ export class Abi {
|
||||
const selector = trimmed.subarray(0, 4);
|
||||
const message = list.find((m) => m.selector.eq(selector));
|
||||
|
||||
assert(message, `Unable to find ${type} with selector ${u8aToHex(selector)}`);
|
||||
if (!message) {
|
||||
throw new Error(`Unable to find ${type} with selector ${u8aToHex(selector)}`);
|
||||
}
|
||||
|
||||
return message.fromU8a(trimmed.subarray(4));
|
||||
};
|
||||
|
||||
#encodeArgs = ({ label, selector }: ContractMessageSpecLatest | ContractConstructorSpecLatest, args: AbiParam[], data: unknown[]): Uint8Array => {
|
||||
assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${label.toString()}', found ${data.length}`);
|
||||
if (data.length !== args.length) {
|
||||
throw new Error(`Expected ${args.length} arguments to contract message '${label.toString()}', found ${data.length}`);
|
||||
}
|
||||
|
||||
return compactAddLength(
|
||||
u8aConcat(
|
||||
|
||||
@@ -8,7 +8,11 @@ import { v0ToV1 } from './toV1';
|
||||
import { v1ToV2 } from './toV2';
|
||||
import { v2ToV3 } from './toV3';
|
||||
|
||||
type Versions = 'V3' | 'V2' | 'V1' | 'V0';
|
||||
// The versions where an enum is used, aka V0 is missing
|
||||
// (Order from newest, i.e. we expect more on newest vs oldest)
|
||||
export const enumVersions = <const> ['V3', 'V2', 'V1'];
|
||||
|
||||
type Versions = typeof enumVersions[number] | 'V0';
|
||||
|
||||
type Converter = (registry: Registry, vx: any) => ContractMetadataLatest;
|
||||
|
||||
@@ -26,10 +30,6 @@ export const v2ToLatest = createConverter(v3ToLatest, v2ToV3);
|
||||
export const v1ToLatest = createConverter(v2ToLatest, v1ToV2);
|
||||
export const v0ToLatest = createConverter(v1ToLatest, v0ToV1);
|
||||
|
||||
// The versions where an enum is used, aka V0 is missing
|
||||
// (Order from newest, i.e. we expect more on newest vs oldest)
|
||||
export const enumVersions = ['V3', 'V2', 'V1'];
|
||||
|
||||
export const convertVersions: [Versions, Converter][] = [
|
||||
['V3', v3ToLatest],
|
||||
['V2', v2ToLatest],
|
||||
|
||||
@@ -23,7 +23,7 @@ interface ArgsEntry <T extends WithArgs> extends NamedEntry {
|
||||
args: GetArgsType<T>['args'][0][];
|
||||
}
|
||||
|
||||
const ARG_TYPES = {
|
||||
const ARG_TYPES = <const> {
|
||||
ContractConstructorSpec: 'ContractMessageParamSpecV2',
|
||||
ContractEventSpec: 'ContractEventParamSpecV2',
|
||||
ContractMessageSpec: 'ContractMessageParamSpecV2'
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { ApiBase } from '@polkadot/api/base';
|
||||
import { assert, isFunction } from '@polkadot/util';
|
||||
import { isFunction } from '@polkadot/util';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
|
||||
@@ -24,9 +24,13 @@ export abstract class Base<ApiType extends ApiTypes> {
|
||||
|
||||
this._decorateMethod = decorateMethod;
|
||||
|
||||
assert(!!(api && api.isConnected && api.tx), 'Your API has not been initialized correctly and is not connected to a chain');
|
||||
assert(!!(api.tx.contracts && Object.keys(api.tx.contracts).length), 'You need to connect to a chain with a runtime that supports contracts');
|
||||
assert(isFunction(api.tx.contracts.instantiateWithCode), 'You need to connect to a chain with a runtime with a V3 contracts module. The runtime does not expose api.tx.contracts.instantiateWithCode');
|
||||
if (!api || !api.isConnected || !api.tx) {
|
||||
throw new Error('Your API has not been initialized correctly and is not connected to a chain');
|
||||
} else if (!api.tx.contracts || !Object.keys(api.tx.contracts).length) {
|
||||
throw new Error('You need to connect to a chain with a runtime that supports contracts');
|
||||
} else if (!isFunction(api.tx.contracts.instantiateWithCode)) {
|
||||
throw new Error('You need to connect to a chain with a runtime with a V3 contracts module. The runtime does not expose api.tx.contracts.instantiateWithCode');
|
||||
}
|
||||
}
|
||||
|
||||
public get registry (): Registry {
|
||||
|
||||
@@ -6,9 +6,9 @@ import path from 'path';
|
||||
|
||||
import { toPromiseMethod } from '@polkadot/api';
|
||||
|
||||
import v0contractFlipper from '../test/contracts/ink/v0/flipper.contract.json';
|
||||
import v0abiFlipper from '../test/contracts/ink/v0/flipper.json';
|
||||
import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json';
|
||||
import v0contractFlipper from '../test/contracts/ink/v0/flipper.contract.json' assert { type: 'json' };
|
||||
import v0abiFlipper from '../test/contracts/ink/v0/flipper.json' assert { type: 'json' };
|
||||
import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json' assert { type: 'json' };
|
||||
import { Code } from './Code';
|
||||
import { mockApi } from './mock';
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import type { MapConstructorExec } from './types';
|
||||
|
||||
import { SubmittableResult } from '@polkadot/api';
|
||||
import { ApiBase } from '@polkadot/api/base';
|
||||
import { assert, BN_ZERO, compactAddLength, isUndefined, isWasm, u8aToU8a } from '@polkadot/util';
|
||||
import { BN_ZERO, compactAddLength, isUndefined, isWasm, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { applyOnEvent } from '../util';
|
||||
@@ -48,7 +48,9 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
? this.abi.info.source.wasm
|
||||
: u8aToU8a(wasm);
|
||||
|
||||
assert(isWasm(this.code), 'No WASM code provided');
|
||||
if (!isWasm(this.code)) {
|
||||
throw new Error('No WASM code provided');
|
||||
}
|
||||
|
||||
this.abi.constructors.forEach((c): void => {
|
||||
if (isUndefined(this.#tx[c.method])) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import { map } from 'rxjs';
|
||||
|
||||
import { SubmittableResult } from '@polkadot/api';
|
||||
import { ApiBase } from '@polkadot/api/base';
|
||||
import { assert, BN, BN_HUNDRED, BN_ONE, BN_ZERO, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
|
||||
import { BN, BN_HUNDRED, BN_ONE, BN_ZERO, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { applyOnEvent, extractOptions, isOptions } from '../util';
|
||||
@@ -87,7 +87,9 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
}
|
||||
|
||||
public get query (): MapMessageQuery<ApiType> {
|
||||
assert(this.hasRpcContractsCall, ERROR_NO_CALL);
|
||||
if (!this.hasRpcContractsCall) {
|
||||
throw new Error(ERROR_NO_CALL);
|
||||
}
|
||||
|
||||
return this.#query;
|
||||
}
|
||||
@@ -138,7 +140,9 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
};
|
||||
|
||||
#read = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, storageDepositLimit = null, value = BN_ZERO }: ContractOptions, params: unknown[]): ContractCallSend<ApiType> => {
|
||||
assert(this.hasRpcContractsCall, ERROR_NO_CALL);
|
||||
if (!this.hasRpcContractsCall) {
|
||||
throw new Error(ERROR_NO_CALL);
|
||||
}
|
||||
|
||||
const message = this.abi.findMessage(messageOrId);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ApiPromise } from '@polkadot/api';
|
||||
import { BlueprintPromise, ContractPromise } from '@polkadot/api-contract';
|
||||
import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs';
|
||||
|
||||
import abiIncrementer from './test/contracts/ink/v0/incrementer.json';
|
||||
import abiIncrementer from './test/contracts/ink/v0/incrementer.json' assert { type: 'json' };
|
||||
|
||||
async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
const blueprint = new BlueprintPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as delegator } from './delegator.json';
|
||||
export { default as dns } from './dns.json';
|
||||
export { default as erc20 } from './erc20.json';
|
||||
export { default as erc721 } from './erc721.json';
|
||||
export { default as flipper } from './flipper.json';
|
||||
export { default as flipperBundle } from './flipper.contract.json';
|
||||
export { default as incrementer } from './incrementer.json';
|
||||
export { default as multisigPlain } from './multisig_plain.json';
|
||||
export { default as delegator } from './delegator.json' assert { type: 'json' };
|
||||
export { default as dns } from './dns.json' assert { type: 'json' };
|
||||
export { default as erc20 } from './erc20.json' assert { type: 'json' };
|
||||
export { default as erc721 } from './erc721.json' assert { type: 'json' };
|
||||
export { default as flipper } from './flipper.json' assert { type: 'json' };
|
||||
export { default as flipperBundle } from './flipper.contract.json' assert { type: 'json' };
|
||||
export { default as incrementer } from './incrementer.json' assert { type: 'json' };
|
||||
export { default as multisigPlain } from './multisig_plain.json' assert { type: 'json' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as flipper } from './flipper.contract.json';
|
||||
export { default as flipper } from './flipper.contract.json' assert { type: 'json' };
|
||||
// A complex contract example with traits.
|
||||
export { default as psp22 } from './psp22_minter_pauser.contract.json';
|
||||
export { default as psp22 } from './psp22_minter_pauser.contract.json' assert { type: 'json' };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as erc20 } from './erc20.contract.json';
|
||||
export { default as flipper } from './flipper.contract.json';
|
||||
export { default as erc20 } from './erc20.contract.json' assert { type: 'json' };
|
||||
export { default as flipper } from './flipper.contract.json' assert { type: 'json' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as flipper } from './flipper.contract.json';
|
||||
export { default as flipper } from './flipper.contract.json' assert { type: 'json' };
|
||||
// A complex contract example with traits.
|
||||
export { default as traitErc20 } from './trait_erc20.contract.json';
|
||||
export { default as traitErc20 } from './trait_erc20.contract.json' assert { type: 'json' };
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as ints256 } from './ints256.json';
|
||||
export { default as ints256 } from './ints256.json' assert { type: 'json' };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as assetTransfer } from './assetTransfer.json';
|
||||
export { default as enumExample } from './enumExample.json';
|
||||
export { default as recursive } from './recursive.contract.json';
|
||||
export { default as withString } from './withString.json';
|
||||
export { default as assetTransfer } from './assetTransfer.json' assert { type: 'json' };
|
||||
export { default as enumExample } from './enumExample.json' assert { type: 'json' };
|
||||
export { default as recursive } from './recursive.contract.json' assert { type: 'json' };
|
||||
export { default as withString } from './withString.json' assert { type: 'json' };
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api": "8.12.1",
|
||||
"@polkadot/api-augment": "8.12.1",
|
||||
"@polkadot/api-base": "8.12.1",
|
||||
"@polkadot/rpc-core": "8.12.1",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/types-codec": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1",
|
||||
"@polkadot/util-crypto": "^10.0.1",
|
||||
"rxjs": "^7.5.5"
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/api": "8.14.1",
|
||||
"@polkadot/api-augment": "8.14.1",
|
||||
"@polkadot/api-base": "8.14.1",
|
||||
"@polkadot/rpc-core": "8.14.1",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/types-codec": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1",
|
||||
"@polkadot/util-crypto": "^10.1.1",
|
||||
"rxjs": "^7.5.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api": "8.12.1",
|
||||
"@polkadot/api-augment": "8.12.1",
|
||||
"@polkadot/rpc-augment": "8.12.1",
|
||||
"@polkadot/rpc-provider": "8.12.1",
|
||||
"@polkadot/types-support": "8.12.1"
|
||||
"@polkadot/api": "8.14.1",
|
||||
"@polkadot/api-augment": "8.14.1",
|
||||
"@polkadot/rpc-augment": "8.14.1",
|
||||
"@polkadot/rpc-provider": "8.14.1",
|
||||
"@polkadot/types-support": "8.14.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,8 @@ function querySystemAccount (api: DeriveApi, accountId: AccountId): Observable<R
|
||||
* ```
|
||||
*/
|
||||
export function account (instanceId: string, api: DeriveApi): (address: AccountIndex | AccountId | Address | string) => Observable<DeriveBalancesAccount> {
|
||||
const balanceInstances = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), 'balances');
|
||||
const balanceInstances = api.registry.getModuleInstances(api.runtimeVersion.specName, 'balances');
|
||||
const nonDefaultBalances = balanceInstances && (balanceInstances.length !== 1 || balanceInstances[0] !== 'balances');
|
||||
|
||||
return memo(instanceId, (address: AccountIndex | AccountId | Address | string): Observable<DeriveBalancesAccount> =>
|
||||
api.derive.accounts.accountId(address).pipe(
|
||||
@@ -158,7 +159,7 @@ export function account (instanceId: string, api: DeriveApi): (address: AccountI
|
||||
(accountId
|
||||
? combineLatest([
|
||||
of(accountId),
|
||||
balanceInstances
|
||||
nonDefaultBalances
|
||||
? queryBalancesAccount(api, accountId, balanceInstances)
|
||||
: isFunction(api.query.system?.account)
|
||||
? querySystemAccount(api, accountId)
|
||||
|
||||
@@ -211,7 +211,7 @@ function queryCurrent (api: DeriveApi, accountId: AccountId | string, balanceIns
|
||||
* ```
|
||||
*/
|
||||
export function all (instanceId: string, api: DeriveApi): (address: AccountId | string) => Observable<DeriveBalancesAll> {
|
||||
const balanceInstances = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), 'balances');
|
||||
const balanceInstances = api.registry.getModuleInstances(api.runtimeVersion.specName, 'balances');
|
||||
|
||||
return memo(instanceId, (address: AccountId | string): Observable<DeriveBalancesAll> =>
|
||||
combineLatest([
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DeriveCustom } from '@polkadot/api-base/types';
|
||||
import type { AnyFunction } from '@polkadot/types/types';
|
||||
import type { AnyFunction, AnyString } from '@polkadot/types/types';
|
||||
import type { ExactDerive } from './derive';
|
||||
import type { DeriveApi } from './types';
|
||||
|
||||
@@ -84,7 +84,7 @@ const checks: Record<string, Avail> = {
|
||||
}
|
||||
};
|
||||
|
||||
function getModuleInstances (api: DeriveApi, specName: string, moduleName: string): string[] {
|
||||
function getModuleInstances (api: DeriveApi, specName: AnyString, moduleName: string): string[] {
|
||||
return api.registry.getModuleInstances(specName, moduleName) || [];
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ function injectFunctions (instanceId: string, api: DeriveApi, derives: DeriveCus
|
||||
const result: Record<string, Record<string, AnyFunction>> = {};
|
||||
const names = Object.keys(derives);
|
||||
const keys = Object.keys(api.query);
|
||||
const specName = api.runtimeVersion.specName.toString();
|
||||
const specName = api.runtimeVersion.specName;
|
||||
|
||||
const filterKeys = (q: string) => keys.includes(q);
|
||||
const filterInstances = (q: string) => getModuleInstances(api, specName, q).some(filterKeys);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
import { unwrapBlockNumber } from './util';
|
||||
import { createBlockNumberDerive } from './util';
|
||||
|
||||
/**
|
||||
* @name bestNumber
|
||||
@@ -17,7 +17,7 @@ import { unwrapBlockNumber } from './util';
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export const bestNumber = unwrapBlockNumber(
|
||||
export const bestNumber = createBlockNumberDerive(
|
||||
(api: DeriveApi) =>
|
||||
api.derive.chain.subscribeNewHeads()
|
||||
api.rpc.chain.subscribeNewHeads()
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
import { unwrapBlockNumber } from './util';
|
||||
import { createBlockNumberDerive } from './util';
|
||||
|
||||
/**
|
||||
* @name bestNumberFinalized
|
||||
@@ -18,7 +18,7 @@ import { unwrapBlockNumber } from './util';
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export const bestNumberFinalized = unwrapBlockNumber(
|
||||
export const bestNumberFinalized = createBlockNumberDerive(
|
||||
(api: DeriveApi) =>
|
||||
api.rpc.chain.subscribeFinalizedHeads()
|
||||
);
|
||||
|
||||
@@ -5,10 +5,11 @@ import type { Observable } from 'rxjs';
|
||||
import type { SignedBlockExtended } from '../type/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
import { catchError, combineLatest, map, of, switchMap } from 'rxjs';
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { createSignedBlockExtended } from '../type';
|
||||
import { memo } from '../util';
|
||||
import { getAuthorDetails } from './util';
|
||||
|
||||
/**
|
||||
* @name getBlock
|
||||
@@ -23,29 +24,22 @@ import { memo } from '../util';
|
||||
* console.log(`block #${block.header.number} was authored by ${author}`);
|
||||
* ```
|
||||
*/
|
||||
export function getBlock (instanceId: string, api: DeriveApi): (hash: Uint8Array | string) => Observable<SignedBlockExtended | undefined> {
|
||||
return memo(instanceId, (blockHash: Uint8Array | string): Observable<SignedBlockExtended | undefined> =>
|
||||
export function getBlock (instanceId: string, api: DeriveApi): (hash: Uint8Array | string) => Observable<SignedBlockExtended> {
|
||||
return memo(instanceId, (blockHash: Uint8Array | string): Observable<SignedBlockExtended> =>
|
||||
combineLatest([
|
||||
api.rpc.chain.getBlock(blockHash),
|
||||
api.queryAt(blockHash).pipe(
|
||||
switchMap((queryAt) =>
|
||||
combineLatest([
|
||||
queryAt.system.events(),
|
||||
queryAt.session
|
||||
? queryAt.session.validators()
|
||||
: of([])
|
||||
])
|
||||
)
|
||||
)
|
||||
api.queryAt(blockHash)
|
||||
]).pipe(
|
||||
map(([signedBlock, [events, validators]]) =>
|
||||
createSignedBlockExtended(api.registry, signedBlock, events, validators)
|
||||
switchMap(([signedBlock, queryAt]) =>
|
||||
combineLatest([
|
||||
of(signedBlock),
|
||||
queryAt.system.events(),
|
||||
getAuthorDetails(signedBlock.block.header, queryAt)
|
||||
])
|
||||
),
|
||||
catchError((): Observable<undefined> =>
|
||||
// where rpc.chain.getHeader throws, we will land here - it can happen that
|
||||
// we supplied an invalid hash. (Due to defaults, storage will have an
|
||||
// empty value, so only the RPC is affected). So return undefined
|
||||
of()
|
||||
map(([signedBlock, events, [, validators, author]]) =>
|
||||
createSignedBlockExtended(events.registry, signedBlock, events, validators, author)
|
||||
)
|
||||
));
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ import { switchMap } from 'rxjs';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
export function getBlockByNumber (instanceId: string, api: DeriveApi): (blockNumber: AnyNumber) => Observable<SignedBlockExtended | undefined> {
|
||||
return memo(instanceId, (blockNumber: AnyNumber): Observable<SignedBlockExtended | undefined> =>
|
||||
export function getBlockByNumber (instanceId: string, api: DeriveApi): (blockNumber: AnyNumber) => Observable<SignedBlockExtended> {
|
||||
return memo(instanceId, (blockNumber: AnyNumber): Observable<SignedBlockExtended> =>
|
||||
api.rpc.chain.getBlockHash(blockNumber).pipe(
|
||||
switchMap((h) => api.derive.chain.getBlock(h))
|
||||
)
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { HeaderExtended } from '../type/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
import { catchError, combineLatest, map, of, switchMap } from 'rxjs';
|
||||
import { combineLatest, map, switchMap } from 'rxjs';
|
||||
|
||||
import { createHeaderExtended } from '../type';
|
||||
import { memo } from '../util';
|
||||
import { getAuthorDetails } from './util';
|
||||
|
||||
/**
|
||||
* @name getHeader
|
||||
@@ -25,26 +25,18 @@ import { memo } from '../util';
|
||||
* console.log(`block #${number} was authored by ${author}`);
|
||||
* ```
|
||||
*/
|
||||
export function getHeader (instanceId: string, api: DeriveApi): (blockHash: Uint8Array | string) => Observable<HeaderExtended | undefined> {
|
||||
return memo(instanceId, (blockHash: Uint8Array | string): Observable<HeaderExtended | undefined> =>
|
||||
export function getHeader (instanceId: string, api: DeriveApi): (blockHash: Uint8Array | string) => Observable<HeaderExtended> {
|
||||
return memo(instanceId, (blockHash: Uint8Array | string): Observable<HeaderExtended> =>
|
||||
combineLatest([
|
||||
api.rpc.chain.getHeader(blockHash),
|
||||
api.queryAt(blockHash).pipe(
|
||||
switchMap((queryAt) =>
|
||||
queryAt.session
|
||||
? queryAt.session.validators()
|
||||
: of([] as AccountId[])
|
||||
)
|
||||
)
|
||||
api.queryAt(blockHash)
|
||||
]).pipe(
|
||||
map(([header, validators]) =>
|
||||
createHeaderExtended(header.registry, header, validators)
|
||||
switchMap(([header, queryAt]) =>
|
||||
getAuthorDetails(header, queryAt)
|
||||
),
|
||||
catchError((): Observable<undefined> =>
|
||||
// where rpc.chain.getHeader throws, we will land here - it can happen that
|
||||
// we supplied an invalid hash. (Due to defaults, storeage will have an
|
||||
// empty value, so only the RPC is affected). So return undefined
|
||||
of()
|
||||
map(([header, validators, author]) =>
|
||||
createHeaderExtended((validators || header).registry, header, validators, author)
|
||||
)
|
||||
));
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,5 +7,6 @@ export * from './bestNumberLag';
|
||||
export * from './getHeader';
|
||||
export * from './getBlock';
|
||||
export * from './getBlockByNumber';
|
||||
export * from './subscribeFinalizedHeads';
|
||||
export * from './subscribeNewBlocks';
|
||||
export * from './subscribeNewHeads';
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { SignedBlockExtended } from '../type/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
import { switchMap } from 'rxjs';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
/**
|
||||
* @name subscribeFinalizedBlocks
|
||||
* @returns The finalized block & events for that block
|
||||
*/
|
||||
export function subscribeFinalizedBlocks (instanceId: string, api: DeriveApi): () => Observable<SignedBlockExtended> {
|
||||
return memo(instanceId, (): Observable<SignedBlockExtended> =>
|
||||
api.derive.chain.subscribeFinalizedHeads().pipe(
|
||||
switchMap((header) =>
|
||||
api.derive.chain.getBlock(header.createdAtHash || header.hash)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { Hash, Header } from '@polkadot/types/interfaces';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
import { from, of, switchMap } from 'rxjs';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
/**
|
||||
* Returns a header range from startHash to to (not including) endHash, i.e. lastBlock.parentHash === endHash
|
||||
*/
|
||||
export function _getHeaderRange (instanceId: string, api: DeriveApi): (startHash: Hash, endHash: Hash, prev?: Header[]) => Observable<Header[]> {
|
||||
return memo(instanceId, (startHash: Hash, endHash: Hash, prev: Header[] = []): Observable<Header[]> =>
|
||||
api.rpc.chain.getHeader(startHash).pipe(
|
||||
switchMap((header) =>
|
||||
header.parentHash.eq(endHash)
|
||||
? of([header, ...prev])
|
||||
: api.derive.chain._getHeaderRange(header.parentHash, endHash, [header, ...prev])
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @name subscribeFinalizedHeads
|
||||
* @description An observable of the finalized block headers. Unlike the base
|
||||
* chain.subscribeFinalizedHeads this does not skip any headers. Since finalization
|
||||
* may skip specific blocks (finalization happens in terms of chains), this version
|
||||
* of the derive tracks missing headers (since last retrieved) and provides them
|
||||
* to the caller
|
||||
*/
|
||||
export function subscribeFinalizedHeads (instanceId: string, api: DeriveApi): () => Observable<Header> {
|
||||
return memo(instanceId, (): Observable<Header> => {
|
||||
let prevHash: Hash | null = null;
|
||||
|
||||
return api.rpc.chain.subscribeFinalizedHeads().pipe(
|
||||
switchMap((header) => {
|
||||
const endHash = prevHash;
|
||||
const startHash = header.parentHash;
|
||||
|
||||
prevHash = header.createdAtHash = header.hash;
|
||||
|
||||
return endHash === null || startHash.eq(endHash)
|
||||
? of(header)
|
||||
: api.derive.chain._getHeaderRange(startHash, endHash, [header]).pipe(
|
||||
switchMap((headers) =>
|
||||
from(headers)
|
||||
)
|
||||
);
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -5,9 +5,8 @@ import type { Observable } from 'rxjs';
|
||||
import type { SignedBlockExtended } from '../type/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
import { switchMap } from 'rxjs';
|
||||
|
||||
import { createSignedBlockExtended } from '../type';
|
||||
import { memo } from '../util';
|
||||
|
||||
/**
|
||||
@@ -17,22 +16,8 @@ import { memo } from '../util';
|
||||
export function subscribeNewBlocks (instanceId: string, api: DeriveApi): () => Observable<SignedBlockExtended> {
|
||||
return memo(instanceId, (): Observable<SignedBlockExtended> =>
|
||||
api.derive.chain.subscribeNewHeads().pipe(
|
||||
switchMap((header) => {
|
||||
const blockHash = header.createdAtHash || header.hash;
|
||||
|
||||
// we get the block first, setting up the registry
|
||||
return combineLatest([
|
||||
of(header),
|
||||
api.rpc.chain.getBlock(blockHash),
|
||||
api.queryAt(blockHash).pipe(
|
||||
switchMap((queryAt) =>
|
||||
queryAt.system.events()
|
||||
)
|
||||
)
|
||||
]);
|
||||
}),
|
||||
map(([header, block, events]) =>
|
||||
createSignedBlockExtended(block.registry, block, events, header.validators)
|
||||
switchMap((header) =>
|
||||
api.derive.chain.getBlock(header.createdAtHash || header.hash)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -5,10 +5,11 @@ import type { Observable } from 'rxjs';
|
||||
import type { HeaderExtended } from '../type/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
import { combineLatest, map, of } from 'rxjs';
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { createHeaderExtended } from '../type';
|
||||
import { memo } from '../util';
|
||||
import { getAuthorDetails } from './util';
|
||||
|
||||
/**
|
||||
* @name subscribeNewHeads
|
||||
@@ -25,16 +26,20 @@ import { memo } from '../util';
|
||||
*/
|
||||
export function subscribeNewHeads (instanceId: string, api: DeriveApi): () => Observable<HeaderExtended> {
|
||||
return memo(instanceId, (): Observable<HeaderExtended> =>
|
||||
combineLatest([
|
||||
api.rpc.chain.subscribeNewHeads(),
|
||||
api.query.session
|
||||
? api.query.session.validators()
|
||||
: of(undefined)
|
||||
]).pipe(
|
||||
map(([header, validators]): HeaderExtended => {
|
||||
api.rpc.chain.subscribeNewHeads().pipe(
|
||||
switchMap((header) =>
|
||||
combineLatest([
|
||||
of(header),
|
||||
api.queryAt(header.hash)
|
||||
])
|
||||
),
|
||||
switchMap(([header, queryAt]) =>
|
||||
getAuthorDetails(header, queryAt)
|
||||
),
|
||||
map(([header, validators, author]): HeaderExtended => {
|
||||
header.createdAtHash = header.hash;
|
||||
|
||||
return createHeaderExtended(header.registry, header, validators);
|
||||
return createHeaderExtended(header.registry, header, validators, author);
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
@@ -2,21 +2,58 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { Compact } from '@polkadot/types';
|
||||
import type { BlockNumber } from '@polkadot/types/interfaces';
|
||||
import type { QueryableStorage } from '@polkadot/api-base/types';
|
||||
import type { Compact, Vec } from '@polkadot/types';
|
||||
import type { AccountId, BlockNumber, Header } from '@polkadot/types/interfaces';
|
||||
import type { Codec, IOption } from '@polkadot/types/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
import { map } from 'rxjs';
|
||||
import { combineLatest, map, of } from 'rxjs';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { memo, unwrapBlockNumber } from '../util';
|
||||
|
||||
// re-export these - since these needs to be resolvable from api-derive, i.e. without this
|
||||
// we would emit code with ../<somewhere>/src embedded in the *.d.ts files
|
||||
export type { BlockNumber } from '@polkadot/types/interfaces';
|
||||
|
||||
export function unwrapBlockNumber <T extends { number: Compact<BlockNumber> }> (fn: (api: DeriveApi) => Observable<T>): (instanceId: string, api: DeriveApi) => () => Observable<BlockNumber> {
|
||||
export function createBlockNumberDerive <T extends { number: Compact<BlockNumber> | BlockNumber }> (fn: (api: DeriveApi) => Observable<T>): (instanceId: string, api: DeriveApi) => () => Observable<BlockNumber> {
|
||||
return (instanceId: string, api: DeriveApi) =>
|
||||
memo(instanceId, () => fn(api).pipe(
|
||||
map((r) => r.number.unwrap())
|
||||
));
|
||||
memo(instanceId, () =>
|
||||
fn(api).pipe(
|
||||
map(unwrapBlockNumber)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export function getAuthorDetails (header: Header, queryAt: QueryableStorage<'rxjs'>): Observable<[Header, Vec<AccountId> | null, AccountId | null]> {
|
||||
// this is Moonbeam specific
|
||||
if (queryAt.authorMapping && queryAt.authorMapping.mappingWithDeposit) {
|
||||
const mapId = header.digest.logs[0] && (
|
||||
(header.digest.logs[0].isConsensus && header.digest.logs[0].asConsensus[1]) ||
|
||||
(header.digest.logs[0].isPreRuntime && header.digest.logs[0].asPreRuntime[1])
|
||||
);
|
||||
|
||||
if (mapId) {
|
||||
return combineLatest([
|
||||
of(header),
|
||||
queryAt.session
|
||||
? queryAt.session.validators()
|
||||
: of(null),
|
||||
queryAt.authorMapping.mappingWithDeposit<IOption<{ account: AccountId } & Codec>>(mapId).pipe(
|
||||
map((opt) =>
|
||||
opt.unwrapOr({ account: null }).account
|
||||
)
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// normal operation, non-mapping
|
||||
return combineLatest([
|
||||
of(header),
|
||||
queryAt.session
|
||||
? queryAt.session.validators()
|
||||
: of(null),
|
||||
of(null)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { isFunction } from '@polkadot/util';
|
||||
import { memo } from '../util';
|
||||
|
||||
export function getInstance (api: DeriveApi, section: string): DeriveApi['query']['council'] {
|
||||
const instances = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), section);
|
||||
const instances = api.registry.getModuleInstances(api.runtimeVersion.specName, section);
|
||||
const name = instances && instances.length
|
||||
? instances[0]
|
||||
: section;
|
||||
|
||||
@@ -55,7 +55,7 @@ function getConstants (api: DeriveApi, elections: string | null): Partial<Derive
|
||||
}
|
||||
|
||||
function getModules (api: DeriveApi): [string, string | null] {
|
||||
const [council] = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), 'council') || ['council'];
|
||||
const [council] = api.registry.getModuleInstances(api.runtimeVersion.specName, 'council') || ['council'];
|
||||
const elections = api.query.phragmenElection
|
||||
? 'phragmenElection'
|
||||
: api.query.electionsPhragmen
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -10,6 +10,7 @@ import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { isNumber, isUndefined } from '@polkadot/util';
|
||||
|
||||
import { unwrapBlockNumber } from '../util';
|
||||
import { FALLBACK_MAX_HASH_COUNT, FALLBACK_PERIOD, MAX_FINALITY_LAG, MORTAL_PERIOD } from './constants';
|
||||
|
||||
interface Result {
|
||||
@@ -51,7 +52,7 @@ function signingHeader (api: DeriveApi): Observable<Header> {
|
||||
]).pipe(
|
||||
map(([current, finalized]) =>
|
||||
// determine the hash to use, current when lag > max, else finalized
|
||||
current.number.unwrap().sub(finalized.number.unwrap()).gt(MAX_FINALITY_LAG)
|
||||
unwrapBlockNumber(current).sub(unwrapBlockNumber(finalized)).gt(MAX_FINALITY_LAG)
|
||||
? current
|
||||
: finalized
|
||||
)
|
||||
|
||||
@@ -7,19 +7,17 @@ import type { HeaderExtended } from './types';
|
||||
|
||||
import { extractAuthor } from './util';
|
||||
|
||||
export function createHeaderExtended (registry: Registry, header?: Header, validators?: AccountId[]): HeaderExtended {
|
||||
export function createHeaderExtended (registry: Registry, header?: Header, validators?: AccountId[] | null, author?: AccountId | null): HeaderExtended {
|
||||
// an instance of the base extrinsic for us to extend
|
||||
const HeaderBase = registry.createClass('Header');
|
||||
|
||||
class Implementation extends HeaderBase implements HeaderExtended {
|
||||
readonly #author?: AccountId;
|
||||
readonly #validators?: AccountId[];
|
||||
|
||||
constructor (registry: Registry, header?: Header, validators?: AccountId[]) {
|
||||
constructor (registry: Registry, header?: Header, validators?: AccountId[] | null, author?: AccountId | null) {
|
||||
super(registry, header);
|
||||
|
||||
this.#author = extractAuthor(this.digest, validators);
|
||||
this.#validators = validators;
|
||||
this.#author = author || extractAuthor(this.digest, validators || []);
|
||||
this.createdAtHash = header?.createdAtHash;
|
||||
}
|
||||
|
||||
@@ -29,14 +27,7 @@ export function createHeaderExtended (registry: Registry, header?: Header, valid
|
||||
public get author (): AccountId | undefined {
|
||||
return this.#author;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Convenience method, returns the validators for the block
|
||||
*/
|
||||
public get validators (): AccountId[] | undefined {
|
||||
return this.#validators;
|
||||
}
|
||||
}
|
||||
|
||||
return new Implementation(registry, header, validators);
|
||||
return new Implementation(registry, header, validators, author);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ function mapExtrinsics (extrinsics: Extrinsic[], records: EventRecord[]): TxWith
|
||||
});
|
||||
}
|
||||
|
||||
export function createSignedBlockExtended (registry: Registry, block?: SignedBlock, events?: EventRecord[], validators?: AccountId[]): SignedBlockExtended {
|
||||
export function createSignedBlockExtended (registry: Registry, block?: SignedBlock, events?: EventRecord[], validators?: AccountId[] | null, author?: AccountId | null): SignedBlockExtended {
|
||||
// an instance of the base extrinsic for us to extend
|
||||
const SignedBlockBase = registry.createClass('SignedBlock');
|
||||
|
||||
@@ -40,10 +40,10 @@ export function createSignedBlockExtended (registry: Registry, block?: SignedBlo
|
||||
readonly #events: EventRecord[];
|
||||
readonly #extrinsics: TxWithEvent[];
|
||||
|
||||
constructor (registry: Registry, block?: SignedBlock, events?: EventRecord[], validators?: AccountId[]) {
|
||||
constructor (registry: Registry, block?: SignedBlock, events?: EventRecord[], validators?: AccountId[] | null, author?: AccountId | null) {
|
||||
super(registry, block);
|
||||
|
||||
this.#author = extractAuthor(this.block.header.digest, validators);
|
||||
this.#author = author || extractAuthor(this.block.header.digest, validators || []);
|
||||
this.#events = events || ([] as EventRecord[]);
|
||||
this.#extrinsics = mapExtrinsics(this.block.extrinsics, this.#events);
|
||||
this.createdAtHash = block?.createdAtHash;
|
||||
@@ -71,5 +71,5 @@ export function createSignedBlockExtended (registry: Registry, block?: SignedBlo
|
||||
}
|
||||
}
|
||||
|
||||
return new Implementation(registry, block, events, validators);
|
||||
return new Implementation(registry, block, events, validators, author);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import type { AccountId, DispatchError, DispatchInfo, Event, EventRecord, Extrin
|
||||
|
||||
export interface HeaderExtended extends Header {
|
||||
readonly author: AccountId | undefined;
|
||||
readonly validators: AccountId[] | undefined;
|
||||
}
|
||||
|
||||
export interface SignedBlockExtended extends SignedBlock {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Compact } from '@polkadot/types';
|
||||
import type { BlockNumber } from '@polkadot/types/interfaces';
|
||||
|
||||
import { isCompact } from '@polkadot/util';
|
||||
|
||||
type CompatHeader = { number: Compact<BlockNumber> | BlockNumber };
|
||||
|
||||
export function unwrapBlockNumber (hdr: CompatHeader): BlockNumber {
|
||||
return isCompact<BlockNumber>(hdr.number)
|
||||
? hdr.number.unwrap()
|
||||
: hdr.number;
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
export { drr, memo } from '@polkadot/rpc-core';
|
||||
|
||||
export * from './approvalFlagsToBools';
|
||||
export * from './blockNumber';
|
||||
export * from './cache';
|
||||
export * from './cacheImpl';
|
||||
export * from './first';
|
||||
|
||||
+19
-19
@@ -20,29 +20,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api-augment": "8.12.1",
|
||||
"@polkadot/api-base": "8.12.1",
|
||||
"@polkadot/api-derive": "8.12.1",
|
||||
"@polkadot/keyring": "^10.0.1",
|
||||
"@polkadot/rpc-augment": "8.12.1",
|
||||
"@polkadot/rpc-core": "8.12.1",
|
||||
"@polkadot/rpc-provider": "8.12.1",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/types-augment": "8.12.1",
|
||||
"@polkadot/types-codec": "8.12.1",
|
||||
"@polkadot/types-create": "8.12.1",
|
||||
"@polkadot/types-known": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1",
|
||||
"@polkadot/util-crypto": "^10.0.1",
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/api-augment": "8.14.1",
|
||||
"@polkadot/api-base": "8.14.1",
|
||||
"@polkadot/api-derive": "8.14.1",
|
||||
"@polkadot/keyring": "^10.1.1",
|
||||
"@polkadot/rpc-augment": "8.14.1",
|
||||
"@polkadot/rpc-core": "8.14.1",
|
||||
"@polkadot/rpc-provider": "8.14.1",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/types-augment": "8.14.1",
|
||||
"@polkadot/types-codec": "8.14.1",
|
||||
"@polkadot/types-create": "8.14.1",
|
||||
"@polkadot/types-known": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1",
|
||||
"@polkadot/util-crypto": "^10.1.1",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^7.5.5"
|
||||
"rxjs": "^7.5.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "8.12.1",
|
||||
"@polkadot/types-support": "8.12.1"
|
||||
"@polkadot/api-augment": "8.14.1",
|
||||
"@polkadot/types-support": "8.14.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import { memo, RpcCore } from '@polkadot/rpc-core';
|
||||
import { WsProvider } from '@polkadot/rpc-provider';
|
||||
import { expandMetadata, Metadata, typeDefinitions, TypeRegistry, unwrapStorageType } from '@polkadot/types';
|
||||
import { getSpecRuntime } from '@polkadot/types-known';
|
||||
import { arrayChunk, arrayFlatten, assert, assertReturn, BN, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, stringCamelCase, stringUpperFirst, u8aConcatStrict, u8aToHex } from '@polkadot/util';
|
||||
import { arrayChunk, arrayFlatten, assertReturn, BN, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, stringCamelCase, stringUpperFirst, u8aConcatStrict, u8aToHex } from '@polkadot/util';
|
||||
import { blake2AsHex } from '@polkadot/util-crypto';
|
||||
|
||||
import { createSubmittable } from '../submittable';
|
||||
@@ -626,7 +626,9 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
const lazySection = (section: string) =>
|
||||
lazyMethods({}, Object.keys(tx[section]), (method: string) =>
|
||||
this._decorateExtrinsicEntry(tx[section][method], result)
|
||||
method.startsWith('$')
|
||||
? tx[section][method]
|
||||
: this._decorateExtrinsicEntry(tx[section][method], result)
|
||||
);
|
||||
|
||||
const sections = Object.keys(tx);
|
||||
@@ -918,7 +920,9 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
}
|
||||
|
||||
private _retrieveMapKeys ({ iterKey, meta, method, section }: StorageEntry, at: Hash | Uint8Array | string | null, args: unknown[]): Observable<StorageKey[]> {
|
||||
assert(iterKey && meta.type.isMap, 'keys can only be retrieved on maps');
|
||||
if (!iterKey || !meta.type.isMap) {
|
||||
throw new Error('keys can only be retrieved on maps');
|
||||
}
|
||||
|
||||
const headKey = iterKey(...args).toHex();
|
||||
const startSubject = new BehaviorSubject<string>(headKey);
|
||||
@@ -945,7 +949,9 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
}
|
||||
|
||||
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');
|
||||
if (!iterKey || !meta.type.isMap) {
|
||||
throw new Error('keys can only be retrieved on maps');
|
||||
}
|
||||
|
||||
const setMeta = (key: StorageKey) => key.setMeta(meta, section, method);
|
||||
const query = at
|
||||
|
||||
@@ -15,7 +15,7 @@ import { firstValueFrom, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { Metadata, TypeRegistry } from '@polkadot/types';
|
||||
import { getSpecAlias, getSpecExtensions, getSpecHasher, getSpecRpc, getSpecTypes, getUpgradeVersion } from '@polkadot/types-known';
|
||||
import { assert, assertReturn, BN_ZERO, isUndefined, logger, objectSpread, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { assertReturn, BN_ZERO, isUndefined, logger, objectSpread, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { cryptoWaitReady } from '@polkadot/util-crypto';
|
||||
|
||||
import { Decorate } from './Decorate';
|
||||
@@ -29,8 +29,7 @@ function textToString (t: Text): string {
|
||||
}
|
||||
|
||||
export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
// Browser/Deno = number, Node = Timeout
|
||||
#healthTimer: unknown | null = null;
|
||||
#healthTimer: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
#registries: VersionedRegistry<ApiType>[] = [];
|
||||
|
||||
@@ -180,7 +179,9 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
|
||||
private async _getBlockRegistryViaHash (blockHash: Uint8Array): Promise<VersionedRegistry<ApiType>> {
|
||||
// ensure we have everything required
|
||||
assert(this._genesisHash && this._runtimeVersion, 'Cannot retrieve data on an uninitialized chain');
|
||||
if (!this._genesisHash || !this._runtimeVersion) {
|
||||
throw new Error('Cannot retrieve data on an uninitialized chain');
|
||||
}
|
||||
|
||||
// We have to assume that on the RPC layer the calls used here does not call back into
|
||||
// the registry swap, so getHeader & getRuntimeVersion should not be historic
|
||||
@@ -190,7 +191,9 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
: await firstValueFrom(this._rpcCore.chain.getHeader.raw(blockHash))
|
||||
);
|
||||
|
||||
assert(!header.parentHash.isEmpty, 'Unable to retrieve header and parent from supplied hash');
|
||||
if (header.parentHash.isEmpty) {
|
||||
throw new Error('Unable to retrieve header and parent from supplied hash');
|
||||
}
|
||||
|
||||
// get the runtime version, either on-chain or via an known upgrade history
|
||||
const [firstVersion, lastVersion] = getUpgradeVersion(this._genesisHash, header.number);
|
||||
@@ -370,8 +373,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
|
||||
private _unsubscribeHealth (): void {
|
||||
if (this.#healthTimer) {
|
||||
// different method signatures for Node vs Browser/Deno
|
||||
clearInterval(this.#healthTimer as number);
|
||||
clearInterval(this.#healthTimer);
|
||||
this.#healthTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { SignerPayloadRawBase } from '@polkadot/types/types';
|
||||
import type { ApiOptions, ApiTypes, DecorateMethod, Signer } from '../types';
|
||||
|
||||
import { assert, isString, objectSpread, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { isString, objectSpread, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { Getters } from './Getters';
|
||||
|
||||
@@ -69,7 +69,9 @@ export abstract class ApiBase<ApiType extends ApiTypes> extends Getters<ApiType>
|
||||
if (isString(address)) {
|
||||
const _signer = signer || this._rx.signer;
|
||||
|
||||
assert(_signer?.signRaw, 'No signer exists with a signRaw interface. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.');
|
||||
if (!_signer || !_signer.signRaw) {
|
||||
throw new Error('No signer exists with a signRaw interface. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.');
|
||||
}
|
||||
|
||||
return (
|
||||
await _signer.signRaw(
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { DecorateFn, DecorateMethodOptions, ObsInnerType, StorageEntryPromi
|
||||
|
||||
import { catchError, EMPTY, Subscription, tap } from 'rxjs';
|
||||
|
||||
import { assert, isFunction, nextTick } from '@polkadot/util';
|
||||
import { isFunction, nextTick } from '@polkadot/util';
|
||||
|
||||
interface Tracker<T> {
|
||||
reject: (value: Error) => Observable<never>;
|
||||
@@ -57,7 +57,9 @@ function extractArgs (args: unknown[], needsCallback: boolean): [unknown[], Call
|
||||
: undefined;
|
||||
|
||||
// When we need a subscription, ensure that a valid callback is actually passed
|
||||
assert(!needsCallback || isFunction(callback), 'Expected a callback to be passed with subscriptions');
|
||||
if (needsCallback && !isFunction(callback)) {
|
||||
throw new Error('Expected a callback to be passed with subscriptions');
|
||||
}
|
||||
|
||||
return [actualArgs, callback];
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { MockProvider } from '@polkadot/rpc-provider/mock';
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { hexToU8a } from '@polkadot/util';
|
||||
|
||||
import { SingleAccountSigner } from '../test/util';
|
||||
import { SingleAccountSigner } from '../test';
|
||||
import { ApiPromise } from '.';
|
||||
|
||||
const TRANSFER_SIG = '0xcc277eb341d3801c08f149508221583fa3185cc3944e6cb376cd061640305edd7dc24dfd754adb24768f1d8547389b7720e6f626bc81f5593fba1141e7f7ba07';
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, Submittable
|
||||
|
||||
import { catchError, first, map, mapTo, mergeMap, of, switchMap, tap } from 'rxjs';
|
||||
|
||||
import { assert, isBn, isFunction, isNumber, isString, isU8a, isUndefined, objectSpread } from '@polkadot/util';
|
||||
import { isBn, isFunction, isNumber, isString, isU8a, objectSpread } from '@polkadot/util';
|
||||
|
||||
import { ApiBase } from '../base';
|
||||
import { filterEvents, isKeyringPair } from '../util';
|
||||
@@ -34,7 +34,9 @@ const identity = <T> (input: T): T => input;
|
||||
|
||||
function makeEraOptions (api: ApiInterfaceRx, registry: Registry, partialOptions: Partial<SignerOptions>, { header, mortalLength, nonce }: { header: Header | null; mortalLength: number; nonce: Index }): SignatureOptions {
|
||||
if (!header) {
|
||||
assert(partialOptions.era === 0 || !isUndefined(partialOptions.blockHash), 'Expected blockHash to be passed alongside non-immortal era options');
|
||||
if (partialOptions.era && !partialOptions.blockHash) {
|
||||
throw new Error('Expected blockHash to be passed alongside non-immortal era options');
|
||||
}
|
||||
|
||||
if (isNumber(partialOptions.era)) {
|
||||
// since we have no header, it is immortal, remove any option overrides
|
||||
@@ -299,7 +301,9 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas
|
||||
#signViaSigner = async (address: Address | string | Uint8Array, options: SignatureOptions, header: Header | null): Promise<number> => {
|
||||
const signer = options.signer || api.signer;
|
||||
|
||||
assert(signer, 'No signer specified, either via api.setSigner or via sign options. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.');
|
||||
if (!signer) {
|
||||
throw new Error('No signer specified, either via api.setSigner or via sign options. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.');
|
||||
}
|
||||
|
||||
const payload = this.registry.createTypeUnsafe<SignerPayload>('SignerPayload', [objectSpread({}, options, {
|
||||
address,
|
||||
|
||||
+7
-3
@@ -5,7 +5,7 @@ import type { Signer, SignerResult } from '@polkadot/api/types';
|
||||
import type { KeyringPair } from '@polkadot/keyring/types';
|
||||
import type { Registry, SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
|
||||
|
||||
import { assert, hexToU8a, u8aToHex } from '@polkadot/util';
|
||||
import { hexToU8a, u8aToHex } from '@polkadot/util';
|
||||
|
||||
let id = 0;
|
||||
|
||||
@@ -23,7 +23,9 @@ export class SingleAccountSigner implements Signer {
|
||||
}
|
||||
|
||||
public async signPayload (payload: SignerPayloadJSON): Promise<SignerResult> {
|
||||
assert(payload.address === this.#keyringPair.address, 'Signer does not have the keyringPair');
|
||||
if (payload.address !== this.#keyringPair.address) {
|
||||
throw new Error('Signer does not have the keyringPair');
|
||||
}
|
||||
|
||||
return new Promise((resolve): void => {
|
||||
setTimeout((): void => {
|
||||
@@ -38,7 +40,9 @@ export class SingleAccountSigner implements Signer {
|
||||
}
|
||||
|
||||
public async signRaw ({ address, data }: SignerPayloadRaw): Promise<SignerResult> {
|
||||
assert(address === this.#keyringPair.address, 'Signer does not have the keyringPair');
|
||||
if (address !== this.#keyringPair.address) {
|
||||
throw new Error('Signer does not have the keyringPair');
|
||||
}
|
||||
|
||||
return new Promise((resolve): void => {
|
||||
setTimeout((): void => {
|
||||
@@ -1,72 +0,0 @@
|
||||
// Copyright 2017-2022 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { jest } from '@jest/globals';
|
||||
|
||||
import { ApiPromise, WsProvider } from '@polkadot/api';
|
||||
|
||||
describe.skip('misc online tests', (): void => {
|
||||
let api: ApiPromise;
|
||||
|
||||
beforeEach(async () => {
|
||||
jest.setTimeout(30000);
|
||||
process.env.NODE_ENV = 'test';
|
||||
|
||||
// const provider = new WsProvider('wss://kusama-rpc.polkadot.io');
|
||||
const provider = new WsProvider('wss://westend-rpc.polkadot.io/');
|
||||
|
||||
api = await ApiPromise.create({ provider });
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await api.disconnect();
|
||||
});
|
||||
|
||||
it('expose rpc and rx definition', (): void => {
|
||||
console.error(api.rpc.payment.queryFeeDetails.meta);
|
||||
console.error(api.rx.rpc.chain.getBlock.meta);
|
||||
});
|
||||
|
||||
it.skip('retrieves balances correctly', async (): Promise<void> => {
|
||||
console.error(JSON.stringify(
|
||||
await api.query.system.account('FPzukZw2mphWsXDqdkNzLaxnanjZEWH9i2vqwobTdtde5me')
|
||||
));
|
||||
console.error(JSON.stringify(
|
||||
await api.query.system.account('HUewJvzVuEeyaxH2vx9XiyAPKrpu1Zj5r5Pi9VrGiBVty7q')
|
||||
));
|
||||
});
|
||||
|
||||
it.skip('handles map keys', async (): Promise<void> => {
|
||||
console.time('map.keys');
|
||||
|
||||
const keys = await api.query.system.account.keys();
|
||||
|
||||
console.error('# keys', keys.length);
|
||||
|
||||
console.timeEnd('map.keys');
|
||||
});
|
||||
|
||||
it.skip('handles map entries', async (): Promise<void> => {
|
||||
console.time('map.entries');
|
||||
|
||||
const entries = await api.query.system.account.entries(); // api.query.indices.accounts.entries();
|
||||
|
||||
console.error('# entries', entries.length);
|
||||
|
||||
console.timeEnd('map.entries');
|
||||
});
|
||||
|
||||
it.skip('handles doublemap entries', async (): Promise<void> => {
|
||||
const activeEra = await api.query.staking.activeEra();
|
||||
|
||||
console.error(JSON.stringify(
|
||||
await api.query.staking.erasStakers.entries(activeEra.unwrapOrDefault().index)
|
||||
));
|
||||
});
|
||||
|
||||
it.skip('does something in society', async (): Promise<void> => {
|
||||
console.error(JSON.stringify(
|
||||
await api.query.society.defenderVotes('Dab4bfYTZRUDMWjYAUQuFbDreQ9mt7nULWu3Dw7jodbzVe9')
|
||||
));
|
||||
});
|
||||
});
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { EventRecord } from '@polkadot/types/interfaces';
|
||||
|
||||
import { SubmittableResult } from '../..';
|
||||
import { SubmittableResult } from '..';
|
||||
|
||||
// log all events for the transfers, calling done() when finalized
|
||||
export const logEvents = (done: () => Record<string, unknown>): (r: SubmittableResult) => void =>
|
||||
@@ -1,237 +0,0 @@
|
||||
// Copyright 2017-2022 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||
import type { Enum, Struct } from '@polkadot/types';
|
||||
import type { Option } from '@polkadot/types/codec';
|
||||
import type { AccountId, AccountIndex, AccountInfo, Address, Balance, BlockNumber, Index } from '@polkadot/types/interfaces';
|
||||
|
||||
import { jest } from '@jest/globals';
|
||||
import { combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { ApiPromise, WsProvider } from '@polkadot/api';
|
||||
import { memo } from '@polkadot/rpc-core';
|
||||
|
||||
interface VestingInfo extends Struct {
|
||||
readonly locked: Balance;
|
||||
readonly perBlock: Balance;
|
||||
readonly startingBlock: BlockNumber;
|
||||
}
|
||||
|
||||
interface SignedBalance extends Enum {
|
||||
readonly isPositive: boolean;
|
||||
readonly asPositive: Balance;
|
||||
readonly isNegative: boolean;
|
||||
readonly asNegative: Balance;
|
||||
}
|
||||
|
||||
export interface EQDeriveBalancesAll {
|
||||
freeBalance: Balance;
|
||||
reservedBalance: Balance;
|
||||
vestingLocked: Balance;
|
||||
lockedBalance: Balance;
|
||||
accountId: AccountId;
|
||||
accountNonce: Index;
|
||||
lockedBreakdown: unknown[];
|
||||
}
|
||||
|
||||
type Result = [Balance, Balance, Balance, Index];
|
||||
|
||||
type RawResult = [
|
||||
SignedBalance,
|
||||
Option<Balance>,
|
||||
Option<VestingInfo>,
|
||||
AccountInfo
|
||||
];
|
||||
|
||||
type EQDeriveBalancesQuery = (address: AccountIndex | AccountId | Address | string) => Observable<EQDeriveBalancesAll>;
|
||||
|
||||
const typesBundle = {
|
||||
spec: {
|
||||
Equilibrium: {
|
||||
derives: {
|
||||
balances: {
|
||||
all: (
|
||||
instanceId: string,
|
||||
api: ApiInterfaceRx
|
||||
): EQDeriveBalancesQuery =>
|
||||
memo(
|
||||
instanceId,
|
||||
(address: AccountIndex | AccountId | Address | string) =>
|
||||
api.derive.accounts.accountId(address).pipe(
|
||||
switchMap(
|
||||
(accountId): Observable<[AccountId, Result]> =>
|
||||
accountId
|
||||
? combineLatest([
|
||||
of(accountId),
|
||||
api
|
||||
.queryMulti([
|
||||
[api.query.balances.account, [accountId, 'EQ']],
|
||||
[api.query.eqVesting.vested, accountId],
|
||||
[api.query.eqVesting.vesting, accountId],
|
||||
[api.query.system.account, accountId]
|
||||
])
|
||||
.pipe(
|
||||
map(
|
||||
(raw): Result => {
|
||||
if (raw.length < 4) {
|
||||
throw new Error('4 members expected');
|
||||
}
|
||||
|
||||
const res = raw as RawResult;
|
||||
const freeBalance = res[0].asPositive;
|
||||
|
||||
let reservedBalance = api.registry.createType(
|
||||
'Balance'
|
||||
);
|
||||
|
||||
let vestingLocked = api.registry.createType(
|
||||
'Balance'
|
||||
);
|
||||
|
||||
if (res[1].isSome && res[2].isSome) {
|
||||
const vested = res[1].unwrap();
|
||||
const info = res[2].unwrap();
|
||||
|
||||
vestingLocked = info.locked;
|
||||
|
||||
reservedBalance = api.registry.createType(
|
||||
'Balance',
|
||||
vestingLocked.sub(vested)
|
||||
);
|
||||
}
|
||||
|
||||
return [
|
||||
freeBalance,
|
||||
reservedBalance,
|
||||
vestingLocked,
|
||||
res[3].nonce
|
||||
];
|
||||
}
|
||||
)
|
||||
)
|
||||
])
|
||||
: of([
|
||||
api.registry.createType('AccountId'),
|
||||
[
|
||||
api.registry.createType('Balance'),
|
||||
api.registry.createType('Balance'),
|
||||
api.registry.createType('Balance'),
|
||||
api.registry.createType('Index')
|
||||
]
|
||||
])
|
||||
),
|
||||
map(
|
||||
([
|
||||
accountId,
|
||||
[
|
||||
freeBalance,
|
||||
reservedBalance,
|
||||
vestingLocked,
|
||||
accountNonce
|
||||
]
|
||||
]): EQDeriveBalancesAll => ({
|
||||
accountId,
|
||||
accountNonce,
|
||||
freeBalance,
|
||||
lockedBalance: vestingLocked,
|
||||
lockedBreakdown: [],
|
||||
reservedBalance,
|
||||
vestingLocked
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
types: [
|
||||
{
|
||||
minmax: [0, undefined],
|
||||
types: {
|
||||
Balance: 'u64',
|
||||
BalanceOf: 'Balance',
|
||||
BalancesAggregate: {
|
||||
total_debt: 'Balance',
|
||||
total_issuance: 'Balance'
|
||||
},
|
||||
BlockNumber: 'u64',
|
||||
Currency: {
|
||||
_enum: ['Unknown', 'Usd', 'EQ', 'Eth', 'Btc', 'Eos', 'Dot']
|
||||
},
|
||||
DataPoint: {
|
||||
account_id: 'AccountId',
|
||||
block_number: 'BlockNumber',
|
||||
price: 'u64',
|
||||
timestamp: 'u64'
|
||||
},
|
||||
FixedI64: 'i64',
|
||||
Keys: 'SessionKeys3',
|
||||
LookupSource: 'AccountId',
|
||||
PricePeriod: {
|
||||
_enum: ['Min', 'TenMin', 'Hour', 'FourHour', 'Day']
|
||||
},
|
||||
PricePoint: {
|
||||
block_number: 'BlockNumber',
|
||||
data_points: 'Vec<DataPoint>',
|
||||
price: 'u64',
|
||||
timestamp: 'u64'
|
||||
},
|
||||
ReinitRequest: {
|
||||
account: 'AccountId',
|
||||
authority_index: 'AuthIndex',
|
||||
block_num: 'BlockNumber',
|
||||
validators_len: 'u32'
|
||||
},
|
||||
SignedBalance: {
|
||||
_enum: {
|
||||
Negative: 'Balance',
|
||||
Positive: 'Balance'
|
||||
}
|
||||
},
|
||||
TotalAggregates: {
|
||||
collateral: 'Balance',
|
||||
debt: 'Balance'
|
||||
},
|
||||
TransferReason: {
|
||||
_enum: [
|
||||
'Common',
|
||||
'InterestFee',
|
||||
'MarginCall',
|
||||
'BailsmenRedistribution',
|
||||
'TreasuryEqBuyout',
|
||||
'TreasuryBuyEq'
|
||||
]
|
||||
},
|
||||
UserGroup: {
|
||||
_enum: ['Unknown', 'Balances', 'Bailsman']
|
||||
},
|
||||
VestingInfo: {
|
||||
locked: 'Balance',
|
||||
perBlock: 'Balance',
|
||||
startingBlock: 'BlockNumber'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function createApi (): Promise<ApiPromise> {
|
||||
jest.setTimeout(30000);
|
||||
const provider = new WsProvider('wss://tge.equilibrium.io');
|
||||
|
||||
return new ApiPromise({ provider, typesBundle }).isReady;
|
||||
}
|
||||
|
||||
describe.skip('equilibrium api', () => {
|
||||
it.skip('does not fail on derive.balances.all', async () => {
|
||||
const api = await createApi();
|
||||
|
||||
await api.derive.balances.all(
|
||||
'5DnoYz3koaRcMZ9Hj4FmQ2nNRKQfS73yBmEzzM9SsPn9cLtb'
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -5,7 +5,7 @@ import type { SiLookupTypeId } from '@polkadot/types/interfaces';
|
||||
import type { StorageEntry } from '@polkadot/types/primitive/types';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { assert, isUndefined } from '@polkadot/util';
|
||||
import { isUndefined } from '@polkadot/util';
|
||||
|
||||
function sig ({ lookup }: Registry, { method, section }: StorageEntry, args: SiLookupTypeId[]): string {
|
||||
return `${section}.${method}(${args.map((a) => lookup.getTypeDef(a).type).join(', ')})`;
|
||||
@@ -17,14 +17,18 @@ export function extractStorageArgs (registry: Registry, creator: StorageEntry, _
|
||||
const args = _args.filter((a) => !isUndefined(a));
|
||||
|
||||
if (creator.meta.type.isPlain) {
|
||||
assert(args.length === 0, () => `${sig(registry, creator, [])} does not take any arguments, ${args.length} found`);
|
||||
if (args.length !== 0) {
|
||||
throw new Error(`${sig(registry, creator, [])} does not take any arguments, ${args.length} found`);
|
||||
}
|
||||
} else {
|
||||
const { hashers, key } = creator.meta.type.asMap;
|
||||
const keys = hashers.length === 1
|
||||
? [key]
|
||||
: registry.lookup.getSiType(key).def.asTuple.map((t) => t);
|
||||
|
||||
assert(args.length === keys.length, () => `${sig(registry, creator, keys)} is a map, requiring ${keys.length} arguments, ${args.length} found`);
|
||||
if (args.length !== keys.length) {
|
||||
throw new Error(`${sig(registry, creator, keys)} is a map, requiring ${keys.length} arguments, ${args.length} found`);
|
||||
}
|
||||
}
|
||||
|
||||
// pass as tuple
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/rpc-core": "8.12.1",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/types-codec": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1"
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/rpc-core": "8.14.1",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/types-codec": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/rpc-augment": "8.12.1",
|
||||
"@polkadot/rpc-provider": "8.12.1",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1",
|
||||
"rxjs": "^7.5.5"
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/rpc-augment": "8.14.1",
|
||||
"@polkadot/rpc-provider": "8.14.1",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1",
|
||||
"rxjs": "^7.5.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^10.0.1",
|
||||
"@polkadot/rpc-augment": "8.12.1"
|
||||
"@polkadot/keyring": "^10.1.1",
|
||||
"@polkadot/rpc-augment": "8.14.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -20,21 +20,21 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/keyring": "^10.0.1",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/types-support": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1",
|
||||
"@polkadot/util-crypto": "^10.0.1",
|
||||
"@polkadot/x-fetch": "^10.0.1",
|
||||
"@polkadot/x-global": "^10.0.1",
|
||||
"@polkadot/x-ws": "^10.0.1",
|
||||
"@substrate/connect": "0.7.7",
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/keyring": "^10.1.1",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/types-support": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1",
|
||||
"@polkadot/util-crypto": "^10.1.1",
|
||||
"@polkadot/x-fetch": "^10.1.1",
|
||||
"@polkadot/x-global": "^10.1.1",
|
||||
"@polkadot/x-ws": "^10.1.1",
|
||||
"@substrate/connect": "0.7.9",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"mock-socket": "^9.1.5",
|
||||
"nock": "^13.2.8"
|
||||
"nock": "^13.2.9"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,4 @@
|
||||
export { HttpProvider } from './http';
|
||||
export { packageInfo } from './packageInfo';
|
||||
export { WsProvider } from './ws';
|
||||
|
||||
// ESM-only, only export top-level when we have dual versions
|
||||
// export { ScProvider } from './substrate-connect';
|
||||
export { ScProvider } from './substrate-connect';
|
||||
|
||||
@@ -13,8 +13,8 @@ import EventEmitter from 'eventemitter3';
|
||||
import { createTestKeyring } from '@polkadot/keyring/testing';
|
||||
import { decorateStorage, Metadata } from '@polkadot/types';
|
||||
import jsonrpc from '@polkadot/types/interfaces/jsonrpc';
|
||||
import rpcHeader from '@polkadot/types-support/json/Header.004.json';
|
||||
import rpcSignedBlock from '@polkadot/types-support/json/SignedBlock.004.immortal.json';
|
||||
import rpcHeader from '@polkadot/types-support/json/Header.004.json' assert { type: 'json' };
|
||||
import rpcSignedBlock from '@polkadot/types-support/json/SignedBlock.004.immortal.json' assert { type: 'json' };
|
||||
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
|
||||
import { BN, bnToU8a, logger, u8aToHex } from '@polkadot/util';
|
||||
import { randomAsU8a } from '@polkadot/util-crypto';
|
||||
@@ -44,8 +44,7 @@ export class MockProvider implements ProviderInterface {
|
||||
|
||||
private emitter = new EventEmitter();
|
||||
|
||||
// Browser/Deno = number, Node = Timeout
|
||||
private intervalId?: unknown | null;
|
||||
private intervalId?: ReturnType<typeof setInterval> | null;
|
||||
|
||||
public isUpdating = true;
|
||||
|
||||
@@ -110,8 +109,7 @@ export class MockProvider implements ProviderInterface {
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
public async disconnect (): Promise<void> {
|
||||
if (this.intervalId) {
|
||||
// different method signatures for Node vs Browser/Deno
|
||||
clearInterval(this.intervalId as number);
|
||||
clearInterval(this.intervalId);
|
||||
this.intervalId = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -106,8 +106,7 @@ export class WsProvider implements ProviderInterface {
|
||||
|
||||
#subscriptions: Record<string, WsStateSubscription> = {};
|
||||
|
||||
// Browser/Deno = number, Node = Timeout
|
||||
#timeoutId?: unknown | null = null;
|
||||
#timeoutId?: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
#websocket: WebSocket | null;
|
||||
|
||||
@@ -431,8 +430,7 @@ export class WsProvider implements ProviderInterface {
|
||||
}
|
||||
|
||||
if (this.#timeoutId) {
|
||||
// different method signatures for Node vs Browser/Deno
|
||||
clearInterval(this.#timeoutId as number);
|
||||
clearInterval(this.#timeoutId);
|
||||
this.#timeoutId = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
@@ -30,21 +30,21 @@
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.18.6",
|
||||
"@babel/register": "^7.18.6",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api": "8.12.1",
|
||||
"@polkadot/api-augment": "8.12.1",
|
||||
"@polkadot/rpc-augment": "8.12.1",
|
||||
"@polkadot/rpc-provider": "8.12.1",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/types-augment": "8.12.1",
|
||||
"@polkadot/types-codec": "8.12.1",
|
||||
"@polkadot/types-create": "8.12.1",
|
||||
"@polkadot/types-support": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1",
|
||||
"@polkadot/util-crypto": "^10.0.1",
|
||||
"@polkadot/x-ws": "^10.0.1",
|
||||
"@babel/core": "^7.18.9",
|
||||
"@babel/register": "^7.18.9",
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/api": "8.14.1",
|
||||
"@polkadot/api-augment": "8.14.1",
|
||||
"@polkadot/rpc-augment": "8.14.1",
|
||||
"@polkadot/rpc-provider": "8.14.1",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/types-augment": "8.14.1",
|
||||
"@polkadot/types-codec": "8.14.1",
|
||||
"@polkadot/types-create": "8.14.1",
|
||||
"@polkadot/types-support": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1",
|
||||
"@polkadot/util-crypto": "^10.1.1",
|
||||
"@polkadot/x-ws": "^10.1.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
"yargs": "^17.5.1"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/types-codec": "8.12.1",
|
||||
"@polkadot/util": "^10.0.1"
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/types-codec": "8.14.1",
|
||||
"@polkadot/util": "^10.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ export default {
|
||||
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
|
||||
},
|
||||
/**
|
||||
* Lookup779: kusama_runtime::Runtime
|
||||
* Lookup777: kusama_runtime::Runtime
|
||||
**/
|
||||
KusamaRuntimeRuntime: 'Null'
|
||||
};
|
||||
|
||||
@@ -1249,7 +1249,24 @@ export default {
|
||||
},
|
||||
CollectionMaxSupplySet: {
|
||||
collection: 'u32',
|
||||
maxSupply: 'u32'
|
||||
maxSupply: 'u32',
|
||||
},
|
||||
ItemPriceSet: {
|
||||
collection: 'u32',
|
||||
item: 'u32',
|
||||
price: 'u128',
|
||||
whitelistedBuyer: 'Option<AccountId32>',
|
||||
},
|
||||
ItemPriceRemoved: {
|
||||
collection: 'u32',
|
||||
item: 'u32',
|
||||
},
|
||||
ItemBought: {
|
||||
collection: 'u32',
|
||||
item: 'u32',
|
||||
price: 'u128',
|
||||
seller: 'AccountId32',
|
||||
buyer: 'AccountId32'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2329,7 +2346,8 @@ export default {
|
||||
},
|
||||
remove_member: {
|
||||
who: 'MultiAddress',
|
||||
hasReplacement: 'bool',
|
||||
slashBond: 'bool',
|
||||
rerunElection: 'bool',
|
||||
},
|
||||
clean_defunct_voters: {
|
||||
numVoters: 'u32',
|
||||
@@ -3338,7 +3356,18 @@ export default {
|
||||
},
|
||||
set_collection_max_supply: {
|
||||
collection: 'u32',
|
||||
maxSupply: 'u32'
|
||||
maxSupply: 'u32',
|
||||
},
|
||||
set_price: {
|
||||
collection: 'u32',
|
||||
item: 'u32',
|
||||
price: 'Option<u128>',
|
||||
whitelistedBuyer: 'Option<MultiAddress>',
|
||||
},
|
||||
buy_item: {
|
||||
collection: 'u32',
|
||||
item: 'u32',
|
||||
bidPrice: 'u128'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -4254,7 +4283,7 @@ export default {
|
||||
* Lookup467: pallet_elections_phragmen::pallet::Error<T>
|
||||
**/
|
||||
PalletElectionsPhragmenError: {
|
||||
_enum: ['UnableToVote', 'NoVotes', 'TooManyVotes', 'MaximumVotesExceeded', 'LowBalance', 'UnableToPayBond', 'MustBeVoter', 'ReportSelf', 'DuplicatedCandidate', 'MemberSubmit', 'RunnerUpSubmit', 'InsufficientCandidateFunds', 'NotMember', 'InvalidWitnessData', 'InvalidVoteCount', 'InvalidRenouncing', 'InvalidReplacement']
|
||||
_enum: ['UnableToVote', 'NoVotes', 'TooManyVotes', 'MaximumVotesExceeded', 'LowBalance', 'UnableToPayBond', 'MustBeVoter', 'DuplicatedCandidate', 'TooManyCandidates', 'MemberSubmit', 'RunnerUpSubmit', 'InsufficientCandidateFunds', 'NotMember', 'InvalidWitnessData', 'InvalidVoteCount', 'InvalidRenouncing', 'InvalidReplacement']
|
||||
},
|
||||
/**
|
||||
* Lookup469: pallet_membership::pallet::Error<T, I>
|
||||
@@ -4886,13 +4915,13 @@ export default {
|
||||
isFrozen: 'bool'
|
||||
},
|
||||
/**
|
||||
* Lookup589: pallet_uniques::pallet::Error<T, I>
|
||||
* Lookup590: pallet_uniques::pallet::Error<T, I>
|
||||
**/
|
||||
PalletUniquesError: {
|
||||
_enum: ['NoPermission', 'UnknownCollection', 'AlreadyExists', 'WrongOwner', 'BadWitness', 'InUse', 'Frozen', 'WrongDelegate', 'NoDelegate', 'Unapproved', 'Unaccepted', 'Locked', 'MaxSupplyReached', 'MaxSupplyAlreadySet', 'MaxSupplyTooSmall']
|
||||
_enum: ['NoPermission', 'UnknownCollection', 'AlreadyExists', 'WrongOwner', 'BadWitness', 'InUse', 'Frozen', 'WrongDelegate', 'NoDelegate', 'Unapproved', 'Unaccepted', 'Locked', 'MaxSupplyReached', 'MaxSupplyAlreadySet', 'MaxSupplyTooSmall', 'UnknownItem', 'NotForSale', 'BidTooLow']
|
||||
},
|
||||
/**
|
||||
* Lookup591: pallet_transaction_storage::TransactionInfo
|
||||
* Lookup592: pallet_transaction_storage::TransactionInfo
|
||||
**/
|
||||
PalletTransactionStorageTransactionInfo: {
|
||||
_alias: {
|
||||
@@ -4904,13 +4933,13 @@ export default {
|
||||
blockChunks: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup593: pallet_transaction_storage::pallet::Error<T>
|
||||
* Lookup594: pallet_transaction_storage::pallet::Error<T>
|
||||
**/
|
||||
PalletTransactionStorageError: {
|
||||
_enum: ['InsufficientFunds', 'NotConfigured', 'RenewedNotFound', 'EmptyTransaction', 'UnexpectedProof', 'InvalidProof', 'MissingProof', 'MissingStateData', 'DoubleCheck', 'ProofNotChecked', 'TransactionTooLarge', 'TooManyTransactions', 'BadContext']
|
||||
},
|
||||
/**
|
||||
* Lookup594: pallet_bags_list::list::Node<T, I>
|
||||
* Lookup595: pallet_bags_list::list::Node<T, I>
|
||||
**/
|
||||
PalletBagsListListNode: {
|
||||
id: 'AccountId32',
|
||||
@@ -4920,14 +4949,14 @@ export default {
|
||||
score: 'u64'
|
||||
},
|
||||
/**
|
||||
* Lookup595: pallet_bags_list::list::Bag<T, I>
|
||||
* Lookup596: pallet_bags_list::list::Bag<T, I>
|
||||
**/
|
||||
PalletBagsListListBag: {
|
||||
head: 'Option<AccountId32>',
|
||||
tail: 'Option<AccountId32>'
|
||||
},
|
||||
/**
|
||||
* Lookup597: pallet_bags_list::pallet::Error<T, I>
|
||||
* Lookup598: pallet_bags_list::pallet::Error<T, I>
|
||||
**/
|
||||
PalletBagsListError: {
|
||||
_enum: {
|
||||
@@ -4935,19 +4964,19 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup598: pallet_bags_list::list::ListError
|
||||
* Lookup599: pallet_bags_list::list::ListError
|
||||
**/
|
||||
PalletBagsListListListError: {
|
||||
_enum: ['Duplicate', 'NotHeavier', 'NotInSameBag', 'NodeNotFound']
|
||||
},
|
||||
/**
|
||||
* Lookup599: pallet_state_trie_migration::pallet::Error<T>
|
||||
* Lookup600: pallet_state_trie_migration::pallet::Error<T>
|
||||
**/
|
||||
PalletStateTrieMigrationError: {
|
||||
_enum: ['MaxSignedLimits', 'KeyTooLong', 'NotEnoughFunds', 'BadWitness', 'SizeUpperBoundExceeded', 'SignedMigrationNotAllowed']
|
||||
},
|
||||
/**
|
||||
* Lookup600: pallet_child_bounties::ChildBounty<sp_core::crypto::AccountId32, Balance, BlockNumber>
|
||||
* Lookup601: pallet_child_bounties::ChildBounty<sp_core::crypto::AccountId32, Balance, BlockNumber>
|
||||
**/
|
||||
PalletChildBountiesChildBounty: {
|
||||
parentBounty: 'u32',
|
||||
@@ -4957,7 +4986,7 @@ export default {
|
||||
status: 'PalletChildBountiesChildBountyStatus'
|
||||
},
|
||||
/**
|
||||
* Lookup601: pallet_child_bounties::ChildBountyStatus<sp_core::crypto::AccountId32, BlockNumber>
|
||||
* Lookup602: pallet_child_bounties::ChildBountyStatus<sp_core::crypto::AccountId32, BlockNumber>
|
||||
**/
|
||||
PalletChildBountiesChildBountyStatus: {
|
||||
_enum: {
|
||||
@@ -4976,13 +5005,13 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup602: pallet_child_bounties::pallet::Error<T>
|
||||
* Lookup603: pallet_child_bounties::pallet::Error<T>
|
||||
**/
|
||||
PalletChildBountiesError: {
|
||||
_enum: ['ParentBountyNotActive', 'InsufficientBountyBalance', 'TooManyChildBounties']
|
||||
},
|
||||
/**
|
||||
* Lookup603: pallet_referenda::types::ReferendumInfo<TrackId, node_runtime::OriginCaller, Moment, primitive_types::H256, Balance, pallet_conviction_voting::types::Tally<Votes, Total>, sp_core::crypto::AccountId32, ScheduleAddress>
|
||||
* Lookup604: pallet_referenda::types::ReferendumInfo<TrackId, node_runtime::OriginCaller, Moment, primitive_types::H256, Balance, pallet_conviction_voting::types::Tally<Votes, Total>, sp_core::crypto::AccountId32, ScheduleAddress>
|
||||
**/
|
||||
PalletReferendaReferendumInfoConvictionVotingTally: {
|
||||
_enum: {
|
||||
@@ -4995,7 +5024,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup604: pallet_referenda::types::ReferendumStatus<TrackId, node_runtime::OriginCaller, Moment, primitive_types::H256, Balance, pallet_conviction_voting::types::Tally<Votes, Total>, sp_core::crypto::AccountId32, ScheduleAddress>
|
||||
* Lookup605: pallet_referenda::types::ReferendumStatus<TrackId, node_runtime::OriginCaller, Moment, primitive_types::H256, Balance, pallet_conviction_voting::types::Tally<Votes, Total>, sp_core::crypto::AccountId32, ScheduleAddress>
|
||||
**/
|
||||
PalletReferendaReferendumStatusConvictionVotingTally: {
|
||||
track: 'u16',
|
||||
@@ -5011,33 +5040,33 @@ export default {
|
||||
alarm: 'Option<(u32,(u32,u32))>'
|
||||
},
|
||||
/**
|
||||
* Lookup605: pallet_referenda::types::Deposit<sp_core::crypto::AccountId32, Balance>
|
||||
* Lookup606: pallet_referenda::types::Deposit<sp_core::crypto::AccountId32, Balance>
|
||||
**/
|
||||
PalletReferendaDeposit: {
|
||||
who: 'AccountId32',
|
||||
amount: 'u128'
|
||||
},
|
||||
/**
|
||||
* Lookup608: pallet_referenda::types::DecidingStatus<BlockNumber>
|
||||
* Lookup609: pallet_referenda::types::DecidingStatus<BlockNumber>
|
||||
**/
|
||||
PalletReferendaDecidingStatus: {
|
||||
since: 'u32',
|
||||
confirming: 'Option<u32>'
|
||||
},
|
||||
/**
|
||||
* Lookup612: pallet_referenda::pallet::Error<T, I>
|
||||
* Lookup613: pallet_referenda::pallet::Error<T, I>
|
||||
**/
|
||||
PalletReferendaError: {
|
||||
_enum: ['NotOngoing', 'HasDeposit', 'BadTrack', 'Full', 'QueueEmpty', 'BadReferendum', 'NothingToDo', 'NoTrack', 'Unfinished', 'NoPermission', 'NoDeposit']
|
||||
},
|
||||
/**
|
||||
* Lookup613: pallet_remark::pallet::Error<T>
|
||||
* Lookup614: pallet_remark::pallet::Error<T>
|
||||
**/
|
||||
PalletRemarkError: {
|
||||
_enum: ['Empty', 'BadContext']
|
||||
},
|
||||
/**
|
||||
* Lookup615: pallet_conviction_voting::vote::Voting<Balance, sp_core::crypto::AccountId32, BlockNumber, PollIndex, MaxVotes>
|
||||
* Lookup616: pallet_conviction_voting::vote::Voting<Balance, sp_core::crypto::AccountId32, BlockNumber, PollIndex, MaxVotes>
|
||||
**/
|
||||
PalletConvictionVotingVoteVoting: {
|
||||
_enum: {
|
||||
@@ -5046,7 +5075,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup616: pallet_conviction_voting::vote::Casting<Balance, BlockNumber, PollIndex, MaxVotes>
|
||||
* Lookup617: pallet_conviction_voting::vote::Casting<Balance, BlockNumber, PollIndex, MaxVotes>
|
||||
**/
|
||||
PalletConvictionVotingVoteCasting: {
|
||||
votes: 'Vec<(u32,PalletConvictionVotingVoteAccountVote)>',
|
||||
@@ -5054,18 +5083,18 @@ export default {
|
||||
prior: 'PalletConvictionVotingVotePriorLock'
|
||||
},
|
||||
/**
|
||||
* Lookup620: pallet_conviction_voting::types::Delegations<Balance>
|
||||
* Lookup621: pallet_conviction_voting::types::Delegations<Balance>
|
||||
**/
|
||||
PalletConvictionVotingDelegations: {
|
||||
votes: 'u128',
|
||||
capital: 'u128'
|
||||
},
|
||||
/**
|
||||
* Lookup621: pallet_conviction_voting::vote::PriorLock<BlockNumber, Balance>
|
||||
* Lookup622: pallet_conviction_voting::vote::PriorLock<BlockNumber, Balance>
|
||||
**/
|
||||
PalletConvictionVotingVotePriorLock: '(u32,u128)',
|
||||
/**
|
||||
* Lookup622: pallet_conviction_voting::vote::Delegating<Balance, sp_core::crypto::AccountId32, BlockNumber>
|
||||
* Lookup623: pallet_conviction_voting::vote::Delegating<Balance, sp_core::crypto::AccountId32, BlockNumber>
|
||||
**/
|
||||
PalletConvictionVotingVoteDelegating: {
|
||||
balance: 'u128',
|
||||
@@ -5075,40 +5104,40 @@ export default {
|
||||
prior: 'PalletConvictionVotingVotePriorLock'
|
||||
},
|
||||
/**
|
||||
* Lookup626: pallet_conviction_voting::pallet::Error<T, I>
|
||||
* Lookup627: pallet_conviction_voting::pallet::Error<T, I>
|
||||
**/
|
||||
PalletConvictionVotingError: {
|
||||
_enum: ['NotOngoing', 'NotVoter', 'NoPermission', 'NoPermissionYet', 'AlreadyDelegating', 'AlreadyVoting', 'InsufficientFunds', 'NotDelegating', 'Nonsense', 'MaxVotesReached', 'ClassNeeded', 'BadClass']
|
||||
},
|
||||
/**
|
||||
* Lookup627: pallet_whitelist::pallet::Error<T>
|
||||
* Lookup628: pallet_whitelist::pallet::Error<T>
|
||||
**/
|
||||
PalletWhitelistError: {
|
||||
_enum: ['UnavailablePreImage', 'UndecodableCall', 'InvalidCallWeightWitness', 'CallIsNotWhitelisted', 'CallAlreadyWhitelisted']
|
||||
},
|
||||
/**
|
||||
* Lookup632: pallet_alliance::MemberRole
|
||||
* Lookup633: pallet_alliance::MemberRole
|
||||
**/
|
||||
PalletAllianceMemberRole: {
|
||||
_enum: ['Founder', 'Fellow', 'Ally']
|
||||
},
|
||||
/**
|
||||
* Lookup637: pallet_alliance::pallet::Error<T, I>
|
||||
* Lookup638: pallet_alliance::pallet::Error<T, I>
|
||||
**/
|
||||
PalletAllianceError: {
|
||||
_enum: ['MembersAlreadyInitialized', 'AlreadyMember', 'NotMember', 'NotAlly', 'NotFounder', 'UpForKicking', 'NoVotingRights', 'AlreadyElevated', 'AlreadyUnscrupulous', 'AccountNonGrata', 'NotListedAsUnscrupulous', 'TooManyUnscrupulousItems', 'TooLongWebsiteUrl', 'InsufficientFunds', 'WithoutIdentityDisplayAndWebsite', 'WithoutGoodIdentityJudgement', 'MissingProposalHash', 'NotVetoableProposal', 'MissingAnnouncement', 'TooManyMembers', 'TooManyAnnouncements']
|
||||
},
|
||||
/**
|
||||
* Lookup638: pallet_nomination_pools::PoolMember<T>
|
||||
* Lookup639: pallet_nomination_pools::PoolMember<T>
|
||||
**/
|
||||
PalletNominationPoolsPoolMember: {
|
||||
poolId: 'u32',
|
||||
points: 'u128',
|
||||
rewardPoolTotalEarnings: 'u128',
|
||||
lastRecordedRewardCounter: 'u128',
|
||||
unbondingEras: 'BTreeMap<u32, u128>'
|
||||
},
|
||||
/**
|
||||
* Lookup641: pallet_nomination_pools::BondedPoolInner<T>
|
||||
* Lookup642: pallet_nomination_pools::BondedPoolInner<T>
|
||||
**/
|
||||
PalletNominationPoolsBondedPoolInner: {
|
||||
points: 'u128',
|
||||
@@ -5117,7 +5146,7 @@ export default {
|
||||
roles: 'PalletNominationPoolsPoolRoles'
|
||||
},
|
||||
/**
|
||||
* Lookup642: pallet_nomination_pools::PoolRoles<sp_core::crypto::AccountId32>
|
||||
* Lookup643: pallet_nomination_pools::PoolRoles<sp_core::crypto::AccountId32>
|
||||
**/
|
||||
PalletNominationPoolsPoolRoles: {
|
||||
depositor: 'AccountId32',
|
||||
@@ -5126,29 +5155,29 @@ export default {
|
||||
stateToggler: 'Option<AccountId32>'
|
||||
},
|
||||
/**
|
||||
* Lookup643: pallet_nomination_pools::RewardPool<T>
|
||||
* Lookup644: pallet_nomination_pools::RewardPool<T>
|
||||
**/
|
||||
PalletNominationPoolsRewardPool: {
|
||||
balance: 'u128',
|
||||
totalEarnings: 'u128',
|
||||
points: 'U256'
|
||||
lastRecordedRewardCounter: 'u128',
|
||||
lastRecordedTotalPayouts: 'u128',
|
||||
totalRewardsClaimed: 'u128'
|
||||
},
|
||||
/**
|
||||
* Lookup646: pallet_nomination_pools::SubPools<T>
|
||||
* Lookup645: pallet_nomination_pools::SubPools<T>
|
||||
**/
|
||||
PalletNominationPoolsSubPools: {
|
||||
noEra: 'PalletNominationPoolsUnbondPool',
|
||||
withEra: 'BTreeMap<u32, PalletNominationPoolsUnbondPool>'
|
||||
},
|
||||
/**
|
||||
* Lookup647: pallet_nomination_pools::UnbondPool<T>
|
||||
* Lookup646: pallet_nomination_pools::UnbondPool<T>
|
||||
**/
|
||||
PalletNominationPoolsUnbondPool: {
|
||||
points: 'u128',
|
||||
balance: 'u128'
|
||||
},
|
||||
/**
|
||||
* Lookup653: pallet_nomination_pools::pallet::Error<T>
|
||||
* Lookup652: pallet_nomination_pools::pallet::Error<T>
|
||||
**/
|
||||
PalletNominationPoolsError: {
|
||||
_enum: {
|
||||
@@ -5163,7 +5192,6 @@ export default {
|
||||
MinimumBondNotMet: 'Null',
|
||||
OverflowRisk: 'Null',
|
||||
NotDestroying: 'Null',
|
||||
NotOnlyPoolMember: 'Null',
|
||||
NotNominator: 'Null',
|
||||
NotKickerOrDestroying: 'Null',
|
||||
NotOpen: 'Null',
|
||||
@@ -5173,18 +5201,17 @@ export default {
|
||||
DoesNotHavePermission: 'Null',
|
||||
MetadataExceedsMaxLen: 'Null',
|
||||
Defensive: 'PalletNominationPoolsDefensiveError',
|
||||
NotEnoughPointsToUnbond: 'Null',
|
||||
PartialUnbondNotAllowedPermissionlessly: 'Null'
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup654: pallet_nomination_pools::pallet::DefensiveError
|
||||
* Lookup653: pallet_nomination_pools::pallet::DefensiveError
|
||||
**/
|
||||
PalletNominationPoolsDefensiveError: {
|
||||
_enum: ['NotEnoughSpaceInUnbondPool', 'PoolNotFound', 'RewardPoolNotFound', 'SubPoolsNotFound', 'BondedStashKilledPrematurely']
|
||||
},
|
||||
/**
|
||||
* Lookup655: pallet_referenda::types::ReferendumInfo<TrackId, node_runtime::OriginCaller, Moment, primitive_types::H256, Balance, pallet_ranked_collective::Tally<M>, sp_core::crypto::AccountId32, ScheduleAddress>
|
||||
* Lookup654: pallet_referenda::types::ReferendumInfo<TrackId, node_runtime::OriginCaller, Moment, primitive_types::H256, Balance, pallet_ranked_collective::Tally<M>, sp_core::crypto::AccountId32, ScheduleAddress>
|
||||
**/
|
||||
PalletReferendaReferendumInfoRankedCollectiveTally: {
|
||||
_enum: {
|
||||
@@ -5197,7 +5224,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup656: pallet_referenda::types::ReferendumStatus<TrackId, node_runtime::OriginCaller, Moment, primitive_types::H256, Balance, pallet_ranked_collective::Tally<M>, sp_core::crypto::AccountId32, ScheduleAddress>
|
||||
* Lookup655: pallet_referenda::types::ReferendumStatus<TrackId, node_runtime::OriginCaller, Moment, primitive_types::H256, Balance, pallet_ranked_collective::Tally<M>, sp_core::crypto::AccountId32, ScheduleAddress>
|
||||
**/
|
||||
PalletReferendaReferendumStatusRankedCollectiveTally: {
|
||||
track: 'u16',
|
||||
@@ -5213,19 +5240,19 @@ export default {
|
||||
alarm: 'Option<(u32,(u32,u32))>'
|
||||
},
|
||||
/**
|
||||
* Lookup659: pallet_ranked_collective::MemberRecord
|
||||
* Lookup658: pallet_ranked_collective::MemberRecord
|
||||
**/
|
||||
PalletRankedCollectiveMemberRecord: {
|
||||
rank: 'u16'
|
||||
},
|
||||
/**
|
||||
* Lookup663: pallet_ranked_collective::pallet::Error<T, I>
|
||||
* Lookup662: pallet_ranked_collective::pallet::Error<T, I>
|
||||
**/
|
||||
PalletRankedCollectiveError: {
|
||||
_enum: ['AlreadyMember', 'NotMember', 'NotPolling', 'Ongoing', 'NoneRemaining', 'Corruption', 'RankTooLow', 'InvalidWitness', 'NoPermission']
|
||||
},
|
||||
/**
|
||||
* Lookup665: sp_runtime::MultiSignature
|
||||
* Lookup664: sp_runtime::MultiSignature
|
||||
**/
|
||||
SpRuntimeMultiSignature: {
|
||||
_enum: {
|
||||
@@ -5235,42 +5262,42 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup666: sp_core::ecdsa::Signature
|
||||
* Lookup665: sp_core::ecdsa::Signature
|
||||
**/
|
||||
SpCoreEcdsaSignature: '[u8;65]',
|
||||
/**
|
||||
* Lookup669: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender<T>
|
||||
* Lookup668: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckNonZeroSender: 'Null',
|
||||
/**
|
||||
* Lookup670: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
|
||||
* Lookup669: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckSpecVersion: 'Null',
|
||||
/**
|
||||
* Lookup671: frame_system::extensions::check_tx_version::CheckTxVersion<T>
|
||||
* Lookup670: frame_system::extensions::check_tx_version::CheckTxVersion<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckTxVersion: 'Null',
|
||||
/**
|
||||
* Lookup672: frame_system::extensions::check_genesis::CheckGenesis<T>
|
||||
* Lookup671: frame_system::extensions::check_genesis::CheckGenesis<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckGenesis: 'Null',
|
||||
/**
|
||||
* Lookup675: frame_system::extensions::check_nonce::CheckNonce<T>
|
||||
* Lookup674: frame_system::extensions::check_nonce::CheckNonce<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
|
||||
/**
|
||||
* Lookup676: frame_system::extensions::check_weight::CheckWeight<T>
|
||||
* Lookup675: frame_system::extensions::check_weight::CheckWeight<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckWeight: 'Null',
|
||||
/**
|
||||
* Lookup677: pallet_asset_tx_payment::ChargeAssetTxPayment<T>
|
||||
* Lookup676: pallet_asset_tx_payment::ChargeAssetTxPayment<T>
|
||||
**/
|
||||
PalletAssetTxPaymentChargeAssetTxPayment: {
|
||||
tip: 'Compact<u128>',
|
||||
assetId: 'Option<u32>'
|
||||
},
|
||||
/**
|
||||
* Lookup678: node_runtime::Runtime
|
||||
* Lookup677: node_runtime::Runtime
|
||||
**/
|
||||
NodeRuntimeRuntime: 'Null'
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeRuntime (779) */
|
||||
/** @name KusamaRuntimeRuntime (777) */
|
||||
type KusamaRuntimeRuntime = Null;
|
||||
|
||||
} // declare module
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import '@polkadot/types/lookup';
|
||||
|
||||
import type { Data } from '@polkadot/types';
|
||||
import type { BTreeMap, Bytes, Compact, Enum, Null, Option, Result, Set, Struct, Text, U256, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { BTreeMap, Bytes, Compact, Enum, Null, Option, Result, Set, Struct, Text, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { Vote } from '@polkadot/types/interfaces/elections';
|
||||
import type { OpaqueMultiaddr, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
|
||||
@@ -1401,7 +1401,27 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly collection: u32;
|
||||
readonly maxSupply: u32;
|
||||
} & Struct;
|
||||
readonly type: 'Created' | 'ForceCreated' | 'Destroyed' | 'Issued' | 'Transferred' | 'Burned' | 'Frozen' | 'Thawed' | 'CollectionFrozen' | 'CollectionThawed' | 'OwnerChanged' | 'TeamChanged' | 'ApprovedTransfer' | 'ApprovalCancelled' | 'ItemStatusChanged' | 'CollectionMetadataSet' | 'CollectionMetadataCleared' | 'MetadataSet' | 'MetadataCleared' | 'Redeposited' | 'AttributeSet' | 'AttributeCleared' | 'OwnershipAcceptanceChanged' | 'CollectionMaxSupplySet';
|
||||
readonly isItemPriceSet: boolean;
|
||||
readonly asItemPriceSet: {
|
||||
readonly collection: u32;
|
||||
readonly item: u32;
|
||||
readonly price: u128;
|
||||
readonly whitelistedBuyer: Option<AccountId32>;
|
||||
} & Struct;
|
||||
readonly isItemPriceRemoved: boolean;
|
||||
readonly asItemPriceRemoved: {
|
||||
readonly collection: u32;
|
||||
readonly item: u32;
|
||||
} & Struct;
|
||||
readonly isItemBought: boolean;
|
||||
readonly asItemBought: {
|
||||
readonly collection: u32;
|
||||
readonly item: u32;
|
||||
readonly price: u128;
|
||||
readonly seller: AccountId32;
|
||||
readonly buyer: AccountId32;
|
||||
} & Struct;
|
||||
readonly type: 'Created' | 'ForceCreated' | 'Destroyed' | 'Issued' | 'Transferred' | 'Burned' | 'Frozen' | 'Thawed' | 'CollectionFrozen' | 'CollectionThawed' | 'OwnerChanged' | 'TeamChanged' | 'ApprovedTransfer' | 'ApprovalCancelled' | 'ItemStatusChanged' | 'CollectionMetadataSet' | 'CollectionMetadataCleared' | 'MetadataSet' | 'MetadataCleared' | 'Redeposited' | 'AttributeSet' | 'AttributeCleared' | 'OwnershipAcceptanceChanged' | 'CollectionMaxSupplySet' | 'ItemPriceSet' | 'ItemPriceRemoved' | 'ItemBought';
|
||||
}
|
||||
|
||||
/** @name PalletTransactionStorageEvent (100) */
|
||||
@@ -2541,7 +2561,8 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isRemoveMember: boolean;
|
||||
readonly asRemoveMember: {
|
||||
readonly who: MultiAddress;
|
||||
readonly hasReplacement: bool;
|
||||
readonly slashBond: bool;
|
||||
readonly rerunElection: bool;
|
||||
} & Struct;
|
||||
readonly isCleanDefunctVoters: boolean;
|
||||
readonly asCleanDefunctVoters: {
|
||||
@@ -3628,7 +3649,20 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly collection: u32;
|
||||
readonly maxSupply: u32;
|
||||
} & Struct;
|
||||
readonly type: 'Create' | 'ForceCreate' | 'Destroy' | 'Mint' | 'Burn' | 'Transfer' | 'Redeposit' | 'Freeze' | 'Thaw' | 'FreezeCollection' | 'ThawCollection' | 'TransferOwnership' | 'SetTeam' | 'ApproveTransfer' | 'CancelApproval' | 'ForceItemStatus' | 'SetAttribute' | 'ClearAttribute' | 'SetMetadata' | 'ClearMetadata' | 'SetCollectionMetadata' | 'ClearCollectionMetadata' | 'SetAcceptOwnership' | 'SetCollectionMaxSupply';
|
||||
readonly isSetPrice: boolean;
|
||||
readonly asSetPrice: {
|
||||
readonly collection: u32;
|
||||
readonly item: u32;
|
||||
readonly price: Option<u128>;
|
||||
readonly whitelistedBuyer: Option<MultiAddress>;
|
||||
} & Struct;
|
||||
readonly isBuyItem: boolean;
|
||||
readonly asBuyItem: {
|
||||
readonly collection: u32;
|
||||
readonly item: u32;
|
||||
readonly bidPrice: u128;
|
||||
} & Struct;
|
||||
readonly type: 'Create' | 'ForceCreate' | 'Destroy' | 'Mint' | 'Burn' | 'Transfer' | 'Redeposit' | 'Freeze' | 'Thaw' | 'FreezeCollection' | 'ThawCollection' | 'TransferOwnership' | 'SetTeam' | 'ApproveTransfer' | 'CancelApproval' | 'ForceItemStatus' | 'SetAttribute' | 'ClearAttribute' | 'SetMetadata' | 'ClearMetadata' | 'SetCollectionMetadata' | 'ClearCollectionMetadata' | 'SetAcceptOwnership' | 'SetCollectionMaxSupply' | 'SetPrice' | 'BuyItem';
|
||||
}
|
||||
|
||||
/** @name PalletUniquesDestroyWitness (337) */
|
||||
@@ -4620,8 +4654,8 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isLowBalance: boolean;
|
||||
readonly isUnableToPayBond: boolean;
|
||||
readonly isMustBeVoter: boolean;
|
||||
readonly isReportSelf: boolean;
|
||||
readonly isDuplicatedCandidate: boolean;
|
||||
readonly isTooManyCandidates: boolean;
|
||||
readonly isMemberSubmit: boolean;
|
||||
readonly isRunnerUpSubmit: boolean;
|
||||
readonly isInsufficientCandidateFunds: boolean;
|
||||
@@ -4630,7 +4664,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isInvalidVoteCount: boolean;
|
||||
readonly isInvalidRenouncing: boolean;
|
||||
readonly isInvalidReplacement: boolean;
|
||||
readonly type: 'UnableToVote' | 'NoVotes' | 'TooManyVotes' | 'MaximumVotesExceeded' | 'LowBalance' | 'UnableToPayBond' | 'MustBeVoter' | 'ReportSelf' | 'DuplicatedCandidate' | 'MemberSubmit' | 'RunnerUpSubmit' | 'InsufficientCandidateFunds' | 'NotMember' | 'InvalidWitnessData' | 'InvalidVoteCount' | 'InvalidRenouncing' | 'InvalidReplacement';
|
||||
readonly type: 'UnableToVote' | 'NoVotes' | 'TooManyVotes' | 'MaximumVotesExceeded' | 'LowBalance' | 'UnableToPayBond' | 'MustBeVoter' | 'DuplicatedCandidate' | 'TooManyCandidates' | 'MemberSubmit' | 'RunnerUpSubmit' | 'InsufficientCandidateFunds' | 'NotMember' | 'InvalidWitnessData' | 'InvalidVoteCount' | 'InvalidRenouncing' | 'InvalidReplacement';
|
||||
}
|
||||
|
||||
/** @name PalletMembershipError (469) */
|
||||
@@ -5386,7 +5420,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isFrozen: bool;
|
||||
}
|
||||
|
||||
/** @name PalletUniquesError (589) */
|
||||
/** @name PalletUniquesError (590) */
|
||||
interface PalletUniquesError extends Enum {
|
||||
readonly isNoPermission: boolean;
|
||||
readonly isUnknownCollection: boolean;
|
||||
@@ -5403,10 +5437,13 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isMaxSupplyReached: boolean;
|
||||
readonly isMaxSupplyAlreadySet: boolean;
|
||||
readonly isMaxSupplyTooSmall: boolean;
|
||||
readonly type: 'NoPermission' | 'UnknownCollection' | 'AlreadyExists' | 'WrongOwner' | 'BadWitness' | 'InUse' | 'Frozen' | 'WrongDelegate' | 'NoDelegate' | 'Unapproved' | 'Unaccepted' | 'Locked' | 'MaxSupplyReached' | 'MaxSupplyAlreadySet' | 'MaxSupplyTooSmall';
|
||||
readonly isUnknownItem: boolean;
|
||||
readonly isNotForSale: boolean;
|
||||
readonly isBidTooLow: boolean;
|
||||
readonly type: 'NoPermission' | 'UnknownCollection' | 'AlreadyExists' | 'WrongOwner' | 'BadWitness' | 'InUse' | 'Frozen' | 'WrongDelegate' | 'NoDelegate' | 'Unapproved' | 'Unaccepted' | 'Locked' | 'MaxSupplyReached' | 'MaxSupplyAlreadySet' | 'MaxSupplyTooSmall' | 'UnknownItem' | 'NotForSale' | 'BidTooLow';
|
||||
}
|
||||
|
||||
/** @name PalletTransactionStorageTransactionInfo (591) */
|
||||
/** @name PalletTransactionStorageTransactionInfo (592) */
|
||||
interface PalletTransactionStorageTransactionInfo extends Struct {
|
||||
readonly chunkRoot: H256;
|
||||
readonly contentHash: H256;
|
||||
@@ -5414,7 +5451,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly blockChunks: u32;
|
||||
}
|
||||
|
||||
/** @name PalletTransactionStorageError (593) */
|
||||
/** @name PalletTransactionStorageError (594) */
|
||||
interface PalletTransactionStorageError extends Enum {
|
||||
readonly isInsufficientFunds: boolean;
|
||||
readonly isNotConfigured: boolean;
|
||||
@@ -5432,7 +5469,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'InsufficientFunds' | 'NotConfigured' | 'RenewedNotFound' | 'EmptyTransaction' | 'UnexpectedProof' | 'InvalidProof' | 'MissingProof' | 'MissingStateData' | 'DoubleCheck' | 'ProofNotChecked' | 'TransactionTooLarge' | 'TooManyTransactions' | 'BadContext';
|
||||
}
|
||||
|
||||
/** @name PalletBagsListListNode (594) */
|
||||
/** @name PalletBagsListListNode (595) */
|
||||
interface PalletBagsListListNode extends Struct {
|
||||
readonly id: AccountId32;
|
||||
readonly prev: Option<AccountId32>;
|
||||
@@ -5441,20 +5478,20 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly score: u64;
|
||||
}
|
||||
|
||||
/** @name PalletBagsListListBag (595) */
|
||||
/** @name PalletBagsListListBag (596) */
|
||||
interface PalletBagsListListBag extends Struct {
|
||||
readonly head: Option<AccountId32>;
|
||||
readonly tail: Option<AccountId32>;
|
||||
}
|
||||
|
||||
/** @name PalletBagsListError (597) */
|
||||
/** @name PalletBagsListError (598) */
|
||||
interface PalletBagsListError extends Enum {
|
||||
readonly isList: boolean;
|
||||
readonly asList: PalletBagsListListListError;
|
||||
readonly type: 'List';
|
||||
}
|
||||
|
||||
/** @name PalletBagsListListListError (598) */
|
||||
/** @name PalletBagsListListListError (599) */
|
||||
interface PalletBagsListListListError extends Enum {
|
||||
readonly isDuplicate: boolean;
|
||||
readonly isNotHeavier: boolean;
|
||||
@@ -5463,7 +5500,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Duplicate' | 'NotHeavier' | 'NotInSameBag' | 'NodeNotFound';
|
||||
}
|
||||
|
||||
/** @name PalletStateTrieMigrationError (599) */
|
||||
/** @name PalletStateTrieMigrationError (600) */
|
||||
interface PalletStateTrieMigrationError extends Enum {
|
||||
readonly isMaxSignedLimits: boolean;
|
||||
readonly isKeyTooLong: boolean;
|
||||
@@ -5474,7 +5511,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'MaxSignedLimits' | 'KeyTooLong' | 'NotEnoughFunds' | 'BadWitness' | 'SizeUpperBoundExceeded' | 'SignedMigrationNotAllowed';
|
||||
}
|
||||
|
||||
/** @name PalletChildBountiesChildBounty (600) */
|
||||
/** @name PalletChildBountiesChildBounty (601) */
|
||||
interface PalletChildBountiesChildBounty extends Struct {
|
||||
readonly parentBounty: u32;
|
||||
readonly value: u128;
|
||||
@@ -5483,7 +5520,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly status: PalletChildBountiesChildBountyStatus;
|
||||
}
|
||||
|
||||
/** @name PalletChildBountiesChildBountyStatus (601) */
|
||||
/** @name PalletChildBountiesChildBountyStatus (602) */
|
||||
interface PalletChildBountiesChildBountyStatus extends Enum {
|
||||
readonly isAdded: boolean;
|
||||
readonly isCuratorProposed: boolean;
|
||||
@@ -5503,7 +5540,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Added' | 'CuratorProposed' | 'Active' | 'PendingPayout';
|
||||
}
|
||||
|
||||
/** @name PalletChildBountiesError (602) */
|
||||
/** @name PalletChildBountiesError (603) */
|
||||
interface PalletChildBountiesError extends Enum {
|
||||
readonly isParentBountyNotActive: boolean;
|
||||
readonly isInsufficientBountyBalance: boolean;
|
||||
@@ -5511,7 +5548,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'ParentBountyNotActive' | 'InsufficientBountyBalance' | 'TooManyChildBounties';
|
||||
}
|
||||
|
||||
/** @name PalletReferendaReferendumInfoConvictionVotingTally (603) */
|
||||
/** @name PalletReferendaReferendumInfoConvictionVotingTally (604) */
|
||||
interface PalletReferendaReferendumInfoConvictionVotingTally extends Enum {
|
||||
readonly isOngoing: boolean;
|
||||
readonly asOngoing: PalletReferendaReferendumStatusConvictionVotingTally;
|
||||
@@ -5528,7 +5565,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Ongoing' | 'Approved' | 'Rejected' | 'Cancelled' | 'TimedOut' | 'Killed';
|
||||
}
|
||||
|
||||
/** @name PalletReferendaReferendumStatusConvictionVotingTally (604) */
|
||||
/** @name PalletReferendaReferendumStatusConvictionVotingTally (605) */
|
||||
interface PalletReferendaReferendumStatusConvictionVotingTally extends Struct {
|
||||
readonly track: u16;
|
||||
readonly origin: NodeRuntimeOriginCaller;
|
||||
@@ -5543,19 +5580,19 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly alarm: Option<ITuple<[u32, ITuple<[u32, u32]>]>>;
|
||||
}
|
||||
|
||||
/** @name PalletReferendaDeposit (605) */
|
||||
/** @name PalletReferendaDeposit (606) */
|
||||
interface PalletReferendaDeposit extends Struct {
|
||||
readonly who: AccountId32;
|
||||
readonly amount: u128;
|
||||
}
|
||||
|
||||
/** @name PalletReferendaDecidingStatus (608) */
|
||||
/** @name PalletReferendaDecidingStatus (609) */
|
||||
interface PalletReferendaDecidingStatus extends Struct {
|
||||
readonly since: u32;
|
||||
readonly confirming: Option<u32>;
|
||||
}
|
||||
|
||||
/** @name PalletReferendaError (612) */
|
||||
/** @name PalletReferendaError (613) */
|
||||
interface PalletReferendaError extends Enum {
|
||||
readonly isNotOngoing: boolean;
|
||||
readonly isHasDeposit: boolean;
|
||||
@@ -5571,14 +5608,14 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'NotOngoing' | 'HasDeposit' | 'BadTrack' | 'Full' | 'QueueEmpty' | 'BadReferendum' | 'NothingToDo' | 'NoTrack' | 'Unfinished' | 'NoPermission' | 'NoDeposit';
|
||||
}
|
||||
|
||||
/** @name PalletRemarkError (613) */
|
||||
/** @name PalletRemarkError (614) */
|
||||
interface PalletRemarkError extends Enum {
|
||||
readonly isEmpty: boolean;
|
||||
readonly isBadContext: boolean;
|
||||
readonly type: 'Empty' | 'BadContext';
|
||||
}
|
||||
|
||||
/** @name PalletConvictionVotingVoteVoting (615) */
|
||||
/** @name PalletConvictionVotingVoteVoting (616) */
|
||||
interface PalletConvictionVotingVoteVoting extends Enum {
|
||||
readonly isCasting: boolean;
|
||||
readonly asCasting: PalletConvictionVotingVoteCasting;
|
||||
@@ -5587,23 +5624,23 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Casting' | 'Delegating';
|
||||
}
|
||||
|
||||
/** @name PalletConvictionVotingVoteCasting (616) */
|
||||
/** @name PalletConvictionVotingVoteCasting (617) */
|
||||
interface PalletConvictionVotingVoteCasting extends Struct {
|
||||
readonly votes: Vec<ITuple<[u32, PalletConvictionVotingVoteAccountVote]>>;
|
||||
readonly delegations: PalletConvictionVotingDelegations;
|
||||
readonly prior: PalletConvictionVotingVotePriorLock;
|
||||
}
|
||||
|
||||
/** @name PalletConvictionVotingDelegations (620) */
|
||||
/** @name PalletConvictionVotingDelegations (621) */
|
||||
interface PalletConvictionVotingDelegations extends Struct {
|
||||
readonly votes: u128;
|
||||
readonly capital: u128;
|
||||
}
|
||||
|
||||
/** @name PalletConvictionVotingVotePriorLock (621) */
|
||||
/** @name PalletConvictionVotingVotePriorLock (622) */
|
||||
interface PalletConvictionVotingVotePriorLock extends ITuple<[u32, u128]> {}
|
||||
|
||||
/** @name PalletConvictionVotingVoteDelegating (622) */
|
||||
/** @name PalletConvictionVotingVoteDelegating (623) */
|
||||
interface PalletConvictionVotingVoteDelegating extends Struct {
|
||||
readonly balance: u128;
|
||||
readonly target: AccountId32;
|
||||
@@ -5612,7 +5649,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly prior: PalletConvictionVotingVotePriorLock;
|
||||
}
|
||||
|
||||
/** @name PalletConvictionVotingError (626) */
|
||||
/** @name PalletConvictionVotingError (627) */
|
||||
interface PalletConvictionVotingError extends Enum {
|
||||
readonly isNotOngoing: boolean;
|
||||
readonly isNotVoter: boolean;
|
||||
@@ -5629,7 +5666,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'NotOngoing' | 'NotVoter' | 'NoPermission' | 'NoPermissionYet' | 'AlreadyDelegating' | 'AlreadyVoting' | 'InsufficientFunds' | 'NotDelegating' | 'Nonsense' | 'MaxVotesReached' | 'ClassNeeded' | 'BadClass';
|
||||
}
|
||||
|
||||
/** @name PalletWhitelistError (627) */
|
||||
/** @name PalletWhitelistError (628) */
|
||||
interface PalletWhitelistError extends Enum {
|
||||
readonly isUnavailablePreImage: boolean;
|
||||
readonly isUndecodableCall: boolean;
|
||||
@@ -5639,7 +5676,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'UnavailablePreImage' | 'UndecodableCall' | 'InvalidCallWeightWitness' | 'CallIsNotWhitelisted' | 'CallAlreadyWhitelisted';
|
||||
}
|
||||
|
||||
/** @name PalletAllianceMemberRole (632) */
|
||||
/** @name PalletAllianceMemberRole (633) */
|
||||
interface PalletAllianceMemberRole extends Enum {
|
||||
readonly isFounder: boolean;
|
||||
readonly isFellow: boolean;
|
||||
@@ -5647,7 +5684,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Founder' | 'Fellow' | 'Ally';
|
||||
}
|
||||
|
||||
/** @name PalletAllianceError (637) */
|
||||
/** @name PalletAllianceError (638) */
|
||||
interface PalletAllianceError extends Enum {
|
||||
readonly isMembersAlreadyInitialized: boolean;
|
||||
readonly isAlreadyMember: boolean;
|
||||
@@ -5673,15 +5710,15 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'MembersAlreadyInitialized' | 'AlreadyMember' | 'NotMember' | 'NotAlly' | 'NotFounder' | 'UpForKicking' | 'NoVotingRights' | 'AlreadyElevated' | 'AlreadyUnscrupulous' | 'AccountNonGrata' | 'NotListedAsUnscrupulous' | 'TooManyUnscrupulousItems' | 'TooLongWebsiteUrl' | 'InsufficientFunds' | 'WithoutIdentityDisplayAndWebsite' | 'WithoutGoodIdentityJudgement' | 'MissingProposalHash' | 'NotVetoableProposal' | 'MissingAnnouncement' | 'TooManyMembers' | 'TooManyAnnouncements';
|
||||
}
|
||||
|
||||
/** @name PalletNominationPoolsPoolMember (638) */
|
||||
/** @name PalletNominationPoolsPoolMember (639) */
|
||||
interface PalletNominationPoolsPoolMember extends Struct {
|
||||
readonly poolId: u32;
|
||||
readonly points: u128;
|
||||
readonly rewardPoolTotalEarnings: u128;
|
||||
readonly lastRecordedRewardCounter: u128;
|
||||
readonly unbondingEras: BTreeMap<u32, u128>;
|
||||
}
|
||||
|
||||
/** @name PalletNominationPoolsBondedPoolInner (641) */
|
||||
/** @name PalletNominationPoolsBondedPoolInner (642) */
|
||||
interface PalletNominationPoolsBondedPoolInner extends Struct {
|
||||
readonly points: u128;
|
||||
readonly state: PalletNominationPoolsPoolState;
|
||||
@@ -5689,7 +5726,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly roles: PalletNominationPoolsPoolRoles;
|
||||
}
|
||||
|
||||
/** @name PalletNominationPoolsPoolRoles (642) */
|
||||
/** @name PalletNominationPoolsPoolRoles (643) */
|
||||
interface PalletNominationPoolsPoolRoles extends Struct {
|
||||
readonly depositor: AccountId32;
|
||||
readonly root: Option<AccountId32>;
|
||||
@@ -5697,26 +5734,26 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly stateToggler: Option<AccountId32>;
|
||||
}
|
||||
|
||||
/** @name PalletNominationPoolsRewardPool (643) */
|
||||
/** @name PalletNominationPoolsRewardPool (644) */
|
||||
interface PalletNominationPoolsRewardPool extends Struct {
|
||||
readonly balance: u128;
|
||||
readonly totalEarnings: u128;
|
||||
readonly points: U256;
|
||||
readonly lastRecordedRewardCounter: u128;
|
||||
readonly lastRecordedTotalPayouts: u128;
|
||||
readonly totalRewardsClaimed: u128;
|
||||
}
|
||||
|
||||
/** @name PalletNominationPoolsSubPools (646) */
|
||||
/** @name PalletNominationPoolsSubPools (645) */
|
||||
interface PalletNominationPoolsSubPools extends Struct {
|
||||
readonly noEra: PalletNominationPoolsUnbondPool;
|
||||
readonly withEra: BTreeMap<u32, PalletNominationPoolsUnbondPool>;
|
||||
}
|
||||
|
||||
/** @name PalletNominationPoolsUnbondPool (647) */
|
||||
/** @name PalletNominationPoolsUnbondPool (646) */
|
||||
interface PalletNominationPoolsUnbondPool extends Struct {
|
||||
readonly points: u128;
|
||||
readonly balance: u128;
|
||||
}
|
||||
|
||||
/** @name PalletNominationPoolsError (653) */
|
||||
/** @name PalletNominationPoolsError (652) */
|
||||
interface PalletNominationPoolsError extends Enum {
|
||||
readonly isPoolNotFound: boolean;
|
||||
readonly isPoolMemberNotFound: boolean;
|
||||
@@ -5729,7 +5766,6 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isMinimumBondNotMet: boolean;
|
||||
readonly isOverflowRisk: boolean;
|
||||
readonly isNotDestroying: boolean;
|
||||
readonly isNotOnlyPoolMember: boolean;
|
||||
readonly isNotNominator: boolean;
|
||||
readonly isNotKickerOrDestroying: boolean;
|
||||
readonly isNotOpen: boolean;
|
||||
@@ -5740,12 +5776,11 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isMetadataExceedsMaxLen: boolean;
|
||||
readonly isDefensive: boolean;
|
||||
readonly asDefensive: PalletNominationPoolsDefensiveError;
|
||||
readonly isNotEnoughPointsToUnbond: boolean;
|
||||
readonly isPartialUnbondNotAllowedPermissionlessly: boolean;
|
||||
readonly type: 'PoolNotFound' | 'PoolMemberNotFound' | 'RewardPoolNotFound' | 'SubPoolsNotFound' | 'AccountBelongsToOtherPool' | 'FullyUnbonding' | 'MaxUnbondingLimit' | 'CannotWithdrawAny' | 'MinimumBondNotMet' | 'OverflowRisk' | 'NotDestroying' | 'NotOnlyPoolMember' | 'NotNominator' | 'NotKickerOrDestroying' | 'NotOpen' | 'MaxPools' | 'MaxPoolMembers' | 'CanNotChangeState' | 'DoesNotHavePermission' | 'MetadataExceedsMaxLen' | 'Defensive' | 'NotEnoughPointsToUnbond' | 'PartialUnbondNotAllowedPermissionlessly';
|
||||
readonly type: 'PoolNotFound' | 'PoolMemberNotFound' | 'RewardPoolNotFound' | 'SubPoolsNotFound' | 'AccountBelongsToOtherPool' | 'FullyUnbonding' | 'MaxUnbondingLimit' | 'CannotWithdrawAny' | 'MinimumBondNotMet' | 'OverflowRisk' | 'NotDestroying' | 'NotNominator' | 'NotKickerOrDestroying' | 'NotOpen' | 'MaxPools' | 'MaxPoolMembers' | 'CanNotChangeState' | 'DoesNotHavePermission' | 'MetadataExceedsMaxLen' | 'Defensive' | 'PartialUnbondNotAllowedPermissionlessly';
|
||||
}
|
||||
|
||||
/** @name PalletNominationPoolsDefensiveError (654) */
|
||||
/** @name PalletNominationPoolsDefensiveError (653) */
|
||||
interface PalletNominationPoolsDefensiveError extends Enum {
|
||||
readonly isNotEnoughSpaceInUnbondPool: boolean;
|
||||
readonly isPoolNotFound: boolean;
|
||||
@@ -5755,7 +5790,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'NotEnoughSpaceInUnbondPool' | 'PoolNotFound' | 'RewardPoolNotFound' | 'SubPoolsNotFound' | 'BondedStashKilledPrematurely';
|
||||
}
|
||||
|
||||
/** @name PalletReferendaReferendumInfoRankedCollectiveTally (655) */
|
||||
/** @name PalletReferendaReferendumInfoRankedCollectiveTally (654) */
|
||||
interface PalletReferendaReferendumInfoRankedCollectiveTally extends Enum {
|
||||
readonly isOngoing: boolean;
|
||||
readonly asOngoing: PalletReferendaReferendumStatusRankedCollectiveTally;
|
||||
@@ -5772,7 +5807,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Ongoing' | 'Approved' | 'Rejected' | 'Cancelled' | 'TimedOut' | 'Killed';
|
||||
}
|
||||
|
||||
/** @name PalletReferendaReferendumStatusRankedCollectiveTally (656) */
|
||||
/** @name PalletReferendaReferendumStatusRankedCollectiveTally (655) */
|
||||
interface PalletReferendaReferendumStatusRankedCollectiveTally extends Struct {
|
||||
readonly track: u16;
|
||||
readonly origin: NodeRuntimeOriginCaller;
|
||||
@@ -5787,12 +5822,12 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly alarm: Option<ITuple<[u32, ITuple<[u32, u32]>]>>;
|
||||
}
|
||||
|
||||
/** @name PalletRankedCollectiveMemberRecord (659) */
|
||||
/** @name PalletRankedCollectiveMemberRecord (658) */
|
||||
interface PalletRankedCollectiveMemberRecord extends Struct {
|
||||
readonly rank: u16;
|
||||
}
|
||||
|
||||
/** @name PalletRankedCollectiveError (663) */
|
||||
/** @name PalletRankedCollectiveError (662) */
|
||||
interface PalletRankedCollectiveError extends Enum {
|
||||
readonly isAlreadyMember: boolean;
|
||||
readonly isNotMember: boolean;
|
||||
@@ -5806,7 +5841,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'AlreadyMember' | 'NotMember' | 'NotPolling' | 'Ongoing' | 'NoneRemaining' | 'Corruption' | 'RankTooLow' | 'InvalidWitness' | 'NoPermission';
|
||||
}
|
||||
|
||||
/** @name SpRuntimeMultiSignature (665) */
|
||||
/** @name SpRuntimeMultiSignature (664) */
|
||||
interface SpRuntimeMultiSignature extends Enum {
|
||||
readonly isEd25519: boolean;
|
||||
readonly asEd25519: SpCoreEd25519Signature;
|
||||
@@ -5817,34 +5852,34 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
|
||||
}
|
||||
|
||||
/** @name SpCoreEcdsaSignature (666) */
|
||||
/** @name SpCoreEcdsaSignature (665) */
|
||||
interface SpCoreEcdsaSignature extends U8aFixed {}
|
||||
|
||||
/** @name FrameSystemExtensionsCheckNonZeroSender (669) */
|
||||
/** @name FrameSystemExtensionsCheckNonZeroSender (668) */
|
||||
type FrameSystemExtensionsCheckNonZeroSender = Null;
|
||||
|
||||
/** @name FrameSystemExtensionsCheckSpecVersion (670) */
|
||||
/** @name FrameSystemExtensionsCheckSpecVersion (669) */
|
||||
type FrameSystemExtensionsCheckSpecVersion = Null;
|
||||
|
||||
/** @name FrameSystemExtensionsCheckTxVersion (671) */
|
||||
/** @name FrameSystemExtensionsCheckTxVersion (670) */
|
||||
type FrameSystemExtensionsCheckTxVersion = Null;
|
||||
|
||||
/** @name FrameSystemExtensionsCheckGenesis (672) */
|
||||
/** @name FrameSystemExtensionsCheckGenesis (671) */
|
||||
type FrameSystemExtensionsCheckGenesis = Null;
|
||||
|
||||
/** @name FrameSystemExtensionsCheckNonce (675) */
|
||||
/** @name FrameSystemExtensionsCheckNonce (674) */
|
||||
interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
|
||||
|
||||
/** @name FrameSystemExtensionsCheckWeight (676) */
|
||||
/** @name FrameSystemExtensionsCheckWeight (675) */
|
||||
type FrameSystemExtensionsCheckWeight = Null;
|
||||
|
||||
/** @name PalletAssetTxPaymentChargeAssetTxPayment (677) */
|
||||
/** @name PalletAssetTxPaymentChargeAssetTxPayment (676) */
|
||||
interface PalletAssetTxPaymentChargeAssetTxPayment extends Struct {
|
||||
readonly tip: Compact<u128>;
|
||||
readonly assetId: Option<u32>;
|
||||
}
|
||||
|
||||
/** @name NodeRuntimeRuntime (678) */
|
||||
/** @name NodeRuntimeRuntime (677) */
|
||||
type NodeRuntimeRuntime = Null;
|
||||
|
||||
} // declare module
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.14.1' };
|
||||
|
||||
@@ -42,6 +42,7 @@ import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMu
|
||||
import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery';
|
||||
import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, OpaqueMetadata, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
|
||||
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafBatchProof, MmrLeafIndex, MmrLeafProof, MmrNodeIndex, MmrProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { NpApiError } from '@polkadot/types/interfaces/nompools';
|
||||
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
|
||||
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
|
||||
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
|
||||
@@ -59,7 +60,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 { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, RuntimeVersionPre3, RuntimeVersionPre4, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
|
||||
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
|
||||
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ApplyExtrinsicResultPre6, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModulePre6, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorPre6, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchOutcomePre6, 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, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
|
||||
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ApplyExtrinsicResultPre6, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModulePre6, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorPre6, DispatchErrorPre6First, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchOutcomePre6, 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, TransactionalError, 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 { Multiplier } from '@polkadot/types/interfaces/txpayment';
|
||||
import type { TransactionSource, TransactionValidity, ValidTransaction } from '@polkadot/types/interfaces/txqueue';
|
||||
@@ -330,6 +331,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
DispatchErrorModuleU8: DispatchErrorModuleU8;
|
||||
DispatchErrorModuleU8a: DispatchErrorModuleU8a;
|
||||
DispatchErrorPre6: DispatchErrorPre6;
|
||||
DispatchErrorPre6First: DispatchErrorPre6First;
|
||||
DispatchErrorTo198: DispatchErrorTo198;
|
||||
DispatchFeePayment: DispatchFeePayment;
|
||||
DispatchInfo: DispatchInfo;
|
||||
@@ -688,6 +690,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
NominatorIndex: NominatorIndex;
|
||||
NominatorIndexCompact: NominatorIndexCompact;
|
||||
NotConnectedPeer: NotConnectedPeer;
|
||||
NpApiError: NpApiError;
|
||||
Null: Null;
|
||||
OccupiedCore: OccupiedCore;
|
||||
OccupiedCoreAssumption: OccupiedCoreAssumption;
|
||||
|
||||
@@ -20,17 +20,17 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.12.1",
|
||||
"version": "8.14.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/util": "^10.0.1",
|
||||
"@polkadot/x-bigint": "^10.0.1"
|
||||
"@babel/runtime": "^7.18.9",
|
||||
"@polkadot/util": "^10.1.1",
|
||||
"@polkadot/x-bigint": "^10.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "8.12.1",
|
||||
"@polkadot/types-augment": "8.12.1",
|
||||
"@polkadot/types-support": "8.12.1",
|
||||
"@polkadot/util-crypto": "^10.0.1"
|
||||
"@polkadot/types": "8.14.1",
|
||||
"@polkadot/types-augment": "8.14.1",
|
||||
"@polkadot/types-support": "8.14.1",
|
||||
"@polkadot/util-crypto": "^10.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
const result = new Array<AnyJson>(this.length);
|
||||
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
result[i] = this[i].toHuman(isExtended);
|
||||
result[i] = this[i] && this[i].toHuman(isExtended);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -132,7 +132,22 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
const result = new Array<AnyJson>(this.length);
|
||||
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
result[i] = this[i].toJSON();
|
||||
// We actually log inside the U8a decoding and use JSON.stringify(...), which
|
||||
// means that the Vec may be partially populated (same applies to toHuman, same check)
|
||||
result[i] = this[i] && this[i].toJSON();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Converts the value in a best-fit primitive form
|
||||
*/
|
||||
public toPrimitive (): AnyJson {
|
||||
const result = new Array<AnyJson>(this.length);
|
||||
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
result[i] = this[i] && this[i].toPrimitive();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -83,6 +83,13 @@ export abstract class AbstractBase<T extends Codec> implements Codec {
|
||||
return this.#raw.toJSON();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Converts the value in a best-fit primitive form
|
||||
*/
|
||||
public toPrimitive (): AnyJson {
|
||||
return this.#raw.toPrimitive();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the string representation of the value
|
||||
*/
|
||||
|
||||
@@ -207,6 +207,15 @@ export abstract class AbstractInt extends BN implements INumber {
|
||||
: this.toNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the value in a primitive form, either number when <= 52 bits, or string otherwise
|
||||
*/
|
||||
public toPrimitive (): number | string {
|
||||
return super.bitLength() > MAX_NUMBER_BITS
|
||||
? this.toString()
|
||||
: this.toNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
|
||||
@@ -171,6 +171,13 @@ export class Compact<T extends INumber> implements ICompact<T> {
|
||||
return this.#raw.toNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Converts the value in a best-fit primitive form
|
||||
*/
|
||||
public toPrimitive (): string | number {
|
||||
return this.#raw.toPrimitive();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
|
||||
@@ -72,6 +72,10 @@ export class DoNotConstruct implements Codec {
|
||||
throw this.#neverError;
|
||||
}
|
||||
|
||||
toPrimitive (): AnyJson {
|
||||
throw this.#neverError;
|
||||
}
|
||||
|
||||
toRawType (): string {
|
||||
throw this.#neverError;
|
||||
}
|
||||
|
||||
@@ -414,6 +414,15 @@ export class Enum implements IEnum {
|
||||
return this.index;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Converts the value in a best-fit primitive form
|
||||
*/
|
||||
public toPrimitive (): AnyJson {
|
||||
return this.#isBasic
|
||||
? this.type
|
||||
: { [stringCamelCase(this.type)]: this.#raw.toPrimitive() };
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a raw struct representation of the enum types
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user