Compare commits

...
33 Commits
Author SHA1 Message Date
github-actions[bot] 94cbbf5356 [CI Skip] release/stable 10.5.1
skip-checks: true
2023-04-29 08:56:34 +00:00
Jaco c1b1ad7843 10.5.1 (#5623) 2023-04-29 11:48:07 +03:00
github-actions[bot] ce5769471f [CI Skip] bump/beta 10.4.2-7-x
skip-checks: true
2023-04-29 06:40:36 +00:00
Jaco 09222d9055 Bump util (#5622)
* Bump util

* Adjust to fix build
2023-04-29 09:31:52 +03:00
github-actions[bot] 9c4554ddb3 [CI Skip] bump/beta 10.4.2-6-x
skip-checks: true
2023-04-28 07:46:21 +00:00
Jaco 1ba4c0c277 Allow switching on/off of isPedantic checks (#5620)
* Allow switching on/off of isPedantic checks

* CHANGELOG

* typos
2023-04-28 10:37:27 +03:00
github-actions[bot] ac46305d15 [CI Skip] bump/beta 10.4.2-5-x
skip-checks: true
2023-04-28 07:33:46 +00:00
Jaco ad59abfc37 Adjust spread usage in types/interfaces (#5610) 2023-04-28 10:23:04 +03:00
github-actions[bot] 5a48ca3a0a [CI Skip] bump/beta 10.4.2-4-x
skip-checks: true
2023-04-28 06:49:19 +00:00
Jaco d3dabadf95 Bump deps (#5619)
* Bump deps

* CHANGELOG
2023-04-28 09:40:45 +03:00
github-actions[bot] 212d0e33ae [CI Skip] bump/beta 10.4.2-3-x
skip-checks: true
2023-04-26 09:49:32 +00:00
Jaco a6adeb739f Bump deps w/ export ordering (#5614) 2023-04-26 12:40:14 +03:00
github-actions[bot] cd440ea3c4 [CI Skip] bump/beta 10.4.2-2-x
skip-checks: true
2023-04-25 06:05:26 +00:00
Jaco eb480d7ce9 Export & spread cleanups on types-known (#5609) 2023-04-25 08:56:37 +03:00
github-actions[bot] 298397f499 [CI Skip] bump/beta 10.4.2-1-x
skip-checks: true
2023-04-23 13:02:37 +00:00
Jaco 6b17bf5a7a Default to hex-only when number bits > native Rust (#5611)
* Default to hex-only when number bits > native Rust

* CHANGELOG

* Add test for > u128 case
2023-04-23 15:53:32 +03:00
github-actions[bot] 3b3da09f33 [CI Skip] bump/beta 10.4.2-0-x
skip-checks: true
2023-04-23 06:21:56 +00:00
Jaco 976d708fae Adjust Deno WebSocket check (#5608) 2023-04-23 09:13:09 +03:00
github-actions[bot] 92c250e9a7 [CI Skip] release/stable 10.4.1
skip-checks: true
2023-04-22 09:56:06 +00:00
Jaco ba43c288fe 10.4.1 (#5607) 2023-04-22 12:47:14 +03:00
github-actions[bot] ef0d1f4e8a [CI Skip] bump/beta 10.3.5-4-x
skip-checks: true
2023-04-22 09:26:11 +00:00
Jaco cc31d1176e Bump static metadata (#5606) 2023-04-22 12:17:06 +03:00
github-actions[bot] b45e0d4e0d [CI Skip] bump/beta 10.3.5-3-x
skip-checks: true
2023-04-22 09:00:43 +00:00
Jaco 3b894da9f2 Adjust AccountId20 detection with partial match (#5605) 2023-04-22 11:48:59 +03:00
github-actions[bot] 83500c05b3 [CI Skip] bump/beta 10.3.5-2-x
skip-checks: true
2023-04-22 08:35:22 +00:00
Jaco c554e5eef7 Bump common (#5604) 2023-04-22 11:26:14 +03:00
Jaco 6b655838a0 Small cleanup to author details (#5599)
* Small cleanup to author details

* CHANGELOG
2023-04-22 11:16:29 +03:00
github-actions[bot] 4bd23463ab [CI Skip] bump/beta 10.3.5-1-x
skip-checks: true
2023-04-21 10:56:23 +00:00
Jaco 9c758cce95 Bump dev (w/ Node 16+ only) (#5603) 2023-04-21 13:47:31 +03:00
github-actions[bot] abdc50f405 [CI Skip] bump/beta 10.3.5-0-x
skip-checks: true
2023-04-20 05:23:47 +00:00
Xiliang Chen b849d50995 no warm for unknown signed extensions (#5601) 2023-04-20 08:14:55 +03:00
github-actions[bot] 3d2307f12a [CI Skip] release/stable 10.3.4
skip-checks: true
2023-04-16 09:27:26 +00:00
Jaco 320135dbe5 Author extract using correct as-at state (#5598)
* Author extract using correct as-at state

* Align header retrieval

* Dedupe

* Deupe

* Adjust

* Remove deprecated events.at

* 10.3.4
2023-04-16 12:18:36 +03:00
238 changed files with 8921 additions and 7944 deletions
+33 -1
View File
@@ -1,6 +1,38 @@
# CHANGELOG
## master
## 10.5.1 Apr 29, 2023
Changes:
- Default to hex-only in `Int/UInt.toJSON` for > 128-bit values
- Allow for disabling of `isPedantic` storage checks in API options
- Adjust usage of `objectSpread`, default to runtime as required
- Adjust compilation output for `__internal__` class fields
- Update to latest Polkadot, Kusama & Substrate metadata
## 10.4.1 Apr 22, 2023
Contributed:
- Apply `noInitWarn` flag to signed extension warnings (Thanks to https://github.com/xlc)
Changes:
- Adjust `AccountId20` detection with partial match
- Cleanup block author extraction derives
- Update to latest Polkadot, Kusama & Substrate metadata
- Drop support for Node 14 (EOL 30 Apr 2023)
## 10.3.4 Apr 16, 2023
Changes:
- Ensure block author extract uses the correct as-at block construction state
## 10.3.3 Apr 15, 2023
Contributed:
+2 -2
View File
@@ -1,9 +1,9 @@
3433 Jaco 10.3.3 (#5596)
3449 Jaco 10.5.1 (#5623)
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)
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
18 Xiliang Chen fix unkown rpc (#5325)
19 Xiliang Chen no warm for unknown signed extensions (#5601)
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
14 Nikos Kontakis Bump substrate connect to 0.7.16 (#5307)
11 Ian He HttpProvider support clone() (#3949)
+5 -5
View File
@@ -14,10 +14,10 @@
},
"sideEffects": false,
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"versions": {
"git": "10.3.3",
"npm": "10.3.3"
"git": "10.5.1",
"npm": "10.5.1"
},
"workspaces": [
"packages/*"
@@ -40,9 +40,9 @@
"test:one": "polkadot-dev-run-test --env node"
},
"devDependencies": {
"@polkadot/dev": "^0.72.43",
"@polkadot/dev": "^0.73.6",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/node": "^18.15.11"
"@types/node": "^18.16.3"
},
"resolutions": {
"typescript": "^5.0.4"
+8 -8
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "API generated augmentation",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-augment#readme",
"license": "Apache-2.0",
@@ -18,15 +18,15 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/api-base": "10.3.3",
"@polkadot/rpc-augment": "10.3.3",
"@polkadot/types": "10.3.3",
"@polkadot/types-augment": "10.3.3",
"@polkadot/types-codec": "10.3.3",
"@polkadot/util": "^11.1.3",
"@polkadot/api-base": "10.5.1",
"@polkadot/rpc-augment": "10.5.1",
"@polkadot/types": "10.5.1",
"@polkadot/types-augment": "10.5.1",
"@polkadot/types-codec": "10.5.1",
"@polkadot/util": "^12.1.1",
"tslib": "^2.5.0"
}
}
+16
View File
@@ -75,6 +75,10 @@ declare module '@polkadot/api-base/types/events' {
* An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
/**
* Some balance was frozen.
**/
Frozen: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was increased by `amount`, creating a credit to be balanced.
**/
@@ -112,6 +116,10 @@ declare module '@polkadot/api-base/types/events' {
* Some amount was suspended from an account (it can be restored later).
**/
Suspended: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Transfer succeeded.
**/
@@ -626,6 +634,10 @@ declare module '@polkadot/api-base/types/events' {
* An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
/**
* Some balance was frozen.
**/
Frozen: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was increased by `amount`, creating a credit to be balanced.
**/
@@ -663,6 +675,10 @@ declare module '@polkadot/api-base/types/events' {
* Some amount was suspended from an account (it can be restored later).
**/
Suspended: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Transfer succeeded.
**/
+8 -9
View File
@@ -370,6 +370,10 @@ declare module '@polkadot/api-base/types/storage' {
[key: string]: QueryableStorageEntry<ApiType>;
};
dmp: {
/**
* The number to multiply the base delivery fee by.
**/
deliveryFeeFactor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* A mapping that stores the downward message queue MQC head for each para.
*
@@ -994,15 +998,6 @@ declare module '@polkadot/api-base/types/storage' {
* The primary structure that holds all offence records keyed by report identifiers.
**/
reports: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<SpStakingOffenceOffenceDetails>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Enumerates all reports of a kind along with the time they happened.
*
* All reports are sorted by the time of offence.
*
* Note that the actual type of this mapping is `Vec<u8>`, this is because values of
* different types are not supported at the moment so we are doing the manual serialization.
**/
reportsByKindIndex: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Bytes>, [U8aFixed]> & QueryableStorageEntry<ApiType, [U8aFixed]>;
/**
* Generic query
**/
@@ -2111,6 +2106,10 @@ declare module '@polkadot/api-base/types/storage' {
* of our versions we informed them of.
**/
versionNotifyTargets: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: XcmVersionedMultiLocation | { V2: any } | { V3: any } | string | Uint8Array) => Observable<Option<ITuple<[u64, SpWeightsWeightV2Weight, u32]>>>, [u32, XcmVersionedMultiLocation]> & QueryableStorageEntry<ApiType, [u32, XcmVersionedMultiLocation]>;
/**
* Global suspension state of the XCM executor.
**/
xcmExecutionSuspended: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
+11 -10
View File
@@ -952,12 +952,6 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
dmp: {
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
electionProviderMultiPhase: {
/**
* Trigger the governance fallback.
@@ -3881,22 +3875,29 @@ declare module '@polkadot/api-base/types/submittable' {
* Set a safe XCM version (the version that XCM should be encoded with if the most recent
* version a destination can accept is unknown).
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable.
**/
forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option<u32> | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
/**
* Ask a location to notify us regarding their XCM version and any changes to it.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The location to which we should subscribe for XCM version notifications.
**/
forceSubscribeVersionNotify: AugmentedSubmittable<(location: XcmVersionedMultiLocation | { V2: any } | { V3: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation]>;
/**
* Set or unset the global suspension state of the XCM executor.
*
* - `origin`: Must be an origin specified by AdminOrigin.
* - `suspended`: `true` to suspend, `false` to resume.
**/
forceSuspension: AugmentedSubmittable<(suspended: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [bool]>;
/**
* Require that a particular destination should no longer notify us regarding any XCM
* version changes.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The location to which we are currently subscribed for XCM version
* notifications which we no longer desire.
**/
@@ -3905,7 +3906,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Extoll that a particular destination can be communicated with through a particular
* version of XCM.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The destination that is being described.
* - `xcm_version`: The latest version of XCM that `location` supports.
**/
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.5.1' };
@@ -179,6 +179,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
council: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
crowdloan: {
/**
* The minimum amount that may be contributed into a crowdloan. Should almost certainly be at
@@ -787,6 +797,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
technicalCommittee: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
timestamp: {
/**
* The minimum period between blocks. Beware that this is different to the *expected*
@@ -75,6 +75,10 @@ declare module '@polkadot/api-base/types/events' {
* An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
/**
* Some balance was frozen.
**/
Frozen: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was increased by `amount`, creating a credit to be balanced.
**/
@@ -112,6 +116,10 @@ declare module '@polkadot/api-base/types/events' {
* Some amount was suspended from an account (it can be restored later).
**/
Suspended: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Transfer succeeded.
**/
+8 -9
View File
@@ -469,6 +469,10 @@ declare module '@polkadot/api-base/types/storage' {
[key: string]: QueryableStorageEntry<ApiType>;
};
dmp: {
/**
* The number to multiply the base delivery fee by.
**/
deliveryFeeFactor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* A mapping that stores the downward message queue MQC head for each para.
*
@@ -946,15 +950,6 @@ declare module '@polkadot/api-base/types/storage' {
* The primary structure that holds all offence records keyed by report identifiers.
**/
reports: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<SpStakingOffenceOffenceDetails>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Enumerates all reports of a kind along with the time they happened.
*
* All reports are sorted by the time of offence.
*
* Note that the actual type of this mapping is `Vec<u8>`, this is because values of
* different types are not supported at the moment so we are doing the manual serialization.
**/
reportsByKindIndex: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Bytes>, [U8aFixed]> & QueryableStorageEntry<ApiType, [U8aFixed]>;
/**
* Generic query
**/
@@ -2054,6 +2049,10 @@ declare module '@polkadot/api-base/types/storage' {
* of our versions we informed them of.
**/
versionNotifyTargets: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: XcmVersionedMultiLocation | { V2: any } | { V3: any } | string | Uint8Array) => Observable<Option<ITuple<[u64, SpWeightsWeightV2Weight, u32]>>>, [u32, XcmVersionedMultiLocation]> & QueryableStorageEntry<ApiType, [u32, XcmVersionedMultiLocation]>;
/**
* Global suspension state of the XCM executor.
**/
xcmExecutionSuspended: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
+11 -10
View File
@@ -1342,12 +1342,6 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
dmp: {
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
electionProviderMultiPhase: {
/**
* Trigger the governance fallback.
@@ -3993,22 +3987,29 @@ declare module '@polkadot/api-base/types/submittable' {
* Set a safe XCM version (the version that XCM should be encoded with if the most recent
* version a destination can accept is unknown).
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable.
**/
forceDefaultXcmVersion: AugmentedSubmittable<(maybeXcmVersion: Option<u32> | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
/**
* Ask a location to notify us regarding their XCM version and any changes to it.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The location to which we should subscribe for XCM version notifications.
**/
forceSubscribeVersionNotify: AugmentedSubmittable<(location: XcmVersionedMultiLocation | { V2: any } | { V3: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation]>;
/**
* Set or unset the global suspension state of the XCM executor.
*
* - `origin`: Must be an origin specified by AdminOrigin.
* - `suspended`: `true` to suspend, `false` to resume.
**/
forceSuspension: AugmentedSubmittable<(suspended: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [bool]>;
/**
* Require that a particular destination should no longer notify us regarding any XCM
* version changes.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The location to which we are currently subscribed for XCM version
* notifications which we no longer desire.
**/
@@ -4017,7 +4018,7 @@ declare module '@polkadot/api-base/types/submittable' {
* Extoll that a particular destination can be communicated with through a particular
* version of XCM.
*
* - `origin`: Must be Root.
* - `origin`: Must be an origin specified by AdminOrigin.
* - `location`: The destination that is being described.
* - `xcm_version`: The latest version of XCM that `location` supports.
**/
@@ -41,6 +41,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
allianceMotion: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
assets: {
/**
* The amount of funds that must be reserved when creating a new approval.
@@ -199,6 +209,10 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec;
};
contracts: {
/**
* Fallback value to limit the storage deposit if it's not being set by the caller.
**/
defaultDepositLimit: u128 & AugmentedConst<ApiType>;
/**
* The amount of balance a caller has to pay for each byte of storage.
*
@@ -284,6 +298,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
council: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
democracy: {
/**
* Period in blocks where an external proposal may not be re-submitted after being vetoed.
@@ -1185,6 +1209,16 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
technicalCommittee: {
/**
* The maximum weight of a dispatch call that can be proposed and executed.
**/
maxProposalWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
timestamp: {
/**
* The minimum period between blocks. Beware that this is different to the *expected*
@@ -160,6 +160,20 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
assetRate: {
/**
* The given asset ID already has an assigned conversion rate and cannot be re-created.
**/
AlreadyExists: AugmentedError<ApiType>;
/**
* The given asset ID is unknown.
**/
UnknownAssetId: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
assets: {
/**
* The asset-account already exists.
@@ -109,6 +109,15 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
assetRate: {
AssetRateCreated: AugmentedEvent<ApiType, [assetId: u32, rate: u128], { assetId: u32, rate: u128 }>;
AssetRateRemoved: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
AssetRateUpdated: AugmentedEvent<ApiType, [assetId: u32, old: u128, new_: u128], { assetId: u32, old: u128, new_: u128 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
assets: {
/**
* Accounts were destroyed for given asset.
@@ -237,6 +246,10 @@ declare module '@polkadot/api-base/types/events' {
* An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
/**
* Some balance was frozen.
**/
Frozen: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was increased by `amount`, creating a credit to be balanced.
**/
@@ -274,6 +287,10 @@ declare module '@polkadot/api-base/types/events' {
* Some amount was suspended from an account (it can be restored later).
**/
Suspended: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Transfer succeeded.
**/
+14 -9
View File
@@ -85,6 +85,18 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
assetRate: {
/**
* Maps an asset to its fixed point representation in the native balance.
*
* E.g. `native_amount = asset_amount * ConversionRateToNative::<T>::get(asset_id)`
**/
conversionRateToNative: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<u128>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
assets: {
/**
* The holdings of a specific account for a specific asset.
@@ -574,6 +586,8 @@ declare module '@polkadot/api-base/types/storage' {
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<SpNposElectionsElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Current best solution, signed or unsigned, queued to be returned upon `elect`.
*
* Always sorted by score.
**/
queuedSolution: AugmentedQuery<ApiType, () => Observable<Option<PalletElectionProviderMultiPhaseReadySolution>>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -1138,15 +1152,6 @@ declare module '@polkadot/api-base/types/storage' {
* The primary structure that holds all offence records keyed by report identifiers.
**/
reports: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<SpStakingOffenceOffenceDetails>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Enumerates all reports of a kind along with the time they happened.
*
* All reports are sorted by the time of offence.
*
* Note that the actual type of this mapping is `Vec<u8>`, this is because values of
* different types are not supported at the moment so we are doing the manual serialization.
**/
reportsByKindIndex: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Bytes>, [U8aFixed]> & QueryableStorageEntry<ApiType, [U8aFixed]>;
/**
* Generic query
**/
+27
View File
@@ -225,6 +225,33 @@ declare module '@polkadot/api-base/types/submittable' {
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
assetRate: {
/**
* Initialize a conversion rate to native balance for the given asset.
*
* ## Complexity
* - O(1)
**/
create: AugmentedSubmittable<(assetId: u32 | AnyNumber | Uint8Array, rate: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u128]>;
/**
* Remove an existing conversion rate to native balance for the given asset.
*
* ## Complexity
* - O(1)
**/
remove: AugmentedSubmittable<(assetId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Update the conversion rate to native balance for the given asset.
*
* ## Complexity
* - O(1)
**/
update: AugmentedSubmittable<(assetId: u32 | AnyNumber | Uint8Array, rate: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u128]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
assets: {
/**
* Approve an amount of asset for transfer by a delegated third-party account.
+6 -6
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Interfaces for interacting with contracts and contract ABIs",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-base#readme",
"license": "Apache-2.0",
@@ -18,13 +18,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "10.3.3",
"@polkadot/types": "10.3.3",
"@polkadot/util": "^11.1.3",
"rxjs": "^7.8.0",
"@polkadot/rpc-core": "10.5.1",
"@polkadot/types": "10.5.1",
"@polkadot/util": "^12.1.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.0"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.5.1' };
+11 -11
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Interfaces for interacting with contracts and contract ABIs",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"license": "Apache-2.0",
@@ -18,20 +18,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/api": "10.3.3",
"@polkadot/types": "10.3.3",
"@polkadot/types-codec": "10.3.3",
"@polkadot/types-create": "10.3.3",
"@polkadot/util": "^11.1.3",
"@polkadot/util-crypto": "^11.1.3",
"rxjs": "^7.8.0",
"@polkadot/api": "10.5.1",
"@polkadot/types": "10.5.1",
"@polkadot/types-codec": "10.5.1",
"@polkadot/types-create": "10.5.1",
"@polkadot/util": "^12.1.1",
"@polkadot/util-crypto": "^12.1.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/api-augment": "10.3.3",
"@polkadot/keyring": "^11.1.3"
"@polkadot/api-augment": "10.5.1",
"@polkadot/keyring": "^12.1.1"
}
}
+1 -1
View File
@@ -1,11 +1,11 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@polkadot/api/base';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { WeightV2 } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import { ApiBase } from '@polkadot/api/base';
import { isFunction } from '@polkadot/util';
import { Abi } from '../Abi/index.js';
+2 -2
View File
@@ -1,18 +1,18 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@polkadot/api/base';
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { AccountId, EventRecord, Hash } from '@polkadot/types/interfaces';
import type { ISubmittableResult } from '@polkadot/types/types';
import type { Abi } from '../Abi/index.js';
import type { AbiConstructor, BlueprintOptions } from '../types.js';
import type { MapConstructorExec } from './types.js';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { BN_ZERO, isUndefined } from '@polkadot/util';
import { Abi } from '../Abi/index.js';
import { applyOnEvent } from '../util.js';
import { Base } from './Base.js';
import { Contract } from './Contract.js';
+2 -2
View File
@@ -1,19 +1,19 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@polkadot/api/base';
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { AccountId, EventRecord } from '@polkadot/types/interfaces';
import type { ISubmittableResult } from '@polkadot/types/types';
import type { Codec } from '@polkadot/types-codec/types';
import type { Abi } from '../Abi/index.js';
import type { AbiConstructor, BlueprintOptions } from '../types.js';
import type { MapConstructorExec } from './types.js';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { BN_ZERO, compactAddLength, isUndefined, isWasm, u8aToU8a } from '@polkadot/util';
import { Abi } from '../Abi/index.js';
import { applyOnEvent } from '../util.js';
import { Base } from './Base.js';
import { Blueprint } from './Blueprint.js';
+2 -2
View File
@@ -1,21 +1,21 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiBase } from '@polkadot/api/base';
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { Bytes } from '@polkadot/types';
import type { AccountId, ContractExecResult, EventRecord, Weight, WeightV2 } from '@polkadot/types/interfaces';
import type { ISubmittableResult } from '@polkadot/types/types';
import type { Abi } from '../Abi/index.js';
import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent, WeightAll } from '../types.js';
import type { ContractCallResult, ContractCallSend, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types.js';
import { map } from 'rxjs';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { BN, BN_HUNDRED, BN_ONE, BN_ZERO, isUndefined, logger } from '@polkadot/util';
import { Abi } from '../Abi/index.js';
import { applyOnEvent } from '../util.js';
import { Base } from './Base.js';
import { convertWeight, withMeta } from './util.js';
+2 -1
View File
@@ -1,7 +1,8 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ApiBase } from '@polkadot/api/base';
import type { ApiBase } from '@polkadot/api/base';
import { TypeRegistry } from '@polkadot/types';
const registry = new TypeRegistry();
+2
View File
@@ -1,8 +1,10 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// all named
export { Abi } from './Abi/index.js';
export { packageInfo } from './packageInfo.js';
// all starred
export * from './promise/index.js';
export * from './rx/index.js';
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.5.1' };
+3 -2
View File
@@ -1,11 +1,12 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiPromise } from '@polkadot/api';
import type { AccountId, Hash } from '@polkadot/types/interfaces';
import type { Abi } from '../Abi/index.js';
import { ApiPromise, toPromiseMethod } from '@polkadot/api';
import { toPromiseMethod } from '@polkadot/api';
import { Abi } from '../Abi/index.js';
import { Blueprint, Code, Contract } from '../base/index.js';
export class BlueprintPromise extends Blueprint<'promise'> {
+3 -2
View File
@@ -1,11 +1,12 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiRx } from '@polkadot/api';
import type { AccountId, Hash } from '@polkadot/types/interfaces';
import type { Abi } from '../Abi/index.js';
import { ApiRx, toRxMethod } from '@polkadot/api';
import { toRxMethod } from '@polkadot/api';
import { Abi } from '../Abi/index.js';
import { Blueprint, Code, Contract } from '../base/index.js';
export class BlueprintRx extends Blueprint<'rxjs'> {
@@ -5,7 +5,7 @@ export { default as delegator } from './delegator.json' assert { type: 'json' };
export { default as dns } from './dns.json' assert { type: 'json' };
export { default as erc20 } from './erc20.json' assert { type: 'json' };
export { default as erc721 } from './erc721.json' assert { type: 'json' };
export { default as flipper } from './flipper.json' assert { type: 'json' };
export { default as flipperBundle } from './flipper.contract.json' assert { type: 'json' };
export { default as flipper } from './flipper.json' assert { type: 'json' };
export { default as incrementer } from './incrementer.json' assert { type: 'json' };
export { default as multisigPlain } from './multisig_plain.json' assert { type: 'json' };
+16 -16
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"license": "Apache-2.0",
@@ -18,25 +18,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/api": "10.3.3",
"@polkadot/api-augment": "10.3.3",
"@polkadot/api-base": "10.3.3",
"@polkadot/rpc-core": "10.3.3",
"@polkadot/types": "10.3.3",
"@polkadot/types-codec": "10.3.3",
"@polkadot/util": "^11.1.3",
"@polkadot/util-crypto": "^11.1.3",
"rxjs": "^7.8.0",
"@polkadot/api": "10.5.1",
"@polkadot/api-augment": "10.5.1",
"@polkadot/api-base": "10.5.1",
"@polkadot/rpc-core": "10.5.1",
"@polkadot/types": "10.5.1",
"@polkadot/types-codec": "10.5.1",
"@polkadot/util": "^12.1.1",
"@polkadot/util-crypto": "^12.1.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/api": "10.3.3",
"@polkadot/api-augment": "10.3.3",
"@polkadot/rpc-augment": "10.3.3",
"@polkadot/rpc-provider": "10.3.3",
"@polkadot/types-support": "10.3.3"
"@polkadot/api": "10.5.1",
"@polkadot/api-augment": "10.5.1",
"@polkadot/rpc-augment": "10.5.1",
"@polkadot/rpc-provider": "10.5.1",
"@polkadot/types-support": "10.5.1"
}
}
+1 -1
View File
@@ -55,7 +55,7 @@ export function _flags (instanceId: string, api: DeriveApi): () => Observable<Fl
map((values: Codec[]): FlagsIntermediate => {
let resultIndex = -1;
for (let i = 0; i < calls.length; i++) {
for (let i = 0, count = calls.length; i < count; i++) {
if (isFunction(calls[i])) {
results[i] = values[++resultIndex];
}
+2 -2
View File
@@ -4,8 +4,8 @@
export * from './accountId.js';
export * from './flags.js';
export * from './idAndIndex.js';
export * from './idToIndex.js';
export * from './identity.js';
export * from './indexToId.js';
export * from './idToIndex.js';
export * from './indexes.js';
export * from './indexToId.js';
export * from './info.js';
@@ -3,6 +3,7 @@
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import type { ApiPromise } from '@polkadot/api';
import type { SubmittableExtrinsic } from '@polkadot/api-base/types';
import type { Bytes, Option, StorageKey } from '@polkadot/types';
import type { Bounty, BountyIndex, Proposal, ProposalIndex } from '@polkadot/types/interfaces';
@@ -11,8 +12,6 @@ import type { DeriveApi, DeriveCollectiveProposal } from '../types.js';
import { firstValueFrom, of } from 'rxjs';
import { ApiPromise } from '@polkadot/api';
import { BountyFactory } from '../test/bountyFactory.js';
import { BytesFactory } from '../test/bytesFactory.js';
import { createApiWithAugmentations } from '../test/helpers.js';
+1 -1
View File
@@ -119,7 +119,7 @@ function injectFunctions (instanceId: string, api: DeriveApi, derives: DeriveCus
)
));
for (let i = 0; i < names.length; i++) {
for (let i = 0, count = names.length; i < count; i++) {
const name = names[i];
isIncluded(name) &&
+1 -1
View File
@@ -34,7 +34,7 @@ export function getBlock (instanceId: string, api: DeriveApi): (hash: Uint8Array
combineLatest([
of(signedBlock),
queryAt.system.events(),
getAuthorDetails(signedBlock.block.header, queryAt)
getAuthorDetails(api, signedBlock.block.header, blockHash)
])
),
map(([signedBlock, events, [, validators, author]]) =>
+4 -7
View File
@@ -5,7 +5,7 @@ import type { Observable } from 'rxjs';
import type { HeaderExtended } from '../type/types.js';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, switchMap } from 'rxjs';
import { map, switchMap } from 'rxjs';
import { createHeaderExtended } from '../type/index.js';
import { memo } from '../util/index.js';
@@ -27,12 +27,9 @@ import { getAuthorDetails } from './util.js';
*/
export function getHeader (instanceId: string, api: DeriveApi): (blockHash: Uint8Array | string) => Observable<HeaderExtended> {
return memo(instanceId, (blockHash: Uint8Array | string): Observable<HeaderExtended> =>
combineLatest([
api.rpc.chain.getHeader(blockHash),
api.queryAt(blockHash)
]).pipe(
switchMap(([header, queryAt]) =>
getAuthorDetails(header, queryAt)
api.rpc.chain.getHeader(blockHash).pipe(
switchMap((header) =>
getAuthorDetails(api, header, blockHash)
),
map(([header, validators, author]) =>
createHeaderExtended((validators || header).registry, header, validators, author)
+1 -1
View File
@@ -4,9 +4,9 @@
export * from './bestNumber.js';
export * from './bestNumberFinalized.js';
export * from './bestNumberLag.js';
export * from './getHeader.js';
export * from './getBlock.js';
export * from './getBlockByNumber.js';
export * from './getHeader.js';
export * from './subscribeFinalizedHeads.js';
export * from './subscribeNewBlocks.js';
export * from './subscribeNewHeads.js';
@@ -5,7 +5,7 @@ import type { Observable } from 'rxjs';
import type { HeaderExtended } from '../type/types.js';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, of, switchMap } from 'rxjs';
import { map, switchMap } from 'rxjs';
import { createHeaderExtended } from '../type/index.js';
import { memo } from '../util/index.js';
@@ -28,13 +28,7 @@ export function subscribeNewHeads (instanceId: string, api: DeriveApi): () => Ob
return memo(instanceId, (): Observable<HeaderExtended> =>
api.rpc.chain.subscribeNewHeads().pipe(
switchMap((header) =>
combineLatest([
of(header),
api.queryAt(header.hash)
])
),
switchMap(([header, queryAt]) =>
getAuthorDetails(header, queryAt)
getAuthorDetails(api, header)
),
map(([header, validators, author]): HeaderExtended => {
header.createdAtHash = header.hash;
+53 -15
View File
@@ -9,12 +9,15 @@ import type { SpCoreSr25519Public } from '@polkadot/types/lookup';
import type { Codec, IOption } from '@polkadot/types/types';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, mergeMap, of } from 'rxjs';
import { combineLatest, map, mergeMap, of, switchMap } from 'rxjs';
import { memo, unwrapBlockNumber } from '../util/index.js';
export type BlockNumberDerive = (instanceId: string, api: DeriveApi) => () => Observable<BlockNumber>;
type OptionMapping = IOption<{ account: AccountId } & Codec>;
type OptionNimbus = IOption<{ nimbus: SpCoreSr25519Public } & Codec>;
export function createBlockNumberDerive <T extends { number: Compact<BlockNumber> | BlockNumber }> (fn: (api: DeriveApi) => Observable<T>): BlockNumberDerive {
return (instanceId: string, api: DeriveApi) =>
memo(instanceId, () =>
@@ -24,8 +27,9 @@ export function createBlockNumberDerive <T extends { number: Compact<BlockNumber
);
}
export function getAuthorDetails (header: Header, queryAt: QueryableStorage<'rxjs'>): Observable<[Header, Vec<AccountId> | null, AccountId | null]> {
const validators = queryAt.session
/** @internal */
function getAuthorDetailsWithAt (header: Header, queryAt: QueryableStorage<'rxjs'>): Observable<[Header, Vec<AccountId> | null, AccountId | null]> {
const validators = queryAt.session?.validators
? queryAt.session.validators()
: of(null);
@@ -38,28 +42,43 @@ export function getAuthorDetails (header: Header, queryAt: QueryableStorage<'rxj
if (loggedAuthor) {
// use the author mapping pallet, if available (ie: moonbeam, moonriver), to map session (nimbus) key to author (collator/validator) key
if (queryAt.authorMapping && queryAt.authorMapping.mappingWithDeposit) {
if (queryAt.authorMapping?.mappingWithDeposit) {
return combineLatest([
of(header),
validators,
queryAt.authorMapping.mappingWithDeposit<IOption<{ account: AccountId } & Codec>>(loggedAuthor)
.pipe(map((opt) => opt.unwrapOr({ account: null }).account))
queryAt.authorMapping.mappingWithDeposit<OptionMapping>(loggedAuthor).pipe(
map((o) =>
o.unwrapOr({ account: null }).account
)
)
]);
}
// fall back to session and parachain staking pallets, if available (ie: manta, calamari), to map session (nimbus) key to author (collator) key
if (queryAt.parachainStaking && queryAt.parachainStaking.selectedCandidates && queryAt.session && queryAt.session.nextKeys && queryAt.session.nextKeys.multi) {
if (queryAt.parachainStaking?.selectedCandidates && queryAt.session?.nextKeys) {
const loggedHex = loggedAuthor.toHex();
return combineLatest([
of(header),
validators,
queryAt.parachainStaking.selectedCandidates<AccountId[]>().pipe(
mergeMap((selectedCandidates) => combineLatest([
of(selectedCandidates),
queryAt.session.nextKeys.multi<IOption<{ nimbus: SpCoreSr25519Public } & Codec>>(selectedCandidates).pipe(
map((nextKeys) => nextKeys.findIndex((option) => option.unwrapOrDefault().nimbus.toHex() === loggedAuthor.toHex()))
)
])),
map(([selectedCandidates, index]) => selectedCandidates[index])
queryAt.parachainStaking.selectedCandidates<Vec<AccountId>>().pipe(
mergeMap((selectedCandidates) =>
combineLatest([
of(selectedCandidates),
queryAt.session.nextKeys.multi<OptionNimbus>(selectedCandidates).pipe(
map((nextKeys) =>
nextKeys.findIndex((o) =>
o.unwrapOrDefault().nimbus.toHex() === loggedHex
)
)
)
])
),
map(([selectedCandidates, index]) =>
index === -1
? null
: selectedCandidates[index]
)
)
]);
}
@@ -72,3 +91,22 @@ export function getAuthorDetails (header: Header, queryAt: QueryableStorage<'rxj
of(null)
]);
}
export function getAuthorDetails (api: DeriveApi, header: Header, blockHash?: Uint8Array | string): Observable<[Header, Vec<AccountId> | null, AccountId | null]> {
// For on-chain state, we need to retrieve it as per the start
// of the block being constructed, i.e. session validators would
// be at the point of the block construction, not when all operations
// has been supplied.
//
// However for the first block (no parentHash available), we would
// just use the as-is
return api.queryAt(
header.parentHash.isEmpty
? blockHash || header.hash
: header.parentHash
).pipe(
switchMap((queryAt) =>
getAuthorDetailsWithAt(header, queryAt)
)
);
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.5.1' };
+1 -1
View File
@@ -3,13 +3,13 @@
export * from './account.js';
export * from './currentPoints.js';
export * from './electedInfo.js';
export * from './erasExposure.js';
export * from './erasHistoric.js';
export * from './erasPoints.js';
export * from './erasPrefs.js';
export * from './erasRewards.js';
export * from './erasSlashes.js';
export * from './electedInfo.js';
export * from './keys.js';
export * from './overview.js';
export * from './ownExposure.js';
@@ -1,10 +1,10 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiPromise } from '@polkadot/api';
import type { Bounty, BountyIndex } from '@polkadot/types/interfaces';
import type { Codec, Constructor, InterfaceTypes, Registry } from '@polkadot/types/types';
import { ApiPromise } from '@polkadot/api';
import { Option, StorageKey } from '@polkadot/types';
export class BountyFactory {
+1 -1
View File
@@ -3,7 +3,7 @@
import type { AccountId, Digest } from '@polkadot/types/interfaces';
export function extractAuthor (digest: Digest, sessionValidators: AccountId[] = []): AccountId | undefined {
export function extractAuthor (digest: Digest, sessionValidators: AccountId[]): AccountId | undefined {
const [citem] = digest.logs.filter((e) => e.isConsensus);
const [pitem] = digest.logs.filter((e) => e.isPreRuntime);
const [sitem] = digest.logs.filter((e) => e.isSeal);
+1 -1
View File
@@ -9,8 +9,8 @@ import type { BN } from '@polkadot/util';
import type { ExactDerive } from './derive.js';
export * from './accounts/types.js';
export * from './balances/types.js';
export * from './bagsList/types.js';
export * from './balances/types.js';
export * from './council/types.js';
export * from './crowdloan/types.js';
export * from './democracy/types.js';
@@ -8,7 +8,7 @@ import type { ApprovalFlag } from '@polkadot/types/interfaces/elections';
export function approvalFlagsToBools (flags: Vec<ApprovalFlag> | ApprovalFlag[]): boolean[] {
const bools: boolean[] = [];
for (let i = 0; i < flags.length; i++) {
for (let i = 0, count = flags.length; i < count; i++) {
const str = flags[i].toString(2);
// read from lowest bit to highest
+2
View File
@@ -1,8 +1,10 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
// all named
export { drr, memo } from '@polkadot/rpc-core';
// all starred
export * from './approvalFlagsToBools.js';
export * from './blockNumber.js';
export * from './cache.js';
+19 -19
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"license": "Apache-2.0",
@@ -18,29 +18,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/api-augment": "10.3.3",
"@polkadot/api-base": "10.3.3",
"@polkadot/api-derive": "10.3.3",
"@polkadot/keyring": "^11.1.3",
"@polkadot/rpc-augment": "10.3.3",
"@polkadot/rpc-core": "10.3.3",
"@polkadot/rpc-provider": "10.3.3",
"@polkadot/types": "10.3.3",
"@polkadot/types-augment": "10.3.3",
"@polkadot/types-codec": "10.3.3",
"@polkadot/types-create": "10.3.3",
"@polkadot/types-known": "10.3.3",
"@polkadot/util": "^11.1.3",
"@polkadot/util-crypto": "^11.1.3",
"@polkadot/api-augment": "10.5.1",
"@polkadot/api-base": "10.5.1",
"@polkadot/api-derive": "10.5.1",
"@polkadot/keyring": "^12.1.1",
"@polkadot/rpc-augment": "10.5.1",
"@polkadot/rpc-core": "10.5.1",
"@polkadot/rpc-provider": "10.5.1",
"@polkadot/types": "10.5.1",
"@polkadot/types-augment": "10.5.1",
"@polkadot/types-codec": "10.5.1",
"@polkadot/types-create": "10.5.1",
"@polkadot/types-known": "10.5.1",
"@polkadot/util": "^12.1.1",
"@polkadot/util-crypto": "^12.1.1",
"eventemitter3": "^5.0.0",
"rxjs": "^7.8.0",
"rxjs": "^7.8.1",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/api-augment": "10.3.3",
"@polkadot/types-support": "10.3.3"
"@polkadot/api-augment": "10.5.1",
"@polkadot/types-support": "10.5.1"
}
}
+26 -22
View File
@@ -4,7 +4,7 @@
import type { Observable } from 'rxjs';
import type { AugmentedCall, DeriveCustom, QueryableCalls } from '@polkadot/api-base/types';
import type { RpcInterface } from '@polkadot/rpc-core/types';
import type { StorageKey, Text, u64 } from '@polkadot/types';
import type { Metadata, 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';
@@ -20,7 +20,7 @@ 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, GenericExtrinsic, Metadata, typeDefinitions, TypeRegistry } from '@polkadot/types';
import { expandMetadata, GenericExtrinsic, typeDefinitions, TypeRegistry } from '@polkadot/types';
import { getSpecRuntime } from '@polkadot/types-known';
import { arrayChunk, arrayFlatten, assertReturn, BN, compactStripLength, lazyMethod, lazyMethods, logger, nextTick, objectSpread, stringCamelCase, stringUpperFirst, u8aConcatStrict, u8aToHex } from '@polkadot/util';
import { blake2AsHex } from '@polkadot/util-crypto';
@@ -139,19 +139,22 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
this._rx.queryAt = (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) =>
from(this.at(blockHash, knownVersion)).pipe(map((a) => a.rx.query));
this._rx.registry = this.#registry;
this._decorateMethod = decorateMethod;
this._options = options;
this._type = type;
const thisProvider = options.source
const provider = options.source
? options.source._rpcCore.provider.isClonable
? options.source._rpcCore.provider.clone()
: options.source._rpcCore.provider
: (options.provider || new WsProvider());
this._decorateMethod = decorateMethod;
this._options = options;
this._type = type;
// The RPC interface decorates the known interfaces on init
this._rpcCore = new RpcCore(this.#instanceId, this.#registry, thisProvider, this._options.rpc) as (RpcCore & RpcInterface);
this._rpcCore = new RpcCore(this.#instanceId, this.#registry, {
isPedantic: this._options.isPedantic,
provider,
userRpc: this._options.rpc
}) as (RpcCore & RpcInterface);
this._isConnected = new BehaviorSubject(this._rpcCore.provider.isConnected);
this._rx.hasSubscriptions = this._rpcCore.provider.hasSubscriptions;
}
@@ -319,7 +322,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
// 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++) {
for (let i = 0, count = methods.length; i < count; i++) {
const [section] = methods[i].split('_');
sectionMap[section] = true;
@@ -328,7 +331,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
// convert the actual section names into an easy name lookup
const sections = Object.keys(sectionMap);
for (let i = 0; i < sections.length; i++) {
for (let i = 0, count = sections.length; i < count; i++) {
const nameA = stringUpperFirst(sections[i]);
const nameB = `${nameA}Api`;
@@ -344,8 +347,9 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const hasResults = exposed.length !== 0;
const allKnown = [...this._rpcCore.mapping.entries()];
const allKeys: string[] = [];
const count = allKnown.length;
for (let i = 0; i < allKnown.length; i++) {
for (let i = 0; i < count; i++) {
const [, { alias, endpoint, method, pubsub, section }] = allKnown[i];
allKeys.push(`${section}_${method}`);
@@ -375,7 +379,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
// loop through all entries we have (populated in decorate) and filter as required
// only remove when we have results and method missing, or with no results if optional
for (let i = 0; i < allKnown.length; i++) {
for (let i = 0; i < count; i++) {
const [k, { method, section }] = allKnown[i];
if (hasResults && !exposed.includes(k) && k !== 'rpc_methods') {
@@ -408,7 +412,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
return fn;
};
for (let s = 0; s < rpc.sections.length; s++) {
for (let s = 0, scount = rpc.sections.length; s < scount; s++) {
const section = rpc.sections[s];
if (!Object.prototype.hasOwnProperty.call(out, section)) {
@@ -417,7 +421,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const decorateInternal = (method: string) =>
decorateFn(section, method);
for (let m = 0; m < methods.length; m++) {
for (let m = 0, mcount = methods.length; m < mcount; m++) {
const method = methods[m];
// skip subscriptions where we have a non-subscribe interface
@@ -443,13 +447,13 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const entries = Object.entries(additional);
for (let j = 0; j < entries.length; j++) {
for (let j = 0, ecount = entries.length; j < ecount; 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++) {
for (let k = 0, dcount = defs.length; k < dcount; k++) {
const def = defs[k];
const prev = result[key].find(({ version }) => def.version === version);
@@ -475,7 +479,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
// 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++) {
for (let i = 0, count = defValues.length; i < count; i++) {
this._addRuntimeDef(result, defValues[i].runtime);
}
@@ -497,7 +501,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
this.#runtimeLog[implName] = true;
for (let i = 0; i < sections.length; i++) {
for (let i = 0, scount = sections.length; i < scount; i++) {
const [_section, secs] = sections[i];
const sectionHash = blake2AsHex(_section, 64);
const rtApi = apis.find(([a]) => a.eq(sectionHash));
@@ -517,7 +521,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
named[section] = {};
}
for (let m = 0; m < methods.length; m++) {
for (let m = 0, mcount = methods.length; m < mcount; m++) {
const [_method, def] = methods[m];
const method = stringCamelCase(_method);
@@ -557,7 +561,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const modules = Object.keys(named);
for (let i = 0; i < modules.length; i++) {
for (let i = 0, count = modules.length; i < count; i++) {
lazyMethod(result, modules[i], lazySection);
}
@@ -642,7 +646,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const sections = Object.keys(tx);
for (let i = 0; i < sections.length; i++) {
for (let i = 0, count = sections.length; i < count; i++) {
lazyMethod(result, sections[i], lazySection);
}
@@ -673,7 +677,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const sections = Object.keys(query);
for (let i = 0; i < sections.length; i++) {
for (let i = 0, count = sections.length; i < count; i++) {
lazyMethod(result, sections[i], lazySection);
}
+3 -3
View File
@@ -97,7 +97,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
registry.knownTypes.typesAlias = getSpecAlias(registry, chain, version.specName);
}
registry.setMetadata(metadata, undefined, objectSpread<ExtDef>({}, getSpecExtensions(registry, chain, version.specName), this._options.signedExtensions));
registry.setMetadata(metadata, undefined, objectSpread<ExtDef>({}, getSpecExtensions(registry, chain, version.specName), this._options.signedExtensions), this._options.noInitWarn);
}
/**
@@ -265,11 +265,11 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
const sections = Object.keys(source.rpc);
const rpcs: string[] = [];
for (let s = 0; s < sections.length; s++) {
for (let s = 0, scount = sections.length; s < scount; s++) {
const section = sections[s];
const methods = Object.keys((source.rpc as unknown as Record<string, Record<string, unknown>>)[section]);
for (let m = 0; m < methods.length; m++) {
for (let m = 0, mcount = methods.length; m < mcount; m++) {
rpcs.push(`${section}_${methods[m]}`);
}
}
+3
View File
@@ -3,11 +3,14 @@
import '@polkadot/rpc-augment';
// all external
export { Keyring } from '@polkadot/keyring';
export { HttpProvider, ScProvider, WsProvider } from '@polkadot/rpc-provider';
// all named
export { packageInfo } from './packageInfo.js';
export { SubmittableResult } from './submittable/index.js';
// all starred
export * from './promise/index.js';
export * from './rx/index.js';
+1 -2
View File
@@ -11,13 +11,12 @@ import type { StorageKey } from '@polkadot/types';
import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces';
import type { FrameSystemAccountInfo } from '@polkadot/types/lookup';
import type { AnyTuple, IExtrinsic, IMethod } from '@polkadot/types/types';
import type { SubmittableResult } from './index.js';
import { ApiPromise } from '@polkadot/api';
import { createTestPairs } from '@polkadot/keyring/testingPairs';
import { createTypeUnsafe, TypeRegistry } from '@polkadot/types/create';
import { SubmittableResult } from './index.js';
const registry = new TypeRegistry();
async function calls (api: ApiPromise): Promise<void> {
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.5.1' };
+2 -2
View File
@@ -1,11 +1,11 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Observable, Subscription } from 'rxjs';
import type { Callback, Codec } from '@polkadot/types/types';
import type { DecorateFn, DecorateMethodOptions, ObsInnerType, StorageEntryPromiseOverloads, UnsubscribePromise, VoidFn } from '../types/index.js';
import { catchError, EMPTY, Subscription, tap } from 'rxjs';
import { catchError, EMPTY, tap } from 'rxjs';
import { isFunction, nextTick } from '@polkadot/util';
+3 -2
View File
@@ -1,9 +1,10 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { ApiOptions } from '../types/index.js';
import { from, Observable } from 'rxjs';
import { from } from 'rxjs';
import { objectSpread } from '@polkadot/util';
@@ -13,7 +14,7 @@ import { toRxMethod } from './decorateMethod.js';
/**
* # @polkadot/api/rx
*
* ## Overview
* ## Overview
*
* @name ApiRx
*
+3 -5
View File
@@ -7,14 +7,14 @@ import type { Observable } from 'rxjs';
import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo, SignerPayload } from '@polkadot/types/interfaces';
import type { Callback, Codec, Constructor, ISubmittableResult, SignatureOptions } from '@polkadot/types/types';
import type { Registry } from '@polkadot/types-codec/types';
import type { ApiBase } from '../base/index.js';
import type { ApiInterfaceRx, ApiTypes, PromiseOrObs, SignerResult } from '../types/index.js';
import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, SubmittableExtrinsic, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription } from './types.js';
import { catchError, first, map, mergeMap, of, switchMap, tap } from 'rxjs';
import { isBn, isFunction, isNumber, isString, isU8a, objectSpread } from '@polkadot/util';
import { identity, isBn, isFunction, isNumber, isString, isU8a, objectSpread } from '@polkadot/util';
import { ApiBase } from '../base/index.js';
import { filterEvents, isKeyringPair } from '../util/index.js';
import { SubmittableResult } from './Result.js';
@@ -30,8 +30,6 @@ interface UpdateInfo {
updateId: number;
}
const identity = <T> (input: T): T => input;
function makeEraOptions (api: ApiInterfaceRx, registry: Registry, partialOptions: Partial<SignerOptions>, { header, mortalLength, nonce }: { header: Header | null; mortalLength: number; nonce: Index }): SignatureOptions {
if (!header) {
if (partialOptions.era && !partialOptions.blockHash) {
@@ -92,7 +90,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas
class Submittable extends ExtrinsicBase implements SubmittableExtrinsic<ApiType> {
readonly #ignoreStatusCb: boolean;
#transformResult: (input: ISubmittableResult) => ISubmittableResult = identity;
#transformResult = identity<ISubmittableResult>;
constructor (registry: Registry, extrinsic: Call | Extrinsic | Uint8Array | string) {
super(registry, extrinsic, { version: api.extrinsicType });
@@ -3,10 +3,10 @@
import type { Call, Extrinsic } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types-codec/types';
import type { ApiBase } from '../base/index.js';
import type { ApiInterfaceRx, ApiTypes } from '../types/index.js';
import type { SubmittableExtrinsic } from './types.js';
import { ApiBase } from '../base/index.js';
import { createClass } from './createClass.js';
type Creator<ApiType extends ApiTypes> = (extrinsic: Call | Uint8Array | string) => SubmittableExtrinsic<ApiType>;
+1 -2
View File
@@ -2,8 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { EventRecord } from '@polkadot/types/interfaces';
import { SubmittableResult } from '../index.js';
import type { SubmittableResult } from '../index.js';
// log all events for the transfers, calling done() when finalized
export const logEvents = (done: () => Record<string, unknown>): (r: SubmittableResult) => void =>
+12 -5
View File
@@ -18,17 +18,20 @@ import type { ApiBase } from '../base/index.js';
import type { SubmittableExtrinsic } from '../types/submittable.js';
import type { AllDerives } from '../util/decorate.js';
export * from '@polkadot/api-base/types';
// types
export type { Signer, SignerResult } from '@polkadot/types/types';
// all named
export { ApiBase } from '../base/index.js';
// all starred
export * from '@polkadot/api/types/calls';
export * from '@polkadot/api/types/consts';
export * from '@polkadot/api/types/errors';
export * from '@polkadot/api/types/events';
export * from '@polkadot/api/types/storage';
export * from '@polkadot/api/types/submittable';
export type { Signer, SignerResult } from '@polkadot/types/types';
export { ApiBase } from '../base/index.js';
export * from '@polkadot/api-base/types';
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
export interface ApiInterfaceRx extends ApiInterfaceBase {
@@ -44,6 +47,10 @@ export interface ApiOptions extends RegisteredTypes {
* @description Control the initialization of the wasm libraries. When not specified, it defaults to `true`, initializing the wasm libraries, set to `false` to not initialize wasm. (No sr25519 support)
*/
initWasm?: boolean;
/**
* @description Controls the checking of storage values once they have been contructed. When not specified this defaults to `true`. Set to `false` to forgo any checking on storage results.
*/
isPedantic?: boolean;
/**
* @description pre-bundles is a map of 'genesis hash and runtime spec version' as key to a metadata hex string
* if genesis hash and runtime spec version matches, then use metadata, else fetch it from chain
+3 -3
View File
@@ -53,12 +53,12 @@ function findMethodExcludes <T> (src: Sections<T>, dst: Sections<T>): string[] {
const dstSections = findSectionIncludes(Object.keys(dst), srcSections);
const excludes: string[] = [];
for (let s = 0; s < dstSections.length; s++) {
for (let s = 0, scount = dstSections.length; s < scount; s++) {
const section = dstSections[s];
const srcMethods = Object.keys(src[section]);
const dstMethods = Object.keys(dst[section]);
for (let d = 0; d < dstMethods.length; d++) {
for (let d = 0, mcount = dstMethods.length; d < mcount; d++) {
const method = dstMethods[d];
if (!srcMethods.includes(method)) {
@@ -95,7 +95,7 @@ export function augmentObject <T> (prefix: string | null, src: Sections<T>, dst:
const sections = Object.keys(src);
for (let i = 0; i < sections.length; i++) {
for (let i = 0, count = sections.length; i < count; i++) {
const section = sections[i];
const methods = src[section];
+1 -1
View File
@@ -35,7 +35,7 @@ export function decorateDeriveSections<ApiType extends ApiTypes> (decorateMethod
const result: AnyDerive = {};
const names = Object.keys(derives);
for (let i = 0; i < names.length; i++) {
for (let i = 0, count = names.length; i < count; i++) {
lazyDeriveSection(result, names[i], getKeys, creator);
}
+4 -2
View File
@@ -1,8 +1,10 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './decorate.js';
// all named
export { filterEvents } from './filterEvents.js';
export { isKeyringPair } from './isKeyringPair.js';
export { l } from './logging.js';
// all starred
export * from './decorate.js';
+6 -6
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "RPC generated augmentation",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-augment#readme",
"license": "Apache-2.0",
@@ -18,13 +18,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "10.3.3",
"@polkadot/types": "10.3.3",
"@polkadot/types-codec": "10.3.3",
"@polkadot/util": "^11.1.3",
"@polkadot/rpc-core": "10.5.1",
"@polkadot/types": "10.5.1",
"@polkadot/types-codec": "10.5.1",
"@polkadot/util": "^12.1.1",
"tslib": "^2.5.0"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.5.1' };
+9 -9
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"license": "Apache-2.0",
@@ -18,18 +18,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-augment": "10.3.3",
"@polkadot/rpc-provider": "10.3.3",
"@polkadot/types": "10.3.3",
"@polkadot/util": "^11.1.3",
"rxjs": "^7.8.0",
"@polkadot/rpc-augment": "10.5.1",
"@polkadot/rpc-provider": "10.5.1",
"@polkadot/types": "10.5.1",
"@polkadot/util": "^12.1.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/keyring": "^11.1.3",
"@polkadot/rpc-augment": "10.3.3"
"@polkadot/keyring": "^12.1.1",
"@polkadot/rpc-augment": "10.5.1"
}
}
+59 -43
View File
@@ -29,6 +29,12 @@ type MemoizedRpcInterfaceMethod = Memoized<RpcInterfaceMethod> & {
meta: DefinitionRpc;
}
interface Options {
isPedantic?: boolean;
provider: ProviderInterface;
userRpc?: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>;
}
const l = logger('rpc-core');
const EMPTY_META = {
@@ -47,11 +53,11 @@ function logErrorMessage (method: string, { noErrorLog, params, type }: Definiti
return;
}
const inputs = params.map(({ isOptional, name, type }): string =>
`${name}${isOptional ? '?' : ''}: ${type}`
).join(', ');
l.error(`${method}(${inputs}): ${type}:: ${error.message}`);
l.error(`${method}(${
params.map(({ isOptional, name, type }): string =>
`${name}${isOptional ? '?' : ''}: ${type}`
).join(', ')
}): ${type}:: ${error.message}`);
}
function isTreatAsHex (key: StorageKey): boolean {
@@ -84,30 +90,31 @@ function isTreatAsHex (key: StorageKey): boolean {
* ```
*/
export class RpcCore {
#instanceId: string;
#registryDefault: Registry;
readonly #instanceId: string;
readonly #isPedantic: boolean;
readonly #registryDefault: Registry;
readonly #storageCache = new Map<string, Codec>();
#getBlockRegistry?: (blockHash: Uint8Array) => Promise<{ registry: Registry }>;
#getBlockHash?: (blockNumber: AnyNumber) => Promise<Uint8Array>;
readonly #storageCache = new Map<string, Codec>();
readonly mapping = new Map<string, DefinitionRpcExt>();
readonly provider: ProviderInterface;
readonly sections: string[] = [];
/**
* @constructor
* Default constructor for the Api Object
* @param {ProviderInterface} provider An API provider using HTTP or WebSocket
* Default constructor for the core RPC handler
* @param {ProviderInterface} provider An API provider using any of the supported providers (HTTP, SC or WebSocket)
*/
constructor (instanceId: string, registry: Registry, provider: ProviderInterface, userRpc: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>> = {}) {
constructor (instanceId: string, registry: Registry, { isPedantic = true, provider, userRpc = {} }: Options) {
// eslint-disable-next-line @typescript-eslint/unbound-method
if (!provider || !isFunction(provider.send)) {
throw new Error('Expected Provider to API create');
}
this.#instanceId = instanceId;
this.#isPedantic = isPedantic;
this.#registryDefault = registry;
this.provider = provider;
@@ -163,12 +170,12 @@ export class RpcCore {
// add any extra user-defined sections
this.sections.push(...Object.keys(userRpc).filter((k) => !this.sections.includes(k)));
for (let s = 0; s < this.sections.length; s++) {
for (let s = 0, scount = this.sections.length; s < scount; s++) {
const section = this.sections[s];
const defs = objectSpread<Record<string, DefinitionRpc | DefinitionRpcSub>>({}, rpcDefinitions[section as 'babe'], userRpc[section]);
const methods = Object.keys(defs);
for (let m = 0; m < methods.length; m++) {
for (let m = 0, mcount = methods.length; m < mcount; m++) {
const method = methods[m];
const def = defs[method];
const jsonrpc = def.endpoint || `${section}_${method}`;
@@ -227,7 +234,7 @@ export class RpcCore {
? await this.#getBlockRegistry(u8aToU8a(blockHash))
: { registry: this.#registryDefault };
const params = this._formatInputs(registry, null, def, values);
const params = this._formatParams(registry, null, def, values);
// only cache .at(<blockHash>) queries, e.g. where valid blockHash was supplied
const result = await this.provider.send<AnyJson>(rpcName, params.map((p) => p.toJSON()), !!blockHash);
@@ -307,8 +314,7 @@ export class RpcCore {
};
try {
const params = this._formatInputs(registry, null, def, values);
const paramsJson = params.map((p) => p.toJSON());
const params = this._formatParams(registry, null, def, values);
const update = (error?: Error | null, result?: unknown): void => {
if (error) {
@@ -324,7 +330,7 @@ export class RpcCore {
}
};
subscriptionPromise = this._createSubscriber({ paramsJson, subName, subType, update }, errorHandler);
subscriptionPromise = this._createSubscriber({ paramsJson: params.map((p) => p.toJSON()), subName, subType, update }, errorHandler);
} catch (error) {
errorHandler(error as Error);
}
@@ -355,19 +361,21 @@ export class RpcCore {
return memoized;
}
private _formatInputs (registry: Registry, blockHash: Uint8Array | string | null | undefined, def: DefinitionRpc, inputs: unknown[]): Codec[] {
const reqArgCount = def.params.filter(({ isOptional }) => !isOptional).length;
const optText = reqArgCount === def.params.length
? ''
: ` (${def.params.length - reqArgCount} optional)`;
private _formatParams (registry: Registry, blockHash: Uint8Array | string | null | undefined, def: DefinitionRpc, inputs: unknown[]): Codec[] {
const count = inputs.length;
const reqCount = def.params.filter(({ isOptional }) => !isOptional).length;
if (inputs.length < reqArgCount || inputs.length > def.params.length) {
throw new Error(`Expected ${def.params.length} parameters${optText}, ${inputs.length} found instead`);
if (count < reqCount || count > def.params.length) {
throw new Error(`Expected ${def.params.length} parameters${reqCount === def.params.length ? '' : ` (${def.params.length - reqCount} optional)`}, ${count} found instead`);
}
return inputs.map((input, index): Codec =>
registry.createTypeUnsafe(def.params[index].type, [input], { blockHash })
);
const params = new Array<Codec>(count);
for (let i = 0; i < count; i++) {
params[i] = registry.createTypeUnsafe(def.params[i].type, [inputs[i]], { blockHash });
}
return params;
}
private _formatOutput (registry: Registry, blockHash: Uint8Array | string | null | undefined, method: string, rpc: DefinitionRpc, params: Codec[], result?: unknown): Codec | Codec[] {
@@ -382,10 +390,18 @@ export class RpcCore {
? this._formatStorageSet(registry, (result as StorageChangeSetJSON).block, keys, (result as StorageChangeSetJSON).changes)
: registry.createType('StorageChangeSet', result);
} else if (rpc.type === 'Vec<StorageChangeSet>') {
const mapped = (result as StorageChangeSetJSON[]).map(({ block, changes }): [Hash, Codec[]] => [
registry.createType('Hash', block),
this._formatStorageSet(registry, block, params[0] as Vec<StorageKey>, changes)
]);
const jsonSet = (result as StorageChangeSetJSON[]);
const count = jsonSet.length;
const mapped = new Array<[Hash, Codec[]]>(count);
for (let i = 0; i < count; i++) {
const { block, changes } = jsonSet[i];
mapped[i] = [
registry.createType('BlockHash', block),
this._formatStorageSet(registry, block, params[0] as Vec<StorageKey>, changes)
];
}
// we only query at a specific block, not a range - flatten
return method === 'queryStorageAt'
@@ -412,17 +428,17 @@ export class RpcCore {
private _formatStorageSet (registry: Registry, blockHash: string, keys: Vec<StorageKey>, changes: [string, string | null][]): Codec[] {
// For StorageChangeSet, the changes has the [key, value] mappings
const withCache = keys.length !== 1;
const count = keys.length;
const withCache = count !== 1;
const values = new Array<Codec>(count);
// multiple return values (via state.storage subscription), decode the values
// one at a time, all based on the query types. Three values can be returned -
// - Codec - There is a valid value, non-empty
// - null - The storage key is empty
return keys.reduce((results: Codec[], key: StorageKey, index): Codec[] => {
results.push(this._formatStorageSetEntry(registry, blockHash, key, changes, withCache, index));
// multiple return values (via state.storage subscription), decode the
// values one at a time, all based on the supplied query types
for (let i = 0; i < count; i++) {
values[i] = this._formatStorageSetEntry(registry, blockHash, keys[i], changes, withCache, i);
}
return results;
}, []);
return values;
}
private _formatStorageSetEntry (registry: Registry, blockHash: string, key: StorageKey, changes: [string, string | null][], withCache: boolean, entryIndex: number): Codec {
@@ -478,9 +494,9 @@ export class RpcCore {
: hexToU8a(meta.fallback.toHex())
: undefined
: meta.modifier.isOptional
? registry.createTypeUnsafe(type, [input], { blockHash, isPedantic: true })
? registry.createTypeUnsafe(type, [input], { blockHash, isPedantic: this.#isPedantic })
: input
], { blockHash, isFallback: isEmpty && !!meta.fallback, isOptional: meta.modifier.isOptional, isPedantic: !meta.modifier.isOptional });
], { blockHash, isFallback: isEmpty && !!meta.fallback, isOptional: meta.modifier.isOptional, isPedantic: this.#isPedantic && !meta.modifier.isOptional });
} catch (error) {
throw new Error(`Unable to decode storage ${key.section || 'unknown'}.${key.method || 'unknown'}:${entryNum}: ${(error as Error).message}`);
}
+1 -1
View File
@@ -19,7 +19,7 @@ describe('Cached Observables', (): void => {
beforeEach((): void => {
provider = new MockProvider(registry);
rpc = new RpcCore('123', registry, provider) as (RpcCore & RpcInterface);
rpc = new RpcCore('123', registry, { provider }) as (RpcCore & RpcInterface);
});
afterEach(async () => {
+10 -7
View File
@@ -16,18 +16,21 @@ describe('Api', (): void => {
it('requires a provider with a send method', (): void => {
expect(
() => new RpcCore('234', registry, {} as unknown as ProviderInterface)
() => new RpcCore('234', registry, { provider: {} as unknown as ProviderInterface })
).toThrow(/Expected Provider/);
});
it('allows for the definition of user RPCs', async () => {
const provider = new MockProvider(registry);
const rpc = new RpcCore('567', registry, provider, {
testing: {
foo: {
description: 'foo',
params: [{ name: 'bar', type: 'u32' }],
type: 'Balance'
const rpc = new RpcCore('567', registry, {
provider,
userRpc: {
testing: {
foo: {
description: 'foo',
params: [{ name: 'bar', type: 'u32' }],
type: 'Balance'
}
}
}
});
+1 -1
View File
@@ -38,7 +38,7 @@ describe('methodSend', (): void => {
)
} as unknown as ProviderInterface;
rpc = new RpcCore('987', registry, provider);
rpc = new RpcCore('987', registry, { provider });
});
it('checks for mismatched parameters', async (): Promise<void> => {
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.5.1' };
+1 -1
View File
@@ -17,7 +17,7 @@ describe('replay', (): void => {
beforeEach((): void => {
provider = new MockProvider(registry);
rpc = new RpcCore('653', registry, provider) as (RpcCore & RpcInterface);
rpc = new RpcCore('653', registry, { provider }) as (RpcCore & RpcInterface);
});
afterEach(async () => {
+13 -13
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Transport providers for the API",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"license": "Apache-2.0",
@@ -18,26 +18,26 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/keyring": "^11.1.3",
"@polkadot/types": "10.3.3",
"@polkadot/types-support": "10.3.3",
"@polkadot/util": "^11.1.3",
"@polkadot/util-crypto": "^11.1.3",
"@polkadot/x-fetch": "^11.1.3",
"@polkadot/x-global": "^11.1.3",
"@polkadot/x-ws": "^11.1.3",
"@polkadot/keyring": "^12.1.1",
"@polkadot/types": "10.5.1",
"@polkadot/types-support": "10.5.1",
"@polkadot/util": "^12.1.1",
"@polkadot/util-crypto": "^12.1.1",
"@polkadot/x-fetch": "^12.1.1",
"@polkadot/x-global": "^12.1.1",
"@polkadot/x-ws": "^12.1.1",
"eventemitter3": "^5.0.0",
"mock-socket": "^9.2.1",
"nock": "^13.3.0",
"nock": "^13.3.1",
"tslib": "^2.5.0"
},
"devDependencies": {
"@substrate/connect": "0.7.23"
"@substrate/connect": "0.7.24"
},
"optionalDependencies": {
"@substrate/connect": "0.7.23"
"@substrate/connect": "0.7.24"
}
}
+1 -2
View File
@@ -1,8 +1,7 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { packageInfo } from './packageInfo.js';
export { HttpProvider } from './http/index.js';
export { packageInfo } from './packageInfo.js';
export { ScProvider } from './substrate-connect/index.js';
export { WsProvider } from './ws/index.js';
+2 -4
View File
@@ -3,7 +3,7 @@
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types.js';
import { logger } from '@polkadot/util';
import { logger, noop } from '@polkadot/util';
import { fetch } from '@polkadot/x-fetch';
import { RpcCoder } from '../coder/index.js';
@@ -115,9 +115,7 @@ export class HttpProvider implements ProviderInterface {
public on (_type: ProviderInterfaceEmitted, _sub: ProviderInterfaceEmitCb): () => void {
l.error('HTTP Provider does not have \'on\' emitters, use WebSockets instead');
return (): void => {
// noop
};
return noop;
}
/**
+3 -2
View File
@@ -48,9 +48,10 @@ export class LRUCache {
entries (): [string, unknown][] {
const keys = this.keys();
const entries = new Array<[string, unknown]>(keys.length);
const count = keys.length;
const entries = new Array<[string, unknown]>(count);
for (let i = 0; i < keys.length; i++) {
for (let i = 0; i < count; i++) {
const key = keys[i];
entries[i] = [key, this.#data.get(key)];
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '10.5.1' };
+14 -9
View File
@@ -1,8 +1,7 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable camelcase */
import type { Constructor } from '@polkadot/util/types';
import type { EndpointStats, JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types.js';
import { EventEmitter } from 'eventemitter3';
@@ -209,8 +208,8 @@ export class WsProvider implements ProviderInterface {
try {
this.#endpointIndex = this.selectEndpointIndex(this.#endpoints);
// the as typeof WebSocket here is Deno-specific - not available on the globalThis
this.#websocket = typeof xglobal.WebSocket !== 'undefined' && isChildClass(xglobal.WebSocket as typeof WebSocket, WebSocket)
// the as here is Deno-specific - not available on the globalThis
this.#websocket = typeof xglobal.WebSocket !== 'undefined' && isChildClass(xglobal.WebSocket as unknown as Constructor, WebSocket)
? new WebSocket(this.endpoint)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - WS may be an instance of ws, which supports options
@@ -357,8 +356,12 @@ export class WsProvider implements ProviderInterface {
start: Date.now(),
subscription
};
this.#endpointStats.bytesSent += body.length;
this.#stats.total.bytesSent += body.length;
const bytesSent = body.length;
this.#endpointStats.bytesSent += bytesSent;
this.#stats.total.bytesSent += bytesSent;
this.#websocket.send(body);
} catch (error) {
this.#endpointStats.errors++;
@@ -481,8 +484,10 @@ export class WsProvider implements ProviderInterface {
#onSocketMessage = (message: MessageEvent<string>): void => {
l.debug(() => ['received', message.data]);
this.#endpointStats.bytesRecv += message.data.length;
this.#stats.total.bytesRecv += message.data.length;
const bytesRecv = message.data.length;
this.#endpointStats.bytesRecv += bytesRecv;
this.#stats.total.bytesRecv += bytesRecv;
const response = JSON.parse(message.data) as JsonRpcResponse;
@@ -603,7 +608,7 @@ export class WsProvider implements ProviderInterface {
const now = Date.now();
const ids = Object.keys(this.#handlers);
for (let i = 0; i < ids.length; i++) {
for (let i = 0, count = ids.length; i < count; i++) {
const handler = this.#handlers[ids[i]];
if ((now - handler.start) > this.#timeout) {
+15 -15
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Type generation scripts",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme",
"license": "Apache-2.0",
@@ -18,7 +18,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.mjs",
@@ -28,21 +28,21 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.mjs"
},
"dependencies": {
"@polkadot/api": "10.3.3",
"@polkadot/api-augment": "10.3.3",
"@polkadot/rpc-augment": "10.3.3",
"@polkadot/rpc-provider": "10.3.3",
"@polkadot/types": "10.3.3",
"@polkadot/types-augment": "10.3.3",
"@polkadot/types-codec": "10.3.3",
"@polkadot/types-create": "10.3.3",
"@polkadot/types-support": "10.3.3",
"@polkadot/util": "^11.1.3",
"@polkadot/util-crypto": "^11.1.3",
"@polkadot/x-ws": "^11.1.3",
"@polkadot/api": "10.5.1",
"@polkadot/api-augment": "10.5.1",
"@polkadot/rpc-augment": "10.5.1",
"@polkadot/rpc-provider": "10.5.1",
"@polkadot/types": "10.5.1",
"@polkadot/types-augment": "10.5.1",
"@polkadot/types-codec": "10.5.1",
"@polkadot/types-create": "10.5.1",
"@polkadot/types-support": "10.5.1",
"@polkadot/util": "^12.1.1",
"@polkadot/util-crypto": "^12.1.1",
"@polkadot/x-ws": "^12.1.1",
"handlebars": "^4.7.7",
"tslib": "^2.5.0",
"yargs": "^17.7.1"
"yargs": "^17.7.2"
},
"devDependencies": {
"@types/websocket": "^1.0.5",
+1 -1
View File
@@ -4,7 +4,7 @@
// Connects to the local chain and outputs a re-usable calls-only chain definition in the form
// export default { chain: 'Development', genesisHash: '0x27b6d5e0f4fdce1c4d20b82406f193acacce0c19e0d2c0e7ca47725c2572a06a', ss58Format: 42, tokenDecimals: 0, tokenSymbol: 'UNIT'; metaCalls: 'bWV0...4AAA==' };
import process from 'process';
import process from 'node:process';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
+1 -1
View File
@@ -8,7 +8,7 @@ import type { TypeDef } from '@polkadot/types-create/types';
import type { HexString } from '@polkadot/util/types';
import Handlebars from 'handlebars';
import path from 'path';
import path from 'node:path';
import * as defaultDefinitions from '@polkadot/types/interfaces/definitions';
import staticKusama from '@polkadot/types-support/metadata/static-kusama';
+5 -4
View File
@@ -24,13 +24,13 @@ function getDefs (apis: Apis | null, defs: Record<string, Definitions>): Record<
const named: Record<string, Record<string, DefinitionCallNamed>> = {};
const all = Object.values(defs);
for (let j = 0; j < all.length; j++) {
for (let j = 0, jcount = all.length; j < jcount; j++) {
const set = all[j].runtime;
if (set) {
const sections = Object.entries(set);
for (let i = 0; i < sections.length; i++) {
for (let i = 0, scount = sections.length; i < scount; i++) {
const [_section, sec] = sections[i];
const sectionHash = blake2AsHex(_section, 64);
const api = apis && apis.find(([h]) => h === sectionHash);
@@ -40,15 +40,16 @@ function getDefs (apis: Apis | null, defs: Record<string, Definitions>): Record<
if (ver) {
const methods = Object.entries(ver.methods);
const mcount = methods.length;
if (methods.length) {
if (mcount) {
const section = stringCamelCase(_section);
if (!named[section]) {
named[section] = {};
}
for (let m = 0; m < methods.length; m++) {
for (let m = 0; m < mcount; m++) {
const [_method, def] = methods[m];
const method = stringCamelCase(_method);
+1 -1
View File
@@ -7,7 +7,7 @@ import type { ModuleTypes } from '../util/imports.js';
import type { TypeImports } from '../util/index.js';
import Handlebars from 'handlebars';
import path from 'path';
import path from 'node:path';
import { TypeRegistry } from '@polkadot/types/create';
import * as defaultDefinitions from '@polkadot/types/interfaces/definitions';
+1 -1
View File
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { Metadata } from '@polkadot/types/metadata/Metadata';
import type { Text } from '@polkadot/types/primitive';
import type { Definitions, Registry } from '@polkadot/types/types';
import type { HexString } from '@polkadot/util/types';
import type { ExtraTypes } from './types.js';
@@ -9,7 +10,6 @@ import type { ExtraTypes } from './types.js';
import Handlebars from 'handlebars';
import * as defaultDefs from '@polkadot/types/interfaces/definitions';
import { Text } from '@polkadot/types/primitive';
import lookupDefinitions from '@polkadot/types-augment/lookup/definitions';
import { stringCamelCase } from '@polkadot/util';
+1 -1
View File
@@ -3,6 +3,7 @@
import type { MetadataLatest, SiLookupTypeId } from '@polkadot/types/interfaces';
import type { PortableRegistry } from '@polkadot/types/metadata';
import type { Text } from '@polkadot/types/primitive';
import type { Codec, DefinitionRpcParam } from '@polkadot/types/types';
import type { HexString } from '@polkadot/util/types';
@@ -15,7 +16,6 @@ import { hideBin } from 'yargs/helpers';
import { Metadata, TypeRegistry, Vec } from '@polkadot/types';
import * as definitions from '@polkadot/types/interfaces/definitions';
import { getStorage as getSubstrateStorage } from '@polkadot/types/metadata/decorate/storage/getStorage';
import { Text } from '@polkadot/types/primitive';
import { unwrapStorageType } from '@polkadot/types/util';
import kusamaMeta, { rpc as kusamaRpc, version as kusamaVer } from '@polkadot/types-support/metadata/static-kusama';
import polkadotMeta, { rpc as polkadotRpc, version as polkadotVer } from '@polkadot/types-support/metadata/static-polkadot';
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.5.1' };
+2 -1
View File
@@ -2,12 +2,13 @@
// SPDX-License-Identifier: Apache-2.0
import type { Constructor, Registry } from '@polkadot/types/types';
import type { UInt } from '@polkadot/types-codec';
import type { TypeDef } from '@polkadot/types-create/types';
import type { ModuleTypes, TypeImports } from './imports.js';
import { GenericAccountId, GenericCall, GenericLookupSource, GenericVote } from '@polkadot/types/generic';
import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions';
import { AbstractInt, bool, Compact, Enum, Null, Option, Struct, Tuple, UInt, Vec, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
import { AbstractInt, bool, Compact, Enum, Null, Option, Struct, Tuple, Vec, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
import { getTypeDef, TypeDefInfo } from '@polkadot/types-create';
import { isChildClass, stringify } from '@polkadot/util';
+1 -1
View File
@@ -41,7 +41,7 @@ function splitAlternatives (type: string): string[] {
let level = 0;
// we assume that the string starts with '['
for (let i = 1; i < type.length; i++) {
for (let i = 1, count = type.length; i < count; i++) {
if (level === 0) {
switch (type[i]) {
case ']':
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types/create';
import type { TypeRegistry } from '@polkadot/types/create';
export function registerDefinitions (registry: TypeRegistry, extras: Record<string, Record<string, { types: Record<string, any> }>>): void {
Object.values(extras).forEach((def): void => {
+5 -5
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Types generated augmentation",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-augment#readme",
"license": "Apache-2.0",
@@ -18,12 +18,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/types": "10.3.3",
"@polkadot/types-codec": "10.3.3",
"@polkadot/util": "^11.1.3",
"@polkadot/types": "10.5.1",
"@polkadot/types-codec": "10.5.1",
"@polkadot/util": "^12.1.1",
"tslib": "^2.5.0"
}
}
+4 -4
View File
@@ -164,7 +164,7 @@ export default {
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
},
/**
* Lookup369: polkadot_runtime_parachains::disputes::slashing::pallet::Call<T>
* Lookup368: polkadot_runtime_parachains::disputes::slashing::pallet::Call<T>
**/
PolkadotRuntimeParachainsDisputesSlashingPalletCall: {
_enum: {
@@ -175,7 +175,7 @@ export default {
}
},
/**
* Lookup370: polkadot_runtime_parachains::disputes::slashing::DisputeProof
* Lookup369: polkadot_runtime_parachains::disputes::slashing::DisputeProof
**/
PolkadotRuntimeParachainsDisputesSlashingDisputeProof: {
timeSlot: 'PolkadotRuntimeParachainsDisputesSlashingDisputesTimeSlot',
@@ -184,14 +184,14 @@ export default {
validatorId: 'PolkadotPrimitivesV4ValidatorAppPublic'
},
/**
* Lookup371: polkadot_runtime_parachains::disputes::slashing::DisputesTimeSlot
* Lookup370: polkadot_runtime_parachains::disputes::slashing::DisputesTimeSlot
**/
PolkadotRuntimeParachainsDisputesSlashingDisputesTimeSlot: {
sessionIndex: 'u32',
candidateHash: 'H256'
},
/**
* Lookup372: polkadot_runtime_parachains::disputes::slashing::SlashingOffenceKind
* Lookup371: polkadot_runtime_parachains::disputes::slashing::SlashingOffenceKind
**/
PolkadotRuntimeParachainsDisputesSlashingSlashingOffenceKind: {
_enum: ['ForInvalid', 'AgainstValid']
+70 -71
View File
@@ -856,11 +856,7 @@ export default {
}
},
/**
* Lookup354: polkadot_runtime_parachains::dmp::pallet::Call<T>
**/
PolkadotRuntimeParachainsDmpPalletCall: 'Null',
/**
* Lookup355: polkadot_runtime_parachains::ump::pallet::Call<T>
* Lookup354: polkadot_runtime_parachains::ump::pallet::Call<T>
**/
PolkadotRuntimeParachainsUmpPalletCall: {
_enum: {
@@ -871,7 +867,7 @@ export default {
}
},
/**
* Lookup356: polkadot_runtime_parachains::hrmp::pallet::Call<T>
* Lookup355: polkadot_runtime_parachains::hrmp::pallet::Call<T>
**/
PolkadotRuntimeParachainsHrmpPalletCall: {
_enum: {
@@ -910,20 +906,20 @@ export default {
}
},
/**
* Lookup357: polkadot_parachain::primitives::HrmpChannelId
* Lookup356: polkadot_parachain::primitives::HrmpChannelId
**/
PolkadotParachainPrimitivesHrmpChannelId: {
sender: 'u32',
recipient: 'u32'
},
/**
* Lookup358: polkadot_runtime_parachains::disputes::pallet::Call<T>
* Lookup357: polkadot_runtime_parachains::disputes::pallet::Call<T>
**/
PolkadotRuntimeParachainsDisputesPalletCall: {
_enum: ['force_unfreeze']
},
/**
* Lookup359: polkadot_runtime_common::paras_registrar::pallet::Call<T>
* Lookup358: polkadot_runtime_common::paras_registrar::pallet::Call<T>
**/
PolkadotRuntimeCommonParasRegistrarPalletCall: {
_enum: {
@@ -964,7 +960,7 @@ export default {
}
},
/**
* Lookup360: polkadot_runtime_common::slots::pallet::Call<T>
* Lookup359: polkadot_runtime_common::slots::pallet::Call<T>
**/
PolkadotRuntimeCommonSlotsPalletCall: {
_enum: {
@@ -984,7 +980,7 @@ export default {
}
},
/**
* Lookup361: polkadot_runtime_common::auctions::pallet::Call<T>
* Lookup360: polkadot_runtime_common::auctions::pallet::Call<T>
**/
PolkadotRuntimeCommonAuctionsPalletCall: {
_enum: {
@@ -1003,7 +999,7 @@ export default {
}
},
/**
* Lookup363: polkadot_runtime_common::crowdloan::pallet::Call<T>
* Lookup362: polkadot_runtime_common::crowdloan::pallet::Call<T>
**/
PolkadotRuntimeCommonCrowdloanPalletCall: {
_enum: {
@@ -1052,7 +1048,7 @@ export default {
}
},
/**
* Lookup365: sp_runtime::MultiSigner
* Lookup364: sp_runtime::MultiSigner
**/
SpRuntimeMultiSigner: {
_enum: {
@@ -1062,11 +1058,11 @@ export default {
}
},
/**
* Lookup366: sp_core::ecdsa::Public
* Lookup365: sp_core::ecdsa::Public
**/
SpCoreEcdsaPublic: '[u8;33]',
/**
* Lookup371: pallet_xcm::pallet::Call<T>
* Lookup370: pallet_xcm::pallet::Call<T>
**/
PalletXcmCall: {
_enum: {
@@ -1115,12 +1111,15 @@ export default {
beneficiary: 'XcmVersionedMultiLocation',
assets: 'XcmVersionedMultiAssets',
feeAssetItem: 'u32',
weightLimit: 'XcmV3WeightLimit'
weightLimit: 'XcmV3WeightLimit',
},
force_suspension: {
suspended: 'bool'
}
}
},
/**
* Lookup372: xcm::VersionedMultiLocation
* Lookup371: xcm::VersionedMultiLocation
**/
XcmVersionedMultiLocation: {
_enum: {
@@ -1131,14 +1130,14 @@ export default {
}
},
/**
* Lookup373: xcm::v2::multilocation::MultiLocation
* Lookup372: xcm::v2::multilocation::MultiLocation
**/
XcmV2MultiLocation: {
parents: 'u8',
interior: 'XcmV2MultilocationJunctions'
},
/**
* Lookup374: xcm::v2::multilocation::Junctions
* Lookup373: xcm::v2::multilocation::Junctions
**/
XcmV2MultilocationJunctions: {
_enum: {
@@ -1154,7 +1153,7 @@ export default {
}
},
/**
* Lookup375: xcm::v2::junction::Junction
* Lookup374: xcm::v2::junction::Junction
**/
XcmV2Junction: {
_enum: {
@@ -1182,7 +1181,7 @@ export default {
}
},
/**
* Lookup376: xcm::v2::NetworkId
* Lookup375: xcm::v2::NetworkId
**/
XcmV2NetworkId: {
_enum: {
@@ -1193,7 +1192,7 @@ export default {
}
},
/**
* Lookup378: xcm::v2::BodyId
* Lookup377: xcm::v2::BodyId
**/
XcmV2BodyId: {
_enum: {
@@ -1210,7 +1209,7 @@ export default {
}
},
/**
* Lookup379: xcm::v2::BodyPart
* Lookup378: xcm::v2::BodyPart
**/
XcmV2BodyPart: {
_enum: {
@@ -1233,7 +1232,7 @@ export default {
}
},
/**
* Lookup380: xcm::VersionedXcm<RuntimeCall>
* Lookup379: xcm::VersionedXcm<RuntimeCall>
**/
XcmVersionedXcm: {
_enum: {
@@ -1244,11 +1243,11 @@ export default {
}
},
/**
* Lookup381: xcm::v2::Xcm<RuntimeCall>
* Lookup380: xcm::v2::Xcm<RuntimeCall>
**/
XcmV2Xcm: 'Vec<XcmV2Instruction>',
/**
* Lookup383: xcm::v2::Instruction<RuntimeCall>
* Lookup382: xcm::v2::Instruction<RuntimeCall>
**/
XcmV2Instruction: {
_enum: {
@@ -1346,18 +1345,18 @@ export default {
}
},
/**
* Lookup384: xcm::v2::multiasset::MultiAssets
* Lookup383: xcm::v2::multiasset::MultiAssets
**/
XcmV2MultiassetMultiAssets: 'Vec<XcmV2MultiAsset>',
/**
* Lookup386: xcm::v2::multiasset::MultiAsset
* Lookup385: xcm::v2::multiasset::MultiAsset
**/
XcmV2MultiAsset: {
id: 'XcmV2MultiassetAssetId',
fun: 'XcmV2MultiassetFungibility'
},
/**
* Lookup387: xcm::v2::multiasset::AssetId
* Lookup386: xcm::v2::multiasset::AssetId
**/
XcmV2MultiassetAssetId: {
_enum: {
@@ -1366,7 +1365,7 @@ export default {
}
},
/**
* Lookup388: xcm::v2::multiasset::Fungibility
* Lookup387: xcm::v2::multiasset::Fungibility
**/
XcmV2MultiassetFungibility: {
_enum: {
@@ -1375,7 +1374,7 @@ export default {
}
},
/**
* Lookup389: xcm::v2::multiasset::AssetInstance
* Lookup388: xcm::v2::multiasset::AssetInstance
**/
XcmV2MultiassetAssetInstance: {
_enum: {
@@ -1389,7 +1388,7 @@ export default {
}
},
/**
* Lookup390: xcm::v2::Response
* Lookup389: xcm::v2::Response
**/
XcmV2Response: {
_enum: {
@@ -1400,7 +1399,7 @@ export default {
}
},
/**
* Lookup393: xcm::v2::traits::Error
* Lookup392: xcm::v2::traits::Error
**/
XcmV2TraitsError: {
_enum: {
@@ -1433,19 +1432,19 @@ export default {
}
},
/**
* Lookup394: xcm::v2::OriginKind
* Lookup393: xcm::v2::OriginKind
**/
XcmV2OriginKind: {
_enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm']
},
/**
* Lookup395: xcm::double_encoded::DoubleEncoded<T>
* Lookup394: xcm::double_encoded::DoubleEncoded<T>
**/
XcmDoubleEncoded: {
encoded: 'Bytes'
},
/**
* Lookup396: xcm::v2::multiasset::MultiAssetFilter
* Lookup395: xcm::v2::multiasset::MultiAssetFilter
**/
XcmV2MultiassetMultiAssetFilter: {
_enum: {
@@ -1454,7 +1453,7 @@ export default {
}
},
/**
* Lookup397: xcm::v2::multiasset::WildMultiAsset
* Lookup396: xcm::v2::multiasset::WildMultiAsset
**/
XcmV2MultiassetWildMultiAsset: {
_enum: {
@@ -1466,13 +1465,13 @@ export default {
}
},
/**
* Lookup398: xcm::v2::multiasset::WildFungibility
* Lookup397: xcm::v2::multiasset::WildFungibility
**/
XcmV2MultiassetWildFungibility: {
_enum: ['Fungible', 'NonFungible']
},
/**
* Lookup399: xcm::v2::WeightLimit
* Lookup398: xcm::v2::WeightLimit
**/
XcmV2WeightLimit: {
_enum: {
@@ -1481,11 +1480,11 @@ export default {
}
},
/**
* Lookup400: xcm::v3::Xcm<Call>
* Lookup399: xcm::v3::Xcm<Call>
**/
XcmV3Xcm: 'Vec<XcmV3Instruction>',
/**
* Lookup402: xcm::v3::Instruction<Call>
* Lookup401: xcm::v3::Instruction<Call>
**/
XcmV3Instruction: {
_enum: {
@@ -1627,18 +1626,18 @@ export default {
}
},
/**
* Lookup403: xcm::v3::multiasset::MultiAssets
* Lookup402: xcm::v3::multiasset::MultiAssets
**/
XcmV3MultiassetMultiAssets: 'Vec<XcmV3MultiAsset>',
/**
* Lookup405: xcm::v3::multiasset::MultiAsset
* Lookup404: xcm::v3::multiasset::MultiAsset
**/
XcmV3MultiAsset: {
id: 'XcmV3MultiassetAssetId',
fun: 'XcmV3MultiassetFungibility'
},
/**
* Lookup406: xcm::v3::multiasset::AssetId
* Lookup405: xcm::v3::multiasset::AssetId
**/
XcmV3MultiassetAssetId: {
_enum: {
@@ -1647,7 +1646,7 @@ export default {
}
},
/**
* Lookup407: xcm::v3::multiasset::Fungibility
* Lookup406: xcm::v3::multiasset::Fungibility
**/
XcmV3MultiassetFungibility: {
_enum: {
@@ -1656,7 +1655,7 @@ export default {
}
},
/**
* Lookup408: xcm::v3::multiasset::AssetInstance
* Lookup407: xcm::v3::multiasset::AssetInstance
**/
XcmV3MultiassetAssetInstance: {
_enum: {
@@ -1669,7 +1668,7 @@ export default {
}
},
/**
* Lookup409: xcm::v3::Response
* Lookup408: xcm::v3::Response
**/
XcmV3Response: {
_enum: {
@@ -1682,7 +1681,7 @@ export default {
}
},
/**
* Lookup412: xcm::v3::traits::Error
* Lookup411: xcm::v3::traits::Error
**/
XcmV3TraitsError: {
_enum: {
@@ -1729,7 +1728,7 @@ export default {
}
},
/**
* Lookup414: xcm::v3::PalletInfo
* Lookup413: xcm::v3::PalletInfo
**/
XcmV3PalletInfo: {
index: 'Compact<u32>',
@@ -1740,7 +1739,7 @@ export default {
patch: 'Compact<u32>'
},
/**
* Lookup417: xcm::v3::MaybeErrorCode
* Lookup416: xcm::v3::MaybeErrorCode
**/
XcmV3MaybeErrorCode: {
_enum: {
@@ -1750,7 +1749,7 @@ export default {
}
},
/**
* Lookup420: xcm::v3::QueryResponseInfo
* Lookup419: xcm::v3::QueryResponseInfo
**/
XcmV3QueryResponseInfo: {
destination: 'XcmV3MultiLocation',
@@ -1758,7 +1757,7 @@ export default {
maxWeight: 'SpWeightsWeightV2Weight'
},
/**
* Lookup421: xcm::v3::multiasset::MultiAssetFilter
* Lookup420: xcm::v3::multiasset::MultiAssetFilter
**/
XcmV3MultiassetMultiAssetFilter: {
_enum: {
@@ -1767,7 +1766,7 @@ export default {
}
},
/**
* Lookup422: xcm::v3::multiasset::WildMultiAsset
* Lookup421: xcm::v3::multiasset::WildMultiAsset
**/
XcmV3MultiassetWildMultiAsset: {
_enum: {
@@ -1785,13 +1784,13 @@ export default {
}
},
/**
* Lookup423: xcm::v3::multiasset::WildFungibility
* Lookup422: xcm::v3::multiasset::WildFungibility
**/
XcmV3MultiassetWildFungibility: {
_enum: ['Fungible', 'NonFungible']
},
/**
* Lookup424: xcm::v3::WeightLimit
* Lookup423: xcm::v3::WeightLimit
**/
XcmV3WeightLimit: {
_enum: {
@@ -1800,7 +1799,7 @@ export default {
}
},
/**
* Lookup425: xcm::VersionedMultiAssets
* Lookup424: xcm::VersionedMultiAssets
**/
XcmVersionedMultiAssets: {
_enum: {
@@ -1811,7 +1810,7 @@ export default {
}
},
/**
* Lookup441: polkadot_runtime_common::claims::pallet::Event<T>
* Lookup440: polkadot_runtime_common::claims::pallet::Event<T>
**/
PolkadotRuntimeCommonClaimsPalletEvent: {
_enum: {
@@ -1823,7 +1822,7 @@ export default {
}
},
/**
* Lookup457: polkadot_runtime_parachains::inclusion::pallet::Event<T>
* Lookup456: polkadot_runtime_parachains::inclusion::pallet::Event<T>
**/
PolkadotRuntimeParachainsInclusionPalletEvent: {
_enum: {
@@ -1833,14 +1832,14 @@ export default {
}
},
/**
* Lookup458: polkadot_primitives::v4::CandidateReceipt<primitive_types::H256>
* Lookup457: polkadot_primitives::v4::CandidateReceipt<primitive_types::H256>
**/
PolkadotPrimitivesV4CandidateReceipt: {
descriptor: 'PolkadotPrimitivesV4CandidateDescriptor',
commitmentsHash: 'H256'
},
/**
* Lookup461: polkadot_runtime_parachains::paras::pallet::Event
* Lookup460: polkadot_runtime_parachains::paras::pallet::Event
**/
PolkadotRuntimeParachainsParasPalletEvent: {
_enum: {
@@ -1855,7 +1854,7 @@ export default {
}
},
/**
* Lookup462: polkadot_runtime_parachains::ump::pallet::Event
* Lookup461: polkadot_runtime_parachains::ump::pallet::Event
**/
PolkadotRuntimeParachainsUmpPalletEvent: {
_enum: {
@@ -1869,7 +1868,7 @@ export default {
}
},
/**
* Lookup463: xcm::v3::traits::Outcome
* Lookup462: xcm::v3::traits::Outcome
**/
XcmV3TraitsOutcome: {
_enum: {
@@ -1879,7 +1878,7 @@ export default {
}
},
/**
* Lookup464: polkadot_runtime_parachains::hrmp::pallet::Event<T>
* Lookup463: polkadot_runtime_parachains::hrmp::pallet::Event<T>
**/
PolkadotRuntimeParachainsHrmpPalletEvent: {
_enum: {
@@ -1891,7 +1890,7 @@ export default {
}
},
/**
* Lookup465: polkadot_runtime_parachains::disputes::pallet::Event<T>
* Lookup464: polkadot_runtime_parachains::disputes::pallet::Event<T>
**/
PolkadotRuntimeParachainsDisputesPalletEvent: {
_enum: {
@@ -1901,19 +1900,19 @@ export default {
}
},
/**
* Lookup466: polkadot_runtime_parachains::disputes::DisputeLocation
* Lookup465: polkadot_runtime_parachains::disputes::DisputeLocation
**/
PolkadotRuntimeParachainsDisputesDisputeLocation: {
_enum: ['Local', 'Remote']
},
/**
* Lookup467: polkadot_runtime_parachains::disputes::DisputeResult
* Lookup466: polkadot_runtime_parachains::disputes::DisputeResult
**/
PolkadotRuntimeParachainsDisputesDisputeResult: {
_enum: ['Valid', 'Invalid']
},
/**
* Lookup468: polkadot_runtime_common::paras_registrar::pallet::Event<T>
* Lookup467: polkadot_runtime_common::paras_registrar::pallet::Event<T>
**/
PolkadotRuntimeCommonParasRegistrarPalletEvent: {
_enum: {
@@ -1931,7 +1930,7 @@ export default {
}
},
/**
* Lookup469: polkadot_runtime_common::slots::pallet::Event<T>
* Lookup468: polkadot_runtime_common::slots::pallet::Event<T>
**/
PolkadotRuntimeCommonSlotsPalletEvent: {
_enum: {
@@ -1949,7 +1948,7 @@ export default {
}
},
/**
* Lookup470: polkadot_runtime_common::auctions::pallet::Event<T>
* Lookup469: polkadot_runtime_common::auctions::pallet::Event<T>
**/
PolkadotRuntimeCommonAuctionsPalletEvent: {
_enum: {
@@ -1989,7 +1988,7 @@ export default {
}
},
/**
* Lookup471: polkadot_runtime_common::crowdloan::pallet::Event<T>
* Lookup470: polkadot_runtime_common::crowdloan::pallet::Event<T>
**/
PolkadotRuntimeCommonCrowdloanPalletEvent: {
_enum: {
@@ -2033,7 +2032,7 @@ export default {
}
},
/**
* Lookup472: pallet_xcm::pallet::Event<T>
* Lookup471: pallet_xcm::pallet::Event<T>
**/
PalletXcmEvent: {
_enum: {
File diff suppressed because it is too large Load Diff
@@ -108,7 +108,7 @@ declare module '@polkadot/types/lookup' {
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
}
/** @name PolkadotRuntimeParachainsDisputesSlashingPalletCall (369) */
/** @name PolkadotRuntimeParachainsDisputesSlashingPalletCall (368) */
interface PolkadotRuntimeParachainsDisputesSlashingPalletCall extends Enum {
readonly isReportDisputeLostUnsigned: boolean;
readonly asReportDisputeLostUnsigned: {
@@ -118,7 +118,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'ReportDisputeLostUnsigned';
}
/** @name PolkadotRuntimeParachainsDisputesSlashingDisputeProof (370) */
/** @name PolkadotRuntimeParachainsDisputesSlashingDisputeProof (369) */
interface PolkadotRuntimeParachainsDisputesSlashingDisputeProof extends Struct {
readonly timeSlot: PolkadotRuntimeParachainsDisputesSlashingDisputesTimeSlot;
readonly kind: PolkadotRuntimeParachainsDisputesSlashingSlashingOffenceKind;
@@ -126,13 +126,13 @@ declare module '@polkadot/types/lookup' {
readonly validatorId: PolkadotPrimitivesV4ValidatorAppPublic;
}
/** @name PolkadotRuntimeParachainsDisputesSlashingDisputesTimeSlot (371) */
/** @name PolkadotRuntimeParachainsDisputesSlashingDisputesTimeSlot (370) */
interface PolkadotRuntimeParachainsDisputesSlashingDisputesTimeSlot extends Struct {
readonly sessionIndex: u32;
readonly candidateHash: H256;
}
/** @name PolkadotRuntimeParachainsDisputesSlashingSlashingOffenceKind (372) */
/** @name PolkadotRuntimeParachainsDisputesSlashingSlashingOffenceKind (371) */
interface PolkadotRuntimeParachainsDisputesSlashingSlashingOffenceKind extends Enum {
readonly isForInvalid: boolean;
readonly isAgainstValid: boolean;
@@ -700,10 +700,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'ForceApprove';
}
/** @name PolkadotRuntimeParachainsDmpPalletCall (354) */
type PolkadotRuntimeParachainsDmpPalletCall = Null;
/** @name PolkadotRuntimeParachainsUmpPalletCall (355) */
/** @name PolkadotRuntimeParachainsUmpPalletCall (354) */
interface PolkadotRuntimeParachainsUmpPalletCall extends Enum {
readonly isServiceOverweight: boolean;
readonly asServiceOverweight: {
@@ -713,7 +710,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'ServiceOverweight';
}
/** @name PolkadotRuntimeParachainsHrmpPalletCall (356) */
/** @name PolkadotRuntimeParachainsHrmpPalletCall (355) */
interface PolkadotRuntimeParachainsHrmpPalletCall extends Enum {
readonly isHrmpInitOpenChannel: boolean;
readonly asHrmpInitOpenChannel: {
@@ -758,19 +755,19 @@ declare module '@polkadot/types/lookup' {
readonly type: 'HrmpInitOpenChannel' | 'HrmpAcceptOpenChannel' | 'HrmpCloseChannel' | 'ForceCleanHrmp' | 'ForceProcessHrmpOpen' | 'ForceProcessHrmpClose' | 'HrmpCancelOpenRequest' | 'ForceOpenHrmpChannel';
}
/** @name PolkadotParachainPrimitivesHrmpChannelId (357) */
/** @name PolkadotParachainPrimitivesHrmpChannelId (356) */
interface PolkadotParachainPrimitivesHrmpChannelId extends Struct {
readonly sender: u32;
readonly recipient: u32;
}
/** @name PolkadotRuntimeParachainsDisputesPalletCall (358) */
/** @name PolkadotRuntimeParachainsDisputesPalletCall (357) */
interface PolkadotRuntimeParachainsDisputesPalletCall extends Enum {
readonly isForceUnfreeze: boolean;
readonly type: 'ForceUnfreeze';
}
/** @name PolkadotRuntimeCommonParasRegistrarPalletCall (359) */
/** @name PolkadotRuntimeCommonParasRegistrarPalletCall (358) */
interface PolkadotRuntimeCommonParasRegistrarPalletCall extends Enum {
readonly isRegister: boolean;
readonly asRegister: {
@@ -817,7 +814,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Register' | 'ForceRegister' | 'Deregister' | 'Swap' | 'RemoveLock' | 'Reserve' | 'AddLock' | 'ScheduleCodeUpgrade' | 'SetCurrentHead';
}
/** @name PolkadotRuntimeCommonSlotsPalletCall (360) */
/** @name PolkadotRuntimeCommonSlotsPalletCall (359) */
interface PolkadotRuntimeCommonSlotsPalletCall extends Enum {
readonly isForceLease: boolean;
readonly asForceLease: {
@@ -838,7 +835,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'ForceLease' | 'ClearAllLeases' | 'TriggerOnboard';
}
/** @name PolkadotRuntimeCommonAuctionsPalletCall (361) */
/** @name PolkadotRuntimeCommonAuctionsPalletCall (360) */
interface PolkadotRuntimeCommonAuctionsPalletCall extends Enum {
readonly isNewAuction: boolean;
readonly asNewAuction: {
@@ -857,7 +854,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'NewAuction' | 'Bid' | 'CancelAuction';
}
/** @name PolkadotRuntimeCommonCrowdloanPalletCall (363) */
/** @name PolkadotRuntimeCommonCrowdloanPalletCall (362) */
interface PolkadotRuntimeCommonCrowdloanPalletCall extends Enum {
readonly isCreate: boolean;
readonly asCreate: {
@@ -913,7 +910,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Create' | 'Contribute' | 'Withdraw' | 'Refund' | 'Dissolve' | 'Edit' | 'AddMemo' | 'Poke' | 'ContributeAll';
}
/** @name SpRuntimeMultiSigner (365) */
/** @name SpRuntimeMultiSigner (364) */
interface SpRuntimeMultiSigner extends Enum {
readonly isEd25519: boolean;
readonly asEd25519: SpCoreEd25519Public;
@@ -924,10 +921,10 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
}
/** @name SpCoreEcdsaPublic (366) */
/** @name SpCoreEcdsaPublic (365) */
interface SpCoreEcdsaPublic extends U8aFixed {}
/** @name PalletXcmCall (371) */
/** @name PalletXcmCall (370) */
interface PalletXcmCall extends Enum {
readonly isSend: boolean;
readonly asSend: {
@@ -986,10 +983,14 @@ declare module '@polkadot/types/lookup' {
readonly feeAssetItem: u32;
readonly weightLimit: XcmV3WeightLimit;
} & Struct;
readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets';
readonly isForceSuspension: boolean;
readonly asForceSuspension: {
readonly suspended: bool;
} & Struct;
readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets' | 'ForceSuspension';
}
/** @name XcmVersionedMultiLocation (372) */
/** @name XcmVersionedMultiLocation (371) */
interface XcmVersionedMultiLocation extends Enum {
readonly isV2: boolean;
readonly asV2: XcmV2MultiLocation;
@@ -998,13 +999,13 @@ declare module '@polkadot/types/lookup' {
readonly type: 'V2' | 'V3';
}
/** @name XcmV2MultiLocation (373) */
/** @name XcmV2MultiLocation (372) */
interface XcmV2MultiLocation extends Struct {
readonly parents: u8;
readonly interior: XcmV2MultilocationJunctions;
}
/** @name XcmV2MultilocationJunctions (374) */
/** @name XcmV2MultilocationJunctions (373) */
interface XcmV2MultilocationJunctions extends Enum {
readonly isHere: boolean;
readonly isX1: boolean;
@@ -1026,7 +1027,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';
}
/** @name XcmV2Junction (375) */
/** @name XcmV2Junction (374) */
interface XcmV2Junction extends Enum {
readonly isParachain: boolean;
readonly asParachain: Compact<u32>;
@@ -1060,7 +1061,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';
}
/** @name XcmV2NetworkId (376) */
/** @name XcmV2NetworkId (375) */
interface XcmV2NetworkId extends Enum {
readonly isAny: boolean;
readonly isNamed: boolean;
@@ -1070,7 +1071,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';
}
/** @name XcmV2BodyId (378) */
/** @name XcmV2BodyId (377) */
interface XcmV2BodyId extends Enum {
readonly isUnit: boolean;
readonly isNamed: boolean;
@@ -1087,7 +1088,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial' | 'Defense' | 'Administration' | 'Treasury';
}
/** @name XcmV2BodyPart (379) */
/** @name XcmV2BodyPart (378) */
interface XcmV2BodyPart extends Enum {
readonly isVoice: boolean;
readonly isMembers: boolean;
@@ -1112,7 +1113,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';
}
/** @name XcmVersionedXcm (380) */
/** @name XcmVersionedXcm (379) */
interface XcmVersionedXcm extends Enum {
readonly isV2: boolean;
readonly asV2: XcmV2Xcm;
@@ -1121,10 +1122,10 @@ declare module '@polkadot/types/lookup' {
readonly type: 'V2' | 'V3';
}
/** @name XcmV2Xcm (381) */
/** @name XcmV2Xcm (380) */
interface XcmV2Xcm extends Vec<XcmV2Instruction> {}
/** @name XcmV2Instruction (383) */
/** @name XcmV2Instruction (382) */
interface XcmV2Instruction extends Enum {
readonly isWithdrawAsset: boolean;
readonly asWithdrawAsset: XcmV2MultiassetMultiAssets;
@@ -1244,16 +1245,16 @@ declare module '@polkadot/types/lookup' {
readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion';
}
/** @name XcmV2MultiassetMultiAssets (384) */
/** @name XcmV2MultiassetMultiAssets (383) */
interface XcmV2MultiassetMultiAssets extends Vec<XcmV2MultiAsset> {}
/** @name XcmV2MultiAsset (386) */
/** @name XcmV2MultiAsset (385) */
interface XcmV2MultiAsset extends Struct {
readonly id: XcmV2MultiassetAssetId;
readonly fun: XcmV2MultiassetFungibility;
}
/** @name XcmV2MultiassetAssetId (387) */
/** @name XcmV2MultiassetAssetId (386) */
interface XcmV2MultiassetAssetId extends Enum {
readonly isConcrete: boolean;
readonly asConcrete: XcmV2MultiLocation;
@@ -1262,7 +1263,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Concrete' | 'Abstract';
}
/** @name XcmV2MultiassetFungibility (388) */
/** @name XcmV2MultiassetFungibility (387) */
interface XcmV2MultiassetFungibility extends Enum {
readonly isFungible: boolean;
readonly asFungible: Compact<u128>;
@@ -1271,7 +1272,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Fungible' | 'NonFungible';
}
/** @name XcmV2MultiassetAssetInstance (389) */
/** @name XcmV2MultiassetAssetInstance (388) */
interface XcmV2MultiassetAssetInstance extends Enum {
readonly isUndefined: boolean;
readonly isIndex: boolean;
@@ -1289,7 +1290,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';
}
/** @name XcmV2Response (390) */
/** @name XcmV2Response (389) */
interface XcmV2Response extends Enum {
readonly isNull: boolean;
readonly isAssets: boolean;
@@ -1301,7 +1302,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';
}
/** @name XcmV2TraitsError (393) */
/** @name XcmV2TraitsError (392) */
interface XcmV2TraitsError extends Enum {
readonly isOverflow: boolean;
readonly isUnimplemented: boolean;
@@ -1334,7 +1335,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable';
}
/** @name XcmV2OriginKind (394) */
/** @name XcmV2OriginKind (393) */
interface XcmV2OriginKind extends Enum {
readonly isNative: boolean;
readonly isSovereignAccount: boolean;
@@ -1343,12 +1344,12 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm';
}
/** @name XcmDoubleEncoded (395) */
/** @name XcmDoubleEncoded (394) */
interface XcmDoubleEncoded extends Struct {
readonly encoded: Bytes;
}
/** @name XcmV2MultiassetMultiAssetFilter (396) */
/** @name XcmV2MultiassetMultiAssetFilter (395) */
interface XcmV2MultiassetMultiAssetFilter extends Enum {
readonly isDefinite: boolean;
readonly asDefinite: XcmV2MultiassetMultiAssets;
@@ -1357,7 +1358,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Definite' | 'Wild';
}
/** @name XcmV2MultiassetWildMultiAsset (397) */
/** @name XcmV2MultiassetWildMultiAsset (396) */
interface XcmV2MultiassetWildMultiAsset extends Enum {
readonly isAll: boolean;
readonly isAllOf: boolean;
@@ -1368,14 +1369,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'All' | 'AllOf';
}
/** @name XcmV2MultiassetWildFungibility (398) */
/** @name XcmV2MultiassetWildFungibility (397) */
interface XcmV2MultiassetWildFungibility extends Enum {
readonly isFungible: boolean;
readonly isNonFungible: boolean;
readonly type: 'Fungible' | 'NonFungible';
}
/** @name XcmV2WeightLimit (399) */
/** @name XcmV2WeightLimit (398) */
interface XcmV2WeightLimit extends Enum {
readonly isUnlimited: boolean;
readonly isLimited: boolean;
@@ -1383,10 +1384,10 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Unlimited' | 'Limited';
}
/** @name XcmV3Xcm (400) */
/** @name XcmV3Xcm (399) */
interface XcmV3Xcm extends Vec<XcmV3Instruction> {}
/** @name XcmV3Instruction (402) */
/** @name XcmV3Instruction (401) */
interface XcmV3Instruction extends Enum {
readonly isWithdrawAsset: boolean;
readonly asWithdrawAsset: XcmV3MultiassetMultiAssets;
@@ -1568,16 +1569,16 @@ declare module '@polkadot/types/lookup' {
readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'ReportHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion' | 'BurnAsset' | 'ExpectAsset' | 'ExpectOrigin' | 'ExpectError' | 'ExpectTransactStatus' | 'QueryPallet' | 'ExpectPallet' | 'ReportTransactStatus' | 'ClearTransactStatus' | 'UniversalOrigin' | 'ExportMessage' | 'LockAsset' | 'UnlockAsset' | 'NoteUnlockable' | 'RequestUnlock' | 'SetFeesMode' | 'SetTopic' | 'ClearTopic' | 'AliasOrigin' | 'UnpaidExecution';
}
/** @name XcmV3MultiassetMultiAssets (403) */
/** @name XcmV3MultiassetMultiAssets (402) */
interface XcmV3MultiassetMultiAssets extends Vec<XcmV3MultiAsset> {}
/** @name XcmV3MultiAsset (405) */
/** @name XcmV3MultiAsset (404) */
interface XcmV3MultiAsset extends Struct {
readonly id: XcmV3MultiassetAssetId;
readonly fun: XcmV3MultiassetFungibility;
}
/** @name XcmV3MultiassetAssetId (406) */
/** @name XcmV3MultiassetAssetId (405) */
interface XcmV3MultiassetAssetId extends Enum {
readonly isConcrete: boolean;
readonly asConcrete: XcmV3MultiLocation;
@@ -1586,7 +1587,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Concrete' | 'Abstract';
}
/** @name XcmV3MultiassetFungibility (407) */
/** @name XcmV3MultiassetFungibility (406) */
interface XcmV3MultiassetFungibility extends Enum {
readonly isFungible: boolean;
readonly asFungible: Compact<u128>;
@@ -1595,7 +1596,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Fungible' | 'NonFungible';
}
/** @name XcmV3MultiassetAssetInstance (408) */
/** @name XcmV3MultiassetAssetInstance (407) */
interface XcmV3MultiassetAssetInstance extends Enum {
readonly isUndefined: boolean;
readonly isIndex: boolean;
@@ -1611,7 +1612,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32';
}
/** @name XcmV3Response (409) */
/** @name XcmV3Response (408) */
interface XcmV3Response extends Enum {
readonly isNull: boolean;
readonly isAssets: boolean;
@@ -1627,7 +1628,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version' | 'PalletsInfo' | 'DispatchResult';
}
/** @name XcmV3TraitsError (412) */
/** @name XcmV3TraitsError (411) */
interface XcmV3TraitsError extends Enum {
readonly isOverflow: boolean;
readonly isUnimplemented: boolean;
@@ -1674,7 +1675,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'LocationFull' | 'LocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'ExpectationFalse' | 'PalletNotFound' | 'NameMismatch' | 'VersionIncompatible' | 'HoldingWouldOverflow' | 'ExportError' | 'ReanchorFailed' | 'NoDeal' | 'FeesNotMet' | 'LockError' | 'NoPermission' | 'Unanchored' | 'NotDepositable' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable' | 'ExceedsStackLimit';
}
/** @name XcmV3PalletInfo (414) */
/** @name XcmV3PalletInfo (413) */
interface XcmV3PalletInfo extends Struct {
readonly index: Compact<u32>;
readonly name: Bytes;
@@ -1684,7 +1685,7 @@ declare module '@polkadot/types/lookup' {
readonly patch: Compact<u32>;
}
/** @name XcmV3MaybeErrorCode (417) */
/** @name XcmV3MaybeErrorCode (416) */
interface XcmV3MaybeErrorCode extends Enum {
readonly isSuccess: boolean;
readonly isError: boolean;
@@ -1694,14 +1695,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Success' | 'Error' | 'TruncatedError';
}
/** @name XcmV3QueryResponseInfo (420) */
/** @name XcmV3QueryResponseInfo (419) */
interface XcmV3QueryResponseInfo extends Struct {
readonly destination: XcmV3MultiLocation;
readonly queryId: Compact<u64>;
readonly maxWeight: SpWeightsWeightV2Weight;
}
/** @name XcmV3MultiassetMultiAssetFilter (421) */
/** @name XcmV3MultiassetMultiAssetFilter (420) */
interface XcmV3MultiassetMultiAssetFilter extends Enum {
readonly isDefinite: boolean;
readonly asDefinite: XcmV3MultiassetMultiAssets;
@@ -1710,7 +1711,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Definite' | 'Wild';
}
/** @name XcmV3MultiassetWildMultiAsset (422) */
/** @name XcmV3MultiassetWildMultiAsset (421) */
interface XcmV3MultiassetWildMultiAsset extends Enum {
readonly isAll: boolean;
readonly isAllOf: boolean;
@@ -1729,14 +1730,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'All' | 'AllOf' | 'AllCounted' | 'AllOfCounted';
}
/** @name XcmV3MultiassetWildFungibility (423) */
/** @name XcmV3MultiassetWildFungibility (422) */
interface XcmV3MultiassetWildFungibility extends Enum {
readonly isFungible: boolean;
readonly isNonFungible: boolean;
readonly type: 'Fungible' | 'NonFungible';
}
/** @name XcmV3WeightLimit (424) */
/** @name XcmV3WeightLimit (423) */
interface XcmV3WeightLimit extends Enum {
readonly isUnlimited: boolean;
readonly isLimited: boolean;
@@ -1744,7 +1745,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Unlimited' | 'Limited';
}
/** @name XcmVersionedMultiAssets (425) */
/** @name XcmVersionedMultiAssets (424) */
interface XcmVersionedMultiAssets extends Enum {
readonly isV2: boolean;
readonly asV2: XcmV2MultiassetMultiAssets;
@@ -1753,7 +1754,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'V2' | 'V3';
}
/** @name PolkadotRuntimeCommonClaimsPalletEvent (441) */
/** @name PolkadotRuntimeCommonClaimsPalletEvent (440) */
interface PolkadotRuntimeCommonClaimsPalletEvent extends Enum {
readonly isClaimed: boolean;
readonly asClaimed: {
@@ -1764,7 +1765,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Claimed';
}
/** @name PolkadotRuntimeParachainsInclusionPalletEvent (457) */
/** @name PolkadotRuntimeParachainsInclusionPalletEvent (456) */
interface PolkadotRuntimeParachainsInclusionPalletEvent extends Enum {
readonly isCandidateBacked: boolean;
readonly asCandidateBacked: ITuple<[PolkadotPrimitivesV4CandidateReceipt, Bytes, u32, u32]>;
@@ -1775,13 +1776,13 @@ declare module '@polkadot/types/lookup' {
readonly type: 'CandidateBacked' | 'CandidateIncluded' | 'CandidateTimedOut';
}
/** @name PolkadotPrimitivesV4CandidateReceipt (458) */
/** @name PolkadotPrimitivesV4CandidateReceipt (457) */
interface PolkadotPrimitivesV4CandidateReceipt extends Struct {
readonly descriptor: PolkadotPrimitivesV4CandidateDescriptor;
readonly commitmentsHash: H256;
}
/** @name PolkadotRuntimeParachainsParasPalletEvent (461) */
/** @name PolkadotRuntimeParachainsParasPalletEvent (460) */
interface PolkadotRuntimeParachainsParasPalletEvent extends Enum {
readonly isCurrentCodeUpdated: boolean;
readonly asCurrentCodeUpdated: u32;
@@ -1802,7 +1803,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'CurrentCodeUpdated' | 'CurrentHeadUpdated' | 'CodeUpgradeScheduled' | 'NewHeadNoted' | 'ActionQueued' | 'PvfCheckStarted' | 'PvfCheckAccepted' | 'PvfCheckRejected';
}
/** @name PolkadotRuntimeParachainsUmpPalletEvent (462) */
/** @name PolkadotRuntimeParachainsUmpPalletEvent (461) */
interface PolkadotRuntimeParachainsUmpPalletEvent extends Enum {
readonly isInvalidFormat: boolean;
readonly asInvalidFormat: U8aFixed;
@@ -1821,7 +1822,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedUpward' | 'WeightExhausted' | 'UpwardMessagesReceived' | 'OverweightEnqueued' | 'OverweightServiced';
}
/** @name XcmV3TraitsOutcome (463) */
/** @name XcmV3TraitsOutcome (462) */
interface XcmV3TraitsOutcome extends Enum {
readonly isComplete: boolean;
readonly asComplete: SpWeightsWeightV2Weight;
@@ -1832,7 +1833,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Complete' | 'Incomplete' | 'Error';
}
/** @name PolkadotRuntimeParachainsHrmpPalletEvent (464) */
/** @name PolkadotRuntimeParachainsHrmpPalletEvent (463) */
interface PolkadotRuntimeParachainsHrmpPalletEvent extends Enum {
readonly isOpenChannelRequested: boolean;
readonly asOpenChannelRequested: ITuple<[u32, u32, u32, u32]>;
@@ -1847,7 +1848,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'OpenChannelRequested' | 'OpenChannelCanceled' | 'OpenChannelAccepted' | 'ChannelClosed' | 'HrmpChannelForceOpened';
}
/** @name PolkadotRuntimeParachainsDisputesPalletEvent (465) */
/** @name PolkadotRuntimeParachainsDisputesPalletEvent (464) */
interface PolkadotRuntimeParachainsDisputesPalletEvent extends Enum {
readonly isDisputeInitiated: boolean;
readonly asDisputeInitiated: ITuple<[H256, PolkadotRuntimeParachainsDisputesDisputeLocation]>;
@@ -1858,21 +1859,21 @@ declare module '@polkadot/types/lookup' {
readonly type: 'DisputeInitiated' | 'DisputeConcluded' | 'Revert';
}
/** @name PolkadotRuntimeParachainsDisputesDisputeLocation (466) */
/** @name PolkadotRuntimeParachainsDisputesDisputeLocation (465) */
interface PolkadotRuntimeParachainsDisputesDisputeLocation extends Enum {
readonly isLocal: boolean;
readonly isRemote: boolean;
readonly type: 'Local' | 'Remote';
}
/** @name PolkadotRuntimeParachainsDisputesDisputeResult (467) */
/** @name PolkadotRuntimeParachainsDisputesDisputeResult (466) */
interface PolkadotRuntimeParachainsDisputesDisputeResult extends Enum {
readonly isValid: boolean;
readonly isInvalid: boolean;
readonly type: 'Valid' | 'Invalid';
}
/** @name PolkadotRuntimeCommonParasRegistrarPalletEvent (468) */
/** @name PolkadotRuntimeCommonParasRegistrarPalletEvent (467) */
interface PolkadotRuntimeCommonParasRegistrarPalletEvent extends Enum {
readonly isRegistered: boolean;
readonly asRegistered: {
@@ -1891,7 +1892,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Registered' | 'Deregistered' | 'Reserved';
}
/** @name PolkadotRuntimeCommonSlotsPalletEvent (469) */
/** @name PolkadotRuntimeCommonSlotsPalletEvent (468) */
interface PolkadotRuntimeCommonSlotsPalletEvent extends Enum {
readonly isNewLeasePeriod: boolean;
readonly asNewLeasePeriod: {
@@ -1909,7 +1910,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'NewLeasePeriod' | 'Leased';
}
/** @name PolkadotRuntimeCommonAuctionsPalletEvent (470) */
/** @name PolkadotRuntimeCommonAuctionsPalletEvent (469) */
interface PolkadotRuntimeCommonAuctionsPalletEvent extends Enum {
readonly isAuctionStarted: boolean;
readonly asAuctionStarted: {
@@ -1954,7 +1955,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'AuctionStarted' | 'AuctionClosed' | 'Reserved' | 'Unreserved' | 'ReserveConfiscated' | 'BidAccepted' | 'WinningOffset';
}
/** @name PolkadotRuntimeCommonCrowdloanPalletEvent (471) */
/** @name PolkadotRuntimeCommonCrowdloanPalletEvent (470) */
interface PolkadotRuntimeCommonCrowdloanPalletEvent extends Enum {
readonly isCreated: boolean;
readonly asCreated: {
@@ -2006,7 +2007,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Created' | 'Contributed' | 'Withdrew' | 'PartiallyRefunded' | 'AllRefunded' | 'Dissolved' | 'HandleBidResult' | 'Edited' | 'MemoUpdated' | 'AddedToNewRaise';
}
/** @name PalletXcmEvent (472) */
/** @name PalletXcmEvent (471) */
interface PalletXcmEvent extends Enum {
readonly isAttempted: boolean;
readonly asAttempted: XcmV3TraitsOutcome;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '10.3.3' };
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '10.5.1' };
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8 -8
View File
@@ -3,7 +3,7 @@
"bugs": "https://github.com/polkadot-js/api/issues",
"description": "Implementation of the SCALE codec",
"engines": {
"node": ">=14"
"node": ">=16"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-codec#readme",
"license": "Apache-2.0",
@@ -18,17 +18,17 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "10.3.3",
"version": "10.5.1",
"main": "index.js",
"dependencies": {
"@polkadot/util": "^11.1.3",
"@polkadot/x-bigint": "^11.1.3",
"@polkadot/util": "^12.1.1",
"@polkadot/x-bigint": "^12.1.1",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/types": "10.3.3",
"@polkadot/types-augment": "10.3.3",
"@polkadot/types-support": "10.3.3",
"@polkadot/util-crypto": "^11.1.3"
"@polkadot/types": "10.5.1",
"@polkadot/types-augment": "10.5.1",
"@polkadot/types-support": "10.5.1",
"@polkadot/util-crypto": "^12.1.1"
}
}
+21 -14
View File
@@ -42,9 +42,10 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
public get encodedLength (): number {
// We need to loop through all entries since they may have a variable length themselves,
// e.g. when a Vec or Compact is contained withing, it has a variable length based on data
let total = compactToU8a(this.length).length;
const count = this.length;
let total = compactToU8a(count).length;
for (let i = 0; i < this.length; i++) {
for (let i = 0; i < count; i++) {
total += this[i].encodedLength;
}
@@ -95,9 +96,10 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
* @description Internal per-item inspection of internal values
*/
public inspectInner (): Inspect[] {
const inner = new Array<Inspect>(this.length);
const count = this.length;
const inner = new Array<Inspect>(count);
for (let i = 0; i < this.length; i++) {
for (let i = 0; i < count; i++) {
inner[i] = this[i].inspect();
}
@@ -122,9 +124,10 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
*/
public toHuman (isExtended?: boolean): AnyJson {
const result = new Array<AnyJson>(this.length);
const count = this.length;
const result = new Array<AnyJson>(count);
for (let i = 0; i < this.length; i++) {
for (let i = 0; i < count; i++) {
result[i] = this[i] && this[i].toHuman(isExtended);
}
@@ -135,9 +138,10 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
* @description Converts the Object to JSON, typically used for RPC transfers
*/
public toJSON (): AnyJson {
const result = new Array<AnyJson>(this.length);
const count = this.length;
const result = new Array<AnyJson>(count);
for (let i = 0; i < this.length; i++) {
for (let i = 0; i < count; i++) {
// We actually log inside the U8a decoding and use JSON.stringify(...), which
// means that the Vec may be partially populated (same applies to toHuman, same check)
result[i] = this[i] && this[i].toJSON();
@@ -150,9 +154,10 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
* @description Converts the value in a best-fit primitive form
*/
public toPrimitive (): AnyJson {
const result = new Array<AnyJson>(this.length);
const count = this.length;
const result = new Array<AnyJson>(count);
for (let i = 0; i < this.length; i++) {
for (let i = 0; i < count; i++) {
result[i] = this[i] && this[i].toPrimitive();
}
@@ -168,9 +173,10 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
* @description Returns the string representation of the value
*/
public override toString (): string {
const result = new Array<string>(this.length);
const count = this.length;
const result = new Array<string>(count);
for (let i = 0; i < this.length; i++) {
for (let i = 0; i < count; i++) {
result[i] = this[i].toString();
}
@@ -195,9 +201,10 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
public toU8aInner (isBare?: boolean): Uint8Array[] {
const encoded = new Array<Uint8Array>(this.length);
const count = this.length;
const encoded = new Array<Uint8Array>(count);
for (let i = 0; i < this.length; i++) {
for (let i = 0; i < count; i++) {
encoded[i] = this[i].toU8a(isBare);
}

Some files were not shown because too many files have changed in this diff Show More