Compare commits

..
71 Commits
Author SHA1 Message Date
Github Actions 62afb0b534 [CI Skip] release/stable 4.7.1
skip-checks: true
2021-04-25 05:18:10 +00:00
Jaco Greeff 5157ca5608 CHANGELOG bump 2021-04-25 08:08:28 +03:00
Jaco 315617c027 4.7 (#3435)
* 4.7

* Update CHANGELOG.md
2021-04-25 06:31:42 +02:00
Github Actions 7d33b4dec6 [CI Skip] release/beta 4.6.3-11
skip-checks: true
2021-04-24 08:06:21 +00:00
Jaco 2345f69c71 Add engines field to package.json (#3433) 2021-04-24 09:56:50 +02:00
Github Actions 3cef2fb4d5 [CI Skip] release/beta 4.6.3-10
skip-checks: true
2021-04-23 15:50:43 +00:00
Jaco 2bbf5513b2 Expand DispatchError (#3431) 2021-04-23 17:43:32 +02:00
Github Actions c146f06178 [CI Skip] release/beta 4.6.3-9
skip-checks: true
2021-04-23 05:44:16 +00:00
Jaco 5903704b61 Expand Data (from identity) with all is/as getters (#3429) 2021-04-23 07:34:01 +02:00
Github Actions 90d8db651b [CI Skip] release/beta 4.6.3-8
skip-checks: true
2021-04-22 13:10:53 +00:00
Jaco 557283a3d1 Struct decoding error messaging (#3425)
* Struct decoding error messaging

* Error adjust

* Tests

* Bump common, use stringify

* Linting

* Adjust

* Bumps

* Rebump

* Assert cleanups

* Don't modify original value on encoding

* util bump, fixe compact encoding
2021-04-22 15:02:54 +02:00
Github Actions 88b84dcf75 [CI Skip] release/beta 4.6.3-7
skip-checks: true
2021-04-21 17:13:17 +00:00
Jaco 45d190eaca Revery Westend beefy keys (#3423) 2021-04-21 20:03:43 +03:00
Github Actions 6d32328509 [CI Skip] release/beta 4.6.3-6
skip-checks: true
2021-04-21 10:37:47 +00:00
Jaco ba470e7417 Bump WS reconnect delay from 1s -> 2.5s (#3420) 2021-04-21 12:27:16 +02:00
Github Actions 4a16e46f88 [CI Skip] release/beta 4.6.3-5
skip-checks: true
2021-04-21 09:39:02 +00:00
Jaco Greeff ada0d99a84 Sorting 2021-04-21 12:28:51 +03:00
Github Actions e486fc4316 [CI Skip] release/beta 4.6.3-4
skip-checks: true
2021-04-21 08:58:57 +00:00
Jaco 6e5c6f4e0b Bump deps (#3418)
* Bump deps

* Sorting md
2021-04-21 10:48:52 +02:00
Github Actions 21ddcaf173 [CI Skip] release/beta 4.6.3-3
skip-checks: true
2021-04-21 07:17:45 +00:00
Jaco 6085b994f6 Remove well-known json dependency (#3417) 2021-04-21 09:09:30 +02:00
Github Actions 7c3bf05868 [CI Skip] release/beta 4.6.3-2
skip-checks: true
2021-04-21 07:03:45 +00:00
Jaco 8bce5b4a09 Add support for BoundedVec (#3415)
* Add support for BoundedVec

* Update packages/types/src/create/sanitize.ts

* Cleanup sanitize duplication

* Additional cleanups

* Update packages/types/src/create/sanitize.ts

* Box wrap
2021-04-21 08:52:56 +02:00
Github Actions 7a6077301f [CI Skip] release/beta 4.6.3-1
skip-checks: true
2021-04-20 09:05:25 +00:00
Jaco 3f2767462f Adjust statemint proxy type (#3412) 2021-04-20 10:55:28 +02:00
Github Actions ecc37d11df [CI Skip] release/beta 4.6.3-0
skip-checks: true
2021-04-20 06:02:39 +00:00
Jaco 0589d151da Add Xcm Plurality types (#3411) 2021-04-20 07:53:24 +02:00
Jaco 47cd6c6410 RewardDestination: None types (#3231) 2021-04-20 07:44:42 +02:00
Github Actions 65688f9e0e [CI Skip] release/stable 4.6.2
skip-checks: true
2021-04-19 10:47:57 +00:00
Jaco 5eb2a95ef2 Correct Kusama/Polkadot runtime 30 session key definitions (#3409)
* Correct Kusama/Polkadot runtime 30 session key definitions

* Remove duplicates
2021-04-19 12:38:48 +02:00
Github Actions 282b39d27a [CI Skip] release/stable 4.6.1
skip-checks: true
2021-04-19 06:07:35 +00:00
Jaco f21e3d317a 4.6.1 (#3407) 2021-04-19 07:56:46 +02:00
Github Actions c2af7cf8f2 [CI Skip] release/beta 4.5.2-8
skip-checks: true
2021-04-18 09:29:51 +00:00
Jaco 0958a4c693 Bump common (#3405)
* Bump common

* Bumps
2021-04-18 11:19:47 +02:00
Github Actions c687181130 [CI Skip] release/beta 4.5.2-7
skip-checks: true
2021-04-16 16:03:07 +00:00
Jaco 685f1ec0b6 Update .123trigger 2021-04-16 17:53:22 +02:00
Jaco e0069b6f7d statemint known-types (#3404) 2021-04-16 17:39:21 +02:00
Github Actions cf48762ff2 [CI Skip] release/beta 4.5.2-6
skip-checks: true
2021-04-15 12:27:19 +00:00
Jaco 31a7545a19 Bump common (#3403) 2021-04-15 14:18:06 +02:00
Github Actions 5cd8e8fb97 [CI Skip] release/beta 4.5.2-5
skip-checks: true
2021-04-14 07:15:18 +00:00
Jaco 96e4090174 Simplify/harden session derives (#3401) 2021-04-14 09:05:35 +02:00
Github Actions 0bbebab90b [CI Skip] release/beta 4.5.2-4
skip-checks: true
2021-04-14 06:26:22 +00:00
Jaco 57dac0ef47 Assert keypair validity in signing operations (#3400) 2021-04-14 08:17:10 +02:00
Github Actions 6c3d24551b [CI Skip] release/beta 4.5.2-3
skip-checks: true
2021-04-13 18:44:11 +00:00
Jaco e7dc6d7a5a Expose internalError on submittables (#3399) 2021-04-13 20:33:59 +02:00
Github Actions a63b7f611e [CI Skip] release/beta 4.5.2-2
skip-checks: true
2021-04-13 10:33:28 +00:00
Jaco 82e15dc36d Explicitly handle isReadyOrError (when only using isReady) (#3395) 2021-04-13 12:24:26 +02:00
Github Actions 6f96037cb5 [CI Skip] release/beta 4.5.2-1
skip-checks: true
2021-04-13 09:08:55 +00:00
Jaco b6da84b8b2 Beefy subscribeJustifications (#3393)
* Beefy subscribeJustifications

* Add payload info

* Update RPC description
2021-04-13 10:59:23 +02:00
Github Actions 41209f074c [CI Skip] release/beta 4.5.2-0
skip-checks: true
2021-04-12 13:17:40 +00:00
Jaco Greeff c47964c942 Updated xcm types (#3391)
* Updated xcm types

* Move NetworkId

* Update DoubleEncodedCall

* trigger

* Xcm is an enum
2021-04-12 15:09:33 +02:00
Github Actions 5f13a634e5 [CI Skip] release/stable 4.5.1
skip-checks: true
2021-04-12 06:30:52 +00:00
Jaco Greeff 40af520fe7 4.5.1 (#3390) 2021-04-12 08:21:37 +02:00
Github Actions 1e506e0f8c [CI Skip] release/beta 4.4.2-7
skip-checks: true
2021-04-11 13:29:10 +00:00
Jaco Greeff 96ea5803d4 Adjust Westend known & detection (#3386) 2021-04-11 15:19:05 +02:00
Jaco Greeff 7d99459f50 Bump deps (#3389) 2021-04-11 15:15:01 +02:00
Github Actions 8fa090f435 [CI Skip] release/beta 4.4.2-6
skip-checks: true
2021-04-09 20:11:40 +00:00
Jaco Greeff d3c60d197c PalletId type 2021-04-09 23:01:11 +03:00
Github Actions ad8550f7f5 [CI Skip] release/beta 4.4.2-5
skip-checks: true
2021-04-09 19:51:56 +00:00
Jaco Greeff a899aa439d Adjust slot types based on constants (#3385) 2021-04-09 21:40:24 +02:00
Github Actions e0e075b350 [CI Skip] release/beta 4.4.2-4
skip-checks: true
2021-04-09 04:48:56 +00:00
Jaco Greeff 34ff14547e Westend runtime 50 upgrade block (& v30 session keys) (#3382)
* Westend runtime 50 upgrade block (& v30 session keys)

* Revery beefy keys

* Defer 7B keys to 51
2021-04-09 06:39:40 +02:00
Github Actions 681a80d456 [CI Skip] release/beta 4.4.2-3
skip-checks: true
2021-04-08 12:17:03 +00:00
Jaco Greeff ed5f2673ce Detect Keys, inject SessionKeys (#3380) 2021-04-08 14:07:39 +02:00
Github Actions 43e87603e2 [CI Skip] release/beta 4.4.2-2
skip-checks: true
2021-04-08 09:02:42 +00:00
Jaco Greeff d056416b47 Bump deps (#3379) 2021-04-08 10:52:20 +02:00
Github Actions 1bcf94131d [CI Skip] release/beta 4.4.2-1
skip-checks: true
2021-04-08 05:45:13 +00:00
Jaco Greeff 17b607b6c3 Update Rococo session key (& small para type cleanups) (#3378) 2021-04-08 08:35:24 +03:00
Github Actions 5a16d1dd8b [CI Skip] release/beta 4.4.2-0
skip-checks: true
2021-04-07 14:18:01 +00:00
Jaco Greeff 144b74306a Update parachain types (#3376)
* Update parachain types

* Remove retiring flag
2021-04-07 16:09:38 +02:00
Jaco Greeff 16b9fa956d Adjust ParaInfo types (#3372) 2021-04-07 15:53:57 +02:00
119 changed files with 2790 additions and 1640 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
27 29
1.4.2 1.4.2
1.6.2 1.6.2
1.11.2 1.11.2
@@ -19,3 +19,5 @@
3.10.2 3.10.2
4.0.2 4.0.2
4.0.3 4.0.3
4.6.2
+59
View File
@@ -1,5 +1,64 @@
# CHANGELOG # CHANGELOG
## 4.7.1 Apr 25, 2021
Upgrade priority: Low. Recommended for users following Substrate master.
Changes:
- Adjust Struct decoding with better error messages on invalid input objects
- Add support for new `BoundedVec` type
- Expand `Data` type (as used in identity), with all is/as getters
- Updated `Xcm` types (with Plularity)
- Adjust `DispatchError` type as per current Substrate master
- Adjusted Statemint `Proxy` type
- Remove metadata generation dependency on well-known.json (dedupe)
- Adjust WebSocket reconnection delay from 1s to 2.5s
- Revert Beefy keys addition for Westend
- Add explicit `engines` config to `package.json`
- Support for `None` in `RewardDestination`
- Align with latest substrate metadata
## 4.6.2 Apr 19, 2021
Upgrade priority: Low. Recommended for users of Kusama/Polkadot.
Changes:
- Correct Kusama/Polkadot runtime 30 session key definitions
## 4.6.1 Apr 19, 2021
Upgrade priority: Low. Recommended if used in a Node.js 15.x environment.
Changes:
- Assert keypair validity in signing operations
- Expose `internalError` on submittable results (e.g. event decoding errors)
- Simplify session derives for old/new
- Add Statemint to known types
- Add support for `rpc.beefy.subscribeJustifications`
- Update Xcm types
- Explicitly handle `isReadyOrError` with `Api.create`
- Add Kusama upgrade block for 2030
## 4.5.1 Apr 12, 2021
Upgrade priority: Low. Recommended with usage with the Rococo testnet.
Changes:
- Update parachain types as per latest Polkadot
- Cater for `Keys` with `BEEFY` session keys
- Update `Keys` injection to allow for on-chain type detection
- Add `Westend` known upgrade block for runtime 50
- Align types with latest Substrate master
- Adjust keepalive `system_health` timer
## 4.4.1 Apr 5, 2021 ## 4.4.1 Apr 5, 2021
Upgrade priority: Low. Recommended with usage with the Rococo testnet. Upgrade priority: Low. Recommended with usage with the Rococo testnet.
+7 -7
View File
@@ -8,7 +8,7 @@
"packages/*" "packages/*"
], ],
"resolutions": { "resolutions": {
"typescript": "^4.2.3" "typescript": "^4.2.4"
}, },
"scripts": { "scripts": {
"build": "yarn build:interfaces && polkadot-dev-build-ts", "build": "yarn build:interfaces && polkadot-dev-build-ts",
@@ -25,14 +25,14 @@
"test:watch": "polkadot-dev-run-test --watch" "test:watch": "polkadot-dev-run-test --watch"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.13.13", "@babel/core": "^7.13.16",
"@babel/register": "^7.13.8", "@babel/register": "^7.13.16",
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/dev": "^0.62.7", "@polkadot/dev": "^0.62.10",
"@polkadot/ts": "^0.3.62", "@polkadot/ts": "^0.3.63",
"@polkadot/typegen": "workspace:packages/typegen", "@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^26.0.22", "@types/jest": "^26.0.22",
"copyfiles": "^2.4.1" "copyfiles": "^2.4.1"
}, },
"version": "4.4.1" "version": "4.7.1"
} }
+9 -6
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/api-contract", "name": "@polkadot/api-contract",
"version": "4.4.1", "version": "4.7.1",
"type": "module", "type": "module",
"description": "Interfaces for interacting with contracts and contract ABIs", "description": "Interfaces for interacting with contracts and contract ABIs",
"main": "index.js", "main": "index.js",
@@ -8,6 +8,9 @@
"./detectPackage.js", "./detectPackage.js",
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"engines": {
"node": ">=14.0.0"
},
"author": "Jaco Greeff <jacogr@gmail.com>", "author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [], "maintainers": [],
"contributors": [], "contributors": [],
@@ -16,11 +19,11 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/api": "4.4.1", "@polkadot/api": "4.7.1",
"@polkadot/types": "4.4.1", "@polkadot/types": "4.7.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.3.1",
"@polkadot/x-rxjs": "^6.0.5", "@polkadot/x-rxjs": "^6.3.1",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
} }
} }
+5 -5
View File
@@ -6,7 +6,7 @@ import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, Contr
import type { AnyJson, Codec, CodecArg } from '@polkadot/types/types'; import type { AnyJson, Codec, CodecArg } from '@polkadot/types/types';
import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from './types'; import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from './types';
import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, u8aConcat, u8aToHex } from '@polkadot/util'; import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
import { MetaRegistry } from './MetaRegistry'; import { MetaRegistry } from './MetaRegistry';
@@ -21,7 +21,7 @@ function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string
? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString())) ? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
: messageOrId; : messageOrId;
return assertReturn(message, `Attempted to call an invalid contract interface, ${JSON.stringify(messageOrId)}`); return assertReturn(message, `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
} }
export class Abi { export class Abi {
@@ -81,7 +81,7 @@ export class Abi {
const index = data[0]; const index = data[0];
const event = this.#events[index]; const event = this.#events[index];
assert(event, `Unable to find event with index ${index}`); assert(event, () => `Unable to find event with index ${index}`);
return event.fromU8a(data.subarray(1)); return event.fromU8a(data.subarray(1));
} }
@@ -118,7 +118,7 @@ export class Abi {
type: this.registry.getMetaTypeDef(arg.type) type: this.registry.getMetaTypeDef(arg.type)
}; };
} catch (error) { } catch (error) {
l.error(`Error expanding argument ${index} in ${JSON.stringify(spec)}`); l.error(`Error expanding argument ${index} in ${stringify(spec)}`);
throw error; throw error;
} }
@@ -186,7 +186,7 @@ export class Abi {
} }
#encodeArgs = ({ name, selector }: ContractMessageSpec | ContractConstructorSpec, args: AbiParam[], data: CodecArg[], additional = EMPTY_U8A): Uint8Array => { #encodeArgs = ({ name, selector }: ContractMessageSpec | ContractConstructorSpec, args: AbiParam[], data: CodecArg[], additional = EMPTY_U8A): Uint8Array => {
assert(data.length === args.length, `Expected ${args.length} arguments to contract message '${name.toString()}', found ${data.length}`); assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${name.toString()}', found ${data.length}`);
return compactAddLength( return compactAddLength(
u8aConcat( u8aConcat(
+2 -2
View File
@@ -80,7 +80,7 @@ export class MetaRegistry extends TypeRegistry {
#getMetaType = (id: SiLookupTypeId): SiType => { #getMetaType = (id: SiLookupTypeId): SiType => {
const type = this.#siTypes[getRegistryOffset(id)]; const type = this.#siTypes[getRegistryOffset(id)];
assert(!isUndefined(type), `getMetaType:: Unable to find ${id.toNumber()} in type values`); assert(!isUndefined(type), () => `getMetaType:: Unable to find ${id.toNumber()} in type values`);
return this.createType('SiType', type); return this.createType('SiType', type);
} }
@@ -184,7 +184,7 @@ export class MetaRegistry extends TypeRegistry {
} }
#extractSequence = ({ type }: SiTypeDefSequence, id: SiLookupTypeId): Omit<TypeDef, 'type'> => { #extractSequence = ({ type }: SiTypeDefSequence, id: SiLookupTypeId): Omit<TypeDef, 'type'> => {
assert(!!type, `ContractRegistry: Invalid sequence type found at id ${id.toString()}`); assert(!!type, () => `ContractRegistry: Invalid sequence type found at id ${id.toString()}`);
return { return {
info: TypeDefInfo.Vec, info: TypeDefInfo.Vec,
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-contract', version: '4.4.1' }; export const packageInfo = { name: '@polkadot/api-contract', version: '4.7.1' };
+13 -10
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/api-derive", "name": "@polkadot/api-derive",
"version": "4.4.1", "version": "4.7.1",
"type": "module", "type": "module",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.", "description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"main": "index.js", "main": "index.js",
@@ -8,6 +8,9 @@
"./detectPackage.js", "./detectPackage.js",
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"engines": {
"node": ">=14.0.0"
},
"author": "Jaco Greeff <jacogr@gmail.com>", "author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [], "maintainers": [],
"contributors": [], "contributors": [],
@@ -16,17 +19,17 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/api": "4.4.1", "@polkadot/api": "4.7.1",
"@polkadot/rpc-core": "4.4.1", "@polkadot/rpc-core": "4.7.1",
"@polkadot/types": "4.4.1", "@polkadot/types": "4.7.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.3.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.3.1",
"@polkadot/x-rxjs": "^6.0.5", "@polkadot/x-rxjs": "^6.3.1",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5", "@polkadot/keyring": "^6.3.1",
"@polkadot/rpc-provider": "4.4.1" "@polkadot/rpc-provider": "4.7.1"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-derive', version: '4.4.1' }; export const packageInfo = { name: '@polkadot/api-derive', version: '4.7.1' };
+15 -55
View File
@@ -2,71 +2,31 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { u64 } from '@polkadot/types';
import type { SessionIndex } from '@polkadot/types/interfaces';
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveSessionIndexes, DeriveSessionInfo } from '../types'; import type { DeriveSessionInfo } from '../types';
import { map } from '@polkadot/x-rxjs/operators'; import { map } from '@polkadot/x-rxjs/operators';
import { memo } from '../util'; import { memo } from '../util';
type ResultType = [boolean, u64, SessionIndex];
type Result = [ResultType, DeriveSessionIndexes];
function createDerive (api: ApiInterfaceRx, [[hasBabe, epochDuration, sessionsPerEra], { activeEra, activeEraStart, currentEra, currentIndex, validatorCount }]: Result): DeriveSessionInfo {
return {
activeEra,
activeEraStart,
currentEra,
currentIndex,
eraLength: api.registry.createType('BlockNumber', sessionsPerEra.mul(epochDuration)),
isEpoch: hasBabe,
sessionLength: epochDuration,
sessionsPerEra,
validatorCount
};
}
function queryAura (api: ApiInterfaceRx): Observable<DeriveSessionInfo> {
return api.derive.session.indexes().pipe(
map((indexes): DeriveSessionInfo =>
createDerive(api, [
[
false,
api.registry.createType('u64', 1),
// we may have aura without staking (permissioned)
api.consts.staking?.sessionsPerEra || api.registry.createType('SessionIndex', 1)
],
indexes
])
)
);
}
function queryBabe (api: ApiInterfaceRx): Observable<DeriveSessionInfo> {
return api.derive.session.indexes().pipe(
map((indexes) =>
createDerive(api, [
[
true,
api.consts.babe.epochDuration,
// we may have babe without staking (permissioned)
api.consts.staking?.sessionsPerEra || api.registry.createType('SessionIndex', 1)
],
indexes
])
)
);
}
/** /**
* @description Retrieves all the session and era query and calculates specific values on it as the length of the session and eras * @description Retrieves all the session and era query and calculates specific values on it as the length of the session and eras
*/ */
export function info (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionInfo> { export function info (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionInfo> {
return memo(instanceId, (): Observable<DeriveSessionInfo> => return memo(instanceId, (): Observable<DeriveSessionInfo> =>
api.consts.babe api.derive.session.indexes().pipe(
? queryBabe(api) map((indexes) => {
: queryAura(api) const sessionLength = api.consts?.babe?.epochDuration || api.registry.createType('u64', 1);
const sessionsPerEra = api.consts?.staking?.sessionsPerEra || api.registry.createType('SessionIndex', 1);
return {
...indexes,
eraLength: api.registry.createType('BlockNumber', sessionsPerEra.mul(sessionLength)),
isEpoch: !!api.query.babe,
sessionLength,
sessionsPerEra
};
})
)
); );
} }
+2 -2
View File
@@ -44,7 +44,7 @@ function queryBabe (api: ApiInterfaceRx): Observable<[DeriveSessionInfo, ResultS
combineLatest([ combineLatest([
of(info), of(info),
// we may have no staking, but have babe (permissioned) // we may have no staking, but have babe (permissioned)
api.query.staking api.query.staking?.erasStartSessionIndex
? api.queryMulti<ResultSlots>([ ? api.queryMulti<ResultSlots>([
api.query.babe.currentSlot, api.query.babe.currentSlot,
api.query.babe.epochIndex, api.query.babe.epochIndex,
@@ -69,7 +69,7 @@ function queryBabe (api: ApiInterfaceRx): Observable<[DeriveSessionInfo, ResultS
*/ */
export function progress (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionProgress> { export function progress (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveSessionProgress> {
return memo(instanceId, (): Observable<DeriveSessionProgress> => return memo(instanceId, (): Observable<DeriveSessionProgress> =>
api.consts.babe api.query.babe
? queryBabe(api).pipe( ? queryBabe(api).pipe(
map(([info, slots]: [DeriveSessionInfo, ResultSlotsFlat]): DeriveSessionProgress => map(([info, slots]: [DeriveSessionInfo, ResultSlotsFlat]): DeriveSessionProgress =>
createDerive(api, info, slots) createDerive(api, info, slots)
+15 -12
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/api", "name": "@polkadot/api",
"version": "4.4.1", "version": "4.7.1",
"type": "module", "type": "module",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC", "description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"main": "index.js", "main": "index.js",
@@ -8,6 +8,9 @@
"./detectPackage.js", "./detectPackage.js",
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"engines": {
"node": ">=14.0.0"
},
"author": "Jaco Greeff <jacogr@gmail.com>", "author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [], "maintainers": [],
"contributors": [], "contributors": [],
@@ -16,17 +19,17 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/api-derive": "4.4.1", "@polkadot/api-derive": "4.7.1",
"@polkadot/keyring": "^6.0.5", "@polkadot/keyring": "^6.3.1",
"@polkadot/metadata": "4.4.1", "@polkadot/metadata": "4.7.1",
"@polkadot/rpc-core": "4.4.1", "@polkadot/rpc-core": "4.7.1",
"@polkadot/rpc-provider": "4.4.1", "@polkadot/rpc-provider": "4.7.1",
"@polkadot/types": "4.4.1", "@polkadot/types": "4.7.1",
"@polkadot/types-known": "4.4.1", "@polkadot/types-known": "4.7.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.3.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.3.1",
"@polkadot/x-rxjs": "^6.0.5", "@polkadot/x-rxjs": "^6.3.1",
"bn.js": "^4.11.9", "bn.js": "^4.11.9",
"eventemitter3": "^4.0.7" "eventemitter3": "^4.0.7"
} }
+40 -6
View File
@@ -3,7 +3,7 @@
import type { Vec, u16, u32, u64, u8 } from '@polkadot/types'; import type { Vec, u16, u32, u64, u8 } from '@polkadot/types';
import type { Codec } from '@polkadot/types/types'; import type { Codec } from '@polkadot/types/types';
import type { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime'; import type { Balance, BalanceOf, BlockNumber, LockIdentifier, Moment, PalletId, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime';
import type { SessionIndex } from '@polkadot/types/interfaces/session'; import type { SessionIndex } from '@polkadot/types/interfaces/session';
import type { EraIndex } from '@polkadot/types/interfaces/staking'; import type { EraIndex } from '@polkadot/types/interfaces/staking';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state'; import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
@@ -200,12 +200,38 @@ declare module '@polkadot/api/types/consts' {
}; };
elections: { elections: {
[key: string]: Codec; [key: string]: Codec;
/**
* How much should be locked up in order to submit one's candidacy.
**/
candidacyBond: BalanceOf & AugmentedConst<ApiType>; candidacyBond: BalanceOf & AugmentedConst<ApiType>;
/**
* Number of members to elect.
**/
desiredMembers: u32 & AugmentedConst<ApiType>; desiredMembers: u32 & AugmentedConst<ApiType>;
/**
* Number of runners_up to keep.
**/
desiredRunnersUp: u32 & AugmentedConst<ApiType>; desiredRunnersUp: u32 & AugmentedConst<ApiType>;
moduleId: LockIdentifier & AugmentedConst<ApiType>; /**
* Identifier for the elections-phragmen pallet's lock
**/
palletId: LockIdentifier & AugmentedConst<ApiType>;
/**
* How long each seat is kept. This defines the next block number at which an election
* round will happen. If set to zero, no elections are ever triggered and the module will
* be in passive mode.
**/
termDuration: BlockNumber & AugmentedConst<ApiType>; termDuration: BlockNumber & AugmentedConst<ApiType>;
/**
* Base deposit associated with voting.
*
* This should be sensibly high to economically ensure the pallet cannot be attacked by
* creating a gigantic number of votes.
**/
votingBondBase: BalanceOf & AugmentedConst<ApiType>; votingBondBase: BalanceOf & AugmentedConst<ApiType>;
/**
* The amount of bond that need to be locked for each vote (32 bytes).
**/
votingBondFactor: BalanceOf & AugmentedConst<ApiType>; votingBondFactor: BalanceOf & AugmentedConst<ApiType>;
}; };
gilt: { gilt: {
@@ -295,7 +321,7 @@ declare module '@polkadot/api/types/consts' {
lottery: { lottery: {
[key: string]: Codec; [key: string]: Codec;
maxCalls: u32 & AugmentedConst<ApiType>; maxCalls: u32 & AugmentedConst<ApiType>;
moduleId: ModuleId & AugmentedConst<ApiType>; palletId: PalletId & AugmentedConst<ApiType>;
}; };
multisig: { multisig: {
[key: string]: Codec; [key: string]: Codec;
@@ -381,6 +407,10 @@ declare module '@polkadot/api/types/consts' {
* The number of blocks between membership challenges. * The number of blocks between membership challenges.
**/ **/
challengePeriod: BlockNumber & AugmentedConst<ApiType>; challengePeriod: BlockNumber & AugmentedConst<ApiType>;
/**
* Maximum candidate intake per round.
**/
maxCandidateIntake: u32 & AugmentedConst<ApiType>;
/** /**
* The number of times a member may vote the wrong way (or not at all, when they are a skeptic) * The number of times a member may vote the wrong way (or not at all, when they are a skeptic)
* before they become suspended. * before they become suspended.
@@ -389,7 +419,7 @@ declare module '@polkadot/api/types/consts' {
/** /**
* The societies's module id * The societies's module id
**/ **/
moduleId: ModuleId & AugmentedConst<ApiType>; palletId: PalletId & AugmentedConst<ApiType>;
/** /**
* The amount of incentive paid within each period. Doesn't include VoterTip. * The amount of incentive paid within each period. Doesn't include VoterTip.
**/ **/
@@ -410,6 +440,10 @@ declare module '@polkadot/api/types/consts' {
* Number of eras that staked funds must remain bonded for. * Number of eras that staked funds must remain bonded for.
**/ **/
bondingDuration: EraIndex & AugmentedConst<ApiType>; bondingDuration: EraIndex & AugmentedConst<ApiType>;
/**
* Maximum number of nominations per nominator.
**/
maxNominations: u32 & AugmentedConst<ApiType>;
/** /**
* The maximum number of nominators rewarded for each validator. * The maximum number of nominators rewarded for each validator.
* *
@@ -514,7 +548,7 @@ declare module '@polkadot/api/types/consts' {
/** /**
* The treasury's module id, used for deriving its sovereign account ID. * The treasury's module id, used for deriving its sovereign account ID.
**/ **/
moduleId: ModuleId & AugmentedConst<ApiType>; palletId: PalletId & AugmentedConst<ApiType>;
/** /**
* Fraction of a proposal's value that should be bonded in order to place the proposal. * Fraction of a proposal's value that should be bonded in order to place the proposal.
* An accepted proposal gets these back. A rejected proposal does not. * An accepted proposal gets these back. A rejected proposal does not.
@@ -532,7 +566,7 @@ declare module '@polkadot/api/types/consts' {
vesting: { vesting: {
[key: string]: Codec; [key: string]: Codec;
/** /**
* The minimum amount to be transferred to create a new vesting schedule. * The minimum amount transferred to call `vested_transfer`.
**/ **/
minVestedTransfer: BalanceOf & AugmentedConst<ApiType>; minVestedTransfer: BalanceOf & AugmentedConst<ApiType>;
}; };
+69
View File
@@ -743,6 +743,64 @@ declare module '@polkadot/api/types/errors' {
**/ **/
InvalidKey: AugmentedError<ApiType>; InvalidKey: AugmentedError<ApiType>;
}; };
indices: {
[key: string]: AugmentedError<ApiType>;
/**
* The index was not available.
**/
InUse: AugmentedError<ApiType>;
/**
* The index was not already assigned.
**/
NotAssigned: AugmentedError<ApiType>;
/**
* The index is assigned to another account.
**/
NotOwner: AugmentedError<ApiType>;
/**
* The source and destination accounts are identical.
**/
NotTransfer: AugmentedError<ApiType>;
/**
* The index is permanent and may not be freed/changed.
**/
Permanent: AugmentedError<ApiType>;
};
lottery: {
[key: string]: AugmentedError<ApiType>;
/**
* A lottery has already ended.
**/
AlreadyEnded: AugmentedError<ApiType>;
/**
* You are already participating in the lottery with this call.
**/
AlreadyParticipating: AugmentedError<ApiType>;
/**
* Failed to encode calls
**/
EncodingFailed: AugmentedError<ApiType>;
/**
* A lottery is already in progress.
**/
InProgress: AugmentedError<ApiType>;
/**
* The call is not valid for an open lottery.
**/
InvalidCall: AugmentedError<ApiType>;
/**
* A lottery has not been configured.
**/
NotConfigured: AugmentedError<ApiType>;
/**
* An overflow has occurred.
**/
Overflow: AugmentedError<ApiType>;
/**
* Too many calls for a single lottery.
**/
TooManyCalls: AugmentedError<ApiType>;
};
multisig: { multisig: {
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
/** /**
@@ -1185,6 +1243,17 @@ declare module '@polkadot/api/types/errors' {
**/ **/
WrongProposalWeight: AugmentedError<ApiType>; WrongProposalWeight: AugmentedError<ApiType>;
}; };
technicalMembership: {
[key: string]: AugmentedError<ApiType>;
/**
* Already a member.
**/
AlreadyMember: AugmentedError<ApiType>;
/**
* Not a member.
**/
NotMember: AugmentedError<ApiType>;
};
tips: { tips: {
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
/** /**
+5 -4
View File
@@ -418,10 +418,11 @@ declare module '@polkadot/api/types/events' {
**/ **/
MemberKicked: AugmentedEvent<ApiType, [AccountId]>; MemberKicked: AugmentedEvent<ApiType, [AccountId]>;
/** /**
* A new term with \[new_members\]. This indicates that enough candidates existed to run the * A new term with \[new_members\]. This indicates that enough candidates existed to run
* election, not that enough have has been elected. The inner value must be examined for * the election, not that enough have has been elected. The inner value must be examined
* this purpose. A `NewTerm(\[\])` indicates that some candidates got their bond slashed and * for this purpose. A `NewTerm(\[\])` indicates that some candidates got their bond
* none were elected, whilst `EmptyTerm` means that no candidates existed to begin with. * slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to
* begin with.
**/ **/
NewTerm: AugmentedEvent<ApiType, [Vec<ITuple<[AccountId, Balance]>>]>; NewTerm: AugmentedEvent<ApiType, [Vec<ITuple<[AccountId, Balance]>>]>;
/** /**
+7
View File
@@ -6,6 +6,7 @@ import type { Bytes, HashMap, Json, Null, Option, StorageKey, Text, U256, U64, V
import type { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types'; import type { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { EpochAuthorship } from '@polkadot/types/interfaces/babe'; import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';
import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
@@ -64,6 +65,12 @@ declare module '@polkadot/rpc-core/types.jsonrpc' {
**/ **/
epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>; epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;
}; };
beefy: {
/**
* Returns the block most recently finalized by BEEFY, alongside side its justification.
**/
subscribeJustifications: AugmentedRpc<() => Observable<BeefySignedCommitment>>;
};
chain: { chain: {
/** /**
* Get header and body of a relay chain block * Get header and body of a relay chain block
+8 -9
View File
@@ -108,8 +108,7 @@ declare module '@polkadot/api/types/submittable' {
* *
* The origin must be Signed and the sender must have sufficient funds free. * The origin must be Signed and the sender must have sufficient funds free.
* *
* Funds of sender are reserved according to the formula: * Funds of sender are reserved by `AssetDeposit`.
* `AssetDepositBase + AssetDepositPerZombie * max_zombies`.
* *
* Parameters: * Parameters:
* - `id`: The identifier of the new asset. This must not be currently in use to identify * - `id`: The identifier of the new asset. This must not be currently in use to identify
@@ -713,7 +712,7 @@ declare module '@polkadot/api/types/submittable' {
* * `gas_limit`: The gas limit enforced when executing the constructor. * * `gas_limit`: The gas limit enforced when executing the constructor.
* * `code`: The contract code to deploy in raw bytes. * * `code`: The contract code to deploy in raw bytes.
* * `data`: The input data to pass to the contract constructor. * * `data`: The input data to pass to the contract constructor.
* * `salt`: Used for the address derivation. See [`Self::contract_address`]. * * `salt`: Used for the address derivation. See [`Pallet::contract_address`].
* *
* Instantiation is executed as follows: * Instantiation is executed as follows:
* *
@@ -1277,8 +1276,8 @@ declare module '@polkadot/api/types/submittable' {
* origin is removed as a runner-up. * origin is removed as a runner-up.
* - `origin` is a current member. In this case, the deposit is unreserved and origin is * - `origin` is a current member. In this case, the deposit is unreserved and origin is
* removed as a member, consequently not being a candidate for the next round anymore. * removed as a member, consequently not being a candidate for the next round anymore.
* Similar to [`remove_members`], if replacement runners exists, they are immediately used. * Similar to [`remove_members`], if replacement runners exists, they are immediately
* If the prime is renouncing, then no prime will exist until the next round. * used. If the prime is renouncing, then no prime will exist until the next round.
* *
* The dispatch origin of this call must be signed, and have one of the above roles. * The dispatch origin of this call must be signed, and have one of the above roles.
* *
@@ -2837,7 +2836,7 @@ declare module '@polkadot/api/types/submittable' {
* - Write: Bonded, Payee, [Origin Account], Locks, Ledger * - Write: Bonded, Payee, [Origin Account], Locks, Ledger
* # </weight> * # </weight>
**/ **/
bond: AugmentedSubmittable<(controller: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, RewardDestination]>; bond: AugmentedSubmittable<(controller: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | { None: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [LookupSource, Compact<BalanceOf>, RewardDestination]>;
/** /**
* Add some extra amount that have appeared in the stash `free_balance` into the balance up * Add some extra amount that have appeared in the stash `free_balance` into the balance up
* for staking. * for staking.
@@ -3143,7 +3142,7 @@ declare module '@polkadot/api/types/submittable' {
* - Write: Payee * - Write: Payee
* # </weight> * # </weight>
**/ **/
setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [RewardDestination]>; setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | { None: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [RewardDestination]>;
/** /**
* Sets the ideal number of validators. * Sets the ideal number of validators.
* *
@@ -3875,7 +3874,7 @@ declare module '@polkadot/api/types/submittable' {
* Unlock any vested funds of the sender account. * Unlock any vested funds of the sender account.
* *
* The dispatch origin for this call must be _Signed_ and the sender must have funds still * The dispatch origin for this call must be _Signed_ and the sender must have funds still
* locked under this module. * locked under this pallet.
* *
* Emits either `VestingCompleted` or `VestingUpdated`. * Emits either `VestingCompleted` or `VestingUpdated`.
* *
@@ -3893,7 +3892,7 @@ declare module '@polkadot/api/types/submittable' {
* The dispatch origin for this call must be _Signed_. * The dispatch origin for this call must be _Signed_.
* *
* - `target`: The account whose vested funds should be unlocked. Must have funds still * - `target`: The account whose vested funds should be unlocked. Must have funds still
* locked under this module. * locked under this pallet.
* *
* Emits either `VestingCompleted` or `VestingUpdated`. * Emits either `VestingCompleted` or `VestingUpdated`.
* *
+5 -5
View File
@@ -13,15 +13,15 @@ import BN from 'bn.js';
import { Metadata } from '@polkadot/metadata'; import { Metadata } from '@polkadot/metadata';
import { TypeRegistry } from '@polkadot/types/create'; import { TypeRegistry } from '@polkadot/types/create';
import { getSpecAlias, getSpecExtensions, getSpecHasher, getSpecRpc, getSpecTypes, getUpgradeVersion } from '@polkadot/types-known'; import { getSpecAlias, getSpecExtensions, getSpecHasher, getSpecRpc, getSpecTypes, getUpgradeVersion } from '@polkadot/types-known';
import { assert, BN_ZERO, logger, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util'; import { assert, BN_ZERO, logger, stringify, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util';
import { cryptoWaitReady } from '@polkadot/util-crypto'; import { cryptoWaitReady } from '@polkadot/util-crypto';
import { of } from '@polkadot/x-rxjs'; import { of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators'; import { map, switchMap } from '@polkadot/x-rxjs/operators';
import { detectedCapabilities } from './capabilities';
import { Decorate } from './Decorate'; import { Decorate } from './Decorate';
import { detectedCapabilities } from './util';
const KEEPALIVE_INTERVAL = 15000; const KEEPALIVE_INTERVAL = 10000;
const DEFAULT_BLOCKNUMBER = { unwrap: () => BN_ZERO }; const DEFAULT_BLOCKNUMBER = { unwrap: () => BN_ZERO };
const l = logger('api/init'); const l = logger('api/init');
@@ -197,7 +197,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
if (Object.keys(types).length) { if (Object.keys(types).length) {
(registry || this.registry).register(types as Record<string, string>); (registry || this.registry).register(types as Record<string, string>);
l.debug(`Capabilities detected${blockHash ? ` (${u8aToHex(u8aToU8a(blockHash))})` : ''}: ${JSON.stringify(types)}`); l.debug(() => `Capabilities detected${blockHash ? ` (${u8aToHex(u8aToU8a(blockHash))})` : ''}: ${stringify(types)}`);
} }
}) })
.catch(l.error); .catch(l.error);
@@ -321,7 +321,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
} }
this.#healthTimer = setInterval((): void => { this.#healthTimer = setInterval((): void => {
this._rpcCore.system.health().toPromise().catch(() => null); this._rpcCore.system.health().toPromise().catch((error) => l.warn(`Health keepalive check failed: ${(error as Error).message}`));
}, KEEPALIVE_INTERVAL); }, KEEPALIVE_INTERVAL);
} catch (_error) { } catch (_error) {
const error = new Error(`FATAL: Unable to initialize the API: ${(_error as Error).message}`); const error = new Error(`FATAL: Unable to initialize the API: ${(_error as Error).message}`);
+181
View File
@@ -0,0 +1,181 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { bool, Raw, u32 } from '@polkadot/types';
import type { Releases } from '@polkadot/types/interfaces';
import type { InterfaceTypes } from '@polkadot/types/types';
import { assert, compactFromU8a } from '@polkadot/util';
import { combineLatest, Observable, of } from '@polkadot/x-rxjs';
import { map, take } from '@polkadot/x-rxjs/operators';
// the order and types needs to map with the all array setup below
type ExtractedQ = [bool | null, bool | null, bool | null, Releases | null];
type ExtractedR = [Raw | null];
type ExtractedC = [u32 | null, u32 | null];
type DetectedKeys = keyof Pick<InterfaceTypes, 'AccountInfo' | 'ValidatorPrefs'>;
type DetectedValues = keyof InterfaceTypes;
interface DetectedTypes extends Record<DetectedKeys, DetectedValues> {
AccountInfo: 'AccountInfoWithRefCount' | 'AccountInfoWithDualRefCount' | 'AccountInfoWithTripleRefCount',
Keys: 'SessionKeys1' | 'SessionKeys2' | 'SessionKeys3' | 'SessionKeys4' | 'SessionKeys5' | 'SessionKeys6' | 'SessionKeys7' | 'SessionKeys8' | 'SessionKeys9' | 'SessionKeys10';
RefCount: 'u8' | 'u32',
SlotRange: Record<string, unknown>;
ValidatorPrefs: 'ValidatorPrefsWithBlocked' | 'ValidatorPrefsWithCommission';
WinningData: string;
}
interface AvailableMap<T> {
filtered: T[];
included: boolean[];
original: T[];
}
interface Constants {
accountIdLength: number;
}
const NumberMap = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'];
function mapCapabilities ({ accountIdLength }: Constants, [leasePeriodsPerSlot, slotRangeCount]: ExtractedC, [systemRefcount32, systemRefcountDual, systemRefcountTriple, stakingVersion]: ExtractedQ, [keys]: ExtractedR): Partial<DetectedTypes> {
const types: Partial<DetectedTypes> = {};
// AccountInfo
if (systemRefcountTriple && systemRefcountTriple.isTrue) {
types.AccountInfo = 'AccountInfoWithTripleRefCount';
} else if (systemRefcountDual && systemRefcountDual.isTrue) {
types.AccountInfo = 'AccountInfoWithDualRefCount';
} else {
types.AccountInfo = 'AccountInfoWithRefCount';
if (!systemRefcount32 || systemRefcount32.isFalse) {
types.RefCount = 'u8';
}
}
// ValidatorPrefs
if (stakingVersion) {
if (stakingVersion.index >= 4) { // v1 = index 0, V5 = index 4
types.ValidatorPrefs = 'ValidatorPrefsWithBlocked';
} else {
types.ValidatorPrefs = 'ValidatorPrefsWithCommission';
}
}
// Keys
if (keys) {
try {
const [offset, numItems] = compactFromU8a(keys);
const tupleLength = (keys.length - offset) / numItems.toNumber();
const numIds = tupleLength / accountIdLength;
const numIdsRound = Math.floor(numIds);
assert(numIds >= 2 && numIds <= 11, () => `Detected ${numIds} in Keys, should be >= 2 and <= 11`);
if (numIdsRound !== numIds) {
// Beefy?
if ((((numIdsRound - 1) * accountIdLength) + 33) === tupleLength) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
types.Keys = `SessionKeys${numIdsRound - 1}B`;
} else {
assert(false, () => `Expected integer number of keys, found ${numIds.toFixed(2)}`);
}
} else {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
types.Keys = `SessionKeys${numIds - 1}`;
}
} catch (error) {
console.error(error);
}
}
// auctions
if (leasePeriodsPerSlot && slotRangeCount) {
const _enum: string[] = [];
for (let i = 0; leasePeriodsPerSlot.gtn(i); i++) {
for (let j = i; leasePeriodsPerSlot.gtn(j); j++) {
_enum.push(`${NumberMap[i]}${NumberMap[j]}`);
}
}
types.SlotRange = { _enum };
types.WinningData = `[WinningDataEntry; ${slotRangeCount.toNumber()}]`;
}
return types;
}
function filterEntries <T> (original: T[]): AvailableMap<T> {
const included = original.map((c) => !!c);
const filtered = original.filter((_, index) => included[index]);
return { filtered, included, original };
}
function extractResults <R, T = unknown> (results: unknown[], map: AvailableMap<T>): R {
let offset = -1;
return map.included.map((isIncluded) =>
isIncluded
? results[++offset]
: null
) as unknown as R;
}
/**
* @description Query the chain for the specific capabilities
*/
export function detectedCapabilities (api: ApiInterfaceRx, blockHash?: Uint8Array | string | undefined): Observable<Partial<DetectedTypes>> {
const consts = filterEntries([
api.consts.auctions?.leasePeriodsPerSlot,
api.consts.auctions?.slotRangeCount
]);
const queries = filterEntries([
api.query.system?.upgradedToU32RefCount,
api.query.system?.upgradedToDualRefCount,
api.query.system?.upgradedToTripleRefCount,
api.query.staking?.storageVersion
]);
const raws = filterEntries([
api.query.session?.queuedKeys
]);
return combineLatest([
consts.filtered.length
? blockHash
// FIXME consts don't have .at as of yet...
? of([])
: of(consts.filtered)
: of([]),
queries.filtered.length
? blockHash
? combineLatest(queries.filtered.map((c) => c.at(blockHash)))
: api.queryMulti(queries.filtered)
: of([]),
raws.filtered.length
? blockHash
? combineLatest(raws.filtered.map((k) => api.rpc.state.getStorage.raw(k.key(), blockHash)))
: combineLatest(raws.filtered.map((k) => api.rpc.state.getStorage.raw(k.key())))
: of([])
]).pipe(
map(([cResults, qResults, rResults]): Partial<DetectedTypes> =>
mapCapabilities(
{
accountIdLength: api.registry.createType('AccountId').encodedLength
},
extractResults<ExtractedC>(cResults, consts),
extractResults<ExtractedQ>(qResults, queries),
extractResults<ExtractedR>(rResults, raws)
)
),
take(1)
);
}
-82
View File
@@ -1,82 +0,0 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { bool } from '@polkadot/types';
import type { Releases } from '@polkadot/types/interfaces';
import type { InterfaceTypes } from '@polkadot/types/types';
import { combineLatest, Observable, of } from '@polkadot/x-rxjs';
import { map, take } from '@polkadot/x-rxjs/operators';
// the order and types needs to map with the all array setup below
type Extracted = [bool | null, bool | null, bool | null, Releases | null];
type DetectedKeys = keyof Pick<InterfaceTypes, 'AccountInfo' | 'ValidatorPrefs'>;
type DetectedValues = keyof InterfaceTypes;
interface DetectedTypes extends Record<DetectedKeys, DetectedValues> {
AccountInfo: 'AccountInfoWithRefCount' | 'AccountInfoWithDualRefCount' | 'AccountInfoWithTripleRefCount',
RefCount: 'u8' | 'u32',
ValidatorPrefs: 'ValidatorPrefsWithBlocked' | 'ValidatorPrefsWithCommission';
}
function mapCapabilities ([systemRefcount32, systemRefcountDual, systemRefcountTriple, stakingVersion]: Extracted): Partial<DetectedTypes> {
const types: Partial<DetectedTypes> = {};
// AccountInfo
if (systemRefcountTriple && systemRefcountTriple.isTrue) {
types.AccountInfo = 'AccountInfoWithTripleRefCount';
} else if (systemRefcountDual && systemRefcountDual.isTrue) {
types.AccountInfo = 'AccountInfoWithDualRefCount';
} else {
types.AccountInfo = 'AccountInfoWithRefCount';
if (!systemRefcount32 || systemRefcount32.isFalse) {
types.RefCount = 'u8';
}
}
// ValidatorPrefs
if (stakingVersion) {
if (stakingVersion.index >= 4) { // v1 = index 0, V5 = index 4
types.ValidatorPrefs = 'ValidatorPrefsWithBlocked';
} else {
types.ValidatorPrefs = 'ValidatorPrefsWithCommission';
}
}
return types;
}
/**
* @description Query the chain for the specific capabilities
*/
export function detectedCapabilities (api: ApiInterfaceRx, blockHash?: Uint8Array | string | undefined): Observable<Partial<DetectedTypes>> {
const all = [
api.query.system?.upgradedToU32RefCount,
api.query.system?.upgradedToDualRefCount,
api.query.system?.upgradedToTripleRefCount,
api.query.staking?.storageVersion
];
const included = all.map((c) => !!c);
const filtered = all.filter((_, index) => included[index]);
return (
filtered.length
? blockHash
? combineLatest(filtered.map((c) => c.at(blockHash)))
: api.queryMulti(filtered)
: of([])
).pipe(
map((results): Partial<DetectedTypes> => {
let offset = -1;
return mapCapabilities(
included.map((isIncluded) => isIncluded ? results[++offset] : null) as Extracted
);
}),
take(1)
);
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api', version: '4.4.1' }; export const packageInfo = { name: '@polkadot/api', version: '4.7.1' };
+18 -10
View File
@@ -211,7 +211,19 @@ export class ApiPromise extends ApiBase<'promise'> {
* ``` * ```
*/ */
public static create (options?: ApiOptions): Promise<ApiPromise> { public static create (options?: ApiOptions): Promise<ApiPromise> {
return new ApiPromise(options).isReady; const instance = new ApiPromise(options);
if (options && options.throwOnConnect) {
return instance.isReadyOrError;
}
// Swallow any rejections on isReadyOrError
// (in Node 15.x this creates issues, when not being looked at)
instance.isReadyOrError.catch(() => {
// ignore
});
return instance.isReady;
} }
/** /**
@@ -235,18 +247,14 @@ export class ApiPromise extends ApiBase<'promise'> {
super(options, 'promise', decorateMethod); super(options, 'promise', decorateMethod);
this.#isReadyPromise = new Promise((resolve): void => { this.#isReadyPromise = new Promise((resolve): void => {
super.once('ready', (): void => { super.once('ready', () => resolve(this));
resolve(this);
});
}); });
this.#isReadyOrErrorPromise = new Promise((resolve, reject): void => { this.#isReadyOrErrorPromise = new Promise((resolve, reject): void => {
super.once('ready', (): void => { const tracker = promiseTracker(resolve, reject);
resolve(this);
}); super.once('ready', () => tracker.resolve(this));
super.once('error', (e): void => { super.once('error', (e) => tracker.reject(e));
reject(e);
});
}); });
} }
+5 -1
View File
@@ -32,14 +32,17 @@ export class SubmittableResult implements ISubmittableResult {
public readonly dispatchInfo?: DispatchInfo; public readonly dispatchInfo?: DispatchInfo;
public readonly internalError?: Error;
public readonly events: EventRecord[]; public readonly events: EventRecord[];
public readonly status: ExtrinsicStatus; public readonly status: ExtrinsicStatus;
constructor ({ dispatchError, dispatchInfo, events, status }: SubmittableResultValue) { constructor ({ dispatchError, dispatchInfo, events, internalError, status }: SubmittableResultValue) {
this.dispatchError = dispatchError || extractError(events); this.dispatchError = dispatchError || extractError(events);
this.dispatchInfo = dispatchInfo || extractInfo(events); this.dispatchInfo = dispatchInfo || extractInfo(events);
this.events = events || []; this.events = events || [];
this.internalError = internalError;
this.status = status; this.status = status;
} }
@@ -85,6 +88,7 @@ export class SubmittableResult implements ISubmittableResult {
dispatchError: this.dispatchError?.toHuman(), dispatchError: this.dispatchError?.toHuman(),
dispatchInfo: this.dispatchInfo?.toHuman(), dispatchInfo: this.dispatchInfo?.toHuman(),
events: this.events.map((event) => event.toHuman(isExtended)), events: this.events.map((event) => event.toHuman(isExtended)),
internalError: this.internalError?.message.toString(),
status: this.status.toHuman(isExtended) status: this.status.toHuman(isExtended)
}; };
} }
+4 -1
View File
@@ -11,7 +11,7 @@ import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, Submittable
import { assert, isBn, isFunction, isNumber, isString, isU8a } from '@polkadot/util'; import { assert, isBn, isFunction, isNumber, isString, isU8a } from '@polkadot/util';
import { of } from '@polkadot/x-rxjs'; import { of } from '@polkadot/x-rxjs';
import { first, map, mapTo, mergeMap, switchMap, tap } from '@polkadot/x-rxjs/operators'; import { catchError, first, map, mapTo, mergeMap, switchMap, tap } from '@polkadot/x-rxjs/operators';
import { ApiBase } from '../base'; import { ApiBase } from '../base';
import { filterEvents, isKeyringPair } from '../util'; import { filterEvents, isKeyringPair } from '../util';
@@ -242,6 +242,9 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
events: filterEvents(hash, block, events, status), events: filterEvents(hash, block, events, status),
status status
})) }))
),
catchError((internalError: Error) =>
of(this.#transformResult(new SubmittableResult({ internalError, status })))
) )
); );
} }
+1
View File
@@ -10,6 +10,7 @@ export interface SubmittableResultValue {
dispatchError?: DispatchError; dispatchError?: DispatchError;
dispatchInfo?: DispatchInfo; dispatchInfo?: DispatchInfo;
events?: EventRecord[]; events?: EventRecord[];
internalError?: Error;
status: ExtrinsicStatus; status: ExtrinsicStatus;
} }
+4
View File
@@ -69,6 +69,10 @@ export interface ApiOptions extends RegisteredTypes {
* @description The source object to use for runtime information (only used when cloning) * @description The source object to use for runtime information (only used when cloning)
*/ */
source?: ApiBase<any>; source?: ApiBase<any>;
/**
* @description Throws an error when the initial connection fails (same as isReadyOrError)
*/
throwOnConnect?: boolean;
} }
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic // A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
+3 -3
View File
@@ -13,7 +13,7 @@ function sig ({ method, section }: StorageEntry, ...args: Type[]): string {
function doDoubleMap (creator: StorageEntry, args: unknown[]): [StorageEntry, [any, any]] { function doDoubleMap (creator: StorageEntry, args: unknown[]): [StorageEntry, [any, any]] {
const { key1, key2 } = creator.meta.type.asDoubleMap; const { key1, key2 } = creator.meta.type.asDoubleMap;
assert(args.length === 2, `${sig(creator, key1, key2)} is a doublemap, requiring 2 arguments, ${args.length} found`); assert(args.length === 2, () => `${sig(creator, key1, key2)} is a doublemap, requiring 2 arguments, ${args.length} found`);
// pass as tuple // pass as tuple
return [creator, args as [any, any]]; return [creator, args as [any, any]];
@@ -22,7 +22,7 @@ function doDoubleMap (creator: StorageEntry, args: unknown[]): [StorageEntry, [a
function doMap (creator: StorageEntry, args: unknown[]): [StorageEntry] | [StorageEntry, any] { function doMap (creator: StorageEntry, args: unknown[]): [StorageEntry] | [StorageEntry, any] {
const { key } = creator.meta.type.asMap; const { key } = creator.meta.type.asMap;
assert(args.length === 1, `${sig(creator, key)} is a map, requiring 1 argument, ${args.length} found`); assert(args.length === 1, () => `${sig(creator, key)} is a map, requiring 1 argument, ${args.length} found`);
// expand // expand
return args.length return args.length
@@ -41,7 +41,7 @@ export function extractStorageArgs (creator: StorageEntry, _args: unknown[]): [S
return doMap(creator, args); return doMap(creator, args);
} }
assert(args.length === 0, `${sig(creator)} does not take any arguments, ${args.length} found`); assert(args.length === 0, () => `${sig(creator)} does not take any arguments, ${args.length} found`);
// no args // no args
return [creator]; return [creator];
+10 -7
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/metadata", "name": "@polkadot/metadata",
"version": "4.4.1", "version": "4.7.1",
"type": "module", "type": "module",
"description": "Helpers to extract information from runtime metadata", "description": "Helpers to extract information from runtime metadata",
"main": "index.js", "main": "index.js",
@@ -8,6 +8,9 @@
"./detectPackage.js", "./detectPackage.js",
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"engines": {
"node": ">=14.0.0"
},
"repository": "github:polkadot-js/api", "repository": "github:polkadot-js/api",
"author": "Jaco Greeff <jacogr@gmail.com>", "author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [], "maintainers": [],
@@ -16,14 +19,14 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/types": "4.4.1", "@polkadot/types": "4.7.1",
"@polkadot/types-known": "4.4.1", "@polkadot/types-known": "4.7.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.3.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.3.1",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5" "@polkadot/keyring": "^6.3.1"
} }
} }
+1 -1
View File
@@ -15,7 +15,7 @@ export class MagicNumber extends U32 {
if (!this.isEmpty) { if (!this.isEmpty) {
const magic = registry.createType('u32', MAGIC_NUMBER); const magic = registry.createType('u32', MAGIC_NUMBER);
assert(this.eq(magic), `MagicNumber mismatch: expected ${magic.toHex()}, found ${this.toHex()}`); assert(this.eq(magic), () => `MagicNumber mismatch: expected ${magic.toHex()}, found ${this.toHex()}`);
} }
} }
} }
+1 -1
View File
@@ -34,7 +34,7 @@ export class MetadataVersioned extends Struct {
} }
#assertVersion = (version: number): boolean => { #assertVersion = (version: number): boolean => {
assert(this.version <= version, `Cannot convert metadata from v${this.version} to v${version}`); assert(this.version <= version, () => `Cannot convert metadata from v${this.version} to v${version}`);
return this.version === version; return this.version === version;
}; };
@@ -16,7 +16,7 @@ export function createUnchecked (registry: Registry, section: string, callIndex:
const funcName = stringCamelCase(callMetadata.name); const funcName = stringCamelCase(callMetadata.name);
const extrinsicFn = (...args: any[]): Call => { const extrinsicFn = (...args: any[]): Call => {
assert(expectedArgs.length === args.length, `Extrinsic ${section}.${funcName} expects ${expectedArgs.length.valueOf()} arguments, got ${args.length}.`); assert(expectedArgs.length === args.length, () => `Extrinsic ${section}.${funcName} expects ${expectedArgs.length.valueOf()} arguments, got ${args.length}.`);
return registry.createType('Call', { return registry.createType('Call', {
args, args,
@@ -65,7 +65,7 @@ function createKeyDoubleMap (registry: Registry, itemFn: CreateItemFn, args: [Cr
const { meta: { name, type } } = itemFn; const { meta: { name, type } } = itemFn;
// since we are passing an almost-unknown through, trust, but verify // since we are passing an almost-unknown through, trust, but verify
assert(Array.isArray(args) && !isUndefined(args[0]) && !isNull(args[0]) && !isUndefined(args[1]) && !isNull(args[1]), `${(name || 'unknown').toString()} is a DoubleMap and requires two arguments`); assert(Array.isArray(args) && !isUndefined(args[0]) && !isNull(args[0]) && !isUndefined(args[1]) && !isNull(args[1]), () => `${(name || 'unknown').toString()} is a DoubleMap and requires two arguments`);
// if this fails, we have bigger issues // if this fails, we have bigger issues
assert(!isUndefined(hasher2), '2 hashing functions should be defined for DoubleMaps'); assert(!isUndefined(hasher2), '2 hashing functions should be defined for DoubleMaps');
@@ -92,7 +92,7 @@ function createKey (registry: Registry, itemFn: CreateItemFn, arg: CreateArgType
if (type.isMap) { if (type.isMap) {
const map = type.asMap; const map = type.asMap;
assert(!isUndefined(arg) && !isNull(arg), `${name.toString()} is a Map and requires one argument`); assert(!isUndefined(arg) && !isNull(arg), () => `${name.toString()} is a Map and requires one argument`);
param = registry.createType(map.key.toString() as 'Raw', arg).toU8a(); param = registry.createType(map.key.toString() as 'Raw', arg).toU8a();
} }
@@ -5,7 +5,7 @@ import type { StorageEntry } from '@polkadot/types/primitive/types';
import type { Registry } from '@polkadot/types/types'; import type { Registry } from '@polkadot/types/types';
import type { Storage } from '../types'; import type { Storage } from '../types';
import * as substrate from './substrate'; import { substrate } from './substrate';
/** @internal */ /** @internal */
export function getStorage (registry: Registry, metaVersion: number): Storage { export function getStorage (registry: Registry, metaVersion: number): Storage {
@@ -12,6 +12,8 @@ interface SubstrateMetadata {
type: string; type: string;
} }
type Creator = (registry: Registry, metaVersion: number) => StorageEntry;
// Small helper function to factorize code on this page. // Small helper function to factorize code on this page.
/** @internal */ /** @internal */
function createRuntimeFunction (method: string, key: string, { documentation, type }: SubstrateMetadata): (registry: Registry, metaVersion: number) => StorageEntry { function createRuntimeFunction (method: string, key: string, { documentation, type }: SubstrateMetadata): (registry: Registry, metaVersion: number) => StorageEntry {
@@ -29,27 +31,25 @@ function createRuntimeFunction (method: string, key: string, { documentation, ty
}, { key, metaVersion, skipHashing: true }); }, { key, metaVersion, skipHashing: true });
} }
export const code = createRuntimeFunction('code', ':code', { export const substrate: Record<string, Creator> = {
documentation: 'Wasm code of the runtime.', changesTrieConfig: createRuntimeFunction('changesTrieConfig', ':changes_trie', {
type: 'Bytes' documentation: ' Changes trie configuration is stored under this key.',
}); type: 'u32'
}),
export const heapPages = createRuntimeFunction('heapPages', ':heappages', { childStorageKeyPrefix: createRuntimeFunction('childStorageKeyPrefix', ':child_storage:', {
documentation: 'Number of wasm linear memory pages required for execution of the runtime.', documentation: ' Prefix of child storage keys.',
type: 'u64' type: 'u32'
}); }),
code: createRuntimeFunction('code', ':code', {
export const extrinsicIndex = createRuntimeFunction('extrinsicIndex', ':extrinsic_index', { documentation: ' Wasm code of the runtime.',
documentation: 'Current extrinsic index (u32) is stored under this key.', type: 'Bytes'
type: 'u32' }),
}); extrinsicIndex: createRuntimeFunction('extrinsicIndex', ':extrinsic_index', {
documentation: ' Current extrinsic index (u32) is stored under this key.',
export const changesTrieConfig = createRuntimeFunction('changesTrieConfig', ':changes_trie', { type: 'u32'
documentation: 'Changes trie configuration is stored under this key.', }),
type: 'u32' heapPages: createRuntimeFunction('heapPages', ':heappages', {
}); documentation: ' Number of wasm linear memory pages required for execution of the runtime.',
type: 'u64'
export const childStorageKeyPrefix = createRuntimeFunction('childStorageKeyPrefix', ':child_storage:', { })
documentation: 'Prefix of child storage keys.', };
type: 'u32'
});
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/metadata', version: '4.4.1' }; export const packageInfo = { name: '@polkadot/metadata', version: '4.7.1' };
+3 -3
View File
@@ -5,7 +5,7 @@ import type { Codec, Registry } from '@polkadot/types/types';
import type { MetadataInterface } from '../types'; import type { MetadataInterface } from '../types';
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
import { assert, hexToU8a, u8aToHex } from '@polkadot/util'; import { assert, hexToU8a, stringify, u8aToHex } from '@polkadot/util';
import { Metadata } from '../Metadata'; import { Metadata } from '../Metadata';
import { getUniqTypes } from './getUniqTypes'; import { getUniqTypes } from './getUniqTypes';
@@ -22,7 +22,7 @@ export function decodeLatestSubstrate<Modules extends Codec> (registry: Registry
expect((metadata[`asV${version}` as keyof Metadata] as unknown as MetadataInterface<Modules>).modules.length).not.toBe(0); expect((metadata[`asV${version}` as keyof Metadata] as unknown as MetadataInterface<Modules>).modules.length).not.toBe(0);
expect(metadata.toJSON()).toEqual(staticSubstrate); expect(metadata.toJSON()).toEqual(staticSubstrate);
} catch (error) { } catch (error) {
console.error(JSON.stringify(metadata.toJSON())); console.error(stringify(metadata.toJSON()));
throw error; throw error;
} }
@@ -65,7 +65,7 @@ export function defaultValues (registry: Registry, rpcData: string, withThrow =
if (withFallbackCheck) { if (withFallbackCheck) {
const [hexType, hexOrig] = [u8aToHex(type.toU8a()), u8aToHex(fallback.toU8a(true))]; const [hexType, hexOrig] = [u8aToHex(type.toU8a()), u8aToHex(fallback.toU8a(true))];
assert(hexType === hexOrig, `Fallback does not match (${((hexOrig.length - 2) / 2) - ((hexType.length - 2) / 2)} bytes missing): ${hexType} !== ${hexOrig}`); assert(hexType === hexOrig, () => `Fallback does not match (${((hexOrig.length - 2) / 2) - ((hexType.length - 2) / 2)} bytes missing): ${hexType} !== ${hexOrig}`);
} }
} catch (error) { } catch (error) {
const message = `${location}:: ${(error as Error).message}`; const message = `${location}:: ${(error as Error).message}`;
+166 -38
View File
@@ -499,7 +499,7 @@
{ {
"name": "Version", "name": "Version",
"type": "RuntimeVersion", "type": "RuntimeVersion",
"value": "0x106e6f6465387375627374726174652d6e6f64650a000000090100000000000034df6acb689907609b0300000037e397fc7c91f5e40100000040fe3ad401f8959a04000000d2bc9897eed08f1502000000f78b278be53f454c02000000ed99c5acb25eedf502000000cbca25e39f14238702000000687ad44ad37f03c201000000bc9d89904f5b923f0100000068b66ba122c93fa70100000037c8bb1350a9a2a80100000091d5df18b0d2cf5801000000ab3c0572291feb8b0100000002000000", "value": "0x106e6f6465387375627374726174652d6e6f64650a000000090100000100000034df6acb689907609b0300000037e397fc7c91f5e40100000040fe3ad401f8959a04000000d2bc9897eed08f1502000000f78b278be53f454c02000000ed99c5acb25eedf502000000cbca25e39f14238702000000687ad44ad37f03c201000000bc9d89904f5b923f0100000068b66ba122c93fa70100000037c8bb1350a9a2a80100000091d5df18b0d2cf5801000000ab3c0572291feb8b0100000002000000",
"documentation": [ "documentation": [
" Get the chain's current version." " Get the chain's current version."
] ]
@@ -947,7 +947,7 @@
{ {
"name": "EpochDuration", "name": "EpochDuration",
"type": "u64", "type": "u64",
"value": "0x1400000000000000", "value": "0xc800000000000000",
"documentation": [ "documentation": [
" The amount of time, in slots, that each epoch should last.", " The amount of time, in slots, that each epoch should last.",
" NOTE: Currently it is not possible to change the epoch duration after", " NOTE: Currently it is not possible to change the epoch duration after",
@@ -1392,7 +1392,38 @@
] ]
} }
], ],
"errors": [], "errors": [
{
"name": "NotAssigned",
"documentation": [
" The index was not already assigned."
]
},
{
"name": "NotOwner",
"documentation": [
" The index is assigned to another account."
]
},
{
"name": "InUse",
"documentation": [
" The index was not available."
]
},
{
"name": "NotTransfer",
"documentation": [
" The source and destination accounts are identical."
]
},
{
"name": "Permanent",
"documentation": [
" The index is permanent and may not be freed/changed."
]
}
],
"index": 5 "index": 5
}, },
{ {
@@ -1971,7 +2002,7 @@
{ {
"name": "UnsignedPhase", "name": "UnsignedPhase",
"type": "BlockNumber", "type": "BlockNumber",
"value": "0x05000000", "value": "0x32000000",
"documentation": [ "documentation": [
" Duration of the unsigned phase." " Duration of the unsigned phase."
] ]
@@ -1979,7 +2010,7 @@
{ {
"name": "SignedPhase", "name": "SignedPhase",
"type": "BlockNumber", "type": "BlockNumber",
"value": "0x05000000", "value": "0x32000000",
"documentation": [ "documentation": [
" Duration of the signed phase." " Duration of the signed phase."
] ]
@@ -3257,6 +3288,14 @@
" For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim", " For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim",
" their reward. This used to limit the i/o cost for the nominator payout." " their reward. This used to limit the i/o cost for the nominator payout."
] ]
},
{
"name": "MaxNominations",
"type": "u32",
"value": "0x10000000",
"documentation": [
" Maximum number of nominations per nominator."
]
} }
], ],
"errors": [ "errors": [
@@ -5747,7 +5786,7 @@
{ {
"name": "Elections", "name": "Elections",
"storage": { "storage": {
"prefix": "PhragmenElection", "prefix": "Elections",
"items": [ "items": [
{ {
"name": "Members", "name": "Members",
@@ -5917,8 +5956,8 @@
" origin is removed as a runner-up.", " origin is removed as a runner-up.",
" - `origin` is a current member. In this case, the deposit is unreserved and origin is", " - `origin` is a current member. In this case, the deposit is unreserved and origin is",
" removed as a member, consequently not being a candidate for the next round anymore.", " removed as a member, consequently not being a candidate for the next round anymore.",
" Similar to [`remove_members`], if replacement runners exists, they are immediately used.", " Similar to [`remove_members`], if replacement runners exists, they are immediately",
" If the prime is renouncing, then no prime will exist until the next round.", " used. If the prime is renouncing, then no prime will exist until the next round.",
"", "",
" The dispatch origin of this call must be signed, and have one of the above roles.", " The dispatch origin of this call must be signed, and have one of the above roles.",
"", "",
@@ -5989,10 +6028,11 @@
"Vec<(AccountId,Balance)>" "Vec<(AccountId,Balance)>"
], ],
"documentation": [ "documentation": [
" A new term with \\[new_members\\]. This indicates that enough candidates existed to run the", " A new term with \\[new_members\\]. This indicates that enough candidates existed to run",
" election, not that enough have has been elected. The inner value must be examined for", " the election, not that enough have has been elected. The inner value must be examined",
" this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond slashed and", " for this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond",
" none were elected, whilst `EmptyTerm` means that no candidates existed to begin with." " slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to",
" begin with."
] ]
}, },
{ {
@@ -6054,47 +6094,66 @@
} }
], ],
"constants": [ "constants": [
{
"name": "PalletId",
"type": "LockIdentifier",
"value": "0x706872656c656374",
"documentation": [
" Identifier for the elections-phragmen pallet's lock"
]
},
{ {
"name": "CandidacyBond", "name": "CandidacyBond",
"type": "BalanceOf", "type": "BalanceOf",
"value": "0x0080c6a47e8d03000000000000000000", "value": "0x0080c6a47e8d03000000000000000000",
"documentation": [] "documentation": [
" How much should be locked up in order to submit one's candidacy."
]
}, },
{ {
"name": "VotingBondBase", "name": "VotingBondBase",
"type": "BalanceOf", "type": "BalanceOf",
"value": "0x00f0436de36a01000000000000000000", "value": "0x00f0436de36a01000000000000000000",
"documentation": [] "documentation": [
" Base deposit associated with voting.",
"",
" This should be sensibly high to economically ensure the pallet cannot be attacked by",
" creating a gigantic number of votes."
]
}, },
{ {
"name": "VotingBondFactor", "name": "VotingBondFactor",
"type": "BalanceOf", "type": "BalanceOf",
"value": "0x0000cc7b9fae00000000000000000000", "value": "0x0000cc7b9fae00000000000000000000",
"documentation": [] "documentation": [
" The amount of bond that need to be locked for each vote (32 bytes)."
]
}, },
{ {
"name": "DesiredMembers", "name": "DesiredMembers",
"type": "u32", "type": "u32",
"value": "0x0d000000", "value": "0x0d000000",
"documentation": [] "documentation": [
" Number of members to elect."
]
}, },
{ {
"name": "DesiredRunnersUp", "name": "DesiredRunnersUp",
"type": "u32", "type": "u32",
"value": "0x07000000", "value": "0x07000000",
"documentation": [] "documentation": [
" Number of runners_up to keep."
]
}, },
{ {
"name": "TermDuration", "name": "TermDuration",
"type": "BlockNumber", "type": "BlockNumber",
"value": "0x80130300", "value": "0x80130300",
"documentation": [] "documentation": [
}, " How long each seat is kept. This defines the next block number at which an election",
{ " round will happen. If set to zero, no elections are ever triggered and the module will",
"name": "ModuleId", " be in passive mode."
"type": "LockIdentifier", ]
"value": "0x706872656c656374",
"documentation": []
} }
], ],
"errors": [ "errors": [
@@ -6383,7 +6442,20 @@
} }
], ],
"constants": [], "constants": [],
"errors": [], "errors": [
{
"name": "AlreadyMember",
"documentation": [
" Already a member."
]
},
{
"name": "NotMember",
"documentation": [
" Not a member."
]
}
],
"index": 15 "index": 15
}, },
{ {
@@ -6825,8 +6897,8 @@
] ]
}, },
{ {
"name": "ModuleId", "name": "PalletId",
"type": "ModuleId", "type": "PalletId",
"value": "0x70792f7472737279", "value": "0x70792f7472737279",
"documentation": [ "documentation": [
" The treasury's module id, used for deriving its sovereign account ID." " The treasury's module id, used for deriving its sovereign account ID."
@@ -7026,7 +7098,7 @@
" * `gas_limit`: The gas limit enforced when executing the constructor.", " * `gas_limit`: The gas limit enforced when executing the constructor.",
" * `code`: The contract code to deploy in raw bytes.", " * `code`: The contract code to deploy in raw bytes.",
" * `data`: The input data to pass to the contract constructor.", " * `data`: The input data to pass to the contract constructor.",
" * `salt`: Used for the address derivation. See [`Self::contract_address`].", " * `salt`: Used for the address derivation. See [`Pallet::contract_address`].",
"", "",
" Instantiation is executed as follows:", " Instantiation is executed as follows:",
"", "",
@@ -9569,12 +9641,20 @@
] ]
}, },
{ {
"name": "ModuleId", "name": "PalletId",
"type": "ModuleId", "type": "PalletId",
"value": "0x70792f736f636965", "value": "0x70792f736f636965",
"documentation": [ "documentation": [
" The societies's module id" " The societies's module id"
] ]
},
{
"name": "MaxCandidateIntake",
"type": "u32",
"value": "0x0a000000",
"documentation": [
" Maximum candidate intake per round."
]
} }
], ],
"errors": [ "errors": [
@@ -10274,7 +10354,7 @@
" Unlock any vested funds of the sender account.", " Unlock any vested funds of the sender account.",
"", "",
" The dispatch origin for this call must be _Signed_ and the sender must have funds still", " The dispatch origin for this call must be _Signed_ and the sender must have funds still",
" locked under this module.", " locked under this pallet.",
"", "",
" Emits either `VestingCompleted` or `VestingUpdated`.", " Emits either `VestingCompleted` or `VestingUpdated`.",
"", "",
@@ -10300,7 +10380,7 @@
" The dispatch origin for this call must be _Signed_.", " The dispatch origin for this call must be _Signed_.",
"", "",
" - `target`: The account whose vested funds should be unlocked. Must have funds still", " - `target`: The account whose vested funds should be unlocked. Must have funds still",
" locked under this module.", " locked under this pallet.",
"", "",
" Emits either `VestingCompleted` or `VestingUpdated`.", " Emits either `VestingCompleted` or `VestingUpdated`.",
"", "",
@@ -10409,7 +10489,7 @@
"type": "BalanceOf", "type": "BalanceOf",
"value": "0x0000c16ff28623000000000000000000", "value": "0x0000c16ff28623000000000000000000",
"documentation": [ "documentation": [
" The minimum amount to be transferred to create a new vesting schedule." " The minimum amount transferred to call `vested_transfer`."
] ]
} }
], ],
@@ -12614,8 +12694,7 @@
"", "",
" The origin must be Signed and the sender must have sufficient funds free.", " The origin must be Signed and the sender must have sufficient funds free.",
"", "",
" Funds of sender are reserved according to the formula:", " Funds of sender are reserved by `AssetDeposit`.",
" `AssetDepositBase + AssetDepositPerZombie * max_zombies`.",
"", "",
" Parameters:", " Parameters:",
" - `id`: The identifier of the new asset. This must not be currently in use to identify", " - `id`: The identifier of the new asset. This must not be currently in use to identify",
@@ -13902,8 +13981,8 @@
], ],
"constants": [ "constants": [
{ {
"name": "ModuleId", "name": "PalletId",
"type": "ModuleId", "type": "PalletId",
"value": "0x70792f6c6f74746f", "value": "0x70792f6c6f74746f",
"documentation": [] "documentation": []
}, },
@@ -13914,7 +13993,56 @@
"documentation": [] "documentation": []
} }
], ],
"errors": [], "errors": [
{
"name": "Overflow",
"documentation": [
" An overflow has occurred."
]
},
{
"name": "NotConfigured",
"documentation": [
" A lottery has not been configured."
]
},
{
"name": "InProgress",
"documentation": [
" A lottery is already in progress."
]
},
{
"name": "AlreadyEnded",
"documentation": [
" A lottery has already ended."
]
},
{
"name": "InvalidCall",
"documentation": [
" The call is not valid for an open lottery."
]
},
{
"name": "AlreadyParticipating",
"documentation": [
" You are already participating in the lottery with this call."
]
},
{
"name": "TooManyCalls",
"documentation": [
" Too many calls for a single lottery."
]
},
{
"name": "EncodingFailed",
"documentation": [
" Failed to encode calls"
]
}
],
"index": 36 "index": 36
}, },
{ {
File diff suppressed because one or more lines are too long
+11 -8
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/rpc-core", "name": "@polkadot/rpc-core",
"version": "4.4.1", "version": "4.7.1",
"type": "module", "type": "module",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js", "main": "index.js",
@@ -8,6 +8,9 @@
"./detectPackage.js", "./detectPackage.js",
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"engines": {
"node": ">=14.0.0"
},
"author": "Jaco Greeff <jacogr@gmail.com>", "author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [], "maintainers": [],
"contributors": [], "contributors": [],
@@ -16,14 +19,14 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/metadata": "4.4.1", "@polkadot/metadata": "4.7.1",
"@polkadot/rpc-provider": "4.4.1", "@polkadot/rpc-provider": "4.7.1",
"@polkadot/types": "4.4.1", "@polkadot/types": "4.7.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.3.1",
"@polkadot/x-rxjs": "^6.0.5" "@polkadot/x-rxjs": "^6.3.1"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5" "@polkadot/keyring": "^6.3.1"
} }
} }
+1 -1
View File
@@ -343,7 +343,7 @@ export class RpcCore {
? '' ? ''
: ` (${def.params.length - reqArgCount} optional)`; : ` (${def.params.length - reqArgCount} optional)`;
assert(inputs.length >= reqArgCount && inputs.length <= def.params.length, `Expected ${def.params.length} parameters${optText}, ${inputs.length} found instead`); assert(inputs.length >= reqArgCount && inputs.length <= def.params.length, () => `Expected ${def.params.length} parameters${optText}, ${inputs.length} found instead`);
return inputs.map((input, index): Codec => return inputs.map((input, index): Codec =>
createTypeUnsafe(registry, def.params[index].type, [input], { blockHash }) createTypeUnsafe(registry, def.params[index].type, [input], { blockHash })
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.4.1' }; export const packageInfo = { name: '@polkadot/rpc-core', version: '4.7.1' };
+2 -2
View File
@@ -3,7 +3,7 @@
import type { Observable } from '@polkadot/x-rxjs'; import type { Observable } from '@polkadot/x-rxjs';
import { logger } from '@polkadot/util'; import { logger, stringify } from '@polkadot/util';
import { catchError, distinctUntilChanged, publishReplay, refCount, tap } from '@polkadot/x-rxjs/operators'; import { catchError, distinctUntilChanged, publishReplay, refCount, tap } from '@polkadot/x-rxjs/operators';
import { refCountDelay } from './refCountDelay'; import { refCountDelay } from './refCountDelay';
@@ -19,7 +19,7 @@ interface Options {
const l = logger('drr'); const l = logger('drr');
const CMP = (a: unknown, b: unknown): boolean => const CMP = (a: unknown, b: unknown): boolean =>
JSON.stringify({ t: a }) === JSON.stringify({ t: b }); stringify({ t: a }) === stringify({ t: b });
const ERR = (error: Error): Observable<never> => { const ERR = (error: Error): Observable<never> => {
l.error(error); l.error(error);
+13 -10
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/rpc-provider", "name": "@polkadot/rpc-provider",
"version": "4.4.1", "version": "4.7.1",
"type": "module", "type": "module",
"description": "Transport providers for the API", "description": "Transport providers for the API",
"main": "index.js", "main": "index.js",
@@ -8,6 +8,9 @@
"./detectPackage.js", "./detectPackage.js",
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"engines": {
"node": ">=14.0.0"
},
"author": "Jaco Greeff <jacogr@gmail.com>", "author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [], "maintainers": [],
"contributors": [], "contributors": [],
@@ -16,19 +19,19 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/types": "4.4.1", "@polkadot/types": "4.7.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.3.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.3.1",
"@polkadot/x-fetch": "^6.0.5", "@polkadot/x-fetch": "^6.3.1",
"@polkadot/x-global": "^6.0.5", "@polkadot/x-global": "^6.3.1",
"@polkadot/x-ws": "^6.0.5", "@polkadot/x-ws": "^6.3.1",
"bn.js": "^4.11.9", "bn.js": "^4.11.9",
"eventemitter3": "^4.0.7" "eventemitter3": "^4.0.7"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5", "@polkadot/keyring": "^6.3.1",
"@polkadot/metadata": "4.4.1", "@polkadot/metadata": "4.7.1",
"mock-socket": "^9.0.3", "mock-socket": "^9.0.3",
"nock": "^13.0.11" "nock": "^13.0.11"
} }
+3 -3
View File
@@ -3,7 +3,7 @@
import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '../types'; import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '../types';
import { assert, isNumber, isString, isUndefined } from '@polkadot/util'; import { assert, isNumber, isString, isUndefined, stringify } from '@polkadot/util';
function formatErrorData (data?: string | number): string { function formatErrorData (data?: string | number): string {
if (isUndefined(data)) { if (isUndefined(data)) {
@@ -12,7 +12,7 @@ function formatErrorData (data?: string | number): string {
const formatted = `: ${isString(data) const formatted = `: ${isString(data)
? data.replace(/Error\("/g, '').replace(/\("/g, '(').replace(/"\)/g, ')').replace(/\(/g, ', ').replace(/\)/g, '') ? data.replace(/Error\("/g, '').replace(/\("/g, '(').replace(/"\)/g, ')').replace(/\(/g, ', ').replace(/\)/g, '')
: JSON.stringify(data)}`; : stringify(data)}`;
// We need some sort of cut-off here since these can be very large and // We need some sort of cut-off here since these can be very large and
// very nested, pick a number and trim the result display to it // very nested, pick a number and trim the result display to it
@@ -47,7 +47,7 @@ export class RpcCoder {
} }
public encodeJson (method: string, params: any | any[]): string { public encodeJson (method: string, params: any | any[]): string {
return JSON.stringify( return stringify(
this.encodeObject(method, params) this.encodeObject(method, params)
); );
} }
+2 -2
View File
@@ -44,7 +44,7 @@ export class HttpProvider implements ProviderInterface {
* @param {string} endpoint The endpoint url starting with http:// * @param {string} endpoint The endpoint url starting with http://
*/ */
constructor (endpoint: string = defaults.HTTP_URL, headers: Record<string, string> = {}) { constructor (endpoint: string = defaults.HTTP_URL, headers: Record<string, string> = {}) {
assert(/^(https|http):\/\//.test(endpoint), `Endpoint should start with 'http://', received '${endpoint}'`); assert(/^(https|http):\/\//.test(endpoint), () => `Endpoint should start with 'http://', received '${endpoint}'`);
this.#coder = new RpcCoder(); this.#coder = new RpcCoder();
this.#endpoint = endpoint; this.#endpoint = endpoint;
@@ -116,7 +116,7 @@ export class HttpProvider implements ProviderInterface {
method: 'POST' method: 'POST'
}); });
assert(response.ok, `[${response.status}]: ${response.statusText}`); assert(response.ok, () => `[${response.status}]: ${response.statusText}`);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const result = await response.json(); const result = await response.json();
+4 -4
View File
@@ -60,7 +60,7 @@ export class MockProvider implements ProviderInterface {
chain_getFinalizedHead: () => this.registry.createType('Header', rpcHeader.result).hash, chain_getFinalizedHead: () => this.registry.createType('Header', rpcHeader.result).hash,
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
chain_getHeader: () => this.registry.createType('Header', rpcHeader.result).toJSON(), chain_getHeader: () => this.registry.createType('Header', rpcHeader.result).toJSON(),
rpc_methods: (): string[] => [], rpc_methods: () => this.registry.createType('RpcMethods').toJSON(),
state_getKeys: (): string[] => [], state_getKeys: (): string[] => [],
state_getKeysPaged: (): string[] => [], state_getKeysPaged: (): string[] => [],
state_getMetadata: (): string => rpcMetadata, state_getMetadata: (): string => rpcMetadata,
@@ -121,7 +121,7 @@ export class MockProvider implements ProviderInterface {
// eslint-disable-next-line @typescript-eslint/require-await // eslint-disable-next-line @typescript-eslint/require-await
public async send (method: string, params: any[]): Promise<unknown> { public async send (method: string, params: any[]): Promise<unknown> {
assert(this.requests[method], `provider.send: Invalid method '${method}'`); assert(this.requests[method], () => `provider.send: Invalid method '${method}'`);
return this.requests[method](this.db, params); return this.requests[method](this.db, params);
} }
@@ -130,7 +130,7 @@ export class MockProvider implements ProviderInterface {
public async subscribe (type: string, method: string, ...params: unknown[]): Promise<number> { public async subscribe (type: string, method: string, ...params: unknown[]): Promise<number> {
l.debug((): any => ['subscribe', method, params]); l.debug((): any => ['subscribe', method, params]);
assert(this.subscriptions[method], `provider.subscribe: Invalid method '${method}'`); assert(this.subscriptions[method], () => `provider.subscribe: Invalid method '${method}'`);
const callback = params.pop() as MockStateSubscriptionCallback; const callback = params.pop() as MockStateSubscriptionCallback;
const id = ++this.subscriptionId; const id = ++this.subscriptionId;
@@ -151,7 +151,7 @@ export class MockProvider implements ProviderInterface {
l.debug((): any => ['unsubscribe', id, sub]); l.debug((): any => ['unsubscribe', id, sub]);
assert(sub, `Unable to find subscription for ${id}`); assert(sub, () => `Unable to find subscription for ${id}`);
delete this.subscriptionMap[id]; delete this.subscriptionMap[id];
delete this.subscriptions[sub].callbacks[id]; delete this.subscriptions[sub].callbacks[id];
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.4.1' }; export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.7.1' };
+2 -2
View File
@@ -38,7 +38,7 @@ const ALIASSES: { [index: string]: string } = {
chain_unsubscribeFinalisedHeads: 'chain_unsubscribeFinalizedHeads' chain_unsubscribeFinalisedHeads: 'chain_unsubscribeFinalizedHeads'
}; };
const RETRY_DELAY = 1000; const RETRY_DELAY = 2500;
const l = logger('api-ws'); const l = logger('api-ws');
@@ -109,7 +109,7 @@ export class WsProvider implements ProviderInterface {
assert(endpoints.length !== 0, 'WsProvider requires at least one Endpoint'); assert(endpoints.length !== 0, 'WsProvider requires at least one Endpoint');
endpoints.forEach((endpoint) => { endpoints.forEach((endpoint) => {
assert(/^(wss|ws):\/\//.test(endpoint), `Endpoint should start with 'ws://', received '${endpoint}'`); assert(/^(wss|ws):\/\//.test(endpoint), () => `Endpoint should start with 'ws://', received '${endpoint}'`);
}); });
this.#eventemitter = new EventEmitter(); this.#eventemitter = new EventEmitter();
+3 -1
View File
@@ -3,6 +3,8 @@
import { Server, WebSocket } from 'mock-socket'; import { Server, WebSocket } from 'mock-socket';
import { stringify } from '@polkadot/util';
interface Scope { interface Scope {
body: { [index: string]: Record<string, any> }; body: { [index: string]: Record<string, any> };
requests: number; requests: number;
@@ -79,7 +81,7 @@ export function mockWs (requests: ({ method: string } & ErrorDef)[], wsUrl: stri
scope.body[request.method] = body; scope.body[request.method] = body;
requestCount++; requestCount++;
socket.send(JSON.stringify(response)); socket.send(stringify(response));
}); });
}); });
+13 -10
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/typegen", "name": "@polkadot/typegen",
"version": "4.4.1", "version": "4.7.1",
"type": "module", "type": "module",
"description": "Type generation scripts", "description": "Type generation scripts",
"main": "index.js", "main": "index.js",
@@ -8,6 +8,9 @@
"./detectPackage.js", "./detectPackage.js",
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"engines": {
"node": ">=14.0.0"
},
"bin": { "bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs", "polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
"polkadot-types-from-chain": "./scripts/polkadot-types-from-chain.cjs", "polkadot-types-from-chain": "./scripts/polkadot-types-from-chain.cjs",
@@ -23,16 +26,16 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme",
"dependencies": { "dependencies": {
"@babel/core": "^7.13.13", "@babel/core": "^7.13.16",
"@babel/register": "^7.13.8", "@babel/register": "^7.13.16",
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/api": "4.4.1", "@polkadot/api": "4.7.1",
"@polkadot/metadata": "4.4.1", "@polkadot/metadata": "4.7.1",
"@polkadot/rpc-provider": "4.4.1", "@polkadot/rpc-provider": "4.7.1",
"@polkadot/types": "4.4.1", "@polkadot/types": "4.7.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.3.1",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
"websocket": "^1.0.33", "websocket": "^1.0.34",
"yargs": "^16.2.0" "yargs": "^16.2.0"
}, },
"devDependencies": { "devDependencies": {
+2 -2
View File
@@ -10,7 +10,7 @@ import path from 'path';
import { getTypeDef } from '@polkadot/types/create'; import { getTypeDef } from '@polkadot/types/create';
import { TypeDefInfo } from '@polkadot/types/create/types'; import { TypeDefInfo } from '@polkadot/types/create/types';
import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'; import * as defaultDefinitions from '@polkadot/types/interfaces/definitions';
import { assert, isString, stringCamelCase, stringUpperFirst } from '@polkadot/util'; import { assert, isString, stringCamelCase, stringify, stringUpperFirst } from '@polkadot/util';
import { createImports, exportInterface, exportType, formatType, readTemplate, setImports, TypeImports, writeFile } from '../util'; import { createImports, exportInterface, exportType, formatType, readTemplate, setImports, TypeImports, writeFile } from '../util';
@@ -192,7 +192,7 @@ function generateInterfaces (definitions: Record<string, ModuleTypes>, { types }
}; };
return Object.entries(types).map(([name, type]): [string, string] => { return Object.entries(types).map(([name, type]): [string, string] => {
const def = getTypeDef(isString(type) ? type : JSON.stringify(type), { name }); const def = getTypeDef(isString(type) ? type : stringify(type), { name });
return [name, generators[def.info](definitions, def, imports)]; return [name, generators[def.info](definitions, def, imports)];
}); });
+30 -11
View File
@@ -7,6 +7,7 @@ import type { Codec, DefinitionRpcParam } from '@polkadot/types/types';
import fs from 'fs'; import fs from 'fs';
import { Metadata } from '@polkadot/metadata'; import { Metadata } from '@polkadot/metadata';
import { getStorage as getSubstrateStorage } from '@polkadot/metadata/decorate/storage/getStorage';
import rpcdata from '@polkadot/metadata/static'; import rpcdata from '@polkadot/metadata/static';
import { Vec } from '@polkadot/types/codec'; import { Vec } from '@polkadot/types/codec';
import { TypeRegistry } from '@polkadot/types/create'; import { TypeRegistry } from '@polkadot/types/create';
@@ -16,15 +17,17 @@ import { Text } from '@polkadot/types/primitive';
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
import { stringCamelCase, stringLowerFirst } from '@polkadot/util'; import { stringCamelCase, stringLowerFirst } from '@polkadot/util';
interface SectionItem {
link?: string;
name: string;
[bullet: string]: undefined | string | Vec<Text>;
}
interface Section { interface Section {
link?: string; link?: string;
name: string; name: string;
description?: string; description?: string;
items: { items: SectionItem[];
link?: string;
name: string;
[bullet: string]: undefined | string | Vec<Text>;
}[];
} }
interface Page { interface Page {
@@ -156,7 +159,7 @@ function addRpc (): string {
}); });
return all; return all;
}, []).sort((a, b) => a.name.localeCompare(b.name)), }, []).sort(sortByName),
title: 'JSON-RPC' title: 'JSON-RPC'
}); });
} }
@@ -192,10 +195,11 @@ function addConstants (metadata: MetadataLatest): string {
/** @internal */ /** @internal */
function addStorage (metadata: MetadataLatest): string { function addStorage (metadata: MetadataLatest): string {
const { substrate } = getSubstrateStorage(metadata.registry, 12);
const moduleSections = metadata.modules const moduleSections = metadata.modules
.sort(sortByName) .sort(sortByName)
.filter((moduleMetadata) => !moduleMetadata.storage.isNone) .filter((moduleMetadata) => !moduleMetadata.storage.isNone)
.map((moduleMetadata) => { .map((moduleMetadata): Section => {
const sectionName = stringLowerFirst(moduleMetadata.name); const sectionName = stringLowerFirst(moduleMetadata.name);
return { return {
@@ -220,12 +224,27 @@ function addStorage (metadata: MetadataLatest): string {
}; };
}); });
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const knownSection: any = JSON.parse(fs.readFileSync('docs/substrate/storage-known-section.json', 'utf8'));
return renderPage({ return renderPage({
description: DESC_STORAGE, description: DESC_STORAGE,
sections: moduleSections.concat([knownSection]), sections: moduleSections.concat([{
description: 'These are well-known keys that are always available to the runtime implementation of any Substrate-based network.',
items: Object.entries(substrate).map(([name, { meta }]) => {
const arg = meta.type.isMap
? ('`' + meta.type.asMap.key.toString() + '`')
: meta.type.isDoubleMap
? ('`' + meta.type.asDoubleMap.key1.toString() + ', ' + meta.type.asDoubleMap.key2.toString() + '`')
: '';
const methodName = stringLowerFirst(name);
const outputType = unwrapStorageType(meta.type, meta.modifier.isOptional);
return {
interface: '`' + `api.query.substrate.${methodName}` + '`',
name: `${methodName}(${arg}): ` + '`' + outputType + '`',
summary: meta.documentation
};
}),
name: 'substrate'
}]).sort(sortByName),
title: 'Storage' title: 'Storage'
}); });
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/typegen', version: '4.4.1' }; export const packageInfo = { name: '@polkadot/typegen', version: '4.7.1' };
+2 -2
View File
@@ -12,7 +12,7 @@ import { GenericAccountId, GenericLookupSource, GenericVote } from '@polkadot/ty
import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions'; import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions';
import { Null } from '@polkadot/types/primitive'; import { Null } from '@polkadot/types/primitive';
import * as primitiveClasses from '@polkadot/types/primitive'; import * as primitiveClasses from '@polkadot/types/primitive';
import { isChildClass } from '@polkadot/util'; import { isChildClass, stringify } from '@polkadot/util';
import { isCompactEncodable } from './class'; import { isCompactEncodable } from './class';
import { formatType } from './formatting'; import { formatType } from './formatting';
@@ -98,7 +98,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
possibleTypes.push(`([${subs.join(', ')}])[]`); possibleTypes.push(`([${subs.join(', ')}])[]`);
} else { } else {
throw new Error(`Unhandled subtype in Vec, ${JSON.stringify(subDef)}`); throw new Error(`Unhandled subtype in Vec, ${stringify(subDef)}`);
} }
} }
} else if (isChildClass(Enum, Clazz)) { } else if (isChildClass(Enum, Clazz)) {
+2 -2
View File
@@ -7,7 +7,7 @@ import Handlebars from 'handlebars';
import { getTypeDef, paramsNotation } from '@polkadot/types/create'; import { getTypeDef, paramsNotation } from '@polkadot/types/create';
import { TypeDefInfo } from '@polkadot/types/create/types'; import { TypeDefInfo } from '@polkadot/types/create/types';
import { isString } from '@polkadot/util'; import { isString, stringify } from '@polkadot/util';
import { readTemplate } from './file'; import { readTemplate } from './file';
import { ModuleTypes, setImports, TypeImports } from './imports'; import { ModuleTypes, setImports, TypeImports } from './imports';
@@ -284,7 +284,7 @@ export function formatType (definitions: Record<string, ModuleTypes>, type: stri
} }
default: { default: {
throw new Error(`Cannot format ${JSON.stringify(type)}`); throw new Error(`Cannot format ${stringify(type)}`);
} }
} }
} }
+8 -5
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/types-known", "name": "@polkadot/types-known",
"version": "4.4.1", "version": "4.7.1",
"type": "module", "type": "module",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface", "description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js", "main": "index.js",
@@ -8,6 +8,9 @@
"./detectPackage.js", "./detectPackage.js",
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"engines": {
"node": ">=14.0.0"
},
"author": "Jaco Greeff <jacogr@gmail.com>", "author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [], "maintainers": [],
"contributors": [], "contributors": [],
@@ -16,10 +19,10 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/networks": "^6.0.5", "@polkadot/networks": "^6.3.1",
"@polkadot/types": "4.4.1", "@polkadot/types": "4.7.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.3.1",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
}, },
"devDependencies": { "devDependencies": {
+6
View File
@@ -72,6 +72,12 @@ const typesModules: Record<string, OverrideModuleType> = {
}, },
treasury: { treasury: {
Proposal: 'TreasuryProposal' Proposal: 'TreasuryProposal'
},
xcm: {
Outcome: 'XcmOutcome'
},
xcmPallet: {
Outcome: 'XcmOutcome'
} }
}; };
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit // Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types-known', version: '4.4.1' }; export const packageInfo = { name: '@polkadot/types-known', version: '4.7.1' };
+2
View File
@@ -9,6 +9,7 @@ import node from './node';
import nodeTemplate from './node-template'; import nodeTemplate from './node-template';
import polkadot from './polkadot'; import polkadot from './polkadot';
import rococo from './rococo'; import rococo from './rococo';
import statemint from './statemint';
import westend from './westend'; import westend from './westend';
// Type overrides for specific spec types & versions as given in runtimeVersion // Type overrides for specific spec types & versions as given in runtimeVersion
@@ -19,6 +20,7 @@ const typesSpec: Record<string, OverrideVersionedType[]> = {
'node-template': nodeTemplate, 'node-template': nodeTemplate,
polkadot, polkadot,
rococo, rococo,
statemint,
westend westend
}; };
+9 -6
View File
@@ -6,14 +6,10 @@
import type { OverrideVersionedType } from '@polkadot/types/types'; import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = { const sharedTypes = {
AccountInfo: 'AccountInfoWithDualRefCount',
Address: 'MultiAddress',
Keys: 'SessionKeys6', Keys: 'SessionKeys6',
LookupSource: 'MultiAddress',
ProxyType: { ProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy'] _enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy']
}, }
ValidatorPrefs: 'ValidatorPrefsWithBlocked'
}; };
const addrIndicesTypes = { const addrIndicesTypes = {
@@ -165,7 +161,14 @@ const versioned: OverrideVersionedType[] = [
} }
}, },
{ {
minmax: [2028, undefined], minmax: [2028, 2029],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount'
}
},
{
minmax: [2030, undefined],
types: { types: {
...sharedTypes ...sharedTypes
} }
+9 -6
View File
@@ -6,10 +6,7 @@
import type { OverrideVersionedType } from '@polkadot/types/types'; import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = { const sharedTypes = {
AccountInfo: 'AccountInfoWithDualRefCount',
Address: 'MultiAddress',
Keys: 'SessionKeys6', Keys: 'SessionKeys6',
LookupSource: 'MultiAddress',
ProxyType: { ProxyType: {
_enum: { _enum: {
Any: 0, Any: 0,
@@ -20,8 +17,7 @@ const sharedTypes = {
IdentityJudgement: 5, IdentityJudgement: 5,
CancelProxy: 6 CancelProxy: 6
} }
}, }
ValidatorPrefs: 'ValidatorPrefsWithBlocked'
}; };
const addrAccountIdTypes = { const addrAccountIdTypes = {
@@ -69,7 +65,14 @@ const versioned: OverrideVersionedType[] = [
} }
}, },
{ {
minmax: [28, undefined], minmax: [28, 29],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount'
}
},
{
minmax: [30, undefined],
types: { types: {
...sharedTypes ...sharedTypes
} }
+9 -2
View File
@@ -10,7 +10,7 @@ import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = { const sharedTypes = {
FullIdentification: '()', // No staking, only session (as per config) FullIdentification: '()', // No staking, only session (as per config)
Keys: 'SessionKeys6' Keys: 'SessionKeys7B'
}; };
const versioned: OverrideVersionedType[] = [ const versioned: OverrideVersionedType[] = [
@@ -31,7 +31,14 @@ const versioned: OverrideVersionedType[] = [
} }
}, },
{ {
minmax: [215, undefined], minmax: [215, 228],
types: {
...sharedTypes,
Keys: 'SessionKeys6'
}
},
{
minmax: [229, undefined],
types: { types: {
...sharedTypes ...sharedTypes
} }
@@ -0,0 +1,29 @@
// Copyright 2017-2021 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable sort-keys */
import type { OverrideVersionedType } from '@polkadot/types/types';
// these are override types for Polkadot
const versioned: OverrideVersionedType[] = [
{
minmax: [0, undefined],
types: {
TAssetBalance: 'u128',
ProxyType: {
_enum: [
'Any',
'NonTransfer',
'CancelProxy',
'Assets',
'AssetOwner',
'AssetManager',
'Staking'
]
}
}
}
];
export default versioned;
+10 -8
View File
@@ -6,15 +6,10 @@
import type { OverrideVersionedType } from '@polkadot/types/types'; import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = { const sharedTypes = {
AccountInfo: 'AccountInfoWithDualRefCount',
Address: 'MultiAddress',
Keys: 'SessionKeys6', Keys: 'SessionKeys6',
LookupSource: 'MultiAddress',
ProxyType: { ProxyType: {
_enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy' _enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy']
] }
},
ValidatorPrefs: 'ValidatorPrefsWithBlocked'
}; };
const addrAccountIdTypes = { const addrAccountIdTypes = {
@@ -73,7 +68,14 @@ const versioned: OverrideVersionedType[] = [
} }
}, },
{ {
minmax: [48, undefined], minmax: [48, 49],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount'
}
},
{
minmax: [50, undefined],
types: { types: {
...sharedTypes ...sharedTypes
} }
+3 -3
View File
@@ -7,7 +7,7 @@ import type { ChainUpgradesRaw } from './types';
import BN from 'bn.js'; import BN from 'bn.js';
import networks from '@polkadot/networks'; import networks from '@polkadot/networks';
import { assert, hexToU8a } from '@polkadot/util'; import { assert, hexToU8a, stringify } from '@polkadot/util';
import kusama from './kusama'; import kusama from './kusama';
import polkadot from './polkadot'; import polkadot from './polkadot';
@@ -30,7 +30,7 @@ function checkOrder (network: string, versions: ChainUpgradesRaw): [number, numb
: curr[0] <= prev[0] || curr[1] <= prev[1]; : curr[0] <= prev[0] || curr[1] <= prev[1];
}); });
assert(!ooo.length, `${network}: Mismatched upgrade ordering: ${JSON.stringify(ooo)}`); assert(!ooo.length, () => `${network}: Mismatched upgrade ordering: ${stringify(ooo)}`);
return versions; return versions;
} }
@@ -39,7 +39,7 @@ function checkOrder (network: string, versions: ChainUpgradesRaw): [number, numb
function mapRaw ([network, versions]: [string, ChainUpgradesRaw]): ChainUpgrades { function mapRaw ([network, versions]: [string, ChainUpgradesRaw]): ChainUpgrades {
const chain = networks.find((n) => n.network === network) || NET_EXTRA[network]; const chain = networks.find((n) => n.network === network) || NET_EXTRA[network];
assert(chain, `Unable to find info for chain ${network}`); assert(chain, () => `Unable to find info for chain ${network}`);
return { return {
genesisHash: hexToU8a(chain.genesisHash[0]), genesisHash: hexToU8a(chain.genesisHash[0]),
+1 -1
View File
@@ -12,7 +12,7 @@ const upgrades: ChainUpgradesRaw = [
[2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011], [2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011],
[2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022], [2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022],
[3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027], [3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027],
[6137912, 2028], [6561855, 2029] [6137912, 2028], [6561855, 2029], [7100891, 2030]
]; ];
export default upgrades; export default upgrades;
+2 -1
View File
@@ -8,7 +8,8 @@ const upgrades: ChainUpgradesRaw = [
[879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29], [879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35], [1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44], [1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49] [2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
[5124076, 50]
]; ];
export default upgrades; export default upgrades;
+10 -7
View File
@@ -1,6 +1,6 @@
{ {
"name": "@polkadot/types", "name": "@polkadot/types",
"version": "4.4.1", "version": "4.7.1",
"type": "module", "type": "module",
"description": "Implementation of the Parity codec", "description": "Implementation of the Parity codec",
"main": "index.js", "main": "index.js",
@@ -8,6 +8,9 @@
"./detectPackage.js", "./detectPackage.js",
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"engines": {
"node": ">=14.0.0"
},
"author": "Jaco Greeff <jacogr@gmail.com>", "author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [], "maintainers": [],
"contributors": [], "contributors": [],
@@ -16,15 +19,15 @@
"bugs": "https://github.com/polkadot-js/api/issues", "bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme", "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.13.10", "@babel/runtime": "^7.13.17",
"@polkadot/metadata": "4.4.1", "@polkadot/metadata": "4.7.1",
"@polkadot/util": "^6.0.5", "@polkadot/util": "^6.3.1",
"@polkadot/util-crypto": "^6.0.5", "@polkadot/util-crypto": "^6.3.1",
"@polkadot/x-rxjs": "^6.0.5", "@polkadot/x-rxjs": "^6.3.1",
"@types/bn.js": "^4.11.6", "@types/bn.js": "^4.11.6",
"bn.js": "^4.11.9" "bn.js": "^4.11.9"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^6.0.5" "@polkadot/keyring": "^6.3.1"
} }
} }
+178 -64
View File
@@ -9,6 +9,7 @@ import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interface
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
import type { BeefyCommitment, BeefyNextAuthoritySet, BeefyPayload, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims'; import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims';
@@ -33,26 +34,27 @@ import type { DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMap
import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr'; import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { StorageKind } from '@polkadot/types/interfaces/offchain';
import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AbstractFungible, AbstractNonFungible, AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Balances, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, ConcreteFungible, ConcreteNonFungible, CoreAssignment, CoreIndex, CoreOccupied, DepositAsset, DepositReserveAsset, DoubleVoteReport, DownwardMessage, ExchangeAsset, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InitiateReserveWithdraw, InitiateTeleport, Junction, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiAsset, MultiLocation, NetworkId, NewBidder, Order, OriginKind, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueryHolding, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayChainHash, RelayTo, RelayedFrom, Remark, ReserveAssetDeposit, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, SystemInherentData, TeleportAsset, Transact, TransientValidationData, UpwardMessage, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry, WithdrawAsset, Xcm, XcmError, XcmResult } from '@polkadot/types/interfaces/parachains'; import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayChainBlockNumber, RelayChainHash, Remark, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, SystemInherentData, TransientValidationData, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { Approvals } from '@polkadot/types/interfaces/poll'; import type { Approvals } from '@polkadot/types/interfaces/poll';
import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy';
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import type { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys7, SessionKeys8, SessionKeys9, ValidatorCount } from '@polkadot/types/interfaces/session'; import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking'; import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state'; import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state';
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system'; import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; import type { Multiplier } from '@polkadot/types/interfaces/txpayment';
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
import type { VestingInfo } from '@polkadot/types/interfaces/vesting'; import type { VestingInfo } from '@polkadot/types/interfaces/vesting';
import type { AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, BodyId, BodyPart, BodyPartAtLeastProportion, BodyPartFraction, BodyPartMoreThanProportion, DoubleEncodedCall, Junction, MultiAsset, MultiAssetAbstractFungible, MultiAssetAbstractNonFungible, MultiAssetConcreteFungible, MultiAssetConcreteNonFungible, MultiLocation, NetworkId, PluralityJunction, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, Xcm, XcmAssetEffects, XcmError, XcmHrmpChannelAccepted, XcmHrmpChannelClosing, XcmHrmpNewChannelOpenRequest, XcmOrder, XcmOrderBuyExecution, XcmOrderDepositAsset, XcmOrderDepositReserveAsset, XcmOrderExchangeAsset, XcmOrderInitiateReserveWithdraw, XcmOrderInitiateTeleport, XcmOrderQueryHolding, XcmOriginKind, XcmOutcome, XcmQueryResponse, XcmRelayedFrom, XcmReserveAssetDeposit, XcmResponse, XcmTeleportAsset, XcmTransact, XcmTransferAsset, XcmTransferReserveAsset, XcmWithdrawAsset } from '@polkadot/types/interfaces/xcm';
declare module '@polkadot/types/types/registry' { declare module '@polkadot/types/types/registry' {
export interface InterfaceTypes { export interface InterfaceTypes {
@@ -139,14 +141,13 @@ declare module '@polkadot/types/types/registry' {
'Compact<USize>': Compact<USize>; 'Compact<USize>': Compact<USize>;
'Compact<ValidatorCount>': Compact<ValidatorCount>; 'Compact<ValidatorCount>': Compact<ValidatorCount>;
'Compact<ValidatorIndex>': Compact<ValidatorIndex>; 'Compact<ValidatorIndex>': Compact<ValidatorIndex>;
'Compact<ValidatorSetId>': Compact<ValidatorSetId>;
'Compact<VoteIndex>': Compact<VoteIndex>; 'Compact<VoteIndex>': Compact<VoteIndex>;
'Compact<VoteWeight>': Compact<VoteWeight>; 'Compact<VoteWeight>': Compact<VoteWeight>;
'Compact<Weight>': Compact<Weight>; 'Compact<Weight>': Compact<Weight>;
'Option<AbridgedCandidateReceipt>': Option<AbridgedCandidateReceipt>; 'Option<AbridgedCandidateReceipt>': Option<AbridgedCandidateReceipt>;
'Option<AbridgedHostConfiguration>': Option<AbridgedHostConfiguration>; 'Option<AbridgedHostConfiguration>': Option<AbridgedHostConfiguration>;
'Option<AbridgedHrmpChannel>': Option<AbridgedHrmpChannel>; 'Option<AbridgedHrmpChannel>': Option<AbridgedHrmpChannel>;
'Option<AbstractFungible>': Option<AbstractFungible>;
'Option<AbstractNonFungible>': Option<AbstractNonFungible>;
'Option<AccountData>': Option<AccountData>; 'Option<AccountData>': Option<AccountData>;
'Option<AccountId>': Option<AccountId>; 'Option<AccountId>': Option<AccountId>;
'Option<AccountId32Junction>': Option<AccountId32Junction>; 'Option<AccountId32Junction>': Option<AccountId32Junction>;
@@ -209,8 +210,12 @@ declare module '@polkadot/types/types/registry' {
'Option<BalanceLock>': Option<BalanceLock>; 'Option<BalanceLock>': Option<BalanceLock>;
'Option<BalanceLockTo212>': Option<BalanceLockTo212>; 'Option<BalanceLockTo212>': Option<BalanceLockTo212>;
'Option<BalanceOf>': Option<BalanceOf>; 'Option<BalanceOf>': Option<BalanceOf>;
'Option<Balances>': Option<Balances>;
'Option<BalanceStatus>': Option<BalanceStatus>; 'Option<BalanceStatus>': Option<BalanceStatus>;
'Option<BeefyCommitment>': Option<BeefyCommitment>;
'Option<BeefyKey>': Option<BeefyKey>;
'Option<BeefyNextAuthoritySet>': Option<BeefyNextAuthoritySet>;
'Option<BeefyPayload>': Option<BeefyPayload>;
'Option<BeefySignedCommitment>': Option<BeefySignedCommitment>;
'Option<Bid>': Option<Bid>; 'Option<Bid>': Option<Bid>;
'Option<Bidder>': Option<Bidder>; 'Option<Bidder>': Option<Bidder>;
'Option<BidKind>': Option<BidKind>; 'Option<BidKind>': Option<BidKind>;
@@ -221,6 +226,11 @@ declare module '@polkadot/types/types/registry' {
'Option<BlockLength>': Option<BlockLength>; 'Option<BlockLength>': Option<BlockLength>;
'Option<BlockNumber>': Option<BlockNumber>; 'Option<BlockNumber>': Option<BlockNumber>;
'Option<BlockWeights>': Option<BlockWeights>; 'Option<BlockWeights>': Option<BlockWeights>;
'Option<BodyId>': Option<BodyId>;
'Option<BodyPart>': Option<BodyPart>;
'Option<BodyPartAtLeastProportion>': Option<BodyPartAtLeastProportion>;
'Option<BodyPartFraction>': Option<BodyPartFraction>;
'Option<BodyPartMoreThanProportion>': Option<BodyPartMoreThanProportion>;
'Option<bool>': Option<bool>; 'Option<bool>': Option<bool>;
'Option<Bool>': Option<Bool>; 'Option<Bool>': Option<Bool>;
'Option<Bounty>': Option<Bounty>; 'Option<Bounty>': Option<Bounty>;
@@ -253,8 +263,6 @@ declare module '@polkadot/types/types/registry' {
'Option<CompactAssignmentsTo257>': Option<CompactAssignmentsTo257>; 'Option<CompactAssignmentsTo257>': Option<CompactAssignmentsTo257>;
'Option<CompactScore>': Option<CompactScore>; 'Option<CompactScore>': Option<CompactScore>;
'Option<CompactScoreCompact>': Option<CompactScoreCompact>; 'Option<CompactScoreCompact>': Option<CompactScoreCompact>;
'Option<ConcreteFungible>': Option<ConcreteFungible>;
'Option<ConcreteNonFungible>': Option<ConcreteNonFungible>;
'Option<Consensus>': Option<Consensus>; 'Option<Consensus>': Option<Consensus>;
'Option<ConsensusEngineId>': Option<ConsensusEngineId>; 'Option<ConsensusEngineId>': Option<ConsensusEngineId>;
'Option<ConsumedWeight>': Option<ConsumedWeight>; 'Option<ConsumedWeight>': Option<ConsumedWeight>;
@@ -303,8 +311,6 @@ declare module '@polkadot/types/types/registry' {
'Option<DefunctVoter>': Option<DefunctVoter>; 'Option<DefunctVoter>': Option<DefunctVoter>;
'Option<Delegations>': Option<Delegations>; 'Option<Delegations>': Option<Delegations>;
'Option<DeletedContract>': Option<DeletedContract>; 'Option<DeletedContract>': Option<DeletedContract>;
'Option<DepositAsset>': Option<DepositAsset>;
'Option<DepositReserveAsset>': Option<DepositReserveAsset>;
'Option<Digest>': Option<Digest>; 'Option<Digest>': Option<Digest>;
'Option<DigestItem>': Option<DigestItem>; 'Option<DigestItem>': Option<DigestItem>;
'Option<DigestOf>': Option<DigestOf>; 'Option<DigestOf>': Option<DigestOf>;
@@ -319,7 +325,10 @@ declare module '@polkadot/types/types/registry' {
'Option<DispatchResult>': Option<DispatchResult>; 'Option<DispatchResult>': Option<DispatchResult>;
'Option<DispatchResultOf>': Option<DispatchResultOf>; 'Option<DispatchResultOf>': Option<DispatchResultOf>;
'Option<DispatchResultTo198>': Option<DispatchResultTo198>; 'Option<DispatchResultTo198>': Option<DispatchResultTo198>;
'Option<DisputeStatement>': Option<DisputeStatement>;
'Option<DisputeStatementSet>': Option<DisputeStatementSet>;
'Option<DoNotConstruct>': Option<DoNotConstruct>; 'Option<DoNotConstruct>': Option<DoNotConstruct>;
'Option<DoubleEncodedCall>': Option<DoubleEncodedCall>;
'Option<DoubleMapTypeLatest>': Option<DoubleMapTypeLatest>; 'Option<DoubleMapTypeLatest>': Option<DoubleMapTypeLatest>;
'Option<DoubleMapTypeV10>': Option<DoubleMapTypeV10>; 'Option<DoubleMapTypeV10>': Option<DoubleMapTypeV10>;
'Option<DoubleMapTypeV11>': Option<DoubleMapTypeV11>; 'Option<DoubleMapTypeV11>': Option<DoubleMapTypeV11>;
@@ -390,12 +399,12 @@ declare module '@polkadot/types/types/registry' {
'Option<EvmAccount>': Option<EvmAccount>; 'Option<EvmAccount>': Option<EvmAccount>;
'Option<EvmLog>': Option<EvmLog>; 'Option<EvmLog>': Option<EvmLog>;
'Option<EvmVicinity>': Option<EvmVicinity>; 'Option<EvmVicinity>': Option<EvmVicinity>;
'Option<ExchangeAsset>': Option<ExchangeAsset>;
'Option<ExitError>': Option<ExitError>; 'Option<ExitError>': Option<ExitError>;
'Option<ExitFatal>': Option<ExitFatal>; 'Option<ExitFatal>': Option<ExitFatal>;
'Option<ExitReason>': Option<ExitReason>; 'Option<ExitReason>': Option<ExitReason>;
'Option<ExitRevert>': Option<ExitRevert>; 'Option<ExitRevert>': Option<ExitRevert>;
'Option<ExitSucceed>': Option<ExitSucceed>; 'Option<ExitSucceed>': Option<ExitSucceed>;
'Option<ExplicitDisputeStatement>': Option<ExplicitDisputeStatement>;
'Option<Exposure>': Option<Exposure>; 'Option<Exposure>': Option<Exposure>;
'Option<ExtendedBalance>': Option<ExtendedBalance>; 'Option<ExtendedBalance>': Option<ExtendedBalance>;
'Option<Extrinsic>': Option<Extrinsic>; 'Option<Extrinsic>': Option<Extrinsic>;
@@ -436,6 +445,7 @@ declare module '@polkadot/types/types/registry' {
'Option<FundInfo>': Option<FundInfo>; 'Option<FundInfo>': Option<FundInfo>;
'Option<Gas>': Option<Gas>; 'Option<Gas>': Option<Gas>;
'Option<GiltBid>': Option<GiltBid>; 'Option<GiltBid>': Option<GiltBid>;
'Option<GlobalValidationData>': Option<GlobalValidationData>;
'Option<GlobalValidationSchedule>': Option<GlobalValidationSchedule>; 'Option<GlobalValidationSchedule>': Option<GlobalValidationSchedule>;
'Option<GrandpaEquivocation>': Option<GrandpaEquivocation>; 'Option<GrandpaEquivocation>': Option<GrandpaEquivocation>;
'Option<GrandpaEquivocationProof>': Option<GrandpaEquivocationProof>; 'Option<GrandpaEquivocationProof>': Option<GrandpaEquivocationProof>;
@@ -492,9 +502,8 @@ declare module '@polkadot/types/types/registry' {
'Option<Index>': Option<Index>; 'Option<Index>': Option<Index>;
'Option<IndicesLookupSource>': Option<IndicesLookupSource>; 'Option<IndicesLookupSource>': Option<IndicesLookupSource>;
'Option<IndividualExposure>': Option<IndividualExposure>; 'Option<IndividualExposure>': Option<IndividualExposure>;
'Option<InitiateReserveWithdraw>': Option<InitiateReserveWithdraw>;
'Option<InitiateTeleport>': Option<InitiateTeleport>;
'Option<InstructionWeights>': Option<InstructionWeights>; 'Option<InstructionWeights>': Option<InstructionWeights>;
'Option<InvalidDisputeStatementKind>': Option<InvalidDisputeStatementKind>;
'Option<InvalidTransaction>': Option<InvalidTransaction>; 'Option<InvalidTransaction>': Option<InvalidTransaction>;
'Option<Json>': Option<Json>; 'Option<Json>': Option<Json>;
'Option<Junction>': Option<Junction>; 'Option<Junction>': Option<Junction>;
@@ -540,6 +549,7 @@ declare module '@polkadot/types/types/registry' {
'Option<MetadataV12>': Option<MetadataV12>; 'Option<MetadataV12>': Option<MetadataV12>;
'Option<MetadataV9>': Option<MetadataV9>; 'Option<MetadataV9>': Option<MetadataV9>;
'Option<MmrLeafProof>': Option<MmrLeafProof>; 'Option<MmrLeafProof>': Option<MmrLeafProof>;
'Option<MmrRootHash>': Option<MmrRootHash>;
'Option<ModuleConstantMetadataLatest>': Option<ModuleConstantMetadataLatest>; 'Option<ModuleConstantMetadataLatest>': Option<ModuleConstantMetadataLatest>;
'Option<ModuleConstantMetadataV10>': Option<ModuleConstantMetadataV10>; 'Option<ModuleConstantMetadataV10>': Option<ModuleConstantMetadataV10>;
'Option<ModuleConstantMetadataV11>': Option<ModuleConstantMetadataV11>; 'Option<ModuleConstantMetadataV11>': Option<ModuleConstantMetadataV11>;
@@ -557,6 +567,11 @@ declare module '@polkadot/types/types/registry' {
'Option<MortalEra>': Option<MortalEra>; 'Option<MortalEra>': Option<MortalEra>;
'Option<MultiAddress>': Option<MultiAddress>; 'Option<MultiAddress>': Option<MultiAddress>;
'Option<MultiAsset>': Option<MultiAsset>; 'Option<MultiAsset>': Option<MultiAsset>;
'Option<MultiAssetAbstractFungible>': Option<MultiAssetAbstractFungible>;
'Option<MultiAssetAbstractNonFungible>': Option<MultiAssetAbstractNonFungible>;
'Option<MultiAssetConcreteFungible>': Option<MultiAssetConcreteFungible>;
'Option<MultiAssetConcreteNonFungible>': Option<MultiAssetConcreteNonFungible>;
'Option<MultiDisputeStatementSet>': Option<MultiDisputeStatementSet>;
'Option<MultiLocation>': Option<MultiLocation>; 'Option<MultiLocation>': Option<MultiLocation>;
'Option<Multiplier>': Option<Multiplier>; 'Option<Multiplier>': Option<Multiplier>;
'Option<Multisig>': Option<Multisig>; 'Option<Multisig>': Option<Multisig>;
@@ -589,17 +604,17 @@ declare module '@polkadot/types/types/registry' {
'Option<OpenTipFinderTo225>': Option<OpenTipFinderTo225>; 'Option<OpenTipFinderTo225>': Option<OpenTipFinderTo225>;
'Option<OpenTipTip>': Option<OpenTipTip>; 'Option<OpenTipTip>': Option<OpenTipTip>;
'Option<OpenTipTo225>': Option<OpenTipTo225>; 'Option<OpenTipTo225>': Option<OpenTipTo225>;
'Option<Order>': Option<Order>;
'Option<Origin>': Option<Origin>; 'Option<Origin>': Option<Origin>;
'Option<OriginCaller>': Option<OriginCaller>; 'Option<OriginCaller>': Option<OriginCaller>;
'Option<OriginKind>': Option<OriginKind>;
'Option<OutboundHrmpMessage>': Option<OutboundHrmpMessage>; 'Option<OutboundHrmpMessage>': Option<OutboundHrmpMessage>;
'Option<Owner>': Option<Owner>; 'Option<Owner>': Option<Owner>;
'Option<PalletId>': Option<PalletId>;
'Option<PalletsOrigin>': Option<PalletsOrigin>; 'Option<PalletsOrigin>': Option<PalletsOrigin>;
'Option<PalletVersion>': Option<PalletVersion>; 'Option<PalletVersion>': Option<PalletVersion>;
'Option<ParachainDispatchOrigin>': Option<ParachainDispatchOrigin>; 'Option<ParachainDispatchOrigin>': Option<ParachainDispatchOrigin>;
'Option<ParachainInherentData>': Option<ParachainInherentData>; 'Option<ParachainInherentData>': Option<ParachainInherentData>;
'Option<ParachainProposal>': Option<ParachainProposal>; 'Option<ParachainProposal>': Option<ParachainProposal>;
'Option<ParachainsInherentData>': Option<ParachainsInherentData>;
'Option<ParaGenesisArgs>': Option<ParaGenesisArgs>; 'Option<ParaGenesisArgs>': Option<ParaGenesisArgs>;
'Option<ParaId>': Option<ParaId>; 'Option<ParaId>': Option<ParaId>;
'Option<ParaInfo>': Option<ParaInfo>; 'Option<ParaInfo>': Option<ParaInfo>;
@@ -635,6 +650,7 @@ declare module '@polkadot/types/types/registry' {
'Option<PhantomData>': Option<PhantomData>; 'Option<PhantomData>': Option<PhantomData>;
'Option<Phase>': Option<Phase>; 'Option<Phase>': Option<Phase>;
'Option<PhragmenScore>': Option<PhragmenScore>; 'Option<PhragmenScore>': Option<PhragmenScore>;
'Option<PluralityJunction>': Option<PluralityJunction>;
'Option<Points>': Option<Points>; 'Option<Points>': Option<Points>;
'Option<Precommits>': Option<Precommits>; 'Option<Precommits>': Option<Precommits>;
'Option<PrefabWasmModule>': Option<PrefabWasmModule>; 'Option<PrefabWasmModule>': Option<PrefabWasmModule>;
@@ -652,7 +668,6 @@ declare module '@polkadot/types/types/registry' {
'Option<ProxyDefinition>': Option<ProxyDefinition>; 'Option<ProxyDefinition>': Option<ProxyDefinition>;
'Option<ProxyState>': Option<ProxyState>; 'Option<ProxyState>': Option<ProxyState>;
'Option<ProxyType>': Option<ProxyType>; 'Option<ProxyType>': Option<ProxyType>;
'Option<QueryHolding>': Option<QueryHolding>;
'Option<QueuedParathread>': Option<QueuedParathread>; 'Option<QueuedParathread>': Option<QueuedParathread>;
'Option<Randomness>': Option<Randomness>; 'Option<Randomness>': Option<Randomness>;
'Option<Raw>': Option<Raw>; 'Option<Raw>': Option<Raw>;
@@ -686,15 +701,12 @@ declare module '@polkadot/types/types/registry' {
'Option<RegistrationJudgement>': Option<RegistrationJudgement>; 'Option<RegistrationJudgement>': Option<RegistrationJudgement>;
'Option<RelayChainBlockNumber>': Option<RelayChainBlockNumber>; 'Option<RelayChainBlockNumber>': Option<RelayChainBlockNumber>;
'Option<RelayChainHash>': Option<RelayChainHash>; 'Option<RelayChainHash>': Option<RelayChainHash>;
'Option<RelayedFrom>': Option<RelayedFrom>;
'Option<RelayTo>': Option<RelayTo>;
'Option<Releases>': Option<Releases>; 'Option<Releases>': Option<Releases>;
'Option<Remark>': Option<Remark>; 'Option<Remark>': Option<Remark>;
'Option<Renouncing>': Option<Renouncing>; 'Option<Renouncing>': Option<Renouncing>;
'Option<ReportedRoundStates>': Option<ReportedRoundStates>; 'Option<ReportedRoundStates>': Option<ReportedRoundStates>;
'Option<Reporter>': Option<Reporter>; 'Option<Reporter>': Option<Reporter>;
'Option<ReportIdOf>': Option<ReportIdOf>; 'Option<ReportIdOf>': Option<ReportIdOf>;
'Option<ReserveAssetDeposit>': Option<ReserveAssetDeposit>;
'Option<Retriable>': Option<Retriable>; 'Option<Retriable>': Option<Retriable>;
'Option<RewardDestination>': Option<RewardDestination>; 'Option<RewardDestination>': Option<RewardDestination>;
'Option<RewardPoint>': Option<RewardPoint>; 'Option<RewardPoint>': Option<RewardPoint>;
@@ -723,14 +735,20 @@ declare module '@polkadot/types/types/registry' {
'Option<SessionInfo>': Option<SessionInfo>; 'Option<SessionInfo>': Option<SessionInfo>;
'Option<SessionInfoValidatorGroup>': Option<SessionInfoValidatorGroup>; 'Option<SessionInfoValidatorGroup>': Option<SessionInfoValidatorGroup>;
'Option<SessionKeys1>': Option<SessionKeys1>; 'Option<SessionKeys1>': Option<SessionKeys1>;
'Option<SessionKeys10>': Option<SessionKeys10>;
'Option<SessionKeys10B>': Option<SessionKeys10B>;
'Option<SessionKeys2>': Option<SessionKeys2>; 'Option<SessionKeys2>': Option<SessionKeys2>;
'Option<SessionKeys3>': Option<SessionKeys3>; 'Option<SessionKeys3>': Option<SessionKeys3>;
'Option<SessionKeys4>': Option<SessionKeys4>; 'Option<SessionKeys4>': Option<SessionKeys4>;
'Option<SessionKeys5>': Option<SessionKeys5>; 'Option<SessionKeys5>': Option<SessionKeys5>;
'Option<SessionKeys6>': Option<SessionKeys6>; 'Option<SessionKeys6>': Option<SessionKeys6>;
'Option<SessionKeys6B>': Option<SessionKeys6B>;
'Option<SessionKeys7>': Option<SessionKeys7>; 'Option<SessionKeys7>': Option<SessionKeys7>;
'Option<SessionKeys7B>': Option<SessionKeys7B>;
'Option<SessionKeys8>': Option<SessionKeys8>; 'Option<SessionKeys8>': Option<SessionKeys8>;
'Option<SessionKeys8B>': Option<SessionKeys8B>;
'Option<SessionKeys9>': Option<SessionKeys9>; 'Option<SessionKeys9>': Option<SessionKeys9>;
'Option<SessionKeys9B>': Option<SessionKeys9B>;
'Option<SetId>': Option<SetId>; 'Option<SetId>': Option<SetId>;
'Option<SetIndex>': Option<SetIndex>; 'Option<SetIndex>': Option<SetIndex>;
'Option<SiField>': Option<SiField>; 'Option<SiField>': Option<SiField>;
@@ -813,11 +831,10 @@ declare module '@polkadot/types/types/registry' {
'Option<TaskAddress>': Option<TaskAddress>; 'Option<TaskAddress>': Option<TaskAddress>;
'Option<TAssetBalance>': Option<TAssetBalance>; 'Option<TAssetBalance>': Option<TAssetBalance>;
'Option<TAssetDepositBalance>': Option<TAssetDepositBalance>; 'Option<TAssetDepositBalance>': Option<TAssetDepositBalance>;
'Option<TeleportAsset>': Option<TeleportAsset>;
'Option<Text>': Option<Text>; 'Option<Text>': Option<Text>;
'Option<Timepoint>': Option<Timepoint>; 'Option<Timepoint>': Option<Timepoint>;
'Option<TokenError>': Option<TokenError>;
'Option<TombstoneContractInfo>': Option<TombstoneContractInfo>; 'Option<TombstoneContractInfo>': Option<TombstoneContractInfo>;
'Option<Transact>': Option<Transact>;
'Option<TransactionPriority>': Option<TransactionPriority>; 'Option<TransactionPriority>': Option<TransactionPriority>;
'Option<TransactionValidityError>': Option<TransactionValidityError>; 'Option<TransactionValidityError>': Option<TransactionValidityError>;
'Option<TransientValidationData>': Option<TransientValidationData>; 'Option<TransientValidationData>': Option<TransientValidationData>;
@@ -860,7 +877,9 @@ declare module '@polkadot/types/types/registry' {
'Option<ValidatorPrefsTo196>': Option<ValidatorPrefsTo196>; 'Option<ValidatorPrefsTo196>': Option<ValidatorPrefsTo196>;
'Option<ValidatorPrefsWithBlocked>': Option<ValidatorPrefsWithBlocked>; 'Option<ValidatorPrefsWithBlocked>': Option<ValidatorPrefsWithBlocked>;
'Option<ValidatorPrefsWithCommission>': Option<ValidatorPrefsWithCommission>; 'Option<ValidatorPrefsWithCommission>': Option<ValidatorPrefsWithCommission>;
'Option<ValidatorSetId>': Option<ValidatorSetId>;
'Option<ValidatorSignature>': Option<ValidatorSignature>; 'Option<ValidatorSignature>': Option<ValidatorSignature>;
'Option<ValidDisputeStatementKind>': Option<ValidDisputeStatementKind>;
'Option<ValidityAttestation>': Option<ValidityAttestation>; 'Option<ValidityAttestation>': Option<ValidityAttestation>;
'Option<VecInboundHrmpMessage>': Option<VecInboundHrmpMessage>; 'Option<VecInboundHrmpMessage>': Option<VecInboundHrmpMessage>;
'Option<VersionedMultiAsset>': Option<VersionedMultiAsset>; 'Option<VersionedMultiAsset>': Option<VersionedMultiAsset>;
@@ -892,16 +911,35 @@ declare module '@polkadot/types/types/registry' {
'Option<WinnersDataTuple>': Option<WinnersDataTuple>; 'Option<WinnersDataTuple>': Option<WinnersDataTuple>;
'Option<WinningData>': Option<WinningData>; 'Option<WinningData>': Option<WinningData>;
'Option<WinningDataEntry>': Option<WinningDataEntry>; 'Option<WinningDataEntry>': Option<WinningDataEntry>;
'Option<WithdrawAsset>': Option<WithdrawAsset>;
'Option<WithdrawReasons>': Option<WithdrawReasons>; 'Option<WithdrawReasons>': Option<WithdrawReasons>;
'Option<Xcm>': Option<Xcm>; 'Option<Xcm>': Option<Xcm>;
'Option<XcmAssetEffects>': Option<XcmAssetEffects>;
'Option<XcmError>': Option<XcmError>; 'Option<XcmError>': Option<XcmError>;
'Option<XcmResult>': Option<XcmResult>; 'Option<XcmHrmpChannelAccepted>': Option<XcmHrmpChannelAccepted>;
'Option<XcmHrmpChannelClosing>': Option<XcmHrmpChannelClosing>;
'Option<XcmHrmpNewChannelOpenRequest>': Option<XcmHrmpNewChannelOpenRequest>;
'Option<XcmOrder>': Option<XcmOrder>;
'Option<XcmOrderBuyExecution>': Option<XcmOrderBuyExecution>;
'Option<XcmOrderDepositAsset>': Option<XcmOrderDepositAsset>;
'Option<XcmOrderDepositReserveAsset>': Option<XcmOrderDepositReserveAsset>;
'Option<XcmOrderExchangeAsset>': Option<XcmOrderExchangeAsset>;
'Option<XcmOrderInitiateReserveWithdraw>': Option<XcmOrderInitiateReserveWithdraw>;
'Option<XcmOrderInitiateTeleport>': Option<XcmOrderInitiateTeleport>;
'Option<XcmOrderQueryHolding>': Option<XcmOrderQueryHolding>;
'Option<XcmOriginKind>': Option<XcmOriginKind>;
'Option<XcmOutcome>': Option<XcmOutcome>;
'Option<XcmQueryResponse>': Option<XcmQueryResponse>;
'Option<XcmRelayedFrom>': Option<XcmRelayedFrom>;
'Option<XcmReserveAssetDeposit>': Option<XcmReserveAssetDeposit>;
'Option<XcmResponse>': Option<XcmResponse>;
'Option<XcmTeleportAsset>': Option<XcmTeleportAsset>;
'Option<XcmTransact>': Option<XcmTransact>;
'Option<XcmTransferAsset>': Option<XcmTransferAsset>;
'Option<XcmTransferReserveAsset>': Option<XcmTransferReserveAsset>;
'Option<XcmWithdrawAsset>': Option<XcmWithdrawAsset>;
'Vec<AbridgedCandidateReceipt>': Vec<AbridgedCandidateReceipt>; 'Vec<AbridgedCandidateReceipt>': Vec<AbridgedCandidateReceipt>;
'Vec<AbridgedHostConfiguration>': Vec<AbridgedHostConfiguration>; 'Vec<AbridgedHostConfiguration>': Vec<AbridgedHostConfiguration>;
'Vec<AbridgedHrmpChannel>': Vec<AbridgedHrmpChannel>; 'Vec<AbridgedHrmpChannel>': Vec<AbridgedHrmpChannel>;
'Vec<AbstractFungible>': Vec<AbstractFungible>;
'Vec<AbstractNonFungible>': Vec<AbstractNonFungible>;
'Vec<AccountData>': Vec<AccountData>; 'Vec<AccountData>': Vec<AccountData>;
'Vec<AccountId>': Vec<AccountId>; 'Vec<AccountId>': Vec<AccountId>;
'Vec<AccountId32Junction>': Vec<AccountId32Junction>; 'Vec<AccountId32Junction>': Vec<AccountId32Junction>;
@@ -964,8 +1002,12 @@ declare module '@polkadot/types/types/registry' {
'Vec<BalanceLock>': Vec<BalanceLock>; 'Vec<BalanceLock>': Vec<BalanceLock>;
'Vec<BalanceLockTo212>': Vec<BalanceLockTo212>; 'Vec<BalanceLockTo212>': Vec<BalanceLockTo212>;
'Vec<BalanceOf>': Vec<BalanceOf>; 'Vec<BalanceOf>': Vec<BalanceOf>;
'Vec<Balances>': Vec<Balances>;
'Vec<BalanceStatus>': Vec<BalanceStatus>; 'Vec<BalanceStatus>': Vec<BalanceStatus>;
'Vec<BeefyCommitment>': Vec<BeefyCommitment>;
'Vec<BeefyKey>': Vec<BeefyKey>;
'Vec<BeefyNextAuthoritySet>': Vec<BeefyNextAuthoritySet>;
'Vec<BeefyPayload>': Vec<BeefyPayload>;
'Vec<BeefySignedCommitment>': Vec<BeefySignedCommitment>;
'Vec<Bid>': Vec<Bid>; 'Vec<Bid>': Vec<Bid>;
'Vec<Bidder>': Vec<Bidder>; 'Vec<Bidder>': Vec<Bidder>;
'Vec<BidKind>': Vec<BidKind>; 'Vec<BidKind>': Vec<BidKind>;
@@ -976,6 +1018,11 @@ declare module '@polkadot/types/types/registry' {
'Vec<BlockLength>': Vec<BlockLength>; 'Vec<BlockLength>': Vec<BlockLength>;
'Vec<BlockNumber>': Vec<BlockNumber>; 'Vec<BlockNumber>': Vec<BlockNumber>;
'Vec<BlockWeights>': Vec<BlockWeights>; 'Vec<BlockWeights>': Vec<BlockWeights>;
'Vec<BodyId>': Vec<BodyId>;
'Vec<BodyPart>': Vec<BodyPart>;
'Vec<BodyPartAtLeastProportion>': Vec<BodyPartAtLeastProportion>;
'Vec<BodyPartFraction>': Vec<BodyPartFraction>;
'Vec<BodyPartMoreThanProportion>': Vec<BodyPartMoreThanProportion>;
'Vec<bool>': Vec<bool>; 'Vec<bool>': Vec<bool>;
'Vec<Bool>': Vec<Bool>; 'Vec<Bool>': Vec<Bool>;
'Vec<Bounty>': Vec<Bounty>; 'Vec<Bounty>': Vec<Bounty>;
@@ -1008,8 +1055,6 @@ declare module '@polkadot/types/types/registry' {
'Vec<CompactAssignmentsTo257>': Vec<CompactAssignmentsTo257>; 'Vec<CompactAssignmentsTo257>': Vec<CompactAssignmentsTo257>;
'Vec<CompactScore>': Vec<CompactScore>; 'Vec<CompactScore>': Vec<CompactScore>;
'Vec<CompactScoreCompact>': Vec<CompactScoreCompact>; 'Vec<CompactScoreCompact>': Vec<CompactScoreCompact>;
'Vec<ConcreteFungible>': Vec<ConcreteFungible>;
'Vec<ConcreteNonFungible>': Vec<ConcreteNonFungible>;
'Vec<Consensus>': Vec<Consensus>; 'Vec<Consensus>': Vec<Consensus>;
'Vec<ConsensusEngineId>': Vec<ConsensusEngineId>; 'Vec<ConsensusEngineId>': Vec<ConsensusEngineId>;
'Vec<ConsumedWeight>': Vec<ConsumedWeight>; 'Vec<ConsumedWeight>': Vec<ConsumedWeight>;
@@ -1058,8 +1103,6 @@ declare module '@polkadot/types/types/registry' {
'Vec<DefunctVoter>': Vec<DefunctVoter>; 'Vec<DefunctVoter>': Vec<DefunctVoter>;
'Vec<Delegations>': Vec<Delegations>; 'Vec<Delegations>': Vec<Delegations>;
'Vec<DeletedContract>': Vec<DeletedContract>; 'Vec<DeletedContract>': Vec<DeletedContract>;
'Vec<DepositAsset>': Vec<DepositAsset>;
'Vec<DepositReserveAsset>': Vec<DepositReserveAsset>;
'Vec<Digest>': Vec<Digest>; 'Vec<Digest>': Vec<Digest>;
'Vec<DigestItem>': Vec<DigestItem>; 'Vec<DigestItem>': Vec<DigestItem>;
'Vec<DigestOf>': Vec<DigestOf>; 'Vec<DigestOf>': Vec<DigestOf>;
@@ -1074,7 +1117,10 @@ declare module '@polkadot/types/types/registry' {
'Vec<DispatchResult>': Vec<DispatchResult>; 'Vec<DispatchResult>': Vec<DispatchResult>;
'Vec<DispatchResultOf>': Vec<DispatchResultOf>; 'Vec<DispatchResultOf>': Vec<DispatchResultOf>;
'Vec<DispatchResultTo198>': Vec<DispatchResultTo198>; 'Vec<DispatchResultTo198>': Vec<DispatchResultTo198>;
'Vec<DisputeStatement>': Vec<DisputeStatement>;
'Vec<DisputeStatementSet>': Vec<DisputeStatementSet>;
'Vec<DoNotConstruct>': Vec<DoNotConstruct>; 'Vec<DoNotConstruct>': Vec<DoNotConstruct>;
'Vec<DoubleEncodedCall>': Vec<DoubleEncodedCall>;
'Vec<DoubleMapTypeLatest>': Vec<DoubleMapTypeLatest>; 'Vec<DoubleMapTypeLatest>': Vec<DoubleMapTypeLatest>;
'Vec<DoubleMapTypeV10>': Vec<DoubleMapTypeV10>; 'Vec<DoubleMapTypeV10>': Vec<DoubleMapTypeV10>;
'Vec<DoubleMapTypeV11>': Vec<DoubleMapTypeV11>; 'Vec<DoubleMapTypeV11>': Vec<DoubleMapTypeV11>;
@@ -1145,12 +1191,12 @@ declare module '@polkadot/types/types/registry' {
'Vec<EvmAccount>': Vec<EvmAccount>; 'Vec<EvmAccount>': Vec<EvmAccount>;
'Vec<EvmLog>': Vec<EvmLog>; 'Vec<EvmLog>': Vec<EvmLog>;
'Vec<EvmVicinity>': Vec<EvmVicinity>; 'Vec<EvmVicinity>': Vec<EvmVicinity>;
'Vec<ExchangeAsset>': Vec<ExchangeAsset>;
'Vec<ExitError>': Vec<ExitError>; 'Vec<ExitError>': Vec<ExitError>;
'Vec<ExitFatal>': Vec<ExitFatal>; 'Vec<ExitFatal>': Vec<ExitFatal>;
'Vec<ExitReason>': Vec<ExitReason>; 'Vec<ExitReason>': Vec<ExitReason>;
'Vec<ExitRevert>': Vec<ExitRevert>; 'Vec<ExitRevert>': Vec<ExitRevert>;
'Vec<ExitSucceed>': Vec<ExitSucceed>; 'Vec<ExitSucceed>': Vec<ExitSucceed>;
'Vec<ExplicitDisputeStatement>': Vec<ExplicitDisputeStatement>;
'Vec<Exposure>': Vec<Exposure>; 'Vec<Exposure>': Vec<Exposure>;
'Vec<ExtendedBalance>': Vec<ExtendedBalance>; 'Vec<ExtendedBalance>': Vec<ExtendedBalance>;
'Vec<Extrinsic>': Vec<Extrinsic>; 'Vec<Extrinsic>': Vec<Extrinsic>;
@@ -1191,6 +1237,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<FundInfo>': Vec<FundInfo>; 'Vec<FundInfo>': Vec<FundInfo>;
'Vec<Gas>': Vec<Gas>; 'Vec<Gas>': Vec<Gas>;
'Vec<GiltBid>': Vec<GiltBid>; 'Vec<GiltBid>': Vec<GiltBid>;
'Vec<GlobalValidationData>': Vec<GlobalValidationData>;
'Vec<GlobalValidationSchedule>': Vec<GlobalValidationSchedule>; 'Vec<GlobalValidationSchedule>': Vec<GlobalValidationSchedule>;
'Vec<GrandpaEquivocation>': Vec<GrandpaEquivocation>; 'Vec<GrandpaEquivocation>': Vec<GrandpaEquivocation>;
'Vec<GrandpaEquivocationProof>': Vec<GrandpaEquivocationProof>; 'Vec<GrandpaEquivocationProof>': Vec<GrandpaEquivocationProof>;
@@ -1247,9 +1294,8 @@ declare module '@polkadot/types/types/registry' {
'Vec<Index>': Vec<Index>; 'Vec<Index>': Vec<Index>;
'Vec<IndicesLookupSource>': Vec<IndicesLookupSource>; 'Vec<IndicesLookupSource>': Vec<IndicesLookupSource>;
'Vec<IndividualExposure>': Vec<IndividualExposure>; 'Vec<IndividualExposure>': Vec<IndividualExposure>;
'Vec<InitiateReserveWithdraw>': Vec<InitiateReserveWithdraw>;
'Vec<InitiateTeleport>': Vec<InitiateTeleport>;
'Vec<InstructionWeights>': Vec<InstructionWeights>; 'Vec<InstructionWeights>': Vec<InstructionWeights>;
'Vec<InvalidDisputeStatementKind>': Vec<InvalidDisputeStatementKind>;
'Vec<InvalidTransaction>': Vec<InvalidTransaction>; 'Vec<InvalidTransaction>': Vec<InvalidTransaction>;
'Vec<Json>': Vec<Json>; 'Vec<Json>': Vec<Json>;
'Vec<Junction>': Vec<Junction>; 'Vec<Junction>': Vec<Junction>;
@@ -1295,6 +1341,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<MetadataV12>': Vec<MetadataV12>; 'Vec<MetadataV12>': Vec<MetadataV12>;
'Vec<MetadataV9>': Vec<MetadataV9>; 'Vec<MetadataV9>': Vec<MetadataV9>;
'Vec<MmrLeafProof>': Vec<MmrLeafProof>; 'Vec<MmrLeafProof>': Vec<MmrLeafProof>;
'Vec<MmrRootHash>': Vec<MmrRootHash>;
'Vec<ModuleConstantMetadataLatest>': Vec<ModuleConstantMetadataLatest>; 'Vec<ModuleConstantMetadataLatest>': Vec<ModuleConstantMetadataLatest>;
'Vec<ModuleConstantMetadataV10>': Vec<ModuleConstantMetadataV10>; 'Vec<ModuleConstantMetadataV10>': Vec<ModuleConstantMetadataV10>;
'Vec<ModuleConstantMetadataV11>': Vec<ModuleConstantMetadataV11>; 'Vec<ModuleConstantMetadataV11>': Vec<ModuleConstantMetadataV11>;
@@ -1312,6 +1359,11 @@ declare module '@polkadot/types/types/registry' {
'Vec<MortalEra>': Vec<MortalEra>; 'Vec<MortalEra>': Vec<MortalEra>;
'Vec<MultiAddress>': Vec<MultiAddress>; 'Vec<MultiAddress>': Vec<MultiAddress>;
'Vec<MultiAsset>': Vec<MultiAsset>; 'Vec<MultiAsset>': Vec<MultiAsset>;
'Vec<MultiAssetAbstractFungible>': Vec<MultiAssetAbstractFungible>;
'Vec<MultiAssetAbstractNonFungible>': Vec<MultiAssetAbstractNonFungible>;
'Vec<MultiAssetConcreteFungible>': Vec<MultiAssetConcreteFungible>;
'Vec<MultiAssetConcreteNonFungible>': Vec<MultiAssetConcreteNonFungible>;
'Vec<MultiDisputeStatementSet>': Vec<MultiDisputeStatementSet>;
'Vec<MultiLocation>': Vec<MultiLocation>; 'Vec<MultiLocation>': Vec<MultiLocation>;
'Vec<Multiplier>': Vec<Multiplier>; 'Vec<Multiplier>': Vec<Multiplier>;
'Vec<Multisig>': Vec<Multisig>; 'Vec<Multisig>': Vec<Multisig>;
@@ -1344,17 +1396,17 @@ declare module '@polkadot/types/types/registry' {
'Vec<OpenTipFinderTo225>': Vec<OpenTipFinderTo225>; 'Vec<OpenTipFinderTo225>': Vec<OpenTipFinderTo225>;
'Vec<OpenTipTip>': Vec<OpenTipTip>; 'Vec<OpenTipTip>': Vec<OpenTipTip>;
'Vec<OpenTipTo225>': Vec<OpenTipTo225>; 'Vec<OpenTipTo225>': Vec<OpenTipTo225>;
'Vec<Order>': Vec<Order>;
'Vec<Origin>': Vec<Origin>; 'Vec<Origin>': Vec<Origin>;
'Vec<OriginCaller>': Vec<OriginCaller>; 'Vec<OriginCaller>': Vec<OriginCaller>;
'Vec<OriginKind>': Vec<OriginKind>;
'Vec<OutboundHrmpMessage>': Vec<OutboundHrmpMessage>; 'Vec<OutboundHrmpMessage>': Vec<OutboundHrmpMessage>;
'Vec<Owner>': Vec<Owner>; 'Vec<Owner>': Vec<Owner>;
'Vec<PalletId>': Vec<PalletId>;
'Vec<PalletsOrigin>': Vec<PalletsOrigin>; 'Vec<PalletsOrigin>': Vec<PalletsOrigin>;
'Vec<PalletVersion>': Vec<PalletVersion>; 'Vec<PalletVersion>': Vec<PalletVersion>;
'Vec<ParachainDispatchOrigin>': Vec<ParachainDispatchOrigin>; 'Vec<ParachainDispatchOrigin>': Vec<ParachainDispatchOrigin>;
'Vec<ParachainInherentData>': Vec<ParachainInherentData>; 'Vec<ParachainInherentData>': Vec<ParachainInherentData>;
'Vec<ParachainProposal>': Vec<ParachainProposal>; 'Vec<ParachainProposal>': Vec<ParachainProposal>;
'Vec<ParachainsInherentData>': Vec<ParachainsInherentData>;
'Vec<ParaGenesisArgs>': Vec<ParaGenesisArgs>; 'Vec<ParaGenesisArgs>': Vec<ParaGenesisArgs>;
'Vec<ParaId>': Vec<ParaId>; 'Vec<ParaId>': Vec<ParaId>;
'Vec<ParaInfo>': Vec<ParaInfo>; 'Vec<ParaInfo>': Vec<ParaInfo>;
@@ -1390,6 +1442,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<PhantomData>': Vec<PhantomData>; 'Vec<PhantomData>': Vec<PhantomData>;
'Vec<Phase>': Vec<Phase>; 'Vec<Phase>': Vec<Phase>;
'Vec<PhragmenScore>': Vec<PhragmenScore>; 'Vec<PhragmenScore>': Vec<PhragmenScore>;
'Vec<PluralityJunction>': Vec<PluralityJunction>;
'Vec<Points>': Vec<Points>; 'Vec<Points>': Vec<Points>;
'Vec<Precommits>': Vec<Precommits>; 'Vec<Precommits>': Vec<Precommits>;
'Vec<PrefabWasmModule>': Vec<PrefabWasmModule>; 'Vec<PrefabWasmModule>': Vec<PrefabWasmModule>;
@@ -1407,7 +1460,6 @@ declare module '@polkadot/types/types/registry' {
'Vec<ProxyDefinition>': Vec<ProxyDefinition>; 'Vec<ProxyDefinition>': Vec<ProxyDefinition>;
'Vec<ProxyState>': Vec<ProxyState>; 'Vec<ProxyState>': Vec<ProxyState>;
'Vec<ProxyType>': Vec<ProxyType>; 'Vec<ProxyType>': Vec<ProxyType>;
'Vec<QueryHolding>': Vec<QueryHolding>;
'Vec<QueuedParathread>': Vec<QueuedParathread>; 'Vec<QueuedParathread>': Vec<QueuedParathread>;
'Vec<Randomness>': Vec<Randomness>; 'Vec<Randomness>': Vec<Randomness>;
'Vec<Raw>': Vec<Raw>; 'Vec<Raw>': Vec<Raw>;
@@ -1441,15 +1493,12 @@ declare module '@polkadot/types/types/registry' {
'Vec<RegistrationJudgement>': Vec<RegistrationJudgement>; 'Vec<RegistrationJudgement>': Vec<RegistrationJudgement>;
'Vec<RelayChainBlockNumber>': Vec<RelayChainBlockNumber>; 'Vec<RelayChainBlockNumber>': Vec<RelayChainBlockNumber>;
'Vec<RelayChainHash>': Vec<RelayChainHash>; 'Vec<RelayChainHash>': Vec<RelayChainHash>;
'Vec<RelayedFrom>': Vec<RelayedFrom>;
'Vec<RelayTo>': Vec<RelayTo>;
'Vec<Releases>': Vec<Releases>; 'Vec<Releases>': Vec<Releases>;
'Vec<Remark>': Vec<Remark>; 'Vec<Remark>': Vec<Remark>;
'Vec<Renouncing>': Vec<Renouncing>; 'Vec<Renouncing>': Vec<Renouncing>;
'Vec<ReportedRoundStates>': Vec<ReportedRoundStates>; 'Vec<ReportedRoundStates>': Vec<ReportedRoundStates>;
'Vec<Reporter>': Vec<Reporter>; 'Vec<Reporter>': Vec<Reporter>;
'Vec<ReportIdOf>': Vec<ReportIdOf>; 'Vec<ReportIdOf>': Vec<ReportIdOf>;
'Vec<ReserveAssetDeposit>': Vec<ReserveAssetDeposit>;
'Vec<Retriable>': Vec<Retriable>; 'Vec<Retriable>': Vec<Retriable>;
'Vec<RewardDestination>': Vec<RewardDestination>; 'Vec<RewardDestination>': Vec<RewardDestination>;
'Vec<RewardPoint>': Vec<RewardPoint>; 'Vec<RewardPoint>': Vec<RewardPoint>;
@@ -1478,14 +1527,20 @@ declare module '@polkadot/types/types/registry' {
'Vec<SessionInfo>': Vec<SessionInfo>; 'Vec<SessionInfo>': Vec<SessionInfo>;
'Vec<SessionInfoValidatorGroup>': Vec<SessionInfoValidatorGroup>; 'Vec<SessionInfoValidatorGroup>': Vec<SessionInfoValidatorGroup>;
'Vec<SessionKeys1>': Vec<SessionKeys1>; 'Vec<SessionKeys1>': Vec<SessionKeys1>;
'Vec<SessionKeys10>': Vec<SessionKeys10>;
'Vec<SessionKeys10B>': Vec<SessionKeys10B>;
'Vec<SessionKeys2>': Vec<SessionKeys2>; 'Vec<SessionKeys2>': Vec<SessionKeys2>;
'Vec<SessionKeys3>': Vec<SessionKeys3>; 'Vec<SessionKeys3>': Vec<SessionKeys3>;
'Vec<SessionKeys4>': Vec<SessionKeys4>; 'Vec<SessionKeys4>': Vec<SessionKeys4>;
'Vec<SessionKeys5>': Vec<SessionKeys5>; 'Vec<SessionKeys5>': Vec<SessionKeys5>;
'Vec<SessionKeys6>': Vec<SessionKeys6>; 'Vec<SessionKeys6>': Vec<SessionKeys6>;
'Vec<SessionKeys6B>': Vec<SessionKeys6B>;
'Vec<SessionKeys7>': Vec<SessionKeys7>; 'Vec<SessionKeys7>': Vec<SessionKeys7>;
'Vec<SessionKeys7B>': Vec<SessionKeys7B>;
'Vec<SessionKeys8>': Vec<SessionKeys8>; 'Vec<SessionKeys8>': Vec<SessionKeys8>;
'Vec<SessionKeys8B>': Vec<SessionKeys8B>;
'Vec<SessionKeys9>': Vec<SessionKeys9>; 'Vec<SessionKeys9>': Vec<SessionKeys9>;
'Vec<SessionKeys9B>': Vec<SessionKeys9B>;
'Vec<SetId>': Vec<SetId>; 'Vec<SetId>': Vec<SetId>;
'Vec<SetIndex>': Vec<SetIndex>; 'Vec<SetIndex>': Vec<SetIndex>;
'Vec<SiField>': Vec<SiField>; 'Vec<SiField>': Vec<SiField>;
@@ -1568,11 +1623,10 @@ declare module '@polkadot/types/types/registry' {
'Vec<TaskAddress>': Vec<TaskAddress>; 'Vec<TaskAddress>': Vec<TaskAddress>;
'Vec<TAssetBalance>': Vec<TAssetBalance>; 'Vec<TAssetBalance>': Vec<TAssetBalance>;
'Vec<TAssetDepositBalance>': Vec<TAssetDepositBalance>; 'Vec<TAssetDepositBalance>': Vec<TAssetDepositBalance>;
'Vec<TeleportAsset>': Vec<TeleportAsset>;
'Vec<Text>': Vec<Text>; 'Vec<Text>': Vec<Text>;
'Vec<Timepoint>': Vec<Timepoint>; 'Vec<Timepoint>': Vec<Timepoint>;
'Vec<TokenError>': Vec<TokenError>;
'Vec<TombstoneContractInfo>': Vec<TombstoneContractInfo>; 'Vec<TombstoneContractInfo>': Vec<TombstoneContractInfo>;
'Vec<Transact>': Vec<Transact>;
'Vec<TransactionPriority>': Vec<TransactionPriority>; 'Vec<TransactionPriority>': Vec<TransactionPriority>;
'Vec<TransactionValidityError>': Vec<TransactionValidityError>; 'Vec<TransactionValidityError>': Vec<TransactionValidityError>;
'Vec<TransientValidationData>': Vec<TransientValidationData>; 'Vec<TransientValidationData>': Vec<TransientValidationData>;
@@ -1615,7 +1669,9 @@ declare module '@polkadot/types/types/registry' {
'Vec<ValidatorPrefsTo196>': Vec<ValidatorPrefsTo196>; 'Vec<ValidatorPrefsTo196>': Vec<ValidatorPrefsTo196>;
'Vec<ValidatorPrefsWithBlocked>': Vec<ValidatorPrefsWithBlocked>; 'Vec<ValidatorPrefsWithBlocked>': Vec<ValidatorPrefsWithBlocked>;
'Vec<ValidatorPrefsWithCommission>': Vec<ValidatorPrefsWithCommission>; 'Vec<ValidatorPrefsWithCommission>': Vec<ValidatorPrefsWithCommission>;
'Vec<ValidatorSetId>': Vec<ValidatorSetId>;
'Vec<ValidatorSignature>': Vec<ValidatorSignature>; 'Vec<ValidatorSignature>': Vec<ValidatorSignature>;
'Vec<ValidDisputeStatementKind>': Vec<ValidDisputeStatementKind>;
'Vec<ValidityAttestation>': Vec<ValidityAttestation>; 'Vec<ValidityAttestation>': Vec<ValidityAttestation>;
'Vec<VecInboundHrmpMessage>': Vec<VecInboundHrmpMessage>; 'Vec<VecInboundHrmpMessage>': Vec<VecInboundHrmpMessage>;
'Vec<VersionedMultiAsset>': Vec<VersionedMultiAsset>; 'Vec<VersionedMultiAsset>': Vec<VersionedMultiAsset>;
@@ -1647,16 +1703,35 @@ declare module '@polkadot/types/types/registry' {
'Vec<WinnersDataTuple>': Vec<WinnersDataTuple>; 'Vec<WinnersDataTuple>': Vec<WinnersDataTuple>;
'Vec<WinningData>': Vec<WinningData>; 'Vec<WinningData>': Vec<WinningData>;
'Vec<WinningDataEntry>': Vec<WinningDataEntry>; 'Vec<WinningDataEntry>': Vec<WinningDataEntry>;
'Vec<WithdrawAsset>': Vec<WithdrawAsset>;
'Vec<WithdrawReasons>': Vec<WithdrawReasons>; 'Vec<WithdrawReasons>': Vec<WithdrawReasons>;
'Vec<Xcm>': Vec<Xcm>; 'Vec<Xcm>': Vec<Xcm>;
'Vec<XcmAssetEffects>': Vec<XcmAssetEffects>;
'Vec<XcmError>': Vec<XcmError>; 'Vec<XcmError>': Vec<XcmError>;
'Vec<XcmResult>': Vec<XcmResult>; 'Vec<XcmHrmpChannelAccepted>': Vec<XcmHrmpChannelAccepted>;
'Vec<XcmHrmpChannelClosing>': Vec<XcmHrmpChannelClosing>;
'Vec<XcmHrmpNewChannelOpenRequest>': Vec<XcmHrmpNewChannelOpenRequest>;
'Vec<XcmOrder>': Vec<XcmOrder>;
'Vec<XcmOrderBuyExecution>': Vec<XcmOrderBuyExecution>;
'Vec<XcmOrderDepositAsset>': Vec<XcmOrderDepositAsset>;
'Vec<XcmOrderDepositReserveAsset>': Vec<XcmOrderDepositReserveAsset>;
'Vec<XcmOrderExchangeAsset>': Vec<XcmOrderExchangeAsset>;
'Vec<XcmOrderInitiateReserveWithdraw>': Vec<XcmOrderInitiateReserveWithdraw>;
'Vec<XcmOrderInitiateTeleport>': Vec<XcmOrderInitiateTeleport>;
'Vec<XcmOrderQueryHolding>': Vec<XcmOrderQueryHolding>;
'Vec<XcmOriginKind>': Vec<XcmOriginKind>;
'Vec<XcmOutcome>': Vec<XcmOutcome>;
'Vec<XcmQueryResponse>': Vec<XcmQueryResponse>;
'Vec<XcmRelayedFrom>': Vec<XcmRelayedFrom>;
'Vec<XcmReserveAssetDeposit>': Vec<XcmReserveAssetDeposit>;
'Vec<XcmResponse>': Vec<XcmResponse>;
'Vec<XcmTeleportAsset>': Vec<XcmTeleportAsset>;
'Vec<XcmTransact>': Vec<XcmTransact>;
'Vec<XcmTransferAsset>': Vec<XcmTransferAsset>;
'Vec<XcmTransferReserveAsset>': Vec<XcmTransferReserveAsset>;
'Vec<XcmWithdrawAsset>': Vec<XcmWithdrawAsset>;
AbridgedCandidateReceipt: AbridgedCandidateReceipt; AbridgedCandidateReceipt: AbridgedCandidateReceipt;
AbridgedHostConfiguration: AbridgedHostConfiguration; AbridgedHostConfiguration: AbridgedHostConfiguration;
AbridgedHrmpChannel: AbridgedHrmpChannel; AbridgedHrmpChannel: AbridgedHrmpChannel;
AbstractFungible: AbstractFungible;
AbstractNonFungible: AbstractNonFungible;
AccountData: AccountData; AccountData: AccountData;
AccountId: AccountId; AccountId: AccountId;
AccountId32Junction: AccountId32Junction; AccountId32Junction: AccountId32Junction;
@@ -1719,8 +1794,12 @@ declare module '@polkadot/types/types/registry' {
BalanceLock: BalanceLock; BalanceLock: BalanceLock;
BalanceLockTo212: BalanceLockTo212; BalanceLockTo212: BalanceLockTo212;
BalanceOf: BalanceOf; BalanceOf: BalanceOf;
Balances: Balances;
BalanceStatus: BalanceStatus; BalanceStatus: BalanceStatus;
BeefyCommitment: BeefyCommitment;
BeefyKey: BeefyKey;
BeefyNextAuthoritySet: BeefyNextAuthoritySet;
BeefyPayload: BeefyPayload;
BeefySignedCommitment: BeefySignedCommitment;
Bid: Bid; Bid: Bid;
Bidder: Bidder; Bidder: Bidder;
BidKind: BidKind; BidKind: BidKind;
@@ -1731,6 +1810,11 @@ declare module '@polkadot/types/types/registry' {
BlockLength: BlockLength; BlockLength: BlockLength;
BlockNumber: BlockNumber; BlockNumber: BlockNumber;
BlockWeights: BlockWeights; BlockWeights: BlockWeights;
BodyId: BodyId;
BodyPart: BodyPart;
BodyPartAtLeastProportion: BodyPartAtLeastProportion;
BodyPartFraction: BodyPartFraction;
BodyPartMoreThanProportion: BodyPartMoreThanProportion;
bool: bool; bool: bool;
Bool: Bool; Bool: Bool;
Bounty: Bounty; Bounty: Bounty;
@@ -1763,8 +1847,6 @@ declare module '@polkadot/types/types/registry' {
CompactAssignmentsTo257: CompactAssignmentsTo257; CompactAssignmentsTo257: CompactAssignmentsTo257;
CompactScore: CompactScore; CompactScore: CompactScore;
CompactScoreCompact: CompactScoreCompact; CompactScoreCompact: CompactScoreCompact;
ConcreteFungible: ConcreteFungible;
ConcreteNonFungible: ConcreteNonFungible;
Consensus: Consensus; Consensus: Consensus;
ConsensusEngineId: ConsensusEngineId; ConsensusEngineId: ConsensusEngineId;
ConsumedWeight: ConsumedWeight; ConsumedWeight: ConsumedWeight;
@@ -1813,8 +1895,6 @@ declare module '@polkadot/types/types/registry' {
DefunctVoter: DefunctVoter; DefunctVoter: DefunctVoter;
Delegations: Delegations; Delegations: Delegations;
DeletedContract: DeletedContract; DeletedContract: DeletedContract;
DepositAsset: DepositAsset;
DepositReserveAsset: DepositReserveAsset;
Digest: Digest; Digest: Digest;
DigestItem: DigestItem; DigestItem: DigestItem;
DigestOf: DigestOf; DigestOf: DigestOf;
@@ -1829,7 +1909,10 @@ declare module '@polkadot/types/types/registry' {
DispatchResult: DispatchResult; DispatchResult: DispatchResult;
DispatchResultOf: DispatchResultOf; DispatchResultOf: DispatchResultOf;
DispatchResultTo198: DispatchResultTo198; DispatchResultTo198: DispatchResultTo198;
DisputeStatement: DisputeStatement;
DisputeStatementSet: DisputeStatementSet;
DoNotConstruct: DoNotConstruct; DoNotConstruct: DoNotConstruct;
DoubleEncodedCall: DoubleEncodedCall;
DoubleMapTypeLatest: DoubleMapTypeLatest; DoubleMapTypeLatest: DoubleMapTypeLatest;
DoubleMapTypeV10: DoubleMapTypeV10; DoubleMapTypeV10: DoubleMapTypeV10;
DoubleMapTypeV11: DoubleMapTypeV11; DoubleMapTypeV11: DoubleMapTypeV11;
@@ -1900,12 +1983,12 @@ declare module '@polkadot/types/types/registry' {
EvmAccount: EvmAccount; EvmAccount: EvmAccount;
EvmLog: EvmLog; EvmLog: EvmLog;
EvmVicinity: EvmVicinity; EvmVicinity: EvmVicinity;
ExchangeAsset: ExchangeAsset;
ExitError: ExitError; ExitError: ExitError;
ExitFatal: ExitFatal; ExitFatal: ExitFatal;
ExitReason: ExitReason; ExitReason: ExitReason;
ExitRevert: ExitRevert; ExitRevert: ExitRevert;
ExitSucceed: ExitSucceed; ExitSucceed: ExitSucceed;
ExplicitDisputeStatement: ExplicitDisputeStatement;
Exposure: Exposure; Exposure: Exposure;
ExtendedBalance: ExtendedBalance; ExtendedBalance: ExtendedBalance;
Extrinsic: Extrinsic; Extrinsic: Extrinsic;
@@ -1946,6 +2029,7 @@ declare module '@polkadot/types/types/registry' {
FundInfo: FundInfo; FundInfo: FundInfo;
Gas: Gas; Gas: Gas;
GiltBid: GiltBid; GiltBid: GiltBid;
GlobalValidationData: GlobalValidationData;
GlobalValidationSchedule: GlobalValidationSchedule; GlobalValidationSchedule: GlobalValidationSchedule;
GrandpaEquivocation: GrandpaEquivocation; GrandpaEquivocation: GrandpaEquivocation;
GrandpaEquivocationProof: GrandpaEquivocationProof; GrandpaEquivocationProof: GrandpaEquivocationProof;
@@ -2002,9 +2086,8 @@ declare module '@polkadot/types/types/registry' {
Index: Index; Index: Index;
IndicesLookupSource: IndicesLookupSource; IndicesLookupSource: IndicesLookupSource;
IndividualExposure: IndividualExposure; IndividualExposure: IndividualExposure;
InitiateReserveWithdraw: InitiateReserveWithdraw;
InitiateTeleport: InitiateTeleport;
InstructionWeights: InstructionWeights; InstructionWeights: InstructionWeights;
InvalidDisputeStatementKind: InvalidDisputeStatementKind;
InvalidTransaction: InvalidTransaction; InvalidTransaction: InvalidTransaction;
Json: Json; Json: Json;
Junction: Junction; Junction: Junction;
@@ -2050,6 +2133,7 @@ declare module '@polkadot/types/types/registry' {
MetadataV12: MetadataV12; MetadataV12: MetadataV12;
MetadataV9: MetadataV9; MetadataV9: MetadataV9;
MmrLeafProof: MmrLeafProof; MmrLeafProof: MmrLeafProof;
MmrRootHash: MmrRootHash;
ModuleConstantMetadataLatest: ModuleConstantMetadataLatest; ModuleConstantMetadataLatest: ModuleConstantMetadataLatest;
ModuleConstantMetadataV10: ModuleConstantMetadataV10; ModuleConstantMetadataV10: ModuleConstantMetadataV10;
ModuleConstantMetadataV11: ModuleConstantMetadataV11; ModuleConstantMetadataV11: ModuleConstantMetadataV11;
@@ -2067,6 +2151,11 @@ declare module '@polkadot/types/types/registry' {
MortalEra: MortalEra; MortalEra: MortalEra;
MultiAddress: MultiAddress; MultiAddress: MultiAddress;
MultiAsset: MultiAsset; MultiAsset: MultiAsset;
MultiAssetAbstractFungible: MultiAssetAbstractFungible;
MultiAssetAbstractNonFungible: MultiAssetAbstractNonFungible;
MultiAssetConcreteFungible: MultiAssetConcreteFungible;
MultiAssetConcreteNonFungible: MultiAssetConcreteNonFungible;
MultiDisputeStatementSet: MultiDisputeStatementSet;
MultiLocation: MultiLocation; MultiLocation: MultiLocation;
Multiplier: Multiplier; Multiplier: Multiplier;
Multisig: Multisig; Multisig: Multisig;
@@ -2099,17 +2188,17 @@ declare module '@polkadot/types/types/registry' {
OpenTipFinderTo225: OpenTipFinderTo225; OpenTipFinderTo225: OpenTipFinderTo225;
OpenTipTip: OpenTipTip; OpenTipTip: OpenTipTip;
OpenTipTo225: OpenTipTo225; OpenTipTo225: OpenTipTo225;
Order: Order;
Origin: Origin; Origin: Origin;
OriginCaller: OriginCaller; OriginCaller: OriginCaller;
OriginKind: OriginKind;
OutboundHrmpMessage: OutboundHrmpMessage; OutboundHrmpMessage: OutboundHrmpMessage;
Owner: Owner; Owner: Owner;
PalletId: PalletId;
PalletsOrigin: PalletsOrigin; PalletsOrigin: PalletsOrigin;
PalletVersion: PalletVersion; PalletVersion: PalletVersion;
ParachainDispatchOrigin: ParachainDispatchOrigin; ParachainDispatchOrigin: ParachainDispatchOrigin;
ParachainInherentData: ParachainInherentData; ParachainInherentData: ParachainInherentData;
ParachainProposal: ParachainProposal; ParachainProposal: ParachainProposal;
ParachainsInherentData: ParachainsInherentData;
ParaGenesisArgs: ParaGenesisArgs; ParaGenesisArgs: ParaGenesisArgs;
ParaId: ParaId; ParaId: ParaId;
ParaInfo: ParaInfo; ParaInfo: ParaInfo;
@@ -2145,6 +2234,7 @@ declare module '@polkadot/types/types/registry' {
PhantomData: PhantomData; PhantomData: PhantomData;
Phase: Phase; Phase: Phase;
PhragmenScore: PhragmenScore; PhragmenScore: PhragmenScore;
PluralityJunction: PluralityJunction;
Points: Points; Points: Points;
Precommits: Precommits; Precommits: Precommits;
PrefabWasmModule: PrefabWasmModule; PrefabWasmModule: PrefabWasmModule;
@@ -2162,7 +2252,6 @@ declare module '@polkadot/types/types/registry' {
ProxyDefinition: ProxyDefinition; ProxyDefinition: ProxyDefinition;
ProxyState: ProxyState; ProxyState: ProxyState;
ProxyType: ProxyType; ProxyType: ProxyType;
QueryHolding: QueryHolding;
QueuedParathread: QueuedParathread; QueuedParathread: QueuedParathread;
Randomness: Randomness; Randomness: Randomness;
Raw: Raw; Raw: Raw;
@@ -2196,15 +2285,12 @@ declare module '@polkadot/types/types/registry' {
RegistrationJudgement: RegistrationJudgement; RegistrationJudgement: RegistrationJudgement;
RelayChainBlockNumber: RelayChainBlockNumber; RelayChainBlockNumber: RelayChainBlockNumber;
RelayChainHash: RelayChainHash; RelayChainHash: RelayChainHash;
RelayedFrom: RelayedFrom;
RelayTo: RelayTo;
Releases: Releases; Releases: Releases;
Remark: Remark; Remark: Remark;
Renouncing: Renouncing; Renouncing: Renouncing;
ReportedRoundStates: ReportedRoundStates; ReportedRoundStates: ReportedRoundStates;
Reporter: Reporter; Reporter: Reporter;
ReportIdOf: ReportIdOf; ReportIdOf: ReportIdOf;
ReserveAssetDeposit: ReserveAssetDeposit;
Retriable: Retriable; Retriable: Retriable;
RewardDestination: RewardDestination; RewardDestination: RewardDestination;
RewardPoint: RewardPoint; RewardPoint: RewardPoint;
@@ -2233,14 +2319,20 @@ declare module '@polkadot/types/types/registry' {
SessionInfo: SessionInfo; SessionInfo: SessionInfo;
SessionInfoValidatorGroup: SessionInfoValidatorGroup; SessionInfoValidatorGroup: SessionInfoValidatorGroup;
SessionKeys1: SessionKeys1; SessionKeys1: SessionKeys1;
SessionKeys10: SessionKeys10;
SessionKeys10B: SessionKeys10B;
SessionKeys2: SessionKeys2; SessionKeys2: SessionKeys2;
SessionKeys3: SessionKeys3; SessionKeys3: SessionKeys3;
SessionKeys4: SessionKeys4; SessionKeys4: SessionKeys4;
SessionKeys5: SessionKeys5; SessionKeys5: SessionKeys5;
SessionKeys6: SessionKeys6; SessionKeys6: SessionKeys6;
SessionKeys6B: SessionKeys6B;
SessionKeys7: SessionKeys7; SessionKeys7: SessionKeys7;
SessionKeys7B: SessionKeys7B;
SessionKeys8: SessionKeys8; SessionKeys8: SessionKeys8;
SessionKeys8B: SessionKeys8B;
SessionKeys9: SessionKeys9; SessionKeys9: SessionKeys9;
SessionKeys9B: SessionKeys9B;
SetId: SetId; SetId: SetId;
SetIndex: SetIndex; SetIndex: SetIndex;
SiField: SiField; SiField: SiField;
@@ -2323,11 +2415,10 @@ declare module '@polkadot/types/types/registry' {
TaskAddress: TaskAddress; TaskAddress: TaskAddress;
TAssetBalance: TAssetBalance; TAssetBalance: TAssetBalance;
TAssetDepositBalance: TAssetDepositBalance; TAssetDepositBalance: TAssetDepositBalance;
TeleportAsset: TeleportAsset;
Text: Text; Text: Text;
Timepoint: Timepoint; Timepoint: Timepoint;
TokenError: TokenError;
TombstoneContractInfo: TombstoneContractInfo; TombstoneContractInfo: TombstoneContractInfo;
Transact: Transact;
TransactionPriority: TransactionPriority; TransactionPriority: TransactionPriority;
TransactionValidityError: TransactionValidityError; TransactionValidityError: TransactionValidityError;
TransientValidationData: TransientValidationData; TransientValidationData: TransientValidationData;
@@ -2370,7 +2461,9 @@ declare module '@polkadot/types/types/registry' {
ValidatorPrefsTo196: ValidatorPrefsTo196; ValidatorPrefsTo196: ValidatorPrefsTo196;
ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked; ValidatorPrefsWithBlocked: ValidatorPrefsWithBlocked;
ValidatorPrefsWithCommission: ValidatorPrefsWithCommission; ValidatorPrefsWithCommission: ValidatorPrefsWithCommission;
ValidatorSetId: ValidatorSetId;
ValidatorSignature: ValidatorSignature; ValidatorSignature: ValidatorSignature;
ValidDisputeStatementKind: ValidDisputeStatementKind;
ValidityAttestation: ValidityAttestation; ValidityAttestation: ValidityAttestation;
VecInboundHrmpMessage: VecInboundHrmpMessage; VecInboundHrmpMessage: VecInboundHrmpMessage;
VersionedMultiAsset: VersionedMultiAsset; VersionedMultiAsset: VersionedMultiAsset;
@@ -2402,10 +2495,31 @@ declare module '@polkadot/types/types/registry' {
WinnersDataTuple: WinnersDataTuple; WinnersDataTuple: WinnersDataTuple;
WinningData: WinningData; WinningData: WinningData;
WinningDataEntry: WinningDataEntry; WinningDataEntry: WinningDataEntry;
WithdrawAsset: WithdrawAsset;
WithdrawReasons: WithdrawReasons; WithdrawReasons: WithdrawReasons;
Xcm: Xcm; Xcm: Xcm;
XcmAssetEffects: XcmAssetEffects;
XcmError: XcmError; XcmError: XcmError;
XcmResult: XcmResult; XcmHrmpChannelAccepted: XcmHrmpChannelAccepted;
XcmHrmpChannelClosing: XcmHrmpChannelClosing;
XcmHrmpNewChannelOpenRequest: XcmHrmpNewChannelOpenRequest;
XcmOrder: XcmOrder;
XcmOrderBuyExecution: XcmOrderBuyExecution;
XcmOrderDepositAsset: XcmOrderDepositAsset;
XcmOrderDepositReserveAsset: XcmOrderDepositReserveAsset;
XcmOrderExchangeAsset: XcmOrderExchangeAsset;
XcmOrderInitiateReserveWithdraw: XcmOrderInitiateReserveWithdraw;
XcmOrderInitiateTeleport: XcmOrderInitiateTeleport;
XcmOrderQueryHolding: XcmOrderQueryHolding;
XcmOriginKind: XcmOriginKind;
XcmOutcome: XcmOutcome;
XcmQueryResponse: XcmQueryResponse;
XcmRelayedFrom: XcmRelayedFrom;
XcmReserveAssetDeposit: XcmReserveAssetDeposit;
XcmResponse: XcmResponse;
XcmTeleportAsset: XcmTeleportAsset;
XcmTransact: XcmTransact;
XcmTransferAsset: XcmTransferAsset;
XcmTransferReserveAsset: XcmTransferReserveAsset;
XcmWithdrawAsset: XcmWithdrawAsset;
} }
} }
+4 -4
View File
@@ -7,7 +7,7 @@ import type { UIntBitLength } from './types';
import BN from 'bn.js'; import BN from 'bn.js';
import { assert, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, u8aToBn } from '@polkadot/util'; import { assert, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, stringify, u8aToBn } from '@polkadot/util';
export const DEFAULT_UINT_BITS = 64; export const DEFAULT_UINT_BITS = 64;
@@ -37,7 +37,7 @@ function decodeAbstracIntU8a (value: Uint8Array, bitLength: UIntBitLength, isNeg
// NOTE When passing u8a in (typically from decoded data), it is always Little Endian // NOTE When passing u8a in (typically from decoded data), it is always Little Endian
return u8aToBn(value.subarray(0, bitLength / 8), { isLe: true, isNegative }).toString(); return u8aToBn(value.subarray(0, bitLength / 8), { isLe: true, isNegative }).toString();
} catch (error) { } catch (error) {
throw new Error(`AbstractInt: failed on ${JSON.stringify(value)}:: ${(error as Error).message}`); throw new Error(`AbstractInt: failed on ${stringify(value)}:: ${(error as Error).message}`);
} }
} }
@@ -83,8 +83,8 @@ export abstract class AbstractInt extends BN implements Codec {
const isPositive = this.gte(BN_ZERO); const isPositive = this.gte(BN_ZERO);
const maxBits = bitLength - (isSigned && isPositive ? 1 : 0); const maxBits = bitLength - (isSigned && isPositive ? 1 : 0);
assert(isSigned || isPositive, `${this.toRawType()}: Negative number passed to unsigned type`); assert(isSigned || isPositive, () => `${this.toRawType()}: Negative number passed to unsigned type`);
assert(super.bitLength() <= maxBits, `${this.toRawType()}: Input too large. Found input with ${super.bitLength()} bits, expected ${maxBits}`); assert(super.bitLength() <= maxBits, () => `${this.toRawType()}: Input too large. Found input with ${super.bitLength()} bits, expected ${maxBits}`);
} }
/** /**
+2 -2
View File
@@ -4,7 +4,7 @@
import type { CodecHash, Hash } from '../interfaces/runtime'; import type { CodecHash, Hash } from '../interfaces/runtime';
import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'; import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { compactFromU8a, compactToU8a, isHex, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; import { compactFromU8a, compactToU8a, isHex, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
import { compareSet, decodeU8a, typeToConstructor } from './utils'; import { compareSet, decodeU8a, typeToConstructor } from './utils';
@@ -176,7 +176,7 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements Codec {
* @description Returns the string representation of the value * @description Returns the string representation of the value
*/ */
public toString (): string { public toString (): string {
return JSON.stringify(this.toJSON()); return stringify(this.toJSON());
} }
/** /**
+2 -4
View File
@@ -3,7 +3,7 @@
import type { CodecHash, Hash } from '../interfaces'; import type { CodecHash, Hash } from '../interfaces';
import type { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types'; import type { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types';
import type { CompactEncodable, UIntBitLength } from './types'; import type { CompactEncodable } from './types';
import BN from 'bn.js'; import BN from 'bn.js';
@@ -50,9 +50,7 @@ export class Compact<T extends CompactEncodable> implements ICompact<T> {
return new Type(registry, value); return new Type(registry, value);
} }
const [, _value] = compactFromU8a(value, new Type(registry, 0).bitLength() as UIntBitLength); return new Type(registry, compactFromU8a(value)[1]);
return new Type(registry, _value);
} }
/** /**
+6 -6
View File
@@ -4,7 +4,7 @@
import type { CodecHash, Hash } from '../interfaces'; import type { CodecHash, Hash } from '../interfaces';
import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'; import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { assert, hexToU8a, isHex, isNumber, isObject, isString, isU8a, isUndefined, stringCamelCase, stringUpperFirst, u8aConcat, u8aToHex } from '@polkadot/util'; import { assert, hexToU8a, isHex, isNumber, isObject, isString, isU8a, isUndefined, stringCamelCase, stringify, stringUpperFirst, u8aConcat, u8aToHex } from '@polkadot/util';
import { Null } from '../primitive/Null'; import { Null } from '../primitive/Null';
import { Struct } from './Struct'; import { Struct } from './Struct';
@@ -88,7 +88,7 @@ function extractDef (registry: Registry, _def: Record<string, keyof InterfaceTyp
function createFromValue (registry: Registry, def: TypesDef, index = 0, value?: any): Decoded { function createFromValue (registry: Registry, def: TypesDef, index = 0, value?: any): Decoded {
const entry = Object.values(def).find((e) => e.index === index); const entry = Object.values(def).find((e) => e.index === index);
assert(!isUndefined(entry), `Unable to create Enum via index ${index}, in ${Object.keys(def).join(', ')}`); assert(!isUndefined(entry), () => `Unable to create Enum via index ${index}, in ${Object.keys(def).join(', ')}`);
return { return {
index, index,
@@ -105,7 +105,7 @@ function decodeFromJSON (registry: Registry, def: TypesDef, key: string, value?:
const keyLower = key.toLowerCase(); const keyLower = key.toLowerCase();
const index = keys.indexOf(keyLower); const index = keys.indexOf(keyLower);
assert(index !== -1, `Cannot map Enum JSON, unable to find '${key}' in ${keys.join(', ')}`); assert(index !== -1, () => `Cannot map Enum JSON, unable to find '${key}' in ${keys.join(', ')}`);
try { try {
return createFromValue(registry, def, Object.values(def)[index].index, value); return createFromValue(registry, def, Object.values(def)[index].index, value);
@@ -213,7 +213,7 @@ export class Enum implements Codec {
Object.defineProperty(this, askey, { Object.defineProperty(this, askey, {
enumerable: true, enumerable: true,
get: (): Codec => { get: (): Codec => {
assert(this[iskey as keyof this], `Cannot convert '${this.type}' via ${askey}`); assert(this[iskey as keyof this], () => `Cannot convert '${this.type}' via ${askey}`);
return this.value; return this.value;
} }
@@ -384,7 +384,7 @@ export class Enum implements Codec {
* @description Returns the base runtime type name for this instance * @description Returns the base runtime type name for this instance
*/ */
public toRawType (): string { public toRawType (): string {
return JSON.stringify({ _enum: this._toRawStruct() }); return stringify({ _enum: this._toRawStruct() });
} }
/** /**
@@ -393,7 +393,7 @@ export class Enum implements Codec {
public toString (): string { public toString (): string {
return this.isNull return this.isNull
? this.type ? this.type
: JSON.stringify(this.toJSON()); : stringify(this.toJSON());
} }
/** /**
+2 -2
View File
@@ -4,7 +4,7 @@
import type { CodecHash, Hash } from '../interfaces/runtime'; import type { CodecHash, Hash } from '../interfaces/runtime';
import type { AnyJson, Codec, Registry } from '../types'; import type { AnyJson, Codec, Registry } from '../types';
import { isFunction, isUndefined } from '@polkadot/util'; import { isFunction, isUndefined, stringify } from '@polkadot/util';
import { compareMap } from './utils'; import { compareMap } from './utils';
@@ -112,7 +112,7 @@ export class Json extends Map<string, any> implements Codec {
* @description Returns the string representation of the value * @description Returns the string representation of the value
*/ */
public toString (): string { public toString (): string {
return JSON.stringify(this.toJSON()); return stringify(this.toJSON());
} }
/** /**
+2 -2
View File
@@ -4,7 +4,7 @@
import type { CodecHash, Hash } from '../interfaces/runtime'; import type { CodecHash, Hash } from '../interfaces/runtime';
import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'; import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { compactFromU8a, compactToU8a, isHex, isObject, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; import { compactFromU8a, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
import { compareMap, decodeU8a, typeToConstructor } from './utils'; import { compareMap, decodeU8a, typeToConstructor } from './utils';
@@ -183,7 +183,7 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
* @description Returns the string representation of the value * @description Returns the string representation of the value
*/ */
public toString (): string { public toString (): string {
return JSON.stringify(this.toJSON()); return stringify(this.toJSON());
} }
/** /**
+6 -6
View File
@@ -6,7 +6,7 @@ import type { Codec, Constructor, Registry } from '../types';
import BN from 'bn.js'; import BN from 'bn.js';
import { assert, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, stringCamelCase, stringUpperFirst, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util'; import { assert, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, stringCamelCase, stringify, stringUpperFirst, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
import { compareArray } from './utils'; import { compareArray } from './utils';
@@ -21,7 +21,7 @@ function encodeSet (setValues: SetValues, value: string[]): BN {
/** @internal */ /** @internal */
function decodeSetArray (setValues: SetValues, value: string[]): string[] { function decodeSetArray (setValues: SetValues, value: string[]): string[] {
return value.reduce((result, key): string[] => { return value.reduce((result, key): string[] => {
assert(!isUndefined(setValues[key]), `Set: Invalid key '${key}' passed to Set, allowed ${Object.keys(setValues).join(', ')}`); assert(!isUndefined(setValues[key]), () => `Set: Invalid key '${key}' passed to Set, allowed ${Object.keys(setValues).join(', ')}`);
result.push(key); result.push(key);
@@ -42,14 +42,14 @@ function decodeSetNumber (setValues: SetValues, _value: BN | number): string[] {
const computed = encodeSet(setValues, result); const computed = encodeSet(setValues, result);
assert(bn.eq(computed), `Set: Mismatch decoding '${bn.toString()}', computed as '${computed.toString()}' with ${result.join(', ')}`); assert(bn.eq(computed), () => `Set: Mismatch decoding '${bn.toString()}', computed as '${computed.toString()}' with ${result.join(', ')}`);
return result; return result;
} }
/** @internal */ /** @internal */
function decodeSet (setValues: SetValues, value: string[] | Set<string> | Uint8Array | BN | number | string = 0, bitLength: number): string[] { function decodeSet (setValues: SetValues, value: string[] | Set<string> | Uint8Array | BN | number | string = 0, bitLength: number): string[] {
assert(bitLength % 8 === 0, `Expected valid bitLength, power of 8, found ${bitLength}`); assert(bitLength % 8 === 0, () => `Expected valid bitLength, power of 8, found ${bitLength}`);
const byteLength = bitLength / 8; const byteLength = bitLength / 8;
@@ -155,7 +155,7 @@ export class CodecSet extends Set<string> implements Codec {
// ^^^ add = () property done to assign this instance's this, otherwise Set.add creates "some" chaos // ^^^ add = () property done to assign this instance's this, otherwise Set.add creates "some" chaos
// we have the isUndefined(this._setValues) in here as well, add is used internally // we have the isUndefined(this._setValues) in here as well, add is used internally
// in the Set constructor (so it is undefined at this point, and should allow) // in the Set constructor (so it is undefined at this point, and should allow)
assert(isUndefined(this.#allowed) || !isUndefined(this.#allowed[key]), `Set: Invalid key '${key}' on add`); assert(isUndefined(this.#allowed) || !isUndefined(this.#allowed[key]), () => `Set: Invalid key '${key}' on add`);
super.add(key); super.add(key);
@@ -210,7 +210,7 @@ export class CodecSet extends Set<string> implements Codec {
* @description Returns the base runtime type name for this instance * @description Returns the base runtime type name for this instance
*/ */
public toRawType (): string { public toRawType (): string {
return JSON.stringify({ _set: this.#allowed }); return stringify({ _set: this.#allowed });
} }
/** /**
+8
View File
@@ -119,6 +119,14 @@ describe('Struct', (): void => {
).toThrowError(/Cannot decode value/); ).toThrowError(/Cannot decode value/);
}); });
it('throws a sensical error on incorrect array values passed to structs', (): void => {
expect(
() => new Struct(registry, {
_: 'Vec<u32>'
}, [123, 456])
).toThrow(/array to object with known keys/);
});
it('provides a clean toString()', (): void => { it('provides a clean toString()', (): void => {
expect( expect(
new ( new (
+8 -5
View File
@@ -4,7 +4,7 @@
import type { CodecHash, Hash } from '../interfaces/runtime'; import type { CodecHash, Hash } from '../interfaces/runtime';
import type { AnyJson, BareOpts, Codec, Constructor, ConstructorDef, InterfaceTypes, Registry } from '../types'; import type { AnyJson, BareOpts, Codec, Constructor, ConstructorDef, InterfaceTypes, Registry } from '../types';
import { hexToU8a, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, stringCamelCase, u8aConcat, u8aToHex } from '@polkadot/util'; import { assert, hexToU8a, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
import { compareMap, decodeU8a, mapToTypeMap } from './utils'; import { compareMap, decodeU8a, mapToTypeMap } from './utils';
@@ -13,8 +13,11 @@ type TypesDef<T = Codec> = Record<string, keyof InterfaceTypes | Constructor<T>>
/** @internal */ /** @internal */
function decodeStructFromObject <T> (registry: Registry, Types: ConstructorDef, value: any, jsonMap: Map<any, string>): T { function decodeStructFromObject <T> (registry: Registry, Types: ConstructorDef, value: any, jsonMap: Map<any, string>): T {
let jsonObj: Record<string, any> | undefined; let jsonObj: Record<string, any> | undefined;
const inputKeys = Object.keys(Types);
return Object.keys(Types).reduce((raw, key, index): T => { assert(!Array.isArray(value) || value.length === inputKeys.length, () => `Struct: Unable to map ${stringify(value)} array to object with known keys ${inputKeys.join(', ')}`);
return inputKeys.reduce((raw, key, index): T => {
// The key in the JSON can be snake_case (or other cases), but in our // The key in the JSON can be snake_case (or other cases), but in our
// Types, result or any other maps, it's camelCase // Types, result or any other maps, it's camelCase
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
@@ -60,7 +63,7 @@ function decodeStructFromObject <T> (registry: Registry, Types: ConstructorDef,
? assign ? assign
: new Types[key](registry, assign); : new Types[key](registry, assign);
} else { } else {
throw new Error(`Cannot decode value ${JSON.stringify(value)}`); throw new Error(`Cannot decode value ${stringify(value)} (typeof ${typeof value}), expected an input object with known keys`);
} }
} catch (error) { } catch (error) {
let type = Types[key].name; let type = Types[key].name;
@@ -297,7 +300,7 @@ export class Struct<
* @description Returns the base runtime type name for this instance * @description Returns the base runtime type name for this instance
*/ */
public toRawType (): string { public toRawType (): string {
return JSON.stringify( return stringify(
Struct.typesToMap(this.registry, this.#Types) Struct.typesToMap(this.registry, this.#Types)
); );
} }
@@ -306,7 +309,7 @@ export class Struct<
* @description Returns the string representation of the value * @description Returns the string representation of the value
*/ */
public toString (): string { public toString (): string {
return JSON.stringify(this.toJSON()); return stringify(this.toJSON());
} }
/** /**
+2 -2
View File
@@ -3,7 +3,7 @@
import type { AnyNumber, AnyString, AnyU8a, Codec, Constructor, InterfaceTypes, Registry } from '../types'; import type { AnyNumber, AnyString, AnyU8a, Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { isHex, isU8a, u8aConcat, u8aToU8a } from '@polkadot/util'; import { isHex, isU8a, stringify, u8aConcat, u8aToU8a } from '@polkadot/util';
import { AbstractArray } from './AbstractArray'; import { AbstractArray } from './AbstractArray';
import { decodeU8a, mapToTypeMap, typeToConstructor } from './utils'; import { decodeU8a, mapToTypeMap, typeToConstructor } from './utils';
@@ -110,7 +110,7 @@ export class Tuple extends AbstractArray<Codec> {
*/ */
public toString (): string { public toString (): string {
// Overwrite the default toString representation of Array. // Overwrite the default toString representation of Array.
return JSON.stringify(this.toJSON()); return stringify(this.toJSON());
} }
/** /**
+1 -1
View File
@@ -50,7 +50,7 @@ export class Vec<T extends Codec> extends AbstractArray<T> {
const u8a = u8aToU8a(value); const u8a = u8aToU8a(value);
const [offset, length] = compactFromU8a(u8a); const [offset, length] = compactFromU8a(u8a);
assert(length.lten(MAX_LENGTH), `Vec length ${length.toString()} exceeds ${MAX_LENGTH}`); assert(length.lten(MAX_LENGTH), () => `Vec length ${length.toString()} exceeds ${MAX_LENGTH}`);
return decodeU8a(registry, u8a.subarray(offset), new Array(length.toNumber()).fill(Type)) as T[]; return decodeU8a(registry, u8a.subarray(offset), new Array(length.toNumber()).fill(Type)) as T[];
} }
+1 -1
View File
@@ -39,7 +39,7 @@ export class VecFixed<T extends Codec> extends AbstractArray<T> {
values.push(new Type(registry)); values.push(new Type(registry));
} }
assert(values.length === allocLength, `Expected a length of exactly ${allocLength} entries`); assert(values.length === allocLength, () => `Expected a length of exactly ${allocLength} entries`);
return values; return values;
} }
+5 -5
View File
@@ -5,7 +5,7 @@ import type { U8aBitLength, UIntBitLength } from '../codec/types';
import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import type { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { FromReg, TypeDef } from './types'; import type { FromReg, TypeDef } from './types';
import { assert, isNumber, isUndefined } from '@polkadot/util'; import { assert, isNumber, isUndefined, stringify } from '@polkadot/util';
import { BTreeMap, BTreeSet, CodecSet, Compact, Enum, HashMap, Int, Option, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed } from '../codec'; import { BTreeMap, BTreeSet, CodecSet, Compact, Enum, HashMap, Int, Option, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed } from '../codec';
import { DoNotConstruct } from '../primitive'; import { DoNotConstruct } from '../primitive';
@@ -33,13 +33,13 @@ export function ClassOf<K extends keyof InterfaceTypes> (registry: Registry, nam
} }
function getSubDefArray (value: TypeDef): TypeDef[] { function getSubDefArray (value: TypeDef): TypeDef[] {
assert(value.sub && Array.isArray(value.sub), `Expected subtype as TypeDef[] in ${JSON.stringify(value)}`); assert(value.sub && Array.isArray(value.sub), () => `Expected subtype as TypeDef[] in ${stringify(value)}`);
return value.sub; return value.sub;
} }
function getSubDef (value: TypeDef): TypeDef { function getSubDef (value: TypeDef): TypeDef {
assert(value.sub && !Array.isArray(value.sub), `Expected subtype as TypeDef in ${JSON.stringify(value)}`); assert(value.sub && !Array.isArray(value.sub), () => `Expected subtype as TypeDef in ${stringify(value)}`);
return value.sub; return value.sub;
} }
@@ -67,7 +67,7 @@ function getTypeClassArray (value: TypeDef): (keyof InterfaceTypes)[] {
} }
function createInt ({ displayName, length }: TypeDef, Clazz: typeof Int | typeof UInt): Constructor { function createInt ({ displayName, length }: TypeDef, Clazz: typeof Int | typeof UInt): Constructor {
assert(isNumber(length), `Expected bitLength information for ${displayName || Clazz.constructor.name}<bitLength>`); assert(isNumber(length), () => `Expected bitLength information for ${displayName || Clazz.constructor.name}<bitLength>`);
return Clazz.with(length as UIntBitLength, displayName); return Clazz.with(length as UIntBitLength, displayName);
} }
@@ -185,7 +185,7 @@ export function getTypeClass<T extends Codec = Codec> (registry: Registry, value
const getFn = infoMapping[value.info]; const getFn = infoMapping[value.info];
assert(getFn, `Unable to construct class from ${JSON.stringify(value)}`); assert(getFn, () => `Unable to construct class from ${stringify(value)}`);
return getFn(registry, value) as Constructor<T>; return getFn(registry, value) as Constructor<T>;
} }
+7 -7
View File
@@ -3,7 +3,7 @@
import type { TypeDef } from './types'; import type { TypeDef } from './types';
import { assert, isNumber, isUndefined } from '@polkadot/util'; import { assert, isNumber, isUndefined, stringify } from '@polkadot/util';
import { TypeDefInfo } from './types'; import { TypeDefInfo } from './types';
@@ -34,7 +34,7 @@ function encodeWithParams (typeDef: TypeDef, outer: string): string {
return paramsNotation(outer, sub, (param) => encodeTypeDef(param)); return paramsNotation(outer, sub, (param) => encodeTypeDef(param));
} }
throw new Error(`Unable to encode ${JSON.stringify(typeDef)} with params`); throw new Error(`Unable to encode ${stringify(typeDef)} with params`);
} }
function encodeDoNotConstruct ({ displayName }: TypeDef): string { function encodeDoNotConstruct ({ displayName }: TypeDef): string {
@@ -44,14 +44,14 @@ function encodeDoNotConstruct ({ displayName }: TypeDef): string {
function encodeSubTypes (sub: TypeDef[], asEnum?: boolean): string { function encodeSubTypes (sub: TypeDef[], asEnum?: boolean): string {
const names = sub.map(({ name }) => name); const names = sub.map(({ name }) => name);
assert(names.every((n) => !!n), `Subtypes does not have consistent names, ${names.join(', ')}`); assert(names.every((n) => !!n), () => `Subtypes does not have consistent names, ${names.join(', ')}`);
const inner = sub.reduce((result: Record<string, string>, type): Record<string, string> => ({ const inner = sub.reduce((result: Record<string, string>, type): Record<string, string> => ({
...result, ...result,
[type.name as string]: encodeTypeDef(type) [type.name as string]: encodeTypeDef(type)
}), {}); }), {});
return JSON.stringify( return stringify(
asEnum asEnum
? { _enum: inner } ? { _enum: inner }
: inner : inner
@@ -66,7 +66,7 @@ function encodeEnum (typeDef: TypeDef): string {
// c-like enums have all Null entries // c-like enums have all Null entries
// TODO We need to take the disciminant into account and auto-add empty entries // TODO We need to take the disciminant into account and auto-add empty entries
return sub.every(({ type }) => type === 'Null') return sub.every(({ type }) => type === 'Null')
? JSON.stringify({ _enum: sub.map(({ name }, index) => `${name || `Empty${index}`}`) }) ? stringify({ _enum: sub.map(({ name }, index) => `${name || `Empty${index}`}`) })
: encodeSubTypes(sub, true); : encodeSubTypes(sub, true);
} }
@@ -121,13 +121,13 @@ const encoders: Record<TypeDefInfo, (typeDef: TypeDef) => string> = {
function encodeType (typeDef: TypeDef): string { function encodeType (typeDef: TypeDef): string {
const encoder = encoders[typeDef.info]; const encoder = encoders[typeDef.info];
assert(encoder, `Cannot encode type: ${JSON.stringify(typeDef)}`); assert(encoder, () => `Cannot encode type: ${stringify(typeDef)}`);
return encoder(typeDef); return encoder(typeDef);
} }
export function encodeTypeDef (typeDef: TypeDef): string { export function encodeTypeDef (typeDef: TypeDef): string {
assert(!isUndefined(typeDef.info), `Invalid type definition with no instance info, ${JSON.stringify(typeDef)}`); assert(!isUndefined(typeDef.info), () => `Invalid type definition with no instance info, ${stringify(typeDef)}`);
// In the case of contracts we do have the unfortunate situation where the displayName would // In the case of contracts we do have the unfortunate situation where the displayName would
// refer to "Option" when it is an option. For these, string it out, only using when actually // refer to "Option" when it is an option. For these, string it out, only using when actually
+2 -2
View File
@@ -110,7 +110,7 @@ function _decodeFixedVec (value: TypeDef, type: string, _: string, count: number
const length = parseInt(strLength.trim(), 10); const length = parseInt(strLength.trim(), 10);
// as a first round, only u8 via u8aFixed, we can add more support // as a first round, only u8 via u8aFixed, we can add more support
assert(length <= 256, `${type}: Only support for [Type; <length>], where length <= 256`); assert(length <= 256, () => `${type}: Only support for [Type; <length>], where length <= 256`);
value.displayName = displayName; value.displayName = displayName;
value.length = length; value.length = length;
@@ -137,7 +137,7 @@ function _decodeAnyInt (value: TypeDef, type: string, _: string, clazz: 'Int' |
const length = parseInt(strLength.trim(), 10); const length = parseInt(strLength.trim(), 10);
// as a first round, only u8 via u8aFixed, we can add more support // as a first round, only u8 via u8aFixed, we can add more support
assert(length <= 8192 && (length % 8) === 0, `${type}: Only support for ${clazz}<bitLength>, where length <= 8192 and a power of 8, found ${length}`); assert(length <= 8192 && (length % 8) === 0, () => `${type}: Only support for ${clazz}<bitLength>, where length <= 8192 and a power of 8, found ${length}`);
value.displayName = displayName; value.displayName = displayName;
value.length = length; value.length = length;
+5 -5
View File
@@ -10,7 +10,7 @@ import type { CallFunction, Codec, CodecHasher, Constructor, InterfaceTypes, Reg
// we are attempting to avoid circular refs, hence the Metadata path import // we are attempting to avoid circular refs, hence the Metadata path import
import { decorateConstants, decorateExtrinsics } from '@polkadot/metadata/decorate'; import { decorateConstants, decorateExtrinsics } from '@polkadot/metadata/decorate';
import { Metadata } from '@polkadot/metadata/Metadata'; import { Metadata } from '@polkadot/metadata/Metadata';
import { assert, assertReturn, BN_ZERO, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, u8aToHex } from '@polkadot/util'; import { assert, assertReturn, BN_ZERO, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, stringify, u8aToHex } from '@polkadot/util';
import { blake2AsU8a } from '@polkadot/util-crypto'; import { blake2AsU8a } from '@polkadot/util-crypto';
import { Json } from '../codec/Json'; import { Json } from '../codec/Json';
@@ -340,8 +340,8 @@ export class TypeRegistry implements Registry {
if (isFunction(arg1)) { if (isFunction(arg1)) {
this.#classes.set(arg1.name, arg1); this.#classes.set(arg1.name, arg1);
} else if (isString(arg1)) { } else if (isString(arg1)) {
assert(isFunction(arg2), `Expected class definition passed to '${arg1}' registration`); assert(isFunction(arg2), () => `Expected class definition passed to '${arg1}' registration`);
assert(arg1 !== arg2.toString(), `Unable to register circular ${arg1} === ${arg1}`); assert(arg1 !== arg2.toString(), () => `Unable to register circular ${arg1} === ${arg1}`);
this.#classes.set(arg1, arg2); this.#classes.set(arg1, arg2);
} else { } else {
@@ -357,9 +357,9 @@ export class TypeRegistry implements Registry {
} else { } else {
const def = isString(type) const def = isString(type)
? type ? type
: JSON.stringify(type); : stringify(type);
assert(name !== def, `Unable to register circular ${name} === ${def}`); assert(name !== def, () => `Unable to register circular ${name} === ${def}`);
// we already have this type, remove the classes registered for it // we already have this type, remove the classes registered for it
if (this.#classes.has(name)) { if (this.#classes.has(name)) {
+43 -46
View File
@@ -16,12 +16,14 @@ const mappings: Mapper[] = [
alias(['VecDeque<'], 'Vec<', false), alias(['VecDeque<'], 'Vec<', false),
// <T::Balance as HasCompact> // <T::Balance as HasCompact>
cleanupCompact(), cleanupCompact(),
// Change BoundedVec<Type, Size> to Vec<Type>
removeBoundedVec(),
// Remove all the trait prefixes // Remove all the trait prefixes
removeTraits(), removeTraits(),
// remove PairOf<T> -> (T, T) // remove PairOf<T> -> (T, T)
removePairOf(), removePairOf(),
// remove boxing, `Box<Proposal>` -> `Proposal` // remove boxing, `Box<Proposal>` -> `Proposal`
removeWrap('Box'), removeWrap('Box<'),
// remove generics, `MisbehaviorReport<Hash, BlockNumber>` -> `MisbehaviorReport` // remove generics, `MisbehaviorReport<Hash, BlockNumber>` -> `MisbehaviorReport`
removeGenerics(), removeGenerics(),
// alias String -> Text (compat with jsonrpc methods) // alias String -> Text (compat with jsonrpc methods)
@@ -61,18 +63,17 @@ export function findClosing (value: string, start: number): number {
} }
export function alias (src: string[], dest: string, withChecks = true): Mapper { export function alias (src: string[], dest: string, withChecks = true): Mapper {
return (value: string): string => { return (value: string): string =>
return src.reduce((value, src): string => { src.reduce((value, src): string =>
return value value
.replace( .replace(
new RegExp(`(^${src}|${BOX_PRECEDING.map((box) => `\\${box}${src}`).join('|')})`, 'g'), new RegExp(`(^${src}|${BOX_PRECEDING.map((box) => `\\${box}${src}`).join('|')})`, 'g'),
(src): string => (src): string =>
withChecks && BOX_PRECEDING.includes(src[0]) withChecks && BOX_PRECEDING.includes(src[0])
? `${src[0]}${dest}` ? `${src[0]}${dest}`
: dest : dest
); ), value
}, value); );
};
} }
export function cleanupCompact (): Mapper { export function cleanupCompact (): Mapper {
@@ -94,9 +95,29 @@ export function cleanupCompact (): Mapper {
} }
export function flattenSingleTuple (): Mapper { export function flattenSingleTuple (): Mapper {
return (value: string): string => { return (value: string) =>
return value.replace(/\(([^,]+)\)/, '$1'); value.replace(/\(([^,]+)\)/, '$1');
}; }
function replaceTagWith (value: string, matcher: string, replacer: (inner: string) => string): string {
for (let index = 0; index < value.length; index++) {
if (value.substr(index, matcher.length) === matcher) {
const start = index + matcher.length;
const end = findClosing(value, start);
value = `${value.substr(0, index)}${replacer(value.substr(start, end - start))}${value.substr(end + 1)}`;
}
}
return value;
}
// remove the BoundedVec wrappers
export function removeBoundedVec (): Mapper {
const replacer = (inner: string) => `Vec<${inner.split(',')[0]}>`;
return (value: string) =>
replaceTagWith(value, 'BoundedVec<', replacer);
} }
export function removeColons (): Mapper { export function removeColons (): Mapper {
@@ -156,25 +177,16 @@ export function removeGenerics (): Mapper {
// remove the PairOf wrappers // remove the PairOf wrappers
export function removePairOf (): Mapper { export function removePairOf (): Mapper {
return (value: string): string => { const replacer = (inner: string) => `(${inner},${inner})`;
for (let index = 0; index < value.length; index++) {
if (value.substr(index, 7) === 'PairOf<') {
const start = index + 7;
const end = findClosing(value, start);
const type = value.substr(start, end - start);
value = `${value.substr(0, index)}(${type},${type})${value.substr(end + 1)}`; return (value: string) =>
} replaceTagWith(value, 'PairOf<', replacer);
}
return value;
};
} }
// remove the type traits // remove the type traits
export function removeTraits (): Mapper { export function removeTraits (): Mapper {
return (value: string): string => { return (value: string): string =>
return value value
// remove all whitespaces // remove all whitespaces
.replace(/\s/g, '') .replace(/\s/g, '')
// anything `T::<type>` to end up as `<type>` // anything `T::<type>` to end up as `<type>`
@@ -187,34 +199,19 @@ export function removeTraits (): Mapper {
.replace(/<LookupasStaticLookup>/g, 'Lookup') .replace(/<LookupasStaticLookup>/g, 'Lookup')
// replace `<...>::Type` // replace `<...>::Type`
.replace(/::Type/g, ''); .replace(/::Type/g, '');
};
} }
// remove wrapping values, i.e. Box<Proposal> -> Proposal // remove wrapping values, i.e. Box<Proposal> -> Proposal
export function removeWrap (_check: string): Mapper { export function removeWrap (check: string): Mapper {
const check = `${_check}<`; const replacer = (inner: string) => inner;
return (value: string): string => { return (value: string) =>
let index = 0; replaceTagWith(value, check, replacer);
while (index !== -1) {
index = value.indexOf(check);
if (index !== -1) {
const start = index + check.length;
const end = findClosing(value, start);
value = `${value.substr(0, index)}${value.substr(start, end - start)}${value.substr(end + 1)}`;
}
}
return value;
};
} }
// eslint-disable-next-line @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/ban-types
export function sanitize (value: String | string, options?: SanitizeOptions): string { export function sanitize (value: String | string, options?: SanitizeOptions): string {
return mappings.reduce((result, fn): string => { return mappings.reduce((result, fn): string =>
return fn(result, options); fn(result, options), value.toString()
}, value.toString()).trim(); ).trim();
} }
+1 -1
View File
@@ -42,7 +42,7 @@ export function typeSplit (type: string): string[] {
} }
} }
assert(isNotNested(cDepth, fDepth, sDepth, tDepth), `Invalid definition (missing terminators) found in ${type}`); assert(isNotNested(cDepth, fDepth, sDepth, tDepth), () => `Invalid definition (missing terminators) found in ${type}`);
// the final leg of the journey // the final leg of the journey
result.push(type.substr(start, type.length - start).trim()); result.push(type.substr(start, type.length - start).trim());
+1 -1
View File
@@ -206,7 +206,7 @@ export class GenericExtrinsic<A extends AnyTuple = AnyTuple> extends ExtrinsicBa
const [offset, length] = compactFromU8a(value); const [offset, length] = compactFromU8a(value);
const total = offset + length.toNumber(); const total = offset + length.toNumber();
assert(total <= value.length, `Extrinsic: length less than remainder, expected at least ${total}, found ${value.length}`); assert(total <= value.length, () => `Extrinsic: length less than remainder, expected at least ${total}, found ${value.length}`);
const data = value.subarray(offset, total); const data = value.subarray(offset, total);
+2 -2
View File
@@ -246,7 +246,7 @@ export class GenericExtrinsicEra extends Enum implements IExtrinsicEra {
* @description Returns the item as a [[ImmortalEra]] * @description Returns the item as a [[ImmortalEra]]
*/ */
public get asImmortalEra (): ImmortalEra { public get asImmortalEra (): ImmortalEra {
assert(this.isImmortalEra, `Cannot convert '${this.type}' via asImmortalEra`); assert(this.isImmortalEra, () => `Cannot convert '${this.type}' via asImmortalEra`);
return this.value as ImmortalEra; return this.value as ImmortalEra;
} }
@@ -255,7 +255,7 @@ export class GenericExtrinsicEra extends Enum implements IExtrinsicEra {
* @description Returns the item as a [[MortalEra]] * @description Returns the item as a [[MortalEra]]
*/ */
public get asMortalEra (): MortalEra { public get asMortalEra (): MortalEra {
assert(this.isMortalEra, `Cannot convert '${this.type}' via asMortalEra`); assert(this.isMortalEra, () => `Cannot convert '${this.type}' via asMortalEra`);
return this.value as MortalEra; return this.value as MortalEra;
} }
@@ -6,7 +6,7 @@ import type { Address, Balance, Call, Index } from '../../interfaces/runtime';
import type { ExtrinsicPayloadValue, IExtrinsicSignature, IKeyringPair, Registry, SignatureOptions } from '../../types'; import type { ExtrinsicPayloadValue, IExtrinsicSignature, IKeyringPair, Registry, SignatureOptions } from '../../types';
import type { ExtrinsicSignatureOptions } from '../types'; import type { ExtrinsicSignatureOptions } from '../types';
import { isU8a, u8aConcat, u8aToHex } from '@polkadot/util'; import { assert, isU8a, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
import { Compact } from '../../codec/Compact'; import { Compact } from '../../codec/Compact';
import { Enum } from '../../codec/Enum'; import { Enum } from '../../codec/Enum';
@@ -155,6 +155,8 @@ export class GenericExtrinsicSignatureV4 extends Struct implements IExtrinsicSig
* @description Generate a payload and applies the signature from a keypair * @description Generate a payload and applies the signature from a keypair
*/ */
public sign (method: Call, account: IKeyringPair, options: SignatureOptions): IExtrinsicSignature { public sign (method: Call, account: IKeyringPair, options: SignatureOptions): IExtrinsicSignature {
assert(account && account.addressRaw, () => `Expected a valid keypair for signing, found ${stringify(account)}`);
const signer = toAddress(this.registry, account.addressRaw); const signer = toAddress(this.registry, account.addressRaw);
const payload = this.createPayload(method, options); const payload = this.createPayload(method, options);
const signature = this.registry.createType('ExtrinsicSignature', payload.sign(account)); const signature = this.registry.createType('ExtrinsicSignature', payload.sign(account));
@@ -166,6 +168,8 @@ export class GenericExtrinsicSignatureV4 extends Struct implements IExtrinsicSig
* @description Generate a payload and applies a fake signature * @description Generate a payload and applies a fake signature
*/ */
public signFake (method: Call, address: Address | Uint8Array | string, options: SignatureOptions): IExtrinsicSignature { public signFake (method: Call, address: Address | Uint8Array | string, options: SignatureOptions): IExtrinsicSignature {
assert(address, () => `Expected a valid address for signing, found ${stringify(address)}`);
const signer = toAddress(this.registry, address); const signer = toAddress(this.registry, address);
const payload = this.createPayload(method, options); const payload = this.createPayload(method, options);
const signature = this.registry.createType('ExtrinsicSignature', u8aConcat(this.#fakePrefix, new Uint8Array(64).fill(0x42))); const signature = this.registry.createType('ExtrinsicSignature', u8aConcat(this.#fakePrefix, new Uint8Array(64).fill(0x42)));
+2 -6
View File
@@ -35,15 +35,11 @@ export class GenericAccountId extends U8aFixed {
const decoded = decodeAccountId(value); const decoded = decodeAccountId(value);
// Part of stream containing >= 32 bytes or a all empty (defaults) // Part of stream containing >= 32 bytes or a all empty (defaults)
assert(decoded.length >= 32 || !decoded.some((b) => b), `Invalid AccountId provided, expected 32 bytes, found ${decoded.length}`); assert(decoded.length >= 32 || !decoded.some((b) => b), () => `Invalid AccountId provided, expected 32 bytes, found ${decoded.length}`);
super(registry, decoded, 256); super(registry, decoded, 256);
} }
public static encode (value: Uint8Array, ss58Format?: number): string {
return encodeAddress(value, ss58Format);
}
/** /**
* @description Compares the value of the input to see if there is a match * @description Compares the value of the input to see if there is a match
*/ */
@@ -69,7 +65,7 @@ export class GenericAccountId extends U8aFixed {
* @description Returns the string representation of the value * @description Returns the string representation of the value
*/ */
public toString (): string { public toString (): string {
return GenericAccountId.encode(this, this.registry.chainSS58); return encodeAddress(this, this.registry.chainSS58);
} }
/** /**
+1 -1
View File
@@ -16,7 +16,7 @@ describe('Call', (): void => {
it('handles decoding correctly (bare)', (): void => { it('handles decoding correctly (bare)', (): void => {
expect( expect(
new Call(registry, { new Call(registry, {
args: [], args: ['0x0000000000000000000000000000000000000000000000000000000000000000', 0, 0],
callIndex: [6, 1] // balances.setBalance callIndex: [6, 1] // balances.setBalance
}).toU8a() }).toU8a()
).toEqual( ).toEqual(
@@ -0,0 +1,41 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { Definitions } from '../../types';
export default {
rpc: {
subscribeJustifications: {
description: 'Returns the block most recently finalized by BEEFY, alongside side its justification.',
params: [],
pubsub: [
'justifications',
'subscribeJustifications',
'unsubscribeJustifications'
],
type: 'BeefySignedCommitment'
}
},
types: {
BeefyCommitment: {
payload: 'BeefyPayload',
blockNumber: 'BlockNumber',
validatorSetId: 'ValidatorSetId'
},
BeefySignedCommitment: {
commitment: 'BeefyCommitment',
signatures: 'Vec<Option<Signature>>'
},
BeefyNextAuthoritySet: {
id: 'u64',
len: 'u32',
root: 'H256'
},
BeefyPayload: 'MmrRootHash',
MmrRootHash: 'H256',
ValidatorSetId: 'u64'
}
} as Definitions;
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export * from './types';
@@ -0,0 +1,37 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Option, Struct, Vec, u32, u64 } from '@polkadot/types';
import type { Signature } from '@polkadot/types/interfaces/extrinsics';
import type { BlockNumber, H256 } from '@polkadot/types/interfaces/runtime';
/** @name BeefyCommitment */
export interface BeefyCommitment extends Struct {
readonly payload: BeefyPayload;
readonly blockNumber: BlockNumber;
readonly validatorSetId: ValidatorSetId;
}
/** @name BeefyNextAuthoritySet */
export interface BeefyNextAuthoritySet extends Struct {
readonly id: u64;
readonly len: u32;
readonly root: H256;
}
/** @name BeefyPayload */
export interface BeefyPayload extends MmrRootHash {}
/** @name BeefySignedCommitment */
export interface BeefySignedCommitment extends Struct {
readonly commitment: BeefyCommitment;
readonly signatures: Vec<Option<Signature>>;
}
/** @name MmrRootHash */
export interface MmrRootHash extends H256 {}
/** @name ValidatorSetId */
export interface ValidatorSetId extends u64 {}
export type PHANTOM_BEEFY = 'beefy';
@@ -18,7 +18,6 @@ export default {
} }
}, },
FundInfo: { FundInfo: {
retiring: 'bool',
depositor: 'AccountId', depositor: 'AccountId',
verifier: 'Option<MultiSigner>', verifier: 'Option<MultiSigner>',
deposit: 'Balance', deposit: 'Balance',
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */ /* eslint-disable */
import type { Enum, Option, Struct, bool, u32 } from '@polkadot/types'; import type { Enum, Option, Struct, u32 } from '@polkadot/types';
import type { LeasePeriod } from '@polkadot/types/interfaces/parachains'; import type { LeasePeriod } from '@polkadot/types/interfaces/parachains';
import type { AccountId, Balance, BlockNumber, MultiSigner } from '@polkadot/types/interfaces/runtime'; import type { AccountId, Balance, BlockNumber, MultiSigner } from '@polkadot/types/interfaces/runtime';
@@ -10,7 +10,6 @@ export interface FundIndex extends u32 {}
/** @name FundInfo */ /** @name FundInfo */
export interface FundInfo extends Struct { export interface FundInfo extends Struct {
readonly retiring: bool;
readonly depositor: AccountId; readonly depositor: AccountId;
readonly verifier: Option<MultiSigner>; readonly verifier: Option<MultiSigner>;
readonly deposit: Balance; readonly deposit: Balance;
@@ -42,11 +42,13 @@ export { default as vesting } from './vesting/definitions';
// polkadot-specific types // polkadot-specific types
export { default as attestations } from './attestations/definitions'; export { default as attestations } from './attestations/definitions';
export { default as beefy } from './beefy/definitions';
export { default as claims } from './claims/definitions'; export { default as claims } from './claims/definitions';
export { default as crowdloan } from './crowdloan/definitions'; export { default as crowdloan } from './crowdloan/definitions';
export { default as parachains } from './parachains/definitions'; export { default as parachains } from './parachains/definitions';
export { default as poll } from './poll/definitions'; export { default as poll } from './poll/definitions';
export { default as purchase } from './purchase/definitions'; export { default as purchase } from './purchase/definitions';
export { default as xcm } from './xcm/definitions';
// scale-info & contracts // scale-info & contracts
export { default as contractsAbi } from './contractsAbi/definitions'; export { default as contractsAbi } from './contractsAbi/definitions';
@@ -104,13 +104,14 @@ export default {
}, },
CandidateDescriptor: { CandidateDescriptor: {
paraId: 'ParaId', paraId: 'ParaId',
relayParent: 'Hash', relayParent: 'RelayChainHash',
collatorId: 'CollatorId', collatorId: 'CollatorId',
persistedValidationDataHash: 'Hash', persistedValidationDataHash: 'Hash',
povHash: 'Hash', povHash: 'Hash',
erasureRoot: 'Hash', erasureRoot: 'Hash',
signature: 'CollatorSignature', signature: 'CollatorSignature',
paraHead: 'Hash' paraHead: 'Hash',
validationCodeHash: 'Hash'
}, },
CandidateHash: 'Hash', CandidateHash: 'Hash',
CandidatePendingAvailability: { CandidatePendingAvailability: {
@@ -126,6 +127,11 @@ export default {
descriptor: 'CandidateDescriptor', descriptor: 'CandidateDescriptor',
commitmentsHash: 'Hash' commitmentsHash: 'Hash'
}, },
GlobalValidationData: {
maxCodeSize: 'u32',
maxHeadDataSize: 'u32',
blockNumber: 'BlockNumber'
},
CollatorId: 'H256', CollatorId: 'H256',
CollatorSignature: 'Signature', CollatorSignature: 'Signature',
CommittedCandidateReceipt: { CommittedCandidateReceipt: {
@@ -145,6 +151,36 @@ export default {
Parachain: 'Null' Parachain: 'Null'
} }
}, },
DisputeStatementSet: {
candidateHash: 'CandidateHash',
session: 'SessionIndex',
statements: 'Vec<(DisputeStatement, ValidatorIndex, ValidatorSignature)>'
},
MultiDisputeStatementSet: 'Vec<DisputeStatementSet>',
DisputeStatement: {
_enum: {
Valid: 'ValidDisputeStatementKind',
Invalid: 'InvalidDisputeStatementKind'
}
},
ValidDisputeStatementKind: {
_enum: [
'Explicit',
'BackingSeconded',
'BackingValid',
'ApprovalChecking'
]
},
InvalidDisputeStatementKind: {
_enum: [
'Explicit'
]
},
ExplicitDisputeStatement: {
valid: 'bool',
candidateHash: 'CandidateHash',
session: 'SessionIndex'
},
DoubleVoteReport: { DoubleVoteReport: {
identity: 'ValidatorId', identity: 'ValidatorId',
first: '(Statement, ValidatorSignature)', first: '(Statement, ValidatorSignature)',
@@ -231,6 +267,12 @@ export default {
downwardMessages: 'Vec<InboundDownwardMessage>', downwardMessages: 'Vec<InboundDownwardMessage>',
horizontalMessages: 'BTreeMap<ParaId, VecInboundHrmpMessage>' horizontalMessages: 'BTreeMap<ParaId, VecInboundHrmpMessage>'
}, },
ParachainsInherentData: {
bitfields: 'SignedAvailabilityBitfields',
backedCandidates: 'Vec<BackedCandidate>',
disputes: 'MultiDisputeStatementSet',
parentHeader: 'Header'
},
ParaGenesisArgs: { ParaGenesisArgs: {
genesisHead: 'Bytes', genesisHead: 'Bytes',
validationCode: 'Bytes', validationCode: 'Bytes',
@@ -239,7 +281,8 @@ export default {
ParaId: 'u32', ParaId: 'u32',
ParaInfo: { ParaInfo: {
manager: 'AccountId', manager: 'AccountId',
deposit: 'Balance' deposit: 'Balance',
locked: 'bool'
}, },
ParaLifecycle: { ParaLifecycle: {
_enum: ['Onboarding', 'Parathread', 'Parachain', 'UpgradingToParachain', 'DowngradingToParathread', 'OutgoingParathread', 'OutgoingParachain'] _enum: ['Onboarding', 'Parathread', 'Parachain', 'UpgradingToParachain', 'DowngradingToParathread', 'OutgoingParathread', 'OutgoingParachain']
@@ -344,204 +387,6 @@ export default {
Explicit: 'ValidatorSignature' Explicit: 'ValidatorSignature'
} }
}, },
VersionedXcm: {
_enum: {
V0: 'Xcm'
}
},
WithdrawAsset: {
assets: 'Vec<MultiAsset>',
effects: 'Vec<Order>'
},
ReserveAssetDeposit: {
assets: 'Vec<MultiAsset>',
effects: 'Vec<Order>'
},
TeleportAsset: {
assets: 'Vec<MultiAsset>',
effects: 'Vec<Order>'
},
Balances: {
queryId: 'Compact<u64>',
assets: 'Vec<MultiAsset>'
},
Transact: {
originType: 'OriginKind',
call: 'Vec<u8>'
},
RelayTo: {
dest: 'MultiLocation',
inner: 'VersionedXcm'
},
RelayedFrom: {
superorigin: 'MultiLocation',
inner: 'VersionedXcm'
},
Xcm: {
_enum: {
WithdrawAsset: 'WithdrawAsset',
ReserveAssetDeposit: 'ReserveAssetDeposit',
TeleportAsset: 'TeleportAsset',
Balances: 'Balances',
Transact: 'Transact',
RelayTo: 'RelayTo',
RelayedFrom: 'RelayedFrom'
}
},
XcmError: {
_enum: ['Undefined', 'Unimplemented', 'UnhandledXcmVersion', 'UnhandledXcmMessage', 'UnhandledEffect', 'EscalationOfPrivilege', 'UntrustedReserveLocation', 'UntrustedTeleportLocation', 'DestinationBufferOverflow', 'CannotReachDestination', 'MultiLocationFull', 'FailedToDecode', 'BadOrigin']
},
XcmResult: {
_enum: {
Ok: '()',
Err: 'XcmError'
}
},
OriginKind: {
_enum: ['Native', 'SovereignAccount', 'Superuser']
},
NetworkId: {
_enum: {
Any: 'Null',
Named: 'Vec<u8>',
Polkadot: 'Null',
Kusama: 'Null'
}
},
MultiLocation: {
_enum: {
Null: 'Null',
X1: 'Junction',
X2: '(Junction, Junction)',
X3: '(Junction, Junction, Junction)',
X4: '(Junction, Junction, Junction, Junction)',
X5: '(Junction, Junction, Junction, Junction, Junction)',
X6: '(Junction, Junction, Junction, Junction, Junction, Junction)',
X7: '(Junction, Junction, Junction, Junction, Junction, Junction, Junction)',
X8: '(Junction, Junction, Junction, Junction, Junction, Junction, Junction, Junction)'
}
},
AccountId32Junction: {
network: 'NetworkId',
id: 'AccountId'
},
AccountIndex64Junction: {
network: 'NetworkId',
index: 'Compact<u64>'
},
AccountKey20Junction: {
network: 'NetworkId',
index: '[u8; 20]'
},
Junction: {
_enum: {
Parent: 'Null',
Parachain: 'Compact<u32>',
AccountId32: 'AccountId32Junction',
AccountIndex64: 'AccountIndex64Junction',
AccountKey20: 'AccountKey20Junction',
PalletInstance: 'u8',
GeneralIndex: 'Compact<u128>',
GeneralKey: 'Vec<u8>',
OnlyChild: 'Null'
}
},
VersionedMultiLocation: {
_enum: {
V0: 'MultiLocation'
}
},
AssetInstance: {
_enum: {
Undefined: 'Null',
Index8: 'u8',
Index16: 'Compact<u16>',
Index32: 'Compact<u32>',
Index64: 'Compact<u64>',
Index128: 'Compact<u128>',
Array4: '[u8; 4]',
Array8: '[u8; 8]',
Array16: '[u8; 16]',
Array32: '[u8; 32]',
Blob: 'Vec<u8>'
}
},
AbstractFungible: {
id: 'Vec<u8>',
instance: 'Compact<u128>'
},
AbstractNonFungible: {
class: 'Vec<u8>',
instance: 'AssetInstance'
},
ConcreteFungible: {
id: 'MultiLocation',
amount: 'Compact<u128>'
},
ConcreteNonFungible: {
class: 'MultiLocation',
instance: 'AssetInstance'
},
MultiAsset: {
_enum: {
None: 'Null',
All: 'Null',
AllFungible: 'Null',
AllNonFungible: 'Null',
AllAbstractFungible: 'Vec<u8>',
AllAbstractNonFungible: 'Vec<u8>',
AllConcreteFungible: 'MultiLocation',
AllConcreteNonFungible: 'MultiLocation',
AbstractFungible: 'AbstractFungible',
AbstractNonFungible: 'AbstractNonFungible',
ConcreteFungible: 'ConcreteFungible',
ConcreteNonFungible: 'ConcreteNonFungible'
}
},
VersionedMultiAsset: {
_enum: {
V0: 'MultiAsset'
}
},
DepositAsset: {
assets: 'Vec<MultiAsset>',
dest: 'MultiLocation'
},
DepositReserveAsset: {
assets: 'Vec<MultiAsset>',
dest: 'MultiLocation',
effects: 'Vec<Order>'
},
ExchangeAsset: {
give: 'Vec<MultiAsset>',
receive: 'Vec<MultiAsset>'
},
InitiateReserveWithdraw: {
assets: 'Vec<MultiAsset>',
reserve: 'MultiLocation',
effects: 'Vec<Order>'
},
InitiateTeleport: {
assets: 'Vec<MultiAsset>',
dest: 'MultiLocation',
effects: 'Vec<Order>'
},
QueryHolding: {
queryId: 'Compact<u64>',
dest: 'MultiLocation',
assets: 'Vec<MultiAsset>'
},
Order: {
_enum: {
Null: 'Null',
DepositAsset: 'DepositAsset',
DepositReserveAsset: 'DepositReserveAsset',
ExchangeAsset: 'ExchangeAsset',
InitiateReserveWithdraw: 'InitiateReserveWithdraw',
InitiateTeleport: 'InitiateTeleport',
QueryHolding: 'QueryHolding'
}
},
MessagingStateSnapshot: { MessagingStateSnapshot: {
relayDispatchQueueSize: '(u32, u32)', relayDispatchQueueSize: '(u32, u32)',
egressChannels: 'Vec<MessagingStateSnapshotEgressEntry>' egressChannels: 'Vec<MessagingStateSnapshotEgressEntry>'
+50 -302
View File
@@ -1,11 +1,12 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */ /* eslint-disable */
import type { BTreeMap, BitVec, Bytes, Compact, Enum, Option, Struct, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types'; import type { BTreeMap, BitVec, Bytes, Enum, Option, Struct, U8aFixed, Vec, bool, u32 } from '@polkadot/types';
import type { ITuple } from '@polkadot/types/types'; import type { ITuple } from '@polkadot/types/types';
import type { Signature } from '@polkadot/types/interfaces/extrinsics'; import type { Signature } from '@polkadot/types/interfaces/extrinsics';
import type { AccountId, Balance, BalanceOf, BlockNumber, H256, Hash, StorageProof, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime'; import type { AccountId, Balance, BalanceOf, BlockNumber, H256, Hash, Header, StorageProof, ValidatorId, Weight } from '@polkadot/types/interfaces/runtime';
import type { MembershipProof, SessionIndex } from '@polkadot/types/interfaces/session'; import type { MembershipProof, SessionIndex } from '@polkadot/types/interfaces/session';
import type { ValidatorIndex } from '@polkadot/types/interfaces/staking';
/** @name AbridgedCandidateReceipt */ /** @name AbridgedCandidateReceipt */
export interface AbridgedCandidateReceipt extends Struct { export interface AbridgedCandidateReceipt extends Struct {
@@ -41,61 +42,6 @@ export interface AbridgedHrmpChannel extends Struct {
readonly mqcHead: Option<Hash>; readonly mqcHead: Option<Hash>;
} }
/** @name AbstractFungible */
export interface AbstractFungible extends Struct {
readonly id: Bytes;
readonly instance: Compact<u128>;
}
/** @name AbstractNonFungible */
export interface AbstractNonFungible extends Struct {
readonly class: Bytes;
readonly instance: AssetInstance;
}
/** @name AccountId32Junction */
export interface AccountId32Junction extends Struct {
readonly network: NetworkId;
readonly id: AccountId;
}
/** @name AccountIndex64Junction */
export interface AccountIndex64Junction extends Struct {
readonly network: NetworkId;
readonly index: Compact<u64>;
}
/** @name AccountKey20Junction */
export interface AccountKey20Junction extends Struct {
readonly network: NetworkId;
readonly index: U8aFixed;
}
/** @name AssetInstance */
export interface AssetInstance extends Enum {
readonly isUndefined: boolean;
readonly isIndex8: boolean;
readonly asIndex8: u8;
readonly isIndex16: boolean;
readonly asIndex16: Compact<u16>;
readonly isIndex32: boolean;
readonly asIndex32: Compact<u32>;
readonly isIndex64: boolean;
readonly asIndex64: Compact<u64>;
readonly isIndex128: boolean;
readonly asIndex128: Compact<u128>;
readonly isArray4: boolean;
readonly asArray4: U8aFixed;
readonly isArray8: boolean;
readonly asArray8: U8aFixed;
readonly isArray16: boolean;
readonly asArray16: U8aFixed;
readonly isArray32: boolean;
readonly asArray32: U8aFixed;
readonly isBlob: boolean;
readonly asBlob: Bytes;
}
/** @name AssignmentId */ /** @name AssignmentId */
export interface AssignmentId extends AccountId {} export interface AssignmentId extends AccountId {}
@@ -135,12 +81,6 @@ export interface BackedCandidate extends Struct {
readonly validatorIndices: BitVec; readonly validatorIndices: BitVec;
} }
/** @name Balances */
export interface Balances extends Struct {
readonly queryId: Compact<u64>;
readonly assets: Vec<MultiAsset>;
}
/** @name Bidder */ /** @name Bidder */
export interface Bidder extends Enum { export interface Bidder extends Enum {
readonly isNew: boolean; readonly isNew: boolean;
@@ -170,13 +110,14 @@ export interface CandidateCommitments extends Struct {
/** @name CandidateDescriptor */ /** @name CandidateDescriptor */
export interface CandidateDescriptor extends Struct { export interface CandidateDescriptor extends Struct {
readonly paraId: ParaId; readonly paraId: ParaId;
readonly relayParent: Hash; readonly relayParent: RelayChainHash;
readonly collatorId: CollatorId; readonly collatorId: CollatorId;
readonly persistedValidationDataHash: Hash; readonly persistedValidationDataHash: Hash;
readonly povHash: Hash; readonly povHash: Hash;
readonly erasureRoot: Hash; readonly erasureRoot: Hash;
readonly signature: CollatorSignature; readonly signature: CollatorSignature;
readonly paraHead: Hash; readonly paraHead: Hash;
readonly validationCodeHash: Hash;
} }
/** @name CandidateHash */ /** @name CandidateHash */
@@ -211,18 +152,6 @@ export interface CommittedCandidateReceipt extends Struct {
readonly commitments: CandidateCommitments; readonly commitments: CandidateCommitments;
} }
/** @name ConcreteFungible */
export interface ConcreteFungible extends Struct {
readonly id: MultiLocation;
readonly amount: Compact<u128>;
}
/** @name ConcreteNonFungible */
export interface ConcreteNonFungible extends Struct {
readonly class: MultiLocation;
readonly instance: AssetInstance;
}
/** @name CoreAssignment */ /** @name CoreAssignment */
export interface CoreAssignment extends Struct { export interface CoreAssignment extends Struct {
readonly core: CoreIndex; readonly core: CoreIndex;
@@ -241,17 +170,19 @@ export interface CoreOccupied extends Enum {
readonly isParachain: boolean; readonly isParachain: boolean;
} }
/** @name DepositAsset */ /** @name DisputeStatement */
export interface DepositAsset extends Struct { export interface DisputeStatement extends Enum {
readonly assets: Vec<MultiAsset>; readonly isValid: boolean;
readonly dest: MultiLocation; readonly asValid: ValidDisputeStatementKind;
readonly isInvalid: boolean;
readonly asInvalid: InvalidDisputeStatementKind;
} }
/** @name DepositReserveAsset */ /** @name DisputeStatementSet */
export interface DepositReserveAsset extends Struct { export interface DisputeStatementSet extends Struct {
readonly assets: Vec<MultiAsset>; readonly candidateHash: CandidateHash;
readonly dest: MultiLocation; readonly session: SessionIndex;
readonly effects: Vec<Order>; readonly statements: Vec<ITuple<[DisputeStatement, ValidatorIndex, ValidatorSignature]>>;
} }
/** @name DoubleVoteReport */ /** @name DoubleVoteReport */
@@ -266,10 +197,18 @@ export interface DoubleVoteReport extends Struct {
/** @name DownwardMessage */ /** @name DownwardMessage */
export interface DownwardMessage extends Bytes {} export interface DownwardMessage extends Bytes {}
/** @name ExchangeAsset */ /** @name ExplicitDisputeStatement */
export interface ExchangeAsset extends Struct { export interface ExplicitDisputeStatement extends Struct {
readonly give: Vec<MultiAsset>; readonly valid: bool;
readonly receive: Vec<MultiAsset>; readonly candidateHash: CandidateHash;
readonly session: SessionIndex;
}
/** @name GlobalValidationData */
export interface GlobalValidationData extends Struct {
readonly maxCodeSize: u32;
readonly maxHeadDataSize: u32;
readonly blockNumber: BlockNumber;
} }
/** @name GlobalValidationSchedule */ /** @name GlobalValidationSchedule */
@@ -392,38 +331,9 @@ export interface IncomingParachainFixed extends Struct {
readonly initialHeadData: HeadData; readonly initialHeadData: HeadData;
} }
/** @name InitiateReserveWithdraw */ /** @name InvalidDisputeStatementKind */
export interface InitiateReserveWithdraw extends Struct { export interface InvalidDisputeStatementKind extends Enum {
readonly assets: Vec<MultiAsset>; readonly isExplicit: boolean;
readonly reserve: MultiLocation;
readonly effects: Vec<Order>;
}
/** @name InitiateTeleport */
export interface InitiateTeleport extends Struct {
readonly assets: Vec<MultiAsset>;
readonly dest: MultiLocation;
readonly effects: Vec<Order>;
}
/** @name Junction */
export interface Junction extends Enum {
readonly isParent: boolean;
readonly isParachain: boolean;
readonly asParachain: Compact<u32>;
readonly isAccountId32: boolean;
readonly asAccountId32: AccountId32Junction;
readonly isAccountIndex64: boolean;
readonly asAccountIndex64: AccountIndex64Junction;
readonly isAccountKey20: boolean;
readonly asAccountKey20: AccountKey20Junction;
readonly isPalletInstance: boolean;
readonly asPalletInstance: u8;
readonly isGeneralIndex: boolean;
readonly asGeneralIndex: Compact<u128>;
readonly isGeneralKey: boolean;
readonly asGeneralKey: Bytes;
readonly isOnlyChild: boolean;
} }
/** @name LeasePeriod */ /** @name LeasePeriod */
@@ -457,59 +367,8 @@ export interface MessagingStateSnapshot extends Struct {
/** @name MessagingStateSnapshotEgressEntry */ /** @name MessagingStateSnapshotEgressEntry */
export interface MessagingStateSnapshotEgressEntry extends ITuple<[ParaId, AbridgedHrmpChannel]> {} export interface MessagingStateSnapshotEgressEntry extends ITuple<[ParaId, AbridgedHrmpChannel]> {}
/** @name MultiAsset */ /** @name MultiDisputeStatementSet */
export interface MultiAsset extends Enum { export interface MultiDisputeStatementSet extends Vec<DisputeStatementSet> {}
readonly isNone: boolean;
readonly isAll: boolean;
readonly isAllFungible: boolean;
readonly isAllNonFungible: boolean;
readonly isAllAbstractFungible: boolean;
readonly asAllAbstractFungible: Bytes;
readonly isAllAbstractNonFungible: boolean;
readonly asAllAbstractNonFungible: Bytes;
readonly isAllConcreteFungible: boolean;
readonly asAllConcreteFungible: MultiLocation;
readonly isAllConcreteNonFungible: boolean;
readonly asAllConcreteNonFungible: MultiLocation;
readonly isAbstractFungible: boolean;
readonly asAbstractFungible: AbstractFungible;
readonly isAbstractNonFungible: boolean;
readonly asAbstractNonFungible: AbstractNonFungible;
readonly isConcreteFungible: boolean;
readonly asConcreteFungible: ConcreteFungible;
readonly isConcreteNonFungible: boolean;
readonly asConcreteNonFungible: ConcreteNonFungible;
}
/** @name MultiLocation */
export interface MultiLocation extends Enum {
readonly isNull: boolean;
readonly isX1: boolean;
readonly asX1: Junction;
readonly isX2: boolean;
readonly asX2: ITuple<[Junction, Junction]>;
readonly isX3: boolean;
readonly asX3: ITuple<[Junction, Junction, Junction]>;
readonly isX4: boolean;
readonly asX4: ITuple<[Junction, Junction, Junction, Junction]>;
readonly isX5: boolean;
readonly asX5: ITuple<[Junction, Junction, Junction, Junction, Junction]>;
readonly isX6: boolean;
readonly asX6: ITuple<[Junction, Junction, Junction, Junction, Junction, Junction]>;
readonly isX7: boolean;
readonly asX7: ITuple<[Junction, Junction, Junction, Junction, Junction, Junction, Junction]>;
readonly isX8: boolean;
readonly asX8: ITuple<[Junction, Junction, Junction, Junction, Junction, Junction, Junction, Junction]>;
}
/** @name NetworkId */
export interface NetworkId extends Enum {
readonly isAny: boolean;
readonly isNamed: boolean;
readonly asNamed: Bytes;
readonly isPolkadot: boolean;
readonly isKusama: boolean;
}
/** @name NewBidder */ /** @name NewBidder */
export interface NewBidder extends Struct { export interface NewBidder extends Struct {
@@ -517,30 +376,6 @@ export interface NewBidder extends Struct {
readonly sub: SubId; readonly sub: SubId;
} }
/** @name Order */
export interface Order extends Enum {
readonly isNull: boolean;
readonly isDepositAsset: boolean;
readonly asDepositAsset: DepositAsset;
readonly isDepositReserveAsset: boolean;
readonly asDepositReserveAsset: DepositReserveAsset;
readonly isExchangeAsset: boolean;
readonly asExchangeAsset: ExchangeAsset;
readonly isInitiateReserveWithdraw: boolean;
readonly asInitiateReserveWithdraw: InitiateReserveWithdraw;
readonly isInitiateTeleport: boolean;
readonly asInitiateTeleport: InitiateTeleport;
readonly isQueryHolding: boolean;
readonly asQueryHolding: QueryHolding;
}
/** @name OriginKind */
export interface OriginKind extends Enum {
readonly isNative: boolean;
readonly isSovereignAccount: boolean;
readonly isSuperuser: boolean;
}
/** @name OutboundHrmpMessage */ /** @name OutboundHrmpMessage */
export interface OutboundHrmpMessage extends Struct { export interface OutboundHrmpMessage extends Struct {
readonly recipient: u32; readonly recipient: u32;
@@ -571,6 +406,14 @@ export interface ParachainProposal extends Struct {
readonly balance: Balance; readonly balance: Balance;
} }
/** @name ParachainsInherentData */
export interface ParachainsInherentData extends Struct {
readonly bitfields: SignedAvailabilityBitfields;
readonly backedCandidates: Vec<BackedCandidate>;
readonly disputes: MultiDisputeStatementSet;
readonly parentHeader: Header;
}
/** @name ParaGenesisArgs */ /** @name ParaGenesisArgs */
export interface ParaGenesisArgs extends Struct { export interface ParaGenesisArgs extends Struct {
readonly genesisHead: Bytes; readonly genesisHead: Bytes;
@@ -585,6 +428,7 @@ export interface ParaId extends u32 {}
export interface ParaInfo extends Struct { export interface ParaInfo extends Struct {
readonly manager: AccountId; readonly manager: AccountId;
readonly deposit: Balance; readonly deposit: Balance;
readonly locked: bool;
} }
/** @name ParaLifecycle */ /** @name ParaLifecycle */
@@ -636,13 +480,6 @@ export interface PersistedValidationData extends Struct {
readonly maxPovSize: u32; readonly maxPovSize: u32;
} }
/** @name QueryHolding */
export interface QueryHolding extends Struct {
readonly queryId: Compact<u64>;
readonly dest: MultiLocation;
readonly assets: Vec<MultiAsset>;
}
/** @name QueuedParathread */ /** @name QueuedParathread */
export interface QueuedParathread extends Struct { export interface QueuedParathread extends Struct {
readonly claim: ParathreadEntry; readonly claim: ParathreadEntry;
@@ -661,27 +498,9 @@ export interface RelayChainBlockNumber extends u32 {}
/** @name RelayChainHash */ /** @name RelayChainHash */
export interface RelayChainHash extends Hash {} export interface RelayChainHash extends Hash {}
/** @name RelayedFrom */
export interface RelayedFrom extends Struct {
readonly superorigin: MultiLocation;
readonly inner: VersionedXcm;
}
/** @name RelayTo */
export interface RelayTo extends Struct {
readonly dest: MultiLocation;
readonly inner: VersionedXcm;
}
/** @name Remark */ /** @name Remark */
export interface Remark extends U8aFixed {} export interface Remark extends U8aFixed {}
/** @name ReserveAssetDeposit */
export interface ReserveAssetDeposit extends Struct {
readonly assets: Vec<MultiAsset>;
readonly effects: Vec<Order>;
}
/** @name Retriable */ /** @name Retriable */
export interface Retriable extends Enum { export interface Retriable extends Enum {
readonly isNever: boolean; readonly isNever: boolean;
@@ -765,18 +584,6 @@ export interface SubId extends u32 {}
/** @name SystemInherentData */ /** @name SystemInherentData */
export interface SystemInherentData extends ParachainInherentData {} export interface SystemInherentData extends ParachainInherentData {}
/** @name TeleportAsset */
export interface TeleportAsset extends Struct {
readonly assets: Vec<MultiAsset>;
readonly effects: Vec<Order>;
}
/** @name Transact */
export interface Transact extends Struct {
readonly originType: OriginKind;
readonly call: Bytes;
}
/** @name TransientValidationData */ /** @name TransientValidationData */
export interface TransientValidationData extends Struct { export interface TransientValidationData extends Struct {
readonly maxCodeSize: u32; readonly maxCodeSize: u32;
@@ -814,6 +621,14 @@ export interface ValidationFunctionParams extends Struct {
/** @name ValidatorSignature */ /** @name ValidatorSignature */
export interface ValidatorSignature extends Signature {} export interface ValidatorSignature extends Signature {}
/** @name ValidDisputeStatementKind */
export interface ValidDisputeStatementKind extends Enum {
readonly isExplicit: boolean;
readonly isBackingSeconded: boolean;
readonly isBackingValid: boolean;
readonly isApprovalChecking: boolean;
}
/** @name ValidityAttestation */ /** @name ValidityAttestation */
export interface ValidityAttestation extends Enum { export interface ValidityAttestation extends Enum {
readonly isNever: boolean; readonly isNever: boolean;
@@ -826,24 +641,6 @@ export interface ValidityAttestation extends Enum {
/** @name VecInboundHrmpMessage */ /** @name VecInboundHrmpMessage */
export interface VecInboundHrmpMessage extends Vec<InboundHrmpMessage> {} export interface VecInboundHrmpMessage extends Vec<InboundHrmpMessage> {}
/** @name VersionedMultiAsset */
export interface VersionedMultiAsset extends Enum {
readonly isV0: boolean;
readonly asV0: MultiAsset;
}
/** @name VersionedMultiLocation */
export interface VersionedMultiLocation extends Enum {
readonly isV0: boolean;
readonly asV0: MultiLocation;
}
/** @name VersionedXcm */
export interface VersionedXcm extends Enum {
readonly isV0: boolean;
readonly asV0: Xcm;
}
/** @name WinnersData */ /** @name WinnersData */
export interface WinnersData extends Vec<WinnersDataTuple> {} export interface WinnersData extends Vec<WinnersDataTuple> {}
@@ -856,53 +653,4 @@ export interface WinningData extends Vec<WinningDataEntry> {}
/** @name WinningDataEntry */ /** @name WinningDataEntry */
export interface WinningDataEntry extends Option<ITuple<[AccountId, ParaId, BalanceOf]>> {} export interface WinningDataEntry extends Option<ITuple<[AccountId, ParaId, BalanceOf]>> {}
/** @name WithdrawAsset */
export interface WithdrawAsset extends Struct {
readonly assets: Vec<MultiAsset>;
readonly effects: Vec<Order>;
}
/** @name Xcm */
export interface Xcm extends Enum {
readonly isWithdrawAsset: boolean;
readonly asWithdrawAsset: WithdrawAsset;
readonly isReserveAssetDeposit: boolean;
readonly asReserveAssetDeposit: ReserveAssetDeposit;
readonly isTeleportAsset: boolean;
readonly asTeleportAsset: TeleportAsset;
readonly isBalances: boolean;
readonly asBalances: Balances;
readonly isTransact: boolean;
readonly asTransact: Transact;
readonly isRelayTo: boolean;
readonly asRelayTo: RelayTo;
readonly isRelayedFrom: boolean;
readonly asRelayedFrom: RelayedFrom;
}
/** @name XcmError */
export interface XcmError extends Enum {
readonly isUndefined: boolean;
readonly isUnimplemented: boolean;
readonly isUnhandledXcmVersion: boolean;
readonly isUnhandledXcmMessage: boolean;
readonly isUnhandledEffect: boolean;
readonly isEscalationOfPrivilege: boolean;
readonly isUntrustedReserveLocation: boolean;
readonly isUntrustedTeleportLocation: boolean;
readonly isDestinationBufferOverflow: boolean;
readonly isCannotReachDestination: boolean;
readonly isMultiLocationFull: boolean;
readonly isFailedToDecode: boolean;
readonly isBadOrigin: boolean;
}
/** @name XcmResult */
export interface XcmResult extends Enum {
readonly isOk: boolean;
readonly asOk: ITuple<[]>;
readonly isErr: boolean;
readonly asErr: XcmError;
}
export type PHANTOM_PARACHAINS = 'parachains'; export type PHANTOM_PARACHAINS = 'parachains';

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