Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afc4ebcd43 | ||
|
|
a93c4e16d3 | ||
|
|
dd0da859e4 | ||
|
|
7c75f7b923 | ||
|
|
f2e8b7702b | ||
|
|
dc01f6d4a0 | ||
|
|
f023b81b77 | ||
|
|
ebb47f0865 | ||
|
|
e23d44d3f5 | ||
|
|
0a444be04c | ||
|
|
1abb7085d6 | ||
|
|
bda5cda4bf | ||
|
|
fe7e313f21 | ||
|
|
31971b5d2c | ||
|
|
54efaa665d | ||
|
|
ddb435219d | ||
|
|
6ceb381ed0 | ||
|
|
6a82ab1efd | ||
|
|
8e3cef8dbc | ||
|
|
5fcfb1277d | ||
|
|
61ca15c143 | ||
|
|
0930a5e0dc | ||
|
|
03824f4600 | ||
|
|
1e785b50da | ||
|
|
daeb86a7af | ||
|
|
7461527448 | ||
|
|
322ac0861d | ||
|
|
52cd06917d | ||
|
|
767eb1fa15 | ||
|
|
60640b4c6c | ||
|
|
dfd45e866b | ||
|
|
dafa9ccc2c | ||
|
|
aeb76aea9a | ||
|
|
436e48aab2 | ||
|
|
0871458312 | ||
|
|
7edff67240 | ||
|
|
89a2ff2cda | ||
|
|
d0fbecb0c4 | ||
|
|
ed8802e605 | ||
|
|
791e76546a | ||
|
|
804b58139a | ||
|
|
ec746648c7 | ||
|
|
4cd8d5c60b | ||
|
|
df74330b67 | ||
|
|
ea36b6d486 | ||
|
|
a210a7314d | ||
|
|
2d5d8e6713 | ||
|
|
56a3d4ece8 | ||
|
|
3336f5530c | ||
|
|
f96b9c6d19 | ||
|
|
e7996e478a | ||
|
|
a695a486dd | ||
|
|
2a1ff7bb1e | ||
|
|
59b4e41cb6 | ||
|
|
194d65d31b | ||
|
|
10995b5696 | ||
|
|
73e717e665 | ||
|
|
f770f29422 | ||
|
|
a7ad18bd0c | ||
|
|
45d6c00816 | ||
|
|
4d02c78fe2 | ||
|
|
e73a347700 | ||
|
|
ea25189d2f | ||
|
|
99be561a88 | ||
|
|
871429b726 | ||
|
|
b041e7985c | ||
|
|
93ad99c5e9 | ||
|
|
3e41751130 | ||
|
|
697c25a541 | ||
|
|
05cf0cba8a | ||
|
|
d245bc69c9 | ||
|
|
c385ec2047 | ||
|
|
374e69f2fc | ||
|
|
12f2fbdaf5 | ||
|
|
e7e81c62c5 | ||
|
|
7e8f5f6bae | ||
|
|
90f7f375e6 | ||
|
|
e7beb2d46f |
+2
-1
@@ -54,4 +54,5 @@
|
||||
8.0.2
|
||||
8.3.2
|
||||
8.4.2
|
||||
8.6.2
|
||||
8.6.2
|
||||
8.8.2
|
||||
@@ -0,0 +1,50 @@
|
||||
<!--
|
||||
|
||||
For general support, howto, coding and bundling questions, please use the Substrate & Polkadot StackExchange at https://substrate.stackexchange.com/ and get other ecosystem developers involved. This issues in this repository are meant for the tracking of feature requests and bug reports.
|
||||
|
||||
While all issues are looked at non-bug and non-features would take quite a bit longer to get to and may yield less than satisfactory responses in this format.
|
||||
|
||||
Additionally, please ensure you have done a search on the existing and closed issues before logging a new request. This saves time on all sides.
|
||||
|
||||
-->
|
||||
|
||||
|
||||
* **I'm submitting a ...**
|
||||
|
||||
<!--- Try and classify your actual report -->
|
||||
|
||||
- [ ] Bug report
|
||||
- [ ] Feature request
|
||||
- [ ] Support request (please bear the comments above in mind)
|
||||
- [ ] Other
|
||||
|
||||
|
||||
* **What is the current behavior and expected behavior?**
|
||||
|
||||
<!--- If you're describing a bug, tell us what should happen -->
|
||||
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||
|
||||
|
||||
* **What is the motivation for changing the behavior?**
|
||||
|
||||
<!--- Not obligatory, but suggest a motivation for the request -->
|
||||
<!--- or ideas how to implement the addition or change -->
|
||||
|
||||
|
||||
* **Please tell us about your environment:**
|
||||
|
||||
<!--- Include as many relevant details about the environment you experienced the issue in -->
|
||||
<!--- Also snsure that you have tested against the latest stable releases if a bug -->
|
||||
|
||||
- Version:
|
||||
- Environment:
|
||||
|
||||
- [ ] Node.js
|
||||
- [ ] Browser
|
||||
- [ ] Other (limited support for other environments available)
|
||||
|
||||
- Language:
|
||||
|
||||
- [ ] JavaScript
|
||||
- [ ] TypeScript
|
||||
- [ ] Other
|
||||
@@ -1,5 +1,46 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 8.8.2 Jun 14, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Aling historic `DispatchErrorModule` with `U8` variant
|
||||
- Extend lookup type name generation when conflicts arrise
|
||||
- Update to latest Substrate metadata
|
||||
|
||||
|
||||
## 8.8.1 Jun 12, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
- Ensure typegen disconnects from WS endpoint (Thanks to https://github.com/rflechtner)
|
||||
|
||||
Changes:
|
||||
|
||||
- Ensure storage `Option<Option<Type>>` are correctly handled
|
||||
- Cater for named event fields (expose on event data as available)
|
||||
- Expose (partial) `runtimeVersion` on `api.at` interfaces
|
||||
- Add aliases for `DispatchError{U8, U8a}` (default to new `U8a` variant)
|
||||
- Align `DispatchError` definition with latest Substrate
|
||||
- Adjust contracts RPC definitions with `DispatchError` return
|
||||
- Ensure `blockHash` is passed through with `era` sign options
|
||||
- Workaround for default calls on chains with non-standard indexes
|
||||
- Optimization for value returns on merged queries
|
||||
- Update `derive.bagsList` to detect `voterList` pallet
|
||||
- Add Polkadot 9200/9220 & Westend 9230 upgrade blocks
|
||||
|
||||
|
||||
## 8.7.1 Jun 4, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Add internal merge of single storage queries
|
||||
- Expose provider stats on API intrerface via `.stats`
|
||||
- Adjust flag extraction for latest phragmen types
|
||||
- Support for `Range` in typegen for `Enum`
|
||||
- Add Kusama 9220 upgrade block
|
||||
|
||||
|
||||
## 8.6.2 May 30, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
2985 Jaco 8.6.2 (#4876)
|
||||
3023 Jaco 8.8.2 (#4937)
|
||||
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)
|
||||
@@ -88,6 +88,7 @@
|
||||
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
|
||||
1 qiuhao update DeriveCustom type (#2581)
|
||||
1 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505)
|
||||
1 Raphael Flechtner fix: typegen disconnect ws on success (#4901)
|
||||
1 Rocco Musolino remove broken link (#2671)
|
||||
1 satellitex Add BTreeSet<V> Codec (#1639)
|
||||
1 satellitex Add traits replace rules. for invalid cases `::<type>` and `<type>::`. (#885)
|
||||
|
||||
+5
-5
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "commonjs",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
@@ -31,15 +31,15 @@
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.2",
|
||||
"@babel/core": "^7.18.5",
|
||||
"@babel/register": "^7.17.7",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/dev": "^0.66.32",
|
||||
"@polkadot/dev": "^0.67.3",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^27.5.1",
|
||||
"@types/jest": "^28.1.1",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"typescript": "^4.7.2"
|
||||
"typescript": "^4.7.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@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"
|
||||
"@polkadot/api-base": "8.8.2",
|
||||
"@polkadot/rpc-augment": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-augment": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types-support": "8.6.2"
|
||||
"@polkadot/types-support": "8.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
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/api-augment', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -14,34 +14,34 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* An auction ended. All funds become unreserved.
|
||||
**/
|
||||
AuctionClosed: AugmentedEvent<ApiType, [u32]>;
|
||||
AuctionClosed: AugmentedEvent<ApiType, [auctionIndex: u32], { auctionIndex: 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.
|
||||
**/
|
||||
AuctionStarted: AugmentedEvent<ApiType, [u32, u32, u32]>;
|
||||
AuctionStarted: AugmentedEvent<ApiType, [auctionIndex: u32, leasePeriod: u32, ending: u32], { auctionIndex: u32, leasePeriod: u32, ending: u32 }>;
|
||||
/**
|
||||
* A new bid has been accepted as the current winner.
|
||||
**/
|
||||
BidAccepted: AugmentedEvent<ApiType, [AccountId32, u32, u128, u32, u32]>;
|
||||
BidAccepted: AugmentedEvent<ApiType, [bidder: AccountId32, paraId: u32, amount: u128, firstSlot: u32, lastSlot: u32], { bidder: AccountId32, paraId: u32, amount: u128, firstSlot: u32, lastSlot: 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.
|
||||
**/
|
||||
ReserveConfiscated: AugmentedEvent<ApiType, [u32, AccountId32, u128]>;
|
||||
ReserveConfiscated: AugmentedEvent<ApiType, [paraId: u32, leaser: AccountId32, amount: u128], { paraId: u32, leaser: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* Funds were reserved for a winning bid. First balance is the extra amount reserved.
|
||||
* Second is the total.
|
||||
**/
|
||||
Reserved: AugmentedEvent<ApiType, [AccountId32, u128, u128]>;
|
||||
Reserved: AugmentedEvent<ApiType, [bidder: AccountId32, extraReserved: u128, totalAmount: u128], { bidder: AccountId32, extraReserved: u128, totalAmount: u128 }>;
|
||||
/**
|
||||
* Funds were unreserved since bidder is no longer active. `[bidder, amount]`
|
||||
**/
|
||||
Unreserved: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
Unreserved: AugmentedEvent<ApiType, [bidder: AccountId32, amount: u128], { bidder: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* The winning offset was chosen for an auction. This will map into the `Winning` storage map.
|
||||
**/
|
||||
WinningOffset: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
WinningOffset: AugmentedEvent<ApiType, [auctionIndex: u32, blockNumber: u32], { auctionIndex: u32, blockNumber: u32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -51,45 +51,45 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A balance was set by root.
|
||||
**/
|
||||
BalanceSet: AugmentedEvent<ApiType, [AccountId32, u128, u128]>;
|
||||
BalanceSet: AugmentedEvent<ApiType, [who: AccountId32, free: u128, reserved: u128], { who: AccountId32, free: u128, reserved: u128 }>;
|
||||
/**
|
||||
* Some amount was deposited (e.g. for transaction fees).
|
||||
**/
|
||||
Deposit: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
Deposit: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* An account was removed whose balance was non-zero but below ExistentialDeposit,
|
||||
* resulting in an outright loss.
|
||||
**/
|
||||
DustLost: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
DustLost: AugmentedEvent<ApiType, [account: AccountId32, amount: u128], { account: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* An account was created with some free balance.
|
||||
**/
|
||||
Endowed: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
|
||||
/**
|
||||
* Some balance was reserved (moved from free to reserved).
|
||||
**/
|
||||
Reserved: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
Reserved: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* Some balance was moved from the reserve of the first account to the second account.
|
||||
* Final argument indicates the destination balance type.
|
||||
**/
|
||||
ReserveRepatriated: AugmentedEvent<ApiType, [AccountId32, AccountId32, u128, FrameSupportTokensMiscBalanceStatus]>;
|
||||
ReserveRepatriated: AugmentedEvent<ApiType, [from: AccountId32, to: AccountId32, amount: u128, destinationStatus: FrameSupportTokensMiscBalanceStatus], { from: AccountId32, to: AccountId32, amount: u128, destinationStatus: FrameSupportTokensMiscBalanceStatus }>;
|
||||
/**
|
||||
* Some amount was removed from the account (e.g. for misbehavior).
|
||||
**/
|
||||
Slashed: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
Slashed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* Transfer succeeded.
|
||||
**/
|
||||
Transfer: AugmentedEvent<ApiType, [AccountId32, AccountId32, u128]>;
|
||||
Transfer: AugmentedEvent<ApiType, [from: AccountId32, to: AccountId32, amount: u128], { from: AccountId32, to: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* Some balance was unreserved (moved from reserved to free).
|
||||
**/
|
||||
Unreserved: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
Unreserved: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* Some amount was withdrawn from the account (e.g. for transaction fees).
|
||||
**/
|
||||
Withdraw: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
Withdraw: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -99,31 +99,31 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A bounty is awarded to a beneficiary.
|
||||
**/
|
||||
BountyAwarded: AugmentedEvent<ApiType, [u32, AccountId32]>;
|
||||
BountyAwarded: AugmentedEvent<ApiType, [index: u32, beneficiary: AccountId32], { index: u32, beneficiary: AccountId32 }>;
|
||||
/**
|
||||
* A bounty proposal is funded and became active.
|
||||
**/
|
||||
BountyBecameActive: AugmentedEvent<ApiType, [u32]>;
|
||||
BountyBecameActive: AugmentedEvent<ApiType, [index: u32], { index: u32 }>;
|
||||
/**
|
||||
* A bounty is cancelled.
|
||||
**/
|
||||
BountyCanceled: AugmentedEvent<ApiType, [u32]>;
|
||||
BountyCanceled: AugmentedEvent<ApiType, [index: u32], { index: u32 }>;
|
||||
/**
|
||||
* A bounty is claimed by beneficiary.
|
||||
**/
|
||||
BountyClaimed: AugmentedEvent<ApiType, [u32, u128, AccountId32]>;
|
||||
BountyClaimed: AugmentedEvent<ApiType, [index: u32, payout: u128, beneficiary: AccountId32], { index: u32, payout: u128, beneficiary: AccountId32 }>;
|
||||
/**
|
||||
* A bounty expiry is extended.
|
||||
**/
|
||||
BountyExtended: AugmentedEvent<ApiType, [u32]>;
|
||||
BountyExtended: AugmentedEvent<ApiType, [index: u32], { index: u32 }>;
|
||||
/**
|
||||
* New bounty proposal.
|
||||
**/
|
||||
BountyProposed: AugmentedEvent<ApiType, [u32]>;
|
||||
BountyProposed: AugmentedEvent<ApiType, [index: u32], { index: u32 }>;
|
||||
/**
|
||||
* A bounty proposal was rejected; funds were slashed.
|
||||
**/
|
||||
BountyRejected: AugmentedEvent<ApiType, [u32, u128]>;
|
||||
BountyRejected: AugmentedEvent<ApiType, [index: u32, bond: u128], { index: u32, bond: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -133,19 +133,19 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A child-bounty is added.
|
||||
**/
|
||||
Added: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
Added: AugmentedEvent<ApiType, [index: u32, childIndex: u32], { index: u32, childIndex: u32 }>;
|
||||
/**
|
||||
* A child-bounty is awarded to a beneficiary.
|
||||
**/
|
||||
Awarded: AugmentedEvent<ApiType, [u32, u32, AccountId32]>;
|
||||
Awarded: AugmentedEvent<ApiType, [index: u32, childIndex: u32, beneficiary: AccountId32], { index: u32, childIndex: u32, beneficiary: AccountId32 }>;
|
||||
/**
|
||||
* A child-bounty is cancelled.
|
||||
**/
|
||||
Canceled: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
Canceled: AugmentedEvent<ApiType, [index: u32, childIndex: u32], { index: u32, childIndex: u32 }>;
|
||||
/**
|
||||
* A child-bounty is claimed by beneficiary.
|
||||
**/
|
||||
Claimed: AugmentedEvent<ApiType, [u32, u32, u128, AccountId32]>;
|
||||
Claimed: AugmentedEvent<ApiType, [index: u32, childIndex: u32, payout: u128, beneficiary: AccountId32], { index: u32, childIndex: u32, payout: u128, beneficiary: AccountId32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -155,7 +155,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* Someone claimed some DOTs.
|
||||
**/
|
||||
Claimed: AugmentedEvent<ApiType, [AccountId32, EthereumAddress, u128]>;
|
||||
Claimed: AugmentedEvent<ApiType, [who: AccountId32, ethereumAddress: EthereumAddress, amount: u128], { who: AccountId32, ethereumAddress: EthereumAddress, amount: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -165,33 +165,33 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A motion was approved by the required threshold.
|
||||
**/
|
||||
Approved: AugmentedEvent<ApiType, [H256]>;
|
||||
Approved: AugmentedEvent<ApiType, [proposalHash: H256], { proposalHash: H256 }>;
|
||||
/**
|
||||
* A proposal was closed because its threshold was reached or after its duration was up.
|
||||
**/
|
||||
Closed: AugmentedEvent<ApiType, [H256, u32, u32]>;
|
||||
Closed: AugmentedEvent<ApiType, [proposalHash: H256, yes: u32, no: u32], { proposalHash: H256, yes: u32, no: u32 }>;
|
||||
/**
|
||||
* A motion was not approved by the required threshold.
|
||||
**/
|
||||
Disapproved: AugmentedEvent<ApiType, [H256]>;
|
||||
Disapproved: AugmentedEvent<ApiType, [proposalHash: H256], { proposalHash: H256 }>;
|
||||
/**
|
||||
* A motion was executed; result will be `Ok` if it returned without error.
|
||||
**/
|
||||
Executed: AugmentedEvent<ApiType, [H256, Result<Null, SpRuntimeDispatchError>]>;
|
||||
Executed: AugmentedEvent<ApiType, [proposalHash: H256, result: Result<Null, SpRuntimeDispatchError>], { proposalHash: H256, result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* A single member did some action; result will be `Ok` if it returned without error.
|
||||
**/
|
||||
MemberExecuted: AugmentedEvent<ApiType, [H256, Result<Null, SpRuntimeDispatchError>]>;
|
||||
MemberExecuted: AugmentedEvent<ApiType, [proposalHash: H256, result: Result<Null, SpRuntimeDispatchError>], { proposalHash: H256, result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* A motion (given hash) has been proposed (by given account) with a threshold (given
|
||||
* `MemberCount`).
|
||||
**/
|
||||
Proposed: AugmentedEvent<ApiType, [AccountId32, u32, H256, u32]>;
|
||||
Proposed: AugmentedEvent<ApiType, [account: AccountId32, proposalIndex: u32, proposalHash: H256, threshold: u32], { account: AccountId32, proposalIndex: u32, proposalHash: H256, threshold: u32 }>;
|
||||
/**
|
||||
* A motion (given hash) has been voted on by given account, leaving
|
||||
* a tally (yes votes and no votes given respectively as `MemberCount`).
|
||||
**/
|
||||
Voted: AugmentedEvent<ApiType, [AccountId32, H256, bool, u32, u32]>;
|
||||
Voted: AugmentedEvent<ApiType, [account: AccountId32, proposalHash: H256, voted: bool, yes: u32, no: u32], { account: AccountId32, proposalHash: H256, voted: bool, yes: u32, no: u32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -201,44 +201,44 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A parachain has been moved to `NewRaise`
|
||||
**/
|
||||
AddedToNewRaise: AugmentedEvent<ApiType, [u32]>;
|
||||
AddedToNewRaise: AugmentedEvent<ApiType, [paraId: u32], { paraId: u32 }>;
|
||||
/**
|
||||
* All loans in a fund have been refunded.
|
||||
**/
|
||||
AllRefunded: AugmentedEvent<ApiType, [u32]>;
|
||||
AllRefunded: AugmentedEvent<ApiType, [paraId: u32], { paraId: u32 }>;
|
||||
/**
|
||||
* Contributed to a crowd sale.
|
||||
**/
|
||||
Contributed: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
Contributed: AugmentedEvent<ApiType, [who: AccountId32, fundIndex: u32, amount: u128], { who: AccountId32, fundIndex: u32, amount: u128 }>;
|
||||
/**
|
||||
* Create a new crowdloaning campaign.
|
||||
**/
|
||||
Created: AugmentedEvent<ApiType, [u32]>;
|
||||
Created: AugmentedEvent<ApiType, [paraId: u32], { paraId: u32 }>;
|
||||
/**
|
||||
* Fund is dissolved.
|
||||
**/
|
||||
Dissolved: AugmentedEvent<ApiType, [u32]>;
|
||||
Dissolved: AugmentedEvent<ApiType, [paraId: u32], { paraId: u32 }>;
|
||||
/**
|
||||
* The configuration to a crowdloan has been edited.
|
||||
**/
|
||||
Edited: AugmentedEvent<ApiType, [u32]>;
|
||||
Edited: AugmentedEvent<ApiType, [paraId: u32], { paraId: u32 }>;
|
||||
/**
|
||||
* The result of trying to submit a new bid to the Slots pallet.
|
||||
**/
|
||||
HandleBidResult: AugmentedEvent<ApiType, [u32, Result<Null, SpRuntimeDispatchError>]>;
|
||||
HandleBidResult: AugmentedEvent<ApiType, [paraId: u32, result: Result<Null, SpRuntimeDispatchError>], { paraId: u32, result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* A memo has been updated.
|
||||
**/
|
||||
MemoUpdated: AugmentedEvent<ApiType, [AccountId32, u32, Bytes]>;
|
||||
MemoUpdated: AugmentedEvent<ApiType, [who: AccountId32, paraId: u32, memo: Bytes], { who: AccountId32, paraId: u32, memo: 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.
|
||||
**/
|
||||
PartiallyRefunded: AugmentedEvent<ApiType, [u32]>;
|
||||
PartiallyRefunded: AugmentedEvent<ApiType, [paraId: u32], { paraId: u32 }>;
|
||||
/**
|
||||
* Withdrew full balance of a contributor.
|
||||
**/
|
||||
Withdrew: AugmentedEvent<ApiType, [AccountId32, u32, u128]>;
|
||||
Withdrew: AugmentedEvent<ApiType, [who: AccountId32, fundIndex: u32, amount: u128], { who: AccountId32, fundIndex: u32, amount: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -248,19 +248,19 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A proposal_hash has been blacklisted permanently.
|
||||
**/
|
||||
Blacklisted: AugmentedEvent<ApiType, [H256]>;
|
||||
Blacklisted: AugmentedEvent<ApiType, [proposalHash: H256], { proposalHash: H256 }>;
|
||||
/**
|
||||
* A referendum has been cancelled.
|
||||
**/
|
||||
Cancelled: AugmentedEvent<ApiType, [u32]>;
|
||||
Cancelled: AugmentedEvent<ApiType, [refIndex: u32], { refIndex: u32 }>;
|
||||
/**
|
||||
* An account has delegated their vote to another account.
|
||||
**/
|
||||
Delegated: AugmentedEvent<ApiType, [AccountId32, AccountId32]>;
|
||||
Delegated: AugmentedEvent<ApiType, [who: AccountId32, target: AccountId32], { who: AccountId32, target: AccountId32 }>;
|
||||
/**
|
||||
* A proposal has been enacted.
|
||||
**/
|
||||
Executed: AugmentedEvent<ApiType, [u32, Result<Null, SpRuntimeDispatchError>]>;
|
||||
Executed: AugmentedEvent<ApiType, [refIndex: u32, result: Result<Null, SpRuntimeDispatchError>], { refIndex: u32, result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* An external proposal has been tabled.
|
||||
**/
|
||||
@@ -268,59 +268,59 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A proposal has been rejected by referendum.
|
||||
**/
|
||||
NotPassed: AugmentedEvent<ApiType, [u32]>;
|
||||
NotPassed: AugmentedEvent<ApiType, [refIndex: u32], { refIndex: u32 }>;
|
||||
/**
|
||||
* A proposal has been approved by referendum.
|
||||
**/
|
||||
Passed: AugmentedEvent<ApiType, [u32]>;
|
||||
Passed: AugmentedEvent<ApiType, [refIndex: u32], { refIndex: u32 }>;
|
||||
/**
|
||||
* A proposal could not be executed because its preimage was invalid.
|
||||
**/
|
||||
PreimageInvalid: AugmentedEvent<ApiType, [H256, u32]>;
|
||||
PreimageInvalid: AugmentedEvent<ApiType, [proposalHash: H256, refIndex: u32], { proposalHash: H256, refIndex: u32 }>;
|
||||
/**
|
||||
* A proposal could not be executed because its preimage was missing.
|
||||
**/
|
||||
PreimageMissing: AugmentedEvent<ApiType, [H256, u32]>;
|
||||
PreimageMissing: AugmentedEvent<ApiType, [proposalHash: H256, refIndex: u32], { proposalHash: H256, refIndex: u32 }>;
|
||||
/**
|
||||
* A proposal's preimage was noted, and the deposit taken.
|
||||
**/
|
||||
PreimageNoted: AugmentedEvent<ApiType, [H256, AccountId32, u128]>;
|
||||
PreimageNoted: AugmentedEvent<ApiType, [proposalHash: H256, who: AccountId32, deposit: u128], { proposalHash: H256, who: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* A registered preimage was removed and the deposit collected by the reaper.
|
||||
**/
|
||||
PreimageReaped: AugmentedEvent<ApiType, [H256, AccountId32, u128, AccountId32]>;
|
||||
PreimageReaped: AugmentedEvent<ApiType, [proposalHash: H256, provider: AccountId32, deposit: u128, reaper: AccountId32], { proposalHash: H256, provider: AccountId32, deposit: u128, reaper: AccountId32 }>;
|
||||
/**
|
||||
* A proposal preimage was removed and used (the deposit was returned).
|
||||
**/
|
||||
PreimageUsed: AugmentedEvent<ApiType, [H256, AccountId32, u128]>;
|
||||
PreimageUsed: AugmentedEvent<ApiType, [proposalHash: H256, provider: AccountId32, deposit: u128], { proposalHash: H256, provider: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* A motion has been proposed by a public account.
|
||||
**/
|
||||
Proposed: AugmentedEvent<ApiType, [u32, u128]>;
|
||||
Proposed: AugmentedEvent<ApiType, [proposalIndex: u32, deposit: u128], { proposalIndex: u32, deposit: u128 }>;
|
||||
/**
|
||||
* An account has secconded a proposal
|
||||
**/
|
||||
Seconded: AugmentedEvent<ApiType, [AccountId32, u32]>;
|
||||
Seconded: AugmentedEvent<ApiType, [seconder: AccountId32, propIndex: u32], { seconder: AccountId32, propIndex: u32 }>;
|
||||
/**
|
||||
* A referendum has begun.
|
||||
**/
|
||||
Started: AugmentedEvent<ApiType, [u32, PalletDemocracyVoteThreshold]>;
|
||||
Started: AugmentedEvent<ApiType, [refIndex: u32, threshold: PalletDemocracyVoteThreshold], { refIndex: u32, threshold: PalletDemocracyVoteThreshold }>;
|
||||
/**
|
||||
* A public proposal has been tabled for referendum vote.
|
||||
**/
|
||||
Tabled: AugmentedEvent<ApiType, [u32, u128, Vec<AccountId32>]>;
|
||||
Tabled: AugmentedEvent<ApiType, [proposalIndex: u32, deposit: u128, depositors: Vec<AccountId32>], { proposalIndex: u32, deposit: u128, depositors: Vec<AccountId32> }>;
|
||||
/**
|
||||
* An account has cancelled a previous delegation operation.
|
||||
**/
|
||||
Undelegated: AugmentedEvent<ApiType, [AccountId32]>;
|
||||
Undelegated: AugmentedEvent<ApiType, [account: AccountId32], { account: AccountId32 }>;
|
||||
/**
|
||||
* An external proposal has been vetoed.
|
||||
**/
|
||||
Vetoed: AugmentedEvent<ApiType, [AccountId32, H256, u32]>;
|
||||
Vetoed: AugmentedEvent<ApiType, [who: AccountId32, proposalHash: H256, until: u32], { who: AccountId32, proposalHash: H256, until: u32 }>;
|
||||
/**
|
||||
* An account has voted in a referendum
|
||||
**/
|
||||
Voted: AugmentedEvent<ApiType, [AccountId32, u32, PalletDemocracyVoteAccountVote]>;
|
||||
Voted: AugmentedEvent<ApiType, [voter: AccountId32, refIndex: u32, vote: PalletDemocracyVoteAccountVote], { voter: AccountId32, refIndex: u32, vote: PalletDemocracyVoteAccountVote }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -331,19 +331,19 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* The election has been finalized, with `Some` of the given computation, or else if the
|
||||
* election failed, `None`.
|
||||
**/
|
||||
ElectionFinalized: AugmentedEvent<ApiType, [Option<PalletElectionProviderMultiPhaseElectionCompute>]>;
|
||||
ElectionFinalized: AugmentedEvent<ApiType, [electionCompute: Option<PalletElectionProviderMultiPhaseElectionCompute>], { electionCompute: Option<PalletElectionProviderMultiPhaseElectionCompute> }>;
|
||||
/**
|
||||
* An account has been rewarded for their signed submission being finalized.
|
||||
**/
|
||||
Rewarded: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
Rewarded: AugmentedEvent<ApiType, [account: AccountId32, value: u128], { account: AccountId32, value: u128 }>;
|
||||
/**
|
||||
* The signed phase of the given round has started.
|
||||
**/
|
||||
SignedPhaseStarted: AugmentedEvent<ApiType, [u32]>;
|
||||
SignedPhaseStarted: AugmentedEvent<ApiType, [round: u32], { round: u32 }>;
|
||||
/**
|
||||
* An account has been slashed for submitting an invalid signed submission.
|
||||
**/
|
||||
Slashed: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
Slashed: AugmentedEvent<ApiType, [account: AccountId32, value: u128], { account: AccountId32, value: u128 }>;
|
||||
/**
|
||||
* A solution was stored with the given compute.
|
||||
*
|
||||
@@ -352,11 +352,11 @@ declare module '@polkadot/api-base/types/events' {
|
||||
*
|
||||
* The `bool` is `true` when a previous solution was ejected to make room for this one.
|
||||
**/
|
||||
SolutionStored: AugmentedEvent<ApiType, [PalletElectionProviderMultiPhaseElectionCompute, bool]>;
|
||||
SolutionStored: AugmentedEvent<ApiType, [electionCompute: PalletElectionProviderMultiPhaseElectionCompute, prevEjected: bool], { electionCompute: PalletElectionProviderMultiPhaseElectionCompute, prevEjected: bool }>;
|
||||
/**
|
||||
* The unsigned phase of the given round has started.
|
||||
**/
|
||||
UnsignedPhaseStarted: AugmentedEvent<ApiType, [u32]>;
|
||||
UnsignedPhaseStarted: AugmentedEvent<ApiType, [round: u32], { round: u32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -366,7 +366,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* New authority set has been applied.
|
||||
**/
|
||||
NewAuthorities: AugmentedEvent<ApiType, [Vec<ITuple<[SpFinalityGrandpaAppPublic, u64]>>]>;
|
||||
NewAuthorities: AugmentedEvent<ApiType, [authoritySet: Vec<ITuple<[SpFinalityGrandpaAppPublic, u64]>>], { authoritySet: Vec<ITuple<[SpFinalityGrandpaAppPublic, u64]>> }>;
|
||||
/**
|
||||
* Current authority set has been paused.
|
||||
**/
|
||||
@@ -408,44 +408,44 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A name was cleared, and the given balance returned.
|
||||
**/
|
||||
IdentityCleared: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
IdentityCleared: AugmentedEvent<ApiType, [who: AccountId32, deposit: u128], { who: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* A name was removed and the given balance slashed.
|
||||
**/
|
||||
IdentityKilled: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
IdentityKilled: AugmentedEvent<ApiType, [who: AccountId32, deposit: u128], { who: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* A name was set or reset (which will remove all judgements).
|
||||
**/
|
||||
IdentitySet: AugmentedEvent<ApiType, [AccountId32]>;
|
||||
IdentitySet: AugmentedEvent<ApiType, [who: AccountId32], { who: AccountId32 }>;
|
||||
/**
|
||||
* A judgement was given by a registrar.
|
||||
**/
|
||||
JudgementGiven: AugmentedEvent<ApiType, [AccountId32, u32]>;
|
||||
JudgementGiven: AugmentedEvent<ApiType, [target: AccountId32, registrarIndex: u32], { target: AccountId32, registrarIndex: u32 }>;
|
||||
/**
|
||||
* A judgement was asked from a registrar.
|
||||
**/
|
||||
JudgementRequested: AugmentedEvent<ApiType, [AccountId32, u32]>;
|
||||
JudgementRequested: AugmentedEvent<ApiType, [who: AccountId32, registrarIndex: u32], { who: AccountId32, registrarIndex: u32 }>;
|
||||
/**
|
||||
* A judgement request was retracted.
|
||||
**/
|
||||
JudgementUnrequested: AugmentedEvent<ApiType, [AccountId32, u32]>;
|
||||
JudgementUnrequested: AugmentedEvent<ApiType, [who: AccountId32, registrarIndex: u32], { who: AccountId32, registrarIndex: u32 }>;
|
||||
/**
|
||||
* A registrar was added.
|
||||
**/
|
||||
RegistrarAdded: AugmentedEvent<ApiType, [u32]>;
|
||||
RegistrarAdded: AugmentedEvent<ApiType, [registrarIndex: u32], { registrarIndex: u32 }>;
|
||||
/**
|
||||
* A sub-identity was added to an identity and the deposit paid.
|
||||
**/
|
||||
SubIdentityAdded: AugmentedEvent<ApiType, [AccountId32, AccountId32, u128]>;
|
||||
SubIdentityAdded: AugmentedEvent<ApiType, [sub: AccountId32, main: AccountId32, deposit: u128], { sub: AccountId32, main: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* A sub-identity was removed from an identity and the deposit freed.
|
||||
**/
|
||||
SubIdentityRemoved: AugmentedEvent<ApiType, [AccountId32, AccountId32, u128]>;
|
||||
SubIdentityRemoved: AugmentedEvent<ApiType, [sub: AccountId32, main: AccountId32, deposit: u128], { sub: AccountId32, main: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* A sub-identity was cleared, and the given deposit repatriated from the
|
||||
* main identity account to the sub-identity account.
|
||||
**/
|
||||
SubIdentityRevoked: AugmentedEvent<ApiType, [AccountId32, AccountId32, u128]>;
|
||||
SubIdentityRevoked: AugmentedEvent<ApiType, [sub: AccountId32, main: AccountId32, deposit: u128], { sub: AccountId32, main: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -459,11 +459,11 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A new heartbeat was received from `AuthorityId`.
|
||||
**/
|
||||
HeartbeatReceived: AugmentedEvent<ApiType, [PalletImOnlineSr25519AppSr25519Public]>;
|
||||
HeartbeatReceived: AugmentedEvent<ApiType, [authorityId: PalletImOnlineSr25519AppSr25519Public], { authorityId: PalletImOnlineSr25519AppSr25519Public }>;
|
||||
/**
|
||||
* At the end of the session, at least one validator was found to be offline.
|
||||
**/
|
||||
SomeOffline: AugmentedEvent<ApiType, [Vec<ITuple<[AccountId32, PalletStakingExposure]>>]>;
|
||||
SomeOffline: AugmentedEvent<ApiType, [offline: Vec<ITuple<[AccountId32, PalletStakingExposure]>>], { offline: Vec<ITuple<[AccountId32, PalletStakingExposure]>> }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -473,15 +473,15 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A account index was assigned.
|
||||
**/
|
||||
IndexAssigned: AugmentedEvent<ApiType, [AccountId32, u32]>;
|
||||
IndexAssigned: AugmentedEvent<ApiType, [who: AccountId32, index: u32], { who: AccountId32, index: u32 }>;
|
||||
/**
|
||||
* A account index has been freed up (unassigned).
|
||||
**/
|
||||
IndexFreed: AugmentedEvent<ApiType, [u32]>;
|
||||
IndexFreed: AugmentedEvent<ApiType, [index: u32], { index: u32 }>;
|
||||
/**
|
||||
* A account index has been frozen to its current account ID.
|
||||
**/
|
||||
IndexFrozen: AugmentedEvent<ApiType, [u32, AccountId32]>;
|
||||
IndexFrozen: AugmentedEvent<ApiType, [index: u32, who: AccountId32], { index: u32, who: AccountId32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -491,19 +491,19 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A multisig operation has been approved by someone.
|
||||
**/
|
||||
MultisigApproval: AugmentedEvent<ApiType, [AccountId32, PalletMultisigTimepoint, AccountId32, U8aFixed]>;
|
||||
MultisigApproval: AugmentedEvent<ApiType, [approving: AccountId32, timepoint: PalletMultisigTimepoint, multisig: AccountId32, callHash: U8aFixed], { approving: AccountId32, timepoint: PalletMultisigTimepoint, multisig: AccountId32, callHash: U8aFixed }>;
|
||||
/**
|
||||
* A multisig operation has been cancelled.
|
||||
**/
|
||||
MultisigCancelled: AugmentedEvent<ApiType, [AccountId32, PalletMultisigTimepoint, AccountId32, U8aFixed]>;
|
||||
MultisigCancelled: AugmentedEvent<ApiType, [cancelling: AccountId32, timepoint: PalletMultisigTimepoint, multisig: AccountId32, callHash: U8aFixed], { cancelling: AccountId32, timepoint: PalletMultisigTimepoint, multisig: AccountId32, callHash: U8aFixed }>;
|
||||
/**
|
||||
* A multisig operation has been executed.
|
||||
**/
|
||||
MultisigExecuted: AugmentedEvent<ApiType, [AccountId32, PalletMultisigTimepoint, AccountId32, U8aFixed, Result<Null, SpRuntimeDispatchError>]>;
|
||||
MultisigExecuted: AugmentedEvent<ApiType, [approving: AccountId32, timepoint: PalletMultisigTimepoint, multisig: AccountId32, callHash: U8aFixed, result: Result<Null, SpRuntimeDispatchError>], { approving: AccountId32, timepoint: PalletMultisigTimepoint, multisig: AccountId32, callHash: U8aFixed, result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* A new multisig operation has begun.
|
||||
**/
|
||||
NewMultisig: AugmentedEvent<ApiType, [AccountId32, AccountId32, U8aFixed]>;
|
||||
NewMultisig: AugmentedEvent<ApiType, [approving: AccountId32, multisig: AccountId32, callHash: U8aFixed], { approving: AccountId32, multisig: AccountId32, callHash: U8aFixed }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -515,7 +515,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* (kind-specific) time slot. This event is not deposited for duplicate slashes.
|
||||
* \[kind, timeslot\].
|
||||
**/
|
||||
Offence: AugmentedEvent<ApiType, [U8aFixed, Bytes]>;
|
||||
Offence: AugmentedEvent<ApiType, [kind: U8aFixed, timeslot: Bytes], { kind: U8aFixed, timeslot: Bytes }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -614,7 +614,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
*
|
||||
* Note that old members and runners-up are also candidates.
|
||||
**/
|
||||
CandidateSlashed: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
CandidateSlashed: AugmentedEvent<ApiType, [candidate: AccountId32, amount: u128], { candidate: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* Internal error happened while trying to perform election.
|
||||
**/
|
||||
@@ -628,7 +628,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A member has been removed. This should always be followed by either `NewTerm` or
|
||||
* `EmptyTerm`.
|
||||
**/
|
||||
MemberKicked: AugmentedEvent<ApiType, [AccountId32]>;
|
||||
MemberKicked: AugmentedEvent<ApiType, [member: AccountId32], { member: AccountId32 }>;
|
||||
/**
|
||||
* A new term with new_members. This indicates that enough candidates existed to run
|
||||
* the election, not that enough have has been elected. The inner value must be examined
|
||||
@@ -636,15 +636,15 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to
|
||||
* begin with.
|
||||
**/
|
||||
NewTerm: AugmentedEvent<ApiType, [Vec<ITuple<[AccountId32, u128]>>]>;
|
||||
NewTerm: AugmentedEvent<ApiType, [newMembers: Vec<ITuple<[AccountId32, u128]>>], { newMembers: Vec<ITuple<[AccountId32, u128]>> }>;
|
||||
/**
|
||||
* Someone has renounced their candidacy.
|
||||
**/
|
||||
Renounced: AugmentedEvent<ApiType, [AccountId32]>;
|
||||
Renounced: AugmentedEvent<ApiType, [candidate: AccountId32], { candidate: AccountId32 }>;
|
||||
/**
|
||||
* A seat holder was slashed by amount by being forcefully removed from the set.
|
||||
**/
|
||||
SeatHolderSlashed: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
SeatHolderSlashed: AugmentedEvent<ApiType, [seatHolder: AccountId32, amount: u128], { seatHolder: AccountId32, amount: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -654,15 +654,15 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A preimage has ben cleared.
|
||||
**/
|
||||
Cleared: AugmentedEvent<ApiType, [H256]>;
|
||||
Cleared: AugmentedEvent<ApiType, [hash_: H256], { hash_: H256 }>;
|
||||
/**
|
||||
* A preimage has been noted.
|
||||
**/
|
||||
Noted: AugmentedEvent<ApiType, [H256]>;
|
||||
Noted: AugmentedEvent<ApiType, [hash_: H256], { hash_: H256 }>;
|
||||
/**
|
||||
* A preimage has been requested.
|
||||
**/
|
||||
Requested: AugmentedEvent<ApiType, [H256]>;
|
||||
Requested: AugmentedEvent<ApiType, [hash_: H256], { hash_: H256 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -672,33 +672,33 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* An announcement was placed to make a call in the future.
|
||||
**/
|
||||
Announced: AugmentedEvent<ApiType, [AccountId32, AccountId32, H256]>;
|
||||
Announced: AugmentedEvent<ApiType, [real: AccountId32, proxy: AccountId32, callHash: H256], { real: AccountId32, proxy: AccountId32, callHash: H256 }>;
|
||||
/**
|
||||
* Anonymous account has been created by new proxy with given
|
||||
* disambiguation index and proxy type.
|
||||
**/
|
||||
AnonymousCreated: AugmentedEvent<ApiType, [AccountId32, AccountId32, PolkadotRuntimeProxyType, u16]>;
|
||||
AnonymousCreated: AugmentedEvent<ApiType, [anonymous: AccountId32, who: AccountId32, proxyType: PolkadotRuntimeProxyType, disambiguationIndex: u16], { anonymous: AccountId32, who: AccountId32, proxyType: PolkadotRuntimeProxyType, disambiguationIndex: u16 }>;
|
||||
/**
|
||||
* A proxy was added.
|
||||
**/
|
||||
ProxyAdded: AugmentedEvent<ApiType, [AccountId32, AccountId32, PolkadotRuntimeProxyType, u32]>;
|
||||
ProxyAdded: AugmentedEvent<ApiType, [delegator: AccountId32, delegatee: AccountId32, proxyType: PolkadotRuntimeProxyType, delay: u32], { delegator: AccountId32, delegatee: AccountId32, proxyType: PolkadotRuntimeProxyType, delay: u32 }>;
|
||||
/**
|
||||
* A proxy was executed correctly, with the given.
|
||||
**/
|
||||
ProxyExecuted: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;
|
||||
ProxyExecuted: AugmentedEvent<ApiType, [result: Result<Null, SpRuntimeDispatchError>], { result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* A proxy was removed.
|
||||
**/
|
||||
ProxyRemoved: AugmentedEvent<ApiType, [AccountId32, AccountId32, PolkadotRuntimeProxyType, u32]>;
|
||||
ProxyRemoved: AugmentedEvent<ApiType, [delegator: AccountId32, delegatee: AccountId32, proxyType: PolkadotRuntimeProxyType, delay: u32], { delegator: AccountId32, delegatee: AccountId32, proxyType: PolkadotRuntimeProxyType, delay: u32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
registrar: {
|
||||
Deregistered: AugmentedEvent<ApiType, [u32]>;
|
||||
Registered: AugmentedEvent<ApiType, [u32, AccountId32]>;
|
||||
Reserved: AugmentedEvent<ApiType, [u32, AccountId32]>;
|
||||
Deregistered: AugmentedEvent<ApiType, [paraId: u32], { paraId: u32 }>;
|
||||
Registered: AugmentedEvent<ApiType, [paraId: u32, manager: AccountId32], { paraId: u32, manager: AccountId32 }>;
|
||||
Reserved: AugmentedEvent<ApiType, [paraId: u32, who: AccountId32], { paraId: u32, who: AccountId32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -708,19 +708,19 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* The call for the provided hash was not found so the task has been aborted.
|
||||
**/
|
||||
CallLookupFailed: AugmentedEvent<ApiType, [ITuple<[u32, u32]>, Option<Bytes>, FrameSupportScheduleLookupError]>;
|
||||
CallLookupFailed: AugmentedEvent<ApiType, [task: ITuple<[u32, u32]>, id: Option<Bytes>, error: FrameSupportScheduleLookupError], { task: ITuple<[u32, u32]>, id: Option<Bytes>, error: FrameSupportScheduleLookupError }>;
|
||||
/**
|
||||
* Canceled some task.
|
||||
**/
|
||||
Canceled: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
Canceled: AugmentedEvent<ApiType, [when: u32, index: u32], { when: u32, index: u32 }>;
|
||||
/**
|
||||
* Dispatched some task.
|
||||
**/
|
||||
Dispatched: AugmentedEvent<ApiType, [ITuple<[u32, u32]>, Option<Bytes>, Result<Null, SpRuntimeDispatchError>]>;
|
||||
Dispatched: AugmentedEvent<ApiType, [task: ITuple<[u32, u32]>, id: Option<Bytes>, result: Result<Null, SpRuntimeDispatchError>], { task: ITuple<[u32, u32]>, id: Option<Bytes>, result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* Scheduled some task.
|
||||
**/
|
||||
Scheduled: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
Scheduled: AugmentedEvent<ApiType, [when: u32, index: u32], { when: u32, index: u32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -731,7 +731,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* New session has happened. Note that the argument is the session index, not the
|
||||
* block number as the type might suggest.
|
||||
**/
|
||||
NewSession: AugmentedEvent<ApiType, [u32]>;
|
||||
NewSession: AugmentedEvent<ApiType, [sessionIndex: u32], { sessionIndex: u32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -743,11 +743,11 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* First balance is any extra amount reserved on top of the para's existing deposit.
|
||||
* Second balance is the total amount reserved.
|
||||
**/
|
||||
Leased: AugmentedEvent<ApiType, [u32, AccountId32, u32, u32, u128, u128]>;
|
||||
Leased: AugmentedEvent<ApiType, [paraId: u32, leaser: AccountId32, periodBegin: u32, periodCount: u32, extraReserved: u128, totalAmount: u128], { paraId: u32, leaser: AccountId32, periodBegin: u32, periodCount: u32, extraReserved: u128, totalAmount: u128 }>;
|
||||
/**
|
||||
* A new `[lease_period]` is beginning.
|
||||
**/
|
||||
NewLeasePeriod: AugmentedEvent<ApiType, [u32]>;
|
||||
NewLeasePeriod: AugmentedEvent<ApiType, [leasePeriod: u32], { leasePeriod: u32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -828,23 +828,23 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* An extrinsic failed.
|
||||
**/
|
||||
ExtrinsicFailed: AugmentedEvent<ApiType, [SpRuntimeDispatchError, FrameSupportWeightsDispatchInfo]>;
|
||||
ExtrinsicFailed: AugmentedEvent<ApiType, [dispatchError: SpRuntimeDispatchError, dispatchInfo: FrameSupportWeightsDispatchInfo], { dispatchError: SpRuntimeDispatchError, dispatchInfo: FrameSupportWeightsDispatchInfo }>;
|
||||
/**
|
||||
* An extrinsic completed successfully.
|
||||
**/
|
||||
ExtrinsicSuccess: AugmentedEvent<ApiType, [FrameSupportWeightsDispatchInfo]>;
|
||||
ExtrinsicSuccess: AugmentedEvent<ApiType, [dispatchInfo: FrameSupportWeightsDispatchInfo], { dispatchInfo: FrameSupportWeightsDispatchInfo }>;
|
||||
/**
|
||||
* An account was reaped.
|
||||
**/
|
||||
KilledAccount: AugmentedEvent<ApiType, [AccountId32]>;
|
||||
KilledAccount: AugmentedEvent<ApiType, [account: AccountId32], { account: AccountId32 }>;
|
||||
/**
|
||||
* A new account was created.
|
||||
**/
|
||||
NewAccount: AugmentedEvent<ApiType, [AccountId32]>;
|
||||
NewAccount: AugmentedEvent<ApiType, [account: AccountId32], { account: AccountId32 }>;
|
||||
/**
|
||||
* On on-chain remark happened.
|
||||
**/
|
||||
Remarked: AugmentedEvent<ApiType, [AccountId32, H256]>;
|
||||
Remarked: AugmentedEvent<ApiType, [sender: AccountId32, hash_: H256], { sender: AccountId32, hash_: H256 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -854,33 +854,33 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A motion was approved by the required threshold.
|
||||
**/
|
||||
Approved: AugmentedEvent<ApiType, [H256]>;
|
||||
Approved: AugmentedEvent<ApiType, [proposalHash: H256], { proposalHash: H256 }>;
|
||||
/**
|
||||
* A proposal was closed because its threshold was reached or after its duration was up.
|
||||
**/
|
||||
Closed: AugmentedEvent<ApiType, [H256, u32, u32]>;
|
||||
Closed: AugmentedEvent<ApiType, [proposalHash: H256, yes: u32, no: u32], { proposalHash: H256, yes: u32, no: u32 }>;
|
||||
/**
|
||||
* A motion was not approved by the required threshold.
|
||||
**/
|
||||
Disapproved: AugmentedEvent<ApiType, [H256]>;
|
||||
Disapproved: AugmentedEvent<ApiType, [proposalHash: H256], { proposalHash: H256 }>;
|
||||
/**
|
||||
* A motion was executed; result will be `Ok` if it returned without error.
|
||||
**/
|
||||
Executed: AugmentedEvent<ApiType, [H256, Result<Null, SpRuntimeDispatchError>]>;
|
||||
Executed: AugmentedEvent<ApiType, [proposalHash: H256, result: Result<Null, SpRuntimeDispatchError>], { proposalHash: H256, result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* A single member did some action; result will be `Ok` if it returned without error.
|
||||
**/
|
||||
MemberExecuted: AugmentedEvent<ApiType, [H256, Result<Null, SpRuntimeDispatchError>]>;
|
||||
MemberExecuted: AugmentedEvent<ApiType, [proposalHash: H256, result: Result<Null, SpRuntimeDispatchError>], { proposalHash: H256, result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* A motion (given hash) has been proposed (by given account) with a threshold (given
|
||||
* `MemberCount`).
|
||||
**/
|
||||
Proposed: AugmentedEvent<ApiType, [AccountId32, u32, H256, u32]>;
|
||||
Proposed: AugmentedEvent<ApiType, [account: AccountId32, proposalIndex: u32, proposalHash: H256, threshold: u32], { account: AccountId32, proposalIndex: u32, proposalHash: H256, threshold: u32 }>;
|
||||
/**
|
||||
* A motion (given hash) has been voted on by given account, leaving
|
||||
* a tally (yes votes and no votes given respectively as `MemberCount`).
|
||||
**/
|
||||
Voted: AugmentedEvent<ApiType, [AccountId32, H256, bool, u32, u32]>;
|
||||
Voted: AugmentedEvent<ApiType, [account: AccountId32, proposalHash: H256, voted: bool, yes: u32, no: u32], { account: AccountId32, proposalHash: H256, voted: bool, yes: u32, no: u32 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -920,23 +920,23 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A new tip suggestion has been opened.
|
||||
**/
|
||||
NewTip: AugmentedEvent<ApiType, [H256]>;
|
||||
NewTip: AugmentedEvent<ApiType, [tipHash: H256], { tipHash: H256 }>;
|
||||
/**
|
||||
* A tip suggestion has been closed.
|
||||
**/
|
||||
TipClosed: AugmentedEvent<ApiType, [H256, AccountId32, u128]>;
|
||||
TipClosed: AugmentedEvent<ApiType, [tipHash: H256, who: AccountId32, payout: u128], { tipHash: H256, who: AccountId32, payout: u128 }>;
|
||||
/**
|
||||
* A tip suggestion has reached threshold and is closing.
|
||||
**/
|
||||
TipClosing: AugmentedEvent<ApiType, [H256]>;
|
||||
TipClosing: AugmentedEvent<ApiType, [tipHash: H256], { tipHash: H256 }>;
|
||||
/**
|
||||
* A tip suggestion has been retracted.
|
||||
**/
|
||||
TipRetracted: AugmentedEvent<ApiType, [H256]>;
|
||||
TipRetracted: AugmentedEvent<ApiType, [tipHash: H256], { tipHash: H256 }>;
|
||||
/**
|
||||
* A tip suggestion has been slashed.
|
||||
**/
|
||||
TipSlashed: AugmentedEvent<ApiType, [H256, AccountId32, u128]>;
|
||||
TipSlashed: AugmentedEvent<ApiType, [tipHash: H256, finder: AccountId32, deposit: u128], { tipHash: H256, finder: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -946,31 +946,31 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* Some funds have been allocated.
|
||||
**/
|
||||
Awarded: AugmentedEvent<ApiType, [u32, u128, AccountId32]>;
|
||||
Awarded: AugmentedEvent<ApiType, [proposalIndex: u32, award: u128, account: AccountId32], { proposalIndex: u32, award: u128, account: AccountId32 }>;
|
||||
/**
|
||||
* Some of our funds have been burnt.
|
||||
**/
|
||||
Burnt: AugmentedEvent<ApiType, [u128]>;
|
||||
Burnt: AugmentedEvent<ApiType, [burntFunds: u128], { burntFunds: u128 }>;
|
||||
/**
|
||||
* Some funds have been deposited.
|
||||
**/
|
||||
Deposit: AugmentedEvent<ApiType, [u128]>;
|
||||
Deposit: AugmentedEvent<ApiType, [value: u128], { value: u128 }>;
|
||||
/**
|
||||
* New proposal.
|
||||
**/
|
||||
Proposed: AugmentedEvent<ApiType, [u32]>;
|
||||
Proposed: AugmentedEvent<ApiType, [proposalIndex: u32], { proposalIndex: u32 }>;
|
||||
/**
|
||||
* A proposal was rejected; funds were slashed.
|
||||
**/
|
||||
Rejected: AugmentedEvent<ApiType, [u32, u128]>;
|
||||
Rejected: AugmentedEvent<ApiType, [proposalIndex: u32, slashed: u128], { proposalIndex: u32, slashed: u128 }>;
|
||||
/**
|
||||
* Spending has finished; this is the amount that rolls over until next spend.
|
||||
**/
|
||||
Rollover: AugmentedEvent<ApiType, [u128]>;
|
||||
Rollover: AugmentedEvent<ApiType, [rolloverBalance: u128], { rolloverBalance: u128 }>;
|
||||
/**
|
||||
* We have ended a spend period and will now allocate funds.
|
||||
**/
|
||||
Spending: AugmentedEvent<ApiType, [u128]>;
|
||||
Spending: AugmentedEvent<ApiType, [budgetRemaining: u128], { budgetRemaining: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -1036,11 +1036,11 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* Batch of dispatches did not complete fully. Index of first failing dispatch given, as
|
||||
* well as the error.
|
||||
**/
|
||||
BatchInterrupted: AugmentedEvent<ApiType, [u32, SpRuntimeDispatchError]>;
|
||||
BatchInterrupted: AugmentedEvent<ApiType, [index: u32, error: SpRuntimeDispatchError], { index: u32, error: SpRuntimeDispatchError }>;
|
||||
/**
|
||||
* A call was dispatched.
|
||||
**/
|
||||
DispatchedAs: AugmentedEvent<ApiType, [Result<Null, SpRuntimeDispatchError>]>;
|
||||
DispatchedAs: AugmentedEvent<ApiType, [result: Result<Null, SpRuntimeDispatchError>], { result: Result<Null, SpRuntimeDispatchError> }>;
|
||||
/**
|
||||
* A single item within a Batch of dispatches has completed with no error.
|
||||
**/
|
||||
@@ -1048,7 +1048,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A single item within a Batch of dispatches has completed with error.
|
||||
**/
|
||||
ItemFailed: AugmentedEvent<ApiType, [SpRuntimeDispatchError]>;
|
||||
ItemFailed: AugmentedEvent<ApiType, [error: SpRuntimeDispatchError], { error: SpRuntimeDispatchError }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -1058,12 +1058,12 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* An \[account\] has become fully vested.
|
||||
**/
|
||||
VestingCompleted: AugmentedEvent<ApiType, [AccountId32]>;
|
||||
VestingCompleted: AugmentedEvent<ApiType, [account: AccountId32], { account: AccountId32 }>;
|
||||
/**
|
||||
* The amount vested has been updated. This could indicate a change in funds available.
|
||||
* The balance given is the amount which is left unvested (and thus locked).
|
||||
**/
|
||||
VestingUpdated: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
VestingUpdated: AugmentedEvent<ApiType, [account: AccountId32, unvested: u128], { account: AccountId32, unvested: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -1073,11 +1073,11 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* Moved an account from one bag to another.
|
||||
**/
|
||||
Rebagged: AugmentedEvent<ApiType, [AccountId32, u64, u64]>;
|
||||
Rebagged: AugmentedEvent<ApiType, [who: AccountId32, from: u64, to: u64], { who: AccountId32, from: u64, to: u64 }>;
|
||||
/**
|
||||
* Updated the score of some account to the given amount.
|
||||
**/
|
||||
ScoreUpdated: AugmentedEvent<ApiType, [AccountId32, u64]>;
|
||||
ScoreUpdated: AugmentedEvent<ApiType, [who: AccountId32, newScore: u64], { who: AccountId32, newScore: u64 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
|
||||
@@ -9,6 +9,33 @@ import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSys
|
||||
|
||||
declare module '@polkadot/api-base/types/consts' {
|
||||
export interface AugmentedConsts<ApiType extends ApiTypes> {
|
||||
alliance: {
|
||||
/**
|
||||
* The deposit required for submitting candidacy.
|
||||
**/
|
||||
allyDeposit: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of announcements.
|
||||
**/
|
||||
maxAnnouncementsCount: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of members per member role. Should not exceed the sum of
|
||||
* `MaxFounders` and `MaxFellows`.
|
||||
**/
|
||||
maxMembersCount: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of the unscrupulous items supported by the pallet.
|
||||
**/
|
||||
maxUnscrupulousItems: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum length of a website URL.
|
||||
**/
|
||||
maxWebsiteUrlLength: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
assets: {
|
||||
/**
|
||||
* The amount of funds that must be reserved when creating a new approval.
|
||||
@@ -223,7 +250,7 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
*
|
||||
* For more information check out: <https://github.com/paritytech/substrate/issues/10301>
|
||||
*
|
||||
* [`DefaultContractAccessWeight`] is a safe default to be used for polkadot or kusama
|
||||
* [`DefaultContractAccessWeight`] is a safe default to be used for Polkadot or Kusama
|
||||
* parachains.
|
||||
*
|
||||
* # Note
|
||||
@@ -709,6 +736,31 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
rankedPolls: {
|
||||
/**
|
||||
* Quantization level for the referendum wakeup scheduler. A higher number will result in
|
||||
* fewer storage reads/writes needed for smaller voters, but also result in delays to the
|
||||
* automatic referendum status changes. Explicit servicing instructions are unaffected.
|
||||
**/
|
||||
alarmInterval: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum size of the referendum queue for a single track.
|
||||
**/
|
||||
maxQueued: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The minimum amount to be used as a deposit for a public referendum proposal.
|
||||
**/
|
||||
submissionDeposit: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The number of blocks after submission that a referendum must begin being decided by.
|
||||
* Once this passes, then anyone may cancel the referendum.
|
||||
**/
|
||||
undecidingTimeout: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
recovery: {
|
||||
/**
|
||||
* The base amount of currency needed to reserve for creating a recovery configuration.
|
||||
@@ -871,6 +923,36 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
stateTrieMigration: {
|
||||
/**
|
||||
* Maximal number of bytes that a key can have.
|
||||
*
|
||||
* FRAME itself does not limit the key length.
|
||||
* The concrete value must therefore depend on your storage usage.
|
||||
* A [`frame_support::storage::StorageNMap`] for example can have an arbitrary number of
|
||||
* keys which are then hashed and concatenated, resulting in arbitrarily long keys.
|
||||
*
|
||||
* Use the *state migration RPC* to retrieve the length of the longest key in your
|
||||
* storage: <https://github.com/paritytech/substrate/issues/11642>
|
||||
*
|
||||
* The migration will halt with a `Halted` event if this value is too small.
|
||||
* Since there is no real penalty from over-estimating, it is advised to use a large
|
||||
* value. The default is 512 byte.
|
||||
*
|
||||
* Some key lengths for reference:
|
||||
* - [`frame_support::storage::StorageValue`]: 32 byte
|
||||
* - [`frame_support::storage::StorageMap`]: 64 byte
|
||||
* - [`frame_support::storage::StorageDoubleMap`]: 96 byte
|
||||
*
|
||||
* For more info see
|
||||
* <https://www.shawntabrizi.com/substrate/querying-substrate-storage-via-rpc/>
|
||||
**/
|
||||
maxKeyLen: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
system: {
|
||||
/**
|
||||
* Maximum number of block number to block hash mappings to keep (oldest pruned first).
|
||||
|
||||
@@ -5,6 +5,143 @@ import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/errors' {
|
||||
export interface AugmentedErrors<ApiType extends ApiTypes> {
|
||||
alliance: {
|
||||
/**
|
||||
* Account has been deemed unscrupulous by the Alliance and is not welcome to join or be
|
||||
* nominated.
|
||||
**/
|
||||
AccountNonGrata: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Account is already an elevated (fellow) member.
|
||||
**/
|
||||
AlreadyElevated: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Account is already a member.
|
||||
**/
|
||||
AlreadyMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Item is already listed as unscrupulous.
|
||||
**/
|
||||
AlreadyUnscrupulous: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Balance is insufficient for the required deposit.
|
||||
**/
|
||||
InsufficientFunds: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The founders/fellows/allies have already been initialized.
|
||||
**/
|
||||
MembersAlreadyInitialized: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The announcement is not found.
|
||||
**/
|
||||
MissingAnnouncement: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The proposal hash is not found.
|
||||
**/
|
||||
MissingProposalHash: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Account is not an ally.
|
||||
**/
|
||||
NotAlly: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Account is not a founder.
|
||||
**/
|
||||
NotFounder: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Item has not been deemed unscrupulous.
|
||||
**/
|
||||
NotListedAsUnscrupulous: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Account is not a member.
|
||||
**/
|
||||
NotMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The proposal is not vetoable.
|
||||
**/
|
||||
NotVetoableProposal: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Account does not have voting rights.
|
||||
**/
|
||||
NoVotingRights: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Length of website URL exceeds `MaxWebsiteUrlLength`.
|
||||
**/
|
||||
TooLongWebsiteUrl: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Number of announcements exceeds `MaxAnnouncementsCount`.
|
||||
**/
|
||||
TooManyAnnouncements: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Number of members exceeds `MaxMembersCount`.
|
||||
**/
|
||||
TooManyMembers: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The number of unscrupulous items exceeds `MaxUnscrupulousItems`.
|
||||
**/
|
||||
TooManyUnscrupulousItems: AugmentedError<ApiType>;
|
||||
/**
|
||||
* This member is up for being kicked from the Alliance and cannot perform this operation.
|
||||
**/
|
||||
UpForKicking: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The account's identity has no good judgement.
|
||||
**/
|
||||
WithoutGoodIdentityJudgement: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The account's identity does not have display field and website field.
|
||||
**/
|
||||
WithoutIdentityDisplayAndWebsite: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
allianceMotion: {
|
||||
/**
|
||||
* Members are already initialized!
|
||||
**/
|
||||
AlreadyInitialized: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Duplicate proposals not allowed
|
||||
**/
|
||||
DuplicateProposal: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Duplicate vote ignored
|
||||
**/
|
||||
DuplicateVote: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Account is not a member
|
||||
**/
|
||||
NotMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Proposal must exist
|
||||
**/
|
||||
ProposalMissing: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The close call was made too early, before the end of the voting.
|
||||
**/
|
||||
TooEarly: AugmentedError<ApiType>;
|
||||
/**
|
||||
* There can only be a maximum of `MaxProposals` active proposals.
|
||||
**/
|
||||
TooManyProposals: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Mismatched index
|
||||
**/
|
||||
WrongIndex: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given length bound for the proposal was too low.
|
||||
**/
|
||||
WrongProposalLength: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given weight bound for the proposal was too low.
|
||||
**/
|
||||
WrongProposalWeight: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
assets: {
|
||||
/**
|
||||
* The asset-account already exists.
|
||||
@@ -1020,10 +1157,6 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* pool at a time.
|
||||
**/
|
||||
AccountBelongsToOtherPool: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The member is already unbonding in this era.
|
||||
**/
|
||||
AlreadyUnbonding: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The pools state cannot be changed.
|
||||
**/
|
||||
@@ -1036,7 +1169,7 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Some error occurred that should never happen. This should be reported to the
|
||||
* maintainers.
|
||||
**/
|
||||
DefensiveError: AugmentedError<ApiType>;
|
||||
Defensive: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The caller does not have adequate permissions.
|
||||
**/
|
||||
@@ -1046,10 +1179,6 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* 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.
|
||||
**/
|
||||
@@ -1193,6 +1322,98 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
rankedCollective: {
|
||||
/**
|
||||
* Account is already a member.
|
||||
**/
|
||||
AlreadyMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Unexpected error in state.
|
||||
**/
|
||||
Corruption: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The information provided is incorrect.
|
||||
**/
|
||||
InvalidWitness: AugmentedError<ApiType>;
|
||||
/**
|
||||
* There are no further records to be removed.
|
||||
**/
|
||||
NoneRemaining: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The origin is not sufficiently privileged to do the operation.
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Account is not a member.
|
||||
**/
|
||||
NotMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given poll index is unknown or has closed.
|
||||
**/
|
||||
NotPolling: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given poll is still ongoing.
|
||||
**/
|
||||
Ongoing: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The member's rank is too low to vote.
|
||||
**/
|
||||
RankTooLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
rankedPolls: {
|
||||
/**
|
||||
* The referendum index provided is invalid in this context.
|
||||
**/
|
||||
BadReferendum: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The track identifier given was invalid.
|
||||
**/
|
||||
BadTrack: AugmentedError<ApiType>;
|
||||
/**
|
||||
* There are already a full complement of referendums in progress for this track.
|
||||
**/
|
||||
Full: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Referendum's decision deposit is already paid.
|
||||
**/
|
||||
HasDeposit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The deposit cannot be refunded since none was made.
|
||||
**/
|
||||
NoDeposit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The deposit refunder is not the depositor.
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* There was nothing to do in the advancement.
|
||||
**/
|
||||
NothingToDo: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Referendum is not ongoing.
|
||||
**/
|
||||
NotOngoing: AugmentedError<ApiType>;
|
||||
/**
|
||||
* No track exists for the proposal origin.
|
||||
**/
|
||||
NoTrack: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The queue of the track is empty.
|
||||
**/
|
||||
QueueEmpty: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Any deposit cannot be refunded until after the decision is over.
|
||||
**/
|
||||
Unfinished: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
recovery: {
|
||||
/**
|
||||
* This account is already set up for recovery
|
||||
@@ -1564,6 +1785,16 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* bad witness data provided.
|
||||
**/
|
||||
BadWitness: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A key was longer than the configured maximum.
|
||||
*
|
||||
* This means that the migration halted at the current [`Progress`] and
|
||||
* can be resumed with a larger [`crate::Config::MaxKeyLen`] value.
|
||||
* Retrying with the same [`crate::Config::MaxKeyLen`] value will not work.
|
||||
* The value should only be increased to avoid a storage migration for the currently
|
||||
* stored [`crate::Progress::LastKey`].
|
||||
**/
|
||||
KeyTooLong: AugmentedError<ApiType>;
|
||||
/**
|
||||
* max signed limits not respected.
|
||||
**/
|
||||
@@ -1684,6 +1915,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Not a member.
|
||||
**/
|
||||
NotMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many members.
|
||||
**/
|
||||
TooManyMembers: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
@@ -1778,6 +2013,11 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
treasury: {
|
||||
/**
|
||||
* The spend origin is valid but the amount it is allowed to spend is lower than the
|
||||
* amount to be spent.
|
||||
**/
|
||||
InsufficientPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Proposer's balance is too low.
|
||||
**/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,14 +3,83 @@
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
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 { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, WrapperOpaque, bool, u128, u16, 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, PalletUniquesCollectionDetails, PalletUniquesCollectionMetadata, PalletUniquesItemDetails, PalletUniquesItemMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAllianceCid, PalletAllianceMemberRole, 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, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, 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' {
|
||||
export interface AugmentedQueries<ApiType extends ApiTypes> {
|
||||
alliance: {
|
||||
/**
|
||||
* The current IPFS CIDs of any announcements.
|
||||
**/
|
||||
announcements: AugmentedQuery<ApiType, () => Observable<Vec<PalletAllianceCid>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Maps members to their candidacy deposit.
|
||||
**/
|
||||
depositOf: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u128>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Maps member type to members of each type.
|
||||
**/
|
||||
members: AugmentedQuery<ApiType, (arg: PalletAllianceMemberRole | 'Founder' | 'Fellow' | 'Ally' | number | Uint8Array) => Observable<Vec<AccountId32>>, [PalletAllianceMemberRole]> & QueryableStorageEntry<ApiType, [PalletAllianceMemberRole]>;
|
||||
/**
|
||||
* The IPFS CID of the alliance rule.
|
||||
* Founders and fellows can propose a new rule with a super-majority.
|
||||
*
|
||||
* Any founder has a special one-vote veto right to the rule setting.
|
||||
**/
|
||||
rule: AugmentedQuery<ApiType, () => Observable<Option<PalletAllianceCid>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The current list of accounts deemed unscrupulous. These accounts non grata cannot submit
|
||||
* candidacy.
|
||||
**/
|
||||
unscrupulousAccounts: AugmentedQuery<ApiType, () => Observable<Vec<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The current list of websites deemed unscrupulous.
|
||||
**/
|
||||
unscrupulousWebsites: AugmentedQuery<ApiType, () => Observable<Vec<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A set of members that are (potentially) being kicked out. They cannot retire until the
|
||||
* motion is settled.
|
||||
**/
|
||||
upForKicking: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<bool>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
allianceMotion: {
|
||||
/**
|
||||
* The current members of the collective. This is stored sorted (just by value).
|
||||
**/
|
||||
members: AugmentedQuery<ApiType, () => Observable<Vec<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The prime member that helps determine the default vote behavior in case of absentations.
|
||||
**/
|
||||
prime: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Proposals so far.
|
||||
**/
|
||||
proposalCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Actual proposal for a given hash, if it's current.
|
||||
**/
|
||||
proposalOf: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<Call>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
|
||||
/**
|
||||
* The hashes of the active proposals.
|
||||
**/
|
||||
proposals: AugmentedQuery<ApiType, () => Observable<Vec<H256>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Votes on a given proposal, if it is ongoing.
|
||||
**/
|
||||
voting: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<PalletCollectiveVotes>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
assets: {
|
||||
/**
|
||||
* The holdings of a specific account for a specific asset.
|
||||
@@ -354,12 +423,12 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* require. The actual amount locked on behalf of this pallet should always be the maximum of
|
||||
* this list.
|
||||
**/
|
||||
classLocksFor: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<ITuple<[u8, u128]>>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
classLocksFor: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<ITuple<[u16, u128]>>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* All voting for a particular voter in a particular voting class. We store the balance for the
|
||||
* number of votes that we have recorded.
|
||||
**/
|
||||
votingFor: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u8 | AnyNumber | Uint8Array) => Observable<PalletConvictionVotingVoteVoting>, [AccountId32, u8]> & QueryableStorageEntry<ApiType, [AccountId32, u8]>;
|
||||
votingFor: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u16 | AnyNumber | Uint8Array) => Observable<PalletConvictionVotingVoteVoting>, [AccountId32, u16]> & QueryableStorageEntry<ApiType, [AccountId32, u16]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -842,6 +911,9 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
*
|
||||
* This is the amount that the depositor must put as their initial stake in the pool, as an
|
||||
* indication of "skin in the game".
|
||||
*
|
||||
* This is the value that will always exist in the staking ledger of the pool bonded account
|
||||
* while all other accounts leave.
|
||||
**/
|
||||
minCreateBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -938,6 +1010,60 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
rankedCollective: {
|
||||
/**
|
||||
* The index of each ranks's member into the group of members who have at least that rank.
|
||||
**/
|
||||
idToIndex: AugmentedQuery<ApiType, (arg1: u16 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u16, AccountId32]> & QueryableStorageEntry<ApiType, [u16, AccountId32]>;
|
||||
/**
|
||||
* The members in the collective by index. All indices in the range `0..MemberCount` will
|
||||
* return `Some`, however a member's index is not guaranteed to remain unchanged over time.
|
||||
**/
|
||||
indexToId: AugmentedQuery<ApiType, (arg1: u16 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<AccountId32>>, [u16, u32]> & QueryableStorageEntry<ApiType, [u16, u32]>;
|
||||
/**
|
||||
* The number of members in the collective who have at least the rank according to the index
|
||||
* of the vec.
|
||||
**/
|
||||
memberCount: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<u32>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
|
||||
/**
|
||||
* The current members of the collective.
|
||||
**/
|
||||
members: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletRankedCollectiveMemberRecord>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Votes on a given proposal, if it is ongoing.
|
||||
**/
|
||||
voting: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<PalletRankedCollectiveVoteRecord>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
|
||||
votingCleanup: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
rankedPolls: {
|
||||
/**
|
||||
* The number of referenda being decided currently.
|
||||
**/
|
||||
decidingCount: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<u32>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
|
||||
/**
|
||||
* The next free referendum index, aka the number of referenda started so far.
|
||||
**/
|
||||
referendumCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Information concerning any given referendum.
|
||||
**/
|
||||
referendumInfoFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletReferendaReferendumInfoRankedCollectiveTally>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The sorted list of referenda ready to be decided but not yet being decided, ordered by
|
||||
* conviction-weighted approvals.
|
||||
*
|
||||
* This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`.
|
||||
**/
|
||||
trackQueue: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, u32]>>>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
recovery: {
|
||||
/**
|
||||
* Active recovery attempts.
|
||||
@@ -965,7 +1091,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
/**
|
||||
* The number of referenda being decided currently.
|
||||
**/
|
||||
decidingCount: AugmentedQuery<ApiType, (arg: u8 | AnyNumber | Uint8Array) => Observable<u32>, [u8]> & QueryableStorageEntry<ApiType, [u8]>;
|
||||
decidingCount: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<u32>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
|
||||
/**
|
||||
* The next free referendum index, aka the number of referenda started so far.
|
||||
**/
|
||||
@@ -973,14 +1099,14 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
/**
|
||||
* Information concerning any given referendum.
|
||||
**/
|
||||
referendumInfoFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletReferendaReferendumInfo>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
referendumInfoFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletReferendaReferendumInfoConvictionVotingTally>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The sorted list of referenda ready to be decided but not yet being decided, ordered by
|
||||
* conviction-weighted approvals.
|
||||
*
|
||||
* This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`.
|
||||
**/
|
||||
trackQueue: AugmentedQuery<ApiType, (arg: u8 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>, [u8]> & QueryableStorageEntry<ApiType, [u8]>;
|
||||
trackQueue: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
|
||||
@@ -6,10 +6,243 @@ 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, 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, 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';
|
||||
import type { FrameSupportScheduleDispatchTime, FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAllianceCid, PalletAllianceUnscrupulousItem, 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> {
|
||||
alliance: {
|
||||
/**
|
||||
* Add accounts or websites to the list of unscrupulous items.
|
||||
**/
|
||||
addUnscrupulousItems: AugmentedSubmittable<(items: Vec<PalletAllianceUnscrupulousItem> | (PalletAllianceUnscrupulousItem | { AccountId: any } | { Website: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<PalletAllianceUnscrupulousItem>]>;
|
||||
/**
|
||||
* Make an announcement of a new IPFS CID about alliance issues.
|
||||
**/
|
||||
announce: AugmentedSubmittable<(announcement: PalletAllianceCid | { version?: any; codec?: any; hash_?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletAllianceCid]>;
|
||||
/**
|
||||
* Close a vote that is either approved, disapproved, or whose voting period has ended.
|
||||
*
|
||||
* Requires the sender to be a founder or fellow.
|
||||
**/
|
||||
close: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: Compact<u64> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, Compact<u64>, Compact<u32>]>;
|
||||
/**
|
||||
* Elevate an ally to fellow.
|
||||
**/
|
||||
elevateAlly: AugmentedSubmittable<(ally: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress]>;
|
||||
/**
|
||||
* Initialize the founders, fellows, and allies.
|
||||
*
|
||||
* This should only be called once, and must be called by the Root origin.
|
||||
**/
|
||||
initMembers: AugmentedSubmittable<(founders: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], fellows: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], allies: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Vec<AccountId32>, Vec<AccountId32>]>;
|
||||
/**
|
||||
* Submit oneself for candidacy. A fixed deposit is reserved.
|
||||
**/
|
||||
joinAlliance: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
|
||||
/**
|
||||
* Kick a member from the alliance and slash its deposit.
|
||||
**/
|
||||
kickMember: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress]>;
|
||||
/**
|
||||
* A founder or fellow can nominate someone to join the alliance as an Ally.
|
||||
* There is no deposit required to the nominator or nominee.
|
||||
**/
|
||||
nominateAlly: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress]>;
|
||||
/**
|
||||
* Add a new proposal to be voted on.
|
||||
*
|
||||
* Requires the sender to be a founder or fellow.
|
||||
**/
|
||||
propose: AugmentedSubmittable<(threshold: Compact<u32> | AnyNumber | Uint8Array, proposal: Call | IMethod | string | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Call, Compact<u32>]>;
|
||||
/**
|
||||
* Remove an announcement.
|
||||
**/
|
||||
removeAnnouncement: AugmentedSubmittable<(announcement: PalletAllianceCid | { version?: any; codec?: any; hash_?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletAllianceCid]>;
|
||||
/**
|
||||
* Deem an item no longer unscrupulous.
|
||||
**/
|
||||
removeUnscrupulousItems: AugmentedSubmittable<(items: Vec<PalletAllianceUnscrupulousItem> | (PalletAllianceUnscrupulousItem | { AccountId: any } | { Website: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<PalletAllianceUnscrupulousItem>]>;
|
||||
/**
|
||||
* As a member, retire from the alliance and unreserve the deposit.
|
||||
**/
|
||||
retire: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
|
||||
/**
|
||||
* Set a new IPFS CID to the alliance rule.
|
||||
**/
|
||||
setRule: AugmentedSubmittable<(rule: PalletAllianceCid | { version?: any; codec?: any; hash_?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletAllianceCid]>;
|
||||
/**
|
||||
* Veto a proposal about `set_rule` and `elevate_ally`, close, and remove it from the
|
||||
* system, regardless of its current state.
|
||||
*
|
||||
* Must be called by a founder.
|
||||
**/
|
||||
veto: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
|
||||
/**
|
||||
* Add an aye or nay vote for the sender to the given proposal.
|
||||
*
|
||||
* Requires the sender to be a founder or fellow.
|
||||
**/
|
||||
vote: AugmentedSubmittable<(proposal: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, bool]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
allianceMotion: {
|
||||
/**
|
||||
* Close a vote that is either approved, disapproved or whose voting period has ended.
|
||||
*
|
||||
* May be called by any signed account in order to finish voting and close the proposal.
|
||||
*
|
||||
* If called before the end of the voting period it will only close the vote if it is
|
||||
* has enough votes to be approved or disapproved.
|
||||
*
|
||||
* If called after the end of the voting period abstentions are counted as rejections
|
||||
* unless there is a prime member set and the prime member cast an approval.
|
||||
*
|
||||
* If the close operation completes successfully with disapproval, the transaction fee will
|
||||
* be waived. Otherwise execution of the approved operation will be charged to the caller.
|
||||
*
|
||||
* + `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed
|
||||
* proposal.
|
||||
* + `length_bound`: The upper bound for the length of the proposal in storage. Checked via
|
||||
* `storage::read` so it is `size_of::<u32>() == 4` larger than the pure length.
|
||||
*
|
||||
* # <weight>
|
||||
* ## Weight
|
||||
* - `O(B + M + P1 + P2)` where:
|
||||
* - `B` is `proposal` size in bytes (length-fee-bounded)
|
||||
* - `M` is members-count (code- and governance-bounded)
|
||||
* - `P1` is the complexity of `proposal` preimage.
|
||||
* - `P2` is proposal-count (code-bounded)
|
||||
* - DB:
|
||||
* - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)
|
||||
* - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec
|
||||
* `O(P2)`)
|
||||
* - any mutations done while executing `proposal` (`P1`)
|
||||
* - up to 3 events
|
||||
* # </weight>
|
||||
**/
|
||||
close: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, proposalWeightBound: Compact<u64> | AnyNumber | Uint8Array, lengthBound: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, Compact<u64>, Compact<u32>]>;
|
||||
/**
|
||||
* Disapprove a proposal, close, and remove it from the system, regardless of its current
|
||||
* state.
|
||||
*
|
||||
* Must be called by the Root origin.
|
||||
*
|
||||
* Parameters:
|
||||
* * `proposal_hash`: The hash of the proposal that should be disapproved.
|
||||
*
|
||||
* # <weight>
|
||||
* Complexity: O(P) where P is the number of max proposals
|
||||
* DB Weight:
|
||||
* * Reads: Proposals
|
||||
* * Writes: Voting, Proposals, ProposalOf
|
||||
* # </weight>
|
||||
**/
|
||||
disapproveProposal: AugmentedSubmittable<(proposalHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
|
||||
/**
|
||||
* Dispatch a proposal from a member using the `Member` origin.
|
||||
*
|
||||
* Origin must be a member of the collective.
|
||||
*
|
||||
* # <weight>
|
||||
* ## Weight
|
||||
* - `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching
|
||||
* `proposal`
|
||||
* - DB: 1 read (codec `O(M)`) + DB access of `proposal`
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
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.
|
||||
*
|
||||
* Requires the sender to be member.
|
||||
*
|
||||
* `threshold` determines whether `proposal` is executed directly (`threshold < 2`)
|
||||
* or put up for voting.
|
||||
*
|
||||
* # <weight>
|
||||
* ## Weight
|
||||
* - `O(B + M + P1)` or `O(B + M + P2)` where:
|
||||
* - `B` is `proposal` size in bytes (length-fee-bounded)
|
||||
* - `M` is members-count (code- and governance-bounded)
|
||||
* - branching is influenced by `threshold` where:
|
||||
* - `P1` is proposal execution complexity (`threshold < 2`)
|
||||
* - `P2` is proposals-count (code-bounded) (`threshold >= 2`)
|
||||
* - DB:
|
||||
* - 1 storage read `is_member` (codec `O(M)`)
|
||||
* - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)
|
||||
* - DB accesses influenced by `threshold`:
|
||||
* - EITHER storage accesses done by `proposal` (`threshold < 2`)
|
||||
* - OR proposal insertion (`threshold <= 2`)
|
||||
* - 1 storage mutation `Proposals` (codec `O(P2)`)
|
||||
* - 1 storage mutation `ProposalCount` (codec `O(1)`)
|
||||
* - 1 storage write `ProposalOf` (codec `O(B)`)
|
||||
* - 1 storage write `Voting` (codec `O(M)`)
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
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.
|
||||
*
|
||||
* - `new_members`: The new member list. Be nice to the chain and provide it sorted.
|
||||
* - `prime`: The prime member whose vote sets the default.
|
||||
* - `old_count`: The upper bound for the previous number of members in storage. Used for
|
||||
* weight estimation.
|
||||
*
|
||||
* Requires root origin.
|
||||
*
|
||||
* NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but
|
||||
* the weight estimations rely on it to estimate dispatchable weight.
|
||||
*
|
||||
* # WARNING:
|
||||
*
|
||||
* The `pallet-collective` can also be managed by logic outside of the pallet through the
|
||||
* implementation of the trait [`ChangeMembers`].
|
||||
* Any call to `set_members` must be careful that the member set doesn't get out of sync
|
||||
* with other logic managing the member set.
|
||||
*
|
||||
* # <weight>
|
||||
* ## Weight
|
||||
* - `O(MP + N)` where:
|
||||
* - `M` old-members-count (code- and governance-bounded)
|
||||
* - `N` new-members-count (code- and governance-bounded)
|
||||
* - `P` proposals-count (code-bounded)
|
||||
* - DB:
|
||||
* - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the
|
||||
* members
|
||||
* - 1 storage read (codec `O(P)`) for reading the proposals
|
||||
* - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal
|
||||
* - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one
|
||||
* # </weight>
|
||||
**/
|
||||
setMembers: AugmentedSubmittable<(newMembers: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[], prime: Option<AccountId32> | null | object | string | Uint8Array, oldCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>, Option<AccountId32>, u32]>;
|
||||
/**
|
||||
* Add an aye or nay vote for the sender to the given proposal.
|
||||
*
|
||||
* Requires the sender to be a member.
|
||||
*
|
||||
* Transaction fees will be waived if the member is voting on any particular proposal
|
||||
* for the first time and the call is successful. Subsequent vote changes will charge a
|
||||
* fee.
|
||||
* # <weight>
|
||||
* ## Weight
|
||||
* - `O(M)` where `M` is members-count (code- and governance-bounded)
|
||||
* - DB:
|
||||
* - 1 storage read `Members` (codec `O(M)`)
|
||||
* - 1 storage mutation `Voting` (codec `O(M)`)
|
||||
* - 1 event
|
||||
* # </weight>
|
||||
**/
|
||||
vote: AugmentedSubmittable<(proposal: H256 | string | Uint8Array, index: Compact<u32> | AnyNumber | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256, Compact<u32>, bool]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
assets: {
|
||||
/**
|
||||
* Approve an amount of asset for transfer by a delegated third-party account.
|
||||
@@ -1026,7 +1259,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Weight: `O(R)` where R is the number of polls the voter delegating to has
|
||||
* voted on. Weight is initially charged as if maximum votes, but is refunded later.
|
||||
**/
|
||||
delegate: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array, to: AccountId32 | string | Uint8Array, conviction: PalletConvictionVotingConviction | 'None' | 'Locked1x' | 'Locked2x' | 'Locked3x' | 'Locked4x' | 'Locked5x' | 'Locked6x' | number | Uint8Array, balance: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8, AccountId32, PalletConvictionVotingConviction, u128]>;
|
||||
delegate: AugmentedSubmittable<(clazz: u16 | AnyNumber | Uint8Array, to: AccountId32 | string | Uint8Array, conviction: PalletConvictionVotingConviction | 'None' | 'Locked1x' | 'Locked2x' | 'Locked3x' | 'Locked4x' | 'Locked5x' | 'Locked6x' | number | Uint8Array, balance: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, AccountId32, PalletConvictionVotingConviction, u128]>;
|
||||
/**
|
||||
* Remove a vote for a poll.
|
||||
*
|
||||
@@ -1045,7 +1278,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Weight: `O(R + log R)` where R is the number of polls that `target` has voted on.
|
||||
* Weight is calculated for the maximum number of vote.
|
||||
**/
|
||||
removeOtherVote: AugmentedSubmittable<(target: AccountId32 | string | Uint8Array, clazz: u8 | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u8, u32]>;
|
||||
removeOtherVote: AugmentedSubmittable<(target: AccountId32 | string | Uint8Array, clazz: u16 | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u16, u32]>;
|
||||
/**
|
||||
* Remove a vote for a poll.
|
||||
*
|
||||
@@ -1077,7 +1310,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Weight: `O(R + log R)` where R is the number of polls that `target` has voted on.
|
||||
* Weight is calculated for the maximum number of vote.
|
||||
**/
|
||||
removeVote: AugmentedSubmittable<(clazz: Option<u8> | null | object | string | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u8>, u32]>;
|
||||
removeVote: AugmentedSubmittable<(clazz: Option<u16> | null | object | string | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u16>, u32]>;
|
||||
/**
|
||||
* Undelegate the voting power of the sending account for a particular class of polls.
|
||||
*
|
||||
@@ -1094,7 +1327,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Weight: `O(R)` where R is the number of polls the voter delegating to has
|
||||
* voted on. Weight is initially charged as if maximum votes, but is refunded later.
|
||||
**/
|
||||
undelegate: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8]>;
|
||||
undelegate: AugmentedSubmittable<(clazz: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16]>;
|
||||
/**
|
||||
* Remove the lock caused prior voting/delegating which has expired within a particluar
|
||||
* class.
|
||||
@@ -1106,7 +1339,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(R)` with R number of vote of target.
|
||||
**/
|
||||
unlock: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array, target: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8, AccountId32]>;
|
||||
unlock: AugmentedSubmittable<(clazz: u16 | AnyNumber | Uint8Array, target: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16, AccountId32]>;
|
||||
/**
|
||||
* Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;
|
||||
* otherwise it is a vote to keep the status quo.
|
||||
@@ -1838,12 +2071,17 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
};
|
||||
grandpa: {
|
||||
/**
|
||||
* Note that the current authority set of the GRANDPA finality gadget has
|
||||
* stalled. This will trigger a forced authority set change at the beginning
|
||||
* of the next session, to be enacted `delay` blocks after that. The delay
|
||||
* should be high enough to safely assume that the block signalling the
|
||||
* forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters
|
||||
* will start the new authority set using the given finalized block as base.
|
||||
* Note that the current authority set of the GRANDPA finality gadget has stalled.
|
||||
*
|
||||
* This will trigger a forced authority set change at the beginning of the next session, to
|
||||
* be enacted `delay` blocks after that. The `delay` should be high enough to safely assume
|
||||
* that the block signalling the forced change will not be re-orged e.g. 1000 blocks.
|
||||
* The block production rate (which may be slowed down because of finality lagging) should
|
||||
* be taken into account when choosing the `delay`. The GRANDPA voters based on the new
|
||||
* authority will start voting on top of `best_finalized_block_number` for new finalized
|
||||
* blocks. `best_finalized_block_number` should be the highest of the latest finalized
|
||||
* block of all validators of the new authority set.
|
||||
*
|
||||
* Only callable by root.
|
||||
**/
|
||||
noteStalled: AugmentedSubmittable<(delay: u32 | AnyNumber | Uint8Array, bestFinalizedBlockNumber: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
@@ -2469,6 +2707,16 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* accumulated rewards, see [`BondExtra`].
|
||||
**/
|
||||
bondExtra: AugmentedSubmittable<(extra: PalletNominationPoolsBondExtra | { FreeBalance: any } | { Rewards: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletNominationPoolsBondExtra]>;
|
||||
/**
|
||||
* Chill on behalf of the pool.
|
||||
*
|
||||
* The dispatch origin of this call must be signed by the pool nominator or the pool
|
||||
* root role, same as [`Pallet::nominate`].
|
||||
*
|
||||
* This directly forward the call to the staking pallet, on behalf of the pool bonded
|
||||
* account.
|
||||
**/
|
||||
chill: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* 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
|
||||
@@ -2511,6 +2759,15 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* * 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 on behalf of the pool.
|
||||
*
|
||||
* The dispatch origin of this call must be signed by the pool nominator or the pool
|
||||
* root role.
|
||||
*
|
||||
* This directly forward the call to the staking pallet, on behalf of the pool bonded
|
||||
* account.
|
||||
**/
|
||||
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.
|
||||
@@ -2534,12 +2791,24 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* * `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]>;
|
||||
/**
|
||||
* Set a new metadata for the pool.
|
||||
*
|
||||
* The dispatch origin of this call must be signed by the state toggler, or the root role
|
||||
* of the pool.
|
||||
**/
|
||||
setMetadata: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, metadata: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes]>;
|
||||
/**
|
||||
* Set a new state for the pool.
|
||||
*
|
||||
* The dispatch origin of this call must be signed by the state toggler, or the root role
|
||||
* of the pool.
|
||||
**/
|
||||
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.
|
||||
* rewards would be forfeited.
|
||||
*
|
||||
* Under certain conditions, this call can be dispatched permissionlessly (i.e. by any
|
||||
* account).
|
||||
@@ -2832,6 +3101,154 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
rankedCollective: {
|
||||
/**
|
||||
* Introduce a new member.
|
||||
*
|
||||
* - `origin`: Must be the `AdminOrigin`.
|
||||
* - `who`: Account of non-member which will become a member.
|
||||
* - `rank`: The rank to give the new member.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
addMember: AugmentedSubmittable<(who: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Remove votes from the given poll. It must have ended.
|
||||
*
|
||||
* - `origin`: Must be `Signed` by any account.
|
||||
* - `poll_index`: Index of a poll which is completed and for which votes continue to
|
||||
* exist.
|
||||
* - `max`: Maximum number of vote items from remove in this call.
|
||||
*
|
||||
* Transaction fees are waived if the operation is successful.
|
||||
*
|
||||
* Weight `O(max)` (less if there are fewer items to remove than `max`).
|
||||
**/
|
||||
cleanupPoll: AugmentedSubmittable<(pollIndex: u32 | AnyNumber | Uint8Array, max: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Decrement the rank of an existing member by one. If the member is already at rank zero,
|
||||
* then they are removed entirely.
|
||||
*
|
||||
* - `origin`: Must be the `AdminOrigin`.
|
||||
* - `who`: Account of existing member of rank greater than zero.
|
||||
*
|
||||
* Weight: `O(1)`, less if the member's index is highest in its rank.
|
||||
**/
|
||||
demoteMember: AugmentedSubmittable<(who: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Increment the rank of an existing member by one.
|
||||
*
|
||||
* - `origin`: Must be the `AdminOrigin`.
|
||||
* - `who`: Account of existing member.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
promoteMember: AugmentedSubmittable<(who: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Remove the member entirely.
|
||||
*
|
||||
* - `origin`: Must be the `AdminOrigin`.
|
||||
* - `who`: Account of existing member of rank greater than zero.
|
||||
* - `min_rank`: The rank of the member or greater.
|
||||
*
|
||||
* Weight: `O(min_rank)`.
|
||||
**/
|
||||
removeMember: AugmentedSubmittable<(who: AccountId32 | string | Uint8Array, minRank: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u16]>;
|
||||
/**
|
||||
* Add an aye or nay vote for the sender to the given proposal.
|
||||
*
|
||||
* - `origin`: Must be `Signed` by a member account.
|
||||
* - `poll`: Index of a poll which is ongoing.
|
||||
* - `aye`: `true` if the vote is to approve the proposal, `false` otherwise.
|
||||
*
|
||||
* Transaction fees are be waived if the member is voting on any particular proposal
|
||||
* for the first time and the call is successful. Subsequent vote changes will charge a
|
||||
* fee.
|
||||
*
|
||||
* Weight: `O(1)`, less if there was no previous vote on the poll by the member.
|
||||
**/
|
||||
vote: AugmentedSubmittable<(poll: u32 | AnyNumber | Uint8Array, aye: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, bool]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
rankedPolls: {
|
||||
/**
|
||||
* Cancel an ongoing referendum.
|
||||
*
|
||||
* - `origin`: must be the `CancelOrigin`.
|
||||
* - `index`: The index of the referendum to be cancelled.
|
||||
*
|
||||
* Emits `Cancelled`.
|
||||
**/
|
||||
cancel: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Cancel an ongoing referendum and slash the deposits.
|
||||
*
|
||||
* - `origin`: must be the `KillOrigin`.
|
||||
* - `index`: The index of the referendum to be cancelled.
|
||||
*
|
||||
* Emits `Killed` and `DepositSlashed`.
|
||||
**/
|
||||
kill: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Advance a referendum onto its next logical state. Only used internally.
|
||||
*
|
||||
* - `origin`: must be `Root`.
|
||||
* - `index`: the referendum to be advanced.
|
||||
**/
|
||||
nudgeReferendum: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Advance a track onto its next logical state. Only used internally.
|
||||
*
|
||||
* - `origin`: must be `Root`.
|
||||
* - `track`: the track to be advanced.
|
||||
*
|
||||
* Action item for when there is now one fewer referendum in the deciding phase and the
|
||||
* `DecidingCount` is not yet updated. This means that we should either:
|
||||
* - begin deciding another referendum (and leave `DecidingCount` alone); or
|
||||
* - decrement `DecidingCount`.
|
||||
**/
|
||||
oneFewerDeciding: AugmentedSubmittable<(track: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16]>;
|
||||
/**
|
||||
* Post the Decision Deposit for a referendum.
|
||||
*
|
||||
* - `origin`: must be `Signed` and the account must have funds available for the
|
||||
* referendum's track's Decision Deposit.
|
||||
* - `index`: The index of the submitted referendum whose Decision Deposit is yet to be
|
||||
* posted.
|
||||
*
|
||||
* Emits `DecisionDepositPlaced`.
|
||||
**/
|
||||
placeDecisionDeposit: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Refund the Decision Deposit for a closed referendum back to the depositor.
|
||||
*
|
||||
* - `origin`: must be `Signed` or `Root`.
|
||||
* - `index`: The index of a closed referendum whose Decision Deposit has not yet been
|
||||
* refunded.
|
||||
*
|
||||
* Emits `DecisionDepositRefunded`.
|
||||
**/
|
||||
refundDecisionDeposit: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Propose a referendum on a privileged action.
|
||||
*
|
||||
* - `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds
|
||||
* available.
|
||||
* - `proposal_origin`: The origin from which the proposal should be executed.
|
||||
* - `proposal_hash`: The hash of the proposal preimage.
|
||||
* - `enactment_moment`: The moment that the proposal should be enacted.
|
||||
*
|
||||
* Emits `Submitted`.
|
||||
**/
|
||||
submit: AugmentedSubmittable<(proposalOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { AllianceMotion: any } | string | Uint8Array, proposalHash: H256 | string | Uint8Array, enactmentMoment: FrameSupportScheduleDispatchTime | { At: any } | { After: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, H256, FrameSupportScheduleDispatchTime]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
recovery: {
|
||||
/**
|
||||
* Send a call through a recovered account.
|
||||
@@ -2995,7 +3412,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - begin deciding another referendum (and leave `DecidingCount` alone); or
|
||||
* - decrement `DecidingCount`.
|
||||
**/
|
||||
oneFewerDeciding: AugmentedSubmittable<(track: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8]>;
|
||||
oneFewerDeciding: AugmentedSubmittable<(track: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u16]>;
|
||||
/**
|
||||
* Post the Decision Deposit for a referendum.
|
||||
*
|
||||
@@ -3020,7 +3437,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
/**
|
||||
* Propose a referendum on a privileged action.
|
||||
*
|
||||
* - `origin`: must be `Signed` and the account must have `SubmissionDeposit` funds
|
||||
* - `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds
|
||||
* available.
|
||||
* - `proposal_origin`: The origin from which the proposal should be executed.
|
||||
* - `proposal_hash`: The hash of the proposal preimage.
|
||||
@@ -3028,7 +3445,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Emits `Submitted`.
|
||||
**/
|
||||
submit: AugmentedSubmittable<(proposalOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, proposalHash: H256 | string | Uint8Array, enactmentMoment: FrameSupportScheduleDispatchTime | { At: any } | { After: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, H256, FrameSupportScheduleDispatchTime]>;
|
||||
submit: AugmentedSubmittable<(proposalOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { AllianceMotion: any } | string | Uint8Array, proposalHash: H256 | string | Uint8Array, enactmentMoment: FrameSupportScheduleDispatchTime | { At: any } | { After: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, H256, FrameSupportScheduleDispatchTime]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -4510,6 +4927,17 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* exist altogether, thus there is no way it would have been approved in the first place.
|
||||
**/
|
||||
removeApproval: AugmentedSubmittable<(proposalId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
|
||||
/**
|
||||
* Propose and approve a spend of treasury funds.
|
||||
*
|
||||
* - `origin`: Must be `SpendOrigin` with the `Success` value being at least `amount`.
|
||||
* - `amount`: The amount to be transferred from the treasury to the `beneficiary`.
|
||||
* - `beneficiary`: The destination account for the transfer.
|
||||
*
|
||||
* NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the
|
||||
* beneficiary.
|
||||
**/
|
||||
spend: AugmentedSubmittable<(amount: Compact<u128> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, MultiAddress]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -4979,7 +5407,7 @@ 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 | IMethod | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, Call]>;
|
||||
dispatchAs: AugmentedSubmittable<(asOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | { AllianceMotion: 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.
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/rpc-core": "8.6.2",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1",
|
||||
"@polkadot/rpc-core": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/util": "^9.4.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.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -16,8 +16,8 @@ export interface DecoratedEvents<ApiType extends ApiTypes> extends AugmentedEven
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type AugmentedEvent<ApiType extends ApiTypes, T extends AnyTuple = AnyTuple> = IsEvent<T>;
|
||||
export type AugmentedEvent<ApiType extends ApiTypes, T extends AnyTuple = AnyTuple, N = unknown> = IsEvent<T, N>;
|
||||
|
||||
export interface ModuleEvents<ApiType extends ApiTypes> {
|
||||
[key: string]: AugmentedEvent<ApiType, AnyTuple>;
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
}
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@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",
|
||||
"@polkadot/api": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/types-create": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"@polkadot/util-crypto": "^9.4.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "8.6.2",
|
||||
"@polkadot/keyring": "^9.3.1"
|
||||
"@polkadot/api-augment": "8.8.2",
|
||||
"@polkadot/keyring": "^9.4.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.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@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",
|
||||
"@polkadot/api": "8.8.2",
|
||||
"@polkadot/api-augment": "8.8.2",
|
||||
"@polkadot/api-base": "8.8.2",
|
||||
"@polkadot/rpc-core": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"@polkadot/util-crypto": "^9.4.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@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"
|
||||
"@polkadot/api": "8.8.2",
|
||||
"@polkadot/api-augment": "8.8.2",
|
||||
"@polkadot/rpc-augment": "8.8.2",
|
||||
"@polkadot/rpc-provider": "8.8.2",
|
||||
"@polkadot/types-support": "8.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,15 +3,19 @@
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { AccountId, Address, Balance } from '@polkadot/types/interfaces';
|
||||
import type{ PalletElectionsPhragmenSeatHolder } from '@polkadot/types/lookup';
|
||||
import type { Codec } from '@polkadot/types/types';
|
||||
import type { Option } from '@polkadot/types-codec';
|
||||
import type { DeriveAccountFlags, DeriveApi } from '../types';
|
||||
|
||||
import { combineLatest, map, of } from 'rxjs';
|
||||
import { map, of } from 'rxjs';
|
||||
|
||||
import { isFunction } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
type FlagsIntermediate = [
|
||||
[AccountId, Balance][] | undefined,
|
||||
PalletElectionsPhragmenSeatHolder[] | [AccountId, Balance][] | undefined,
|
||||
AccountId[],
|
||||
AccountId[],
|
||||
AccountId[],
|
||||
@@ -24,39 +28,53 @@ function parseFlags (address: AccountId | Address | string | null | undefined, [
|
||||
id.toString() === addrStr;
|
||||
|
||||
return {
|
||||
isCouncil: (electionsMembers?.map(([id]) => id) || councilMembers || []).some(isIncluded),
|
||||
isCouncil: (electionsMembers?.map((r) => Array.isArray(r) ? r[0] : r.who) || councilMembers || []).some(isIncluded),
|
||||
isSociety: (societyMembers || []).some(isIncluded),
|
||||
isSudo: sudoKey?.toString() === addrStr,
|
||||
isTechCommittee: (technicalCommitteeMembers || []).some(isIncluded)
|
||||
};
|
||||
}
|
||||
|
||||
export function _flags (instanceId: string, api: DeriveApi): () => Observable<FlagsIntermediate> {
|
||||
return memo(instanceId, (): Observable<FlagsIntermediate> => {
|
||||
const results: unknown[] = [undefined, [], [], [], undefined];
|
||||
const calls = [
|
||||
(api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections)?.members,
|
||||
api.query.council?.members,
|
||||
api.query.technicalCommittee?.members,
|
||||
api.query.society?.members,
|
||||
api.query.sudo?.key
|
||||
];
|
||||
const filtered = calls.filter((c) => c);
|
||||
|
||||
if (!filtered.length) {
|
||||
return of(results as FlagsIntermediate);
|
||||
}
|
||||
|
||||
return api.queryMulti(filtered).pipe(
|
||||
map((values: Codec[]): FlagsIntermediate => {
|
||||
let resultIndex = -1;
|
||||
|
||||
for (let i = 0; i < calls.length; i++) {
|
||||
if (isFunction(calls[i])) {
|
||||
results[i] = values[++resultIndex];
|
||||
}
|
||||
}
|
||||
|
||||
return results as FlagsIntermediate;
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @name info
|
||||
* @description Returns account membership flags
|
||||
*/
|
||||
export function flags (instanceId: string, api: DeriveApi): (address?: AccountId | Address | string | null) => Observable<DeriveAccountFlags> {
|
||||
return memo(instanceId, (address?: AccountId | Address | string | null): Observable<DeriveAccountFlags> => {
|
||||
const elections = api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections;
|
||||
|
||||
return combineLatest([
|
||||
address && elections?.members
|
||||
? elections.members<[AccountId, Balance][]>()
|
||||
: of(undefined),
|
||||
address && api.query.council?.members
|
||||
? api.query.council.members()
|
||||
: of([]),
|
||||
address && api.query.technicalCommittee?.members
|
||||
? api.query.technicalCommittee.members()
|
||||
: of([]),
|
||||
address && api.query.society?.members
|
||||
? api.query.society.members()
|
||||
: of([]),
|
||||
address && api.query.sudo?.key
|
||||
? api.query.sudo.key()
|
||||
: of(undefined)
|
||||
]).pipe(
|
||||
return memo(instanceId, (address?: AccountId | Address | string | null): Observable<DeriveAccountFlags> =>
|
||||
api.derive.accounts._flags().pipe(
|
||||
map((r) => parseFlags(address, r))
|
||||
);
|
||||
});
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -71,9 +71,10 @@ function getParent (api: DeriveApi, identityOfOpt: Option<PalletIdentityRegistra
|
||||
} else if (superOfOpt?.isSome) {
|
||||
const superOf = superOfOpt.unwrap();
|
||||
|
||||
// we have a super
|
||||
return combineLatest([
|
||||
api.query.identity.identityOf(superOf[0]),
|
||||
api.derive.accounts._identity(superOf[0]).pipe(
|
||||
map(([info]) => info)
|
||||
),
|
||||
of(superOf)
|
||||
]);
|
||||
}
|
||||
@@ -82,13 +83,15 @@ function getParent (api: DeriveApi, identityOfOpt: Option<PalletIdentityRegistra
|
||||
return of([undefined, undefined]);
|
||||
}
|
||||
|
||||
function getBase (api: DeriveApi, accountId?: AccountId | Uint8Array | string): Observable<[Option<PalletIdentityRegistration> | undefined, Option<ITuple<[AccountId, Data]>> | undefined]> {
|
||||
return accountId && api.query.identity?.identityOf
|
||||
? api.queryMulti<[Option<PalletIdentityRegistration>, Option<ITuple<[AccountId, Data]>>]>([
|
||||
[api.query.identity.identityOf, accountId],
|
||||
[api.query.identity.superOf, accountId]
|
||||
])
|
||||
: of([undefined, undefined]);
|
||||
export function _identity (instanceId: string, api: DeriveApi): (accountId?: AccountId | Uint8Array | string) => Observable<[Option<PalletIdentityRegistration> | undefined, Option<ITuple<[AccountId, Data]>> | undefined]> {
|
||||
return memo(instanceId, (accountId?: AccountId | Uint8Array | string): Observable<[Option<PalletIdentityRegistration> | undefined, Option<ITuple<[AccountId, Data]>> | undefined]> =>
|
||||
accountId && api.query.identity?.identityOf
|
||||
? combineLatest([
|
||||
api.query.identity.identityOf(accountId),
|
||||
api.query.identity.superOf(accountId)
|
||||
])
|
||||
: of([undefined, undefined])
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,9 +100,13 @@ function getBase (api: DeriveApi, accountId?: AccountId | Uint8Array | string):
|
||||
*/
|
||||
export function identity (instanceId: string, api: DeriveApi): (accountId?: AccountId | Uint8Array | string) => Observable<DeriveAccountRegistration> {
|
||||
return memo(instanceId, (accountId?: AccountId | Uint8Array | string): Observable<DeriveAccountRegistration> =>
|
||||
getBase(api, accountId).pipe(
|
||||
switchMap(([identityOfOpt, superOfOpt]) => getParent(api, identityOfOpt, superOfOpt)),
|
||||
map(([identityOfOpt, superOf]) => extractIdentity(identityOfOpt, superOf))
|
||||
api.derive.accounts._identity(accountId).pipe(
|
||||
switchMap(([identityOfOpt, superOfOpt]) =>
|
||||
getParent(api, identityOfOpt, superOfOpt)
|
||||
),
|
||||
map(([identityOfOpt, superOf]) =>
|
||||
extractIdentity(identityOfOpt, superOf)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { Option } from '@polkadot/types';
|
||||
import type { Option, u64 } from '@polkadot/types';
|
||||
import type { PalletBagsListListBag } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { DeriveApi } from '../types';
|
||||
@@ -43,7 +43,7 @@ export function _getIds (instanceId: string, api: DeriveApi): (ids: (BN | number
|
||||
const ids = _ids.map((id) => bnToBn(id));
|
||||
|
||||
return ids.length
|
||||
? api.query.listBags.multi<Option<PalletBagsListListBag>[]>(ids).pipe(
|
||||
? (api.query.voterList || api.query.bagsList).listBags.multi<Option<PalletBagsListListBag>>(ids).pipe(
|
||||
map((bags) => orderBags(ids, bags))
|
||||
)
|
||||
: of([]);
|
||||
@@ -52,7 +52,7 @@ export function _getIds (instanceId: string, api: DeriveApi): (ids: (BN | number
|
||||
|
||||
export function all (instanceId: string, api: DeriveApi): () => Observable<Bag[]> {
|
||||
return memo(instanceId, (): Observable<Bag[]> =>
|
||||
api.query.bagsList.listBags.keys().pipe(
|
||||
(api.query.voterList || api.query.bagsList).listBags.keys<[u64]>().pipe(
|
||||
switchMap((keys) =>
|
||||
api.derive.bagsList._getIds(keys.map(({ args: [id] }) => id))
|
||||
),
|
||||
|
||||
@@ -9,6 +9,8 @@ import type { DeriveApi } from '../types';
|
||||
|
||||
import { BehaviorSubject, map, of, switchMap, tap, toArray } from 'rxjs';
|
||||
|
||||
import { nextTick } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
function traverseLinks (api: DeriveApi, head: AccountId32 | string): Observable<PalletBagsListListNode[]> {
|
||||
@@ -16,14 +18,14 @@ function traverseLinks (api: DeriveApi, head: AccountId32 | string): Observable<
|
||||
|
||||
return subject.pipe(
|
||||
switchMap((account) =>
|
||||
api.query.bagsList.listNodes(account)
|
||||
(api.query.voterList || api.query.bagsList).listNodes<Option<PalletBagsListListNode>>(account)
|
||||
),
|
||||
tap((node: Option<PalletBagsListListNode>): void => {
|
||||
setTimeout((): void => {
|
||||
nextTick((): void => {
|
||||
node.isSome && node.value.next.isSome
|
||||
? subject.next(node.unwrap().next.unwrap())
|
||||
: subject.complete();
|
||||
}, 0);
|
||||
});
|
||||
}),
|
||||
toArray(), // toArray since we want to startSubject to be completed
|
||||
map((all: Option<PalletBagsListListNode>[]) =>
|
||||
|
||||
@@ -50,10 +50,10 @@ function calcBalances (api: DeriveApi, [accountId, [accountNonce, [primary, ...a
|
||||
|
||||
// old
|
||||
function queryBalancesFree (api: DeriveApi, accountId: AccountId): Observable<Result> {
|
||||
return api.queryMulti<[Balance, Balance, Index]>([
|
||||
[api.query.balances.freeBalance, accountId],
|
||||
[api.query.balances.reservedBalance, accountId],
|
||||
[api.query.system.accountNonce, accountId]
|
||||
return combineLatest([
|
||||
api.query.balances.freeBalance<Balance>(accountId),
|
||||
api.query.balances.reservedBalance<Balance>(accountId),
|
||||
api.query.system.accountNonce<Index>(accountId)
|
||||
]).pipe(
|
||||
map(([freeBalance, reservedBalance, accountNonce]): Result => [
|
||||
accountNonce,
|
||||
@@ -82,8 +82,7 @@ function queryNonceOnly (api: DeriveApi, accountId: AccountId): Observable<Resul
|
||||
function queryBalancesAccount (api: DeriveApi, accountId: AccountId, modules: string[] = ['balances']): Observable<Result> {
|
||||
const balances = modules
|
||||
.map((m): QueryableStorageEntry<'rxjs'> => (api.derive as DeriveCustomAccount)[m]?.customAccount || api.query[m]?.account)
|
||||
.filter((q) => isFunction(q))
|
||||
.map((q): [QueryableStorageEntry<'rxjs'>, AccountId] => [q, accountId]);
|
||||
.filter((q) => isFunction(q));
|
||||
|
||||
const extract = (nonce: Index, data: AccountData[]): Result => [
|
||||
nonce,
|
||||
@@ -93,11 +92,17 @@ function queryBalancesAccount (api: DeriveApi, accountId: AccountId, modules: st
|
||||
// NOTE this is for the first case where we do have instances specified
|
||||
return balances.length
|
||||
? isFunction(api.query.system.account)
|
||||
? api.queryMulti<[AccountInfo, ...(AccountData[])]>([[api.query.system.account, accountId], ...balances]).pipe(
|
||||
map(([{ nonce }, ...balances]) => extract(nonce, balances))
|
||||
? combineLatest([
|
||||
api.query.system.account(accountId),
|
||||
...balances.map((c) => c(accountId))
|
||||
]).pipe(
|
||||
map(([{ nonce }, ...balances]) => extract(nonce, balances as unknown as AccountData[]))
|
||||
)
|
||||
: api.queryMulti<[Index, ...(AccountData[])]>([[api.query.system.accountNonce, accountId], ...balances]).pipe(
|
||||
map(([nonce, ...balances]) => extract(nonce, balances))
|
||||
: combineLatest([
|
||||
api.query.system.accountNonce<Index>(accountId),
|
||||
...balances.map((c) => c(accountId))
|
||||
]).pipe(
|
||||
map(([nonce, ...balances]) => extract(nonce, balances as unknown as AccountData[]))
|
||||
)
|
||||
: queryNonceOnly(api, accountId);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { QueryableStorageMultiArg } from '@polkadot/api-base/types';
|
||||
import type { Option, Vec } from '@polkadot/types';
|
||||
import type { AccountId, AccountIndex, Address, Balance, BalanceLockTo212, BlockNumber, VestingSchedule } from '@polkadot/types/interfaces';
|
||||
import type { AccountId, Balance, BalanceLockTo212, BlockNumber, VestingSchedule } from '@polkadot/types/interfaces';
|
||||
import type { PalletBalancesBalanceLock, PalletBalancesReserveData, PalletVestingVestingInfo } from '@polkadot/types/lookup';
|
||||
import type { DeriveApi, DeriveBalancesAccount, DeriveBalancesAccountData, DeriveBalancesAll, DeriveBalancesAllAccountData, DeriveBalancesAllVesting } from '../types';
|
||||
|
||||
@@ -15,7 +14,7 @@ import { BN, BN_ZERO, bnMax, bnMin, isFunction } from '@polkadot/util';
|
||||
import { memo } from '../util';
|
||||
|
||||
type ResultBalance = [PalletVestingVestingInfo[] | null, ((PalletBalancesBalanceLock | BalanceLockTo212)[])[], PalletBalancesReserveData[][]];
|
||||
type Result = [DeriveBalancesAccount, BlockNumber, ResultBalance];
|
||||
type Result = [DeriveBalancesAccount, ResultBalance, BlockNumber];
|
||||
|
||||
interface AllLocked {
|
||||
allLocked: boolean,
|
||||
@@ -100,7 +99,7 @@ function calcVesting (bestNumber: BlockNumber, shared: DeriveBalancesAllAccountD
|
||||
};
|
||||
}
|
||||
|
||||
function calcBalances (api: DeriveApi, [data, bestNumber, [vesting, allLocks, namedReserves]]: Result): DeriveBalancesAll {
|
||||
function calcBalances (api: DeriveApi, [data, [vesting, allLocks, namedReserves], bestNumber]: Result): DeriveBalancesAll {
|
||||
const shared = calcShared(api, bestNumber, data, allLocks[0]);
|
||||
|
||||
return {
|
||||
@@ -116,10 +115,10 @@ function calcBalances (api: DeriveApi, [data, bestNumber, [vesting, allLocks, na
|
||||
}
|
||||
|
||||
// old
|
||||
function queryOld (api: DeriveApi, accountId: AccountId): Observable<ResultBalance> {
|
||||
return api.queryMulti<[Vec<PalletBalancesBalanceLock>, Option<VestingSchedule>]>([
|
||||
[api.query.balances.locks, accountId],
|
||||
[api.query.balances.vesting, accountId]
|
||||
function queryOld (api: DeriveApi, accountId: AccountId | string): Observable<ResultBalance> {
|
||||
return combineLatest([
|
||||
api.query.balances.locks(accountId),
|
||||
api.query.balances.vesting<Option<VestingSchedule>>(accountId)
|
||||
]).pipe(
|
||||
map(([locks, optVesting]): ResultBalance => {
|
||||
let vestingNew = null;
|
||||
@@ -143,26 +142,22 @@ function queryOld (api: DeriveApi, accountId: AccountId): Observable<ResultBalan
|
||||
|
||||
const isNonNullable = <T>(nullable: T): nullable is NonNullable<T> => !!nullable;
|
||||
|
||||
function createCalls (accountId: AccountId, calls: unknown[]): [boolean[], QueryableStorageMultiArg<'rxjs'>[]] {
|
||||
function createCalls <T> (calls: (((a: unknown) => Observable<T>) | null | undefined)[]): [boolean[], ((a: unknown) => Observable<T>)[]] {
|
||||
return [
|
||||
calls.map((c) => !c),
|
||||
calls
|
||||
.filter(isNonNullable)
|
||||
.map((c) => [c, accountId] as unknown as QueryableStorageMultiArg<'rxjs'>)
|
||||
calls.filter(isNonNullable)
|
||||
];
|
||||
}
|
||||
|
||||
// current (balances, vesting)
|
||||
function queryCurrent (api: DeriveApi, accountId: AccountId, balanceInstances: string[] = ['balances']): Observable<ResultBalance> {
|
||||
const [lockEmpty, lockQueries] = createCalls(
|
||||
accountId,
|
||||
balanceInstances.map((m): DeriveApi['query']['balances']['locks'] | undefined =>
|
||||
function queryCurrent (api: DeriveApi, accountId: AccountId | string, balanceInstances: string[] = ['balances']): Observable<ResultBalance> {
|
||||
const [lockEmpty, lockQueries] = createCalls<Vec<PalletBalancesBalanceLock>>(
|
||||
balanceInstances.map((m) =>
|
||||
(api.derive as DeriveCustomLocks)[m]?.customLocks || api.query[m as 'balances']?.locks
|
||||
)
|
||||
);
|
||||
const [reserveEmpty, reserveQueries] = createCalls(
|
||||
accountId,
|
||||
balanceInstances.map((m): DeriveApi['query']['balances']['reserves'] | undefined =>
|
||||
const [reserveEmpty, reserveQueries] = createCalls<Vec<PalletBalancesReserveData>>(
|
||||
balanceInstances.map((m) =>
|
||||
api.query[m as 'balances']?.reserves
|
||||
)
|
||||
);
|
||||
@@ -172,10 +167,10 @@ function queryCurrent (api: DeriveApi, accountId: AccountId, balanceInstances: s
|
||||
? api.query.vesting.vesting(accountId)
|
||||
: of(api.registry.createType('Option<VestingInfo>')),
|
||||
lockQueries.length
|
||||
? api.queryMulti<[...(Vec<PalletBalancesBalanceLock>)[]]>(lockQueries)
|
||||
? combineLatest(lockQueries.map((c) => c(accountId)))
|
||||
: of([] as Vec<PalletBalancesBalanceLock>[]),
|
||||
reserveQueries.length
|
||||
? api.queryMulti<[...(Vec<PalletBalancesReserveData>)[]]>(reserveQueries)
|
||||
? combineLatest(reserveQueries.map((c) => c(accountId)))
|
||||
: of([] as Vec<PalletBalancesReserveData>[])
|
||||
]).pipe(
|
||||
map(([opt, locks, reserves]): ResultBalance => {
|
||||
@@ -215,23 +210,23 @@ function queryCurrent (api: DeriveApi, accountId: AccountId, balanceInstances: s
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function all (instanceId: string, api: DeriveApi): (address: AccountIndex | AccountId | Address | string) => Observable<DeriveBalancesAll> {
|
||||
export function all (instanceId: string, api: DeriveApi): (address: AccountId | string) => Observable<DeriveBalancesAll> {
|
||||
const balanceInstances = api.registry.getModuleInstances(api.runtimeVersion.specName.toString(), 'balances');
|
||||
|
||||
return memo(instanceId, (address: AccountIndex | AccountId | Address | string): Observable<DeriveBalancesAll> =>
|
||||
api.derive.balances.account(address).pipe(
|
||||
switchMap((account): Observable<Result> =>
|
||||
(!account.accountId.isEmpty
|
||||
? combineLatest([
|
||||
of(account),
|
||||
api.derive.chain.bestNumber(),
|
||||
isFunction(api.query.system?.account) || isFunction(api.query.balances?.account)
|
||||
? queryCurrent(api, account.accountId, balanceInstances)
|
||||
: queryOld(api, account.accountId)
|
||||
])
|
||||
: of([account, api.registry.createType('BlockNumber'), [null, [], []]])
|
||||
)
|
||||
return memo(instanceId, (address: AccountId | string): Observable<DeriveBalancesAll> =>
|
||||
combineLatest([
|
||||
api.derive.balances.account(address),
|
||||
isFunction(api.query.system?.account) || isFunction(api.query.balances?.account)
|
||||
? queryCurrent(api, address, balanceInstances)
|
||||
: queryOld(api, address)
|
||||
]).pipe(
|
||||
switchMap(([account, locks]) =>
|
||||
combineLatest([
|
||||
of(account),
|
||||
of(locks),
|
||||
api.derive.chain.bestNumber()
|
||||
])
|
||||
),
|
||||
map((result): DeriveBalancesAll => calcBalances(api, result))
|
||||
map((result) => calcBalances(api, result))
|
||||
));
|
||||
}
|
||||
|
||||
@@ -156,6 +156,6 @@ describe('bounties derive', () => {
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result[0].proposals).toHaveLength(0);
|
||||
expect(result[1].proposals).toHaveLength(1);
|
||||
expect(result[1].proposals[0].proposal.method).toEqual('approveBounty');
|
||||
expect(result[1].proposals[0].proposal && result[1].proposals[0].proposal.method).toEqual('approveBounty');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,7 +23,9 @@ function parseResult ([maybeBounties, maybeDescriptions, ids, bountyProposals]:
|
||||
bounty: bounty.unwrap(),
|
||||
description: maybeDescriptions[index].unwrapOrDefault().toUtf8(),
|
||||
index: ids[index],
|
||||
proposals: bountyProposals.filter((bountyProposal) => ids[index].eq(bountyProposal.proposal.args[0]))
|
||||
proposals: bountyProposals.filter((bountyProposal) =>
|
||||
bountyProposal.proposal && ids[index].eq(bountyProposal.proposal.args[0])
|
||||
)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -7,5 +7,7 @@ export function filterBountiesProposals (api: DeriveApi, allProposals: DeriveCol
|
||||
const bountyTxBase = api.tx.bounties ? api.tx.bounties : api.tx.treasury;
|
||||
const bountyProposalCalls = [bountyTxBase.approveBounty, bountyTxBase.closeBounty, bountyTxBase.proposeCurator, bountyTxBase.unassignCurator];
|
||||
|
||||
return allProposals.filter((proposal) => bountyProposalCalls.find((bountyCall) => bountyCall.is(proposal.proposal)));
|
||||
return allProposals.filter((proposal) => bountyProposalCalls.find((bountyCall) =>
|
||||
proposal.proposal && bountyCall.is(proposal.proposal))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ import type { AnyFunction } from '@polkadot/types/types';
|
||||
import type { ExactDerive } from './derive';
|
||||
import type { DeriveApi } from './types';
|
||||
|
||||
import { lazyDeriveSection } from './util/lazy';
|
||||
import { derive } from './derive';
|
||||
import { lazyDeriveSection } from './util';
|
||||
|
||||
export * from './derive';
|
||||
export * from './type';
|
||||
@@ -23,8 +23,9 @@ export { lazyDeriveSection };
|
||||
// Enable derive only if some of these modules are available
|
||||
const checks: Record<string, Avail> = {
|
||||
bagsList: {
|
||||
instances: ['bagsList'],
|
||||
methods: []
|
||||
instances: ['voterList', 'bagsList'],
|
||||
methods: [],
|
||||
withDetect: true
|
||||
},
|
||||
contracts: {
|
||||
instances: ['contracts'],
|
||||
|
||||
@@ -21,17 +21,13 @@ export type { Hash, Proposal, Votes } from '@polkadot/types/interfaces';
|
||||
type Result = [(Hash | Uint8Array | string)[], (Option<Proposal> | null)[], Option<Votes>[]];
|
||||
|
||||
function parse (api: DeriveApi, [hashes, proposals, votes]: Result): DeriveCollectiveProposal[] {
|
||||
return proposals
|
||||
.map((o, index): DeriveCollectiveProposal | null =>
|
||||
o && o.isSome
|
||||
? {
|
||||
hash: api.registry.createType('Hash', hashes[index]),
|
||||
proposal: o.unwrap(),
|
||||
votes: votes[index].unwrapOr(null)
|
||||
}
|
||||
: null
|
||||
)
|
||||
.filter((proposal): proposal is DeriveCollectiveProposal => !!proposal);
|
||||
return proposals.map((o, index): DeriveCollectiveProposal => ({
|
||||
hash: api.registry.createType('Hash', hashes[index]),
|
||||
proposal: o && o.isSome
|
||||
? o.unwrap()
|
||||
: null,
|
||||
votes: votes[index].unwrapOr(null)
|
||||
}));
|
||||
}
|
||||
|
||||
function _proposalsFrom (api: DeriveApi, query: DeriveApi['query']['council'], hashes: (Hash | Uint8Array | string)[]): Observable<DeriveCollectiveProposal[]> {
|
||||
@@ -41,11 +37,9 @@ function _proposalsFrom (api: DeriveApi, query: DeriveApi['query']['council'], h
|
||||
// this should simply be api.query[section].proposalOf.multi<Option<Proposal>>(hashes),
|
||||
// however we have had cases on Edgeware where the indices have moved around after an
|
||||
// upgrade, which results in invalid on-chain data
|
||||
combineLatest(hashes.map((h) =>
|
||||
query.proposalOf<Option<Proposal>>(h).pipe(
|
||||
catchError(() => of(null))
|
||||
)
|
||||
)),
|
||||
query.proposalOf.multi<Option<Proposal>>(hashes).pipe(
|
||||
catchError(() => of(hashes.map(() => null)))
|
||||
),
|
||||
query.voting.multi<Option<Votes>>(hashes)
|
||||
])
|
||||
: of<Result>([[], [], []])
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { DeriveApi, DeriveContributions } from '../types';
|
||||
|
||||
import { BehaviorSubject, combineLatest, EMPTY, map, of, startWith, switchMap, tap, toArray } from 'rxjs';
|
||||
|
||||
import { arrayFlatten, isFunction } from '@polkadot/util';
|
||||
import { arrayFlatten, isFunction, nextTick } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
import { extractContributed } from './util';
|
||||
@@ -67,11 +67,11 @@ function _getKeysPaged (api: DeriveApi, childKey: string): Observable<StorageKey
|
||||
api.rpc.childstate.getKeysPaged(childKey, '0x', PAGE_SIZE_K, startKey)
|
||||
),
|
||||
tap((keys): void => {
|
||||
setTimeout((): void => {
|
||||
nextTick((): void => {
|
||||
keys.length === PAGE_SIZE_K
|
||||
? subject.next(keys[PAGE_SIZE_K - 1].toHex())
|
||||
: subject.complete();
|
||||
}, 0);
|
||||
});
|
||||
}),
|
||||
toArray(), // toArray since we want to startSubject to be completed
|
||||
map((keyArr: StorageKey[][]) => arrayFlatten(keyArr))
|
||||
|
||||
@@ -47,7 +47,7 @@ function queryQueue (api: DeriveApi): Observable<DeriveDispatch[]> {
|
||||
);
|
||||
}
|
||||
|
||||
function schedulerEntries (api: DeriveApi): Observable<[BlockNumber[], (Option<PalletSchedulerScheduledV3 | Scheduled>[] | null)[]]> {
|
||||
function schedulerEntries (api: DeriveApi): Observable<[BlockNumber[], Option<PalletSchedulerScheduledV3 | Scheduled>[][]]> {
|
||||
// We don't get entries, but rather we get the keys (triggered via finished referendums) and
|
||||
// the subscribe to those keys - this means we pickup when the schedulers actually executes
|
||||
// at a block, the entry for that block will become empty
|
||||
@@ -64,12 +64,11 @@ function schedulerEntries (api: DeriveApi): Observable<[BlockNumber[], (Option<P
|
||||
// this should simply be api.query.scheduler.agenda.multi,
|
||||
// however we have had cases on Darwinia where the indices have moved around after an
|
||||
// upgrade, which results in invalid on-chain data
|
||||
combineLatest(blockNumbers.map((blockNumber) =>
|
||||
// this does create an issue since it discards all at that block
|
||||
api.query.scheduler.agenda(blockNumber).pipe(catchError(() => of(null)))
|
||||
))
|
||||
api.query.scheduler.agenda.multi(blockNumbers).pipe(
|
||||
catchError(() => of(blockNumbers.map(() => [])))
|
||||
)
|
||||
])
|
||||
: of<[BlockNumber[], null[]]>([[], []]);
|
||||
: of<[BlockNumber[], Option<PalletSchedulerScheduledV3 | Scheduled>[][]]>([[], []]);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -39,12 +39,14 @@ export function keysMulti (instanceId: string, api: DeriveApi): (stashIds: (Uint
|
||||
combineLatest([
|
||||
of(queuedKeys),
|
||||
api.consts.session?.dedupKeyPrefix
|
||||
? api.query.session.nextKeys.multi(stashIds.map((stashId) => [api.consts.session.dedupKeyPrefix, stashId]))
|
||||
: api.query.session.nextKeys.multi(stashIds)
|
||||
? api.query.session.nextKeys.multi(stashIds.map((s) => [api.consts.session.dedupKeyPrefix, s]))
|
||||
: combineLatest(stashIds.map((s) => api.query.session.nextKeys(s)))
|
||||
])
|
||||
),
|
||||
map(([queuedKeys, nextKeys]) =>
|
||||
stashIds.map((stashId, index) => extractsIds(stashId, queuedKeys, nextKeys[index]))
|
||||
stashIds.map((stashId, index) =>
|
||||
extractsIds(stashId, queuedKeys, nextKeys[index])
|
||||
)
|
||||
)
|
||||
)
|
||||
: of([])
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { QueryableStorageMultiArg } from '@polkadot/api-base/types';
|
||||
import type { EraIndex } from '@polkadot/types/interfaces';
|
||||
import type { PalletStakingExposure } from '@polkadot/types/lookup';
|
||||
import type { DeriveApi, DeriveOwnExposure } from '../types';
|
||||
|
||||
import { map, of } from 'rxjs';
|
||||
import { combineLatest, map, of } from 'rxjs';
|
||||
|
||||
import { firstMemo, memo } from '../util';
|
||||
import { erasHistoricApplyAccount } from './util';
|
||||
@@ -16,12 +14,12 @@ export function _ownExposures (instanceId: string, api: DeriveApi): (accountId:
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean): Observable<DeriveOwnExposure[]> =>
|
||||
eras.length
|
||||
? api.queryMulti<PalletStakingExposure[]>([
|
||||
...eras.map((e): QueryableStorageMultiArg<'rxjs'> => [api.query.staking.erasStakersClipped, [e, accountId]]),
|
||||
...eras.map((e): QueryableStorageMultiArg<'rxjs'> => [api.query.staking.erasStakers, [e, accountId]])
|
||||
? combineLatest([
|
||||
combineLatest(eras.map((e) => api.query.staking.erasStakersClipped(e, accountId))),
|
||||
combineLatest(eras.map((e) => api.query.staking.erasStakers(e, accountId)))
|
||||
]).pipe(
|
||||
map((all): DeriveOwnExposure[] =>
|
||||
eras.map((era, index) => ({ clipped: all[index], era, exposure: all[eras.length + index] }))
|
||||
map(([clp, exp]): DeriveOwnExposure[] =>
|
||||
eras.map((era, index) => ({ clipped: clp[index], era, exposure: exp[index] }))
|
||||
)
|
||||
)
|
||||
: of([])
|
||||
|
||||
@@ -2,13 +2,11 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { QueryableStorageMultiArg } from '@polkadot/api-base/types';
|
||||
import type { Option } from '@polkadot/types';
|
||||
import type { BalanceOf, EraIndex, Perbill } from '@polkadot/types/interfaces';
|
||||
import type { ITuple } from '@polkadot/types/types';
|
||||
import type { DeriveApi, DeriveStakerSlashes } from '../types';
|
||||
|
||||
import { map, of } from 'rxjs';
|
||||
import { combineLatest, map, of } from 'rxjs';
|
||||
|
||||
import { firstMemo, memo } from '../util';
|
||||
import { erasHistoricApplyAccount } from './util';
|
||||
@@ -17,16 +15,16 @@ export function _ownSlashes (instanceId: string, api: DeriveApi): (accountId: Ui
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean): Observable<DeriveStakerSlashes[]> =>
|
||||
eras.length
|
||||
? api.queryMulti<(Option<ITuple<[Perbill, BalanceOf]>> | Option<BalanceOf>)[]>([
|
||||
...eras.map((e): QueryableStorageMultiArg<'rxjs'> => [api.query.staking.validatorSlashInEra, [e, accountId]]),
|
||||
...eras.map((e): QueryableStorageMultiArg<'rxjs'> => [api.query.staking.nominatorSlashInEra, [e, accountId]])
|
||||
? combineLatest([
|
||||
combineLatest(eras.map((e) => api.query.staking.validatorSlashInEra(e, accountId))),
|
||||
combineLatest(eras.map((e) => api.query.staking.nominatorSlashInEra(e, accountId)))
|
||||
]).pipe(
|
||||
map((values): DeriveStakerSlashes[] =>
|
||||
map(([vals, noms]): DeriveStakerSlashes[] =>
|
||||
eras.map((era, index) => ({
|
||||
era,
|
||||
total: values[index].isSome
|
||||
? (values[index].unwrap() as ITuple<[Perbill, BalanceOf]>)[1]
|
||||
: (values[index + eras.length].unwrapOrDefault() as BalanceOf)
|
||||
total: vals[index].isSome
|
||||
? (vals[index].unwrap() as ITuple<[Perbill, BalanceOf]>)[1]
|
||||
: (noms[index].unwrapOrDefault() as BalanceOf)
|
||||
}))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -34,7 +34,7 @@ function getLedgers (api: DeriveApi, optIds: (Option<AccountId> | null)[], { wit
|
||||
|
||||
return (
|
||||
ids.length
|
||||
? api.query.staking.ledger.multi(ids)
|
||||
? combineLatest(ids.map((s) => api.query.staking.ledger(s)))
|
||||
: of([])
|
||||
).pipe(
|
||||
map((optLedgers): Option<PalletStakingStakingLedger>[] => {
|
||||
@@ -57,19 +57,19 @@ function getStashInfo (api: DeriveApi, stashIds: AccountId[], activeEra: EraInde
|
||||
|
||||
return combineLatest([
|
||||
withController || withLedger
|
||||
? api.query.staking.bonded.multi(stashIds)
|
||||
? combineLatest(stashIds.map((s) => api.query.staking.bonded(s)))
|
||||
: of(stashIds.map(() => null)),
|
||||
withNominations
|
||||
? api.query.staking.nominators.multi(stashIds)
|
||||
? combineLatest(stashIds.map((s) => api.query.staking.nominators(s)))
|
||||
: of(stashIds.map(() => emptyNoms)),
|
||||
withDestination
|
||||
? api.query.staking.payee.multi(stashIds)
|
||||
? combineLatest(stashIds.map((s) => api.query.staking.payee(s)))
|
||||
: of(stashIds.map(() => emptyRewa)),
|
||||
withPrefs
|
||||
? api.query.staking.validators.multi(stashIds)
|
||||
? combineLatest(stashIds.map((s) => api.query.staking.validators(s)))
|
||||
: of(stashIds.map(() => emptyPrefs)),
|
||||
withExposure
|
||||
? api.query.staking.erasStakers.multi(stashIds.map((stashId) => [activeEra, stashId]))
|
||||
? combineLatest(stashIds.map((s) => api.query.staking.erasStakers(activeEra, s)))
|
||||
: of(stashIds.map(() => emptyExpo))
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import type { DeriveApi } from '../types';
|
||||
|
||||
import { BehaviorSubject, combineLatest, map, of, switchMap, tap, toArray } from 'rxjs';
|
||||
|
||||
import { arrayChunk, arrayFlatten } from '@polkadot/util';
|
||||
import { arrayChunk, arrayFlatten, nextTick } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
|
||||
@@ -28,13 +28,13 @@ function chunkEras <T> (eras: EraIndex[], fn: (eras: EraIndex[]) => Observable<T
|
||||
return subject.pipe(
|
||||
switchMap(fn),
|
||||
tap((): void => {
|
||||
setTimeout((): void => {
|
||||
nextTick((): void => {
|
||||
index++;
|
||||
|
||||
index === chunked.length
|
||||
? subject.complete()
|
||||
: subject.next(chunked[index]);
|
||||
}, 0);
|
||||
});
|
||||
}),
|
||||
toArray(),
|
||||
map(arrayFlatten)
|
||||
|
||||
@@ -23,15 +23,23 @@ function parseResult (api: DeriveApi, { allIds, allProposals, approvalIds, counc
|
||||
const approvals: DeriveTreasuryProposal[] = [];
|
||||
const proposals: DeriveTreasuryProposal[] = [];
|
||||
const councilTreasury = councilProposals.filter(({ proposal }) =>
|
||||
api.tx.treasury.approveProposal.is(proposal) ||
|
||||
api.tx.treasury.rejectProposal.is(proposal)
|
||||
proposal && (
|
||||
api.tx.treasury.approveProposal.is(proposal) ||
|
||||
api.tx.treasury.rejectProposal.is(proposal)
|
||||
)
|
||||
);
|
||||
|
||||
allIds.forEach((id, index): void => {
|
||||
if (allProposals[index].isSome) {
|
||||
const council = councilTreasury
|
||||
.filter(({ proposal }) => id.eq(proposal.args[0]))
|
||||
.sort((a, b) => a.proposal.method.localeCompare(b.proposal.method));
|
||||
.filter(({ proposal }) => proposal && id.eq(proposal.args[0]))
|
||||
.sort((a, b) =>
|
||||
a.proposal && b.proposal
|
||||
? a.proposal.method.localeCompare(b.proposal.method)
|
||||
: a.proposal
|
||||
? -1
|
||||
: 1
|
||||
);
|
||||
const isApproval = approvalIds.some((approvalId) => approvalId.eq(id));
|
||||
const derived = { council, id, proposal: allProposals[index].unwrap() };
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export interface DeriveContractFees {
|
||||
|
||||
export interface DeriveCollectiveProposal {
|
||||
hash: Hash;
|
||||
proposal: Proposal;
|
||||
proposal: Proposal | null;
|
||||
votes: Votes | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,3 +7,4 @@ export * from './approvalFlagsToBools';
|
||||
export * from './cache';
|
||||
export * from './cacheImpl';
|
||||
export * from './first';
|
||||
export * from './lazy';
|
||||
|
||||
+17
-17
@@ -20,29 +20,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@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",
|
||||
"@polkadot/api-augment": "8.8.2",
|
||||
"@polkadot/api-base": "8.8.2",
|
||||
"@polkadot/api-derive": "8.8.2",
|
||||
"@polkadot/keyring": "^9.4.1",
|
||||
"@polkadot/rpc-augment": "8.8.2",
|
||||
"@polkadot/rpc-core": "8.8.2",
|
||||
"@polkadot/rpc-provider": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-augment": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/types-create": "8.8.2",
|
||||
"@polkadot/types-known": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"@polkadot/util-crypto": "^9.4.1",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "8.6.2",
|
||||
"@polkadot/types-support": "8.6.2"
|
||||
"@polkadot/api-augment": "8.8.2",
|
||||
"@polkadot/types-support": "8.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { getAvailableDerives } from '@polkadot/api-derive';
|
||||
import { memo, RpcCore } from '@polkadot/rpc-core';
|
||||
import { WsProvider } from '@polkadot/rpc-provider';
|
||||
import { expandMetadata, Metadata, TypeRegistry, unwrapStorageType } from '@polkadot/types';
|
||||
import { arrayChunk, arrayFlatten, assert, assertReturn, BN, BN_ZERO, compactStripLength, lazyMethod, lazyMethods, logger, objectSpread, u8aToHex } from '@polkadot/util';
|
||||
import { arrayChunk, arrayFlatten, assert, assertReturn, BN, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { createSubmittable } from '../submittable';
|
||||
import { augmentObject } from '../util/augmentObject';
|
||||
@@ -43,7 +43,8 @@ interface FullDecoration<ApiType extends ApiTypes> {
|
||||
|
||||
// the max amount of keys/values that we will retrieve at once
|
||||
const PAGE_SIZE_K = 1000; // limit aligned with the 1k on the node (trie lookups are heavy)
|
||||
const PAGE_SIZE_V = 250; // limited since the data may be very large (e.g. misfiring elections)
|
||||
const PAGE_SIZE_V = 250; // limited since the data may be > 16MB (e.g. misfiring elections)
|
||||
const PAGE_SIZE_Q = 50; // queue of pending storage queries (mapped together, next tick)
|
||||
|
||||
const l = logger('api/init');
|
||||
|
||||
@@ -58,6 +59,10 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
#registry: Registry;
|
||||
|
||||
#storageGetQ: [Observable<Codec[]>, [StorageEntry, unknown[]][]][] = [];
|
||||
|
||||
#storageSubQ: [Observable<Codec[]>, [StorageEntry, unknown[]][]][] = [];
|
||||
|
||||
// HACK Use BN import so decorateDerive works... yes, wtf.
|
||||
protected __phantom = new BN(0);
|
||||
|
||||
@@ -238,6 +243,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
decoratedApi.queryMulti = blockHash
|
||||
? this._decorateMultiAt(decoratedApi, this._decorateMethod, blockHash)
|
||||
: this._decorateMulti(this._decorateMethod);
|
||||
decoratedApi.runtimeVersion = registry.runtimeVersion;
|
||||
|
||||
return {
|
||||
decoratedApi,
|
||||
@@ -280,7 +286,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
* backwards compatible endpoint for metadata injection, may be removed in the future (However, it is still useful for testing injection)
|
||||
*/
|
||||
public injectMetadata (metadata: Metadata, fromEmpty?: boolean, registry?: Registry): void {
|
||||
this._injectMetadata({ metadata, registry: registry || this.#registry, specName: this.#registry.createType('Text'), specVersion: BN_ZERO }, fromEmpty);
|
||||
this._injectMetadata({ metadata, registry: registry || this.#registry, runtimeVersion: this.#registry.createType('RuntimeVersionPartial') }, fromEmpty);
|
||||
}
|
||||
|
||||
private _decorateFunctionMeta (input: MetaDecoration, output: MetaDecoration): MetaDecoration {
|
||||
@@ -401,18 +407,20 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
// only be called if supportMulti is true
|
||||
protected _decorateMulti<ApiType extends ApiTypes> (decorateMethod: DecorateMethod<ApiType>): QueryableStorageMulti<ApiType> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return decorateMethod((calls: QueryableStorageMultiArg<ApiType>[]): Observable<Codec[]> =>
|
||||
return decorateMethod((keys: QueryableStorageMultiArg<ApiType>[]): Observable<Codec[]> =>
|
||||
(this.hasSubscriptions
|
||||
? this._rpcCore.state.subscribeStorage
|
||||
: this._rpcCore.state.queryStorageAt)(
|
||||
calls.map((args: QueryableStorageMultiArg<ApiType>) =>
|
||||
Array.isArray(args)
|
||||
? args[0].creator.meta.type.isPlain
|
||||
? [args[0].creator]
|
||||
: args[0].creator.meta.type.asMap.hashers.length === 1
|
||||
? [args[0].creator, args.slice(1)]
|
||||
: [args[0].creator, ...args.slice(1)]
|
||||
: [args.creator])));
|
||||
: this._rpcCore.state.queryStorageAt
|
||||
)(keys.map((args: QueryableStorageMultiArg<ApiType>): [StorageEntry, ...unknown[]] =>
|
||||
Array.isArray(args)
|
||||
? args[0].creator.meta.type.isPlain
|
||||
? [args[0].creator]
|
||||
: args[0].creator.meta.type.asMap.hashers.length === 1
|
||||
? [args[0].creator, args.slice(1)]
|
||||
: [args[0].creator, ...args.slice(1)]
|
||||
: [args.creator]
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
protected _decorateMultiAt<ApiType extends ApiTypes> (atApi: ApiDecoration<ApiType>, decorateMethod: DecorateMethod<ApiType>, blockHash: Uint8Array | string): QueryableStorageMulti<ApiType> {
|
||||
@@ -633,18 +641,61 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
return this._decorateFunctionMeta(creator as unknown as MetaDecoration, decorated) as unknown as QueryableStorageEntry<ApiType>;
|
||||
}
|
||||
|
||||
private _queueStorage (call: [StorageEntry, unknown[]], queue: [Observable<Codec[]>, [StorageEntry, unknown[]][]][]): Observable<Codec> {
|
||||
const query = queue === this.#storageSubQ
|
||||
? this._rpcCore.state.subscribeStorage
|
||||
: this._rpcCore.state.queryStorageAt;
|
||||
let queueIdx = queue.length - 1;
|
||||
let valueIdx = 0;
|
||||
let valueObs: Observable<Codec[]>;
|
||||
|
||||
if (queueIdx === -1 || !queue[queueIdx] || queue[queueIdx][1].length === PAGE_SIZE_Q) {
|
||||
queueIdx++;
|
||||
|
||||
valueObs = from(
|
||||
// Defer to the next tick - this aligns with nextTick in @polkadot/util,
|
||||
// however since we return a value here, we don't re-use what is there
|
||||
Promise
|
||||
.resolve()
|
||||
.then((): [StorageEntry, unknown[]][] => {
|
||||
const calls = queue[queueIdx][1];
|
||||
|
||||
delete queue[queueIdx];
|
||||
|
||||
return calls;
|
||||
})
|
||||
).pipe(
|
||||
switchMap((calls) => query(calls))
|
||||
);
|
||||
|
||||
queue.push([valueObs, [call]]);
|
||||
} else {
|
||||
valueObs = queue[queueIdx][0];
|
||||
valueIdx = queue[queueIdx][1].length;
|
||||
|
||||
queue[queueIdx][1].push(call);
|
||||
}
|
||||
|
||||
return valueObs.pipe(
|
||||
map((values) => values[valueIdx])
|
||||
);
|
||||
}
|
||||
|
||||
// Decorate the base storage call. In the case or rxjs or promise-without-callback (await)
|
||||
// we make a subscription, alternatively we push this through a single-shot query
|
||||
private _decorateStorageCall<ApiType extends ApiTypes> (creator: StorageEntry, decorateMethod: DecorateMethod<ApiType>): ReturnType<DecorateMethod<ApiType>> {
|
||||
return decorateMethod((...args: unknown[]): Observable<Codec> => {
|
||||
return this.hasSubscriptions
|
||||
? this._rpcCore.state.subscribeStorage<[Codec]>([extractStorageArgs(this.#registry, creator, args)]).pipe(
|
||||
map(([data]) => data) // extract first/only result from list
|
||||
)
|
||||
: this._rpcCore.state.getStorage(extractStorageArgs(this.#registry, creator, args));
|
||||
const call = extractStorageArgs(this.#registry, creator, args);
|
||||
|
||||
if (!this.hasSubscriptions) {
|
||||
return this._rpcCore.state.getStorage(call);
|
||||
}
|
||||
|
||||
return this._queueStorage(call, this.#storageSubQ);
|
||||
}, {
|
||||
methodName: creator.method,
|
||||
overrideNoSub: (...args: unknown[]) => this._rpcCore.state.getStorage(extractStorageArgs(this.#registry, creator, args))
|
||||
overrideNoSub: (...args: unknown[]) =>
|
||||
this._queueStorage(extractStorageArgs(this.#registry, creator, args), this.#storageGetQ)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -667,15 +718,21 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
return of([]);
|
||||
}
|
||||
|
||||
const queryCall = this.hasSubscriptions && !blockHash
|
||||
const query = this.hasSubscriptions && !blockHash
|
||||
? this._rpcCore.state.subscribeStorage
|
||||
: this._rpcCore.state.queryStorageAt;
|
||||
|
||||
if (keys.length <= PAGE_SIZE_V) {
|
||||
return blockHash
|
||||
? query(keys, blockHash)
|
||||
: query(keys);
|
||||
}
|
||||
|
||||
return combineLatest(
|
||||
arrayChunk(keys, PAGE_SIZE_V).map((k) =>
|
||||
blockHash
|
||||
? queryCall(k, blockHash)
|
||||
: queryCall(k)
|
||||
? query(k, blockHash)
|
||||
: query(k)
|
||||
)
|
||||
).pipe(
|
||||
map(arrayFlatten)
|
||||
@@ -687,21 +744,23 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
const headKey = iterKey(...args).toHex();
|
||||
const startSubject = new BehaviorSubject<string>(headKey);
|
||||
const getKeysPaged = at
|
||||
? (startKey: string) => this._rpcCore.state.getKeysPaged(headKey, PAGE_SIZE_K, startKey, at)
|
||||
: (startKey: string) => this._rpcCore.state.getKeysPaged(headKey, PAGE_SIZE_K, startKey);
|
||||
const query = at
|
||||
? (startKey: string) =>
|
||||
this._rpcCore.state.getKeysPaged(headKey, PAGE_SIZE_K, startKey, at)
|
||||
: (startKey: string) =>
|
||||
this._rpcCore.state.getKeysPaged(headKey, PAGE_SIZE_K, startKey);
|
||||
const setMeta = (key: StorageKey) => key.setMeta(meta, section, method);
|
||||
|
||||
return startSubject.pipe(
|
||||
switchMap(getKeysPaged),
|
||||
switchMap(query),
|
||||
map((keys) => keys.map(setMeta)),
|
||||
tap((keys): void => {
|
||||
setTimeout((): void => {
|
||||
tap((keys) =>
|
||||
nextTick((): void => {
|
||||
keys.length === PAGE_SIZE_K
|
||||
? startSubject.next(keys[PAGE_SIZE_K - 1].toHex())
|
||||
: startSubject.complete();
|
||||
}, 0);
|
||||
}),
|
||||
})
|
||||
),
|
||||
toArray(), // toArray since we want to startSubject to be completed
|
||||
map(arrayFlatten)
|
||||
);
|
||||
@@ -711,24 +770,28 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
assert(iterKey && meta.type.isMap, 'keys can only be retrieved on maps');
|
||||
|
||||
const setMeta = (key: StorageKey) => key.setMeta(meta, section, method);
|
||||
const getKeysPaged = at
|
||||
? (headKey: string) => this._rpcCore.state.getKeysPaged(headKey, opts.pageSize, opts.startKey || headKey, at)
|
||||
: (headKey: string) => this._rpcCore.state.getKeysPaged(headKey, opts.pageSize, opts.startKey || headKey);
|
||||
const query = at
|
||||
? (headKey: string) =>
|
||||
this._rpcCore.state.getKeysPaged(headKey, opts.pageSize, opts.startKey || headKey, at)
|
||||
: (headKey: string) =>
|
||||
this._rpcCore.state.getKeysPaged(headKey, opts.pageSize, opts.startKey || headKey);
|
||||
|
||||
return getKeysPaged(iterKey(...opts.args).toHex()).pipe(
|
||||
return query(iterKey(...opts.args).toHex()).pipe(
|
||||
map((keys) => keys.map(setMeta))
|
||||
);
|
||||
}
|
||||
|
||||
private _retrieveMapEntries (entry: StorageEntry, at: Hash | Uint8Array | string | null, args: unknown[]): Observable<[StorageKey, Codec][]> {
|
||||
const queryStorageAt = at
|
||||
? (keys: StorageKey[]) => this._rpcCore.state.queryStorageAt(keys, at)
|
||||
: (keys: StorageKey[]) => this._rpcCore.state.queryStorageAt(keys);
|
||||
const query = at
|
||||
? (keys: StorageKey[]) =>
|
||||
this._rpcCore.state.queryStorageAt(keys, at)
|
||||
: (keys: StorageKey[]) =>
|
||||
this._rpcCore.state.queryStorageAt(keys);
|
||||
|
||||
return this._retrieveMapKeys(entry, at, args).pipe(
|
||||
switchMap((keys) =>
|
||||
keys.length
|
||||
? combineLatest(arrayChunk(keys, PAGE_SIZE_V).map(queryStorageAt)).pipe(
|
||||
? combineLatest(arrayChunk(keys, PAGE_SIZE_V).map(query)).pipe(
|
||||
map((valsArr) =>
|
||||
arrayFlatten(valsArr).map((value, index): [StorageKey, Codec] => [keys[index], value])
|
||||
)
|
||||
@@ -739,14 +802,16 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
}
|
||||
|
||||
private _retrieveMapEntriesPaged (entry: StorageEntry, at: Hash | Uint8Array | string | undefined, opts: PaginationOptions): Observable<[StorageKey, Codec][]> {
|
||||
const queryStorageAt = at
|
||||
? (keys: StorageKey[]) => this._rpcCore.state.queryStorageAt(keys, at)
|
||||
: (keys: StorageKey[]) => this._rpcCore.state.queryStorageAt(keys);
|
||||
const query = at
|
||||
? (keys: StorageKey[]) =>
|
||||
this._rpcCore.state.queryStorageAt(keys, at)
|
||||
: (keys: StorageKey[]) =>
|
||||
this._rpcCore.state.queryStorageAt(keys);
|
||||
|
||||
return this._retrieveMapKeysPaged(entry, at, opts).pipe(
|
||||
switchMap((keys) =>
|
||||
keys.length
|
||||
? queryStorageAt(keys).pipe(
|
||||
? query(keys).pipe(
|
||||
map((valsArr) =>
|
||||
valsArr.map((value, index): [StorageKey, Codec] => [keys[index], value])
|
||||
)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { RpcInterface } from '@polkadot/rpc-core/types';
|
||||
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
|
||||
import type { Text } from '@polkadot/types';
|
||||
import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
|
||||
import type { Metadata } from '@polkadot/types/metadata';
|
||||
@@ -188,6 +189,13 @@ export abstract class Getters<ApiType extends ApiTypes> extends Init<ApiType> im
|
||||
return assertResult(this._rx as Pick<ApiInterfaceRx, 'tx' | 'rpc' | 'query'>);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the underlying provider stats
|
||||
*/
|
||||
public get stats (): ProviderInterface['stats'] | undefined {
|
||||
return this._rpcCore.provider.stats;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The type of this API instance, either 'rxjs' or 'promise'
|
||||
*/
|
||||
|
||||
@@ -129,7 +129,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
this._initRegistry(registry, this._runtimeChain as Text, version, metadata);
|
||||
|
||||
// add our new registry
|
||||
const result = { lastBlockHash: blockHash, metadata, registry, specName: version.specName, specVersion: version.specVersion };
|
||||
const result = { lastBlockHash: blockHash, metadata, registry, runtimeVersion: version };
|
||||
|
||||
this.#registries.push(result);
|
||||
|
||||
@@ -162,7 +162,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
if (version) {
|
||||
// check for pre-existing registries. We also check specName, e.g. it
|
||||
// could be changed like in Westmint with upgrade from shell -> westmint
|
||||
const existingViaVersion = this.#registries.find(({ specName, specVersion }) =>
|
||||
const existingViaVersion = this.#registries.find(({ runtimeVersion: { specName, specVersion } }) =>
|
||||
specName.eq(version.specName) &&
|
||||
specVersion.eq(version.specVersion)
|
||||
);
|
||||
@@ -289,7 +289,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
|
||||
// setup the data as per the current versions
|
||||
thisRegistry.metadata = metadata;
|
||||
thisRegistry.specVersion = version.specVersion;
|
||||
thisRegistry.runtimeVersion = version;
|
||||
|
||||
this._initRegistry(this.registry, this._runtimeChain as Text, version, metadata);
|
||||
this._injectMetadata(thisRegistry, true);
|
||||
@@ -333,7 +333,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
|
||||
// setup the initial registry, when we have none
|
||||
if (!this.#registries.length) {
|
||||
this.#registries.push({ isDefault: true, metadata, registry: this.registry, specName: runtimeVersion.specName, specVersion: runtimeVersion.specVersion });
|
||||
this.#registries.push({ isDefault: true, metadata, registry: this.registry, runtimeVersion });
|
||||
}
|
||||
|
||||
// get unique types & validate
|
||||
@@ -362,7 +362,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
// Only enable the health keepalive on WS, not needed on HTTP
|
||||
this.#healthTimer = this.hasSubscriptions
|
||||
? setInterval((): void => {
|
||||
firstValueFrom(this._rpcCore.system.health()).catch(() => undefined);
|
||||
firstValueFrom(this._rpcCore.system.health.raw()).catch(() => undefined);
|
||||
}, KEEPALIVE_INTERVAL)
|
||||
: null;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// Copyright 2017-2022 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Metadata } from '@polkadot/types/metadata';
|
||||
import type { Metadata } from '@polkadot/types';
|
||||
import type { RuntimeVersionPartial } from '@polkadot/types/interfaces';
|
||||
import type { DecoratedMeta } from '@polkadot/types/metadata/decorate/types';
|
||||
import type { Text } from '@polkadot/types/primitive';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { ApiDecoration, ApiTypes } from '../types';
|
||||
|
||||
export interface VersionedRegistry<ApiType extends ApiTypes> {
|
||||
@@ -15,6 +14,5 @@ export interface VersionedRegistry<ApiType extends ApiTypes> {
|
||||
lastBlockHash?: Uint8Array | null;
|
||||
metadata: Metadata;
|
||||
registry: Registry;
|
||||
specName: Text;
|
||||
specVersion: BN;
|
||||
runtimeVersion: RuntimeVersionPartial;
|
||||
}
|
||||
|
||||
@@ -57,14 +57,33 @@ function events (api: ApiPromise): void {
|
||||
// existing
|
||||
if (api.events.balances.Transfer.is(event)) {
|
||||
// the types are correctly expanded
|
||||
const [from, to, amount] = event.data;
|
||||
const [afrom, ato, aamount] = event.data;
|
||||
|
||||
console.log(from.toHuman(), to.toHuman(), amount.toBn());
|
||||
console.log(
|
||||
afrom.toHuman(),
|
||||
ato.toHuman(),
|
||||
aamount.toBn()
|
||||
);
|
||||
|
||||
// the types have getters
|
||||
const { amount, from, to } = event.data;
|
||||
|
||||
console.log(
|
||||
from.toHuman(),
|
||||
to.toHuman(),
|
||||
amount.toBn()
|
||||
);
|
||||
}
|
||||
|
||||
// something random
|
||||
// something with only tuple data
|
||||
if (api.events.staking.Bonded.is(event)) {
|
||||
const [account, amount] = event.data;
|
||||
|
||||
console.log(account.toHuman(), amount.toBn());
|
||||
}
|
||||
|
||||
// something random, just codec[]
|
||||
if (api.events.something.Random.is(event)) {
|
||||
// the types are just codec
|
||||
const [a, b] = event.data;
|
||||
|
||||
console.log(a.toHuman(), b.toHuman());
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { DecorateFn, DecorateMethodOptions, ObsInnerType, StorageEntryPromi
|
||||
|
||||
import { catchError, EMPTY, Subscription, tap } from 'rxjs';
|
||||
|
||||
import { assert, isFunction } from '@polkadot/util';
|
||||
import { assert, isFunction, nextTick } from '@polkadot/util';
|
||||
|
||||
interface Tracker<T> {
|
||||
reject: (value: Error) => Observable<never>;
|
||||
@@ -75,7 +75,8 @@ function decorateCall<M extends DecorateFn<CodecReturnType<M>>> (method: M, args
|
||||
)
|
||||
.subscribe((result): void => {
|
||||
tracker.resolve(result);
|
||||
setTimeout(() => subscription.unsubscribe(), 0);
|
||||
|
||||
nextTick(() => subscription.unsubscribe());
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -94,7 +95,7 @@ function decorateSubscribe<M extends DecorateFn<CodecReturnType<M>>> (method: M,
|
||||
)
|
||||
.subscribe((result): void => {
|
||||
// queue result (back of queue to clear current)
|
||||
setTimeout(() => resultCb(result) as void, 0);
|
||||
nextTick(() => resultCb(result));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, Submittable
|
||||
|
||||
import { catchError, first, map, mapTo, mergeMap, of, switchMap, tap } from 'rxjs';
|
||||
|
||||
import { assert, isBn, isFunction, isNumber, isString, isU8a, objectSpread } from '@polkadot/util';
|
||||
import { assert, isBn, isFunction, isNumber, isString, isU8a, isUndefined, objectSpread } from '@polkadot/util';
|
||||
|
||||
import { ApiBase } from '../base';
|
||||
import { filterEvents, isKeyringPair } from '../util';
|
||||
@@ -34,6 +34,8 @@ const identity = <T> (input: T): T => input;
|
||||
|
||||
function makeEraOptions (api: ApiInterfaceRx, registry: Registry, partialOptions: Partial<SignerOptions>, { header, mortalLength, nonce }: { header: Header | null; mortalLength: number; nonce: Index }): SignatureOptions {
|
||||
if (!header) {
|
||||
assert(partialOptions.era === 0 || !isUndefined(partialOptions.blockHash), 'Expected blockHash to be passed alongside non-immortal era options');
|
||||
|
||||
if (isNumber(partialOptions.era)) {
|
||||
// since we have no header, it is immortal, remove any option overrides
|
||||
// so we only supply the genesisHash and no era to the construction
|
||||
|
||||
@@ -9,7 +9,7 @@ import type { DecoratedEvents } from '@polkadot/api-base/types/events';
|
||||
import type { QueryableStorage } from '@polkadot/api-base/types/storage';
|
||||
import type { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types';
|
||||
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
|
||||
import type { Call, Extrinsic, Hash } from '@polkadot/types/interfaces';
|
||||
import type { Call, Extrinsic, Hash, RuntimeVersionPartial } from '@polkadot/types/interfaces';
|
||||
import type { CallFunction, DefinitionRpc, DefinitionRpcSub, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@polkadot/types/types';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
@@ -95,6 +95,7 @@ export interface ApiDecoration<ApiType extends ApiTypes> {
|
||||
events: DecoratedEvents<ApiType>;
|
||||
query: QueryableStorage<ApiType>;
|
||||
registry: Registry;
|
||||
runtimeVersion: RuntimeVersionPartial;
|
||||
rx: {
|
||||
query: QueryableStorage<'rxjs'>;
|
||||
};
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@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"
|
||||
"@polkadot/rpc-core": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@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",
|
||||
"@polkadot/rpc-augment": "8.8.2",
|
||||
"@polkadot/rpc-provider": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^9.3.1",
|
||||
"@polkadot/rpc-augment": "8.6.2"
|
||||
"@polkadot/keyring": "^9.4.1",
|
||||
"@polkadot/rpc-augment": "8.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,11 @@ const EMPTY_META = {
|
||||
|
||||
// utility method to create a nicely-formatted error
|
||||
/** @internal */
|
||||
function logErrorMessage (method: string, { params, type }: DefinitionRpc, error: Error): void {
|
||||
function logErrorMessage (method: string, { noErrorLog, params, type }: DefinitionRpc, error: Error): void {
|
||||
if (noErrorLog) {
|
||||
return;
|
||||
}
|
||||
|
||||
const inputs = params.map(({ isOptional, name, type }): string =>
|
||||
`${name}${isOptional ? '?' : ''}: ${type}`
|
||||
).join(', ');
|
||||
@@ -87,7 +91,7 @@ export class RpcCore {
|
||||
#getBlockRegistry?: (blockHash: Uint8Array) => Promise<{ registry: Registry }>;
|
||||
#getBlockHash?: (blockNumber: AnyNumber) => Promise<Uint8Array>;
|
||||
|
||||
readonly #storageCache = new Map<string, string | null>();
|
||||
readonly #storageCache = new Map<string, Codec>();
|
||||
|
||||
public readonly mapping = new Map<string, DefinitionRpcExt>();
|
||||
|
||||
@@ -418,28 +422,38 @@ export class RpcCore {
|
||||
}, []);
|
||||
}
|
||||
|
||||
private _formatStorageSetEntry (registry: Registry, blockHash: string, key: StorageKey, changes: [string, string | null][], witCache: boolean, entryIndex: number): Codec {
|
||||
private _formatStorageSetEntry (registry: Registry, blockHash: string, key: StorageKey, changes: [string, string | null][], withCache: boolean, entryIndex: number): Codec {
|
||||
const hexKey = key.toHex();
|
||||
const found = changes.find(([key]) => key === hexKey);
|
||||
const isNotFound = isUndefined(found);
|
||||
|
||||
// if we don't find the value, this is our fallback
|
||||
// - in the case of an array of values, fill the hole from the cache
|
||||
// - if a single result value, don't fill - it is not an update hole
|
||||
// - fallback to an empty option in all cases
|
||||
const value = isUndefined(found)
|
||||
? (witCache && this.#storageCache.get(hexKey)) || null
|
||||
if (isNotFound && withCache) {
|
||||
const cached = this.#storageCache.get(hexKey);
|
||||
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
}
|
||||
|
||||
const value = isNotFound
|
||||
? null
|
||||
: found[1];
|
||||
const isEmpty = isNull(value);
|
||||
const input = isEmpty || isTreatAsHex(key)
|
||||
? value
|
||||
: u8aToU8a(value);
|
||||
const codec = this._newType(registry, blockHash, key, input, isEmpty, entryIndex);
|
||||
|
||||
// store the retrieved result - the only issue with this cache is that there is no
|
||||
// clearing of it, so very long running processes (not just a couple of hours, longer)
|
||||
// will increase memory beyond what is allowed.
|
||||
this.#storageCache.set(hexKey, value);
|
||||
this.#storageCache.set(hexKey, codec);
|
||||
|
||||
return this._newType(registry, blockHash, key, input, isEmpty, entryIndex);
|
||||
return codec;
|
||||
}
|
||||
|
||||
private _newType (registry: Registry, blockHash: Uint8Array | string | null | undefined, key: StorageKey, input: string | Uint8Array | null, isEmpty: boolean, entryIndex = -1): Codec {
|
||||
|
||||
@@ -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.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -20,21 +20,21 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@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",
|
||||
"@polkadot/keyring": "^9.4.1",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-support": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"@polkadot/util-crypto": "^9.4.1",
|
||||
"@polkadot/x-fetch": "^9.4.1",
|
||||
"@polkadot/x-global": "^9.4.1",
|
||||
"@polkadot/x-ws": "^9.4.1",
|
||||
"@substrate/connect": "0.7.5",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"mock-socket": "^9.1.4",
|
||||
"nock": "^13.2.4"
|
||||
"mock-socket": "^9.1.5",
|
||||
"nock": "^13.2.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export class HttpProvider implements ProviderInterface {
|
||||
this.#headers = headers;
|
||||
this.#stats = {
|
||||
active: { requests: 0, subscriptions: 0 },
|
||||
total: { bytesRecv: 0, bytesSent: 0, cached: 0, requests: 0, subscriptions: 0, timeout: 0 }
|
||||
total: { bytesRecv: 0, bytesSent: 0, cached: 0, errors: 0, requests: 0, subscriptions: 0, timeout: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -169,6 +169,7 @@ export class HttpProvider implements ProviderInterface {
|
||||
return decoded;
|
||||
} catch (e) {
|
||||
this.#stats.active.requests--;
|
||||
this.#stats.total.errors++;
|
||||
|
||||
throw e;
|
||||
}
|
||||
|
||||
@@ -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.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -71,6 +71,7 @@ export interface ProviderStats {
|
||||
bytesRecv: number;
|
||||
bytesSent: number;
|
||||
cached: number;
|
||||
errors: number;
|
||||
requests: number;
|
||||
subscriptions: number;
|
||||
timeout: number;
|
||||
|
||||
@@ -137,7 +137,7 @@ export class WsProvider implements ProviderInterface {
|
||||
this.#websocket = null;
|
||||
this.#stats = {
|
||||
active: { requests: 0, subscriptions: 0 },
|
||||
total: { bytesRecv: 0, bytesSent: 0, cached: 0, requests: 0, subscriptions: 0, timeout: 0 }
|
||||
total: { bytesRecv: 0, bytesSent: 0, cached: 0, errors: 0, requests: 0, subscriptions: 0, timeout: 0 }
|
||||
};
|
||||
this.#timeout = timeout || DEFAULT_TIMEOUT_MS;
|
||||
|
||||
@@ -339,6 +339,8 @@ export class WsProvider implements ProviderInterface {
|
||||
this.#stats.total.bytesSent += body.length;
|
||||
this.#websocket.send(body);
|
||||
} catch (error) {
|
||||
this.#stats.total.errors++;
|
||||
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
@@ -492,6 +494,8 @@ export class WsProvider implements ProviderInterface {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this.#stats.total.errors++;
|
||||
|
||||
handler.callback(error as Error, undefined);
|
||||
}
|
||||
|
||||
@@ -520,6 +524,8 @@ export class WsProvider implements ProviderInterface {
|
||||
|
||||
handler.callback(null, result);
|
||||
} catch (error) {
|
||||
this.#stats.total.errors++;
|
||||
|
||||
handler.callback(error as Error, undefined);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
@@ -30,20 +30,20 @@
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.18.2",
|
||||
"@babel/core": "^7.18.5",
|
||||
"@babel/register": "^7.17.7",
|
||||
"@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",
|
||||
"@polkadot/api": "8.8.2",
|
||||
"@polkadot/api-augment": "8.8.2",
|
||||
"@polkadot/rpc-augment": "8.8.2",
|
||||
"@polkadot/rpc-provider": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-augment": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/types-create": "8.8.2",
|
||||
"@polkadot/types-support": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"@polkadot/x-ws": "^9.4.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
"yargs": "^17.5.1"
|
||||
|
||||
@@ -16,6 +16,9 @@ import { compareName, createImports, formatType, initMeta, readTemplate, setImpo
|
||||
|
||||
const generateForMetaTemplate = Handlebars.compile(readTemplate('events'));
|
||||
|
||||
// For babel itself we need some extra aliasing
|
||||
const ALIAS = ['symbol'];
|
||||
|
||||
/** @internal */
|
||||
function generateForMeta (meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean, customLookupDefinitions?: Definitions): void {
|
||||
writeFile(dest, (): string => {
|
||||
@@ -42,13 +45,18 @@ function generateForMeta (meta: Metadata, dest: string, extraTypes: ExtraTypes,
|
||||
const args = fields
|
||||
.map(({ type }) => lookup.getTypeDef(type))
|
||||
.map((typeDef) => typeDef.lookupName || formatType(registry, allDefs, typeDef, imports));
|
||||
const names = fields
|
||||
.map(({ name }) => registry.lookup.sanitizeField(name)[0])
|
||||
.filter((n): n is string => !!n);
|
||||
|
||||
setImports(allDefs, imports, args);
|
||||
|
||||
return {
|
||||
docs,
|
||||
name: name.toString(),
|
||||
type: args.join(', ')
|
||||
type: names.length !== 0 && names.length === args.length
|
||||
? `[${names.map((n, i) => `${ALIAS.includes(n) ? `${n}_` : n}: ${args[i]}`).join(', ')}], { ${names.map((n, i) => `${n}: ${args[i]}`).join(', ')} }`
|
||||
: `[${args.join(', ')}]`
|
||||
};
|
||||
})
|
||||
.sort(compareName),
|
||||
|
||||
@@ -21,48 +21,52 @@ const generateForMetaTemplate = Handlebars.compile(readTemplate('query'));
|
||||
|
||||
// From a storage entry metadata, we return [args, returnType]
|
||||
/** @internal */
|
||||
function entrySignature (lookup: PortableRegistry, allDefs: Record<string, ModuleTypes>, registry: Registry, storageEntry: StorageEntryMetadataLatest, imports: TypeImports): [boolean, string, string, string] {
|
||||
const outputType = lookup.getTypeDef(unwrapStorageSi(storageEntry.type));
|
||||
function entrySignature (lookup: PortableRegistry, allDefs: Record<string, ModuleTypes>, registry: Registry, section: string, storageEntry: StorageEntryMetadataLatest, imports: TypeImports): [boolean, string, string, string] {
|
||||
try {
|
||||
const outputType = lookup.getTypeDef(unwrapStorageSi(storageEntry.type));
|
||||
|
||||
if (storageEntry.type.isPlain) {
|
||||
const typeDef = lookup.getTypeDef(storageEntry.type.asPlain);
|
||||
if (storageEntry.type.isPlain) {
|
||||
const typeDef = lookup.getTypeDef(storageEntry.type.asPlain);
|
||||
|
||||
setImports(allDefs, imports, [
|
||||
typeDef.lookupName || typeDef.type,
|
||||
storageEntry.modifier.isOptional
|
||||
? 'Option'
|
||||
: null
|
||||
]);
|
||||
setImports(allDefs, imports, [
|
||||
typeDef.lookupName || typeDef.type,
|
||||
storageEntry.modifier.isOptional
|
||||
? 'Option'
|
||||
: null
|
||||
]);
|
||||
|
||||
return [storageEntry.modifier.isOptional, '', '', formatType(registry, allDefs, outputType, imports)];
|
||||
} else if (storageEntry.type.isMap) {
|
||||
const { hashers, key, value } = storageEntry.type.asMap;
|
||||
const keyDefs = hashers.length === 1
|
||||
? [lookup.getTypeDef(key)]
|
||||
: lookup.getSiType(key).def.asTuple.map((k) => lookup.getTypeDef(k));
|
||||
const similarTypes = keyDefs.map((k) => getSimilarTypes(registry, allDefs, k.lookupName || k.type, imports));
|
||||
const keyTypes = similarTypes.map((t) => t.join(' | '));
|
||||
const defValue = lookup.getTypeDef(value);
|
||||
return [storageEntry.modifier.isOptional, '', '', formatType(registry, allDefs, outputType, imports)];
|
||||
} else if (storageEntry.type.isMap) {
|
||||
const { hashers, key, value } = storageEntry.type.asMap;
|
||||
const keyDefs = hashers.length === 1
|
||||
? [lookup.getTypeDef(key)]
|
||||
: lookup.getSiType(key).def.asTuple.map((k) => lookup.getTypeDef(k));
|
||||
const similarTypes = keyDefs.map((k) => getSimilarTypes(registry, allDefs, k.lookupName || k.type, imports));
|
||||
const keyTypes = similarTypes.map((t) => t.join(' | '));
|
||||
const defValue = lookup.getTypeDef(value);
|
||||
|
||||
setImports(allDefs, imports, [
|
||||
...similarTypes.reduce<string[]>((all, t) => all.concat(t), []),
|
||||
storageEntry.modifier.isOptional
|
||||
? 'Option'
|
||||
: null,
|
||||
defValue.lookupName
|
||||
? undefined
|
||||
: defValue.type
|
||||
]);
|
||||
setImports(allDefs, imports, [
|
||||
...similarTypes.reduce<string[]>((all, t) => all.concat(t), []),
|
||||
storageEntry.modifier.isOptional
|
||||
? 'Option'
|
||||
: null,
|
||||
defValue.lookupName
|
||||
? undefined
|
||||
: defValue.type
|
||||
]);
|
||||
|
||||
return [
|
||||
storageEntry.modifier.isOptional,
|
||||
keyDefs.map((k) => formatType(registry, allDefs, k.lookupName || k.type, imports)).join(', '),
|
||||
keyTypes.map((t, i) => `arg${keyTypes.length === 1 ? '' : (i + 1)}: ${t}`).join(', '),
|
||||
formatType(registry, allDefs, outputType, imports)
|
||||
];
|
||||
return [
|
||||
storageEntry.modifier.isOptional,
|
||||
keyDefs.map((k) => formatType(registry, allDefs, k.lookupName || k.type, imports)).join(', '),
|
||||
keyTypes.map((t, i) => `arg${keyTypes.length === 1 ? '' : (i + 1)}: ${t}`).join(', '),
|
||||
formatType(registry, allDefs, outputType, imports)
|
||||
];
|
||||
}
|
||||
|
||||
throw new Error(`Expected Plain or Map type, found ${storageEntry.type.type}`);
|
||||
} catch (error) {
|
||||
throw new Error(`entrySignature: Cannot create signature for query ${section}.${storageEntry.name.toString()}:: ${(error as Error).message}`);
|
||||
}
|
||||
|
||||
throw new Error(`entryArgs: Cannot parse args of entry ${storageEntry.name.toString()}`);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
@@ -88,7 +92,7 @@ function generateForMeta (registry: Registry, meta: Metadata, dest: string, extr
|
||||
.map(({ name, storage }) => {
|
||||
const items = storage.unwrap().items
|
||||
.map((storageEntry) => {
|
||||
const [isOptional, args, params, _returnType] = entrySignature(lookup, allDefs, registry, storageEntry, imports);
|
||||
const [isOptional, args, params, _returnType] = entrySignature(lookup, allDefs, registry, name.toString(), storageEntry, imports);
|
||||
const returnType = isOptional
|
||||
? `Option<${_returnType}>`
|
||||
: _returnType;
|
||||
|
||||
@@ -50,7 +50,7 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
|
||||
const keys = named.map((def): string => {
|
||||
const { info, lookupName, name = '', type } = def;
|
||||
const getter = stringPascalCase(name.replace(' ', '_'));
|
||||
const isComplex = [TypeDefInfo.Option, TypeDefInfo.Result, TypeDefInfo.Struct, TypeDefInfo.Tuple, TypeDefInfo.Vec, TypeDefInfo.VecFixed].includes(info);
|
||||
const isComplex = [TypeDefInfo.Option, TypeDefInfo.Range, TypeDefInfo.RangeInclusive, TypeDefInfo.Result, TypeDefInfo.Struct, TypeDefInfo.Tuple, TypeDefInfo.Vec, TypeDefInfo.VecFixed].includes(info);
|
||||
const asGetter = type === 'Null' || info === TypeDefInfo.DoNotConstruct
|
||||
? ''
|
||||
: createGetter(definitions, `as${getter}`, lookupName || (isComplex ? formatType(registry, definitions, info === TypeDefInfo.Struct ? def : type, imports, false) : type), imports);
|
||||
@@ -61,6 +61,8 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
|
||||
switch (info) {
|
||||
case TypeDefInfo.Compact:
|
||||
case TypeDefInfo.Plain:
|
||||
case TypeDefInfo.Range:
|
||||
case TypeDefInfo.RangeInclusive:
|
||||
case TypeDefInfo.Result:
|
||||
case TypeDefInfo.Si:
|
||||
case TypeDefInfo.Struct:
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -8,7 +8,7 @@ declare module '@polkadot/api-base/types/events' {
|
||||
{{{name}}}: {
|
||||
{{#each items}}
|
||||
{{> docs}}
|
||||
{{{name}}}: AugmentedEvent<ApiType, [{{{type}}}]>;
|
||||
{{{name}}}: AugmentedEvent<ApiType, {{{type}}}>;
|
||||
{{/each}}
|
||||
{{#unless @root.isStrict}}
|
||||
/**
|
||||
|
||||
@@ -147,15 +147,15 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
return typeDef.lookupName;
|
||||
}
|
||||
|
||||
throw new Error(`TypeDefInfo.Enum: Not implemented on ${stringify(typeDef)}`);
|
||||
throw new Error(`TypeDefInfo.Enum: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Int]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Int: Not implemented on ${stringify(typeDef)}`);
|
||||
throw new Error(`TypeDefInfo.Int: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.UInt]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.UInt: Not implemented on ${stringify(typeDef)}`);
|
||||
throw new Error(`TypeDefInfo.UInt: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Null]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
@@ -183,7 +183,7 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
},
|
||||
|
||||
[TypeDefInfo.Set]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Set: Not implemented on ${stringify(typeDef)}`);
|
||||
throw new Error(`TypeDefInfo.Set: Parameter formatting not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Si]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
|
||||
@@ -11,8 +11,14 @@ export async function getMetadataViaWs (endpoint: string): Promise<HexString> {
|
||||
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);
|
||||
const msg = `disconnected, code: '${event.code}' reason: '${event.reason}'`;
|
||||
|
||||
if (event.code === 1000) {
|
||||
console.log(msg);
|
||||
} else {
|
||||
console.error(msg);
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
websocket.onerror = (event: unknown): void => {
|
||||
@@ -27,6 +33,7 @@ export async function getMetadataViaWs (endpoint: string): Promise<HexString> {
|
||||
|
||||
websocket.onmessage = (message: { data: string }): void => {
|
||||
resolve((JSON.parse(message.data) as { result: HexString }).result);
|
||||
websocket.close();
|
||||
};
|
||||
} catch (error) {
|
||||
process.exit(1);
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1"
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
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.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -17,7 +17,7 @@ import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
|
||||
import type { StatementKind } from '@polkadot/types/interfaces/claims';
|
||||
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
|
||||
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
|
||||
import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
|
||||
import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
|
||||
import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
|
||||
@@ -53,7 +53,7 @@ import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, Vouching
|
||||
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SignedSubmission, SignedSubmissionOf, SignedSubmissionTo276, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, SubmissionIndicesOf, Supports, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
|
||||
import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
|
||||
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
|
||||
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModuleU8a, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
|
||||
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
|
||||
import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
|
||||
import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
|
||||
import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques';
|
||||
@@ -240,8 +240,6 @@ declare module '@polkadot/types/types/registry' {
|
||||
ContractEventSpecV1: ContractEventSpecV1;
|
||||
ContractEventSpecV2: ContractEventSpecV2;
|
||||
ContractExecResult: ContractExecResult;
|
||||
ContractExecResultErr: ContractExecResultErr;
|
||||
ContractExecResultErrModule: ContractExecResultErrModule;
|
||||
ContractExecResultOk: ContractExecResultOk;
|
||||
ContractExecResultResult: ContractExecResultResult;
|
||||
ContractExecResultSuccessTo255: ContractExecResultSuccessTo255;
|
||||
@@ -307,6 +305,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
DispatchClass: DispatchClass;
|
||||
DispatchError: DispatchError;
|
||||
DispatchErrorModule: DispatchErrorModule;
|
||||
DispatchErrorModuleU8: DispatchErrorModuleU8;
|
||||
DispatchErrorModuleU8a: DispatchErrorModuleU8a;
|
||||
DispatchErrorTo198: DispatchErrorTo198;
|
||||
DispatchFeePayment: DispatchFeePayment;
|
||||
@@ -994,6 +993,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
TombstoneContractInfo: TombstoneContractInfo;
|
||||
TraceBlockResponse: TraceBlockResponse;
|
||||
TraceError: TraceError;
|
||||
TransactionalError: TransactionalError;
|
||||
TransactionInfo: TransactionInfo;
|
||||
TransactionPriority: TransactionPriority;
|
||||
TransactionStorageProof: TransactionStorageProof;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -20,16 +20,16 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/util": "^9.3.1"
|
||||
"@polkadot/util": "^9.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-augment": "8.6.2",
|
||||
"@polkadot/types-support": "8.6.2",
|
||||
"@polkadot/util-crypto": "^9.3.1"
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-augment": "8.8.2",
|
||||
"@polkadot/types-support": "8.8.2",
|
||||
"@polkadot/util-crypto": "^9.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ function decodeAbstractInt (value: Exclude<AnyNumber, Uint8Array>, isNegative: b
|
||||
} else if (isHex(value, -1, true)) {
|
||||
return hexToBn(value, { isLe: false, isNegative }).toString();
|
||||
} else if (isNumber(value)) {
|
||||
assert(value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER && Math.floor(value) === value, 'Number needs to be an integer <= Number.MAX_SAFE_INTEGER, i.e. 2 ^ 53 - 1');
|
||||
assert(value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER && Number.isInteger(value), 'Number needs to be an integer <= Number.MAX_SAFE_INTEGER, i.e. 2 ^ 53 - 1');
|
||||
} else if (isString(value)) {
|
||||
assert(!(value.includes('.') || value.includes(',') || value.includes('e')), 'String should not contain decimal points or scientific notation');
|
||||
}
|
||||
|
||||
@@ -43,6 +43,24 @@ describe('Option', (): void => {
|
||||
});
|
||||
});
|
||||
|
||||
it('can decode a nested Option', (): void => {
|
||||
expect(
|
||||
new Option(
|
||||
registry,
|
||||
Option.with(Option.with(Text)),
|
||||
new Option(
|
||||
registry,
|
||||
Option.with(Text),
|
||||
new Option(
|
||||
registry,
|
||||
Text,
|
||||
new Uint8Array([1, 3 << 2, 66, 67, 68])
|
||||
)
|
||||
)
|
||||
).toU8a()
|
||||
).toEqual(new Uint8Array([1, 1, 1, 3 << 2, 66, 67, 68]));
|
||||
});
|
||||
|
||||
it('can convert between different Some/None', (): void => {
|
||||
const def = '{ "foo":"Text", "zar":"Text" }';
|
||||
const none = new Option(registry, def, null);
|
||||
|
||||
@@ -29,16 +29,23 @@ class None extends Null {
|
||||
|
||||
/** @internal */
|
||||
function decodeOption (registry: Registry, Type: CodecClass, value?: unknown): Codec {
|
||||
// In the case of an option, unwrap the inner
|
||||
if (value instanceof Option) {
|
||||
value = value.value;
|
||||
}
|
||||
|
||||
if (isNull(value) || isUndefined(value) || value === '0x' || value instanceof None) {
|
||||
return new None(registry);
|
||||
} else if (value instanceof Type) {
|
||||
if (value instanceof Type) {
|
||||
// don't re-create, use as it (which also caters for derived types)
|
||||
return value;
|
||||
} else if (value instanceof Option) {
|
||||
if (value.value instanceof Type) {
|
||||
// same instance, return it
|
||||
return value.value;
|
||||
} else if (value.isNone) {
|
||||
// internal is None, we are also none
|
||||
return new None(registry);
|
||||
}
|
||||
|
||||
// convert the actual value into known
|
||||
return new Type(registry, value.value);
|
||||
} else if (isNull(value) || isUndefined(value) || value === '0x' || value instanceof None) {
|
||||
// anyhting empty we pass as-is
|
||||
return new None(registry);
|
||||
} else if (isU8a(value)) {
|
||||
// the isU8a check happens last in the if-tree - since the wrapped value
|
||||
// may be an instance of it, so Type and Option checks go in first
|
||||
|
||||
@@ -9,12 +9,7 @@ describe('Range', (): void => {
|
||||
let range: Range<U32>;
|
||||
|
||||
beforeEach((): void => {
|
||||
const Clazz = Range.with(U32);
|
||||
|
||||
range = new Clazz(
|
||||
registry,
|
||||
[new U32(registry, 1), new U32(registry, 2)]
|
||||
);
|
||||
range = new (Range.with(U32))(registry, [1, 2]);
|
||||
});
|
||||
|
||||
it('decodes', (): void => {
|
||||
|
||||
@@ -7,6 +7,10 @@ import { Tuple } from '../base/Tuple';
|
||||
|
||||
type RangeType = 'Range' | 'RangeInclusive';
|
||||
|
||||
interface Options {
|
||||
rangeName?: RangeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Range
|
||||
* @description
|
||||
@@ -15,19 +19,16 @@ type RangeType = 'Range' | 'RangeInclusive';
|
||||
export class Range<T extends INumber> extends Tuple {
|
||||
#rangeName: RangeType;
|
||||
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, value?: AnyTuple, rangeName: RangeType = 'Range') {
|
||||
super(registry, {
|
||||
end: Type,
|
||||
start: Type
|
||||
}, value);
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, value?: AnyTuple, { rangeName = 'Range' }: Options = {}) {
|
||||
super(registry, [Type, Type], value);
|
||||
|
||||
this.#rangeName = rangeName;
|
||||
}
|
||||
|
||||
public static override with <T extends INumber> (Types: CodecClass<T> | string): CodecClass<Range<T>> {
|
||||
public static override with <T extends INumber> (Type: CodecClass<T> | string): CodecClass<Range<T>> {
|
||||
return class extends Range<T> {
|
||||
constructor (registry: Registry, value?: AnyTuple) {
|
||||
super(registry, Types, value);
|
||||
super(registry, Type, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Range } from './Range';
|
||||
|
||||
export class RangeInclusive<T extends INumber = INumber> extends Range<T> {
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, value?: AnyTuple) {
|
||||
super(registry, Type, value, 'RangeInclusive');
|
||||
super(registry, Type, value, { rangeName: 'RangeInclusive' });
|
||||
}
|
||||
|
||||
public static override with <T extends INumber> (Type: CodecClass<T> | string): CodecClass<RangeInclusive<T>> {
|
||||
|
||||
@@ -11,6 +11,10 @@ import { Bytes } from './Bytes';
|
||||
|
||||
type OpaqueName = 'WrapperKeepOpaque' | 'WrapperOpaque';
|
||||
|
||||
interface Options {
|
||||
opaqueName?: OpaqueName;
|
||||
}
|
||||
|
||||
function decodeRaw<T extends Codec> (registry: Registry, typeName: CodecClass<T> | string, value?: unknown): [CodecClass<T>, T | null, AnyU8a] {
|
||||
const Type = typeToConstructor(registry, typeName);
|
||||
|
||||
@@ -38,7 +42,7 @@ export class WrapperKeepOpaque<T extends Codec> extends Bytes {
|
||||
|
||||
readonly #opaqueName: OpaqueName;
|
||||
|
||||
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown, opaqueName: OpaqueName = 'WrapperKeepOpaque') {
|
||||
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown, { opaqueName = 'WrapperKeepOpaque' }: Options = {}) {
|
||||
const [Type, decoded, u8a] = decodeRaw(registry, typeName, value);
|
||||
|
||||
super(registry, u8a);
|
||||
|
||||
@@ -7,7 +7,7 @@ import { WrapperKeepOpaque } from './WrapperKeepOpaque';
|
||||
|
||||
export class WrapperOpaque<T extends Codec> extends WrapperKeepOpaque<T> {
|
||||
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown) {
|
||||
super(registry, typeName, value, 'WrapperOpaque');
|
||||
super(registry, typeName, value, { opaqueName: 'WrapperOpaque' });
|
||||
}
|
||||
|
||||
public static override with<T extends Codec> (Type: CodecClass<T> | string): CodecClass<WrapperKeepOpaque<T>> {
|
||||
|
||||
@@ -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.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -92,12 +92,14 @@ export function alias (src: string, dest: string, withChecks = true): Mapper {
|
||||
|
||||
export function cleanupCompact (): Mapper {
|
||||
return (value: string): string => {
|
||||
for (let index = 0; index < value.length; index++) {
|
||||
if (value[index] === '<') {
|
||||
const end = findClosing(value, index + 1) - 14;
|
||||
if (value.includes(' as HasCompact')) {
|
||||
for (let index = 0; index < value.length; index++) {
|
||||
if (value[index] === '<') {
|
||||
const end = findClosing(value, index + 1) - 14;
|
||||
|
||||
if (value.substring(end, end + 14) === ' as HasCompact') {
|
||||
value = `Compact<${value.substring(index + 1, end)}>`;
|
||||
if (value.substring(end, end + 14) === ' as HasCompact') {
|
||||
value = `Compact<${value.substring(index + 1, end)}>`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,10 +142,12 @@ function replaceTagWith (value: string, matcher: string, replacer: (inner: strin
|
||||
|
||||
// remove the Bounded* or Weak* wrappers
|
||||
export function removeExtensions (type: string, isSized: boolean): Mapper {
|
||||
return (value: string) =>
|
||||
BOUNDED.reduce((value, tag) =>
|
||||
replaceTagWith(value, `${type}${tag}<`, (inner: string): string => {
|
||||
const parts = inner
|
||||
return (value: string): string => {
|
||||
for (let i = 0; i < BOUNDED.length; i++) {
|
||||
const tag = BOUNDED[i];
|
||||
|
||||
value = replaceTagWith(value, `${type}${tag}<`, (v: string): string => {
|
||||
const parts = v
|
||||
.split(',')
|
||||
.map((s) => s.trim())
|
||||
.filter((s) => s);
|
||||
@@ -153,8 +157,11 @@ export function removeExtensions (type: string, isSized: boolean): Mapper {
|
||||
}
|
||||
|
||||
return `${tag}<${parts.join(',')}>`;
|
||||
}), value
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
||||
export function removeColons (): Mapper {
|
||||
@@ -193,9 +200,15 @@ export function removeGenerics (): Mapper {
|
||||
const box = ALLOWED_BOXES.find((box): boolean => {
|
||||
const start = index - box.length;
|
||||
|
||||
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])
|
||||
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])
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -212,12 +225,15 @@ export function removeGenerics (): Mapper {
|
||||
};
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function pairOfReplacer (v: string): string {
|
||||
return `(${v},${v})`;
|
||||
}
|
||||
|
||||
// remove the PairOf wrappers
|
||||
export function removePairOf (): Mapper {
|
||||
const replacer = (inner: string) => `(${inner},${inner})`;
|
||||
|
||||
return (value: string) =>
|
||||
replaceTagWith(value, 'PairOf<', replacer);
|
||||
replaceTagWith(value, 'PairOf<', pairOfReplacer);
|
||||
}
|
||||
|
||||
// remove the type traits
|
||||
@@ -253,12 +269,15 @@ export function removeTraits (): Mapper {
|
||||
};
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function wrapReplacer (v: string): string {
|
||||
return v;
|
||||
}
|
||||
|
||||
// remove wrapping values, i.e. Box<Proposal> -> Proposal
|
||||
export function removeWrap (check: string): Mapper {
|
||||
const replacer = (inner: string) => inner;
|
||||
|
||||
return (value: string) =>
|
||||
replaceTagWith(value, check, replacer);
|
||||
replaceTagWith(value, check, wrapReplacer);
|
||||
}
|
||||
|
||||
const sanitizeMap = new Map<string, string>();
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1"
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "8.6.2"
|
||||
"@polkadot/types": "8.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/types-create authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Option, Text } from '@polkadot/types-codec';
|
||||
import type { ICompact, INumber } from '@polkadot/types-codec/types';
|
||||
import type { TypeDef } from './types';
|
||||
|
||||
@@ -11,4 +12,5 @@ export interface ILookup {
|
||||
}
|
||||
},
|
||||
getTypeDef (lookupId: ICompact<INumber> | string | number): TypeDef;
|
||||
sanitizeField (name: Option<Text>): [string | null, string | null];
|
||||
}
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.6.2",
|
||||
"version": "8.8.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/networks": "^9.3.1",
|
||||
"@polkadot/types": "8.6.2",
|
||||
"@polkadot/types-codec": "8.6.2",
|
||||
"@polkadot/types-create": "8.6.2",
|
||||
"@polkadot/util": "^9.3.1"
|
||||
"@polkadot/networks": "^9.4.1",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/types-create": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '8.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
|
||||
@@ -14,6 +14,7 @@ const sharedTypes = {
|
||||
docRoot: 'H256',
|
||||
id: 'H256'
|
||||
},
|
||||
DispatchErrorModule: 'DispatchErrorModuleU8',
|
||||
PreCommitData: {
|
||||
expirationBlock: 'u64',
|
||||
identity: 'H256',
|
||||
|
||||
@@ -10,6 +10,7 @@ import { objectSpread } from '@polkadot/util';
|
||||
|
||||
const sharedTypes = {
|
||||
CompactAssignments: 'CompactAssignmentsWith24',
|
||||
DispatchErrorModule: 'DispatchErrorModuleU8',
|
||||
RawSolution: 'RawSolutionWith24',
|
||||
Keys: 'SessionKeys6',
|
||||
ProxyType: {
|
||||
|
||||
@@ -9,6 +9,7 @@ import { objectSpread } from '@polkadot/util';
|
||||
|
||||
const sharedTypes = {
|
||||
CompactAssignments: 'CompactAssignmentsWith16',
|
||||
DispatchErrorModule: 'DispatchErrorModuleU8',
|
||||
RawSolution: 'RawSolutionWith16',
|
||||
Keys: 'SessionKeys6',
|
||||
ProxyType: {
|
||||
|
||||
@@ -12,6 +12,7 @@ import { objectSpread } from '@polkadot/util';
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
const sharedTypes = {
|
||||
DispatchErrorModule: 'DispatchErrorModuleU8',
|
||||
FullIdentification: '()', // No staking, only session (as per config)
|
||||
Keys: 'SessionKeys7B'
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@ import { mapXcmTypes } from '@polkadot/types-create';
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
const sharedTypes = {
|
||||
DispatchErrorModule: 'DispatchErrorModuleU8',
|
||||
TAssetBalance: 'u128',
|
||||
ProxyType: {
|
||||
_enum: [
|
||||
|
||||
@@ -11,6 +11,7 @@ import { objectSpread } from '@polkadot/util';
|
||||
const sharedTypes = {
|
||||
// 16 validators
|
||||
CompactAssignments: 'CompactAssignmentsWith16',
|
||||
DispatchErrorModule: 'DispatchErrorModuleU8',
|
||||
RawSolution: 'RawSolutionWith16',
|
||||
// general
|
||||
Keys: 'SessionKeys6',
|
||||
|
||||
@@ -16,7 +16,7 @@ const upgrades: ChainUpgradesRaw = [
|
||||
[7812476, 9040], [8010981, 9050], [8073833, 9070], [8555825, 9080], [8945245, 9090],
|
||||
[9611377, 9100], [9625129, 9111], [9866422, 9122], [10403784, 9130], [10960765, 9150],
|
||||
[11006614, 9151], [11404482, 9160], [11601803, 9170], [12008022, 9180], [12405451, 9190],
|
||||
[12665416, 9200]
|
||||
[12665416, 9200], [12909508, 9220]
|
||||
];
|
||||
|
||||
export default upgrades;
|
||||
|
||||
@@ -10,7 +10,8 @@ const upgrades: ChainUpgradesRaw = [
|
||||
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
|
||||
[3613564, 27], [3899547, 28], [4345767, 29], [4876134, 30], [5661442, 9050],
|
||||
[6321619, 9080], [6713249, 9090], [7217907, 9100], [7229126, 9110], [7560558, 9122],
|
||||
[8115869, 9140], [8638103, 9151], [9280179, 9170], [9738717, 9180], [10156856, 9190]
|
||||
[8115869, 9140], [8638103, 9151], [9280179, 9170], [9738717, 9180], [10156856, 9190],
|
||||
[10458576, 9200], [10655116, 9220]
|
||||
];
|
||||
|
||||
export default upgrades;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user