Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
+22
-2
@@ -1,8 +1,28 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 4.7.1 Apr 25, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users following Substrate master.
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust Struct decoding with better error messages on invalid input objects
|
||||
- Add support for new `BoundedVec` type
|
||||
- Expand `Data` type (as used in identity), with all is/as getters
|
||||
- Updated `Xcm` types (with Plularity)
|
||||
- Adjust `DispatchError` type as per current Substrate master
|
||||
- Adjusted Statemint `Proxy` type
|
||||
- Remove metadata generation dependency on well-known.json (dedupe)
|
||||
- Adjust WebSocket reconnection delay from 1s to 2.5s
|
||||
- Revert Beefy keys addition for Westend
|
||||
- Add explicit `engines` config to `package.json`
|
||||
- Support for `None` in `RewardDestination`
|
||||
- Align with latest substrate metadata
|
||||
|
||||
|
||||
## 4.6.2 Apr 19, 2021
|
||||
|
||||
Upgrade priority: Low.
|
||||
Upgrade priority: Low. Recommended for users of Kusama/Polkadot.
|
||||
|
||||
Changes:
|
||||
|
||||
@@ -18,7 +38,7 @@ 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 Statemint to known types
|
||||
- Add support for `rpc.beefy.subscribeJustifications`
|
||||
- Update Xcm types
|
||||
- Explicitly handle `isReadyOrError` with `Api.create`
|
||||
|
||||
+6
-6
@@ -25,14 +25,14 @@
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.15",
|
||||
"@babel/register": "^7.13.14",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/dev": "^0.62.8",
|
||||
"@polkadot/ts": "^0.3.62",
|
||||
"@babel/core": "^7.13.16",
|
||||
"@babel/register": "^7.13.16",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/dev": "^0.62.10",
|
||||
"@polkadot/ts": "^0.3.63",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^26.0.22",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"version": "4.6.2"
|
||||
"version": "4.7.1"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-contract",
|
||||
"version": "4.6.2",
|
||||
"version": "4.7.1",
|
||||
"type": "module",
|
||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||
"main": "index.js",
|
||||
@@ -8,6 +8,9 @@
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
"contributors": [],
|
||||
@@ -16,11 +19,11 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/api": "4.6.2",
|
||||
"@polkadot/types": "4.6.2",
|
||||
"@polkadot/util": "^6.2.1",
|
||||
"@polkadot/x-rxjs": "^6.2.1",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/api": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1",
|
||||
"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 { 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';
|
||||
|
||||
@@ -21,7 +21,7 @@ function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string
|
||||
? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
|
||||
: 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 {
|
||||
@@ -81,7 +81,7 @@ export class Abi {
|
||||
const index = data[0];
|
||||
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));
|
||||
}
|
||||
@@ -118,7 +118,7 @@ export class Abi {
|
||||
type: this.registry.getMetaTypeDef(arg.type)
|
||||
};
|
||||
} catch (error) {
|
||||
l.error(`Error expanding argument ${index} in ${JSON.stringify(spec)}`);
|
||||
l.error(`Error expanding argument ${index} in ${stringify(spec)}`);
|
||||
|
||||
throw error;
|
||||
}
|
||||
@@ -186,7 +186,7 @@ export class Abi {
|
||||
}
|
||||
|
||||
#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(
|
||||
u8aConcat(
|
||||
|
||||
@@ -80,7 +80,7 @@ export class MetaRegistry extends TypeRegistry {
|
||||
#getMetaType = (id: SiLookupTypeId): SiType => {
|
||||
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);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ export class MetaRegistry extends TypeRegistry {
|
||||
}
|
||||
|
||||
#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 {
|
||||
info: TypeDefInfo.Vec,
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '4.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '4.7.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api-derive",
|
||||
"version": "4.6.2",
|
||||
"version": "4.7.1",
|
||||
"type": "module",
|
||||
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
|
||||
"main": "index.js",
|
||||
@@ -8,6 +8,9 @@
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
"contributors": [],
|
||||
@@ -16,17 +19,17 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/api": "4.6.2",
|
||||
"@polkadot/rpc-core": "4.6.2",
|
||||
"@polkadot/types": "4.6.2",
|
||||
"@polkadot/util": "^6.2.1",
|
||||
"@polkadot/util-crypto": "^6.2.1",
|
||||
"@polkadot/x-rxjs": "^6.2.1",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/api": "4.7.1",
|
||||
"@polkadot/rpc-core": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^6.2.1",
|
||||
"@polkadot/rpc-provider": "4.6.2"
|
||||
"@polkadot/keyring": "^6.3.1",
|
||||
"@polkadot/rpc-provider": "4.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '4.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', version: '4.7.1' };
|
||||
|
||||
+15
-12
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/api",
|
||||
"version": "4.6.2",
|
||||
"version": "4.7.1",
|
||||
"type": "module",
|
||||
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
|
||||
"main": "index.js",
|
||||
@@ -8,6 +8,9 @@
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
"contributors": [],
|
||||
@@ -16,17 +19,17 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/api-derive": "4.6.2",
|
||||
"@polkadot/keyring": "^6.2.1",
|
||||
"@polkadot/metadata": "4.6.2",
|
||||
"@polkadot/rpc-core": "4.6.2",
|
||||
"@polkadot/rpc-provider": "4.6.2",
|
||||
"@polkadot/types": "4.6.2",
|
||||
"@polkadot/types-known": "4.6.2",
|
||||
"@polkadot/util": "^6.2.1",
|
||||
"@polkadot/util-crypto": "^6.2.1",
|
||||
"@polkadot/x-rxjs": "^6.2.1",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/api-derive": "4.7.1",
|
||||
"@polkadot/keyring": "^6.3.1",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"@polkadot/rpc-core": "4.7.1",
|
||||
"@polkadot/rpc-provider": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/types-known": "4.7.1",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1",
|
||||
"bn.js": "^4.11.9",
|
||||
"eventemitter3": "^4.0.7"
|
||||
}
|
||||
|
||||
@@ -200,12 +200,38 @@ declare module '@polkadot/api/types/consts' {
|
||||
};
|
||||
elections: {
|
||||
[key: string]: Codec;
|
||||
/**
|
||||
* How much should be locked up in order to submit one's candidacy.
|
||||
**/
|
||||
candidacyBond: BalanceOf & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Number of members to elect.
|
||||
**/
|
||||
desiredMembers: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Number of runners_up to keep.
|
||||
**/
|
||||
desiredRunnersUp: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Identifier for the elections-phragmen pallet's lock
|
||||
**/
|
||||
palletId: LockIdentifier & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* How long each seat is kept. This defines the next block number at which an election
|
||||
* round will happen. If set to zero, no elections are ever triggered and the module will
|
||||
* be in passive mode.
|
||||
**/
|
||||
termDuration: BlockNumber & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* 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>;
|
||||
/**
|
||||
* The amount of bond that need to be locked for each vote (32 bytes).
|
||||
**/
|
||||
votingBondFactor: BalanceOf & AugmentedConst<ApiType>;
|
||||
};
|
||||
gilt: {
|
||||
|
||||
@@ -418,10 +418,11 @@ declare module '@polkadot/api/types/events' {
|
||||
**/
|
||||
MemberKicked: AugmentedEvent<ApiType, [AccountId]>;
|
||||
/**
|
||||
* A new term with \[new_members\]. This indicates that enough candidates existed to run the
|
||||
* election, not that enough have has been elected. The inner value must be examined for
|
||||
* this purpose. A `NewTerm(\[\])` indicates that some candidates got their bond slashed and
|
||||
* none were elected, whilst `EmptyTerm` means that no candidates existed to begin with.
|
||||
* A new term with \[new_members\]. This indicates that enough candidates existed to run
|
||||
* the election, not that enough have has been elected. The inner value must be examined
|
||||
* for this purpose. A `NewTerm(\[\])` indicates that some candidates got their bond
|
||||
* slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to
|
||||
* begin with.
|
||||
**/
|
||||
NewTerm: AugmentedEvent<ApiType, [Vec<ITuple<[AccountId, Balance]>>]>;
|
||||
/**
|
||||
|
||||
@@ -1276,8 +1276,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* origin is removed as a runner-up.
|
||||
* - `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.
|
||||
* Similar to [`remove_members`], if replacement runners exists, they are immediately used.
|
||||
* If the prime is renouncing, then no prime will exist until the next round.
|
||||
* Similar to [`remove_members`], if replacement runners exists, they are immediately
|
||||
* 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.
|
||||
*
|
||||
@@ -2836,7 +2836,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - Write: Bonded, Payee, [Origin Account], Locks, Ledger
|
||||
* # </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
|
||||
* for staking.
|
||||
@@ -3142,7 +3142,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - Write: Payee
|
||||
* # </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.
|
||||
*
|
||||
|
||||
@@ -13,7 +13,7 @@ import BN from 'bn.js';
|
||||
import { Metadata } from '@polkadot/metadata';
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
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 { of } from '@polkadot/x-rxjs';
|
||||
import { map, switchMap } from '@polkadot/x-rxjs/operators';
|
||||
@@ -197,7 +197,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
if (Object.keys(types).length) {
|
||||
(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);
|
||||
|
||||
@@ -75,7 +75,7 @@ function mapCapabilities ({ accountIdLength }: Constants, [leasePeriodsPerSlot,
|
||||
const numIds = tupleLength / accountIdLength;
|
||||
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) {
|
||||
// Beefy?
|
||||
@@ -84,7 +84,7 @@ function mapCapabilities ({ accountIdLength }: Constants, [leasePeriodsPerSlot,
|
||||
// @ts-ignore
|
||||
types.Keys = `SessionKeys${numIdsRound - 1}B`;
|
||||
} else {
|
||||
assert(false, `Expected integer number of keys, found ${numIds.toFixed(2)}`);
|
||||
assert(false, () => `Expected integer number of keys, found ${numIds.toFixed(2)}`);
|
||||
}
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', version: '4.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/api', version: '4.7.1' };
|
||||
|
||||
@@ -13,7 +13,7 @@ function sig ({ method, section }: StorageEntry, ...args: Type[]): string {
|
||||
function doDoubleMap (creator: StorageEntry, args: unknown[]): [StorageEntry, [any, any]] {
|
||||
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
|
||||
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] {
|
||||
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
|
||||
return args.length
|
||||
@@ -41,7 +41,7 @@ export function extractStorageArgs (creator: StorageEntry, _args: unknown[]): [S
|
||||
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
|
||||
return [creator];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/metadata",
|
||||
"version": "4.6.2",
|
||||
"version": "4.7.1",
|
||||
"type": "module",
|
||||
"description": "Helpers to extract information from runtime metadata",
|
||||
"main": "index.js",
|
||||
@@ -8,6 +8,9 @@
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"repository": "github:polkadot-js/api",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
@@ -16,14 +19,14 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/types": "4.6.2",
|
||||
"@polkadot/types-known": "4.6.2",
|
||||
"@polkadot/util": "^6.2.1",
|
||||
"@polkadot/util-crypto": "^6.2.1",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/types-known": "4.7.1",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^6.2.1"
|
||||
"@polkadot/keyring": "^6.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export class MagicNumber extends U32 {
|
||||
if (!this.isEmpty) {
|
||||
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()}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export class MetadataVersioned extends Struct {
|
||||
}
|
||||
|
||||
#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;
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ export function createUnchecked (registry: Registry, section: string, callIndex:
|
||||
const funcName = stringCamelCase(callMetadata.name);
|
||||
|
||||
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', {
|
||||
args,
|
||||
|
||||
@@ -65,7 +65,7 @@ function createKeyDoubleMap (registry: Registry, itemFn: CreateItemFn, args: [Cr
|
||||
const { meta: { name, type } } = itemFn;
|
||||
|
||||
// since we are passing an almost-unknown through, trust, but verify
|
||||
assert(Array.isArray(args) && !isUndefined(args[0]) && !isNull(args[0]) && !isUndefined(args[1]) && !isNull(args[1]), `${(name || 'unknown').toString()} is a DoubleMap and requires two arguments`);
|
||||
assert(Array.isArray(args) && !isUndefined(args[0]) && !isNull(args[0]) && !isUndefined(args[1]) && !isNull(args[1]), () => `${(name || 'unknown').toString()} is a DoubleMap and requires two arguments`);
|
||||
|
||||
// if this fails, we have bigger issues
|
||||
assert(!isUndefined(hasher2), '2 hashing functions should be defined for DoubleMaps');
|
||||
@@ -92,7 +92,7 @@ function createKey (registry: Registry, itemFn: CreateItemFn, arg: CreateArgType
|
||||
if (type.isMap) {
|
||||
const map = type.asMap;
|
||||
|
||||
assert(!isUndefined(arg) && !isNull(arg), `${name.toString()} is a Map and requires one argument`);
|
||||
assert(!isUndefined(arg) && !isNull(arg), () => `${name.toString()} is a Map and requires one argument`);
|
||||
|
||||
param = registry.createType(map.key.toString() as 'Raw', arg).toU8a();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { StorageEntry } from '@polkadot/types/primitive/types';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
import type { Storage } from '../types';
|
||||
|
||||
import * as substrate from './substrate';
|
||||
import { substrate } from './substrate';
|
||||
|
||||
/** @internal */
|
||||
export function getStorage (registry: Registry, metaVersion: number): Storage {
|
||||
|
||||
@@ -12,6 +12,8 @@ interface SubstrateMetadata {
|
||||
type: string;
|
||||
}
|
||||
|
||||
type Creator = (registry: Registry, metaVersion: number) => StorageEntry;
|
||||
|
||||
// Small helper function to factorize code on this page.
|
||||
/** @internal */
|
||||
function createRuntimeFunction (method: string, key: string, { documentation, type }: SubstrateMetadata): (registry: Registry, metaVersion: number) => StorageEntry {
|
||||
@@ -29,27 +31,25 @@ function createRuntimeFunction (method: string, key: string, { documentation, ty
|
||||
}, { key, metaVersion, skipHashing: true });
|
||||
}
|
||||
|
||||
export const code = createRuntimeFunction('code', ':code', {
|
||||
documentation: 'Wasm code of the runtime.',
|
||||
type: 'Bytes'
|
||||
});
|
||||
|
||||
export const heapPages = createRuntimeFunction('heapPages', ':heappages', {
|
||||
documentation: 'Number of wasm linear memory pages required for execution of the runtime.',
|
||||
type: 'u64'
|
||||
});
|
||||
|
||||
export const extrinsicIndex = createRuntimeFunction('extrinsicIndex', ':extrinsic_index', {
|
||||
documentation: 'Current extrinsic index (u32) is stored under this key.',
|
||||
type: 'u32'
|
||||
});
|
||||
|
||||
export const changesTrieConfig = createRuntimeFunction('changesTrieConfig', ':changes_trie', {
|
||||
documentation: 'Changes trie configuration is stored under this key.',
|
||||
type: 'u32'
|
||||
});
|
||||
|
||||
export const childStorageKeyPrefix = createRuntimeFunction('childStorageKeyPrefix', ':child_storage:', {
|
||||
documentation: 'Prefix of child storage keys.',
|
||||
type: 'u32'
|
||||
});
|
||||
export const substrate: Record<string, Creator> = {
|
||||
changesTrieConfig: createRuntimeFunction('changesTrieConfig', ':changes_trie', {
|
||||
documentation: ' Changes trie configuration is stored under this key.',
|
||||
type: 'u32'
|
||||
}),
|
||||
childStorageKeyPrefix: createRuntimeFunction('childStorageKeyPrefix', ':child_storage:', {
|
||||
documentation: ' Prefix of child storage keys.',
|
||||
type: 'u32'
|
||||
}),
|
||||
code: createRuntimeFunction('code', ':code', {
|
||||
documentation: ' Wasm code of the runtime.',
|
||||
type: 'Bytes'
|
||||
}),
|
||||
extrinsicIndex: createRuntimeFunction('extrinsicIndex', ':extrinsic_index', {
|
||||
documentation: ' Current extrinsic index (u32) 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'
|
||||
})
|
||||
};
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/metadata', version: '4.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/metadata', version: '4.7.1' };
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Codec, Registry } from '@polkadot/types/types';
|
||||
import type { MetadataInterface } from '../types';
|
||||
|
||||
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 { 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.toJSON()).toEqual(staticSubstrate);
|
||||
} catch (error) {
|
||||
console.error(JSON.stringify(metadata.toJSON()));
|
||||
console.error(stringify(metadata.toJSON()));
|
||||
|
||||
throw error;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ export function defaultValues (registry: Registry, rpcData: string, withThrow =
|
||||
if (withFallbackCheck) {
|
||||
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) {
|
||||
const message = `${location}:: ${(error as Error).message}`;
|
||||
|
||||
@@ -5786,7 +5786,7 @@
|
||||
{
|
||||
"name": "Elections",
|
||||
"storage": {
|
||||
"prefix": "PhragmenElection",
|
||||
"prefix": "Elections",
|
||||
"items": [
|
||||
{
|
||||
"name": "Members",
|
||||
@@ -5956,8 +5956,8 @@
|
||||
" origin is removed as a runner-up.",
|
||||
" - `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.",
|
||||
" Similar to [`remove_members`], if replacement runners exists, they are immediately used.",
|
||||
" If the prime is renouncing, then no prime will exist until the next round.",
|
||||
" Similar to [`remove_members`], if replacement runners exists, they are immediately",
|
||||
" 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.",
|
||||
"",
|
||||
@@ -6028,10 +6028,11 @@
|
||||
"Vec<(AccountId,Balance)>"
|
||||
],
|
||||
"documentation": [
|
||||
" A new term with \\[new_members\\]. This indicates that enough candidates existed to run the",
|
||||
" election, not that enough have has been elected. The inner value must be examined for",
|
||||
" this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond slashed and",
|
||||
" none were elected, whilst `EmptyTerm` means that no candidates existed to begin with."
|
||||
" A new term with \\[new_members\\]. This indicates that enough candidates existed to run",
|
||||
" the election, not that enough have has been elected. The inner value must be examined",
|
||||
" for this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond",
|
||||
" slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to",
|
||||
" begin with."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -6093,47 +6094,66 @@
|
||||
}
|
||||
],
|
||||
"constants": [
|
||||
{
|
||||
"name": "PalletId",
|
||||
"type": "LockIdentifier",
|
||||
"value": "0x706872656c656374",
|
||||
"documentation": [
|
||||
" Identifier for the elections-phragmen pallet's lock"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "CandidacyBond",
|
||||
"type": "BalanceOf",
|
||||
"value": "0x0080c6a47e8d03000000000000000000",
|
||||
"documentation": []
|
||||
"documentation": [
|
||||
" How much should be locked up in order to submit one's candidacy."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "VotingBondBase",
|
||||
"type": "BalanceOf",
|
||||
"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",
|
||||
"type": "BalanceOf",
|
||||
"value": "0x0000cc7b9fae00000000000000000000",
|
||||
"documentation": []
|
||||
"documentation": [
|
||||
" The amount of bond that need to be locked for each vote (32 bytes)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DesiredMembers",
|
||||
"type": "u32",
|
||||
"value": "0x0d000000",
|
||||
"documentation": []
|
||||
"documentation": [
|
||||
" Number of members to elect."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DesiredRunnersUp",
|
||||
"type": "u32",
|
||||
"value": "0x07000000",
|
||||
"documentation": []
|
||||
"documentation": [
|
||||
" Number of runners_up to keep."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "TermDuration",
|
||||
"type": "BlockNumber",
|
||||
"value": "0x80130300",
|
||||
"documentation": []
|
||||
},
|
||||
{
|
||||
"name": "PalletId",
|
||||
"type": "LockIdentifier",
|
||||
"value": "0x706872656c656374",
|
||||
"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",
|
||||
" be in passive mode."
|
||||
]
|
||||
}
|
||||
],
|
||||
"errors": [
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-core",
|
||||
"version": "4.6.2",
|
||||
"version": "4.7.1",
|
||||
"type": "module",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
@@ -8,6 +8,9 @@
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
"contributors": [],
|
||||
@@ -16,14 +19,14 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/metadata": "4.6.2",
|
||||
"@polkadot/rpc-provider": "4.6.2",
|
||||
"@polkadot/types": "4.6.2",
|
||||
"@polkadot/util": "^6.2.1",
|
||||
"@polkadot/x-rxjs": "^6.2.1"
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"@polkadot/rpc-provider": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^6.2.1"
|
||||
"@polkadot/keyring": "^6.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ export class RpcCore {
|
||||
? ''
|
||||
: ` (${def.params.length - reqArgCount} optional)`;
|
||||
|
||||
assert(inputs.length >= reqArgCount && inputs.length <= def.params.length, `Expected ${def.params.length} parameters${optText}, ${inputs.length} found instead`);
|
||||
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 =>
|
||||
createTypeUnsafe(registry, def.params[index].type, [input], { blockHash })
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.7.1' };
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
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 { refCountDelay } from './refCountDelay';
|
||||
@@ -19,7 +19,7 @@ interface Options {
|
||||
const l = logger('drr');
|
||||
|
||||
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> => {
|
||||
l.error(error);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/rpc-provider",
|
||||
"version": "4.6.2",
|
||||
"version": "4.7.1",
|
||||
"type": "module",
|
||||
"description": "Transport providers for the API",
|
||||
"main": "index.js",
|
||||
@@ -8,6 +8,9 @@
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
"contributors": [],
|
||||
@@ -16,19 +19,19 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/types": "4.6.2",
|
||||
"@polkadot/util": "^6.2.1",
|
||||
"@polkadot/util-crypto": "^6.2.1",
|
||||
"@polkadot/x-fetch": "^6.2.1",
|
||||
"@polkadot/x-global": "^6.2.1",
|
||||
"@polkadot/x-ws": "^6.2.1",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"@polkadot/x-fetch": "^6.3.1",
|
||||
"@polkadot/x-global": "^6.3.1",
|
||||
"@polkadot/x-ws": "^6.3.1",
|
||||
"bn.js": "^4.11.9",
|
||||
"eventemitter3": "^4.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^6.2.1",
|
||||
"@polkadot/metadata": "4.6.2",
|
||||
"@polkadot/keyring": "^6.3.1",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"mock-socket": "^9.0.3",
|
||||
"nock": "^13.0.11"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
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 {
|
||||
if (isUndefined(data)) {
|
||||
@@ -12,7 +12,7 @@ function formatErrorData (data?: string | number): string {
|
||||
|
||||
const formatted = `: ${isString(data)
|
||||
? 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
|
||||
// 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 {
|
||||
return JSON.stringify(
|
||||
return stringify(
|
||||
this.encodeObject(method, params)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export class HttpProvider implements ProviderInterface {
|
||||
* @param {string} endpoint The endpoint url starting with http://
|
||||
*/
|
||||
constructor (endpoint: string = defaults.HTTP_URL, headers: Record<string, string> = {}) {
|
||||
assert(/^(https|http):\/\//.test(endpoint), `Endpoint should start with 'http://', received '${endpoint}'`);
|
||||
assert(/^(https|http):\/\//.test(endpoint), () => `Endpoint should start with 'http://', received '${endpoint}'`);
|
||||
|
||||
this.#coder = new RpcCoder();
|
||||
this.#endpoint = endpoint;
|
||||
@@ -116,7 +116,7 @@ export class HttpProvider implements ProviderInterface {
|
||||
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
|
||||
const result = await response.json();
|
||||
|
||||
@@ -60,7 +60,7 @@ export class MockProvider implements ProviderInterface {
|
||||
chain_getFinalizedHead: () => this.registry.createType('Header', rpcHeader.result).hash,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
chain_getHeader: () => this.registry.createType('Header', rpcHeader.result).toJSON(),
|
||||
rpc_methods: (): string[] => [],
|
||||
rpc_methods: () => this.registry.createType('RpcMethods').toJSON(),
|
||||
state_getKeys: (): string[] => [],
|
||||
state_getKeysPaged: (): string[] => [],
|
||||
state_getMetadata: (): string => rpcMetadata,
|
||||
@@ -121,7 +121,7 @@ export class MockProvider implements ProviderInterface {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
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);
|
||||
}
|
||||
@@ -130,7 +130,7 @@ export class MockProvider implements ProviderInterface {
|
||||
public async subscribe (type: string, method: string, ...params: unknown[]): Promise<number> {
|
||||
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 id = ++this.subscriptionId;
|
||||
@@ -151,7 +151,7 @@ export class MockProvider implements ProviderInterface {
|
||||
|
||||
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.subscriptions[sub].callbacks[id];
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.7.1' };
|
||||
|
||||
@@ -38,7 +38,7 @@ const ALIASSES: { [index: string]: string } = {
|
||||
chain_unsubscribeFinalisedHeads: 'chain_unsubscribeFinalizedHeads'
|
||||
};
|
||||
|
||||
const RETRY_DELAY = 1000;
|
||||
const RETRY_DELAY = 2500;
|
||||
|
||||
const l = logger('api-ws');
|
||||
|
||||
@@ -109,7 +109,7 @@ export class WsProvider implements ProviderInterface {
|
||||
assert(endpoints.length !== 0, 'WsProvider requires at least one 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();
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
import { Server, WebSocket } from 'mock-socket';
|
||||
|
||||
import { stringify } from '@polkadot/util';
|
||||
|
||||
interface Scope {
|
||||
body: { [index: string]: Record<string, any> };
|
||||
requests: number;
|
||||
@@ -79,7 +81,7 @@ export function mockWs (requests: ({ method: string } & ErrorDef)[], wsUrl: stri
|
||||
scope.body[request.method] = body;
|
||||
requestCount++;
|
||||
|
||||
socket.send(JSON.stringify(response));
|
||||
socket.send(stringify(response));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/typegen",
|
||||
"version": "4.6.2",
|
||||
"version": "4.7.1",
|
||||
"type": "module",
|
||||
"description": "Type generation scripts",
|
||||
"main": "index.js",
|
||||
@@ -8,6 +8,9 @@
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
"polkadot-types-from-chain": "./scripts/polkadot-types-from-chain.cjs",
|
||||
@@ -23,14 +26,14 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/typegen#readme",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.13.15",
|
||||
"@babel/register": "^7.13.14",
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/api": "4.6.2",
|
||||
"@polkadot/metadata": "4.6.2",
|
||||
"@polkadot/rpc-provider": "4.6.2",
|
||||
"@polkadot/types": "4.6.2",
|
||||
"@polkadot/util": "^6.2.1",
|
||||
"@babel/core": "^7.13.16",
|
||||
"@babel/register": "^7.13.16",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/api": "4.7.1",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"@polkadot/rpc-provider": "4.7.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
"yargs": "^16.2.0"
|
||||
|
||||
@@ -10,7 +10,7 @@ import path from 'path';
|
||||
import { getTypeDef } from '@polkadot/types/create';
|
||||
import { TypeDefInfo } from '@polkadot/types/create/types';
|
||||
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';
|
||||
|
||||
@@ -192,7 +192,7 @@ function generateInterfaces (definitions: Record<string, ModuleTypes>, { types }
|
||||
};
|
||||
|
||||
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)];
|
||||
});
|
||||
|
||||
@@ -7,6 +7,7 @@ import type { Codec, DefinitionRpcParam } from '@polkadot/types/types';
|
||||
import fs from 'fs';
|
||||
|
||||
import { Metadata } from '@polkadot/metadata';
|
||||
import { getStorage as getSubstrateStorage } from '@polkadot/metadata/decorate/storage/getStorage';
|
||||
import rpcdata from '@polkadot/metadata/static';
|
||||
import { Vec } from '@polkadot/types/codec';
|
||||
import { TypeRegistry } from '@polkadot/types/create';
|
||||
@@ -16,15 +17,17 @@ import { Text } from '@polkadot/types/primitive';
|
||||
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
|
||||
import { stringCamelCase, stringLowerFirst } from '@polkadot/util';
|
||||
|
||||
interface SectionItem {
|
||||
link?: string;
|
||||
name: string;
|
||||
[bullet: string]: undefined | string | Vec<Text>;
|
||||
}
|
||||
|
||||
interface Section {
|
||||
link?: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
items: {
|
||||
link?: string;
|
||||
name: string;
|
||||
[bullet: string]: undefined | string | Vec<Text>;
|
||||
}[];
|
||||
items: SectionItem[];
|
||||
}
|
||||
|
||||
interface Page {
|
||||
@@ -156,7 +159,7 @@ function addRpc (): string {
|
||||
});
|
||||
|
||||
return all;
|
||||
}, []).sort((a, b) => a.name.localeCompare(b.name)),
|
||||
}, []).sort(sortByName),
|
||||
title: 'JSON-RPC'
|
||||
});
|
||||
}
|
||||
@@ -192,10 +195,11 @@ function addConstants (metadata: MetadataLatest): string {
|
||||
|
||||
/** @internal */
|
||||
function addStorage (metadata: MetadataLatest): string {
|
||||
const { substrate } = getSubstrateStorage(metadata.registry, 12);
|
||||
const moduleSections = metadata.modules
|
||||
.sort(sortByName)
|
||||
.filter((moduleMetadata) => !moduleMetadata.storage.isNone)
|
||||
.map((moduleMetadata) => {
|
||||
.map((moduleMetadata): Section => {
|
||||
const sectionName = stringLowerFirst(moduleMetadata.name);
|
||||
|
||||
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({
|
||||
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'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '4.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', version: '4.7.1' };
|
||||
|
||||
@@ -12,7 +12,7 @@ import { GenericAccountId, GenericLookupSource, GenericVote } from '@polkadot/ty
|
||||
import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions';
|
||||
import { Null } 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 { formatType } from './formatting';
|
||||
@@ -98,7 +98,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
|
||||
|
||||
possibleTypes.push(`([${subs.join(', ')}])[]`);
|
||||
} 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)) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import Handlebars from 'handlebars';
|
||||
|
||||
import { getTypeDef, paramsNotation } from '@polkadot/types/create';
|
||||
import { TypeDefInfo } from '@polkadot/types/create/types';
|
||||
import { isString } from '@polkadot/util';
|
||||
import { isString, stringify } from '@polkadot/util';
|
||||
|
||||
import { readTemplate } from './file';
|
||||
import { ModuleTypes, setImports, TypeImports } from './imports';
|
||||
@@ -284,7 +284,7 @@ export function formatType (definitions: Record<string, ModuleTypes>, type: stri
|
||||
}
|
||||
|
||||
default: {
|
||||
throw new Error(`Cannot format ${JSON.stringify(type)}`);
|
||||
throw new Error(`Cannot format ${stringify(type)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types-known",
|
||||
"version": "4.6.2",
|
||||
"version": "4.7.1",
|
||||
"type": "module",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
@@ -8,6 +8,9 @@
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
"contributors": [],
|
||||
@@ -16,10 +19,10 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/networks": "^6.2.1",
|
||||
"@polkadot/types": "4.6.2",
|
||||
"@polkadot/util": "^6.2.1",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/networks": "^6.3.1",
|
||||
"@polkadot/types": "4.7.1",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '4.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/types-known', version: '4.7.1' };
|
||||
|
||||
@@ -12,14 +12,15 @@ const versioned: OverrideVersionedType[] = [
|
||||
types: {
|
||||
TAssetBalance: 'u128',
|
||||
ProxyType: {
|
||||
_enum: {
|
||||
Any: 0,
|
||||
NonTransfer: 1,
|
||||
CancelProxy: 2,
|
||||
Assets: 3,
|
||||
AssetOwner: 4,
|
||||
AssetManager: 5
|
||||
}
|
||||
_enum: [
|
||||
'Any',
|
||||
'NonTransfer',
|
||||
'CancelProxy',
|
||||
'Assets',
|
||||
'AssetOwner',
|
||||
'AssetManager',
|
||||
'Staking'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import type { OverrideVersionedType } from '@polkadot/types/types';
|
||||
|
||||
const sharedTypes = {
|
||||
Keys: 'SessionKeys7B',
|
||||
Keys: 'SessionKeys6',
|
||||
ProxyType: {
|
||||
_enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances', 'IdentityJudgement', 'CancelProxy']
|
||||
}
|
||||
@@ -71,20 +71,11 @@ const versioned: OverrideVersionedType[] = [
|
||||
minmax: [48, 49],
|
||||
types: {
|
||||
...sharedTypes,
|
||||
AccountInfo: 'AccountInfoWithDualRefCount',
|
||||
Keys: 'SessionKeys6'
|
||||
AccountInfo: 'AccountInfoWithDualRefCount'
|
||||
}
|
||||
},
|
||||
{
|
||||
// 50 was supposed to have Beefy, didn't
|
||||
minmax: [50, 50],
|
||||
types: {
|
||||
...sharedTypes,
|
||||
Keys: 'SessionKeys6'
|
||||
}
|
||||
},
|
||||
{
|
||||
minmax: [51, undefined],
|
||||
minmax: [50, undefined],
|
||||
types: {
|
||||
...sharedTypes
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { ChainUpgradesRaw } from './types';
|
||||
import BN from 'bn.js';
|
||||
|
||||
import networks from '@polkadot/networks';
|
||||
import { assert, hexToU8a } from '@polkadot/util';
|
||||
import { assert, hexToU8a, stringify } from '@polkadot/util';
|
||||
|
||||
import kusama from './kusama';
|
||||
import polkadot from './polkadot';
|
||||
@@ -30,7 +30,7 @@ function checkOrder (network: string, versions: ChainUpgradesRaw): [number, numb
|
||||
: 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;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ function checkOrder (network: string, versions: ChainUpgradesRaw): [number, numb
|
||||
function mapRaw ([network, versions]: [string, ChainUpgradesRaw]): ChainUpgrades {
|
||||
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 {
|
||||
genesisHash: hexToU8a(chain.genesisHash[0]),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types",
|
||||
"version": "4.6.2",
|
||||
"version": "4.7.1",
|
||||
"type": "module",
|
||||
"description": "Implementation of the Parity codec",
|
||||
"main": "index.js",
|
||||
@@ -8,6 +8,9 @@
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
"contributors": [],
|
||||
@@ -16,15 +19,15 @@
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@polkadot/metadata": "4.6.2",
|
||||
"@polkadot/util": "^6.2.1",
|
||||
"@polkadot/util-crypto": "^6.2.1",
|
||||
"@polkadot/x-rxjs": "^6.2.1",
|
||||
"@babel/runtime": "^7.13.17",
|
||||
"@polkadot/metadata": "4.7.1",
|
||||
"@polkadot/util": "^6.3.1",
|
||||
"@polkadot/util-crypto": "^6.3.1",
|
||||
"@polkadot/x-rxjs": "^6.3.1",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"bn.js": "^4.11.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^6.2.1"
|
||||
"@polkadot/keyring": "^6.3.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,12 +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 { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state';
|
||||
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 { Multiplier } from '@polkadot/types/interfaces/txpayment';
|
||||
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
|
||||
import type { VestingInfo } from '@polkadot/types/interfaces/vesting';
|
||||
import type { AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, DoubleEncodedCall, Junction, MultiAsset, MultiAssetAbstractFungible, MultiAssetAbstractNonFungible, MultiAssetConcreteFungible, MultiAssetConcreteNonFungible, MultiLocation, NetworkId, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, Xcm, XcmAssetEffects, XcmError, XcmHrmpChannelAccepted, XcmHrmpChannelClosing, XcmHrmpNewChannelOpenRequest, XcmOrder, XcmOrderBuyExecution, XcmOrderDepositAsset, XcmOrderDepositReserveAsset, XcmOrderExchangeAsset, XcmOrderInitiateReserveWithdraw, XcmOrderInitiateTeleport, XcmOrderQueryHolding, XcmOriginKind, XcmOutcome, XcmQueryResponse, XcmRelayedFrom, XcmReserveAssetDeposit, XcmResponse, XcmTeleportAsset, XcmTransact, XcmTransferAsset, XcmTransferReserveAsset, XcmWithdrawAsset } from '@polkadot/types/interfaces/xcm';
|
||||
import type { AccountId32Junction, AccountIndex64Junction, AccountKey20Junction, AssetInstance, BodyId, BodyPart, BodyPartAtLeastProportion, BodyPartFraction, BodyPartMoreThanProportion, DoubleEncodedCall, Junction, MultiAsset, MultiAssetAbstractFungible, MultiAssetAbstractNonFungible, MultiAssetConcreteFungible, MultiAssetConcreteNonFungible, MultiLocation, NetworkId, PluralityJunction, VersionedMultiAsset, VersionedMultiLocation, VersionedXcm, Xcm, XcmAssetEffects, XcmError, XcmHrmpChannelAccepted, XcmHrmpChannelClosing, XcmHrmpNewChannelOpenRequest, XcmOrder, XcmOrderBuyExecution, XcmOrderDepositAsset, XcmOrderDepositReserveAsset, XcmOrderExchangeAsset, XcmOrderInitiateReserveWithdraw, XcmOrderInitiateTeleport, XcmOrderQueryHolding, XcmOriginKind, XcmOutcome, XcmQueryResponse, XcmRelayedFrom, XcmReserveAssetDeposit, XcmResponse, XcmTeleportAsset, XcmTransact, XcmTransferAsset, XcmTransferReserveAsset, XcmWithdrawAsset } from '@polkadot/types/interfaces/xcm';
|
||||
|
||||
declare module '@polkadot/types/types/registry' {
|
||||
export interface InterfaceTypes {
|
||||
@@ -226,6 +226,11 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<BlockLength>': Option<BlockLength>;
|
||||
'Option<BlockNumber>': Option<BlockNumber>;
|
||||
'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<Bounty>': Option<Bounty>;
|
||||
@@ -645,6 +650,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<PhantomData>': Option<PhantomData>;
|
||||
'Option<Phase>': Option<Phase>;
|
||||
'Option<PhragmenScore>': Option<PhragmenScore>;
|
||||
'Option<PluralityJunction>': Option<PluralityJunction>;
|
||||
'Option<Points>': Option<Points>;
|
||||
'Option<Precommits>': Option<Precommits>;
|
||||
'Option<PrefabWasmModule>': Option<PrefabWasmModule>;
|
||||
@@ -827,6 +833,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<TAssetDepositBalance>': Option<TAssetDepositBalance>;
|
||||
'Option<Text>': Option<Text>;
|
||||
'Option<Timepoint>': Option<Timepoint>;
|
||||
'Option<TokenError>': Option<TokenError>;
|
||||
'Option<TombstoneContractInfo>': Option<TombstoneContractInfo>;
|
||||
'Option<TransactionPriority>': Option<TransactionPriority>;
|
||||
'Option<TransactionValidityError>': Option<TransactionValidityError>;
|
||||
@@ -1011,6 +1018,11 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<BlockLength>': Vec<BlockLength>;
|
||||
'Vec<BlockNumber>': Vec<BlockNumber>;
|
||||
'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<Bounty>': Vec<Bounty>;
|
||||
@@ -1430,6 +1442,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<PhantomData>': Vec<PhantomData>;
|
||||
'Vec<Phase>': Vec<Phase>;
|
||||
'Vec<PhragmenScore>': Vec<PhragmenScore>;
|
||||
'Vec<PluralityJunction>': Vec<PluralityJunction>;
|
||||
'Vec<Points>': Vec<Points>;
|
||||
'Vec<Precommits>': Vec<Precommits>;
|
||||
'Vec<PrefabWasmModule>': Vec<PrefabWasmModule>;
|
||||
@@ -1612,6 +1625,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<TAssetDepositBalance>': Vec<TAssetDepositBalance>;
|
||||
'Vec<Text>': Vec<Text>;
|
||||
'Vec<Timepoint>': Vec<Timepoint>;
|
||||
'Vec<TokenError>': Vec<TokenError>;
|
||||
'Vec<TombstoneContractInfo>': Vec<TombstoneContractInfo>;
|
||||
'Vec<TransactionPriority>': Vec<TransactionPriority>;
|
||||
'Vec<TransactionValidityError>': Vec<TransactionValidityError>;
|
||||
@@ -1796,6 +1810,11 @@ declare module '@polkadot/types/types/registry' {
|
||||
BlockLength: BlockLength;
|
||||
BlockNumber: BlockNumber;
|
||||
BlockWeights: BlockWeights;
|
||||
BodyId: BodyId;
|
||||
BodyPart: BodyPart;
|
||||
BodyPartAtLeastProportion: BodyPartAtLeastProportion;
|
||||
BodyPartFraction: BodyPartFraction;
|
||||
BodyPartMoreThanProportion: BodyPartMoreThanProportion;
|
||||
bool: bool;
|
||||
Bool: Bool;
|
||||
Bounty: Bounty;
|
||||
@@ -2215,6 +2234,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
PhantomData: PhantomData;
|
||||
Phase: Phase;
|
||||
PhragmenScore: PhragmenScore;
|
||||
PluralityJunction: PluralityJunction;
|
||||
Points: Points;
|
||||
Precommits: Precommits;
|
||||
PrefabWasmModule: PrefabWasmModule;
|
||||
@@ -2397,6 +2417,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
TAssetDepositBalance: TAssetDepositBalance;
|
||||
Text: Text;
|
||||
Timepoint: Timepoint;
|
||||
TokenError: TokenError;
|
||||
TombstoneContractInfo: TombstoneContractInfo;
|
||||
TransactionPriority: TransactionPriority;
|
||||
TransactionValidityError: TransactionValidityError;
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { UIntBitLength } from './types';
|
||||
|
||||
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;
|
||||
|
||||
@@ -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
|
||||
return u8aToBn(value.subarray(0, bitLength / 8), { isLe: true, isNegative }).toString();
|
||||
} 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 maxBits = bitLength - (isSigned && isPositive ? 1 : 0);
|
||||
|
||||
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(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}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
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';
|
||||
|
||||
@@ -176,7 +176,7 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements Codec {
|
||||
* @description Returns the string representation of the value
|
||||
*/
|
||||
public toString (): string {
|
||||
return JSON.stringify(this.toJSON());
|
||||
return stringify(this.toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { CodecHash, Hash } from '../interfaces';
|
||||
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';
|
||||
|
||||
@@ -50,9 +50,7 @@ export class Compact<T extends CompactEncodable> implements ICompact<T> {
|
||||
return new Type(registry, value);
|
||||
}
|
||||
|
||||
const [, _value] = compactFromU8a(value, new Type(registry, 0).bitLength() as UIntBitLength);
|
||||
|
||||
return new Type(registry, _value);
|
||||
return new Type(registry, compactFromU8a(value)[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { CodecHash, Hash } from '../interfaces';
|
||||
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 { 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 {
|
||||
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 {
|
||||
index,
|
||||
@@ -105,7 +105,7 @@ function decodeFromJSON (registry: Registry, def: TypesDef, key: string, value?:
|
||||
const keyLower = key.toLowerCase();
|
||||
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 {
|
||||
return createFromValue(registry, def, Object.values(def)[index].index, value);
|
||||
@@ -213,7 +213,7 @@ export class Enum implements Codec {
|
||||
Object.defineProperty(this, askey, {
|
||||
enumerable: true,
|
||||
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;
|
||||
}
|
||||
@@ -384,7 +384,7 @@ export class Enum implements Codec {
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
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 {
|
||||
return this.isNull
|
||||
? this.type
|
||||
: JSON.stringify(this.toJSON());
|
||||
: stringify(this.toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyJson, Codec, Registry } from '../types';
|
||||
|
||||
import { isFunction, isUndefined } from '@polkadot/util';
|
||||
import { isFunction, isUndefined, stringify } from '@polkadot/util';
|
||||
|
||||
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
|
||||
*/
|
||||
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 { 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';
|
||||
|
||||
@@ -183,7 +183,7 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
|
||||
* @description Returns the string representation of the value
|
||||
*/
|
||||
public toString (): string {
|
||||
return JSON.stringify(this.toJSON());
|
||||
return stringify(this.toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Codec, Constructor, Registry } from '../types';
|
||||
|
||||
import BN from 'bn.js';
|
||||
|
||||
import { assert, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, stringCamelCase, stringUpperFirst, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { assert, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, stringCamelCase, stringify, stringUpperFirst, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { compareArray } from './utils';
|
||||
|
||||
@@ -21,7 +21,7 @@ function encodeSet (setValues: SetValues, value: string[]): BN {
|
||||
/** @internal */
|
||||
function decodeSetArray (setValues: SetValues, value: string[]): string[] {
|
||||
return value.reduce((result, key): string[] => {
|
||||
assert(!isUndefined(setValues[key]), `Set: Invalid key '${key}' passed to Set, allowed ${Object.keys(setValues).join(', ')}`);
|
||||
assert(!isUndefined(setValues[key]), () => `Set: Invalid key '${key}' passed to Set, allowed ${Object.keys(setValues).join(', ')}`);
|
||||
|
||||
result.push(key);
|
||||
|
||||
@@ -42,14 +42,14 @@ function decodeSetNumber (setValues: SetValues, _value: BN | number): string[] {
|
||||
|
||||
const computed = encodeSet(setValues, result);
|
||||
|
||||
assert(bn.eq(computed), `Set: Mismatch decoding '${bn.toString()}', computed as '${computed.toString()}' with ${result.join(', ')}`);
|
||||
assert(bn.eq(computed), () => `Set: Mismatch decoding '${bn.toString()}', computed as '${computed.toString()}' with ${result.join(', ')}`);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
function decodeSet (setValues: SetValues, value: string[] | Set<string> | Uint8Array | BN | number | string = 0, bitLength: number): string[] {
|
||||
assert(bitLength % 8 === 0, `Expected valid bitLength, power of 8, found ${bitLength}`);
|
||||
assert(bitLength % 8 === 0, () => `Expected valid bitLength, power of 8, found ${bitLength}`);
|
||||
|
||||
const byteLength = bitLength / 8;
|
||||
|
||||
@@ -155,7 +155,7 @@ export class CodecSet extends Set<string> implements Codec {
|
||||
// ^^^ add = () property done to assign this instance's this, otherwise Set.add creates "some" chaos
|
||||
// we have the isUndefined(this._setValues) in here as well, add is used internally
|
||||
// in the Set constructor (so it is undefined at this point, and should allow)
|
||||
assert(isUndefined(this.#allowed) || !isUndefined(this.#allowed[key]), `Set: Invalid key '${key}' on add`);
|
||||
assert(isUndefined(this.#allowed) || !isUndefined(this.#allowed[key]), () => `Set: Invalid key '${key}' on add`);
|
||||
|
||||
super.add(key);
|
||||
|
||||
@@ -210,7 +210,7 @@ export class CodecSet extends Set<string> implements Codec {
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
public toRawType (): string {
|
||||
return JSON.stringify({ _set: this.#allowed });
|
||||
return stringify({ _set: this.#allowed });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -119,6 +119,14 @@ describe('Struct', (): void => {
|
||||
).toThrowError(/Cannot decode value/);
|
||||
});
|
||||
|
||||
it('throws a sensical error on incorrect array values passed to structs', (): void => {
|
||||
expect(
|
||||
() => new Struct(registry, {
|
||||
_: 'Vec<u32>'
|
||||
}, [123, 456])
|
||||
).toThrow(/array to object with known keys/);
|
||||
});
|
||||
|
||||
it('provides a clean toString()', (): void => {
|
||||
expect(
|
||||
new (
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { CodecHash, Hash } from '../interfaces/runtime';
|
||||
import type { AnyJson, BareOpts, Codec, Constructor, ConstructorDef, InterfaceTypes, Registry } from '../types';
|
||||
|
||||
import { hexToU8a, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, stringCamelCase, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
import { assert, hexToU8a, isBoolean, isFunction, isHex, isObject, isU8a, isUndefined, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { compareMap, decodeU8a, mapToTypeMap } from './utils';
|
||||
|
||||
@@ -13,8 +13,11 @@ type TypesDef<T = Codec> = Record<string, keyof InterfaceTypes | Constructor<T>>
|
||||
/** @internal */
|
||||
function decodeStructFromObject <T> (registry: Registry, Types: ConstructorDef, value: any, jsonMap: Map<any, string>): T {
|
||||
let jsonObj: Record<string, any> | undefined;
|
||||
const inputKeys = Object.keys(Types);
|
||||
|
||||
return Object.keys(Types).reduce((raw, key, index): T => {
|
||||
assert(!Array.isArray(value) || value.length === inputKeys.length, () => `Struct: Unable to map ${stringify(value)} array to object with known keys ${inputKeys.join(', ')}`);
|
||||
|
||||
return inputKeys.reduce((raw, key, index): T => {
|
||||
// The key in the JSON can be snake_case (or other cases), but in our
|
||||
// Types, result or any other maps, it's camelCase
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
@@ -60,7 +63,7 @@ function decodeStructFromObject <T> (registry: Registry, Types: ConstructorDef,
|
||||
? assign
|
||||
: new Types[key](registry, assign);
|
||||
} else {
|
||||
throw new Error(`Cannot decode value ${JSON.stringify(value)}`);
|
||||
throw new Error(`Cannot decode value ${stringify(value)} (typeof ${typeof value}), expected an input object with known keys`);
|
||||
}
|
||||
} catch (error) {
|
||||
let type = Types[key].name;
|
||||
@@ -297,7 +300,7 @@ export class Struct<
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
public toRawType (): string {
|
||||
return JSON.stringify(
|
||||
return stringify(
|
||||
Struct.typesToMap(this.registry, this.#Types)
|
||||
);
|
||||
}
|
||||
@@ -306,7 +309,7 @@ export class Struct<
|
||||
* @description Returns the string representation of the value
|
||||
*/
|
||||
public toString (): string {
|
||||
return JSON.stringify(this.toJSON());
|
||||
return stringify(this.toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { AnyNumber, AnyString, AnyU8a, Codec, Constructor, InterfaceTypes, Registry } from '../types';
|
||||
|
||||
import { isHex, isU8a, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
import { isHex, isU8a, stringify, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { AbstractArray } from './AbstractArray';
|
||||
import { decodeU8a, mapToTypeMap, typeToConstructor } from './utils';
|
||||
@@ -110,7 +110,7 @@ export class Tuple extends AbstractArray<Codec> {
|
||||
*/
|
||||
public toString (): string {
|
||||
// Overwrite the default toString representation of Array.
|
||||
return JSON.stringify(this.toJSON());
|
||||
return stringify(this.toJSON());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,7 +50,7 @@ export class Vec<T extends Codec> extends AbstractArray<T> {
|
||||
const u8a = u8aToU8a(value);
|
||||
const [offset, length] = compactFromU8a(u8a);
|
||||
|
||||
assert(length.lten(MAX_LENGTH), `Vec length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(length.lten(MAX_LENGTH), () => `Vec length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
|
||||
return decodeU8a(registry, u8a.subarray(offset), new Array(length.toNumber()).fill(Type)) as T[];
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export class VecFixed<T extends Codec> extends AbstractArray<T> {
|
||||
values.push(new Type(registry));
|
||||
}
|
||||
|
||||
assert(values.length === allocLength, `Expected a length of exactly ${allocLength} entries`);
|
||||
assert(values.length === allocLength, () => `Expected a length of exactly ${allocLength} entries`);
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { U8aBitLength, UIntBitLength } from '../codec/types';
|
||||
import type { Codec, Constructor, InterfaceTypes, Registry } from '../types';
|
||||
import type { FromReg, TypeDef } from './types';
|
||||
|
||||
import { assert, isNumber, isUndefined } from '@polkadot/util';
|
||||
import { assert, isNumber, isUndefined, stringify } from '@polkadot/util';
|
||||
|
||||
import { BTreeMap, BTreeSet, CodecSet, Compact, Enum, HashMap, Int, Option, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed } from '../codec';
|
||||
import { DoNotConstruct } from '../primitive';
|
||||
@@ -33,13 +33,13 @@ export function ClassOf<K extends keyof InterfaceTypes> (registry: Registry, nam
|
||||
}
|
||||
|
||||
function getSubDefArray (value: TypeDef): TypeDef[] {
|
||||
assert(value.sub && Array.isArray(value.sub), `Expected subtype as TypeDef[] in ${JSON.stringify(value)}`);
|
||||
assert(value.sub && Array.isArray(value.sub), () => `Expected subtype as TypeDef[] in ${stringify(value)}`);
|
||||
|
||||
return value.sub;
|
||||
}
|
||||
|
||||
function getSubDef (value: TypeDef): TypeDef {
|
||||
assert(value.sub && !Array.isArray(value.sub), `Expected subtype as TypeDef in ${JSON.stringify(value)}`);
|
||||
assert(value.sub && !Array.isArray(value.sub), () => `Expected subtype as TypeDef in ${stringify(value)}`);
|
||||
|
||||
return value.sub;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ function getTypeClassArray (value: TypeDef): (keyof InterfaceTypes)[] {
|
||||
}
|
||||
|
||||
function createInt ({ displayName, length }: TypeDef, Clazz: typeof Int | typeof UInt): Constructor {
|
||||
assert(isNumber(length), `Expected bitLength information for ${displayName || Clazz.constructor.name}<bitLength>`);
|
||||
assert(isNumber(length), () => `Expected bitLength information for ${displayName || Clazz.constructor.name}<bitLength>`);
|
||||
|
||||
return Clazz.with(length as UIntBitLength, displayName);
|
||||
}
|
||||
@@ -185,7 +185,7 @@ export function getTypeClass<T extends Codec = Codec> (registry: Registry, value
|
||||
|
||||
const getFn = infoMapping[value.info];
|
||||
|
||||
assert(getFn, `Unable to construct class from ${JSON.stringify(value)}`);
|
||||
assert(getFn, () => `Unable to construct class from ${stringify(value)}`);
|
||||
|
||||
return getFn(registry, value) as Constructor<T>;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { TypeDef } from './types';
|
||||
|
||||
import { assert, isNumber, isUndefined } from '@polkadot/util';
|
||||
import { assert, isNumber, isUndefined, stringify } from '@polkadot/util';
|
||||
|
||||
import { TypeDefInfo } from './types';
|
||||
|
||||
@@ -34,7 +34,7 @@ function encodeWithParams (typeDef: TypeDef, outer: string): string {
|
||||
return paramsNotation(outer, sub, (param) => encodeTypeDef(param));
|
||||
}
|
||||
|
||||
throw new Error(`Unable to encode ${JSON.stringify(typeDef)} with params`);
|
||||
throw new Error(`Unable to encode ${stringify(typeDef)} with params`);
|
||||
}
|
||||
|
||||
function encodeDoNotConstruct ({ displayName }: TypeDef): string {
|
||||
@@ -44,14 +44,14 @@ function encodeDoNotConstruct ({ displayName }: TypeDef): string {
|
||||
function encodeSubTypes (sub: TypeDef[], asEnum?: boolean): string {
|
||||
const names = sub.map(({ name }) => name);
|
||||
|
||||
assert(names.every((n) => !!n), `Subtypes does not have consistent names, ${names.join(', ')}`);
|
||||
assert(names.every((n) => !!n), () => `Subtypes does not have consistent names, ${names.join(', ')}`);
|
||||
|
||||
const inner = sub.reduce((result: Record<string, string>, type): Record<string, string> => ({
|
||||
...result,
|
||||
[type.name as string]: encodeTypeDef(type)
|
||||
}), {});
|
||||
|
||||
return JSON.stringify(
|
||||
return stringify(
|
||||
asEnum
|
||||
? { _enum: inner }
|
||||
: inner
|
||||
@@ -66,7 +66,7 @@ function encodeEnum (typeDef: TypeDef): string {
|
||||
// c-like enums have all Null entries
|
||||
// TODO We need to take the disciminant into account and auto-add empty entries
|
||||
return sub.every(({ type }) => type === 'Null')
|
||||
? JSON.stringify({ _enum: sub.map(({ name }, index) => `${name || `Empty${index}`}`) })
|
||||
? stringify({ _enum: sub.map(({ name }, index) => `${name || `Empty${index}`}`) })
|
||||
: encodeSubTypes(sub, true);
|
||||
}
|
||||
|
||||
@@ -121,13 +121,13 @@ const encoders: Record<TypeDefInfo, (typeDef: TypeDef) => string> = {
|
||||
function encodeType (typeDef: TypeDef): string {
|
||||
const encoder = encoders[typeDef.info];
|
||||
|
||||
assert(encoder, `Cannot encode type: ${JSON.stringify(typeDef)}`);
|
||||
assert(encoder, () => `Cannot encode type: ${stringify(typeDef)}`);
|
||||
|
||||
return encoder(typeDef);
|
||||
}
|
||||
|
||||
export function encodeTypeDef (typeDef: TypeDef): string {
|
||||
assert(!isUndefined(typeDef.info), `Invalid type definition with no instance info, ${JSON.stringify(typeDef)}`);
|
||||
assert(!isUndefined(typeDef.info), () => `Invalid type definition with no instance info, ${stringify(typeDef)}`);
|
||||
|
||||
// In the case of contracts we do have the unfortunate situation where the displayName would
|
||||
// refer to "Option" when it is an option. For these, string it out, only using when actually
|
||||
|
||||
@@ -110,7 +110,7 @@ function _decodeFixedVec (value: TypeDef, type: string, _: string, count: number
|
||||
const length = parseInt(strLength.trim(), 10);
|
||||
|
||||
// as a first round, only u8 via u8aFixed, we can add more support
|
||||
assert(length <= 256, `${type}: Only support for [Type; <length>], where length <= 256`);
|
||||
assert(length <= 256, () => `${type}: Only support for [Type; <length>], where length <= 256`);
|
||||
|
||||
value.displayName = displayName;
|
||||
value.length = length;
|
||||
@@ -137,7 +137,7 @@ function _decodeAnyInt (value: TypeDef, type: string, _: string, clazz: 'Int' |
|
||||
const length = parseInt(strLength.trim(), 10);
|
||||
|
||||
// as a first round, only u8 via u8aFixed, we can add more support
|
||||
assert(length <= 8192 && (length % 8) === 0, `${type}: Only support for ${clazz}<bitLength>, where length <= 8192 and a power of 8, found ${length}`);
|
||||
assert(length <= 8192 && (length % 8) === 0, () => `${type}: Only support for ${clazz}<bitLength>, where length <= 8192 and a power of 8, found ${length}`);
|
||||
|
||||
value.displayName = displayName;
|
||||
value.length = length;
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { CallFunction, Codec, CodecHasher, Constructor, InterfaceTypes, Reg
|
||||
// we are attempting to avoid circular refs, hence the Metadata path import
|
||||
import { decorateConstants, decorateExtrinsics } from '@polkadot/metadata/decorate';
|
||||
import { Metadata } from '@polkadot/metadata/Metadata';
|
||||
import { assert, assertReturn, BN_ZERO, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, u8aToHex } from '@polkadot/util';
|
||||
import { assert, assertReturn, BN_ZERO, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, stringify, u8aToHex } from '@polkadot/util';
|
||||
import { blake2AsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
import { Json } from '../codec/Json';
|
||||
@@ -340,8 +340,8 @@ export class TypeRegistry implements Registry {
|
||||
if (isFunction(arg1)) {
|
||||
this.#classes.set(arg1.name, arg1);
|
||||
} else if (isString(arg1)) {
|
||||
assert(isFunction(arg2), `Expected class definition passed to '${arg1}' registration`);
|
||||
assert(arg1 !== arg2.toString(), `Unable to register circular ${arg1} === ${arg1}`);
|
||||
assert(isFunction(arg2), () => `Expected class definition passed to '${arg1}' registration`);
|
||||
assert(arg1 !== arg2.toString(), () => `Unable to register circular ${arg1} === ${arg1}`);
|
||||
|
||||
this.#classes.set(arg1, arg2);
|
||||
} else {
|
||||
@@ -357,9 +357,9 @@ export class TypeRegistry implements Registry {
|
||||
} else {
|
||||
const def = isString(type)
|
||||
? type
|
||||
: JSON.stringify(type);
|
||||
: stringify(type);
|
||||
|
||||
assert(name !== def, `Unable to register circular ${name} === ${def}`);
|
||||
assert(name !== def, () => `Unable to register circular ${name} === ${def}`);
|
||||
|
||||
// we already have this type, remove the classes registered for it
|
||||
if (this.#classes.has(name)) {
|
||||
|
||||
@@ -16,12 +16,14 @@ const mappings: Mapper[] = [
|
||||
alias(['VecDeque<'], 'Vec<', false),
|
||||
// <T::Balance as HasCompact>
|
||||
cleanupCompact(),
|
||||
// Change BoundedVec<Type, Size> to Vec<Type>
|
||||
removeBoundedVec(),
|
||||
// Remove all the trait prefixes
|
||||
removeTraits(),
|
||||
// remove PairOf<T> -> (T, T)
|
||||
removePairOf(),
|
||||
// remove boxing, `Box<Proposal>` -> `Proposal`
|
||||
removeWrap('Box'),
|
||||
removeWrap('Box<'),
|
||||
// remove generics, `MisbehaviorReport<Hash, BlockNumber>` -> `MisbehaviorReport`
|
||||
removeGenerics(),
|
||||
// alias String -> Text (compat with jsonrpc methods)
|
||||
@@ -61,18 +63,17 @@ export function findClosing (value: string, start: number): number {
|
||||
}
|
||||
|
||||
export function alias (src: string[], dest: string, withChecks = true): Mapper {
|
||||
return (value: string): string => {
|
||||
return src.reduce((value, src): string => {
|
||||
return value
|
||||
return (value: string): string =>
|
||||
src.reduce((value, src): string =>
|
||||
value
|
||||
.replace(
|
||||
new RegExp(`(^${src}|${BOX_PRECEDING.map((box) => `\\${box}${src}`).join('|')})`, 'g'),
|
||||
(src): string =>
|
||||
withChecks && BOX_PRECEDING.includes(src[0])
|
||||
? `${src[0]}${dest}`
|
||||
: dest
|
||||
);
|
||||
}, value);
|
||||
};
|
||||
), value
|
||||
);
|
||||
}
|
||||
|
||||
export function cleanupCompact (): Mapper {
|
||||
@@ -94,9 +95,29 @@ export function cleanupCompact (): Mapper {
|
||||
}
|
||||
|
||||
export function flattenSingleTuple (): Mapper {
|
||||
return (value: string): string => {
|
||||
return value.replace(/\(([^,]+)\)/, '$1');
|
||||
};
|
||||
return (value: string) =>
|
||||
value.replace(/\(([^,]+)\)/, '$1');
|
||||
}
|
||||
|
||||
function replaceTagWith (value: string, matcher: string, replacer: (inner: string) => string): string {
|
||||
for (let index = 0; index < value.length; index++) {
|
||||
if (value.substr(index, matcher.length) === matcher) {
|
||||
const start = index + matcher.length;
|
||||
const end = findClosing(value, start);
|
||||
|
||||
value = `${value.substr(0, index)}${replacer(value.substr(start, end - start))}${value.substr(end + 1)}`;
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// remove the BoundedVec wrappers
|
||||
export function removeBoundedVec (): Mapper {
|
||||
const replacer = (inner: string) => `Vec<${inner.split(',')[0]}>`;
|
||||
|
||||
return (value: string) =>
|
||||
replaceTagWith(value, 'BoundedVec<', replacer);
|
||||
}
|
||||
|
||||
export function removeColons (): Mapper {
|
||||
@@ -156,25 +177,16 @@ export function removeGenerics (): Mapper {
|
||||
|
||||
// remove the PairOf wrappers
|
||||
export function removePairOf (): Mapper {
|
||||
return (value: string): string => {
|
||||
for (let index = 0; index < value.length; index++) {
|
||||
if (value.substr(index, 7) === 'PairOf<') {
|
||||
const start = index + 7;
|
||||
const end = findClosing(value, start);
|
||||
const type = value.substr(start, end - start);
|
||||
const replacer = (inner: string) => `(${inner},${inner})`;
|
||||
|
||||
value = `${value.substr(0, index)}(${type},${type})${value.substr(end + 1)}`;
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
return (value: string) =>
|
||||
replaceTagWith(value, 'PairOf<', replacer);
|
||||
}
|
||||
|
||||
// remove the type traits
|
||||
export function removeTraits (): Mapper {
|
||||
return (value: string): string => {
|
||||
return value
|
||||
return (value: string): string =>
|
||||
value
|
||||
// remove all whitespaces
|
||||
.replace(/\s/g, '')
|
||||
// anything `T::<type>` to end up as `<type>`
|
||||
@@ -187,34 +199,19 @@ export function removeTraits (): Mapper {
|
||||
.replace(/<LookupasStaticLookup>/g, 'Lookup')
|
||||
// replace `<...>::Type`
|
||||
.replace(/::Type/g, '');
|
||||
};
|
||||
}
|
||||
|
||||
// remove wrapping values, i.e. Box<Proposal> -> Proposal
|
||||
export function removeWrap (_check: string): Mapper {
|
||||
const check = `${_check}<`;
|
||||
export function removeWrap (check: string): Mapper {
|
||||
const replacer = (inner: string) => inner;
|
||||
|
||||
return (value: string): string => {
|
||||
let index = 0;
|
||||
|
||||
while (index !== -1) {
|
||||
index = value.indexOf(check);
|
||||
|
||||
if (index !== -1) {
|
||||
const start = index + check.length;
|
||||
const end = findClosing(value, start);
|
||||
|
||||
value = `${value.substr(0, index)}${value.substr(start, end - start)}${value.substr(end + 1)}`;
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
return (value: string) =>
|
||||
replaceTagWith(value, check, replacer);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export function sanitize (value: String | string, options?: SanitizeOptions): string {
|
||||
return mappings.reduce((result, fn): string => {
|
||||
return fn(result, options);
|
||||
}, value.toString()).trim();
|
||||
return mappings.reduce((result, fn): string =>
|
||||
fn(result, options), value.toString()
|
||||
).trim();
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export function typeSplit (type: string): string[] {
|
||||
}
|
||||
}
|
||||
|
||||
assert(isNotNested(cDepth, fDepth, sDepth, tDepth), `Invalid definition (missing terminators) found in ${type}`);
|
||||
assert(isNotNested(cDepth, fDepth, sDepth, tDepth), () => `Invalid definition (missing terminators) found in ${type}`);
|
||||
|
||||
// the final leg of the journey
|
||||
result.push(type.substr(start, type.length - start).trim());
|
||||
|
||||
@@ -206,7 +206,7 @@ export class GenericExtrinsic<A extends AnyTuple = AnyTuple> extends ExtrinsicBa
|
||||
const [offset, length] = compactFromU8a(value);
|
||||
const total = offset + length.toNumber();
|
||||
|
||||
assert(total <= value.length, `Extrinsic: length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
assert(total <= value.length, () => `Extrinsic: length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
|
||||
const data = value.subarray(offset, total);
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ export class GenericExtrinsicEra extends Enum implements IExtrinsicEra {
|
||||
* @description Returns the item as a [[ImmortalEra]]
|
||||
*/
|
||||
public get asImmortalEra (): ImmortalEra {
|
||||
assert(this.isImmortalEra, `Cannot convert '${this.type}' via asImmortalEra`);
|
||||
assert(this.isImmortalEra, () => `Cannot convert '${this.type}' via asImmortalEra`);
|
||||
|
||||
return this.value as ImmortalEra;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ export class GenericExtrinsicEra extends Enum implements IExtrinsicEra {
|
||||
* @description Returns the item as a [[MortalEra]]
|
||||
*/
|
||||
public get asMortalEra (): MortalEra {
|
||||
assert(this.isMortalEra, `Cannot convert '${this.type}' via asMortalEra`);
|
||||
assert(this.isMortalEra, () => `Cannot convert '${this.type}' via asMortalEra`);
|
||||
|
||||
return this.value as MortalEra;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Address, Balance, Call, Index } from '../../interfaces/runtime';
|
||||
import type { ExtrinsicPayloadValue, IExtrinsicSignature, IKeyringPair, Registry, SignatureOptions } from '../../types';
|
||||
import type { ExtrinsicSignatureOptions } from '../types';
|
||||
|
||||
import { assert, isU8a, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
import { assert, isU8a, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { Compact } from '../../codec/Compact';
|
||||
import { Enum } from '../../codec/Enum';
|
||||
@@ -155,7 +155,7 @@ export class GenericExtrinsicSignatureV4 extends Struct implements IExtrinsicSig
|
||||
* @description Generate a payload and applies the signature from a keypair
|
||||
*/
|
||||
public sign (method: Call, account: IKeyringPair, options: SignatureOptions): IExtrinsicSignature {
|
||||
assert(account && account.addressRaw, `Expected a valid keypair for signing, found ${JSON.stringify(account)}`);
|
||||
assert(account && account.addressRaw, () => `Expected a valid keypair for signing, found ${stringify(account)}`);
|
||||
|
||||
const signer = toAddress(this.registry, account.addressRaw);
|
||||
const payload = this.createPayload(method, options);
|
||||
@@ -168,7 +168,7 @@ export class GenericExtrinsicSignatureV4 extends Struct implements IExtrinsicSig
|
||||
* @description Generate a payload and applies a fake signature
|
||||
*/
|
||||
public signFake (method: Call, address: Address | Uint8Array | string, options: SignatureOptions): IExtrinsicSignature {
|
||||
assert(address, `Expected a valid address for signing, found ${JSON.stringify(address)}`);
|
||||
assert(address, () => `Expected a valid address for signing, found ${stringify(address)}`);
|
||||
|
||||
const signer = toAddress(this.registry, address);
|
||||
const payload = this.createPayload(method, options);
|
||||
|
||||
@@ -35,15 +35,11 @@ export class GenericAccountId extends U8aFixed {
|
||||
const decoded = decodeAccountId(value);
|
||||
|
||||
// Part of stream containing >= 32 bytes or a all empty (defaults)
|
||||
assert(decoded.length >= 32 || !decoded.some((b) => b), `Invalid AccountId provided, expected 32 bytes, found ${decoded.length}`);
|
||||
assert(decoded.length >= 32 || !decoded.some((b) => b), () => `Invalid AccountId provided, expected 32 bytes, found ${decoded.length}`);
|
||||
|
||||
super(registry, decoded, 256);
|
||||
}
|
||||
|
||||
public static encode (value: Uint8Array, ss58Format?: number): string {
|
||||
return encodeAddress(value, ss58Format);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Compares the value of the input to see if there is a match
|
||||
*/
|
||||
@@ -69,7 +65,7 @@ export class GenericAccountId extends U8aFixed {
|
||||
* @description Returns the string representation of the value
|
||||
*/
|
||||
public toString (): string {
|
||||
return GenericAccountId.encode(this, this.registry.chainSS58);
|
||||
return encodeAddress(this, this.registry.chainSS58);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@ describe('Call', (): void => {
|
||||
it('handles decoding correctly (bare)', (): void => {
|
||||
expect(
|
||||
new Call(registry, {
|
||||
args: [],
|
||||
args: ['0x0000000000000000000000000000000000000000000000000000000000000000', 0, 0],
|
||||
callIndex: [6, 1] // balances.setBalance
|
||||
}).toU8a()
|
||||
).toEqual(
|
||||
|
||||
@@ -172,7 +172,8 @@ export default {
|
||||
Staked: 'Null',
|
||||
Stash: 'Null',
|
||||
Controller: 'Null',
|
||||
Account: 'AccountId'
|
||||
Account: 'AccountId',
|
||||
None: 'Null'
|
||||
}
|
||||
},
|
||||
RewardPoint: 'u32',
|
||||
|
||||
@@ -193,6 +193,7 @@ export interface RewardDestination extends Enum {
|
||||
readonly isController: boolean;
|
||||
readonly isAccount: boolean;
|
||||
readonly asAccount: AccountId;
|
||||
readonly isNone: boolean;
|
||||
}
|
||||
|
||||
/** @name RewardPoint */
|
||||
|
||||
@@ -183,7 +183,10 @@ export default {
|
||||
Other: 'Null',
|
||||
CannotLookup: 'Null',
|
||||
BadOrigin: 'Null',
|
||||
Module: 'DispatchErrorModule'
|
||||
Module: 'DispatchErrorModule',
|
||||
ConsumerRemaining: 'Null',
|
||||
NoProviders: 'Null',
|
||||
Token: 'TokenError'
|
||||
}
|
||||
},
|
||||
DispatchErrorModule: {
|
||||
@@ -342,6 +345,18 @@ export default {
|
||||
highestBlock: 'Option<BlockNumber>'
|
||||
},
|
||||
SystemOrigin: 'RawOrigin',
|
||||
TokenError: {
|
||||
_enum: [
|
||||
'NoFunds',
|
||||
'WouldDie',
|
||||
'BelowMinimum',
|
||||
'CannotCreate',
|
||||
'UnknownAsset',
|
||||
'Frozen',
|
||||
'Underflow',
|
||||
'Overflow'
|
||||
]
|
||||
},
|
||||
TransactionValidityError: {
|
||||
_enum: {
|
||||
Invalid: 'InvalidTransaction',
|
||||
|
||||
@@ -92,6 +92,10 @@ export interface DispatchError extends Enum {
|
||||
readonly isBadOrigin: boolean;
|
||||
readonly isModule: boolean;
|
||||
readonly asModule: DispatchErrorModule;
|
||||
readonly isConsumerRemaining: boolean;
|
||||
readonly isNoProviders: boolean;
|
||||
readonly isToken: boolean;
|
||||
readonly asToken: TokenError;
|
||||
}
|
||||
|
||||
/** @name DispatchErrorModule */
|
||||
@@ -341,6 +345,18 @@ export interface SyncState extends Struct {
|
||||
/** @name SystemOrigin */
|
||||
export interface SystemOrigin extends RawOrigin {}
|
||||
|
||||
/** @name TokenError */
|
||||
export interface TokenError extends Enum {
|
||||
readonly isNoFunds: boolean;
|
||||
readonly isWouldDie: boolean;
|
||||
readonly isBelowMinimum: boolean;
|
||||
readonly isCannotCreate: boolean;
|
||||
readonly isUnknownAsset: boolean;
|
||||
readonly isFrozen: boolean;
|
||||
readonly isUnderflow: boolean;
|
||||
readonly isOverflow: boolean;
|
||||
}
|
||||
|
||||
/** @name TransactionValidityError */
|
||||
export interface TransactionValidityError extends Enum {
|
||||
readonly isInvalid: boolean;
|
||||
|
||||
@@ -106,21 +106,78 @@ const multiAsset = {
|
||||
}
|
||||
};
|
||||
|
||||
const junction = {
|
||||
BodyId: {
|
||||
_enum: {
|
||||
Unit: 'Null',
|
||||
Named: 'Vec<u8>',
|
||||
Index: 'Compact<u32>',
|
||||
Executive: 'Null',
|
||||
Technical: 'Null',
|
||||
Legislative: 'Null',
|
||||
Judicial: 'Null'
|
||||
}
|
||||
},
|
||||
BodyPart: {
|
||||
_enum: {
|
||||
Voice: 'Null',
|
||||
Members: 'Compact<u32>',
|
||||
Fraction: 'BodyPartFraction',
|
||||
AtLeastProportion: 'BodyPartAtLeastProportion',
|
||||
MoreThanProportion: 'BodyPartMoreThanProportion'
|
||||
}
|
||||
},
|
||||
BodyPartFraction: { nom: 'Compact<u32>', denom: 'Compact<u32>' },
|
||||
BodyPartAtLeastProportion: { nom: 'Compact<u32>', denom: 'Compact<u32>' },
|
||||
BodyPartMoreThanProportion: { nom: 'Compact<u32>', denom: 'Compact<u32>' },
|
||||
AccountId32Junction: {
|
||||
network: 'NetworkId',
|
||||
id: 'AccountId'
|
||||
},
|
||||
AccountIndex64Junction: {
|
||||
network: 'NetworkId',
|
||||
index: 'Compact<u64>'
|
||||
},
|
||||
AccountKey20Junction: {
|
||||
network: 'NetworkId',
|
||||
index: '[u8; 20]'
|
||||
},
|
||||
PluralityJunction: {
|
||||
id: 'BodyId',
|
||||
part: 'BodyPart'
|
||||
},
|
||||
Junction: {
|
||||
_enum: {
|
||||
Parent: 'Null',
|
||||
Parachain: 'Compact<u32>',
|
||||
AccountId32: 'AccountId32Junction',
|
||||
AccountIndex64: 'AccountIndex64Junction',
|
||||
AccountKey20: 'AccountKey20Junction',
|
||||
PalletInstance: 'u8',
|
||||
GeneralIndex: 'Compact<u128>',
|
||||
GeneralKey: 'Vec<u8>',
|
||||
OnlyChild: 'Null',
|
||||
Plurality: 'PluralityJunction'
|
||||
}
|
||||
},
|
||||
NetworkId: {
|
||||
_enum: {
|
||||
Any: 'Null',
|
||||
Named: 'Vec<u8>',
|
||||
Polkadot: 'Null',
|
||||
Kusama: 'Null'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
types: {
|
||||
...junction,
|
||||
...multiAsset,
|
||||
...xcm,
|
||||
...xmcOrder,
|
||||
DoubleEncodedCall: { encoded: 'Vec<u8>' },
|
||||
NetworkId: {
|
||||
_enum: {
|
||||
Any: 'Null',
|
||||
Named: 'Vec<u8>',
|
||||
Polkadot: 'Null',
|
||||
Kusama: 'Null'
|
||||
}
|
||||
},
|
||||
XcmOriginKind: {
|
||||
_enum: ['Native', 'SovereignAccount', 'Superuser']
|
||||
},
|
||||
@@ -178,31 +235,6 @@ export default {
|
||||
X8: '(Junction, Junction, Junction, Junction, Junction, Junction, Junction, Junction)'
|
||||
}
|
||||
},
|
||||
AccountId32Junction: {
|
||||
network: 'NetworkId',
|
||||
id: 'AccountId'
|
||||
},
|
||||
AccountIndex64Junction: {
|
||||
network: 'NetworkId',
|
||||
index: 'Compact<u64>'
|
||||
},
|
||||
AccountKey20Junction: {
|
||||
network: 'NetworkId',
|
||||
index: '[u8; 20]'
|
||||
},
|
||||
Junction: {
|
||||
_enum: {
|
||||
Parent: 'Null',
|
||||
Parachain: 'Compact<u32>',
|
||||
AccountId32: 'AccountId32Junction',
|
||||
AccountIndex64: 'AccountIndex64Junction',
|
||||
AccountKey20: 'AccountKey20Junction',
|
||||
PalletInstance: 'u8',
|
||||
GeneralIndex: 'Compact<u128>',
|
||||
GeneralKey: 'Vec<u8>',
|
||||
OnlyChild: 'Null'
|
||||
}
|
||||
},
|
||||
VersionedMultiLocation: {
|
||||
_enum: {
|
||||
V0: 'MultiLocation'
|
||||
|
||||
@@ -48,6 +48,50 @@ export interface AssetInstance extends Enum {
|
||||
readonly asBlob: Bytes;
|
||||
}
|
||||
|
||||
/** @name BodyId */
|
||||
export interface BodyId extends Enum {
|
||||
readonly isUnit: boolean;
|
||||
readonly isNamed: boolean;
|
||||
readonly asNamed: Bytes;
|
||||
readonly isIndex: boolean;
|
||||
readonly asIndex: Compact<u32>;
|
||||
readonly isExecutive: boolean;
|
||||
readonly isTechnical: boolean;
|
||||
readonly isLegislative: boolean;
|
||||
readonly isJudicial: boolean;
|
||||
}
|
||||
|
||||
/** @name BodyPart */
|
||||
export interface BodyPart extends Enum {
|
||||
readonly isVoice: boolean;
|
||||
readonly isMembers: boolean;
|
||||
readonly asMembers: Compact<u32>;
|
||||
readonly isFraction: boolean;
|
||||
readonly asFraction: BodyPartFraction;
|
||||
readonly isAtLeastProportion: boolean;
|
||||
readonly asAtLeastProportion: BodyPartAtLeastProportion;
|
||||
readonly isMoreThanProportion: boolean;
|
||||
readonly asMoreThanProportion: BodyPartMoreThanProportion;
|
||||
}
|
||||
|
||||
/** @name BodyPartAtLeastProportion */
|
||||
export interface BodyPartAtLeastProportion extends Struct {
|
||||
readonly nom: Compact<u32>;
|
||||
readonly denom: Compact<u32>;
|
||||
}
|
||||
|
||||
/** @name BodyPartFraction */
|
||||
export interface BodyPartFraction extends Struct {
|
||||
readonly nom: Compact<u32>;
|
||||
readonly denom: Compact<u32>;
|
||||
}
|
||||
|
||||
/** @name BodyPartMoreThanProportion */
|
||||
export interface BodyPartMoreThanProportion extends Struct {
|
||||
readonly nom: Compact<u32>;
|
||||
readonly denom: Compact<u32>;
|
||||
}
|
||||
|
||||
/** @name DoubleEncodedCall */
|
||||
export interface DoubleEncodedCall extends Struct {
|
||||
readonly encoded: Bytes;
|
||||
@@ -71,6 +115,8 @@ export interface Junction extends Enum {
|
||||
readonly isGeneralKey: boolean;
|
||||
readonly asGeneralKey: Bytes;
|
||||
readonly isOnlyChild: boolean;
|
||||
readonly isPlurality: boolean;
|
||||
readonly asPlurality: PluralityJunction;
|
||||
}
|
||||
|
||||
/** @name MultiAsset */
|
||||
@@ -151,6 +197,12 @@ export interface NetworkId extends Enum {
|
||||
readonly isKusama: boolean;
|
||||
}
|
||||
|
||||
/** @name PluralityJunction */
|
||||
export interface PluralityJunction extends Struct {
|
||||
readonly id: BodyId;
|
||||
readonly part: BodyPart;
|
||||
}
|
||||
|
||||
/** @name VersionedMultiAsset */
|
||||
export interface VersionedMultiAsset extends Enum {
|
||||
readonly isV0: boolean;
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types', version: '4.6.2' };
|
||||
export const packageInfo = { name: '@polkadot/types', version: '4.7.1' };
|
||||
|
||||
@@ -17,7 +17,7 @@ function decodeBitVecU8a (value?: Uint8Array): Uint8Array {
|
||||
const [offset, length] = compactFromU8a(value);
|
||||
const total = offset + Math.ceil(length.toNumber() / 8);
|
||||
|
||||
assert(total <= value.length, `BitVec: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
assert(total <= value.length, () => `BitVec: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
|
||||
return value.subarray(offset, total);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ function decodeBytesU8a (value: Uint8Array): Uint8Array {
|
||||
const [offset, length] = compactFromU8a(value);
|
||||
const total = offset + length.toNumber();
|
||||
|
||||
assert(length.lten(MAX_LENGTH), `Bytes length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(total <= value.length, `Bytes: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
assert(length.lten(MAX_LENGTH), () => `Bytes length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(total <= value.length, () => `Bytes: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
|
||||
return value.subarray(offset, total);
|
||||
}
|
||||
|
||||
@@ -59,6 +59,14 @@ export class Data extends Enum {
|
||||
}, ...decodeData(registry, value));
|
||||
}
|
||||
|
||||
get asBlakeTwo256 (): H256 {
|
||||
return this.value as H256;
|
||||
}
|
||||
|
||||
get asKeccak256 (): H256 {
|
||||
return this.value as H256;
|
||||
}
|
||||
|
||||
get asRaw (): Bytes {
|
||||
return this.value as Bytes;
|
||||
}
|
||||
@@ -67,6 +75,22 @@ export class Data extends Enum {
|
||||
return this.value as H256;
|
||||
}
|
||||
|
||||
get asShaThree256 (): H256 {
|
||||
return this.value as H256;
|
||||
}
|
||||
|
||||
get isBlakeTwo256 (): boolean {
|
||||
return this.index === 2;
|
||||
}
|
||||
|
||||
get isKeccak256 (): boolean {
|
||||
return this.index === 4;
|
||||
}
|
||||
|
||||
get isNone (): boolean {
|
||||
return this.index === 0;
|
||||
}
|
||||
|
||||
get isRaw (): boolean {
|
||||
return this.index === 1;
|
||||
}
|
||||
@@ -75,6 +99,10 @@ export class Data extends Enum {
|
||||
return this.index === 3;
|
||||
}
|
||||
|
||||
get isShaThree256 (): boolean {
|
||||
return this.index === 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description The encoded length
|
||||
*/
|
||||
|
||||
@@ -28,8 +28,8 @@ function decodeText (value?: null | Text | string | AnyU8a | { toString: () => s
|
||||
const [offset, length] = compactFromU8a(value);
|
||||
const total = offset + length.toNumber();
|
||||
|
||||
assert(length.lten(MAX_LENGTH), `Text length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(total <= value.length, `Text: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
assert(length.lten(MAX_LENGTH), () => `Text length ${length.toString()} exceeds ${MAX_LENGTH}`);
|
||||
assert(total <= value.length, () => `Text: required length less than remainder, expected at least ${total}, found ${value.length}`);
|
||||
|
||||
return u8aToString(value.subarray(offset, total));
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ __metadata:
|
||||
version: 4
|
||||
cacheKey: 7
|
||||
|
||||
"@babel/cli@npm:^7.13.14":
|
||||
version: 7.13.14
|
||||
resolution: "@babel/cli@npm:7.13.14"
|
||||
"@babel/cli@npm:^7.13.16":
|
||||
version: 7.13.16
|
||||
resolution: "@babel/cli@npm:7.13.16"
|
||||
dependencies:
|
||||
"@nicolo-ribaudo/chokidar-2": 2.1.8-no-fsevents
|
||||
chokidar: ^3.4.0
|
||||
@@ -15,7 +15,6 @@ __metadata:
|
||||
convert-source-map: ^1.1.0
|
||||
fs-readdir-recursive: ^1.1.0
|
||||
glob: ^7.0.0
|
||||
lodash: ^4.17.19
|
||||
make-dir: ^2.1.0
|
||||
slash: ^2.0.0
|
||||
source-map: ^0.5.0
|
||||
@@ -29,7 +28,7 @@ __metadata:
|
||||
bin:
|
||||
babel: ./bin/babel.js
|
||||
babel-external-helpers: ./bin/babel-external-helpers.js
|
||||
checksum: 6259a752460c92685ce6c4d4a63f2010081add799388bce003b8a2278e9ce94fd6b470ab511fbab509da2034631539d030932059ca343b1a09433ed88032e91f
|
||||
checksum: 97324cb2b8469b61452bc189a7de4b4d248a4b5fb9a697a3a2f9388f85f1291ac58fe8f5eeb9d419652d4e9e242d970db845578a31a1a118227625faf955ca7f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -51,44 +50,44 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/compat-data@npm:^7.13.11, @babel/compat-data@npm:^7.13.12, @babel/compat-data@npm:^7.13.15, @babel/compat-data@npm:^7.13.8":
|
||||
"@babel/compat-data@npm:^7.13.11, @babel/compat-data@npm:^7.13.15, @babel/compat-data@npm:^7.13.8":
|
||||
version: 7.13.15
|
||||
resolution: "@babel/compat-data@npm:7.13.15"
|
||||
checksum: 6abe95cbd36e54217cdcc51829e377cf31451ed0a64ff43cc82e0ce728d9e265990c5e079d5c3f9ee0afd49e20d6c90112fe2093ed0699c2ffc62f5172df24fa
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/core@npm:7.13.15, @babel/core@npm:^7.1.0, @babel/core@npm:^7.13.15, @babel/core@npm:^7.7.5":
|
||||
version: 7.13.15
|
||||
resolution: "@babel/core@npm:7.13.15"
|
||||
"@babel/core@npm:7.13.16, @babel/core@npm:^7.1.0, @babel/core@npm:^7.13.16, @babel/core@npm:^7.7.5":
|
||||
version: 7.13.16
|
||||
resolution: "@babel/core@npm:7.13.16"
|
||||
dependencies:
|
||||
"@babel/code-frame": ^7.12.13
|
||||
"@babel/generator": ^7.13.9
|
||||
"@babel/helper-compilation-targets": ^7.13.13
|
||||
"@babel/generator": ^7.13.16
|
||||
"@babel/helper-compilation-targets": ^7.13.16
|
||||
"@babel/helper-module-transforms": ^7.13.14
|
||||
"@babel/helpers": ^7.13.10
|
||||
"@babel/parser": ^7.13.15
|
||||
"@babel/helpers": ^7.13.16
|
||||
"@babel/parser": ^7.13.16
|
||||
"@babel/template": ^7.12.13
|
||||
"@babel/traverse": ^7.13.15
|
||||
"@babel/types": ^7.13.14
|
||||
"@babel/types": ^7.13.16
|
||||
convert-source-map: ^1.7.0
|
||||
debug: ^4.1.0
|
||||
gensync: ^1.0.0-beta.2
|
||||
json5: ^2.1.2
|
||||
semver: ^6.3.0
|
||||
source-map: ^0.5.0
|
||||
checksum: 818377633fa89d9b333c1a71625f9398e9e5a92270209cc8b5392e36385b5fe61210b2b31fb114ffe255974a3341cdfaa9e89a0fa81fabba9f6c14332fb72a02
|
||||
checksum: 1a53b70629fae3c5b714af1c582a92ffbb1a87d0f8fe705292faed6281476bf0a35ffa19d9d28ad791610d203fdbb8928e28aedb52a02023a561caaa44a9ee61
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/generator@npm:^7.13.9":
|
||||
version: 7.13.9
|
||||
resolution: "@babel/generator@npm:7.13.9"
|
||||
"@babel/generator@npm:^7.13.16":
|
||||
version: 7.13.16
|
||||
resolution: "@babel/generator@npm:7.13.16"
|
||||
dependencies:
|
||||
"@babel/types": ^7.13.0
|
||||
"@babel/types": ^7.13.16
|
||||
jsesc: ^2.5.1
|
||||
source-map: ^0.5.0
|
||||
checksum: d9cf7db910dd703a55c3ba147a8024564d51de06f5e3e61aef6ca197bcd80a6cb0a633fe4688c8c9f6226c70ee6f32a747050a8e420972b45cc98a6b3fc5ae66
|
||||
checksum: 299bf875ea550f52d157260804bf5b1acdc27269ae7287e53a1a5a602ff6052a466f4a4c03dc7377b3f2d5240eea5ee92162e2a943acb4d28e017ac89ab89e9d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -111,17 +110,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/helper-compilation-targets@npm:^7.13.0, @babel/helper-compilation-targets@npm:^7.13.13, @babel/helper-compilation-targets@npm:^7.13.8":
|
||||
version: 7.13.13
|
||||
resolution: "@babel/helper-compilation-targets@npm:7.13.13"
|
||||
"@babel/helper-compilation-targets@npm:^7.13.0, @babel/helper-compilation-targets@npm:^7.13.13, @babel/helper-compilation-targets@npm:^7.13.16, @babel/helper-compilation-targets@npm:^7.13.8":
|
||||
version: 7.13.16
|
||||
resolution: "@babel/helper-compilation-targets@npm:7.13.16"
|
||||
dependencies:
|
||||
"@babel/compat-data": ^7.13.12
|
||||
"@babel/compat-data": ^7.13.15
|
||||
"@babel/helper-validator-option": ^7.12.17
|
||||
browserslist: ^4.14.5
|
||||
semver: ^6.3.0
|
||||
peerDependencies:
|
||||
"@babel/core": ^7.0.0
|
||||
checksum: 2d77381d5fa0e488e86b2abbf5c299a6c1b0e490c95d3ca9a63fac8d45713a182a32fedabceb207588681ae09fc1c19c5418c26e686ae752d46102c9537f9ec7
|
||||
checksum: baa1e4cdd562996c6af0a8cedb097cd72f67c44577faf4b657015f477d4930ebcc40ca21dc1e5fcffe91a1517de6e4114bc21f805ca701dfac2ddd2e9b006228
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -335,14 +334,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/helpers@npm:^7.13.10":
|
||||
version: 7.13.10
|
||||
resolution: "@babel/helpers@npm:7.13.10"
|
||||
"@babel/helpers@npm:^7.13.16":
|
||||
version: 7.13.17
|
||||
resolution: "@babel/helpers@npm:7.13.17"
|
||||
dependencies:
|
||||
"@babel/template": ^7.12.13
|
||||
"@babel/traverse": ^7.13.0
|
||||
"@babel/types": ^7.13.0
|
||||
checksum: 1bc93126957b51108080ab1aa24997a9a10d5f395de54621ce9df7825cdbce878ad9d26886c927c3d9bcfd75d24972037ed5fb904fcd83fb92e5c8f8628f6b40
|
||||
"@babel/traverse": ^7.13.17
|
||||
"@babel/types": ^7.13.17
|
||||
checksum: 3e2b18d6bad7e7fa4e268a4e28f7ba5a15893efd39a57af9ae38613fe11bf4cff03cb2a56d4e6e18eeabe0934bfa689432ce3578bf59bb43bf926c956771b4b4
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -357,12 +356,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/parser@npm:^7.0.0, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.12.13, @babel/parser@npm:^7.13.15":
|
||||
version: 7.13.15
|
||||
resolution: "@babel/parser@npm:7.13.15"
|
||||
"@babel/parser@npm:^7.0.0, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.12.13, @babel/parser@npm:^7.13.16":
|
||||
version: 7.13.16
|
||||
resolution: "@babel/parser@npm:7.13.16"
|
||||
bin:
|
||||
parser: ./bin/babel-parser.js
|
||||
checksum: 74e9edc72f187c3956a52b3bb7dad22769fa9bf91c0107d6d5f1841ad5f655e6d12e0380a5b296f8c61c4471b200cdfea490969b75d5dff6b942157a26a1a9ac
|
||||
checksum: 4f02b226686ad98684128d64082388c8af3a2cd0bb986e8eb0339235d99f9a6bb55ba225da953291d975f341fe6d5d5dc006706d515f999be5ad49dd99f815e3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1293,27 +1292,27 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/register@npm:^7.13.14":
|
||||
version: 7.13.14
|
||||
resolution: "@babel/register@npm:7.13.14"
|
||||
"@babel/register@npm:^7.13.16":
|
||||
version: 7.13.16
|
||||
resolution: "@babel/register@npm:7.13.16"
|
||||
dependencies:
|
||||
clone-deep: ^4.0.1
|
||||
find-cache-dir: ^2.0.0
|
||||
lodash: ^4.17.19
|
||||
make-dir: ^2.1.0
|
||||
pirates: ^4.0.0
|
||||
source-map-support: ^0.5.16
|
||||
peerDependencies:
|
||||
"@babel/core": ^7.0.0-0
|
||||
checksum: 0dacbad9a231907c71ade15952bb9cfdc7bea35e22dac9190fa7bd3328ebae34f3fe16e957e4b8a6f10e50e1a614957195a4a9dbe4245018c8a986bc386fd2ec
|
||||
checksum: 9a859b9fb5301525450638d57a7db72f0364a14b3e433f62062140b45ce13e5c92d9618f1f0413c6b41336937062e3cbd7fad88f2938b030e1b4331c11a74f23
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.13.9, @babel/runtime@npm:^7.8.4":
|
||||
version: 7.13.10
|
||||
resolution: "@babel/runtime@npm:7.13.10"
|
||||
"@babel/runtime@npm:^7.13.17, @babel/runtime@npm:^7.13.9, @babel/runtime@npm:^7.8.4":
|
||||
version: 7.13.17
|
||||
resolution: "@babel/runtime@npm:7.13.17"
|
||||
dependencies:
|
||||
regenerator-runtime: ^0.13.4
|
||||
checksum: 22014226b96a8c8e8d4e8bcdb011f317d1b32881aef424a669dc6ceaee14993d3609172967853cbf9c25c724c25145d45885b6c9df56ba241c12820776607f1f
|
||||
checksum: c32e5e2833348b586bc919c0fbc8efbd2fdd79451cce56ed5962ace6ff74ea44fbb8723dcd3f08e52ce07e88e37f4c02cd5021855417d365558e41de38d277a8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1328,30 +1327,29 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.13.13, @babel/traverse@npm:^7.13.15":
|
||||
version: 7.13.15
|
||||
resolution: "@babel/traverse@npm:7.13.15"
|
||||
"@babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.13.13, @babel/traverse@npm:^7.13.15, @babel/traverse@npm:^7.13.17":
|
||||
version: 7.13.17
|
||||
resolution: "@babel/traverse@npm:7.13.17"
|
||||
dependencies:
|
||||
"@babel/code-frame": ^7.12.13
|
||||
"@babel/generator": ^7.13.9
|
||||
"@babel/generator": ^7.13.16
|
||||
"@babel/helper-function-name": ^7.12.13
|
||||
"@babel/helper-split-export-declaration": ^7.12.13
|
||||
"@babel/parser": ^7.13.15
|
||||
"@babel/types": ^7.13.14
|
||||
"@babel/parser": ^7.13.16
|
||||
"@babel/types": ^7.13.17
|
||||
debug: ^4.1.0
|
||||
globals: ^11.1.0
|
||||
checksum: 4ee49a25e7875e0a05e09ca685ac4f92316aeacfa81526aa947cdfdddb49e595ddb0459b3566dac100e85069ec08bcdce66f4897cc22fee341fb83cf10dbfd14
|
||||
checksum: e50e3a97a5704ed76558c00a632fbbee888a864054772361323075f436b3e767b7441c53fec34333a0c5ed2a88b856c76de8770932a050bb6a1553ece998b0c1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.1, @babel/types@npm:^7.12.13, @babel/types@npm:^7.13.0, @babel/types@npm:^7.13.12, @babel/types@npm:^7.13.14, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3":
|
||||
version: 7.13.14
|
||||
resolution: "@babel/types@npm:7.13.14"
|
||||
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.1, @babel/types@npm:^7.12.13, @babel/types@npm:^7.13.0, @babel/types@npm:^7.13.12, @babel/types@npm:^7.13.14, @babel/types@npm:^7.13.16, @babel/types@npm:^7.13.17, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3":
|
||||
version: 7.13.17
|
||||
resolution: "@babel/types@npm:7.13.17"
|
||||
dependencies:
|
||||
"@babel/helper-validator-identifier": ^7.12.11
|
||||
lodash: ^4.17.19
|
||||
to-fast-properties: ^2.0.0
|
||||
checksum: 0dda1e774076c763ad38d77a2292524556be0629f5b7a2078bddb40ae4a2fd059d10197029a988926dc314f7519e17daa8a714656e0faa207f2bb5339b57410c
|
||||
checksum: d75193ea37008a039b2383f8ba3cbe492a092550c6656721f6aa76bd8565a9286b56165a0c82ea5a8423d6f65bd803eb2c73561a5fc7a098b97d19f692bc79a6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1789,58 +1787,58 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/api": 4.6.2
|
||||
"@polkadot/types": 4.6.2
|
||||
"@polkadot/util": ^6.2.1
|
||||
"@polkadot/x-rxjs": ^6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/api": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
bn.js: ^4.11.9
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/api-derive@4.6.2, @polkadot/api-derive@workspace:packages/api-derive":
|
||||
"@polkadot/api-derive@4.7.1, @polkadot/api-derive@workspace:packages/api-derive":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/api": 4.6.2
|
||||
"@polkadot/keyring": ^6.2.1
|
||||
"@polkadot/rpc-core": 4.6.2
|
||||
"@polkadot/rpc-provider": 4.6.2
|
||||
"@polkadot/types": 4.6.2
|
||||
"@polkadot/util": ^6.2.1
|
||||
"@polkadot/util-crypto": ^6.2.1
|
||||
"@polkadot/x-rxjs": ^6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/api": 4.7.1
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/rpc-core": 4.7.1
|
||||
"@polkadot/rpc-provider": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
bn.js: ^4.11.9
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/api@4.6.2, @polkadot/api@workspace:packages/api":
|
||||
"@polkadot/api@4.7.1, @polkadot/api@workspace:packages/api":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/api@workspace:packages/api"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/api-derive": 4.6.2
|
||||
"@polkadot/keyring": ^6.2.1
|
||||
"@polkadot/metadata": 4.6.2
|
||||
"@polkadot/rpc-core": 4.6.2
|
||||
"@polkadot/rpc-provider": 4.6.2
|
||||
"@polkadot/types": 4.6.2
|
||||
"@polkadot/types-known": 4.6.2
|
||||
"@polkadot/util": ^6.2.1
|
||||
"@polkadot/util-crypto": ^6.2.1
|
||||
"@polkadot/x-rxjs": ^6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/api-derive": 4.7.1
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/rpc-core": 4.7.1
|
||||
"@polkadot/rpc-provider": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/types-known": 4.7.1
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
bn.js: ^4.11.9
|
||||
eventemitter3: ^4.0.7
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/dev@npm:^0.62.8":
|
||||
version: 0.62.8
|
||||
resolution: "@polkadot/dev@npm:0.62.8"
|
||||
"@polkadot/dev@npm:^0.62.10":
|
||||
version: 0.62.10
|
||||
resolution: "@polkadot/dev@npm:0.62.10"
|
||||
dependencies:
|
||||
"@babel/cli": ^7.13.14
|
||||
"@babel/core": ^7.13.15
|
||||
"@babel/cli": ^7.13.16
|
||||
"@babel/core": ^7.13.16
|
||||
"@babel/plugin-proposal-class-properties": ^7.13.0
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": ^7.13.8
|
||||
"@babel/plugin-proposal-numeric-separator": ^7.12.13
|
||||
@@ -1856,8 +1854,8 @@ __metadata:
|
||||
"@babel/preset-env": ^7.13.15
|
||||
"@babel/preset-react": ^7.13.13
|
||||
"@babel/preset-typescript": ^7.13.0
|
||||
"@babel/register": ^7.13.14
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@babel/register": ^7.13.16
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@rushstack/eslint-patch": ^1.0.6
|
||||
"@typescript-eslint/eslint-plugin": 4.22.0
|
||||
"@typescript-eslint/parser": 4.22.0
|
||||
@@ -1866,10 +1864,10 @@ __metadata:
|
||||
babel-plugin-module-extension-resolver: ^1.0.0-rc.2
|
||||
babel-plugin-module-resolver: ^4.1.0
|
||||
babel-plugin-styled-components: ^1.12.0
|
||||
browserslist: ^4.16.4
|
||||
chalk: ^4.1.0
|
||||
browserslist: ^4.16.5
|
||||
chalk: ^4.1.1
|
||||
coveralls: ^3.1.0
|
||||
eslint: ^7.24.0
|
||||
eslint: ^7.25.0
|
||||
eslint-config-standard: ^16.0.2
|
||||
eslint-import-resolver-node: ^0.3.4
|
||||
eslint-plugin-header: ^3.1.1
|
||||
@@ -1917,74 +1915,74 @@ __metadata:
|
||||
polkadot-exec-prettier: scripts/polkadot-exec-prettier.cjs
|
||||
polkadot-exec-tsc: scripts/polkadot-exec-tsc.cjs
|
||||
polkadot-exec-webpack: scripts/polkadot-exec-webpack.cjs
|
||||
checksum: d4aa8b1da1e7da2ac3ebe7141b10d5da3544e114b2447322676496cd62a360c7b60c7388dba44177e143e7f3bfc7c2d128b370314f0909cf6443394bc7d42dea
|
||||
checksum: e197e64ed55ffd9809835afbaa0f4d3495adf16d246885a5ea98459f658a587f74481049f472b752f0b0666a41c236159fcd9f8cf623b66363fff1cca2526f4f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/keyring@npm:^6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/keyring@npm:6.2.1"
|
||||
"@polkadot/keyring@npm:^6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/keyring@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/util": 6.2.1
|
||||
"@polkadot/util-crypto": 6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/util": 6.3.1
|
||||
"@polkadot/util-crypto": 6.3.1
|
||||
peerDependencies:
|
||||
"@polkadot/util": 6.2.1
|
||||
"@polkadot/util-crypto": 6.2.1
|
||||
checksum: 638019fb75d3571902a670ed30c1ff47bd1fb5eec5320a78f7900efac1d7f629e6fe92cd66be60658a2afd07dc21e0387fc3b30314b21dde425481e0a3781717
|
||||
"@polkadot/util": 6.3.1
|
||||
"@polkadot/util-crypto": 6.3.1
|
||||
checksum: aab63b74f1eebc49ac3c6ddd6b385695ec6d07e15f03ece02f3f516298b07b51ecf47cb8a8f5c38804cc2ae347886716a46f3f0d6ad83281fd11f7494875e1e8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/metadata@4.6.2, @polkadot/metadata@workspace:packages/metadata":
|
||||
"@polkadot/metadata@4.7.1, @polkadot/metadata@workspace:packages/metadata":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/metadata@workspace:packages/metadata"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/keyring": ^6.2.1
|
||||
"@polkadot/types": 4.6.2
|
||||
"@polkadot/types-known": 4.6.2
|
||||
"@polkadot/util": ^6.2.1
|
||||
"@polkadot/util-crypto": ^6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/types-known": 4.7.1
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
bn.js: ^4.11.9
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/networks@npm:6.2.1, @polkadot/networks@npm:^6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/networks@npm:6.2.1"
|
||||
"@polkadot/networks@npm:6.3.1, @polkadot/networks@npm:^6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/networks@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
checksum: 680f9d18e92e7c6fee0480fa7fbc10f3232a488c47535053227ed20efbe575bc39ef3f122665561328aed3d66993fadb68629fc4e9880fdcb62e841354365d82
|
||||
"@babel/runtime": ^7.13.17
|
||||
checksum: 24fea684b71efdf77ac7fbe0da0871c4ea617e9c66c5d3fce5ba627005bafc3874d62559689d72f427795a077319aa96c95114f351037f404f3defa0008b8097
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/rpc-core@4.6.2, @polkadot/rpc-core@workspace:packages/rpc-core":
|
||||
"@polkadot/rpc-core@4.7.1, @polkadot/rpc-core@workspace:packages/rpc-core":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/keyring": ^6.2.1
|
||||
"@polkadot/metadata": 4.6.2
|
||||
"@polkadot/rpc-provider": 4.6.2
|
||||
"@polkadot/types": 4.6.2
|
||||
"@polkadot/util": ^6.2.1
|
||||
"@polkadot/x-rxjs": ^6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/rpc-provider": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/rpc-provider@4.6.2, @polkadot/rpc-provider@workspace:packages/rpc-provider":
|
||||
"@polkadot/rpc-provider@4.7.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/keyring": ^6.2.1
|
||||
"@polkadot/metadata": 4.6.2
|
||||
"@polkadot/types": 4.6.2
|
||||
"@polkadot/util": ^6.2.1
|
||||
"@polkadot/util-crypto": ^6.2.1
|
||||
"@polkadot/x-fetch": ^6.2.1
|
||||
"@polkadot/x-global": ^6.2.1
|
||||
"@polkadot/x-ws": ^6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
"@polkadot/x-fetch": ^6.3.1
|
||||
"@polkadot/x-global": ^6.3.1
|
||||
"@polkadot/x-ws": ^6.3.1
|
||||
bn.js: ^4.11.9
|
||||
eventemitter3: ^4.0.7
|
||||
mock-socket: ^9.0.3
|
||||
@@ -1992,12 +1990,12 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/ts@npm:^0.3.62":
|
||||
version: 0.3.62
|
||||
resolution: "@polkadot/ts@npm:0.3.62"
|
||||
"@polkadot/ts@npm:^0.3.63":
|
||||
version: 0.3.63
|
||||
resolution: "@polkadot/ts@npm:0.3.63"
|
||||
dependencies:
|
||||
"@types/chrome": ^0.0.133
|
||||
checksum: 0ee98e5cfbdd78574a07d1232bc8ac51d3cfee439c200b944e5e3909241067361b4dfa59be7af03fecd27db473d33c9a458b9b91a155d44ecab7e2eb40a47cad
|
||||
"@types/chrome": ^0.0.135
|
||||
checksum: b5614968b9a3b558347ff9f4b7c52767fc08b3f8ecf8c82f808d37ffcaf2be4f8a1791bb327d3dcdfe064be4ee1811b648e984bc3a329188ae4a9a24b7391884
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2005,14 +2003,14 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/typegen@workspace:packages/typegen"
|
||||
dependencies:
|
||||
"@babel/core": ^7.13.15
|
||||
"@babel/register": ^7.13.14
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/api": 4.6.2
|
||||
"@polkadot/metadata": 4.6.2
|
||||
"@polkadot/rpc-provider": 4.6.2
|
||||
"@polkadot/types": 4.6.2
|
||||
"@polkadot/util": ^6.2.1
|
||||
"@babel/core": ^7.13.16
|
||||
"@babel/register": ^7.13.16
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/api": 4.7.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/rpc-provider": 4.7.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@types/websocket": ^1.0.2
|
||||
"@types/yargs": ^16.0.1
|
||||
handlebars: ^4.7.7
|
||||
@@ -2027,43 +2025,43 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/types-known@4.6.2, @polkadot/types-known@workspace:packages/types-known":
|
||||
"@polkadot/types-known@4.7.1, @polkadot/types-known@workspace:packages/types-known":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/types-known@workspace:packages/types-known"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/networks": ^6.2.1
|
||||
"@polkadot/types": 4.6.2
|
||||
"@polkadot/util": ^6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/networks": ^6.3.1
|
||||
"@polkadot/types": 4.7.1
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^4.11.9
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/types@4.6.2, @polkadot/types@workspace:packages/types":
|
||||
"@polkadot/types@4.7.1, @polkadot/types@workspace:packages/types":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/types@workspace:packages/types"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/keyring": ^6.2.1
|
||||
"@polkadot/metadata": 4.6.2
|
||||
"@polkadot/util": ^6.2.1
|
||||
"@polkadot/util-crypto": ^6.2.1
|
||||
"@polkadot/x-rxjs": ^6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/keyring": ^6.3.1
|
||||
"@polkadot/metadata": 4.7.1
|
||||
"@polkadot/util": ^6.3.1
|
||||
"@polkadot/util-crypto": ^6.3.1
|
||||
"@polkadot/x-rxjs": ^6.3.1
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^4.11.9
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/util-crypto@npm:6.2.1, @polkadot/util-crypto@npm:^6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/util-crypto@npm:6.2.1"
|
||||
"@polkadot/util-crypto@npm:6.3.1, @polkadot/util-crypto@npm:^6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/util-crypto@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/networks": 6.2.1
|
||||
"@polkadot/util": 6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/networks": 6.3.1
|
||||
"@polkadot/util": 6.3.1
|
||||
"@polkadot/wasm-crypto": ^4.0.2
|
||||
"@polkadot/x-randomvalues": 6.2.1
|
||||
"@polkadot/x-randomvalues": 6.3.1
|
||||
base-x: ^3.0.8
|
||||
base64-js: ^1.5.1
|
||||
blakejs: ^1.1.0
|
||||
@@ -2076,23 +2074,23 @@ __metadata:
|
||||
tweetnacl: ^1.0.3
|
||||
xxhashjs: ^0.2.2
|
||||
peerDependencies:
|
||||
"@polkadot/util": 6.2.1
|
||||
checksum: 6b7a3e5c19081ca7255e85b66f0576a7945ec07fec9f96f0ff8738d030f48a6fece9782d915f77346d06cf040d0d1b60a94531cfb5927da2b641ca403b6652ec
|
||||
"@polkadot/util": 6.3.1
|
||||
checksum: 69004aaf5a5dd44b909292e671bd357336bfec5ce0d0a5feea09c3c310242a41dd2f69488520510aeba948b80faef0352645a2ca0cdf2c0f5a384bf0dc49a403
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/util@npm:6.2.1, @polkadot/util@npm:^6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/util@npm:6.2.1"
|
||||
"@polkadot/util@npm:6.3.1, @polkadot/util@npm:^6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/util@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/x-textdecoder": 6.2.1
|
||||
"@polkadot/x-textencoder": 6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/x-textdecoder": 6.3.1
|
||||
"@polkadot/x-textencoder": 6.3.1
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^4.11.9
|
||||
camelcase: ^5.3.1
|
||||
ip-regex: ^4.3.0
|
||||
checksum: b4aeafe4eed161ac72a0f42deefe4fb91fcdd4f5aa497dc23f9480de976269e93708aeb18aa37e91b538a88ff60bac55a263b5d4808af4eb77a6bd7ad601c63a
|
||||
checksum: a4d6e19d9933e70bab809f23dbb0b99d4152333e8c1128b94117cec6e6ea28021379d28ad49c95ab2065743ab4b7555d34e4ab1ae3cb80105b74d490bdb4142a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2128,78 +2126,78 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-fetch@npm:^6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/x-fetch@npm:6.2.1"
|
||||
"@polkadot/x-fetch@npm:^6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/x-fetch@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/x-global": 6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/x-global": 6.3.1
|
||||
"@types/node-fetch": ^2.5.10
|
||||
node-fetch: ^2.6.1
|
||||
checksum: 0ead9e1096a8904292914313adf14a1ad8113f48fc0df0c090cb43e984967d80ce35b09b8b760d37ac5aa57e41a926b48bcafc8360a4439ba46032df70a08453
|
||||
checksum: 74e0957bf96b91aa7db7759a2466f57ee8b31b94993be92efafab3ea2047461331391ba14dd2df12ec62c70449b4ad25cef46073f31bf8963862a15e9d6dcd9f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-global@npm:6.2.1, @polkadot/x-global@npm:^6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/x-global@npm:6.2.1"
|
||||
"@polkadot/x-global@npm:6.3.1, @polkadot/x-global@npm:^6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/x-global@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@types/node-fetch": ^2.5.10
|
||||
node-fetch: ^2.6.1
|
||||
checksum: ece93e020f9e8fb81c6315b078d7ca4e3a923a93dc90857757b2f14eed3b53243dd09c5cb56a43ca3c64cea6e71b8704788fea1f923f74a420e40fa9d520c9d5
|
||||
checksum: fa8ffbdc402da35ef5d19716030c8294680abf798d139d17d819f227f7bdcc2b4fb838986c8ce78c2873c12581e5c0af04070b39c3e4f9bc3f0a53e3bcf2f262
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-randomvalues@npm:6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/x-randomvalues@npm:6.2.1"
|
||||
"@polkadot/x-randomvalues@npm:6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/x-randomvalues@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/x-global": 6.2.1
|
||||
checksum: 65edcf6401eed14631bf605c035950837f6451d01f52bd65d299436900dae7271761d1018c05cd35fce4c0a7e52c9f134e0d13073e8afbe7eefa600dae035bf5
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/x-global": 6.3.1
|
||||
checksum: 3f970f8623a917c36283a6301ca9158a47a51ca2d968a7c5a27d66fcb8376d0e86f68284090f37290a8855610f9a29d67a7cdb215cb0a6e8c8b2864612bef466
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-rxjs@npm:^6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/x-rxjs@npm:6.2.1"
|
||||
"@polkadot/x-rxjs@npm:^6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/x-rxjs@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@babel/runtime": ^7.13.17
|
||||
rxjs: ^6.6.7
|
||||
checksum: 815672accbea5fe295f4de0bad50db5e223785ba1655bbbdf2af7b379eadb0479b4a7b1bef12757e8f58911144268f9dc47dc9c104cfd141e53f5d048ae96a66
|
||||
checksum: 6c3e3a0785e583df6e1adfcc667f680ddb55d961883c14f62e49d6970b99a5aa577f6b63f436ae196ed7368ee21314be5c68dc230eeb7d8966dc38afe67561ff
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-textdecoder@npm:6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/x-textdecoder@npm:6.2.1"
|
||||
"@polkadot/x-textdecoder@npm:6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/x-textdecoder@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/x-global": 6.2.1
|
||||
checksum: ff17e0db6d83509ede097dfcb17a662c198957edc4fb618dc024f4a46473392fbac187fa814a7819b61caa413d3a48a1d24aa794881c302d0a70cf77397b5ba8
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/x-global": 6.3.1
|
||||
checksum: b917de465bc96c8adae88d36cf9de3bd459bc5987b755246a8e477082edbc74efa468983cff133da3dd6b38d0684c7183ee46aab2d5efd9b2912954266be50c2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-textencoder@npm:6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/x-textencoder@npm:6.2.1"
|
||||
"@polkadot/x-textencoder@npm:6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/x-textencoder@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/x-global": 6.2.1
|
||||
checksum: 388e9c5d106199a889f2e87ebd9b447b147c699dfd98c0aad60761a697c16f0d840f7b458e5aaffaa23c73687844c6b19714eb35c0af1d20ab4d6ef21045bd2f
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/x-global": 6.3.1
|
||||
checksum: 80457f236f08cea895919d6cb29535eeece8ff2324956890b4f07dd59745ad2ef8344892ab0b2a9576ce624e576a706ec91a2cc9464c99fecb164c6bc891c8ac
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-ws@npm:^6.2.1":
|
||||
version: 6.2.1
|
||||
resolution: "@polkadot/x-ws@npm:6.2.1"
|
||||
"@polkadot/x-ws@npm:^6.3.1":
|
||||
version: 6.3.1
|
||||
resolution: "@polkadot/x-ws@npm:6.3.1"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/x-global": 6.2.1
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/x-global": 6.3.1
|
||||
"@types/websocket": ^1.0.2
|
||||
websocket: ^1.0.34
|
||||
checksum: 4ccb3cbbcaf05dcb39d587091f1c7e9b425841c2ed4d75a84a0f99c0d263b7e4534f8f4224667a151ccf799eeddeb806affe6a8939dc4e51d805ce358ef22f4a
|
||||
checksum: e8a2332ae30698eea4428020203291414ef3fc7be3b676df41fff1c5c4312c6008a2f9240baa92f6f8c542714ee7e39b923d5dd8ec9f0a6811f610a5cb87a45f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2294,13 +2292,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/chrome@npm:^0.0.133":
|
||||
version: 0.0.133
|
||||
resolution: "@types/chrome@npm:0.0.133"
|
||||
"@types/chrome@npm:^0.0.135":
|
||||
version: 0.0.135
|
||||
resolution: "@types/chrome@npm:0.0.135"
|
||||
dependencies:
|
||||
"@types/filesystem": "*"
|
||||
"@types/har-format": "*"
|
||||
checksum: f4ea13de2c09514b67af8454dc5cec897e4c8ffaecf894ba4e871f5e3fb6c1c40faffd8ebb059d08e57961f1b218cb4a6dbc1fe44989378a4c6600dde59e8e9b
|
||||
checksum: 0619796ce1a174d807d82c412f4c988447d3b3f4195a993dd88166864ed568623e8bad9f7aaae96c99b2cefcf9532ead978ae36ade21dc6dfd8435a34db277ec
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -3324,18 +3322,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"browserslist@npm:^4.14.5, browserslist@npm:^4.16.3, browserslist@npm:^4.16.4":
|
||||
version: 4.16.4
|
||||
resolution: "browserslist@npm:4.16.4"
|
||||
"browserslist@npm:^4.14.5, browserslist@npm:^4.16.3, browserslist@npm:^4.16.5":
|
||||
version: 4.16.5
|
||||
resolution: "browserslist@npm:4.16.5"
|
||||
dependencies:
|
||||
caniuse-lite: ^1.0.30001208
|
||||
caniuse-lite: ^1.0.30001214
|
||||
colorette: ^1.2.2
|
||||
electron-to-chromium: ^1.3.712
|
||||
electron-to-chromium: ^1.3.719
|
||||
escalade: ^3.1.1
|
||||
node-releases: ^1.1.71
|
||||
bin:
|
||||
browserslist: cli.js
|
||||
checksum: 00071f51695eae0d33c6193f37af87c690e5049dc615aeebae32bd0a60ad64698f29b8a579667012a177bff532f6235f22d1a96bfb30bf6364631914e2d64294
|
||||
checksum: ea06cb8262a69d1479ab2c288eb939250ea0a6b172a181ce7ce9410f1ee29701095c8c13bd575b70baead87743866471814f8c0247c9785b229b04bef399e4c8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -3438,10 +3436,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"caniuse-lite@npm:^1.0.30001208":
|
||||
version: 1.0.30001208
|
||||
resolution: "caniuse-lite@npm:1.0.30001208"
|
||||
checksum: c8c9ffbd57fe0f39e1cde2211b685f4a16babe73ab2bb50b22b9f267e29ca4843b5df83d518fae2c2e79347eab6d7da86027d649cb984e6f151a5650f592c03b
|
||||
"caniuse-lite@npm:^1.0.30001214":
|
||||
version: 1.0.30001214
|
||||
resolution: "caniuse-lite@npm:1.0.30001214"
|
||||
checksum: 96c09af8989fe03e6aa0cc0130be3392c4a871093f0ae7190cb1185862a63b54de14483561578564d034cf993c315d4939727badee39ed76144e94ae4ab2a0f7
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -3482,13 +3480,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"chalk@npm:^4.0.0, chalk@npm:^4.1.0":
|
||||
version: 4.1.0
|
||||
resolution: "chalk@npm:4.1.0"
|
||||
"chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.1":
|
||||
version: 4.1.1
|
||||
resolution: "chalk@npm:4.1.1"
|
||||
dependencies:
|
||||
ansi-styles: ^4.1.0
|
||||
supports-color: ^7.1.0
|
||||
checksum: f860285b419f9e925c2db0f45ffa88aa8794c14b80cc5d01ff30930bcfc384996606362706f0829cf557f6d36152a5fb2d227ad63c4bc90e2ec9e9dbed4a3c07
|
||||
checksum: 445c12db7aeed0046500a1e4184d31209a77d165654c885a789c41c8598a6a95bd2392180987cac572c967b93a2a730dda778bb7f87fa06ca63fd8592f8cc59f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -3632,6 +3630,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"clone-deep@npm:^4.0.1":
|
||||
version: 4.0.1
|
||||
resolution: "clone-deep@npm:4.0.1"
|
||||
dependencies:
|
||||
is-plain-object: ^2.0.4
|
||||
kind-of: ^6.0.2
|
||||
shallow-clone: ^3.0.0
|
||||
checksum: b0146d66cabc7e609d23d10155dcc88e2f74b03539b3b65f8a05f889500e2a78b6c6265a744445d009d512a1afa16836f62aa5737d462027142984c2d41130c8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"clone-response@npm:^1.0.2":
|
||||
version: 1.0.2
|
||||
resolution: "clone-response@npm:1.0.2"
|
||||
@@ -4378,10 +4387,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"electron-to-chromium@npm:^1.3.712":
|
||||
version: 1.3.715
|
||||
resolution: "electron-to-chromium@npm:1.3.715"
|
||||
checksum: b47fae50b323c0a75fbf511499c9a2bf59ceb380c791505ceb28725db523b25813e37e4d31f9a6c69e228a5bed96b7ff69c4bd3c2483293f97dc26afc0a6083e
|
||||
"electron-to-chromium@npm:^1.3.719":
|
||||
version: 1.3.720
|
||||
resolution: "electron-to-chromium@npm:1.3.720"
|
||||
checksum: 51bb3720af1ffe2ac04e0760f4cdcf319c2e371625e7ed9e433ee962c1c7ae09e65b44afbe7ddf5c71dc9a01583c8e0015ff04b86f0222ed7cc5b5871494078d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -4771,9 +4780,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eslint@npm:^7.24.0":
|
||||
version: 7.24.0
|
||||
resolution: "eslint@npm:7.24.0"
|
||||
"eslint@npm:^7.25.0":
|
||||
version: 7.25.0
|
||||
resolution: "eslint@npm:7.25.0"
|
||||
dependencies:
|
||||
"@babel/code-frame": 7.12.11
|
||||
"@eslint/eslintrc": ^0.4.0
|
||||
@@ -4814,7 +4823,7 @@ __metadata:
|
||||
v8-compile-cache: ^2.0.3
|
||||
bin:
|
||||
eslint: bin/eslint.js
|
||||
checksum: 8130aacc3698a730ba8fa10ac9e1436151181c34cad265c21c97708e62dba714b6f3cc4cb7a1d343918da3d35a5913505ccf53cfbdc1fa8d62d326b7e35b7aae
|
||||
checksum: 6e1782e2264ebf987504746ee82e996bf0ef2c29a2eaea869b54cb8aa1eaf10945b1d563618515e65ac934ca626f3609282127773f45868ad4a98744458a3c62
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -9430,11 +9439,11 @@ resolve@^2.0.0-next.3:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "root-workspace-0b6124@workspace:."
|
||||
dependencies:
|
||||
"@babel/core": ^7.13.15
|
||||
"@babel/register": ^7.13.14
|
||||
"@babel/runtime": ^7.13.10
|
||||
"@polkadot/dev": ^0.62.8
|
||||
"@polkadot/ts": ^0.3.62
|
||||
"@babel/core": ^7.13.16
|
||||
"@babel/register": ^7.13.16
|
||||
"@babel/runtime": ^7.13.17
|
||||
"@polkadot/dev": ^0.62.10
|
||||
"@polkadot/ts": ^0.3.63
|
||||
"@polkadot/typegen": "workspace:packages/typegen"
|
||||
"@types/jest": ^26.0.22
|
||||
copyfiles: ^2.4.1
|
||||
@@ -9625,6 +9634,15 @@ resolve@^2.0.0-next.3:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"shallow-clone@npm:^3.0.0":
|
||||
version: 3.0.1
|
||||
resolution: "shallow-clone@npm:3.0.1"
|
||||
dependencies:
|
||||
kind-of: ^6.0.2
|
||||
checksum: e329e054c286f0681fd8a9e5c353999519332f12510a99e189ea9cfa0337adb6f1414639d44493418ef6790a693b78c354525269f5db25a9feddd8b4d7891a62
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"shebang-command@npm:^1.2.0":
|
||||
version: 1.2.0
|
||||
resolution: "shebang-command@npm:1.2.0"
|
||||
|
||||
Reference in New Issue
Block a user