Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7a5a409d8 | ||
|
|
bd0b6426a7 | ||
|
|
06cb4aadfa | ||
|
|
f76efa5f8a | ||
|
|
cdc8d68e8b | ||
|
|
a208cc9bb5 | ||
|
|
6192e60668 | ||
|
|
c5eb40a98d | ||
|
|
ab9b47ba51 | ||
|
|
dc0a5f3dec | ||
|
|
3628a1bf86 | ||
|
|
a51fed491b | ||
|
|
4616865333 | ||
|
|
e840d43463 | ||
|
|
c384311570 | ||
|
|
521d44bb73 | ||
|
|
865fb63002 | ||
|
|
63c58538dc | ||
|
|
4166cb7fa5 | ||
|
|
8810f31eae | ||
|
|
3038edec72 | ||
|
|
9e09c11b0b | ||
|
|
c6d1e00b09 | ||
|
|
c5f467dce1 | ||
|
|
c8ce65f079 | ||
|
|
71a8ff55d6 | ||
|
|
4825d5466d | ||
|
|
c6a0f3b8d5 | ||
|
|
100f008ffa | ||
|
|
02b9136d56 | ||
|
|
8379783835 | ||
|
|
5730005eba | ||
|
|
f701c398c3 | ||
|
|
5a90d02f1f | ||
|
|
4dad961106 | ||
|
|
d41491e859 | ||
|
|
1fbfbac062 | ||
|
|
a7d826f839 | ||
|
|
8649c17dd7 | ||
|
|
9b794e963d | ||
|
|
ad9a162b01 | ||
|
|
82c16e2aed | ||
|
|
e6a432049c | ||
|
|
84c70a850b | ||
|
|
937efb631b | ||
|
|
99898e3310 | ||
|
|
d540355729 | ||
|
|
5fac4d9398 | ||
|
|
baa2caae68 | ||
|
|
62d9889737 | ||
|
|
7c0e9831c3 | ||
|
|
c601e4163a | ||
|
|
1404994792 | ||
|
|
a95d36d67a | ||
|
|
48b43b9129 | ||
|
|
c60c1efd46 | ||
|
|
ef54cfb29b | ||
|
|
23c23a81b3 | ||
|
|
3d8ba0f1bf | ||
|
|
b39efbeaf2 | ||
|
|
b305caee6e | ||
|
|
143a149628 | ||
|
|
8f80c0391d | ||
|
|
1364cb8264 | ||
|
|
0e12ebad1d | ||
|
|
8dc0f0486d | ||
|
|
6159270465 | ||
|
|
40b3c54916 | ||
|
|
85e7e3c11c | ||
|
|
3ad01d27b2 | ||
|
|
05b0ff2aba | ||
|
|
84c9da8374 | ||
|
|
6222672faa | ||
|
|
96f2f83cd5 | ||
|
|
f444d9ed75 | ||
|
|
d93a127d88 | ||
|
|
3a9a35a392 | ||
|
|
5c655ca029 | ||
|
|
1808cb0a9d | ||
|
|
54e94ec6bc | ||
|
|
22db4f1c3d | ||
|
|
e514a59e63 | ||
|
|
3318a7566f | ||
|
|
fd568c0341 | ||
|
|
2edcef6ff5 | ||
|
|
264cc9365e | ||
|
|
6e23a27ce1 | ||
|
|
38d39a4d13 | ||
|
|
6954ec794c | ||
|
|
3ee6eb5a13 | ||
|
|
9d1c848f28 | ||
|
|
1d3258f537 | ||
|
|
e8d7013172 | ||
|
|
55ccdd2fbc |
+3
-1
@@ -52,4 +52,6 @@
|
||||
7.14.2
|
||||
7.14.3
|
||||
8.0.2
|
||||
8.3.2
|
||||
8.3.2
|
||||
8.4.2
|
||||
8.6.2
|
||||
@@ -1,5 +1,65 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 8.6.2 May 30, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Don't apply default to `Option<bool>` opt-in
|
||||
- Lower default historic LRU cache size (128 entries, 192MB est)
|
||||
- Cater for updates required by TS 4.7.2
|
||||
|
||||
|
||||
## 8.6.1 May 29, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Add codec support for specialized `Option<bool>`
|
||||
- Optimization for `createClass` with shortcut typeDef creation
|
||||
- Optimization of `registry.getOrUnknown` with lookup cache
|
||||
- Optimization of Array allocations in decoding
|
||||
- Use `compactFromU8aLim` & `u8aConcatStrict` variants
|
||||
- Adjust `.inspect()` for `ExtrinsicPayload`
|
||||
- Adjust Kusama `StakingLedger` for runtime 1051
|
||||
- Update to latest Substrate, Kusama & Polkadot static metadata
|
||||
|
||||
|
||||
## 8.5.1 May 22, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
- Bump `@substrate/connect` to 0.7.5 (Thanks to https://github.com/wirednkod)
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust extrinsic inspect for signed/unsigned
|
||||
- Add support for `mmr_generateBatchProof` RPC
|
||||
- Add additional `isCodec` checks to error/event `.is`
|
||||
- Add support for `Vec<Option<X>>` in typegen
|
||||
- Update to latest Substrate, Kusama & Polkadot static metadata
|
||||
|
||||
|
||||
## 8.4.2 May 15, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Expand/fix TS typings for `MortalEra.{birth, death}(...)`
|
||||
|
||||
|
||||
## 8.4.1 May 14, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Added support for typegen over `Range/RangeInclusive` types
|
||||
- Add explicit support for `Call` typegen (inclusive of non-defaults)
|
||||
- Deupe `wss://` handling in `polkadot-types-from-{chain, defs}`
|
||||
- Allow for optional `definitions.ts` in typegen (only use chain)
|
||||
- Optimize `Compact<*>` decoding in Uint8Array streams
|
||||
- Use `I*` interfaces for extrinsic payload getters
|
||||
- Re-add support for historic linked-map queries
|
||||
- Update to latest Substrate, Kusama & Polkadot static metadata
|
||||
- Add latest upgrade blocks for Polkadot, Kusama & Westend
|
||||
|
||||
|
||||
## 8.3.2 May 8, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
2939 Jaco 8.3.2 (#4800)
|
||||
2985 Jaco 8.6.2 (#4876)
|
||||
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)
|
||||
@@ -14,6 +14,7 @@
|
||||
4 Alexander Popiak Add asset id in signing (#4009)
|
||||
4 Joshy Orndorff spelling; efect -> effect (#2295)
|
||||
4 Nantian fix bigint type (#3869)
|
||||
4 Nikos Kontakis Update substrate connect to 0.7.5 (#4835)
|
||||
4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574)
|
||||
4 Thibaut Sardan no subscription for http (#3127)
|
||||
3 André Silva add support for ValidationCodeHash (#3640)
|
||||
@@ -26,7 +27,6 @@
|
||||
3 Julien Eluard Fixed typos about module balances (#1402)
|
||||
3 KarishmaBothara Backward compatibility thing (#3511)
|
||||
3 Miguel Hervas Adding RT4 Types (#3007)
|
||||
3 Nikos Kontakis Bump @substrate/connect in rpc-provider to 0.7.4 (#4796)
|
||||
3 Shawn Tabrizi Add `isReadyOrError` when connecting to API (#2577)
|
||||
3 YJ feat: Vote interface as U8a (#1061)
|
||||
2 Alexander Krupenkin Add [u8; 33] type width for U8aFixed type (#2391)
|
||||
|
||||
+6
-6
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "commonjs",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
@@ -31,15 +31,15 @@
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.10",
|
||||
"@babel/core": "^7.18.2",
|
||||
"@babel/register": "^7.17.7",
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/dev": "^0.66.17",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/dev": "^0.66.32",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^27.5.0",
|
||||
"@types/jest": "^27.5.1",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"typescript": "^4.6.4"
|
||||
"typescript": "^4.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/api-base": "8.3.2",
|
||||
"@polkadot/rpc-augment": "8.3.2",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/types-augment": "8.3.2",
|
||||
"@polkadot/types-codec": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1"
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/api-base": "8.6.2",
|
||||
"@polkadot/rpc-augment": "8.6.2",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-augment": "8.6.2",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types-support": "8.3.2"
|
||||
"@polkadot/types-support": "8.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { Codec } from '@polkadot/types-codec/types';
|
||||
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/consts' {
|
||||
export interface AugmentedConsts<ApiType extends ApiTypes> {
|
||||
@@ -63,58 +63,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* The list of thresholds separating the various bags.
|
||||
*
|
||||
* Ids are separated into unsorted bags according to their score. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
|
||||
* is less than or equal to its upper threshold.
|
||||
*
|
||||
* When ids are iterated, higher bags are iterated completely before lower bags. This means
|
||||
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
|
||||
* score, but peer ids within a particular bag are sorted in insertion order.
|
||||
*
|
||||
* # Expressing the constant
|
||||
*
|
||||
* This constant must be sorted in strictly increasing order. Duplicate items are not
|
||||
* permitted.
|
||||
*
|
||||
* There is an implied upper limit of `Score::MAX`; that value does not need to be
|
||||
* specified within the bag. For any two threshold lists, if one ends with
|
||||
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
|
||||
* lists will behave identically.
|
||||
*
|
||||
* # Calculation
|
||||
*
|
||||
* It is recommended to generate the set of thresholds in a geometric series, such that
|
||||
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
|
||||
* constant_ratio).max(threshold[k] + 1)` for all `k`.
|
||||
*
|
||||
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
|
||||
*
|
||||
* # Examples
|
||||
*
|
||||
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
|
||||
* iteration is strictly in insertion order.
|
||||
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is equal to 2.
|
||||
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is approximately equal to 1.248.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
|
||||
* into bag 0, an id with score 2 will fall into bag 1, etc.
|
||||
*
|
||||
* # Migration
|
||||
*
|
||||
* In the event that this list ever changes, a copy of the old bags list must be retained.
|
||||
* With that `List::migrate` can be called, which will perform the appropriate migration.
|
||||
**/
|
||||
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* The minimum amount required to keep an account open.
|
||||
@@ -304,20 +252,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* take place over multiple blocks.
|
||||
**/
|
||||
maxElectingVoters: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum length (bytes) that the mined solution should consume.
|
||||
*
|
||||
* The miner will ensure that the total length of the unsigned solution will not exceed
|
||||
* this value.
|
||||
**/
|
||||
minerMaxLength: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum weight that the miner should consume.
|
||||
*
|
||||
* The miner will ensure that the total weight of the unsigned solution will not exceed
|
||||
* this value, based on [`WeightInfo::submit_unsigned`].
|
||||
**/
|
||||
minerMaxWeight: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The priority of the unsigned transaction submitted in the unsigned-phase
|
||||
**/
|
||||
@@ -358,7 +292,9 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
/**
|
||||
* Maximum weight of a signed solution.
|
||||
*
|
||||
* This should probably be similar to [`Config::MinerMaxWeight`].
|
||||
* If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of
|
||||
* this pallet), then [`MinerConfig::solution_weight`] is used to compare against
|
||||
* this value.
|
||||
**/
|
||||
signedMaxWeight: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -519,6 +455,24 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
nominationPools: {
|
||||
/**
|
||||
* The minimum pool points-to-balance ratio that must be maintained for it to be `open`.
|
||||
* This is important in the event slashing takes place and the pool's points-to-balance
|
||||
* ratio becomes disproportional.
|
||||
* 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>;
|
||||
/**
|
||||
* The nomination pool's pallet id.
|
||||
**/
|
||||
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
paras: {
|
||||
unsignedPriority: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -850,10 +804,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
[key: string]: Codec;
|
||||
};
|
||||
transactionPayment: {
|
||||
/**
|
||||
* The polynomial that is applied in order to derive fee from length.
|
||||
**/
|
||||
lengthToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
|
||||
* `priority`
|
||||
@@ -878,10 +828,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* transactions.
|
||||
**/
|
||||
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The polynomial that is applied in order to derive fee from weight.
|
||||
**/
|
||||
weightToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
@@ -945,5 +891,57 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* The list of thresholds separating the various bags.
|
||||
*
|
||||
* Ids are separated into unsorted bags according to their score. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
|
||||
* is less than or equal to its upper threshold.
|
||||
*
|
||||
* When ids are iterated, higher bags are iterated completely before lower bags. This means
|
||||
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
|
||||
* score, but peer ids within a particular bag are sorted in insertion order.
|
||||
*
|
||||
* # Expressing the constant
|
||||
*
|
||||
* This constant must be sorted in strictly increasing order. Duplicate items are not
|
||||
* permitted.
|
||||
*
|
||||
* There is an implied upper limit of `Score::MAX`; that value does not need to be
|
||||
* specified within the bag. For any two threshold lists, if one ends with
|
||||
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
|
||||
* lists will behave identically.
|
||||
*
|
||||
* # Calculation
|
||||
*
|
||||
* It is recommended to generate the set of thresholds in a geometric series, such that
|
||||
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
|
||||
* constant_ratio).max(threshold[k] + 1)` for all `k`.
|
||||
*
|
||||
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
|
||||
*
|
||||
* # Examples
|
||||
*
|
||||
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
|
||||
* iteration is strictly in insertion order.
|
||||
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is equal to 2.
|
||||
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is approximately equal to 1.248.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
|
||||
* into bag 0, an id with score 2 will fall into bag 1, etc.
|
||||
*
|
||||
* # Migration
|
||||
*
|
||||
* In the event that this list ever changes, a copy of the old bags list must be retained.
|
||||
* With that `List::migrate` can be called, which will perform the appropriate migration.
|
||||
**/
|
||||
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
} // AugmentedConsts
|
||||
} // declare module
|
||||
|
||||
@@ -78,6 +78,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* A given equivocation report is valid but already previously reported.
|
||||
**/
|
||||
DuplicateOffenceReport: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Submitted configuration is invalid.
|
||||
**/
|
||||
InvalidConfiguration: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An equivocation proof provided as part of an equivocation report is invalid.
|
||||
**/
|
||||
@@ -91,24 +95,6 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Id not found in list.
|
||||
**/
|
||||
IdNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An Id does not have a greater score than another Id.
|
||||
**/
|
||||
NotHeavier: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Attempted to place node in front of a node in another bag.
|
||||
**/
|
||||
NotInSameBag: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* Beneficiary account must pre-exist
|
||||
@@ -903,6 +889,117 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
nominationPools: {
|
||||
/**
|
||||
* An account is already delegating in another pool. An account may only belong to one
|
||||
* pool at a time.
|
||||
**/
|
||||
AccountBelongsToOtherPool: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The member is already unbonding in this era.
|
||||
**/
|
||||
AlreadyUnbonding: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The pools state cannot be changed.
|
||||
**/
|
||||
CanNotChangeState: AugmentedError<ApiType>;
|
||||
/**
|
||||
* None of the funds can be withdrawn yet because the bonding duration has not passed.
|
||||
**/
|
||||
CannotWithdrawAny: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Some error occurred that should never happen. This should be reported to the
|
||||
* maintainers.
|
||||
**/
|
||||
DefensiveError: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The caller does not have adequate permissions.
|
||||
**/
|
||||
DoesNotHavePermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The member is fully unbonded (and thus cannot access the bonded and reward pool
|
||||
* anymore to, for example, collect rewards).
|
||||
**/
|
||||
FullyUnbonding: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The pool has insufficient balance to bond as a nominator.
|
||||
**/
|
||||
InsufficientBond: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many members in the pool or system.
|
||||
**/
|
||||
MaxPoolMembers: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The system is maxed out on pools.
|
||||
**/
|
||||
MaxPools: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The member cannot unbond further chunks due to reaching the limit.
|
||||
**/
|
||||
MaxUnbondingLimit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Metadata exceeds [`Config::MaxMetadataLen`]
|
||||
**/
|
||||
MetadataExceedsMaxLen: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The amount does not meet the minimum bond to either join or create a pool.
|
||||
**/
|
||||
MinimumBondNotMet: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A pool must be in [`PoolState::Destroying`] in order for the depositor to unbond or for
|
||||
* 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.
|
||||
**/
|
||||
NotKickerOrDestroying: AugmentedError<ApiType>;
|
||||
/**
|
||||
* 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
|
||||
**/
|
||||
NotOpen: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The transaction could not be executed due to overflow risk for the pool.
|
||||
**/
|
||||
OverflowRisk: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Partial unbonding now allowed permissionlessly.
|
||||
**/
|
||||
PartialUnbondNotAllowedPermissionlessly: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An account is not a member.
|
||||
**/
|
||||
PoolMemberNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A (bonded) pool id does not exist.
|
||||
**/
|
||||
PoolNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A reward pool does not exist. In all cases this is a system logic error.
|
||||
**/
|
||||
RewardPoolNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A sub pool does not exist.
|
||||
**/
|
||||
SubPoolsNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
paraInclusion: {
|
||||
/**
|
||||
* Bitfield consists of zeros only.
|
||||
@@ -1866,6 +1963,16 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* A error in the list interface implementation.
|
||||
**/
|
||||
List: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
xcmPallet: {
|
||||
/**
|
||||
* The location is invalid since it already has a subscription from us.
|
||||
|
||||
@@ -6,35 +6,32 @@ import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32,
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, KusamaRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PalletStakingValidatorPrefs, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, KusamaRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNominationPoolsPoolState, PalletStakingExposure, PalletStakingValidatorPrefs, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/events' {
|
||||
export interface AugmentedEvents<ApiType extends ApiTypes> {
|
||||
auctions: {
|
||||
/**
|
||||
* An auction ended. All funds become unreserved. `[auction_index]`
|
||||
* An auction ended. All funds become unreserved.
|
||||
**/
|
||||
AuctionClosed: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* An auction started. Provides its index and the block number where it will begin to
|
||||
* close and the first lease period of the quadruplet that is auctioned.
|
||||
* `[auction_index, lease_period, ending]`
|
||||
**/
|
||||
AuctionStarted: AugmentedEvent<ApiType, [u32, u32, u32]>;
|
||||
/**
|
||||
* A new bid has been accepted as the current winner.
|
||||
* `[who, para_id, amount, first_slot, last_slot]`
|
||||
**/
|
||||
BidAccepted: AugmentedEvent<ApiType, [AccountId32, u32, u128, u32, u32]>;
|
||||
/**
|
||||
* Someone attempted to lease the same slot twice for a parachain. The amount is held in reserve
|
||||
* but no parachain slot has been leased.
|
||||
* `[parachain_id, leaser, amount]`
|
||||
**/
|
||||
ReserveConfiscated: AugmentedEvent<ApiType, [u32, AccountId32, u128]>;
|
||||
/**
|
||||
* Funds were reserved for a winning bid. First balance is the extra amount reserved.
|
||||
* Second is the total. `[bidder, extra_reserved, total_amount]`
|
||||
* Second is the total.
|
||||
**/
|
||||
Reserved: AugmentedEvent<ApiType, [AccountId32, u128, u128]>;
|
||||
/**
|
||||
@@ -43,7 +40,6 @@ declare module '@polkadot/api-base/types/events' {
|
||||
Unreserved: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
/**
|
||||
* The winning offset was chosen for an auction. This will map into the `Winning` storage map.
|
||||
* `[auction_index, block_number]`
|
||||
**/
|
||||
WinningOffset: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
@@ -51,16 +47,6 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Moved an account from one bag to another.
|
||||
**/
|
||||
Rebagged: AugmentedEvent<ApiType, [AccountId32, u64, u64]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* A balance was set by root.
|
||||
@@ -167,7 +153,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
};
|
||||
claims: {
|
||||
/**
|
||||
* Someone claimed some DOTs. `[who, ethereum_address, amount]`
|
||||
* Someone claimed some DOTs.
|
||||
**/
|
||||
Claimed: AugmentedEvent<ApiType, [AccountId32, EthereumAddress, u128]>;
|
||||
/**
|
||||
@@ -217,23 +203,23 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
AddedToNewRaise: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* All loans in a fund have been refunded. `[fund_index]`
|
||||
* All loans in a fund have been refunded.
|
||||
**/
|
||||
AllRefunded: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Contributed to a crowd sale. `[who, fund_index, amount]`
|
||||
* Contributed to a crowd sale.
|
||||
**/
|
||||
Contributed: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
/**
|
||||
* Create a new crowdloaning campaign. `[fund_index]`
|
||||
* Create a new crowdloaning campaign.
|
||||
**/
|
||||
Created: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Fund is dissolved. `[fund_index]`
|
||||
* Fund is dissolved.
|
||||
**/
|
||||
Dissolved: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* The configuration to a crowdloan has been edited. `[fund_index]`
|
||||
* The configuration to a crowdloan has been edited.
|
||||
**/
|
||||
Edited: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
@@ -241,16 +227,16 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
HandleBidResult: AugmentedEvent<ApiType, [u32, Result<Null, SpRuntimeDispatchError>]>;
|
||||
/**
|
||||
* A memo has been updated. `[who, fund_index, memo]`
|
||||
* A memo has been updated.
|
||||
**/
|
||||
MemoUpdated: AugmentedEvent<ApiType, [AccountId32, u32, Bytes]>;
|
||||
/**
|
||||
* The loans in a fund have been partially dissolved, i.e. there are some left
|
||||
* over child keys that still need to be killed. `[fund_index]`
|
||||
* over child keys that still need to be killed.
|
||||
**/
|
||||
PartiallyRefunded: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Withdrew full balance of a contributor. `[who, fund_index, amount]`
|
||||
* Withdrew full balance of a contributor.
|
||||
**/
|
||||
Withdrew: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
/**
|
||||
@@ -545,6 +531,51 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
nominationPools: {
|
||||
/**
|
||||
* A member has became bonded in a pool.
|
||||
**/
|
||||
Bonded: AugmentedEvent<ApiType, [AccountId32, u32, u128, bool]>;
|
||||
/**
|
||||
* A pool has been created.
|
||||
**/
|
||||
Created: AugmentedEvent<ApiType, [AccountId32, u32]>;
|
||||
/**
|
||||
* A pool has been destroyed.
|
||||
**/
|
||||
Destroyed: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* A member has been removed from a pool.
|
||||
*
|
||||
* The removal can be voluntary (withdrawn all unbonded funds) or involuntary (kicked).
|
||||
**/
|
||||
MemberRemoved: AugmentedEvent<ApiType, [u32, AccountId32]>;
|
||||
/**
|
||||
* A payout has been made to a member.
|
||||
**/
|
||||
PaidOut: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
/**
|
||||
* The roles of a pool have been updated to the given new roles. Note that the depositor
|
||||
* can never change.
|
||||
**/
|
||||
RolesUpdated: AugmentedEvent<ApiType, [Option<AccountId32>, Option<AccountId32>, Option<AccountId32>]>;
|
||||
/**
|
||||
* The state of a pool has changed
|
||||
**/
|
||||
StateChanged: AugmentedEvent<ApiType, [u32, PalletNominationPoolsPoolState]>;
|
||||
/**
|
||||
* A member has unbonded from their pool.
|
||||
**/
|
||||
Unbonded: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
/**
|
||||
* A member has withdrawn from their pool.
|
||||
**/
|
||||
Withdrawn: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
offences: {
|
||||
/**
|
||||
* There is an offence reported of the given `kind` happened at the `session_index` and
|
||||
@@ -808,7 +839,6 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A para has won the right to a continuous set of lease periods as a parachain.
|
||||
* First balance is any extra amount reserved on top of the para's existing deposit.
|
||||
* Second balance is the total amount reserved.
|
||||
* `[parachain_id, leaser, period_begin, period_count, extra_reserved, total_amount]`
|
||||
**/
|
||||
Leased: AugmentedEvent<ApiType, [u32, AccountId32, u32, u32, u128, u128]>;
|
||||
/**
|
||||
@@ -1168,6 +1198,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* Batch of dispatches completed fully with no error.
|
||||
**/
|
||||
BatchCompleted: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* Batch of dispatches completed but has errors.
|
||||
**/
|
||||
BatchCompletedWithErrors: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* Batch of dispatches did not complete fully. Index of first failing dispatch given, as
|
||||
* well as the error.
|
||||
@@ -1181,6 +1215,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A single item within a Batch of dispatches has completed with no error.
|
||||
**/
|
||||
ItemCompleted: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* A single item within a Batch of dispatches has completed with error.
|
||||
**/
|
||||
ItemFailed: AugmentedEvent<ApiType, [SpRuntimeDispatchError]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -1201,6 +1239,20 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* Moved an account from one bag to another.
|
||||
**/
|
||||
Rebagged: AugmentedEvent<ApiType, [AccountId32, u64, u64]>;
|
||||
/**
|
||||
* Updated the score of some account to the given amount.
|
||||
**/
|
||||
ScoreUpdated: AugmentedEvent<ApiType, [AccountId32, u64]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
xcmPallet: {
|
||||
/**
|
||||
* Some assets have been placed in an asset trap.
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/storage' {
|
||||
@@ -68,7 +68,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* This field should always be populated during block processing unless
|
||||
* secondary plain slots are enabled (which don't contain a VRF output).
|
||||
*
|
||||
* It is set in `on_initialize`, before it will contain the value from the last block.
|
||||
* It is set in `on_finalize`, before it will contain the value from the last block.
|
||||
**/
|
||||
authorVrfRandomness: AugmentedQuery<ApiType, () => Observable<Option<U8aFixed>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Temporary value (cleared at block finalization) which is `Some`
|
||||
* if per-block initialization has already been called for current block.
|
||||
**/
|
||||
initialized: AugmentedQuery<ApiType, () => Observable<Option<Option<U8aFixed>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
initialized: AugmentedQuery<ApiType, () => Observable<Option<Option<SpConsensusBabeDigestsPreDigest>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* How late the current block is compared to its parent.
|
||||
*
|
||||
@@ -161,28 +161,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForListNodes: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A bag stored in storage.
|
||||
*
|
||||
* Stores a `Bag` struct, which stores head and tail pointers to itself.
|
||||
**/
|
||||
listBags: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<PalletBagsListListBag>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
|
||||
/**
|
||||
* A single node, within some bag.
|
||||
*
|
||||
* Nodes store links forward and back within their respective bags.
|
||||
**/
|
||||
listNodes: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletBagsListListNode>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* The Balances pallet example of storing the balance of an account.
|
||||
@@ -814,6 +792,95 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
nominationPools: {
|
||||
/**
|
||||
* Storage for bonded pools.
|
||||
**/
|
||||
bondedPools: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNominationPoolsBondedPoolInner>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForBondedPools: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForMetadata: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForPoolMembers: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForReversePoolIdLookup: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForRewardPools: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForSubPoolsStorage: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Ever increasing number of all pools created so far.
|
||||
**/
|
||||
lastPoolId: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Maximum number of members that can exist in the system. If `None`, then the count
|
||||
* members are not bound on a system wide basis.
|
||||
**/
|
||||
maxPoolMembers: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Maximum number of members that may belong to pool. If `None`, then the count of
|
||||
* members is not bound on a per pool basis.
|
||||
**/
|
||||
maxPoolMembersPerPool: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Maximum number of nomination pools that can exist. If `None`, then an unbounded number of
|
||||
* pools can exist.
|
||||
**/
|
||||
maxPools: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Metadata for the pool.
|
||||
**/
|
||||
metadata: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Bytes>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Minimum bond required to create a pool.
|
||||
*
|
||||
* This is the amount that the depositor must put as their initial stake in the pool, as an
|
||||
* indication of "skin in the game".
|
||||
**/
|
||||
minCreateBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Minimum amount to bond to join a pool.
|
||||
**/
|
||||
minJoinBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Active members.
|
||||
**/
|
||||
poolMembers: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletNominationPoolsPoolMember>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* A reverse lookup from the pool's account id to its id.
|
||||
*
|
||||
* This is only used for slashing. In all other instances, the pool id is used, and the
|
||||
* accounts are deterministically derived from it.
|
||||
**/
|
||||
reversePoolIdLookup: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Reward pools. This is where there rewards for each pool accumulate. When a members payout
|
||||
* is claimed, the balance comes out fo the reward pool. Keyed by the bonded pools account.
|
||||
**/
|
||||
rewardPools: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNominationPoolsRewardPool>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Groups of unbonding pools. Each group of unbonding pools belongs to a bonded pool,
|
||||
* hence the name sub-pools. Keyed by the bonded pools account.
|
||||
**/
|
||||
subPoolsStorage: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNominationPoolsSubPools>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
offences: {
|
||||
/**
|
||||
* A vector of reports of the same kind that happened at the same time slot.
|
||||
@@ -1098,6 +1165,10 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
paraSessionInfo: {
|
||||
/**
|
||||
* The validator account keys of the validators actively participating in parachain consensus.
|
||||
**/
|
||||
accountKeys: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Vec<AccountId32>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Assignment keys for the current session.
|
||||
* Note that this API is private due to it being prone to 'off-by-one' at session boundaries.
|
||||
@@ -1905,6 +1976,28 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForListNodes: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A bag stored in storage.
|
||||
*
|
||||
* Stores a `Bag` struct, which stores head and tail pointers to itself.
|
||||
**/
|
||||
listBags: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<PalletBagsListListBag>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
|
||||
/**
|
||||
* A single node, within some bag.
|
||||
*
|
||||
* Nodes store links forward and back within their respective bags.
|
||||
**/
|
||||
listNodes: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletBagsListListNode>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
xcmPallet: {
|
||||
/**
|
||||
* The existing asset traps.
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Data } from '@polkadot/types';
|
||||
import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleMaybeHashed, KusamaRuntimeOriginCaller, KusamaRuntimeProxyType, KusamaRuntimeSessionKeys, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleMaybeHashed, KusamaRuntimeOriginCaller, KusamaRuntimeProxyType, KusamaRuntimeSessionKeys, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletNominationPoolsBondExtra, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsPoolState, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/submittable' {
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
||||
@@ -91,34 +91,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Move the caller's Id directly in front of `lighter`.
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_ and can only be called by the Id of
|
||||
* the account going in front of `lighter`.
|
||||
*
|
||||
* Only works if
|
||||
* - both nodes are within the same bag,
|
||||
* - and `origin` has a greater `Score` than `lighter`.
|
||||
**/
|
||||
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
|
||||
* changed its score that it should properly fall into a different bag than its current
|
||||
* one.
|
||||
*
|
||||
* Anyone can call this function about any potentially dislocated account.
|
||||
*
|
||||
* Will never return an error; if `dislocated` does not exist or doesn't need a rebag, then
|
||||
* it is a noop and fees are still collected from `origin`.
|
||||
**/
|
||||
rebag: AugmentedSubmittable<(dislocated: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* Exactly as `transfer`, except the origin must be root and the source account may be
|
||||
@@ -862,7 +834,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
/**
|
||||
* Add a new proposal to either be voted on or executed directly.
|
||||
*
|
||||
@@ -892,7 +864,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
/**
|
||||
* Set the collective's membership.
|
||||
*
|
||||
@@ -2102,7 +2074,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Plus Call Weight
|
||||
* # </weight>
|
||||
**/
|
||||
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
|
||||
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
|
||||
/**
|
||||
* Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously
|
||||
* for this operation will be unreserved on success.
|
||||
@@ -2137,6 +2109,149 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
nominationPools: {
|
||||
/**
|
||||
* Bond `extra` more funds from `origin` into the pool to which they already belong.
|
||||
*
|
||||
* Additional funds can come from either the free balance of the account, of from the
|
||||
* accumulated rewards, see [`BondExtra`].
|
||||
**/
|
||||
bondExtra: AugmentedSubmittable<(extra: PalletNominationPoolsBondExtra | { FreeBalance: any } | { Rewards: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletNominationPoolsBondExtra]>;
|
||||
/**
|
||||
* A bonded member can use this to claim their payout based on the rewards that the pool
|
||||
* has accumulated since their last claimed payout (OR since joining if this is there first
|
||||
* time claiming rewards). The payout will be transferred to the member's account.
|
||||
*
|
||||
* The member will earn rewards pro rata based on the members stake vs the sum of the
|
||||
* members in the pools stake. Rewards do not "expire".
|
||||
**/
|
||||
claimPayout: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
|
||||
/**
|
||||
* Create a new delegation pool.
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* * `amount` - The amount of funds to delegate to the pool. This also acts of a sort of
|
||||
* deposit since the pools creator cannot fully unbond funds until the pool is being
|
||||
* destroyed.
|
||||
* * `index` - A disambiguation index for creating the account. Likely only useful when
|
||||
* creating multiple pools in the same extrinsic.
|
||||
* * `root` - The account to set as [`PoolRoles::root`].
|
||||
* * `nominator` - The account to set as the [`PoolRoles::nominator`].
|
||||
* * `state_toggler` - The account to set as the [`PoolRoles::state_toggler`].
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* In addition to `amount`, the caller will transfer the existential deposit; so the caller
|
||||
* needs at have at least `amount + existential_deposit` transferrable.
|
||||
**/
|
||||
create: AugmentedSubmittable<(amount: Compact<u128> | AnyNumber | Uint8Array, root: AccountId32 | string | Uint8Array, nominator: AccountId32 | string | Uint8Array, stateToggler: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, AccountId32, AccountId32, AccountId32]>;
|
||||
/**
|
||||
* Stake funds with a pool. The amount to bond is transferred from the member to the
|
||||
* pools account and immediately increases the pools bond.
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* * An account can only be a member of a single pool.
|
||||
* * An account cannot join the same pool multiple times.
|
||||
* * This call will *not* dust the member account, so the member must have at least
|
||||
* `existential deposit + amount` in their account.
|
||||
* * Only a pool with [`PoolState::Open`] can be joined
|
||||
**/
|
||||
join: AugmentedSubmittable<(amount: Compact<u128> | AnyNumber | Uint8Array, poolId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, u32]>;
|
||||
nominate: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, validators: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<AccountId32>]>;
|
||||
/**
|
||||
* Call `withdraw_unbonded` for the pools account. This call can be made by any account.
|
||||
*
|
||||
* This is useful if their are too many unlocking chunks to call `unbond`, and some
|
||||
* can be cleared by withdrawing. In the case there are too many unlocking chunks, the user
|
||||
* would probably see an error like `NoMoreChunks` emitted from the staking system when
|
||||
* they attempt to unbond.
|
||||
**/
|
||||
poolWithdrawUnbonded: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Update configurations for the nomination pools. The origin for this call must be
|
||||
* Root.
|
||||
*
|
||||
* # Arguments
|
||||
*
|
||||
* * `min_join_bond` - Set [`MinJoinBond`].
|
||||
* * `min_create_bond` - Set [`MinCreateBond`].
|
||||
* * `max_pools` - Set [`MaxPools`].
|
||||
* * `max_members` - Set [`MaxPoolMembers`].
|
||||
* * `max_members_per_pool` - Set [`MaxPoolMembersPerPool`].
|
||||
**/
|
||||
setConfigs: AugmentedSubmittable<(minJoinBond: PalletNominationPoolsConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, minCreateBond: PalletNominationPoolsConfigOpU128 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxPools: PalletNominationPoolsConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxMembers: PalletNominationPoolsConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, maxMembersPerPool: PalletNominationPoolsConfigOpU32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsConfigOpU32, PalletNominationPoolsConfigOpU32]>;
|
||||
setMetadata: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, metadata: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes]>;
|
||||
setState: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, state: PalletNominationPoolsPoolState | 'Open' | 'Blocked' | 'Destroying' | number | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletNominationPoolsPoolState]>;
|
||||
/**
|
||||
* Unbond up to `unbonding_points` of the `member_account`'s funds from the pool. It
|
||||
* implicitly collects the rewards one last time, since not doing so would mean some
|
||||
* rewards would go forfeited.
|
||||
*
|
||||
* Under certain conditions, this call can be dispatched permissionlessly (i.e. by any
|
||||
* account).
|
||||
*
|
||||
* # Conditions for a permissionless dispatch.
|
||||
*
|
||||
* * The pool is blocked and the caller is either the root or state-toggler. This is
|
||||
* refereed to as a kick.
|
||||
* * The pool is destroying and the member is not the depositor.
|
||||
* * The pool is destroying, the member is the depositor and no other members are in the
|
||||
* pool.
|
||||
*
|
||||
* ## Conditions for permissioned dispatch (i.e. the caller is also the
|
||||
* `member_account`):
|
||||
*
|
||||
* * The caller is not the depositor.
|
||||
* * The caller is the depositor, the pool is destroying and no other members are in the
|
||||
* pool.
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* If there are too many unlocking chunks to unbond with the pool account,
|
||||
* [`Call::pool_withdraw_unbonded`] can be called to try and minimize unlocking chunks. If
|
||||
* there are too many unlocking chunks, the result of this call will likely be the
|
||||
* `NoMoreChunks` error from the staking system.
|
||||
**/
|
||||
unbond: AugmentedSubmittable<(memberAccount: AccountId32 | string | Uint8Array, unbondingPoints: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Compact<u128>]>;
|
||||
/**
|
||||
* Update the roles of the pool.
|
||||
*
|
||||
* The root is the only entity that can change any of the roles, including itself,
|
||||
* excluding the depositor, who can never change.
|
||||
*
|
||||
* It emits an event, notifying UIs of the role change. This event is quite relevant to
|
||||
* most pool members and they should be informed of changes to pool roles.
|
||||
**/
|
||||
updateRoles: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, newRoot: PalletNominationPoolsConfigOpAccountId32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, newNominator: PalletNominationPoolsConfigOpAccountId32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, newStateToggler: PalletNominationPoolsConfigOpAccountId32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpAccountId32]>;
|
||||
/**
|
||||
* Withdraw unbonded funds from `member_account`. If no bonded funds can be unbonded, an
|
||||
* error is returned.
|
||||
*
|
||||
* Under certain conditions, this call can be dispatched permissionlessly (i.e. by any
|
||||
* account).
|
||||
*
|
||||
* # Conditions for a permissionless dispatch
|
||||
*
|
||||
* * The pool is in destroy mode and the target is not the depositor.
|
||||
* * The target is the depositor and they are the only member in the sub pools.
|
||||
* * The pool is blocked and the caller is either the root or state-toggler.
|
||||
*
|
||||
* # Conditions for permissioned dispatch
|
||||
*
|
||||
* * The caller is the target and they are not the depositor.
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* If the target is the depositor, the pool will be destroyed.
|
||||
**/
|
||||
withdrawUnbonded: AugmentedSubmittable<(memberAccount: AccountId32 | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
paraInclusion: {
|
||||
/**
|
||||
* Generic tx
|
||||
@@ -2469,7 +2584,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Weight is a function of the number of proxies the user has (P).
|
||||
* # </weight>
|
||||
**/
|
||||
proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option<KusamaRuntimeProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<KusamaRuntimeProxyType>, Call]>;
|
||||
proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option<KusamaRuntimeProxyType> | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<KusamaRuntimeProxyType>, Call]>;
|
||||
/**
|
||||
* Dispatch the given `call` from an account that the sender is authorized for through
|
||||
* `add_proxy`.
|
||||
@@ -2489,7 +2604,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - P: the number of proxies the user has.
|
||||
* # </weight>
|
||||
**/
|
||||
proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option<KusamaRuntimeProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, AccountId32, Option<KusamaRuntimeProxyType>, Call]>;
|
||||
proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option<KusamaRuntimeProxyType> | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, AccountId32, Option<KusamaRuntimeProxyType>, Call]>;
|
||||
/**
|
||||
* Remove the given announcement of a delegate.
|
||||
*
|
||||
@@ -2571,7 +2686,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - `account`: The recovered account you want to make a call on-behalf-of.
|
||||
* - `call`: The call you want to make with the recovered account.
|
||||
**/
|
||||
asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Call]>;
|
||||
asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Call]>;
|
||||
/**
|
||||
* Cancel the ability to use `as_recovered` for `account`.
|
||||
*
|
||||
@@ -3735,7 +3850,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
/**
|
||||
* Add a new proposal to either be voted on or executed directly.
|
||||
*
|
||||
@@ -3765,7 +3880,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
/**
|
||||
* Set the collective's membership.
|
||||
*
|
||||
@@ -4136,7 +4251,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_.
|
||||
**/
|
||||
asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Call]>;
|
||||
asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Call]>;
|
||||
/**
|
||||
* Send a batch of dispatch calls.
|
||||
*
|
||||
@@ -4158,7 +4273,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* and the error of the failed call. If all were successful, then the `BatchCompleted`
|
||||
* event is deposited.
|
||||
**/
|
||||
batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Send a batch of dispatch calls and atomically execute them.
|
||||
* The whole transaction will rollback and fail if any of the calls failed.
|
||||
@@ -4175,7 +4290,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Complexity: O(C) where C is the number of calls to be batched.
|
||||
* # </weight>
|
||||
**/
|
||||
batchAll: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
batchAll: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Dispatches a function call with a provided origin.
|
||||
*
|
||||
@@ -4188,7 +4303,24 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Weight of derivative `call` execution + T::WeightInfo::dispatch_as().
|
||||
* # </weight>
|
||||
**/
|
||||
dispatchAs: AugmentedSubmittable<(asOrigin: KusamaRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { ParachainsOrigin: any } | { XcmPallet: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [KusamaRuntimeOriginCaller, Call]>;
|
||||
dispatchAs: AugmentedSubmittable<(asOrigin: KusamaRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { ParachainsOrigin: any } | { XcmPallet: any } | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [KusamaRuntimeOriginCaller, Call]>;
|
||||
/**
|
||||
* Send a batch of dispatch calls.
|
||||
* Unlike `batch`, it allows errors and won't interrupt.
|
||||
*
|
||||
* May be called from any origin.
|
||||
*
|
||||
* - `calls`: The calls to be dispatched from the same origin. The number of call must not
|
||||
* exceed the constant: `batched_calls_limit` (available in constant metadata).
|
||||
*
|
||||
* If origin is root then call are dispatch without checking origin filter. (This includes
|
||||
* bypassing `frame_system::Config::BaseCallFilter`).
|
||||
*
|
||||
* # <weight>
|
||||
* - Complexity: O(C) where C is the number of calls to be batched.
|
||||
* # </weight>
|
||||
**/
|
||||
forceBatch: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -4299,6 +4431,36 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* Move the caller's Id directly in front of `lighter`.
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_ and can only be called by the Id of
|
||||
* the account going in front of `lighter`.
|
||||
*
|
||||
* Only works if
|
||||
* - both nodes are within the same bag,
|
||||
* - and `origin` has a greater `Score` than `lighter`.
|
||||
**/
|
||||
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
|
||||
* changed its score that it should properly fall into a different bag than its current
|
||||
* one.
|
||||
*
|
||||
* Anyone can call this function about any potentially dislocated account.
|
||||
*
|
||||
* Will always update the stored score of `dislocated` to the correct score, based on
|
||||
* `ScoreProvider`.
|
||||
*
|
||||
* If `dislocated` does not exists, it returns an error.
|
||||
**/
|
||||
rebag: AugmentedSubmittable<(dislocated: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
xcmPallet: {
|
||||
/**
|
||||
* Execute an XCM message from a local, signed, origin.
|
||||
|
||||
@@ -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.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { Codec } from '@polkadot/types-codec/types';
|
||||
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/consts' {
|
||||
export interface AugmentedConsts<ApiType extends ApiTypes> {
|
||||
@@ -63,58 +63,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* The list of thresholds separating the various bags.
|
||||
*
|
||||
* Ids are separated into unsorted bags according to their score. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
|
||||
* is less than or equal to its upper threshold.
|
||||
*
|
||||
* When ids are iterated, higher bags are iterated completely before lower bags. This means
|
||||
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
|
||||
* score, but peer ids within a particular bag are sorted in insertion order.
|
||||
*
|
||||
* # Expressing the constant
|
||||
*
|
||||
* This constant must be sorted in strictly increasing order. Duplicate items are not
|
||||
* permitted.
|
||||
*
|
||||
* There is an implied upper limit of `Score::MAX`; that value does not need to be
|
||||
* specified within the bag. For any two threshold lists, if one ends with
|
||||
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
|
||||
* lists will behave identically.
|
||||
*
|
||||
* # Calculation
|
||||
*
|
||||
* It is recommended to generate the set of thresholds in a geometric series, such that
|
||||
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
|
||||
* constant_ratio).max(threshold[k] + 1)` for all `k`.
|
||||
*
|
||||
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
|
||||
*
|
||||
* # Examples
|
||||
*
|
||||
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
|
||||
* iteration is strictly in insertion order.
|
||||
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is equal to 2.
|
||||
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is approximately equal to 1.248.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
|
||||
* into bag 0, an id with score 2 will fall into bag 1, etc.
|
||||
*
|
||||
* # Migration
|
||||
*
|
||||
* In the event that this list ever changes, a copy of the old bags list must be retained.
|
||||
* With that `List::migrate` can be called, which will perform the appropriate migration.
|
||||
**/
|
||||
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* The minimum amount required to keep an account open.
|
||||
@@ -304,20 +252,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* take place over multiple blocks.
|
||||
**/
|
||||
maxElectingVoters: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum length (bytes) that the mined solution should consume.
|
||||
*
|
||||
* The miner will ensure that the total length of the unsigned solution will not exceed
|
||||
* this value.
|
||||
**/
|
||||
minerMaxLength: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum weight that the miner should consume.
|
||||
*
|
||||
* The miner will ensure that the total weight of the unsigned solution will not exceed
|
||||
* this value, based on [`WeightInfo::submit_unsigned`].
|
||||
**/
|
||||
minerMaxWeight: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The priority of the unsigned transaction submitted in the unsigned-phase
|
||||
**/
|
||||
@@ -358,7 +292,9 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
/**
|
||||
* Maximum weight of a signed solution.
|
||||
*
|
||||
* This should probably be similar to [`Config::MinerMaxWeight`].
|
||||
* If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of
|
||||
* this pallet), then [`MinerConfig::solution_weight`] is used to compare against
|
||||
* this value.
|
||||
**/
|
||||
signedMaxWeight: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -717,10 +653,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
[key: string]: Codec;
|
||||
};
|
||||
transactionPayment: {
|
||||
/**
|
||||
* The polynomial that is applied in order to derive fee from length.
|
||||
**/
|
||||
lengthToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
|
||||
* `priority`
|
||||
@@ -745,10 +677,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* transactions.
|
||||
**/
|
||||
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The polynomial that is applied in order to derive fee from weight.
|
||||
**/
|
||||
weightToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
@@ -812,5 +740,57 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* The list of thresholds separating the various bags.
|
||||
*
|
||||
* Ids are separated into unsorted bags according to their score. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
|
||||
* is less than or equal to its upper threshold.
|
||||
*
|
||||
* When ids are iterated, higher bags are iterated completely before lower bags. This means
|
||||
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
|
||||
* score, but peer ids within a particular bag are sorted in insertion order.
|
||||
*
|
||||
* # Expressing the constant
|
||||
*
|
||||
* This constant must be sorted in strictly increasing order. Duplicate items are not
|
||||
* permitted.
|
||||
*
|
||||
* There is an implied upper limit of `Score::MAX`; that value does not need to be
|
||||
* specified within the bag. For any two threshold lists, if one ends with
|
||||
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
|
||||
* lists will behave identically.
|
||||
*
|
||||
* # Calculation
|
||||
*
|
||||
* It is recommended to generate the set of thresholds in a geometric series, such that
|
||||
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
|
||||
* constant_ratio).max(threshold[k] + 1)` for all `k`.
|
||||
*
|
||||
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
|
||||
*
|
||||
* # Examples
|
||||
*
|
||||
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
|
||||
* iteration is strictly in insertion order.
|
||||
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is equal to 2.
|
||||
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is approximately equal to 1.248.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
|
||||
* into bag 0, an id with score 2 will fall into bag 1, etc.
|
||||
*
|
||||
* # Migration
|
||||
*
|
||||
* In the event that this list ever changes, a copy of the old bags list must be retained.
|
||||
* With that `List::migrate` can be called, which will perform the appropriate migration.
|
||||
**/
|
||||
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
} // AugmentedConsts
|
||||
} // declare module
|
||||
|
||||
@@ -78,6 +78,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* A given equivocation report is valid but already previously reported.
|
||||
**/
|
||||
DuplicateOffenceReport: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Submitted configuration is invalid.
|
||||
**/
|
||||
InvalidConfiguration: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An equivocation proof provided as part of an equivocation report is invalid.
|
||||
**/
|
||||
@@ -91,24 +95,6 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Id not found in list.
|
||||
**/
|
||||
IdNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An Id does not have a greater score than another Id.
|
||||
**/
|
||||
NotHeavier: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Attempted to place node in front of a node in another bag.
|
||||
**/
|
||||
NotInSameBag: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* Beneficiary account must pre-exist
|
||||
@@ -1679,6 +1665,16 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* A error in the list interface implementation.
|
||||
**/
|
||||
List: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
xcmPallet: {
|
||||
/**
|
||||
* The location is invalid since it already has a subscription from us.
|
||||
|
||||
@@ -12,29 +12,26 @@ declare module '@polkadot/api-base/types/events' {
|
||||
export interface AugmentedEvents<ApiType extends ApiTypes> {
|
||||
auctions: {
|
||||
/**
|
||||
* An auction ended. All funds become unreserved. `[auction_index]`
|
||||
* An auction ended. All funds become unreserved.
|
||||
**/
|
||||
AuctionClosed: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* An auction started. Provides its index and the block number where it will begin to
|
||||
* close and the first lease period of the quadruplet that is auctioned.
|
||||
* `[auction_index, lease_period, ending]`
|
||||
**/
|
||||
AuctionStarted: AugmentedEvent<ApiType, [u32, u32, u32]>;
|
||||
/**
|
||||
* A new bid has been accepted as the current winner.
|
||||
* `[who, para_id, amount, first_slot, last_slot]`
|
||||
**/
|
||||
BidAccepted: AugmentedEvent<ApiType, [AccountId32, u32, u128, u32, u32]>;
|
||||
/**
|
||||
* Someone attempted to lease the same slot twice for a parachain. The amount is held in reserve
|
||||
* but no parachain slot has been leased.
|
||||
* `[parachain_id, leaser, amount]`
|
||||
**/
|
||||
ReserveConfiscated: AugmentedEvent<ApiType, [u32, AccountId32, u128]>;
|
||||
/**
|
||||
* Funds were reserved for a winning bid. First balance is the extra amount reserved.
|
||||
* Second is the total. `[bidder, extra_reserved, total_amount]`
|
||||
* Second is the total.
|
||||
**/
|
||||
Reserved: AugmentedEvent<ApiType, [AccountId32, u128, u128]>;
|
||||
/**
|
||||
@@ -43,7 +40,6 @@ declare module '@polkadot/api-base/types/events' {
|
||||
Unreserved: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
/**
|
||||
* The winning offset was chosen for an auction. This will map into the `Winning` storage map.
|
||||
* `[auction_index, block_number]`
|
||||
**/
|
||||
WinningOffset: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
@@ -51,16 +47,6 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Moved an account from one bag to another.
|
||||
**/
|
||||
Rebagged: AugmentedEvent<ApiType, [AccountId32, u64, u64]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* A balance was set by root.
|
||||
@@ -167,7 +153,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
};
|
||||
claims: {
|
||||
/**
|
||||
* Someone claimed some DOTs. `[who, ethereum_address, amount]`
|
||||
* Someone claimed some DOTs.
|
||||
**/
|
||||
Claimed: AugmentedEvent<ApiType, [AccountId32, EthereumAddress, u128]>;
|
||||
/**
|
||||
@@ -217,23 +203,23 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
AddedToNewRaise: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* All loans in a fund have been refunded. `[fund_index]`
|
||||
* All loans in a fund have been refunded.
|
||||
**/
|
||||
AllRefunded: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Contributed to a crowd sale. `[who, fund_index, amount]`
|
||||
* Contributed to a crowd sale.
|
||||
**/
|
||||
Contributed: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
/**
|
||||
* Create a new crowdloaning campaign. `[fund_index]`
|
||||
* Create a new crowdloaning campaign.
|
||||
**/
|
||||
Created: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Fund is dissolved. `[fund_index]`
|
||||
* Fund is dissolved.
|
||||
**/
|
||||
Dissolved: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* The configuration to a crowdloan has been edited. `[fund_index]`
|
||||
* The configuration to a crowdloan has been edited.
|
||||
**/
|
||||
Edited: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
@@ -241,16 +227,16 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
HandleBidResult: AugmentedEvent<ApiType, [u32, Result<Null, SpRuntimeDispatchError>]>;
|
||||
/**
|
||||
* A memo has been updated. `[who, fund_index, memo]`
|
||||
* A memo has been updated.
|
||||
**/
|
||||
MemoUpdated: AugmentedEvent<ApiType, [AccountId32, u32, Bytes]>;
|
||||
/**
|
||||
* The loans in a fund have been partially dissolved, i.e. there are some left
|
||||
* over child keys that still need to be killed. `[fund_index]`
|
||||
* over child keys that still need to be killed.
|
||||
**/
|
||||
PartiallyRefunded: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Withdrew full balance of a contributor. `[who, fund_index, amount]`
|
||||
* Withdrew full balance of a contributor.
|
||||
**/
|
||||
Withdrew: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
/**
|
||||
@@ -756,7 +742,6 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A para has won the right to a continuous set of lease periods as a parachain.
|
||||
* First balance is any extra amount reserved on top of the para's existing deposit.
|
||||
* Second balance is the total amount reserved.
|
||||
* `[parachain_id, leaser, period_begin, period_count, extra_reserved, total_amount]`
|
||||
**/
|
||||
Leased: AugmentedEvent<ApiType, [u32, AccountId32, u32, u32, u128, u128]>;
|
||||
/**
|
||||
@@ -1043,6 +1028,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* Batch of dispatches completed fully with no error.
|
||||
**/
|
||||
BatchCompleted: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* Batch of dispatches completed but has errors.
|
||||
**/
|
||||
BatchCompletedWithErrors: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* Batch of dispatches did not complete fully. Index of first failing dispatch given, as
|
||||
* well as the error.
|
||||
@@ -1056,6 +1045,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A single item within a Batch of dispatches has completed with no error.
|
||||
**/
|
||||
ItemCompleted: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* A single item within a Batch of dispatches has completed with error.
|
||||
**/
|
||||
ItemFailed: AugmentedEvent<ApiType, [SpRuntimeDispatchError]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -1076,6 +1069,20 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* Moved an account from one bag to another.
|
||||
**/
|
||||
Rebagged: AugmentedEvent<ApiType, [AccountId32, u64, u64]>;
|
||||
/**
|
||||
* Updated the score of some account to the given amount.
|
||||
**/
|
||||
ScoreUpdated: AugmentedEvent<ApiType, [AccountId32, u64]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
xcmPallet: {
|
||||
/**
|
||||
* Some assets have been placed in an asset trap.
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/storage' {
|
||||
@@ -68,7 +68,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* This field should always be populated during block processing unless
|
||||
* secondary plain slots are enabled (which don't contain a VRF output).
|
||||
*
|
||||
* It is set in `on_initialize`, before it will contain the value from the last block.
|
||||
* It is set in `on_finalize`, before it will contain the value from the last block.
|
||||
**/
|
||||
authorVrfRandomness: AugmentedQuery<ApiType, () => Observable<Option<U8aFixed>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Temporary value (cleared at block finalization) which is `Some`
|
||||
* if per-block initialization has already been called for current block.
|
||||
**/
|
||||
initialized: AugmentedQuery<ApiType, () => Observable<Option<Option<U8aFixed>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
initialized: AugmentedQuery<ApiType, () => Observable<Option<Option<SpConsensusBabeDigestsPreDigest>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* How late the current block is compared to its parent.
|
||||
*
|
||||
@@ -161,28 +161,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForListNodes: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A bag stored in storage.
|
||||
*
|
||||
* Stores a `Bag` struct, which stores head and tail pointers to itself.
|
||||
**/
|
||||
listBags: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<PalletBagsListListBag>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
|
||||
/**
|
||||
* A single node, within some bag.
|
||||
*
|
||||
* Nodes store links forward and back within their respective bags.
|
||||
**/
|
||||
listNodes: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletBagsListListNode>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* The Balances pallet example of storing the balance of an account.
|
||||
@@ -1072,6 +1050,10 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
paraSessionInfo: {
|
||||
/**
|
||||
* The validator account keys of the validators actively participating in parachain consensus.
|
||||
**/
|
||||
accountKeys: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Vec<AccountId32>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Assignment keys for the current session.
|
||||
* Note that this API is private due to it being prone to 'off-by-one' at session boundaries.
|
||||
@@ -1785,6 +1767,28 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForListNodes: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A bag stored in storage.
|
||||
*
|
||||
* Stores a `Bag` struct, which stores head and tail pointers to itself.
|
||||
**/
|
||||
listBags: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<PalletBagsListListBag>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
|
||||
/**
|
||||
* A single node, within some bag.
|
||||
*
|
||||
* Nodes store links forward and back within their respective bags.
|
||||
**/
|
||||
listNodes: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletBagsListListNode>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
xcmPallet: {
|
||||
/**
|
||||
* The existing asset traps.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Data } from '@polkadot/types';
|
||||
import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleMaybeHashed, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeOriginCaller, PolkadotRuntimeProxyType, PolkadotRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
|
||||
@@ -91,34 +91,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Move the caller's Id directly in front of `lighter`.
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_ and can only be called by the Id of
|
||||
* the account going in front of `lighter`.
|
||||
*
|
||||
* Only works if
|
||||
* - both nodes are within the same bag,
|
||||
* - and `origin` has a greater `Score` than `lighter`.
|
||||
**/
|
||||
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
|
||||
* changed its score that it should properly fall into a different bag than its current
|
||||
* one.
|
||||
*
|
||||
* Anyone can call this function about any potentially dislocated account.
|
||||
*
|
||||
* Will never return an error; if `dislocated` does not exist or doesn't need a rebag, then
|
||||
* it is a noop and fees are still collected from `origin`.
|
||||
**/
|
||||
rebag: AugmentedSubmittable<(dislocated: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* Exactly as `transfer`, except the origin must be root and the source account may be
|
||||
@@ -862,7 +834,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
/**
|
||||
* Add a new proposal to either be voted on or executed directly.
|
||||
*
|
||||
@@ -892,7 +864,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
/**
|
||||
* Set the collective's membership.
|
||||
*
|
||||
@@ -2051,7 +2023,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Plus Call Weight
|
||||
* # </weight>
|
||||
**/
|
||||
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
|
||||
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
|
||||
/**
|
||||
* Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously
|
||||
* for this operation will be unreserved on success.
|
||||
@@ -2418,7 +2390,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Weight is a function of the number of proxies the user has (P).
|
||||
* # </weight>
|
||||
**/
|
||||
proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option<PolkadotRuntimeProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<PolkadotRuntimeProxyType>, Call]>;
|
||||
proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option<PolkadotRuntimeProxyType> | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<PolkadotRuntimeProxyType>, Call]>;
|
||||
/**
|
||||
* Dispatch the given `call` from an account that the sender is authorized for through
|
||||
* `add_proxy`.
|
||||
@@ -2438,7 +2410,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - P: the number of proxies the user has.
|
||||
* # </weight>
|
||||
**/
|
||||
proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option<PolkadotRuntimeProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, AccountId32, Option<PolkadotRuntimeProxyType>, Call]>;
|
||||
proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option<PolkadotRuntimeProxyType> | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, AccountId32, Option<PolkadotRuntimeProxyType>, Call]>;
|
||||
/**
|
||||
* Remove the given announcement of a delegate.
|
||||
*
|
||||
@@ -3231,7 +3203,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
/**
|
||||
* Add a new proposal to either be voted on or executed directly.
|
||||
*
|
||||
@@ -3261,7 +3233,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
/**
|
||||
* Set the collective's membership.
|
||||
*
|
||||
@@ -3632,7 +3604,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_.
|
||||
**/
|
||||
asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Call]>;
|
||||
asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Call]>;
|
||||
/**
|
||||
* Send a batch of dispatch calls.
|
||||
*
|
||||
@@ -3654,7 +3626,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* and the error of the failed call. If all were successful, then the `BatchCompleted`
|
||||
* event is deposited.
|
||||
**/
|
||||
batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Send a batch of dispatch calls and atomically execute them.
|
||||
* The whole transaction will rollback and fail if any of the calls failed.
|
||||
@@ -3671,7 +3643,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Complexity: O(C) where C is the number of calls to be batched.
|
||||
* # </weight>
|
||||
**/
|
||||
batchAll: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
batchAll: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Dispatches a function call with a provided origin.
|
||||
*
|
||||
@@ -3684,7 +3656,24 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Weight of derivative `call` execution + T::WeightInfo::dispatch_as().
|
||||
* # </weight>
|
||||
**/
|
||||
dispatchAs: AugmentedSubmittable<(asOrigin: PolkadotRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { ParachainsOrigin: any } | { XcmPallet: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotRuntimeOriginCaller, Call]>;
|
||||
dispatchAs: AugmentedSubmittable<(asOrigin: PolkadotRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { ParachainsOrigin: any } | { XcmPallet: any } | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotRuntimeOriginCaller, Call]>;
|
||||
/**
|
||||
* Send a batch of dispatch calls.
|
||||
* Unlike `batch`, it allows errors and won't interrupt.
|
||||
*
|
||||
* May be called from any origin.
|
||||
*
|
||||
* - `calls`: The calls to be dispatched from the same origin. The number of call must not
|
||||
* exceed the constant: `batched_calls_limit` (available in constant metadata).
|
||||
*
|
||||
* If origin is root then call are dispatch without checking origin filter. (This includes
|
||||
* bypassing `frame_system::Config::BaseCallFilter`).
|
||||
*
|
||||
* # <weight>
|
||||
* - Complexity: O(C) where C is the number of calls to be batched.
|
||||
* # </weight>
|
||||
**/
|
||||
forceBatch: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -3795,6 +3784,36 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
voterList: {
|
||||
/**
|
||||
* Move the caller's Id directly in front of `lighter`.
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_ and can only be called by the Id of
|
||||
* the account going in front of `lighter`.
|
||||
*
|
||||
* Only works if
|
||||
* - both nodes are within the same bag,
|
||||
* - and `origin` has a greater `Score` than `lighter`.
|
||||
**/
|
||||
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
|
||||
* changed its score that it should properly fall into a different bag than its current
|
||||
* one.
|
||||
*
|
||||
* Anyone can call this function about any potentially dislocated account.
|
||||
*
|
||||
* Will always update the stored score of `dislocated` to the correct score, based on
|
||||
* `ScoreProvider`.
|
||||
*
|
||||
* If `dislocated` does not exists, it returns an error.
|
||||
**/
|
||||
rebag: AugmentedSubmittable<(dislocated: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
xcmPallet: {
|
||||
/**
|
||||
* Execute an XCM message from a local, signed, origin.
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { Codec } from '@polkadot/types-codec/types';
|
||||
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/consts' {
|
||||
export interface AugmentedConsts<ApiType extends ApiTypes> {
|
||||
@@ -210,6 +210,27 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
[key: string]: Codec;
|
||||
};
|
||||
contracts: {
|
||||
/**
|
||||
* The weight per byte of code that is charged when loading a contract from storage.
|
||||
*
|
||||
* Currently, FRAME only charges fees for computation incurred but not for PoV
|
||||
* consumption caused for storage access. This is usually not exploitable because
|
||||
* accessing storage carries some substantial weight costs, too. However in case
|
||||
* of contract code very much PoV consumption can be caused while consuming very little
|
||||
* computation. This could be used to keep the chain busy without paying the
|
||||
* proper fee for it. Until this is resolved we charge from the weight meter for
|
||||
* contract access.
|
||||
*
|
||||
* For more information check out: <https://github.com/paritytech/substrate/issues/10301>
|
||||
*
|
||||
* [`DefaultContractAccessWeight`] is a safe default to be used for polkadot or kusama
|
||||
* parachains.
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* This is only relevant for parachains. Set to zero in case of a standalone chain.
|
||||
**/
|
||||
contractAccessWeight: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of contracts that can be pending for deletion.
|
||||
*
|
||||
@@ -365,20 +386,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* take place over multiple blocks.
|
||||
**/
|
||||
maxElectingVoters: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum length (bytes) that the mined solution should consume.
|
||||
*
|
||||
* The miner will ensure that the total length of the unsigned solution will not exceed
|
||||
* this value.
|
||||
**/
|
||||
minerMaxLength: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum weight that the miner should consume.
|
||||
*
|
||||
* The miner will ensure that the total weight of the unsigned solution will not exceed
|
||||
* this value, based on [`WeightInfo::submit_unsigned`].
|
||||
**/
|
||||
minerMaxWeight: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The priority of the unsigned transaction submitted in the unsigned-phase
|
||||
**/
|
||||
@@ -419,7 +426,9 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
/**
|
||||
* Maximum weight of a signed solution.
|
||||
*
|
||||
* This should probably be similar to [`Config::MinerMaxWeight`].
|
||||
* If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of
|
||||
* this pallet), then [`MinerConfig::solution_weight`] is used to compare against
|
||||
* this value.
|
||||
**/
|
||||
signedMaxWeight: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -640,6 +649,14 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
[key: string]: Codec;
|
||||
};
|
||||
nominationPools: {
|
||||
/**
|
||||
* The minimum pool points-to-balance ratio that must be maintained for it to be `open`.
|
||||
* This is important in the event slashing takes place and the pool's points-to-balance
|
||||
* ratio becomes disproportional.
|
||||
* 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>;
|
||||
/**
|
||||
* The nomination pool's pallet id.
|
||||
**/
|
||||
@@ -930,10 +947,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
[key: string]: Codec;
|
||||
};
|
||||
transactionPayment: {
|
||||
/**
|
||||
* The polynomial that is applied in order to derive fee from length.
|
||||
**/
|
||||
lengthToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
|
||||
* `priority`
|
||||
@@ -958,10 +971,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* transactions.
|
||||
**/
|
||||
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The polynomial that is applied in order to derive fee from weight.
|
||||
**/
|
||||
weightToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
@@ -1006,28 +1015,28 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
};
|
||||
uniques: {
|
||||
/**
|
||||
* The basic amount of funds that must be reserved when adding an attribute to an asset.
|
||||
* The basic amount of funds that must be reserved when adding an attribute to an item.
|
||||
**/
|
||||
attributeDepositBase: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The basic amount of funds that must be reserved for an asset class.
|
||||
* The basic amount of funds that must be reserved for collection.
|
||||
**/
|
||||
classDeposit: u128 & AugmentedConst<ApiType>;
|
||||
collectionDeposit: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The additional funds that must be reserved for the number of bytes store in metadata,
|
||||
* either "normal" metadata or attribute metadata.
|
||||
**/
|
||||
depositPerByte: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The basic amount of funds that must be reserved for an asset instance.
|
||||
* The basic amount of funds that must be reserved for an item.
|
||||
**/
|
||||
instanceDeposit: u128 & AugmentedConst<ApiType>;
|
||||
itemDeposit: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum length of an attribute key.
|
||||
**/
|
||||
keyLimit: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The basic amount of funds that must be reserved when adding metadata to your asset.
|
||||
* The basic amount of funds that must be reserved when adding metadata to your item.
|
||||
**/
|
||||
metadataDepositBase: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
|
||||
@@ -112,6 +112,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* A given equivocation report is valid but already previously reported.
|
||||
**/
|
||||
DuplicateOffenceReport: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Submitted configuration is invalid.
|
||||
**/
|
||||
InvalidConfiguration: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An equivocation proof provided as part of an equivocation report is invalid.
|
||||
**/
|
||||
@@ -127,17 +131,9 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Id not found in list.
|
||||
* A error in the list interface implementation.
|
||||
**/
|
||||
IdNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An Id does not have a greater score than another Id.
|
||||
**/
|
||||
NotHeavier: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Attempted to place node in front of a node in another bag.
|
||||
**/
|
||||
NotInSameBag: AugmentedError<ApiType>;
|
||||
List: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
@@ -1104,6 +1100,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* The transaction could not be executed due to overflow risk for the pool.
|
||||
**/
|
||||
OverflowRisk: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Partial unbonding now allowed permissionlessly.
|
||||
**/
|
||||
PartialUnbondNotAllowedPermissionlessly: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An account is not a member.
|
||||
**/
|
||||
@@ -1801,7 +1801,7 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
};
|
||||
uniques: {
|
||||
/**
|
||||
* The asset instance ID has already been used for an asset.
|
||||
* The item ID has already been used for an item.
|
||||
**/
|
||||
AlreadyExists: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -1809,17 +1809,29 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
BadWitness: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The asset instance or class is frozen.
|
||||
* The item or collection is frozen.
|
||||
**/
|
||||
Frozen: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The asset ID is already taken.
|
||||
* The item ID is already taken.
|
||||
**/
|
||||
InUse: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The asset instance is locked.
|
||||
* The item is locked.
|
||||
**/
|
||||
Locked: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The max supply has already been set.
|
||||
**/
|
||||
MaxSupplyAlreadySet: AugmentedError<ApiType>;
|
||||
/**
|
||||
* All items have been minted.
|
||||
**/
|
||||
MaxSupplyReached: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The provided max supply is less to the amount of items a collection already has.
|
||||
**/
|
||||
MaxSupplyTooSmall: AugmentedError<ApiType>;
|
||||
/**
|
||||
* There is no delegate approved.
|
||||
**/
|
||||
@@ -1829,7 +1841,7 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The named owner has not signed ownership of the class is acceptable.
|
||||
* The named owner has not signed ownership of the collection is acceptable.
|
||||
**/
|
||||
Unaccepted: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -1837,9 +1849,9 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
Unapproved: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given asset ID is unknown.
|
||||
* The given item ID is unknown.
|
||||
**/
|
||||
UnknownClass: AugmentedError<ApiType>;
|
||||
UnknownCollection: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The delegate turned out to be different to what was expected.
|
||||
**/
|
||||
|
||||
@@ -93,6 +93,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* Moved an account from one bag to another.
|
||||
**/
|
||||
Rebagged: AugmentedEvent<ApiType, [AccountId32, u64, u64]>;
|
||||
/**
|
||||
* Updated the score of some account to the given amount.
|
||||
**/
|
||||
ScoreUpdated: AugmentedEvent<ApiType, [AccountId32, u64]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -628,10 +632,21 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A pool has been destroyed.
|
||||
**/
|
||||
Destroyed: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* A member has been removed from a pool.
|
||||
*
|
||||
* The removal can be voluntary (withdrawn all unbonded funds) or involuntary (kicked).
|
||||
**/
|
||||
MemberRemoved: AugmentedEvent<ApiType, [u32, AccountId32]>;
|
||||
/**
|
||||
* A payout has been made to a member.
|
||||
**/
|
||||
PaidOut: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
/**
|
||||
* The roles of a pool have been updated to the given new roles. Note that the depositor
|
||||
* can never change.
|
||||
**/
|
||||
RolesUpdated: AugmentedEvent<ApiType, [Option<AccountId32>, Option<AccountId32>, Option<AccountId32>]>;
|
||||
/**
|
||||
* The state of a pool has changed
|
||||
**/
|
||||
@@ -1188,73 +1203,77 @@ declare module '@polkadot/api-base/types/events' {
|
||||
};
|
||||
uniques: {
|
||||
/**
|
||||
* An approval for a `delegate` account to transfer the `instance` of an asset `class` was
|
||||
* cancelled by its `owner`.
|
||||
* An approval for a `delegate` account to transfer the `item` of an item
|
||||
* `collection` was cancelled by its `owner`.
|
||||
**/
|
||||
ApprovalCancelled: AugmentedEvent<ApiType, [u32, u32, AccountId32, AccountId32]>;
|
||||
/**
|
||||
* An `instance` of an asset `class` has been approved by the `owner` for transfer by a
|
||||
* `delegate`.
|
||||
* An `item` of a `collection` has been approved by the `owner` for transfer by
|
||||
* a `delegate`.
|
||||
**/
|
||||
ApprovedTransfer: AugmentedEvent<ApiType, [u32, u32, AccountId32, AccountId32]>;
|
||||
/**
|
||||
* An asset `class` has had its attributes changed by the `Force` origin.
|
||||
**/
|
||||
AssetStatusChanged: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Attribute metadata has been cleared for an asset class or instance.
|
||||
* Attribute metadata has been cleared for a `collection` or `item`.
|
||||
**/
|
||||
AttributeCleared: AugmentedEvent<ApiType, [u32, Option<u32>, Bytes]>;
|
||||
/**
|
||||
* New attribute metadata has been set for an asset class or instance.
|
||||
* New attribute metadata has been set for a `collection` or `item`.
|
||||
**/
|
||||
AttributeSet: AugmentedEvent<ApiType, [u32, Option<u32>, Bytes, Bytes]>;
|
||||
/**
|
||||
* An asset `instance` was destroyed.
|
||||
* An `item` was destroyed.
|
||||
**/
|
||||
Burned: AugmentedEvent<ApiType, [u32, u32, AccountId32]>;
|
||||
/**
|
||||
* Some asset `class` was frozen.
|
||||
* Some `collection` was frozen.
|
||||
**/
|
||||
ClassFrozen: AugmentedEvent<ApiType, [u32]>;
|
||||
CollectionFrozen: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Metadata has been cleared for an asset class.
|
||||
* Max supply has been set for a collection.
|
||||
**/
|
||||
ClassMetadataCleared: AugmentedEvent<ApiType, [u32]>;
|
||||
CollectionMaxSupplySet: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* New metadata has been set for an asset class.
|
||||
* Metadata has been cleared for a `collection`.
|
||||
**/
|
||||
ClassMetadataSet: AugmentedEvent<ApiType, [u32, Bytes, bool]>;
|
||||
CollectionMetadataCleared: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Some asset `class` was thawed.
|
||||
* New metadata has been set for a `collection`.
|
||||
**/
|
||||
ClassThawed: AugmentedEvent<ApiType, [u32]>;
|
||||
CollectionMetadataSet: AugmentedEvent<ApiType, [u32, Bytes, bool]>;
|
||||
/**
|
||||
* An asset class was created.
|
||||
* Some `collection` was thawed.
|
||||
**/
|
||||
CollectionThawed: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* A `collection` was created.
|
||||
**/
|
||||
Created: AugmentedEvent<ApiType, [u32, AccountId32, AccountId32]>;
|
||||
/**
|
||||
* An asset `class` was destroyed.
|
||||
* A `collection` was destroyed.
|
||||
**/
|
||||
Destroyed: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* An asset class was force-created.
|
||||
* A `collection` was force-created.
|
||||
**/
|
||||
ForceCreated: AugmentedEvent<ApiType, [u32, AccountId32]>;
|
||||
/**
|
||||
* Some asset `instance` was frozen.
|
||||
* Some `item` was frozen.
|
||||
**/
|
||||
Frozen: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* An asset `instance` was issued.
|
||||
* An `item` was issued.
|
||||
**/
|
||||
Issued: AugmentedEvent<ApiType, [u32, u32, AccountId32]>;
|
||||
/**
|
||||
* Metadata has been cleared for an asset instance.
|
||||
* A `collection` has had its attributes changed by the `Force` origin.
|
||||
**/
|
||||
ItemStatusChanged: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* Metadata has been cleared for an item.
|
||||
**/
|
||||
MetadataCleared: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* New metadata has been set for an asset instance.
|
||||
* New metadata has been set for an item.
|
||||
**/
|
||||
MetadataSet: AugmentedEvent<ApiType, [u32, u32, Bytes, bool]>;
|
||||
/**
|
||||
@@ -1266,7 +1285,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
OwnershipAcceptanceChanged: AugmentedEvent<ApiType, [AccountId32, Option<u32>]>;
|
||||
/**
|
||||
* Metadata has been cleared for an asset instance.
|
||||
* Metadata has been cleared for an item.
|
||||
**/
|
||||
Redeposited: AugmentedEvent<ApiType, [u32, Vec<u32>]>;
|
||||
/**
|
||||
@@ -1274,11 +1293,11 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
TeamChanged: AugmentedEvent<ApiType, [u32, AccountId32, AccountId32, AccountId32]>;
|
||||
/**
|
||||
* Some asset `instance` was thawed.
|
||||
* Some `item` was thawed.
|
||||
**/
|
||||
Thawed: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* An asset `instance` was transferred.
|
||||
* An `item` was transferred.
|
||||
**/
|
||||
Transferred: AugmentedEvent<ApiType, [u32, u32, AccountId32, AccountId32]>;
|
||||
/**
|
||||
@@ -1291,6 +1310,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* Batch of dispatches completed fully with no error.
|
||||
**/
|
||||
BatchCompleted: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* Batch of dispatches completed but has errors.
|
||||
**/
|
||||
BatchCompletedWithErrors: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* Batch of dispatches did not complete fully. Index of first failing dispatch given, as
|
||||
* well as the error.
|
||||
@@ -1304,6 +1327,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A single item within a Batch of dispatches has completed with no error.
|
||||
**/
|
||||
ItemCompleted: AugmentedEvent<ApiType, []>;
|
||||
/**
|
||||
* A single item within a Batch of dispatches has completed with error.
|
||||
**/
|
||||
ItemFailed: AugmentedEvent<ApiType, [SpRuntimeDispatchError]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
|
||||
import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, WrapperOpaque, bool, u128, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfo, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfo, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesCollectionDetails, PalletUniquesCollectionMetadata, PalletUniquesItemDetails, PalletUniquesItemMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/storage' {
|
||||
@@ -76,7 +76,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* This field should always be populated during block processing unless
|
||||
* secondary plain slots are enabled (which don't contain a VRF output).
|
||||
*
|
||||
* It is set in `on_initialize`, before it will contain the value from the last block.
|
||||
* It is set in `on_finalize`, before it will contain the value from the last block.
|
||||
**/
|
||||
authorVrfRandomness: AugmentedQuery<ApiType, () => Observable<Option<U8aFixed>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -109,7 +109,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Temporary value (cleared at block finalization) which is `Some`
|
||||
* if per-block initialization has already been called for current block.
|
||||
**/
|
||||
initialized: AugmentedQuery<ApiType, () => Observable<Option<Option<U8aFixed>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
initialized: AugmentedQuery<ApiType, () => Observable<Option<Option<SpConsensusBabeDigestsPreDigest>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* How late the current block is compared to its parent.
|
||||
*
|
||||
@@ -814,6 +814,9 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForSubPoolsStorage: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Ever increasing number of all pools created so far.
|
||||
**/
|
||||
lastPoolId: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Maximum number of members that can exist in the system. If `None`, then the count
|
||||
@@ -849,6 +852,12 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Active members.
|
||||
**/
|
||||
poolMembers: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletNominationPoolsPoolMember>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* A reverse lookup from the pool's account id to its id.
|
||||
*
|
||||
* This is only used for slashing. In all other instances, the pool id is used, and the
|
||||
* accounts are deterministically derived from it.
|
||||
**/
|
||||
reversePoolIdLookup: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Reward pools. This is where there rewards for each pool accumulate. When a members payout
|
||||
@@ -1612,37 +1621,41 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
};
|
||||
uniques: {
|
||||
/**
|
||||
* The assets held by any given account; set out this way so that assets owned by a single
|
||||
* The items held by any given account; set out this way so that items owned by a single
|
||||
* account can be enumerated.
|
||||
**/
|
||||
account: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<Option<Null>>, [AccountId32, u32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32, u32]>;
|
||||
/**
|
||||
* The assets in existence and their ownership details.
|
||||
* The items in existence and their ownership details.
|
||||
**/
|
||||
asset: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesInstanceDetails>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
asset: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesItemDetails>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* Metadata of an asset class.
|
||||
* Attributes of a collection.
|
||||
**/
|
||||
attribute: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: Option<u32> | null | object | string | Uint8Array, arg3: Bytes | string | Uint8Array) => Observable<Option<ITuple<[Bytes, u128]>>>, [u32, Option<u32>, Bytes]> & QueryableStorageEntry<ApiType, [u32, Option<u32>, Bytes]>;
|
||||
/**
|
||||
* Details of an asset class.
|
||||
* Details of a collection.
|
||||
**/
|
||||
class: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesClassDetails>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
class: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesCollectionDetails>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The classes owned by any given account; set out this way so that classes owned by a single
|
||||
* account can be enumerated.
|
||||
* The collections owned by any given account; set out this way so that collections owned by
|
||||
* a single account can be enumerated.
|
||||
**/
|
||||
classAccount: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<Null>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
|
||||
/**
|
||||
* Metadata of an asset class.
|
||||
* Metadata of a collection.
|
||||
**/
|
||||
classMetadataOf: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesClassMetadata>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
classMetadataOf: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesCollectionMetadata>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Metadata of an asset instance.
|
||||
* Keeps track of the number of items a collection might have.
|
||||
**/
|
||||
instanceMetadataOf: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesInstanceMetadata>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
collectionMaxSupply: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The class, if any, of which an account is willing to take ownership.
|
||||
* Metadata of an item.
|
||||
**/
|
||||
instanceMetadataOf: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesItemMetadata>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* The collection, if any, of which an account is willing to take ownership.
|
||||
**/
|
||||
ownershipAcceptance: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Data } from '@polkadot/types';
|
||||
import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleDispatchTime, FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletNominationPoolsBondExtra, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsPoolState, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletStateTrieMigrationProgress, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleDispatchTime, FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletNominationPoolsBondExtra, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpU128, PalletNominationPoolsConfigOpU32, PalletNominationPoolsPoolState, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletStateTrieMigrationProgress, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/submittable' {
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
||||
@@ -504,8 +504,10 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Anyone can call this function about any potentially dislocated account.
|
||||
*
|
||||
* Will never return an error; if `dislocated` does not exist or doesn't need a rebag, then
|
||||
* it is a noop and fees are still collected from `origin`.
|
||||
* Will always update the stored score of `dislocated` to the correct score, based on
|
||||
* `ScoreProvider`.
|
||||
*
|
||||
* If `dislocated` does not exists, it returns an error.
|
||||
**/
|
||||
rebag: AugmentedSubmittable<(dislocated: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
@@ -961,6 +963,19 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* not used by any contract.
|
||||
**/
|
||||
removeCode: AugmentedSubmittable<(codeHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
|
||||
/**
|
||||
* Privileged function that changes the code of an existing contract.
|
||||
*
|
||||
* This takes care of updating refcounts and all other necessary operations. Returns
|
||||
* an error if either the `code_hash` or `dest` do not exist.
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* This does **not** change the address of the contract in question. This means
|
||||
* that the contract address is no longer derived from its code hash after calling
|
||||
* this dispatchable.
|
||||
**/
|
||||
setCode: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, codeHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, H256]>;
|
||||
/**
|
||||
* Upload new `code` without instantiating a contract from it.
|
||||
*
|
||||
@@ -1175,7 +1190,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
/**
|
||||
* Add a new proposal to either be voted on or executed directly.
|
||||
*
|
||||
@@ -1205,7 +1220,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
/**
|
||||
* Set the collective's membership.
|
||||
*
|
||||
@@ -2271,7 +2286,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* This extrinsic must be called by a signed origin.
|
||||
**/
|
||||
buyTicket: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call]>;
|
||||
buyTicket: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call]>;
|
||||
/**
|
||||
* Set calls in storage which can be used to purchase a lottery ticket.
|
||||
*
|
||||
@@ -2280,7 +2295,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* This extrinsic must be called by the Manager origin.
|
||||
**/
|
||||
setCalls: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
setCalls: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Start a lottery using the provided configuration.
|
||||
*
|
||||
@@ -2411,7 +2426,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Plus Call Weight
|
||||
* # </weight>
|
||||
**/
|
||||
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
|
||||
asMultiThreshold1: AugmentedSubmittable<(otherSignatories: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Call]>;
|
||||
/**
|
||||
* Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously
|
||||
* for this operation will be unreserved on success.
|
||||
@@ -2507,7 +2522,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
poolWithdrawUnbonded: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Update configurations for the nomination pools. The origin must for this call must be
|
||||
* Update configurations for the nomination pools. The origin for this call must be
|
||||
* Root.
|
||||
*
|
||||
* # Arguments
|
||||
@@ -2552,6 +2567,16 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* `NoMoreChunks` error from the staking system.
|
||||
**/
|
||||
unbond: AugmentedSubmittable<(memberAccount: AccountId32 | string | Uint8Array, unbondingPoints: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Compact<u128>]>;
|
||||
/**
|
||||
* Update the roles of the pool.
|
||||
*
|
||||
* The root is the only entity that can change any of the roles, including itself,
|
||||
* excluding the depositor, who can never change.
|
||||
*
|
||||
* It emits an event, notifying UIs of the role change. This event is quite relevant to
|
||||
* most pool members and they should be informed of changes to pool roles.
|
||||
**/
|
||||
updateRoles: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, newRoot: PalletNominationPoolsConfigOpAccountId32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, newNominator: PalletNominationPoolsConfigOpAccountId32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array, newStateToggler: PalletNominationPoolsConfigOpAccountId32 | { Noop: any } | { Set: any } | { Remove: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpAccountId32, PalletNominationPoolsConfigOpAccountId32]>;
|
||||
/**
|
||||
* Withdraw unbonded funds from `member_account`. If no bonded funds can be unbonded, an
|
||||
* error is returned.
|
||||
@@ -2716,7 +2741,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Weight is a function of the number of proxies the user has (P).
|
||||
* # </weight>
|
||||
**/
|
||||
proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option<NodeRuntimeProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<NodeRuntimeProxyType>, Call]>;
|
||||
proxy: AugmentedSubmittable<(real: AccountId32 | string | Uint8Array, forceProxyType: Option<NodeRuntimeProxyType> | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Option<NodeRuntimeProxyType>, Call]>;
|
||||
/**
|
||||
* Dispatch the given `call` from an account that the sender is authorized for through
|
||||
* `add_proxy`.
|
||||
@@ -2736,7 +2761,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - P: the number of proxies the user has.
|
||||
* # </weight>
|
||||
**/
|
||||
proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option<NodeRuntimeProxyType> | null | object | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, AccountId32, Option<NodeRuntimeProxyType>, Call]>;
|
||||
proxyAnnounced: AugmentedSubmittable<(delegate: AccountId32 | string | Uint8Array, real: AccountId32 | string | Uint8Array, forceProxyType: Option<NodeRuntimeProxyType> | null | object | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, AccountId32, Option<NodeRuntimeProxyType>, Call]>;
|
||||
/**
|
||||
* Remove the given announcement of a delegate.
|
||||
*
|
||||
@@ -2818,7 +2843,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - `account`: The recovered account you want to make a call on-behalf-of.
|
||||
* - `call`: The call you want to make with the recovered account.
|
||||
**/
|
||||
asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Call]>;
|
||||
asRecovered: AugmentedSubmittable<(account: AccountId32 | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, Call]>;
|
||||
/**
|
||||
* Cancel the ability to use `as_recovered` for `account`.
|
||||
*
|
||||
@@ -3923,7 +3948,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Weight of derivative `call` execution + 10,000.
|
||||
* # </weight>
|
||||
**/
|
||||
sudo: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call]>;
|
||||
sudo: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call]>;
|
||||
/**
|
||||
* Authenticates the sudo key and dispatches a function call with `Signed` origin from
|
||||
* a given account.
|
||||
@@ -3937,7 +3962,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Weight of derivative `call` execution + 10,000.
|
||||
* # </weight>
|
||||
**/
|
||||
sudoAs: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Call]>;
|
||||
sudoAs: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Call]>;
|
||||
/**
|
||||
* Authenticates the sudo key and dispatches a function call with `Root` origin.
|
||||
* This function does not check the weight of the call, and instead allows the
|
||||
@@ -3950,7 +3975,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - The weight of this call is defined by the caller.
|
||||
* # </weight>
|
||||
**/
|
||||
sudoUncheckedWeight: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array, weight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, u64]>;
|
||||
sudoUncheckedWeight: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array, weight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, u64]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -4090,7 +4115,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
execute: AugmentedSubmittable<(proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
execute: AugmentedSubmittable<(proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, Compact<u32>]>;
|
||||
/**
|
||||
* Add a new proposal to either be voted on or executed directly.
|
||||
*
|
||||
@@ -4120,7 +4145,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | { callIndex?: any; args?: any } | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
/**
|
||||
* Set the collective's membership.
|
||||
*
|
||||
@@ -4492,46 +4517,46 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
};
|
||||
uniques: {
|
||||
/**
|
||||
* Approve an instance to be transferred by a delegated third-party account.
|
||||
* Approve an item to be transferred by a delegated third-party account.
|
||||
*
|
||||
* Origin must be Signed and must be the owner of the asset `instance`.
|
||||
* Origin must be Signed and must be the owner of the `item`.
|
||||
*
|
||||
* - `class`: The class of the asset to be approved for delegated transfer.
|
||||
* - `instance`: The instance of the asset to be approved for delegated transfer.
|
||||
* - `delegate`: The account to delegate permission to transfer the asset.
|
||||
* - `collection`: The collection of the item to be approved for delegated transfer.
|
||||
* - `item`: The item of the item to be approved for delegated transfer.
|
||||
* - `delegate`: The account to delegate permission to transfer the item.
|
||||
*
|
||||
* Emits `ApprovedTransfer` on success.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
approveTransfer: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, delegate: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
|
||||
approveTransfer: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, delegate: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
|
||||
/**
|
||||
* Destroy a single asset instance.
|
||||
* Destroy a single item.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Admin of the asset `class`.
|
||||
* Origin must be Signed and the sender should be the Admin of the `collection`.
|
||||
*
|
||||
* - `class`: The class of the asset to be burned.
|
||||
* - `instance`: The instance of the asset to be burned.
|
||||
* - `collection`: The collection of the item to be burned.
|
||||
* - `item`: The item of the item to be burned.
|
||||
* - `check_owner`: If `Some` then the operation will fail with `WrongOwner` unless the
|
||||
* asset is owned by this value.
|
||||
* item is owned by this value.
|
||||
*
|
||||
* Emits `Burned` with the actual amount burned.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
* Modes: `check_owner.is_some()`.
|
||||
**/
|
||||
burn: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, checkOwner: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<MultiAddress>]>;
|
||||
burn: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, checkOwner: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<MultiAddress>]>;
|
||||
/**
|
||||
* Cancel the prior approval for the transfer of an asset by a delegate.
|
||||
* Cancel the prior approval for the transfer of an item by a delegate.
|
||||
*
|
||||
* Origin must be either:
|
||||
* - the `Force` origin;
|
||||
* - `Signed` with the signer being the Admin of the asset `class`;
|
||||
* - `Signed` with the signer being the Owner of the asset `instance`;
|
||||
* - `Signed` with the signer being the Admin of the `collection`;
|
||||
* - `Signed` with the signer being the Owner of the `item`;
|
||||
*
|
||||
* Arguments:
|
||||
* - `class`: The class of the asset of whose approval will be cancelled.
|
||||
* - `instance`: The instance of the asset of whose approval will be cancelled.
|
||||
* - `collection`: The collection of the item of whose approval will be cancelled.
|
||||
* - `item`: The item of the item of whose approval will be cancelled.
|
||||
* - `maybe_check_delegate`: If `Some` will ensure that the given account is the one to
|
||||
* which permission of transfer is delegated.
|
||||
*
|
||||
@@ -4539,215 +4564,215 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
cancelApproval: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, maybeCheckDelegate: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<MultiAddress>]>;
|
||||
cancelApproval: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, maybeCheckDelegate: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<MultiAddress>]>;
|
||||
/**
|
||||
* Clear an attribute for an asset class or instance.
|
||||
* Clear an attribute for a collection or item.
|
||||
*
|
||||
* Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
|
||||
* asset `class`.
|
||||
* `collection`.
|
||||
*
|
||||
* Any deposit is freed for the asset class owner.
|
||||
* Any deposit is freed for the collection's owner.
|
||||
*
|
||||
* - `class`: The identifier of the asset class whose instance's metadata to clear.
|
||||
* - `maybe_instance`: The identifier of the asset instance whose metadata to clear.
|
||||
* - `collection`: The identifier of the collection whose item's metadata to clear.
|
||||
* - `maybe_item`: The identifier of the item whose metadata to clear.
|
||||
* - `key`: The key of the attribute.
|
||||
*
|
||||
* Emits `AttributeCleared`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
clearAttribute: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<u32>, Bytes]>;
|
||||
clearAttribute: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, maybeItem: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<u32>, Bytes]>;
|
||||
/**
|
||||
* Clear the metadata for an asset class.
|
||||
* Clear the metadata for a collection.
|
||||
*
|
||||
* Origin must be either `ForceOrigin` or `Signed` and the sender should be the Owner of
|
||||
* the asset `class`.
|
||||
* the `collection`.
|
||||
*
|
||||
* Any deposit is freed for the asset class owner.
|
||||
* Any deposit is freed for the collection's owner.
|
||||
*
|
||||
* - `class`: The identifier of the asset class whose metadata to clear.
|
||||
* - `collection`: The identifier of the collection whose metadata to clear.
|
||||
*
|
||||
* Emits `ClassMetadataCleared`.
|
||||
* Emits `CollectionMetadataCleared`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
clearClassMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
clearCollectionMetadata: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Clear the metadata for an asset instance.
|
||||
* Clear the metadata for an item.
|
||||
*
|
||||
* Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
|
||||
* asset `instance`.
|
||||
* `item`.
|
||||
*
|
||||
* Any deposit is freed for the asset class owner.
|
||||
* Any deposit is freed for the collection's owner.
|
||||
*
|
||||
* - `class`: The identifier of the asset class whose instance's metadata to clear.
|
||||
* - `instance`: The identifier of the asset instance whose metadata to clear.
|
||||
* - `collection`: The identifier of the collection whose item's metadata to clear.
|
||||
* - `item`: The identifier of the item whose metadata to clear.
|
||||
*
|
||||
* Emits `MetadataCleared`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
clearMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
clearMetadata: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Issue a new class of non-fungible assets from a public origin.
|
||||
* Issue a new collection of non-fungible items from a public origin.
|
||||
*
|
||||
* This new asset class has no assets initially and its owner is the origin.
|
||||
* This new collection has no items initially and its owner is the origin.
|
||||
*
|
||||
* The origin must be Signed and the sender must have sufficient funds free.
|
||||
*
|
||||
* `AssetDeposit` funds of sender are reserved.
|
||||
* `ItemDeposit` funds of sender are reserved.
|
||||
*
|
||||
* Parameters:
|
||||
* - `class`: The identifier of the new asset class. This must not be currently in use.
|
||||
* - `admin`: The admin of this class of assets. The admin is the initial address of each
|
||||
* member of the asset class's admin team.
|
||||
* - `collection`: The identifier of the new collection. This must not be currently in use.
|
||||
* - `admin`: The admin of this collection. The admin is the initial address of each
|
||||
* member of the collection's admin team.
|
||||
*
|
||||
* Emits `Created` event when successful.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
create: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress]>;
|
||||
create: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress]>;
|
||||
/**
|
||||
* Destroy a class of fungible assets.
|
||||
* Destroy a collection of fungible items.
|
||||
*
|
||||
* The origin must conform to `ForceOrigin` or must be `Signed` and the sender must be the
|
||||
* owner of the asset `class`.
|
||||
* owner of the `collection`.
|
||||
*
|
||||
* - `class`: The identifier of the asset class to be destroyed.
|
||||
* - `witness`: Information on the instances minted in the asset class. This must be
|
||||
* - `collection`: The identifier of the collection to be destroyed.
|
||||
* - `witness`: Information on the items minted in the collection. This must be
|
||||
* correct.
|
||||
*
|
||||
* Emits `Destroyed` event when successful.
|
||||
*
|
||||
* Weight: `O(n + m)` where:
|
||||
* - `n = witness.instances`
|
||||
* - `m = witness.instance_metadatas`
|
||||
* - `n = witness.items`
|
||||
* - `m = witness.item_metadatas`
|
||||
* - `a = witness.attributes`
|
||||
**/
|
||||
destroy: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, witness: PalletUniquesDestroyWitness | { instances?: any; instanceMetadatas?: any; attributes?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletUniquesDestroyWitness]>;
|
||||
destroy: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, witness: PalletUniquesDestroyWitness | { items?: any; itemMetadatas?: any; attributes?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletUniquesDestroyWitness]>;
|
||||
/**
|
||||
* Alter the attributes of a given asset.
|
||||
* Issue a new collection of non-fungible items from a privileged origin.
|
||||
*
|
||||
* Origin must be `ForceOrigin`.
|
||||
*
|
||||
* - `class`: The identifier of the asset.
|
||||
* - `owner`: The new Owner of this asset.
|
||||
* - `issuer`: The new Issuer of this asset.
|
||||
* - `admin`: The new Admin of this asset.
|
||||
* - `freezer`: The new Freezer of this asset.
|
||||
* - `free_holding`: Whether a deposit is taken for holding an instance of this asset
|
||||
* class.
|
||||
* - `is_frozen`: Whether this asset class is frozen except for permissioned/admin
|
||||
* instructions.
|
||||
*
|
||||
* Emits `AssetStatusChanged` with the identity of the asset.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceAssetStatus: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, MultiAddress, MultiAddress, MultiAddress, bool, bool]>;
|
||||
/**
|
||||
* Issue a new class of non-fungible assets from a privileged origin.
|
||||
*
|
||||
* This new asset class has no assets initially.
|
||||
* This new collection has no items initially.
|
||||
*
|
||||
* The origin must conform to `ForceOrigin`.
|
||||
*
|
||||
* Unlike `create`, no funds are reserved.
|
||||
*
|
||||
* - `class`: The identifier of the new asset. This must not be currently in use.
|
||||
* - `owner`: The owner of this class of assets. The owner has full superuser permissions
|
||||
* over this asset, but may later change and configure the permissions using
|
||||
* - `collection`: The identifier of the new item. This must not be currently in use.
|
||||
* - `owner`: The owner of this collection of items. The owner has full superuser
|
||||
* permissions
|
||||
* over this item, but may later change and configure the permissions using
|
||||
* `transfer_ownership` and `set_team`.
|
||||
*
|
||||
* Emits `ForceCreated` event when successful.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceCreate: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, bool]>;
|
||||
forceCreate: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, bool]>;
|
||||
/**
|
||||
* Disallow further unprivileged transfer of an asset instance.
|
||||
* Alter the attributes of a given item.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Freezer of the asset `class`.
|
||||
* Origin must be `ForceOrigin`.
|
||||
*
|
||||
* - `class`: The class of the asset to be frozen.
|
||||
* - `instance`: The instance of the asset to be frozen.
|
||||
* - `collection`: The identifier of the item.
|
||||
* - `owner`: The new Owner of this item.
|
||||
* - `issuer`: The new Issuer of this item.
|
||||
* - `admin`: The new Admin of this item.
|
||||
* - `freezer`: The new Freezer of this item.
|
||||
* - `free_holding`: Whether a deposit is taken for holding an item of this collection.
|
||||
* - `is_frozen`: Whether this collection is frozen except for permissioned/admin
|
||||
* instructions.
|
||||
*
|
||||
* Emits `ItemStatusChanged` with the identity of the item.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceItemStatus: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, MultiAddress, MultiAddress, MultiAddress, bool, bool]>;
|
||||
/**
|
||||
* Disallow further unprivileged transfer of an item.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Freezer of the `collection`.
|
||||
*
|
||||
* - `collection`: The collection of the item to be frozen.
|
||||
* - `item`: The item of the item to be frozen.
|
||||
*
|
||||
* Emits `Frozen`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
freeze: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
freeze: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Disallow further unprivileged transfers for a whole asset class.
|
||||
* Disallow further unprivileged transfers for a whole collection.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Freezer of the asset `class`.
|
||||
* Origin must be Signed and the sender should be the Freezer of the `collection`.
|
||||
*
|
||||
* - `class`: The asset class to be frozen.
|
||||
* - `collection`: The collection to be frozen.
|
||||
*
|
||||
* Emits `ClassFrozen`.
|
||||
* Emits `CollectionFrozen`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
freezeClass: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
freezeCollection: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Mint an asset instance of a particular class.
|
||||
* Mint an item of a particular collection.
|
||||
*
|
||||
* The origin must be Signed and the sender must be the Issuer of the asset `class`.
|
||||
* The origin must be Signed and the sender must be the Issuer of the `collection`.
|
||||
*
|
||||
* - `class`: The class of the asset to be minted.
|
||||
* - `instance`: The instance value of the asset to be minted.
|
||||
* - `beneficiary`: The initial owner of the minted asset.
|
||||
* - `collection`: The collection of the item to be minted.
|
||||
* - `item`: The item value of the item to be minted.
|
||||
* - `beneficiary`: The initial owner of the minted item.
|
||||
*
|
||||
* Emits `Issued` event when successful.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
mint: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
|
||||
mint: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
|
||||
/**
|
||||
* Reevaluate the deposits on some assets.
|
||||
* Reevaluate the deposits on some items.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Owner of the asset `class`.
|
||||
* Origin must be Signed and the sender should be the Owner of the `collection`.
|
||||
*
|
||||
* - `class`: The class of the asset to be frozen.
|
||||
* - `instances`: The instances of the asset class whose deposits will be reevaluated.
|
||||
* - `collection`: The collection to be frozen.
|
||||
* - `items`: The items of the collection whose deposits will be reevaluated.
|
||||
*
|
||||
* NOTE: This exists as a best-effort function. Any asset instances which are unknown or
|
||||
* NOTE: This exists as a best-effort function. Any items which are unknown or
|
||||
* in the case that the owner account does not have reservable funds to pay for a
|
||||
* deposit increase are ignored. Generally the owner isn't going to call this on instances
|
||||
* deposit increase are ignored. Generally the owner isn't going to call this on items
|
||||
* whose existing deposit is less than the refreshed deposit as it would only cost them,
|
||||
* so it's of little consequence.
|
||||
*
|
||||
* It will still return an error in the case that the class is unknown of the signer is
|
||||
* not permitted to call it.
|
||||
* It will still return an error in the case that the collection is unknown of the signer
|
||||
* is not permitted to call it.
|
||||
*
|
||||
* Weight: `O(instances.len())`
|
||||
* Weight: `O(items.len())`
|
||||
**/
|
||||
redeposit: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instances: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
|
||||
redeposit: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, items: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
|
||||
/**
|
||||
* Set (or reset) the acceptance of ownership for a particular account.
|
||||
*
|
||||
* Origin must be `Signed` and if `maybe_class` is `Some`, then the signer must have a
|
||||
* Origin must be `Signed` and if `maybe_collection` is `Some`, then the signer must have a
|
||||
* provider reference.
|
||||
*
|
||||
* - `maybe_class`: The identifier of the asset class whose ownership the signer is willing
|
||||
* to accept, or if `None`, an indication that the signer is willing to accept no
|
||||
* - `maybe_collection`: The identifier of the collection whose ownership the signer is
|
||||
* willing to accept, or if `None`, an indication that the signer is willing to accept no
|
||||
* ownership transferal.
|
||||
*
|
||||
* Emits `OwnershipAcceptanceChanged`.
|
||||
**/
|
||||
setAcceptOwnership: AugmentedSubmittable<(maybeClass: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
|
||||
setAcceptOwnership: AugmentedSubmittable<(maybeCollection: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
|
||||
/**
|
||||
* Set an attribute for an asset class or instance.
|
||||
* Set an attribute for a collection or item.
|
||||
*
|
||||
* Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
|
||||
* asset `class`.
|
||||
* `collection`.
|
||||
*
|
||||
* If the origin is Signed, then funds of signer are reserved according to the formula:
|
||||
* `MetadataDepositBase + DepositPerByte * (key.len + value.len)` taking into
|
||||
* account any already reserved funds.
|
||||
*
|
||||
* - `class`: The identifier of the asset class whose instance's metadata to set.
|
||||
* - `maybe_instance`: The identifier of the asset instance whose metadata to set.
|
||||
* - `collection`: The identifier of the collection whose item's metadata to set.
|
||||
* - `maybe_item`: The identifier of the item whose metadata to set.
|
||||
* - `key`: The key of the attribute.
|
||||
* - `value`: The value to which to set the attribute.
|
||||
*
|
||||
@@ -4755,118 +4780,132 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setAttribute: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<u32>, Bytes, Bytes]>;
|
||||
setAttribute: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, maybeItem: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<u32>, Bytes, Bytes]>;
|
||||
/**
|
||||
* Set the metadata for an asset class.
|
||||
* Set the maximum amount of items a collection could have.
|
||||
*
|
||||
* Origin must be either `ForceOrigin` or `Signed` and the sender should be the Owner of
|
||||
* the asset `class`.
|
||||
* the `collection`.
|
||||
*
|
||||
* Note: This function can only succeed once per collection.
|
||||
*
|
||||
* - `collection`: The identifier of the collection to change.
|
||||
* - `max_supply`: The maximum amount of items a collection could have.
|
||||
*
|
||||
* Emits `CollectionMaxSupplySet` event when successful.
|
||||
**/
|
||||
setCollectionMaxSupply: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, maxSupply: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Set the metadata for a collection.
|
||||
*
|
||||
* Origin must be either `ForceOrigin` or `Signed` and the sender should be the Owner of
|
||||
* the `collection`.
|
||||
*
|
||||
* If the origin is `Signed`, then funds of signer are reserved according to the formula:
|
||||
* `MetadataDepositBase + DepositPerByte * data.len` taking into
|
||||
* account any already reserved funds.
|
||||
*
|
||||
* - `class`: The identifier of the asset whose metadata to update.
|
||||
* - `data`: The general information of this asset. Limited in length by `StringLimit`.
|
||||
* - `collection`: The identifier of the item whose metadata to update.
|
||||
* - `data`: The general information of this item. Limited in length by `StringLimit`.
|
||||
* - `is_frozen`: Whether the metadata should be frozen against further changes.
|
||||
*
|
||||
* Emits `ClassMetadataSet`.
|
||||
* Emits `CollectionMetadataSet`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setClassMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes, bool]>;
|
||||
setCollectionMetadata: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes, bool]>;
|
||||
/**
|
||||
* Set the metadata for an asset instance.
|
||||
* Set the metadata for an item.
|
||||
*
|
||||
* Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
|
||||
* asset `class`.
|
||||
* `collection`.
|
||||
*
|
||||
* If the origin is Signed, then funds of signer are reserved according to the formula:
|
||||
* `MetadataDepositBase + DepositPerByte * data.len` taking into
|
||||
* account any already reserved funds.
|
||||
*
|
||||
* - `class`: The identifier of the asset class whose instance's metadata to set.
|
||||
* - `instance`: The identifier of the asset instance whose metadata to set.
|
||||
* - `data`: The general information of this asset. Limited in length by `StringLimit`.
|
||||
* - `collection`: The identifier of the collection whose item's metadata to set.
|
||||
* - `item`: The identifier of the item whose metadata to set.
|
||||
* - `data`: The general information of this item. Limited in length by `StringLimit`.
|
||||
* - `is_frozen`: Whether the metadata should be frozen against further changes.
|
||||
*
|
||||
* Emits `MetadataSet`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Bytes, bool]>;
|
||||
setMetadata: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Bytes, bool]>;
|
||||
/**
|
||||
* Change the Issuer, Admin and Freezer of an asset class.
|
||||
* Change the Issuer, Admin and Freezer of a collection.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Owner of the asset `class`.
|
||||
* Origin must be Signed and the sender should be the Owner of the `collection`.
|
||||
*
|
||||
* - `class`: The asset class whose team should be changed.
|
||||
* - `issuer`: The new Issuer of this asset class.
|
||||
* - `admin`: The new Admin of this asset class.
|
||||
* - `freezer`: The new Freezer of this asset class.
|
||||
* - `collection`: The collection whose team should be changed.
|
||||
* - `issuer`: The new Issuer of this collection.
|
||||
* - `admin`: The new Admin of this collection.
|
||||
* - `freezer`: The new Freezer of this collection.
|
||||
*
|
||||
* Emits `TeamChanged`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setTeam: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, MultiAddress, MultiAddress]>;
|
||||
setTeam: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, MultiAddress, MultiAddress]>;
|
||||
/**
|
||||
* Re-allow unprivileged transfer of an asset instance.
|
||||
* Re-allow unprivileged transfer of an item.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Freezer of the asset `class`.
|
||||
* Origin must be Signed and the sender should be the Freezer of the `collection`.
|
||||
*
|
||||
* - `class`: The class of the asset to be thawed.
|
||||
* - `instance`: The instance of the asset to be thawed.
|
||||
* - `collection`: The collection of the item to be thawed.
|
||||
* - `item`: The item of the item to be thawed.
|
||||
*
|
||||
* Emits `Thawed`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
thaw: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
thaw: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Re-allow unprivileged transfers for a whole asset class.
|
||||
* Re-allow unprivileged transfers for a whole collection.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Admin of the asset `class`.
|
||||
* Origin must be Signed and the sender should be the Admin of the `collection`.
|
||||
*
|
||||
* - `class`: The class to be thawed.
|
||||
* - `collection`: The collection to be thawed.
|
||||
*
|
||||
* Emits `ClassThawed`.
|
||||
* Emits `CollectionThawed`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
thawClass: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
thawCollection: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Move an asset from the sender account to another.
|
||||
* Move an item from the sender account to another.
|
||||
*
|
||||
* Origin must be Signed and the signing account must be either:
|
||||
* - the Admin of the asset `class`;
|
||||
* - the Owner of the asset `instance`;
|
||||
* - the approved delegate for the asset `instance` (in this case, the approval is reset).
|
||||
* - the Admin of the `collection`;
|
||||
* - the Owner of the `item`;
|
||||
* - the approved delegate for the `item` (in this case, the approval is reset).
|
||||
*
|
||||
* Arguments:
|
||||
* - `class`: The class of the asset to be transferred.
|
||||
* - `instance`: The instance of the asset to be transferred.
|
||||
* - `dest`: The account to receive ownership of the asset.
|
||||
* - `collection`: The collection of the item to be transferred.
|
||||
* - `item`: The item of the item to be transferred.
|
||||
* - `dest`: The account to receive ownership of the item.
|
||||
*
|
||||
* Emits `Transferred`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
transfer: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
|
||||
transfer: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, item: u32 | AnyNumber | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
|
||||
/**
|
||||
* Change the Owner of an asset class.
|
||||
* Change the Owner of a collection.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Owner of the asset `class`.
|
||||
* Origin must be Signed and the sender should be the Owner of the `collection`.
|
||||
*
|
||||
* - `class`: The asset class whose owner should be changed.
|
||||
* - `owner`: The new Owner of this asset class. They must have called
|
||||
* `set_accept_ownership` with `class` in order for this operation to succeed.
|
||||
* - `collection`: The collection whose owner should be changed.
|
||||
* - `owner`: The new Owner of this collection. They must have called
|
||||
* `set_accept_ownership` with `collection` in order for this operation to succeed.
|
||||
*
|
||||
* Emits `OwnerChanged`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
transferOwnership: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress]>;
|
||||
transferOwnership: AugmentedSubmittable<(collection: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -4888,7 +4927,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_.
|
||||
**/
|
||||
asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Call]>;
|
||||
asDerivative: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, Call]>;
|
||||
/**
|
||||
* Send a batch of dispatch calls.
|
||||
*
|
||||
@@ -4910,7 +4949,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* and the error of the failed call. If all were successful, then the `BatchCompleted`
|
||||
* event is deposited.
|
||||
**/
|
||||
batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Send a batch of dispatch calls and atomically execute them.
|
||||
* The whole transaction will rollback and fail if any of the calls failed.
|
||||
@@ -4927,7 +4966,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Complexity: O(C) where C is the number of calls to be batched.
|
||||
* # </weight>
|
||||
**/
|
||||
batchAll: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
batchAll: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Dispatches a function call with a provided origin.
|
||||
*
|
||||
@@ -4940,7 +4979,24 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - Weight of derivative `call` execution + T::WeightInfo::dispatch_as().
|
||||
* # </weight>
|
||||
**/
|
||||
dispatchAs: AugmentedSubmittable<(asOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, Call]>;
|
||||
dispatchAs: AugmentedSubmittable<(asOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, Call]>;
|
||||
/**
|
||||
* Send a batch of dispatch calls.
|
||||
* Unlike `batch`, it allows errors and won't interrupt.
|
||||
*
|
||||
* May be called from any origin.
|
||||
*
|
||||
* - `calls`: The calls to be dispatched from the same origin. The number of call must not
|
||||
* exceed the constant: `batched_calls_limit` (available in constant metadata).
|
||||
*
|
||||
* If origin is root then call are dispatch without checking origin filter. (This includes
|
||||
* bypassing `frame_system::Config::BaseCallFilter`).
|
||||
*
|
||||
* # <weight>
|
||||
* - Complexity: O(C) where C is the number of calls to be batched.
|
||||
* # </weight>
|
||||
**/
|
||||
forceBatch: AugmentedSubmittable<(calls: Vec<Call> | (Call | IMethod | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -5053,7 +5109,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
};
|
||||
whitelist: {
|
||||
dispatchWhitelistedCall: AugmentedSubmittable<(callHash: H256 | string | Uint8Array, callWeightWitness: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, u64]>;
|
||||
dispatchWhitelistedCallWithPreimage: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call]>;
|
||||
dispatchWhitelistedCallWithPreimage: AugmentedSubmittable<(call: Call | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call]>;
|
||||
removeWhitelistedCall: AugmentedSubmittable<(callHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
|
||||
whitelistCall: AugmentedSubmittable<(callHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
|
||||
/**
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/rpc-core": "8.3.2",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/rpc-core": "8.6.2",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1",
|
||||
"rxjs": "^7.5.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/api": "8.3.2",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/types-codec": "8.3.2",
|
||||
"@polkadot/types-create": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1",
|
||||
"@polkadot/util-crypto": "^9.1.1",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/api": "8.6.2",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/types-create": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1",
|
||||
"@polkadot/util-crypto": "^9.3.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "8.3.2",
|
||||
"@polkadot/keyring": "^9.1.1"
|
||||
"@polkadot/api-augment": "8.6.2",
|
||||
"@polkadot/keyring": "^9.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/api": "8.3.2",
|
||||
"@polkadot/api-augment": "8.3.2",
|
||||
"@polkadot/api-base": "8.3.2",
|
||||
"@polkadot/rpc-core": "8.3.2",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/types-codec": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1",
|
||||
"@polkadot/util-crypto": "^9.1.1",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/api": "8.6.2",
|
||||
"@polkadot/api-augment": "8.6.2",
|
||||
"@polkadot/api-base": "8.6.2",
|
||||
"@polkadot/rpc-core": "8.6.2",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1",
|
||||
"@polkadot/util-crypto": "^9.3.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api": "8.3.2",
|
||||
"@polkadot/api-augment": "8.3.2",
|
||||
"@polkadot/rpc-augment": "8.3.2",
|
||||
"@polkadot/rpc-provider": "8.3.2",
|
||||
"@polkadot/types-support": "8.3.2"
|
||||
"@polkadot/api": "8.6.2",
|
||||
"@polkadot/api-augment": "8.6.2",
|
||||
"@polkadot/rpc-augment": "8.6.2",
|
||||
"@polkadot/rpc-provider": "8.6.2",
|
||||
"@polkadot/types-support": "8.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ function retrieveNick (api: DeriveApi, accountId?: AccountId): Observable<string
|
||||
) as Observable<Option<ITuple<[Bytes, Balance]>> | undefined>).pipe(
|
||||
map((nameOf): string | undefined =>
|
||||
nameOf?.isSome
|
||||
? u8aToString(nameOf.unwrap()[0]).substr(0, (api.consts.nicks.maxLength as u32).toNumber())
|
||||
? u8aToString(nameOf.unwrap()[0]).substring(0, (api.consts.nicks.maxLength as u32).toNumber())
|
||||
: undefined
|
||||
)
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ function traverseLinks (api: DeriveApi, head: AccountId32 | string): Observable<
|
||||
),
|
||||
tap((node: Option<PalletBagsListListNode>): void => {
|
||||
setTimeout((): void => {
|
||||
node.isSome && (node.value as PalletBagsListListNode).next.isSome
|
||||
node.isSome && node.value.next.isSome
|
||||
? subject.next(node.unwrap().next.unwrap())
|
||||
: subject.complete();
|
||||
}, 0);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { u32, Vec } from '@polkadot/types';
|
||||
import type { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces';
|
||||
import type { AccountId32, Balance, BlockNumber } from '@polkadot/types/interfaces';
|
||||
import type { PalletElectionsPhragmenSeatHolder } from '@polkadot/types/lookup';
|
||||
import type { ITuple } from '@polkadot/types/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
@@ -14,31 +14,31 @@ import { combineLatest, map, of } from 'rxjs';
|
||||
import { memo } from '../util';
|
||||
|
||||
// SeatHolder is current tuple is 2.x-era Substrate
|
||||
type Member = PalletElectionsPhragmenSeatHolder | ITuple<[AccountId, Balance]>;
|
||||
type Member = PalletElectionsPhragmenSeatHolder | ITuple<[AccountId32, Balance]>;
|
||||
|
||||
type Candidate = AccountId | ITuple<[AccountId, Balance]>;
|
||||
type Candidate = AccountId32 | ITuple<[AccountId32, Balance]>;
|
||||
|
||||
function isSeatHolder (value: Member): value is PalletElectionsPhragmenSeatHolder {
|
||||
return !Array.isArray(value);
|
||||
}
|
||||
|
||||
function isCandidateTuple (value: Candidate): value is ITuple<[AccountId, Balance]> {
|
||||
function isCandidateTuple (value: Candidate): value is ITuple<[AccountId32, Balance]> {
|
||||
return Array.isArray(value);
|
||||
}
|
||||
|
||||
function getAccountTuple (value: Member): [AccountId, Balance] {
|
||||
function getAccountTuple (value: Member): [AccountId32, Balance] {
|
||||
return isSeatHolder(value)
|
||||
? [value.who, value.stake]
|
||||
: value;
|
||||
}
|
||||
|
||||
function getCandidate (value: Candidate): AccountId {
|
||||
function getCandidate (value: Candidate): AccountId32 {
|
||||
return isCandidateTuple(value)
|
||||
? value[0]
|
||||
: value;
|
||||
}
|
||||
|
||||
function sortAccounts ([, balanceA]: [AccountId, Balance], [, balanceB]: [AccountId, Balance]): number {
|
||||
function sortAccounts ([, balanceA]: [AccountId32, Balance], [, balanceB]: [AccountId32, Balance]): number {
|
||||
return balanceB.cmp(balanceA);
|
||||
}
|
||||
|
||||
@@ -67,6 +67,24 @@ function getModules (api: DeriveApi): [string, string | null] {
|
||||
return [council, elections];
|
||||
}
|
||||
|
||||
function queryAll (api: DeriveApi, council: string, elections: string): Observable<[AccountId32[], Candidate[], Member[], Member[]]> {
|
||||
return api.queryMulti<[Vec<AccountId32>, Vec<Candidate>, Vec<Member>, Vec<Member>]>([
|
||||
api.query[council as 'council'].members,
|
||||
api.query[elections as 'phragmenElection'].candidates,
|
||||
api.query[elections as 'phragmenElection'].members,
|
||||
api.query[elections as 'phragmenElection'].runnersUp
|
||||
]);
|
||||
}
|
||||
|
||||
function queryCouncil (api: DeriveApi, council: string): Observable<[AccountId32[], Candidate[], Member[], Member[]]> {
|
||||
return combineLatest([
|
||||
api.query[council as 'council'].members(),
|
||||
of<Candidate[]>([]),
|
||||
of<Member[]>([]),
|
||||
of<Member[]>([])
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @name info
|
||||
* @returns An object containing the combined results of the storage queries for
|
||||
@@ -86,18 +104,8 @@ export function info (instanceId: string, api: DeriveApi): () => Observable<Deri
|
||||
|
||||
return (
|
||||
elections
|
||||
? api.queryMulti<[Vec<AccountId>, Vec<Candidate>, Vec<Member>, Vec<Member>]>([
|
||||
api.query[council].members,
|
||||
api.query[elections].candidates,
|
||||
api.query[elections].members,
|
||||
api.query[elections].runnersUp
|
||||
])
|
||||
: combineLatest([
|
||||
api.query[council].members<Vec<AccountId>>(),
|
||||
of<Candidate[]>([]),
|
||||
of<Member[]>([]),
|
||||
of<Member[]>([])
|
||||
])
|
||||
? queryAll(api, council, elections)
|
||||
: queryCouncil(api, council)
|
||||
).pipe(
|
||||
map(([councilMembers, candidates, members, runnersUp]): DeriveElectionsInfo => ({
|
||||
...getConstants(api, elections),
|
||||
@@ -105,7 +113,7 @@ export function info (instanceId: string, api: DeriveApi): () => Observable<Deri
|
||||
candidates: candidates.map(getCandidate),
|
||||
members: members.length
|
||||
? members.map(getAccountTuple).sort(sortAccounts)
|
||||
: councilMembers.map((a): [AccountId, Balance] => [a, api.registry.createType('Balance')]),
|
||||
: councilMembers.map((a): [AccountId32, Balance] => [a, api.registry.createType('Balance')]),
|
||||
runnersUp: runnersUp.map(getAccountTuple).sort(sortAccounts)
|
||||
}))
|
||||
);
|
||||
|
||||
@@ -15,7 +15,7 @@ import { ExactDerive } from '.';
|
||||
|
||||
const testFunction = (api: ApiRx): any => {
|
||||
return <S extends keyof ExactDerive, M extends keyof (typeof api.derive[S])>(section: S, method: M, inputs: any[]): void => {
|
||||
describe(`derive.${section}.${method}`, (): void => {
|
||||
describe(`derive.${section}.${method as string}`, (): void => {
|
||||
it('should be a function', (): void => {
|
||||
expect(typeof api.derive[section][method]).toBe('function');
|
||||
});
|
||||
|
||||
@@ -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.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
+18
-18
@@ -20,29 +20,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/api-augment": "8.3.2",
|
||||
"@polkadot/api-base": "8.3.2",
|
||||
"@polkadot/api-derive": "8.3.2",
|
||||
"@polkadot/keyring": "^9.1.1",
|
||||
"@polkadot/rpc-augment": "8.3.2",
|
||||
"@polkadot/rpc-core": "8.3.2",
|
||||
"@polkadot/rpc-provider": "8.3.2",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/types-augment": "8.3.2",
|
||||
"@polkadot/types-codec": "8.3.2",
|
||||
"@polkadot/types-create": "8.3.2",
|
||||
"@polkadot/types-known": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1",
|
||||
"@polkadot/util-crypto": "^9.1.1",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/api-augment": "8.6.2",
|
||||
"@polkadot/api-base": "8.6.2",
|
||||
"@polkadot/api-derive": "8.6.2",
|
||||
"@polkadot/keyring": "^9.3.1",
|
||||
"@polkadot/rpc-augment": "8.6.2",
|
||||
"@polkadot/rpc-core": "8.6.2",
|
||||
"@polkadot/rpc-provider": "8.6.2",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-augment": "8.6.2",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/types-create": "8.6.2",
|
||||
"@polkadot/types-known": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1",
|
||||
"@polkadot/util-crypto": "^9.3.1",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "8.3.2",
|
||||
"@polkadot/types-support": "8.3.2"
|
||||
"@polkadot/api-augment": "8.6.2",
|
||||
"@polkadot/types-support": "8.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/rpc-core": "8.3.2",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/types-codec": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1"
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/rpc-core": "8.6.2",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
|
||||
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
|
||||
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
|
||||
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
|
||||
@@ -353,10 +353,14 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
|
||||
subscribeJustifications: AugmentedRpc<() => Observable<JustificationNotification>>;
|
||||
};
|
||||
mmr: {
|
||||
/**
|
||||
* Generate MMR proof for the given leaf indices.
|
||||
**/
|
||||
generateBatchProof: AugmentedRpc<(leafIndices: Vec<u64> | (u64 | AnyNumber | Uint8Array)[], at?: BlockHash | string | Uint8Array) => Observable<MmrLeafProof>>;
|
||||
/**
|
||||
* Generate MMR proof for given leaf index.
|
||||
**/
|
||||
generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<MmrLeafProof>>;
|
||||
generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<MmrLeafBatchProof>>;
|
||||
};
|
||||
net: {
|
||||
/**
|
||||
|
||||
@@ -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.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/rpc-augment": "8.3.2",
|
||||
"@polkadot/rpc-provider": "8.3.2",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/rpc-augment": "8.6.2",
|
||||
"@polkadot/rpc-provider": "8.6.2",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^9.1.1",
|
||||
"@polkadot/rpc-augment": "8.3.2"
|
||||
"@polkadot/keyring": "^9.3.1",
|
||||
"@polkadot/rpc-augment": "8.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { RpcInterfaceMethod } from './types';
|
||||
import { Observable, publishReplay, refCount } from 'rxjs';
|
||||
|
||||
import { rpcDefinitions } from '@polkadot/types';
|
||||
import { assert, hexToU8a, isFunction, isNull, isUndefined, lazyMethod, logger, memoize, objectSpread, u8aToU8a } from '@polkadot/util';
|
||||
import { assert, hexToU8a, isFunction, isNull, isUndefined, lazyMethod, logger, memoize, objectSpread, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { drr, refCountDelay } from './util';
|
||||
|
||||
@@ -455,7 +455,10 @@ export class RpcCore {
|
||||
return registry.createTypeUnsafe(type, [
|
||||
isEmpty
|
||||
? meta.fallback
|
||||
? hexToU8a(meta.fallback.toHex())
|
||||
// For old-style Linkage, we add an empty linkage at the end
|
||||
? type.includes('Linkage<')
|
||||
? u8aConcat(hexToU8a(meta.fallback.toHex()), new Uint8Array(2))
|
||||
: hexToU8a(meta.fallback.toHex())
|
||||
: undefined
|
||||
: meta.modifier.isOptional
|
||||
? registry.createTypeUnsafe(type, [input], { blockHash, isPedantic: true })
|
||||
|
||||
@@ -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.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -20,21 +20,21 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/keyring": "^9.1.1",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/types-support": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1",
|
||||
"@polkadot/util-crypto": "^9.1.1",
|
||||
"@polkadot/x-fetch": "^9.1.1",
|
||||
"@polkadot/x-global": "^9.1.1",
|
||||
"@polkadot/x-ws": "^9.1.1",
|
||||
"@substrate/connect": "0.7.4",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/keyring": "^9.3.1",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-support": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1",
|
||||
"@polkadot/util-crypto": "^9.3.1",
|
||||
"@polkadot/x-fetch": "^9.3.1",
|
||||
"@polkadot/x-global": "^9.3.1",
|
||||
"@polkadot/x-ws": "^9.3.1",
|
||||
"@substrate/connect": "0.7.5",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"mock-socket": "^9.1.3",
|
||||
"mock-socket": "^9.1.4",
|
||||
"nock": "^13.2.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Assuming all 1.5MB responses, we apply a default allowing for 576MB
|
||||
// Assuming all 1.5MB responses, we apply a default allowing for 192MB
|
||||
// cache space (depending on the historic queries this would vary, metadata
|
||||
// for Kusama/Polkadot/Substrate falls between 600-750K, 2x for estimate)
|
||||
const DEFAULT_CAPACITY = 384;
|
||||
const DEFAULT_CAPACITY = 128;
|
||||
|
||||
class LRUNode {
|
||||
public readonly key: string;
|
||||
|
||||
@@ -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.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Config as ScConfig } from '@substrate/connect';
|
||||
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types';
|
||||
|
||||
import { Chain, createScClient, ScClient, WellKnownChain } from '@substrate/connect';
|
||||
@@ -67,7 +68,9 @@ export class ScProvider implements ProviderInterface {
|
||||
throw new Error('clone() is not supported.');
|
||||
}
|
||||
|
||||
async connect (): Promise<void> {
|
||||
// Config details can be found in @substrate/connect repo following the link:
|
||||
// https://github.com/paritytech/substrate-connect/blob/main/packages/connect/src/connector/index.ts
|
||||
async connect (config?: ScConfig): Promise<void> {
|
||||
assert(!this.isConnected, 'Already connected!');
|
||||
|
||||
// it could happen that after emitting `disconnected` due to the fact taht
|
||||
@@ -86,7 +89,7 @@ export class ScProvider implements ProviderInterface {
|
||||
|
||||
const client = this.#sharedSandbox
|
||||
? scClients.get(this.#sharedSandbox)
|
||||
: createScClient();
|
||||
: createScClient(config);
|
||||
|
||||
assert(client, 'Unkown ScProvider!');
|
||||
scClients.set(this, client);
|
||||
@@ -348,3 +351,4 @@ export class ScProvider implements ProviderInterface {
|
||||
}
|
||||
}
|
||||
export type ScProviderClass = typeof ScProvider
|
||||
export type Config = ScConfig
|
||||
|
||||
@@ -300,7 +300,7 @@ export class WsProvider implements ProviderInterface {
|
||||
|
||||
const [id, body] = this.#coder.encodeJson(method, params);
|
||||
let resultPromise: Promise<T> | null = isCacheable
|
||||
? this.#callCache.get(body) as Promise<T>
|
||||
? this.#callCache.get(body)
|
||||
: null;
|
||||
|
||||
if (!resultPromise) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
@@ -30,23 +30,23 @@
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.17.10",
|
||||
"@babel/core": "^7.18.2",
|
||||
"@babel/register": "^7.17.7",
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/api": "8.3.2",
|
||||
"@polkadot/api-augment": "8.3.2",
|
||||
"@polkadot/rpc-augment": "8.3.2",
|
||||
"@polkadot/rpc-provider": "8.3.2",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/types-augment": "8.3.2",
|
||||
"@polkadot/types-codec": "8.3.2",
|
||||
"@polkadot/types-create": "8.3.2",
|
||||
"@polkadot/types-support": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1",
|
||||
"@polkadot/x-ws": "^9.1.1",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/api": "8.6.2",
|
||||
"@polkadot/api-augment": "8.6.2",
|
||||
"@polkadot/rpc-augment": "8.6.2",
|
||||
"@polkadot/rpc-provider": "8.6.2",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-augment": "8.6.2",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/types-create": "8.6.2",
|
||||
"@polkadot/types-support": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1",
|
||||
"@polkadot/x-ws": "^9.3.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
"yargs": "^17.4.1"
|
||||
"yargs": "^17.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/websocket": "^1.0.5",
|
||||
|
||||
@@ -8,40 +8,46 @@ import yargs from 'yargs';
|
||||
|
||||
import { Definitions } from '@polkadot/types/types';
|
||||
import { formatNumber } from '@polkadot/util';
|
||||
import { WebSocket } from '@polkadot/x-ws';
|
||||
|
||||
import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultTx } from './generate';
|
||||
import { HEADER, writeFile } from './util';
|
||||
import { assertDir, assertFile, getMetadataViaWs, HEADER, writeFile } from './util';
|
||||
|
||||
function generate (metaHex: HexString, pkg: string | undefined, output: string, isStrict?: boolean): void {
|
||||
console.log(`Generating from metadata, ${formatNumber((metaHex.length - 2) / 2)} bytes`);
|
||||
|
||||
const base = path.join(process.cwd(), output);
|
||||
const extraTypes = pkg
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
? { [pkg]: require(path.join(base, 'definitions')) as Record<string, any> }
|
||||
: {};
|
||||
const outputPath = assertDir(path.join(process.cwd(), output));
|
||||
let extraTypes: Record<string, any> = {};
|
||||
let customLookupDefinitions: Definitions = { rpc: {}, types: {} };
|
||||
|
||||
let customLookupDefinitions;
|
||||
if (pkg) {
|
||||
try {
|
||||
extraTypes = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-argument
|
||||
[pkg]: require(assertFile(path.join(outputPath, 'definitions.ts'))) as Record<string, any>
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('ERROR: No custom definitions found:', (error as Error).message);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
customLookupDefinitions = {
|
||||
rpc: {},
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
|
||||
types: require(path.join(base, 'lookup.ts')).default
|
||||
} as Definitions;
|
||||
types: require(assertFile(path.join(outputPath, 'lookup.ts'))).default
|
||||
};
|
||||
} catch (error) {
|
||||
console.log('No custom definitions found.');
|
||||
console.error('ERROR: No lookup definitions found:', (error as Error).message);
|
||||
}
|
||||
|
||||
generateDefaultConsts(path.join(base, 'augment-api-consts.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultErrors(path.join(base, 'augment-api-errors.ts'), metaHex, extraTypes, isStrict);
|
||||
generateDefaultEvents(path.join(base, 'augment-api-events.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultQuery(path.join(base, 'augment-api-query.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultRpc(path.join(base, 'augment-api-rpc.ts'), extraTypes);
|
||||
generateDefaultTx(path.join(base, 'augment-api-tx.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultConsts(path.join(outputPath, 'augment-api-consts.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultErrors(path.join(outputPath, 'augment-api-errors.ts'), metaHex, extraTypes, isStrict);
|
||||
generateDefaultEvents(path.join(outputPath, 'augment-api-events.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultQuery(path.join(outputPath, 'augment-api-query.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultRpc(path.join(outputPath, 'augment-api-rpc.ts'), extraTypes);
|
||||
generateDefaultTx(path.join(outputPath, 'augment-api-tx.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
|
||||
writeFile(path.join(base, 'augment-api.ts'), (): string =>
|
||||
writeFile(path.join(outputPath, 'augment-api.ts'), (): string =>
|
||||
[
|
||||
HEADER('chain'),
|
||||
...[
|
||||
@@ -78,32 +84,11 @@ export function main (): void {
|
||||
}).argv as ArgV;
|
||||
|
||||
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
|
||||
try {
|
||||
const websocket = new WebSocket(endpoint);
|
||||
|
||||
websocket.onclose = (event: { code: number; reason: string }): void => {
|
||||
console.error(`disconnected, code: '${event.code}' reason: '${event.reason}'`);
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
websocket.onerror = (event: unknown): void => {
|
||||
console.error(event);
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
websocket.onopen = (): void => {
|
||||
console.log('connected');
|
||||
websocket.send('{"id":"1","jsonrpc":"2.0","method":"state_getMetadata","params":[]}');
|
||||
};
|
||||
|
||||
websocket.onmessage = (message: unknown): void => {
|
||||
generate((JSON.parse((message as Record<string, string>).data) as Record<string, HexString>).result, pkg, output, isStrict);
|
||||
};
|
||||
} catch (error) {
|
||||
process.exit(1);
|
||||
}
|
||||
getMetadataViaWs(endpoint)
|
||||
.then((metadata) => generate(metadata, pkg, output, isStrict))
|
||||
.catch(() => process.exit(1));
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
generate((require(path.join(process.cwd(), endpoint)) as Record<string, HexString>).result, pkg, output, isStrict);
|
||||
generate((require(assertFile(path.join(process.cwd(), endpoint))) as Record<string, HexString>).result, pkg, output, isStrict);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import path from 'path';
|
||||
import yargs from 'yargs';
|
||||
|
||||
import * as substrateDefs from '@polkadot/types/interfaces/definitions';
|
||||
import { WebSocket } from '@polkadot/x-ws';
|
||||
|
||||
import { generateInterfaceTypes } from './generate/interfaceRegistry';
|
||||
import { generateTsDef } from './generate/tsDef';
|
||||
import { generateDefaultLookup } from './generate';
|
||||
import { assertDir, assertFile, getMetadataViaWs } from './util';
|
||||
|
||||
type ArgV = { input: string; package: string; endpoint?: string; };
|
||||
|
||||
@@ -33,8 +33,16 @@ export function main (): void {
|
||||
}
|
||||
}).argv as ArgV;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const userDefs = require(path.join(process.cwd(), input, 'definitions.ts')) as Record<string, any>;
|
||||
const inputPath = assertDir(path.join(process.cwd(), input));
|
||||
let userDefs: Record<string, any> = {};
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
userDefs = require(assertFile(path.join(inputPath, 'definitions.ts'))) as Record<string, any>;
|
||||
} catch (error) {
|
||||
console.error('ERROR: Unable to load user definitions:', (error as Error).message);
|
||||
}
|
||||
|
||||
const userKeys = Object.keys(userDefs);
|
||||
const filteredBase = Object
|
||||
.entries(substrateDefs as Record<string, unknown>)
|
||||
@@ -58,41 +66,19 @@ export function main (): void {
|
||||
[pkg]: userDefs
|
||||
};
|
||||
|
||||
generateTsDef(allDefs, path.join(process.cwd(), input), pkg);
|
||||
generateInterfaceTypes(allDefs, path.join(process.cwd(), input, 'augment-types.ts'));
|
||||
generateTsDef(allDefs, inputPath, pkg);
|
||||
generateInterfaceTypes(allDefs, path.join(inputPath, 'augment-types.ts'));
|
||||
|
||||
if (endpoint) {
|
||||
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
|
||||
try {
|
||||
const websocket = new WebSocket(endpoint);
|
||||
|
||||
websocket.onclose = (event: { code: number; reason: string }): void => {
|
||||
console.error(`disconnected, code: '${event.code}' reason: '${event.reason}'`);
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
websocket.onerror = (event: unknown): void => {
|
||||
console.error(event);
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
websocket.onopen = (): void => {
|
||||
console.log('connected');
|
||||
websocket.send('{"id":"1","jsonrpc":"2.0","method":"state_getMetadata","params":[]}');
|
||||
};
|
||||
|
||||
websocket.onmessage = (message: unknown): void => {
|
||||
generateDefaultLookup(path.join(process.cwd(), input), (JSON.parse((message as Record<string, string>).data) as Record<string, HexString>).result);
|
||||
process.exit(0);
|
||||
};
|
||||
} catch (error) {
|
||||
process.exit(1);
|
||||
}
|
||||
getMetadataViaWs(endpoint)
|
||||
.then((metadata) => generateDefaultLookup(inputPath, metadata))
|
||||
.catch(() => process.exit(1));
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const metaHex = (require(path.join(process.cwd(), endpoint)) as Record<string, HexString>).result;
|
||||
const metaHex = (require(assertFile(path.join(process.cwd(), endpoint))) as Record<string, HexString>).result;
|
||||
|
||||
generateDefaultLookup(path.join(process.cwd(), input), metaHex);
|
||||
generateDefaultLookup(inputPath, metaHex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,17 +42,6 @@ function tsExport (registry: Registry, definitions: Record<string, ModuleTypes>,
|
||||
return exportInterface(def.lookupIndex, def.name, formatType(registry, definitions, def, imports, false));
|
||||
}
|
||||
|
||||
const tsBTreeMap = tsExport;
|
||||
const tsBTreeSet = tsExport;
|
||||
const tsCompact = tsExport;
|
||||
const tsDoNotConstruct = tsExport;
|
||||
const tsHashMap = tsExport;
|
||||
const tsOption = tsExport;
|
||||
const tsPlain = tsExport;
|
||||
const tsTuple = tsExport;
|
||||
const tsWrapperKeepOpaque = tsExport;
|
||||
const tsWrapperOpaque = tsExport;
|
||||
|
||||
/** @internal */
|
||||
function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, { lookupIndex, name: enumName, sub }: TypeDef, imports: TypeImports): string {
|
||||
setImports(definitions, imports, ['Enum']);
|
||||
@@ -227,29 +216,29 @@ function tsVec (registry: Registry, definitions: Record<string, ModuleTypes>, de
|
||||
// `generators[typedef.info](...)` TS will show any unhandled types. Rather
|
||||
// we are being explicit in having no handlers where we do not support (yet)
|
||||
export const typeEncoders: Record<TypeDefInfo, (registry: Registry, definitions: Record<string, ModuleTypes>, def: TypeDef, imports: TypeImports) => string> = {
|
||||
[TypeDefInfo.BTreeMap]: tsBTreeMap,
|
||||
[TypeDefInfo.BTreeSet]: tsBTreeSet,
|
||||
[TypeDefInfo.Compact]: tsCompact,
|
||||
[TypeDefInfo.DoNotConstruct]: tsDoNotConstruct,
|
||||
[TypeDefInfo.BTreeMap]: tsExport,
|
||||
[TypeDefInfo.BTreeSet]: tsExport,
|
||||
[TypeDefInfo.Compact]: tsExport,
|
||||
[TypeDefInfo.DoNotConstruct]: tsExport,
|
||||
[TypeDefInfo.Enum]: tsEnum,
|
||||
[TypeDefInfo.HashMap]: tsHashMap,
|
||||
[TypeDefInfo.HashMap]: tsExport,
|
||||
[TypeDefInfo.Int]: tsInt,
|
||||
[TypeDefInfo.Linkage]: errorUnhandled,
|
||||
[TypeDefInfo.Null]: tsNull,
|
||||
[TypeDefInfo.Option]: tsOption,
|
||||
[TypeDefInfo.Plain]: tsPlain,
|
||||
[TypeDefInfo.Range]: errorUnhandled,
|
||||
[TypeDefInfo.RangeInclusive]: errorUnhandled,
|
||||
[TypeDefInfo.Option]: tsExport,
|
||||
[TypeDefInfo.Plain]: tsExport,
|
||||
[TypeDefInfo.Range]: tsExport,
|
||||
[TypeDefInfo.RangeInclusive]: tsExport,
|
||||
[TypeDefInfo.Result]: tsResult,
|
||||
[TypeDefInfo.Set]: tsSet,
|
||||
[TypeDefInfo.Si]: tsSi,
|
||||
[TypeDefInfo.Struct]: tsStruct,
|
||||
[TypeDefInfo.Tuple]: tsTuple,
|
||||
[TypeDefInfo.Tuple]: tsExport,
|
||||
[TypeDefInfo.UInt]: tsUInt,
|
||||
[TypeDefInfo.Vec]: tsVec,
|
||||
[TypeDefInfo.VecFixed]: tsVec,
|
||||
[TypeDefInfo.WrapperKeepOpaque]: tsWrapperKeepOpaque,
|
||||
[TypeDefInfo.WrapperOpaque]: tsWrapperOpaque
|
||||
[TypeDefInfo.WrapperKeepOpaque]: tsExport,
|
||||
[TypeDefInfo.WrapperOpaque]: tsExport
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
|
||||
@@ -13,8 +13,8 @@ const BASE = 'packages/api-augment/src';
|
||||
const METAS = Object.entries({ kusama, polkadot, substrate }) as [string, HexString][];
|
||||
|
||||
export function main (): void {
|
||||
generateDefaultLookup();
|
||||
generateDefaultInterface();
|
||||
generateDefaultLookup();
|
||||
generateDefaultRpc();
|
||||
generateDefaultTsDef();
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright 2017-2022 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import fs from 'fs';
|
||||
|
||||
import { assert } from '@polkadot/util';
|
||||
|
||||
export function assertDir (path: string): string {
|
||||
assert(fs.existsSync(path) && fs.lstatSync(path).isDirectory(), `${path} is not a directory`);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
export function assertFile (path: string): string {
|
||||
assert(fs.existsSync(path) && fs.lstatSync(path).isFile(), `${path} is not a file`);
|
||||
|
||||
return path;
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { Constructor, Registry } from '@polkadot/types/types';
|
||||
import type { TypeDef } from '@polkadot/types-create/types';
|
||||
|
||||
import { GenericAccountId, GenericLookupSource, GenericVote } from '@polkadot/types/generic';
|
||||
import { GenericAccountId, GenericCall, GenericLookupSource, GenericVote } from '@polkadot/types/generic';
|
||||
import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions';
|
||||
import { AbstractInt, bool, Compact, Enum, Null, Option, Struct, Tuple, UInt, Vec, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
|
||||
import { getTypeDef, TypeDefInfo } from '@polkadot/types-create';
|
||||
@@ -58,7 +58,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
|
||||
);
|
||||
|
||||
possibleTypes.push(`([${subs.join(', ')}])[]`);
|
||||
} else if (subDef.info === TypeDefInfo.VecFixed) {
|
||||
} else if (subDef.info === TypeDefInfo.Option || subDef.info === TypeDefInfo.Vec || subDef.info === TypeDefInfo.VecFixed) {
|
||||
// TODO: Add possibleTypes so imports work
|
||||
} else if (subDef.info === TypeDefInfo.Struct) {
|
||||
// TODO: Add possibleTypes so imports work
|
||||
@@ -84,6 +84,8 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
|
||||
possibleTypes.push('Address', 'AccountId', 'AccountIndex', 'LookupSource', 'string', 'Uint8Array');
|
||||
} else if (isChildClass(GenericAccountId, Clazz)) {
|
||||
possibleTypes.push('string', 'Uint8Array');
|
||||
} else if (isChildClass(GenericCall, Clazz)) {
|
||||
possibleTypes.push('IMethod', 'string', 'Uint8Array');
|
||||
} else if (isChildClass(bool, Clazz)) {
|
||||
possibleTypes.push('boolean', 'Uint8Array');
|
||||
} else if (isChildClass(Null, Clazz)) {
|
||||
|
||||
@@ -175,11 +175,11 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
},
|
||||
|
||||
[TypeDefInfo.Range]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Range: Not implemented on ${stringify(typeDef)}`);
|
||||
return singleParamNotation(registry, 'Range', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.RangeInclusive]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.RangeInclusive: Not implemented on ${stringify(typeDef)}`);
|
||||
return singleParamNotation(registry, 'RangeInclusive', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Set]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
|
||||
@@ -42,7 +42,7 @@ export function setImports (allDefs: Record<string, ModuleTypes>, imports: TypeI
|
||||
types.filter((t): t is string => !!t).forEach((type): void => {
|
||||
if (ignoredTypes.includes(type)) {
|
||||
// do nothing
|
||||
} else if (['AnyNumber', 'CallFunction', 'Codec', 'IExtrinsic', 'ITuple'].includes(type)) {
|
||||
} else if (['AnyNumber', 'CallFunction', 'Codec', 'IExtrinsic', 'IMethod', 'ITuple'].includes(type)) {
|
||||
typesTypes[type] = true;
|
||||
} else if (['Metadata', 'PortableRegistry'].includes(type)) {
|
||||
metadataTypes[type] = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './assert';
|
||||
export * from './derived';
|
||||
export * from './docs';
|
||||
export * from './file';
|
||||
@@ -8,6 +9,7 @@ export * from './formatting';
|
||||
export * from './imports';
|
||||
export * from './initMeta';
|
||||
export * from './register';
|
||||
export * from './wsMeta';
|
||||
|
||||
type Cmp = { name: { toString(): string } };
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright 2017-2022 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
|
||||
import { WebSocket } from '@polkadot/x-ws';
|
||||
|
||||
export async function getMetadataViaWs (endpoint: string): Promise<HexString> {
|
||||
return new Promise((resolve): void => {
|
||||
try {
|
||||
const websocket = new WebSocket(endpoint);
|
||||
|
||||
websocket.onclose = (event: { code: number; reason: string }): void => {
|
||||
console.error(`disconnected, code: '${event.code}' reason: '${event.reason}'`);
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
websocket.onerror = (event: unknown): void => {
|
||||
console.error(event);
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
websocket.onopen = (): void => {
|
||||
console.log('connected');
|
||||
websocket.send('{"id":"1","jsonrpc":"2.0","method":"state_getMetadata","params":[]}');
|
||||
};
|
||||
|
||||
websocket.onmessage = (message: { data: string }): void => {
|
||||
resolve((JSON.parse(message.data) as { result: HexString }).result);
|
||||
};
|
||||
} catch (error) {
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/types-codec": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1"
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export default {
|
||||
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction', 'Society']
|
||||
},
|
||||
/**
|
||||
* Lookup253: kusama_runtime::SessionKeys
|
||||
* Lookup258: kusama_runtime::SessionKeys
|
||||
**/
|
||||
KusamaRuntimeSessionKeys: {
|
||||
grandpa: 'SpFinalityGrandpaAppPublic',
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
|
||||
},
|
||||
/**
|
||||
* Lookup327: kusama_runtime::OriginCaller
|
||||
* Lookup332: kusama_runtime::OriginCaller
|
||||
**/
|
||||
KusamaRuntimeOriginCaller: {
|
||||
_enum: {
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup393: kusama_runtime::NposCompactSolution24
|
||||
* Lookup398: kusama_runtime::NposCompactSolution24
|
||||
**/
|
||||
KusamaRuntimeNposCompactSolution24: {
|
||||
votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
|
||||
@@ -158,7 +158,7 @@ export default {
|
||||
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
|
||||
},
|
||||
/**
|
||||
* Lookup747: kusama_runtime::Runtime
|
||||
* Lookup774: kusama_runtime::Runtime
|
||||
**/
|
||||
KusamaRuntimeRuntime: 'Null'
|
||||
};
|
||||
|
||||
@@ -9,7 +9,11 @@ export default {
|
||||
**/
|
||||
PolkadotRuntimeCommonClaimsPalletEvent: {
|
||||
_enum: {
|
||||
Claimed: '(AccountId32,EthereumAddress,u128)'
|
||||
Claimed: {
|
||||
who: 'AccountId32',
|
||||
ethereumAddress: 'EthereumAddress',
|
||||
amount: 'u128'
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -175,9 +179,17 @@ export default {
|
||||
**/
|
||||
PolkadotRuntimeCommonParasRegistrarPalletEvent: {
|
||||
_enum: {
|
||||
Registered: '(u32,AccountId32)',
|
||||
Deregistered: 'u32',
|
||||
Reserved: '(u32,AccountId32)'
|
||||
Registered: {
|
||||
paraId: 'u32',
|
||||
manager: 'AccountId32',
|
||||
},
|
||||
Deregistered: {
|
||||
paraId: 'u32',
|
||||
},
|
||||
Reserved: {
|
||||
paraId: 'u32',
|
||||
who: 'AccountId32'
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -185,8 +197,17 @@ export default {
|
||||
**/
|
||||
PolkadotRuntimeCommonSlotsPalletEvent: {
|
||||
_enum: {
|
||||
NewLeasePeriod: 'u32',
|
||||
Leased: '(u32,AccountId32,u32,u32,u128,u128)'
|
||||
NewLeasePeriod: {
|
||||
leasePeriod: 'u32',
|
||||
},
|
||||
Leased: {
|
||||
paraId: 'u32',
|
||||
leaser: 'AccountId32',
|
||||
periodBegin: 'u32',
|
||||
periodCount: 'u32',
|
||||
extraReserved: 'u128',
|
||||
totalAmount: 'u128'
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -194,13 +215,39 @@ export default {
|
||||
**/
|
||||
PolkadotRuntimeCommonAuctionsPalletEvent: {
|
||||
_enum: {
|
||||
AuctionStarted: '(u32,u32,u32)',
|
||||
AuctionClosed: 'u32',
|
||||
Reserved: '(AccountId32,u128,u128)',
|
||||
Unreserved: '(AccountId32,u128)',
|
||||
ReserveConfiscated: '(u32,AccountId32,u128)',
|
||||
BidAccepted: '(AccountId32,u32,u128,u32,u32)',
|
||||
WinningOffset: '(u32,u32)'
|
||||
AuctionStarted: {
|
||||
auctionIndex: 'u32',
|
||||
leasePeriod: 'u32',
|
||||
ending: 'u32',
|
||||
},
|
||||
AuctionClosed: {
|
||||
auctionIndex: 'u32',
|
||||
},
|
||||
Reserved: {
|
||||
bidder: 'AccountId32',
|
||||
extraReserved: 'u128',
|
||||
totalAmount: 'u128',
|
||||
},
|
||||
Unreserved: {
|
||||
bidder: 'AccountId32',
|
||||
amount: 'u128',
|
||||
},
|
||||
ReserveConfiscated: {
|
||||
paraId: 'u32',
|
||||
leaser: 'AccountId32',
|
||||
amount: 'u128',
|
||||
},
|
||||
BidAccepted: {
|
||||
bidder: 'AccountId32',
|
||||
paraId: 'u32',
|
||||
amount: 'u128',
|
||||
firstSlot: 'u32',
|
||||
lastSlot: 'u32',
|
||||
},
|
||||
WinningOffset: {
|
||||
auctionIndex: 'u32',
|
||||
blockNumber: 'u32'
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -208,16 +255,43 @@ export default {
|
||||
**/
|
||||
PolkadotRuntimeCommonCrowdloanPalletEvent: {
|
||||
_enum: {
|
||||
Created: 'u32',
|
||||
Contributed: '(AccountId32,u32,u128)',
|
||||
Withdrew: '(AccountId32,u32,u128)',
|
||||
PartiallyRefunded: 'u32',
|
||||
AllRefunded: 'u32',
|
||||
Dissolved: 'u32',
|
||||
HandleBidResult: '(u32,Result<Null, SpRuntimeDispatchError>)',
|
||||
Edited: 'u32',
|
||||
MemoUpdated: '(AccountId32,u32,Bytes)',
|
||||
AddedToNewRaise: 'u32'
|
||||
Created: {
|
||||
paraId: 'u32',
|
||||
},
|
||||
Contributed: {
|
||||
who: 'AccountId32',
|
||||
fundIndex: 'u32',
|
||||
amount: 'u128',
|
||||
},
|
||||
Withdrew: {
|
||||
who: 'AccountId32',
|
||||
fundIndex: 'u32',
|
||||
amount: 'u128',
|
||||
},
|
||||
PartiallyRefunded: {
|
||||
paraId: 'u32',
|
||||
},
|
||||
AllRefunded: {
|
||||
paraId: 'u32',
|
||||
},
|
||||
Dissolved: {
|
||||
paraId: 'u32',
|
||||
},
|
||||
HandleBidResult: {
|
||||
paraId: 'u32',
|
||||
result: 'Result<Null, SpRuntimeDispatchError>',
|
||||
},
|
||||
Edited: {
|
||||
paraId: 'u32',
|
||||
},
|
||||
MemoUpdated: {
|
||||
who: 'AccountId32',
|
||||
paraId: 'u32',
|
||||
memo: 'Bytes',
|
||||
},
|
||||
AddedToNewRaise: {
|
||||
paraId: 'u32'
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -1777,13 +1851,13 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup541: polkadot_runtime_common::claims::pallet::Error<T>
|
||||
* Lookup544: polkadot_runtime_common::claims::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeCommonClaimsPalletError: {
|
||||
_enum: ['InvalidEthereumSignature', 'SignerHasNoClaim', 'SenderHasNoClaim', 'PotUnderflow', 'InvalidStatement', 'VestedBalanceExists']
|
||||
},
|
||||
/**
|
||||
* Lookup596: polkadot_runtime_parachains::configuration::HostConfiguration<BlockNumber>
|
||||
* Lookup600: polkadot_runtime_parachains::configuration::HostConfiguration<BlockNumber>
|
||||
**/
|
||||
PolkadotRuntimeParachainsConfigurationHostConfiguration: {
|
||||
maxCodeSize: 'u32',
|
||||
@@ -1831,20 +1905,20 @@ export default {
|
||||
minimumValidationUpgradeDelay: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup599: polkadot_runtime_parachains::configuration::pallet::Error<T>
|
||||
* Lookup603: polkadot_runtime_parachains::configuration::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsConfigurationPalletError: {
|
||||
_enum: ['InvalidNewValue']
|
||||
},
|
||||
/**
|
||||
* Lookup602: polkadot_runtime_parachains::inclusion::AvailabilityBitfieldRecord<N>
|
||||
* Lookup606: polkadot_runtime_parachains::inclusion::AvailabilityBitfieldRecord<N>
|
||||
**/
|
||||
PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord: {
|
||||
bitfield: 'BitVec',
|
||||
submittedAt: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup603: polkadot_runtime_parachains::inclusion::CandidatePendingAvailability<primitive_types::H256, N>
|
||||
* Lookup607: polkadot_runtime_parachains::inclusion::CandidatePendingAvailability<primitive_types::H256, N>
|
||||
**/
|
||||
PolkadotRuntimeParachainsInclusionCandidatePendingAvailability: {
|
||||
_alias: {
|
||||
@@ -1860,13 +1934,13 @@ export default {
|
||||
backingGroup: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup604: polkadot_runtime_parachains::inclusion::pallet::Error<T>
|
||||
* Lookup608: polkadot_runtime_parachains::inclusion::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsInclusionPalletError: {
|
||||
_enum: ['UnsortedOrDuplicateValidatorIndices', 'UnsortedOrDuplicateDisputeStatementSet', 'UnsortedOrDuplicateBackedCandidates', 'UnexpectedRelayParent', 'WrongBitfieldSize', 'BitfieldAllZeros', 'BitfieldDuplicateOrUnordered', 'ValidatorIndexOutOfBounds', 'InvalidBitfieldSignature', 'UnscheduledCandidate', 'CandidateScheduledBeforeParaFree', 'WrongCollator', 'ScheduledOutOfOrder', 'HeadDataTooLarge', 'PrematureCodeUpgrade', 'NewCodeTooLarge', 'CandidateNotInParentContext', 'InvalidGroupIndex', 'InsufficientBacking', 'InvalidBacking', 'NotCollatorSigned', 'ValidationDataHashMismatch', 'IncorrectDownwardMessageHandling', 'InvalidUpwardMessages', 'HrmpWatermarkMishandling', 'InvalidOutboundHrmp', 'InvalidValidationCodeHash', 'ParaHeadMismatch', 'BitfieldReferencesFreedCore']
|
||||
},
|
||||
/**
|
||||
* Lookup605: polkadot_primitives::v2::ScrapedOnChainVotes<primitive_types::H256>
|
||||
* Lookup609: polkadot_primitives::v2::ScrapedOnChainVotes<primitive_types::H256>
|
||||
**/
|
||||
PolkadotPrimitivesV2ScrapedOnChainVotes: {
|
||||
session: 'u32',
|
||||
@@ -1874,38 +1948,38 @@ export default {
|
||||
disputes: 'Vec<PolkadotPrimitivesV2DisputeStatementSet>'
|
||||
},
|
||||
/**
|
||||
* Lookup610: polkadot_runtime_parachains::paras_inherent::pallet::Error<T>
|
||||
* Lookup614: polkadot_runtime_parachains::paras_inherent::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsParasInherentPalletError: {
|
||||
_enum: ['TooManyInclusionInherents', 'InvalidParentHeader', 'CandidateConcludedInvalid', 'InherentOverweight', 'DisputeStatementsUnsortedOrDuplicates', 'DisputeInvalid']
|
||||
},
|
||||
/**
|
||||
* Lookup612: polkadot_runtime_parachains::scheduler::ParathreadClaimQueue
|
||||
* Lookup616: polkadot_runtime_parachains::scheduler::ParathreadClaimQueue
|
||||
**/
|
||||
PolkadotRuntimeParachainsSchedulerParathreadClaimQueue: {
|
||||
queue: 'Vec<PolkadotRuntimeParachainsSchedulerQueuedParathread>',
|
||||
nextCoreOffset: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup614: polkadot_runtime_parachains::scheduler::QueuedParathread
|
||||
* Lookup618: polkadot_runtime_parachains::scheduler::QueuedParathread
|
||||
**/
|
||||
PolkadotRuntimeParachainsSchedulerQueuedParathread: {
|
||||
claim: 'PolkadotPrimitivesV2ParathreadEntry',
|
||||
coreOffset: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup615: polkadot_primitives::v2::ParathreadEntry
|
||||
* Lookup619: polkadot_primitives::v2::ParathreadEntry
|
||||
**/
|
||||
PolkadotPrimitivesV2ParathreadEntry: {
|
||||
claim: 'PolkadotPrimitivesV2ParathreadClaim',
|
||||
retries: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup616: polkadot_primitives::v2::ParathreadClaim
|
||||
* Lookup620: polkadot_primitives::v2::ParathreadClaim
|
||||
**/
|
||||
PolkadotPrimitivesV2ParathreadClaim: '(u32,PolkadotPrimitivesV2CollatorAppPublic)',
|
||||
/**
|
||||
* Lookup619: polkadot_primitives::v2::CoreOccupied
|
||||
* Lookup623: polkadot_primitives::v2::CoreOccupied
|
||||
**/
|
||||
PolkadotPrimitivesV2CoreOccupied: {
|
||||
_enum: {
|
||||
@@ -1914,7 +1988,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup622: polkadot_runtime_parachains::scheduler::CoreAssignment
|
||||
* Lookup626: polkadot_runtime_parachains::scheduler::CoreAssignment
|
||||
**/
|
||||
PolkadotRuntimeParachainsSchedulerCoreAssignment: {
|
||||
core: 'u32',
|
||||
@@ -1923,7 +1997,7 @@ export default {
|
||||
groupIdx: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup623: polkadot_runtime_parachains::scheduler::AssignmentKind
|
||||
* Lookup627: polkadot_runtime_parachains::scheduler::AssignmentKind
|
||||
**/
|
||||
PolkadotRuntimeParachainsSchedulerAssignmentKind: {
|
||||
_enum: {
|
||||
@@ -1932,7 +2006,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup624: polkadot_runtime_parachains::paras::PvfCheckActiveVoteState<BlockNumber>
|
||||
* Lookup628: polkadot_runtime_parachains::paras::PvfCheckActiveVoteState<BlockNumber>
|
||||
**/
|
||||
PolkadotRuntimeParachainsParasPvfCheckActiveVoteState: {
|
||||
votesAccept: 'BitVec',
|
||||
@@ -1942,7 +2016,7 @@ export default {
|
||||
causes: 'Vec<PolkadotRuntimeParachainsParasPvfCheckCause>'
|
||||
},
|
||||
/**
|
||||
* Lookup626: polkadot_runtime_parachains::paras::PvfCheckCause<BlockNumber>
|
||||
* Lookup630: polkadot_runtime_parachains::paras::PvfCheckCause<BlockNumber>
|
||||
**/
|
||||
PolkadotRuntimeParachainsParasPvfCheckCause: {
|
||||
_enum: {
|
||||
@@ -1954,39 +2028,39 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup628: polkadot_runtime_parachains::paras::ParaLifecycle
|
||||
* Lookup632: polkadot_runtime_parachains::paras::ParaLifecycle
|
||||
**/
|
||||
PolkadotRuntimeParachainsParasParaLifecycle: {
|
||||
_enum: ['Onboarding', 'Parathread', 'Parachain', 'UpgradingParathread', 'DowngradingParachain', 'OffboardingParathread', 'OffboardingParachain']
|
||||
},
|
||||
/**
|
||||
* Lookup630: polkadot_runtime_parachains::paras::ParaPastCodeMeta<N>
|
||||
* Lookup634: polkadot_runtime_parachains::paras::ParaPastCodeMeta<N>
|
||||
**/
|
||||
PolkadotRuntimeParachainsParasParaPastCodeMeta: {
|
||||
upgradeTimes: 'Vec<PolkadotRuntimeParachainsParasReplacementTimes>',
|
||||
lastPruned: 'Option<u32>'
|
||||
},
|
||||
/**
|
||||
* Lookup632: polkadot_runtime_parachains::paras::ReplacementTimes<N>
|
||||
* Lookup636: polkadot_runtime_parachains::paras::ReplacementTimes<N>
|
||||
**/
|
||||
PolkadotRuntimeParachainsParasReplacementTimes: {
|
||||
expectedAt: 'u32',
|
||||
activatedAt: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup634: polkadot_primitives::v2::UpgradeGoAhead
|
||||
* Lookup638: polkadot_primitives::v2::UpgradeGoAhead
|
||||
**/
|
||||
PolkadotPrimitivesV2UpgradeGoAhead: {
|
||||
_enum: ['Abort', 'GoAhead']
|
||||
},
|
||||
/**
|
||||
* Lookup635: polkadot_primitives::v2::UpgradeRestriction
|
||||
* Lookup639: polkadot_primitives::v2::UpgradeRestriction
|
||||
**/
|
||||
PolkadotPrimitivesV2UpgradeRestriction: {
|
||||
_enum: ['Present']
|
||||
},
|
||||
/**
|
||||
* Lookup636: polkadot_runtime_parachains::paras::ParaGenesisArgs
|
||||
* Lookup640: polkadot_runtime_parachains::paras::ParaGenesisArgs
|
||||
**/
|
||||
PolkadotRuntimeParachainsParasParaGenesisArgs: {
|
||||
genesisHead: 'Bytes',
|
||||
@@ -1994,13 +2068,13 @@ export default {
|
||||
parachain: 'bool'
|
||||
},
|
||||
/**
|
||||
* Lookup637: polkadot_runtime_parachains::paras::pallet::Error<T>
|
||||
* Lookup641: polkadot_runtime_parachains::paras::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsParasPalletError: {
|
||||
_enum: ['NotRegistered', 'CannotOnboard', 'CannotOffboard', 'CannotUpgrade', 'CannotDowngrade', 'PvfCheckStatementStale', 'PvfCheckStatementFuture', 'PvfCheckValidatorIndexOutOfBounds', 'PvfCheckInvalidSignature', 'PvfCheckDoubleVote', 'PvfCheckSubjectInvalid', 'PvfCheckDisabled']
|
||||
},
|
||||
/**
|
||||
* Lookup639: polkadot_runtime_parachains::initializer::BufferedSessionChange
|
||||
* Lookup643: polkadot_runtime_parachains::initializer::BufferedSessionChange
|
||||
**/
|
||||
PolkadotRuntimeParachainsInitializerBufferedSessionChange: {
|
||||
validators: 'Vec<PolkadotPrimitivesV2ValidatorAppPublic>',
|
||||
@@ -2008,20 +2082,20 @@ export default {
|
||||
sessionIndex: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup641: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
|
||||
* Lookup645: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
|
||||
**/
|
||||
PolkadotCorePrimitivesInboundDownwardMessage: {
|
||||
sentAt: 'u32',
|
||||
msg: 'Bytes'
|
||||
},
|
||||
/**
|
||||
* Lookup643: polkadot_runtime_parachains::ump::pallet::Error<T>
|
||||
* Lookup647: polkadot_runtime_parachains::ump::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsUmpPalletError: {
|
||||
_enum: ['UnknownMessageIndex', 'WeightOverLimit']
|
||||
},
|
||||
/**
|
||||
* Lookup644: polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest
|
||||
* Lookup648: polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest
|
||||
**/
|
||||
PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest: {
|
||||
confirmed: 'bool',
|
||||
@@ -2032,7 +2106,7 @@ export default {
|
||||
maxTotalSize: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup646: polkadot_runtime_parachains::hrmp::HrmpChannel
|
||||
* Lookup650: polkadot_runtime_parachains::hrmp::HrmpChannel
|
||||
**/
|
||||
PolkadotRuntimeParachainsHrmpHrmpChannel: {
|
||||
maxCapacity: 'u32',
|
||||
@@ -2045,20 +2119,20 @@ export default {
|
||||
recipientDeposit: 'u128'
|
||||
},
|
||||
/**
|
||||
* Lookup649: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
|
||||
* Lookup653: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
|
||||
**/
|
||||
PolkadotCorePrimitivesInboundHrmpMessage: {
|
||||
sentAt: 'u32',
|
||||
data: 'Bytes'
|
||||
},
|
||||
/**
|
||||
* Lookup652: polkadot_runtime_parachains::hrmp::pallet::Error<T>
|
||||
* Lookup656: polkadot_runtime_parachains::hrmp::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsHrmpPalletError: {
|
||||
_enum: ['OpenHrmpChannelToSelf', 'OpenHrmpChannelInvalidRecipient', 'OpenHrmpChannelZeroCapacity', 'OpenHrmpChannelCapacityExceedsLimit', 'OpenHrmpChannelZeroMessageSize', 'OpenHrmpChannelMessageSizeExceedsLimit', 'OpenHrmpChannelAlreadyExists', 'OpenHrmpChannelAlreadyRequested', 'OpenHrmpChannelLimitExceeded', 'AcceptHrmpChannelDoesntExist', 'AcceptHrmpChannelAlreadyConfirmed', 'AcceptHrmpChannelLimitExceeded', 'CloseHrmpChannelUnauthorized', 'CloseHrmpChannelDoesntExist', 'CloseHrmpChannelAlreadyUnderway', 'CancelHrmpOpenChannelUnauthorized', 'OpenHrmpChannelDoesntExist', 'OpenHrmpChannelAlreadyConfirmed', 'WrongWitness']
|
||||
},
|
||||
/**
|
||||
* Lookup654: polkadot_primitives::v2::SessionInfo
|
||||
* Lookup658: polkadot_primitives::v2::SessionInfo
|
||||
**/
|
||||
PolkadotPrimitivesV2SessionInfo: {
|
||||
activeValidatorIndices: 'Vec<u32>',
|
||||
@@ -2076,7 +2150,7 @@ export default {
|
||||
neededApprovals: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup657: polkadot_primitives::v2::DisputeState<N>
|
||||
* Lookup661: polkadot_primitives::v2::DisputeState<N>
|
||||
**/
|
||||
PolkadotPrimitivesV2DisputeState: {
|
||||
validatorsFor: 'BitVec',
|
||||
@@ -2085,13 +2159,13 @@ export default {
|
||||
concludedAt: 'Option<u32>'
|
||||
},
|
||||
/**
|
||||
* Lookup658: polkadot_runtime_parachains::disputes::pallet::Error<T>
|
||||
* Lookup662: polkadot_runtime_parachains::disputes::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesPalletError: {
|
||||
_enum: ['DuplicateDisputeStatementSets', 'AncientDisputeStatement', 'ValidatorIndexOutOfBounds', 'InvalidSignature', 'DuplicateStatement', 'PotentialSpam', 'SingleSidedDispute']
|
||||
},
|
||||
/**
|
||||
* Lookup659: polkadot_runtime_common::paras_registrar::ParaInfo<sp_core::crypto::AccountId32, Balance>
|
||||
* Lookup663: polkadot_runtime_common::paras_registrar::ParaInfo<sp_core::crypto::AccountId32, Balance>
|
||||
**/
|
||||
PolkadotRuntimeCommonParasRegistrarParaInfo: {
|
||||
manager: 'AccountId32',
|
||||
@@ -2099,25 +2173,25 @@ export default {
|
||||
locked: 'bool'
|
||||
},
|
||||
/**
|
||||
* Lookup660: polkadot_runtime_common::paras_registrar::pallet::Error<T>
|
||||
* Lookup664: polkadot_runtime_common::paras_registrar::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeCommonParasRegistrarPalletError: {
|
||||
_enum: ['NotRegistered', 'AlreadyRegistered', 'NotOwner', 'CodeTooLarge', 'HeadDataTooLarge', 'NotParachain', 'NotParathread', 'CannotDeregister', 'CannotDowngrade', 'CannotUpgrade', 'ParaLocked', 'NotReserved', 'EmptyCode', 'CannotSwap']
|
||||
},
|
||||
/**
|
||||
* Lookup662: polkadot_runtime_common::slots::pallet::Error<T>
|
||||
* Lookup666: polkadot_runtime_common::slots::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeCommonSlotsPalletError: {
|
||||
_enum: ['ParaNotOnboarding', 'LeaseError']
|
||||
},
|
||||
/**
|
||||
* Lookup667: polkadot_runtime_common::auctions::pallet::Error<T>
|
||||
* Lookup671: polkadot_runtime_common::auctions::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeCommonAuctionsPalletError: {
|
||||
_enum: ['AuctionInProgress', 'LeasePeriodInPast', 'ParaNotRegistered', 'NotCurrentAuction', 'NotAuction', 'AuctionEnded', 'AlreadyLeasedOut']
|
||||
},
|
||||
/**
|
||||
* Lookup668: polkadot_runtime_common::crowdloan::FundInfo<sp_core::crypto::AccountId32, Balance, BlockNumber, LeasePeriod>
|
||||
* Lookup672: polkadot_runtime_common::crowdloan::FundInfo<sp_core::crypto::AccountId32, Balance, BlockNumber, LeasePeriod>
|
||||
**/
|
||||
PolkadotRuntimeCommonCrowdloanFundInfo: {
|
||||
depositor: 'AccountId32',
|
||||
@@ -2132,7 +2206,7 @@ export default {
|
||||
fundIndex: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup669: polkadot_runtime_common::crowdloan::LastContribution<BlockNumber>
|
||||
* Lookup673: polkadot_runtime_common::crowdloan::LastContribution<BlockNumber>
|
||||
**/
|
||||
PolkadotRuntimeCommonCrowdloanLastContribution: {
|
||||
_enum: {
|
||||
@@ -2142,13 +2216,13 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup670: polkadot_runtime_common::crowdloan::pallet::Error<T>
|
||||
* Lookup674: polkadot_runtime_common::crowdloan::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeCommonCrowdloanPalletError: {
|
||||
_enum: ['FirstPeriodInPast', 'FirstPeriodTooFarInFuture', 'LastPeriodBeforeFirstPeriod', 'LastPeriodTooFarInFuture', 'CannotEndInPast', 'EndTooFarInFuture', 'Overflow', 'ContributionTooSmall', 'InvalidParaId', 'CapExceeded', 'ContributionPeriodOver', 'InvalidOrigin', 'NotParachain', 'LeaseActive', 'BidOrLeaseActive', 'FundNotEnded', 'NoContributions', 'NotReadyToDissolve', 'InvalidSignature', 'MemoTooLarge', 'AlreadyInNewRaise', 'VrfDelayInProgress', 'NoLeasePeriod']
|
||||
},
|
||||
/**
|
||||
* Lookup671: pallet_xcm::pallet::QueryStatus<BlockNumber>
|
||||
* Lookup675: pallet_xcm::pallet::QueryStatus<BlockNumber>
|
||||
**/
|
||||
PalletXcmQueryStatus: {
|
||||
_enum: {
|
||||
@@ -2168,7 +2242,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup674: xcm::VersionedResponse
|
||||
* Lookup678: xcm::VersionedResponse
|
||||
**/
|
||||
XcmVersionedResponse: {
|
||||
_enum: {
|
||||
@@ -2178,7 +2252,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup680: pallet_xcm::pallet::VersionMigrationStage
|
||||
* Lookup684: pallet_xcm::pallet::VersionMigrationStage
|
||||
**/
|
||||
PalletXcmVersionMigrationStage: {
|
||||
_enum: {
|
||||
@@ -2189,21 +2263,21 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup681: pallet_xcm::pallet::Error<T>
|
||||
* Lookup685: pallet_xcm::pallet::Error<T>
|
||||
**/
|
||||
PalletXcmError: {
|
||||
_enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed']
|
||||
},
|
||||
/**
|
||||
* Lookup692: pallet_transaction_payment::ChargeTransactionPayment<T>
|
||||
* Lookup696: pallet_transaction_payment::ChargeTransactionPayment<T>
|
||||
**/
|
||||
PalletTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
|
||||
/**
|
||||
* Lookup693: polkadot_runtime_common::claims::PrevalidateAttests<T>
|
||||
* Lookup697: polkadot_runtime_common::claims::PrevalidateAttests<T>
|
||||
**/
|
||||
PolkadotRuntimeCommonClaimsPrevalidateAttests: 'Null',
|
||||
/**
|
||||
* Lookup694: polkadot_runtime::Runtime
|
||||
* Lookup698: polkadot_runtime::Runtime
|
||||
**/
|
||||
PolkadotRuntimeRuntime: 'Null'
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeSessionKeys (253) */
|
||||
/** @name KusamaRuntimeSessionKeys (258) */
|
||||
export interface KusamaRuntimeSessionKeys extends Struct {
|
||||
readonly grandpa: SpFinalityGrandpaAppPublic;
|
||||
readonly babe: SpConsensusBabeAppPublic;
|
||||
@@ -29,7 +29,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeOriginCaller (327) */
|
||||
/** @name KusamaRuntimeOriginCaller (332) */
|
||||
export interface KusamaRuntimeOriginCaller extends Enum {
|
||||
readonly isSystem: boolean;
|
||||
readonly asSystem: FrameSupportDispatchRawOrigin;
|
||||
@@ -45,7 +45,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeNposCompactSolution24 (393) */
|
||||
/** @name KusamaRuntimeNposCompactSolution24 (398) */
|
||||
export interface KusamaRuntimeNposCompactSolution24 extends Struct {
|
||||
readonly votes1: Vec<ITuple<[Compact<u32>, Compact<u16>]>>;
|
||||
readonly votes2: Vec<ITuple<[Compact<u32>, ITuple<[Compact<u16>, Compact<PerU16>]>, Compact<u16>]>>;
|
||||
@@ -73,7 +73,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeRuntime (747) */
|
||||
/** @name KusamaRuntimeRuntime (774) */
|
||||
export type KusamaRuntimeRuntime = Null;
|
||||
|
||||
} // declare module
|
||||
|
||||
@@ -10,7 +10,11 @@ declare module '@polkadot/types/lookup' {
|
||||
/** @name PolkadotRuntimeCommonClaimsPalletEvent (71) */
|
||||
export interface PolkadotRuntimeCommonClaimsPalletEvent extends Enum {
|
||||
readonly isClaimed: boolean;
|
||||
readonly asClaimed: ITuple<[AccountId32, EthereumAddress, u128]>;
|
||||
readonly asClaimed: {
|
||||
readonly who: AccountId32;
|
||||
readonly ethereumAddress: EthereumAddress;
|
||||
readonly amount: u128;
|
||||
} & Struct;
|
||||
readonly type: 'Claimed';
|
||||
}
|
||||
|
||||
@@ -195,64 +199,134 @@ declare module '@polkadot/types/lookup' {
|
||||
/** @name PolkadotRuntimeCommonParasRegistrarPalletEvent (111) */
|
||||
export interface PolkadotRuntimeCommonParasRegistrarPalletEvent extends Enum {
|
||||
readonly isRegistered: boolean;
|
||||
readonly asRegistered: ITuple<[u32, AccountId32]>;
|
||||
readonly asRegistered: {
|
||||
readonly paraId: u32;
|
||||
readonly manager: AccountId32;
|
||||
} & Struct;
|
||||
readonly isDeregistered: boolean;
|
||||
readonly asDeregistered: u32;
|
||||
readonly asDeregistered: {
|
||||
readonly paraId: u32;
|
||||
} & Struct;
|
||||
readonly isReserved: boolean;
|
||||
readonly asReserved: ITuple<[u32, AccountId32]>;
|
||||
readonly asReserved: {
|
||||
readonly paraId: u32;
|
||||
readonly who: AccountId32;
|
||||
} & Struct;
|
||||
readonly type: 'Registered' | 'Deregistered' | 'Reserved';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonSlotsPalletEvent (112) */
|
||||
export interface PolkadotRuntimeCommonSlotsPalletEvent extends Enum {
|
||||
readonly isNewLeasePeriod: boolean;
|
||||
readonly asNewLeasePeriod: u32;
|
||||
readonly asNewLeasePeriod: {
|
||||
readonly leasePeriod: u32;
|
||||
} & Struct;
|
||||
readonly isLeased: boolean;
|
||||
readonly asLeased: ITuple<[u32, AccountId32, u32, u32, u128, u128]>;
|
||||
readonly asLeased: {
|
||||
readonly paraId: u32;
|
||||
readonly leaser: AccountId32;
|
||||
readonly periodBegin: u32;
|
||||
readonly periodCount: u32;
|
||||
readonly extraReserved: u128;
|
||||
readonly totalAmount: u128;
|
||||
} & Struct;
|
||||
readonly type: 'NewLeasePeriod' | 'Leased';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonAuctionsPalletEvent (113) */
|
||||
export interface PolkadotRuntimeCommonAuctionsPalletEvent extends Enum {
|
||||
readonly isAuctionStarted: boolean;
|
||||
readonly asAuctionStarted: ITuple<[u32, u32, u32]>;
|
||||
readonly asAuctionStarted: {
|
||||
readonly auctionIndex: u32;
|
||||
readonly leasePeriod: u32;
|
||||
readonly ending: u32;
|
||||
} & Struct;
|
||||
readonly isAuctionClosed: boolean;
|
||||
readonly asAuctionClosed: u32;
|
||||
readonly asAuctionClosed: {
|
||||
readonly auctionIndex: u32;
|
||||
} & Struct;
|
||||
readonly isReserved: boolean;
|
||||
readonly asReserved: ITuple<[AccountId32, u128, u128]>;
|
||||
readonly asReserved: {
|
||||
readonly bidder: AccountId32;
|
||||
readonly extraReserved: u128;
|
||||
readonly totalAmount: u128;
|
||||
} & Struct;
|
||||
readonly isUnreserved: boolean;
|
||||
readonly asUnreserved: ITuple<[AccountId32, u128]>;
|
||||
readonly asUnreserved: {
|
||||
readonly bidder: AccountId32;
|
||||
readonly amount: u128;
|
||||
} & Struct;
|
||||
readonly isReserveConfiscated: boolean;
|
||||
readonly asReserveConfiscated: ITuple<[u32, AccountId32, u128]>;
|
||||
readonly asReserveConfiscated: {
|
||||
readonly paraId: u32;
|
||||
readonly leaser: AccountId32;
|
||||
readonly amount: u128;
|
||||
} & Struct;
|
||||
readonly isBidAccepted: boolean;
|
||||
readonly asBidAccepted: ITuple<[AccountId32, u32, u128, u32, u32]>;
|
||||
readonly asBidAccepted: {
|
||||
readonly bidder: AccountId32;
|
||||
readonly paraId: u32;
|
||||
readonly amount: u128;
|
||||
readonly firstSlot: u32;
|
||||
readonly lastSlot: u32;
|
||||
} & Struct;
|
||||
readonly isWinningOffset: boolean;
|
||||
readonly asWinningOffset: ITuple<[u32, u32]>;
|
||||
readonly asWinningOffset: {
|
||||
readonly auctionIndex: u32;
|
||||
readonly blockNumber: u32;
|
||||
} & Struct;
|
||||
readonly type: 'AuctionStarted' | 'AuctionClosed' | 'Reserved' | 'Unreserved' | 'ReserveConfiscated' | 'BidAccepted' | 'WinningOffset';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonCrowdloanPalletEvent (114) */
|
||||
export interface PolkadotRuntimeCommonCrowdloanPalletEvent extends Enum {
|
||||
readonly isCreated: boolean;
|
||||
readonly asCreated: u32;
|
||||
readonly asCreated: {
|
||||
readonly paraId: u32;
|
||||
} & Struct;
|
||||
readonly isContributed: boolean;
|
||||
readonly asContributed: ITuple<[AccountId32, u32, u128]>;
|
||||
readonly asContributed: {
|
||||
readonly who: AccountId32;
|
||||
readonly fundIndex: u32;
|
||||
readonly amount: u128;
|
||||
} & Struct;
|
||||
readonly isWithdrew: boolean;
|
||||
readonly asWithdrew: ITuple<[AccountId32, u32, u128]>;
|
||||
readonly asWithdrew: {
|
||||
readonly who: AccountId32;
|
||||
readonly fundIndex: u32;
|
||||
readonly amount: u128;
|
||||
} & Struct;
|
||||
readonly isPartiallyRefunded: boolean;
|
||||
readonly asPartiallyRefunded: u32;
|
||||
readonly asPartiallyRefunded: {
|
||||
readonly paraId: u32;
|
||||
} & Struct;
|
||||
readonly isAllRefunded: boolean;
|
||||
readonly asAllRefunded: u32;
|
||||
readonly asAllRefunded: {
|
||||
readonly paraId: u32;
|
||||
} & Struct;
|
||||
readonly isDissolved: boolean;
|
||||
readonly asDissolved: u32;
|
||||
readonly asDissolved: {
|
||||
readonly paraId: u32;
|
||||
} & Struct;
|
||||
readonly isHandleBidResult: boolean;
|
||||
readonly asHandleBidResult: ITuple<[u32, Result<Null, SpRuntimeDispatchError>]>;
|
||||
readonly asHandleBidResult: {
|
||||
readonly paraId: u32;
|
||||
readonly result: Result<Null, SpRuntimeDispatchError>;
|
||||
} & Struct;
|
||||
readonly isEdited: boolean;
|
||||
readonly asEdited: u32;
|
||||
readonly asEdited: {
|
||||
readonly paraId: u32;
|
||||
} & Struct;
|
||||
readonly isMemoUpdated: boolean;
|
||||
readonly asMemoUpdated: ITuple<[AccountId32, u32, Bytes]>;
|
||||
readonly asMemoUpdated: {
|
||||
readonly who: AccountId32;
|
||||
readonly paraId: u32;
|
||||
readonly memo: Bytes;
|
||||
} & Struct;
|
||||
readonly isAddedToNewRaise: boolean;
|
||||
readonly asAddedToNewRaise: u32;
|
||||
readonly asAddedToNewRaise: {
|
||||
readonly paraId: u32;
|
||||
} & Struct;
|
||||
readonly type: 'Created' | 'Contributed' | 'Withdrew' | 'PartiallyRefunded' | 'AllRefunded' | 'Dissolved' | 'HandleBidResult' | 'Edited' | 'MemoUpdated' | 'AddedToNewRaise';
|
||||
}
|
||||
|
||||
@@ -1735,7 +1809,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Assets' | 'Version';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonClaimsPalletError (541) */
|
||||
/** @name PolkadotRuntimeCommonClaimsPalletError (544) */
|
||||
export interface PolkadotRuntimeCommonClaimsPalletError extends Enum {
|
||||
readonly isInvalidEthereumSignature: boolean;
|
||||
readonly isSignerHasNoClaim: boolean;
|
||||
@@ -1746,7 +1820,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'InvalidEthereumSignature' | 'SignerHasNoClaim' | 'SenderHasNoClaim' | 'PotUnderflow' | 'InvalidStatement' | 'VestedBalanceExists';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsConfigurationHostConfiguration (596) */
|
||||
/** @name PolkadotRuntimeParachainsConfigurationHostConfiguration (600) */
|
||||
export interface PolkadotRuntimeParachainsConfigurationHostConfiguration extends Struct {
|
||||
readonly maxCodeSize: u32;
|
||||
readonly maxHeadDataSize: u32;
|
||||
@@ -1793,19 +1867,19 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly minimumValidationUpgradeDelay: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsConfigurationPalletError (599) */
|
||||
/** @name PolkadotRuntimeParachainsConfigurationPalletError (603) */
|
||||
export interface PolkadotRuntimeParachainsConfigurationPalletError extends Enum {
|
||||
readonly isInvalidNewValue: boolean;
|
||||
readonly type: 'InvalidNewValue';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord (602) */
|
||||
/** @name PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord (606) */
|
||||
export interface PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord extends Struct {
|
||||
readonly bitfield: BitVec;
|
||||
readonly submittedAt: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsInclusionCandidatePendingAvailability (603) */
|
||||
/** @name PolkadotRuntimeParachainsInclusionCandidatePendingAvailability (607) */
|
||||
export interface PolkadotRuntimeParachainsInclusionCandidatePendingAvailability extends Struct {
|
||||
readonly core: u32;
|
||||
readonly hash_: H256;
|
||||
@@ -1817,7 +1891,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly backingGroup: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsInclusionPalletError (604) */
|
||||
/** @name PolkadotRuntimeParachainsInclusionPalletError (608) */
|
||||
export interface PolkadotRuntimeParachainsInclusionPalletError extends Enum {
|
||||
readonly isUnsortedOrDuplicateValidatorIndices: boolean;
|
||||
readonly isUnsortedOrDuplicateDisputeStatementSet: boolean;
|
||||
@@ -1851,14 +1925,14 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'UnsortedOrDuplicateValidatorIndices' | 'UnsortedOrDuplicateDisputeStatementSet' | 'UnsortedOrDuplicateBackedCandidates' | 'UnexpectedRelayParent' | 'WrongBitfieldSize' | 'BitfieldAllZeros' | 'BitfieldDuplicateOrUnordered' | 'ValidatorIndexOutOfBounds' | 'InvalidBitfieldSignature' | 'UnscheduledCandidate' | 'CandidateScheduledBeforeParaFree' | 'WrongCollator' | 'ScheduledOutOfOrder' | 'HeadDataTooLarge' | 'PrematureCodeUpgrade' | 'NewCodeTooLarge' | 'CandidateNotInParentContext' | 'InvalidGroupIndex' | 'InsufficientBacking' | 'InvalidBacking' | 'NotCollatorSigned' | 'ValidationDataHashMismatch' | 'IncorrectDownwardMessageHandling' | 'InvalidUpwardMessages' | 'HrmpWatermarkMishandling' | 'InvalidOutboundHrmp' | 'InvalidValidationCodeHash' | 'ParaHeadMismatch' | 'BitfieldReferencesFreedCore';
|
||||
}
|
||||
|
||||
/** @name PolkadotPrimitivesV2ScrapedOnChainVotes (605) */
|
||||
/** @name PolkadotPrimitivesV2ScrapedOnChainVotes (609) */
|
||||
export interface PolkadotPrimitivesV2ScrapedOnChainVotes extends Struct {
|
||||
readonly session: u32;
|
||||
readonly backingValidatorsPerCandidate: Vec<ITuple<[PolkadotPrimitivesV2CandidateReceipt, Vec<ITuple<[u32, PolkadotPrimitivesV2ValidityAttestation]>>]>>;
|
||||
readonly disputes: Vec<PolkadotPrimitivesV2DisputeStatementSet>;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsParasInherentPalletError (610) */
|
||||
/** @name PolkadotRuntimeParachainsParasInherentPalletError (614) */
|
||||
export interface PolkadotRuntimeParachainsParasInherentPalletError extends Enum {
|
||||
readonly isTooManyInclusionInherents: boolean;
|
||||
readonly isInvalidParentHeader: boolean;
|
||||
@@ -1869,28 +1943,28 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'TooManyInclusionInherents' | 'InvalidParentHeader' | 'CandidateConcludedInvalid' | 'InherentOverweight' | 'DisputeStatementsUnsortedOrDuplicates' | 'DisputeInvalid';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsSchedulerParathreadClaimQueue (612) */
|
||||
/** @name PolkadotRuntimeParachainsSchedulerParathreadClaimQueue (616) */
|
||||
export interface PolkadotRuntimeParachainsSchedulerParathreadClaimQueue extends Struct {
|
||||
readonly queue: Vec<PolkadotRuntimeParachainsSchedulerQueuedParathread>;
|
||||
readonly nextCoreOffset: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsSchedulerQueuedParathread (614) */
|
||||
/** @name PolkadotRuntimeParachainsSchedulerQueuedParathread (618) */
|
||||
export interface PolkadotRuntimeParachainsSchedulerQueuedParathread extends Struct {
|
||||
readonly claim: PolkadotPrimitivesV2ParathreadEntry;
|
||||
readonly coreOffset: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotPrimitivesV2ParathreadEntry (615) */
|
||||
/** @name PolkadotPrimitivesV2ParathreadEntry (619) */
|
||||
export interface PolkadotPrimitivesV2ParathreadEntry extends Struct {
|
||||
readonly claim: PolkadotPrimitivesV2ParathreadClaim;
|
||||
readonly retries: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotPrimitivesV2ParathreadClaim (616) */
|
||||
/** @name PolkadotPrimitivesV2ParathreadClaim (620) */
|
||||
export interface PolkadotPrimitivesV2ParathreadClaim extends ITuple<[u32, PolkadotPrimitivesV2CollatorAppPublic]> {}
|
||||
|
||||
/** @name PolkadotPrimitivesV2CoreOccupied (619) */
|
||||
/** @name PolkadotPrimitivesV2CoreOccupied (623) */
|
||||
export interface PolkadotPrimitivesV2CoreOccupied extends Enum {
|
||||
readonly isParathread: boolean;
|
||||
readonly asParathread: PolkadotPrimitivesV2ParathreadEntry;
|
||||
@@ -1898,7 +1972,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Parathread' | 'Parachain';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsSchedulerCoreAssignment (622) */
|
||||
/** @name PolkadotRuntimeParachainsSchedulerCoreAssignment (626) */
|
||||
export interface PolkadotRuntimeParachainsSchedulerCoreAssignment extends Struct {
|
||||
readonly core: u32;
|
||||
readonly paraId: u32;
|
||||
@@ -1906,7 +1980,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly groupIdx: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsSchedulerAssignmentKind (623) */
|
||||
/** @name PolkadotRuntimeParachainsSchedulerAssignmentKind (627) */
|
||||
export interface PolkadotRuntimeParachainsSchedulerAssignmentKind extends Enum {
|
||||
readonly isParachain: boolean;
|
||||
readonly isParathread: boolean;
|
||||
@@ -1914,7 +1988,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Parachain' | 'Parathread';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsParasPvfCheckActiveVoteState (624) */
|
||||
/** @name PolkadotRuntimeParachainsParasPvfCheckActiveVoteState (628) */
|
||||
export interface PolkadotRuntimeParachainsParasPvfCheckActiveVoteState extends Struct {
|
||||
readonly votesAccept: BitVec;
|
||||
readonly votesReject: BitVec;
|
||||
@@ -1923,7 +1997,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly causes: Vec<PolkadotRuntimeParachainsParasPvfCheckCause>;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsParasPvfCheckCause (626) */
|
||||
/** @name PolkadotRuntimeParachainsParasPvfCheckCause (630) */
|
||||
export interface PolkadotRuntimeParachainsParasPvfCheckCause extends Enum {
|
||||
readonly isOnboarding: boolean;
|
||||
readonly asOnboarding: u32;
|
||||
@@ -1935,7 +2009,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Onboarding' | 'Upgrade';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsParasParaLifecycle (628) */
|
||||
/** @name PolkadotRuntimeParachainsParasParaLifecycle (632) */
|
||||
export interface PolkadotRuntimeParachainsParasParaLifecycle extends Enum {
|
||||
readonly isOnboarding: boolean;
|
||||
readonly isParathread: boolean;
|
||||
@@ -1947,39 +2021,39 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Onboarding' | 'Parathread' | 'Parachain' | 'UpgradingParathread' | 'DowngradingParachain' | 'OffboardingParathread' | 'OffboardingParachain';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsParasParaPastCodeMeta (630) */
|
||||
/** @name PolkadotRuntimeParachainsParasParaPastCodeMeta (634) */
|
||||
export interface PolkadotRuntimeParachainsParasParaPastCodeMeta extends Struct {
|
||||
readonly upgradeTimes: Vec<PolkadotRuntimeParachainsParasReplacementTimes>;
|
||||
readonly lastPruned: Option<u32>;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsParasReplacementTimes (632) */
|
||||
/** @name PolkadotRuntimeParachainsParasReplacementTimes (636) */
|
||||
export interface PolkadotRuntimeParachainsParasReplacementTimes extends Struct {
|
||||
readonly expectedAt: u32;
|
||||
readonly activatedAt: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotPrimitivesV2UpgradeGoAhead (634) */
|
||||
/** @name PolkadotPrimitivesV2UpgradeGoAhead (638) */
|
||||
export interface PolkadotPrimitivesV2UpgradeGoAhead extends Enum {
|
||||
readonly isAbort: boolean;
|
||||
readonly isGoAhead: boolean;
|
||||
readonly type: 'Abort' | 'GoAhead';
|
||||
}
|
||||
|
||||
/** @name PolkadotPrimitivesV2UpgradeRestriction (635) */
|
||||
/** @name PolkadotPrimitivesV2UpgradeRestriction (639) */
|
||||
export interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {
|
||||
readonly isPresent: boolean;
|
||||
readonly type: 'Present';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsParasParaGenesisArgs (636) */
|
||||
/** @name PolkadotRuntimeParachainsParasParaGenesisArgs (640) */
|
||||
export interface PolkadotRuntimeParachainsParasParaGenesisArgs extends Struct {
|
||||
readonly genesisHead: Bytes;
|
||||
readonly validationCode: Bytes;
|
||||
readonly parachain: bool;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsParasPalletError (637) */
|
||||
/** @name PolkadotRuntimeParachainsParasPalletError (641) */
|
||||
export interface PolkadotRuntimeParachainsParasPalletError extends Enum {
|
||||
readonly isNotRegistered: boolean;
|
||||
readonly isCannotOnboard: boolean;
|
||||
@@ -1996,27 +2070,27 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'NotRegistered' | 'CannotOnboard' | 'CannotOffboard' | 'CannotUpgrade' | 'CannotDowngrade' | 'PvfCheckStatementStale' | 'PvfCheckStatementFuture' | 'PvfCheckValidatorIndexOutOfBounds' | 'PvfCheckInvalidSignature' | 'PvfCheckDoubleVote' | 'PvfCheckSubjectInvalid' | 'PvfCheckDisabled';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsInitializerBufferedSessionChange (639) */
|
||||
/** @name PolkadotRuntimeParachainsInitializerBufferedSessionChange (643) */
|
||||
export interface PolkadotRuntimeParachainsInitializerBufferedSessionChange extends Struct {
|
||||
readonly validators: Vec<PolkadotPrimitivesV2ValidatorAppPublic>;
|
||||
readonly queued: Vec<PolkadotPrimitivesV2ValidatorAppPublic>;
|
||||
readonly sessionIndex: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotCorePrimitivesInboundDownwardMessage (641) */
|
||||
/** @name PolkadotCorePrimitivesInboundDownwardMessage (645) */
|
||||
export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {
|
||||
readonly sentAt: u32;
|
||||
readonly msg: Bytes;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsUmpPalletError (643) */
|
||||
/** @name PolkadotRuntimeParachainsUmpPalletError (647) */
|
||||
export interface PolkadotRuntimeParachainsUmpPalletError extends Enum {
|
||||
readonly isUnknownMessageIndex: boolean;
|
||||
readonly isWeightOverLimit: boolean;
|
||||
readonly type: 'UnknownMessageIndex' | 'WeightOverLimit';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest (644) */
|
||||
/** @name PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest (648) */
|
||||
export interface PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest extends Struct {
|
||||
readonly confirmed: bool;
|
||||
readonly age: u32;
|
||||
@@ -2026,7 +2100,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly maxTotalSize: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsHrmpHrmpChannel (646) */
|
||||
/** @name PolkadotRuntimeParachainsHrmpHrmpChannel (650) */
|
||||
export interface PolkadotRuntimeParachainsHrmpHrmpChannel extends Struct {
|
||||
readonly maxCapacity: u32;
|
||||
readonly maxTotalSize: u32;
|
||||
@@ -2038,13 +2112,13 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly recipientDeposit: u128;
|
||||
}
|
||||
|
||||
/** @name PolkadotCorePrimitivesInboundHrmpMessage (649) */
|
||||
/** @name PolkadotCorePrimitivesInboundHrmpMessage (653) */
|
||||
export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {
|
||||
readonly sentAt: u32;
|
||||
readonly data: Bytes;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsHrmpPalletError (652) */
|
||||
/** @name PolkadotRuntimeParachainsHrmpPalletError (656) */
|
||||
export interface PolkadotRuntimeParachainsHrmpPalletError extends Enum {
|
||||
readonly isOpenHrmpChannelToSelf: boolean;
|
||||
readonly isOpenHrmpChannelInvalidRecipient: boolean;
|
||||
@@ -2068,7 +2142,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'OpenHrmpChannelToSelf' | 'OpenHrmpChannelInvalidRecipient' | 'OpenHrmpChannelZeroCapacity' | 'OpenHrmpChannelCapacityExceedsLimit' | 'OpenHrmpChannelZeroMessageSize' | 'OpenHrmpChannelMessageSizeExceedsLimit' | 'OpenHrmpChannelAlreadyExists' | 'OpenHrmpChannelAlreadyRequested' | 'OpenHrmpChannelLimitExceeded' | 'AcceptHrmpChannelDoesntExist' | 'AcceptHrmpChannelAlreadyConfirmed' | 'AcceptHrmpChannelLimitExceeded' | 'CloseHrmpChannelUnauthorized' | 'CloseHrmpChannelDoesntExist' | 'CloseHrmpChannelAlreadyUnderway' | 'CancelHrmpOpenChannelUnauthorized' | 'OpenHrmpChannelDoesntExist' | 'OpenHrmpChannelAlreadyConfirmed' | 'WrongWitness';
|
||||
}
|
||||
|
||||
/** @name PolkadotPrimitivesV2SessionInfo (654) */
|
||||
/** @name PolkadotPrimitivesV2SessionInfo (658) */
|
||||
export interface PolkadotPrimitivesV2SessionInfo extends Struct {
|
||||
readonly activeValidatorIndices: Vec<u32>;
|
||||
readonly randomSeed: U8aFixed;
|
||||
@@ -2085,7 +2159,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly neededApprovals: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotPrimitivesV2DisputeState (657) */
|
||||
/** @name PolkadotPrimitivesV2DisputeState (661) */
|
||||
export interface PolkadotPrimitivesV2DisputeState extends Struct {
|
||||
readonly validatorsFor: BitVec;
|
||||
readonly validatorsAgainst: BitVec;
|
||||
@@ -2093,7 +2167,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly concludedAt: Option<u32>;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletError (658) */
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletError (662) */
|
||||
export interface PolkadotRuntimeParachainsDisputesPalletError extends Enum {
|
||||
readonly isDuplicateDisputeStatementSets: boolean;
|
||||
readonly isAncientDisputeStatement: boolean;
|
||||
@@ -2105,14 +2179,14 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'DuplicateDisputeStatementSets' | 'AncientDisputeStatement' | 'ValidatorIndexOutOfBounds' | 'InvalidSignature' | 'DuplicateStatement' | 'PotentialSpam' | 'SingleSidedDispute';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonParasRegistrarParaInfo (659) */
|
||||
/** @name PolkadotRuntimeCommonParasRegistrarParaInfo (663) */
|
||||
export interface PolkadotRuntimeCommonParasRegistrarParaInfo extends Struct {
|
||||
readonly manager: AccountId32;
|
||||
readonly deposit: u128;
|
||||
readonly locked: bool;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonParasRegistrarPalletError (660) */
|
||||
/** @name PolkadotRuntimeCommonParasRegistrarPalletError (664) */
|
||||
export interface PolkadotRuntimeCommonParasRegistrarPalletError extends Enum {
|
||||
readonly isNotRegistered: boolean;
|
||||
readonly isAlreadyRegistered: boolean;
|
||||
@@ -2131,14 +2205,14 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'NotRegistered' | 'AlreadyRegistered' | 'NotOwner' | 'CodeTooLarge' | 'HeadDataTooLarge' | 'NotParachain' | 'NotParathread' | 'CannotDeregister' | 'CannotDowngrade' | 'CannotUpgrade' | 'ParaLocked' | 'NotReserved' | 'EmptyCode' | 'CannotSwap';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonSlotsPalletError (662) */
|
||||
/** @name PolkadotRuntimeCommonSlotsPalletError (666) */
|
||||
export interface PolkadotRuntimeCommonSlotsPalletError extends Enum {
|
||||
readonly isParaNotOnboarding: boolean;
|
||||
readonly isLeaseError: boolean;
|
||||
readonly type: 'ParaNotOnboarding' | 'LeaseError';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonAuctionsPalletError (667) */
|
||||
/** @name PolkadotRuntimeCommonAuctionsPalletError (671) */
|
||||
export interface PolkadotRuntimeCommonAuctionsPalletError extends Enum {
|
||||
readonly isAuctionInProgress: boolean;
|
||||
readonly isLeasePeriodInPast: boolean;
|
||||
@@ -2150,7 +2224,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'AuctionInProgress' | 'LeasePeriodInPast' | 'ParaNotRegistered' | 'NotCurrentAuction' | 'NotAuction' | 'AuctionEnded' | 'AlreadyLeasedOut';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonCrowdloanFundInfo (668) */
|
||||
/** @name PolkadotRuntimeCommonCrowdloanFundInfo (672) */
|
||||
export interface PolkadotRuntimeCommonCrowdloanFundInfo extends Struct {
|
||||
readonly depositor: AccountId32;
|
||||
readonly verifier: Option<SpRuntimeMultiSigner>;
|
||||
@@ -2164,7 +2238,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly fundIndex: u32;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonCrowdloanLastContribution (669) */
|
||||
/** @name PolkadotRuntimeCommonCrowdloanLastContribution (673) */
|
||||
export interface PolkadotRuntimeCommonCrowdloanLastContribution extends Enum {
|
||||
readonly isNever: boolean;
|
||||
readonly isPreEnding: boolean;
|
||||
@@ -2174,7 +2248,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Never' | 'PreEnding' | 'Ending';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeCommonCrowdloanPalletError (670) */
|
||||
/** @name PolkadotRuntimeCommonCrowdloanPalletError (674) */
|
||||
export interface PolkadotRuntimeCommonCrowdloanPalletError extends Enum {
|
||||
readonly isFirstPeriodInPast: boolean;
|
||||
readonly isFirstPeriodTooFarInFuture: boolean;
|
||||
@@ -2202,7 +2276,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'FirstPeriodInPast' | 'FirstPeriodTooFarInFuture' | 'LastPeriodBeforeFirstPeriod' | 'LastPeriodTooFarInFuture' | 'CannotEndInPast' | 'EndTooFarInFuture' | 'Overflow' | 'ContributionTooSmall' | 'InvalidParaId' | 'CapExceeded' | 'ContributionPeriodOver' | 'InvalidOrigin' | 'NotParachain' | 'LeaseActive' | 'BidOrLeaseActive' | 'FundNotEnded' | 'NoContributions' | 'NotReadyToDissolve' | 'InvalidSignature' | 'MemoTooLarge' | 'AlreadyInNewRaise' | 'VrfDelayInProgress' | 'NoLeasePeriod';
|
||||
}
|
||||
|
||||
/** @name PalletXcmQueryStatus (671) */
|
||||
/** @name PalletXcmQueryStatus (675) */
|
||||
export interface PalletXcmQueryStatus extends Enum {
|
||||
readonly isPending: boolean;
|
||||
readonly asPending: {
|
||||
@@ -2223,7 +2297,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Pending' | 'VersionNotifier' | 'Ready';
|
||||
}
|
||||
|
||||
/** @name XcmVersionedResponse (674) */
|
||||
/** @name XcmVersionedResponse (678) */
|
||||
export interface XcmVersionedResponse extends Enum {
|
||||
readonly isV0: boolean;
|
||||
readonly asV0: XcmV0Response;
|
||||
@@ -2234,7 +2308,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'V0' | 'V1' | 'V2';
|
||||
}
|
||||
|
||||
/** @name PalletXcmVersionMigrationStage (680) */
|
||||
/** @name PalletXcmVersionMigrationStage (684) */
|
||||
export interface PalletXcmVersionMigrationStage extends Enum {
|
||||
readonly isMigrateSupportedVersion: boolean;
|
||||
readonly isMigrateVersionNotifiers: boolean;
|
||||
@@ -2244,7 +2318,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'MigrateSupportedVersion' | 'MigrateVersionNotifiers' | 'NotifyCurrentTargets' | 'MigrateAndNotifyOldTargets';
|
||||
}
|
||||
|
||||
/** @name PalletXcmError (681) */
|
||||
/** @name PalletXcmError (685) */
|
||||
export interface PalletXcmError extends Enum {
|
||||
readonly isUnreachable: boolean;
|
||||
readonly isSendFailure: boolean;
|
||||
@@ -2262,13 +2336,13 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';
|
||||
}
|
||||
|
||||
/** @name PalletTransactionPaymentChargeTransactionPayment (692) */
|
||||
/** @name PalletTransactionPaymentChargeTransactionPayment (696) */
|
||||
export interface PalletTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
|
||||
|
||||
/** @name PolkadotRuntimeCommonClaimsPrevalidateAttests (693) */
|
||||
/** @name PolkadotRuntimeCommonClaimsPrevalidateAttests (697) */
|
||||
export type PolkadotRuntimeCommonClaimsPrevalidateAttests = Null;
|
||||
|
||||
/** @name PolkadotRuntimeRuntime (694) */
|
||||
/** @name PolkadotRuntimeRuntime (698) */
|
||||
export type PolkadotRuntimeRuntime = Null;
|
||||
|
||||
} // declare module
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Data, StorageKey } from '@polkadot/types';
|
||||
import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
|
||||
import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
|
||||
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
|
||||
import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
|
||||
import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
|
||||
@@ -35,7 +35,7 @@ import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityInfo
|
||||
import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
|
||||
import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery';
|
||||
import type { 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, 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 { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';
|
||||
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, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, Scheduling, 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';
|
||||
@@ -595,6 +595,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
MetadataV14: MetadataV14;
|
||||
MetadataV9: MetadataV9;
|
||||
MigrationStatusResult: MigrationStatusResult;
|
||||
MmrLeafBatchProof: MmrLeafBatchProof;
|
||||
MmrLeafProof: MmrLeafProof;
|
||||
MmrRootHash: MmrRootHash;
|
||||
ModuleConstantMetadataV10: ModuleConstantMetadataV10;
|
||||
@@ -660,6 +661,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
OpenTipTip: OpenTipTip;
|
||||
OpenTipTo225: OpenTipTo225;
|
||||
OperatingMode: OperatingMode;
|
||||
OptionBool: OptionBool;
|
||||
Origin: Origin;
|
||||
OriginCaller: OriginCaller;
|
||||
OriginKindV0: OriginKindV0;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -20,16 +20,16 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/util": "^9.1.1"
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/util": "^9.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "8.3.2",
|
||||
"@polkadot/types-augment": "8.3.2",
|
||||
"@polkadot/types-support": "8.3.2",
|
||||
"@polkadot/util-crypto": "^9.1.1"
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-augment": "8.6.2",
|
||||
"@polkadot/types-support": "8.6.2",
|
||||
"@polkadot/util-crypto": "^9.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, Inspect, IU8a, IVec, Registry } from '../types';
|
||||
|
||||
import { compactToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
import { compactToU8a, u8aConcatStrict, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { compareArray } from '../utils/compareArray';
|
||||
|
||||
@@ -20,18 +20,10 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
readonly initialU8aLength?: number;
|
||||
|
||||
protected constructor (registry: Registry, values: T[], initialU8aLength?: number) {
|
||||
super(values.length);
|
||||
|
||||
// explicitly set the values here - this removes the need for any extra allocations
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
this[i] = values[i];
|
||||
}
|
||||
protected constructor (registry: Registry, length: number) {
|
||||
super(length);
|
||||
|
||||
this.registry = registry;
|
||||
this.initialU8aLength = initialU8aLength;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,8 +156,8 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
const encoded = this.toU8aInner();
|
||||
|
||||
return isBare
|
||||
? u8aConcat(...encoded)
|
||||
: u8aConcat(compactToU8a(this.length), ...encoded);
|
||||
? u8aConcatStrict(encoded)
|
||||
: u8aConcatStrict([compactToU8a(this.length), ...encoded]);
|
||||
}
|
||||
|
||||
public toU8aInner (isBare?: boolean): Uint8Array[] {
|
||||
|
||||
@@ -25,10 +25,8 @@ function toPercentage (value: BN, divisor: BN): string {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeAbstractInt (value: AnyNumber, bitLength: UIntBitLength, isNegative: boolean): string {
|
||||
if (isU8a(value)) {
|
||||
return u8aToBn(value.subarray(0, bitLength / 8), { isLe: true, isNegative }).toString();
|
||||
} else if (isBn(value)) {
|
||||
function decodeAbstractInt (value: Exclude<AnyNumber, Uint8Array>, isNegative: boolean): string {
|
||||
if (isBn(value)) {
|
||||
return value.toString();
|
||||
} else if (isHex(value, -1, true)) {
|
||||
return hexToBn(value, { isLe: false, isNegative }).toString();
|
||||
@@ -65,7 +63,7 @@ export abstract class AbstractInt extends BN implements INumber {
|
||||
// shortcut isU8a as used in SCALE decoding
|
||||
isU8a(value)
|
||||
? u8aToBn(value.subarray(0, bitLength / 8), { isLe: true, isNegative: isSigned }).toString()
|
||||
: decodeAbstractInt(value, bitLength, isSigned)
|
||||
: decodeAbstractInt(value, isSigned)
|
||||
);
|
||||
|
||||
this.registry = registry;
|
||||
|
||||
@@ -5,10 +5,19 @@ import type { BN } from '@polkadot/util';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, AnyNumber, CodecClass, ICompact, Inspect, INumber, IU8a, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util';
|
||||
import { compactFromU8a, compactToU8a, isU8a } from '@polkadot/util';
|
||||
|
||||
import { typeToConstructor } from '../utils';
|
||||
|
||||
interface Options<T> {
|
||||
definition?: CodecClass<T>;
|
||||
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
|
||||
}
|
||||
|
||||
function noopSetDefinition <T> (d: CodecClass<T>): CodecClass<T> {
|
||||
return d;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Compact
|
||||
* @description
|
||||
@@ -28,9 +37,9 @@ export class Compact<T extends INumber> implements ICompact<T> {
|
||||
|
||||
readonly #raw: T;
|
||||
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, value: Compact<T> | AnyNumber = 0) {
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, value: Compact<T> | AnyNumber = 0, { definition, setDefinition = noopSetDefinition }: Options<T> = {}) {
|
||||
this.registry = registry;
|
||||
this.#Type = typeToConstructor(registry, Type);
|
||||
this.#Type = definition || setDefinition(typeToConstructor(registry, Type));
|
||||
|
||||
const [raw, decodedLength] = Compact.decodeCompact<T>(registry, this.#Type, value);
|
||||
|
||||
@@ -38,27 +47,33 @@ export class Compact<T extends INumber> implements ICompact<T> {
|
||||
this.#raw = raw;
|
||||
}
|
||||
|
||||
public static with<T extends INumber> (Type: CodecClass<T> | string): CodecClass<Compact<T>> {
|
||||
return class extends Compact<T> {
|
||||
constructor (registry: Registry, value?: Compact<T> | AnyNumber) {
|
||||
super(registry, Type, value);
|
||||
public static with<O extends INumber> (Type: CodecClass<O> | string): CodecClass<Compact<O>> {
|
||||
let definition: CodecClass<O> | undefined;
|
||||
|
||||
// eslint-disable-next-line no-return-assign
|
||||
const setDefinition = <T> (d: CodecClass<T>) =>
|
||||
(definition = d as unknown as CodecClass<O>) as unknown as CodecClass<T>;
|
||||
|
||||
return class extends Compact<O> {
|
||||
constructor (registry: Registry, value?: Compact<O> | AnyNumber) {
|
||||
super(registry, Type, value, { definition, setDefinition });
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
public static decodeCompact<T extends INumber> (registry: Registry, Type: CodecClass<T>, value: Compact<T> | AnyNumber): [T, number] {
|
||||
if (value instanceof Compact) {
|
||||
if (isU8a(value)) {
|
||||
const [decodedLength, bn] = compactFromU8a(value);
|
||||
|
||||
return [new Type(registry, bn), decodedLength];
|
||||
} else if (value instanceof Compact) {
|
||||
return [new Type(registry, value.#raw), 0];
|
||||
} else if (value instanceof Type) {
|
||||
return [value, 0];
|
||||
} else if (isString(value) || isNumber(value) || isBn(value) || isBigInt(value)) {
|
||||
return [new Type(registry, value), 0];
|
||||
}
|
||||
|
||||
const [decodedLength, bn] = compactFromU8a(value);
|
||||
|
||||
return [new Type(registry, bn), decodedLength];
|
||||
return [new Type(registry, value), 0];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, IEnum, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { assert, isHex, isNumber, isObject, isString, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, stringPascalCase, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { assert, isCodec, isHex, isNumber, isObject, isString, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, stringPascalCase, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { mapToTypeMap, typesToMap } from '../utils';
|
||||
import { Null } from './Null';
|
||||
@@ -14,6 +14,12 @@ export interface EnumCodecClass<T = Codec> {
|
||||
new(registry: Registry, value?: any, index?: number): T;
|
||||
}
|
||||
|
||||
interface Definition {
|
||||
def: TypesDef;
|
||||
isBasic: boolean;
|
||||
isIndexed: boolean;
|
||||
}
|
||||
|
||||
interface EntryDef {
|
||||
Type: CodecClass;
|
||||
index: number;
|
||||
@@ -26,6 +32,15 @@ interface Decoded {
|
||||
value: Codec;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
definition?: Definition;
|
||||
setDefinition?: (d: Definition) => Definition;
|
||||
}
|
||||
|
||||
function noopSetDefinition (d: Definition): Definition {
|
||||
return d;
|
||||
}
|
||||
|
||||
function isRustEnum (def: Record<string, string | CodecClass> | Record<string, number>): def is Record<string, string | CodecClass> {
|
||||
const defValues = Object.values(def);
|
||||
|
||||
@@ -38,7 +53,7 @@ function isRustEnum (def: Record<string, string | CodecClass> | Record<string, n
|
||||
return true;
|
||||
}
|
||||
|
||||
function extractDef (registry: Registry, _def: Record<string, string | CodecClass> | Record<string, number> | string[]): { def: TypesDef; isBasic: boolean; isIndexed: boolean } {
|
||||
function extractDef (registry: Registry, _def: Record<string, string | CodecClass> | Record<string, number> | string[]): Definition {
|
||||
const def: TypesDef = {};
|
||||
let isBasic: boolean;
|
||||
let isIndexed: boolean;
|
||||
@@ -51,12 +66,10 @@ function extractDef (registry: Registry, _def: Record<string, string | CodecClas
|
||||
isBasic = true;
|
||||
isIndexed = false;
|
||||
} else if (isRustEnum(_def)) {
|
||||
const entries = Object.entries(mapToTypeMap(registry, _def));
|
||||
const [Types, keys] = mapToTypeMap(registry, _def);
|
||||
|
||||
for (let i = 0; i < entries.length; i++) {
|
||||
const [key, Type] = entries[i];
|
||||
|
||||
def[key] = { Type, index: i };
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
def[keys[i]] = { Type: Types[i], index: i };
|
||||
}
|
||||
|
||||
isBasic = !Object.values(def).some(({ Type }) => Type !== Null);
|
||||
@@ -88,7 +101,7 @@ function createFromValue (registry: Registry, def: TypesDef, index = 0, value?:
|
||||
|
||||
return {
|
||||
index,
|
||||
value: value instanceof entry.Type
|
||||
value: isCodec(value) && value instanceof entry.Type
|
||||
? value
|
||||
: new entry.Type(registry, value)
|
||||
};
|
||||
@@ -163,8 +176,8 @@ export class Enum implements IEnum {
|
||||
|
||||
readonly #raw: Codec;
|
||||
|
||||
constructor (registry: Registry, Types: Record<string, string | CodecClass> | Record<string, number> | string[], value?: unknown, index?: number) {
|
||||
const { def, isBasic, isIndexed } = extractDef(registry, Types);
|
||||
constructor (registry: Registry, Types: Record<string, string | CodecClass> | Record<string, number> | string[], value?: unknown, index?: number, { definition, setDefinition = noopSetDefinition }: Options = {}) {
|
||||
const { def, isBasic, isIndexed } = definition || setDefinition(extractDef(registry, Types));
|
||||
|
||||
// shortcut isU8a as used in SCALE decoding
|
||||
const decoded = isU8a(value) && value.length && !isNumber(index)
|
||||
@@ -198,9 +211,15 @@ export class Enum implements IEnum {
|
||||
isKeys[i] = `is${name}`;
|
||||
}
|
||||
|
||||
let definition: Definition | undefined;
|
||||
|
||||
// eslint-disable-next-line no-return-assign
|
||||
const setDefinition = (d: Definition) =>
|
||||
definition = d;
|
||||
|
||||
return class extends Enum {
|
||||
constructor (registry: Registry, value?: unknown, index?: number) {
|
||||
super(registry, Types, value, index);
|
||||
super(registry, Types, value, index, { definition, setDefinition });
|
||||
|
||||
objectProperties(this, isKeys, (_, i) => this.type === keys[i]);
|
||||
objectProperties(this, asKeys, (k, i): Codec => {
|
||||
@@ -266,7 +285,7 @@ export class Enum implements IEnum {
|
||||
* @deprecated use isNone
|
||||
*/
|
||||
public get isNull (): boolean {
|
||||
return this.#raw instanceof Null;
|
||||
return this.isNone;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -310,7 +329,7 @@ export class Enum implements IEnum {
|
||||
return this.type === other;
|
||||
} else if (isHex(other)) {
|
||||
return this.toHex() === other;
|
||||
} else if (other instanceof Enum) {
|
||||
} else if (isCodec(other) && other instanceof Enum) {
|
||||
return this.index === other.index && this.value.eq(other.value);
|
||||
} else if (isObject(other)) {
|
||||
return this.value.eq(other[this.type]);
|
||||
@@ -382,15 +401,14 @@ export class Enum implements IEnum {
|
||||
: this.defKeys;
|
||||
}
|
||||
|
||||
const typeMap = Object
|
||||
.entries(this.#def)
|
||||
.reduce((out: Record<string, CodecClass>, [key, { Type }]) => {
|
||||
out[key] = Type;
|
||||
const entries = Object.entries(this.#def);
|
||||
|
||||
return out;
|
||||
}, {});
|
||||
return typesToMap(this.registry, entries.reduce<[CodecClass[], string[]]>((out, [key, { Type }], i) => {
|
||||
out[0][i] = Type;
|
||||
out[1][i] = key;
|
||||
|
||||
return typesToMap(this.registry, typeMap);
|
||||
return out;
|
||||
}, [new Array<CodecClass>(entries.length), new Array<string>(entries.length)]));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -404,7 +422,7 @@ export class Enum implements IEnum {
|
||||
* @description Returns the string representation of the value
|
||||
*/
|
||||
public toString (): string {
|
||||
return this.isNull
|
||||
return this.isNone
|
||||
? this.type
|
||||
: stringify(this.toJSON());
|
||||
}
|
||||
@@ -414,9 +432,11 @@ export class Enum implements IEnum {
|
||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||
*/
|
||||
public toU8a (isBare?: boolean): Uint8Array {
|
||||
return u8aConcat(
|
||||
new Uint8Array(isBare ? [] : [this.index]),
|
||||
this.#raw.toU8a(isBare)
|
||||
);
|
||||
return isBare
|
||||
? this.#raw.toU8a(isBare)
|
||||
: u8aConcatStrict([
|
||||
new Uint8Array([this.index]),
|
||||
this.#raw.toU8a(isBare)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,8 +80,8 @@ describe('Option', (): void => {
|
||||
|
||||
// watch the hex prefix and length
|
||||
expect(
|
||||
new Option(registry, Bytes, HEX).toHex().substr(6)
|
||||
).toEqual(HEX.substr(2));
|
||||
new Option(registry, Bytes, HEX).toHex().substring(6)
|
||||
).toEqual(HEX.substring(2));
|
||||
});
|
||||
|
||||
it('converts correctly from hex with toNumber (U64)', (): void => {
|
||||
|
||||
@@ -9,6 +9,15 @@ import { assert, isCodec, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot
|
||||
import { typeToConstructor } from '../utils';
|
||||
import { Null } from './Null';
|
||||
|
||||
interface Options<T> {
|
||||
definition?: CodecClass<T>;
|
||||
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
|
||||
}
|
||||
|
||||
function noopSetDefinition <T extends Codec> (d: CodecClass<T>): CodecClass<T> {
|
||||
return d;
|
||||
}
|
||||
|
||||
class None extends Null {
|
||||
/**
|
||||
* @description Returns the base runtime type name for this instance
|
||||
@@ -60,8 +69,8 @@ export class Option<T extends Codec> implements IOption<T> {
|
||||
|
||||
readonly #raw: T;
|
||||
|
||||
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown) {
|
||||
const Type = typeToConstructor(registry, typeName);
|
||||
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown, { definition, setDefinition = noopSetDefinition }: Options<T> = {}) {
|
||||
const Type = definition || setDefinition(typeToConstructor(registry, typeName));
|
||||
const decoded = isU8a(value) && value.length && !isCodec(value)
|
||||
? value[0] === 0
|
||||
? new None(registry)
|
||||
@@ -78,9 +87,17 @@ export class Option<T extends Codec> implements IOption<T> {
|
||||
}
|
||||
|
||||
public static with<O extends Codec> (Type: CodecClass<O> | string): CodecClass<Option<O>> {
|
||||
let definition: CodecClass<O> | undefined;
|
||||
|
||||
const setDefinition = <T> (d: CodecClass<T>): CodecClass<T> => {
|
||||
definition = d as unknown as CodecClass<O>;
|
||||
|
||||
return d;
|
||||
};
|
||||
|
||||
return class extends Option<O> {
|
||||
constructor (registry: Registry, value?: unknown) {
|
||||
super(registry, Type, value);
|
||||
super(registry, Type, value, { definition, setDefinition });
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -131,7 +148,7 @@ export class Option<T extends Codec> implements IOption<T> {
|
||||
/**
|
||||
* @description The actual value for the Option
|
||||
*/
|
||||
public get value (): Codec {
|
||||
public get value (): T {
|
||||
return this.#raw;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,47 +3,49 @@
|
||||
|
||||
import type { AnyTupleValue, Codec, CodecClass, Inspect, ITuple, Registry } from '../types';
|
||||
|
||||
import { isFunction, isHex, isString, isU8a, stringify, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
import { isFunction, isHex, isString, isU8a, stringify, u8aConcatStrict, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { AbstractArray } from '../abstract/AbstractArray';
|
||||
import { decodeU8a, mapToTypeMap, typeToConstructor } from '../utils';
|
||||
|
||||
type TupleCodecClasss = CodecClass[] | {
|
||||
[index: string]: CodecClass;
|
||||
};
|
||||
|
||||
type TupleType = (CodecClass | string);
|
||||
|
||||
type TupleTypes = TupleType[] | {
|
||||
[index: string]: CodecClass | string;
|
||||
};
|
||||
|
||||
type Definition = [CodecClass[], string[]];
|
||||
|
||||
interface Options {
|
||||
definition?: Definition;
|
||||
setDefinition?: (d: Definition) => Definition;
|
||||
}
|
||||
|
||||
function noopSetDefinition (d: Definition): Definition {
|
||||
return d;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeTuple (registry: Registry, Classes: TupleCodecClasss, value?: AnyTupleValue): [Codec[], number] {
|
||||
function decodeTuple (registry: Registry, result: Codec[], Classes: Definition, value?: Exclude<AnyTupleValue, Uint8Array>): [Codec[], number] {
|
||||
if (isU8a(value) || isHex(value)) {
|
||||
return decodeU8a(registry, u8aToU8a(value), Classes);
|
||||
return decodeU8a(registry, result, u8aToU8a(value), Classes);
|
||||
}
|
||||
|
||||
const Types: CodecClass[] = Array.isArray(Classes)
|
||||
? Classes
|
||||
: Object.values(Classes);
|
||||
const Types = Classes[0];
|
||||
|
||||
return [
|
||||
Types.map((Type, index): Codec => {
|
||||
try {
|
||||
const entry = value?.[index];
|
||||
for (let i = 0; i < Types.length; i++) {
|
||||
try {
|
||||
const entry = value?.[i];
|
||||
|
||||
if (entry instanceof Type) {
|
||||
return entry;
|
||||
}
|
||||
result[i] = entry instanceof Types[i]
|
||||
? entry
|
||||
: new Types[i](registry, entry);
|
||||
} catch (error) {
|
||||
throw new Error(`Tuple: failed on ${i}:: ${(error as Error).message}`);
|
||||
}
|
||||
}
|
||||
|
||||
return new Type(registry, entry);
|
||||
} catch (error) {
|
||||
throw new Error(`Tuple: failed on ${index}:: ${(error as Error).message}`);
|
||||
}
|
||||
}),
|
||||
0
|
||||
];
|
||||
return [result, 0];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,27 +55,39 @@ function decodeTuple (registry: Registry, Classes: TupleCodecClasss, value?: Any
|
||||
* own type. It extends the base JS `Array` object.
|
||||
*/
|
||||
export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
|
||||
#Types: TupleCodecClasss;
|
||||
readonly initialU8aLength?: number;
|
||||
|
||||
constructor (registry: Registry, Types: TupleTypes | TupleType, value?: AnyTupleValue) {
|
||||
const Classes = Array.isArray(Types)
|
||||
? Types.map((t) => typeToConstructor(registry, t))
|
||||
: isFunction(Types) || isString(Types)
|
||||
? [typeToConstructor(registry, Types)]
|
||||
: mapToTypeMap(registry, Types);
|
||||
const [values, decodedLength] = isU8a(value)
|
||||
? decodeU8a(registry, value, Classes)
|
||||
: decodeTuple(registry, Classes, value);
|
||||
#Types: Definition;
|
||||
|
||||
super(registry, values, decodedLength);
|
||||
constructor (registry: Registry, Types: TupleTypes | TupleType, value?: AnyTupleValue, { definition, setDefinition = noopSetDefinition }: Options = {}) {
|
||||
const Classes = definition || setDefinition(
|
||||
Array.isArray(Types)
|
||||
? [Types.map((t) => typeToConstructor(registry, t)), []]
|
||||
: isFunction(Types) || isString(Types)
|
||||
? [[typeToConstructor(registry, Types)], []]
|
||||
: mapToTypeMap(registry, Types)
|
||||
);
|
||||
|
||||
super(registry, Classes[0].length);
|
||||
|
||||
const [, decodedLength] = isU8a(value)
|
||||
? decodeU8a(registry, this, value, Classes, false)
|
||||
: decodeTuple(registry, this, Classes, value);
|
||||
|
||||
this.initialU8aLength = decodedLength;
|
||||
this.#Types = Classes;
|
||||
}
|
||||
|
||||
public static with (Types: TupleTypes | TupleType): CodecClass<Tuple> {
|
||||
let definition: Definition | undefined;
|
||||
|
||||
// eslint-disable-next-line no-return-assign
|
||||
const setDefinition = (d: Definition) =>
|
||||
definition = d;
|
||||
|
||||
return class extends Tuple {
|
||||
constructor (registry: Registry, value?: AnyTupleValue) {
|
||||
super(registry, Types, value);
|
||||
super(registry, Types, value, { definition, setDefinition });
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -95,9 +109,9 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
|
||||
* @description The types definition of the tuple
|
||||
*/
|
||||
public get Types (): string[] {
|
||||
return Array.isArray(this.#Types)
|
||||
? this.#Types.map((T) => new T(this.registry).toRawType())
|
||||
: Object.keys(this.#Types);
|
||||
return this.#Types[1].length
|
||||
? this.#Types[1]
|
||||
: this.#Types[0].map((T) => new T(this.registry).toRawType());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,11 +127,7 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
public toRawType (): string {
|
||||
const types = (
|
||||
Array.isArray(this.#Types)
|
||||
? this.#Types
|
||||
: Object.values(this.#Types)
|
||||
).map((T) =>
|
||||
const types = this.#Types[0].map((T) =>
|
||||
this.registry.getClassName(T) || new T(this.registry).toRawType()
|
||||
);
|
||||
|
||||
@@ -137,6 +147,6 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
|
||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||
*/
|
||||
public override toU8a (isBare?: boolean): Uint8Array {
|
||||
return u8aConcat(...this.toU8aInner(isBare));
|
||||
return u8aConcatStrict(this.toU8aInner(isBare));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ describe('Vec', (): void => {
|
||||
|
||||
it('exposes a working map', (): void => {
|
||||
expect(
|
||||
vector.map((e): string => e.toString().substr(0, 1))
|
||||
vector.map((e): string => e.toString().substring(0, 1))
|
||||
).toEqual(['1', '2', '3', '4', '5']);
|
||||
});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { Codec, CodecClass, Registry } from '../types';
|
||||
|
||||
import { assert, compactFromU8a, logger, u8aToU8a } from '@polkadot/util';
|
||||
import { assert, compactFromU8aLim, isU8a, logger, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { AbstractArray } from '../abstract/AbstractArray';
|
||||
import { decodeU8aVec, typeToConstructor } from '../utils';
|
||||
@@ -13,11 +13,33 @@ const MAX_LENGTH = 64 * 1024;
|
||||
|
||||
const l = logger('Vec');
|
||||
|
||||
export function decodeVec<T extends Codec> (registry: Registry, Type: CodecClass<T>, value: Uint8Array | HexString | unknown[], length = -1): [T[], number, number] {
|
||||
if (Array.isArray(value)) {
|
||||
const result = new Array<T>(value.length);
|
||||
interface Options<T> {
|
||||
definition?: CodecClass<T>;
|
||||
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
|
||||
}
|
||||
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
function noopSetDefinition <T extends Codec> (d: CodecClass<T>): CodecClass<T> {
|
||||
return d;
|
||||
}
|
||||
|
||||
function decodeVecLength (value: Uint8Array | HexString | unknown[]): [Uint8Array | unknown[], number, number] {
|
||||
if (Array.isArray(value)) {
|
||||
return [value, value.length, 0];
|
||||
}
|
||||
|
||||
const u8a = u8aToU8a(value);
|
||||
const [startAt, length] = compactFromU8aLim(u8a);
|
||||
|
||||
assert(length <= MAX_LENGTH, () => `Vec length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
|
||||
return [u8a, length, startAt];
|
||||
}
|
||||
|
||||
export function decodeVec<T extends Codec> (registry: Registry, result: T[], value: Uint8Array | HexString | unknown[], startAt: number, Type: CodecClass<T>): [number, number] {
|
||||
if (Array.isArray(value)) {
|
||||
const count = result.length;
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
const entry = value[i];
|
||||
|
||||
try {
|
||||
@@ -31,22 +53,10 @@ export function decodeVec<T extends Codec> (registry: Registry, Type: CodecClass
|
||||
}
|
||||
}
|
||||
|
||||
return [result, 0, 0];
|
||||
return [0, 0];
|
||||
}
|
||||
|
||||
const u8a = u8aToU8a(value);
|
||||
let offset = 0;
|
||||
|
||||
if (length === -1) {
|
||||
const [_offset, _length] = compactFromU8a(u8a);
|
||||
|
||||
assert(_length.lten(MAX_LENGTH), () => `Vec length ${_length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
|
||||
length = _length.toNumber();
|
||||
offset = _offset;
|
||||
}
|
||||
|
||||
return decodeU8aVec(registry, u8a, offset, Type, length);
|
||||
return decodeU8aVec(registry, result, u8aToU8a(value), startAt, Type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,21 +67,34 @@ export function decodeVec<T extends Codec> (registry: Registry, Type: CodecClass
|
||||
* specific encoding/decoding on top of the base type.
|
||||
*/
|
||||
export class Vec<T extends Codec> extends AbstractArray<T> {
|
||||
readonly initialU8aLength?: number;
|
||||
|
||||
#Type: CodecClass<T>;
|
||||
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, value: Uint8Array | HexString | unknown[] = []) {
|
||||
const Clazz = typeToConstructor<T>(registry, Type);
|
||||
const [values, decodedLength] = decodeVec(registry, Clazz, value);
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, value: Uint8Array | HexString | unknown[] = [], { definition, setDefinition = noopSetDefinition }: Options<T> = {}) {
|
||||
const [decodeFrom, length, startAt] = decodeVecLength(value);
|
||||
|
||||
super(registry, values, decodedLength);
|
||||
super(registry, length);
|
||||
|
||||
this.#Type = Clazz;
|
||||
this.#Type = definition || setDefinition(typeToConstructor<T>(registry, Type));
|
||||
|
||||
const [decodedLength] = isU8a(decodeFrom)
|
||||
? decodeU8aVec(registry, this, decodeFrom, startAt, this.#Type)
|
||||
: decodeVec(registry, this, decodeFrom, startAt, this.#Type);
|
||||
|
||||
this.initialU8aLength = decodedLength;
|
||||
}
|
||||
|
||||
public static with<O extends Codec> (Type: CodecClass<O> | string): CodecClass<Vec<O>> {
|
||||
let definition: CodecClass<O> | undefined;
|
||||
|
||||
// eslint-disable-next-line no-return-assign
|
||||
const setDefinition = <T> (d: CodecClass<T>) =>
|
||||
(definition = d as unknown as CodecClass<O>) as unknown as CodecClass<T>;
|
||||
|
||||
return class extends Vec<O> {
|
||||
constructor (registry: Registry, value?: any[]) {
|
||||
super(registry, Type, value);
|
||||
super(registry, Type, value, { definition, setDefinition });
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,23 +4,19 @@
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { Codec, CodecClass, Inspect, Registry } from '../types';
|
||||
|
||||
import { assert, isU8a, u8aConcat } from '@polkadot/util';
|
||||
import { isU8a, u8aConcatStrict } from '@polkadot/util';
|
||||
|
||||
import { AbstractArray } from '../abstract/AbstractArray';
|
||||
import { decodeU8aVec, typeToConstructor } from '../utils';
|
||||
import { decodeVec } from './Vec';
|
||||
|
||||
/** @internal */
|
||||
function decodeVecFixed<T extends Codec> (registry: Registry, value: Uint8Array | HexString | unknown[], Type: CodecClass<T>, length: number): [T[], number, number] {
|
||||
const [values, decodedLength, decodedLengthNoOffset] = decodeVec(registry, Type, value, length);
|
||||
interface Options<T> {
|
||||
definition?: CodecClass<T>;
|
||||
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
|
||||
}
|
||||
|
||||
while (values.length < length) {
|
||||
values.push(new Type(registry));
|
||||
}
|
||||
|
||||
assert(values.length === length, () => `Expected a length of exactly ${length} entries`);
|
||||
|
||||
return [values, decodedLength, decodedLengthNoOffset];
|
||||
function noopSetDefinition <T extends Codec> (d: CodecClass<T>): CodecClass<T> {
|
||||
return d;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,23 +25,32 @@ function decodeVecFixed<T extends Codec> (registry: Registry, value: Uint8Array
|
||||
* This manages codec arrays of a fixed length
|
||||
*/
|
||||
export class VecFixed<T extends Codec> extends AbstractArray<T> {
|
||||
readonly initialU8aLength?: number;
|
||||
|
||||
#Type: CodecClass<T>;
|
||||
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, length: number, value: Uint8Array | HexString | unknown[] = [] as unknown[]) {
|
||||
const Clazz = typeToConstructor<T>(registry, Type);
|
||||
const [values,, decodedLengthNoOffset] = isU8a(value)
|
||||
? decodeU8aVec(registry, value, 0, Clazz, length)
|
||||
: decodeVecFixed(registry, value, Clazz, length);
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, length: number, value: Uint8Array | HexString | unknown[] = [] as unknown[], { definition, setDefinition = noopSetDefinition }: Options<T> = {}) {
|
||||
super(registry, length);
|
||||
|
||||
super(registry, values, decodedLengthNoOffset);
|
||||
this.#Type = definition || setDefinition(typeToConstructor<T>(registry, Type));
|
||||
|
||||
this.#Type = Clazz;
|
||||
const [, decodedLengthNoOffset] = isU8a(value)
|
||||
? decodeU8aVec(registry, this, value, 0, this.#Type)
|
||||
: decodeVec(registry, this, value, 0, this.#Type);
|
||||
|
||||
this.initialU8aLength = decodedLengthNoOffset;
|
||||
}
|
||||
|
||||
public static with<O extends Codec> (Type: CodecClass<O> | string, length: number): CodecClass<VecFixed<O>> {
|
||||
let definition: CodecClass<O> | undefined;
|
||||
|
||||
// eslint-disable-next-line no-return-assign
|
||||
const setDefinition = <T> (d: CodecClass<T>) =>
|
||||
(definition = d as unknown as CodecClass<O>) as unknown as CodecClass<T>;
|
||||
|
||||
return class extends VecFixed<O> {
|
||||
constructor (registry: Registry, value?: any[]) {
|
||||
super(registry, Type, length, value);
|
||||
super(registry, Type, length, value, { definition, setDefinition });
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -85,7 +90,7 @@ export class VecFixed<T extends Codec> extends AbstractArray<T> {
|
||||
const encoded = this.toU8aInner();
|
||||
|
||||
return encoded.length
|
||||
? u8aConcat(...encoded)
|
||||
? u8aConcatStrict(encoded)
|
||||
: new Uint8Array([]);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,27 +4,28 @@
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, Inspect, ISet, IU8a, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isHex, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { compactFromU8aLim, compactToU8a, isHex, isU8a, logger, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { compareSet, decodeU8aVec, sortSet, typeToConstructor } from '../utils';
|
||||
|
||||
const l = logger('BTreeSet');
|
||||
|
||||
/** @internal */
|
||||
function decodeSetFromU8a<V extends Codec> (registry: Registry, ValClass: CodecClass<V>, u8a: Uint8Array): [Set<V>, number] {
|
||||
function decodeSetFromU8a<V extends Codec> (registry: Registry, ValClass: CodecClass<V>, u8a: Uint8Array): [CodecClass<V>, Set<V>, number] {
|
||||
const output = new Set<V>();
|
||||
const [offset, length] = compactFromU8a(u8a);
|
||||
const [values, decodedLength] = decodeU8aVec(registry, u8a, offset, ValClass, length.toNumber());
|
||||
const [offset, count] = compactFromU8aLim(u8a);
|
||||
const result = new Array<V>(count);
|
||||
const [decodedLength] = decodeU8aVec(registry, result, u8a, offset, ValClass);
|
||||
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
output.add(values[i]);
|
||||
for (let i = 0; i < count; i++) {
|
||||
output.add(result[i] as unknown as V);
|
||||
}
|
||||
|
||||
return [output, decodedLength];
|
||||
return [ValClass, output, decodedLength];
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeSetFromSet<V extends Codec> (registry: Registry, ValClass: CodecClass<V>, value: Set<any> | string[]): [Set<V>, number] {
|
||||
function decodeSetFromSet<V extends Codec> (registry: Registry, ValClass: CodecClass<V>, value: Set<any> | string[]): [CodecClass<V>, Set<V>, number] {
|
||||
const output = new Set<V>();
|
||||
|
||||
value.forEach((val: any) => {
|
||||
@@ -37,7 +38,7 @@ function decodeSetFromSet<V extends Codec> (registry: Registry, ValClass: CodecC
|
||||
}
|
||||
});
|
||||
|
||||
return [output, 0];
|
||||
return [ValClass, output, 0];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,14 +55,12 @@ function decodeSetFromSet<V extends Codec> (registry: Registry, ValClass: CodecC
|
||||
* @param jsonSet
|
||||
* @internal
|
||||
*/
|
||||
function decodeSet<V extends Codec> (registry: Registry, valType: CodecClass<V> | string, value?: Uint8Array | string | string[] | Set<any>): [Set<V>, number] {
|
||||
if (!value) {
|
||||
return [new Set<V>(), 0];
|
||||
}
|
||||
|
||||
function decodeSet<V extends Codec> (registry: Registry, valType: CodecClass<V> | string, value?: Uint8Array | string | string[] | Set<any>): [CodecClass<V>, Set<V>, number] {
|
||||
const ValClass = typeToConstructor(registry, valType);
|
||||
|
||||
if (isU8a(value) || isHex(value)) {
|
||||
if (!value) {
|
||||
return [ValClass, new Set<V>(), 0];
|
||||
} else if (isU8a(value) || isHex(value)) {
|
||||
return decodeSetFromU8a<V>(registry, ValClass, u8aToU8a(value));
|
||||
} else if (Array.isArray(value) || value instanceof Set) {
|
||||
return decodeSetFromSet<V>(registry, ValClass, value);
|
||||
@@ -80,13 +79,13 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V>
|
||||
readonly #ValClass: CodecClass<V>;
|
||||
|
||||
constructor (registry: Registry, valType: CodecClass<V> | string, rawValue?: Uint8Array | string | string[] | Set<any>) {
|
||||
const [values, decodedLength] = decodeSet(registry, valType, rawValue);
|
||||
const [ValClass, values, decodedLength] = decodeSet(registry, valType, rawValue);
|
||||
|
||||
super(sortSet(values));
|
||||
|
||||
this.registry = registry;
|
||||
this.initialU8aLength = decodedLength;
|
||||
this.#ValClass = typeToConstructor(registry, valType);
|
||||
this.#ValClass = ValClass;
|
||||
}
|
||||
|
||||
public static with<V extends Codec> (valType: CodecClass<V> | string): CodecClass<BTreeSet<V>> {
|
||||
@@ -216,6 +215,6 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V>
|
||||
encoded.push(v.toU8a(isBare));
|
||||
}
|
||||
|
||||
return u8aConcat(...encoded);
|
||||
return u8aConcatStrict(encoded);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { AnyU8a, Inspect, Registry } from '../types';
|
||||
|
||||
import { assert, compactFromU8a, compactToU8a, isString, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
import { assert, compactFromU8aLim, compactToU8a, isString, u8aConcatStrict, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { Raw } from '../native/Raw';
|
||||
|
||||
@@ -14,12 +14,12 @@ function decodeBitVecU8a (value?: Uint8Array): [number, Uint8Array] {
|
||||
}
|
||||
|
||||
// handle all other Uint8Array inputs, these do have a length prefix which is the number of bits encoded
|
||||
const [offset, length] = compactFromU8a(value);
|
||||
const total = offset + Math.ceil(length.toNumber() / 8);
|
||||
const [offset, length] = compactFromU8aLim(value);
|
||||
const total = offset + Math.ceil(length / 8);
|
||||
|
||||
assert(total <= value.length, () => `BitVec: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
|
||||
return [length.toNumber(), value.subarray(offset, total)];
|
||||
return [length, value.subarray(offset, total)];
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
@@ -96,6 +96,6 @@ export class BitVec extends Raw {
|
||||
|
||||
return isBare
|
||||
? bitVec
|
||||
: u8aConcat(compactToU8a(this.#decodedLength), bitVec);
|
||||
: u8aConcatStrict([compactToU8a(this.#decodedLength), bitVec]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { AnyU8a, Inspect, Registry } from '../types';
|
||||
|
||||
import { assert, compactAddLength, compactFromU8a, compactToU8a, isString, isU8a, u8aToU8a } from '@polkadot/util';
|
||||
import { assert, compactAddLength, compactFromU8aLim, compactToU8a, isCodec, isString, isU8a, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { Raw } from '../native/Raw';
|
||||
|
||||
@@ -17,28 +17,15 @@ function decodeBytesU8a (value: Uint8Array): [Uint8Array, number] {
|
||||
}
|
||||
|
||||
// handle all other Uint8Array inputs, these do have a length prefix
|
||||
const [offset, length] = compactFromU8a(value);
|
||||
const total = offset + length.toNumber();
|
||||
const [offset, length] = compactFromU8aLim(value);
|
||||
const total = offset + length;
|
||||
|
||||
assert(length.lten(MAX_LENGTH), () => `Bytes length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(length <= MAX_LENGTH, () => `Bytes length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(total <= value.length, () => `Bytes: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
|
||||
return [value.subarray(offset, total), total];
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeBytes (value?: AnyU8a): [Uint8Array | undefined, number] {
|
||||
if (Array.isArray(value) || isString(value)) {
|
||||
return [u8aToU8a(value), 0];
|
||||
} else if (!(value instanceof Raw) && isU8a(value)) {
|
||||
// We are ensuring we are not a Raw instance. In the case of a Raw we already have gotten
|
||||
// rid of the length, i.e. new Bytes(new Bytes(...)) will work as expected
|
||||
return decodeBytesU8a(value);
|
||||
}
|
||||
|
||||
return [value, 0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Bytes
|
||||
* @description
|
||||
@@ -48,7 +35,11 @@ function decodeBytes (value?: AnyU8a): [Uint8Array | undefined, number] {
|
||||
*/
|
||||
export class Bytes extends Raw {
|
||||
constructor (registry: Registry, value?: AnyU8a) {
|
||||
const [u8a, decodedLength] = decodeBytes(value);
|
||||
const [u8a, decodedLength] = isU8a(value) && !(isCodec(value) && value instanceof Raw)
|
||||
? decodeBytesU8a(value)
|
||||
: Array.isArray(value) || isString(value)
|
||||
? [u8aToU8a(value), 0]
|
||||
: [value, 0];
|
||||
|
||||
super(registry, u8a, decodedLength);
|
||||
}
|
||||
@@ -63,13 +54,15 @@ export class Bytes extends Raw {
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
override inspect (): Inspect {
|
||||
override inspect (isBare?: boolean): Inspect {
|
||||
const clength = compactToU8a(this.length);
|
||||
|
||||
return {
|
||||
outer: this.length
|
||||
? [clength, super.toU8a()]
|
||||
: [clength]
|
||||
outer: isBare
|
||||
? [super.toU8a()]
|
||||
: this.length
|
||||
? [clength, super.toU8a()]
|
||||
: [clength]
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, IMap, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { compactFromU8aLim, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { AbstractArray } from '../abstract/AbstractArray';
|
||||
import { Enum } from '../base/Enum';
|
||||
@@ -14,27 +14,26 @@ import { compareMap, decodeU8a, sortMap, typeToConstructor } from '../utils';
|
||||
const l = logger('Map');
|
||||
|
||||
/** @internal */
|
||||
function decodeMapFromU8a<K extends Codec, V extends Codec> (registry: Registry, KeyClass: CodecClass<K>, ValClass: CodecClass<V>, u8a: Uint8Array): [Map<K, V>, number] {
|
||||
function decodeMapFromU8a<K extends Codec, V extends Codec> (registry: Registry, KeyClass: CodecClass<K>, ValClass: CodecClass<V>, u8a: Uint8Array): [CodecClass<K>, CodecClass<V>, Map<K, V>, number] {
|
||||
const output = new Map<K, V>();
|
||||
const [offset, length] = compactFromU8a(u8a);
|
||||
const count = length.toNumber();
|
||||
const [offset, count] = compactFromU8aLim(u8a);
|
||||
const types = [];
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
types.push(KeyClass, ValClass);
|
||||
}
|
||||
|
||||
const [values, decodedLength] = decodeU8a(registry, u8a.subarray(offset), types);
|
||||
const [values, decodedLength] = decodeU8a(registry, new Array(types.length), u8a.subarray(offset), [types, []]);
|
||||
|
||||
for (let i = 0; i < values.length; i += 2) {
|
||||
output.set(values[i] as K, values[i + 1] as V);
|
||||
}
|
||||
|
||||
return [output, offset + decodedLength];
|
||||
return [KeyClass, ValClass, output, offset + decodedLength];
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeMapFromMap<K extends Codec, V extends Codec> (registry: Registry, KeyClass: CodecClass<K>, ValClass: CodecClass<V>, value: Map<any, any>): [Map<K, V>, number] {
|
||||
function decodeMapFromMap<K extends Codec, V extends Codec> (registry: Registry, KeyClass: CodecClass<K>, ValClass: CodecClass<V>, value: Map<any, any>): [CodecClass<K>, CodecClass<V>, Map<K, V>, number] {
|
||||
const output = new Map<K, V>();
|
||||
|
||||
for (const [key, val] of value.entries()) {
|
||||
@@ -58,7 +57,7 @@ function decodeMapFromMap<K extends Codec, V extends Codec> (registry: Registry,
|
||||
}
|
||||
}
|
||||
|
||||
return [output, 0];
|
||||
return [KeyClass, ValClass, output, 0];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,12 +75,12 @@ function decodeMapFromMap<K extends Codec, V extends Codec> (registry: Registry,
|
||||
* @param jsonMap
|
||||
* @internal
|
||||
*/
|
||||
function decodeMap<K extends Codec, V extends Codec> (registry: Registry, keyType: CodecClass<K> | string, valType: CodecClass<V> | string, value?: Uint8Array | string | Map<any, any>): [Map<K, V>, number] {
|
||||
function decodeMap<K extends Codec, V extends Codec> (registry: Registry, keyType: CodecClass<K> | string, valType: CodecClass<V> | string, value?: Uint8Array | string | Map<any, any>): [CodecClass<K>, CodecClass<V>, Map<K, V>, number] {
|
||||
const KeyClass = typeToConstructor(registry, keyType);
|
||||
const ValClass = typeToConstructor(registry, valType);
|
||||
|
||||
if (!value) {
|
||||
return [new Map<K, V>(), 0];
|
||||
return [KeyClass, ValClass, new Map<K, V>(), 0];
|
||||
} else if (isU8a(value) || isHex(value)) {
|
||||
return decodeMapFromU8a<K, V>(registry, KeyClass, ValClass, u8aToU8a(value));
|
||||
} else if (value instanceof Map) {
|
||||
@@ -107,14 +106,14 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
|
||||
readonly #type: string;
|
||||
|
||||
constructor (registry: Registry, keyType: CodecClass<K> | string, valType: CodecClass<V> | string, rawValue: Uint8Array | string | Map<any, any> | undefined, type: 'BTreeMap' | 'HashMap' = 'HashMap') {
|
||||
const [decoded, decodedLength] = decodeMap(registry, keyType, valType, rawValue);
|
||||
const [KeyClass, ValClass, decoded, decodedLength] = decodeMap(registry, keyType, valType, rawValue);
|
||||
|
||||
super(type === 'BTreeMap' ? sortMap(decoded) : decoded);
|
||||
|
||||
this.registry = registry;
|
||||
this.initialU8aLength = decodedLength;
|
||||
this.#KeyClass = typeToConstructor(registry, keyType);
|
||||
this.#ValClass = typeToConstructor(registry, valType);
|
||||
this.#KeyClass = KeyClass;
|
||||
this.#ValClass = ValClass;
|
||||
this.#type = type;
|
||||
}
|
||||
|
||||
@@ -231,6 +230,6 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
|
||||
encoded.push(k.toU8a(isBare), v.toU8a(isBare));
|
||||
}
|
||||
|
||||
return u8aConcat(...encoded);
|
||||
return u8aConcatStrict(encoded);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { OptionBool } from '@polkadot/types-codec';
|
||||
|
||||
describe('OptionBool', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
describe('decodes', (): void => {
|
||||
it('decodes none', (): void => {
|
||||
expect(new OptionBool(registry).toJSON()).toEqual(null);
|
||||
});
|
||||
|
||||
it('decodes true', (): void => {
|
||||
expect(new OptionBool(registry, true).toJSON()).toEqual(true);
|
||||
});
|
||||
|
||||
it('decodes false', (): void => {
|
||||
expect(new OptionBool(registry, false).toJSON()).toEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('encodes', (): void => {
|
||||
it('encodes none', (): void => {
|
||||
expect(new OptionBool(registry).toU8a()).toEqual(new Uint8Array([0]));
|
||||
});
|
||||
|
||||
it('encodes true', (): void => {
|
||||
expect(new OptionBool(registry, true).toU8a()).toEqual(new Uint8Array([1]));
|
||||
});
|
||||
|
||||
it('encodes false', (): void => {
|
||||
expect(new OptionBool(registry, false).toU8a()).toEqual(new Uint8Array([2]));
|
||||
});
|
||||
});
|
||||
|
||||
it('has a sane toRawType representation', (): void => {
|
||||
expect(new OptionBool(registry).toRawType()).toEqual('Option<bool>');
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(new OptionBool(registry, true).inspect()).toEqual({
|
||||
outer: [new Uint8Array([1])]
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,98 @@
|
||||
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyBool, Inspect, Registry } from '../types';
|
||||
|
||||
import { isHex, isU8a, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { Option } from '../base/Option';
|
||||
import { bool as Bool } from '../native/Bool';
|
||||
|
||||
function decodeU8a (registry: Registry, value: Uint8Array): null | Bool {
|
||||
// Encoded as -
|
||||
// - 0 = None
|
||||
// - 1 = True
|
||||
// - 2 = False
|
||||
return value[0] === 0
|
||||
? null
|
||||
: new Bool(registry, value[0] === 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @name OptionBool
|
||||
* @description A specific implementation of Option<bool> than allows for single-byte encoding
|
||||
*/
|
||||
export class OptionBool extends Option<Bool> {
|
||||
constructor (registry: Registry, value?: Option<Bool> | AnyBool | Uint8Array | HexString | null) {
|
||||
super(
|
||||
registry,
|
||||
Bool,
|
||||
isU8a(value) || isHex(value)
|
||||
? decodeU8a(registry, u8aToU8a(value))
|
||||
: value
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The length of the value when encoded as a Uint8Array
|
||||
*/
|
||||
public override get encodedLength (): number {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The length of the initial encoded value (Only available when constructed from a Uint8Array)
|
||||
*/
|
||||
public override get initialU8aLength (): number {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Checks if the value is an empty value (always false)
|
||||
*/
|
||||
public get isFalse (): boolean {
|
||||
return this.isSome
|
||||
? !this.value.valueOf()
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Checks if the value is an empty value (always false)
|
||||
*/
|
||||
public get isTrue (): boolean {
|
||||
return this.isSome
|
||||
? this.value.valueOf()
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
override inspect (): Inspect {
|
||||
return { outer: [this.toU8a()] };
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
public override toRawType (isBare?: boolean): string {
|
||||
return isBare
|
||||
? 'bool'
|
||||
: 'Option<bool>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||
*/
|
||||
public override toU8a (isBare?: boolean): Uint8Array {
|
||||
if (isBare) {
|
||||
return super.toU8a(true);
|
||||
}
|
||||
|
||||
return this.isSome
|
||||
? new Uint8Array([this.isTrue ? 1 : 2])
|
||||
: new Uint8Array([0]);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export { Bytes } from './Bytes';
|
||||
export { HashMap } from './HashMap';
|
||||
export { Linkage } from './Linkage';
|
||||
export { CodecMap, CodecMap as Map } from './Map';
|
||||
export { OptionBool } from './OptionBool';
|
||||
export { Range } from './Range';
|
||||
export { RangeInclusive } from './RangeInclusive';
|
||||
export { Type } from './Type';
|
||||
|
||||
@@ -2,21 +2,10 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { Codec, Inspect, IU8a, Registry } from '../types';
|
||||
import type { AnyBool, Codec, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { isU8a, u8aToHex } from '@polkadot/util';
|
||||
|
||||
/** @internal */
|
||||
function decodeBool (value: any): boolean {
|
||||
if (isU8a(value)) {
|
||||
return value[0] === 1;
|
||||
} else if (value instanceof Boolean) {
|
||||
return value.valueOf();
|
||||
}
|
||||
|
||||
return !!value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name bool
|
||||
* @description
|
||||
@@ -28,9 +17,14 @@ export class bool extends Boolean implements Codec {
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
constructor (registry: Registry, value: bool | Boolean | Uint8Array | boolean | number = false) {
|
||||
super(decodeBool(value));
|
||||
constructor (registry: Registry, value: bool | AnyBool | Uint8Array | number = false) {
|
||||
super(
|
||||
isU8a(value)
|
||||
? value[0] === 1
|
||||
: value instanceof Boolean
|
||||
? value.valueOf()
|
||||
: !!value
|
||||
);
|
||||
|
||||
this.registry = registry;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ const BITLENGTH: UIntBitLength = 64;
|
||||
|
||||
function decodeDate (value: CodecDate | Date | AnyNumber): Date {
|
||||
if (isU8a(value)) {
|
||||
value = u8aToBn(value.subarray(0, BITLENGTH / 8), true);
|
||||
value = u8aToBn(value.subarray(0, BITLENGTH / 8));
|
||||
} else if (value instanceof Date) {
|
||||
return value;
|
||||
} else if (isString(value)) {
|
||||
|
||||
@@ -111,8 +111,8 @@ export class CodecSet extends Set<string> implements ISet<string> {
|
||||
}
|
||||
|
||||
return class extends CodecSet {
|
||||
constructor (registry: Registry, value?: unknown) {
|
||||
super(registry, values, value as undefined, bitLength);
|
||||
constructor (registry: Registry, value?: string[] | Set<string> | Uint8Array | BN | number | string) {
|
||||
super(registry, values, value, bitLength);
|
||||
|
||||
objectProperties(this, isKeys, (_, i) => this.strings.includes(keys[i]));
|
||||
}
|
||||
|
||||
@@ -2,30 +2,40 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, BareOpts, Codec, CodecClass, CodecClassDef, Inspect, IStruct, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, BareOpts, Codec, CodecClass, Inspect, IStruct, IU8a, Registry } from '../types';
|
||||
|
||||
import { assert, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { assert, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { compareMap, decodeU8a, mapToTypeMap, typesToMap } from '../utils';
|
||||
|
||||
type TypesDef<T = Codec> = Record<string, string | CodecClass<T>>;
|
||||
|
||||
type Definition = [CodecClass[], string[]];
|
||||
|
||||
interface Options {
|
||||
definition?: Definition;
|
||||
setDefinition?: (d: Definition) => Definition;
|
||||
}
|
||||
|
||||
function noopSetDefinition (d: Definition): Definition {
|
||||
return d;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeStructFromObject (registry: Registry, Types: CodecClassDef, value: any, jsonMap: Map<string, string>): [Iterable<[string, Codec]>, number] {
|
||||
function decodeStructFromObject (registry: Registry, [Types, keys]: Definition, value: any, jsonMap: Map<string, string>): [Iterable<[string, Codec]>, number] {
|
||||
let jsonObj: Record<string, unknown> | undefined;
|
||||
const inputKeys = Object.keys(Types);
|
||||
const typeofArray = Array.isArray(value);
|
||||
const typeofMap = value instanceof Map;
|
||||
|
||||
assert(typeofArray || typeofMap || isObject(value), () => `Struct: Cannot decode value ${stringify(value)} (typeof ${typeof value}), expected an input object, map or array`);
|
||||
assert(!typeofArray || value.length === inputKeys.length, () => `Struct: Unable to map ${stringify(value)} array to object with known keys ${inputKeys.join(', ')}`);
|
||||
assert(!typeofArray || value.length === keys.length, () => `Struct: Unable to map ${stringify(value)} array to object with known keys ${keys.join(', ')}`);
|
||||
|
||||
const raw = new Array<[string, Codec]>(inputKeys.length);
|
||||
const raw = new Array<[string, Codec]>(keys.length);
|
||||
|
||||
for (let i = 0; i < inputKeys.length; i++) {
|
||||
const key = inputKeys[i];
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
const jsonKey = jsonMap.get(key) || key;
|
||||
const Type = Types[key];
|
||||
const Type = Types[i];
|
||||
let assign: unknown;
|
||||
|
||||
try {
|
||||
@@ -98,17 +108,15 @@ export class Struct<
|
||||
|
||||
readonly #jsonMap: Map<keyof S, string>;
|
||||
|
||||
readonly #Types: CodecClassDef;
|
||||
readonly #Types: Definition;
|
||||
|
||||
constructor (registry: Registry, Types: S, value?: V | Map<unknown, unknown> | unknown[] | HexString | null, jsonMap = new Map<string, string>()) {
|
||||
const typeMap = mapToTypeMap(registry, Types);
|
||||
const [decoded, decodedLength] = isU8a(value)
|
||||
? decodeU8a<Codec, [string, Codec]>(registry, value, typeMap, true)
|
||||
: isHex(value)
|
||||
? decodeU8a<Codec, [string, Codec]>(registry, u8aToU8a(value), typeMap, true)
|
||||
: value instanceof Struct
|
||||
? [value as Iterable<[string, Codec]>, 0]
|
||||
: decodeStructFromObject(registry, typeMap, value || {}, jsonMap);
|
||||
constructor (registry: Registry, Types: S, value?: V | Map<unknown, unknown> | unknown[] | HexString | null, jsonMap = new Map<string, string>(), { definition, setDefinition = noopSetDefinition }: Options = {}) {
|
||||
const typeMap = definition || setDefinition(mapToTypeMap(registry, Types));
|
||||
const [decoded, decodedLength] = isU8a(value) || isHex(value)
|
||||
? decodeU8a<Codec, [string, Codec]>(registry, new Array(typeMap[0].length), u8aToU8a(value), typeMap, true)
|
||||
: value instanceof Struct
|
||||
? [value as Iterable<[string, Codec]>, 0]
|
||||
: decodeStructFromObject(registry, typeMap, value || {}, jsonMap);
|
||||
|
||||
super(decoded);
|
||||
|
||||
@@ -121,9 +129,15 @@ export class Struct<
|
||||
public static with<S extends TypesDef> (Types: S, jsonMap?: Map<string, string>): CodecClass<Struct<S>> {
|
||||
const keys = Object.keys(Types);
|
||||
|
||||
let definition: Definition | undefined;
|
||||
|
||||
// eslint-disable-next-line no-return-assign
|
||||
const setDefinition = (d: Definition) =>
|
||||
definition = d;
|
||||
|
||||
return class extends Struct<S> {
|
||||
constructor (registry: Registry, value?: unknown) {
|
||||
super(registry, Types, value as HexString, jsonMap);
|
||||
super(registry, Types, value as HexString, jsonMap, { definition, setDefinition });
|
||||
|
||||
objectProperties(this, keys, (k) => this.get(k));
|
||||
}
|
||||
@@ -134,7 +148,7 @@ export class Struct<
|
||||
* @description The available keys for this struct
|
||||
*/
|
||||
public get defKeys (): string[] {
|
||||
return Object.keys(this.#Types);
|
||||
return this.#Types[1];
|
||||
}
|
||||
|
||||
public getT <T> (key: string): T {
|
||||
@@ -159,12 +173,10 @@ export class Struct<
|
||||
*/
|
||||
public get Type (): E {
|
||||
const result: Record<string, string> = {};
|
||||
const defs = Object.entries(this.#Types);
|
||||
const [Types, keys] = this.#Types;
|
||||
|
||||
for (let i = 0; i < defs.length; i++) {
|
||||
const [key, Type] = defs[i];
|
||||
|
||||
result[key] = new Type(this.registry).toRawType();
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
result[keys[i]] = new Types[i](this.registry).toRawType();
|
||||
}
|
||||
|
||||
return result as E;
|
||||
@@ -219,12 +231,16 @@ export class Struct<
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
inspect (isBare?: BareOpts): Inspect {
|
||||
const inner = new Array<Inspect>();
|
||||
|
||||
for (const [k, v] of this.entries()) {
|
||||
inner.push({
|
||||
...v.inspect(),
|
||||
...v.inspect(
|
||||
!isBare || isBoolean(isBare)
|
||||
? isBare
|
||||
: isBare[k]
|
||||
),
|
||||
name: stringCamelCase(k as string)
|
||||
});
|
||||
}
|
||||
@@ -309,6 +325,6 @@ export class Struct<
|
||||
}
|
||||
}
|
||||
|
||||
return u8aConcat(...encoded);
|
||||
return u8aConcatStrict(encoded);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyU8a, Codec, Inspect, IU8a, Registry } from '../types';
|
||||
import type { AnyString, AnyU8a, Inspect, IText, IU8a, Registry } from '../types';
|
||||
|
||||
import { assert, compactAddLength, compactFromU8a, compactToU8a, hexToU8a, isHex, isString, isU8a, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util';
|
||||
import { assert, compactAddLength, compactFromU8aLim, compactToU8a, hexToU8a, isHex, isString, isU8a, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util';
|
||||
|
||||
import { Raw } from './Raw';
|
||||
|
||||
const MAX_LENGTH = 128 * 1024;
|
||||
|
||||
/** @internal */
|
||||
function decodeText (value?: null | Text | string | AnyU8a | { toString: () => string }): [string, number] {
|
||||
function decodeText (value?: null | AnyString | AnyU8a | { toString: () => string }): [string, number] {
|
||||
if (isU8a(value)) {
|
||||
if (!value.length) {
|
||||
return ['', 0];
|
||||
@@ -23,10 +23,10 @@ function decodeText (value?: null | Text | string | AnyU8a | { toString: () => s
|
||||
return [u8aToString(value), 0];
|
||||
}
|
||||
|
||||
const [offset, length] = compactFromU8a(value);
|
||||
const total = offset + length.toNumber();
|
||||
const [offset, length] = compactFromU8aLim(value);
|
||||
const total = offset + length;
|
||||
|
||||
assert(length.lten(MAX_LENGTH), () => `Text: length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(length <= MAX_LENGTH, () => `Text: length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(total <= value.length, () => `Text: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
|
||||
return [u8aToString(value.subarray(offset, total)), total];
|
||||
@@ -45,9 +45,7 @@ function decodeText (value?: null | Text | string | AnyU8a | { toString: () => s
|
||||
* object, inheriting all methods exposed from `String`.
|
||||
* @noInheritDoc
|
||||
*/
|
||||
// TODO
|
||||
// - Strings should probably be trimmed (docs do come through with extra padding)
|
||||
export class Text extends String implements Codec {
|
||||
export class Text extends String implements IText {
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
@@ -56,7 +54,7 @@ export class Text extends String implements Codec {
|
||||
|
||||
#override: string | null = null;
|
||||
|
||||
constructor (registry: Registry, value?: null | Text | string | AnyU8a | { toString: () => string }) {
|
||||
constructor (registry: Registry, value?: null | AnyString | AnyU8a | { toString: () => string }) {
|
||||
const [str, decodedLength] = decodeText(value);
|
||||
|
||||
super(str);
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '8.3.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
|
||||
@@ -60,7 +60,7 @@ export interface Codec {
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect;
|
||||
inspect (isBare?: BareOpts): Inspect;
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
||||
@@ -105,8 +105,6 @@ export interface CodecClass<T = Codec> {
|
||||
new(registry: Registry, ...args: any[]): T;
|
||||
}
|
||||
|
||||
export type CodecClassDef<T = Codec> = Record<string, CodecClass<T>>;
|
||||
|
||||
export type CodecTo = 'toHex' | 'toJSON' | 'toString' | 'toU8a';
|
||||
|
||||
export type ArgsDef = Record<string, CodecClass | string>;
|
||||
|
||||
@@ -10,7 +10,11 @@ export type AnyFunction = (...args: any[]) => any;
|
||||
|
||||
export type AnyNumber = BN | bigint | Uint8Array | number | string;
|
||||
|
||||
export type AnyString = string | string;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export type AnyString = String | string;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export type AnyBool = Boolean | boolean;
|
||||
|
||||
export type AnyTuple = Codec[];
|
||||
|
||||
|
||||
@@ -61,6 +61,10 @@ export interface IStruct<K = string, V extends Codec = Codec> extends Map<K, V>,
|
||||
toArray (): Codec[];
|
||||
}
|
||||
|
||||
export interface IText extends String, Codec {
|
||||
// nothing additional
|
||||
}
|
||||
|
||||
export type ITuple<T extends AnyTuple = Codec[]> = T & Codec;
|
||||
|
||||
export interface IU8a extends Uint8Array, Codec {
|
||||
|
||||
@@ -25,22 +25,18 @@ function getRawType (registry: Registry, Type: CodecClass): string | null {
|
||||
* @param result - The result array (will be returned with values pushed)
|
||||
* @param types - The array of CodecClass to decode the U8a against.
|
||||
*/
|
||||
export function decodeU8a <T extends Codec = Codec, E = T> (registry: Registry, u8a: Uint8Array, types: CodecClass[] | { [index: string]: CodecClass }, withZip?: boolean): [E[], number] {
|
||||
const [Types, keys]: [CodecClass[], string[]] = Array.isArray(types)
|
||||
? [types, []]
|
||||
: [Object.values(types), Object.keys(types)];
|
||||
|
||||
const result = new Array<E>(Types.length);
|
||||
export function decodeU8a <T extends Codec = Codec, E = T> (registry: Registry, result: unknown[], u8a: Uint8Array, [Types, keys]: [CodecClass[], string[]], withZip?: boolean): [E[], number] {
|
||||
const count = result.length;
|
||||
let offset = 0;
|
||||
|
||||
for (let i = 0; i < Types.length; i++) {
|
||||
for (let i = 0; i < count; i++) {
|
||||
try {
|
||||
const value = new Types[i](registry, u8a.subarray(offset));
|
||||
|
||||
offset += value.initialU8aLength || value.encodedLength;
|
||||
result[i] = withZip
|
||||
? [keys[i], value] as unknown as E
|
||||
: value as unknown as E;
|
||||
? [keys[i], value]
|
||||
: value;
|
||||
} catch (error) {
|
||||
throw new Error(formatFailure(
|
||||
error as Error,
|
||||
@@ -51,14 +47,14 @@ export function decodeU8a <T extends Codec = Codec, E = T> (registry: Registry,
|
||||
}
|
||||
}
|
||||
|
||||
return [result, offset];
|
||||
return [result as E[], offset];
|
||||
}
|
||||
|
||||
// Split from decodeU8a since this is specialized to 1 instance ... yes duplication, but
|
||||
// since we have to do less checks (and these are intensive anyway), much faster
|
||||
export function decodeU8aVec <T extends Codec = Codec> (registry: Registry, u8a: Uint8Array, start: number, Type: CodecClass<T>, count: number): [T[], number, number] {
|
||||
const result = new Array<T>(count);
|
||||
let offset = start;
|
||||
export function decodeU8aVec <T extends Codec = Codec> (registry: Registry, result: unknown[], u8a: Uint8Array, startAt: number, Type: CodecClass<T>): [number, number] {
|
||||
const count = result.length;
|
||||
let offset = startAt;
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
try {
|
||||
@@ -75,5 +71,5 @@ export function decodeU8aVec <T extends Codec = Codec> (registry: Registry, u8a:
|
||||
}
|
||||
}
|
||||
|
||||
return [result, offset, offset - start];
|
||||
return [offset, offset - startAt];
|
||||
}
|
||||
|
||||
@@ -8,12 +8,14 @@ import { typeToConstructor } from './typeToConstructor';
|
||||
/**
|
||||
* @description takes an input map of the form `{ [string]: string | CodecClass }` and returns a map of `{ [string]: CodecClass }`
|
||||
*/
|
||||
export function mapToTypeMap (registry: Registry, input: Record<string, string | CodecClass>): Record<string, CodecClass> {
|
||||
export function mapToTypeMap (registry: Registry, input: Record<string, string | CodecClass>): [CodecClass[], string[]] {
|
||||
const entries = Object.entries(input);
|
||||
const output: Record<string, CodecClass> = {};
|
||||
const count = entries.length;
|
||||
const output: [CodecClass[], string[]] = [new Array<CodecClass>(count), new Array<string>(count)];
|
||||
|
||||
for (let i = 0; i < entries.length; i++) {
|
||||
output[entries[i][0]] = typeToConstructor(registry, entries[i][1]);
|
||||
output[1][i] = entries[i][0];
|
||||
output[0][i] = typeToConstructor(registry, entries[i][1]);
|
||||
}
|
||||
|
||||
return output;
|
||||
|
||||
@@ -45,9 +45,17 @@ const mappings: Mapper[] = [
|
||||
// flattens tuples with one value, `(AccountId)` -> `AccountId`
|
||||
flattenSingleTuple(),
|
||||
// converts ::Type to Type, <T as Trait<I>>::Proposal -> Proposal
|
||||
removeColons()
|
||||
removeColons(),
|
||||
// remove all trailing spaces - this should always be the last
|
||||
trim()
|
||||
];
|
||||
|
||||
// given a string, trim it
|
||||
export function trim (): Mapper {
|
||||
return (value: string): string =>
|
||||
value.trim();
|
||||
}
|
||||
|
||||
// given a starting index, find the closing >
|
||||
export function findClosing (value: string, start: number): number {
|
||||
let depth = 0;
|
||||
@@ -88,8 +96,8 @@ export function cleanupCompact (): Mapper {
|
||||
if (value[index] === '<') {
|
||||
const end = findClosing(value, index + 1) - 14;
|
||||
|
||||
if (value.substr(end, 14) === ' as HasCompact') {
|
||||
value = `Compact<${value.substr(index + 1, end - index - 1)}>`;
|
||||
if (value.substring(end, end + 14) === ' as HasCompact') {
|
||||
value = `Compact<${value.substring(index + 1, end)}>`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,7 +134,7 @@ function replaceTagWith (value: string, matcher: string, replacer: (inner: strin
|
||||
const start = index + matcher.length;
|
||||
const end = findClosing(value, start);
|
||||
|
||||
value = `${value.substr(0, index)}${replacer(value.substr(start, end - start))}${value.substr(end + 1)}`;
|
||||
value = `${value.substring(0, index)}${replacer(value.substring(start, end))}${value.substring(end + 1)}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +165,7 @@ export function removeColons (): Mapper {
|
||||
index = value.indexOf('::');
|
||||
|
||||
if (index === 0) {
|
||||
value = value.substr(2);
|
||||
value = value.substring(2);
|
||||
} else if (index !== -1) {
|
||||
if (allowNamespaces) {
|
||||
return value;
|
||||
@@ -169,7 +177,7 @@ export function removeColons (): Mapper {
|
||||
start--;
|
||||
}
|
||||
|
||||
value = `${value.substr(0, start + 1)}${value.substr(index + 2)}`;
|
||||
value = `${value.substring(0, start + 1)}${value.substring(index + 2)}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +193,7 @@ export function removeGenerics (): Mapper {
|
||||
const box = ALLOWED_BOXES.find((box): boolean => {
|
||||
const start = index - box.length;
|
||||
|
||||
return (start >= 0 && value.substr(start, box.length) === box) && (
|
||||
return (start >= 0 && value.substring(start, start + box.length) === box) && (
|
||||
// make sure it is stand-alone, i.e. don't catch ElectionResult<...> as Result<...>
|
||||
start === 0 || BOX_PRECEDING.includes(value[start - 1])
|
||||
);
|
||||
@@ -195,7 +203,7 @@ export function removeGenerics (): Mapper {
|
||||
if (!box) {
|
||||
const end = findClosing(value, index + 1);
|
||||
|
||||
value = `${value.substr(0, index)}${value.substr(end + 1)}`;
|
||||
value = `${value.substring(0, index)}${value.substring(end + 1)}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,10 +265,11 @@ const sanitizeMap = new Map<string, string>();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export function sanitize (value: String | string, options?: SanitizeOptions): string {
|
||||
let result = value.toString();
|
||||
const startValue = value.toString();
|
||||
let result = startValue;
|
||||
|
||||
if (!options) {
|
||||
const memoized = sanitizeMap.get(result);
|
||||
const memoized = sanitizeMap.get(startValue);
|
||||
|
||||
if (memoized) {
|
||||
return memoized;
|
||||
@@ -271,10 +280,8 @@ export function sanitize (value: String | string, options?: SanitizeOptions): st
|
||||
result = mappings[i](result, options);
|
||||
}
|
||||
|
||||
result = result.trim();
|
||||
|
||||
if (!options) {
|
||||
sanitizeMap.set(value.toString(), result);
|
||||
sanitizeMap.set(startValue, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -3,14 +3,11 @@
|
||||
|
||||
import type { CodecClass, Registry } from '../types';
|
||||
|
||||
export function typesToMap (registry: Registry, Types: Record<string, CodecClass>): Record<string, string> {
|
||||
const entries = Object.entries(Types);
|
||||
export function typesToMap (registry: Registry, [Types, keys]: [CodecClass[], string[]]): Record<string, string> {
|
||||
const result: Record<string, string> = {};
|
||||
|
||||
for (let i = 0; i < entries.length; i++) {
|
||||
const [key, Type] = entries[i];
|
||||
|
||||
result[key] = registry.getClassName(Type) || new Type(registry).toRawType();
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
result[keys[i]] = registry.getClassName(Types[i]) || new Types[i](registry).toRawType();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.3.2",
|
||||
"version": "8.6.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.9",
|
||||
"@polkadot/types-codec": "8.3.2",
|
||||
"@polkadot/util": "^9.1.1"
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "8.3.2"
|
||||
"@polkadot/types": "8.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,8 +115,16 @@ const infoMapping: Record<TypeDefInfo, (registry: Registry, value: TypeDef) => C
|
||||
[TypeDefInfo.Null]: (registry: Registry, _: TypeDef): CodecClass<Codec> =>
|
||||
Null,
|
||||
|
||||
[TypeDefInfo.Option]: (registry: Registry, value: TypeDef): CodecClass<Codec> =>
|
||||
createWithSub(Option, value),
|
||||
[TypeDefInfo.Option]: (registry: Registry, value: TypeDef): CodecClass<Codec> => {
|
||||
assert(value.sub && !Array.isArray(value.sub), 'Expected type information for Option');
|
||||
|
||||
// NOTE This is opt-in (unhandled), not by default
|
||||
// if (value.sub.type === 'bool') {
|
||||
// return OptionBool;
|
||||
// }
|
||||
|
||||
return createWithSub(Option, value);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Plain]: (registry: Registry, value: TypeDef): CodecClass<Codec> =>
|
||||
registry.getOrUnknown(value.type),
|
||||
@@ -208,10 +216,15 @@ export function getTypeClass<T extends Codec = Codec> (registry: Registry, typeD
|
||||
}
|
||||
|
||||
export function createClassUnsafe<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K): CodecClass<T> {
|
||||
return getTypeClass(
|
||||
registry,
|
||||
registry.isLookupType(type)
|
||||
? registry.lookup.getTypeDef(type)
|
||||
: getTypeDef(type)
|
||||
return (
|
||||
// just retrieve via name, no creation via typeDef
|
||||
registry.getUnsafe(type) ||
|
||||
// we don't have an existing type, create the class via typeDef
|
||||
getTypeClass(
|
||||
registry,
|
||||
registry.isLookupType(type)
|
||||
? registry.lookup.getTypeDef(type)
|
||||
: getTypeDef(type)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,13 +32,11 @@ function checkInstance (created: Codec, matcher: Uint8Array): void {
|
||||
assert(isOk, () => `${rawType}:: Decoded input doesn't match input, received ${u8aToHex(matcher, 512)} (${matcher.length} bytes), created ${u8aToHex(u8a, 512)} (${u8a.length} bytes)`);
|
||||
}
|
||||
|
||||
function checkPedantic (created: Codec, [value]: unknown[], isPedantic = false): void {
|
||||
if (isPedantic) {
|
||||
if (isU8a(value)) {
|
||||
checkInstance(created, value);
|
||||
} else if (isHex(value)) {
|
||||
checkInstance(created, u8aToU8a(value));
|
||||
}
|
||||
function checkPedantic (created: Codec, [value]: unknown[]): void {
|
||||
if (isU8a(value)) {
|
||||
checkInstance(created, value);
|
||||
} else if (isHex(value)) {
|
||||
checkInstance(created, u8aToU8a(value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +45,7 @@ function checkPedantic (created: Codec, [value]: unknown[], isPedantic = false):
|
||||
function initType<T extends Codec> (registry: Registry, Type: CodecClass, params: unknown[] = [], { blockHash, isOptional, isPedantic }: CreateOptions = {}): T {
|
||||
const created = new (isOptional ? Option.with(Type) : Type)(registry, ...params);
|
||||
|
||||
checkPedantic(created, params, isPedantic);
|
||||
isPedantic && checkPedantic(created, params);
|
||||
|
||||
if (blockHash) {
|
||||
created.createdAtHash = createTypeUnsafe<IU8a>(registry, 'Hash', [blockHash]);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user