Compare commits

..
32 Commits
Author SHA1 Message Date
github-actions[bot] 6192e60668 [CI Skip] release/stable 8.6.1
skip-checks: true
2022-05-29 09:53:24 +00:00
Jaco c5eb40a98d 8.6.1 (#4870) 2022-05-29 12:45:28 +03:00
github-actions[bot] ab9b47ba51 [CI Skip] release/beta 8.5.2-14
skip-checks: true
2022-05-29 09:26:43 +00:00
Jaco dc0a5f3dec Bump Kusama metadata (#4868) 2022-05-29 12:18:39 +03:00
github-actions[bot] 3628a1bf86 [CI Skip] release/beta 8.5.2-13
skip-checks: true
2022-05-29 09:14:48 +00:00
Jaco a51fed491b Bump metadata (#4867) 2022-05-29 12:07:13 +03:00
github-actions[bot] 4616865333 [CI Skip] release/beta 8.5.2-12
skip-checks: true
2022-05-29 08:29:33 +00:00
Jaco e840d43463 Bump 3rd party deps (#4865) 2022-05-29 11:20:04 +03:00
github-actions[bot] c384311570 [CI Skip] release/beta 8.5.2-11
skip-checks: true
2022-05-29 08:03:56 +00:00
Jaco 521d44bb73 Bump deps (#4864) 2022-05-29 10:54:13 +03:00
github-actions[bot] 865fb63002 [CI Skip] release/beta 8.5.2-10
skip-checks: true
2022-05-27 10:38:01 +00:00
Jaco 63c58538dc Adjust inspect for ExtrinsicPayload (#4862)
* Adjust inspect for ExtrinsicPayload

* Adjust
2022-05-27 13:30:15 +03:00
github-actions[bot] 4166cb7fa5 [CI Skip] release/beta 8.5.2-9
skip-checks: true
2022-05-27 09:37:45 +00:00
Jaco 8810f31eae Remove dev logs (#4861) 2022-05-27 12:27:10 +03:00
github-actions[bot] 3038edec72 [CI Skip] release/beta 8.5.2-8
skip-checks: true
2022-05-27 09:21:19 +00:00
Jaco 9e09c11b0b Use compactFromU8aLim & u8aConcatStrict (#4859)
* Use compactFromU8aLim & u8aConcatStrict

* Bump common
2022-05-27 12:11:17 +03:00
github-actions[bot] c6d1e00b09 [CI Skip] release/beta 8.5.2-7
skip-checks: true
2022-05-27 07:09:27 +00:00
Jaco c5f467dce1 Remove some internal Array allocations (#4858)
* Handle Vec assignment inline

* mappings

* Adjust

* Adjust

* Cleanup build

* Fix BTreeSet build

* Adjust

* hasNoDupes adjustment

* Adjust PortableRegistry extractName
2022-05-27 10:01:11 +03:00
github-actions[bot] c8ce65f079 [CI Skip] release/beta 8.5.2-6
skip-checks: true
2022-05-26 14:07:36 +00:00
Jaco 71a8ff55d6 Cache class definitions for codec primitives (#4855)
* Cache class definitions for codec primitives

* Adjustments for linting

* clearCache

* cleaner test description

* inline assign

* Adjust failing

* Pass definition via Options
2022-05-26 16:59:32 +03:00
github-actions[bot] 4825d5466d [CI Skip] release/beta 8.5.2-5
skip-checks: true
2022-05-26 12:08:06 +00:00
Jaco c6a0f3b8d5 Internal typegen ordering (#4857) 2022-05-26 15:00:10 +03:00
github-actions[bot] 100f008ffa [CI Skip] release/beta 8.5.2-4
skip-checks: true
2022-05-26 10:23:57 +00:00
Jaco 02b9136d56 Adjust Kusama historic StakingLedger for < 1051 (#4856)
* Adjust Kusama historic StakingLedger for < 1051

* CHANGELOG
2022-05-26 13:14:31 +03:00
github-actions[bot] 8379783835 [CI Skip] release/beta 8.5.2-3
skip-checks: true
2022-05-26 07:23:45 +00:00
Jaco 5730005eba Optimization of registry.getOrUnknown with lookup cache (#4853) 2022-05-26 10:15:22 +03:00
github-actions[bot] f701c398c3 [CI Skip] release/beta 8.5.2-2
skip-checks: true
2022-05-26 06:01:51 +00:00
Jaco 5a90d02f1f Support for Option<bool> 1-byte encoding (#4852)
* Support for Option<bool> 1-byte encoding

* Adjust for linting
2022-05-26 08:53:38 +03:00
github-actions[bot] 4dad961106 [CI Skip] release/beta 8.5.2-1
skip-checks: true
2022-05-25 17:55:24 +00:00
Jaco d41491e859 Adjust AnyBool & AnyString typings (#4850)
* Adjust AnyBool & AnyString typings

* Fix AnyString typing
2022-05-25 20:43:30 +03:00
github-actions[bot] 1fbfbac062 [CI Skip] release/beta 8.5.2-0
skip-checks: true
2022-05-25 12:18:33 +00:00
Jaco a7d826f839 Optimization for createClass with shortcut typeDef creation (#4849) 2022-05-25 15:07:42 +03:00
92 changed files with 5780 additions and 5685 deletions
+14
View File
@@ -1,5 +1,19 @@
# CHANGELOG
## 8.6.1 May 29, 2022
Changes:
- Add codec support for specialized `Option<bool>`
- Optimization for `createClass` with shortcut typeDef creation
- Optimization of `registry.getOrUnknown` with lookup cache
- Optimization of Array allocations in decoding
- Use `compactFromU8aLim` & `u8aConcatStrict` variants
- Adjust `.inspect()` for `ExtrinsicPayload`
- Adjust Kusama `StakingLedger` for runtime 1051
- Update to latest Substrate, Kusama & Polkadot static metadata
## 8.5.1 May 22, 2022
Contributed:
+1 -1
View File
@@ -1,4 +1,4 @@
2966 Jaco 8.5.1 (#4847)
2982 Jaco 8.6.1 (#4870)
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)
+4 -4
View File
@@ -11,7 +11,7 @@
},
"sideEffects": false,
"type": "commonjs",
"version": "8.5.1",
"version": "8.6.1",
"workspaces": [
"packages/*"
],
@@ -31,10 +31,10 @@
"test:watch": "polkadot-dev-run-test --watch"
},
"devDependencies": {
"@babel/core": "^7.18.0",
"@babel/core": "^7.18.2",
"@babel/register": "^7.17.7",
"@babel/runtime": "^7.18.0",
"@polkadot/dev": "^0.66.28",
"@babel/runtime": "^7.18.3",
"@polkadot/dev": "^0.66.30",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^27.5.1",
"copyfiles": "^2.4.1"
+9 -9
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/api-base": "8.5.1",
"@polkadot/rpc-augment": "8.5.1",
"@polkadot/types": "8.5.1",
"@polkadot/types-augment": "8.5.1",
"@polkadot/types-codec": "8.5.1",
"@polkadot/util": "^9.2.1"
"@babel/runtime": "^7.18.3",
"@polkadot/api-base": "8.6.1",
"@polkadot/rpc-augment": "8.6.1",
"@polkadot/types": "8.6.1",
"@polkadot/types-augment": "8.6.1",
"@polkadot/types-codec": "8.6.1",
"@polkadot/util": "^9.3.1"
},
"devDependencies": {
"@polkadot/types-support": "8.5.1"
"@polkadot/types-support": "8.6.1"
}
}
+1 -9
View File
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/consts' {
export interface AugmentedConsts<ApiType extends ApiTypes> {
@@ -804,10 +804,6 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec;
};
transactionPayment: {
/**
* The polynomial that is applied in order to derive fee from length.
**/
lengthToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/**
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
* `priority`
@@ -832,10 +828,6 @@ declare module '@polkadot/api-base/types/consts' {
* transactions.
**/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* The polynomial that is applied in order to derive fee from weight.
**/
weightToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/**
* Generic const
**/
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.6.1' };
+1 -9
View File
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/consts' {
export interface AugmentedConsts<ApiType extends ApiTypes> {
@@ -653,10 +653,6 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec;
};
transactionPayment: {
/**
* The polynomial that is applied in order to derive fee from length.
**/
lengthToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/**
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
* `priority`
@@ -681,10 +677,6 @@ declare module '@polkadot/api-base/types/consts' {
* transactions.
**/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* The polynomial that is applied in order to derive fee from weight.
**/
weightToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/**
* Generic const
**/
+1 -9
View File
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
import type { Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/consts' {
export interface AugmentedConsts<ApiType extends ApiTypes> {
@@ -947,10 +947,6 @@ declare module '@polkadot/api-base/types/consts' {
[key: string]: Codec;
};
transactionPayment: {
/**
* The polynomial that is applied in order to derive fee from length.
**/
lengthToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/**
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
* `priority`
@@ -975,10 +971,6 @@ declare module '@polkadot/api-base/types/consts' {
* transactions.
**/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* The polynomial that is applied in order to derive fee from weight.
**/
weightToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/**
* Generic const
**/
+5 -5
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/rpc-core": "8.5.1",
"@polkadot/types": "8.5.1",
"@polkadot/util": "^9.2.1",
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-core": "8.6.1",
"@polkadot/types": "8.6.1",
"@polkadot/util": "^9.3.1",
"rxjs": "^7.5.5"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.6.1' };
+10 -10
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/api": "8.5.1",
"@polkadot/types": "8.5.1",
"@polkadot/types-codec": "8.5.1",
"@polkadot/types-create": "8.5.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@babel/runtime": "^7.18.3",
"@polkadot/api": "8.6.1",
"@polkadot/types": "8.6.1",
"@polkadot/types-codec": "8.6.1",
"@polkadot/types-create": "8.6.1",
"@polkadot/util": "^9.3.1",
"@polkadot/util-crypto": "^9.3.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api-augment": "8.5.1",
"@polkadot/keyring": "^9.2.1"
"@polkadot/api-augment": "8.6.1",
"@polkadot/keyring": "^9.3.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '8.6.1' };
+15 -15
View File
@@ -20,25 +20,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/api": "8.5.1",
"@polkadot/api-augment": "8.5.1",
"@polkadot/api-base": "8.5.1",
"@polkadot/rpc-core": "8.5.1",
"@polkadot/types": "8.5.1",
"@polkadot/types-codec": "8.5.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@babel/runtime": "^7.18.3",
"@polkadot/api": "8.6.1",
"@polkadot/api-augment": "8.6.1",
"@polkadot/api-base": "8.6.1",
"@polkadot/rpc-core": "8.6.1",
"@polkadot/types": "8.6.1",
"@polkadot/types-codec": "8.6.1",
"@polkadot/util": "^9.3.1",
"@polkadot/util-crypto": "^9.3.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api": "8.5.1",
"@polkadot/api-augment": "8.5.1",
"@polkadot/rpc-augment": "8.5.1",
"@polkadot/rpc-provider": "8.5.1",
"@polkadot/types-support": "8.5.1"
"@polkadot/api": "8.6.1",
"@polkadot/api-augment": "8.6.1",
"@polkadot/rpc-augment": "8.6.1",
"@polkadot/rpc-provider": "8.6.1",
"@polkadot/types-support": "8.6.1"
}
}
@@ -20,7 +20,7 @@ function traverseLinks (api: DeriveApi, head: AccountId32 | string): Observable<
),
tap((node: Option<PalletBagsListListNode>): void => {
setTimeout((): void => {
node.isSome && (node.value as PalletBagsListListNode).next.isSome
node.isSome && node.value.next.isSome
? subject.next(node.unwrap().next.unwrap())
: subject.complete();
}, 0);
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '8.6.1' };
+18 -18
View File
@@ -20,29 +20,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/api-augment": "8.5.1",
"@polkadot/api-base": "8.5.1",
"@polkadot/api-derive": "8.5.1",
"@polkadot/keyring": "^9.2.1",
"@polkadot/rpc-augment": "8.5.1",
"@polkadot/rpc-core": "8.5.1",
"@polkadot/rpc-provider": "8.5.1",
"@polkadot/types": "8.5.1",
"@polkadot/types-augment": "8.5.1",
"@polkadot/types-codec": "8.5.1",
"@polkadot/types-create": "8.5.1",
"@polkadot/types-known": "8.5.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@babel/runtime": "^7.18.3",
"@polkadot/api-augment": "8.6.1",
"@polkadot/api-base": "8.6.1",
"@polkadot/api-derive": "8.6.1",
"@polkadot/keyring": "^9.3.1",
"@polkadot/rpc-augment": "8.6.1",
"@polkadot/rpc-core": "8.6.1",
"@polkadot/rpc-provider": "8.6.1",
"@polkadot/types": "8.6.1",
"@polkadot/types-augment": "8.6.1",
"@polkadot/types-codec": "8.6.1",
"@polkadot/types-create": "8.6.1",
"@polkadot/types-known": "8.6.1",
"@polkadot/util": "^9.3.1",
"@polkadot/util-crypto": "^9.3.1",
"eventemitter3": "^4.0.7",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api-augment": "8.5.1",
"@polkadot/types-support": "8.5.1"
"@polkadot/api-augment": "8.6.1",
"@polkadot/types-support": "8.6.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '8.6.1' };
+6 -6
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/rpc-core": "8.5.1",
"@polkadot/types": "8.5.1",
"@polkadot/types-codec": "8.5.1",
"@polkadot/util": "^9.2.1"
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-core": "8.6.1",
"@polkadot/types": "8.6.1",
"@polkadot/types-codec": "8.6.1",
"@polkadot/util": "^9.3.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '8.6.1' };
+8 -8
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/rpc-augment": "8.5.1",
"@polkadot/rpc-provider": "8.5.1",
"@polkadot/types": "8.5.1",
"@polkadot/util": "^9.2.1",
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-augment": "8.6.1",
"@polkadot/rpc-provider": "8.6.1",
"@polkadot/types": "8.6.1",
"@polkadot/util": "^9.3.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/keyring": "^9.2.1",
"@polkadot/rpc-augment": "8.5.1"
"@polkadot/keyring": "^9.3.1",
"@polkadot/rpc-augment": "8.6.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '8.6.1' };
+11 -11
View File
@@ -20,21 +20,21 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/keyring": "^9.2.1",
"@polkadot/types": "8.5.1",
"@polkadot/types-support": "8.5.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@polkadot/x-fetch": "^9.2.1",
"@polkadot/x-global": "^9.2.1",
"@polkadot/x-ws": "^9.2.1",
"@babel/runtime": "^7.18.3",
"@polkadot/keyring": "^9.3.1",
"@polkadot/types": "8.6.1",
"@polkadot/types-support": "8.6.1",
"@polkadot/util": "^9.3.1",
"@polkadot/util-crypto": "^9.3.1",
"@polkadot/x-fetch": "^9.3.1",
"@polkadot/x-global": "^9.3.1",
"@polkadot/x-ws": "^9.3.1",
"@substrate/connect": "0.7.5",
"eventemitter3": "^4.0.7",
"mock-socket": "^9.1.3",
"mock-socket": "^9.1.4",
"nock": "^13.2.4"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '8.6.1' };
+14 -14
View File
@@ -20,7 +20,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
@@ -30,20 +30,20 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
},
"dependencies": {
"@babel/core": "^7.18.0",
"@babel/core": "^7.18.2",
"@babel/register": "^7.17.7",
"@babel/runtime": "^7.18.0",
"@polkadot/api": "8.5.1",
"@polkadot/api-augment": "8.5.1",
"@polkadot/rpc-augment": "8.5.1",
"@polkadot/rpc-provider": "8.5.1",
"@polkadot/types": "8.5.1",
"@polkadot/types-augment": "8.5.1",
"@polkadot/types-codec": "8.5.1",
"@polkadot/types-create": "8.5.1",
"@polkadot/types-support": "8.5.1",
"@polkadot/util": "^9.2.1",
"@polkadot/x-ws": "^9.2.1",
"@babel/runtime": "^7.18.3",
"@polkadot/api": "8.6.1",
"@polkadot/api-augment": "8.6.1",
"@polkadot/rpc-augment": "8.6.1",
"@polkadot/rpc-provider": "8.6.1",
"@polkadot/types": "8.6.1",
"@polkadot/types-augment": "8.6.1",
"@polkadot/types-codec": "8.6.1",
"@polkadot/types-create": "8.6.1",
"@polkadot/types-support": "8.6.1",
"@polkadot/util": "^9.3.1",
"@polkadot/x-ws": "^9.3.1",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.5.1"
+1 -1
View File
@@ -13,8 +13,8 @@ const BASE = 'packages/api-augment/src';
const METAS = Object.entries({ kusama, polkadot, substrate }) as [string, HexString][];
export function main (): void {
generateDefaultLookup();
generateDefaultInterface();
generateDefaultLookup();
generateDefaultRpc();
generateDefaultTsDef();
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '8.6.1' };
+5 -5
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/types": "8.5.1",
"@polkadot/types-codec": "8.5.1",
"@polkadot/util": "^9.2.1"
"@babel/runtime": "^7.18.3",
"@polkadot/types": "8.6.1",
"@polkadot/types-codec": "8.6.1",
"@polkadot/util": "^9.3.1"
}
}
+4 -4
View File
@@ -11,7 +11,7 @@ export default {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction', 'Society']
},
/**
* Lookup260: kusama_runtime::SessionKeys
* Lookup258: kusama_runtime::SessionKeys
**/
KusamaRuntimeSessionKeys: {
grandpa: 'SpFinalityGrandpaAppPublic',
@@ -22,7 +22,7 @@ export default {
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
},
/**
* Lookup334: kusama_runtime::OriginCaller
* Lookup332: kusama_runtime::OriginCaller
**/
KusamaRuntimeOriginCaller: {
_enum: {
@@ -129,7 +129,7 @@ export default {
}
},
/**
* Lookup400: kusama_runtime::NposCompactSolution24
* Lookup398: kusama_runtime::NposCompactSolution24
**/
KusamaRuntimeNposCompactSolution24: {
votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
@@ -158,7 +158,7 @@ export default {
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
},
/**
* Lookup776: kusama_runtime::Runtime
* Lookup774: kusama_runtime::Runtime
**/
KusamaRuntimeRuntime: 'Null'
};
+48 -48
View File
@@ -1851,13 +1851,13 @@ export default {
}
},
/**
* Lookup546: polkadot_runtime_common::claims::pallet::Error<T>
* Lookup544: polkadot_runtime_common::claims::pallet::Error<T>
**/
PolkadotRuntimeCommonClaimsPalletError: {
_enum: ['InvalidEthereumSignature', 'SignerHasNoClaim', 'SenderHasNoClaim', 'PotUnderflow', 'InvalidStatement', 'VestedBalanceExists']
},
/**
* Lookup602: polkadot_runtime_parachains::configuration::HostConfiguration<BlockNumber>
* Lookup600: polkadot_runtime_parachains::configuration::HostConfiguration<BlockNumber>
**/
PolkadotRuntimeParachainsConfigurationHostConfiguration: {
maxCodeSize: 'u32',
@@ -1905,20 +1905,20 @@ export default {
minimumValidationUpgradeDelay: 'u32'
},
/**
* Lookup605: polkadot_runtime_parachains::configuration::pallet::Error<T>
* Lookup603: polkadot_runtime_parachains::configuration::pallet::Error<T>
**/
PolkadotRuntimeParachainsConfigurationPalletError: {
_enum: ['InvalidNewValue']
},
/**
* Lookup608: polkadot_runtime_parachains::inclusion::AvailabilityBitfieldRecord<N>
* Lookup606: polkadot_runtime_parachains::inclusion::AvailabilityBitfieldRecord<N>
**/
PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord: {
bitfield: 'BitVec',
submittedAt: 'u32'
},
/**
* Lookup609: polkadot_runtime_parachains::inclusion::CandidatePendingAvailability<primitive_types::H256, N>
* Lookup607: polkadot_runtime_parachains::inclusion::CandidatePendingAvailability<primitive_types::H256, N>
**/
PolkadotRuntimeParachainsInclusionCandidatePendingAvailability: {
_alias: {
@@ -1934,13 +1934,13 @@ export default {
backingGroup: 'u32'
},
/**
* Lookup610: polkadot_runtime_parachains::inclusion::pallet::Error<T>
* Lookup608: polkadot_runtime_parachains::inclusion::pallet::Error<T>
**/
PolkadotRuntimeParachainsInclusionPalletError: {
_enum: ['UnsortedOrDuplicateValidatorIndices', 'UnsortedOrDuplicateDisputeStatementSet', 'UnsortedOrDuplicateBackedCandidates', 'UnexpectedRelayParent', 'WrongBitfieldSize', 'BitfieldAllZeros', 'BitfieldDuplicateOrUnordered', 'ValidatorIndexOutOfBounds', 'InvalidBitfieldSignature', 'UnscheduledCandidate', 'CandidateScheduledBeforeParaFree', 'WrongCollator', 'ScheduledOutOfOrder', 'HeadDataTooLarge', 'PrematureCodeUpgrade', 'NewCodeTooLarge', 'CandidateNotInParentContext', 'InvalidGroupIndex', 'InsufficientBacking', 'InvalidBacking', 'NotCollatorSigned', 'ValidationDataHashMismatch', 'IncorrectDownwardMessageHandling', 'InvalidUpwardMessages', 'HrmpWatermarkMishandling', 'InvalidOutboundHrmp', 'InvalidValidationCodeHash', 'ParaHeadMismatch', 'BitfieldReferencesFreedCore']
},
/**
* Lookup611: polkadot_primitives::v2::ScrapedOnChainVotes<primitive_types::H256>
* Lookup609: polkadot_primitives::v2::ScrapedOnChainVotes<primitive_types::H256>
**/
PolkadotPrimitivesV2ScrapedOnChainVotes: {
session: 'u32',
@@ -1948,38 +1948,38 @@ export default {
disputes: 'Vec<PolkadotPrimitivesV2DisputeStatementSet>'
},
/**
* Lookup616: polkadot_runtime_parachains::paras_inherent::pallet::Error<T>
* Lookup614: polkadot_runtime_parachains::paras_inherent::pallet::Error<T>
**/
PolkadotRuntimeParachainsParasInherentPalletError: {
_enum: ['TooManyInclusionInherents', 'InvalidParentHeader', 'CandidateConcludedInvalid', 'InherentOverweight', 'DisputeStatementsUnsortedOrDuplicates', 'DisputeInvalid']
},
/**
* Lookup618: polkadot_runtime_parachains::scheduler::ParathreadClaimQueue
* Lookup616: polkadot_runtime_parachains::scheduler::ParathreadClaimQueue
**/
PolkadotRuntimeParachainsSchedulerParathreadClaimQueue: {
queue: 'Vec<PolkadotRuntimeParachainsSchedulerQueuedParathread>',
nextCoreOffset: 'u32'
},
/**
* Lookup620: polkadot_runtime_parachains::scheduler::QueuedParathread
* Lookup618: polkadot_runtime_parachains::scheduler::QueuedParathread
**/
PolkadotRuntimeParachainsSchedulerQueuedParathread: {
claim: 'PolkadotPrimitivesV2ParathreadEntry',
coreOffset: 'u32'
},
/**
* Lookup621: polkadot_primitives::v2::ParathreadEntry
* Lookup619: polkadot_primitives::v2::ParathreadEntry
**/
PolkadotPrimitivesV2ParathreadEntry: {
claim: 'PolkadotPrimitivesV2ParathreadClaim',
retries: 'u32'
},
/**
* Lookup622: polkadot_primitives::v2::ParathreadClaim
* Lookup620: polkadot_primitives::v2::ParathreadClaim
**/
PolkadotPrimitivesV2ParathreadClaim: '(u32,PolkadotPrimitivesV2CollatorAppPublic)',
/**
* Lookup625: polkadot_primitives::v2::CoreOccupied
* Lookup623: polkadot_primitives::v2::CoreOccupied
**/
PolkadotPrimitivesV2CoreOccupied: {
_enum: {
@@ -1988,7 +1988,7 @@ export default {
}
},
/**
* Lookup628: polkadot_runtime_parachains::scheduler::CoreAssignment
* Lookup626: polkadot_runtime_parachains::scheduler::CoreAssignment
**/
PolkadotRuntimeParachainsSchedulerCoreAssignment: {
core: 'u32',
@@ -1997,7 +1997,7 @@ export default {
groupIdx: 'u32'
},
/**
* Lookup629: polkadot_runtime_parachains::scheduler::AssignmentKind
* Lookup627: polkadot_runtime_parachains::scheduler::AssignmentKind
**/
PolkadotRuntimeParachainsSchedulerAssignmentKind: {
_enum: {
@@ -2006,7 +2006,7 @@ export default {
}
},
/**
* Lookup630: polkadot_runtime_parachains::paras::PvfCheckActiveVoteState<BlockNumber>
* Lookup628: polkadot_runtime_parachains::paras::PvfCheckActiveVoteState<BlockNumber>
**/
PolkadotRuntimeParachainsParasPvfCheckActiveVoteState: {
votesAccept: 'BitVec',
@@ -2016,7 +2016,7 @@ export default {
causes: 'Vec<PolkadotRuntimeParachainsParasPvfCheckCause>'
},
/**
* Lookup632: polkadot_runtime_parachains::paras::PvfCheckCause<BlockNumber>
* Lookup630: polkadot_runtime_parachains::paras::PvfCheckCause<BlockNumber>
**/
PolkadotRuntimeParachainsParasPvfCheckCause: {
_enum: {
@@ -2028,39 +2028,39 @@ export default {
}
},
/**
* Lookup634: polkadot_runtime_parachains::paras::ParaLifecycle
* Lookup632: polkadot_runtime_parachains::paras::ParaLifecycle
**/
PolkadotRuntimeParachainsParasParaLifecycle: {
_enum: ['Onboarding', 'Parathread', 'Parachain', 'UpgradingParathread', 'DowngradingParachain', 'OffboardingParathread', 'OffboardingParachain']
},
/**
* Lookup636: polkadot_runtime_parachains::paras::ParaPastCodeMeta<N>
* Lookup634: polkadot_runtime_parachains::paras::ParaPastCodeMeta<N>
**/
PolkadotRuntimeParachainsParasParaPastCodeMeta: {
upgradeTimes: 'Vec<PolkadotRuntimeParachainsParasReplacementTimes>',
lastPruned: 'Option<u32>'
},
/**
* Lookup638: polkadot_runtime_parachains::paras::ReplacementTimes<N>
* Lookup636: polkadot_runtime_parachains::paras::ReplacementTimes<N>
**/
PolkadotRuntimeParachainsParasReplacementTimes: {
expectedAt: 'u32',
activatedAt: 'u32'
},
/**
* Lookup640: polkadot_primitives::v2::UpgradeGoAhead
* Lookup638: polkadot_primitives::v2::UpgradeGoAhead
**/
PolkadotPrimitivesV2UpgradeGoAhead: {
_enum: ['Abort', 'GoAhead']
},
/**
* Lookup641: polkadot_primitives::v2::UpgradeRestriction
* Lookup639: polkadot_primitives::v2::UpgradeRestriction
**/
PolkadotPrimitivesV2UpgradeRestriction: {
_enum: ['Present']
},
/**
* Lookup642: polkadot_runtime_parachains::paras::ParaGenesisArgs
* Lookup640: polkadot_runtime_parachains::paras::ParaGenesisArgs
**/
PolkadotRuntimeParachainsParasParaGenesisArgs: {
genesisHead: 'Bytes',
@@ -2068,13 +2068,13 @@ export default {
parachain: 'bool'
},
/**
* Lookup643: polkadot_runtime_parachains::paras::pallet::Error<T>
* Lookup641: polkadot_runtime_parachains::paras::pallet::Error<T>
**/
PolkadotRuntimeParachainsParasPalletError: {
_enum: ['NotRegistered', 'CannotOnboard', 'CannotOffboard', 'CannotUpgrade', 'CannotDowngrade', 'PvfCheckStatementStale', 'PvfCheckStatementFuture', 'PvfCheckValidatorIndexOutOfBounds', 'PvfCheckInvalidSignature', 'PvfCheckDoubleVote', 'PvfCheckSubjectInvalid', 'PvfCheckDisabled']
},
/**
* Lookup645: polkadot_runtime_parachains::initializer::BufferedSessionChange
* Lookup643: polkadot_runtime_parachains::initializer::BufferedSessionChange
**/
PolkadotRuntimeParachainsInitializerBufferedSessionChange: {
validators: 'Vec<PolkadotPrimitivesV2ValidatorAppPublic>',
@@ -2082,20 +2082,20 @@ export default {
sessionIndex: 'u32'
},
/**
* Lookup647: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
* Lookup645: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundDownwardMessage: {
sentAt: 'u32',
msg: 'Bytes'
},
/**
* Lookup649: polkadot_runtime_parachains::ump::pallet::Error<T>
* Lookup647: polkadot_runtime_parachains::ump::pallet::Error<T>
**/
PolkadotRuntimeParachainsUmpPalletError: {
_enum: ['UnknownMessageIndex', 'WeightOverLimit']
},
/**
* Lookup650: polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest
* Lookup648: polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest
**/
PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest: {
confirmed: 'bool',
@@ -2106,7 +2106,7 @@ export default {
maxTotalSize: 'u32'
},
/**
* Lookup652: polkadot_runtime_parachains::hrmp::HrmpChannel
* Lookup650: polkadot_runtime_parachains::hrmp::HrmpChannel
**/
PolkadotRuntimeParachainsHrmpHrmpChannel: {
maxCapacity: 'u32',
@@ -2119,20 +2119,20 @@ export default {
recipientDeposit: 'u128'
},
/**
* Lookup655: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
* Lookup653: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundHrmpMessage: {
sentAt: 'u32',
data: 'Bytes'
},
/**
* Lookup658: polkadot_runtime_parachains::hrmp::pallet::Error<T>
* Lookup656: polkadot_runtime_parachains::hrmp::pallet::Error<T>
**/
PolkadotRuntimeParachainsHrmpPalletError: {
_enum: ['OpenHrmpChannelToSelf', 'OpenHrmpChannelInvalidRecipient', 'OpenHrmpChannelZeroCapacity', 'OpenHrmpChannelCapacityExceedsLimit', 'OpenHrmpChannelZeroMessageSize', 'OpenHrmpChannelMessageSizeExceedsLimit', 'OpenHrmpChannelAlreadyExists', 'OpenHrmpChannelAlreadyRequested', 'OpenHrmpChannelLimitExceeded', 'AcceptHrmpChannelDoesntExist', 'AcceptHrmpChannelAlreadyConfirmed', 'AcceptHrmpChannelLimitExceeded', 'CloseHrmpChannelUnauthorized', 'CloseHrmpChannelDoesntExist', 'CloseHrmpChannelAlreadyUnderway', 'CancelHrmpOpenChannelUnauthorized', 'OpenHrmpChannelDoesntExist', 'OpenHrmpChannelAlreadyConfirmed', 'WrongWitness']
},
/**
* Lookup660: polkadot_primitives::v2::SessionInfo
* Lookup658: polkadot_primitives::v2::SessionInfo
**/
PolkadotPrimitivesV2SessionInfo: {
activeValidatorIndices: 'Vec<u32>',
@@ -2150,7 +2150,7 @@ export default {
neededApprovals: 'u32'
},
/**
* Lookup663: polkadot_primitives::v2::DisputeState<N>
* Lookup661: polkadot_primitives::v2::DisputeState<N>
**/
PolkadotPrimitivesV2DisputeState: {
validatorsFor: 'BitVec',
@@ -2159,13 +2159,13 @@ export default {
concludedAt: 'Option<u32>'
},
/**
* Lookup664: polkadot_runtime_parachains::disputes::pallet::Error<T>
* Lookup662: polkadot_runtime_parachains::disputes::pallet::Error<T>
**/
PolkadotRuntimeParachainsDisputesPalletError: {
_enum: ['DuplicateDisputeStatementSets', 'AncientDisputeStatement', 'ValidatorIndexOutOfBounds', 'InvalidSignature', 'DuplicateStatement', 'PotentialSpam', 'SingleSidedDispute']
},
/**
* Lookup665: polkadot_runtime_common::paras_registrar::ParaInfo<sp_core::crypto::AccountId32, Balance>
* Lookup663: polkadot_runtime_common::paras_registrar::ParaInfo<sp_core::crypto::AccountId32, Balance>
**/
PolkadotRuntimeCommonParasRegistrarParaInfo: {
manager: 'AccountId32',
@@ -2173,25 +2173,25 @@ export default {
locked: 'bool'
},
/**
* Lookup666: polkadot_runtime_common::paras_registrar::pallet::Error<T>
* Lookup664: polkadot_runtime_common::paras_registrar::pallet::Error<T>
**/
PolkadotRuntimeCommonParasRegistrarPalletError: {
_enum: ['NotRegistered', 'AlreadyRegistered', 'NotOwner', 'CodeTooLarge', 'HeadDataTooLarge', 'NotParachain', 'NotParathread', 'CannotDeregister', 'CannotDowngrade', 'CannotUpgrade', 'ParaLocked', 'NotReserved', 'EmptyCode', 'CannotSwap']
},
/**
* Lookup668: polkadot_runtime_common::slots::pallet::Error<T>
* Lookup666: polkadot_runtime_common::slots::pallet::Error<T>
**/
PolkadotRuntimeCommonSlotsPalletError: {
_enum: ['ParaNotOnboarding', 'LeaseError']
},
/**
* Lookup673: polkadot_runtime_common::auctions::pallet::Error<T>
* Lookup671: polkadot_runtime_common::auctions::pallet::Error<T>
**/
PolkadotRuntimeCommonAuctionsPalletError: {
_enum: ['AuctionInProgress', 'LeasePeriodInPast', 'ParaNotRegistered', 'NotCurrentAuction', 'NotAuction', 'AuctionEnded', 'AlreadyLeasedOut']
},
/**
* Lookup674: polkadot_runtime_common::crowdloan::FundInfo<sp_core::crypto::AccountId32, Balance, BlockNumber, LeasePeriod>
* Lookup672: polkadot_runtime_common::crowdloan::FundInfo<sp_core::crypto::AccountId32, Balance, BlockNumber, LeasePeriod>
**/
PolkadotRuntimeCommonCrowdloanFundInfo: {
depositor: 'AccountId32',
@@ -2206,7 +2206,7 @@ export default {
fundIndex: 'u32'
},
/**
* Lookup675: polkadot_runtime_common::crowdloan::LastContribution<BlockNumber>
* Lookup673: polkadot_runtime_common::crowdloan::LastContribution<BlockNumber>
**/
PolkadotRuntimeCommonCrowdloanLastContribution: {
_enum: {
@@ -2216,13 +2216,13 @@ export default {
}
},
/**
* Lookup676: polkadot_runtime_common::crowdloan::pallet::Error<T>
* Lookup674: polkadot_runtime_common::crowdloan::pallet::Error<T>
**/
PolkadotRuntimeCommonCrowdloanPalletError: {
_enum: ['FirstPeriodInPast', 'FirstPeriodTooFarInFuture', 'LastPeriodBeforeFirstPeriod', 'LastPeriodTooFarInFuture', 'CannotEndInPast', 'EndTooFarInFuture', 'Overflow', 'ContributionTooSmall', 'InvalidParaId', 'CapExceeded', 'ContributionPeriodOver', 'InvalidOrigin', 'NotParachain', 'LeaseActive', 'BidOrLeaseActive', 'FundNotEnded', 'NoContributions', 'NotReadyToDissolve', 'InvalidSignature', 'MemoTooLarge', 'AlreadyInNewRaise', 'VrfDelayInProgress', 'NoLeasePeriod']
},
/**
* Lookup677: pallet_xcm::pallet::QueryStatus<BlockNumber>
* Lookup675: pallet_xcm::pallet::QueryStatus<BlockNumber>
**/
PalletXcmQueryStatus: {
_enum: {
@@ -2242,7 +2242,7 @@ export default {
}
},
/**
* Lookup680: xcm::VersionedResponse
* Lookup678: xcm::VersionedResponse
**/
XcmVersionedResponse: {
_enum: {
@@ -2252,7 +2252,7 @@ export default {
}
},
/**
* Lookup686: pallet_xcm::pallet::VersionMigrationStage
* Lookup684: pallet_xcm::pallet::VersionMigrationStage
**/
PalletXcmVersionMigrationStage: {
_enum: {
@@ -2263,21 +2263,21 @@ export default {
}
},
/**
* Lookup687: pallet_xcm::pallet::Error<T>
* Lookup685: pallet_xcm::pallet::Error<T>
**/
PalletXcmError: {
_enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed']
},
/**
* Lookup698: pallet_transaction_payment::ChargeTransactionPayment<T>
* Lookup696: pallet_transaction_payment::ChargeTransactionPayment<T>
**/
PalletTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
* Lookup699: polkadot_runtime_common::claims::PrevalidateAttests<T>
* Lookup697: polkadot_runtime_common::claims::PrevalidateAttests<T>
**/
PolkadotRuntimeCommonClaimsPrevalidateAttests: 'Null',
/**
* Lookup700: polkadot_runtime::Runtime
* Lookup698: polkadot_runtime::Runtime
**/
PolkadotRuntimeRuntime: 'Null'
};
File diff suppressed because it is too large Load Diff
@@ -19,7 +19,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society';
}
/** @name KusamaRuntimeSessionKeys (260) */
/** @name KusamaRuntimeSessionKeys (258) */
export interface KusamaRuntimeSessionKeys extends Struct {
readonly grandpa: SpFinalityGrandpaAppPublic;
readonly babe: SpConsensusBabeAppPublic;
@@ -29,7 +29,7 @@ declare module '@polkadot/types/lookup' {
readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
}
/** @name KusamaRuntimeOriginCaller (334) */
/** @name KusamaRuntimeOriginCaller (332) */
export interface KusamaRuntimeOriginCaller extends Enum {
readonly isSystem: boolean;
readonly asSystem: FrameSupportDispatchRawOrigin;
@@ -45,7 +45,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet';
}
/** @name KusamaRuntimeNposCompactSolution24 (400) */
/** @name KusamaRuntimeNposCompactSolution24 (398) */
export interface KusamaRuntimeNposCompactSolution24 extends Struct {
readonly votes1: Vec<ITuple<[Compact<u32>, Compact<u16>]>>;
readonly votes2: Vec<ITuple<[Compact<u32>, ITuple<[Compact<u16>, Compact<PerU16>]>, Compact<u16>]>>;
@@ -73,7 +73,7 @@ declare module '@polkadot/types/lookup' {
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
}
/** @name KusamaRuntimeRuntime (776) */
/** @name KusamaRuntimeRuntime (774) */
export type KusamaRuntimeRuntime = Null;
} // declare module
@@ -1809,7 +1809,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Assets' | 'Version';
}
/** @name PolkadotRuntimeCommonClaimsPalletError (546) */
/** @name PolkadotRuntimeCommonClaimsPalletError (544) */
export interface PolkadotRuntimeCommonClaimsPalletError extends Enum {
readonly isInvalidEthereumSignature: boolean;
readonly isSignerHasNoClaim: boolean;
@@ -1820,7 +1820,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'InvalidEthereumSignature' | 'SignerHasNoClaim' | 'SenderHasNoClaim' | 'PotUnderflow' | 'InvalidStatement' | 'VestedBalanceExists';
}
/** @name PolkadotRuntimeParachainsConfigurationHostConfiguration (602) */
/** @name PolkadotRuntimeParachainsConfigurationHostConfiguration (600) */
export interface PolkadotRuntimeParachainsConfigurationHostConfiguration extends Struct {
readonly maxCodeSize: u32;
readonly maxHeadDataSize: u32;
@@ -1867,19 +1867,19 @@ declare module '@polkadot/types/lookup' {
readonly minimumValidationUpgradeDelay: u32;
}
/** @name PolkadotRuntimeParachainsConfigurationPalletError (605) */
/** @name PolkadotRuntimeParachainsConfigurationPalletError (603) */
export interface PolkadotRuntimeParachainsConfigurationPalletError extends Enum {
readonly isInvalidNewValue: boolean;
readonly type: 'InvalidNewValue';
}
/** @name PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord (608) */
/** @name PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord (606) */
export interface PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord extends Struct {
readonly bitfield: BitVec;
readonly submittedAt: u32;
}
/** @name PolkadotRuntimeParachainsInclusionCandidatePendingAvailability (609) */
/** @name PolkadotRuntimeParachainsInclusionCandidatePendingAvailability (607) */
export interface PolkadotRuntimeParachainsInclusionCandidatePendingAvailability extends Struct {
readonly core: u32;
readonly hash_: H256;
@@ -1891,7 +1891,7 @@ declare module '@polkadot/types/lookup' {
readonly backingGroup: u32;
}
/** @name PolkadotRuntimeParachainsInclusionPalletError (610) */
/** @name PolkadotRuntimeParachainsInclusionPalletError (608) */
export interface PolkadotRuntimeParachainsInclusionPalletError extends Enum {
readonly isUnsortedOrDuplicateValidatorIndices: boolean;
readonly isUnsortedOrDuplicateDisputeStatementSet: boolean;
@@ -1925,14 +1925,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'UnsortedOrDuplicateValidatorIndices' | 'UnsortedOrDuplicateDisputeStatementSet' | 'UnsortedOrDuplicateBackedCandidates' | 'UnexpectedRelayParent' | 'WrongBitfieldSize' | 'BitfieldAllZeros' | 'BitfieldDuplicateOrUnordered' | 'ValidatorIndexOutOfBounds' | 'InvalidBitfieldSignature' | 'UnscheduledCandidate' | 'CandidateScheduledBeforeParaFree' | 'WrongCollator' | 'ScheduledOutOfOrder' | 'HeadDataTooLarge' | 'PrematureCodeUpgrade' | 'NewCodeTooLarge' | 'CandidateNotInParentContext' | 'InvalidGroupIndex' | 'InsufficientBacking' | 'InvalidBacking' | 'NotCollatorSigned' | 'ValidationDataHashMismatch' | 'IncorrectDownwardMessageHandling' | 'InvalidUpwardMessages' | 'HrmpWatermarkMishandling' | 'InvalidOutboundHrmp' | 'InvalidValidationCodeHash' | 'ParaHeadMismatch' | 'BitfieldReferencesFreedCore';
}
/** @name PolkadotPrimitivesV2ScrapedOnChainVotes (611) */
/** @name PolkadotPrimitivesV2ScrapedOnChainVotes (609) */
export interface PolkadotPrimitivesV2ScrapedOnChainVotes extends Struct {
readonly session: u32;
readonly backingValidatorsPerCandidate: Vec<ITuple<[PolkadotPrimitivesV2CandidateReceipt, Vec<ITuple<[u32, PolkadotPrimitivesV2ValidityAttestation]>>]>>;
readonly disputes: Vec<PolkadotPrimitivesV2DisputeStatementSet>;
}
/** @name PolkadotRuntimeParachainsParasInherentPalletError (616) */
/** @name PolkadotRuntimeParachainsParasInherentPalletError (614) */
export interface PolkadotRuntimeParachainsParasInherentPalletError extends Enum {
readonly isTooManyInclusionInherents: boolean;
readonly isInvalidParentHeader: boolean;
@@ -1943,28 +1943,28 @@ declare module '@polkadot/types/lookup' {
readonly type: 'TooManyInclusionInherents' | 'InvalidParentHeader' | 'CandidateConcludedInvalid' | 'InherentOverweight' | 'DisputeStatementsUnsortedOrDuplicates' | 'DisputeInvalid';
}
/** @name PolkadotRuntimeParachainsSchedulerParathreadClaimQueue (618) */
/** @name PolkadotRuntimeParachainsSchedulerParathreadClaimQueue (616) */
export interface PolkadotRuntimeParachainsSchedulerParathreadClaimQueue extends Struct {
readonly queue: Vec<PolkadotRuntimeParachainsSchedulerQueuedParathread>;
readonly nextCoreOffset: u32;
}
/** @name PolkadotRuntimeParachainsSchedulerQueuedParathread (620) */
/** @name PolkadotRuntimeParachainsSchedulerQueuedParathread (618) */
export interface PolkadotRuntimeParachainsSchedulerQueuedParathread extends Struct {
readonly claim: PolkadotPrimitivesV2ParathreadEntry;
readonly coreOffset: u32;
}
/** @name PolkadotPrimitivesV2ParathreadEntry (621) */
/** @name PolkadotPrimitivesV2ParathreadEntry (619) */
export interface PolkadotPrimitivesV2ParathreadEntry extends Struct {
readonly claim: PolkadotPrimitivesV2ParathreadClaim;
readonly retries: u32;
}
/** @name PolkadotPrimitivesV2ParathreadClaim (622) */
/** @name PolkadotPrimitivesV2ParathreadClaim (620) */
export interface PolkadotPrimitivesV2ParathreadClaim extends ITuple<[u32, PolkadotPrimitivesV2CollatorAppPublic]> {}
/** @name PolkadotPrimitivesV2CoreOccupied (625) */
/** @name PolkadotPrimitivesV2CoreOccupied (623) */
export interface PolkadotPrimitivesV2CoreOccupied extends Enum {
readonly isParathread: boolean;
readonly asParathread: PolkadotPrimitivesV2ParathreadEntry;
@@ -1972,7 +1972,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Parathread' | 'Parachain';
}
/** @name PolkadotRuntimeParachainsSchedulerCoreAssignment (628) */
/** @name PolkadotRuntimeParachainsSchedulerCoreAssignment (626) */
export interface PolkadotRuntimeParachainsSchedulerCoreAssignment extends Struct {
readonly core: u32;
readonly paraId: u32;
@@ -1980,7 +1980,7 @@ declare module '@polkadot/types/lookup' {
readonly groupIdx: u32;
}
/** @name PolkadotRuntimeParachainsSchedulerAssignmentKind (629) */
/** @name PolkadotRuntimeParachainsSchedulerAssignmentKind (627) */
export interface PolkadotRuntimeParachainsSchedulerAssignmentKind extends Enum {
readonly isParachain: boolean;
readonly isParathread: boolean;
@@ -1988,7 +1988,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Parachain' | 'Parathread';
}
/** @name PolkadotRuntimeParachainsParasPvfCheckActiveVoteState (630) */
/** @name PolkadotRuntimeParachainsParasPvfCheckActiveVoteState (628) */
export interface PolkadotRuntimeParachainsParasPvfCheckActiveVoteState extends Struct {
readonly votesAccept: BitVec;
readonly votesReject: BitVec;
@@ -1997,7 +1997,7 @@ declare module '@polkadot/types/lookup' {
readonly causes: Vec<PolkadotRuntimeParachainsParasPvfCheckCause>;
}
/** @name PolkadotRuntimeParachainsParasPvfCheckCause (632) */
/** @name PolkadotRuntimeParachainsParasPvfCheckCause (630) */
export interface PolkadotRuntimeParachainsParasPvfCheckCause extends Enum {
readonly isOnboarding: boolean;
readonly asOnboarding: u32;
@@ -2009,7 +2009,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Onboarding' | 'Upgrade';
}
/** @name PolkadotRuntimeParachainsParasParaLifecycle (634) */
/** @name PolkadotRuntimeParachainsParasParaLifecycle (632) */
export interface PolkadotRuntimeParachainsParasParaLifecycle extends Enum {
readonly isOnboarding: boolean;
readonly isParathread: boolean;
@@ -2021,39 +2021,39 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Onboarding' | 'Parathread' | 'Parachain' | 'UpgradingParathread' | 'DowngradingParachain' | 'OffboardingParathread' | 'OffboardingParachain';
}
/** @name PolkadotRuntimeParachainsParasParaPastCodeMeta (636) */
/** @name PolkadotRuntimeParachainsParasParaPastCodeMeta (634) */
export interface PolkadotRuntimeParachainsParasParaPastCodeMeta extends Struct {
readonly upgradeTimes: Vec<PolkadotRuntimeParachainsParasReplacementTimes>;
readonly lastPruned: Option<u32>;
}
/** @name PolkadotRuntimeParachainsParasReplacementTimes (638) */
/** @name PolkadotRuntimeParachainsParasReplacementTimes (636) */
export interface PolkadotRuntimeParachainsParasReplacementTimes extends Struct {
readonly expectedAt: u32;
readonly activatedAt: u32;
}
/** @name PolkadotPrimitivesV2UpgradeGoAhead (640) */
/** @name PolkadotPrimitivesV2UpgradeGoAhead (638) */
export interface PolkadotPrimitivesV2UpgradeGoAhead extends Enum {
readonly isAbort: boolean;
readonly isGoAhead: boolean;
readonly type: 'Abort' | 'GoAhead';
}
/** @name PolkadotPrimitivesV2UpgradeRestriction (641) */
/** @name PolkadotPrimitivesV2UpgradeRestriction (639) */
export interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {
readonly isPresent: boolean;
readonly type: 'Present';
}
/** @name PolkadotRuntimeParachainsParasParaGenesisArgs (642) */
/** @name PolkadotRuntimeParachainsParasParaGenesisArgs (640) */
export interface PolkadotRuntimeParachainsParasParaGenesisArgs extends Struct {
readonly genesisHead: Bytes;
readonly validationCode: Bytes;
readonly parachain: bool;
}
/** @name PolkadotRuntimeParachainsParasPalletError (643) */
/** @name PolkadotRuntimeParachainsParasPalletError (641) */
export interface PolkadotRuntimeParachainsParasPalletError extends Enum {
readonly isNotRegistered: boolean;
readonly isCannotOnboard: boolean;
@@ -2070,27 +2070,27 @@ declare module '@polkadot/types/lookup' {
readonly type: 'NotRegistered' | 'CannotOnboard' | 'CannotOffboard' | 'CannotUpgrade' | 'CannotDowngrade' | 'PvfCheckStatementStale' | 'PvfCheckStatementFuture' | 'PvfCheckValidatorIndexOutOfBounds' | 'PvfCheckInvalidSignature' | 'PvfCheckDoubleVote' | 'PvfCheckSubjectInvalid' | 'PvfCheckDisabled';
}
/** @name PolkadotRuntimeParachainsInitializerBufferedSessionChange (645) */
/** @name PolkadotRuntimeParachainsInitializerBufferedSessionChange (643) */
export interface PolkadotRuntimeParachainsInitializerBufferedSessionChange extends Struct {
readonly validators: Vec<PolkadotPrimitivesV2ValidatorAppPublic>;
readonly queued: Vec<PolkadotPrimitivesV2ValidatorAppPublic>;
readonly sessionIndex: u32;
}
/** @name PolkadotCorePrimitivesInboundDownwardMessage (647) */
/** @name PolkadotCorePrimitivesInboundDownwardMessage (645) */
export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {
readonly sentAt: u32;
readonly msg: Bytes;
}
/** @name PolkadotRuntimeParachainsUmpPalletError (649) */
/** @name PolkadotRuntimeParachainsUmpPalletError (647) */
export interface PolkadotRuntimeParachainsUmpPalletError extends Enum {
readonly isUnknownMessageIndex: boolean;
readonly isWeightOverLimit: boolean;
readonly type: 'UnknownMessageIndex' | 'WeightOverLimit';
}
/** @name PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest (650) */
/** @name PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest (648) */
export interface PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest extends Struct {
readonly confirmed: bool;
readonly age: u32;
@@ -2100,7 +2100,7 @@ declare module '@polkadot/types/lookup' {
readonly maxTotalSize: u32;
}
/** @name PolkadotRuntimeParachainsHrmpHrmpChannel (652) */
/** @name PolkadotRuntimeParachainsHrmpHrmpChannel (650) */
export interface PolkadotRuntimeParachainsHrmpHrmpChannel extends Struct {
readonly maxCapacity: u32;
readonly maxTotalSize: u32;
@@ -2112,13 +2112,13 @@ declare module '@polkadot/types/lookup' {
readonly recipientDeposit: u128;
}
/** @name PolkadotCorePrimitivesInboundHrmpMessage (655) */
/** @name PolkadotCorePrimitivesInboundHrmpMessage (653) */
export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {
readonly sentAt: u32;
readonly data: Bytes;
}
/** @name PolkadotRuntimeParachainsHrmpPalletError (658) */
/** @name PolkadotRuntimeParachainsHrmpPalletError (656) */
export interface PolkadotRuntimeParachainsHrmpPalletError extends Enum {
readonly isOpenHrmpChannelToSelf: boolean;
readonly isOpenHrmpChannelInvalidRecipient: boolean;
@@ -2142,7 +2142,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'OpenHrmpChannelToSelf' | 'OpenHrmpChannelInvalidRecipient' | 'OpenHrmpChannelZeroCapacity' | 'OpenHrmpChannelCapacityExceedsLimit' | 'OpenHrmpChannelZeroMessageSize' | 'OpenHrmpChannelMessageSizeExceedsLimit' | 'OpenHrmpChannelAlreadyExists' | 'OpenHrmpChannelAlreadyRequested' | 'OpenHrmpChannelLimitExceeded' | 'AcceptHrmpChannelDoesntExist' | 'AcceptHrmpChannelAlreadyConfirmed' | 'AcceptHrmpChannelLimitExceeded' | 'CloseHrmpChannelUnauthorized' | 'CloseHrmpChannelDoesntExist' | 'CloseHrmpChannelAlreadyUnderway' | 'CancelHrmpOpenChannelUnauthorized' | 'OpenHrmpChannelDoesntExist' | 'OpenHrmpChannelAlreadyConfirmed' | 'WrongWitness';
}
/** @name PolkadotPrimitivesV2SessionInfo (660) */
/** @name PolkadotPrimitivesV2SessionInfo (658) */
export interface PolkadotPrimitivesV2SessionInfo extends Struct {
readonly activeValidatorIndices: Vec<u32>;
readonly randomSeed: U8aFixed;
@@ -2159,7 +2159,7 @@ declare module '@polkadot/types/lookup' {
readonly neededApprovals: u32;
}
/** @name PolkadotPrimitivesV2DisputeState (663) */
/** @name PolkadotPrimitivesV2DisputeState (661) */
export interface PolkadotPrimitivesV2DisputeState extends Struct {
readonly validatorsFor: BitVec;
readonly validatorsAgainst: BitVec;
@@ -2167,7 +2167,7 @@ declare module '@polkadot/types/lookup' {
readonly concludedAt: Option<u32>;
}
/** @name PolkadotRuntimeParachainsDisputesPalletError (664) */
/** @name PolkadotRuntimeParachainsDisputesPalletError (662) */
export interface PolkadotRuntimeParachainsDisputesPalletError extends Enum {
readonly isDuplicateDisputeStatementSets: boolean;
readonly isAncientDisputeStatement: boolean;
@@ -2179,14 +2179,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'DuplicateDisputeStatementSets' | 'AncientDisputeStatement' | 'ValidatorIndexOutOfBounds' | 'InvalidSignature' | 'DuplicateStatement' | 'PotentialSpam' | 'SingleSidedDispute';
}
/** @name PolkadotRuntimeCommonParasRegistrarParaInfo (665) */
/** @name PolkadotRuntimeCommonParasRegistrarParaInfo (663) */
export interface PolkadotRuntimeCommonParasRegistrarParaInfo extends Struct {
readonly manager: AccountId32;
readonly deposit: u128;
readonly locked: bool;
}
/** @name PolkadotRuntimeCommonParasRegistrarPalletError (666) */
/** @name PolkadotRuntimeCommonParasRegistrarPalletError (664) */
export interface PolkadotRuntimeCommonParasRegistrarPalletError extends Enum {
readonly isNotRegistered: boolean;
readonly isAlreadyRegistered: boolean;
@@ -2205,14 +2205,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'NotRegistered' | 'AlreadyRegistered' | 'NotOwner' | 'CodeTooLarge' | 'HeadDataTooLarge' | 'NotParachain' | 'NotParathread' | 'CannotDeregister' | 'CannotDowngrade' | 'CannotUpgrade' | 'ParaLocked' | 'NotReserved' | 'EmptyCode' | 'CannotSwap';
}
/** @name PolkadotRuntimeCommonSlotsPalletError (668) */
/** @name PolkadotRuntimeCommonSlotsPalletError (666) */
export interface PolkadotRuntimeCommonSlotsPalletError extends Enum {
readonly isParaNotOnboarding: boolean;
readonly isLeaseError: boolean;
readonly type: 'ParaNotOnboarding' | 'LeaseError';
}
/** @name PolkadotRuntimeCommonAuctionsPalletError (673) */
/** @name PolkadotRuntimeCommonAuctionsPalletError (671) */
export interface PolkadotRuntimeCommonAuctionsPalletError extends Enum {
readonly isAuctionInProgress: boolean;
readonly isLeasePeriodInPast: boolean;
@@ -2224,7 +2224,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'AuctionInProgress' | 'LeasePeriodInPast' | 'ParaNotRegistered' | 'NotCurrentAuction' | 'NotAuction' | 'AuctionEnded' | 'AlreadyLeasedOut';
}
/** @name PolkadotRuntimeCommonCrowdloanFundInfo (674) */
/** @name PolkadotRuntimeCommonCrowdloanFundInfo (672) */
export interface PolkadotRuntimeCommonCrowdloanFundInfo extends Struct {
readonly depositor: AccountId32;
readonly verifier: Option<SpRuntimeMultiSigner>;
@@ -2238,7 +2238,7 @@ declare module '@polkadot/types/lookup' {
readonly fundIndex: u32;
}
/** @name PolkadotRuntimeCommonCrowdloanLastContribution (675) */
/** @name PolkadotRuntimeCommonCrowdloanLastContribution (673) */
export interface PolkadotRuntimeCommonCrowdloanLastContribution extends Enum {
readonly isNever: boolean;
readonly isPreEnding: boolean;
@@ -2248,7 +2248,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Never' | 'PreEnding' | 'Ending';
}
/** @name PolkadotRuntimeCommonCrowdloanPalletError (676) */
/** @name PolkadotRuntimeCommonCrowdloanPalletError (674) */
export interface PolkadotRuntimeCommonCrowdloanPalletError extends Enum {
readonly isFirstPeriodInPast: boolean;
readonly isFirstPeriodTooFarInFuture: boolean;
@@ -2276,7 +2276,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'FirstPeriodInPast' | 'FirstPeriodTooFarInFuture' | 'LastPeriodBeforeFirstPeriod' | 'LastPeriodTooFarInFuture' | 'CannotEndInPast' | 'EndTooFarInFuture' | 'Overflow' | 'ContributionTooSmall' | 'InvalidParaId' | 'CapExceeded' | 'ContributionPeriodOver' | 'InvalidOrigin' | 'NotParachain' | 'LeaseActive' | 'BidOrLeaseActive' | 'FundNotEnded' | 'NoContributions' | 'NotReadyToDissolve' | 'InvalidSignature' | 'MemoTooLarge' | 'AlreadyInNewRaise' | 'VrfDelayInProgress' | 'NoLeasePeriod';
}
/** @name PalletXcmQueryStatus (677) */
/** @name PalletXcmQueryStatus (675) */
export interface PalletXcmQueryStatus extends Enum {
readonly isPending: boolean;
readonly asPending: {
@@ -2297,7 +2297,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Pending' | 'VersionNotifier' | 'Ready';
}
/** @name XcmVersionedResponse (680) */
/** @name XcmVersionedResponse (678) */
export interface XcmVersionedResponse extends Enum {
readonly isV0: boolean;
readonly asV0: XcmV0Response;
@@ -2308,7 +2308,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'V0' | 'V1' | 'V2';
}
/** @name PalletXcmVersionMigrationStage (686) */
/** @name PalletXcmVersionMigrationStage (684) */
export interface PalletXcmVersionMigrationStage extends Enum {
readonly isMigrateSupportedVersion: boolean;
readonly isMigrateVersionNotifiers: boolean;
@@ -2318,7 +2318,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'MigrateSupportedVersion' | 'MigrateVersionNotifiers' | 'NotifyCurrentTargets' | 'MigrateAndNotifyOldTargets';
}
/** @name PalletXcmError (687) */
/** @name PalletXcmError (685) */
export interface PalletXcmError extends Enum {
readonly isUnreachable: boolean;
readonly isSendFailure: boolean;
@@ -2336,13 +2336,13 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';
}
/** @name PalletTransactionPaymentChargeTransactionPayment (698) */
/** @name PalletTransactionPaymentChargeTransactionPayment (696) */
export interface PalletTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
/** @name PolkadotRuntimeCommonClaimsPrevalidateAttests (699) */
/** @name PolkadotRuntimeCommonClaimsPrevalidateAttests (697) */
export type PolkadotRuntimeCommonClaimsPrevalidateAttests = Null;
/** @name PolkadotRuntimeRuntime (700) */
/** @name PolkadotRuntimeRuntime (698) */
export type PolkadotRuntimeRuntime = Null;
} // declare module
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '8.6.1' };
@@ -2,7 +2,7 @@
/* eslint-disable */
import type { Data, StorageKey } from '@polkadot/types';
import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
@@ -661,6 +661,7 @@ declare module '@polkadot/types/types/registry' {
OpenTipTip: OpenTipTip;
OpenTipTo225: OpenTipTo225;
OperatingMode: OperatingMode;
OptionBool: OptionBool;
Origin: Origin;
OriginCaller: OriginCaller;
OriginKindV0: OriginKindV0;
File diff suppressed because one or more lines are too long
+7 -7
View File
@@ -20,16 +20,16 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/util": "^9.2.1"
"@babel/runtime": "^7.18.3",
"@polkadot/util": "^9.3.1"
},
"devDependencies": {
"@polkadot/types": "8.5.1",
"@polkadot/types-augment": "8.5.1",
"@polkadot/types-support": "8.5.1",
"@polkadot/util-crypto": "^9.2.1"
"@polkadot/types": "8.6.1",
"@polkadot/types-augment": "8.6.1",
"@polkadot/types-support": "8.6.1",
"@polkadot/util-crypto": "^9.3.1"
}
}
@@ -4,7 +4,7 @@
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, Inspect, IU8a, IVec, Registry } from '../types';
import { compactToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
import { compactToU8a, u8aConcatStrict, u8aToHex } from '@polkadot/util';
import { compareArray } from '../utils/compareArray';
@@ -20,18 +20,10 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
public createdAtHash?: IU8a;
readonly initialU8aLength?: number;
protected constructor (registry: Registry, values: T[], initialU8aLength?: number) {
super(values.length);
// explicitly set the values here - this removes the need for any extra allocations
for (let i = 0; i < values.length; i++) {
this[i] = values[i];
}
protected constructor (registry: Registry, length: number) {
super(length);
this.registry = registry;
this.initialU8aLength = initialU8aLength;
}
/**
@@ -164,8 +156,8 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
const encoded = this.toU8aInner();
return isBare
? u8aConcat(...encoded)
: u8aConcat(compactToU8a(this.length), ...encoded);
? u8aConcatStrict(encoded)
: u8aConcatStrict([compactToU8a(this.length), ...encoded]);
}
public toU8aInner (isBare?: boolean): Uint8Array[] {
+21 -6
View File
@@ -9,6 +9,15 @@ import { compactFromU8a, compactToU8a, isU8a } from '@polkadot/util';
import { typeToConstructor } from '../utils';
interface Options<T> {
definition?: CodecClass<T>;
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
}
function noopSetDefinition <T> (d: CodecClass<T>): CodecClass<T> {
return d;
}
/**
* @name Compact
* @description
@@ -28,9 +37,9 @@ export class Compact<T extends INumber> implements ICompact<T> {
readonly #raw: T;
constructor (registry: Registry, Type: CodecClass<T> | string, value: Compact<T> | AnyNumber = 0) {
constructor (registry: Registry, Type: CodecClass<T> | string, value: Compact<T> | AnyNumber = 0, { definition, setDefinition = noopSetDefinition }: Options<T> = {}) {
this.registry = registry;
this.#Type = typeToConstructor(registry, Type);
this.#Type = definition || setDefinition(typeToConstructor(registry, Type));
const [raw, decodedLength] = Compact.decodeCompact<T>(registry, this.#Type, value);
@@ -38,10 +47,16 @@ export class Compact<T extends INumber> implements ICompact<T> {
this.#raw = raw;
}
public static with<T extends INumber> (Type: CodecClass<T> | string): CodecClass<Compact<T>> {
return class extends Compact<T> {
constructor (registry: Registry, value?: Compact<T> | AnyNumber) {
super(registry, Type, value);
public static with<O extends INumber> (Type: CodecClass<O> | string): CodecClass<Compact<O>> {
let definition: CodecClass<O> | undefined;
// eslint-disable-next-line no-return-assign
const setDefinition = <T> (d: CodecClass<T>) =>
(definition = d as unknown as CodecClass<O>) as unknown as CodecClass<T>;
return class extends Compact<O> {
constructor (registry: Registry, value?: Compact<O> | AnyNumber) {
super(registry, Type, value, { definition, setDefinition });
}
};
}
+41 -21
View File
@@ -4,7 +4,7 @@
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, CodecClass, IEnum, Inspect, IU8a, Registry } from '../types';
import { assert, isCodec, isHex, isNumber, isObject, isString, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, stringPascalCase, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
import { assert, isCodec, isHex, isNumber, isObject, isString, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, stringPascalCase, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
import { mapToTypeMap, typesToMap } from '../utils';
import { Null } from './Null';
@@ -14,6 +14,12 @@ export interface EnumCodecClass<T = Codec> {
new(registry: Registry, value?: any, index?: number): T;
}
interface Definition {
def: TypesDef;
isBasic: boolean;
isIndexed: boolean;
}
interface EntryDef {
Type: CodecClass;
index: number;
@@ -26,6 +32,15 @@ interface Decoded {
value: Codec;
}
interface Options {
definition?: Definition;
setDefinition?: (d: Definition) => Definition;
}
function noopSetDefinition (d: Definition): Definition {
return d;
}
function isRustEnum (def: Record<string, string | CodecClass> | Record<string, number>): def is Record<string, string | CodecClass> {
const defValues = Object.values(def);
@@ -38,7 +53,7 @@ function isRustEnum (def: Record<string, string | CodecClass> | Record<string, n
return true;
}
function extractDef (registry: Registry, _def: Record<string, string | CodecClass> | Record<string, number> | string[]): { def: TypesDef; isBasic: boolean; isIndexed: boolean } {
function extractDef (registry: Registry, _def: Record<string, string | CodecClass> | Record<string, number> | string[]): Definition {
const def: TypesDef = {};
let isBasic: boolean;
let isIndexed: boolean;
@@ -51,12 +66,10 @@ function extractDef (registry: Registry, _def: Record<string, string | CodecClas
isBasic = true;
isIndexed = false;
} else if (isRustEnum(_def)) {
const entries = Object.entries(mapToTypeMap(registry, _def));
const [Types, keys] = mapToTypeMap(registry, _def);
for (let i = 0; i < entries.length; i++) {
const [key, Type] = entries[i];
def[key] = { Type, index: i };
for (let i = 0; i < keys.length; i++) {
def[keys[i]] = { Type: Types[i], index: i };
}
isBasic = !Object.values(def).some(({ Type }) => Type !== Null);
@@ -163,8 +176,8 @@ export class Enum implements IEnum {
readonly #raw: Codec;
constructor (registry: Registry, Types: Record<string, string | CodecClass> | Record<string, number> | string[], value?: unknown, index?: number) {
const { def, isBasic, isIndexed } = extractDef(registry, Types);
constructor (registry: Registry, Types: Record<string, string | CodecClass> | Record<string, number> | string[], value?: unknown, index?: number, { definition, setDefinition = noopSetDefinition }: Options = {}) {
const { def, isBasic, isIndexed } = definition || setDefinition(extractDef(registry, Types));
// shortcut isU8a as used in SCALE decoding
const decoded = isU8a(value) && value.length && !isNumber(index)
@@ -198,9 +211,15 @@ export class Enum implements IEnum {
isKeys[i] = `is${name}`;
}
let definition: Definition | undefined;
// eslint-disable-next-line no-return-assign
const setDefinition = (d: Definition) =>
definition = d;
return class extends Enum {
constructor (registry: Registry, value?: unknown, index?: number) {
super(registry, Types, value, index);
super(registry, Types, value, index, { definition, setDefinition });
objectProperties(this, isKeys, (_, i) => this.type === keys[i]);
objectProperties(this, asKeys, (k, i): Codec => {
@@ -382,15 +401,14 @@ export class Enum implements IEnum {
: this.defKeys;
}
const typeMap = Object
.entries(this.#def)
.reduce((out: Record<string, CodecClass>, [key, { Type }]) => {
out[key] = Type;
const entries = Object.entries(this.#def);
return out;
}, {});
return typesToMap(this.registry, entries.reduce<[CodecClass[], string[]]>((out, [key, { Type }], i) => {
out[0][i] = Type;
out[1][i] = key;
return typesToMap(this.registry, typeMap);
return out;
}, [new Array<CodecClass>(entries.length), new Array<string>(entries.length)]));
}
/**
@@ -414,9 +432,11 @@ export class Enum implements IEnum {
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
public toU8a (isBare?: boolean): Uint8Array {
return u8aConcat(
new Uint8Array(isBare ? [] : [this.index]),
this.#raw.toU8a(isBare)
);
return isBare
? this.#raw.toU8a(isBare)
: u8aConcatStrict([
new Uint8Array([this.index]),
this.#raw.toU8a(isBare)
]);
}
}
+21 -4
View File
@@ -9,6 +9,15 @@ import { assert, isCodec, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot
import { typeToConstructor } from '../utils';
import { Null } from './Null';
interface Options<T> {
definition?: CodecClass<T>;
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
}
function noopSetDefinition <T extends Codec> (d: CodecClass<T>): CodecClass<T> {
return d;
}
class None extends Null {
/**
* @description Returns the base runtime type name for this instance
@@ -60,8 +69,8 @@ export class Option<T extends Codec> implements IOption<T> {
readonly #raw: T;
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown) {
const Type = typeToConstructor(registry, typeName);
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown, { definition, setDefinition = noopSetDefinition }: Options<T> = {}) {
const Type = definition || setDefinition(typeToConstructor(registry, typeName));
const decoded = isU8a(value) && value.length && !isCodec(value)
? value[0] === 0
? new None(registry)
@@ -78,9 +87,17 @@ export class Option<T extends Codec> implements IOption<T> {
}
public static with<O extends Codec> (Type: CodecClass<O> | string): CodecClass<Option<O>> {
let definition: CodecClass<O> | undefined;
const setDefinition = <T> (d: CodecClass<T>): CodecClass<T> => {
definition = d as unknown as CodecClass<O>;
return d;
};
return class extends Option<O> {
constructor (registry: Registry, value?: unknown) {
super(registry, Type, value);
super(registry, Type, value, { definition, setDefinition });
}
};
}
@@ -131,7 +148,7 @@ export class Option<T extends Codec> implements IOption<T> {
/**
* @description The actual value for the Option
*/
public get value (): Codec {
public get value (): T {
return this.#raw;
}
+55 -45
View File
@@ -3,47 +3,49 @@
import type { AnyTupleValue, Codec, CodecClass, Inspect, ITuple, Registry } from '../types';
import { isFunction, isHex, isString, isU8a, stringify, u8aConcat, u8aToU8a } from '@polkadot/util';
import { isFunction, isHex, isString, isU8a, stringify, u8aConcatStrict, u8aToU8a } from '@polkadot/util';
import { AbstractArray } from '../abstract/AbstractArray';
import { decodeU8a, mapToTypeMap, typeToConstructor } from '../utils';
type TupleCodecClasss = CodecClass[] | {
[index: string]: CodecClass;
};
type TupleType = (CodecClass | string);
type TupleTypes = TupleType[] | {
[index: string]: CodecClass | string;
};
type Definition = [CodecClass[], string[]];
interface Options {
definition?: Definition;
setDefinition?: (d: Definition) => Definition;
}
function noopSetDefinition (d: Definition): Definition {
return d;
}
/** @internal */
function decodeTuple (registry: Registry, Classes: TupleCodecClasss, value?: Exclude<AnyTupleValue, Uint8Array>): [Codec[], number] {
function decodeTuple (registry: Registry, result: Codec[], Classes: Definition, value?: Exclude<AnyTupleValue, Uint8Array>): [Codec[], number] {
if (isU8a(value) || isHex(value)) {
return decodeU8a(registry, u8aToU8a(value), Classes);
return decodeU8a(registry, result, u8aToU8a(value), Classes);
}
const Types: CodecClass[] = Array.isArray(Classes)
? Classes
: Object.values(Classes);
const Types = Classes[0];
return [
Types.map((Type, index): Codec => {
try {
const entry = value?.[index];
for (let i = 0; i < Types.length; i++) {
try {
const entry = value?.[i];
if (entry instanceof Type) {
return entry;
}
result[i] = entry instanceof Types[i]
? entry
: new Types[i](registry, entry);
} catch (error) {
throw new Error(`Tuple: failed on ${i}:: ${(error as Error).message}`);
}
}
return new Type(registry, entry);
} catch (error) {
throw new Error(`Tuple: failed on ${index}:: ${(error as Error).message}`);
}
}),
0
];
return [result, 0];
}
/**
@@ -53,27 +55,39 @@ function decodeTuple (registry: Registry, Classes: TupleCodecClasss, value?: Exc
* own type. It extends the base JS `Array` object.
*/
export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
#Types: TupleCodecClasss;
readonly initialU8aLength?: number;
constructor (registry: Registry, Types: TupleTypes | TupleType, value?: AnyTupleValue) {
const Classes = Array.isArray(Types)
? Types.map((t) => typeToConstructor(registry, t))
: isFunction(Types) || isString(Types)
? [typeToConstructor(registry, Types)]
: mapToTypeMap(registry, Types);
const [values, decodedLength] = isU8a(value)
? decodeU8a(registry, value, Classes)
: decodeTuple(registry, Classes, value);
#Types: Definition;
super(registry, values, decodedLength);
constructor (registry: Registry, Types: TupleTypes | TupleType, value?: AnyTupleValue, { definition, setDefinition = noopSetDefinition }: Options = {}) {
const Classes = definition || setDefinition(
Array.isArray(Types)
? [Types.map((t) => typeToConstructor(registry, t)), []]
: isFunction(Types) || isString(Types)
? [[typeToConstructor(registry, Types)], []]
: mapToTypeMap(registry, Types)
);
super(registry, Classes[0].length);
const [, decodedLength] = isU8a(value)
? decodeU8a(registry, this, value, Classes, false)
: decodeTuple(registry, this, Classes, value);
this.initialU8aLength = decodedLength;
this.#Types = Classes;
}
public static with (Types: TupleTypes | TupleType): CodecClass<Tuple> {
let definition: Definition | undefined;
// eslint-disable-next-line no-return-assign
const setDefinition = (d: Definition) =>
definition = d;
return class extends Tuple {
constructor (registry: Registry, value?: AnyTupleValue) {
super(registry, Types, value);
super(registry, Types, value, { definition, setDefinition });
}
};
}
@@ -95,9 +109,9 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
* @description The types definition of the tuple
*/
public get Types (): string[] {
return Array.isArray(this.#Types)
? this.#Types.map((T) => new T(this.registry).toRawType())
: Object.keys(this.#Types);
return this.#Types[1].length
? this.#Types[1]
: this.#Types[0].map((T) => new T(this.registry).toRawType());
}
/**
@@ -113,11 +127,7 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
* @description Returns the base runtime type name for this instance
*/
public toRawType (): string {
const types = (
Array.isArray(this.#Types)
? this.#Types
: Object.values(this.#Types)
).map((T) =>
const types = this.#Types[0].map((T) =>
this.registry.getClassName(T) || new T(this.registry).toRawType()
);
@@ -137,6 +147,6 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
public override toU8a (isBare?: boolean): Uint8Array {
return u8aConcat(...this.toU8aInner(isBare));
return u8aConcatStrict(this.toU8aInner(isBare));
}
}
+48 -25
View File
@@ -4,7 +4,7 @@
import type { HexString } from '@polkadot/util/types';
import type { Codec, CodecClass, Registry } from '../types';
import { assert, compactFromU8a, logger, u8aToU8a } from '@polkadot/util';
import { assert, compactFromU8aLim, isU8a, logger, u8aToU8a } from '@polkadot/util';
import { AbstractArray } from '../abstract/AbstractArray';
import { decodeU8aVec, typeToConstructor } from '../utils';
@@ -13,11 +13,33 @@ const MAX_LENGTH = 64 * 1024;
const l = logger('Vec');
export function decodeVec<T extends Codec> (registry: Registry, Type: CodecClass<T>, value: Uint8Array | HexString | unknown[], length = -1): [T[], number, number] {
if (Array.isArray(value)) {
const result = new Array<T>(value.length);
interface Options<T> {
definition?: CodecClass<T>;
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
}
for (let i = 0; i < value.length; i++) {
function noopSetDefinition <T extends Codec> (d: CodecClass<T>): CodecClass<T> {
return d;
}
function decodeVecLength (value: Uint8Array | HexString | unknown[]): [Uint8Array | unknown[], number, number] {
if (Array.isArray(value)) {
return [value, value.length, 0];
}
const u8a = u8aToU8a(value);
const [startAt, length] = compactFromU8aLim(u8a);
assert(length <= MAX_LENGTH, () => `Vec length ${length.toString()} exceeds ${MAX_LENGTH}`);
return [u8a, length, startAt];
}
export function decodeVec<T extends Codec> (registry: Registry, result: T[], value: Uint8Array | HexString | unknown[], startAt: number, Type: CodecClass<T>): [number, number] {
if (Array.isArray(value)) {
const count = result.length;
for (let i = 0; i < count; i++) {
const entry = value[i];
try {
@@ -31,22 +53,10 @@ export function decodeVec<T extends Codec> (registry: Registry, Type: CodecClass
}
}
return [result, 0, 0];
return [0, 0];
}
const u8a = u8aToU8a(value);
let offset = 0;
if (length === -1) {
const [_offset, _length] = compactFromU8a(u8a);
assert(_length.lten(MAX_LENGTH), () => `Vec length ${_length.toString()} exceeds ${MAX_LENGTH}`);
length = _length.toNumber();
offset = _offset;
}
return decodeU8aVec(registry, u8a, offset, Type, length);
return decodeU8aVec(registry, result, u8aToU8a(value), startAt, Type);
}
/**
@@ -57,21 +67,34 @@ export function decodeVec<T extends Codec> (registry: Registry, Type: CodecClass
* specific encoding/decoding on top of the base type.
*/
export class Vec<T extends Codec> extends AbstractArray<T> {
readonly initialU8aLength?: number;
#Type: CodecClass<T>;
constructor (registry: Registry, Type: CodecClass<T> | string, value: Uint8Array | HexString | unknown[] = []) {
const Clazz = typeToConstructor<T>(registry, Type);
const [values, decodedLength] = decodeVec(registry, Clazz, value);
constructor (registry: Registry, Type: CodecClass<T> | string, value: Uint8Array | HexString | unknown[] = [], { definition, setDefinition = noopSetDefinition }: Options<T> = {}) {
const [decodeFrom, length, startAt] = decodeVecLength(value);
super(registry, values, decodedLength);
super(registry, length);
this.#Type = Clazz;
this.#Type = definition || setDefinition(typeToConstructor<T>(registry, Type));
const [decodedLength] = isU8a(decodeFrom)
? decodeU8aVec(registry, this, decodeFrom, startAt, this.#Type)
: decodeVec(registry, this, decodeFrom, startAt, this.#Type);
this.initialU8aLength = decodedLength;
}
public static with<O extends Codec> (Type: CodecClass<O> | string): CodecClass<Vec<O>> {
let definition: CodecClass<O> | undefined;
// eslint-disable-next-line no-return-assign
const setDefinition = <T> (d: CodecClass<T>) =>
(definition = d as unknown as CodecClass<O>) as unknown as CodecClass<T>;
return class extends Vec<O> {
constructor (registry: Registry, value?: any[]) {
super(registry, Type, value);
super(registry, Type, value, { definition, setDefinition });
}
};
}
+25 -20
View File
@@ -4,23 +4,19 @@
import type { HexString } from '@polkadot/util/types';
import type { Codec, CodecClass, Inspect, Registry } from '../types';
import { assert, isU8a, u8aConcat } from '@polkadot/util';
import { isU8a, u8aConcatStrict } from '@polkadot/util';
import { AbstractArray } from '../abstract/AbstractArray';
import { decodeU8aVec, typeToConstructor } from '../utils';
import { decodeVec } from './Vec';
/** @internal */
function decodeVecFixed<T extends Codec> (registry: Registry, value: HexString | unknown[], Type: CodecClass<T>, length: number): [T[], number, number] {
const [values, decodedLength, decodedLengthNoOffset] = decodeVec(registry, Type, value, length);
interface Options<T> {
definition?: CodecClass<T>;
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
}
while (values.length < length) {
values.push(new Type(registry));
}
assert(values.length === length, () => `Expected a length of exactly ${length} entries`);
return [values, decodedLength, decodedLengthNoOffset];
function noopSetDefinition <T extends Codec> (d: CodecClass<T>): CodecClass<T> {
return d;
}
/**
@@ -29,23 +25,32 @@ function decodeVecFixed<T extends Codec> (registry: Registry, value: HexString |
* This manages codec arrays of a fixed length
*/
export class VecFixed<T extends Codec> extends AbstractArray<T> {
readonly initialU8aLength?: number;
#Type: CodecClass<T>;
constructor (registry: Registry, Type: CodecClass<T> | string, length: number, value: Uint8Array | HexString | unknown[] = [] as unknown[]) {
const Clazz = typeToConstructor<T>(registry, Type);
const [values,, decodedLengthNoOffset] = isU8a(value)
? decodeU8aVec(registry, value, 0, Clazz, length)
: decodeVecFixed(registry, value, Clazz, length);
constructor (registry: Registry, Type: CodecClass<T> | string, length: number, value: Uint8Array | HexString | unknown[] = [] as unknown[], { definition, setDefinition = noopSetDefinition }: Options<T> = {}) {
super(registry, length);
super(registry, values, decodedLengthNoOffset);
this.#Type = definition || setDefinition(typeToConstructor<T>(registry, Type));
this.#Type = Clazz;
const [, decodedLengthNoOffset] = isU8a(value)
? decodeU8aVec(registry, this, value, 0, this.#Type)
: decodeVec(registry, this, value, 0, this.#Type);
this.initialU8aLength = decodedLengthNoOffset;
}
public static with<O extends Codec> (Type: CodecClass<O> | string, length: number): CodecClass<VecFixed<O>> {
let definition: CodecClass<O> | undefined;
// eslint-disable-next-line no-return-assign
const setDefinition = <T> (d: CodecClass<T>) =>
(definition = d as unknown as CodecClass<O>) as unknown as CodecClass<T>;
return class extends VecFixed<O> {
constructor (registry: Registry, value?: any[]) {
super(registry, Type, length, value);
super(registry, Type, length, value, { definition, setDefinition });
}
};
}
@@ -85,7 +90,7 @@ export class VecFixed<T extends Codec> extends AbstractArray<T> {
const encoded = this.toU8aInner();
return encoded.length
? u8aConcat(...encoded)
? u8aConcatStrict(encoded)
: new Uint8Array([]);
}
@@ -4,7 +4,7 @@
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, CodecClass, Inspect, ISet, IU8a, Registry } from '../types';
import { compactFromU8a, compactToU8a, isHex, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
import { compactFromU8aLim, compactToU8a, isHex, isU8a, logger, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
import { compareSet, decodeU8aVec, sortSet, typeToConstructor } from '../utils';
@@ -13,11 +13,12 @@ const l = logger('BTreeSet');
/** @internal */
function decodeSetFromU8a<V extends Codec> (registry: Registry, ValClass: CodecClass<V>, u8a: Uint8Array): [CodecClass<V>, Set<V>, number] {
const output = new Set<V>();
const [offset, length] = compactFromU8a(u8a);
const [values, decodedLength] = decodeU8aVec(registry, u8a, offset, ValClass, length.toNumber());
const [offset, count] = compactFromU8aLim(u8a);
const result = new Array<V>(count);
const [decodedLength] = decodeU8aVec(registry, result, u8a, offset, ValClass);
for (let i = 0; i < values.length; i++) {
output.add(values[i]);
for (let i = 0; i < count; i++) {
output.add(result[i] as unknown as V);
}
return [ValClass, output, decodedLength];
@@ -214,6 +215,6 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V>
encoded.push(v.toU8a(isBare));
}
return u8aConcat(...encoded);
return u8aConcatStrict(encoded);
}
}
+5 -5
View File
@@ -3,7 +3,7 @@
import type { AnyU8a, Inspect, Registry } from '../types';
import { assert, compactFromU8a, compactToU8a, isString, u8aConcat, u8aToU8a } from '@polkadot/util';
import { assert, compactFromU8aLim, compactToU8a, isString, u8aConcatStrict, u8aToU8a } from '@polkadot/util';
import { Raw } from '../native/Raw';
@@ -14,12 +14,12 @@ function decodeBitVecU8a (value?: Uint8Array): [number, Uint8Array] {
}
// handle all other Uint8Array inputs, these do have a length prefix which is the number of bits encoded
const [offset, length] = compactFromU8a(value);
const total = offset + Math.ceil(length.toNumber() / 8);
const [offset, length] = compactFromU8aLim(value);
const total = offset + Math.ceil(length / 8);
assert(total <= value.length, () => `BitVec: required length less than remainder, expected at least ${total}, found ${value.length}`);
return [length.toNumber(), value.subarray(offset, total)];
return [length, value.subarray(offset, total)];
}
/** @internal */
@@ -96,6 +96,6 @@ export class BitVec extends Raw {
return isBare
? bitVec
: u8aConcat(compactToU8a(this.#decodedLength), bitVec);
: u8aConcatStrict([compactToU8a(this.#decodedLength), bitVec]);
}
}
+10 -8
View File
@@ -3,7 +3,7 @@
import type { AnyU8a, Inspect, Registry } from '../types';
import { assert, compactAddLength, compactFromU8a, compactToU8a, isCodec, isString, isU8a, u8aToU8a } from '@polkadot/util';
import { assert, compactAddLength, compactFromU8aLim, compactToU8a, isCodec, isString, isU8a, u8aToU8a } from '@polkadot/util';
import { Raw } from '../native/Raw';
@@ -17,10 +17,10 @@ function decodeBytesU8a (value: Uint8Array): [Uint8Array, number] {
}
// handle all other Uint8Array inputs, these do have a length prefix
const [offset, length] = compactFromU8a(value);
const total = offset + length.toNumber();
const [offset, length] = compactFromU8aLim(value);
const total = offset + length;
assert(length.lten(MAX_LENGTH), () => `Bytes length ${length.toString()} exceeds ${MAX_LENGTH}`);
assert(length <= MAX_LENGTH, () => `Bytes length ${length.toString()} exceeds ${MAX_LENGTH}`);
assert(total <= value.length, () => `Bytes: required length less than remainder, expected at least ${total}, found ${value.length}`);
return [value.subarray(offset, total), total];
@@ -54,13 +54,15 @@ export class Bytes extends Raw {
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
override inspect (): Inspect {
override inspect (isBare?: boolean): Inspect {
const clength = compactToU8a(this.length);
return {
outer: this.length
? [clength, super.toU8a()]
: [clength]
outer: isBare
? [super.toU8a()]
: this.length
? [clength, super.toU8a()]
: [clength]
};
}
+4 -5
View File
@@ -4,7 +4,7 @@
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, Codec, CodecClass, IMap, Inspect, IU8a, Registry } from '../types';
import { compactFromU8a, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
import { compactFromU8aLim, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
import { AbstractArray } from '../abstract/AbstractArray';
import { Enum } from '../base/Enum';
@@ -16,15 +16,14 @@ const l = logger('Map');
/** @internal */
function decodeMapFromU8a<K extends Codec, V extends Codec> (registry: Registry, KeyClass: CodecClass<K>, ValClass: CodecClass<V>, u8a: Uint8Array): [CodecClass<K>, CodecClass<V>, Map<K, V>, number] {
const output = new Map<K, V>();
const [offset, length] = compactFromU8a(u8a);
const count = length.toNumber();
const [offset, count] = compactFromU8aLim(u8a);
const types = [];
for (let i = 0; i < count; i++) {
types.push(KeyClass, ValClass);
}
const [values, decodedLength] = decodeU8a(registry, u8a.subarray(offset), types);
const [values, decodedLength] = decodeU8a(registry, new Array(types.length), u8a.subarray(offset), [types, []]);
for (let i = 0; i < values.length; i += 2) {
output.set(values[i] as K, values[i + 1] as V);
@@ -231,6 +230,6 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
encoded.push(k.toU8a(isBare), v.toU8a(isBare));
}
return u8aConcat(...encoded);
return u8aConcatStrict(encoded);
}
}
@@ -0,0 +1,47 @@
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import { OptionBool } from '@polkadot/types-codec';
describe('OptionBool', (): void => {
const registry = new TypeRegistry();
describe('decodes', (): void => {
it('decodes none', (): void => {
expect(new OptionBool(registry).toJSON()).toEqual(null);
});
it('decodes true', (): void => {
expect(new OptionBool(registry, true).toJSON()).toEqual(true);
});
it('decodes false', (): void => {
expect(new OptionBool(registry, false).toJSON()).toEqual(false);
});
});
describe('encodes', (): void => {
it('encodes none', (): void => {
expect(new OptionBool(registry).toU8a()).toEqual(new Uint8Array([0]));
});
it('encodes true', (): void => {
expect(new OptionBool(registry, true).toU8a()).toEqual(new Uint8Array([1]));
});
it('encodes false', (): void => {
expect(new OptionBool(registry, false).toU8a()).toEqual(new Uint8Array([2]));
});
});
it('has a sane toRawType representation', (): void => {
expect(new OptionBool(registry).toRawType()).toEqual('Option<bool>');
});
it('has a sane inspect', (): void => {
expect(new OptionBool(registry, true).inspect()).toEqual({
outer: [new Uint8Array([1])]
});
});
});
@@ -0,0 +1,98 @@
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyBool, Inspect, Registry } from '../types';
import { isHex, isU8a, u8aToU8a } from '@polkadot/util';
import { Option } from '../base/Option';
import { bool as Bool } from '../native/Bool';
function decodeU8a (registry: Registry, value: Uint8Array): null | Bool {
// Encoded as -
// - 0 = None
// - 1 = True
// - 2 = False
return value[0] === 0
? null
: new Bool(registry, value[0] === 1);
}
/**
* @name OptionBool
* @description A specific implementation of Option<bool> than allows for single-byte encoding
*/
export class OptionBool extends Option<Bool> {
constructor (registry: Registry, value?: Option<Bool> | AnyBool | Uint8Array | HexString | null) {
super(
registry,
Bool,
isU8a(value) || isHex(value)
? decodeU8a(registry, u8aToU8a(value))
: value
);
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
public override get encodedLength (): number {
return 1;
}
/**
* @description The length of the initial encoded value (Only available when constructed from a Uint8Array)
*/
public override get initialU8aLength (): number {
return 1;
}
/**
* @description Checks if the value is an empty value (always false)
*/
public get isFalse (): boolean {
return this.isSome
? !this.value.valueOf()
: false;
}
/**
* @description Checks if the value is an empty value (always false)
*/
public get isTrue (): boolean {
return this.isSome
? this.value.valueOf()
: false;
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
override inspect (): Inspect {
return { outer: [this.toU8a()] };
}
/**
* @description Returns the base runtime type name for this instance
*/
public override toRawType (isBare?: boolean): string {
return isBare
? 'bool'
: 'Option<bool>';
}
/**
* @description Encodes the value as a Uint8Array as per the SCALE specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
public override toU8a (isBare?: boolean): Uint8Array {
if (isBare) {
return super.toU8a(true);
}
return this.isSome
? new Uint8Array([this.isTrue ? 1 : 2])
: new Uint8Array([0]);
}
}
@@ -8,6 +8,7 @@ export { Bytes } from './Bytes';
export { HashMap } from './HashMap';
export { Linkage } from './Linkage';
export { CodecMap, CodecMap as Map } from './Map';
export { OptionBool } from './OptionBool';
export { Range } from './Range';
export { RangeInclusive } from './RangeInclusive';
export { Type } from './Type';
+2 -3
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { Codec, Inspect, IU8a, Registry } from '../types';
import type { AnyBool, Codec, Inspect, IU8a, Registry } from '../types';
import { isU8a, u8aToHex } from '@polkadot/util';
@@ -17,8 +17,7 @@ export class bool extends Boolean implements Codec {
public createdAtHash?: IU8a;
// eslint-disable-next-line @typescript-eslint/ban-types
constructor (registry: Registry, value: bool | Boolean | Uint8Array | boolean | number = false) {
constructor (registry: Registry, value: bool | AnyBool | Uint8Array | number = false) {
super(
isU8a(value)
? value[0] === 1
+45 -29
View File
@@ -2,30 +2,40 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyJson, BareOpts, Codec, CodecClass, CodecClassDef, Inspect, IStruct, IU8a, Registry } from '../types';
import type { AnyJson, BareOpts, Codec, CodecClass, Inspect, IStruct, IU8a, Registry } from '../types';
import { assert, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
import { assert, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
import { compareMap, decodeU8a, mapToTypeMap, typesToMap } from '../utils';
type TypesDef<T = Codec> = Record<string, string | CodecClass<T>>;
type Definition = [CodecClass[], string[]];
interface Options {
definition?: Definition;
setDefinition?: (d: Definition) => Definition;
}
function noopSetDefinition (d: Definition): Definition {
return d;
}
/** @internal */
function decodeStructFromObject (registry: Registry, Types: CodecClassDef, value: any, jsonMap: Map<string, string>): [Iterable<[string, Codec]>, number] {
function decodeStructFromObject (registry: Registry, [Types, keys]: Definition, value: any, jsonMap: Map<string, string>): [Iterable<[string, Codec]>, number] {
let jsonObj: Record<string, unknown> | undefined;
const inputKeys = Object.keys(Types);
const typeofArray = Array.isArray(value);
const typeofMap = value instanceof Map;
assert(typeofArray || typeofMap || isObject(value), () => `Struct: Cannot decode value ${stringify(value)} (typeof ${typeof value}), expected an input object, map or array`);
assert(!typeofArray || value.length === inputKeys.length, () => `Struct: Unable to map ${stringify(value)} array to object with known keys ${inputKeys.join(', ')}`);
assert(!typeofArray || value.length === keys.length, () => `Struct: Unable to map ${stringify(value)} array to object with known keys ${keys.join(', ')}`);
const raw = new Array<[string, Codec]>(inputKeys.length);
const raw = new Array<[string, Codec]>(keys.length);
for (let i = 0; i < inputKeys.length; i++) {
const key = inputKeys[i];
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const jsonKey = jsonMap.get(key) || key;
const Type = Types[key];
const Type = Types[i];
let assign: unknown;
try {
@@ -98,17 +108,15 @@ export class Struct<
readonly #jsonMap: Map<keyof S, string>;
readonly #Types: CodecClassDef;
readonly #Types: Definition;
constructor (registry: Registry, Types: S, value?: V | Map<unknown, unknown> | unknown[] | HexString | null, jsonMap = new Map<string, string>()) {
const typeMap = mapToTypeMap(registry, Types);
const [decoded, decodedLength] = isU8a(value)
? decodeU8a<Codec, [string, Codec]>(registry, value, typeMap, true)
: isHex(value)
? decodeU8a<Codec, [string, Codec]>(registry, u8aToU8a(value), typeMap, true)
: value instanceof Struct
? [value as Iterable<[string, Codec]>, 0]
: decodeStructFromObject(registry, typeMap, value || {}, jsonMap);
constructor (registry: Registry, Types: S, value?: V | Map<unknown, unknown> | unknown[] | HexString | null, jsonMap = new Map<string, string>(), { definition, setDefinition = noopSetDefinition }: Options = {}) {
const typeMap = definition || setDefinition(mapToTypeMap(registry, Types));
const [decoded, decodedLength] = isU8a(value) || isHex(value)
? decodeU8a<Codec, [string, Codec]>(registry, new Array(typeMap[0].length), u8aToU8a(value), typeMap, true)
: value instanceof Struct
? [value as Iterable<[string, Codec]>, 0]
: decodeStructFromObject(registry, typeMap, value || {}, jsonMap);
super(decoded);
@@ -121,9 +129,15 @@ export class Struct<
public static with<S extends TypesDef> (Types: S, jsonMap?: Map<string, string>): CodecClass<Struct<S>> {
const keys = Object.keys(Types);
let definition: Definition | undefined;
// eslint-disable-next-line no-return-assign
const setDefinition = (d: Definition) =>
definition = d;
return class extends Struct<S> {
constructor (registry: Registry, value?: unknown) {
super(registry, Types, value as HexString, jsonMap);
super(registry, Types, value as HexString, jsonMap, { definition, setDefinition });
objectProperties(this, keys, (k) => this.get(k));
}
@@ -134,7 +148,7 @@ export class Struct<
* @description The available keys for this struct
*/
public get defKeys (): string[] {
return Object.keys(this.#Types);
return this.#Types[1];
}
public getT <T> (key: string): T {
@@ -159,12 +173,10 @@ export class Struct<
*/
public get Type (): E {
const result: Record<string, string> = {};
const defs = Object.entries(this.#Types);
const [Types, keys] = this.#Types;
for (let i = 0; i < defs.length; i++) {
const [key, Type] = defs[i];
result[key] = new Type(this.registry).toRawType();
for (let i = 0; i < keys.length; i++) {
result[keys[i]] = new Types[i](this.registry).toRawType();
}
return result as E;
@@ -219,12 +231,16 @@ export class Struct<
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect {
inspect (isBare?: BareOpts): Inspect {
const inner = new Array<Inspect>();
for (const [k, v] of this.entries()) {
inner.push({
...v.inspect(),
...v.inspect(
!isBare || isBoolean(isBare)
? isBare
: isBare[k]
),
name: stringCamelCase(k as string)
});
}
@@ -309,6 +325,6 @@ export class Struct<
}
}
return u8aConcat(...encoded);
return u8aConcatStrict(encoded);
}
}
+7 -7
View File
@@ -2,16 +2,16 @@
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { AnyU8a, Inspect, IText, IU8a, Registry } from '../types';
import type { AnyString, AnyU8a, Inspect, IText, IU8a, Registry } from '../types';
import { assert, compactAddLength, compactFromU8a, compactToU8a, hexToU8a, isHex, isString, isU8a, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util';
import { assert, compactAddLength, compactFromU8aLim, compactToU8a, hexToU8a, isHex, isString, isU8a, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util';
import { Raw } from './Raw';
const MAX_LENGTH = 128 * 1024;
/** @internal */
function decodeText (value?: null | Text | string | AnyU8a | { toString: () => string }): [string, number] {
function decodeText (value?: null | AnyString | AnyU8a | { toString: () => string }): [string, number] {
if (isU8a(value)) {
if (!value.length) {
return ['', 0];
@@ -23,10 +23,10 @@ function decodeText (value?: null | Text | string | AnyU8a | { toString: () => s
return [u8aToString(value), 0];
}
const [offset, length] = compactFromU8a(value);
const total = offset + length.toNumber();
const [offset, length] = compactFromU8aLim(value);
const total = offset + length;
assert(length.lten(MAX_LENGTH), () => `Text: length ${length.toString()} exceeds ${MAX_LENGTH}`);
assert(length <= MAX_LENGTH, () => `Text: length ${length.toString()} exceeds ${MAX_LENGTH}`);
assert(total <= value.length, () => `Text: required length less than remainder, expected at least ${total}, found ${value.length}`);
return [u8aToString(value.subarray(offset, total)), total];
@@ -54,7 +54,7 @@ export class Text extends String implements IText {
#override: string | null = null;
constructor (registry: Registry, value?: null | Text | string | AnyU8a | { toString: () => string }) {
constructor (registry: Registry, value?: null | AnyString | AnyU8a | { toString: () => string }) {
const [str, decodedLength] = decodeText(value);
super(str);
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '8.6.1' };
+1 -3
View File
@@ -60,7 +60,7 @@ export interface Codec {
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
inspect (): Inspect;
inspect (isBare?: BareOpts): Inspect;
/**
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
@@ -105,8 +105,6 @@ export interface CodecClass<T = Codec> {
new(registry: Registry, ...args: any[]): T;
}
export type CodecClassDef<T = Codec> = Record<string, CodecClass<T>>;
export type CodecTo = 'toHex' | 'toJSON' | 'toString' | 'toU8a';
export type ArgsDef = Record<string, CodecClass | string>;
+5 -1
View File
@@ -10,7 +10,11 @@ export type AnyFunction = (...args: any[]) => any;
export type AnyNumber = BN | bigint | Uint8Array | number | string;
export type AnyString = string | string;
// eslint-disable-next-line @typescript-eslint/ban-types
export type AnyString = String | string;
// eslint-disable-next-line @typescript-eslint/ban-types
export type AnyBool = Boolean | boolean;
export type AnyTuple = Codec[];
+10 -14
View File
@@ -25,22 +25,18 @@ function getRawType (registry: Registry, Type: CodecClass): string | null {
* @param result - The result array (will be returned with values pushed)
* @param types - The array of CodecClass to decode the U8a against.
*/
export function decodeU8a <T extends Codec = Codec, E = T> (registry: Registry, u8a: Uint8Array, types: CodecClass[] | { [index: string]: CodecClass }, withZip?: boolean): [E[], number] {
const [Types, keys]: [CodecClass[], string[]] = Array.isArray(types)
? [types, []]
: [Object.values(types), Object.keys(types)];
const result = new Array<E>(Types.length);
export function decodeU8a <T extends Codec = Codec, E = T> (registry: Registry, result: unknown[], u8a: Uint8Array, [Types, keys]: [CodecClass[], string[]], withZip?: boolean): [E[], number] {
const count = result.length;
let offset = 0;
for (let i = 0; i < Types.length; i++) {
for (let i = 0; i < count; i++) {
try {
const value = new Types[i](registry, u8a.subarray(offset));
offset += value.initialU8aLength || value.encodedLength;
result[i] = withZip
? [keys[i], value] as unknown as E
: value as unknown as E;
? [keys[i], value]
: value;
} catch (error) {
throw new Error(formatFailure(
error as Error,
@@ -51,14 +47,14 @@ export function decodeU8a <T extends Codec = Codec, E = T> (registry: Registry,
}
}
return [result, offset];
return [result as E[], offset];
}
// Split from decodeU8a since this is specialized to 1 instance ... yes duplication, but
// since we have to do less checks (and these are intensive anyway), much faster
export function decodeU8aVec <T extends Codec = Codec> (registry: Registry, u8a: Uint8Array, start: number, Type: CodecClass<T>, count: number): [T[], number, number] {
const result = new Array<T>(count);
let offset = start;
export function decodeU8aVec <T extends Codec = Codec> (registry: Registry, result: unknown[], u8a: Uint8Array, startAt: number, Type: CodecClass<T>): [number, number] {
const count = result.length;
let offset = startAt;
for (let i = 0; i < count; i++) {
try {
@@ -75,5 +71,5 @@ export function decodeU8aVec <T extends Codec = Codec> (registry: Registry, u8a:
}
}
return [result, offset, offset - start];
return [offset, offset - startAt];
}
@@ -8,12 +8,14 @@ import { typeToConstructor } from './typeToConstructor';
/**
* @description takes an input map of the form `{ [string]: string | CodecClass }` and returns a map of `{ [string]: CodecClass }`
*/
export function mapToTypeMap (registry: Registry, input: Record<string, string | CodecClass>): Record<string, CodecClass> {
export function mapToTypeMap (registry: Registry, input: Record<string, string | CodecClass>): [CodecClass[], string[]] {
const entries = Object.entries(input);
const output: Record<string, CodecClass> = {};
const count = entries.length;
const output: [CodecClass[], string[]] = [new Array<CodecClass>(count), new Array<string>(count)];
for (let i = 0; i < entries.length; i++) {
output[entries[i][0]] = typeToConstructor(registry, entries[i][1]);
output[1][i] = entries[i][0];
output[0][i] = typeToConstructor(registry, entries[i][1]);
}
return output;
+13 -6
View File
@@ -45,9 +45,17 @@ const mappings: Mapper[] = [
// flattens tuples with one value, `(AccountId)` -> `AccountId`
flattenSingleTuple(),
// converts ::Type to Type, <T as Trait<I>>::Proposal -> Proposal
removeColons()
removeColons(),
// remove all trailing spaces - this should always be the last
trim()
];
// given a string, trim it
export function trim (): Mapper {
return (value: string): string =>
value.trim();
}
// given a starting index, find the closing >
export function findClosing (value: string, start: number): number {
let depth = 0;
@@ -257,10 +265,11 @@ const sanitizeMap = new Map<string, string>();
// eslint-disable-next-line @typescript-eslint/ban-types
export function sanitize (value: String | string, options?: SanitizeOptions): string {
let result = value.toString();
const startValue = value.toString();
let result = startValue;
if (!options) {
const memoized = sanitizeMap.get(result);
const memoized = sanitizeMap.get(startValue);
if (memoized) {
return memoized;
@@ -271,10 +280,8 @@ export function sanitize (value: String | string, options?: SanitizeOptions): st
result = mappings[i](result, options);
}
result = result.trim();
if (!options) {
sanitizeMap.set(value.toString(), result);
sanitizeMap.set(startValue, result);
}
return result;
+3 -6
View File
@@ -3,14 +3,11 @@
import type { CodecClass, Registry } from '../types';
export function typesToMap (registry: Registry, Types: Record<string, CodecClass>): Record<string, string> {
const entries = Object.entries(Types);
export function typesToMap (registry: Registry, [Types, keys]: [CodecClass[], string[]]): Record<string, string> {
const result: Record<string, string> = {};
for (let i = 0; i < entries.length; i++) {
const [key, Type] = entries[i];
result[key] = registry.getClassName(Type) || new Type(registry).toRawType();
for (let i = 0; i < keys.length; i++) {
result[keys[i]] = registry.getClassName(Types[i]) || new Types[i](registry).toRawType();
}
return result;
+5 -5
View File
@@ -20,14 +20,14 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/types-codec": "8.5.1",
"@polkadot/util": "^9.2.1"
"@babel/runtime": "^7.18.3",
"@polkadot/types-codec": "8.6.1",
"@polkadot/util": "^9.3.1"
},
"devDependencies": {
"@polkadot/types": "8.5.1"
"@polkadot/types": "8.6.1"
}
}
+20 -8
View File
@@ -4,7 +4,7 @@
import type { Codec, CodecClass, Registry, U8aBitLength, UIntBitLength } from '@polkadot/types-codec/types';
import type { TypeDef } from '../types';
import { BTreeMap, BTreeSet, Bytes, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Null, Option, Range, RangeInclusive, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
import { BTreeMap, BTreeSet, Bytes, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Null, Option, OptionBool, Range, RangeInclusive, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
import { assert, isNumber, stringify } from '@polkadot/util';
import { TypeDefInfo } from '../types';
@@ -115,8 +115,15 @@ const infoMapping: Record<TypeDefInfo, (registry: Registry, value: TypeDef) => C
[TypeDefInfo.Null]: (registry: Registry, _: TypeDef): CodecClass<Codec> =>
Null,
[TypeDefInfo.Option]: (registry: Registry, value: TypeDef): CodecClass<Codec> =>
createWithSub(Option, value),
[TypeDefInfo.Option]: (registry: Registry, value: TypeDef): CodecClass<Codec> => {
assert(value.sub && !Array.isArray(value.sub), 'Expected type information for Option');
return (
value.sub.type === 'bool'
? OptionBool
: createWithSub(Option, value)
);
},
[TypeDefInfo.Plain]: (registry: Registry, value: TypeDef): CodecClass<Codec> =>
registry.getOrUnknown(value.type),
@@ -208,10 +215,15 @@ export function getTypeClass<T extends Codec = Codec> (registry: Registry, typeD
}
export function createClassUnsafe<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K): CodecClass<T> {
return getTypeClass(
registry,
registry.isLookupType(type)
? registry.lookup.getTypeDef(type)
: getTypeDef(type)
return (
// just retrieve via name, no creation via typeDef
registry.getUnsafe(type) ||
// we don't have an existing type, create the class via typeDef
getTypeClass(
registry,
registry.isLookupType(type)
? registry.lookup.getTypeDef(type)
: getTypeDef(type)
)
);
}
+6 -8
View File
@@ -32,13 +32,11 @@ function checkInstance (created: Codec, matcher: Uint8Array): void {
assert(isOk, () => `${rawType}:: Decoded input doesn't match input, received ${u8aToHex(matcher, 512)} (${matcher.length} bytes), created ${u8aToHex(u8a, 512)} (${u8a.length} bytes)`);
}
function checkPedantic (created: Codec, [value]: unknown[], isPedantic = false): void {
if (isPedantic) {
if (isU8a(value)) {
checkInstance(created, value);
} else if (isHex(value)) {
checkInstance(created, u8aToU8a(value));
}
function checkPedantic (created: Codec, [value]: unknown[]): void {
if (isU8a(value)) {
checkInstance(created, value);
} else if (isHex(value)) {
checkInstance(created, u8aToU8a(value));
}
}
@@ -47,7 +45,7 @@ function checkPedantic (created: Codec, [value]: unknown[], isPedantic = false):
function initType<T extends Codec> (registry: Registry, Type: CodecClass, params: unknown[] = [], { blockHash, isOptional, isPedantic }: CreateOptions = {}): T {
const created = new (isOptional ? Option.with(Type) : Type)(registry, ...params);
checkPedantic(created, params, isPedantic);
isPedantic && checkPedantic(created, params);
if (blockHash) {
created.createdAtHash = createTypeUnsafe<IU8a>(registry, 'Hash', [blockHash]);
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '8.6.1' };
+7 -7
View File
@@ -20,14 +20,14 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/networks": "^9.2.1",
"@polkadot/types": "8.5.1",
"@polkadot/types-codec": "8.5.1",
"@polkadot/types-create": "8.5.1",
"@polkadot/util": "^9.2.1"
"@babel/runtime": "^7.18.3",
"@polkadot/networks": "^9.3.1",
"@polkadot/types": "8.6.1",
"@polkadot/types-codec": "8.6.1",
"@polkadot/types-create": "8.6.1",
"@polkadot/util": "^9.3.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '8.6.1' };
+15 -1
View File
@@ -96,7 +96,21 @@ const versioned: OverrideVersionedType[] = [
})
},
{
minmax: [1046, 1054],
minmax: [1046, 1050],
types: objectSpread({}, sharedTypes, addrAccountIdTypes, {
CompactAssignments: 'CompactAssignmentsTo257',
DispatchInfo: 'DispatchInfoTo244',
Heartbeat: 'HeartbeatTo244',
Multiplier: 'Fixed64',
OpenTip: 'OpenTipTo225',
RefCount: 'RefCountTo259',
ReferendumInfo: 'ReferendumInfoTo239',
StakingLedger: 'StakingLedgerTo223',
Weight: 'u32'
})
},
{
minmax: [1051, 1054],
types: objectSpread({}, sharedTypes, addrAccountIdTypes, {
CompactAssignments: 'CompactAssignmentsTo257',
DispatchInfo: 'DispatchInfoTo244',
+3 -3
View File
@@ -20,10 +20,10 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/util": "^9.2.1"
"@babel/runtime": "^7.18.3",
"@polkadot/util": "^9.3.1"
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '8.6.1' };
+10 -10
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "8.5.1",
"version": "8.6.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.0",
"@polkadot/keyring": "^9.2.1",
"@polkadot/types-augment": "8.5.1",
"@polkadot/types-codec": "8.5.1",
"@polkadot/types-create": "8.5.1",
"@polkadot/util": "^9.2.1",
"@polkadot/util-crypto": "^9.2.1",
"@babel/runtime": "^7.18.3",
"@polkadot/keyring": "^9.3.1",
"@polkadot/types-augment": "8.6.1",
"@polkadot/types-codec": "8.6.1",
"@polkadot/types-create": "8.6.1",
"@polkadot/util": "^9.3.1",
"@polkadot/util-crypto": "^9.3.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/keyring": "^9.2.1",
"@polkadot/types-support": "8.5.1"
"@polkadot/keyring": "^9.3.1",
"@polkadot/types-support": "8.6.1"
}
}
+14 -2
View File
@@ -205,7 +205,8 @@ describe('createType', (): void => {
expect(balu32.bitLength()).toEqual(32);
});
it('allows for re-registration of a type (affecting derives)', (): void => {
it('allows for re-registration of a type (derived types)', (): void => {
registry.clearCache();
registry.register({
Balance: 'u128',
TestComplex: {
@@ -224,7 +225,18 @@ describe('createType', (): void => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call
expect(cmpDef.balance.bitLength()).toEqual(128);
registry.register({ Balance: 'u32' });
registry.clearCache();
registry.register({
Balance: 'u32',
TestComplex: {
balance: 'Balance',
// eslint-disable-next-line sort-keys
accountId: 'AccountId',
log: '(u64, u32)',
// eslint-disable-next-line sort-keys
fromSrml: 'Gas'
}
});
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const cmpu32: any = registry.createType('TestComplex');
+10 -4
View File
@@ -9,7 +9,7 @@ import type { CallFunction, CodecHasher, Definitions, DetectCodec, RegisteredTyp
import { DoNotConstruct, Json, Raw } from '@polkadot/types-codec';
import { constructTypeClass, createClassUnsafe, createTypeUnsafe } from '@polkadot/types-create';
import { assert, assertReturn, BN_ZERO, formatBalance, isFunction, isString, isU8a, lazyMethod, logger, objectSpread, stringCamelCase, stringify } from '@polkadot/util';
import { assert, assertReturn, BN_ZERO, formatBalance, isFunction, isNumber, isString, isU8a, lazyMethod, logger, objectSpread, stringCamelCase, stringify } from '@polkadot/util';
import { blake2AsU8a } from '@polkadot/util-crypto';
import { expandExtensionTypes, fallbackExtensions, findUnknownExtensions } from '../extrinsic/signedExtensions';
@@ -212,7 +212,7 @@ export class TypeRegistry implements Registry {
}
/**
* @description Returns tru if the type is in a Compat format
* @description Returns true if the type is in a Compat format
*/
public isLookupType (value: string): boolean {
return /Lookup\d+$/.test(value);
@@ -253,7 +253,7 @@ export class TypeRegistry implements Registry {
* @describe Creates an instance of the class
*/
public createClass <T extends Codec = Codec, K extends string = string> (type: K): CodecClass<DetectCodec<T, K>> {
return this.createClassUnsafe(type) as unknown as CodecClass<DetectCodec<T, K>>;
return createClassUnsafe<DetectCodec<T, K>>(this, type);
}
/**
@@ -267,7 +267,7 @@ export class TypeRegistry implements Registry {
* @description Creates an instance of a type as registered
*/
public createType <T extends Codec = Codec, K extends string = string> (type: K, ...params: unknown[]): DetectCodec<T, K> {
return this.createTypeUnsafe(type, params);
return createTypeUnsafe(this, type, params);
}
/**
@@ -345,6 +345,12 @@ export class TypeRegistry implements Registry {
Type = class extends BaseType {};
this.#classes.set(name, Type);
// In the case of lookups, we also want to store the actual class against
// the lookup name, instad of having to traverse again
if (knownTypeDef && isNumber(knownTypeDef.lookupIndex)) {
this.#classes.set(this.createLookupType(knownTypeDef.lookupIndex), Type);
}
}
}
+2 -2
View File
@@ -11,8 +11,8 @@ import { ethereumEncode, isEthereumAddress } from '@polkadot/util-crypto';
function decodeAccountId (value: AnyU8a | AnyString): AnyU8a {
if (isU8a(value) || Array.isArray(value)) {
return u8aToU8a(value);
} else if (isHex(value) || isEthereumAddress(value)) {
return hexToU8a(value);
} else if (isHex(value) || isEthereumAddress(value.toString())) {
return hexToU8a(value.toString());
} else if (isString(value)) {
return u8aToU8a(value);
}
@@ -0,0 +1,35 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../../create';
import { decorateExtrinsics, Metadata } from '../../metadata';
import { GenericExtrinsicPayloadV4 as ExtrinsicPayload } from '.';
const registry = new TypeRegistry();
const metadata = new Metadata(registry, rpcMetadata);
registry.setMetadata(metadata);
const tx = decorateExtrinsics(registry, metadata.asLatest, metadata.version);
describe('ExtrinsicPayload', (): void => {
it('has a sane inspect', (): void => {
// we don't expect this to fail, however it is actually a good
// reference for the ordering in base Substrate
expect(new ExtrinsicPayload(registry, { method: tx.timestamp.set(0).toHex() } as never).inspect()).toEqual({
inner: [
{ name: 'method', outer: [new Uint8Array([3, 0, 0])] },
{ name: 'era', outer: [new Uint8Array([0]), new Uint8Array([0])] },
{ name: 'nonce', outer: [new Uint8Array([0])] },
{ name: 'tip', outer: [new Uint8Array([0])] },
{ name: 'assetId', outer: [new Uint8Array([0])] },
{ name: 'specVersion', outer: [new Uint8Array([0, 0, 0, 0])] },
{ name: 'transactionVersion', outer: [new Uint8Array([0, 0, 0, 0])] },
{ name: 'genesisHash', outer: [new Uint8Array(32)] },
{ name: 'blockHash', outer: [new Uint8Array(32)] }
]
});
});
});
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { SignOptions } from '@polkadot/keyring/types';
import type { Registry } from '@polkadot/types-codec/types';
import type { Inspect, Registry } from '@polkadot/types-codec/types';
import type { HexString } from '@polkadot/util/types';
import type { ExtrinsicEra } from '../../interfaces/extrinsics';
import type { Hash } from '../../interfaces/runtime';
@@ -37,6 +37,13 @@ export class GenericExtrinsicPayloadV4 extends Struct {
};
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
public override inspect (): Inspect {
return super.inspect({ method: true });
}
/**
* @description The block [[Hash]] the signature applies to (mortal/immortal)
*/
+1 -1
View File
@@ -16,7 +16,7 @@ function decodeAccountId (value?: AnyU8a | AnyString): Uint8Array {
} else if (isHex(value)) {
return hexToU8a(value);
} else if (isString(value)) {
return decodeAddress(value);
return decodeAddress(value.toString());
}
throw new Error(`Unknown type passed to AccountId constructor, found typeof ${typeof value}`);
@@ -117,11 +117,13 @@ function getAliasPath (path: SiPath): string | null {
: null;
}
function hasNoDupes (input: [number, string, SiTypeParameter[]][]): boolean {
for (let i = 0; i < input.length; i++) {
function hasNoDupes (input: [number, string][]): boolean {
const count = input.length;
for (let i = 0; i < count; i++) {
const [ai, an] = input[i];
for (let j = 0; j < input.length; j++) {
for (let j = i + 1; j < count; j++) {
const [bi, bn] = input[j];
// if the indexes are not the same and the names match, we have a dupe
@@ -177,7 +179,7 @@ function removeDuplicateNames (lookup: PortableRegistry, names: [number, string
}
// see if using the param type helps
const adjusted = new Array<[number, string, SiTypeParameter[]]>(allSame.length);
const adjusted = new Array<[number, string]>(allSame.length);
for (let i = 0; i < allSame.length; i++) {
const [oIndex, oName, oParams] = allSame[i];
@@ -191,8 +193,7 @@ function removeDuplicateNames (lookup: PortableRegistry, names: [number, string
oIndex,
def.isPrimitive
? `${oName}${def.asPrimitive.toString()}`
: `${oName}${path[path.length - 1].toString()}`,
params
: `${oName}${path[path.length - 1].toString()}`
];
}
@@ -217,29 +218,36 @@ function removeDuplicateNames (lookup: PortableRegistry, names: [number, string
}
function extractName (types: PortableType[], { id, type: { params, path } }: PortableType): [number, string, SiTypeParameter[]] | null {
const last = path.length - 1;
// if we have no path or determined as a wrapper, we just skip it
if (!path.length || WRAPPERS.includes(path[path.length - 1].toString())) {
if (last === -1 || WRAPPERS.includes(path[last].toString())) {
return null;
}
const parts = path
.map((p) => stringPascalCase(p))
.filter((p, index) => {
const lower = p.toLowerCase();
const parts: string[] = [];
let typeName = '';
return (
for (let i = 0; i <= last; i++) {
const p = stringPascalCase(path[i]);
const l = p.toLowerCase();
if (
(
// Remove ::{generic, misc, pallet, traits, types}::
index !== 1 ||
!PATH_RM_INDEX_1.includes(lower)
i !== 1 ||
!PATH_RM_INDEX_1.includes(l)
) &&
(
// sp_runtime::generic::digest::Digest -> sp_runtime::generic::Digest
// sp_runtime::multiaddress::MultiAddress -> sp_runtime::MultiAddress
index === path.length - 1 ||
lower !== path[index + 1].toLowerCase()
);
});
let typeName = parts.join('');
i === last ||
l !== path[i + 1].toLowerCase()
)) {
parts.push(p);
typeName += p;
}
}
// do magic for RawOrigin lookup, e.g. pallet_collective::RawOrigin
if (parts.length === 2 && parts[1] === 'RawOrigin' && params.length === 2 && params[1].type.isSome) {
@@ -321,8 +329,9 @@ function extractAliases (params: Record<string, SiTypeParameter[]>, isContract?:
function extractTypeInfo (lookup: PortableRegistry, portable: PortableType[]): [Record<number, PortableType>, Record<string, string>, Record<number, string>, Record<string, SiTypeParameter[]>] {
const nameInfo: [number, string, SiTypeParameter[]][] = [];
const types: Record<number, PortableType> = {};
const porCount = portable.length;
for (let i = 0; i < portable.length; i++) {
for (let i = 0; i < porCount; i++) {
const type = portable[i];
const extracted = extractName(portable, portable[i]);
@@ -337,8 +346,9 @@ function extractTypeInfo (lookup: PortableRegistry, portable: PortableType[]): [
const lookups: Record<string, string> = {};
const names: Record<number, string> = {};
const params: Record<string, SiTypeParameter[]> = {};
const dupCount = dedup.length;
for (let i = 0; i < dedup.length; i++) {
for (let i = 0; i < dupCount; i++) {
const [lookupIndex, name, p] = dedup[i];
names[lookupIndex] = name;
@@ -772,9 +782,18 @@ export class PortableRegistry extends Struct implements ILookup {
const specialVariant = path[0].toString();
if (specialVariant === 'Option') {
const sub = this.#createSiDef(params[0].type.unwrap());
if (sub.type === 'bool') {
return withTypeString(this.registry, {
info: TypeDefInfo.Plain,
type: 'OptionBool'
});
}
return withTypeString(this.registry, {
info: TypeDefInfo.Option,
sub: this.#createSiDef(params[0].type.unwrap())
sub
});
} else if (specialVariant === 'Result') {
return withTypeString(this.registry, {
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '8.5.1' };
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '8.6.1' };
+1 -1
View File
@@ -4,7 +4,7 @@
/**
* @summary Type definitions that are used in the system
*/
export { BitVec, bool, Bool, Bytes, i8, I8, i16, I16, i32, I32, i64, I64, i128, I128, i256, I256, Null, Text, Type, u8, U8, u16, U16, u32, U32, u64, U64, u128, U128, u256, U256, usize, USize } from '@polkadot/types-codec';
export { BitVec, bool, Bool, Bytes, i8, I8, i16, I16, i32, I32, i64, I64, i128, I128, i256, I256, Null, OptionBool, Text, Type, u8, U8, u16, U16, u32, U32, u64, U64, u128, U128, u256, U256, usize, USize } from '@polkadot/types-codec';
export { Data } from './Data';
export { StorageKey } from './StorageKey';
+2 -2
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { InterfaceTypes } from '@polkadot/types/types';
import type { BTreeMap, BTreeSet, Bytes, CodecSet, Compact, Enum, HashMap, Linkage, Null, Option, Range, RangeInclusive, Result, Struct, u8, U8aFixed, Vec, VecFixed } from '@polkadot/types-codec';
import type { bool, BTreeMap, BTreeSet, Bytes, CodecSet, Compact, Enum, HashMap, Linkage, Null, Option, OptionBool, Range, RangeInclusive, Result, Struct, u8, U8aFixed, Vec, VecFixed } from '@polkadot/types-codec';
import type { Codec, ICompact, IEnum, IMap, IMethod, INumber, IOption, IResult, ISet, IStruct, ITuple, IU8a, IVec } from '@polkadot/types-codec/types';
export type DetectCodec<T extends Codec, K extends string> =
@@ -37,7 +37,7 @@ export type __MapWrapOne<C extends Codec> = {
'BTreeSet<': BTreeSet<C>;
'Compact<': C extends INumber ? Compact<C> : Codec;
'Linkage<': Linkage<C>;
'Option<': Option<C>;
'Option<': C extends bool ? OptionBool : Option<C>;
'Range<': C extends INumber ? Range<C> : Codec;
'RangeInclusive<': C extends INumber ? RangeInclusive<C> : Codec;
'Vec<': C extends u8 ? Bytes : Vec<C>;
+2 -2
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { BitVec, Bool, bool, Bytes, I8, i8, I16, i16, I32, i32, I64, i64, I128, i128, I256, i256, Json, Null, Raw, Text, Type, U8, u8, U16, u16, U32, u32, U64, u64, U128, u128, U256, u256, USize, usize } from '@polkadot/types-codec';
import type { BitVec, Bool, bool, Bytes, I8, i8, I16, i16, I32, i32, I64, i64, I128, i128, I256, i256, Json, Null, OptionBool, Raw, Text, Type, U8, u8, U16, u16, U32, u32, U64, u64, U128, u128, U256, u256, USize, usize } from '@polkadot/types-codec';
import type { RegistryTypes } from '@polkadot/types-codec/types';
import type { BN } from '@polkadot/util';
import type { GenericExtrinsic, GenericExtrinsicEra, GenericExtrinsicPayload, GenericSignerPayload } from '../extrinsic';
@@ -18,7 +18,7 @@ export type { Registry, RegistryError, RegistryTypes } from '@polkadot/types-cod
export interface InterfaceTypes {
// base codec
BitVec: BitVec, Bool: Bool, Bytes: Bytes, I128: I128, I16: I16, I256: I256, I32: I32, I64: I64, I8: I8, Json: Json, Null: Null, Raw: Raw, Text: Text, Type: Type, U128: U128, U16: U16, U256: U256, U32: U32, U64: U64, U8: U8, USize: USize, bool: bool, i128: i128, i16: i16, i256: i256, i32: i32, i64: i64, i8: i8, u128: u128, u16: u16, u256: u256, u32: u32, u64: u64, u8: u8, usize: usize,
BitVec: BitVec, Bool: Bool, Bytes: Bytes, I128: I128, I16: I16, I256: I256, I32: I32, I64: I64, I8: I8, Json: Json, Null: Null, OptionBool: OptionBool, Raw: Raw, Text: Text, Type: Type, U128: U128, U16: U16, U256: U256, U32: U32, U64: U64, U8: U8, USize: USize, bool: bool, i128: i128, i16: i16, i256: i256, i32: i32, i64: i64, i8: i8, u128: u128, u16: u16, u256: u256, u32: u32, u64: u64, u8: u8, usize: usize,
// extrinsic
Extrinsic: GenericExtrinsic, ExtrinsicEra: GenericExtrinsicEra, ExtrinsicPayload: GenericExtrinsicPayload, SignerPayload: GenericSignerPayload,
// generic
+351 -353
View File
File diff suppressed because it is too large Load Diff