Compare commits

...
50 Commits
Author SHA1 Message Date
github-actions[bot] afc4ebcd43 [CI Skip] release/stable 8.8.2
skip-checks: true
2022-06-14 13:26:09 +00:00
Jaco a93c4e16d3 8.8.2 (#4937) 2022-06-14 16:16:43 +03:00
github-actions[bot] dd0da859e4 [CI Skip] release/beta 8.8.2-2
skip-checks: true
2022-06-14 09:35:05 +00:00
Jaco 7c75f7b923 Adjust sanitize (#4935)
* Adjust sanitize

* Update packages/types-codec/src/utils/sanitize.ts
2022-06-14 12:27:28 +03:00
github-actions[bot] f2e8b7702b [CI Skip] release/beta 8.8.2-1
skip-checks: true
2022-06-14 08:57:44 +00:00
Jaco dc01f6d4a0 Update to latest Substrate metadata (#4934)
* Update to latest Substrate metadata

* linting
2022-06-14 11:47:58 +03:00
github-actions[bot] f023b81b77 [CI Skip] release/beta 8.8.2-0
skip-checks: true
2022-06-14 04:33:45 +00:00
Jaco ebb47f0865 Bump dev (#4932) 2022-06-14 07:25:40 +03:00
github-actions[bot] e23d44d3f5 [CI Skip] release/stable 8.8.1
skip-checks: true
2022-06-12 09:03:06 +00:00
Jaco 0a444be04c 8.8.1 (#4929) 2022-06-12 11:53:39 +03:00
github-actions[bot] 1abb7085d6 [CI Skip] release/beta 8.7.2-19
skip-checks: true
2022-06-12 08:23:17 +00:00
Jaco bda5cda4bf Update issue template (#4928) 2022-06-12 11:13:50 +03:00
github-actions[bot] fe7e313f21 [CI Skip] release/beta 8.7.2-18
skip-checks: true
2022-06-12 07:44:29 +00:00
Jaco 31971b5d2c Correct handling for storage Option<Option<Type>> (#4927)
* Correct handling for storage Option<Option<Type>>

* Adjust
2022-06-12 10:36:41 +03:00
github-actions[bot] 54efaa665d [CI Skip] release/beta 8.7.2-17
skip-checks: true
2022-06-11 05:53:00 +00:00
Jaco ddb435219d Bump deps (& issue template) (#4924) 2022-06-11 08:44:02 +03:00
github-actions[bot] 6ceb381ed0 [CI Skip] release/beta 8.7.2-16
skip-checks: true
2022-06-10 09:57:20 +00:00
Jaco 6a82ab1efd Add Polkadot & Westend upgrade blocks (#4922)
* Add Polkadot & Westend upgrade blocks

* Correct versions

* Adjust CHANGELOG
2022-06-10 12:49:20 +03:00
github-actions[bot] 8e3cef8dbc [CI Skip] release/beta 8.7.2-15
skip-checks: true
2022-06-10 08:30:59 +00:00
Jaco 5fcfb1277d Align IEventData interfaces (#4921) 2022-06-10 11:22:13 +03:00
github-actions[bot] 61ca15c143 [CI Skip] release/beta 8.7.2-14
skip-checks: true
2022-06-10 06:49:23 +00:00
Jaco 0930a5e0dc Expose partial runtimeVersion on api.at (#4920) 2022-06-10 09:41:22 +03:00
github-actions[bot] 03824f4600 [CI Skip] release/beta 8.7.2-13
skip-checks: true
2022-06-10 06:05:39 +00:00
Jaco 1e785b50da Adjust named enum fields augmentation (#4919)
* Adjust named enum fields augmentation

* Named tuples

* Adjust sanitize for symbol

* Explicit check

* Remove unused code

* Adjust expansion

* Adjust (only keep to named tuples this round)

* Pass struct
2022-06-10 08:57:16 +03:00
github-actions[bot] daeb86a7af [CI Skip] release/beta 8.7.2-12
skip-checks: true
2022-06-09 10:52:26 +00:00
Jaco 7461527448 Cater for named event fields (#4915)
* Cater for named event fields

* Adjust name extraction

* Rebuild with named events

* Empty object

* Adjust

* Additional

* Adjust
2022-06-09 13:44:31 +03:00
github-actions[bot] 322ac0861d [CI Skip] release/beta 8.7.2-11
skip-checks: true
2022-06-08 17:14:09 +00:00
Jaco 52cd06917d Pass Range/WrapperOpaque names via options (#4911) 2022-06-08 20:04:01 +03:00
github-actions[bot] 767eb1fa15 [CI Skip] release/beta 8.7.2-10
skip-checks: true
2022-06-08 13:54:48 +00:00
Jaco 60640b4c6c Update derive.bagsList to detect voterList pallet (#4910)
* Update `derive.bagsList` to detect `voterList` pallet

* Adjust

* Adjust
2022-06-08 16:45:48 +03:00
github-actions[bot] dfd45e866b [CI Skip] release/beta 8.7.2-9
skip-checks: true
2022-06-08 11:40:15 +00:00
Jaco dafa9ccc2c assert for blockHash alongside era override (#4909)
* assert for blockHash alongside era override

* typo
2022-06-08 14:31:08 +03:00
github-actions[bot] aeb76aea9a [CI Skip] release/beta 8.7.2-8
skip-checks: true
2022-06-08 10:48:06 +00:00
Jaco 436e48aab2 Align DispatchError (#4907) 2022-06-08 13:38:38 +03:00
github-actions[bot] 0871458312 [CI Skip] release/beta 8.7.2-7
skip-checks: true
2022-06-08 09:36:14 +00:00
Jaco 7edff67240 Split rpc.system.* definitions (#4906) 2022-06-08 12:28:03 +03:00
github-actions[bot] 89a2ff2cda [CI Skip] release/beta 8.7.2-6
skip-checks: true
2022-06-08 08:41:03 +00:00
Jaco d0fbecb0c4 Bump dev (#4905) 2022-06-08 11:31:40 +03:00
github-actions[bot] ed8802e605 [CI Skip] release/beta 8.7.2-5
skip-checks: true
2022-06-08 07:23:43 +00:00
Jaco 791e76546a Workaround for default calls on chains with non-standard indexes (#4904) 2022-06-08 10:15:48 +03:00
github-actions[bot] 804b58139a [CI Skip] release/beta 8.7.2-4
skip-checks: true
2022-06-07 19:39:26 +00:00
Raphael Flechtner ec746648c7 fix: typegen disconnect ws on success (#4901)
* fix: typegen disconnect ws on success

* fix: check for error onclose
2022-06-07 22:30:23 +03:00
github-actions[bot] 4cd8d5c60b [CI Skip] release/beta 8.7.2-3
skip-checks: true
2022-06-07 11:52:23 +00:00
Jaco df74330b67 Adjust AbstractInt asserts (#4898)
* Adjust AbstractInt asserts

* Adjust

* Number.isInteger
2022-06-07 14:43:39 +03:00
github-actions[bot] ea36b6d486 [CI Skip] release/beta 8.7.2-2
skip-checks: true
2022-06-06 07:37:12 +00:00
Jaco a210a7314d Use Result<.., ...> instead of specific enum (#4895) 2022-06-06 10:28:50 +03:00
github-actions[bot] 2d5d8e6713 [CI Skip] release/beta 8.7.2-1
skip-checks: true
2022-06-06 05:48:31 +00:00
Jaco 56a3d4ece8 DispatchError{U8, U8a} aliasing (w/ contracts RPC) (#4894)
* DispatchError{U8, U8a} aliasing (w/ contracts RPC)

* Rename
2022-06-06 08:40:35 +03:00
github-actions[bot] 3336f5530c [CI Skip] release/beta 8.7.2-0
skip-checks: true
2022-06-06 04:06:56 +00:00
Jaco f96b9c6d19 Optimization for value returns on merged queries (#4893)
* Optimization for value returns on merged queries

* Adjust

* Flatten
2022-06-06 06:58:00 +03:00
100 changed files with 10794 additions and 4330 deletions
+2 -1
View File
@@ -54,4 +54,5 @@
8.0.2
8.3.2
8.4.2
8.6.2
8.6.2
8.8.2
+50
View File
@@ -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
+30
View File
@@ -1,5 +1,35 @@
# 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:
+2 -1
View File
@@ -1,4 +1,4 @@
2999 Jaco 8.7.1 (#4892)
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)
+4 -4
View File
@@ -11,7 +11,7 @@
},
"sideEffects": false,
"type": "commonjs",
"version": "8.7.1",
"version": "8.8.2",
"workspaces": [
"packages/*"
],
@@ -31,12 +31,12 @@
"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.34",
"@polkadot/dev": "^0.67.3",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^28.1.0",
"@types/jest": "^28.1.1",
"copyfiles": "^2.4.1"
},
"resolutions": {
+7 -7
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/api-base": "8.7.1",
"@polkadot/rpc-augment": "8.7.1",
"@polkadot/types": "8.7.1",
"@polkadot/types-augment": "8.7.1",
"@polkadot/types-codec": "8.7.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.7.1"
"@polkadot/types-support": "8.8.2"
}
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.7.1' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.8.2' };
+145 -145
View File
@@ -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
**/
+83 -1
View File
@@ -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).
+249 -9
View File
@@ -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
+133 -7
View File
@@ -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
**/
+445 -17
View File
@@ -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.
+3 -3
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-core": "8.7.1",
"@polkadot/types": "8.7.1",
"@polkadot/rpc-core": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/util": "^9.4.1",
"rxjs": "^7.5.5"
}
+1 -1
View File
@@ -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.7.1' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.8.2' };
+2 -2
View File
@@ -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>;
}
+6 -6
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/api": "8.7.1",
"@polkadot/types": "8.7.1",
"@polkadot/types-codec": "8.7.1",
"@polkadot/types-create": "8.7.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.7.1",
"@polkadot/api-augment": "8.8.2",
"@polkadot/keyring": "^9.4.1"
}
}
+1 -1
View File
@@ -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.7.1' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.8.2' };
+12 -12
View File
@@ -20,25 +20,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/api": "8.7.1",
"@polkadot/api-augment": "8.7.1",
"@polkadot/api-base": "8.7.1",
"@polkadot/rpc-core": "8.7.1",
"@polkadot/types": "8.7.1",
"@polkadot/types-codec": "8.7.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.7.1",
"@polkadot/api-augment": "8.7.1",
"@polkadot/rpc-augment": "8.7.1",
"@polkadot/rpc-provider": "8.7.1",
"@polkadot/types-support": "8.7.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-support": "8.8.2"
}
}
+3 -3
View File
@@ -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))
),
@@ -18,7 +18,7 @@ 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 => {
nextTick((): void => {
+3 -2
View File
@@ -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'],
+1 -1
View File
@@ -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.7.1' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.8.2' };
+14 -14
View File
@@ -20,29 +20,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/api-augment": "8.7.1",
"@polkadot/api-base": "8.7.1",
"@polkadot/api-derive": "8.7.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.7.1",
"@polkadot/rpc-core": "8.7.1",
"@polkadot/rpc-provider": "8.7.1",
"@polkadot/types": "8.7.1",
"@polkadot/types-augment": "8.7.1",
"@polkadot/types-codec": "8.7.1",
"@polkadot/types-create": "8.7.1",
"@polkadot/types-known": "8.7.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.7.1",
"@polkadot/types-support": "8.7.1"
"@polkadot/api-augment": "8.8.2",
"@polkadot/types-support": "8.8.2"
}
}
+58 -95
View File
@@ -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, nextTick, 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';
@@ -59,9 +59,9 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
#registry: Registry;
#storageGetQ: [[StorageEntry, ...unknown[]][], Observable<Codec[]>][] = [];
#storageGetQ: [Observable<Codec[]>, [StorageEntry, unknown[]][]][] = [];
#storageSubQ: [[StorageEntry, ...unknown[]][], Observable<Codec[]>][] = [];
#storageSubQ: [Observable<Codec[]>, [StorageEntry, unknown[]][]][] = [];
// HACK Use BN import so decorateDerive works... yes, wtf.
protected __phantom = new BN(0);
@@ -243,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,
@@ -285,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 {
@@ -406,12 +407,11 @@ 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((keys: QueryableStorageMultiArg<ApiType>[]): Observable<Codec[]> => {
const query = this.hasSubscriptions
return decorateMethod((keys: QueryableStorageMultiArg<ApiType>[]): Observable<Codec[]> =>
(this.hasSubscriptions
? this._rpcCore.state.subscribeStorage
: this._rpcCore.state.queryStorageAt;
const calls = keys.map((args: QueryableStorageMultiArg<ApiType>): [StorageEntry, ...unknown[]] =>
: this._rpcCore.state.queryStorageAt
)(keys.map((args: QueryableStorageMultiArg<ApiType>): [StorageEntry, ...unknown[]] =>
Array.isArray(args)
? args[0].creator.meta.type.isPlain
? [args[0].creator]
@@ -419,22 +419,8 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
? [args[0].creator, args.slice(1)]
: [args[0].creator, ...args.slice(1)]
: [args.creator]
);
// NOTE Skipping
//
// // with a smaller number of keys we combine this into a queue
// // along with other ongoing queries
// if (calls.length <= PAGE_SIZE_Q) {
// const queue = this.hasSubscriptions
// ? this.#storageSubQ
// : this.#storageGetQ;
// return this._queuedStorage(calls, queue, query);
// }
return query(calls);
});
))
);
}
protected _decorateMultiAt<ApiType extends ApiTypes> (atApi: ApiDecoration<ApiType>, decorateMethod: DecorateMethod<ApiType>, blockHash: Uint8Array | string): QueryableStorageMulti<ApiType> {
@@ -655,62 +641,43 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
return this._decorateFunctionMeta(creator as unknown as MetaDecoration, decorated) as unknown as QueryableStorageEntry<ApiType>;
}
private _queuedStorage (calls: [StorageEntry, ...unknown[]][], queue: [[StorageEntry, ...unknown[]][], Observable<Codec[]>][], query: (calls: unknown[]) => Observable<Codec[]>): Observable<Codec[]> {
const count = calls.length;
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][0].length === PAGE_SIZE_Q || count >= PAGE_SIZE_Q) {
if (queueIdx === -1 || !queue[queueIdx] || queue[queueIdx][1].length === PAGE_SIZE_Q) {
queueIdx++;
queue.push([[], from(
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];
.then((): [StorageEntry, unknown[]][] => {
const calls = queue[queueIdx][1];
delete queue[queueIdx];
return calls;
})
.catch(() => [])
).pipe(
switchMap((calls) =>
query(calls)
)
)]);
}
switchMap((calls) => query(calls))
);
const valueIdx = queue[queueIdx][0].length;
const valueObs = queue[queueIdx][1];
queue.push([valueObs, [call]]);
} else {
valueObs = queue[queueIdx][0];
valueIdx = queue[queueIdx][1].length;
for (let i = 0; i < count; i++) {
queue[queueIdx][0].push(calls[i]);
queue[queueIdx][1].push(call);
}
return valueObs.pipe(
map((values): Codec[] => {
if (valueIdx === 0 && values.length === count) {
return values;
} else if (count === 1) {
return [values[valueIdx]];
}
const result = new Array<Codec>(count);
for (let i = 0; i < count; i++) {
result[i] = values[valueIdx + i];
}
return result;
})
);
}
private _queuedStorageSingle (call: [StorageEntry, ...unknown[]], queue: [[StorageEntry, ...unknown[]][], Observable<Codec[]>][], query: (calls: unknown[]) => Observable<Codec[]>): Observable<Codec> {
return this._queuedStorage([call], queue, query).pipe(
map(([first]) => first)
map((values) => values[valueIdx])
);
}
@@ -724,11 +691,11 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
return this._rpcCore.state.getStorage(call);
}
return this._queuedStorageSingle(call, this.#storageSubQ, this._rpcCore.state.subscribeStorage);
return this._queueStorage(call, this.#storageSubQ);
}, {
methodName: creator.method,
overrideNoSub: (...args: unknown[]) =>
this._queuedStorageSingle(extractStorageArgs(this.#registry, creator, args), this.#storageGetQ, this._rpcCore.state.queryStorageAt)
this._queueStorage(extractStorageArgs(this.#registry, creator, args), this.#storageGetQ)
});
}
@@ -755,18 +722,6 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
? this._rpcCore.state.subscribeStorage
: this._rpcCore.state.queryStorageAt;
// NOTE Skipping
//
// // Where we have a limited number of multi keys, we combine
// // this query with others that precedes it (same tick)
// if (!blockHash && keys.length <= PAGE_SIZE_Q) {
// const queue = this.hasSubscriptions
// ? this.#storageSubQ
// : this.#storageGetQ;
// return this._queuedStorage(keys, queue, query);
// }
if (keys.length <= PAGE_SIZE_V) {
return blockHash
? query(keys, blockHash)
@@ -789,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 => {
tap((keys) =>
nextTick((): void => {
keys.length === PAGE_SIZE_K
? startSubject.next(keys[PAGE_SIZE_K - 1].toHex())
: startSubject.complete();
});
}),
})
),
toArray(), // toArray since we want to startSubject to be completed
map(arrayFlatten)
);
@@ -813,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])
)
@@ -841,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])
)
+5 -5
View File
@@ -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;
}
+3 -5
View File
@@ -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;
}
+23 -4
View File
@@ -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());
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.7.1' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.8.2' };
+3 -1
View File
@@ -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
+2 -1
View File
@@ -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'>;
};
+4 -4
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-core": "8.7.1",
"@polkadot/types": "8.7.1",
"@polkadot/types-codec": "8.7.1",
"@polkadot/rpc-core": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/util": "^9.4.1"
}
}
+1 -1
View File
@@ -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.7.1' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.8.2' };
+5 -5
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-augment": "8.7.1",
"@polkadot/rpc-provider": "8.7.1",
"@polkadot/types": "8.7.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.4.1",
"@polkadot/rpc-augment": "8.7.1"
"@polkadot/rpc-augment": "8.8.2"
}
}
+5 -1
View File
@@ -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(', ');
+1 -1
View File
@@ -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.7.1' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.8.2' };
+4 -4
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/keyring": "^9.4.1",
"@polkadot/types": "8.7.1",
"@polkadot/types-support": "8.7.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",
@@ -34,7 +34,7 @@
"@polkadot/x-ws": "^9.4.1",
"@substrate/connect": "0.7.5",
"eventemitter3": "^4.0.7",
"mock-socket": "^9.1.4",
"mock-socket": "^9.1.5",
"nock": "^13.2.6"
}
}
+1 -1
View File
@@ -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.7.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.8.2' };
+11 -11
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
@@ -30,18 +30,18 @@
"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.7.1",
"@polkadot/api-augment": "8.7.1",
"@polkadot/rpc-augment": "8.7.1",
"@polkadot/rpc-provider": "8.7.1",
"@polkadot/types": "8.7.1",
"@polkadot/types-augment": "8.7.1",
"@polkadot/types-codec": "8.7.1",
"@polkadot/types-create": "8.7.1",
"@polkadot/types-support": "8.7.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",
+9 -1
View File
@@ -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),
+41 -37
View File
@@ -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;
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.7.1' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.8.2' };
+1 -1
View File
@@ -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}}
/**
+4 -4
View File
@@ -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) => {
+9 -2
View File
@@ -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);
+3 -3
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/types": "8.7.1",
"@polkadot/types-codec": "8.7.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
+1 -1
View File
@@ -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.7.1' };
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
+4 -4
View File
@@ -20,16 +20,16 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/util": "^9.4.1"
},
"devDependencies": {
"@polkadot/types": "8.7.1",
"@polkadot/types-augment": "8.7.1",
"@polkadot/types-support": "8.7.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);
+15 -8
View File
@@ -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 => {
+8 -7
View File
@@ -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>> {
+1 -1
View File
@@ -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.7.1' };
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '8.8.2' };
+39 -20
View File
@@ -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>();
+3 -3
View File
@@ -20,14 +20,14 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/types-codec": "8.7.1",
"@polkadot/types-codec": "8.8.2",
"@polkadot/util": "^9.4.1"
},
"devDependencies": {
"@polkadot/types": "8.7.1"
"@polkadot/types": "8.8.2"
}
}
+1 -1
View File
@@ -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.7.1' };
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];
}
+4 -4
View File
@@ -20,14 +20,14 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/networks": "^9.4.1",
"@polkadot/types": "8.7.1",
"@polkadot/types-codec": "8.7.1",
"@polkadot/types-create": "8.7.1",
"@polkadot/types": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/types-create": "8.8.2",
"@polkadot/util": "^9.4.1"
}
}
+1 -1
View File
@@ -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.7.1' };
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',
+1
View File
@@ -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: {
+1
View File
@@ -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: [
+1
View File
@@ -11,6 +11,7 @@ import { objectSpread } from '@polkadot/util';
const sharedTypes = {
// 16 validators
CompactAssignments: 'CompactAssignmentsWith16',
DispatchErrorModule: 'DispatchErrorModuleU8',
RawSolution: 'RawSolutionWith16',
// general
Keys: 'SessionKeys6',
@@ -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;
+1 -1
View File
@@ -14,7 +14,7 @@ const upgrades: ChainUpgradesRaw = [
[6379314, 9080], [6979141, 9090], [7568453, 9100], [7766394, 9111], [7911691, 9120],
[7968866, 9121], [7982889, 9122], [8514322, 9130], [9091726, 9140], [9091774, 9150],
[9406726, 9160], [9921066, 9170], [10007115, 9180], [10480973, 9190], [10578091, 9200],
[10678509, 9210], [10811001, 9220]
[10678509, 9210], [10811001, 9220], [11096116, 9230]
];
export default upgrades;
+1 -1
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '8.7.1' };
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '8.8.2' };
+5 -5
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.7.1",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/keyring": "^9.4.1",
"@polkadot/types-augment": "8.7.1",
"@polkadot/types-codec": "8.7.1",
"@polkadot/types-create": "8.7.1",
"@polkadot/types-augment": "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/keyring": "^9.4.1",
"@polkadot/types-support": "8.7.1"
"@polkadot/types-support": "8.8.2"
}
}
+31 -2
View File
@@ -4,7 +4,7 @@
import type { Codec, CodecClass, IU8a } from '@polkadot/types-codec/types';
import type { CreateOptions, TypeDef } from '@polkadot/types-create/types';
import type { ExtDef } from '../extrinsic/signedExtensions/types';
import type { ChainProperties, DispatchErrorModule, DispatchErrorModuleU8a, EventMetadataLatest, Hash, MetadataLatest, SiField, SiLookupTypeId, SiVariant } from '../interfaces/types';
import type { ChainProperties, DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, EventMetadataLatest, Hash, MetadataLatest, SiField, SiLookupTypeId, SiVariant } from '../interfaces/types';
import type { CallFunction, CodecHasher, Definitions, DetectCodec, RegisteredTypes, Registry, RegistryError, RegistryTypes } from '../types';
import { DoNotConstruct, Json, Raw } from '@polkadot/types-codec';
@@ -22,8 +22,14 @@ import { Metadata } from '../metadata/Metadata';
import { PortableRegistry } from '../metadata/PortableRegistry';
import { lazyVariants } from './lazy';
const DEFAULT_FIRST_CALL_IDX = new Uint8Array(2);
const l = logger('registry');
function sortDecimalStrings (a: string, b: string): number {
return parseInt(a, 10) - parseInt(b, 10);
}
function valueToString (v: { toString: () => string }): string {
return v.toString();
}
@@ -136,6 +142,8 @@ export class TypeRegistry implements Registry {
#definitions = new Map<string, string>();
#firstCallIndex: Uint8Array | null = null;
#lookup?: PortableRegistry;
#metadata?: MetadataLatest;
@@ -211,6 +219,10 @@ export class TypeRegistry implements Registry {
return [formatBalance.getDefaults().unit];
}
public get firstCallIndex (): Uint8Array {
return this.#firstCallIndex || DEFAULT_FIRST_CALL_IDX;
}
/**
* @description Returns true if the type is in a Compat format
*/
@@ -288,7 +300,7 @@ export class TypeRegistry implements Registry {
}
// finds an error
public findMetaError (errorIndex: Uint8Array | DispatchErrorModule | DispatchErrorModuleU8a): RegistryError {
public findMetaError (errorIndex: Uint8Array | DispatchErrorModule | DispatchErrorModuleU8 | DispatchErrorModuleU8a): RegistryError {
const [section, method] = isU8a(errorIndex)
? [errorIndex[0], errorIndex[1]]
: [
@@ -503,6 +515,7 @@ export class TypeRegistry implements Registry {
public setMetadata (metadata: Metadata, signedExtensions?: string[], userExtensions?: ExtDef): void {
this.#metadata = metadata.asLatest;
this.#metadataVersion = metadata.version;
this.#firstCallIndex = null;
// attach the lookup at this point (before injecting)
this.setLookup(this.#metadata.lookup);
@@ -511,6 +524,22 @@ export class TypeRegistry implements Registry {
injectErrors(this, this.#metadata, this.#metadataVersion, this.#metadataErrors);
injectEvents(this, this.#metadata, this.#metadataVersion, this.#metadataEvents);
// set the default call index (the lowest section, the lowest method)
// in most chains this should be 0,0
const [defSection] = Object
.keys(this.#metadataCalls)
.sort(sortDecimalStrings);
if (defSection) {
const [defMethod] = Object
.keys(this.#metadataCalls[defSection])
.sort(sortDecimalStrings);
if (defMethod) {
this.#firstCallIndex = new Uint8Array([parseInt(defSection, 10), parseInt(defMethod, 10)]);
}
}
// setup the available extensions
this.setSignedExtensions(
signedExtensions || (
+22 -12
View File
@@ -188,26 +188,36 @@ export class MortalEra extends Tuple {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public override toU8a (isBare?: boolean): Uint8Array {
const period = this.period.toNumber();
const phase = this.phase.toNumber();
const quantizeFactor = Math.max(period >> 12, 1);
const trailingZeros = getTrailingZeros(period);
const encoded = Math.min(15, Math.max(1, trailingZeros - 1)) + (((phase / quantizeFactor) << 4));
const first = encoded >> 8;
const second = encoded & 0xff;
const encoded = Math.min(
15,
Math.max(1, getTrailingZeros(period) - 1)
) + (
(
this.phase.toNumber() / Math.max(period >> 12, 1)
) << 4
);
return new Uint8Array([second, first]);
return new Uint8Array([
encoded & 0xff,
encoded >> 8
]);
}
/**
* @description Get the block number of the start of the era whose properties this object describes that `current` belongs to.
*/
public birth (current: BN | bigint | number | string): number {
const phase = this.phase.toNumber();
const period = this.period.toNumber();
// FIXME No toNumber() here
return Math.floor(
(
Math.max(bnToBn(current).toNumber(), this.phase.toNumber()) - this.phase.toNumber()
) / this.period.toNumber()
) * this.period.toNumber() + this.phase.toNumber();
return (
~~(
(
Math.max(bnToBn(current).toNumber(), phase) - phase
) / period
) * period
) + phase;
}
/**
+1 -1
View File
@@ -59,7 +59,7 @@ function decodeCallViaObject (registry: Registry, value: DecodedMethod, _meta?:
/** @internal */
function decodeCallViaU8a (registry: Registry, value: Uint8Array, _meta?: FunctionMetadataLatest): DecodedMethod {
// We need 2 bytes for the callIndex
const callIndex = new Uint8Array(2);
const callIndex = registry.firstCallIndex.slice();
callIndex.set(value.subarray(0, 2), 0);
+38 -2
View File
@@ -8,7 +8,7 @@ import type { EventId } from '../interfaces/system';
import type { IEvent, IEventData, InterfaceTypes, Registry } from '../types';
import { Null, Struct, Tuple } from '@polkadot/types-codec';
import { objectSpread } from '@polkadot/util';
import { objectProperties, objectSpread } from '@polkadot/util';
interface Decoded {
DataType: CodecClass<Null> | CodecClass<GenericEventData>;
@@ -45,6 +45,8 @@ export class GenericEventData extends Tuple implements IEventData {
readonly #method: string;
readonly #names: string[] | null = null;
readonly #section: string;
readonly #typeDef: TypeDef[];
@@ -58,6 +60,16 @@ export class GenericEventData extends Tuple implements IEventData {
this.#method = method;
this.#section = section;
this.#typeDef = fields.map(({ type }) => registry.lookup.getTypeDef(type));
const names = fields
.map(({ name }) => registry.lookup.sanitizeField(name)[0])
.filter((n): n is string => !!n);
if (names.length === fields.length) {
this.#names = names;
objectProperties(this, names, (_, i) => this[i]);
}
}
/**
@@ -74,6 +86,13 @@ export class GenericEventData extends Tuple implements IEventData {
return this.#method;
}
/**
* @description The field names (as available)
*/
public get names (): string[] | null {
return this.#names;
}
/**
* @description The section as a string
*/
@@ -87,6 +106,23 @@ export class GenericEventData extends Tuple implements IEventData {
public get typeDef (): TypeDef[] {
return this.#typeDef;
}
/**
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
*/
public override toHuman (isExtended?: boolean): AnyJson {
if (this.#names !== null) {
const json: Record<string, AnyJson> = {};
for (let i = 0; i < this.#names.length; i++) {
json[this.#names[i]] = this[i].toHuman(isExtended);
}
return json;
}
return super.toHuman(isExtended);
}
}
/**
@@ -111,7 +147,7 @@ export class GenericEvent extends Struct implements IEvent<Codec[]> {
/**
* @description The wrapped [[EventData]]
*/
public get data (): GenericEventData {
public get data (): IEvent<Codec[]>['data'] {
return this.getT('data');
}
@@ -34,12 +34,7 @@ export default {
code: 'Bytes',
storageDepositLimit: 'Option<Balance>'
},
CodeUploadResult: {
_enum: {
Ok: 'CodeUploadResultValue',
Err: 'Null'
}
},
CodeUploadResult: 'Result<CodeUploadResultValue, DispatchError>',
CodeUploadResultValue: {
codeHash: 'CodeHash',
deposit: 'Balance'
@@ -73,29 +68,11 @@ export default {
Error: 'Null'
}
},
ContractExecResultErrModule: {
index: 'u8',
error: 'u8',
message: 'Option<Text>'
},
ContractExecResultErr: {
_enum: {
Other: 'Text',
CannotLookup: 'Null',
BadOrigin: 'Null',
Module: 'ContractExecResultErrModule'
}
},
ContractExecResultOk: {
flags: 'ContractReturnFlags',
data: 'Bytes'
},
ContractExecResultResult: {
_enum: {
Ok: 'ContractExecResultOk',
Err: 'ContractExecResultErr'
}
},
ContractExecResultResult: 'Result<ContractExecResultOk, DispatchError>',
ContractExecResultTo267: {
gasConsumed: 'u64',
debugMessage: 'Text',
@@ -268,19 +245,8 @@ export default {
data: 'Bytes',
salt: 'Bytes'
},
ContractInstantiateResultTo267: {
_enum: {
Ok: 'InstantiateReturnValueTo267',
Err: 'Null'
}
},
ContractInstantiateResultTo299: {
_enum: {
Ok: 'InstantiateReturnValue',
Err: 'Null'
},
_fallback: 'ContractInstantiateResultTo267'
},
ContractInstantiateResultTo267: 'Result<InstantiateReturnValueTo267, Null>',
ContractInstantiateResultTo299: 'Result<InstantiateReturnValueOk, Null>',
ContractInstantiateResult: {
_fallback: 'ContractInstantiateResultTo299',
gasConsumed: 'u64',
@@ -298,12 +264,7 @@ export default {
result: 'ExecReturnValue',
accountId: 'AccountId'
},
InstantiateReturnValue: {
_enum: {
Ok: 'InstantiateReturnValueOk',
Err: 'DispatchError'
}
},
InstantiateReturnValue: 'Result<InstantiateReturnValueOk, DispatchError>',
InstructionWeights: {
i64const: 'u32',
i64load: 'u32',
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Bytes, Compact, Enum, Null, Option, Raw, Set, Struct, Text, U8aFixed, bool, u32, u64, u8 } from '@polkadot/types-codec';
import type { Bytes, Compact, Enum, Null, Option, Raw, Result, Set, Struct, Text, U8aFixed, bool, u32, u64, u8 } from '@polkadot/types-codec';
import type { AccountId, Balance, BlockNumber, Hash, Weight } from '@polkadot/types/interfaces/runtime';
import type { DispatchError } from '@polkadot/types/interfaces/system';
@@ -38,11 +38,15 @@ export interface CodeUploadRequest extends Struct {
}
/** @name CodeUploadResult */
export interface CodeUploadResult extends Enum {
export interface CodeUploadResult extends Result<CodeUploadResultValue, DispatchError> {
readonly isErr: boolean;
readonly asErr: DispatchError;
/** @deprecated Use isErr */
readonly isError: boolean;
/** @deprecated Use asErr */
readonly asError: DispatchError;
readonly isOk: boolean;
readonly asOk: CodeUploadResultValue;
readonly isErr: boolean;
readonly type: 'Ok' | 'Err';
}
/** @name CodeUploadResultValue */
@@ -78,24 +82,6 @@ export interface ContractExecResult extends Struct {
readonly result: ContractExecResultResult;
}
/** @name ContractExecResultErr */
export interface ContractExecResultErr extends Enum {
readonly isOther: boolean;
readonly asOther: Text;
readonly isCannotLookup: boolean;
readonly isBadOrigin: boolean;
readonly isModule: boolean;
readonly asModule: ContractExecResultErrModule;
readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module';
}
/** @name ContractExecResultErrModule */
export interface ContractExecResultErrModule extends Struct {
readonly index: u8;
readonly error: u8;
readonly message: Option<Text>;
}
/** @name ContractExecResultOk */
export interface ContractExecResultOk extends Struct {
readonly flags: ContractReturnFlags;
@@ -103,12 +89,15 @@ export interface ContractExecResultOk extends Struct {
}
/** @name ContractExecResultResult */
export interface ContractExecResultResult extends Enum {
export interface ContractExecResultResult extends Result<ContractExecResultOk, DispatchError> {
readonly isErr: boolean;
readonly asErr: DispatchError;
/** @deprecated Use isErr */
readonly isError: boolean;
/** @deprecated Use asErr */
readonly asError: DispatchError;
readonly isOk: boolean;
readonly asOk: ContractExecResultOk;
readonly isErr: boolean;
readonly asErr: ContractExecResultErr;
readonly type: 'Ok' | 'Err';
}
/** @name ContractExecResultSuccessTo255 */
@@ -166,19 +155,21 @@ export interface ContractInstantiateResult extends Struct {
}
/** @name ContractInstantiateResultTo267 */
export interface ContractInstantiateResultTo267 extends Enum {
export interface ContractInstantiateResultTo267 extends Result<InstantiateReturnValueTo267, Null> {
readonly isErr: boolean;
/** @deprecated Use isErr */
readonly isError: boolean;
readonly isOk: boolean;
readonly asOk: InstantiateReturnValueTo267;
readonly isErr: boolean;
readonly type: 'Ok' | 'Err';
}
/** @name ContractInstantiateResultTo299 */
export interface ContractInstantiateResultTo299 extends Enum {
readonly isOk: boolean;
readonly asOk: InstantiateReturnValue;
export interface ContractInstantiateResultTo299 extends Result<InstantiateReturnValueOk, Null> {
readonly isErr: boolean;
readonly type: 'Ok' | 'Err';
/** @deprecated Use isErr */
readonly isError: boolean;
readonly isOk: boolean;
readonly asOk: InstantiateReturnValueOk;
}
/** @name ContractReturnFlags */
@@ -342,12 +333,15 @@ export interface InstantiateRequestV2 extends Struct {
}
/** @name InstantiateReturnValue */
export interface InstantiateReturnValue extends Enum {
readonly isOk: boolean;
readonly asOk: InstantiateReturnValueOk;
export interface InstantiateReturnValue extends Result<InstantiateReturnValueOk, DispatchError> {
readonly isErr: boolean;
readonly asErr: DispatchError;
readonly type: 'Ok' | 'Err';
/** @deprecated Use isErr */
readonly isError: boolean;
/** @deprecated Use asErr */
readonly asError: DispatchError;
readonly isOk: boolean;
readonly asOk: InstantiateReturnValueOk;
}
/** @name InstantiateReturnValueOk */
@@ -6,138 +6,10 @@
import type { Definitions } from '../../types';
import { rpc } from './rpc';
export default {
rpc: {
accountNextIndex: {
alias: ['account_nextIndex'],
description: 'Retrieves the next accountIndex as available on the node',
params: [
{
name: 'accountId',
type: 'AccountId'
}
],
type: 'Index'
},
dryRun: {
alias: ['system_dryRunAt'],
description: 'Dry run an extrinsic at a given block',
params: [
{
name: 'extrinsic',
type: 'Bytes'
},
{
name: 'at',
type: 'BlockHash',
isHistoric: true,
isOptional: true
}
],
type: 'ApplyExtrinsicResult'
},
name: {
description: 'Retrieves the node name',
params: [],
type: 'Text'
},
version: {
description: 'Retrieves the version of the node',
params: [],
type: 'Text'
},
chain: {
description: 'Retrieves the chain',
params: [],
type: 'Text'
},
chainType: {
description: 'Retrieves the chain type',
params: [],
type: 'ChainType'
},
properties: {
description: 'Get a custom set of properties as a JSON object, defined in the chain spec',
params: [],
type: 'ChainProperties'
},
health: {
description: 'Return health status of the node',
params: [],
type: 'Health'
},
localPeerId: {
description: 'Returns the base58-encoded PeerId of the node',
params: [],
type: 'Text'
},
localListenAddresses: {
description: 'The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example',
params: [],
type: 'Vec<Text>'
},
peers: {
description: 'Returns the currently connected peers',
params: [],
type: 'Vec<PeerInfo>'
},
networkState: {
alias: ['system_unstable_networkState'],
description: 'Returns current state of the network',
params: [],
type: 'NetworkState'
},
addReservedPeer: {
description: 'Adds a reserved peer',
params: [
{
name: 'peer',
type: 'Text'
}
],
type: 'Text'
},
removeReservedPeer: {
description: 'Remove a reserved peer',
params: [
{
name: 'peerId',
type: 'Text'
}
],
type: 'Text'
},
reservedPeers: {
description: 'Returns the list of reserved peers',
params: [],
type: 'Vec<Text>'
},
nodeRoles: {
description: 'Returns the roles the node is running as',
params: [],
type: 'Vec<NodeRole>'
},
syncState: {
description: 'Returns the state of the syncing of the node',
params: [],
type: 'SyncState'
},
addLogFilter: {
description: 'Adds the supplied directives to the current log filter',
params: [
{
name: 'directives',
type: 'Text'
}
],
type: 'Null'
},
resetLogFilter: {
description: 'Resets the log filter to Substrate defaults',
params: [],
type: 'Null'
}
},
rpc,
types: {
AccountInfo: 'AccountInfoWithTripleRefCount',
AccountInfoWithRefCountU8: {
@@ -206,11 +78,13 @@ export default {
Module: 'DispatchErrorModule',
ConsumerRemaining: 'Null',
NoProviders: 'Null',
TooManyConsumers: 'Null',
Token: 'TokenError',
Arithmetic: 'ArithmeticError'
Arithmetic: 'ArithmeticError',
Transactional: 'TransactionalError'
}
},
DispatchErrorModule: {
DispatchErrorModuleU8: {
index: 'u8',
error: 'u8'
},
@@ -218,6 +92,7 @@ export default {
index: 'u8',
error: '[u8; 4]'
},
DispatchErrorModule: 'DispatchErrorModuleU8a',
DispatchErrorTo198: {
module: 'Option<u8>',
error: 'u8'
@@ -378,6 +253,7 @@ export default {
'CannotCreate',
'UnknownAsset',
'Frozen',
'Unsupported',
// these are dropped, but still in older versions
// (if this adjusts, will need to take a re-look)
'Underflow',
@@ -390,6 +266,12 @@ export default {
Unknown: 'UnknownTransaction'
}
},
TransactionalError: {
_enum: [
'LimitReached',
'NoLayer'
]
},
UnknownTransaction: {
_enum: {
CannotLookup: 'Null',
+139
View File
@@ -0,0 +1,139 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// As per frontier
import type { DefinitionsRpc } from '../../types';
export const rpc: DefinitionsRpc = {
accountNextIndex: {
alias: ['account_nextIndex'],
description: 'Retrieves the next accountIndex as available on the node',
params: [
{
name: 'accountId',
type: 'AccountId'
}
],
type: 'Index'
},
addLogFilter: {
description: 'Adds the supplied directives to the current log filter',
params: [
{
name: 'directives',
type: 'Text'
}
],
type: 'Null'
},
addReservedPeer: {
description: 'Adds a reserved peer',
params: [
{
name: 'peer',
type: 'Text'
}
],
type: 'Text'
},
chain: {
description: 'Retrieves the chain',
params: [],
type: 'Text'
},
chainType: {
description: 'Retrieves the chain type',
params: [],
type: 'ChainType'
},
dryRun: {
alias: ['system_dryRunAt'],
description: 'Dry run an extrinsic at a given block',
params: [
{
name: 'extrinsic',
type: 'Bytes'
},
{
isHistoric: true,
isOptional: true,
name: 'at',
type: 'BlockHash'
}
],
type: 'ApplyExtrinsicResult'
},
health: {
description: 'Return health status of the node',
noErrorLog: true,
params: [],
type: 'Health'
},
localListenAddresses: {
description: 'The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example',
params: [],
type: 'Vec<Text>'
},
localPeerId: {
description: 'Returns the base58-encoded PeerId of the node',
params: [],
type: 'Text'
},
name: {
description: 'Retrieves the node name',
params: [],
type: 'Text'
},
networkState: {
alias: ['system_unstable_networkState'],
description: 'Returns current state of the network',
params: [],
type: 'NetworkState'
},
nodeRoles: {
description: 'Returns the roles the node is running as',
params: [],
type: 'Vec<NodeRole>'
},
peers: {
description: 'Returns the currently connected peers',
params: [],
type: 'Vec<PeerInfo>'
},
properties: {
description: 'Get a custom set of properties as a JSON object, defined in the chain spec',
params: [],
type: 'ChainProperties'
},
removeReservedPeer: {
description: 'Remove a reserved peer',
params: [
{
name: 'peerId',
type: 'Text'
}
],
type: 'Text'
},
reservedPeers: {
description: 'Returns the list of reserved peers',
params: [],
type: 'Vec<Text>'
},
resetLogFilter: {
description: 'Resets the log filter to Substrate defaults',
params: [],
type: 'Null'
},
syncState: {
description: 'Returns the state of the syncing of the node',
params: [],
type: 'SyncState'
},
version: {
description: 'Retrieves the version of the node',
params: [],
type: 'Text'
}
};
+17 -3
View File
@@ -112,15 +112,21 @@ export interface DispatchError extends Enum {
readonly asModule: DispatchErrorModule;
readonly isConsumerRemaining: boolean;
readonly isNoProviders: boolean;
readonly isTooManyConsumers: boolean;
readonly isToken: boolean;
readonly asToken: TokenError;
readonly isArithmetic: boolean;
readonly asArithmetic: ArithmeticError;
readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'Token' | 'Arithmetic';
readonly isTransactional: boolean;
readonly asTransactional: TransactionalError;
readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional';
}
/** @name DispatchErrorModule */
export interface DispatchErrorModule extends Struct {
export interface DispatchErrorModule extends DispatchErrorModuleU8a {}
/** @name DispatchErrorModuleU8 */
export interface DispatchErrorModuleU8 extends Struct {
readonly index: u8;
readonly error: u8;
}
@@ -384,9 +390,17 @@ export interface TokenError extends Enum {
readonly isCannotCreate: boolean;
readonly isUnknownAsset: boolean;
readonly isFrozen: boolean;
readonly isUnsupported: boolean;
readonly isUnderflow: boolean;
readonly isOverflow: boolean;
readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Underflow' | 'Overflow';
readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported' | 'Underflow' | 'Overflow';
}
/** @name TransactionalError */
export interface TransactionalError extends Enum {
readonly isLimitReached: boolean;
readonly isNoLayer: boolean;
readonly type: 'LimitReached' | 'NoLayer';
}
/** @name TransactionValidityError */
@@ -1,8 +1,8 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Text, Type, Vec } from '@polkadot/types-codec';
import type { Registry } from '@polkadot/types-codec/types';
import type { Option, Text, Type, Vec } from '@polkadot/types-codec';
import type { AnyString, Registry } from '@polkadot/types-codec/types';
import type { ILookup, TypeDef } from '@polkadot/types-create/types';
import type { PortableType } from '../../interfaces/metadata';
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '../../interfaces/scaleInfo';
@@ -136,7 +136,55 @@ function hasNoDupes (input: [number, string][]): boolean {
return true;
}
function removeDuplicateNames (lookup: PortableRegistry, names: [number, string | null, SiTypeParameter[]][]): [number, string, SiTypeParameter[]][] {
function extractNameFlat (portable: PortableType[], lookupId: number, params: SiTypeParameter[], path: AnyString[], isInternal = false): [number, string, SiTypeParameter[]] | null {
const last = path.length - 1;
// if we have no path or determined as a wrapper, we just skip it
if (last === -1 || WRAPPERS.includes(path[last].toString())) {
return null;
}
const parts: string[] = [];
let typeName = '';
for (let i = 0; i <= last; i++) {
const p = stringPascalCase(isInternal ? path[i].replace('pallet_', '') : path[i]);
const l = p.toLowerCase();
if (
(
// Remove ::{generic, misc, pallet, traits, types}::
i !== 1 ||
!PATH_RM_INDEX_1.includes(l)
) &&
(
// sp_runtime::generic::digest::Digest -> sp_runtime::generic::Digest
// sp_runtime::multiaddress::MultiAddress -> sp_runtime::MultiAddress
i === last ||
l !== path[i + 1].toLowerCase()
)) {
parts.push(p);
typeName += p;
}
}
// do magic for RawOrigin lookup, e.g. pallet_collective::RawOrigin
if (parts.length === 2 && parts[1] === 'RawOrigin' && params.length === 2 && params[1].type.isSome) {
const instanceType = portable[params[1].type.unwrap().toNumber()];
if (instanceType.type.path.length === 2) {
typeName = `${typeName}${instanceType.type.path[1].toString()}`;
}
}
return [lookupId, typeName, params];
}
function extractName (portable: PortableType[], { id, type: { params, path } }: PortableType): [number, string, SiTypeParameter[]] | null {
return extractNameFlat(portable, id.toNumber(), params, path);
}
function removeDuplicateNames (lookup: PortableRegistry, portable: PortableType[], names: [number, string | null, SiTypeParameter[]][]): [number, string, SiTypeParameter[]][] {
const rewrite: Record<number, string> = {};
return names
@@ -164,6 +212,8 @@ function removeDuplicateNames (lookup: PortableRegistry, names: [number, string
return [lookupIndex, name, params];
}
// TODO We probably want to attach all the indexes with differences,
// not just the first
// find the first parameter that yields differences
const paramIdx = allSame[0][2].findIndex(({ type }, index) =>
allSame.every(([,, params]) => params[index].type.isSome) &&
@@ -181,10 +231,14 @@ function removeDuplicateNames (lookup: PortableRegistry, names: [number, string
// see if using the param type helps
const adjusted = new Array<[number, string]>(allSame.length);
// loop through all, specifically checking that index where the
// first param yields differences
for (let i = 0; i < allSame.length; i++) {
const [oIndex, oName, oParams] = allSame[i];
const { def, path } = lookup.getSiType(oParams[paramIdx].type.unwrap());
// if it is not a primitive and it doesn't have a path, we really cannot
// do anything at this point
if (!def.isPrimitive && !path.length) {
return null;
}
@@ -197,6 +251,40 @@ function removeDuplicateNames (lookup: PortableRegistry, names: [number, string
];
}
// check to see if the adjusted names have no issues
if (hasNoDupes(adjusted)) {
for (let i = 0; i < adjusted.length; i++) {
const [index, name] = adjusted[i];
rewrite[index] = name;
}
return [lookupIndex, name, params];
}
// TODO This is duplicated from the section just above...
// ... we certainly need a better solution here
// last-ditch effort to use the full type path - ugly
// loop through all, specifically checking that index where the
// first param yields differences
for (let i = 0; i < allSame.length; i++) {
const [oIndex, oName, oParams] = allSame[i];
const { def, path } = lookup.getSiType(oParams[paramIdx].type.unwrap());
const flat = extractNameFlat(portable, oIndex, oParams, path, true);
if (def.isPrimitive || !flat) {
return null;
}
adjusted[i] = [
oIndex,
`${oName}${flat[1]}`
];
}
// check to see if the adjusted names have no issues
if (hasNoDupes(adjusted)) {
for (let i = 0; i < adjusted.length; i++) {
const [index, name] = adjusted[i];
@@ -217,50 +305,6 @@ function removeDuplicateNames (lookup: PortableRegistry, names: [number, string
]);
}
function extractName (types: PortableType[], { id, type: { params, path } }: PortableType): [number, string, SiTypeParameter[]] | null {
const last = path.length - 1;
// if we have no path or determined as a wrapper, we just skip it
if (last === -1 || WRAPPERS.includes(path[last].toString())) {
return null;
}
const parts: string[] = [];
let typeName = '';
for (let i = 0; i <= last; i++) {
const p = stringPascalCase(path[i]);
const l = p.toLowerCase();
if (
(
// Remove ::{generic, misc, pallet, traits, types}::
i !== 1 ||
!PATH_RM_INDEX_1.includes(l)
) &&
(
// sp_runtime::generic::digest::Digest -> sp_runtime::generic::Digest
// sp_runtime::multiaddress::MultiAddress -> sp_runtime::MultiAddress
i === last ||
l !== path[i + 1].toLowerCase()
)) {
parts.push(p);
typeName += p;
}
}
// do magic for RawOrigin lookup, e.g. pallet_collective::RawOrigin
if (parts.length === 2 && parts[1] === 'RawOrigin' && params.length === 2 && params[1].type.isSome) {
const instanceType = types[params[1].type.unwrap().toNumber()];
if (instanceType.type.path.length === 2) {
typeName = `${typeName}${instanceType.type.path[1].toString()}`;
}
}
return [id.toNumber(), typeName, params];
}
function registerTypes (lookup: PortableRegistry, lookups: Record<string, string>, names: Record<number, string>, params: Record<string, SiTypeParameter[]>): void {
// Register the types we extracted
lookup.registry.register(lookups);
@@ -342,7 +386,7 @@ function extractTypeInfo (lookup: PortableRegistry, portable: PortableType[]): [
types[type.id.toNumber()] = type;
}
const dedup = removeDuplicateNames(lookup, nameInfo);
const dedup = removeDuplicateNames(lookup, portable, nameInfo);
const lookups: Record<string, string> = {};
const names: Record<number, string> = {};
const params: Record<string, SiTypeParameter[]> = {};
@@ -464,6 +508,25 @@ export class PortableRegistry extends Struct implements ILookup {
return this.#typeDefs[lookupIndex];
}
public sanitizeField (name: Option<Text>): [string | null, string | null] {
let nameField: string | null = null;
let nameOrig: string | null = null;
if (name.isSome) {
nameField = stringCamelCase(name.unwrap());
if (nameField.includes('#')) {
nameOrig = nameField;
nameField = nameOrig.replace(/#/g, '_');
} else if (RESERVED.includes(nameField)) {
nameOrig = nameField;
nameField = `${nameField}_`;
}
}
return [nameField, nameOrig];
}
#createSiDef (lookupId: SiLookupTypeId): TypeDef {
const typeDef = this.getTypeDef(lookupId);
const lookupIndex = lookupId.toNumber();
@@ -681,18 +744,9 @@ export class PortableRegistry extends Struct implements ILookup {
if (name.isNone) {
sub[i] = typeDef;
} else {
let nameField = stringCamelCase(name.unwrap());
let nameOrig: string | null = null;
const [nameField, nameOrig] = this.sanitizeField(name);
if (nameField.includes('#')) {
nameOrig = nameField;
nameField = nameOrig.replace(/#/g, '_');
} else if (RESERVED.includes(nameField)) {
nameOrig = nameField;
nameField = `${nameField}_`;
}
if (nameOrig) {
if (nameField && nameOrig) {
alias.set(nameField, nameOrig);
}
@@ -3,7 +3,7 @@
import type { Text, u8 } from '@polkadot/types-codec';
import type { Registry } from '@polkadot/types-codec/types';
import type { DispatchErrorModule, DispatchErrorModuleU8a, MetadataLatest, SiField, SiVariant } from '../../../interfaces';
import type { DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, MetadataLatest, SiField, SiVariant } from '../../../interfaces';
import type { PortableRegistry } from '../../../metadata';
import type { Errors, IsError } from '../types';
@@ -40,7 +40,7 @@ export function decorateErrors (registry: Registry, { lookup, pallets }: Metadat
lazyMethod(result, stringCamelCase(name), () =>
lazyVariants(lookup, errors.unwrap(), objectNameToString, (variant: SiVariant): IsError => ({
// We sprinkle in isCodec & isU8a to ensure we are dealing with the correct objects
is: (errorMod: DispatchErrorModule | DispatchErrorModuleU8a) =>
is: (errorMod: DispatchErrorModule | DispatchErrorModuleU8 | DispatchErrorModuleU8a) =>
isCodec(errorMod) &&
isCodec(errorMod.index) &&
errorMod.index.eq(sectionIndex) && (
@@ -3,7 +3,7 @@
import type { AnyTuple, Registry } from '@polkadot/types-codec/types';
import type { MetadataLatest, PalletMetadataLatest, SiVariant } from '../../../interfaces';
import type { IEvent } from '../../../types';
import type { IEvent, IEventLike } from '../../../types';
import type { Events, IsEvent } from '../types';
import { isCodec, isU8a, lazyMethod, stringCamelCase } from '@polkadot/util';
@@ -28,7 +28,7 @@ export function decorateEvents (registry: Registry, { lookup, pallets }: Metadat
lazyMethod(result, stringCamelCase(name), () =>
lazyVariants(lookup, events.unwrap(), objectNameToString, (variant: SiVariant): IsEvent<AnyTuple> => ({
// We sprinkle in isCodec & isU8a to ensure we are dealing with the correct objects
is: <T extends AnyTuple> (eventRecord: IEvent<AnyTuple>): eventRecord is IEvent<T> =>
is: <T extends AnyTuple> (eventRecord: IEventLike): eventRecord is IEvent<T> =>
isCodec(eventRecord) &&
isU8a(eventRecord.index) &&
sectionIndex === eventRecord.index[0] &&
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
import type { AnyTuple, Codec, Registry } from '@polkadot/types-codec/types';
import type { DispatchErrorModule, DispatchErrorModuleU8a, ErrorMetadataLatest, EventMetadataLatest, PalletConstantMetadataLatest } from '../../interfaces';
import type { DispatchErrorModule, DispatchErrorModuleU8, DispatchErrorModuleU8a, ErrorMetadataLatest, EventMetadataLatest, PalletConstantMetadataLatest } from '../../interfaces';
import type { StorageEntry } from '../../primitive/types';
import type { CallFunction, IEvent } from '../../types';
import type { CallFunction, IEvent, IEventLike } from '../../types';
export interface ConstantCodec extends Codec {
readonly meta: PalletConstantMetadataLatest;
@@ -13,13 +13,13 @@ export interface ConstantCodec extends Codec {
export interface IsError {
readonly meta: ErrorMetadataLatest;
is: (moduleError: DispatchErrorModule | DispatchErrorModuleU8a) => boolean;
is: (moduleError: DispatchErrorModule | DispatchErrorModuleU8 | DispatchErrorModuleU8a) => boolean;
}
export interface IsEvent <T extends AnyTuple> {
export interface IsEvent <T extends AnyTuple, N = unknown> {
readonly meta: EventMetadataLatest;
is: (event: IEvent<AnyTuple>) => event is IEvent<T>;
is: (event: IEventLike) => event is IEvent<T, N>;
}
export type ModuleConstants = Record<string, ConstantCodec>;
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '8.7.1' };
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '8.8.2' };
@@ -20,6 +20,7 @@ declare module '@polkadot/types-codec/types/registry' {
}
export interface Registry {
readonly firstCallIndex: Uint8Array;
readonly knownTypes: RegisteredTypes;
readonly metadata: MetadataLatest;
readonly unknownTypes: string[];
+1
View File
@@ -29,6 +29,7 @@ export interface DefinitionRpc {
description: string;
endpoint?: string;
isSigned?: boolean;
noErrorLog?: boolean;
params: DefinitionRpcParam[];
type: DefinitionTypeType;
}
+16 -5
View File
@@ -1,25 +1,36 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Codec, ITuple } from '@polkadot/types-codec/types';
import type { Codec } from '@polkadot/types-codec/types';
import type { TypeDef } from '@polkadot/types-create/types';
import type { EventMetadataLatest } from '../interfaces/metadata';
import type { Hash } from '../interfaces/runtime';
import type { EventId, Phase } from '../interfaces/system';
export interface IEventRecord<T extends Codec[]> {
export interface IEventRecord<T extends Codec[]> extends Codec {
readonly phase: Phase;
readonly event: IEvent<T>;
readonly topics: Hash[];
}
export interface IEventData {
export interface IEventData extends Codec {
readonly meta: EventMetadataLatest;
readonly method: string;
readonly names: string[] | null;
readonly section: string;
readonly typeDef: TypeDef[];
}
export interface IEvent<T extends Codec[]> {
readonly data: ITuple<T> & IEventData;
export interface IEventLike {
readonly index: unknown;
readonly method: unknown;
readonly section: unknown;
}
export interface IEvent<T extends Codec[], N = unknown> extends IEventLike, Codec {
readonly data: N extends Record<string, Codec>
? N & T & IEventData
: T & IEventData;
readonly index: EventId;
readonly method: string;
readonly section: string;
+541 -539
View File
File diff suppressed because it is too large Load Diff