Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dc121a796 | ||
|
|
a827131457 | ||
|
|
2174537f76 | ||
|
|
53fca2406a | ||
|
|
0eaba284ae | ||
|
|
378f359a76 | ||
|
|
5460d96b5d | ||
|
|
b1353edc84 | ||
|
|
9129fed6e5 | ||
|
|
7c4abacaca | ||
|
|
3664c7d81b | ||
|
|
f75b87c5a5 | ||
|
|
1c228216cd | ||
|
|
cec3c12795 | ||
|
|
0d0d12e85b | ||
|
|
3a16e69be5 | ||
|
|
4ae8e3909f | ||
|
|
6e18bb3b1d | ||
|
|
be153e13a6 | ||
|
|
4c01dfd0ab | ||
|
|
b57c7a1343 | ||
|
|
da62acdf50 | ||
|
|
cc95e4fc0a | ||
|
|
7f5647c6e1 | ||
|
|
c636d63bc0 | ||
|
|
30c98ef857 | ||
|
|
debecde50f | ||
|
|
cd2cdd1184 | ||
|
|
f5c25d75ff | ||
|
|
780cc62942 | ||
|
|
165568c905 | ||
|
|
976a48d8f9 | ||
|
|
35cbbbe0ed | ||
|
|
772769c981 | ||
|
|
1ba2bd1766 | ||
|
|
4afa345a7d | ||
|
|
5c03359f32 | ||
|
|
04120505f0 | ||
|
|
7bd9dd65f8 | ||
|
|
5f57ecb2e1 | ||
|
|
9123f1d805 | ||
|
|
7050c4a554 | ||
|
|
62afb0b534 | ||
|
|
5157ca5608 | ||
|
|
315617c027 | ||
|
|
7d33b4dec6 | ||
|
|
2345f69c71 | ||
|
|
3cef2fb4d5 | ||
|
|
2bbf5513b2 | ||
|
|
c146f06178 | ||
|
|
5903704b61 | ||
|
|
90d8db651b | ||
|
|
557283a3d1 | ||
|
|
88b84dcf75 | ||
|
|
45d190eaca | ||
|
|
6d32328509 | ||
|
|
ba470e7417 | ||
|
|
4a16e46f88 | ||
|
|
ada0d99a84 | ||
|
|
e486fc4316 | ||
|
|
6e5c6f4e0b | ||
|
|
21ddcaf173 | ||
|
|
6085b994f6 | ||
|
|
7c3bf05868 | ||
|
|
8bce5b4a09 | ||
|
|
7a6077301f | ||
|
|
3f2767462f | ||
|
|
ecc37d11df | ||
|
|
0589d151da | ||
|
|
47cd6c6410 | ||
|
|
65688f9e0e | ||
|
|
5eb2a95ef2 | ||
|
|
282b39d27a | ||
|
|
f21e3d317a | ||
|
|
c2af7cf8f2 | ||
|
|
0958a4c693 | ||
|
|
c687181130 | ||
|
|
685f1ec0b6 | ||
|
|
e0069b6f7d | ||
|
|
cf48762ff2 | ||
|
|
31a7545a19 | ||
|
|
5cd8e8fb97 | ||
|
|
96e4090174 | ||
|
|
0bbebab90b | ||
|
|
57dac0ef47 | ||
|
|
6c3d24551b | ||
|
|
e7dc6d7a5a | ||
|
|
a63b7f611e | ||
|
|
82e15dc36d | ||
|
|
6f96037cb5 | ||
|
|
b6da84b8b2 | ||
|
|
41209f074c | ||
|
|
c47964c942 |
+4
-1
@@ -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,6 @@
|
|||||||
3.10.2
|
3.10.2
|
||||||
4.0.2
|
4.0.2
|
||||||
4.0.3
|
4.0.3
|
||||||
|
|
||||||
|
4.6.2
|
||||||
|
4.7.2
|
||||||
+77
-1
@@ -1,5 +1,81 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 4.8.1 May 2, 2021
|
||||||
|
|
||||||
|
Upgrade priority: Low. Recommended when using or developing for parachains.
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- De-alias xcm `Outcome` (used in multiple pallettes)
|
||||||
|
- Adjust xcm types as per latest, e.g. `XcmError`
|
||||||
|
- Fix generate of well-known storage keys (e.g. `:code`)
|
||||||
|
- Optimize metadata unknown type validation
|
||||||
|
- Allow metadata creation for `Map` or `Record`
|
||||||
|
- Expose additional camelCase `method` on `AbiMessage` (maps to decorated name)
|
||||||
|
- Added explicit double-byte ss58 `AccountId` encoding test
|
||||||
|
- Add known upgrade block for Polkadot v30
|
||||||
|
- Cleanup WebSocket handlers when close event has been received
|
||||||
|
- Update to latest Substrate metadata
|
||||||
|
|
||||||
|
|
||||||
|
## 4.7.2 Apr 26, 2021
|
||||||
|
|
||||||
|
Upgrade priority: Low. Recommended for users of 4.7.1 using nvm
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Update `EthBlock`/`EthHeader` types (as per Rust origin)
|
||||||
|
- Updated Xcm `OriginKind` enum
|
||||||
|
- Add derives for `membership`
|
||||||
|
- Cleanups on encodedLength calculations
|
||||||
|
- Update `.nvmrc` to reflect engines changes
|
||||||
|
|
||||||
|
|
||||||
|
## 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
|
## 4.5.1 Apr 12, 2021
|
||||||
|
|
||||||
Upgrade priority: Low. Recommended with usage with the Rococo testnet.
|
Upgrade priority: Low. Recommended with usage with the Rococo testnet.
|
||||||
@@ -9,7 +85,7 @@ Changes:
|
|||||||
- Update parachain types as per latest Polkadot
|
- Update parachain types as per latest Polkadot
|
||||||
- Cater for `Keys` with `BEEFY` session keys
|
- Cater for `Keys` with `BEEFY` session keys
|
||||||
- Update `Keys` injection to allow for on-chain type detection
|
- Update `Keys` injection to allow for on-chain type detection
|
||||||
- Update `Westend` known upgrade points for runtime 50
|
- Add `Westend` known upgrade block for runtime 50
|
||||||
- Align types with latest Substrate master
|
- Align types with latest Substrate master
|
||||||
- Adjust keepalive `system_health` timer
|
- Adjust keepalive `system_health` timer
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ The API is split up into a number of internal packages -
|
|||||||
|
|
||||||
- [@polkadot/api](packages/api/) The API library, providing both Promise and RxJS Observable-based interfaces. This is the main user-facing entry point.
|
- [@polkadot/api](packages/api/) The API library, providing both Promise and RxJS Observable-based interfaces. This is the main user-facing entry point.
|
||||||
- [@polkadot/api-derive](packages/api-derive/) Derived results that are injected into the API, allowing for combinations of various query results (only used internally and exposed on the Api instances via `api.derive.*`)
|
- [@polkadot/api-derive](packages/api-derive/) Derived results that are injected into the API, allowing for combinations of various query results (only used internally and exposed on the Api instances via `api.derive.*`)
|
||||||
- [@polkadot/api-metadata](packages/api-metadata/) Base extrinsic, storage and constant injectors for injection
|
- [@polkadot/metadata](packages/metadata/) Base extrinsic, storage and constant injectors for injection
|
||||||
- [@polkadot/rpc-core](packages/rpc-core/) Wrapper around all [JSON-RPC methods](https://polkadot.js.org/docs/substrate/rpc) exposed by a Polkadot network client
|
- [@polkadot/rpc-core](packages/rpc-core/) Wrapper around all [JSON-RPC methods](https://polkadot.js.org/docs/substrate/rpc) exposed by a Polkadot network client
|
||||||
- [@polkadot/rpc-provider](packages/rpc-provider/) Providers for connecting to nodes, including WebSockets and Http
|
- [@polkadot/rpc-provider](packages/rpc-provider/) Providers for connecting to nodes, including WebSockets and Http
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -25,14 +25,14 @@
|
|||||||
"test:watch": "polkadot-dev-run-test --watch"
|
"test:watch": "polkadot-dev-run-test --watch"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.13.15",
|
"@babel/core": "^7.14.0",
|
||||||
"@babel/register": "^7.13.14",
|
"@babel/register": "^7.13.16",
|
||||||
"@babel/runtime": "^7.13.10",
|
"@babel/runtime": "^7.14.0",
|
||||||
"@polkadot/dev": "^0.62.7",
|
"@polkadot/dev": "^0.62.11",
|
||||||
"@polkadot/ts": "^0.3.62",
|
"@polkadot/ts": "^0.3.64",
|
||||||
"@polkadot/typegen": "workspace:packages/typegen",
|
"@polkadot/typegen": "workspace:packages/typegen",
|
||||||
"@types/jest": "^26.0.22",
|
"@types/jest": "^26.0.23",
|
||||||
"copyfiles": "^2.4.1"
|
"copyfiles": "^2.4.1"
|
||||||
},
|
},
|
||||||
"version": "4.5.1"
|
"version": "4.8.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/api-contract",
|
"name": "@polkadot/api-contract",
|
||||||
"version": "4.5.1",
|
"version": "4.8.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.14.0",
|
||||||
"@polkadot/api": "4.5.1",
|
"@polkadot/api": "4.8.1",
|
||||||
"@polkadot/types": "4.5.1",
|
"@polkadot/types": "4.8.1",
|
||||||
"@polkadot/util": "^6.1.1",
|
"@polkadot/util": "^6.3.1",
|
||||||
"@polkadot/x-rxjs": "^6.1.1",
|
"@polkadot/x-rxjs": "^6.3.1",
|
||||||
"bn.js": "^4.11.9"
|
"bn.js": "^4.11.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -143,6 +143,7 @@ export class Abi {
|
|||||||
|
|
||||||
#createMessage = (spec: ContractMessageSpec | ContractConstructorSpec, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
|
#createMessage = (spec: ContractMessageSpec | ContractConstructorSpec, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
|
||||||
const args = this.#createArgs(spec.args, spec);
|
const args = this.#createArgs(spec.args, spec);
|
||||||
|
const identifier = spec.name.toString();
|
||||||
const message = {
|
const message = {
|
||||||
...add,
|
...add,
|
||||||
args,
|
args,
|
||||||
@@ -151,8 +152,9 @@ export class Abi {
|
|||||||
args: this.#decodeArgs(args, data),
|
args: this.#decodeArgs(args, data),
|
||||||
message
|
message
|
||||||
}),
|
}),
|
||||||
identifier: spec.name.toString(),
|
identifier,
|
||||||
index,
|
index,
|
||||||
|
method: stringCamelCase(identifier),
|
||||||
selector: spec.selector,
|
selector: spec.selector,
|
||||||
toU8a: (params: CodecArg[], additional?: Uint8Array) =>
|
toU8a: (params: CodecArg[], additional?: Uint8Array) =>
|
||||||
this.#encodeArgs(spec, args, params, additional)
|
this.#encodeArgs(spec, args, params, additional)
|
||||||
@@ -186,7 +188,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(
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import type { ContractGeneric, MapConstructorExec } from './types';
|
|||||||
|
|
||||||
import { SubmittableResult } from '@polkadot/api';
|
import { SubmittableResult } from '@polkadot/api';
|
||||||
import { ApiBase } from '@polkadot/api/base';
|
import { ApiBase } from '@polkadot/api/base';
|
||||||
import { isUndefined, stringCamelCase } from '@polkadot/util';
|
import { isUndefined } from '@polkadot/util';
|
||||||
|
|
||||||
import { Abi } from '../Abi';
|
import { Abi } from '../Abi';
|
||||||
import { applyOnEvent } from '../util';
|
import { applyOnEvent } from '../util';
|
||||||
@@ -49,10 +49,8 @@ export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
|
|||||||
this.createContract = createBluePrintWithId(this.#deploy);
|
this.createContract = createBluePrintWithId(this.#deploy);
|
||||||
|
|
||||||
this.abi.constructors.forEach((c): void => {
|
this.abi.constructors.forEach((c): void => {
|
||||||
const messageName = stringCamelCase(c.identifier);
|
if (isUndefined(this.#tx[c.method])) {
|
||||||
|
this.#tx[c.method] = createBluePrintTx((o, p) => this.#deploy(c, o, p));
|
||||||
if (isUndefined(this.#tx[messageName])) {
|
|
||||||
this.#tx[messageName] = createBluePrintTx((o, p) => this.#deploy(c, o, p));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import type { MapConstructorExec } from './types';
|
|||||||
|
|
||||||
import { SubmittableResult } from '@polkadot/api';
|
import { SubmittableResult } from '@polkadot/api';
|
||||||
import { ApiBase } from '@polkadot/api/base';
|
import { ApiBase } from '@polkadot/api/base';
|
||||||
import { assert, compactAddLength, isFunction, isUndefined, isWasm, logger, stringCamelCase, u8aToU8a } from '@polkadot/util';
|
import { assert, compactAddLength, isFunction, isUndefined, isWasm, logger, u8aToU8a } from '@polkadot/util';
|
||||||
import { blake2AsU8a } from '@polkadot/util-crypto';
|
import { blake2AsU8a } from '@polkadot/util-crypto';
|
||||||
|
|
||||||
import { Abi } from '../Abi';
|
import { Abi } from '../Abi';
|
||||||
@@ -49,10 +49,8 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
|
|||||||
assert(isWasm(this.code), 'No WASM code provided');
|
assert(isWasm(this.code), 'No WASM code provided');
|
||||||
|
|
||||||
this.abi.constructors.forEach((c): void => {
|
this.abi.constructors.forEach((c): void => {
|
||||||
const messageName = stringCamelCase(c.identifier);
|
if (isUndefined(this.#tx[c.method])) {
|
||||||
|
this.#tx[c.method] = createBluePrintTx((o, p) => this.#instantiate(c, o, p));
|
||||||
if (isUndefined(this.#tx[messageName])) {
|
|
||||||
this.#tx[messageName] = createBluePrintTx((o, p) => this.#instantiate(c, o, p));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import BN from 'bn.js';
|
|||||||
|
|
||||||
import { SubmittableResult } from '@polkadot/api';
|
import { SubmittableResult } from '@polkadot/api';
|
||||||
import { ApiBase } from '@polkadot/api/base';
|
import { ApiBase } from '@polkadot/api/base';
|
||||||
import { assert, bnToBn, isFunction, isUndefined, logger, stringCamelCase } from '@polkadot/util';
|
import { assert, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
|
||||||
import { map } from '@polkadot/x-rxjs/operators';
|
import { map } from '@polkadot/x-rxjs/operators';
|
||||||
|
|
||||||
import { Abi } from '../Abi';
|
import { Abi } from '../Abi';
|
||||||
@@ -117,14 +117,12 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
|||||||
this.read = createWithId(this.#read, '.read is deprecated, use contract.query.<messageName>(...) instead (where contract refers to this instance)');
|
this.read = createWithId(this.#read, '.read is deprecated, use contract.query.<messageName>(...) instead (where contract refers to this instance)');
|
||||||
|
|
||||||
this.abi.messages.forEach((m): void => {
|
this.abi.messages.forEach((m): void => {
|
||||||
const messageName = stringCamelCase(m.identifier);
|
if (isUndefined(this.#tx[m.method])) {
|
||||||
|
this.#tx[m.method] = createTx((o, p) => this.#exec(m, o, p));
|
||||||
if (isUndefined(this.#tx[messageName])) {
|
|
||||||
this.#tx[messageName] = createTx((o, p) => this.#exec(m, o, p));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isUndefined(this.#query[messageName])) {
|
if (isUndefined(this.#query[m.method])) {
|
||||||
this.#query[messageName] = createQuery((f, o, p) => this.#read(m, o, p).send(f));
|
this.#query[m.method] = createQuery((f, o, p) => this.#read(m, o, p).send(f));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.5.1' };
|
export const packageInfo = { name: '@polkadot/api-contract', version: '4.8.1' };
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export interface AbiMessage {
|
|||||||
isConstructor?: boolean;
|
isConstructor?: boolean;
|
||||||
isMutating?: boolean;
|
isMutating?: boolean;
|
||||||
isPayable?: boolean;
|
isPayable?: boolean;
|
||||||
|
method: string;
|
||||||
returnType?: TypeDef | null;
|
returnType?: TypeDef | null;
|
||||||
selector: ContractSelector;
|
selector: ContractSelector;
|
||||||
toU8a: (params: CodecArg[], additional?: Uint8Array) => Uint8Array;
|
toU8a: (params: CodecArg[], additional?: Uint8Array) => Uint8Array;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/api-derive",
|
"name": "@polkadot/api-derive",
|
||||||
"version": "4.5.1",
|
"version": "4.8.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.14.0",
|
||||||
"@polkadot/api": "4.5.1",
|
"@polkadot/api": "4.8.1",
|
||||||
"@polkadot/rpc-core": "4.5.1",
|
"@polkadot/rpc-core": "4.8.1",
|
||||||
"@polkadot/types": "4.5.1",
|
"@polkadot/types": "4.8.1",
|
||||||
"@polkadot/util": "^6.1.1",
|
"@polkadot/util": "^6.3.1",
|
||||||
"@polkadot/util-crypto": "^6.1.1",
|
"@polkadot/util-crypto": "^6.3.1",
|
||||||
"@polkadot/x-rxjs": "^6.1.1",
|
"@polkadot/x-rxjs": "^6.3.1",
|
||||||
"bn.js": "^4.11.9"
|
"bn.js": "^4.11.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/keyring": "^6.1.1",
|
"@polkadot/keyring": "^6.3.1",
|
||||||
"@polkadot/rpc-provider": "4.5.1"
|
"@polkadot/rpc-provider": "4.8.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import { catchError, map, switchMap } from '@polkadot/x-rxjs/operators';
|
|||||||
|
|
||||||
import { memo } from '../util';
|
import { memo } from '../util';
|
||||||
|
|
||||||
|
type Collective = 'council' | 'membership' | 'technicalCommittee';
|
||||||
|
|
||||||
type Result = [(Hash | Uint8Array | string)[], (Option<Proposal> | null)[], Option<Votes>[]];
|
type Result = [(Hash | Uint8Array | string)[], (Option<Proposal> | null)[], Option<Votes>[]];
|
||||||
|
|
||||||
function parse (api: ApiInterfaceRx, [hashes, proposals, votes]: Result): DeriveCollectiveProposal[] {
|
function parse (api: ApiInterfaceRx, [hashes, proposals, votes]: Result): DeriveCollectiveProposal[] {
|
||||||
@@ -29,7 +31,7 @@ function parse (api: ApiInterfaceRx, [hashes, proposals, votes]: Result): Derive
|
|||||||
.filter((proposal): proposal is DeriveCollectiveProposal => !!proposal);
|
.filter((proposal): proposal is DeriveCollectiveProposal => !!proposal);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _proposalsFrom (instanceId: string, api: ApiInterfaceRx, section: 'council' | 'technicalCommittee' = 'council'): (hashes: (Hash | Uint8Array | string)[]) => Observable<DeriveCollectiveProposal[]> {
|
function _proposalsFrom (instanceId: string, api: ApiInterfaceRx, section: Collective): (hashes: (Hash | Uint8Array | string)[]) => Observable<DeriveCollectiveProposal[]> {
|
||||||
return memo(instanceId, (hashes: (Hash | Uint8Array | string)[]): Observable<DeriveCollectiveProposal[]> =>
|
return memo(instanceId, (hashes: (Hash | Uint8Array | string)[]): Observable<DeriveCollectiveProposal[]> =>
|
||||||
(isFunction(api.query[section]?.proposals) && hashes.length
|
(isFunction(api.query[section]?.proposals) && hashes.length
|
||||||
? combineLatest<Result>([
|
? combineLatest<Result>([
|
||||||
@@ -49,19 +51,19 @@ function _proposalsFrom (instanceId: string, api: ApiInterfaceRx, section: 'coun
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function proposals (instanceId: string, api: ApiInterfaceRx, section: 'council' | 'technicalCommittee' = 'council'): () => Observable<DeriveCollectiveProposal[]> {
|
export function proposals (instanceId: string, api: ApiInterfaceRx, section: Collective): () => Observable<DeriveCollectiveProposal[]> {
|
||||||
const proposalsFrom = _proposalsFrom(instanceId, api, section);
|
const proposalsFrom = _proposalsFrom(instanceId, api, section);
|
||||||
|
|
||||||
return memo(instanceId, (): Observable<DeriveCollectiveProposal[]> =>
|
return memo(instanceId, (): Observable<DeriveCollectiveProposal[]> =>
|
||||||
isFunction(api.query[section]?.proposals)
|
isFunction(api.query[section]?.proposals)
|
||||||
? api.query[section].proposals().pipe(
|
? api.query[section as 'council'].proposals().pipe(
|
||||||
switchMap(proposalsFrom)
|
switchMap(proposalsFrom)
|
||||||
)
|
)
|
||||||
: of([] as DeriveCollectiveProposal[])
|
: of([] as DeriveCollectiveProposal[])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function proposal (instanceId: string, api: ApiInterfaceRx, section: 'council' | 'technicalCommittee' = 'council'): (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
|
export function proposal (instanceId: string, api: ApiInterfaceRx, section: Collective): (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
|
||||||
const proposalsFrom = _proposalsFrom(instanceId, api, section);
|
const proposalsFrom = _proposalsFrom(instanceId, api, section);
|
||||||
|
|
||||||
return memo(instanceId, (hash: Hash | Uint8Array | string): Observable<DeriveCollectiveProposal | null> =>
|
return memo(instanceId, (hash: Hash | Uint8Array | string): Observable<DeriveCollectiveProposal | null> =>
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import { proposal as collectiveProposal, proposals as collectiveProposals } from
|
|||||||
import { memo } from '../util';
|
import { memo } from '../util';
|
||||||
|
|
||||||
export function proposal (instanceId: string, api: ApiInterfaceRx): (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
|
export function proposal (instanceId: string, api: ApiInterfaceRx): (hash: Hash | Uint8Array | string) => Observable<DeriveCollectiveProposal | null> {
|
||||||
return memo(instanceId, collectiveProposal(instanceId, api));
|
return memo(instanceId, collectiveProposal(instanceId, api, 'council'));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function proposals (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveCollectiveProposal[]> {
|
export function proposals (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveCollectiveProposal[]> {
|
||||||
return memo(instanceId, collectiveProposals(instanceId, api));
|
return memo(instanceId, collectiveProposals(instanceId, api, 'council'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import * as council from './council';
|
|||||||
import * as democracy from './democracy';
|
import * as democracy from './democracy';
|
||||||
import * as elections from './elections';
|
import * as elections from './elections';
|
||||||
import * as imOnline from './imOnline';
|
import * as imOnline from './imOnline';
|
||||||
|
import * as membership from './membership';
|
||||||
import * as parachains from './parachains';
|
import * as parachains from './parachains';
|
||||||
import * as session from './session';
|
import * as session from './session';
|
||||||
import * as society from './society';
|
import * as society from './society';
|
||||||
@@ -27,7 +28,7 @@ import * as tx from './tx';
|
|||||||
export { packageInfo } from './packageInfo';
|
export { packageInfo } from './packageInfo';
|
||||||
export * from './type';
|
export * from './type';
|
||||||
|
|
||||||
export const derive = { accounts, balances, bounties, chain, contracts, council, democracy, elections, imOnline, parachains, session, society, staking, technicalCommittee, treasury, tx };
|
export const derive = { accounts, balances, bounties, chain, contracts, council, democracy, elections, imOnline, membership, parachains, session, society, staking, technicalCommittee, treasury, tx };
|
||||||
|
|
||||||
type DeriveSection<Section> = {
|
type DeriveSection<Section> = {
|
||||||
[Method in keyof Section]: Section[Method] extends AnyFunction
|
[Method in keyof Section]: Section[Method] extends AnyFunction
|
||||||
@@ -49,6 +50,7 @@ const deriveAvail: Record<string, string[]> = {
|
|||||||
democracy: ['democracy'],
|
democracy: ['democracy'],
|
||||||
elections: ['electionsPhragmen', 'elections'],
|
elections: ['electionsPhragmen', 'elections'],
|
||||||
imOnline: ['imOnline'],
|
imOnline: ['imOnline'],
|
||||||
|
membership: ['membership'],
|
||||||
parachains: ['parachains', 'registrar'],
|
parachains: ['parachains', 'registrar'],
|
||||||
session: ['session'],
|
session: ['session'],
|
||||||
society: ['society'],
|
society: ['society'],
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
export * from './proposals';
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
import type { ApiInterfaceRx } from '@polkadot/api/types';
|
||||||
|
import type { Observable } from '@polkadot/x-rxjs';
|
||||||
|
import type { DeriveCollectiveProposal } from '../types';
|
||||||
|
|
||||||
|
import { proposals as collectiveProposals } from '../collective';
|
||||||
|
import { memo } from '../util';
|
||||||
|
|
||||||
|
export function proposals (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveCollectiveProposal[]> {
|
||||||
|
return memo(instanceId, collectiveProposals(instanceId, api, 'membership'));
|
||||||
|
}
|
||||||
@@ -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.5.1' };
|
export const packageInfo = { name: '@polkadot/api-derive', version: '4.8.1' };
|
||||||
|
|||||||
@@ -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
|
||||||
|
};
|
||||||
|
})
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/api",
|
"name": "@polkadot/api",
|
||||||
"version": "4.5.1",
|
"version": "4.8.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.14.0",
|
||||||
"@polkadot/api-derive": "4.5.1",
|
"@polkadot/api-derive": "4.8.1",
|
||||||
"@polkadot/keyring": "^6.1.1",
|
"@polkadot/keyring": "^6.3.1",
|
||||||
"@polkadot/metadata": "4.5.1",
|
"@polkadot/metadata": "4.8.1",
|
||||||
"@polkadot/rpc-core": "4.5.1",
|
"@polkadot/rpc-core": "4.8.1",
|
||||||
"@polkadot/rpc-provider": "4.5.1",
|
"@polkadot/rpc-provider": "4.8.1",
|
||||||
"@polkadot/types": "4.5.1",
|
"@polkadot/types": "4.8.1",
|
||||||
"@polkadot/types-known": "4.5.1",
|
"@polkadot/types-known": "4.8.1",
|
||||||
"@polkadot/util": "^6.1.1",
|
"@polkadot/util": "^6.3.1",
|
||||||
"@polkadot/util-crypto": "^6.1.1",
|
"@polkadot/util-crypto": "^6.3.1",
|
||||||
"@polkadot/x-rxjs": "^6.1.1",
|
"@polkadot/x-rxjs": "^6.3.1",
|
||||||
"bn.js": "^4.11.9",
|
"bn.js": "^4.11.9",
|
||||||
"eventemitter3": "^4.0.7"
|
"eventemitter3": "^4.0.7"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>;
|
||||||
|
/**
|
||||||
|
* Identifier for the elections-phragmen pallet's lock
|
||||||
|
**/
|
||||||
palletId: LockIdentifier & AugmentedConst<ApiType>;
|
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: {
|
||||||
|
|||||||
@@ -1291,6 +1291,10 @@ declare module '@polkadot/api/types/errors' {
|
|||||||
* No proposal or bounty at that index.
|
* No proposal or bounty at that index.
|
||||||
**/
|
**/
|
||||||
InvalidIndex: AugmentedError<ApiType>;
|
InvalidIndex: AugmentedError<ApiType>;
|
||||||
|
/**
|
||||||
|
* Too many approvals in the queue.
|
||||||
|
**/
|
||||||
|
TooManyApprovals: AugmentedError<ApiType>;
|
||||||
};
|
};
|
||||||
vesting: {
|
vesting: {
|
||||||
[key: string]: AugmentedError<ApiType>;
|
[key: string]: AugmentedError<ApiType>;
|
||||||
|
|||||||
@@ -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]>>]>;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -1276,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.
|
||||||
*
|
*
|
||||||
@@ -2836,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.
|
||||||
@@ -3142,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.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ 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';
|
||||||
@@ -31,7 +31,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
|||||||
|
|
||||||
#registries: VersionedRegistry[] = [];
|
#registries: VersionedRegistry[] = [];
|
||||||
|
|
||||||
#updateSub?: Subscription;
|
#updateSub?: Subscription | null = null;
|
||||||
|
|
||||||
constructor (options: ApiOptions, type: ApiTypes, decorateMethod: DecorateMethod<ApiType>) {
|
constructor (options: ApiOptions, type: ApiTypes, decorateMethod: DecorateMethod<ApiType>) {
|
||||||
super(options, type, decorateMethod);
|
super(options, type, decorateMethod);
|
||||||
@@ -156,10 +156,10 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
|||||||
// on re-connection to the same chain, we don't want to re-do everything from chain again
|
// on re-connection to the same chain, we don't want to re-do everything from chain again
|
||||||
if (this._isReady) {
|
if (this._isReady) {
|
||||||
return true;
|
return true;
|
||||||
} else if (this.#updateSub) {
|
|
||||||
this.#updateSub.unsubscribe();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._unsubscribeUpdates();
|
||||||
|
|
||||||
// only load from on-chain if we are not a clone (default path), alternatively
|
// only load from on-chain if we are not a clone (default path), alternatively
|
||||||
// just use the values from the source instance provided
|
// just use the values from the source instance provided
|
||||||
[this._genesisHash, this._runtimeMetadata] = this._options.source?._isReady
|
[this._genesisHash, this._runtimeMetadata] = this._options.source?._isReady
|
||||||
@@ -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);
|
||||||
@@ -302,6 +302,25 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _unsubscribeHealth (): void {
|
||||||
|
if (this.#healthTimer) {
|
||||||
|
clearInterval(this.#healthTimer);
|
||||||
|
this.#healthTimer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private _unsubscribeUpdates (): void {
|
||||||
|
if (this.#updateSub) {
|
||||||
|
this.#updateSub.unsubscribe();
|
||||||
|
this.#updateSub = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected _unsubscribe (): void {
|
||||||
|
this._unsubscribeHealth();
|
||||||
|
this._unsubscribeUpdates();
|
||||||
|
}
|
||||||
|
|
||||||
#onProviderConnect = async (): Promise<void> => {
|
#onProviderConnect = async (): Promise<void> => {
|
||||||
this.emit('connected');
|
this.emit('connected');
|
||||||
this._isConnected.next(true);
|
this._isConnected.next(true);
|
||||||
@@ -337,10 +356,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
|||||||
this.emit('disconnected');
|
this.emit('disconnected');
|
||||||
this._isConnected.next(false);
|
this._isConnected.next(false);
|
||||||
|
|
||||||
if (this.#healthTimer) {
|
this._unsubscribeHealth();
|
||||||
clearInterval(this.#healthTimer);
|
|
||||||
this.#healthTimer = null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#onProviderError = (error: Error): void => {
|
#onProviderError = (error: Error): void => {
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ function mapCapabilities ({ accountIdLength }: Constants, [leasePeriodsPerSlot,
|
|||||||
const numIds = tupleLength / accountIdLength;
|
const numIds = tupleLength / accountIdLength;
|
||||||
const numIdsRound = Math.floor(numIds);
|
const numIdsRound = Math.floor(numIds);
|
||||||
|
|
||||||
assert(numIds >= 2 && numIds <= 11, `Detected ${numIds} in Keys, should be >= 2 and <= 11`);
|
assert(numIds >= 2 && numIds <= 11, () => `Detected ${numIds} in Keys, should be >= 2 and <= 11`);
|
||||||
|
|
||||||
if (numIdsRound !== numIds) {
|
if (numIdsRound !== numIds) {
|
||||||
// Beefy?
|
// Beefy?
|
||||||
@@ -84,7 +84,7 @@ function mapCapabilities ({ accountIdLength }: Constants, [leasePeriodsPerSlot,
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
types.Keys = `SessionKeys${numIdsRound - 1}B`;
|
types.Keys = `SessionKeys${numIdsRound - 1}B`;
|
||||||
} else {
|
} else {
|
||||||
assert(false, `Expected integer number of keys, found ${numIds.toFixed(2)}`);
|
assert(false, () => `Expected integer number of keys, found ${numIds.toFixed(2)}`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ export abstract class ApiBase<ApiType extends ApiTypes> extends Getters<ApiType>
|
|||||||
* @description Disconnect from the underlying provider, halting all network traffic
|
* @description Disconnect from the underlying provider, halting all network traffic
|
||||||
*/
|
*/
|
||||||
public disconnect (): Promise<void> {
|
public disconnect (): Promise<void> {
|
||||||
|
this._unsubscribe();
|
||||||
|
|
||||||
return this._rpcCore.disconnect();
|
return this._rpcCore.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.5.1' };
|
export const packageInfo = { name: '@polkadot/api', version: '4.8.1' };
|
||||||
|
|||||||
@@ -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);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,9 +165,7 @@ export class ApiRx extends ApiBase<'rxjs'> {
|
|||||||
this.#isReadyRx = from<Promise<ApiRx>>(
|
this.#isReadyRx = from<Promise<ApiRx>>(
|
||||||
// You can create an observable from an event, however my mind groks this form better
|
// You can create an observable from an event, however my mind groks this form better
|
||||||
new Promise((resolve): void => {
|
new Promise((resolve): void => {
|
||||||
super.on('ready', (): void => {
|
super.on('ready', () => resolve(this));
|
||||||
resolve(this);
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 })))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/metadata",
|
"name": "@polkadot/metadata",
|
||||||
"version": "4.5.1",
|
"version": "4.8.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.14.0",
|
||||||
"@polkadot/types": "4.5.1",
|
"@polkadot/types": "4.8.1",
|
||||||
"@polkadot/types-known": "4.5.1",
|
"@polkadot/types-known": "4.8.1",
|
||||||
"@polkadot/util": "^6.1.1",
|
"@polkadot/util": "^6.3.1",
|
||||||
"@polkadot/util-crypto": "^6.1.1",
|
"@polkadot/util-crypto": "^6.3.1",
|
||||||
"bn.js": "^4.11.9"
|
"bn.js": "^4.11.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/keyring": "^6.1.1"
|
"@polkadot/keyring": "^6.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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()}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import type { Registry } from '@polkadot/types/types';
|
import type { Registry } from '@polkadot/types/types';
|
||||||
|
|
||||||
import { isString, u8aConcat, u8aToU8a } from '@polkadot/util';
|
import { isHex, isU8a, u8aToU8a } from '@polkadot/util';
|
||||||
|
|
||||||
import { MetadataVersioned } from './MetadataVersioned';
|
import { MetadataVersioned } from './MetadataVersioned';
|
||||||
|
|
||||||
@@ -11,37 +11,39 @@ import { MetadataVersioned } from './MetadataVersioned';
|
|||||||
const VERSION_IDX = 4;
|
const VERSION_IDX = 4;
|
||||||
|
|
||||||
// magic + lowest supported version
|
// magic + lowest supported version
|
||||||
const EMPTY_METADATA = u8aConcat(new Uint8Array([0x6d, 0x65, 0x74, 0x61, 9]));
|
const EMPTY_METADATA = new Uint8Array([0x6d, 0x65, 0x74, 0x61, 9]);
|
||||||
const EMPTY_U8A = new Uint8Array();
|
const EMPTY_U8A = new Uint8Array();
|
||||||
|
|
||||||
function sanitizeInput (_value: Uint8Array | string = EMPTY_U8A): Uint8Array {
|
function toU8a (value: Uint8Array | string = EMPTY_U8A): Uint8Array {
|
||||||
if (isString(_value)) {
|
return isHex(value)
|
||||||
return sanitizeInput(u8aToU8a(_value));
|
? toU8a(u8aToU8a(value))
|
||||||
}
|
: isU8a(value) && value.length === 0
|
||||||
|
? EMPTY_METADATA
|
||||||
return _value.length === 0
|
: value;
|
||||||
? EMPTY_METADATA
|
|
||||||
: _value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function decodeMetadata (registry: Registry, _value?: Uint8Array | string): MetadataVersioned {
|
function decodeMetadata (registry: Registry, _value?: Uint8Array | string | Map<string, unknown> | Record<string, unknown>): MetadataVersioned {
|
||||||
const value = sanitizeInput(_value);
|
if (!_value || isU8a(_value) || isHex(_value)) {
|
||||||
const version = value[VERSION_IDX];
|
const value = toU8a(_value);
|
||||||
|
const version = value[VERSION_IDX];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new MetadataVersioned(registry, value);
|
return new MetadataVersioned(registry, value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// This is an f-ing hack as a follow-up to another ugly hack
|
// This is an f-ing hack as a follow-up to another ugly hack
|
||||||
// https://github.com/polkadot-js/api/commit/a9211690be6b68ad6c6dad7852f1665cadcfa5b2
|
// https://github.com/polkadot-js/api/commit/a9211690be6b68ad6c6dad7852f1665cadcfa5b2
|
||||||
// when we fail on V9, try to re-parse it as v10... yes... HACK
|
// when we fail on V9, try to re-parse it as v10... yes... HACK
|
||||||
if (version === 9) {
|
if (version === 9) {
|
||||||
value[VERSION_IDX] = 10;
|
value[VERSION_IDX] = 10;
|
||||||
|
|
||||||
return decodeMetadata(registry, value);
|
return decodeMetadata(registry, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new MetadataVersioned(registry, _value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,7 +52,7 @@ function decodeMetadata (registry: Registry, _value?: Uint8Array | string): Meta
|
|||||||
* The versioned runtime metadata as a decoded structure
|
* The versioned runtime metadata as a decoded structure
|
||||||
*/
|
*/
|
||||||
export class Metadata extends MetadataVersioned {
|
export class Metadata extends MetadataVersioned {
|
||||||
constructor (registry: Registry, value?: Uint8Array | string) {
|
constructor (registry: Registry, value?: Uint8Array | string | Map<string, unknown> | Record<string, unknown>) {
|
||||||
super(registry, decodeMetadata(registry, value));
|
super(registry, decodeMetadata(registry, value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function init (meta: string): [Constants, TypeRegistry] {
|
|||||||
|
|
||||||
registry.setMetadata(metadata);
|
registry.setMetadata(metadata);
|
||||||
|
|
||||||
return [decorateConstants(registry, metadata.asLatest), registry];
|
return [decorateConstants(registry, metadata.asLatest, 12), registry];
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('decorateConstants', (): void => {
|
describe('decorateConstants', (): void => {
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import type { ConstantCodec, Constants, ModuleConstants } from '../types';
|
|||||||
import { hexToU8a, stringCamelCase } from '@polkadot/util';
|
import { hexToU8a, stringCamelCase } from '@polkadot/util';
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export function decorateConstants (registry: Registry, { modules }: MetadataLatest): Constants {
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
export function decorateConstants (registry: Registry, { modules }: MetadataLatest, _metaVersion: number): Constants {
|
||||||
return modules.reduce((result: Constants, { constants, name }): Constants => {
|
return modules.reduce((result: Constants, { constants, name }): Constants => {
|
||||||
if (constants.isEmpty) {
|
if (constants.isEmpty) {
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ describe('Decorated', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return constants with the correct type and value', (): void => {
|
it('should return constants with the correct type and value', (): void => {
|
||||||
const consts = decorateConstants(registry, metadata.asLatest);
|
const consts = decorateConstants(registry, metadata.asLatest, metadata.version);
|
||||||
|
|
||||||
expect(consts.democracy.cooloffPeriod).toBeInstanceOf(registry.createClass('BlockNumber'));
|
expect(consts.democracy.cooloffPeriod).toBeInstanceOf(registry.createClass('BlockNumber'));
|
||||||
expect(consts.democracy.cooloffPeriod.toHex()).toEqual('0x000c4e00');
|
expect(consts.democracy.cooloffPeriod.toHex()).toEqual('0x000c4e00');
|
||||||
|
|||||||
@@ -20,13 +20,14 @@ export function expandMetadata (registry: Registry, metadata: Metadata): Decorat
|
|||||||
assert(metadata instanceof Metadata, 'You need to pass a valid Metadata instance to Decorated');
|
assert(metadata instanceof Metadata, 'You need to pass a valid Metadata instance to Decorated');
|
||||||
|
|
||||||
const latest = metadata.asLatest;
|
const latest = metadata.asLatest;
|
||||||
|
const version = metadata.version;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
consts: decorateConstants(registry, latest),
|
consts: decorateConstants(registry, latest, version),
|
||||||
errors: decorateErrors(registry, latest, metadata.version),
|
errors: decorateErrors(registry, latest, version),
|
||||||
events: decorateEvents(registry, latest, metadata.version),
|
events: decorateEvents(registry, latest, version),
|
||||||
query: decorateStorage(registry, latest, metadata.version),
|
query: decorateStorage(registry, latest, version),
|
||||||
tx: decorateExtrinsics(registry, latest, metadata.version)
|
tx: decorateExtrinsics(registry, latest, version)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ describe('createFunction', (): void => {
|
|||||||
method: 'NextKeys',
|
method: 'NextKeys',
|
||||||
prefix: 'Session',
|
prefix: 'Session',
|
||||||
section: 'session'
|
section: 'session'
|
||||||
}, { metaVersion: 9 });
|
}, {});
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
u8aToHex(
|
u8aToHex(
|
||||||
|
|||||||
@@ -8,16 +8,15 @@ import type { Codec, Registry } from '@polkadot/types/types';
|
|||||||
import BN from 'bn.js';
|
import BN from 'bn.js';
|
||||||
|
|
||||||
import { Raw } from '@polkadot/types/codec';
|
import { Raw } from '@polkadot/types/codec';
|
||||||
import { StorageKey } from '@polkadot/types/primitive';
|
import { StorageKey, Type } from '@polkadot/types/primitive';
|
||||||
import { assert, compactAddLength, compactStripLength, isNull, isUndefined, stringLowerFirst, u8aConcat } from '@polkadot/util';
|
import { assert, compactAddLength, compactStripLength, isNull, isUndefined, stringCamelCase, stringify, stringLowerFirst, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||||
import { xxhashAsU8a } from '@polkadot/util-crypto';
|
import { xxhashAsU8a } from '@polkadot/util-crypto';
|
||||||
|
|
||||||
import { getHasher, HasherFunction } from './getHasher';
|
import { getHasher } from './getHasher';
|
||||||
|
|
||||||
export interface CreateItemOptions {
|
export interface CreateItemOptions {
|
||||||
key?: string;
|
key?: string;
|
||||||
metaVersion: number;
|
skipHashing?: boolean;
|
||||||
skipHashing?: boolean; // We don't hash the keys defined in ./substrate.ts
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateItemFn {
|
export interface CreateItemFn {
|
||||||
@@ -34,81 +33,35 @@ interface IterFn {
|
|||||||
|
|
||||||
type CreateArgType = boolean | string | number | null | BN | BigInt | Uint8Array | Codec;
|
type CreateArgType = boolean | string | number | null | BN | BigInt | Uint8Array | Codec;
|
||||||
|
|
||||||
const EMPTY_U8A = new Uint8Array([]);
|
type U8aHasher = (input: Uint8Array) => Uint8Array;
|
||||||
const NULL_HASHER = (value: Uint8Array): Uint8Array => value;
|
|
||||||
|
|
||||||
// get the hashers, the base (and in the case of DoubleMap), the second key
|
|
||||||
/** @internal */
|
|
||||||
function getHashers ({ meta: { type } }: CreateItemFn): [HasherFunction, HasherFunction?] {
|
|
||||||
if (type.isDoubleMap) {
|
|
||||||
return [
|
|
||||||
getHasher(type.asDoubleMap.hasher),
|
|
||||||
getHasher(type.asDoubleMap.key2Hasher)
|
|
||||||
];
|
|
||||||
} else if (type.isMap) {
|
|
||||||
return [getHasher(type.asMap.hasher)];
|
|
||||||
}
|
|
||||||
|
|
||||||
// the default
|
|
||||||
return [getHasher()];
|
|
||||||
}
|
|
||||||
|
|
||||||
// create a base prefixed key
|
|
||||||
/** @internal */
|
|
||||||
function createPrefixedKey ({ method, prefix }: CreateItemFn): Uint8Array {
|
function createPrefixedKey ({ method, prefix }: CreateItemFn): Uint8Array {
|
||||||
return u8aConcat(xxhashAsU8a(prefix, 128), xxhashAsU8a(method, 128));
|
return u8aConcat(xxhashAsU8a(prefix, 128), xxhashAsU8a(method, 128));
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a key for a DoubleMap type
|
function createKey (registry: Registry, itemFn: CreateItemFn, keys: Type[], hashers: U8aHasher[], args: CreateArgType[]): Uint8Array {
|
||||||
/** @internal */
|
const { method, section } = itemFn;
|
||||||
function createKeyDoubleMap (registry: Registry, itemFn: CreateItemFn, args: [CreateArgType, CreateArgType], [hasher1, hasher2]: [HasherFunction, HasherFunction?]): Uint8Array {
|
|
||||||
const { meta: { name, type } } = itemFn;
|
|
||||||
|
|
||||||
// since we are passing an almost-unknown through, trust, but verify
|
assert(Array.isArray(args) && args.length === keys.length, () => `Call to ${stringCamelCase(section || 'unknown')}.${stringCamelCase(method || 'unknown')} needs ${keys.length} arguments, found ${stringify(args)}`);
|
||||||
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
|
|
||||||
assert(!isUndefined(hasher2), '2 hashing functions should be defined for DoubleMaps');
|
|
||||||
|
|
||||||
const [key1, key2] = args;
|
|
||||||
const map = type.asDoubleMap;
|
|
||||||
const val1 = registry.createType(map.key1.toString() as 'Raw', key1).toU8a();
|
|
||||||
const val2 = registry.createType(map.key2.toString() as 'Raw', key2).toU8a();
|
|
||||||
|
|
||||||
// as per createKey, always add the length prefix (underlying it is Bytes)
|
// as per createKey, always add the length prefix (underlying it is Bytes)
|
||||||
return compactAddLength(u8aConcat(
|
return compactAddLength(
|
||||||
createPrefixedKey(itemFn),
|
u8aConcat(
|
||||||
hasher1(val1),
|
createPrefixedKey(itemFn),
|
||||||
hasher2(val2)
|
...keys.map((type, index): Uint8Array => {
|
||||||
));
|
const arg = args[index];
|
||||||
}
|
|
||||||
|
|
||||||
// create a key for either a map or a plain value
|
assert(!isUndefined(arg) && !isNull(arg), () => `Call to ${stringCamelCase(section || 'unknown')}.${stringCamelCase(method || 'unknown')} has a null or undefined argument at position ${index}`);
|
||||||
/** @internal */
|
|
||||||
function createKey (registry: Registry, itemFn: CreateItemFn, arg: CreateArgType, hasher: (value: Uint8Array) => Uint8Array): Uint8Array {
|
|
||||||
const { meta: { name, type } } = itemFn;
|
|
||||||
let param: Uint8Array = EMPTY_U8A;
|
|
||||||
|
|
||||||
if (type.isMap) {
|
return hashers[index](registry.createType(type.toString() as 'Raw', arg).toU8a());
|
||||||
const map = type.asMap;
|
})
|
||||||
|
)
|
||||||
assert(!isUndefined(arg) && !isNull(arg), `${name.toString()} is a Map and requires one argument`);
|
);
|
||||||
|
|
||||||
param = registry.createType(map.key.toString() as 'Raw', arg).toU8a();
|
|
||||||
}
|
|
||||||
|
|
||||||
// StorageKey is a Bytes, so is length-prefixed
|
|
||||||
return compactAddLength(u8aConcat(
|
|
||||||
createPrefixedKey(itemFn),
|
|
||||||
param.length
|
|
||||||
? hasher(param)
|
|
||||||
: EMPTY_U8A
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// attach the metadata to expand to a StorageFunction
|
// attach the metadata to expand to a StorageFunction
|
||||||
/** @internal */
|
/** @internal */
|
||||||
function expandWithMeta ({ meta, method, prefix, section }: CreateItemFn, _storageFn: (arg?: CreateArgType | [CreateArgType?, CreateArgType?]) => Uint8Array): StorageEntry {
|
function expandWithMeta ({ meta, method, prefix, section }: CreateItemFn, _storageFn: (arg?: CreateArgType | CreateArgType[]) => Uint8Array): StorageEntry {
|
||||||
const storageFn = _storageFn as StorageEntry;
|
const storageFn = _storageFn as StorageEntry;
|
||||||
|
|
||||||
storageFn.meta = meta;
|
storageFn.meta = meta;
|
||||||
@@ -177,16 +130,19 @@ function extendPrefixedMap (registry: Registry, itemFn: CreateItemFn, storageFn:
|
|||||||
/** @internal */
|
/** @internal */
|
||||||
export function createFunction (registry: Registry, itemFn: CreateItemFn, options: CreateItemOptions): StorageEntry {
|
export function createFunction (registry: Registry, itemFn: CreateItemFn, options: CreateItemOptions): StorageEntry {
|
||||||
const { meta: { type } } = itemFn;
|
const { meta: { type } } = itemFn;
|
||||||
const [hasher, key2Hasher] = getHashers(itemFn);
|
|
||||||
|
|
||||||
// Can only have zero or one argument:
|
// Can only have zero or one argument:
|
||||||
// - storage.system.account(address)
|
// - storage.system.account(address)
|
||||||
// - storage.timestamp.blockPeriod()
|
// - storage.timestamp.blockPeriod()
|
||||||
// For doublemap queries the params is passed in as an tuple, [key1, key2]
|
// For higher-map queries the params are passed in as an tuple, [key1, key2]
|
||||||
const storageFn = expandWithMeta(itemFn, (arg?: CreateArgType | [CreateArgType?, CreateArgType?]): Uint8Array =>
|
const storageFn = expandWithMeta(itemFn, (arg?: CreateArgType | CreateArgType[]) =>
|
||||||
type.isDoubleMap
|
type.isDoubleMap
|
||||||
? createKeyDoubleMap(registry, itemFn, arg as [CreateArgType, CreateArgType], [hasher, key2Hasher])
|
? createKey(registry, itemFn, [type.asDoubleMap.key1, type.asDoubleMap.key2], [getHasher(type.asDoubleMap.hasher), getHasher(type.asDoubleMap.key2Hasher)], arg as CreateArgType[])
|
||||||
: createKey(registry, itemFn, arg as CreateArgType, options.skipHashing ? NULL_HASHER : hasher)
|
: type.isMap
|
||||||
|
? createKey(registry, itemFn, [type.asMap.key], [getHasher(type.asMap.hasher)], [arg as CreateArgType])
|
||||||
|
: options.skipHashing
|
||||||
|
? compactAddLength(u8aToU8a(options.key))
|
||||||
|
: createKey(registry, itemFn, [], [], [])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (type.isMap || type.isDoubleMap) {
|
if (type.isMap || type.isDoubleMap) {
|
||||||
@@ -194,7 +150,8 @@ export function createFunction (registry: Registry, itemFn: CreateItemFn, option
|
|||||||
}
|
}
|
||||||
|
|
||||||
storageFn.keyPrefix = (arg?: any): Uint8Array =>
|
storageFn.keyPrefix = (arg?: any): Uint8Array =>
|
||||||
(storageFn.iterKey && storageFn.iterKey(arg)) || compactStripLength(storageFn())[1];
|
(storageFn.iterKey && storageFn.iterKey(arg)) ||
|
||||||
|
compactStripLength(storageFn())[1];
|
||||||
|
|
||||||
return storageFn;
|
return storageFn;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,6 @@ const HASHERS: Record<keyof typeof AllHashers, HasherFunction> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export function getHasher (hasher?: StorageHasher): HasherFunction {
|
export function getHasher (hasher: StorageHasher): HasherFunction {
|
||||||
return HASHERS[hasher?.type as 'Identity'] || DEFAULT_FN;
|
return HASHERS[hasher.type as 'Identity'] || DEFAULT_FN;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,19 +2,21 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import { TypeRegistry } from '@polkadot/types/create';
|
import { TypeRegistry } from '@polkadot/types/create';
|
||||||
|
import { compactAddLength, u8aToU8a } from '@polkadot/util';
|
||||||
|
|
||||||
import { getStorage } from './getStorage';
|
import { getStorage } from './getStorage';
|
||||||
|
|
||||||
describe('getSorage', (): void => {
|
describe('getSorage', (): void => {
|
||||||
const registry = new TypeRegistry();
|
const registry = new TypeRegistry();
|
||||||
const storage = getStorage(registry, 8);
|
const storage = getStorage(registry);
|
||||||
|
|
||||||
it('should return well known keys', (): void => {
|
it('should return well known keys', (): void => {
|
||||||
expect(typeof storage.substrate).toBe('object');
|
expect(typeof storage.substrate).toBe('object');
|
||||||
|
|
||||||
|
expect(storage.substrate.code()).toEqual(compactAddLength(u8aToU8a(':code')));
|
||||||
|
|
||||||
expect(storage.substrate.changesTrieConfig).toBeTruthy();
|
expect(storage.substrate.changesTrieConfig).toBeTruthy();
|
||||||
expect(storage.substrate.childStorageKeyPrefix).toBeTruthy();
|
expect(storage.substrate.childStorageKeyPrefix).toBeTruthy();
|
||||||
expect(storage.substrate.code).toBeTruthy();
|
|
||||||
expect(storage.substrate.extrinsicIndex).toBeTruthy();
|
expect(storage.substrate.extrinsicIndex).toBeTruthy();
|
||||||
expect(storage.substrate.heapPages).toBeTruthy();
|
expect(storage.substrate.heapPages).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ 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): Storage {
|
||||||
return {
|
return {
|
||||||
substrate: Object
|
substrate: Object
|
||||||
.entries(substrate)
|
.entries(substrate)
|
||||||
.reduce((storage: Record<string, StorageEntry>, [key, fn]): Record<string, StorageEntry> => {
|
.reduce((storage: Record<string, StorageEntry>, [key, fn]): Record<string, StorageEntry> => {
|
||||||
(storage as Record<string, unknown>)[key] = fn(registry, metaVersion);
|
(storage as Record<string, unknown>)[key] = fn(registry);
|
||||||
|
|
||||||
return storage;
|
return storage;
|
||||||
}, {})
|
}, {})
|
||||||
|
|||||||
@@ -21,7 +21,11 @@ describe('decorateStorage', (): void => {
|
|||||||
const query = decorateStorage(registry, metadata.asLatest, metadata.version);
|
const query = decorateStorage(registry, metadata.asLatest, metadata.version);
|
||||||
|
|
||||||
it('should throw if the storage function expects an argument', (): void => {
|
it('should throw if the storage function expects an argument', (): void => {
|
||||||
expect(() => query.balances.account()).toThrowError(/requires one argument/);
|
expect(() => query.balances.account()).toThrowError('Call to balances.account has a null or undefined argument at position 0');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw if the storage function expects multiple arguments', (): void => {
|
||||||
|
expect(() => query.staking.erasStakers([1])).toThrowError('Call to staking.erasStakers needs 2 arguments, found [1]');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return a value if the storage function does not expect an argument', (): void => {
|
it('should return a value if the storage function does not expect an argument', (): void => {
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ import { createFunction } from './createFunction';
|
|||||||
import { getStorage } from './getStorage';
|
import { getStorage } from './getStorage';
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export function decorateStorage (registry: Registry, { modules }: MetadataLatest, metaVersion: number): Storage {
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
export function decorateStorage (registry: Registry, { modules }: MetadataLatest, _metaVersion: number): Storage {
|
||||||
return modules.reduce((result: Storage, moduleMetadata): Storage => {
|
return modules.reduce((result: Storage, moduleMetadata): Storage => {
|
||||||
if (moduleMetadata.storage.isNone) {
|
if (moduleMetadata.storage.isNone) {
|
||||||
return result;
|
return result;
|
||||||
@@ -31,11 +32,11 @@ export function decorateStorage (registry: Registry, { modules }: MetadataLatest
|
|||||||
method,
|
method,
|
||||||
prefix,
|
prefix,
|
||||||
section
|
section
|
||||||
}, { metaVersion });
|
}, {});
|
||||||
|
|
||||||
return newModule;
|
return newModule;
|
||||||
}, {} as ModuleStorage);
|
}, {} as ModuleStorage);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}, { ...getStorage(registry, metaVersion) });
|
}, { ...getStorage(registry) });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// Copyright 2017-2021 @polkadot/metadata authors & contributors
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
import { TypeRegistry } from '@polkadot/types/create';
|
||||||
|
import { compactAddLength, u8aToU8a } from '@polkadot/util';
|
||||||
|
|
||||||
|
import { substrate } from './substrate';
|
||||||
|
|
||||||
|
const registry = new TypeRegistry();
|
||||||
|
|
||||||
|
describe('substrate', (): void => {
|
||||||
|
it('creates a well-known :code key', (): void => {
|
||||||
|
expect(
|
||||||
|
substrate.code(registry)()
|
||||||
|
).toEqual(
|
||||||
|
compactAddLength(u8aToU8a(':code'))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -12,44 +12,45 @@ interface SubstrateMetadata {
|
|||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Creator = (registry: Registry) => 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) => StorageEntry {
|
||||||
return (registry: Registry, metaVersion: number): StorageEntry =>
|
return (registry: Registry): StorageEntry =>
|
||||||
createFunction(registry, {
|
createFunction(registry, {
|
||||||
meta: {
|
meta: {
|
||||||
documentation: registry.createType('Vec<Text>', [documentation]),
|
documentation: registry.createType('Vec<Text>', [documentation]),
|
||||||
modifier: registry.createType('StorageEntryModifierLatest', 1), // required
|
modifier: registry.createType('StorageEntryModifierLatest', 1), // required
|
||||||
|
name: registry.createType('Text', method),
|
||||||
toJSON: (): any => key,
|
toJSON: (): any => key,
|
||||||
type: registry.createType('StorageEntryTypeLatest', type, 0)
|
type: registry.createType('StorageEntryTypeLatest', type, 0)
|
||||||
} as StorageEntryMetadataLatest,
|
} as StorageEntryMetadataLatest,
|
||||||
method,
|
method,
|
||||||
prefix: 'Substrate',
|
prefix: 'Substrate',
|
||||||
section: 'substrate'
|
section: 'substrate'
|
||||||
}, { key, metaVersion, skipHashing: true });
|
}, { key, 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'
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -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.5.1' };
|
export const packageInfo = { name: '@polkadot/metadata', version: '4.8.1' };
|
||||||
|
|||||||
@@ -4,16 +4,16 @@
|
|||||||
type Types = string | Types[];
|
type Types = string | Types[];
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export function flattenUniq (list: Types[]): string[] {
|
export function flattenUniq (list: Types[], start: string[] = []): string[] {
|
||||||
const flat = list.reduce((result: string[], entry): string[] => {
|
return [...new Set(
|
||||||
return result.concat(
|
list.reduce((result: string[], entry): string[] => {
|
||||||
Array.isArray(entry)
|
if (Array.isArray(entry)) {
|
||||||
? flattenUniq(entry)
|
return flattenUniq(entry, result);
|
||||||
: entry
|
}
|
||||||
);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return [...new Set(flat)]
|
result.push(entry);
|
||||||
.filter((value: string) => value)
|
|
||||||
.sort();
|
return result;
|
||||||
|
}, start)
|
||||||
|
)];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,12 +28,7 @@ type Item = {
|
|||||||
};
|
};
|
||||||
} & Codec;
|
} & Codec;
|
||||||
|
|
||||||
type Storage = Option<Vec<Item> | {
|
type Storage = Option<{ items: Vec<Item> } & Codec>;
|
||||||
// v0
|
|
||||||
functions?: Vec<Item>;
|
|
||||||
// V7+
|
|
||||||
items?: Vec<Item>;
|
|
||||||
} & Codec>;
|
|
||||||
|
|
||||||
type Call = { args: Vec<Arg> } & Codec;
|
type Call = { args: Vec<Arg> } & Codec;
|
||||||
|
|
||||||
@@ -44,12 +39,6 @@ type Event = { args: Vec<Type> } & Codec;
|
|||||||
type Events = Option<Vec<Event>>;
|
type Events = Option<Vec<Event>>;
|
||||||
|
|
||||||
type Module = {
|
type Module = {
|
||||||
// V0
|
|
||||||
module?: {
|
|
||||||
call: {
|
|
||||||
functions: Vec<Call>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
// V1+
|
// V1+
|
||||||
calls?: Calls;
|
calls?: Calls;
|
||||||
// V6+
|
// V6+
|
||||||
@@ -60,30 +49,25 @@ type Module = {
|
|||||||
|
|
||||||
interface ExtractionMetadata {
|
interface ExtractionMetadata {
|
||||||
modules: Vec<Module>;
|
modules: Vec<Module>;
|
||||||
|
|
||||||
// V0
|
|
||||||
outerEvent?: {
|
|
||||||
events: Vec<[Text, Vec<Event>] & Codec>;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
function unwrapCalls (mod: Module): Call[] {
|
function unwrapCalls (mod: Module): Call[] {
|
||||||
return mod.calls
|
return mod.calls
|
||||||
? mod.calls.unwrapOr([])
|
? mod.calls.unwrapOr([])
|
||||||
// V0
|
: [];
|
||||||
: mod.module
|
}
|
||||||
? mod.module.call.functions
|
|
||||||
: [];
|
/** @internal */
|
||||||
|
function typeToString ({ type }: Arg): string {
|
||||||
|
return type.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
function getCallNames ({ modules }: ExtractionMetadata): string[][][] {
|
function getCallNames ({ modules }: ExtractionMetadata): string[][][] {
|
||||||
return modules.map((mod): string[][] =>
|
return modules.map((mod): string[][] =>
|
||||||
unwrapCalls(mod).map(({ args }): string[] =>
|
unwrapCalls(mod).map(({ args }): string[] =>
|
||||||
args.map((arg): string =>
|
args.map(typeToString)
|
||||||
arg.type.toString()
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -91,90 +75,61 @@ function getCallNames ({ modules }: ExtractionMetadata): string[][][] {
|
|||||||
/** @internal */
|
/** @internal */
|
||||||
function getConstantNames ({ modules }: ExtractionMetadata): string[][] {
|
function getConstantNames ({ modules }: ExtractionMetadata): string[][] {
|
||||||
return modules.map(({ constants }): string[] =>
|
return modules.map(({ constants }): string[] =>
|
||||||
constants
|
(constants || []).map(typeToString)
|
||||||
? constants.map((constant): string =>
|
|
||||||
constant.type.toString()
|
|
||||||
)
|
|
||||||
: []
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
function unwrapEvents (events?: Events): Event[] {
|
function unwrapEvents (events?: Events): Event[] {
|
||||||
if (!events) {
|
return events
|
||||||
return [];
|
? events.unwrapOr([])
|
||||||
}
|
: [];
|
||||||
|
|
||||||
return events.unwrapOr([]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
function getEventNames ({ modules, outerEvent }: ExtractionMetadata): string[][][] {
|
function getEventNames ({ modules }: ExtractionMetadata): string[][][] {
|
||||||
const mapArg = ({ args }: Event): string[] =>
|
|
||||||
args.map((arg): string =>
|
|
||||||
arg.toString()
|
|
||||||
);
|
|
||||||
|
|
||||||
// V0
|
|
||||||
if (outerEvent) {
|
|
||||||
return outerEvent.events.map(([, events]): string[][] =>
|
|
||||||
events.map(mapArg)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// V1+
|
|
||||||
return modules.map(({ events }): string[][] =>
|
return modules.map(({ events }): string[][] =>
|
||||||
unwrapEvents(events).map(mapArg)
|
unwrapEvents(events).map(({ args }: Event): string[] =>
|
||||||
|
args.map((a) => a.toString())
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
function unwrapStorage (storage?: Storage): Item[] {
|
function unwrapStorage (storage?: Storage): Item[] {
|
||||||
if (!storage) {
|
return storage
|
||||||
return [];
|
? storage.unwrapOr({ items: [] }).items
|
||||||
}
|
: [];
|
||||||
|
|
||||||
const data = storage.unwrapOr([]);
|
|
||||||
|
|
||||||
return Array.isArray(data)
|
|
||||||
? data
|
|
||||||
: (data.items || data.functions) as Item[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
function getStorageNames ({ modules }: ExtractionMetadata): string[][][] {
|
function getStorageNames ({ modules }: ExtractionMetadata): string[][][] {
|
||||||
return modules.map(({ storage }): string[][] =>
|
return modules.map(({ storage }): string[][] =>
|
||||||
unwrapStorage(storage).map(({ type }): string[] => {
|
unwrapStorage(storage).map(({ type }) =>
|
||||||
if (type.isDoubleMap && type.asDoubleMap) {
|
type.isDoubleMap && type.asDoubleMap
|
||||||
return [
|
? [
|
||||||
type.asDoubleMap.key1.toString(),
|
type.asDoubleMap.key1.toString(),
|
||||||
type.asDoubleMap.key2.toString(),
|
type.asDoubleMap.key2.toString(),
|
||||||
type.asDoubleMap.value.toString()
|
type.asDoubleMap.value.toString()
|
||||||
];
|
]
|
||||||
} else if (type.isMap) {
|
: type.isMap
|
||||||
return [
|
? [
|
||||||
type.asMap.key.toString(),
|
type.asMap.key.toString(),
|
||||||
type.asMap.value.toString()
|
type.asMap.value.toString()
|
||||||
];
|
]
|
||||||
} else {
|
: [
|
||||||
return [
|
type.asPlain.toString()
|
||||||
type.asPlain.toString()
|
]
|
||||||
];
|
)
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export function getUniqTypes (registry: Registry, meta: ExtractionMetadata, throwError: boolean): string[] {
|
export function getUniqTypes (registry: Registry, meta: ExtractionMetadata, throwError: boolean): string[] {
|
||||||
const types = flattenUniq([
|
return validateTypes(registry, throwError, flattenUniq([
|
||||||
getCallNames(meta),
|
getCallNames(meta),
|
||||||
getConstantNames(meta),
|
getConstantNames(meta),
|
||||||
getEventNames(meta),
|
getEventNames(meta),
|
||||||
getStorageNames(meta)
|
getStorageNames(meta)
|
||||||
]);
|
]));
|
||||||
|
|
||||||
validateTypes(registry, types, throwError);
|
|
||||||
|
|
||||||
return types;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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}`;
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ import { flattenUniq } from './flattenUniq';
|
|||||||
const l = logger('metadata');
|
const l = logger('metadata');
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export function validateTypes (registry: Registry, types: string[], throwError: boolean): void {
|
export function validateTypes (registry: Registry, throwError: boolean, types: string[]): string[] {
|
||||||
const missing = flattenUniq(extractTypes(types)).filter((type) => !registry.hasType(type));
|
const missing = flattenUniq(extractTypes(types))
|
||||||
|
.filter((type) => !registry.hasType(type))
|
||||||
|
.sort();
|
||||||
|
|
||||||
if (missing.length !== 0) {
|
if (missing.length !== 0) {
|
||||||
const message = `Unknown types found, no types for ${missing.join(', ')}`;
|
const message = `Unknown types found, no types for ${missing.join(', ')}`;
|
||||||
@@ -23,4 +25,6 @@ export function validateTypes (registry: Registry, types: string[], throwError:
|
|||||||
l.warn(message);
|
l.warn(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return types;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5786,7 +5786,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Elections",
|
"name": "Elections",
|
||||||
"storage": {
|
"storage": {
|
||||||
"prefix": "PhragmenElection",
|
"prefix": "Elections",
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"name": "Members",
|
"name": "Members",
|
||||||
@@ -5956,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.",
|
||||||
"",
|
"",
|
||||||
@@ -6028,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."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -6093,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": "PalletId",
|
" be in passive mode."
|
||||||
"type": "LockIdentifier",
|
]
|
||||||
"value": "0x706872656c656374",
|
|
||||||
"documentation": []
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"errors": [
|
"errors": [
|
||||||
@@ -6897,6 +6917,12 @@
|
|||||||
"documentation": [
|
"documentation": [
|
||||||
" No proposal or bounty at that index."
|
" No proposal or bounty at that index."
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "TooManyApprovals",
|
||||||
|
"documentation": [
|
||||||
|
" Too many approvals in the queue."
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index": 17
|
"index": 17
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/rpc-core",
|
"name": "@polkadot/rpc-core",
|
||||||
"version": "4.5.1",
|
"version": "4.8.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.14.0",
|
||||||
"@polkadot/metadata": "4.5.1",
|
"@polkadot/metadata": "4.8.1",
|
||||||
"@polkadot/rpc-provider": "4.5.1",
|
"@polkadot/rpc-provider": "4.8.1",
|
||||||
"@polkadot/types": "4.5.1",
|
"@polkadot/types": "4.8.1",
|
||||||
"@polkadot/util": "^6.1.1",
|
"@polkadot/util": "^6.3.1",
|
||||||
"@polkadot/x-rxjs": "^6.1.1"
|
"@polkadot/x-rxjs": "^6.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/keyring": "^6.1.1"
|
"@polkadot/keyring": "^6.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 })
|
||||||
|
|||||||
@@ -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.5.1' };
|
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.8.1' };
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/rpc-provider",
|
"name": "@polkadot/rpc-provider",
|
||||||
"version": "4.5.1",
|
"version": "4.8.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.14.0",
|
||||||
"@polkadot/types": "4.5.1",
|
"@polkadot/types": "4.8.1",
|
||||||
"@polkadot/util": "^6.1.1",
|
"@polkadot/util": "^6.3.1",
|
||||||
"@polkadot/util-crypto": "^6.1.1",
|
"@polkadot/util-crypto": "^6.3.1",
|
||||||
"@polkadot/x-fetch": "^6.1.1",
|
"@polkadot/x-fetch": "^6.3.1",
|
||||||
"@polkadot/x-global": "^6.1.1",
|
"@polkadot/x-global": "^6.3.1",
|
||||||
"@polkadot/x-ws": "^6.1.1",
|
"@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.1.1",
|
"@polkadot/keyring": "^6.3.1",
|
||||||
"@polkadot/metadata": "4.5.1",
|
"@polkadot/metadata": "4.8.1",
|
||||||
"mock-socket": "^9.0.3",
|
"mock-socket": "^9.0.3",
|
||||||
"nock": "^13.0.11"
|
"nock": "^13.0.11"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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];
|
||||||
|
|||||||
@@ -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.5.1' };
|
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.8.1' };
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ interface WsStateSubscription extends SubscriptionHandler {
|
|||||||
params: any[];
|
params: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const ALIASSES: { [index: string]: string } = {
|
const ALIASES: { [index: string]: string } = {
|
||||||
chain_finalisedHead: 'chain_finalizedHead',
|
chain_finalisedHead: 'chain_finalizedHead',
|
||||||
chain_subscribeFinalisedHeads: 'chain_subscribeFinalizedHeads',
|
chain_subscribeFinalisedHeads: 'chain_subscribeFinalizedHeads',
|
||||||
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();
|
||||||
@@ -225,7 +225,6 @@ export class WsProvider implements ProviderInterface {
|
|||||||
|
|
||||||
// 1000 - Normal closure; the connection successfully completed
|
// 1000 - Normal closure; the connection successfully completed
|
||||||
this.#websocket.close(1000);
|
this.#websocket.close(1000);
|
||||||
this.#websocket = null;
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
l.error(error);
|
l.error(error);
|
||||||
|
|
||||||
@@ -351,9 +350,19 @@ export class WsProvider implements ProviderInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.#isConnected = false;
|
this.#isConnected = false;
|
||||||
|
|
||||||
|
if (this.#websocket) {
|
||||||
|
this.#websocket.onclose = null;
|
||||||
|
this.#websocket.onerror = null;
|
||||||
|
this.#websocket.onmessage = null;
|
||||||
|
this.#websocket.onopen = null;
|
||||||
|
this.#websocket = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.#emit('disconnected');
|
this.#emit('disconnected');
|
||||||
|
|
||||||
// reject all hanging requests
|
// reject all hanging requests
|
||||||
eraseRecord(this.#handlers, (handler) => handler.callback(error, undefined));
|
eraseRecord(this.#handlers, (h) => h.callback(error, undefined));
|
||||||
eraseRecord(this.#waitingForId);
|
eraseRecord(this.#waitingForId);
|
||||||
|
|
||||||
if (this.#autoConnectMs > 0) {
|
if (this.#autoConnectMs > 0) {
|
||||||
@@ -419,7 +428,7 @@ export class WsProvider implements ProviderInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#onSocketMessageSubscribe = (response: JsonRpcResponse): void => {
|
#onSocketMessageSubscribe = (response: JsonRpcResponse): void => {
|
||||||
const method = ALIASSES[response.method as string] || response.method || 'invalid';
|
const method = ALIASES[response.method as string] || response.method || 'invalid';
|
||||||
const subId = `${method}::${response.params.subscription}`;
|
const subId = `${method}::${response.params.subscription}`;
|
||||||
const handler = this.#subscriptions[subId];
|
const handler = this.#subscriptions[subId];
|
||||||
|
|
||||||
|
|||||||
@@ -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));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/typegen",
|
"name": "@polkadot/typegen",
|
||||||
"version": "4.5.1",
|
"version": "4.8.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.15",
|
"@babel/core": "^7.14.0",
|
||||||
"@babel/register": "^7.13.14",
|
"@babel/register": "^7.13.16",
|
||||||
"@babel/runtime": "^7.13.10",
|
"@babel/runtime": "^7.14.0",
|
||||||
"@polkadot/api": "4.5.1",
|
"@polkadot/api": "4.8.1",
|
||||||
"@polkadot/metadata": "4.5.1",
|
"@polkadot/metadata": "4.8.1",
|
||||||
"@polkadot/rpc-provider": "4.5.1",
|
"@polkadot/rpc-provider": "4.8.1",
|
||||||
"@polkadot/types": "4.5.1",
|
"@polkadot/types": "4.8.1",
|
||||||
"@polkadot/util": "^6.1.1",
|
"@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": {
|
||||||
|
|||||||
@@ -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)];
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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);
|
||||||
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'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.5.1' };
|
export const packageInfo = { name: '@polkadot/typegen', version: '4.8.1' };
|
||||||
|
|||||||
@@ -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)) {
|
||||||
|
|||||||
@@ -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)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/types-known",
|
"name": "@polkadot/types-known",
|
||||||
"version": "4.5.1",
|
"version": "4.8.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.14.0",
|
||||||
"@polkadot/networks": "^6.1.1",
|
"@polkadot/networks": "^6.3.1",
|
||||||
"@polkadot/types": "4.5.1",
|
"@polkadot/types": "4.8.1",
|
||||||
"@polkadot/util": "^6.1.1",
|
"@polkadot/util": "^6.3.1",
|
||||||
"bn.js": "^4.11.9"
|
"bn.js": "^4.11.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -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.5.1' };
|
export const packageInfo = { name: '@polkadot/types-known', version: '4.8.1' };
|
||||||
|
|||||||
@@ -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
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,10 @@
|
|||||||
import type { OverrideVersionedType } from '@polkadot/types/types';
|
import type { OverrideVersionedType } from '@polkadot/types/types';
|
||||||
|
|
||||||
const sharedTypes = {
|
const sharedTypes = {
|
||||||
AccountInfo: 'AccountInfoWithDualRefCount',
|
Keys: 'SessionKeys6',
|
||||||
Address: 'MultiAddress',
|
|
||||||
Keys: 'SessionKeys7B',
|
|
||||||
LookupSource: 'MultiAddress',
|
|
||||||
ProxyType: {
|
ProxyType: {
|
||||||
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy']
|
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy']
|
||||||
},
|
}
|
||||||
ValidatorPrefs: 'ValidatorPrefsWithBlocked'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const addrIndicesTypes = {
|
const addrIndicesTypes = {
|
||||||
@@ -168,7 +164,7 @@ const versioned: OverrideVersionedType[] = [
|
|||||||
minmax: [2028, 2029],
|
minmax: [2028, 2029],
|
||||||
types: {
|
types: {
|
||||||
...sharedTypes,
|
...sharedTypes,
|
||||||
Keys: 'SessionKeys6'
|
AccountInfo: 'AccountInfoWithDualRefCount'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,10 +6,7 @@
|
|||||||
import type { OverrideVersionedType } from '@polkadot/types/types';
|
import type { OverrideVersionedType } from '@polkadot/types/types';
|
||||||
|
|
||||||
const sharedTypes = {
|
const sharedTypes = {
|
||||||
AccountInfo: 'AccountInfoWithDualRefCount',
|
Keys: 'SessionKeys6',
|
||||||
Address: 'MultiAddress',
|
|
||||||
Keys: 'SessionKeys7B',
|
|
||||||
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 = {
|
||||||
@@ -72,7 +68,7 @@ const versioned: OverrideVersionedType[] = [
|
|||||||
minmax: [28, 29],
|
minmax: [28, 29],
|
||||||
types: {
|
types: {
|
||||||
...sharedTypes,
|
...sharedTypes,
|
||||||
Keys: 'SessionKeys6'
|
AccountInfo: 'AccountInfoWithDualRefCount'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
import type { OverrideVersionedType } from '@polkadot/types/types';
|
import type { OverrideVersionedType } from '@polkadot/types/types';
|
||||||
|
|
||||||
const sharedTypes = {
|
const sharedTypes = {
|
||||||
Keys: 'SessionKeys7B',
|
Keys: 'SessionKeys6',
|
||||||
ProxyType: {
|
ProxyType: {
|
||||||
_enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy']
|
_enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy']
|
||||||
}
|
}
|
||||||
@@ -71,20 +71,11 @@ const versioned: OverrideVersionedType[] = [
|
|||||||
minmax: [48, 49],
|
minmax: [48, 49],
|
||||||
types: {
|
types: {
|
||||||
...sharedTypes,
|
...sharedTypes,
|
||||||
AccountInfo: 'AccountInfoWithDualRefCount',
|
AccountInfo: 'AccountInfoWithDualRefCount'
|
||||||
Keys: 'SessionKeys6'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// 50 was supposed to have Beefy, didn't
|
minmax: [50, undefined],
|
||||||
minmax: [50, 50],
|
|
||||||
types: {
|
|
||||||
...sharedTypes,
|
|
||||||
Keys: 'SessionKeys6'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
minmax: [51, undefined],
|
|
||||||
types: {
|
types: {
|
||||||
...sharedTypes
|
...sharedTypes
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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]),
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const upgrades: ChainUpgradesRaw = [
|
|||||||
[244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
|
[244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
|
||||||
[528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
|
[528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
|
||||||
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
|
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
|
||||||
[3613564, 27], [3899547, 28], [4345767, 29]
|
[3613564, 27], [3899547, 28], [4345767, 29], [4876134, 30]
|
||||||
];
|
];
|
||||||
|
|
||||||
export default upgrades;
|
export default upgrades;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/types",
|
"name": "@polkadot/types",
|
||||||
"version": "4.5.1",
|
"version": "4.8.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.14.0",
|
||||||
"@polkadot/metadata": "4.5.1",
|
"@polkadot/metadata": "4.8.1",
|
||||||
"@polkadot/util": "^6.1.1",
|
"@polkadot/util": "^6.3.1",
|
||||||
"@polkadot/util-crypto": "^6.1.1",
|
"@polkadot/util-crypto": "^6.3.1",
|
||||||
"@polkadot/x-rxjs": "^6.1.1",
|
"@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.1.1"
|
"@polkadot/keyring": "^6.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +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 { BeefyNextAuthoritySet, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
|
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';
|
||||||
@@ -21,7 +21,7 @@ import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot
|
|||||||
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||||
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
||||||
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
|
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
|
||||||
import type { EthAccount, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature } from '@polkadot/types/interfaces/eth';
|
import type { EthAccount, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature } from '@polkadot/types/interfaces/eth';
|
||||||
import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
|
import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
|
||||||
import type { AnySignature, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
|
import type { AnySignature, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
|
||||||
import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
|
import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
|
||||||
@@ -34,14 +34,14 @@ 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, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExchangeAsset, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InitiateReserveWithdraw, InitiateTeleport, InvalidDisputeStatementKind, Junction, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiAsset, MultiDisputeStatementSet, MultiLocation, NetworkId, NewBidder, Order, OriginKind, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, 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, ValidDisputeStatementKind, 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, 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 { 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, H32, 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 { 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 { 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';
|
||||||
@@ -49,11 +49,12 @@ import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, Vouching
|
|||||||
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, Outcome, PluralityJunction, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, Xcm, XcmAssetEffects, XcmError, XcmHrmpChannelAccepted, XcmHrmpChannelClosing, XcmHrmpNewChannelOpenRequest, XcmOrder, XcmOrderBuyExecution, XcmOrderDepositAsset, XcmOrderDepositReserveAsset, XcmOrderExchangeAsset, XcmOrderInitiateReserveWithdraw, XcmOrderInitiateTeleport, XcmOrderQueryHolding, XcmOriginKind, 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 {
|
||||||
@@ -147,8 +148,6 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
'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>;
|
||||||
@@ -211,10 +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<BeefyKey>': Option<BeefyKey>;
|
||||||
'Option<BeefyNextAuthoritySet>': Option<BeefyNextAuthoritySet>;
|
'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>;
|
||||||
@@ -225,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>;
|
||||||
@@ -257,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>;
|
||||||
@@ -307,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>;
|
||||||
@@ -326,6 +328,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
'Option<DisputeStatement>': Option<DisputeStatement>;
|
'Option<DisputeStatement>': Option<DisputeStatement>;
|
||||||
'Option<DisputeStatementSet>': Option<DisputeStatementSet>;
|
'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>;
|
||||||
@@ -382,6 +385,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
'Option<EthTransactionAction>': Option<EthTransactionAction>;
|
'Option<EthTransactionAction>': Option<EthTransactionAction>;
|
||||||
'Option<EthTransactionCondition>': Option<EthTransactionCondition>;
|
'Option<EthTransactionCondition>': Option<EthTransactionCondition>;
|
||||||
'Option<EthTransactionRequest>': Option<EthTransactionRequest>;
|
'Option<EthTransactionRequest>': Option<EthTransactionRequest>;
|
||||||
|
'Option<EthTransactionSignature>': Option<EthTransactionSignature>;
|
||||||
'Option<EthTransactionStatus>': Option<EthTransactionStatus>;
|
'Option<EthTransactionStatus>': Option<EthTransactionStatus>;
|
||||||
'Option<EthWork>': Option<EthWork>;
|
'Option<EthWork>': Option<EthWork>;
|
||||||
'Option<Event>': Option<Event>;
|
'Option<Event>': Option<Event>;
|
||||||
@@ -396,7 +400,6 @@ 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>;
|
||||||
@@ -455,6 +458,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
'Option<H160>': Option<H160>;
|
'Option<H160>': Option<H160>;
|
||||||
'Option<H2048>': Option<H2048>;
|
'Option<H2048>': Option<H2048>;
|
||||||
'Option<H256>': Option<H256>;
|
'Option<H256>': Option<H256>;
|
||||||
|
'Option<H32>': Option<H32>;
|
||||||
'Option<H512>': Option<H512>;
|
'Option<H512>': Option<H512>;
|
||||||
'Option<H64>': Option<H64>;
|
'Option<H64>': Option<H64>;
|
||||||
'Option<Hash>': Option<Hash>;
|
'Option<Hash>': Option<Hash>;
|
||||||
@@ -500,8 +504,6 @@ 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<InvalidDisputeStatementKind>': Option<InvalidDisputeStatementKind>;
|
||||||
'Option<InvalidTransaction>': Option<InvalidTransaction>;
|
'Option<InvalidTransaction>': Option<InvalidTransaction>;
|
||||||
@@ -549,6 +551,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>;
|
||||||
@@ -566,6 +569,10 @@ 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<MultiDisputeStatementSet>': Option<MultiDisputeStatementSet>;
|
||||||
'Option<MultiLocation>': Option<MultiLocation>;
|
'Option<MultiLocation>': Option<MultiLocation>;
|
||||||
'Option<Multiplier>': Option<Multiplier>;
|
'Option<Multiplier>': Option<Multiplier>;
|
||||||
@@ -599,11 +606,10 @@ 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<Outcome>': Option<Outcome>;
|
||||||
'Option<Owner>': Option<Owner>;
|
'Option<Owner>': Option<Owner>;
|
||||||
'Option<PalletId>': Option<PalletId>;
|
'Option<PalletId>': Option<PalletId>;
|
||||||
'Option<PalletsOrigin>': Option<PalletsOrigin>;
|
'Option<PalletsOrigin>': Option<PalletsOrigin>;
|
||||||
@@ -647,6 +653,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>;
|
||||||
@@ -664,7 +671,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>;
|
||||||
@@ -698,15 +704,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>;
|
||||||
@@ -831,11 +834,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>;
|
||||||
@@ -912,16 +914,34 @@ 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<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>;
|
||||||
@@ -984,10 +1004,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<BeefyKey>': Vec<BeefyKey>;
|
||||||
'Vec<BeefyNextAuthoritySet>': Vec<BeefyNextAuthoritySet>;
|
'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>;
|
||||||
@@ -998,6 +1020,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>;
|
||||||
@@ -1030,8 +1057,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>;
|
||||||
@@ -1080,8 +1105,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>;
|
||||||
@@ -1099,6 +1122,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
'Vec<DisputeStatement>': Vec<DisputeStatement>;
|
'Vec<DisputeStatement>': Vec<DisputeStatement>;
|
||||||
'Vec<DisputeStatementSet>': Vec<DisputeStatementSet>;
|
'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>;
|
||||||
@@ -1155,6 +1179,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
'Vec<EthTransactionAction>': Vec<EthTransactionAction>;
|
'Vec<EthTransactionAction>': Vec<EthTransactionAction>;
|
||||||
'Vec<EthTransactionCondition>': Vec<EthTransactionCondition>;
|
'Vec<EthTransactionCondition>': Vec<EthTransactionCondition>;
|
||||||
'Vec<EthTransactionRequest>': Vec<EthTransactionRequest>;
|
'Vec<EthTransactionRequest>': Vec<EthTransactionRequest>;
|
||||||
|
'Vec<EthTransactionSignature>': Vec<EthTransactionSignature>;
|
||||||
'Vec<EthTransactionStatus>': Vec<EthTransactionStatus>;
|
'Vec<EthTransactionStatus>': Vec<EthTransactionStatus>;
|
||||||
'Vec<EthWork>': Vec<EthWork>;
|
'Vec<EthWork>': Vec<EthWork>;
|
||||||
'Vec<Event>': Vec<Event>;
|
'Vec<Event>': Vec<Event>;
|
||||||
@@ -1169,7 +1194,6 @@ 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>;
|
||||||
@@ -1228,6 +1252,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
'Vec<H160>': Vec<H160>;
|
'Vec<H160>': Vec<H160>;
|
||||||
'Vec<H2048>': Vec<H2048>;
|
'Vec<H2048>': Vec<H2048>;
|
||||||
'Vec<H256>': Vec<H256>;
|
'Vec<H256>': Vec<H256>;
|
||||||
|
'Vec<H32>': Vec<H32>;
|
||||||
'Vec<H512>': Vec<H512>;
|
'Vec<H512>': Vec<H512>;
|
||||||
'Vec<H64>': Vec<H64>;
|
'Vec<H64>': Vec<H64>;
|
||||||
'Vec<Hash>': Vec<Hash>;
|
'Vec<Hash>': Vec<Hash>;
|
||||||
@@ -1273,8 +1298,6 @@ 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<InvalidDisputeStatementKind>': Vec<InvalidDisputeStatementKind>;
|
||||||
'Vec<InvalidTransaction>': Vec<InvalidTransaction>;
|
'Vec<InvalidTransaction>': Vec<InvalidTransaction>;
|
||||||
@@ -1322,6 +1345,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>;
|
||||||
@@ -1339,6 +1363,10 @@ 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<MultiDisputeStatementSet>': Vec<MultiDisputeStatementSet>;
|
||||||
'Vec<MultiLocation>': Vec<MultiLocation>;
|
'Vec<MultiLocation>': Vec<MultiLocation>;
|
||||||
'Vec<Multiplier>': Vec<Multiplier>;
|
'Vec<Multiplier>': Vec<Multiplier>;
|
||||||
@@ -1372,11 +1400,10 @@ 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<Outcome>': Vec<Outcome>;
|
||||||
'Vec<Owner>': Vec<Owner>;
|
'Vec<Owner>': Vec<Owner>;
|
||||||
'Vec<PalletId>': Vec<PalletId>;
|
'Vec<PalletId>': Vec<PalletId>;
|
||||||
'Vec<PalletsOrigin>': Vec<PalletsOrigin>;
|
'Vec<PalletsOrigin>': Vec<PalletsOrigin>;
|
||||||
@@ -1420,6 +1447,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>;
|
||||||
@@ -1437,7 +1465,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>;
|
||||||
@@ -1471,15 +1498,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>;
|
||||||
@@ -1604,11 +1628,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>;
|
||||||
@@ -1685,16 +1708,34 @@ 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<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;
|
||||||
@@ -1757,10 +1798,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;
|
BeefyKey: BeefyKey;
|
||||||
BeefyNextAuthoritySet: BeefyNextAuthoritySet;
|
BeefyNextAuthoritySet: BeefyNextAuthoritySet;
|
||||||
|
BeefyPayload: BeefyPayload;
|
||||||
|
BeefySignedCommitment: BeefySignedCommitment;
|
||||||
Bid: Bid;
|
Bid: Bid;
|
||||||
Bidder: Bidder;
|
Bidder: Bidder;
|
||||||
BidKind: BidKind;
|
BidKind: BidKind;
|
||||||
@@ -1771,6 +1814,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;
|
||||||
@@ -1803,8 +1851,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;
|
||||||
@@ -1853,8 +1899,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;
|
||||||
@@ -1872,6 +1916,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
DisputeStatement: DisputeStatement;
|
DisputeStatement: DisputeStatement;
|
||||||
DisputeStatementSet: DisputeStatementSet;
|
DisputeStatementSet: DisputeStatementSet;
|
||||||
DoNotConstruct: DoNotConstruct;
|
DoNotConstruct: DoNotConstruct;
|
||||||
|
DoubleEncodedCall: DoubleEncodedCall;
|
||||||
DoubleMapTypeLatest: DoubleMapTypeLatest;
|
DoubleMapTypeLatest: DoubleMapTypeLatest;
|
||||||
DoubleMapTypeV10: DoubleMapTypeV10;
|
DoubleMapTypeV10: DoubleMapTypeV10;
|
||||||
DoubleMapTypeV11: DoubleMapTypeV11;
|
DoubleMapTypeV11: DoubleMapTypeV11;
|
||||||
@@ -1928,6 +1973,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
EthTransactionAction: EthTransactionAction;
|
EthTransactionAction: EthTransactionAction;
|
||||||
EthTransactionCondition: EthTransactionCondition;
|
EthTransactionCondition: EthTransactionCondition;
|
||||||
EthTransactionRequest: EthTransactionRequest;
|
EthTransactionRequest: EthTransactionRequest;
|
||||||
|
EthTransactionSignature: EthTransactionSignature;
|
||||||
EthTransactionStatus: EthTransactionStatus;
|
EthTransactionStatus: EthTransactionStatus;
|
||||||
EthWork: EthWork;
|
EthWork: EthWork;
|
||||||
Event: Event;
|
Event: Event;
|
||||||
@@ -1942,7 +1988,6 @@ 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;
|
||||||
@@ -2001,6 +2046,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
H160: H160;
|
H160: H160;
|
||||||
H2048: H2048;
|
H2048: H2048;
|
||||||
H256: H256;
|
H256: H256;
|
||||||
|
H32: H32;
|
||||||
H512: H512;
|
H512: H512;
|
||||||
H64: H64;
|
H64: H64;
|
||||||
Hash: Hash;
|
Hash: Hash;
|
||||||
@@ -2046,8 +2092,6 @@ 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;
|
InvalidDisputeStatementKind: InvalidDisputeStatementKind;
|
||||||
InvalidTransaction: InvalidTransaction;
|
InvalidTransaction: InvalidTransaction;
|
||||||
@@ -2095,6 +2139,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;
|
||||||
@@ -2112,6 +2157,10 @@ 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;
|
MultiDisputeStatementSet: MultiDisputeStatementSet;
|
||||||
MultiLocation: MultiLocation;
|
MultiLocation: MultiLocation;
|
||||||
Multiplier: Multiplier;
|
Multiplier: Multiplier;
|
||||||
@@ -2145,11 +2194,10 @@ 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;
|
||||||
|
Outcome: Outcome;
|
||||||
Owner: Owner;
|
Owner: Owner;
|
||||||
PalletId: PalletId;
|
PalletId: PalletId;
|
||||||
PalletsOrigin: PalletsOrigin;
|
PalletsOrigin: PalletsOrigin;
|
||||||
@@ -2193,6 +2241,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;
|
||||||
@@ -2210,7 +2259,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;
|
||||||
@@ -2244,15 +2292,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;
|
||||||
@@ -2377,11 +2422,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;
|
||||||
@@ -2458,10 +2502,30 @@ 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;
|
||||||
|
XcmQueryResponse: XcmQueryResponse;
|
||||||
|
XcmRelayedFrom: XcmRelayedFrom;
|
||||||
|
XcmReserveAssetDeposit: XcmReserveAssetDeposit;
|
||||||
|
XcmResponse: XcmResponse;
|
||||||
|
XcmTeleportAsset: XcmTeleportAsset;
|
||||||
|
XcmTransact: XcmTransact;
|
||||||
|
XcmTransferAsset: XcmTransferAsset;
|
||||||
|
XcmTransferReserveAsset: XcmTransferReserveAsset;
|
||||||
|
XcmWithdrawAsset: XcmWithdrawAsset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,7 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
|||||||
* @description The length of the value when encoded as a Uint8Array
|
* @description The length of the value when encoded as a Uint8Array
|
||||||
*/
|
*/
|
||||||
public get encodedLength (): number {
|
public get encodedLength (): number {
|
||||||
return this.reduce((total, raw): number => {
|
return this.reduce((total, entry) => total + entry.encodedLength, compactToU8a(this.length).length);
|
||||||
return total + raw.encodedLength;
|
|
||||||
}, compactToU8a(this.length).length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user