Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d4b5df61e | ||
|
|
8bacac840f | ||
|
|
f75d32e198 | ||
|
|
0282cbac35 | ||
|
|
98506f9fea | ||
|
|
ecf6ad725b | ||
|
|
627e54473e | ||
|
|
8e56995556 | ||
|
|
45525b4288 | ||
|
|
6808eb1925 | ||
|
|
c301e7128d | ||
|
|
72a6f60498 | ||
|
|
ef6cbce6e5 | ||
|
|
50e9e9cb1e | ||
|
|
230cc2c437 | ||
|
|
511a345b23 | ||
|
|
5800ba5d91 | ||
|
|
d91b16f93d | ||
|
|
6d4027e116 | ||
|
|
e39a1ebac5 | ||
|
|
2ef672d4ec | ||
|
|
9a89ad37c9 | ||
|
|
7eb907b155 | ||
|
|
5fc142cf5c | ||
|
|
7571c6ae76 | ||
|
|
5a1598a389 | ||
|
|
b8451b4fe7 | ||
|
|
a97da748be | ||
|
|
34fead5c8a | ||
|
|
332b79a04a | ||
|
|
64384a6a04 | ||
|
|
6e6f46a188 | ||
|
|
ee09a2f4d6 | ||
|
|
62be4530f9 | ||
|
|
516289bcb7 | ||
|
|
b24e13f478 | ||
|
|
6fdd0d674e | ||
|
|
d85a096066 | ||
|
|
df68fde6cd | ||
|
|
1664c868df | ||
|
|
f5e89b7530 | ||
|
|
abdbd37215 | ||
|
|
354c4b8fd4 | ||
|
|
2ddacb67db | ||
|
|
602cff44a4 | ||
|
|
9ea866815b | ||
|
|
74e1442343 | ||
|
|
23069dad76 | ||
|
|
560bf096f7 | ||
|
|
ac1837cdfe | ||
|
|
0a9158befc | ||
|
|
9c4e984f7b | ||
|
|
c1187f4c7a | ||
|
|
e279d50224 | ||
|
|
f28908d28e | ||
|
|
570cf5fea4 | ||
|
|
7bf5bb7a3b | ||
|
|
756502771e | ||
|
|
977eb3f9ec | ||
|
|
909b3429f2 | ||
|
|
116b817696 | ||
|
|
c295d699e7 | ||
|
|
c8ab0e6959 | ||
|
|
cf52676025 | ||
|
|
935b176740 | ||
|
|
af9c4e0e4b | ||
|
|
17eccc0b7b | ||
|
|
1ba2413c86 | ||
|
|
ff69198b1a | ||
|
|
7b368a3f2d | ||
|
|
58020291ea | ||
|
|
fb1e428615 | ||
|
|
2164f80a3c | ||
|
|
59903dfba3 | ||
|
|
97ded7d284 | ||
|
|
772ab6e7d1 | ||
|
|
f7a3907519 | ||
|
|
891790b2b6 | ||
|
|
fac008f453 | ||
|
|
32fd91a221 | ||
|
|
472ab9acac | ||
|
|
393f528e89 | ||
|
|
4a9d5fd3c1 | ||
|
|
8e8bcd5f68 | ||
|
|
bd300791b5 | ||
|
|
cd2b3be962 | ||
|
|
87df83a2b9 | ||
|
|
697688eea5 | ||
|
|
9bbe095a5d | ||
|
|
51a6e50b09 | ||
|
|
d496ab2d1e | ||
|
|
3acca845f7 | ||
|
|
3a8b1c5683 | ||
|
|
94c5c025a9 | ||
|
|
a7c54d704b | ||
|
|
4640939908 | ||
|
|
6d07803003 | ||
|
|
13f7e853e8 | ||
|
|
fbd0e4212f | ||
|
|
ebb9f5c63b | ||
|
|
bffb72f29f | ||
|
|
68272615e7 | ||
|
|
190959dbd4 | ||
|
|
dbb427be5c | ||
|
|
9a18016701 | ||
|
|
bcda5caa39 | ||
|
|
b88cad4b87 | ||
|
|
c86807c0b8 | ||
|
|
771f3bc6fd | ||
|
|
58a18e1da5 | ||
|
|
b42669f864 | ||
|
|
0d2e938674 | ||
|
|
98b3b10bd9 | ||
|
|
34a1e0cbe2 | ||
|
|
44512c1d5f | ||
|
|
0440ce606a | ||
|
|
c05cb79005 | ||
|
|
ce39264b77 | ||
|
|
7c5f82404f | ||
|
|
7da9c5c20b | ||
|
|
ccd3b62632 | ||
|
|
fdf6ec9530 | ||
|
|
51b583d9ea | ||
|
|
6149b6ca76 | ||
|
|
083e0478c3 | ||
|
|
ee584f62a7 | ||
|
|
530909d773 | ||
|
|
d0c55a31b8 | ||
|
|
eafd4923fe | ||
|
|
264bcaf4ac | ||
|
|
a25c057ae7 | ||
|
|
29927129a1 | ||
|
|
4385320554 | ||
|
|
58eadc4e0f | ||
|
|
89e4cba131 |
@@ -0,0 +1 @@
|
||||
8.11.1
|
||||
@@ -2,6 +2,7 @@ _book/
|
||||
build/
|
||||
build-cjs/
|
||||
build-esm/
|
||||
build-deno/
|
||||
build-docs/
|
||||
coverage/
|
||||
docs/.vuepress/dist/
|
||||
|
||||
+53
-1
@@ -1,10 +1,62 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 8.11.1 Jul 2, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
- Adjust `api.{tx, query, ...}` with no external side-effects (Thanks to https://github.com/btwiuse)
|
||||
|
||||
Changes:
|
||||
|
||||
- Support for `state_call` definitions via API config (exposed on `api.call.*`)
|
||||
- Base type definitions for `state_call` from Substrate, Polkadot & Orml
|
||||
- Align runtime types with latest Substrate master
|
||||
- Type generation for runtime call definitions (internal & external)
|
||||
- Update to latest Substrate, Polkadot & Kusama metadata
|
||||
|
||||
|
||||
## 8.10.1 Jun 26, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
- Bump `@substrate/connect` to 0.7.7 (Thanks to https://github.com/wirednkod)
|
||||
- Support `feeHistory` & `maxPriorityFeePerGas` eth RPCs (Thanks to https://github.com/crystalin)
|
||||
|
||||
Changes:
|
||||
|
||||
- Align `BeefyPayload` with Substrate master
|
||||
- Use `static get [Symbol.species] ()` for `Array` & `Uint8Array` types
|
||||
- Add support for (optional, non-runtime recommended) `f32` & `f64` types
|
||||
- Add future-use `AbstrateBigInt` wrapper extension
|
||||
- Update Codec-internal performance tests
|
||||
- Add Westend 9250 upgrade block
|
||||
- Update to latest Substrate, Polkadot & Kusama metadata
|
||||
|
||||
|
||||
## 8.9.1 Jun 19, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
- Update `@substrate/connect` to 0.7.6 (Thanks to https://github.com/tomaka)
|
||||
|
||||
Changes:
|
||||
|
||||
- Deupe all internal type property getters
|
||||
- Adjust `@polkadot/types-codec` asserts
|
||||
- Rename `Base` type to `AbstractBase` (reflecting usage)
|
||||
- Alias `blockHash` on `rpc.engine.createBlock` return
|
||||
- Instantiate `Compact/UInt/Int` with `number` when passed
|
||||
- Adjust name extraction in `PortableRegistry` (maintainability)
|
||||
- Adjust string type path extraction (maintainability)
|
||||
- Add Kusama 9230 upgrade block
|
||||
- Update to latest Substrate metadata
|
||||
|
||||
|
||||
## 8.8.2 Jun 14, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Aling historic `DispatchErrorModule` with `U8` variant
|
||||
- Align historic `DispatchErrorModule` with `U8` variant
|
||||
- Extend lookup type name generation when conflicts arrise
|
||||
- Update to latest Substrate metadata
|
||||
|
||||
|
||||
+5
-2
@@ -1,4 +1,4 @@
|
||||
3023 Jaco 8.8.2 (#4937)
|
||||
3087 Jaco 8.11.1 (#5018)
|
||||
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)
|
||||
@@ -9,12 +9,12 @@
|
||||
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
|
||||
5 Chevdor Fix metadata package link (#3458)
|
||||
5 Jake Naviasky Fixing approvalFlagsToBools. (#1250)
|
||||
5 Nikos Kontakis Bump substrate connect to 0.7.7 (#4962)
|
||||
4 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
|
||||
4 Alex Wang fix issue that creates duplicate providers (#983)
|
||||
4 Alexander Popiak Add asset id in signing (#4009)
|
||||
4 Joshy Orndorff spelling; efect -> effect (#2295)
|
||||
4 Nantian fix bigint type (#3869)
|
||||
4 Nikos Kontakis Update substrate connect to 0.7.5 (#4835)
|
||||
4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574)
|
||||
4 Thibaut Sardan no subscription for http (#3127)
|
||||
3 André Silva add support for ValidationCodeHash (#3640)
|
||||
@@ -43,8 +43,10 @@
|
||||
2 Wei Tang Use /usr/bin/env bash instead of /bin/bash (#2053)
|
||||
2 Zannis Kalampoukis fix: Typegen handles structs and vectors of structs without erroring (#4743)
|
||||
2 扩散性百万甜面包 Typo, deocrateMethod -> decorateMethod (#1594)
|
||||
1 Alan Sapede Adds Eth feeHistory & maxPriorityFeePerGas rpc (#4956)
|
||||
1 Andreea Eftene Add storage deposit support (#4304)
|
||||
1 Brad Larson [NEW] Support for custom headers with providers (#2423)
|
||||
1 Btwiuse Arch Add side effect check workaround (#4994) (#5009)
|
||||
1 chriswmercer little readme tweak (#279)
|
||||
1 codingsh #2182 - add: search for docs (#2232)
|
||||
1 coolcorexix Investigate 4559 v2 (#4608)
|
||||
@@ -86,6 +88,7 @@
|
||||
1 Oleksandr Mykhailenko Add more complex namespaced contracts & test cases for them (#4472)
|
||||
1 Paul M Fox Basic BTreeMaps codec support (#1474)
|
||||
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
|
||||
1 Pierre Krieger Update substrate/connect to 0.7.6 (#4940)
|
||||
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)
|
||||
|
||||
+7
-7
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "commonjs",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
@@ -31,15 +31,15 @@
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.5",
|
||||
"@babel/register": "^7.17.7",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/dev": "^0.67.3",
|
||||
"@babel/core": "^7.18.6",
|
||||
"@babel/register": "^7.18.6",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/dev": "^0.67.46",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^28.1.1",
|
||||
"@types/jest": "^28.1.4",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"typescript": "^4.7.3"
|
||||
"typescript": "^4.7.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@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"
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api-base": "8.11.1",
|
||||
"@polkadot/rpc-augment": "8.11.1",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/types-augment": "8.11.1",
|
||||
"@polkadot/types-codec": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types-support": "8.8.2"
|
||||
"@polkadot/types-support": "8.11.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -497,6 +497,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* these are removed, either through `unvote` or `reap_vote`.
|
||||
**/
|
||||
VotesExist: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Voting period too low
|
||||
**/
|
||||
VotingPeriodLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Invalid upper bound.
|
||||
**/
|
||||
@@ -895,10 +899,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.
|
||||
**/
|
||||
@@ -911,7 +911,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.
|
||||
**/
|
||||
@@ -921,10 +921,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.
|
||||
**/
|
||||
@@ -1855,6 +1851,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Not a member.
|
||||
**/
|
||||
NotMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many members.
|
||||
**/
|
||||
TooManyMembers: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
@@ -1891,6 +1891,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.
|
||||
**/
|
||||
|
||||
@@ -293,6 +293,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A proposal preimage was removed and used (the deposit was returned).
|
||||
**/
|
||||
PreimageUsed: AugmentedEvent<ApiType, [proposalHash: H256, provider: AccountId32, deposit: u128], { proposalHash: H256, provider: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* A proposal got canceled.
|
||||
**/
|
||||
ProposalCanceled: AugmentedEvent<ApiType, [propIndex: u32], { propIndex: u32 }>;
|
||||
/**
|
||||
* A motion has been proposed by a public account.
|
||||
**/
|
||||
@@ -554,6 +558,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A payout has been made to a member.
|
||||
**/
|
||||
PaidOut: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, payout: u128], { member: AccountId32, poolId: u32, payout: u128 }>;
|
||||
/**
|
||||
* The active balance of pool `pool_id` has been slashed to `balance`.
|
||||
**/
|
||||
PoolSlashed: AugmentedEvent<ApiType, [poolId: u32, balance: u128], { poolId: u32, balance: u128 }>;
|
||||
/**
|
||||
* The roles of a pool have been updated to the given new roles. Note that the depositor
|
||||
* can never change.
|
||||
@@ -565,12 +573,31 @@ declare module '@polkadot/api-base/types/events' {
|
||||
StateChanged: AugmentedEvent<ApiType, [poolId: u32, newState: PalletNominationPoolsPoolState], { poolId: u32, newState: PalletNominationPoolsPoolState }>;
|
||||
/**
|
||||
* A member has unbonded from their pool.
|
||||
*
|
||||
* - `balance` is the corresponding balance of the number of points that has been
|
||||
* requested to be unbonded (the argument of the `unbond` transaction) from the bonded
|
||||
* pool.
|
||||
* - `points` is the number of points that are issued as a result of `balance` being
|
||||
* dissolved into the corresponding unbonding pool.
|
||||
*
|
||||
* In the absence of slashing, these values will match. In the presence of slashing, the
|
||||
* number of points that are issued in the unbonding pool will be less than the amount
|
||||
* requested to be unbonded.
|
||||
**/
|
||||
Unbonded: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, amount: u128], { member: AccountId32, poolId: u32, amount: u128 }>;
|
||||
Unbonded: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, balance: u128, points: u128], { member: AccountId32, poolId: u32, balance: u128, points: u128 }>;
|
||||
/**
|
||||
* The unbond pool at `era` of pool `pool_id` has been slashed to `balance`.
|
||||
**/
|
||||
UnbondingPoolSlashed: AugmentedEvent<ApiType, [poolId: u32, era: u32, balance: u128], { poolId: u32, era: u32, balance: u128 }>;
|
||||
/**
|
||||
* A member has withdrawn from their pool.
|
||||
*
|
||||
* The given number of `points` have been dissolved in return of `balance`.
|
||||
*
|
||||
* Similar to `Unbonded` event, in the absence of slashing, the ratio of point to balance
|
||||
* will be 1.
|
||||
**/
|
||||
Withdrawn: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, amount: u128], { member: AccountId32, poolId: u32, amount: u128 }>;
|
||||
Withdrawn: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, balance: u128, points: u128], { member: AccountId32, poolId: u32, balance: u128, points: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
@@ -1112,6 +1139,17 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
transactionPayment: {
|
||||
/**
|
||||
* A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
|
||||
* has been paid by `who`.
|
||||
**/
|
||||
TransactionFeePaid: AugmentedEvent<ApiType, [who: AccountId32, actualFee: u128, tip: u128], { who: AccountId32, actualFee: u128, tip: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
treasury: {
|
||||
/**
|
||||
* Some funds have been allocated.
|
||||
@@ -1137,6 +1175,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* Spending has finished; this is the amount that rolls over until next spend.
|
||||
**/
|
||||
Rollover: AugmentedEvent<ApiType, [rolloverBalance: u128], { rolloverBalance: u128 }>;
|
||||
/**
|
||||
* A new spend proposal has been approved.
|
||||
**/
|
||||
SpendApproved: AugmentedEvent<ApiType, [proposalIndex: u32, amount: u128, beneficiary: AccountId32], { proposalIndex: u32, amount: u128, beneficiary: AccountId32 }>;
|
||||
/**
|
||||
* We have ended a spend period and will now allocate funds.
|
||||
**/
|
||||
|
||||
@@ -7,4 +7,5 @@ import './errors';
|
||||
import './events';
|
||||
import './query';
|
||||
import './registry';
|
||||
import './runtime';
|
||||
import './tx';
|
||||
|
||||
@@ -849,6 +849,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, []>;
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,334 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Bytes, Null, Option, Result, Vec, bool, u32 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { ValidatorSet } from '@polkadot/types/interfaces/beefy';
|
||||
import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder';
|
||||
import type { BlockHash } from '@polkadot/types/interfaces/chain';
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
|
||||
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafIndex, MmrProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { CandidateCommitments, CandidateEvent, CommittedCandidateReceipt, CoreState, GroupRotationInfo, InboundDownwardMessage, InboundHrmpMessage, OccupiedCoreAssumption, ParaId, ParaValidatorIndex, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorSignature } from '@polkadot/types/interfaces/parachains';
|
||||
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { AccountId, Block, Hash, Header, Index, KeyTypeId, Slot, ValidatorId } from '@polkadot/types/interfaces/runtime';
|
||||
import type { SessionIndex } from '@polkadot/types/interfaces/session';
|
||||
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
|
||||
import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system';
|
||||
import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue';
|
||||
import type { IExtrinsic, Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/calls' {
|
||||
export interface AugmentedCalls<ApiType extends ApiTypes> {
|
||||
/** 0xbc9d89904f5b923f/1 */
|
||||
accountNonceApi: {
|
||||
/**
|
||||
* The API to query account nonce (aka transaction index)
|
||||
**/
|
||||
accountNonce: AugmentedCall<ApiType, (accountId: AccountId | string | Uint8Array) => Observable<Index>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x687ad44ad37f03c2/1 */
|
||||
authorityDiscoveryApi: {
|
||||
/**
|
||||
* Retrieve authority identifiers of the current and next authority set.
|
||||
**/
|
||||
authorities: AugmentedCall<ApiType, () => Observable<Vec<AuthorityId>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xcbca25e39f142387/2 */
|
||||
babeApi: {
|
||||
/**
|
||||
* Return the genesis configuration for BABE. The configuration is only read on genesis.
|
||||
**/
|
||||
configuration: AugmentedCall<ApiType, () => Observable<BabeGenesisConfiguration>>;
|
||||
/**
|
||||
* Returns information regarding the current epoch.
|
||||
**/
|
||||
currentEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Returns the slot that started the current epoch.
|
||||
**/
|
||||
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
|
||||
/**
|
||||
* Generates a proof of key ownership for the given authority in the current epoch.
|
||||
**/
|
||||
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
|
||||
/**
|
||||
* Returns information regarding the next epoch (which was already previously announced).
|
||||
**/
|
||||
nextEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Submits an unsigned extrinsic to report an equivocation.
|
||||
**/
|
||||
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x49eaaf1b548a0cb0/1 */
|
||||
beefyApi: {
|
||||
/**
|
||||
* Return the current active BEEFY validator set
|
||||
**/
|
||||
validatorSet: AugmentedCall<ApiType, () => Observable<Option<ValidatorSet>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x40fe3ad401f8959a/6 */
|
||||
blockBuilder: {
|
||||
/**
|
||||
* Apply the given extrinsic.
|
||||
**/
|
||||
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;
|
||||
/**
|
||||
* Check that the inherents are valid.
|
||||
**/
|
||||
checkInherents: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array, data: InherentData | { data?: any } | string | Uint8Array) => Observable<CheckInherentsResult>>;
|
||||
/**
|
||||
* Finish the current block.
|
||||
**/
|
||||
finalizeBlock: AugmentedCall<ApiType, () => Observable<Header>>;
|
||||
/**
|
||||
* Generate inherent extrinsics.
|
||||
**/
|
||||
inherentExtrinsics: AugmentedCall<ApiType, (inherent: InherentData | { data?: any } | string | Uint8Array) => Observable<Vec<Extrinsic>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xdf6acb689907609b/4 */
|
||||
core: {
|
||||
/**
|
||||
* Execute the given block.
|
||||
**/
|
||||
executeBlock: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Initialize a block with the given header.
|
||||
**/
|
||||
initializeBlock: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Returns the version of the runtime.
|
||||
**/
|
||||
version: AugmentedCall<ApiType, () => Observable<RuntimeVersion>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xed99c5acb25eedf5/3 */
|
||||
grandpaApi: {
|
||||
/**
|
||||
* Get current GRANDPA authority set id.
|
||||
**/
|
||||
currentSetId: AugmentedCall<ApiType, () => Observable<SetId>>;
|
||||
/**
|
||||
* Generates a proof of key ownership for the given authority in the given set.
|
||||
**/
|
||||
generateKeyOwnershipProof: AugmentedCall<ApiType, (setId: SetId | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
|
||||
/**
|
||||
* Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.
|
||||
**/
|
||||
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<AuthorityList>>;
|
||||
/**
|
||||
* Submits an unsigned extrinsic to report an equivocation.
|
||||
**/
|
||||
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x37e397fc7c91f5e4/1 */
|
||||
metadata: {
|
||||
/**
|
||||
* Returns the metadata of a runtime
|
||||
**/
|
||||
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x91d5df18b0d2cf58/1 */
|
||||
mmrApi: {
|
||||
/**
|
||||
* Generate MMR proof for a series of leaves under given indices.
|
||||
**/
|
||||
generateBatchProof: AugmentedCall<ApiType, (leafIndices: Vec<MmrLeafIndex> | (MmrLeafIndex | AnyNumber | Uint8Array)[]) => Observable<Result<ITuple<[Vec<MmrEncodableOpaqueLeaf>, MmrBatchProof]>, MmrError>>>;
|
||||
/**
|
||||
* Generate MMR proof for a leaf under given index.
|
||||
**/
|
||||
generateProof: AugmentedCall<ApiType, (leafIndex: MmrLeafIndex | AnyNumber | Uint8Array) => Observable<Result<ITuple<[MmrEncodableOpaqueLeaf, MmrProof]>, MmrError>>>;
|
||||
/**
|
||||
* Return the on-chain MMR root hash.
|
||||
**/
|
||||
mmrRoot: AugmentedCall<ApiType, () => Observable<Result<Hash, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against on-chain MMR for a batch of leaves.
|
||||
**/
|
||||
verifyBatchProof: AugmentedCall<ApiType, (leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against given root hash or a batch of leaves.
|
||||
**/
|
||||
verifyBatchProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against on-chain MMR.
|
||||
**/
|
||||
verifyProof: AugmentedCall<ApiType, (leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against given root hash.
|
||||
**/
|
||||
verifyProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xf78b278be53f454c/2 */
|
||||
offchainWorkerApi: {
|
||||
/**
|
||||
* Starts the off-chain task for given block header.
|
||||
**/
|
||||
offchainWorker: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xaf2c0297a23e6d3d/2 */
|
||||
parachainHost: {
|
||||
/**
|
||||
* Returns the persisted validation data for the given `ParaId` along with the corresponding validation code hash.
|
||||
**/
|
||||
assumedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, hash: Hash | string | Uint8Array) => Observable<Option<ITuple<[PersistedValidationData, ValidationCodeHash]>>>>;
|
||||
/**
|
||||
* Yields information on all availability cores as relevant to the child block.
|
||||
**/
|
||||
availabilityCores: AugmentedCall<ApiType, () => Observable<Vec<CoreState>>>;
|
||||
/**
|
||||
* Get a vector of events concerning candidates that occurred within a block.
|
||||
**/
|
||||
candidateEvents: AugmentedCall<ApiType, () => Observable<Vec<CandidateEvent>>>;
|
||||
/**
|
||||
* Get the receipt of a candidate pending availability.
|
||||
**/
|
||||
candidatePendingAvailability: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Option<CommittedCandidateReceipt>>>;
|
||||
/**
|
||||
* Checks if the given validation outputs pass the acceptance criteria.
|
||||
**/
|
||||
checkValidationOutputs: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, outputs: CandidateCommitments | { upwardMessages?: any; horizontalMessages?: any; newValidationCode?: any; headData?: any; processedDownwardMessages?: any; hrmpWatermark?: any } | string | Uint8Array) => Observable<bool>>;
|
||||
/**
|
||||
* Get all the pending inbound messages in the downward message queue for a para.
|
||||
**/
|
||||
dmqContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundDownwardMessage>>>;
|
||||
/**
|
||||
* Get the contents of all channels addressed to the given recipient.
|
||||
**/
|
||||
inboundHrmpChannelsContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundHrmpMessage>>>;
|
||||
/**
|
||||
* Scrape dispute relevant from on-chain, backing votes and resolved disputes.
|
||||
**/
|
||||
onChainVotes: AugmentedCall<ApiType, () => Observable<Option<ScrapedOnChainVotes>>>;
|
||||
/**
|
||||
* Yields the persisted validation data for the given `ParaId` along with an assumption that should be used if the para currently occupies a core.
|
||||
**/
|
||||
persistedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<PersistedValidationData>>>;
|
||||
/**
|
||||
* Returns code hashes of PVFs that require pre-checking by validators in the active set.
|
||||
**/
|
||||
pvfsRequirePrecheck: AugmentedCall<ApiType, () => Observable<Vec<ValidationCodeHash>>>;
|
||||
/**
|
||||
* Returns the session index expected at a child of the block.
|
||||
**/
|
||||
sessionIndexForChild: AugmentedCall<ApiType, () => Observable<SessionIndex>>;
|
||||
/**
|
||||
* Get the session info for the given session, if stored.
|
||||
**/
|
||||
sessionInfo: AugmentedCall<ApiType, (index: SessionIndex | AnyNumber | Uint8Array) => Observable<Option<SessionInfo>>>;
|
||||
/**
|
||||
* Submits a PVF pre-checking statement into the transaction pool.
|
||||
**/
|
||||
submitPvfCheckStatement: AugmentedCall<ApiType, (stmt: PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: ValidatorSignature | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.
|
||||
**/
|
||||
validationCode: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<ValidationCode>>;
|
||||
/**
|
||||
* Get the validation code from its hash.
|
||||
**/
|
||||
validationCodeByHash: AugmentedCall<ApiType, (hash: ValidationCodeHash | string | Uint8Array) => Observable<Option<ValidationCode>>>;
|
||||
/**
|
||||
* Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`.
|
||||
**/
|
||||
validationCodeHash: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<ValidationCodeHash>>>;
|
||||
/**
|
||||
* Returns the validator groups and rotation info localized based on the hypothetical child of a block whose state this is invoked on
|
||||
**/
|
||||
validatorGroups: AugmentedCall<ApiType, () => Observable<ITuple<[Vec<Vec<ParaValidatorIndex>>, GroupRotationInfo]>>>;
|
||||
/**
|
||||
* Get the current validators.
|
||||
**/
|
||||
validators: AugmentedCall<ApiType, () => Observable<Vec<ValidatorId>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xab3c0572291feb8b/1 */
|
||||
sessionKeys: {
|
||||
/**
|
||||
* Decode the given public session keys.
|
||||
**/
|
||||
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, KeyTypeId]>>>>>;
|
||||
/**
|
||||
* Generate a set of session keys with optionally using the given seed.
|
||||
**/
|
||||
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | object | string | Uint8Array) => Observable<Bytes>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xd2bc9897eed08f15/3 */
|
||||
taggedTransactionQueue: {
|
||||
/**
|
||||
* Validate the transaction.
|
||||
**/
|
||||
validateTransaction: AugmentedCall<ApiType, (source: TransactionSource | 'InBlock' | 'Local' | 'External' | number | Uint8Array, tx: Extrinsic | IExtrinsic | string | Uint8Array, blockHash: BlockHash | string | Uint8Array) => Observable<TransactionValidity>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x37c8bb1350a9a2a8/1 */
|
||||
transactionPaymentApi: {
|
||||
/**
|
||||
* The transaction fee details
|
||||
**/
|
||||
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<FeeDetails>>;
|
||||
/**
|
||||
* The transaction info
|
||||
**/
|
||||
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
} // AugmentedCalls
|
||||
} // declare module
|
||||
@@ -1139,8 +1139,9 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* The dispatch of this call must be `FastTrackOrigin`.
|
||||
*
|
||||
* - `proposal_hash`: The hash of the current external proposal.
|
||||
* - `voting_period`: The period that is allowed for voting on this proposal. Increased to
|
||||
* `FastTrackVotingPeriod` if too low.
|
||||
* - `voting_period`: The period that is allowed for voting on this proposal.
|
||||
* Must be always greater than zero.
|
||||
* For `FastTrackOrigin` must be equal or greater than `FastTrackVotingPeriod`.
|
||||
* - `delay`: The number of block after voting has ended in approval and this should be
|
||||
* enacted. This doesn't have a minimum amount.
|
||||
*
|
||||
@@ -1452,12 +1453,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]>;
|
||||
@@ -2117,6 +2123,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
|
||||
@@ -2159,6 +2175,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.
|
||||
@@ -2182,12 +2207,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).
|
||||
@@ -4209,6 +4246,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
|
||||
**/
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index';
|
||||
@@ -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.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
@@ -497,6 +497,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* these are removed, either through `unvote` or `reap_vote`.
|
||||
**/
|
||||
VotesExist: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Voting period too low
|
||||
**/
|
||||
VotingPeriodLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Invalid upper bound.
|
||||
**/
|
||||
@@ -1557,6 +1561,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Not a member.
|
||||
**/
|
||||
NotMember: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many members.
|
||||
**/
|
||||
TooManyMembers: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
@@ -1593,6 +1601,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.
|
||||
**/
|
||||
|
||||
@@ -293,6 +293,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A proposal preimage was removed and used (the deposit was returned).
|
||||
**/
|
||||
PreimageUsed: AugmentedEvent<ApiType, [proposalHash: H256, provider: AccountId32, deposit: u128], { proposalHash: H256, provider: AccountId32, deposit: u128 }>;
|
||||
/**
|
||||
* A proposal got canceled.
|
||||
**/
|
||||
ProposalCanceled: AugmentedEvent<ApiType, [propIndex: u32], { propIndex: u32 }>;
|
||||
/**
|
||||
* A motion has been proposed by a public account.
|
||||
**/
|
||||
@@ -942,6 +946,17 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
transactionPayment: {
|
||||
/**
|
||||
* A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
|
||||
* has been paid by `who`.
|
||||
**/
|
||||
TransactionFeePaid: AugmentedEvent<ApiType, [who: AccountId32, actualFee: u128, tip: u128], { who: AccountId32, actualFee: u128, tip: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
treasury: {
|
||||
/**
|
||||
* Some funds have been allocated.
|
||||
@@ -967,6 +982,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* Spending has finished; this is the amount that rolls over until next spend.
|
||||
**/
|
||||
Rollover: AugmentedEvent<ApiType, [rolloverBalance: u128], { rolloverBalance: u128 }>;
|
||||
/**
|
||||
* A new spend proposal has been approved.
|
||||
**/
|
||||
SpendApproved: AugmentedEvent<ApiType, [proposalIndex: u32, amount: u128, beneficiary: AccountId32], { proposalIndex: u32, amount: u128, beneficiary: AccountId32 }>;
|
||||
/**
|
||||
* We have ended a spend period and will now allocate funds.
|
||||
**/
|
||||
|
||||
@@ -7,4 +7,5 @@ import './errors';
|
||||
import './events';
|
||||
import './query';
|
||||
import './registry';
|
||||
import './runtime';
|
||||
import './tx';
|
||||
|
||||
@@ -0,0 +1,334 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Bytes, Null, Option, Result, Vec, bool, u32 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { ValidatorSet } from '@polkadot/types/interfaces/beefy';
|
||||
import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder';
|
||||
import type { BlockHash } from '@polkadot/types/interfaces/chain';
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
|
||||
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafIndex, MmrProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { CandidateCommitments, CandidateEvent, CommittedCandidateReceipt, CoreState, GroupRotationInfo, InboundDownwardMessage, InboundHrmpMessage, OccupiedCoreAssumption, ParaId, ParaValidatorIndex, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorSignature } from '@polkadot/types/interfaces/parachains';
|
||||
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { AccountId, Block, Hash, Header, Index, KeyTypeId, Slot, ValidatorId } from '@polkadot/types/interfaces/runtime';
|
||||
import type { SessionIndex } from '@polkadot/types/interfaces/session';
|
||||
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
|
||||
import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system';
|
||||
import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue';
|
||||
import type { IExtrinsic, Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/calls' {
|
||||
export interface AugmentedCalls<ApiType extends ApiTypes> {
|
||||
/** 0xbc9d89904f5b923f/1 */
|
||||
accountNonceApi: {
|
||||
/**
|
||||
* The API to query account nonce (aka transaction index)
|
||||
**/
|
||||
accountNonce: AugmentedCall<ApiType, (accountId: AccountId | string | Uint8Array) => Observable<Index>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x687ad44ad37f03c2/1 */
|
||||
authorityDiscoveryApi: {
|
||||
/**
|
||||
* Retrieve authority identifiers of the current and next authority set.
|
||||
**/
|
||||
authorities: AugmentedCall<ApiType, () => Observable<Vec<AuthorityId>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xcbca25e39f142387/2 */
|
||||
babeApi: {
|
||||
/**
|
||||
* Return the genesis configuration for BABE. The configuration is only read on genesis.
|
||||
**/
|
||||
configuration: AugmentedCall<ApiType, () => Observable<BabeGenesisConfiguration>>;
|
||||
/**
|
||||
* Returns information regarding the current epoch.
|
||||
**/
|
||||
currentEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Returns the slot that started the current epoch.
|
||||
**/
|
||||
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
|
||||
/**
|
||||
* Generates a proof of key ownership for the given authority in the current epoch.
|
||||
**/
|
||||
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
|
||||
/**
|
||||
* Returns information regarding the next epoch (which was already previously announced).
|
||||
**/
|
||||
nextEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Submits an unsigned extrinsic to report an equivocation.
|
||||
**/
|
||||
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x49eaaf1b548a0cb0/1 */
|
||||
beefyApi: {
|
||||
/**
|
||||
* Return the current active BEEFY validator set
|
||||
**/
|
||||
validatorSet: AugmentedCall<ApiType, () => Observable<Option<ValidatorSet>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x40fe3ad401f8959a/6 */
|
||||
blockBuilder: {
|
||||
/**
|
||||
* Apply the given extrinsic.
|
||||
**/
|
||||
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;
|
||||
/**
|
||||
* Check that the inherents are valid.
|
||||
**/
|
||||
checkInherents: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array, data: InherentData | { data?: any } | string | Uint8Array) => Observable<CheckInherentsResult>>;
|
||||
/**
|
||||
* Finish the current block.
|
||||
**/
|
||||
finalizeBlock: AugmentedCall<ApiType, () => Observable<Header>>;
|
||||
/**
|
||||
* Generate inherent extrinsics.
|
||||
**/
|
||||
inherentExtrinsics: AugmentedCall<ApiType, (inherent: InherentData | { data?: any } | string | Uint8Array) => Observable<Vec<Extrinsic>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xdf6acb689907609b/4 */
|
||||
core: {
|
||||
/**
|
||||
* Execute the given block.
|
||||
**/
|
||||
executeBlock: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Initialize a block with the given header.
|
||||
**/
|
||||
initializeBlock: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Returns the version of the runtime.
|
||||
**/
|
||||
version: AugmentedCall<ApiType, () => Observable<RuntimeVersion>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xed99c5acb25eedf5/3 */
|
||||
grandpaApi: {
|
||||
/**
|
||||
* Get current GRANDPA authority set id.
|
||||
**/
|
||||
currentSetId: AugmentedCall<ApiType, () => Observable<SetId>>;
|
||||
/**
|
||||
* Generates a proof of key ownership for the given authority in the given set.
|
||||
**/
|
||||
generateKeyOwnershipProof: AugmentedCall<ApiType, (setId: SetId | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
|
||||
/**
|
||||
* Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.
|
||||
**/
|
||||
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<AuthorityList>>;
|
||||
/**
|
||||
* Submits an unsigned extrinsic to report an equivocation.
|
||||
**/
|
||||
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x37e397fc7c91f5e4/1 */
|
||||
metadata: {
|
||||
/**
|
||||
* Returns the metadata of a runtime
|
||||
**/
|
||||
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x91d5df18b0d2cf58/1 */
|
||||
mmrApi: {
|
||||
/**
|
||||
* Generate MMR proof for a series of leaves under given indices.
|
||||
**/
|
||||
generateBatchProof: AugmentedCall<ApiType, (leafIndices: Vec<MmrLeafIndex> | (MmrLeafIndex | AnyNumber | Uint8Array)[]) => Observable<Result<ITuple<[Vec<MmrEncodableOpaqueLeaf>, MmrBatchProof]>, MmrError>>>;
|
||||
/**
|
||||
* Generate MMR proof for a leaf under given index.
|
||||
**/
|
||||
generateProof: AugmentedCall<ApiType, (leafIndex: MmrLeafIndex | AnyNumber | Uint8Array) => Observable<Result<ITuple<[MmrEncodableOpaqueLeaf, MmrProof]>, MmrError>>>;
|
||||
/**
|
||||
* Return the on-chain MMR root hash.
|
||||
**/
|
||||
mmrRoot: AugmentedCall<ApiType, () => Observable<Result<Hash, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against on-chain MMR for a batch of leaves.
|
||||
**/
|
||||
verifyBatchProof: AugmentedCall<ApiType, (leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against given root hash or a batch of leaves.
|
||||
**/
|
||||
verifyBatchProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against on-chain MMR.
|
||||
**/
|
||||
verifyProof: AugmentedCall<ApiType, (leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against given root hash.
|
||||
**/
|
||||
verifyProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xf78b278be53f454c/2 */
|
||||
offchainWorkerApi: {
|
||||
/**
|
||||
* Starts the off-chain task for given block header.
|
||||
**/
|
||||
offchainWorker: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xaf2c0297a23e6d3d/2 */
|
||||
parachainHost: {
|
||||
/**
|
||||
* Returns the persisted validation data for the given `ParaId` along with the corresponding validation code hash.
|
||||
**/
|
||||
assumedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, hash: Hash | string | Uint8Array) => Observable<Option<ITuple<[PersistedValidationData, ValidationCodeHash]>>>>;
|
||||
/**
|
||||
* Yields information on all availability cores as relevant to the child block.
|
||||
**/
|
||||
availabilityCores: AugmentedCall<ApiType, () => Observable<Vec<CoreState>>>;
|
||||
/**
|
||||
* Get a vector of events concerning candidates that occurred within a block.
|
||||
**/
|
||||
candidateEvents: AugmentedCall<ApiType, () => Observable<Vec<CandidateEvent>>>;
|
||||
/**
|
||||
* Get the receipt of a candidate pending availability.
|
||||
**/
|
||||
candidatePendingAvailability: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Option<CommittedCandidateReceipt>>>;
|
||||
/**
|
||||
* Checks if the given validation outputs pass the acceptance criteria.
|
||||
**/
|
||||
checkValidationOutputs: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, outputs: CandidateCommitments | { upwardMessages?: any; horizontalMessages?: any; newValidationCode?: any; headData?: any; processedDownwardMessages?: any; hrmpWatermark?: any } | string | Uint8Array) => Observable<bool>>;
|
||||
/**
|
||||
* Get all the pending inbound messages in the downward message queue for a para.
|
||||
**/
|
||||
dmqContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundDownwardMessage>>>;
|
||||
/**
|
||||
* Get the contents of all channels addressed to the given recipient.
|
||||
**/
|
||||
inboundHrmpChannelsContents: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array) => Observable<Vec<InboundHrmpMessage>>>;
|
||||
/**
|
||||
* Scrape dispute relevant from on-chain, backing votes and resolved disputes.
|
||||
**/
|
||||
onChainVotes: AugmentedCall<ApiType, () => Observable<Option<ScrapedOnChainVotes>>>;
|
||||
/**
|
||||
* Yields the persisted validation data for the given `ParaId` along with an assumption that should be used if the para currently occupies a core.
|
||||
**/
|
||||
persistedValidationData: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<PersistedValidationData>>>;
|
||||
/**
|
||||
* Returns code hashes of PVFs that require pre-checking by validators in the active set.
|
||||
**/
|
||||
pvfsRequirePrecheck: AugmentedCall<ApiType, () => Observable<Vec<ValidationCodeHash>>>;
|
||||
/**
|
||||
* Returns the session index expected at a child of the block.
|
||||
**/
|
||||
sessionIndexForChild: AugmentedCall<ApiType, () => Observable<SessionIndex>>;
|
||||
/**
|
||||
* Get the session info for the given session, if stored.
|
||||
**/
|
||||
sessionInfo: AugmentedCall<ApiType, (index: SessionIndex | AnyNumber | Uint8Array) => Observable<Option<SessionInfo>>>;
|
||||
/**
|
||||
* Submits a PVF pre-checking statement into the transaction pool.
|
||||
**/
|
||||
submitPvfCheckStatement: AugmentedCall<ApiType, (stmt: PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: ValidatorSignature | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Fetch the validation code used by a para, making the given `OccupiedCoreAssumption`.
|
||||
**/
|
||||
validationCode: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<ValidationCode>>;
|
||||
/**
|
||||
* Get the validation code from its hash.
|
||||
**/
|
||||
validationCodeByHash: AugmentedCall<ApiType, (hash: ValidationCodeHash | string | Uint8Array) => Observable<Option<ValidationCode>>>;
|
||||
/**
|
||||
* Fetch the hash of the validation code used by a para, making the given `OccupiedCoreAssumption`.
|
||||
**/
|
||||
validationCodeHash: AugmentedCall<ApiType, (paraId: ParaId | AnyNumber | Uint8Array, assumption: OccupiedCoreAssumption | 'Included,' | 'TimedOut' | 'Free' | number | Uint8Array) => Observable<Option<ValidationCodeHash>>>;
|
||||
/**
|
||||
* Returns the validator groups and rotation info localized based on the hypothetical child of a block whose state this is invoked on
|
||||
**/
|
||||
validatorGroups: AugmentedCall<ApiType, () => Observable<ITuple<[Vec<Vec<ParaValidatorIndex>>, GroupRotationInfo]>>>;
|
||||
/**
|
||||
* Get the current validators.
|
||||
**/
|
||||
validators: AugmentedCall<ApiType, () => Observable<Vec<ValidatorId>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xab3c0572291feb8b/1 */
|
||||
sessionKeys: {
|
||||
/**
|
||||
* Decode the given public session keys.
|
||||
**/
|
||||
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, KeyTypeId]>>>>>;
|
||||
/**
|
||||
* Generate a set of session keys with optionally using the given seed.
|
||||
**/
|
||||
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | object | string | Uint8Array) => Observable<Bytes>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xd2bc9897eed08f15/3 */
|
||||
taggedTransactionQueue: {
|
||||
/**
|
||||
* Validate the transaction.
|
||||
**/
|
||||
validateTransaction: AugmentedCall<ApiType, (source: TransactionSource | 'InBlock' | 'Local' | 'External' | number | Uint8Array, tx: Extrinsic | IExtrinsic | string | Uint8Array, blockHash: BlockHash | string | Uint8Array) => Observable<TransactionValidity>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x37c8bb1350a9a2a8/1 */
|
||||
transactionPaymentApi: {
|
||||
/**
|
||||
* The transaction fee details
|
||||
**/
|
||||
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<FeeDetails>>;
|
||||
/**
|
||||
* The transaction info
|
||||
**/
|
||||
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
} // AugmentedCalls
|
||||
} // declare module
|
||||
@@ -1139,8 +1139,9 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* The dispatch of this call must be `FastTrackOrigin`.
|
||||
*
|
||||
* - `proposal_hash`: The hash of the current external proposal.
|
||||
* - `voting_period`: The period that is allowed for voting on this proposal. Increased to
|
||||
* `FastTrackVotingPeriod` if too low.
|
||||
* - `voting_period`: The period that is allowed for voting on this proposal.
|
||||
* Must be always greater than zero.
|
||||
* For `FastTrackOrigin` must be equal or greater than `FastTrackVotingPeriod`.
|
||||
* - `delay`: The number of block after voting has ended in approval and this should be
|
||||
* enacted. This doesn't have a minimum amount.
|
||||
*
|
||||
@@ -1401,12 +1402,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]>;
|
||||
@@ -3562,6 +3568,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
|
||||
**/
|
||||
|
||||
@@ -733,6 +733,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* these are removed, either through `unvote` or `reap_vote`.
|
||||
**/
|
||||
VotesExist: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Voting period too low
|
||||
**/
|
||||
VotingPeriodLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Invalid upper bound.
|
||||
**/
|
||||
|
||||
@@ -1333,6 +1333,17 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
transactionPayment: {
|
||||
/**
|
||||
* A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
|
||||
* has been paid by `who`.
|
||||
**/
|
||||
TransactionFeePaid: AugmentedEvent<ApiType, [who: AccountId32, actualFee: u128, tip: u128], { who: AccountId32, actualFee: u128, tip: u128 }>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
transactionStorage: {
|
||||
/**
|
||||
* Storage proof was successfully checked.
|
||||
|
||||
@@ -7,4 +7,5 @@ import './errors';
|
||||
import './events';
|
||||
import './query';
|
||||
import './registry';
|
||||
import './runtime';
|
||||
import './tx';
|
||||
|
||||
@@ -1701,14 +1701,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Storage fee per transaction.
|
||||
**/
|
||||
entryFee: AugmentedQuery<ApiType, () => Observable<Option<u128>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Maximum number of indexed transactions in the block.
|
||||
**/
|
||||
maxBlockTransactions: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Maximum data set in a single transaction in bytes.
|
||||
**/
|
||||
maxTransactionSize: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Was the proof checked in this block?
|
||||
**/
|
||||
|
||||
@@ -0,0 +1,265 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Bytes, Null, Option, Result, Vec, u32, u64 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { BabeEquivocationProof, BabeGenesisConfiguration, Epoch, OpaqueKeyOwnershipProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder';
|
||||
import type { BlockHash } from '@polkadot/types/interfaces/chain';
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { CodeUploadResult, ContractExecResult, ContractInstantiateResult } from '@polkadot/types/interfaces/contracts';
|
||||
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { OpaqueMetadata } from '@polkadot/types/interfaces/metadata';
|
||||
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafIndex, MmrProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { AccountId, Balance, Block, Hash, Header, Index, KeyTypeId, Slot } from '@polkadot/types/interfaces/runtime';
|
||||
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
|
||||
import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system';
|
||||
import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue';
|
||||
import type { IExtrinsic, Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/calls' {
|
||||
export interface AugmentedCalls<ApiType extends ApiTypes> {
|
||||
/** 0xbc9d89904f5b923f/1 */
|
||||
accountNonceApi: {
|
||||
/**
|
||||
* The API to query account nonce (aka transaction index)
|
||||
**/
|
||||
accountNonce: AugmentedCall<ApiType, (accountId: AccountId | string | Uint8Array) => Observable<Index>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x687ad44ad37f03c2/1 */
|
||||
authorityDiscoveryApi: {
|
||||
/**
|
||||
* Retrieve authority identifiers of the current and next authority set.
|
||||
**/
|
||||
authorities: AugmentedCall<ApiType, () => Observable<Vec<AuthorityId>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xcbca25e39f142387/2 */
|
||||
babeApi: {
|
||||
/**
|
||||
* Return the genesis configuration for BABE. The configuration is only read on genesis.
|
||||
**/
|
||||
configuration: AugmentedCall<ApiType, () => Observable<BabeGenesisConfiguration>>;
|
||||
/**
|
||||
* Returns information regarding the current epoch.
|
||||
**/
|
||||
currentEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Returns the slot that started the current epoch.
|
||||
**/
|
||||
currentEpochStart: AugmentedCall<ApiType, () => Observable<Slot>>;
|
||||
/**
|
||||
* Generates a proof of key ownership for the given authority in the current epoch.
|
||||
**/
|
||||
generateKeyOwnershipProof: AugmentedCall<ApiType, (slot: Slot | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
|
||||
/**
|
||||
* Returns information regarding the next epoch (which was already previously announced).
|
||||
**/
|
||||
nextEpoch: AugmentedCall<ApiType, () => Observable<Epoch>>;
|
||||
/**
|
||||
* Submits an unsigned extrinsic to report an equivocation.
|
||||
**/
|
||||
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: BabeEquivocationProof | { offender?: any; slotNumber?: any; firstHeader?: any; secondHeader?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x40fe3ad401f8959a/6 */
|
||||
blockBuilder: {
|
||||
/**
|
||||
* Apply the given extrinsic.
|
||||
**/
|
||||
applyExtrinsic: AugmentedCall<ApiType, (extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;
|
||||
/**
|
||||
* Check that the inherents are valid.
|
||||
**/
|
||||
checkInherents: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array, data: InherentData | { data?: any } | string | Uint8Array) => Observable<CheckInherentsResult>>;
|
||||
/**
|
||||
* Finish the current block.
|
||||
**/
|
||||
finalizeBlock: AugmentedCall<ApiType, () => Observable<Header>>;
|
||||
/**
|
||||
* Generate inherent extrinsics.
|
||||
**/
|
||||
inherentExtrinsics: AugmentedCall<ApiType, (inherent: InherentData | { data?: any } | string | Uint8Array) => Observable<Vec<Extrinsic>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x68b66ba122c93fa7/1 */
|
||||
contractsApi: {
|
||||
/**
|
||||
* Perform a call from a specified account to a given contract.
|
||||
**/
|
||||
call: AugmentedCall<ApiType, (origin: AccountId | string | Uint8Array, dest: AccountId | string | Uint8Array, value: Balance | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, storageDepositLimit: Option<Balance> | null | object | string | Uint8Array, inputData: Bytes | string | Uint8Array) => Observable<ContractExecResult>>;
|
||||
/**
|
||||
* Query a given storage key in a given contract.
|
||||
**/
|
||||
getStorage: AugmentedCall<ApiType, (address: AccountId | string | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Option<Bytes>>>;
|
||||
/**
|
||||
* Instantiate a new contract.
|
||||
**/
|
||||
instantiate: AugmentedCall<ApiType, (origin: AccountId | string | Uint8Array, value: Balance | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, storageDepositLimit: Option<Balance> | null | object | string | Uint8Array, code: Bytes | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => Observable<ContractInstantiateResult>>;
|
||||
/**
|
||||
* Upload new code without instantiating a contract from it.
|
||||
**/
|
||||
uploadCode: AugmentedCall<ApiType, (origin: AccountId | string | Uint8Array, code: Bytes | string | Uint8Array, storageDepositLimit: Option<Balance> | null | object | string | Uint8Array) => Observable<CodeUploadResult>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xdf6acb689907609b/4 */
|
||||
core: {
|
||||
/**
|
||||
* Execute the given block.
|
||||
**/
|
||||
executeBlock: AugmentedCall<ApiType, (block: Block | { header?: any; extrinsics?: any } | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Initialize a block with the given header.
|
||||
**/
|
||||
initializeBlock: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Returns the version of the runtime.
|
||||
**/
|
||||
version: AugmentedCall<ApiType, () => Observable<RuntimeVersion>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xed99c5acb25eedf5/3 */
|
||||
grandpaApi: {
|
||||
/**
|
||||
* Get current GRANDPA authority set id.
|
||||
**/
|
||||
currentSetId: AugmentedCall<ApiType, () => Observable<SetId>>;
|
||||
/**
|
||||
* Generates a proof of key ownership for the given authority in the given set.
|
||||
**/
|
||||
generateKeyOwnershipProof: AugmentedCall<ApiType, (setId: SetId | AnyNumber | Uint8Array, authorityId: AuthorityId | string | Uint8Array) => Observable<Option<OpaqueKeyOwnershipProof>>>;
|
||||
/**
|
||||
* Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.
|
||||
**/
|
||||
grandpaAuthorities: AugmentedCall<ApiType, () => Observable<AuthorityList>>;
|
||||
/**
|
||||
* Submits an unsigned extrinsic to report an equivocation.
|
||||
**/
|
||||
submitReportEquivocationUnsignedExtrinsic: AugmentedCall<ApiType, (equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: OpaqueKeyOwnershipProof | string | Uint8Array) => Observable<Option<Null>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x37e397fc7c91f5e4/1 */
|
||||
metadata: {
|
||||
/**
|
||||
* Returns the metadata of a runtime
|
||||
**/
|
||||
metadata: AugmentedCall<ApiType, () => Observable<OpaqueMetadata>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x91d5df18b0d2cf58/1 */
|
||||
mmrApi: {
|
||||
/**
|
||||
* Generate MMR proof for a series of leaves under given indices.
|
||||
**/
|
||||
generateBatchProof: AugmentedCall<ApiType, (leafIndices: Vec<MmrLeafIndex> | (MmrLeafIndex | AnyNumber | Uint8Array)[]) => Observable<Result<ITuple<[Vec<MmrEncodableOpaqueLeaf>, MmrBatchProof]>, MmrError>>>;
|
||||
/**
|
||||
* Generate MMR proof for a leaf under given index.
|
||||
**/
|
||||
generateProof: AugmentedCall<ApiType, (leafIndex: MmrLeafIndex | AnyNumber | Uint8Array) => Observable<Result<ITuple<[MmrEncodableOpaqueLeaf, MmrProof]>, MmrError>>>;
|
||||
/**
|
||||
* Return the on-chain MMR root hash.
|
||||
**/
|
||||
mmrRoot: AugmentedCall<ApiType, () => Observable<Result<Hash, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against on-chain MMR for a batch of leaves.
|
||||
**/
|
||||
verifyBatchProof: AugmentedCall<ApiType, (leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against given root hash or a batch of leaves.
|
||||
**/
|
||||
verifyBatchProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaves: Vec<MmrEncodableOpaqueLeaf> | (MmrEncodableOpaqueLeaf | string | Uint8Array)[], proof: MmrBatchProof | { leafIndices?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against on-chain MMR.
|
||||
**/
|
||||
verifyProof: AugmentedCall<ApiType, (leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Verify MMR proof against given root hash.
|
||||
**/
|
||||
verifyProofStateless: AugmentedCall<ApiType, (root: Hash | string | Uint8Array, leaf: MmrEncodableOpaqueLeaf | string | Uint8Array, proof: MmrProof | { leafIndex?: any; leafCount?: any; items?: any } | string | Uint8Array) => Observable<Result<ITuple<[]>, MmrError>>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xf78b278be53f454c/2 */
|
||||
offchainWorkerApi: {
|
||||
/**
|
||||
* Starts the off-chain task for given block header.
|
||||
**/
|
||||
offchainWorker: AugmentedCall<ApiType, (header: Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array) => Observable<Null>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xab3c0572291feb8b/1 */
|
||||
sessionKeys: {
|
||||
/**
|
||||
* Decode the given public session keys.
|
||||
**/
|
||||
decodeSessionKeys: AugmentedCall<ApiType, (encoded: Bytes | string | Uint8Array) => Observable<Option<Vec<ITuple<[Bytes, KeyTypeId]>>>>>;
|
||||
/**
|
||||
* Generate a set of session keys with optionally using the given seed.
|
||||
**/
|
||||
generateSessionKeys: AugmentedCall<ApiType, (seed: Option<Bytes> | null | object | string | Uint8Array) => Observable<Bytes>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0xd2bc9897eed08f15/3 */
|
||||
taggedTransactionQueue: {
|
||||
/**
|
||||
* Validate the transaction.
|
||||
**/
|
||||
validateTransaction: AugmentedCall<ApiType, (source: TransactionSource | 'InBlock' | 'Local' | 'External' | number | Uint8Array, tx: Extrinsic | IExtrinsic | string | Uint8Array, blockHash: BlockHash | string | Uint8Array) => Observable<TransactionValidity>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
/** 0x37c8bb1350a9a2a8/1 */
|
||||
transactionPaymentApi: {
|
||||
/**
|
||||
* The transaction fee details
|
||||
**/
|
||||
queryFeeDetails: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<FeeDetails>>;
|
||||
/**
|
||||
* The transaction info
|
||||
**/
|
||||
queryInfo: AugmentedCall<ApiType, (uxt: Extrinsic | IExtrinsic | string | Uint8Array, len: u32 | AnyNumber | Uint8Array) => Observable<RuntimeDispatchInfo>>;
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
};
|
||||
} // AugmentedCalls
|
||||
} // declare module
|
||||
@@ -1655,8 +1655,9 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* The dispatch of this call must be `FastTrackOrigin`.
|
||||
*
|
||||
* - `proposal_hash`: The hash of the current external proposal.
|
||||
* - `voting_period`: The period that is allowed for voting on this proposal. Increased to
|
||||
* `FastTrackVotingPeriod` if too low.
|
||||
* - `voting_period`: The period that is allowed for voting on this proposal.
|
||||
* Must be always greater than zero.
|
||||
* For `FastTrackOrigin` must be equal or greater than `FastTrackVotingPeriod`.
|
||||
* - `delay`: The number of block after voting has ended in approval and this should be
|
||||
* enacted. This doesn't have a minimum amount.
|
||||
*
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/rpc-core": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/rpc-core": "8.11.1",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1",
|
||||
"rxjs": "^7.5.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index';
|
||||
@@ -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.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
@@ -65,3 +65,9 @@ export interface PaginationOptions<A = unknown> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type DecorateMethod<ApiType extends ApiTypes, T = any> =
|
||||
<M extends (...args: any[]) => Observable<any>>(method: M, options?: DecorateMethodOptions) => T;
|
||||
|
||||
type AsCodec<R extends Codec | any> = R extends Codec
|
||||
? R
|
||||
: Codec;
|
||||
|
||||
export type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright 2017-2022 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { AnyFunction, Codec, DefinitionCallNamed } from '@polkadot/types/types';
|
||||
import type { ApiTypes, ReturnCodec } from './base';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedCalls<ApiType extends ApiTypes> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
export interface QueryableCalls<ApiType extends ApiTypes> extends AugmentedCalls<ApiType> {
|
||||
// when non-augmented, we need to at least have Codec results
|
||||
[key: string]: QueryableModuleCalls<ApiType>;
|
||||
}
|
||||
|
||||
export interface QueryableModuleCalls<ApiType extends ApiTypes> {
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
}
|
||||
|
||||
export type DecoratedCallBase<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> =
|
||||
ApiType extends 'rxjs'
|
||||
? <T extends Codec | any = ReturnCodec<F>> (...args: Parameters<F>) => Observable<T>
|
||||
: <T extends Codec | any = ReturnCodec<F>> (...args: Parameters<F>) => Promise<T>;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type AugmentedCall<ApiType extends ApiTypes, F extends AnyFunction = (...args: any[]) => Observable<Codec>> =
|
||||
DecoratedCallBase<ApiType, F> & { meta: DefinitionCallNamed };
|
||||
@@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// These are augmented, do an augmentation export
|
||||
export * from '@polkadot/api-base/types/calls';
|
||||
export * from '@polkadot/api-base/types/consts';
|
||||
export * from '@polkadot/api-base/types/errors';
|
||||
export * from '@polkadot/api-base/types/events';
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { StorageKey, u64 } from '@polkadot/types';
|
||||
import type { Hash } from '@polkadot/types/interfaces';
|
||||
import type { StorageEntry } from '@polkadot/types/primitive/types';
|
||||
import type { AnyFunction, AnyTuple, Callback, Codec, IStorageKey } from '@polkadot/types/types';
|
||||
import type { ApiTypes, DropLast, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base';
|
||||
import type { ApiTypes, DropLast, MethodResult, PaginationOptions, PromiseOrObs, ReturnCodec, UnsubscribePromise } from './base';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedQueries<ApiType extends ApiTypes> {
|
||||
@@ -22,12 +22,6 @@ export interface QueryableStorageAt<ApiType extends ApiTypes> extends AugmentedQ
|
||||
[key: string]: QueryableModuleStorageAt<ApiType>;
|
||||
}
|
||||
|
||||
type AsCodec<R extends Codec | any> = R extends Codec
|
||||
? R
|
||||
: Codec;
|
||||
|
||||
type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
|
||||
|
||||
interface StorageEntryObservableMulti<R extends Codec = Codec> {
|
||||
<T extends Codec = R>(args: (unknown[] | unknown)[]): Observable<T[]>;
|
||||
}
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@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",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api": "8.11.1",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/types-codec": "8.11.1",
|
||||
"@polkadot/types-create": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1",
|
||||
"@polkadot/util-crypto": "^9.7.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "8.8.2",
|
||||
"@polkadot/keyring": "^9.4.1"
|
||||
"@polkadot/api-augment": "8.11.1",
|
||||
"@polkadot/keyring": "^9.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index';
|
||||
@@ -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.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
@@ -160,6 +160,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 10,
|
||||
"lookupName": "InkStorageCollectionsStashEntry",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 10,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntryEntry",
|
||||
"type": "{\"value\":\"u32\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
@@ -205,6 +206,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 11,
|
||||
"lookupName": "InkStorageCollectionsStashEntry",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
@@ -275,6 +277,7 @@
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 13,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntryOption",
|
||||
"type": "{\"value\":\"bool\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
|
||||
@@ -226,6 +226,7 @@
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 12,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntry",
|
||||
"type": "{\"value\":\"u32\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
@@ -251,7 +252,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 13,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"MultisigPlainMultisigPlainTransaction\"}}",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"MultisigPlainTransaction\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
@@ -268,7 +269,7 @@
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 14,
|
||||
"lookupName": "MultisigPlainMultisigPlainTransaction",
|
||||
"lookupName": "MultisigPlainTransaction",
|
||||
"type": "Lookup14",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
@@ -278,7 +279,7 @@
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 14,
|
||||
"lookupName": "MultisigPlainMultisigPlainTransaction",
|
||||
"lookupName": "MultisigPlainTransaction",
|
||||
"type": "{\"callee\":\"AccountId\",\"selector\":\"[u8;4]\",\"input\":\"Bytes\",\"transferredValue\":\"u128\",\"gasLimit\":\"u64\"}",
|
||||
"docs": [],
|
||||
"namespace": "multisig_plain::multisig_plain::Transaction",
|
||||
@@ -373,6 +374,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 19,
|
||||
"lookupName": "InkStorageCollectionsStashEntry",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
@@ -416,7 +418,7 @@
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 21,
|
||||
"type": "(u32,MultisigPlainMultisigPlainConfirmationStatus)",
|
||||
"type": "(u32,MultisigPlainConfirmationStatus)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
@@ -431,7 +433,7 @@
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 22,
|
||||
"lookupName": "MultisigPlainMultisigPlainConfirmationStatus",
|
||||
"lookupName": "MultisigPlainConfirmationStatus",
|
||||
"type": "Lookup22"
|
||||
}
|
||||
]
|
||||
@@ -439,7 +441,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 22,
|
||||
"lookupName": "MultisigPlainMultisigPlainConfirmationStatus",
|
||||
"lookupName": "MultisigPlainConfirmationStatus",
|
||||
"type": "{\"_enum\":{\"Confirmed\":\"Null\",\"ConfirmationsNeeded\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "multisig_plain::multisig_plain::ConfirmationStatus",
|
||||
|
||||
@@ -310,6 +310,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 15,
|
||||
"lookupName": "InkStorageCollectionsStashEntry",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(u32,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
@@ -380,6 +381,7 @@
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 17,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntry",
|
||||
"type": "{\"value\":\"Null\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 6,
|
||||
"lookupName": "InkStorageLazyMapping",
|
||||
"type": "{\"offsetKey\":\"InkPrimitivesKey\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::lazy::mapping::Mapping",
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 6,
|
||||
"lookupName": "InkStorageLazyMapping",
|
||||
"type": "{\"offsetKey\":\"InkPrimitivesKey\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::lazy::mapping::Mapping",
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "EnumExampleEnumExampleVariant",
|
||||
"type": "{\"_enum\":{\"None\":\"Null\",\"Weekday\":\"EnumExampleEnumExampleWeekday\",\"TupleMaybeSigned\":\"EnumExampleEnumExampleTupleMaybeSigned\",\"NamedMaybeSigned\":\"EnumExampleEnumExampleNamedMaybeSigned\",\"Color\":\"EnumExampleEnumExampleColor\"}}",
|
||||
"lookupName": "EnumExampleVariant",
|
||||
"type": "{\"_enum\":{\"None\":\"Null\",\"Weekday\":\"EnumExampleWeekday\",\"TupleMaybeSigned\":\"EnumExampleTupleMaybeSigned\",\"NamedMaybeSigned\":\"EnumExampleNamedMaybeSigned\",\"Color\":\"EnumExampleColor\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::Variant",
|
||||
"sub": [
|
||||
@@ -38,7 +38,7 @@
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 5,
|
||||
"lookupName": "EnumExampleEnumExampleWeekday",
|
||||
"lookupName": "EnumExampleWeekday",
|
||||
"type": "Lookup5",
|
||||
"index": 1,
|
||||
"name": "Weekday"
|
||||
@@ -47,7 +47,7 @@
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 6,
|
||||
"lookupName": "EnumExampleEnumExampleTupleMaybeSigned",
|
||||
"lookupName": "EnumExampleTupleMaybeSigned",
|
||||
"type": "Lookup6",
|
||||
"index": 2,
|
||||
"name": "TupleMaybeSigned"
|
||||
@@ -56,7 +56,7 @@
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "EnumExampleEnumExampleNamedMaybeSigned",
|
||||
"lookupName": "EnumExampleNamedMaybeSigned",
|
||||
"type": "Lookup7",
|
||||
"index": 3,
|
||||
"name": "NamedMaybeSigned"
|
||||
@@ -65,7 +65,7 @@
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "EnumExampleEnumExampleColor",
|
||||
"lookupName": "EnumExampleColor",
|
||||
"type": "Lookup8",
|
||||
"index": 4,
|
||||
"name": "Color"
|
||||
@@ -75,7 +75,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 5,
|
||||
"lookupName": "EnumExampleEnumExampleWeekday",
|
||||
"lookupName": "EnumExampleWeekday",
|
||||
"type": "{\"_enum\":[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"]}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::Weekday",
|
||||
@@ -127,7 +127,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 6,
|
||||
"lookupName": "EnumExampleEnumExampleTupleMaybeSigned",
|
||||
"lookupName": "EnumExampleTupleMaybeSigned",
|
||||
"type": "{\"_enum\":{\"Signed\":\"i32\",\"Unsigned\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::TupleMaybeSigned",
|
||||
@@ -155,7 +155,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "EnumExampleEnumExampleNamedMaybeSigned",
|
||||
"lookupName": "EnumExampleNamedMaybeSigned",
|
||||
"type": "{\"_enum\":{\"Signed\":\"{\\\"value\\\":\\\"i32\\\"}\",\"Unsigned\":\"{\\\"value\\\":\\\"u32\\\"}\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::NamedMaybeSigned",
|
||||
@@ -197,7 +197,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "EnumExampleEnumExampleColor",
|
||||
"lookupName": "EnumExampleColor",
|
||||
"type": "{\"_enum\":{\"Red\":\"Null\",\"Blue\":\"Null\",\"Green\":\"Null\",\"Yellow\":\"Null\",\"Rgb\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\"}\",\"Rgba\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\",\\\"a\\\":\\\"u8\\\"}\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::Color",
|
||||
|
||||
@@ -160,6 +160,7 @@
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 10,
|
||||
"lookupName": "InkStorageCollectionsStashEntry",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@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",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api": "8.11.1",
|
||||
"@polkadot/api-augment": "8.11.1",
|
||||
"@polkadot/api-base": "8.11.1",
|
||||
"@polkadot/rpc-core": "8.11.1",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/types-codec": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1",
|
||||
"@polkadot/util-crypto": "^9.7.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@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"
|
||||
"@polkadot/api": "8.11.1",
|
||||
"@polkadot/api-augment": "8.11.1",
|
||||
"@polkadot/rpc-augment": "8.11.1",
|
||||
"@polkadot/rpc-provider": "8.11.1",
|
||||
"@polkadot/types-support": "8.11.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import type { DeriveApi, DeriveDispatch, DeriveProposalImage } from '../types';
|
||||
|
||||
import { catchError, combineLatest, map, of, switchMap } from 'rxjs';
|
||||
|
||||
import { Enum } from '@polkadot/types';
|
||||
import { isFunction, stringToHex } from '@polkadot/util';
|
||||
|
||||
import { memo } from '../util';
|
||||
@@ -24,7 +25,7 @@ interface SchedulerInfo {
|
||||
|
||||
function isMaybeHashed (call: FrameSupportScheduleMaybeHashed | Call): call is FrameSupportScheduleMaybeHashed {
|
||||
// check for enum
|
||||
return (call as FrameSupportScheduleMaybeHashed).isBasic === false;
|
||||
return call instanceof Enum;
|
||||
}
|
||||
|
||||
function queryQueue (api: DeriveApi): Observable<DeriveDispatch[]> {
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/api-derive authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index';
|
||||
@@ -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.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
+18
-18
@@ -20,29 +20,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/api-augment": "8.8.2",
|
||||
"@polkadot/api-base": "8.8.2",
|
||||
"@polkadot/api-derive": "8.8.2",
|
||||
"@polkadot/keyring": "^9.4.1",
|
||||
"@polkadot/rpc-augment": "8.8.2",
|
||||
"@polkadot/rpc-core": "8.8.2",
|
||||
"@polkadot/rpc-provider": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-augment": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/types-create": "8.8.2",
|
||||
"@polkadot/types-known": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"@polkadot/util-crypto": "^9.4.1",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api-augment": "8.11.1",
|
||||
"@polkadot/api-base": "8.11.1",
|
||||
"@polkadot/api-derive": "8.11.1",
|
||||
"@polkadot/keyring": "^9.7.1",
|
||||
"@polkadot/rpc-augment": "8.11.1",
|
||||
"@polkadot/rpc-core": "8.11.1",
|
||||
"@polkadot/rpc-provider": "8.11.1",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/types-augment": "8.11.1",
|
||||
"@polkadot/types-codec": "8.11.1",
|
||||
"@polkadot/types-create": "8.11.1",
|
||||
"@polkadot/types-known": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1",
|
||||
"@polkadot/util-crypto": "^9.7.1",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "8.8.2",
|
||||
"@polkadot/types-support": "8.8.2"
|
||||
"@polkadot/api-augment": "8.11.1",
|
||||
"@polkadot/types-support": "8.11.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { DeriveCustom } from '@polkadot/api-base/types';
|
||||
import type { AugmentedCall, DeriveCustom, QueryableCalls } from '@polkadot/api-base/types';
|
||||
import type { RpcInterface } from '@polkadot/rpc-core/types';
|
||||
import type { Option, Raw, StorageKey, Text, u64 } from '@polkadot/types';
|
||||
import type { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces';
|
||||
import type { DecoratedMeta } from '@polkadot/types/metadata/decorate/types';
|
||||
import type { StorageEntry } from '@polkadot/types/primitive/types';
|
||||
import type { AnyFunction, AnyTuple, CallFunction, Codec, DefinitionRpc, DefinitionRpcSub, DetectCodec, IMethod, IStorageKey, Registry, RegistryError, RegistryTypes } from '@polkadot/types/types';
|
||||
import type { AnyFunction, AnyTuple, CallFunction, Codec, DefinitionCallNamed, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, DefinitionsCallEntry, DetectCodec, IMethod, IStorageKey, Registry, RegistryError, RegistryTypes } from '@polkadot/types/types';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { SubmittableExtrinsic } from '../submittable/types';
|
||||
import type { ApiDecoration, ApiInterfaceRx, ApiOptions, ApiTypes, AugmentedQuery, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecorateMethod, GenericStorageEntryFunction, PaginationOptions, QueryableConsts, QueryableStorage, QueryableStorageEntry, QueryableStorageEntryAt, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics } from '../types';
|
||||
import type { VersionedRegistry } from './types';
|
||||
@@ -18,8 +19,10 @@ import { BehaviorSubject, combineLatest, from, map, of, switchMap, tap, toArray
|
||||
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, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, u8aToHex } from '@polkadot/util';
|
||||
import { expandMetadata, Metadata, typeDefinitions, TypeRegistry, unwrapStorageType } from '@polkadot/types';
|
||||
import { getSpecRuntime } from '@polkadot/types-known';
|
||||
import { arrayChunk, arrayFlatten, assert, assertReturn, BN, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, stringCamelCase, stringUpperFirst, u8aConcatStrict, u8aToHex } from '@polkadot/util';
|
||||
import { blake2AsHex } from '@polkadot/util-crypto';
|
||||
|
||||
import { createSubmittable } from '../submittable';
|
||||
import { augmentObject } from '../util/augmentObject';
|
||||
@@ -66,6 +69,8 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
// HACK Use BN import so decorateDerive works... yes, wtf.
|
||||
protected __phantom = new BN(0);
|
||||
|
||||
protected _call: QueryableCalls<ApiType> = {} as QueryableCalls<ApiType>;
|
||||
|
||||
protected _consts: QueryableConsts<ApiType> = {} as QueryableConsts<ApiType>;
|
||||
|
||||
protected _derive?: ReturnType<Decorate<ApiType>['_decorateDerive']>;
|
||||
@@ -94,6 +99,8 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
protected _rpcCore: RpcCore & RpcInterface;
|
||||
|
||||
protected _runtimeMap: Record<HexString, string> = {};
|
||||
|
||||
protected _runtimeChain?: Text;
|
||||
|
||||
protected _runtimeMetadata?: Metadata;
|
||||
@@ -206,6 +213,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
protected _emptyDecorated (registry: Registry, blockHash?: Uint8Array): ApiDecoration<ApiType> {
|
||||
return {
|
||||
call: {},
|
||||
consts: {},
|
||||
errors: {},
|
||||
events: {},
|
||||
@@ -227,6 +235,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
registry.decoratedMeta = expandMetadata(registry.registry, registry.metadata);
|
||||
}
|
||||
|
||||
const runtime = this._decorateCalls(registry, this._decorateMethod, blockHash);
|
||||
const storage = this._decorateStorage(registry.decoratedMeta, this._decorateMethod, blockHash);
|
||||
const storageRx = this._decorateStorage(registry.decoratedMeta, this._rxDecorateMethod, blockHash);
|
||||
|
||||
@@ -235,6 +244,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
augmentObject('events', registry.decoratedMeta.events, decoratedApi.events, fromEmpty);
|
||||
augmentObject('query', storage, decoratedApi.query, fromEmpty);
|
||||
augmentObject('query', storageRx, decoratedApi.rx.query, fromEmpty);
|
||||
augmentObject('call', runtime, decoratedApi.call, fromEmpty);
|
||||
|
||||
decoratedApi.findCall = (callIndex: Uint8Array | string): CallFunction =>
|
||||
findCall(registry.registry, callIndex);
|
||||
@@ -259,6 +269,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
|
||||
const { decoratedApi, decoratedMeta } = this._createDecorated(registry, fromEmpty, registry.decoratedApi);
|
||||
|
||||
this._call = decoratedApi.call;
|
||||
this._consts = decoratedApi.consts;
|
||||
this._errors = decoratedApi.errors;
|
||||
this._events = decoratedApi.events;
|
||||
@@ -316,6 +327,28 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
this._decorateRpc(this._rpcCore, this._rxDecorateMethod, this._rx.rpc);
|
||||
}
|
||||
|
||||
// extract the actual sections from the methods (this is useful when
|
||||
// we try and create mappings to runtime names via a hash mapping)
|
||||
const sectionMap: Record<string, boolean> = {};
|
||||
|
||||
for (let i = 0; i < methods.length; i++) {
|
||||
const [section] = methods[i].split('_');
|
||||
|
||||
sectionMap[section] = true;
|
||||
}
|
||||
|
||||
// convert the actual section names into an easy name lookup
|
||||
const sections = Object.keys(sectionMap);
|
||||
|
||||
for (let i = 0; i < sections.length; i++) {
|
||||
const nameA = stringUpperFirst(sections[i]);
|
||||
const nameB = `${nameA}Api`;
|
||||
|
||||
this._runtimeMap[blake2AsHex(nameA, 64)] = nameA;
|
||||
this._runtimeMap[blake2AsHex(nameB, 64)] = nameB;
|
||||
}
|
||||
|
||||
// finally we filter the actual methods to expose
|
||||
this._filterRpcMethods(methods);
|
||||
}
|
||||
|
||||
@@ -404,6 +437,151 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
return out as DecoratedRpc<ApiType, RpcInterface>;
|
||||
}
|
||||
|
||||
// add all definition entries
|
||||
protected _addRuntimeDef (result: DefinitionsCall, additional?: DefinitionsCall): void {
|
||||
if (!additional) {
|
||||
return;
|
||||
}
|
||||
|
||||
const entries = Object.entries(additional);
|
||||
|
||||
for (let j = 0; j < entries.length; j++) {
|
||||
const [key, defs] = entries[j];
|
||||
|
||||
if (result[key]) {
|
||||
// we have this one already, step through for new versions or
|
||||
// new methods and add those as applicable
|
||||
for (let k = 0; k < defs.length; k++) {
|
||||
const def = defs[k];
|
||||
const prev = result[key].find(({ version }) => def.version === version);
|
||||
|
||||
if (prev) {
|
||||
// interleave the new methods with the old - last definition wins
|
||||
objectSpread(prev.methods, def.methods);
|
||||
} else {
|
||||
// we don't have this specific version, add it
|
||||
result[key].push(def);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// we don't have this runtime definition, add it as-is
|
||||
result[key] = defs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// extract all runtime definitions
|
||||
protected _getRuntimeDefs (registry: Registry, specName: Text, chain: Text | string = ''): [string, DefinitionsCallEntry[]][] {
|
||||
const result: DefinitionsCall = {};
|
||||
const defValues = Object.values(typeDefinitions);
|
||||
|
||||
// options > chain/spec > built-in, apply in reverse order with
|
||||
// methods overriding previous definitions (or interleave missing)
|
||||
for (let i = 0; i < defValues.length; i++) {
|
||||
this._addRuntimeDef(result, defValues[i].runtime);
|
||||
}
|
||||
|
||||
this._addRuntimeDef(result, getSpecRuntime(registry, chain, specName));
|
||||
this._addRuntimeDef(result, this._options.runtime);
|
||||
|
||||
return Object.entries(result);
|
||||
}
|
||||
|
||||
// pre-metadata decoration
|
||||
protected _decorateCalls<ApiType extends ApiTypes> ({ registry, runtimeVersion: { apis, specName } }: VersionedRegistry<ApiType>, decorateMethod: DecorateMethod<ApiType>, blockHash?: Uint8Array | string | null): QueryableCalls<ApiType> {
|
||||
const result = {} as QueryableCalls<ApiType>;
|
||||
const named: Record<string, Record<string, DefinitionCallNamed>> = {};
|
||||
const hashes: Record<HexString, boolean> = {};
|
||||
const sections = this._getRuntimeDefs(registry, specName, this._runtimeChain);
|
||||
const older: string[] = [];
|
||||
|
||||
for (let i = 0; i < sections.length; i++) {
|
||||
const [_section, secs] = sections[i];
|
||||
const sectionHash = blake2AsHex(_section, 64);
|
||||
const rtApi = apis.find(([a]) => a.eq(sectionHash));
|
||||
|
||||
hashes[sectionHash] = true;
|
||||
|
||||
if (rtApi) {
|
||||
const all = secs.map(({ version }) => version).sort();
|
||||
const sec = secs.find(({ version }) => rtApi[1].eq(version));
|
||||
|
||||
if (sec) {
|
||||
const section = stringCamelCase(_section);
|
||||
const methods = Object.entries(sec.methods);
|
||||
|
||||
if (methods.length) {
|
||||
if (!named[section]) {
|
||||
named[section] = {};
|
||||
}
|
||||
|
||||
for (let m = 0; m < methods.length; m++) {
|
||||
const [_method, def] = methods[m];
|
||||
const method = stringCamelCase(_method);
|
||||
|
||||
named[section][method] = objectSpread({ method, name: `${_section}_${_method}`, section, sectionHash }, def);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
older.push(`${_section}/${rtApi[1].toString()} (${all.join('/')} known)`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// find the runtimes that we don't have hashes for
|
||||
const notFound = apis
|
||||
.map(([a, v]): [HexString, string] => [a.toHex(), v.toString()])
|
||||
.filter(([a]) => !hashes[a])
|
||||
.map(([a, v]) => `${this._runtimeMap[a] || a}/${v}`);
|
||||
|
||||
if (older.length) {
|
||||
l.warn(`Not decorating runtime apis without matching versions: ${older.join(', ')}`);
|
||||
}
|
||||
|
||||
if (notFound.length) {
|
||||
l.warn(`Not decorating unknown runtime apis: ${notFound.join(', ')}`);
|
||||
}
|
||||
|
||||
const stateCall = blockHash
|
||||
? (name: string, bytes: Uint8Array) => this._rpcCore.state.call(name, bytes, blockHash)
|
||||
: (name: string, bytes: Uint8Array) => this._rpcCore.state.call(name, bytes);
|
||||
|
||||
const lazySection = (section: string) =>
|
||||
lazyMethods({}, Object.keys(named[section]), (method: string) =>
|
||||
this._decorateCall(registry, named[section][method], stateCall, decorateMethod)
|
||||
);
|
||||
|
||||
const modules = Object.keys(named);
|
||||
|
||||
for (let i = 0; i < modules.length; i++) {
|
||||
lazyMethod(result, modules[i], lazySection);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected _decorateCall<ApiType extends ApiTypes> (registry: Registry, def: DefinitionCallNamed, stateCall: (method: string, bytes: Uint8Array) => Observable<Codec>, decorateMethod: DecorateMethod<ApiType>): AugmentedCall<ApiType> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const decorated = decorateMethod((...args: unknown[]): Observable<Codec> => {
|
||||
if (args.length !== def.params.length) {
|
||||
throw new Error(`${def.name}:: Expected ${def.params.length} arguments, found ${args.length}`);
|
||||
}
|
||||
|
||||
const bytes = registry.createType('Raw', u8aConcatStrict(
|
||||
args.map((a, i) => registry.createTypeUnsafe(def.params[i].type, [a]).toU8a())
|
||||
));
|
||||
|
||||
return stateCall(def.name, bytes).pipe(
|
||||
map((r) => registry.createTypeUnsafe(def.type, [r]))
|
||||
);
|
||||
});
|
||||
|
||||
(decorated as AugmentedCall<ApiType>).meta = def;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return decorated;
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
@@ -7,9 +7,7 @@ import type { Text } from '@polkadot/types';
|
||||
import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
|
||||
import type { Metadata } from '@polkadot/types/metadata';
|
||||
import type { CallFunction, RegistryError } from '@polkadot/types/types';
|
||||
import type { ApiDecoration, ApiInterfaceRx, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types';
|
||||
|
||||
import { assertReturn } from '@polkadot/util';
|
||||
import type { ApiDecoration, ApiInterfaceRx, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, QueryableCalls, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types';
|
||||
|
||||
import { packageInfo } from '../packageInfo';
|
||||
import { findCall, findError } from './find';
|
||||
@@ -21,10 +19,21 @@ interface PkgJson {
|
||||
}
|
||||
|
||||
function assertResult<T> (value: T | undefined): T {
|
||||
return assertReturn(value, 'Api needs to be initialized before using, listen on \'ready\'');
|
||||
if (value === undefined) {
|
||||
throw new Error("Api interfaces needs to be initialized before using, wait for 'isReady'");
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
export abstract class Getters<ApiType extends ApiTypes> extends Init<ApiType> implements ApiDecoration<ApiType> {
|
||||
/**
|
||||
* @description Runtime call interfaces (currently untyped, only decorated via API options)
|
||||
*/
|
||||
public get call (): QueryableCalls<ApiType> {
|
||||
return assertResult(this._call);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Contains the parameter types (constants) of all modules.
|
||||
*
|
||||
|
||||
@@ -18,6 +18,19 @@ import { SubmittableResult } from './';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
async function calls (api: ApiPromise): Promise<void> {
|
||||
// it allows defaults
|
||||
const testSetId = await api.call.grandpaApi.currentSetId();
|
||||
|
||||
// it allows type overrides (generally shouldn't be used, but available)
|
||||
const testSetIdO = await api.call.grandpaApi.currentSetId<AccountId>();
|
||||
|
||||
// it allows actual params
|
||||
const nonce = await api.call.accountNonceApi.accountNonce('5Test');
|
||||
|
||||
console.log(testSetId.toNumber(), testSetIdO.isAscii, nonce.toNumber());
|
||||
}
|
||||
|
||||
function consts (api: ApiPromise): void {
|
||||
// constants has actual value & metadata
|
||||
console.log(
|
||||
@@ -213,12 +226,15 @@ function types (api: ApiPromise): void {
|
||||
const balance = registry.createType('Balance', 2);
|
||||
const gas = registry.createType('Gas', 2);
|
||||
const compact = registry.createType('Compact<u32>', 2);
|
||||
const f32 = registry.createType('f32');
|
||||
const u32 = registry.createType('u32');
|
||||
const raw = registry.createType('Raw');
|
||||
// const random = registry.createType('RandomType', 2); // This one should deliberately show a TS error
|
||||
|
||||
const gasUnsafe = createTypeUnsafe(registry, 'Gas', [2]);
|
||||
const overriddenUnsafe = createTypeUnsafe<Header>(registry, 'Gas', [2]);
|
||||
|
||||
console.log(balance, gas, compact, gasUnsafe, overriddenUnsafe, api.createType('AccountData'));
|
||||
console.log(balance, gas, compact, gasUnsafe, overriddenUnsafe, u32.toNumber(), f32.toNumber(), api.createType('AccountData'), raw.subarray(0, 10));
|
||||
}
|
||||
|
||||
async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
@@ -287,6 +303,7 @@ async function main (): Promise<void> {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
Promise.all([
|
||||
calls(api),
|
||||
consts(api),
|
||||
derive(api),
|
||||
errors(api),
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index';
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from '@polkadot/api-base/types/calls';
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import type { ApiTypes, DeriveCustom, QueryableStorageMulti } from '@polkadot/api-base/types';
|
||||
import type { ApiInterfaceRx as ApiInterfaceBase } from '@polkadot/api-base/types/api';
|
||||
import type { QueryableCalls } from '@polkadot/api-base/types/calls';
|
||||
import type { QueryableConsts } from '@polkadot/api-base/types/consts';
|
||||
import type { DecoratedErrors } from '@polkadot/api-base/types/errors';
|
||||
import type { DecoratedEvents } from '@polkadot/api-base/types/events';
|
||||
@@ -10,7 +11,7 @@ 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, RuntimeVersionPartial } from '@polkadot/types/interfaces';
|
||||
import type { CallFunction, DefinitionRpc, DefinitionRpcSub, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@polkadot/types/types';
|
||||
import type { CallFunction, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@polkadot/types/types';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { ApiBase } from '../base';
|
||||
@@ -18,6 +19,7 @@ import type { SubmittableExtrinsic } from '../types/submittable';
|
||||
import type { AllDerives } from '../util/decorate';
|
||||
|
||||
export * from '@polkadot/api-base/types';
|
||||
export * from '@polkadot/api/types/calls';
|
||||
export * from '@polkadot/api/types/consts';
|
||||
export * from '@polkadot/api/types/errors';
|
||||
export * from '@polkadot/api/types/events';
|
||||
@@ -60,6 +62,10 @@ export interface ApiOptions extends RegisteredTypes {
|
||||
* @description User-defined RPC methods
|
||||
*/
|
||||
rpc?: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>;
|
||||
/**
|
||||
* @description Overrides for state_call usage (this will be removed in some future version)
|
||||
*/
|
||||
runtime?: DefinitionsCall;
|
||||
/**
|
||||
* @description Any chain-specific signed extensions that are now well-known
|
||||
*/
|
||||
@@ -90,6 +96,7 @@ export interface SignerOptions extends SignatureOptions {
|
||||
}
|
||||
|
||||
export interface ApiDecoration<ApiType extends ApiTypes> {
|
||||
call: QueryableCalls<ApiType>;
|
||||
consts: QueryableConsts<ApiType>;
|
||||
errors: DecoratedErrors<ApiType>;
|
||||
events: DecoratedEvents<ApiType>;
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/rpc-core": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1"
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/rpc-core": "8.11.1",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/types-codec": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { AugmentedRpc } from '@polkadot/rpc-core/types';
|
||||
import type { Metadata, StorageKey } from '@polkadot/types';
|
||||
import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u32, u64 } from '@polkadot/types-codec';
|
||||
import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u32, u64 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, Codec } from '@polkadot/types-codec/types';
|
||||
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
|
||||
import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
|
||||
@@ -14,7 +14,7 @@ import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';
|
||||
import type { BlockStats } from '@polkadot/types/interfaces/dev';
|
||||
import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
|
||||
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
|
||||
import type { EthAccount, EthCallRequest, EthFeeHistory, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
|
||||
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';
|
||||
import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';
|
||||
@@ -56,11 +56,11 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
|
||||
/**
|
||||
* Submit and subscribe to watch an extrinsic until unsubscribed
|
||||
**/
|
||||
submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable<ExtrinsicStatus>>;
|
||||
submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<ExtrinsicStatus>>;
|
||||
/**
|
||||
* Submit a fully formatted extrinsic for block inclusion
|
||||
**/
|
||||
submitExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable<Hash>>;
|
||||
submitExtrinsic: AugmentedRpc<(extrinsic: Extrinsic | IExtrinsic | string | Uint8Array) => Observable<Hash>>;
|
||||
};
|
||||
babe: {
|
||||
/**
|
||||
@@ -197,6 +197,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
|
||||
* Estimate gas needed for execution of given contract.
|
||||
**/
|
||||
estimateGas: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
|
||||
/**
|
||||
* Returns fee history for given block count & reward percentiles
|
||||
**/
|
||||
feeHistory: AugmentedRpc<(blockCount: U256 | AnyNumber | Uint8Array, newestBlock: BlockNumber | AnyNumber | Uint8Array, rewardPercentiles: Option<Vec<f64>> | null | object | string | Uint8Array) => Observable<EthFeeHistory>>;
|
||||
/**
|
||||
* Returns current gas price.
|
||||
**/
|
||||
@@ -289,6 +293,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
|
||||
* Returns the number of hashes per second that the node is mining with.
|
||||
**/
|
||||
hashrate: AugmentedRpc<() => Observable<U256>>;
|
||||
/**
|
||||
* Returns max priority fee per gas
|
||||
**/
|
||||
maxPriorityFeePerGas: AugmentedRpc<() => Observable<U256>>;
|
||||
/**
|
||||
* Returns true if client is actively mining new blocks.
|
||||
**/
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-augment authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index';
|
||||
@@ -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.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/rpc-augment": "8.8.2",
|
||||
"@polkadot/rpc-provider": "8.8.2",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/rpc-augment": "8.11.1",
|
||||
"@polkadot/rpc-provider": "8.11.1",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^9.4.1",
|
||||
"@polkadot/rpc-augment": "8.8.2"
|
||||
"@polkadot/keyring": "^9.7.1",
|
||||
"@polkadot/rpc-augment": "8.11.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { RpcInterfaceMethod } from './types';
|
||||
import { Observable, publishReplay, refCount } from 'rxjs';
|
||||
|
||||
import { rpcDefinitions } from '@polkadot/types';
|
||||
import { assert, hexToU8a, isFunction, isNull, isUndefined, lazyMethod, logger, memoize, objectSpread, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
import { hexToU8a, isFunction, isNull, isUndefined, lazyMethod, logger, memoize, objectSpread, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { drr, refCountDelay } from './util';
|
||||
|
||||
@@ -106,7 +106,9 @@ export class RpcCore {
|
||||
*/
|
||||
constructor (instanceId: string, registry: Registry, provider: ProviderInterface, userRpc: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>> = {}) {
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
assert(provider && isFunction(provider.send), 'Expected Provider to API create');
|
||||
if (!provider || !isFunction(provider.send)) {
|
||||
throw new Error('Expected Provider to API create');
|
||||
}
|
||||
|
||||
this.#instanceId = instanceId;
|
||||
this.#registryDefault = registry;
|
||||
@@ -360,7 +362,9 @@ export class RpcCore {
|
||||
? ''
|
||||
: ` (${def.params.length - reqArgCount} optional)`;
|
||||
|
||||
assert(inputs.length >= reqArgCount && inputs.length <= def.params.length, () => `Expected ${def.params.length} parameters${optText}, ${inputs.length} found instead`);
|
||||
if (inputs.length < reqArgCount || inputs.length > def.params.length) {
|
||||
throw new Error(`Expected ${def.params.length} parameters${optText}, ${inputs.length} found instead`);
|
||||
}
|
||||
|
||||
return inputs.map((input, index): Codec =>
|
||||
registry.createTypeUnsafe(def.params[index].type, [input], { blockHash })
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index';
|
||||
@@ -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.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
@@ -20,21 +20,21 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/keyring": "^9.4.1",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-support": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1",
|
||||
"@polkadot/util-crypto": "^9.4.1",
|
||||
"@polkadot/x-fetch": "^9.4.1",
|
||||
"@polkadot/x-global": "^9.4.1",
|
||||
"@polkadot/x-ws": "^9.4.1",
|
||||
"@substrate/connect": "0.7.5",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/keyring": "^9.7.1",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/types-support": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1",
|
||||
"@polkadot/util-crypto": "^9.7.1",
|
||||
"@polkadot/x-fetch": "^9.7.1",
|
||||
"@polkadot/x-global": "^9.7.1",
|
||||
"@polkadot/x-ws": "^9.7.1",
|
||||
"@substrate/connect": "0.7.7",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"mock-socket": "^9.1.5",
|
||||
"nock": "^13.2.6"
|
||||
"nock": "^13.2.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '../types';
|
||||
|
||||
import { assert, isNumber, isString, isUndefined, stringify } from '@polkadot/util';
|
||||
import { isNumber, isString, isUndefined, stringify } from '@polkadot/util';
|
||||
|
||||
import RpcError from './error';
|
||||
|
||||
@@ -36,15 +36,29 @@ export class RpcCoder {
|
||||
#id = 0;
|
||||
|
||||
public decodeResponse (response?: JsonRpcResponse): unknown {
|
||||
assert(response && response.jsonrpc === '2.0', 'Invalid jsonrpc field in decoded object');
|
||||
if (!response || response.jsonrpc !== '2.0') {
|
||||
throw new Error('Invalid jsonrpc field in decoded object');
|
||||
}
|
||||
|
||||
const isSubscription = !isUndefined(response.params) && !isUndefined(response.method);
|
||||
|
||||
assert(isNumber(response.id) || (isSubscription && (isNumber(response.params.subscription) || isString(response.params.subscription))), 'Invalid id field in decoded object');
|
||||
if (
|
||||
!isNumber(response.id) &&
|
||||
(
|
||||
!isSubscription || (
|
||||
!isNumber(response.params.subscription) &&
|
||||
!isString(response.params.subscription)
|
||||
)
|
||||
)
|
||||
) {
|
||||
throw new Error('Invalid id field in decoded object');
|
||||
}
|
||||
|
||||
checkError(response.error);
|
||||
|
||||
assert(!isUndefined(response.result) || isSubscription, 'No result found in jsonrpc response');
|
||||
if (response.result === undefined && !isSubscription) {
|
||||
throw new Error('No result found in jsonrpc response');
|
||||
}
|
||||
|
||||
if (isSubscription) {
|
||||
checkError(response.params.error);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types';
|
||||
|
||||
import { assert, logger } from '@polkadot/util';
|
||||
import { logger } from '@polkadot/util';
|
||||
import { fetch } from '@polkadot/x-fetch';
|
||||
|
||||
import { RpcCoder } from '../coder';
|
||||
@@ -49,7 +49,9 @@ export class HttpProvider implements ProviderInterface {
|
||||
* @param {string} endpoint The endpoint url starting with http://
|
||||
*/
|
||||
constructor (endpoint: string = defaults.HTTP_URL, headers: Record<string, string> = {}) {
|
||||
assert(/^(https|http):\/\//.test(endpoint), () => `Endpoint should start with 'http://', received '${endpoint}'`);
|
||||
if (!/^(https|http):\/\//.test(endpoint)) {
|
||||
throw new Error(`Endpoint should start with 'http://' or 'https://', received '${endpoint}'`);
|
||||
}
|
||||
|
||||
this.#coder = new RpcCoder();
|
||||
this.#endpoint = endpoint;
|
||||
@@ -156,7 +158,9 @@ export class HttpProvider implements ProviderInterface {
|
||||
method: 'POST'
|
||||
});
|
||||
|
||||
assert(response.ok, () => `[${response.status}]: ${response.statusText}`);
|
||||
if (!response.ok) {
|
||||
throw new Error(`[${response.status}]: ${response.statusText}`);
|
||||
}
|
||||
|
||||
const result = await response.text();
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import jsonrpc from '@polkadot/types/interfaces/jsonrpc';
|
||||
import rpcHeader from '@polkadot/types-support/json/Header.004.json';
|
||||
import rpcSignedBlock from '@polkadot/types-support/json/SignedBlock.004.immortal.json';
|
||||
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
|
||||
import { assert, BN, bnToU8a, logger, u8aToHex } from '@polkadot/util';
|
||||
import { BN, bnToU8a, logger, u8aToHex } from '@polkadot/util';
|
||||
import { randomAsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
const INTERVAL = 1000;
|
||||
@@ -130,7 +130,9 @@ export class MockProvider implements ProviderInterface {
|
||||
public async send <T = any> (method: string, params: unknown[]): Promise<T> {
|
||||
l.debug(() => ['send', method, params]);
|
||||
|
||||
assert(this.requests[method], () => `provider.send: Invalid method '${method}'`);
|
||||
if (!this.requests[method]) {
|
||||
throw new Error(`provider.send: Invalid method '${method}'`);
|
||||
}
|
||||
|
||||
return this.requests[method](this.db, params) as T;
|
||||
}
|
||||
@@ -139,7 +141,9 @@ export class MockProvider implements ProviderInterface {
|
||||
public async subscribe (type: string, method: string, ...params: unknown[]): Promise<number> {
|
||||
l.debug(() => ['subscribe', method, params]);
|
||||
|
||||
assert(this.subscriptions[method], () => `provider.subscribe: Invalid method '${method}'`);
|
||||
if (!this.subscriptions[method]) {
|
||||
throw new Error(`provider.subscribe: Invalid method '${method}'`);
|
||||
}
|
||||
|
||||
const callback = params.pop() as MockStateSubscriptionCallback;
|
||||
const id = ++this.subscriptionId;
|
||||
@@ -160,7 +164,9 @@ export class MockProvider implements ProviderInterface {
|
||||
|
||||
l.debug(() => ['unsubscribe', id, sub]);
|
||||
|
||||
assert(sub, () => `Unable to find subscription for ${id}`);
|
||||
if (!sub) {
|
||||
throw new Error(`Unable to find subscription for ${id}`);
|
||||
}
|
||||
|
||||
delete this.subscriptionMap[id];
|
||||
delete this.subscriptions[sub].callbacks[id];
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index';
|
||||
@@ -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.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { assert } from '@polkadot/util';
|
||||
|
||||
export interface SmoldotHealth {
|
||||
isSyncing: boolean
|
||||
peers: number
|
||||
@@ -63,10 +61,9 @@ export function healthChecker (): HealthChecker {
|
||||
return checker.responsePassThrough(jsonRpcResponse);
|
||||
},
|
||||
sendJsonRpc: (request) => {
|
||||
assert(
|
||||
sendJsonRpc,
|
||||
'setSendJsonRpc must be called before sending requests'
|
||||
);
|
||||
if (!sendJsonRpc) {
|
||||
throw new Error('setSendJsonRpc must be called before sending requests');
|
||||
}
|
||||
|
||||
if (checker === null) {
|
||||
sendJsonRpc(request);
|
||||
@@ -78,14 +75,12 @@ export function healthChecker (): HealthChecker {
|
||||
sendJsonRpc = cb;
|
||||
},
|
||||
start: (healthCallback) => {
|
||||
assert(
|
||||
checker === null,
|
||||
"Can't start the health checker multiple times in parallel"
|
||||
);
|
||||
assert(
|
||||
sendJsonRpc,
|
||||
'setSendJsonRpc must be called before starting the health checks'
|
||||
);
|
||||
if (checker !== null) {
|
||||
throw new Error("Can't start the health checker multiple times in parallel");
|
||||
} else if (!sendJsonRpc) {
|
||||
throw new Error('setSendJsonRpc must be called before starting the health checks');
|
||||
}
|
||||
|
||||
checker = new InnerChecker(healthCallback, sendJsonRpc);
|
||||
checker.update(true);
|
||||
},
|
||||
@@ -216,7 +211,9 @@ class InnerChecker {
|
||||
const id: string = parsedResponse.id;
|
||||
|
||||
// Need to remove the `extern:` prefix.
|
||||
assert(id.startsWith('extern:'), 'State inconsistency in health checker');
|
||||
if (!id.startsWith('extern:')) {
|
||||
throw new Error('State inconsistency in health checker');
|
||||
}
|
||||
|
||||
const newId = JSON.parse(id.slice('extern:'.length)) as string;
|
||||
|
||||
@@ -283,10 +280,9 @@ class InnerChecker {
|
||||
};
|
||||
|
||||
startSubscription = (): void => {
|
||||
assert(
|
||||
!this.#currentSubunsubRequestId && !this.#currentSubscriptionId,
|
||||
'Internal error in health checker'
|
||||
);
|
||||
if (this.#currentSubunsubRequestId || this.#currentSubscriptionId) {
|
||||
throw new Error('Internal error in health checker');
|
||||
}
|
||||
|
||||
this.#currentSubunsubRequestId = 'health-checker:'.concat(
|
||||
this.#nextRequestId.toString()
|
||||
@@ -303,10 +299,9 @@ class InnerChecker {
|
||||
};
|
||||
|
||||
endSubscription = (): void => {
|
||||
assert(
|
||||
!this.#currentSubunsubRequestId && this.#currentSubscriptionId,
|
||||
'Internal error in health checker'
|
||||
);
|
||||
if (this.#currentSubunsubRequestId || !this.#currentSubscriptionId) {
|
||||
throw new Error('Internal error in health checker');
|
||||
}
|
||||
|
||||
this.#currentSubunsubRequestId = 'health-checker:'.concat(
|
||||
this.#nextRequestId.toString()
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, Pro
|
||||
import { Chain, createScClient, ScClient, WellKnownChain } from '@substrate/connect';
|
||||
import EventEmitter from 'eventemitter3';
|
||||
|
||||
import { assert, isError } from '@polkadot/util';
|
||||
import { isError } from '@polkadot/util';
|
||||
|
||||
import { RpcCoder } from '../coder';
|
||||
import { healthChecker } from './Health';
|
||||
@@ -71,7 +71,9 @@ export class ScProvider implements ProviderInterface {
|
||||
// Config details can be found in @substrate/connect repo following the link:
|
||||
// https://github.com/paritytech/substrate-connect/blob/main/packages/connect/src/connector/index.ts
|
||||
async connect (config?: ScConfig): Promise<void> {
|
||||
assert(!this.isConnected, 'Already connected!');
|
||||
if (this.isConnected) {
|
||||
throw new Error('Already connected!');
|
||||
}
|
||||
|
||||
// it could happen that after emitting `disconnected` due to the fact taht
|
||||
// smoldot is syncing, the consumer tries to reconnect after a certain amount
|
||||
@@ -91,7 +93,10 @@ export class ScProvider implements ProviderInterface {
|
||||
? scClients.get(this.#sharedSandbox)
|
||||
: createScClient(config);
|
||||
|
||||
assert(client, 'Unkown ScProvider!');
|
||||
if (!client) {
|
||||
throw new Error('Unkown ScProvider!');
|
||||
}
|
||||
|
||||
scClients.set(this, client);
|
||||
|
||||
const hc = healthChecker();
|
||||
@@ -156,7 +161,9 @@ export class ScProvider implements ProviderInterface {
|
||||
|
||||
const stale = staleSubscriptions.pop();
|
||||
|
||||
assert(stale, 'Unable to get stale subscription');
|
||||
if (!stale) {
|
||||
throw new Error('Unable to get stale subscription');
|
||||
}
|
||||
|
||||
const { id, unsubscribeMethod } = stale;
|
||||
|
||||
@@ -264,7 +271,9 @@ export class ScProvider implements ProviderInterface {
|
||||
}
|
||||
|
||||
public async send<T = any> (method: string, params: unknown[]): Promise<T> {
|
||||
assert(this.isConnected && this.#chain, 'Provider is not connected');
|
||||
if (!this.isConnected || !this.#chain) {
|
||||
throw new Error('Provider is not connected');
|
||||
}
|
||||
|
||||
const chain = await this.#chain;
|
||||
const [id, json] = this.#coder.encodeJson(method, params);
|
||||
@@ -302,10 +311,9 @@ export class ScProvider implements ProviderInterface {
|
||||
params: any[],
|
||||
callback: ProviderInterfaceCallback
|
||||
): Promise<number | string> {
|
||||
assert(
|
||||
subscriptionUnsubscriptionMethods.has(method),
|
||||
`Unsupported subscribe method: ${method}`
|
||||
);
|
||||
if (!subscriptionUnsubscriptionMethods.has(method)) {
|
||||
throw new Error(`Unsupported subscribe method: ${method}`);
|
||||
}
|
||||
|
||||
const id = await this.send<number | string>(method, params);
|
||||
const subscriptionId = `${type}::${id}`;
|
||||
@@ -320,7 +328,9 @@ export class ScProvider implements ProviderInterface {
|
||||
|
||||
const unsubscribeMethod = subscriptionUnsubscriptionMethods.get(method);
|
||||
|
||||
assert(unsubscribeMethod, 'Invalid unsubscribe method found');
|
||||
if (!unsubscribeMethod) {
|
||||
throw new Error('Invalid unsubscribe method found');
|
||||
}
|
||||
|
||||
this.#subscriptions.set(subscriptionId, [cb, { id, unsubscribeMethod }]);
|
||||
|
||||
@@ -332,10 +342,9 @@ export class ScProvider implements ProviderInterface {
|
||||
method: string,
|
||||
id: number | string
|
||||
): Promise<boolean> {
|
||||
assert(
|
||||
this.isConnected,
|
||||
'Provider is not connected'
|
||||
);
|
||||
if (!this.isConnected) {
|
||||
throw new Error('Provider is not connected');
|
||||
}
|
||||
|
||||
const subscriptionId = `${type}::${id}`;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, Pro
|
||||
|
||||
import EventEmitter from 'eventemitter3';
|
||||
|
||||
import { assert, isChildClass, isNull, isUndefined, logger, objectSpread } from '@polkadot/util';
|
||||
import { isChildClass, isNull, isUndefined, logger, objectSpread } from '@polkadot/util';
|
||||
import { xglobal } from '@polkadot/x-global';
|
||||
import { WebSocket } from '@polkadot/x-ws';
|
||||
|
||||
@@ -122,10 +122,14 @@ export class WsProvider implements ProviderInterface {
|
||||
? endpoint
|
||||
: [endpoint];
|
||||
|
||||
assert(endpoints.length !== 0, 'WsProvider requires at least one Endpoint');
|
||||
if (endpoints.length === 0) {
|
||||
throw new Error('WsProvider requires at least one Endpoint');
|
||||
}
|
||||
|
||||
endpoints.forEach((endpoint) => {
|
||||
assert(/^(wss|ws):\/\//.test(endpoint), () => `Endpoint should start with 'ws://', received '${endpoint}'`);
|
||||
if (!/^(wss|ws):\/\//.test(endpoint)) {
|
||||
throw new Error(`Endpoint should start with 'ws://', received '${endpoint}'`);
|
||||
}
|
||||
});
|
||||
|
||||
this.#eventemitter = new EventEmitter();
|
||||
@@ -319,7 +323,9 @@ export class WsProvider implements ProviderInterface {
|
||||
async #send <T> (id: number, body: string, method: string, params: unknown[], subscription?: SubscriptionHandler): Promise<T> {
|
||||
return new Promise<T>((resolve, reject): void => {
|
||||
try {
|
||||
assert(this.isConnected && !isNull(this.#websocket), 'WebSocket is not connected');
|
||||
if (!this.isConnected || this.#websocket === null) {
|
||||
throw new Error('WebSocket is not connected');
|
||||
}
|
||||
|
||||
const callback = (error?: Error | null, result?: T): void => {
|
||||
error
|
||||
@@ -531,7 +537,9 @@ export class WsProvider implements ProviderInterface {
|
||||
};
|
||||
|
||||
#onSocketOpen = (): boolean => {
|
||||
assert(!isNull(this.#websocket), 'WebSocket cannot be null in onOpen');
|
||||
if (this.#websocket === null) {
|
||||
throw new Error('WebSocket cannot be null in onOpen');
|
||||
}
|
||||
|
||||
l.debug(() => ['connected to', this.#endpoints[this.#endpointIndex]]);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
@@ -30,20 +30,21 @@
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.18.5",
|
||||
"@babel/register": "^7.17.7",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@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",
|
||||
"@babel/core": "^7.18.6",
|
||||
"@babel/register": "^7.18.6",
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/api": "8.11.1",
|
||||
"@polkadot/api-augment": "8.11.1",
|
||||
"@polkadot/rpc-augment": "8.11.1",
|
||||
"@polkadot/rpc-provider": "8.11.1",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/types-augment": "8.11.1",
|
||||
"@polkadot/types-codec": "8.11.1",
|
||||
"@polkadot/types-create": "8.11.1",
|
||||
"@polkadot/types-support": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1",
|
||||
"@polkadot/util-crypto": "^9.7.1",
|
||||
"@polkadot/x-ws": "^9.7.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
"yargs": "^17.5.1"
|
||||
|
||||
@@ -9,10 +9,12 @@ import yargs from 'yargs';
|
||||
import { Definitions } from '@polkadot/types/types';
|
||||
import { formatNumber } from '@polkadot/util';
|
||||
|
||||
import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultTx } from './generate';
|
||||
import { generateDefaultCalls, generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultTx } from './generate';
|
||||
import { assertDir, assertFile, getMetadataViaWs, HEADER, writeFile } from './util';
|
||||
|
||||
function generate (metaHex: HexString, pkg: string | undefined, output: string, isStrict?: boolean): void {
|
||||
type Version = { apis: [HexString, number][] };
|
||||
|
||||
function generate (metaHex: HexString, version: Version | null, pkg: string | undefined, output: string, isStrict?: boolean): void {
|
||||
console.log(`Generating from metadata, ${formatNumber((metaHex.length - 2) / 2)} bytes`);
|
||||
|
||||
const outputPath = assertDir(path.join(process.cwd(), output));
|
||||
@@ -46,12 +48,15 @@ function generate (metaHex: HexString, pkg: string | undefined, output: string,
|
||||
generateDefaultQuery(path.join(outputPath, 'augment-api-query.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultRpc(path.join(outputPath, 'augment-api-rpc.ts'), extraTypes);
|
||||
generateDefaultTx(path.join(outputPath, 'augment-api-tx.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions);
|
||||
generateDefaultCalls(path.join(outputPath, 'augment-api-runtime.ts'), metaHex, version, extraTypes, isStrict, customLookupDefinitions);
|
||||
|
||||
writeFile(path.join(outputPath, 'augment-api.ts'), (): string =>
|
||||
[
|
||||
HEADER('chain'),
|
||||
...[
|
||||
...['consts', 'errors', 'events', 'query', 'tx', 'rpc'].filter((key) => !!key).map((key) => `./augment-api-${key}`)
|
||||
...['consts', 'errors', 'events', 'query', 'tx', 'rpc', 'runtime']
|
||||
.filter((key) => !!key)
|
||||
.map((key) => `./augment-api-${key}`)
|
||||
].map((path) => `import '${path}';\n`)
|
||||
].join('')
|
||||
);
|
||||
@@ -59,10 +64,10 @@ function generate (metaHex: HexString, pkg: string | undefined, output: string,
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
type ArgV = { endpoint: string; output: string; package?: string; strict?: boolean };
|
||||
type ArgV = { endpoint: string; output: string; package?: string; strict?: boolean, version?: string };
|
||||
|
||||
export function main (): void {
|
||||
const { endpoint, output, package: pkg, strict: isStrict } = yargs.strict().options({
|
||||
const { endpoint, output, package: pkg, strict: isStrict, version } = yargs.strict().options({
|
||||
endpoint: {
|
||||
description: 'The endpoint to connect to (e.g. wss://kusama-rpc.polkadot.io) or relative path to a file containing the JSON output of an RPC state_getMetadata call',
|
||||
required: true,
|
||||
@@ -80,15 +85,28 @@ export function main (): void {
|
||||
strict: {
|
||||
description: 'Turns on strict mode, no output of catch-all generic versions',
|
||||
type: 'boolean'
|
||||
},
|
||||
version: {
|
||||
description: 'Pass through a version JSON (if endpoint is non-wss)',
|
||||
type: 'string'
|
||||
}
|
||||
}).argv as ArgV;
|
||||
|
||||
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
|
||||
getMetadataViaWs(endpoint)
|
||||
.then((metadata) => generate(metadata, pkg, output, isStrict))
|
||||
.then(({ metadata, version }) => generate(metadata, version, pkg, output, isStrict))
|
||||
.catch(() => process.exit(1));
|
||||
} else {
|
||||
let rtv: Version | null = null;
|
||||
|
||||
if (version) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
rtv = (require(assertFile(path.join(process.cwd(), version))) as Record<string, Version>).result;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
generate((require(assertFile(path.join(process.cwd(), endpoint))) as Record<string, HexString>).result, pkg, output, isStrict);
|
||||
const metadata = (require(assertFile(path.join(process.cwd(), endpoint))) as Record<string, HexString>).result;
|
||||
|
||||
generate(metadata, rtv, pkg, output, isStrict);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ export function main (): void {
|
||||
if (endpoint) {
|
||||
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
|
||||
getMetadataViaWs(endpoint)
|
||||
.then((metadata) => generateDefaultLookup(inputPath, metadata))
|
||||
.then(({ metadata }) => generateDefaultLookup(inputPath, metadata))
|
||||
.catch(() => process.exit(1));
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
|
||||
@@ -8,5 +8,6 @@ export { generateDefaultInterface } from './interfaceRegistry';
|
||||
export { generateDefaultLookup } from './lookup';
|
||||
export { generateDefaultQuery } from './query';
|
||||
export { generateDefaultRpc } from './rpc';
|
||||
export { generateDefaultCalls } from './runtime';
|
||||
export { generateDefaultTsDef } from './tsDef';
|
||||
export { generateDefaultTx } from './tx';
|
||||
|
||||
@@ -30,7 +30,7 @@ const StorageKeyType = 'StorageKey | string | Uint8Array | any';
|
||||
const generateRpcTypesTemplate = Handlebars.compile(readTemplate('rpc'));
|
||||
|
||||
/** @internal */
|
||||
export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Record<string, Definitions>, dest: string, extraTypes: ExtraTypes = {}): void {
|
||||
export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Record<string, Definitions>, dest: string, extraTypes: ExtraTypes): void {
|
||||
writeFile(dest, (): string => {
|
||||
const allTypes: ExtraTypes = { '@polkadot/types/interfaces': importDefinitions, ...extraTypes };
|
||||
const imports = createImports(allTypes);
|
||||
@@ -46,7 +46,7 @@ export function generateRpcTypes (registry: TypeRegistry, importDefinitions: Rec
|
||||
|
||||
const additional: Record<string, ModuleDef> = {};
|
||||
const modules = rpcKeys.map((sectionFullName) => {
|
||||
const rpc = definitions[sectionFullName].rpc;
|
||||
const rpc = definitions[sectionFullName].rpc || {};
|
||||
const section = sectionFullName.split('/').pop();
|
||||
|
||||
const allMethods = Object.keys(rpc).sort().map((methodName) => {
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
// Copyright 2017-2022 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { TypeRegistry } from '@polkadot/types/create';
|
||||
import type { DefinitionCallNamed, Definitions } from '@polkadot/types/types';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { ExtraTypes } from './types';
|
||||
|
||||
import Handlebars from 'handlebars';
|
||||
|
||||
import * as defaultDefs from '@polkadot/types/interfaces/definitions';
|
||||
import lookupDefinitions from '@polkadot/types-augment/lookup/definitions';
|
||||
import { objectSpread, stringCamelCase } from '@polkadot/util';
|
||||
import { blake2AsHex } from '@polkadot/util-crypto';
|
||||
|
||||
import { createImports, formatType, getSimilarTypes, initMeta, readTemplate, setImports, writeFile } from '../util';
|
||||
|
||||
type Apis = [HexString, number][];
|
||||
|
||||
const generateCallsTypesTemplate = Handlebars.compile(readTemplate('calls'));
|
||||
|
||||
/** @internal */
|
||||
function getDefs (apis: Apis | null, defs: Record<string, Definitions>): Record<string, Record<string, DefinitionCallNamed>> {
|
||||
const named: Record<string, Record<string, DefinitionCallNamed>> = {};
|
||||
const all = Object.values(defs);
|
||||
|
||||
for (let j = 0; j < all.length; j++) {
|
||||
const set = all[j].runtime;
|
||||
|
||||
if (set) {
|
||||
const sections = Object.entries(set);
|
||||
|
||||
for (let i = 0; i < sections.length; i++) {
|
||||
const [_section, sec] = sections[i];
|
||||
const sectionHash = blake2AsHex(_section, 64);
|
||||
const api = apis && apis.find(([h]) => h === sectionHash);
|
||||
|
||||
if (api) {
|
||||
const ver = sec.find(({ version }) => version === api[1]);
|
||||
|
||||
if (ver) {
|
||||
const methods = Object.entries(ver.methods);
|
||||
|
||||
if (methods.length) {
|
||||
const section = stringCamelCase(_section);
|
||||
|
||||
if (!named[section]) {
|
||||
named[section] = {};
|
||||
}
|
||||
|
||||
for (let m = 0; m < methods.length; m++) {
|
||||
const [_method, def] = methods[m];
|
||||
const method = stringCamelCase(_method);
|
||||
|
||||
named[section][method] = objectSpread({ method, name: `${_section}_${method}`, section, sectionHash, version: ver.version }, def);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.warn(`Unable to find matching version for runtime ${_section}, expected ${api[1]}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return named;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export function generateCallTypes (registry: TypeRegistry, dest: string, apis: Apis | null, extraTypes: ExtraTypes, isStrict: boolean, customLookupDefinitions?: Definitions): void {
|
||||
writeFile(dest, (): string => {
|
||||
const allTypes: ExtraTypes = {
|
||||
'@polkadot/types-augment': {
|
||||
lookup: {
|
||||
...lookupDefinitions,
|
||||
...customLookupDefinitions
|
||||
}
|
||||
},
|
||||
'@polkadot/types/interfaces': defaultDefs,
|
||||
...extraTypes
|
||||
};
|
||||
const imports = createImports(allTypes);
|
||||
const allDefs = Object.entries(allTypes).reduce((defs, [path, obj]) => {
|
||||
return Object.entries(obj).reduce((defs, [key, value]) => ({ ...defs, [`${path}/${key}`]: value }), defs);
|
||||
}, {});
|
||||
const definitions = getDefs(apis, imports.definitions as Record<string, Definitions>);
|
||||
const callKeys = Object.keys(definitions);
|
||||
|
||||
const modules = callKeys.map((section) => {
|
||||
const calls = definitions[section];
|
||||
|
||||
const allMethods = Object.keys(calls).sort().map((methodName) => {
|
||||
const def = calls[methodName];
|
||||
|
||||
setImports(allDefs, imports, [def.type]);
|
||||
|
||||
const args = def.params.map((param) => {
|
||||
const similarTypes = getSimilarTypes(registry, imports.definitions, param.type, imports);
|
||||
|
||||
setImports(allDefs, imports, [param.type, ...similarTypes]);
|
||||
|
||||
return `${param.name}: ${similarTypes.join(' | ')}`;
|
||||
});
|
||||
|
||||
return {
|
||||
args: args.join(', '),
|
||||
docs: [def.description],
|
||||
name: methodName,
|
||||
sectionHash: def.sectionHash,
|
||||
sectionName: def.section,
|
||||
sectionVersion: def.version,
|
||||
type: formatType(registry, allDefs, def.type, imports)
|
||||
};
|
||||
}).sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
return {
|
||||
items: allMethods,
|
||||
name: section || 'unknown',
|
||||
sectionHash: allMethods.length && allMethods[0].sectionHash,
|
||||
sectionName: allMethods.length && allMethods[0].sectionName,
|
||||
sectionVersion: allMethods.length && allMethods[0].sectionVersion
|
||||
};
|
||||
}).filter(({ items }) => items.length).sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
if (modules.length) {
|
||||
imports.typesTypes.Observable = true;
|
||||
}
|
||||
|
||||
return generateCallsTypesTemplate({
|
||||
headerType: 'chain',
|
||||
imports,
|
||||
isStrict,
|
||||
modules,
|
||||
types: [
|
||||
...Object.keys(imports.localTypes).sort().map((packagePath): { file: string; types: string[] } => ({
|
||||
file: packagePath.replace('@polkadot/types-augment', '@polkadot/types'),
|
||||
types: Object.keys(imports.localTypes[packagePath])
|
||||
})),
|
||||
{
|
||||
file: '@polkadot/api-base/types',
|
||||
types: ['ApiTypes']
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function generateDefaultCalls (dest: string, data: HexString, rtVersion: { apis: Apis } | null = null, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void {
|
||||
const { registry } = initMeta(data, extraTypes);
|
||||
|
||||
generateCallTypes(
|
||||
registry,
|
||||
dest,
|
||||
rtVersion && rtVersion.apis,
|
||||
extraTypes,
|
||||
isStrict,
|
||||
customLookupDefinitions
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/typegen authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export type ExtraTypes = Record<string, Record<string, { types: Record<string, any> }>>;
|
||||
export type ExtraTypes = Record<string, Record<string, { runtime?: Record<string, any>, types: Record<string, any> }>>;
|
||||
|
||||
@@ -6,11 +6,15 @@ import type { HexString } from '@polkadot/util/types';
|
||||
import kusama from '@polkadot/types-support/metadata/static-kusama';
|
||||
import polkadot from '@polkadot/types-support/metadata/static-polkadot';
|
||||
import substrate from '@polkadot/types-support/metadata/static-substrate';
|
||||
import kusamaVer from '@polkadot/types-support/versions/kusama';
|
||||
import polkadotVer from '@polkadot/types-support/versions/polkadot';
|
||||
import substrateVer from '@polkadot/types-support/versions/substrate';
|
||||
|
||||
import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultTsDef, generateDefaultTx } from './generate';
|
||||
import { generateDefaultCalls, generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultTsDef, generateDefaultTx } from './generate';
|
||||
|
||||
const BASE = 'packages/api-augment/src';
|
||||
const METAS = Object.entries({ kusama, polkadot, substrate }) as [string, HexString][];
|
||||
const VERS = { kusama: kusamaVer, polkadot: polkadotVer, substrate: substrateVer };
|
||||
|
||||
export function main (): void {
|
||||
generateDefaultInterface();
|
||||
@@ -27,5 +31,6 @@ export function main (): void {
|
||||
generateDefaultEvents(`${BASE}/${name}/events.ts`, staticMeta);
|
||||
generateDefaultQuery(`${BASE}/${name}/query.ts`, staticMeta);
|
||||
generateDefaultTx(`${BASE}/${name}/tx.ts`, staticMeta);
|
||||
generateDefaultCalls(`${BASE}/${name}/runtime.ts`, staticMeta, VERS[name as keyof typeof VERS] as unknown as { apis: [HexString, number][] });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,10 +138,10 @@ function addRpc (): string {
|
||||
.reduce((all: Section[], _sectionName): Section[] => {
|
||||
const section = definitions[_sectionName as 'babe'];
|
||||
|
||||
Object.keys(section.rpc)
|
||||
Object.keys(section.rpc || {})
|
||||
.sort()
|
||||
.forEach((methodName) => {
|
||||
const method = section.rpc[methodName];
|
||||
const method = (section.rpc || {})[methodName];
|
||||
const sectionName = method.aliasSection || _sectionName;
|
||||
const topName = method.aliasSection ? `${_sectionName}/${method.aliasSection}` : _sectionName;
|
||||
let container = all.find(({ name }) => name === topName);
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{{> header }}
|
||||
|
||||
{{{ importsAll }}}
|
||||
|
||||
declare module '@polkadot/api-base/types/calls' {
|
||||
export interface AugmentedCalls<ApiType extends ApiTypes> {
|
||||
{{#each modules}}
|
||||
/** {{{sectionHash}}}/{{{sectionVersion}}} */
|
||||
{{{name}}}: {
|
||||
{{#each items}}
|
||||
{{> docs}}
|
||||
{{{name}}}: AugmentedCall<ApiType, ({{{args}}}) => Observable<{{{type}}}>>;
|
||||
{{/each}}
|
||||
{{#unless @root.isStrict}}
|
||||
/**
|
||||
* Generic call
|
||||
**/
|
||||
[key: string]: DecoratedCallBase<ApiType>;
|
||||
{{/unless}}
|
||||
};
|
||||
{{/each}}
|
||||
} // AugmentedCalls
|
||||
} // declare module
|
||||
@@ -31,7 +31,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
|
||||
if (type === 'Extrinsic') {
|
||||
setImports(definitions, imports, ['IExtrinsic']);
|
||||
|
||||
return ['IExtrinsic'];
|
||||
return ['Extrinsic', 'IExtrinsic', 'string', 'Uint8Array'];
|
||||
} else if (type === 'Keys') {
|
||||
// This one is weird... surely it should popup as a Tuple? (but either way better as defined hex)
|
||||
return ['Keys', 'string', 'Uint8Array'];
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { assert } from '@polkadot/util';
|
||||
|
||||
import { packageInfo } from '../packageInfo';
|
||||
|
||||
export function writeFile (dest: string, generator: () => string, noLog?: boolean): void {
|
||||
@@ -35,7 +33,9 @@ export function readTemplate (template: string): string {
|
||||
.map((p) => path.join(rootDir, p, `${template}.hbs`))
|
||||
.find((p) => fs.existsSync(p));
|
||||
|
||||
assert(file, `Unable to locate ${template}.hbs from ${rootDir}`);
|
||||
if (!file) {
|
||||
throw new Error(`Unable to locate ${template}.hbs from ${rootDir}`);
|
||||
}
|
||||
|
||||
return fs.readFileSync(file).toString();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
import type { AnyString, Registry } from '@polkadot/types/types';
|
||||
import type { TypeDef } from '@polkadot/types-create/types';
|
||||
|
||||
import Handlebars from 'handlebars';
|
||||
@@ -270,7 +270,7 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
*/
|
||||
/** @internal */
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export function formatType (registry: Registry, definitions: Record<string, ModuleTypes>, type: string | String | TypeDef, imports: TypeImports, withShortcut = false): string {
|
||||
export function formatType (registry: Registry, definitions: Record<string, ModuleTypes>, type: AnyString | TypeDef, imports: TypeImports, withShortcut = false): string {
|
||||
let typeDef: TypeDef;
|
||||
|
||||
if (isString(type)) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { HexString } from '@polkadot/util/types';
|
||||
|
||||
import { WebSocket } from '@polkadot/x-ws';
|
||||
|
||||
export async function getMetadataViaWs (endpoint: string): Promise<HexString> {
|
||||
async function getWsData <T> (endpoint: string, method: 'state_getMetadata' | 'state_getRuntimeVersion'): Promise<T> {
|
||||
return new Promise((resolve): void => {
|
||||
try {
|
||||
const websocket = new WebSocket(endpoint);
|
||||
@@ -28,11 +28,11 @@ export async function getMetadataViaWs (endpoint: string): Promise<HexString> {
|
||||
|
||||
websocket.onopen = (): void => {
|
||||
console.log('connected');
|
||||
websocket.send('{"id":"1","jsonrpc":"2.0","method":"state_getMetadata","params":[]}');
|
||||
websocket.send(`{"id":"1","jsonrpc":"2.0","method":"${method}","params":[]}`);
|
||||
};
|
||||
|
||||
websocket.onmessage = (message: { data: string }): void => {
|
||||
resolve((JSON.parse(message.data) as { result: HexString }).result);
|
||||
resolve((JSON.parse(message.data) as { result: T }).result);
|
||||
websocket.close();
|
||||
};
|
||||
} catch (error) {
|
||||
@@ -40,3 +40,15 @@ export async function getMetadataViaWs (endpoint: string): Promise<HexString> {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function getMetadataViaWs (endpoint: string): Promise<{ metadata: HexString, version: { apis: [HexString, number][] } }> {
|
||||
return Promise
|
||||
.all([
|
||||
getWsData<HexString>(endpoint, 'state_getMetadata'),
|
||||
getWsData<{ apis: [HexString, number][] }>(endpoint, 'state_getRuntimeVersion')
|
||||
])
|
||||
.then(([metadata, version]) => ({
|
||||
metadata,
|
||||
version
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-codec": "8.8.2",
|
||||
"@polkadot/util": "^9.4.1"
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/types-codec": "8.11.1",
|
||||
"@polkadot/util": "^9.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
export default {
|
||||
/**
|
||||
* Lookup79: kusama_runtime::ProxyType
|
||||
* Lookup80: kusama_runtime::ProxyType
|
||||
**/
|
||||
KusamaRuntimeProxyType: {
|
||||
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction', 'Society']
|
||||
},
|
||||
/**
|
||||
* Lookup258: kusama_runtime::SessionKeys
|
||||
* Lookup261: kusama_runtime::SessionKeys
|
||||
**/
|
||||
KusamaRuntimeSessionKeys: {
|
||||
grandpa: 'SpFinalityGrandpaAppPublic',
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
|
||||
},
|
||||
/**
|
||||
* Lookup332: kusama_runtime::OriginCaller
|
||||
* Lookup335: kusama_runtime::OriginCaller
|
||||
**/
|
||||
KusamaRuntimeOriginCaller: {
|
||||
_enum: {
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup398: kusama_runtime::NposCompactSolution24
|
||||
* Lookup401: kusama_runtime::NposCompactSolution24
|
||||
**/
|
||||
KusamaRuntimeNposCompactSolution24: {
|
||||
votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
|
||||
@@ -158,7 +158,7 @@ export default {
|
||||
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
|
||||
},
|
||||
/**
|
||||
* Lookup774: kusama_runtime::Runtime
|
||||
* Lookup779: kusama_runtime::Runtime
|
||||
**/
|
||||
KusamaRuntimeRuntime: 'Null'
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ declare module '@polkadot/types/lookup' {
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { PerU16 } from '@polkadot/types/interfaces/runtime';
|
||||
|
||||
/** @name KusamaRuntimeProxyType (79) */
|
||||
/** @name KusamaRuntimeProxyType (80) */
|
||||
export interface KusamaRuntimeProxyType extends Enum {
|
||||
readonly isAny: boolean;
|
||||
readonly isNonTransfer: boolean;
|
||||
@@ -19,7 +19,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeSessionKeys (258) */
|
||||
/** @name KusamaRuntimeSessionKeys (261) */
|
||||
export interface KusamaRuntimeSessionKeys extends Struct {
|
||||
readonly grandpa: SpFinalityGrandpaAppPublic;
|
||||
readonly babe: SpConsensusBabeAppPublic;
|
||||
@@ -29,7 +29,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeOriginCaller (332) */
|
||||
/** @name KusamaRuntimeOriginCaller (335) */
|
||||
export interface KusamaRuntimeOriginCaller extends Enum {
|
||||
readonly isSystem: boolean;
|
||||
readonly asSystem: FrameSupportDispatchRawOrigin;
|
||||
@@ -45,7 +45,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeNposCompactSolution24 (398) */
|
||||
/** @name KusamaRuntimeNposCompactSolution24 (401) */
|
||||
export interface KusamaRuntimeNposCompactSolution24 extends Struct {
|
||||
readonly votes1: Vec<ITuple<[Compact<u32>, Compact<u16>]>>;
|
||||
readonly votes2: Vec<ITuple<[Compact<u32>, ITuple<[Compact<u16>, Compact<PerU16>]>, Compact<u16>]>>;
|
||||
@@ -73,7 +73,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeRuntime (774) */
|
||||
/** @name KusamaRuntimeRuntime (779) */
|
||||
export type KusamaRuntimeRuntime = Null;
|
||||
|
||||
} // declare module
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/types-augment authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './index';
|
||||
@@ -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.8.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.11.1' };
|
||||
|
||||
@@ -2,15 +2,17 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Data, StorageKey } from '@polkadot/types';
|
||||
import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
|
||||
import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
|
||||
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
|
||||
import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
|
||||
import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
|
||||
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
|
||||
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
|
||||
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeGenesisConfiguration, BabeGenesisConfigurationV1, BabeWeight, Epoch, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, OpaqueKeyOwnershipProof, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
|
||||
import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
|
||||
import type { BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
|
||||
import type { BeefyAuthoritySet, BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
|
||||
import type { BenchmarkConfig, BenchmarkList, BenchmarkMetadata, BenchmarkParameter } from '@polkadot/types/interfaces/benchmark';
|
||||
import type { CheckInherentsResult, InherentData, InherentIdentifier } from '@polkadot/types/interfaces/blockbuilder';
|
||||
import type { BridgeMessageId, BridgedBlockHash, BridgedBlockNumber, BridgedHeader, CallOrigin, ChainId, DeliveredMessages, DispatchFeePayment, InboundLaneData, InboundRelayer, InitializationData, LaneId, MessageData, MessageKey, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundLaneData, OutboundMessageFee, OutboundPayload, Parameter, RelayerId, UnrewardedRelayer, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges';
|
||||
import type { BlockHash } from '@polkadot/types/interfaces/chain';
|
||||
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
|
||||
@@ -20,13 +22,13 @@ import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/conse
|
||||
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';
|
||||
import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
|
||||
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||
import type { BlockStats } from '@polkadot/types/interfaces/dev';
|
||||
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
||||
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
|
||||
import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth';
|
||||
import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
|
||||
import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthReceiptV0, EthReceiptV3, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth';
|
||||
import type { EvmAccount, EvmCallInfo, EvmCreateInfo, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
|
||||
import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
|
||||
import type { ActiveGilt, ActiveGiltsTotal, ActiveIndex, GiltBid } from '@polkadot/types/interfaces/gilt';
|
||||
@@ -34,28 +36,29 @@ import type { AuthorityIndex, AuthorityList, AuthoritySet, AuthoritySetChange, A
|
||||
import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityInfoTo198, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement, RegistrationTo198 } from '@polkadot/types/interfaces/identity';
|
||||
import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
|
||||
import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery';
|
||||
import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
|
||||
import type { MmrLeafBatchProof, MmrLeafProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, OpaqueMetadata, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
|
||||
import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError, MmrLeafBatchProof, MmrLeafIndex, MmrLeafProof, MmrNodeIndex, MmrProof } from '@polkadot/types/interfaces/mmr';
|
||||
import type { StorageKind } from '@polkadot/types/interfaces/offchain';
|
||||
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
|
||||
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
|
||||
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateEvent, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, CoreState, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, GroupRotationInfo, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OccupiedCore, OccupiedCoreAssumption, OldV1SessionInfo, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, PvfCheckStatement, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, ScheduledCore, Scheduling, ScrapedOnChainVotes, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
|
||||
import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { Approvals } from '@polkadot/types/interfaces/poll';
|
||||
import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy';
|
||||
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
|
||||
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
|
||||
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
|
||||
import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionInfo, TransactionPriority, TransactionStorageProof, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import type { AccountId, AccountId20, AccountId32, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, BlockNumberFor, BlockNumberOf, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, CrateVersion, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, SlotDuration, StorageData, StorageInfo, StorageProof, TransactionInfo, TransactionLongevity, TransactionPriority, TransactionStorageProof, TransactionTag, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
|
||||
import type { Si0Field, Si0LookupTypeId, Si0Path, Si0Type, Si0TypeDef, Si0TypeDefArray, Si0TypeDefBitSequence, Si0TypeDefCompact, Si0TypeDefComposite, Si0TypeDefPhantom, Si0TypeDefPrimitive, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0TypeParameter, Si0Variant, Si1Field, Si1LookupTypeId, Si1Path, Si1Type, Si1TypeDef, Si1TypeDefArray, Si1TypeDefBitSequence, Si1TypeDefCompact, Si1TypeDefComposite, Si1TypeDefPrimitive, Si1TypeDefSequence, Si1TypeDefTuple, Si1TypeDefVariant, Si1TypeParameter, Si1Variant, SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
|
||||
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
|
||||
import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
|
||||
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
|
||||
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SignedSubmission, SignedSubmissionOf, SignedSubmissionTo276, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, SubmissionIndicesOf, Supports, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
|
||||
import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
|
||||
import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, RuntimeVersionPre3, RuntimeVersionPre4, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
|
||||
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
|
||||
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, 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 { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ApplyExtrinsicResultPre6, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorModulePre6, DispatchErrorModuleU8, DispatchErrorModuleU8a, DispatchErrorPre6, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchOutcomePre6, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, TransactionalError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
|
||||
import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
|
||||
import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
|
||||
import type { TransactionSource, TransactionValidity, ValidTransaction } from '@polkadot/types/interfaces/txqueue';
|
||||
import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques';
|
||||
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
|
||||
import type { VestingInfo } from '@polkadot/types/interfaces/vesting';
|
||||
@@ -94,6 +97,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
AnySignature: AnySignature;
|
||||
ApiId: ApiId;
|
||||
ApplyExtrinsicResult: ApplyExtrinsicResult;
|
||||
ApplyExtrinsicResultPre6: ApplyExtrinsicResultPre6;
|
||||
ApprovalFlag: ApprovalFlag;
|
||||
Approvals: Approvals;
|
||||
ArithmeticError: ArithmeticError;
|
||||
@@ -129,6 +133,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
BabeBlockWeight: BabeBlockWeight;
|
||||
BabeEpochConfiguration: BabeEpochConfiguration;
|
||||
BabeEquivocationProof: BabeEquivocationProof;
|
||||
BabeGenesisConfiguration: BabeGenesisConfiguration;
|
||||
BabeGenesisConfigurationV1: BabeGenesisConfigurationV1;
|
||||
BabeWeight: BabeWeight;
|
||||
BackedCandidate: BackedCandidate;
|
||||
Balance: Balance;
|
||||
@@ -136,12 +142,18 @@ declare module '@polkadot/types/types/registry' {
|
||||
BalanceLockTo212: BalanceLockTo212;
|
||||
BalanceOf: BalanceOf;
|
||||
BalanceStatus: BalanceStatus;
|
||||
BeefyAuthoritySet: BeefyAuthoritySet;
|
||||
BeefyCommitment: BeefyCommitment;
|
||||
BeefyId: BeefyId;
|
||||
BeefyKey: BeefyKey;
|
||||
BeefyNextAuthoritySet: BeefyNextAuthoritySet;
|
||||
BeefyPayload: BeefyPayload;
|
||||
BeefyPayloadId: BeefyPayloadId;
|
||||
BeefySignedCommitment: BeefySignedCommitment;
|
||||
BenchmarkConfig: BenchmarkConfig;
|
||||
BenchmarkList: BenchmarkList;
|
||||
BenchmarkMetadata: BenchmarkMetadata;
|
||||
BenchmarkParameter: BenchmarkParameter;
|
||||
Bid: Bid;
|
||||
Bidder: Bidder;
|
||||
BidKind: BidKind;
|
||||
@@ -185,6 +197,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
CallOrigin: CallOrigin;
|
||||
CandidateCommitments: CandidateCommitments;
|
||||
CandidateDescriptor: CandidateDescriptor;
|
||||
CandidateEvent: CandidateEvent;
|
||||
CandidateHash: CandidateHash;
|
||||
CandidateInfo: CandidateInfo;
|
||||
CandidatePendingAvailability: CandidatePendingAvailability;
|
||||
@@ -194,6 +207,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ChainType: ChainType;
|
||||
ChangesTrieConfiguration: ChangesTrieConfiguration;
|
||||
ChangesTrieSignal: ChangesTrieSignal;
|
||||
CheckInherentsResult: CheckInherentsResult;
|
||||
ClassDetails: ClassDetails;
|
||||
ClassId: ClassId;
|
||||
ClassMetadata: ClassMetadata;
|
||||
@@ -203,6 +217,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
CodeUploadRequest: CodeUploadRequest;
|
||||
CodeUploadResult: CodeUploadResult;
|
||||
CodeUploadResultValue: CodeUploadResultValue;
|
||||
CollationInfo: CollationInfo;
|
||||
CollationInfoV1: CollationInfoV1;
|
||||
CollatorId: CollatorId;
|
||||
CollatorSignature: CollatorSignature;
|
||||
CollectiveOrigin: CollectiveOrigin;
|
||||
@@ -286,6 +302,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
CoreAssignment: CoreAssignment;
|
||||
CoreIndex: CoreIndex;
|
||||
CoreOccupied: CoreOccupied;
|
||||
CoreState: CoreState;
|
||||
CrateVersion: CrateVersion;
|
||||
CreatedBlock: CreatedBlock;
|
||||
Data: Data;
|
||||
@@ -305,14 +322,17 @@ declare module '@polkadot/types/types/registry' {
|
||||
DispatchClass: DispatchClass;
|
||||
DispatchError: DispatchError;
|
||||
DispatchErrorModule: DispatchErrorModule;
|
||||
DispatchErrorModulePre6: DispatchErrorModulePre6;
|
||||
DispatchErrorModuleU8: DispatchErrorModuleU8;
|
||||
DispatchErrorModuleU8a: DispatchErrorModuleU8a;
|
||||
DispatchErrorPre6: DispatchErrorPre6;
|
||||
DispatchErrorTo198: DispatchErrorTo198;
|
||||
DispatchFeePayment: DispatchFeePayment;
|
||||
DispatchInfo: DispatchInfo;
|
||||
DispatchInfoTo190: DispatchInfoTo190;
|
||||
DispatchInfoTo244: DispatchInfoTo244;
|
||||
DispatchOutcome: DispatchOutcome;
|
||||
DispatchOutcomePre6: DispatchOutcomePre6;
|
||||
DispatchResult: DispatchResult;
|
||||
DispatchResultOf: DispatchResultOf;
|
||||
DispatchResultTo198: DispatchResultTo198;
|
||||
@@ -336,6 +356,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ElectionStatus: ElectionStatus;
|
||||
EncodedFinalityProofs: EncodedFinalityProofs;
|
||||
EncodedJustification: EncodedJustification;
|
||||
Epoch: Epoch;
|
||||
EpochAuthorship: EpochAuthorship;
|
||||
Era: Era;
|
||||
EraIndex: EraIndex;
|
||||
@@ -360,6 +381,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
EthereumAddress: EthereumAddress;
|
||||
EthereumLookupSource: EthereumLookupSource;
|
||||
EthereumSignature: EthereumSignature;
|
||||
EthFeeHistory: EthFeeHistory;
|
||||
EthFilter: EthFilter;
|
||||
EthFilterAddress: EthFilterAddress;
|
||||
EthFilterChanges: EthFilterChanges;
|
||||
@@ -369,6 +391,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
EthHeader: EthHeader;
|
||||
EthLog: EthLog;
|
||||
EthReceipt: EthReceipt;
|
||||
EthReceiptV0: EthReceiptV0;
|
||||
EthReceiptV3: EthReceiptV3;
|
||||
EthRichBlock: EthRichBlock;
|
||||
EthRichHeader: EthRichHeader;
|
||||
EthStorageProof: EthStorageProof;
|
||||
@@ -396,6 +420,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
EventMetadataV9: EventMetadataV9;
|
||||
EventRecord: EventRecord;
|
||||
EvmAccount: EvmAccount;
|
||||
EvmCallInfo: EvmCallInfo;
|
||||
EvmCreateInfo: EvmCreateInfo;
|
||||
EvmLog: EvmLog;
|
||||
EvmVicinity: EvmVicinity;
|
||||
ExecReturnValue: ExecReturnValue;
|
||||
@@ -424,6 +450,10 @@ declare module '@polkadot/types/types/registry' {
|
||||
ExtrinsicsWeight: ExtrinsicsWeight;
|
||||
ExtrinsicUnknown: ExtrinsicUnknown;
|
||||
ExtrinsicV4: ExtrinsicV4;
|
||||
f32: f32;
|
||||
F32: F32;
|
||||
f64: f64;
|
||||
F64: F64;
|
||||
FeeDetails: FeeDetails;
|
||||
Fixed128: Fixed128;
|
||||
Fixed64: Fixed64;
|
||||
@@ -468,6 +498,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
GrandpaPrevote: GrandpaPrevote;
|
||||
GrandpaSignedPrecommit: GrandpaSignedPrecommit;
|
||||
GroupIndex: GroupIndex;
|
||||
GroupRotationInfo: GroupRotationInfo;
|
||||
H1024: H1024;
|
||||
H128: H128;
|
||||
H160: H160;
|
||||
@@ -524,6 +555,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
Index: Index;
|
||||
IndicesLookupSource: IndicesLookupSource;
|
||||
IndividualExposure: IndividualExposure;
|
||||
InherentData: InherentData;
|
||||
InherentIdentifier: InherentIdentifier;
|
||||
InitializationData: InitializationData;
|
||||
InstanceDetails: InstanceDetails;
|
||||
InstanceId: InstanceId;
|
||||
@@ -594,8 +627,14 @@ declare module '@polkadot/types/types/registry' {
|
||||
MetadataV14: MetadataV14;
|
||||
MetadataV9: MetadataV9;
|
||||
MigrationStatusResult: MigrationStatusResult;
|
||||
MmrBatchProof: MmrBatchProof;
|
||||
MmrEncodableOpaqueLeaf: MmrEncodableOpaqueLeaf;
|
||||
MmrError: MmrError;
|
||||
MmrLeafBatchProof: MmrLeafBatchProof;
|
||||
MmrLeafIndex: MmrLeafIndex;
|
||||
MmrLeafProof: MmrLeafProof;
|
||||
MmrNodeIndex: MmrNodeIndex;
|
||||
MmrProof: MmrProof;
|
||||
MmrRootHash: MmrRootHash;
|
||||
ModuleConstantMetadataV10: ModuleConstantMetadataV10;
|
||||
ModuleConstantMetadataV11: ModuleConstantMetadataV11;
|
||||
@@ -646,11 +685,16 @@ declare module '@polkadot/types/types/registry' {
|
||||
NominatorIndexCompact: NominatorIndexCompact;
|
||||
NotConnectedPeer: NotConnectedPeer;
|
||||
Null: Null;
|
||||
OccupiedCore: OccupiedCore;
|
||||
OccupiedCoreAssumption: OccupiedCoreAssumption;
|
||||
OffchainAccuracy: OffchainAccuracy;
|
||||
OffchainAccuracyCompact: OffchainAccuracyCompact;
|
||||
OffenceDetails: OffenceDetails;
|
||||
Offender: Offender;
|
||||
OldV1SessionInfo: OldV1SessionInfo;
|
||||
OpaqueCall: OpaqueCall;
|
||||
OpaqueKeyOwnershipProof: OpaqueKeyOwnershipProof;
|
||||
OpaqueMetadata: OpaqueMetadata;
|
||||
OpaqueMultiaddr: OpaqueMultiaddr;
|
||||
OpaqueNetworkState: OpaqueNetworkState;
|
||||
OpaquePeerId: OpaquePeerId;
|
||||
@@ -751,6 +795,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ProxyDefinition: ProxyDefinition;
|
||||
ProxyState: ProxyState;
|
||||
ProxyType: ProxyType;
|
||||
PvfCheckStatement: PvfCheckStatement;
|
||||
QueryId: QueryId;
|
||||
QueryStatus: QueryStatus;
|
||||
QueueConfigData: QueueConfigData;
|
||||
@@ -821,8 +866,11 @@ declare module '@polkadot/types/types/registry' {
|
||||
RuntimeVersion: RuntimeVersion;
|
||||
RuntimeVersionApi: RuntimeVersionApi;
|
||||
RuntimeVersionPartial: RuntimeVersionPartial;
|
||||
RuntimeVersionPre3: RuntimeVersionPre3;
|
||||
RuntimeVersionPre4: RuntimeVersionPre4;
|
||||
Schedule: Schedule;
|
||||
Scheduled: Scheduled;
|
||||
ScheduledCore: ScheduledCore;
|
||||
ScheduledTo254: ScheduledTo254;
|
||||
SchedulePeriod: SchedulePeriod;
|
||||
SchedulePriority: SchedulePriority;
|
||||
@@ -830,6 +878,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ScheduleTo258: ScheduleTo258;
|
||||
ScheduleTo264: ScheduleTo264;
|
||||
Scheduling: Scheduling;
|
||||
ScrapedOnChainVotes: ScrapedOnChainVotes;
|
||||
Seal: Seal;
|
||||
SealV0: SealV0;
|
||||
SeatHolder: SeatHolder;
|
||||
@@ -918,6 +967,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
SlashingSpansTo204: SlashingSpansTo204;
|
||||
SlashJournalEntry: SlashJournalEntry;
|
||||
Slot: Slot;
|
||||
SlotDuration: SlotDuration;
|
||||
SlotNumber: SlotNumber;
|
||||
SlotRange: SlotRange;
|
||||
SlotRange10: SlotRange10;
|
||||
@@ -966,6 +1016,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
StorageHasherV13: StorageHasherV13;
|
||||
StorageHasherV14: StorageHasherV14;
|
||||
StorageHasherV9: StorageHasherV9;
|
||||
StorageInfo: StorageInfo;
|
||||
StorageKey: StorageKey;
|
||||
StorageKind: StorageKind;
|
||||
StorageMetadataV10: StorageMetadataV10;
|
||||
@@ -995,11 +1046,15 @@ declare module '@polkadot/types/types/registry' {
|
||||
TraceError: TraceError;
|
||||
TransactionalError: TransactionalError;
|
||||
TransactionInfo: TransactionInfo;
|
||||
TransactionLongevity: TransactionLongevity;
|
||||
TransactionPriority: TransactionPriority;
|
||||
TransactionSource: TransactionSource;
|
||||
TransactionStorageProof: TransactionStorageProof;
|
||||
TransactionTag: TransactionTag;
|
||||
TransactionV0: TransactionV0;
|
||||
TransactionV1: TransactionV1;
|
||||
TransactionV2: TransactionV2;
|
||||
TransactionValidity: TransactionValidity;
|
||||
TransactionValidityError: TransactionValidityError;
|
||||
TransientValidationData: TransientValidationData;
|
||||
TreasuryProposal: TreasuryProposal;
|
||||
@@ -1046,10 +1101,12 @@ declare module '@polkadot/types/types/registry' {
|
||||
ValidatorPrefsTo196: ValidatorPrefsTo196;
|
||||
ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked;
|
||||
ValidatorPrefsWithCommission: ValidatorPrefsWithCommission;
|
||||
ValidatorSet: ValidatorSet;
|
||||
ValidatorSetId: ValidatorSetId;
|
||||
ValidatorSignature: ValidatorSignature;
|
||||
ValidDisputeStatementKind: ValidDisputeStatementKind;
|
||||
ValidityAttestation: ValidityAttestation;
|
||||
ValidTransaction: ValidTransaction;
|
||||
VecInboundHrmpMessage: VecInboundHrmpMessage;
|
||||
VersionedMultiAsset: VersionedMultiAsset;
|
||||
VersionedMultiAssets: VersionedMultiAssets;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -20,16 +20,17 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.8.2",
|
||||
"version": "8.11.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@polkadot/util": "^9.4.1"
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/util": "^9.7.1",
|
||||
"@polkadot/x-bigint": "^9.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "8.8.2",
|
||||
"@polkadot/types-augment": "8.8.2",
|
||||
"@polkadot/types-support": "8.8.2",
|
||||
"@polkadot/util-crypto": "^9.4.1"
|
||||
"@polkadot/types": "8.11.1",
|
||||
"@polkadot/types-augment": "8.11.1",
|
||||
"@polkadot/types-support": "8.11.1",
|
||||
"@polkadot/util-crypto": "^9.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
+10
-41
@@ -20,6 +20,14 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
/**
|
||||
* @description This ensures that operators such as clice, filter, map, etc. return
|
||||
* new Array instances (without this we need to apply overrides)
|
||||
*/
|
||||
static get [Symbol.species] (): typeof Array {
|
||||
return Array;
|
||||
}
|
||||
|
||||
protected constructor (registry: Registry, length: number) {
|
||||
super(length);
|
||||
|
||||
@@ -73,14 +81,14 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
public inspect (): Inspect {
|
||||
return {
|
||||
inner: this.inspectInner(),
|
||||
outer: [compactToU8a(this.length)]
|
||||
};
|
||||
}
|
||||
|
||||
inspectInner (): Inspect[] {
|
||||
public inspectInner (): Inspect[] {
|
||||
const inner = new Array<Inspect>(this.length);
|
||||
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
@@ -169,43 +177,4 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
// Below are methods that we override. When we do a `new Vec(...).map()`,
|
||||
// we want it to return an Array. We only override the methods that return a
|
||||
// new instance.
|
||||
|
||||
/**
|
||||
* @description Concatenates two arrays
|
||||
*/
|
||||
public override concat (other: T[]): T[] {
|
||||
return this.toArray().concat(other instanceof AbstractArray ? other.toArray() : other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Filters the array with the callback
|
||||
*/
|
||||
public override filter (callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: unknown): T[] {
|
||||
return this.toArray().filter(callbackfn, thisArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Maps the array with the callback
|
||||
*/
|
||||
public override map<U> (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: unknown): U[] {
|
||||
return this.toArray().map(callbackfn, thisArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Checks if the array includes a specific value
|
||||
*/
|
||||
public override includes (check: unknown): boolean {
|
||||
return this.some((value: T) => value.eq(check));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a slice of an array
|
||||
*/
|
||||
public override slice (start?: number, end?: number): T[] {
|
||||
return this.toArray().slice(start, end);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user