Compare commits

..
56 Commits
Author SHA1 Message Date
Github Actions 83650b8f28 [CI Skip] release/stable 4.10.1
skip-checks: true
2021-05-17 05:00:09 +00:00
Jaco 50a3501dd2 4.10 (#3539) 2021-05-17 06:49:57 +02:00
Github Actions 526a3fd139 [CI Skip] release/beta 4.9.3-24
skip-checks: true
2021-05-16 18:33:15 +00:00
Jaco 3b996b3444 CompactSolution for 24 nominees (#3537)
* CompactSolution for 24 nominees

* Westend & Rococo

* CompactAssignments: 'CompactAssignmentsTo265'

* With{16, 24}

* CompactAssignmentsWith16 in test

* With16 in historic types

* RawSolution alias

* Types

* Bump common
2021-05-16 20:22:54 +02:00
Github Actions c72c9e4a5e [CI Skip] release/beta 4.9.3-23
skip-checks: true
2021-05-15 05:50:42 +00:00
Jaco 60a71a5ac9 Bump static Substrate metadata (#3532) 2021-05-15 07:39:22 +02:00
Jaco 26c3ccccc3 Additional phragmenElection check (#3531) 2021-05-15 07:32:32 +02:00
Github Actions 963e25934d [CI Skip] release/beta 4.9.3-22
skip-checks: true
2021-05-15 04:54:15 +00:00
Jaco 55d9f8a062 Fix 9010 upgrade blocks (#3530)
* Fix 9010 upgrade blocks

* CHANGELOG
2021-05-15 06:43:51 +02:00
Github Actions 700c8ba21f [CI Skip] release/beta 4.9.3-21
skip-checks: true
2021-05-14 16:16:15 +00:00
Jaco cbc255b4e7 Cater for new phragmenElection module (#3528) 2021-05-14 19:07:47 +03:00
Jaco 2fe1e5031e Add Westend & Kusama blocks for 9100 (#3527) 2021-05-14 18:01:07 +02:00
Github Actions f2cdac7875 [CI Skip] release/beta 4.9.3-20
skip-checks: true
2021-05-13 19:29:42 +00:00
Jaco 165405bdc3 Contracts read for variable-length bytes (#3526) 2021-05-13 21:19:11 +02:00
Github Actions f86d71524d [CI Skip] release/beta 4.9.3-19
skip-checks: true
2021-05-13 15:34:14 +00:00
Jaco 4d6d59f1c5 Adjust Compact toBigInt() (#3525) 2021-05-13 17:23:46 +02:00
Github Actions 7a709898e5 [CI Skip] release/beta 4.9.3-18
skip-checks: true
2021-05-13 07:17:24 +00:00
Jaco 121bfc7913 VecFixed with hex inputs (& adjust isPedantic) (#3522)
* VecFixed with hex inputs (& adjust isPedantic)

* Update packages/types/src/codec/VecFixed.spec.ts

* Cleanups
2021-05-13 09:08:52 +02:00
Github Actions a04ccec445 [CI Skip] release/beta 4.9.3-17
skip-checks: true
2021-05-13 05:21:42 +00:00
Jaco 2611fc5e1a Handle Text is same way as Bytes (isPedantic mode) (#3521)
* Handle Text is same was as Bytes (isPedantic mode)

* Length on input

* tests

* raw decoding test
2021-05-13 07:10:44 +02:00
Github Actions cd5c306b22 [CI Skip] release/beta 4.9.3-16
skip-checks: true
2021-05-12 16:55:21 +00:00
Branan Riley ca6a7819f6 Update centrifuge-chain types for updated substrate used in parachain (#3520) 2021-05-12 18:44:35 +02:00
Github Actions 29c0ea9856 [CI Skip] release/beta 4.9.3-15
skip-checks: true
2021-05-12 13:21:30 +00:00
Jaco c82ed58d68 Bump common (#3519) 2021-05-12 15:11:14 +02:00
Github Actions 59a3867c50 [CI Skip] release/beta 4.9.3-14
skip-checks: true
2021-05-11 10:35:32 +00:00
Jaco 0fca4e6866 Raw getHeader value for metadata determination (#3490)
* Raw getHeader value for metadata determination

* Don't cache raw/json RPC calls

* getRuntimeVersion via .json RPC

* Minimal RuntimeVersion type

* getMetadata with isHistoric

* User .raw for Metadata

* Adjust types

* Updates

* Remove (now-unused) isCached

* Update packages/api/src/base/Init.ts

* Update packages/api/src/base/Init.ts

* Apply suggestions from code review

* Only decorate registry on scale

* tidy typings

* typing

* Linting updates

* CHANGELOG

* V2 contracts
2021-05-11 12:25:27 +02:00
Github Actions 3f9e65a179 [CI Skip] release/beta 4.9.3-13
skip-checks: true
2021-05-11 09:08:46 +00:00
Jaco 92bde9de6f Adjust ABI registry (#3516)
* Adjust ABI registry

* Remove V2 support

* instantiateWithCode mock
2021-05-11 10:58:20 +02:00
Github Actions 9b3158599c [CI Skip] release/beta 4.9.3-12
skip-checks: true
2021-05-11 08:12:16 +00:00
Jaco 206fb49df5 Cater for Abi type offsets in 1+ (#3514)
* Cater for Abi type offsets in 1+

* Update packages/api-contract/src/MetaRegistry.ts
2021-05-11 10:01:27 +02:00
Github Actions cc0ad9b04b [CI Skip] release/beta 4.9.3-11
skip-checks: true
2021-05-10 08:32:30 +00:00
Jaco 39902dd8ac Adjust DispatchError (#3513)
* Adjust DisptachError

* Merge master, rebuild generation
2021-05-10 11:23:15 +03:00
Github Actions 324e4ab89b [CI Skip] release/beta 4.9.3-10
skip-checks: true
2021-05-10 05:06:07 +00:00
KarishmaBothara 68bf0a487f Backward compatibility thing (#3511) 2021-05-10 06:56:04 +02:00
Github Actions 3acf7e0fd7 [CI Skip] release/beta 4.9.3-9
skip-checks: true
2021-05-10 04:45:08 +00:00
Jaco edaf13abe1 Updata cumulus types (#3512)
* Updata cumulus types

* yarn .lock
2021-05-10 06:33:20 +02:00
Github Actions b3649a70ce [CI Skip] release/beta 4.9.3-8
skip-checks: true
2021-05-09 07:58:08 +00:00
Jaco 80ab628643 Adjust contract call result decoding (#3510)
* Adjust types for node/node-template

* Adjust contract call result

* Adjust

* Raw directly

* CHANGELOG
2021-05-09 09:46:21 +02:00
Github Actions 76363c0142 [CI Skip] release/beta 4.9.3-7
skip-checks: true
2021-05-09 07:37:35 +00:00
Jaco 80c18c2201 Adjust types for node/node-template (#3509) 2021-05-09 09:27:23 +02:00
Github Actions fcf9b86b87 [CI Skip] release/beta 4.9.3-6
skip-checks: true
2021-05-07 12:52:17 +00:00
Jaco 1113a3d2f8 Use BN_* constants in contract default params (#3507) 2021-05-07 14:41:08 +02:00
Github Actions c899dbf893 [CI Skip] release/beta 4.9.3-5
skip-checks: true
2021-05-07 11:28:49 +00:00
Jaco be137b2a03 Fix ContractRx query result definitions (#3506) 2021-05-07 13:19:23 +02:00
Github Actions 122d780fe8 [CI Skip] release/beta 4.9.3-4
skip-checks: true
2021-05-07 08:57:49 +00:00
Jaco 12be027b18 Allow for Bounded* type usage (#3504)
* Allow for `Bounded*` type usage

* Adjust start index after found

* Adjust

* Add tests for bounded

* Bounded with length value

* adjust
2021-05-07 10:47:09 +02:00
Github Actions dfeef40037 [CI Skip] release/beta 4.9.3-3
skip-checks: true
2021-05-07 07:26:32 +00:00
Jaco a7b4fe4dd0 Adjust internal TS definitions for providers (#3503) 2021-05-07 09:16:10 +02:00
Github Actions f4ec64d6f5 [CI Skip] release/beta 4.9.3-2
skip-checks: true
2021-05-07 06:15:35 +00:00
JQQQ 9a0d39199e Allow rpc expose definition/ metadata (#3488)
* Expose rpc defination(meta)

* Fix lint

* Change def to meta
2021-05-07 08:04:55 +02:00
Github Actions 77d82d9511 [CI Skip] release/beta 4.9.3-1
skip-checks: true
2021-05-07 06:00:57 +00:00
Jaco 5464b91cc6 Bump dev (#3502) 2021-05-07 07:52:31 +02:00
Github Actions 64ff87952a [CI Skip] release/beta 4.9.3-0
skip-checks: true
2021-05-06 11:12:47 +00:00
WoeOm 0de39e4c52 adapt Darwinia, Crab Network types (#3498) 2021-05-06 13:03:16 +02:00
Github Actions 60bc384d22 [CI Skip] release/stable 4.9.2
skip-checks: true
2021-05-06 10:37:05 +00:00
Jaco Greeff ca7ea0e143 4.9.2 (publish failure on .1) 2021-05-06 13:26:36 +03:00
95 changed files with 1146 additions and 885 deletions
+2 -1
View File
@@ -21,4 +21,5 @@
4.0.3
4.6.2
4.7.2
4.7.2
4.9.2
+32
View File
@@ -1,5 +1,37 @@
# CHANGELOG
## 4.10.1 May 17, 2021
Upgrade priority: Medium. Recommended for uses of Polkadot/Kusama 9010 runtimes.
- **Breaking change** Support for the contracts V2 compatibility has been dropped in `@polkadot/api-contract`
Contributed:
- Expose RPC definitions via `.meta` (Thanks to https://github.com/jiqiang90)
- Adjust staking derives for chain-specific optional fields (https://github.com/WoeOm)
- Update base Centrifuge types (Thanks to https://github.com/branan)
Changes:
- Allow for `Bounded*` type usage (as per latest Substrate)
- Adjust internal TS definitions for providers
- Fix `ContractRx` query result definitions (no extra Observable)
- Handle contract call RPC result directly as `Raw` (returned as hex)
- Use `BN_*` constants as non-specified defaults in contract interfaces
- Remove all type overrides for node/node-template (API tracks latest)
- Contracts ABI now supports metadata version where indexes are 0-based
- Remove support for the old-style V2 contracts from `@polkadot/api-contract`
- Adjust historic decoration, return as-at registry via `getHeader`, `getMetadata` & `getRuntimeVersion`
- Adjust `VecFixed` to allow for the handling of hex inputs
- Adjust `Compact<*>` to allow for wrapped `toBigInt()` conversions
- Fix `isPedantic` decoding to correctly handle `Text`
- Cater for new `phragmenElection` module naming
- Add Kusama & Westend 9010 upgrade blocks
- Adjust `CompactSolution` for 24 nominators
- Bump static metadata to latest Substrate
## 4.9.1 May 6, 2021
Upgrade priority: Medium. Required for the next v0.9.0 Polkadot/Kusama chain upgrades where parachains are used.
+4 -4
View File
@@ -25,14 +25,14 @@
"test:watch": "polkadot-dev-run-test --watch"
},
"devDependencies": {
"@babel/core": "^7.14.0",
"@babel/core": "^7.14.2",
"@babel/register": "^7.13.16",
"@babel/runtime": "^7.14.0",
"@polkadot/dev": "^0.62.12",
"@polkadot/ts": "^0.3.64",
"@polkadot/dev": "^0.62.14",
"@polkadot/ts": "^0.3.66",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^26.0.23",
"copyfiles": "^2.4.1"
},
"version": "4.9.1"
"version": "4.10.1"
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-contract",
"version": "4.9.1",
"version": "4.10.1",
"type": "module",
"description": "Interfaces for interacting with contracts and contract ABIs",
"main": "index.js",
@@ -20,10 +20,10 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/api": "4.9.1",
"@polkadot/types": "4.9.1",
"@polkadot/util": "^6.3.1",
"@polkadot/x-rxjs": "^6.3.1",
"@polkadot/api": "4.10.1",
"@polkadot/types": "4.10.1",
"@polkadot/util": "^6.4.1",
"@polkadot/x-rxjs": "^6.4.1",
"bn.js": "^4.11.9"
}
}
+6 -9
View File
@@ -10,8 +10,6 @@ import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, i
import { MetaRegistry } from './MetaRegistry';
const EMPTY_U8A = new Uint8Array();
const l = logger('Abi');
function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string | number): T {
@@ -45,13 +43,13 @@ export class Abi {
assert(isObject(json) && !Array.isArray(json) && json.metadataVersion && isObject(json.spec) && !Array.isArray(json.spec) && Array.isArray(json.spec.constructors) && Array.isArray(json.spec.messages), 'Invalid JSON ABI structure supplied, expected a recent metadata version');
this.json = json;
this.registry = new MetaRegistry(chainProperties);
this.registry = new MetaRegistry(json.metadataVersion as string, chainProperties);
this.project = this.registry.createType('ContractProject', json);
this.registry.setMetaTypes(this.project.types);
this.project.types.forEach((_, index) =>
this.registry.getMetaTypeDef({ type: this.registry.createType('SiLookupTypeId', index + 1) })
this.registry.getMetaTypeDef({ type: this.registry.createType('SiLookupTypeId', index + this.registry.typeOffset) })
);
this.constructors = this.project.spec.constructors.map((spec: ContractConstructorSpec, index) =>
this.#createMessage(spec, index, {
@@ -156,8 +154,8 @@ export class Abi {
index,
method: stringCamelCase(identifier),
selector: spec.selector,
toU8a: (params: CodecArg[], additional?: Uint8Array) =>
this.#encodeArgs(spec, args, params, additional)
toU8a: (params: CodecArg[]) =>
this.#encodeArgs(spec, args, params)
};
return message;
@@ -187,14 +185,13 @@ export class Abi {
return message.fromU8a(trimmed.subarray(4));
}
#encodeArgs = ({ name, selector }: ContractMessageSpec | ContractConstructorSpec, args: AbiParam[], data: CodecArg[], additional = EMPTY_U8A): Uint8Array => {
#encodeArgs = ({ name, selector }: ContractMessageSpec | ContractConstructorSpec, args: AbiParam[], data: CodecArg[]): Uint8Array => {
assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${name.toString()}', found ${data.length}`);
return compactAddLength(
u8aConcat(
this.registry.createType('ContractSelector', selector).toU8a(),
...args.map(({ type }, index) => this.registry.createType(type.type as 'Text', data[index]).toU8a()),
additional
...args.map(({ type }, index) => this.registry.createType(type.type as 'Text', data[index]).toU8a())
)
);
}
+28 -20
View File
@@ -14,8 +14,8 @@ interface PartialTypeSpec {
}
// convert the offset into project-specific, index-1
export function getRegistryOffset (id: SiLookupTypeId): number {
return id.toNumber() - 1;
export function getRegistryOffset (id: SiLookupTypeId, typeOffset: number): number {
return id.toNumber() - typeOffset;
}
const PRIMITIVE_ALIAS: Record<string, keyof InterfaceTypes> = {
@@ -28,11 +28,16 @@ const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance'];
export class MetaRegistry extends TypeRegistry {
public readonly metaTypeDefs: TypeDef[] = [];
public readonly typeOffset;
#siTypes: SiType[] = [];
constructor (chainProperties?: ChainProperties) {
constructor (metadataVersion: string, chainProperties?: ChainProperties) {
super();
// type indexes are 1-based pre-1.0 and 0-based post-1.0
this.typeOffset = metadataVersion.split('.')[0] === '0' ? 1 : 0;
if (chainProperties) {
this.setChainProperties(chainProperties);
}
@@ -43,7 +48,7 @@ export class MetaRegistry extends TypeRegistry {
}
public getMetaTypeDef (typeSpec: PartialTypeSpec): TypeDef {
const offset = getRegistryOffset(typeSpec.type);
const offset = getRegistryOffset(typeSpec.type, this.typeOffset);
let typeDef = this.metaTypeDefs[offset];
if (!typeDef) {
@@ -78,7 +83,7 @@ export class MetaRegistry extends TypeRegistry {
}
#getMetaType = (id: SiLookupTypeId): SiType => {
const type = this.#siTypes[getRegistryOffset(id)];
const type = this.#siTypes[getRegistryOffset(id, this.typeOffset)];
assert(!isUndefined(type), () => `getMetaType:: Unable to find ${id.toNumber()} in type values`);
@@ -87,10 +92,13 @@ export class MetaRegistry extends TypeRegistry {
#extract = (type: SiType, id: SiLookupTypeId): TypeDef => {
const path = [...type.path];
const pathFinal = path.length ? path[path.length - 1].toString() : '';
const isPrimitivePath = !!path.length && (
(path.length > 2 && path[0].eq('ink_env') && path[1].eq('types')) ||
PRIMITIVE_ALWAYS.includes(path[path.length - 1].toString())
);
let typeDef: Omit<TypeDef, 'type'>;
if (type.path.join('::').startsWith('ink_env::types::') || PRIMITIVE_ALWAYS.includes(pathFinal)) {
if (isPrimitivePath) {
typeDef = this.#extractPrimitivePath(type);
} else if (type.def.isPrimitive) {
typeDef = this.#extractPrimitive(type);
@@ -128,7 +136,7 @@ export class MetaRegistry extends TypeRegistry {
}
#extractArray = ({ len: length, type }: SiTypeDefArray): Omit<TypeDef, 'type'> => {
assert(!length || length.toNumber() <= 256, 'MetaRegistry: Only support for [Type; <length>], where length > 256');
assert(!length || length.toNumber() <= 256, 'MetaRegistry: Only support for [Type; <length>], where length <= 256');
return {
info: TypeDefInfo.VecFixed,
@@ -144,27 +152,27 @@ export class MetaRegistry extends TypeRegistry {
]),
[true, true]);
let info;
// check for tuple first (no fields may be available)
if (isTuple) {
info = TypeDefInfo.Tuple;
} else if (isStruct) {
info = TypeDefInfo.Struct;
} else {
throw new Error('Invalid fields type detected, expected either Tuple or Struct');
}
assert(isTuple || isStruct, 'Invalid fields type detected, expected either Tuple or Struct');
const sub = fields.map(({ name, type }) => {
return {
...this.getMetaTypeDef({ type }),
...(name.isSome ? { name: name.unwrap().toString() } : {})
...(name.isSome
? { name: name.unwrap().toString() }
: {}
)
};
});
return isTuple && sub.length === 1
? sub[0]
: { info, sub };
: {
// check for tuple first (no fields may be available)
info: isTuple
? TypeDefInfo.Tuple
: TypeDefInfo.Struct,
sub
};
}
#extractPrimitive = (type: SiType): TypeDef => {
+2 -2
View File
@@ -5,7 +5,7 @@ import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { AnyJson, Registry } from '@polkadot/types/types';
import { ApiBase } from '@polkadot/api/base';
import { assert } from '@polkadot/util';
import { assert, isFunction } from '@polkadot/util';
import { Abi } from '../Abi';
@@ -26,6 +26,6 @@ export abstract class Base<ApiType extends ApiTypes> {
this.registry = this.abi.registry;
this._decorateMethod = decorateMethod;
assert(api.rx.tx.contracts?.instantiate, 'You need to connect to a node with the contracts module, the metadata does not enable api.tx.contracts on this instance');
assert(isFunction(api.rx.tx.contracts?.instantiateWithCode), 'You need to connect to a node with a V3 contracts module. Your node does not expose api.tx.contracts.instantiateWithCode on this instance');
}
}
+16 -17
View File
@@ -10,13 +10,13 @@ import type { MapConstructorExec } from './types';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { isUndefined } from '@polkadot/util';
import { BN_ZERO, isUndefined } from '@polkadot/util';
import { Abi } from '../Abi';
import { applyOnEvent } from '../util';
import { Base } from './Base';
import { Contract } from './Contract';
import { createBluePrintTx, EMPTY_SALT, encodeSalt } from './util';
import { createBluePrintTx, encodeSalt } from './util';
export class BlueprintSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
public readonly contract?: Contract<ApiType>;
@@ -52,20 +52,19 @@ export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
return this.#tx;
}
#deploy = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, BlueprintSubmittableResult<ApiType>> => {
const encodedSalt = encodeSalt(salt);
const withSalt = this.api.tx.contracts.instantiate.meta.args.length === 5;
const encoded = this.abi.findConstructor(constructorOrId).toU8a(params, withSalt ? EMPTY_SALT : encodedSalt);
const tx = withSalt
? this.api.tx.contracts.instantiate(value, gasLimit, this.codeHash, encoded, encodedSalt)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore old style with salt included
: this.api.tx.contracts.instantiate(value, gasLimit, this.codeHash, encoded);
return tx.withResultTransform((result: ISubmittableResult) =>
new BlueprintSubmittableResult(result, applyOnEvent(result, ['Instantiated'], ([record]: EventRecord[]) =>
new Contract<ApiType>(this.api, this.abi, record.event.data[1] as AccountId, this._decorateMethod)
))
);
#deploy = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, value = BN_ZERO }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, BlueprintSubmittableResult<ApiType>> => {
return this.api.tx.contracts
.instantiate(
value,
gasLimit,
this.codeHash,
this.abi.findConstructor(constructorOrId).toU8a(params),
encodeSalt(salt)
)
.withResultTransform((result: ISubmittableResult) =>
new BlueprintSubmittableResult(result, applyOnEvent(result, ['Instantiated'], ([record]: EventRecord[]) =>
new Contract<ApiType>(this.api, this.abi, record.event.data[1] as AccountId, this._decorateMethod)
))
);
}
}
+21 -42
View File
@@ -10,15 +10,14 @@ import type { MapConstructorExec } from './types';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { assert, compactAddLength, isFunction, isUndefined, isWasm, u8aToU8a } from '@polkadot/util';
import { blake2AsU8a } from '@polkadot/util-crypto';
import { assert, BN_ZERO, compactAddLength, isUndefined, isWasm, u8aToU8a } from '@polkadot/util';
import { Abi } from '../Abi';
import { applyOnEvent } from '../util';
import { Base } from './Base';
import { Blueprint } from './Blueprint';
import { Contract } from './Contract';
import { createBluePrintTx, EMPTY_SALT, encodeSalt } from './util';
import { createBluePrintTx, encodeSalt } from './util';
export class CodeSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
public readonly blueprint?: Blueprint<ApiType>;
@@ -57,45 +56,25 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
return this.#tx;
}
#instantiate = (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
return isFunction(this.api.tx.contracts.instantiateWithCode)
? this.#instantiateCurrent(constructorOrId, options, params)
: this.#instantiatePrev(constructorOrId, options, params);
}
#instantiateCurrent = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
#instantiate = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, value = BN_ZERO }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
return this.api.tx.contracts
.instantiateWithCode(value, gasLimit, compactAddLength(this.code), this.abi.findConstructor(constructorOrId).toU8a(params), encodeSalt(salt))
.withResultTransform(this.#transformEvents);
}
#instantiatePrev = (constructorOrId: AbiConstructor | string | number, { gasLimit = 0, salt, value = 0 }: BlueprintOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
assert(isFunction(this.api.tx.utility?.batch), 'Your chain does not include the utility pallet, for contracts v2 deployment, this is required');
const encodedSalt = encodeSalt(salt);
const withSalt = this.api.tx.contracts.instantiate.meta.args.length === 5;
const encoded = this.abi.findConstructor(constructorOrId).toU8a(params, withSalt ? EMPTY_SALT : encodedSalt);
const codeHash = blake2AsU8a(this.code);
return this.api.tx.utility.batch([
this.api.tx.contracts.putCode(compactAddLength(this.code)),
withSalt
? this.api.tx.contracts.instantiate(value, gasLimit, codeHash, encoded, encodedSalt)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore old style with salt included in the params itself
: this.api.tx.contracts.instantiate(value, gasLimit, codeHash, encoded)
]).withResultTransform(this.#transformEvents);
}
#transformEvents = (result: ISubmittableResult): CodeSubmittableResult<ApiType> => {
return new CodeSubmittableResult(result, ...(applyOnEvent(result, ['CodeStored', 'Instantiated'], (records: EventRecord[]) =>
records.reduce(([blueprint, contract], { event }): [Blueprint<ApiType>?, Contract<ApiType>?] =>
this.api.events.contracts.Instantiated.is(event)
? [blueprint, new Contract<ApiType>(this.api, this.abi, event.data[1], this._decorateMethod)]
: this.api.events.contracts.CodeStored.is(event)
? [new Blueprint<ApiType>(this.api, this.abi, event.data[0], this._decorateMethod), contract]
: [blueprint, contract],
[] as [Blueprint<ApiType>?, Contract<ApiType>?])
) || []));
.instantiateWithCode(
value,
gasLimit,
compactAddLength(this.code),
this.abi.findConstructor(constructorOrId).toU8a(params),
encodeSalt(salt)
)
.withResultTransform((result: ISubmittableResult) =>
new CodeSubmittableResult(result, ...(applyOnEvent(result, ['CodeStored', 'Instantiated'], (records: EventRecord[]) =>
records.reduce<[Blueprint<ApiType>?, Contract<ApiType>?]>(([blueprint, contract], { event }) =>
this.api.events.contracts.Instantiated.is(event)
? [blueprint, new Contract<ApiType>(this.api, this.abi, event.data[1], this._decorateMethod)]
: this.api.events.contracts.CodeStored.is(event)
? [new Blueprint<ApiType>(this.api, this.abi, event.data[0], this._decorateMethod), contract]
: [blueprint, contract],
[])
) || []))
);
}
}
+34 -55
View File
@@ -4,8 +4,8 @@
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { Bytes } from '@polkadot/types';
import type { AccountId, ContractExecResult, EventRecord, Weight } from '@polkadot/types/interfaces';
import type { AnyJson, CodecArg, ISubmittableResult, Registry } from '@polkadot/types/types';
import type { AccountId, EventRecord, Weight } from '@polkadot/types/interfaces';
import type { AnyJson, CodecArg, ISubmittableResult } from '@polkadot/types/types';
import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent } from '../types';
import type { ContractCallResult, ContractCallSend, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types';
@@ -13,15 +13,16 @@ import BN from 'bn.js';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { assert, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
import { createTypeUnsafe } from '@polkadot/types';
import { assert, BN_HUNDRED, BN_ONE, BN_ZERO, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
import { map } from '@polkadot/x-rxjs/operators';
import { Abi } from '../Abi';
import { applyOnEvent, extractOptions, formatData, isOptions } from '../util';
import { applyOnEvent, extractOptions, isOptions } from '../util';
import { Base } from './Base';
// As per Rust, 5 * GAS_PER_SEC
const MAX_CALL_GAS = new BN(5_000_000_000_000).subn(1);
const MAX_CALL_GAS = new BN(5_000_000_000_000).isub(BN_ONE);
const ERROR_NO_CALL = 'Your node does not expose the contracts.call RPC. This is most probably due to a runtime configuration.';
const l = logger('Contract');
@@ -50,33 +51,6 @@ export class ContractSubmittableResult extends SubmittableResult {
}
}
// map from a JSON result to current-style ContractExecResult
function mapExecResult (registry: Registry, json: Record<string, AnyJson>): ContractExecResult {
if (!Object.keys(json).some((key) => ['error', 'success'].includes(key))) {
return registry.createType('ContractExecResult', json);
}
const from = registry.createType('ContractExecResultTo260', json);
if (from.isSuccess) {
const s = from.asSuccess;
return registry.createType('ContractExecResult', {
gasConsumed: s.gasConsumed,
result: {
ok: {
data: s.data,
flags: s.flags
}
}
});
}
// in the old format error has no additional information,
// map it as-is with an "unknown" error
return registry.createType('ContractExecResult', { result: { err: { other: 'unknown' } } });
}
export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
/**
* @description The on-chain address for this contract
@@ -120,19 +94,24 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
#getGas = (_gasLimit: BigInt | BN | string | number, isCall = false): BN => {
const gasLimit = bnToBn(_gasLimit);
return gasLimit.lten(0)
return gasLimit.lte(BN_ZERO)
? isCall
? MAX_CALL_GAS
: (this.api.consts.system.blockWeights
? this.api.consts.system.blockWeights.maxBlock
: this.api.consts.system.maximumBlockWeight as Weight
).muln(64).divn(100)
).muln(64).div(BN_HUNDRED)
: gasLimit;
}
#exec = (messageOrId: AbiMessage | string | number, { gasLimit = 0, value = 0 }: ContractOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType> => {
#exec = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: CodecArg[]): SubmittableExtrinsic<ApiType> => {
return this.api.tx.contracts
.call(this.address, value, this.#getGas(gasLimit), this.abi.findMessage(messageOrId).toU8a(params))
.call(
this.address,
value,
this.#getGas(gasLimit),
this.abi.findMessage(messageOrId).toU8a(params)
)
.withResultTransform((result: ISubmittableResult) =>
// ContractEmitted is the current generation, ContractExecution is the previous generation
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractEmitted', 'ContractExecution'], (records: EventRecord[]) =>
@@ -151,7 +130,7 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
);
}
#read = (messageOrId: AbiMessage | string | number, { gasLimit = 0, value = 0 }: ContractOptions, params: CodecArg[]): ContractCallSend<ApiType> => {
#read = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: CodecArg[]): ContractCallSend<ApiType> => {
assert(this.hasRpcContractsCall, ERROR_NO_CALL);
const message = this.abi.findMessage(messageOrId);
@@ -159,24 +138,24 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
return {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
send: this._decorateMethod((origin: string | AccountId | Uint8Array) =>
this.api.rx.rpc.contracts.call.json({
dest: this.address,
gasLimit: this.#getGas(gasLimit, true),
inputData: message.toU8a(params),
origin,
value
}).pipe(map((json): ContractCallOutcome => {
const { debugMessage, gasConsumed, result } = mapExecResult(this.registry, json.toJSON());
return {
debugMessage,
gasConsumed,
output: result.isOk && message.returnType
? formatData(this.registry, result.asOk.data, message.returnType)
: null,
result
};
}))
this.api.rx.rpc.contracts
.call({
dest: this.address,
gasLimit: this.#getGas(gasLimit, true),
inputData: message.toU8a(params),
origin,
value
})
.pipe(
map(({ debugMessage, gasConsumed, result }): ContractCallOutcome => ({
debugMessage,
gasConsumed,
output: result.isOk && message.returnType
? createTypeUnsafe(this.registry, message.returnType.type, [result.asOk.data.toU8a(true)], { isPedantic: true })
: null,
result
}))
)
)
};
}
+1 -4
View File
@@ -11,10 +11,7 @@ export const mockApi = {
rx: {
tx: {
contracts: {
instantiate: (): never => {
throw new Error('mock');
},
putCode: (): never => {
instantiateWithCode: (): never => {
throw new Error('mock');
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ export interface ContractGeneric<O, T> {
}
export type ContractCallResult<ApiType extends ApiTypes, T> = ApiType extends 'rxjs'
? Observable<Observable<T>>
? Observable<T>
: Promise<ObsInnerType<Observable<T>>>;
export interface ContractCallSend<ApiType extends ApiTypes> {
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-contract', version: '4.9.1' };
export const packageInfo = { name: '@polkadot/api-contract', version: '4.10.1' };
+1 -1
View File
@@ -42,7 +42,7 @@ export interface AbiMessage {
method: string;
returnType?: TypeDef | null;
selector: ContractSelector;
toU8a: (params: CodecArg[], additional?: Uint8Array) => Uint8Array;
toU8a: (params: CodecArg[]) => Uint8Array;
}
export type AbiConstructor = AbiMessage;
+1 -7
View File
@@ -2,24 +2,18 @@
// SPDX-License-Identifier: Apache-2.0
import type { SubmittableResult } from '@polkadot/api';
import type { Raw } from '@polkadot/types';
import type { EventRecord } from '@polkadot/types/interfaces';
import type { Codec, CodecArg, Registry, TypeDef } from '@polkadot/types/types';
import type { CodecArg } from '@polkadot/types/types';
import type { BlueprintOptions, ContractOptions } from './types';
import BN from 'bn.js';
import { createTypeUnsafe } from '@polkadot/types/create';
import { isBigInt, isBn, isNumber, isString } from '@polkadot/util';
type ContractEvents = 'CodeStored' | 'ContractEmitted' | 'ContractExecution' | 'Instantiated';
type TOptions = BlueprintOptions | ContractOptions;
export function formatData (registry: Registry, data: Raw, { type }: TypeDef): Codec {
return createTypeUnsafe(registry, type, [data], { isPedantic: true });
}
export function applyOnEvent <T> (result: SubmittableResult, types: ContractEvents[], fn: (records: EventRecord[]) => T): T | undefined {
if (result.isInBlock || result.isFinalized) {
const records = result.filterRecords('contracts', types);
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-derive",
"version": "4.9.1",
"version": "4.10.1",
"type": "module",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"main": "index.js",
@@ -20,16 +20,16 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/api": "4.9.1",
"@polkadot/rpc-core": "4.9.1",
"@polkadot/types": "4.9.1",
"@polkadot/util": "^6.3.1",
"@polkadot/util-crypto": "^6.3.1",
"@polkadot/x-rxjs": "^6.3.1",
"@polkadot/api": "4.10.1",
"@polkadot/rpc-core": "4.10.1",
"@polkadot/types": "4.10.1",
"@polkadot/util": "^6.4.1",
"@polkadot/util-crypto": "^6.4.1",
"@polkadot/x-rxjs": "^6.4.1",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^6.3.1",
"@polkadot/rpc-provider": "4.9.1"
"@polkadot/keyring": "^6.4.1",
"@polkadot/rpc-provider": "4.10.1"
}
}
+5 -1
View File
@@ -41,7 +41,11 @@ function parseFlags (address: AccountId | Address | string | null | undefined, [
*/
export function flags (instanceId: string, api: ApiInterfaceRx): (address?: AccountId | Address | string | null) => Observable<DeriveAccountFlags> {
return memo(instanceId, (address?: AccountId | Address | string | null): Observable<DeriveAccountFlags> => {
const councilSection = api.query.electionsPhragmen ? 'electionsPhragmen' : 'elections';
const councilSection = api.query.phragmenElection
? 'phragmenElection'
: api.query.electionsPhragmen
? 'electionsPhragmen'
: 'elections';
return combineLatest<FlagsIntermediate>([
address && api.query[councilSection]?.members
+2 -2
View File
@@ -44,11 +44,11 @@ function calcLocked (api: ApiInterfaceRx, bestNumber: BlockNumber, locks: (Balan
if (Array.isArray(locks)) {
// only get the locks that are valid until passed the current block
lockedBreakdown = (locks as BalanceLockTo212[]).filter(({ until }): boolean => !until || (bestNumber && until.gt(bestNumber)));
allLocked = lockedBreakdown.some(({ amount }) => amount.isMax());
allLocked = lockedBreakdown.some(({ amount }) => amount && amount.isMax());
vestingLocked = api.registry.createType('Balance', lockedBreakdown.filter(({ id }) => id.eq(VESTING_ID)).reduce((result: BN, { amount }) => result.iadd(amount), new BN(0)));
// get the maximum of the locks according to https://github.com/paritytech/substrate/blob/master/srml/balances/src/lib.rs#L699
const notAll = lockedBreakdown.filter(({ amount }) => !amount.isMax());
const notAll = lockedBreakdown.filter(({ amount }) => amount && !amount.isMax());
if (notAll.length) {
lockedBalance = api.registry.createType('Balance', bnMax(...notAll.map(({ amount }): Balance => amount)));
+4 -4
View File
@@ -21,7 +21,7 @@ function isVoter (value: VoteEntry): value is Voter {
}
function retrieveStakeOf (api: ApiInterfaceRx): Observable<[AccountId, Balance][]> {
return (api.query.electionsPhragmen || api.query.elections).stakeOf.entries<Balance, [AccountId]>().pipe(
return (api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections).stakeOf.entries<Balance, [AccountId]>().pipe(
map((entries) =>
entries.map(([{ args: [accountId] }, stake]) => [accountId, stake])
)
@@ -29,7 +29,7 @@ function retrieveStakeOf (api: ApiInterfaceRx): Observable<[AccountId, Balance][
}
function retrieveVoteOf (api: ApiInterfaceRx): Observable<[AccountId, AccountId[]][]> {
return (api.query.electionsPhragmen || api.query.elections).votesOf.entries<Vec<AccountId>, [AccountId]>().pipe(
return (api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections).votesOf.entries<Vec<AccountId>, [AccountId]>().pipe(
map((entries) =>
entries.map(([{ args: [accountId] }, votes]) => [accountId, votes])
)
@@ -61,7 +61,7 @@ function retrievePrev (api: ApiInterfaceRx): Observable<DeriveCouncilVotes> {
}
function retrieveCurrent (api: ApiInterfaceRx): Observable<DeriveCouncilVotes> {
const elections = (api.query.electionsPhragmen || api.query.elections);
const elections = (api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections);
return elections.voting.entries<VoteEntry, [AccountId]>().pipe(
map((entries): DeriveCouncilVotes =>
@@ -77,7 +77,7 @@ function retrieveCurrent (api: ApiInterfaceRx): Observable<DeriveCouncilVotes> {
export function votes (instanceId: string, api: ApiInterfaceRx): () => Observable<DeriveCouncilVotes> {
return memo(instanceId, (): Observable<DeriveCouncilVotes> =>
(api.query.electionsPhragmen || api.query.elections).stakeOf
(api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections).stakeOf
? retrievePrev(api)
: retrieveCurrent(api)
);
+5 -1
View File
@@ -42,7 +42,11 @@ function sortAccounts ([, balanceA]: [AccountId, Balance], [, balanceB]: [Accoun
}
function queryElections (api: ApiInterfaceRx): Observable<DeriveElectionsInfo> {
const section = api.query.electionsPhragmen ? 'electionsPhragmen' : 'elections';
const section = api.query.phragmenElection
? 'phragmenElection'
: api.query.electionsPhragmen
? 'electionsPhragmen'
: 'elections';
return api.queryMulti<[Vec<AccountId>, Vec<Candidate>, Vec<Member>, Vec<Member>]>([
api.query.council.members,
+1 -1
View File
@@ -48,7 +48,7 @@ const deriveAvail: Record<string, string[]> = {
contracts: ['contracts'],
council: ['council'],
democracy: ['democracy'],
elections: ['electionsPhragmen', 'elections'],
elections: ['phragmenElection', 'electionsPhragmen', 'elections'],
imOnline: ['imOnline'],
membership: ['membership'],
parachains: ['parachains', 'registrar'],
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api-derive', version: '4.9.1' };
export const packageInfo = { name: '@polkadot/api-derive', version: '4.10.1' };
@@ -28,7 +28,7 @@ function parseRewards (api: ApiInterfaceRx, stashId: AccountId, [erasPoints, era
Object.entries(eraValidators).forEach(([validatorId, exposure]): void => {
const valPoints = allValPoints[validatorId] || BN_ZERO;
const valComm = allValPrefs[validatorId]?.commission.unwrap() || BN_ZERO;
const expTotal = exposure.total.unwrap();
const expTotal = exposure.total?.unwrap() || BN_ZERO;
let avail = BN_ZERO;
let value: BN | undefined;
+11 -11
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api",
"version": "4.9.1",
"version": "4.10.1",
"type": "module",
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
"main": "index.js",
@@ -20,16 +20,16 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/api-derive": "4.9.1",
"@polkadot/keyring": "^6.3.1",
"@polkadot/metadata": "4.9.1",
"@polkadot/rpc-core": "4.9.1",
"@polkadot/rpc-provider": "4.9.1",
"@polkadot/types": "4.9.1",
"@polkadot/types-known": "4.9.1",
"@polkadot/util": "^6.3.1",
"@polkadot/util-crypto": "^6.3.1",
"@polkadot/x-rxjs": "^6.3.1",
"@polkadot/api-derive": "4.10.1",
"@polkadot/keyring": "^6.4.1",
"@polkadot/metadata": "4.10.1",
"@polkadot/rpc-core": "4.10.1",
"@polkadot/rpc-provider": "4.10.1",
"@polkadot/types": "4.10.1",
"@polkadot/types-known": "4.10.1",
"@polkadot/util": "^6.4.1",
"@polkadot/util-crypto": "^6.4.1",
"@polkadot/x-rxjs": "^6.4.1",
"bn.js": "^4.11.9",
"eventemitter3": "^4.0.7"
}
+22 -14
View File
@@ -3,6 +3,7 @@
import type { Vec, u16, u32, u64, u8 } from '@polkadot/types';
import type { Codec } from '@polkadot/types/types';
import type { Schedule } from '@polkadot/types/interfaces/contracts';
import type { Balance, BalanceOf, BlockNumber, LockIdentifier, Moment, PalletId, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime';
import type { SessionIndex } from '@polkadot/types/interfaces/session';
import type { EraIndex } from '@polkadot/types/interfaces/staking';
@@ -104,20 +105,6 @@ declare module '@polkadot/api/types/consts' {
* It works the same as [`Self::DepositPerStorageByte`] but for storage items.
**/
depositPerStorageItem: BalanceOf & AugmentedConst<ApiType>;
/**
* The maximum length of a contract code in bytes. This limit applies to the instrumented
* version of the code. Therefore `instantiate_with_code` can fail even when supplying
* a wasm binary below this maximum size.
**/
maxCodeSize: u32 & AugmentedConst<ApiType>;
/**
* The maximum nesting level of a call/instantiate stack.
**/
maxDepth: u32 & AugmentedConst<ApiType>;
/**
* The maximum size of a storage value and event payload in bytes.
**/
maxValueSize: u32 & AugmentedConst<ApiType>;
/**
* The fraction of the deposit that should be used as rent per block.
*
@@ -126,6 +113,10 @@ declare module '@polkadot/api/types/consts' {
* This determines how high this rent payment is per block as a fraction of the deposit.
**/
rentFraction: Perbill & AugmentedConst<ApiType>;
/**
* Cost schedule and limits.
**/
schedule: Schedule & AugmentedConst<ApiType>;
/**
* Number of block delay an extrinsic claim surcharge has.
*
@@ -327,7 +318,13 @@ declare module '@polkadot/api/types/consts' {
};
lottery: {
[key: string]: Codec;
/**
* The max number of calls available in a single lottery.
**/
maxCalls: u32 & AugmentedConst<ApiType>;
/**
* The Lottery's pallet id
**/
palletId: PalletId & AugmentedConst<ApiType>;
};
multisig: {
@@ -389,10 +386,15 @@ declare module '@polkadot/api/types/consts' {
[key: string]: Codec;
/**
* The base amount of currency needed to reserve for creating a recovery configuration.
*
* This is held for an additional storage item whose value size is
* `2 + sizeof(BlockNumber, Balance)` bytes.
**/
configDepositBase: BalanceOf & AugmentedConst<ApiType>;
/**
* The amount of currency needed per additional user when creating a recovery configuration.
*
* This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage value.
**/
friendDepositFactor: BalanceOf & AugmentedConst<ApiType>;
/**
@@ -401,6 +403,12 @@ declare module '@polkadot/api/types/consts' {
maxFriends: u16 & AugmentedConst<ApiType>;
/**
* The base amount of currency needed to reserve for starting a recovery.
*
* This is primarily held for deterring malicious recovery attempts, and should
* have a value large enough that a bad actor would choose not to place this
* deposit. It also acts to fund additional storage item whose value size is
* `sizeof(BlockNumber, Balance + T * AccountId)` bytes. Where T is a configurable
* threshold.
**/
recoveryDeposit: BalanceOf & AugmentedConst<ApiType>;
};
+10 -24
View File
@@ -43,10 +43,6 @@ declare module '@polkadot/api/types/errors' {
* No provider reference exists to allow a non-zero balance of a non-self-sufficient asset.
**/
NoProvider: AugmentedError<ApiType>;
/**
* A mint operation lead to an overflow.
**/
Overflow: AugmentedError<ApiType>;
/**
* No approval exists that would allow the transfer.
**/
@@ -132,10 +128,6 @@ declare module '@polkadot/api/types/errors' {
* Account liquidity restrictions prevent withdrawal
**/
LiquidityRestrictions: AugmentedError<ApiType>;
/**
* Got an overflow after adding
**/
Overflow: AugmentedError<ApiType>;
/**
* Vesting balance too high to send value
**/
@@ -210,6 +202,10 @@ declare module '@polkadot/api/types/errors' {
* Contract trapped during execution.
**/
ContractTrapped: AugmentedError<ApiType>;
/**
* The debug message specified to `seal_debug_message` does contain invalid UTF-8.
**/
DebugMessageInvalidUTF8: AugmentedError<ApiType>;
/**
* Input passed to a contract API function failed to decode as expected type.
**/
@@ -308,6 +304,12 @@ declare module '@polkadot/api/types/errors' {
* when number of storage items is too large.
**/
StorageExhausted: AugmentedError<ApiType>;
/**
* A contract self destructed in its constructor.
*
* This can be triggered by a call to `seal_terminate` or `seal_restore_to`.
**/
TerminatedInConstructor: AugmentedError<ApiType>;
/**
* The amount of topics passed to `seal_deposit_events` exceeds the limit.
**/
@@ -460,10 +462,6 @@ declare module '@polkadot/api/types/errors' {
* The given account did not vote on the referendum.
**/
NotVoter: AugmentedError<ApiType>;
/**
* An unexpected integer overflow occurred.
**/
Overflow: AugmentedError<ApiType>;
/**
* Invalid preimage
**/
@@ -492,10 +490,6 @@ declare module '@polkadot/api/types/errors' {
* Maximum number of proposals reached.
**/
TooManyProposals: AugmentedError<ApiType>;
/**
* An unexpected integer underflow occurred.
**/
Underflow: AugmentedError<ApiType>;
/**
* Value too low
**/
@@ -796,10 +790,6 @@ declare module '@polkadot/api/types/errors' {
* A lottery has not been configured.
**/
NotConfigured: AugmentedError<ApiType>;
/**
* An overflow has occurred.
**/
Overflow: AugmentedError<ApiType>;
/**
* Too many calls for a single lottery.
**/
@@ -953,10 +943,6 @@ declare module '@polkadot/api/types/errors' {
* A recovery process has not started for this rescuer
**/
NotStarted: AugmentedError<ApiType>;
/**
* There was an overflow in a calculation
**/
Overflow: AugmentedError<ApiType>;
/**
* There are still active recovery attempts that need to be closed
**/
+1 -5
View File
@@ -9,7 +9,7 @@ import type { BabeAuthorityWeight, BabeEpochConfiguration, MaybeRandomness, Next
import type { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
import type { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { CodeHash, ContractInfo, DeletedContract, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts';
import type { CodeHash, ContractInfo, DeletedContract, PrefabWasmModule } from '@polkadot/types/interfaces/contracts';
import type { PreimageStatus, PropIndex, Proposal, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy';
import type { VoteThreshold } from '@polkadot/types/interfaces/elections';
import type { ActiveGilt, ActiveGiltsTotal, ActiveIndex, GiltBid } from '@polkadot/types/interfaces/gilt';
@@ -225,10 +225,6 @@ declare module '@polkadot/api/types/storage' {
* TWOX-NOTE: SAFE since `AccountId` is a secure hash.
**/
contractInfoOf: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<ContractInfo>>, [AccountId]> & QueryableStorageEntry<ApiType, [AccountId]>;
/**
* Current cost schedule for contracts.
**/
currentSchedule: AugmentedQuery<ApiType, () => Observable<Schedule>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Evicted contracts that await child trie deletion.
*
+1 -10
View File
@@ -6,7 +6,7 @@ import type { AnyNumber, ITuple } from '@polkadot/types/types';
import type { AssetDestroyWitness, TAssetBalance } from '@polkadot/types/interfaces/assets';
import type { BabeEquivocationProof, NextConfigDescriptor } from '@polkadot/types/interfaces/babe';
import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective';
import type { CodeHash, Schedule } from '@polkadot/types/interfaces/contracts';
import type { CodeHash } from '@polkadot/types/interfaces/contracts';
import type { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy';
import type { Renouncing } from '@polkadot/types/interfaces/elections';
import type { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
@@ -724,15 +724,6 @@ declare module '@polkadot/api/types/submittable' {
* - The `deploy` function is executed in the context of the newly-created account.
**/
instantiateWithCode: AugmentedSubmittable<(endowment: Compact<BalanceOf> | AnyNumber | Uint8Array, gasLimit: Compact<Weight> | AnyNumber | Uint8Array, code: Bytes | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<BalanceOf>, Compact<Weight>, Bytes, Bytes, Bytes]>;
/**
* Updates the schedule for metering contracts.
*
* The schedule's version cannot be less than the version of the stored schedule.
* If a schedule does not change the instruction weights the version does not
* need to be increased. Therefore we allow storing a schedule that has the same
* version as the stored one.
**/
updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; enablePrintln?: any; limits?: any; instructionWeights?: any; hostFnWeights?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Schedule]>;
};
council: {
[key: string]: SubmittableExtrinsicFunction<ApiType>;
+2
View File
@@ -291,6 +291,8 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
(section as Record<string, { json: unknown }>)[methodName].json = decorateMethod(method.json, { methodName }) as unknown;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
(section as Record<string, { raw: unknown }>)[methodName].raw = decorateMethod(method.raw, { methodName }) as unknown;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
(section as Record<string, { meta: unknown }>)[methodName].meta = method.meta;
}
return section;
+16 -10
View File
@@ -1,6 +1,7 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { RpcInterfaceMethod } from '@polkadot/rpc-core/types';
import type { Text } from '@polkadot/types';
import type { ChainProperties, Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
@@ -22,7 +23,6 @@ import { detectedCapabilities } from './capabilities';
import { Decorate } from './Decorate';
const KEEPALIVE_INTERVAL = 10000;
const DEFAULT_BLOCKNUMBER = { unwrap: () => BN_ZERO };
const l = logger('api/init');
@@ -116,17 +116,21 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
// We have to assume that on the RPC layer the calls used here does not call back into
// the registry swap, so getHeader & getRuntimeVersion should not be historic
const header = this._genesisHash.eq(blockHash)
? { number: DEFAULT_BLOCKNUMBER, parentHash: this._genesisHash }
: await this._rpcCore.chain.getHeader(blockHash).toPromise();
const header = this.registry.createType('HeaderPartial',
this._genesisHash.eq(blockHash)
? { number: BN_ZERO, parentHash: this._genesisHash }
: await (this._rpcCore.chain.getHeader as RpcInterfaceMethod).json(blockHash).toPromise()
);
assert(header?.parentHash && !header.parentHash.isEmpty, 'Unable to retrieve header and parent from supplied hash');
assert(!header.parentHash.isEmpty, 'Unable to retrieve header and parent from supplied hash');
// get the runtime version, either on-chain or via an known upgrade history
const [firstVersion, lastVersion] = getUpgradeVersion(this._genesisHash, header.number.unwrap());
const version = (firstVersion && (lastVersion || firstVersion.specVersion.eq(this._runtimeVersion.specVersion)))
? { specName: this._runtimeVersion.specName, specVersion: firstVersion.specVersion }
: await this._rpcCore.state.getRuntimeVersion(header.parentHash).toPromise();
const [firstVersion, lastVersion] = getUpgradeVersion(this._genesisHash, header.number);
const version = this.registry.createType('RuntimeVersionPartial',
(firstVersion && (lastVersion || firstVersion.specVersion.eq(this._runtimeVersion.specVersion)))
? { specName: this._runtimeVersion.specName, specVersion: firstVersion.specVersion }
: await (this._rpcCore.state.getRuntimeVersion as RpcInterfaceMethod).json(header.parentHash).toPromise()
);
// check for pre-existing registries
const existingViaVersion = this.#registries.find(({ specVersion }) => specVersion.eq(version.specVersion));
@@ -138,7 +142,9 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
}
// nothing has been found, construct new
const metadata = await this._rpcCore.state.getMetadata(header.parentHash).toPromise();
const metadata = new Metadata(this.registry,
await (this._rpcCore.state.getMetadata as RpcInterfaceMethod).raw(header.parentHash).toPromise()
);
const registry = this._initRegistry(new TypeRegistry(blockHash), this._runtimeChain as Text, version, metadata);
// add our new registry
+1 -1
View File
@@ -150,7 +150,7 @@ export function detectedCapabilities (api: ApiInterfaceRx, blockHash?: Uint8Arra
]);
const raws = filterEntries([
api.query.session?.queuedKeys.key(),
api.query.system?.account.key(emptyAccountId)
api.query.system?.account?.key(emptyAccountId)
]);
return combineLatest([
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/api', version: '4.9.1' };
export const packageInfo = { name: '@polkadot/api', version: '4.10.1' };
+2 -5
View File
@@ -50,13 +50,10 @@ describe('ApiPromise', (): void => {
describe('initialization', (): void => {
it('Create API instance with metadata map and makes the runtime, rpc, state & extrinsics available', async (): Promise<void> => {
const rpcData = await provider.send('state_getMetadata', []);
const rpcData = await provider.send<string>('state_getMetadata', []);
const genesisHash = registry.createType('Hash', await provider.send('chain_getBlockHash', [])).toHex();
const specVersion = 0;
const metadata = { [`${genesisHash}-${specVersion}`]: rpcData as string };
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const api = await ApiPromise.create({ metadata, provider, registry });
const api = await ApiPromise.create({ metadata: { [`${genesisHash}-${specVersion}`]: rpcData }, provider, registry });
expect(api.genesisHash).toBeDefined();
expect(api.runtimeMetadata).toBeDefined();
+3 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { Json, Raw } from '@polkadot/types/codec';
import type { AnyFunction, Callback } from '@polkadot/types/types';
import type { AnyFunction, Callback, DefinitionRpc } from '@polkadot/types/types';
import type { Observable } from '@polkadot/x-rxjs';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -11,6 +11,7 @@ import { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './b
export interface RpcRxResult<F extends AnyFunction> extends RxResult<F> {
json (...args: Parameters<F>): Observable<Json>;
raw (...args: Parameters<F>): Observable<Raw>;
meta: DefinitionRpc;
}
export interface RpcPromiseResult<F extends AnyFunction> extends PromiseResult<F> {
@@ -18,6 +19,7 @@ export interface RpcPromiseResult<F extends AnyFunction> extends PromiseResult<F
json (...args: Push<Parameters<F>, Callback<Json>>): UnsubscribePromise;
raw (...args: Parameters<F>): Promise<Raw>;
raw (...args: Push<Parameters<F>, Callback<Raw>>): UnsubscribePromise;
meta: DefinitionRpc;
}
export type RpcMethodResult<ApiType extends ApiTypes, F extends AnyFunction> = ApiType extends 'rxjs'
+9 -1
View File
@@ -14,7 +14,7 @@ function createApi (): Promise<ApiPromise> {
return new ApiPromise({ provider }).isReady;
}
describe.skip('misc quick tests', (): void => {
describe('misc quick tests', (): void => {
it.skip('retrieves balances correctly', async (): Promise<void> => {
const api = await createApi();
@@ -76,4 +76,12 @@ describe.skip('misc quick tests', (): void => {
.map(([block, value]) => [block, value.toRawType(), value.toHuman()])
));
});
it('expose rpc and rx definition', async (): Promise<void> => {
const api = await createApi();
console.error(api.rpc.payment.queryFeeDetails.meta);
console.error(api.rx.rpc.chain.getBlock.meta);
});
});
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/metadata",
"version": "4.9.1",
"version": "4.10.1",
"type": "module",
"description": "Helpers to extract information from runtime metadata",
"main": "index.js",
@@ -20,13 +20,13 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/types": "4.9.1",
"@polkadot/types-known": "4.9.1",
"@polkadot/util": "^6.3.1",
"@polkadot/util-crypto": "^6.3.1",
"@polkadot/types": "4.10.1",
"@polkadot/types-known": "4.10.1",
"@polkadot/util": "^6.4.1",
"@polkadot/util-crypto": "^6.4.1",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^6.3.1"
"@polkadot/keyring": "^6.4.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/metadata', version: '4.9.1' };
export const packageInfo = { name: '@polkadot/metadata', version: '4.10.1' };
+43 -96
View File
@@ -1736,12 +1736,6 @@
" Account liquidity restrictions prevent withdrawal"
]
},
{
"name": "Overflow",
"documentation": [
" Got an overflow after adding"
]
},
{
"name": "InsufficientBalance",
"documentation": [
@@ -4812,18 +4806,6 @@
" The account is already delegating."
]
},
{
"name": "Overflow",
"documentation": [
" An unexpected integer overflow occurred."
]
},
{
"name": "Underflow",
"documentation": [
" An unexpected integer underflow occurred."
]
},
{
"name": "InsufficientFunds",
"documentation": [
@@ -6949,17 +6931,6 @@
"storage": {
"prefix": "Contracts",
"items": [
{
"name": "CurrentSchedule",
"modifier": "Default",
"type": {
"plain": "Schedule"
},
"fallback": "0x000000000004000000000200000001000080000000100000000010000000010000200000001f060000d66a0200dd84030026180000bd1c0000430b000003170000ae2800009c000000dd69010063e00200300700000706000065070000b10500006e180000002800006905000072deae08f0070000dc070000710a00006a080000a507000096070000d1070000770900003e09000075090000d809000082090000bc090000120900003c09000072090000dc090000f7080000e108000062090000162000006b1d00002e2000002c1b0000fe080000000900000f090000a7090000f1090000ba090000bb09000065090000d8b82800000000009e9828000000000016902700000000004c705700000000004cc8270000000000e4bc270000000000e8d1270000000000a0685b0000000000484f2700000000009e7627000000000000f45100000000004cab120000000000184a700000000000140100000000000000cd460000000000fc02000000000000d0b570270000000013200000000000007821da3100000000e0200000000000009a120000000000000482b10900000000e03463000000000038d7900000000000de67d00700000000840900000000000006186e000000000016935d1200000000da02000000000000eaced408000000003a240e0200000000e705000000000000fc41d50a00000000d48e9309000000002d0f0000000000003a4225090000000047020000000000002303000000000000ba7c962300000000a5210000000000006d020000000000005403000000000000e50b00000000000026922400000000006110000000000000a4122600000000001d0d000000000000520e2200000000001a0600000000000020222200000000001a0600000000000044b13c0000000000",
"documentation": [
" Current cost schedule for contracts."
]
},
{
"name": "PristineCode",
"modifier": "Optional",
@@ -7038,23 +7009,6 @@
]
},
"calls": [
{
"name": "update_schedule",
"args": [
{
"name": "schedule",
"type": "Schedule"
}
],
"documentation": [
" Updates the schedule for metering contracts.",
"",
" The schedule's version cannot be less than the version of the stored schedule.",
" If a schedule does not change the instruction weights the version does not",
" need to be increased. Therefore we allow storing a schedule that has the same",
" version as the stored one."
]
},
{
"name": "call",
"args": [
@@ -7305,6 +7259,14 @@
}
],
"constants": [
{
"name": "Schedule",
"type": "Schedule",
"value": "0x040000000002000000010000800000001000000000100000000100002000000020000000004000000000020002000000bb060000c70c0200ea16030019160000571d0000940d0000c7190000f7290000520000000c59010050810200930b000027070000e7070000cd0500008c160000b819000022070000e757b50798060000490600008f090000ca0700009e050000de050000fa050000f9080000d3080000d2080000b1080000aa080000b2080000a1080000f60800001c0900009f0800006f080000af080000320800008d210000ff1d0000b2210000221e0000ca080000d6080000810800008c090000be090000b6090000a40a0000dc080000ae032600000000007a79250000000000bab224000000000056db500000000000469024000000000002ed2400000000008088240000000000d4c02400000000005e8224000000000004aa240000000000f6c1470000000000162d120000000000384b680000000000ef0000000000000060cf430000000000e20200000000000098ca9f20000000005b20000000000000202a872900000000f21c000000000000410d000000000000eafaac0900000000c6eb5c0000000000e4ba88000000000090bcc907000000007e09000000000000e08e1300000000002aea1800000000007e98cb0900000000b802000000000000bad9360800000000f2040c0200000000d505000000000000baa9960a00000000c021eb0f00000000ee0e00000000000000d47808000000005202000000000000080300000000000014c314230000000059200000000000005802000000000000290300000000000009090000000000005abf220000000000db12000000000000202a240000000000f50c00000000000024c61f00000000000c060000000000009a821f0000000000e30500000000000006eb360000000000",
"documentation": [
" Cost schedule and limits."
]
},
{
"name": "SignedClaimHandicap",
"type": "BlockNumber",
@@ -7383,26 +7345,10 @@
" to removal of a contract."
]
},
{
"name": "MaxDepth",
"type": "u32",
"value": "0x20000000",
"documentation": [
" The maximum nesting level of a call/instantiate stack."
]
},
{
"name": "MaxValueSize",
"type": "u32",
"value": "0x00400000",
"documentation": [
" The maximum size of a storage value and event payload in bytes."
]
},
{
"name": "DeletionQueueDepth",
"type": "u32",
"value": "0xf0000000",
"value": "0x71040000",
"documentation": [
" The maximum number of tries that can be queued for deletion."
]
@@ -7414,16 +7360,6 @@
"documentation": [
" The maximum amount of weight that can be consumed per block for lazy trie removal."
]
},
{
"name": "MaxCodeSize",
"type": "u32",
"value": "0x00000200",
"documentation": [
" The maximum length of a contract code in bytes. This limit applies to the instrumented",
" version of the code. Therefore `instantiate_with_code` can fail even when supplying",
" a wasm binary below this maximum size."
]
}
],
"errors": [
@@ -7623,6 +7559,20 @@
"documentation": [
" A contract with the same AccountId already exists."
]
},
{
"name": "TerminatedInConstructor",
"documentation": [
" A contract self destructed in its constructor.",
"",
" This can be triggered by a call to `seal_terminate` or `seal_restore_to`."
]
},
{
"name": "DebugMessageInvalidUTF8",
"documentation": [
" The debug message specified to `seal_debug_message` does contain invalid UTF-8."
]
}
],
"index": 18
@@ -10198,7 +10148,10 @@
"type": "BalanceOf",
"value": "0x00406352bfc601000000000000000000",
"documentation": [
" The base amount of currency needed to reserve for creating a recovery configuration."
" The base amount of currency needed to reserve for creating a recovery configuration.",
"",
" This is held for an additional storage item whose value size is",
" `2 + sizeof(BlockNumber, Balance)` bytes."
]
},
{
@@ -10206,7 +10159,9 @@
"type": "BalanceOf",
"value": "0x00203d88792d00000000000000000000",
"documentation": [
" The amount of currency needed per additional user when creating a recovery configuration."
" The amount of currency needed per additional user when creating a recovery configuration.",
"",
" This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage value."
]
},
{
@@ -10222,7 +10177,13 @@
"type": "BalanceOf",
"value": "0x00406352bfc601000000000000000000",
"documentation": [
" The base amount of currency needed to reserve for starting a recovery."
" The base amount of currency needed to reserve for starting a recovery.",
"",
" This is primarily held for deterring malicious recovery attempts, and should",
" have a value large enough that a bad actor would choose not to place this",
" deposit. It also acts to fund additional storage item whose value size is",
" `sizeof(BlockNumber, Balance + T * AccountId)` bytes. Where T is a configurable",
" threshold."
]
}
],
@@ -10311,12 +10272,6 @@
" There are still active recovery attempts that need to be closed"
]
},
{
"name": "Overflow",
"documentation": [
" There was an overflow in a calculation"
]
},
{
"name": "AlreadyProxy",
"documentation": [
@@ -13696,12 +13651,6 @@
" Minimum balance should be non-zero."
]
},
{
"name": "Overflow",
"documentation": [
" A mint operation lead to an overflow."
]
},
{
"name": "NoProvider",
"documentation": [
@@ -13993,22 +13942,20 @@
"name": "PalletId",
"type": "PalletId",
"value": "0x70792f6c6f74746f",
"documentation": []
"documentation": [
" The Lottery's pallet id"
]
},
{
"name": "MaxCalls",
"type": "u32",
"value": "0x0a000000",
"documentation": []
"documentation": [
" The max number of calls available in a single lottery."
]
}
],
"errors": [
{
"name": "Overflow",
"documentation": [
" An overflow has occurred."
]
},
{
"name": "NotConfigured",
"documentation": [
File diff suppressed because one or more lines are too long
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-core",
"version": "4.9.1",
"version": "4.10.1",
"type": "module",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
@@ -20,13 +20,13 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/metadata": "4.9.1",
"@polkadot/rpc-provider": "4.9.1",
"@polkadot/types": "4.9.1",
"@polkadot/util": "^6.3.1",
"@polkadot/x-rxjs": "^6.3.1"
"@polkadot/metadata": "4.10.1",
"@polkadot/rpc-provider": "4.10.1",
"@polkadot/types": "4.10.1",
"@polkadot/util": "^6.4.1",
"@polkadot/x-rxjs": "^6.4.1"
},
"devDependencies": {
"@polkadot/keyring": "^6.3.1"
"@polkadot/keyring": "^6.4.1"
}
}
+21 -27
View File
@@ -178,12 +178,6 @@ export class RpcCore {
this.mapping.set(jsonrpc, { ...def, isSubscription, jsonrpc, method, section });
// FIXME Remove any here
// To do so, remove `RpcInterfaceMethod` from './types.ts', and refactor
// every method inside this class to take:
// `<S extends keyof RpcInterface, M extends keyof RpcInterface[S]>`
// Not doing so, because it makes this class a little bit less readable,
// and leaving it as-is doesn't harm much
(exposed as Record<string, unknown>)[method] = isSubscription
? this._createMethodSubscribe(section, method, def as DefinitionRpcSub)
: this._createMethodSend(section, method, def);
@@ -192,13 +186,14 @@ export class RpcCore {
}, {} as RpcInterface[Section]);
}
private _memomize (creator: (outputAs: OutputType) => (...values: any[]) => Observable<any>): Memoized<RpcInterfaceMethod> {
private _memomize (creator: <T> (outputAs: OutputType) => (...values: unknown[]) => Observable<T>, def: DefinitionRpc): Memoized<RpcInterfaceMethod> {
const memoized = memoize(creator('scale') as RpcInterfaceMethod, {
getInstanceId: () => this.#instanceId
});
memoized.json = creator('json');
memoized.raw = creator('raw');
memoized.meta = def;
return memoized;
}
@@ -206,30 +201,29 @@ export class RpcCore {
private _createMethodSend (section: string, method: string, def: DefinitionRpc): RpcInterfaceMethod {
const rpcName = def.endpoint || `${section}_${method}`;
const hashIndex = def.params.findIndex(({ isHistoric }) => isHistoric);
const cacheIndex = def.params.findIndex(({ isCached }) => isCached);
let memoized: null | Memoized<RpcInterfaceMethod> = null;
// execute the RPC call, doing a registry swap for historic as applicable
const callWithRegistry = async (outputAs: OutputType, values: any[]): Promise<Codec | Codec[]> => {
const callWithRegistry = async <T> (outputAs: OutputType, values: unknown[]): Promise<T> => {
const blockHash = hashIndex === -1
? null
: values[hashIndex] as (Uint8Array | string | null | undefined);
const { registry } = blockHash && this.#getBlockRegistry
const { registry } = outputAs === 'scale' && blockHash && this.#getBlockRegistry
? await this.#getBlockRegistry(u8aToU8a(blockHash))
: { registry: this.#registryDefault };
const params = this._formatInputs(registry, null, def, values);
const data = await this.provider.send(rpcName, params.map((param): AnyJson => param.toJSON())) as AnyJson;
const data = await this.provider.send<AnyJson>(rpcName, params.map((param) => param.toJSON()));
return outputAs === 'scale'
? this._formatOutput(registry, blockHash, method, def, params, data)
: registry.createType(outputAs === 'raw' ? 'Raw' : 'Json', data);
? this._formatOutput(registry, blockHash, method, def, params, data) as unknown as T
: registry.createType(outputAs === 'raw' ? 'Raw' : 'Json', data) as unknown as T;
};
const creator = (outputAs: OutputType) => (...values: any[]): Observable<any> => {
const isDelayed = (hashIndex !== -1 && !!values[hashIndex]) || (cacheIndex !== -1 && !!values[cacheIndex]);
const creator = <T> (outputAs: OutputType) => (...values: unknown[]): Observable<T> => {
const isDelayed = outputAs === 'scale' && hashIndex !== -1 && !!values[hashIndex];
return new Observable((observer: Observer<any>): VoidCallback => {
callWithRegistry(outputAs, values)
return new Observable((observer: Observer<T>): VoidCallback => {
callWithRegistry<T>(outputAs, values)
.then((value): void => {
observer.next(value);
observer.complete();
@@ -253,7 +247,7 @@ export class RpcCore {
);
};
memoized = this._memomize(creator);
memoized = this._memomize(creator, def);
return memoized;
}
@@ -278,8 +272,8 @@ export class RpcCore {
const subType = `${section}_${updateType}`;
let memoized: null | Memoized<RpcInterfaceMethod> = null;
const creator = (outputAs: OutputType) => (...values: unknown[]): Observable<any> => {
return new Observable((observer: Observer<any>): VoidCallback => {
const creator = <T> (outputAs: OutputType) => (...values: unknown[]): Observable<T> => {
return new Observable((observer: Observer<T>): VoidCallback => {
// Have at least an empty promise, as used in the unsubscribe
let subscriptionPromise: Promise<number | string | null> = Promise.resolve(null);
const registry = this.#registryDefault;
@@ -294,7 +288,7 @@ export class RpcCore {
const params = this._formatInputs(registry, null, def, values);
const paramsJson = params.map((param): AnyJson => param.toJSON());
const update = (error?: Error | null, result?: any): void => {
const update = (error?: Error | null, result?: T): void => {
if (error) {
logErrorMessage(method, def, error);
@@ -304,8 +298,8 @@ export class RpcCore {
try {
observer.next(
outputAs === 'scale'
? this._formatOutput(registry, null, method, def, params, result)
: registry.createType(outputAs === 'raw' ? 'Raw' : 'Json', result)
? this._formatOutput(registry, null, method, def, params, result) as unknown as T
: registry.createType(outputAs === 'raw' ? 'Raw' : 'Json', result) as unknown as T
);
} catch (error) {
observer.error(error);
@@ -334,12 +328,12 @@ export class RpcCore {
}).pipe(drr());
};
memoized = this._memomize(creator);
memoized = this._memomize(creator, def);
return memoized;
}
private _formatInputs (registry: Registry, blockHash: Uint8Array | string | null | undefined, def: DefinitionRpc, inputs: any[]): Codec[] {
private _formatInputs (registry: Registry, blockHash: Uint8Array | string | null | undefined, def: DefinitionRpc, inputs: unknown[]): Codec[] {
const reqArgCount = def.params.filter(({ isOptional }) => !isOptional).length;
const optText = reqArgCount === def.params.length
? ''
@@ -352,11 +346,11 @@ export class RpcCore {
);
}
private _formatOutput (registry: Registry, blockHash: Uint8Array | string | null | undefined, method: string, rpc: DefinitionRpc, params: Codec[], result?: any): Codec | Codec[] {
private _formatOutput (registry: Registry, blockHash: Uint8Array | string | null | undefined, method: string, rpc: DefinitionRpc, params: Codec[], result?: unknown): Codec | Codec[] {
if (rpc.type === 'StorageData') {
const key = params[0] as StorageKey;
return this._formatStorageData(registry, blockHash, key, result);
return this._formatStorageData(registry, blockHash, key, result as string);
} else if (rpc.type === 'StorageChangeSet') {
const keys = params[0] as Vec<StorageKey>;
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.9.1' };
export const packageInfo = { name: '@polkadot/rpc-core', version: '4.10.1' };
+6 -3
View File
@@ -1,12 +1,15 @@
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Json, Raw } from '@polkadot/types';
import type { Codec, DefinitionRpc } from '@polkadot/types/types';
import type { Observable } from '@polkadot/x-rxjs';
export * from './types.jsonrpc';
export interface RpcInterfaceMethod {
(...params: any[]): Observable<any>;
json (...params: any[]): Observable<any>;
raw (...params: any[]): Observable<any>;
<T extends Codec> (...params: unknown[]): Observable<T>;
json (...params: unknown[]): Observable<Json>;
raw (...params: unknown[]): Observable<Raw>;
meta: DefinitionRpc;
}
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/rpc-provider",
"version": "4.9.1",
"version": "4.10.1",
"type": "module",
"description": "Transport providers for the API",
"main": "index.js",
@@ -20,18 +20,18 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/types": "4.9.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",
"@polkadot/types": "4.10.1",
"@polkadot/util": "^6.4.1",
"@polkadot/util-crypto": "^6.4.1",
"@polkadot/x-fetch": "^6.4.1",
"@polkadot/x-global": "^6.4.1",
"@polkadot/x-ws": "^6.4.1",
"bn.js": "^4.11.9",
"eventemitter3": "^4.0.7"
},
"devDependencies": {
"@polkadot/keyring": "^6.3.1",
"@polkadot/metadata": "4.9.1",
"@polkadot/keyring": "^6.4.1",
"@polkadot/metadata": "4.10.1",
"mock-socket": "^9.0.3",
"nock": "^13.0.11"
}
+3 -3
View File
@@ -103,7 +103,7 @@ export class HttpProvider implements ProviderInterface {
/**
* @summary Send HTTP POST Request with Body to configured HTTP Endpoint.
*/
public async send (method: string, params: any[]): Promise<any> {
public async send <T = any> (method: string, params: unknown[]): Promise<T> {
const body = this.#coder.encodeJson(method, params);
const response = await fetch(this.#endpoint, {
body,
@@ -121,14 +121,14 @@ export class HttpProvider implements ProviderInterface {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const result = await response.json();
return this.#coder.decodeResponse(result);
return this.#coder.decodeResponse(result) as T;
}
/**
* @summary Subscriptions are not supported with the HttpProvider, see [[WsProvider]].
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/require-await
public async subscribe (types: string, method: string, params: any[], cb: ProviderInterfaceCallback): Promise<number> {
public async subscribe (types: string, method: string, params: unknown[], cb: ProviderInterfaceCallback): Promise<number> {
l.error(ERROR_SUBSCRIBE);
throw new Error(ERROR_SUBSCRIBE);
+14 -14
View File
@@ -53,24 +53,24 @@ export class MockProvider implements ProviderInterface {
private requests: Record<string, (...params: any[]) => unknown> = {
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-unsafe-member-access
chain_getBlock: (hash: string): any => this.registry.createType('SignedBlock', rpcSignedBlock.result).toJSON(),
chain_getBlock: () => this.registry.createType('SignedBlock', rpcSignedBlock.result).toJSON(),
// eslint-disable-next-line @typescript-eslint/no-unused-vars
chain_getBlockHash: (blockNumber: number): string => '0x1234',
chain_getBlockHash: () => '0x1234',
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
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: () => this.registry.createType('RpcMethods').toJSON(),
state_getKeys: (): string[] => [],
state_getKeysPaged: (): string[] => [],
state_getMetadata: (): string => rpcMetadata,
state_getRuntimeVersion: (): string => this.registry.createType('RuntimeVersion').toHex(),
state_getStorage: (storage: MockStateDb, params: any[]): string => u8aToHex(storage[(params[0] as string)]),
system_chain: (): string => 'mockChain',
system_name: (): string => 'mockClient',
system_properties: (): Record<string, number | string> => ({ ss58Format: 42 }),
state_getKeys: () => [],
state_getKeysPaged: () => [],
state_getMetadata: () => rpcMetadata,
state_getRuntimeVersion: () => this.registry.createType('RuntimeVersion').toHex(),
state_getStorage: (storage: MockStateDb, [key]: string[]) => u8aToHex(storage[key]),
system_chain: () => 'mockChain',
system_name: () => 'mockClient',
system_properties: () => ({ ss58Format: 42 }),
system_upgradedToTripleRefCount: () => this.registry.createType('bool', true),
system_version: (): string => '9.8.7'
system_version: () => '9.8.7'
};
public subscriptions: MockStateSubscriptions = SUBSCRIPTIONS.reduce((subs, name): MockStateSubscriptions => {
@@ -121,12 +121,12 @@ export class MockProvider implements ProviderInterface {
}
// eslint-disable-next-line @typescript-eslint/require-await
public async send (method: string, params: any[]): Promise<unknown> {
public async send <T = any> (method: string, params: unknown[]): Promise<T> {
l.debug(() => ['send', method, params]);
assert(this.requests[method], () => `provider.send: Invalid method '${method}'`);
return this.requests[method](this.db, params);
return this.requests[method](this.db, params) as T;
}
// eslint-disable-next-line @typescript-eslint/require-await
@@ -152,7 +152,7 @@ export class MockProvider implements ProviderInterface {
public async unsubscribe (type: string, method: string, id: number): Promise<boolean> {
const sub = this.subscriptionMap[id];
l.debug((): any => ['unsubscribe', id, sub]);
l.debug(() => ['unsubscribe', id, sub]);
assert(sub, () => `Unable to find subscription for ${id}`);
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.9.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', version: '4.10.1' };
+2 -2
View File
@@ -49,7 +49,7 @@ export interface ProviderInterface {
connect (): Promise<void>;
disconnect (): Promise<void>;
on (type: ProviderInterfaceEmitted, sub: ProviderInterfaceEmitCb): () => void;
send (method: string, params: any[]): Promise<any>;
subscribe (type: string, method: string, params: any[], cb: ProviderInterfaceCallback): Promise<number | string>;
send <T = any> (method: string, params: unknown[]): Promise<T>;
subscribe (type: string, method: string, params: unknown[], cb: ProviderInterfaceCallback): Promise<number | string>;
unsubscribe (type: string, method: string, id: number | string): Promise<boolean>;
}
+7 -12
View File
@@ -23,13 +23,13 @@ interface SubscriptionHandler {
interface WsStateAwaiting {
callback: ProviderInterfaceCallback;
method: string;
params: any[];
params: unknown[];
subscription?: SubscriptionHandler;
}
interface WsStateSubscription extends SubscriptionHandler {
method: string;
params: any[];
params: unknown[];
}
const ALIASES: { [index: string]: string } = {
@@ -254,7 +254,7 @@ export class WsProvider implements ProviderInterface {
* @param params Encoded parameters as applicable for the method
* @param subscription Subscription details (internally used)
*/
public send <T = any> (method: string, params: any[], subscription?: SubscriptionHandler): Promise<T> {
public send <T = any> (method: string, params: unknown[], subscription?: SubscriptionHandler): Promise<T> {
return new Promise<T>((resolve, reject): void => {
try {
assert(this.isConnected && !isNull(this.#websocket), 'WebSocket is not connected');
@@ -262,10 +262,10 @@ export class WsProvider implements ProviderInterface {
const json = this.#coder.encodeJson(method, params);
const id = this.#coder.getId();
const callback = (error?: Error | null, result?: any): void => {
const callback = (error?: Error | null, result?: T): void => {
error
? reject(error)
: resolve(result);
: resolve(result as T);
};
l.debug(() => ['calling', method, json]);
@@ -287,11 +287,6 @@ export class WsProvider implements ProviderInterface {
/**
* @name subscribe
* @summary Allows subscribing to a specific event.
* @param {string} type Subscription type
* @param {string} method Subscription method
* @param {any[]} params Parameters
* @param {ProviderInterfaceCallback} callback Callback
* @return {Promise<number>} Promise resolving to the dd of the subscription you can use with [[unsubscribe]].
*
* @example
* <BR>
@@ -307,7 +302,7 @@ export class WsProvider implements ProviderInterface {
* })
* ```
*/
public subscribe (type: string, method: string, params: any[], callback: ProviderInterfaceCallback): Promise<number | string> {
public subscribe (type: string, method: string, params: unknown[], callback: ProviderInterfaceCallback): Promise<number | string> {
return this.send<number | string>(method, params, { callback, type });
}
@@ -338,7 +333,7 @@ export class WsProvider implements ProviderInterface {
}
}
#emit = (type: ProviderInterfaceEmitted, ...args: any[]): void => {
#emit = (type: ProviderInterfaceEmitted, ...args: unknown[]): void => {
this.#eventemitter.emit(type, ...args);
}
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/typegen",
"version": "4.9.1",
"version": "4.10.1",
"type": "module",
"description": "Type generation scripts",
"main": "index.js",
@@ -26,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.14.0",
"@babel/core": "^7.14.2",
"@babel/register": "^7.13.16",
"@babel/runtime": "^7.14.0",
"@polkadot/api": "4.9.1",
"@polkadot/metadata": "4.9.1",
"@polkadot/rpc-provider": "4.9.1",
"@polkadot/types": "4.9.1",
"@polkadot/util": "^6.3.1",
"@polkadot/api": "4.10.1",
"@polkadot/metadata": "4.10.1",
"@polkadot/rpc-provider": "4.10.1",
"@polkadot/types": "4.10.1",
"@polkadot/util": "^6.4.1",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.0.1"
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/typegen', version: '4.9.1' };
export const packageInfo = { name: '@polkadot/typegen', version: '4.10.1' };
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/types-known",
"version": "4.9.1",
"version": "4.10.1",
"type": "module",
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
"main": "index.js",
@@ -20,9 +20,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/networks": "^6.3.1",
"@polkadot/types": "4.9.1",
"@polkadot/util": "^6.3.1",
"@polkadot/networks": "^6.4.1",
"@polkadot/types": "4.10.1",
"@polkadot/util": "^6.4.1",
"bn.js": "^4.11.9"
},
"devDependencies": {
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types-known', version: '4.9.1' };
export const packageInfo = { name: '@polkadot/types-known', version: '4.10.1' };
@@ -6,12 +6,6 @@
import type { OverrideVersionedType } from '@polkadot/types/types';
const sharedTypes = {
// substrate
AccountInfo: 'AccountInfoWithRefCount',
Address: 'LookupSource',
LookupSource: 'IndicesLookupSource',
Multiplier: 'Fixed64',
// Anchor
AnchorData: {
anchoredBlock: 'u64',
@@ -77,11 +71,21 @@ const sharedTypes = {
const versioned: OverrideVersionedType[] = [
{
minmax: [240, undefined],
minmax: [240, 999],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithRefCount',
Address: 'LookupSource',
LookupSource: 'IndicesLookupSource',
Multiplier: 'Fixed64',
RefCount: 'RefCountTo259'
}
},
{
minmax: [1000, undefined],
types: {
...sharedTypes
}
}
];
+16 -2
View File
@@ -15,16 +15,20 @@ const sharedTypes = {
const addrIndicesTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'LookupSource',
CompactAssignments: 'CompactAssignmentsWith16',
Keys: 'SessionKeys5',
LookupSource: 'IndicesLookupSource',
RawSolution: 'RawSolutionWith16',
ValidatorPrefs: 'ValidatorPrefsWithCommission'
};
const addrAccountIdTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
CompactAssignments: 'CompactAssignmentsWith16',
Keys: 'SessionKeys5',
LookupSource: 'AccountId',
RawSolution: 'RawSolutionWith16',
ValidatorPrefs: 'ValidatorPrefsWithCommission'
};
@@ -164,11 +168,21 @@ const versioned: OverrideVersionedType[] = [
minmax: [2028, 2029],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount'
AccountInfo: 'AccountInfoWithDualRefCount',
CompactAssignments: 'CompactAssignmentsWith16',
RawSolution: 'RawSolutionWith16'
}
},
{
minmax: [2030, undefined],
minmax: [2030, 9000],
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsWith16',
RawSolution: 'RawSolutionWith16'
}
},
{
minmax: [9010, undefined],
types: {
...sharedTypes
}
@@ -9,8 +9,7 @@ const versioned: OverrideVersionedType[] = [
{
minmax: [0, undefined],
types: {
Address: 'MultiAddress',
LookupSource: 'MultiAddress'
// nothing, API tracks master
}
}
];
+2 -13
View File
@@ -5,22 +5,11 @@
import type { OverrideVersionedType } from '@polkadot/types/types';
// these are override types for Polkadot
const versioned: OverrideVersionedType[] = [
{
minmax: [0, 260],
minmax: [0, undefined],
types: {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'LookupSource',
LookupSource: 'IndicesLookupSource'
}
},
{
minmax: [261, undefined],
types: {
AccountInfo: 'AccountInfoWithDualRefCount',
Address: 'MultiAddress',
LookupSource: 'MultiAddress'
// nothing, API tracks master
}
}
];
+13 -1
View File
@@ -23,8 +23,10 @@ const sharedTypes = {
const addrAccountIdTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
CompactAssignments: 'CompactAssignmentsWith16',
Keys: 'SessionKeys5',
LookupSource: 'AccountId',
RawSolution: 'RawSolutionWith16',
ValidatorPrefs: 'ValidatorPrefsWithCommission'
};
@@ -68,11 +70,21 @@ const versioned: OverrideVersionedType[] = [
minmax: [28, 29],
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsWith16',
RawSolution: 'RawSolutionWith16',
AccountInfo: 'AccountInfoWithDualRefCount'
}
},
{
minmax: [30, undefined],
minmax: [30, 9000],
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsWith16',
RawSolution: 'RawSolutionWith16'
}
},
{
minmax: [9010, undefined],
types: {
...sharedTypes
}
+18 -4
View File
@@ -20,25 +20,39 @@ const versioned: OverrideVersionedType[] = [
...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount',
Address: 'AccountId',
LookupSource: 'AccountId'
CompactAssignments: 'CompactAssignmentsWith16',
LookupSource: 'AccountId',
RawSolution: 'RawSolutionWith16'
}
},
{
minmax: [201, 214],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount'
AccountInfo: 'AccountInfoWithDualRefCount',
CompactAssignments: 'CompactAssignmentsWith16',
RawSolution: 'RawSolutionWith16'
}
},
{
minmax: [215, 228],
types: {
...sharedTypes,
Keys: 'SessionKeys6'
CompactAssignments: 'CompactAssignmentsWith16',
Keys: 'SessionKeys6',
RawSolution: 'RawSolutionWith16'
}
},
{
minmax: [229, undefined],
minmax: [229, 9000],
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsWith16',
RawSolution: 'RawSolutionWith16'
}
},
{
minmax: [9010, undefined],
types: {
...sharedTypes
}
+14 -2
View File
@@ -15,8 +15,10 @@ const sharedTypes = {
const addrAccountIdTypes = {
AccountInfo: 'AccountInfoWithRefCount',
Address: 'AccountId',
CompactAssignments: 'CompactAssignmentsWith16',
LookupSource: 'AccountId',
Keys: 'SessionKeys5',
RawSolution: 'RawSolutionWith16',
ValidatorPrefs: 'ValidatorPrefsWithCommission'
};
@@ -71,11 +73,21 @@ const versioned: OverrideVersionedType[] = [
minmax: [48, 49],
types: {
...sharedTypes,
AccountInfo: 'AccountInfoWithDualRefCount'
AccountInfo: 'AccountInfoWithDualRefCount',
CompactAssignments: 'CompactAssignmentsWith16',
RawSolution: 'RawSolutionWith16'
}
},
{
minmax: [50, undefined],
minmax: [50, 9000],
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsWith16',
RawSolution: 'RawSolutionWith16'
}
},
{
minmax: [9010, undefined],
types: {
...sharedTypes
}
+1 -1
View File
@@ -12,7 +12,7 @@ const upgrades: ChainUpgradesRaw = [
[2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011],
[2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022],
[3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027],
[6137912, 2028], [6561855, 2029], [7100891, 2030]
[6137912, 2028], [6561855, 2029], [7100891, 2030], [7468792, 9010]
];
export default upgrades;
+1 -1
View File
@@ -9,7 +9,7 @@ const upgrades: ChainUpgradesRaw = [
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
[5124076, 50], [5478664, 900], [5482450, 9000]
[5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010]
];
export default upgrades;
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/types",
"version": "4.9.1",
"version": "4.10.1",
"type": "module",
"description": "Implementation of the Parity codec",
"main": "index.js",
@@ -20,14 +20,14 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/metadata": "4.9.1",
"@polkadot/util": "^6.3.1",
"@polkadot/util-crypto": "^6.3.1",
"@polkadot/x-rxjs": "^6.3.1",
"@polkadot/metadata": "4.10.1",
"@polkadot/util": "^6.4.1",
"@polkadot/util-crypto": "^6.4.1",
"@polkadot/x-rxjs": "^6.4.1",
"@types/bn.js": "^4.11.6",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^6.3.1"
"@polkadot/keyring": "^6.4.1"
}
}
+49 -4
View File
@@ -18,6 +18,7 @@ import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/conse
import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractInstantiateResult, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateReturnValue, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
@@ -41,15 +42,15 @@ import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/ty
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, ChangesTrieSignal, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, HeaderPartial, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, 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, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, 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, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, StorageChangeSet, TraceBlockResponse, TraceError } 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, TokenError, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, 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';
@@ -92,6 +93,8 @@ declare module '@polkadot/types/types/registry' {
'Compact<MomentOf>': Compact<MomentOf>;
'Compact<NominatorIndex>': Compact<NominatorIndex>;
'Compact<OffchainAccuracy>': Compact<OffchainAccuracy>;
'Compact<OverweightIndex>': Compact<OverweightIndex>;
'Compact<PageCounter>': Compact<PageCounter>;
'Compact<ParaId>': Compact<ParaId>;
'Compact<ParaValidatorIndex>': Compact<ParaValidatorIndex>;
'Compact<Perbill>': Compact<Perbill>;
@@ -178,6 +181,7 @@ declare module '@polkadot/types/types/registry' {
'Option<ApplyExtrinsicResult>': Option<ApplyExtrinsicResult>;
'Option<ApprovalFlag>': Option<ApprovalFlag>;
'Option<Approvals>': Option<Approvals>;
'Option<ArithmeticError>': Option<ArithmeticError>;
'Option<AssetApproval>': Option<AssetApproval>;
'Option<AssetApprovalKey>': Option<AssetApprovalKey>;
'Option<AssetBalance>': Option<AssetBalance>;
@@ -266,8 +270,12 @@ declare module '@polkadot/types/types/registry' {
'Option<CommittedCandidateReceipt>': Option<CommittedCandidateReceipt>;
'Option<CompactAssignments>': Option<CompactAssignments>;
'Option<CompactAssignmentsTo257>': Option<CompactAssignmentsTo257>;
'Option<CompactAssignmentsTo265>': Option<CompactAssignmentsTo265>;
'Option<CompactAssignmentsWith16>': Option<CompactAssignmentsWith16>;
'Option<CompactAssignmentsWith24>': Option<CompactAssignmentsWith24>;
'Option<CompactScore>': Option<CompactScore>;
'Option<CompactScoreCompact>': Option<CompactScoreCompact>;
'Option<ConfigData>': Option<ConfigData>;
'Option<Consensus>': Option<Consensus>;
'Option<ConsensusEngineId>': Option<ConsensusEngineId>;
'Option<ConsumedWeight>': Option<ConsumedWeight>;
@@ -477,6 +485,7 @@ declare module '@polkadot/types/types/registry' {
'Option<Hash>': Option<Hash>;
'Option<HeadData>': Option<HeadData>;
'Option<Header>': Option<Header>;
'Option<HeaderPartial>': Option<HeaderPartial>;
'Option<Health>': Option<Health>;
'Option<Heartbeat>': Option<Heartbeat>;
'Option<HeartbeatTo244>': Option<HeartbeatTo244>;
@@ -557,6 +566,7 @@ declare module '@polkadot/types/types/registry' {
'Option<MaybeVrf>': Option<MaybeVrf>;
'Option<MemberCount>': Option<MemberCount>;
'Option<MembershipProof>': Option<MembershipProof>;
'Option<MessageId>': Option<MessageId>;
'Option<MessageIngestionType>': Option<MessageIngestionType>;
'Option<MessageQueueChain>': Option<MessageQueueChain>;
'Option<MessagingStateSnapshot>': Option<MessagingStateSnapshot>;
@@ -633,7 +643,10 @@ declare module '@polkadot/types/types/registry' {
'Option<OutboundHrmpMessage>': Option<OutboundHrmpMessage>;
'Option<OutboundStatus>': Option<OutboundStatus>;
'Option<Outcome>': Option<Outcome>;
'Option<OverweightIndex>': Option<OverweightIndex>;
'Option<Owner>': Option<Owner>;
'Option<PageCounter>': Option<PageCounter>;
'Option<PageIndexData>': Option<PageIndexData>;
'Option<PalletId>': Option<PalletId>;
'Option<PalletsOrigin>': Option<PalletsOrigin>;
'Option<PalletVersion>': Option<PalletVersion>;
@@ -709,6 +722,9 @@ declare module '@polkadot/types/types/registry' {
'Option<RawBabePreDigestTo159>': Option<RawBabePreDigestTo159>;
'Option<RawOrigin>': Option<RawOrigin>;
'Option<RawSolution>': Option<RawSolution>;
'Option<RawSolutionTo265>': Option<RawSolutionTo265>;
'Option<RawSolutionWith16>': Option<RawSolutionWith16>;
'Option<RawSolutionWith24>': Option<RawSolutionWith24>;
'Option<RawVRFOutput>': Option<RawVRFOutput>;
'Option<ReadProof>': Option<ReadProof>;
'Option<ReadySolution>': Option<ReadySolution>;
@@ -747,6 +763,7 @@ declare module '@polkadot/types/types/registry' {
'Option<RuntimeDispatchInfo>': Option<RuntimeDispatchInfo>;
'Option<RuntimeVersion>': Option<RuntimeVersion>;
'Option<RuntimeVersionApi>': Option<RuntimeVersionApi>;
'Option<RuntimeVersionPartial>': Option<RuntimeVersionPartial>;
'Option<Schedule>': Option<Schedule>;
'Option<Scheduled>': Option<Scheduled>;
'Option<ScheduledTo254>': Option<ScheduledTo254>;
@@ -1007,6 +1024,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<ApplyExtrinsicResult>': Vec<ApplyExtrinsicResult>;
'Vec<ApprovalFlag>': Vec<ApprovalFlag>;
'Vec<Approvals>': Vec<Approvals>;
'Vec<ArithmeticError>': Vec<ArithmeticError>;
'Vec<AssetApproval>': Vec<AssetApproval>;
'Vec<AssetApprovalKey>': Vec<AssetApprovalKey>;
'Vec<AssetBalance>': Vec<AssetBalance>;
@@ -1095,8 +1113,12 @@ declare module '@polkadot/types/types/registry' {
'Vec<CommittedCandidateReceipt>': Vec<CommittedCandidateReceipt>;
'Vec<CompactAssignments>': Vec<CompactAssignments>;
'Vec<CompactAssignmentsTo257>': Vec<CompactAssignmentsTo257>;
'Vec<CompactAssignmentsTo265>': Vec<CompactAssignmentsTo265>;
'Vec<CompactAssignmentsWith16>': Vec<CompactAssignmentsWith16>;
'Vec<CompactAssignmentsWith24>': Vec<CompactAssignmentsWith24>;
'Vec<CompactScore>': Vec<CompactScore>;
'Vec<CompactScoreCompact>': Vec<CompactScoreCompact>;
'Vec<ConfigData>': Vec<ConfigData>;
'Vec<Consensus>': Vec<Consensus>;
'Vec<ConsensusEngineId>': Vec<ConsensusEngineId>;
'Vec<ConsumedWeight>': Vec<ConsumedWeight>;
@@ -1306,6 +1328,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<Hash>': Vec<Hash>;
'Vec<HeadData>': Vec<HeadData>;
'Vec<Header>': Vec<Header>;
'Vec<HeaderPartial>': Vec<HeaderPartial>;
'Vec<Health>': Vec<Health>;
'Vec<Heartbeat>': Vec<Heartbeat>;
'Vec<HeartbeatTo244>': Vec<HeartbeatTo244>;
@@ -1386,6 +1409,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<MaybeVrf>': Vec<MaybeVrf>;
'Vec<MemberCount>': Vec<MemberCount>;
'Vec<MembershipProof>': Vec<MembershipProof>;
'Vec<MessageId>': Vec<MessageId>;
'Vec<MessageIngestionType>': Vec<MessageIngestionType>;
'Vec<MessageQueueChain>': Vec<MessageQueueChain>;
'Vec<MessagingStateSnapshot>': Vec<MessagingStateSnapshot>;
@@ -1462,7 +1486,10 @@ declare module '@polkadot/types/types/registry' {
'Vec<OutboundHrmpMessage>': Vec<OutboundHrmpMessage>;
'Vec<OutboundStatus>': Vec<OutboundStatus>;
'Vec<Outcome>': Vec<Outcome>;
'Vec<OverweightIndex>': Vec<OverweightIndex>;
'Vec<Owner>': Vec<Owner>;
'Vec<PageCounter>': Vec<PageCounter>;
'Vec<PageIndexData>': Vec<PageIndexData>;
'Vec<PalletId>': Vec<PalletId>;
'Vec<PalletsOrigin>': Vec<PalletsOrigin>;
'Vec<PalletVersion>': Vec<PalletVersion>;
@@ -1538,6 +1565,9 @@ declare module '@polkadot/types/types/registry' {
'Vec<RawBabePreDigestTo159>': Vec<RawBabePreDigestTo159>;
'Vec<RawOrigin>': Vec<RawOrigin>;
'Vec<RawSolution>': Vec<RawSolution>;
'Vec<RawSolutionTo265>': Vec<RawSolutionTo265>;
'Vec<RawSolutionWith16>': Vec<RawSolutionWith16>;
'Vec<RawSolutionWith24>': Vec<RawSolutionWith24>;
'Vec<RawVRFOutput>': Vec<RawVRFOutput>;
'Vec<ReadProof>': Vec<ReadProof>;
'Vec<ReadySolution>': Vec<ReadySolution>;
@@ -1576,6 +1606,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<RuntimeDispatchInfo>': Vec<RuntimeDispatchInfo>;
'Vec<RuntimeVersion>': Vec<RuntimeVersion>;
'Vec<RuntimeVersionApi>': Vec<RuntimeVersionApi>;
'Vec<RuntimeVersionPartial>': Vec<RuntimeVersionPartial>;
'Vec<Schedule>': Vec<Schedule>;
'Vec<Scheduled>': Vec<Scheduled>;
'Vec<ScheduledTo254>': Vec<ScheduledTo254>;
@@ -1836,6 +1867,7 @@ declare module '@polkadot/types/types/registry' {
ApplyExtrinsicResult: ApplyExtrinsicResult;
ApprovalFlag: ApprovalFlag;
Approvals: Approvals;
ArithmeticError: ArithmeticError;
AssetApproval: AssetApproval;
AssetApprovalKey: AssetApprovalKey;
AssetBalance: AssetBalance;
@@ -1924,8 +1956,12 @@ declare module '@polkadot/types/types/registry' {
CommittedCandidateReceipt: CommittedCandidateReceipt;
CompactAssignments: CompactAssignments;
CompactAssignmentsTo257: CompactAssignmentsTo257;
CompactAssignmentsTo265: CompactAssignmentsTo265;
CompactAssignmentsWith16: CompactAssignmentsWith16;
CompactAssignmentsWith24: CompactAssignmentsWith24;
CompactScore: CompactScore;
CompactScoreCompact: CompactScoreCompact;
ConfigData: ConfigData;
Consensus: Consensus;
ConsensusEngineId: ConsensusEngineId;
ConsumedWeight: ConsumedWeight;
@@ -2135,6 +2171,7 @@ declare module '@polkadot/types/types/registry' {
Hash: Hash;
HeadData: HeadData;
Header: Header;
HeaderPartial: HeaderPartial;
Health: Health;
Heartbeat: Heartbeat;
HeartbeatTo244: HeartbeatTo244;
@@ -2215,6 +2252,7 @@ declare module '@polkadot/types/types/registry' {
MaybeVrf: MaybeVrf;
MemberCount: MemberCount;
MembershipProof: MembershipProof;
MessageId: MessageId;
MessageIngestionType: MessageIngestionType;
MessageQueueChain: MessageQueueChain;
MessagingStateSnapshot: MessagingStateSnapshot;
@@ -2291,7 +2329,10 @@ declare module '@polkadot/types/types/registry' {
OutboundHrmpMessage: OutboundHrmpMessage;
OutboundStatus: OutboundStatus;
Outcome: Outcome;
OverweightIndex: OverweightIndex;
Owner: Owner;
PageCounter: PageCounter;
PageIndexData: PageIndexData;
PalletId: PalletId;
PalletsOrigin: PalletsOrigin;
PalletVersion: PalletVersion;
@@ -2367,6 +2408,9 @@ declare module '@polkadot/types/types/registry' {
RawBabePreDigestTo159: RawBabePreDigestTo159;
RawOrigin: RawOrigin;
RawSolution: RawSolution;
RawSolutionTo265: RawSolutionTo265;
RawSolutionWith16: RawSolutionWith16;
RawSolutionWith24: RawSolutionWith24;
RawVRFOutput: RawVRFOutput;
ReadProof: ReadProof;
ReadySolution: ReadySolution;
@@ -2405,6 +2449,7 @@ declare module '@polkadot/types/types/registry' {
RuntimeDispatchInfo: RuntimeDispatchInfo;
RuntimeVersion: RuntimeVersion;
RuntimeVersionApi: RuntimeVersionApi;
RuntimeVersionPartial: RuntimeVersionPartial;
Schedule: Schedule;
Scheduled: Scheduled;
ScheduledTo254: ScheduledTo254;
+1 -3
View File
@@ -62,8 +62,6 @@ function decodeAbstractInt (value: AnyNumber, bitLength: UIntBitLength, isNegati
* @ignore
* @noInheritDoc
*/
// TODO:
// - Apart from encoding/decoding we don't actually keep check on the sizes, is this good enough?
export abstract class AbstractInt extends BN implements Codec {
public readonly registry: Registry;
@@ -140,7 +138,7 @@ export abstract class AbstractInt extends BN implements Codec {
* @description True if this value is the max of the type
*/
public isMax (): boolean {
const u8a = this.toU8a().filter((byte): boolean => byte === 0xff);
const u8a = this.toU8a().filter((b) => b === 0xff);
return u8a.length === (this.#bitLength / 8);
}
+1 -1
View File
@@ -96,7 +96,7 @@ export class Compact<T extends CompactEncodable> implements ICompact<T> {
* @description Returns a BigInt representation of the number
*/
public toBigInt (): bigint {
return BigInt(this.toString());
return this.#raw.toBigInt();
}
/**
+16 -17
View File
@@ -11,6 +11,20 @@ import { bnToBn, bnToHex, bnToU8a, isString, isU8a, u8aToBn } from '@polkadot/ut
const BITLENGTH: UIntBitLength = 64;
function decodeDate (value: CodecDate | Date | AnyNumber): Date {
if (value instanceof Date) {
return value;
} else if (isU8a(value)) {
value = u8aToBn(value.subarray(0, BITLENGTH / 8), true);
} else if (isString(value)) {
value = new BN(value.toString(), 10, 'le');
}
return new Date(
bnToBn(value as BN).toNumber() * 1000
);
}
/**
* @name Date
* @description
@@ -27,26 +41,11 @@ export class CodecDate extends Date implements Codec {
public createdAtHash?: Hash;
constructor (registry: Registry, value: CodecDate | Date | AnyNumber = 0) {
super(CodecDate.decodeDate(value));
super(decodeDate(value));
this.registry = registry;
}
/** @internal */
public static decodeDate (value: CodecDate | Date | AnyNumber | unknown): Date {
if (value instanceof Date) {
return value;
} else if (isU8a(value)) {
value = u8aToBn(value.subarray(0, BITLENGTH / 8), true);
} else if (isString(value)) {
value = new BN(value.toString(), 10, 'le');
}
return new Date(
bnToBn(value as BN).toNumber() * 1000
);
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
@@ -72,7 +71,7 @@ export class CodecDate extends Date implements Codec {
* @description Compares the value of the input to see if there is a match
*/
public eq (other?: unknown): boolean {
return CodecDate.decodeDate(other).getTime() === this.getTime();
return decodeDate(other as AnyNumber).getTime() === this.getTime();
}
/**
+2 -2
View File
@@ -81,7 +81,7 @@ export class Json extends Map<string, any> implements Codec {
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
*/
public toHuman (): Record<string, AnyJson> {
return [...this.entries()].reduce((json: Record<string, AnyJson>, [key, value]): Record<string, AnyJson> => {
return [...this.entries()].reduce<Record<string, AnyJson>>((json, [key, value]): Record<string, AnyJson> => {
json[key] = isFunction((value as Codec).toHuman)
? (value as Codec).toHuman()
: value as AnyJson;
@@ -94,7 +94,7 @@ export class Json extends Map<string, any> implements Codec {
* @description Converts the Object to JSON, typically used for RPC transfers
*/
public toJSON (): Record<string, AnyJson> {
return [...this.entries()].reduce((json: Record<string, AnyJson>, [key, value]): Record<string, AnyJson> => {
return [...this.entries()].reduce<Record<string, AnyJson>>((json, [key, value]): Record<string, AnyJson> => {
json[key] = value as AnyJson;
return json;
+5 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '../create';
import { Text } from '../primitive';
import { Text, u16 } from '../primitive';
import { VecFixed } from '.';
describe('VecFixed', (): void => {
@@ -17,6 +17,10 @@ describe('VecFixed', (): void => {
expect(new VecFixed(registry, Text, 2, new Uint8Array([0x00, 0x04, 0x31])).toHex()).toEqual('0x000431');
});
it('constructs via hex', (): void => {
expect(new VecFixed(registry, u16, 2, '0x12345678').toHex()).toEqual('0x12345678');
});
it('decodes reusing instance inputs', (): void => {
const foo = new Text(registry, 'bar');
+21 -21
View File
@@ -3,12 +3,31 @@
import type { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import { assert, compactToU8a, isU8a, u8aConcat } from '@polkadot/util';
import { assert, compactToU8a, isHex, isU8a, u8aConcat } from '@polkadot/util';
import { AbstractArray } from './AbstractArray';
import { typeToConstructor } from './utils';
import { Vec } from './Vec';
/** @internal */
function decodeVecFixed<T extends Codec> (registry: Registry, Type: Constructor<T>, allocLength: number, value: VecFixed<any> | Uint8Array | string | any[]): T[] {
const values = Vec.decodeVec(
registry,
Type,
isU8a(value) || isHex(value)
? u8aConcat(compactToU8a(allocLength), value)
: value
);
while (values.length < allocLength) {
values.push(new Type(registry));
}
assert(values.length === allocLength, () => `Expected a length of exactly ${allocLength} entries`);
return values;
}
/**
* @name VecFixed
* @description
@@ -20,30 +39,11 @@ export class VecFixed<T extends Codec> extends AbstractArray<T> {
constructor (registry: Registry, Type: Constructor<T> | keyof InterfaceTypes, length: number, value: VecFixed<any> | Uint8Array | string | any[] = [] as any[]) {
const Clazz = typeToConstructor<T>(registry, Type);
super(registry, ...VecFixed.decodeVecFixed(registry, Clazz, length, value));
super(registry, ...decodeVecFixed(registry, Clazz, length, value));
this._Type = Clazz;
}
/** @internal */
public static decodeVecFixed<T extends Codec> (registry: Registry, Type: Constructor<T>, allocLength: number, value: VecFixed<any> | Uint8Array | string | any[]): T[] {
const values = Vec.decodeVec(
registry,
Type,
isU8a(value)
? u8aConcat(compactToU8a(allocLength), value)
: value
);
while (values.length < allocLength) {
values.push(new Type(registry));
}
assert(values.length === allocLength, () => `Expected a length of exactly ${allocLength} entries`);
return values;
}
public static with<O extends Codec> (Type: Constructor<O> | keyof InterfaceTypes, length: number): Constructor<VecFixed<O>> {
return class extends VecFixed<O> {
constructor (registry: Registry, value?: any[]) {
+1
View File
@@ -6,6 +6,7 @@ import type { Codec } from '../types';
export interface CompactEncodable extends Codec {
bitLength (): number;
toBigInt (): bigint;
toBn (): BN;
toNumber (): number;
}
@@ -122,6 +122,38 @@ describe('createType', (): void => {
).toEqual(new Uint8Array([0x00, 0x12, 0x00, 0x23, 0x00, 0x45, 0x00, 0x67]));
});
describe('isPedantic', (): void => {
it('correctly decodes Bytes', (): void => {
expect(
createTypeUnsafe(registry, 'Bytes', ['0x12345678'], { isPedantic: true }).toHex()
).toEqual('0x12345678');
});
it('correctly decodes Bytes (prefixed)', (): void => {
expect(
createTypeUnsafe(registry, 'Bytes', [new Uint8Array([4 << 2, 0x12, 0x34, 0x56, 0x78])], { isPedantic: true }).toHex()
).toEqual('0x12345678');
});
it('correctly decodes Text', (): void => {
expect(
createTypeUnsafe(registry, 'Text', ['0x70726f7669646572'], { isPedantic: true }).toString()
).toEqual('provider');
});
it('correctly decodes Type', (): void => {
expect(
createTypeUnsafe(registry, 'Type', ['0x5665633c75383e'], { isPedantic: true }).toString()
).toEqual('Bytes'); // Vec<u8> -> Bytes
});
it('correctly decodes [u16; 4]', (): void => {
expect(
createTypeUnsafe(registry, '[u16; 4]', ['0x0012002300450067'], { isPedantic: true }).toHex()
).toEqual('0x0012002300450067');
});
});
describe('instanceof', (): void => {
it('instanceof should work (primitive type)', (): void => {
const value = registry.createType('Balance', 1234);
+11 -9
View File
@@ -1,6 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Bytes } from '../primitive/Bytes';
import type { Codec, Constructor, InterfaceTypes, Registry } from '../types';
import type { FromReg } from './types';
@@ -15,15 +16,18 @@ interface CreateOptions {
// With isPedantic, actually check that the encoding matches that supplied. This
// is much slower, but verifies that we have the correct types defined
// eslint-disable-next-line @typescript-eslint/ban-types
function checkInstance<T extends Codec = Codec, K extends string = string> (value: Uint8Array, created: FromReg<T, K>): void {
const u8a = created.toU8a();
const rawType = created.toRawType();
const isEqual = rawType === 'Bytes'
? value.length === u8a.length
: u8aEq(value, u8a);
assert(isEqual, () => `${rawType}:: Decoded input doesn't match input, received ${u8aToHex(value, 512)} (${value.length} bytes), created ${u8aToHex(u8a, 512)} (${u8a.length} bytes)`);
assert(
u8aEq(value, u8a) || (
// when length-prefixed from hex, just check the actual length
['Bytes', 'Text', 'Type'].includes(rawType) &&
value.length === (created as Bytes).length
),
() => `${rawType}:: Decoded input doesn't match input, received ${u8aToHex(value, 512)} (${value.length} bytes), created ${u8aToHex(u8a, 512)} (${u8a.length} bytes)`
);
}
// Initializes a type with a value. This also checks for fallbacks and in the cases
@@ -50,10 +54,8 @@ function initType<T extends Codec = Codec, K extends string = string> (registry:
// An unsafe version of the `createType` below. It's unsafe because the `type`
// argument here can be any string, which, when it cannot parse, will yield a
// runtime error.
export function createTypeUnsafe<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K, params: any[] = [], options: CreateOptions = {}): T {
export function createTypeUnsafe<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K, params: unknown[] = [], options: CreateOptions = {}): T {
try {
// Circle back to isPedantic when it handles all cases 100% - as of now,
// it provides false warning which is more hinderance than help
return initType(registry, createClass<T, K>(registry, type), params, options);
} catch (error) {
throw new Error(`createType(${type}):: ${(error as Error).message}`);
@@ -66,6 +68,6 @@ export function createTypeUnsafe<T extends Codec = Codec, K extends string = str
* instance from
* @param params - The value to instantiate the type with
*/
export function createType<K extends keyof InterfaceTypes> (registry: Registry, type: K, ...params: any[]): InterfaceTypes[K] {
export function createType<K extends keyof InterfaceTypes> (registry: Registry, type: K, ...params: unknown[]): InterfaceTypes[K] {
return createTypeUnsafe<InterfaceTypes[K], K>(registry, type, params);
}
+25 -11
View File
@@ -1,32 +1,32 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { alias, removeColons } from './sanitize';
import { alias, removeBounded, removeColons } from './sanitize';
describe('sanitize', (): void => {
describe('alias', (): void => {
const exec = alias('String', 'Text');
const fn = alias('String', 'Text');
it('replaces all occurrences for types', (): void => {
expect(exec('(String,Address,MasterString,String)')).toEqual(
expect(fn('(String,Address,MasterString,String)')).toEqual(
'(Text,Address,MasterString,Text)'
);
});
it('replaces actual types, but leaves struct names', (): void => {
expect(exec('{"system":"String","versionString":"String"}')).toEqual(
expect(fn('{"system":"String","versionString":"String"}')).toEqual(
'{"system":"Text","versionString":"Text"}'
);
});
it('handles the preceding correctly', (): void => {
// NOTE This type doesn't make sense
expect(exec('String String (String,[String;32],String)"String<String>')).toEqual(
expect(fn('String String (String,[String;32],String)"String<String>')).toEqual(
'Text Text (Text,[Text;32],Text)"Text<Text>'
);
});
it('handles emdedded Vec/Tuples', (): void => {
it('handles embedded Vec/Tuples', (): void => {
const ann = alias('Announcement', 'ProxyAnnouncement');
expect(ann('(Vec<Announcement>,BalanceOf)')).toEqual(
@@ -36,24 +36,38 @@ describe('sanitize', (): void => {
});
describe('removeColons', (): void => {
const fn = removeColons();
it('removes preceding ::Text -> Text', (): void => {
expect(removeColons()('::Text')).toEqual('Text');
expect(fn('::Text')).toEqual('Text');
});
it('removes middle voting::TallyType -> TallyType', (): void => {
expect(removeColons()('voting::TallyType')).toEqual('TallyType');
expect(fn('voting::TallyType')).toEqual('TallyType');
});
it('removes on embedded values (one)', (): void => {
expect(removeColons()('(T::AccountId, SpanIndex)')).toEqual('(AccountId, SpanIndex)');
expect(fn('(T::AccountId, SpanIndex)')).toEqual('(AccountId, SpanIndex)');
});
it('removes on embedded values (all)', (): void => {
expect(removeColons()('(T::AccountId, slashing::SpanIndex)')).toEqual('(AccountId, SpanIndex)');
expect(fn('(T::AccountId, slashing::SpanIndex)')).toEqual('(AccountId, SpanIndex)');
});
it('keeps with allowNamespaces', (): void => {
expect(removeColons()('::slashing::SpanIndex', { allowNamespaces: true })).toEqual('slashing::SpanIndex');
expect(fn('::slashing::SpanIndex', { allowNamespaces: true })).toEqual('slashing::SpanIndex');
});
});
describe('bounded', (): void => {
const fn = removeBounded();
it('correctly cleans up bounded values', (): void => {
expect(fn('BoundedVec<u32, 256>')).toEqual('Vec<u32>');
});
it('correctly cleans up nested bounded values', (): void => {
expect(fn('BoundedBTreeMap<BoundedVec<BoundedVec<u32, 1>, 2>, BoundedBTreeSet<u32, BoundedVec<u64, 3>, 4>, 5>')).toEqual('BTreeMap<Vec<Vec<u32>>, BTreeSet<u32, Vec<u64>>>');
});
});
});
+28 -21
View File
@@ -7,7 +7,8 @@ interface SanitizeOptions {
type Mapper = (value: string, options?: SanitizeOptions) => string;
const ALLOWED_BOXES = ['BTreeMap', 'BTreeSet', 'Compact', 'DoNotConstruct', 'HashMap', 'Int', 'Linkage', 'Result', 'Option', 'UInt', 'Vec'];
const BOUNDED = ['BTreeMap', 'BTreeSet', 'HashMap', 'Vec'];
const ALLOWED_BOXES = BOUNDED.concat(['Compact', 'DoNotConstruct', 'Int', 'Linkage', 'Result', 'Option', 'UInt']);
const BOX_PRECEDING = ['<', '(', '[', '"', ',', ' ']; // start of vec, tuple, fixed array, part of struct def or in tuple
const mappings: Mapper[] = [
@@ -17,7 +18,7 @@ const mappings: Mapper[] = [
// <T::Balance as HasCompact>
cleanupCompact(),
// Change BoundedVec<Type, Size> to Vec<Type>
removeBoundedVec(),
removeBounded(),
// Remove all the trait prefixes
removeTraits(),
// remove PairOf<T> -> (T, T)
@@ -77,14 +78,12 @@ export function alias (src: string, dest: string, withChecks = true): Mapper {
export function cleanupCompact (): Mapper {
return (value: string): string => {
for (let index = 0; index < value.length; index++) {
if (value[index] !== '<') {
continue;
}
if (value[index] === '<') {
const end = findClosing(value, index + 1) - 14;
const end = findClosing(value, index + 1) - 14;
if (value.substr(end, 14) === ' as HasCompact') {
value = `Compact<${value.substr(index + 1, end - index - 1)}>`;
if (value.substr(end, 14) === ' as HasCompact') {
value = `Compact<${value.substr(index + 1, end - index - 1)}>`;
}
}
}
@@ -98,24 +97,32 @@ export function flattenSingleTuple (): Mapper {
}
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);
let index = -1;
value = `${value.substr(0, index)}${replacer(value.substr(start, end - start))}${value.substr(end + 1)}`;
while (true) {
index = value.indexOf(matcher, index + 1);
if (index === -1) {
return value;
}
}
return value;
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)}`;
}
}
// remove the BoundedVec wrappers
export function removeBoundedVec (): Mapper {
const replacer = (inner: string) => `Vec<${inner.split(',')[0]}>`;
// remove the Bounded* wrappers
export function removeBounded (): Mapper {
return (value: string) =>
replaceTagWith(value, 'BoundedVec<', replacer);
BOUNDED.reduce((value, tag) =>
replaceTagWith(value, `Bounded${tag}<`, (inner: string): string => {
const parts = inner.split(',');
return `${tag}<${parts.filter((_, i) => i !== parts.length - 1).join(',')}>`;
}), value
);
}
export function removeColons (): Mapper {
@@ -15,7 +15,7 @@ export default {
{
name: 'hash',
type: 'BlockHash',
isCached: true,
isHistoric: true,
isOptional: true
}
],
@@ -0,0 +1,28 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { Definitions } from '../../types';
const dmpQueue = {
ConfigData: {
maxIndividual: 'Weight'
},
MessageId: '[u8; 32]',
OverweightIndex: 'u64',
PageCounter: 'u32',
PageIndexData: {
beginUsed: 'PageCounter',
endUsed: 'PageCounter',
overweightCount: 'OverweightIndex'
}
};
export default {
rpc: {},
types: {
...dmpQueue
}
} as Definitions;
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export * from './types';
@@ -0,0 +1,28 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Struct, U8aFixed, u32, u64 } from '@polkadot/types';
import type { Weight } from '@polkadot/types/interfaces/runtime';
/** @name ConfigData */
export interface ConfigData extends Struct {
readonly maxIndividual: Weight;
}
/** @name MessageId */
export interface MessageId extends U8aFixed {}
/** @name OverweightIndex */
export interface OverweightIndex extends u64 {}
/** @name PageCounter */
export interface PageCounter extends u32 {}
/** @name PageIndexData */
export interface PageIndexData extends Struct {
readonly beginUsed: PageCounter;
readonly endUsed: PageCounter;
readonly overweightCount: OverweightIndex;
}
export type PHANTOM_CUMULUS = 'cumulus';
+2 -1
View File
@@ -10,6 +10,7 @@ export { default as authorship } from './authorship/definitions';
export { default as aura } from './aura/definitions';
export { default as babe } from './babe/definitions';
export { default as balances } from './balances/definitions';
export { default as beefy } from './beefy/definitions';
export { default as collective } from './collective/definitions';
export { default as consensus } from './consensus/definitions';
export { default as contracts } from './contracts/definitions';
@@ -42,9 +43,9 @@ export { default as vesting } from './vesting/definitions';
// polkadot-specific types
export { default as attestations } from './attestations/definitions';
export { default as beefy } from './beefy/definitions';
export { default as claims } from './claims/definitions';
export { default as crowdloan } from './crowdloan/definitions';
export { default as cumulus } from './cumulus/definitions';
export { default as parachains } from './parachains/definitions';
export { default as poll } from './poll/definitions';
export { default as purchase } from './purchase/definitions';
@@ -84,6 +84,11 @@ export default {
extrinsicsRoot: 'Hash',
digest: 'Digest'
},
HeaderPartial: {
parentHash: 'Hash',
// since we only parse JSON with this, having non-compact works
number: 'BlockNumber'
},
IndicesLookupSource: 'GenericLookupSource',
Index: 'u32',
Justification: '(ConsensusEngineId, EncodedJustification)',
@@ -152,6 +152,12 @@ export interface Header extends Struct {
readonly digest: Digest;
}
/** @name HeaderPartial */
export interface HeaderPartial extends Struct {
readonly parentHash: Hash;
readonly number: BlockNumber;
}
/** @name I32F32 */
export interface I32F32 extends Int {}
@@ -148,7 +148,7 @@ describe('CompactAssignmentSiNormal', (): void => {
]);
const registry = new TypeRegistry();
const compact = registry.createType('CompactAssignments', bytes);
const compact = registry.createType('CompactAssignmentsWith16', bytes);
expect(compact.toJSON()).toEqual({
votes1: [[2, 20], [4, 40]],
@@ -15,7 +15,8 @@ const deprecated = {
};
const phragmen = {
CompactAssignments: {
CompactAssignments: 'CompactAssignmentsWith24',
CompactAssignmentsWith16: {
votes1: 'Vec<(NominatorIndexCompact, ValidatorIndexCompact)>',
votes2: 'Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>',
votes3: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>',
@@ -33,6 +34,33 @@ const phragmen = {
votes15: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>',
votes16: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>'
},
CompactAssignmentsWith24: {
votes1: 'Vec<(NominatorIndexCompact, ValidatorIndexCompact)>',
votes2: 'Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>',
votes3: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>',
votes4: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>',
votes5: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>',
votes6: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>',
votes7: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>',
votes8: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>',
votes9: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>',
votes10: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>',
votes11: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>',
votes12: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>',
votes13: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>',
votes14: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>',
votes15: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>',
votes16: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>',
votes17: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 16], ValidatorIndexCompact)>',
votes18: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 17], ValidatorIndexCompact)>',
votes19: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 18], ValidatorIndexCompact)>',
votes20: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 19], ValidatorIndexCompact)>',
votes21: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 20], ValidatorIndexCompact)>',
votes22: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 21], ValidatorIndexCompact)>',
votes23: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 22], ValidatorIndexCompact)>',
votes24: 'Vec<(NominatorIndexCompact, [CompactScoreCompact; 23], ValidatorIndexCompact)>'
},
CompactAssignmentsTo265: 'CompactAssignmentsWith16',
CompactAssignmentsTo257: {
votes1: 'Vec<(NominatorIndex, [CompactScore; 0], ValidatorIndex)>',
votes2: 'Vec<(NominatorIndex, [CompactScore; 1], ValidatorIndex)>',
@@ -83,11 +111,18 @@ const phragmen = {
}
},
ExtendedBalance: 'u128',
RawSolution: {
compact: 'CompactAssignments',
RawSolution: 'RawSolutionWith24',
RawSolutionWith16: {
compact: 'CompactAssignmentsWith16',
score: 'ElectionScore',
round: 'u32'
},
RawSolutionWith24: {
compact: 'CompactAssignmentsWith24',
score: 'ElectionScore',
round: 'u32'
},
RawSolutionTo265: 'RawSolutionWith16',
ReadySolution: {
supports: 'SolutionSupports',
score: 'ElectionScore',
+67 -20
View File
@@ -12,24 +12,7 @@ export interface ActiveEraInfo extends Struct {
}
/** @name CompactAssignments */
export interface CompactAssignments extends Struct {
readonly votes1: Vec<ITuple<[NominatorIndexCompact, ValidatorIndexCompact]>>;
readonly votes2: Vec<ITuple<[NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact]>>;
readonly votes3: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes4: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes5: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes6: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes7: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes8: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes9: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes10: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes11: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes12: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes13: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes14: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes15: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes16: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
}
export interface CompactAssignments extends CompactAssignmentsWith24 {}
/** @name CompactAssignmentsTo257 */
export interface CompactAssignmentsTo257 extends Struct {
@@ -51,6 +34,57 @@ export interface CompactAssignmentsTo257 extends Struct {
readonly votes16: Vec<ITuple<[NominatorIndex, Vec<CompactScore>, ValidatorIndex]>>;
}
/** @name CompactAssignmentsTo265 */
export interface CompactAssignmentsTo265 extends CompactAssignmentsWith16 {}
/** @name CompactAssignmentsWith16 */
export interface CompactAssignmentsWith16 extends Struct {
readonly votes1: Vec<ITuple<[NominatorIndexCompact, ValidatorIndexCompact]>>;
readonly votes2: Vec<ITuple<[NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact]>>;
readonly votes3: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes4: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes5: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes6: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes7: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes8: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes9: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes10: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes11: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes12: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes13: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes14: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes15: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes16: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
}
/** @name CompactAssignmentsWith24 */
export interface CompactAssignmentsWith24 extends Struct {
readonly votes1: Vec<ITuple<[NominatorIndexCompact, ValidatorIndexCompact]>>;
readonly votes2: Vec<ITuple<[NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact]>>;
readonly votes3: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes4: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes5: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes6: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes7: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes8: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes9: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes10: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes11: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes12: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes13: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes14: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes15: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes16: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes17: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes18: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes19: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes20: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes21: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes22: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes23: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
readonly votes24: Vec<ITuple<[NominatorIndexCompact, Vec<CompactScoreCompact>, ValidatorIndexCompact]>>;
}
/** @name CompactScore */
export interface CompactScore extends ITuple<[ValidatorIndex, OffchainAccuracy]> {}
@@ -173,8 +207,21 @@ export interface PhragmenScore extends Vec<u128> {}
export interface Points extends u32 {}
/** @name RawSolution */
export interface RawSolution extends Struct {
readonly compact: CompactAssignments;
export interface RawSolution extends RawSolutionWith24 {}
/** @name RawSolutionTo265 */
export interface RawSolutionTo265 extends RawSolutionWith16 {}
/** @name RawSolutionWith16 */
export interface RawSolutionWith16 extends Struct {
readonly compact: CompactAssignmentsWith16;
readonly score: ElectionScore;
readonly round: u32;
}
/** @name RawSolutionWith24 */
export interface RawSolutionWith24 extends Struct {
readonly compact: CompactAssignmentsWith24;
readonly score: ElectionScore;
readonly round: u32;
}
@@ -256,7 +256,7 @@ export default {
{
name: 'at',
type: 'BlockHash',
isCached: true,
isHistoric: true,
isOptional: true
}
],
@@ -269,7 +269,7 @@ export default {
{
name: 'at',
type: 'BlockHash',
isCached: true,
isHistoric: true,
isOptional: true
}
],
@@ -412,6 +412,10 @@ export default {
apis: 'Vec<RuntimeVersionApi>',
transactionVersion: 'u32'
},
RuntimeVersionPartial: {
specName: 'Text',
specVersion: 'u32'
},
StorageChangeSet: {
block: 'Hash',
changes: 'Vec<KeyValueOption>'
@@ -62,6 +62,12 @@ export interface RuntimeVersion extends Struct {
/** @name RuntimeVersionApi */
export interface RuntimeVersionApi extends ITuple<[ApiId, u32]> {}
/** @name RuntimeVersionPartial */
export interface RuntimeVersionPartial extends Struct {
readonly specName: Text;
readonly specVersion: u32;
}
/** @name StorageChangeSet */
export interface StorageChangeSet extends Struct {
readonly block: Hash;
@@ -161,6 +161,13 @@ export default {
data: 'AccountData'
},
ApplyExtrinsicResult: 'Result<DispatchOutcome, TransactionValidityError>',
ArithmeticError: {
_enum: [
'Underflow',
'Overflow',
'DivisionByZero'
]
},
BlockLength: {
max: 'PerDispatchClassU32'
},
@@ -191,7 +198,8 @@ export default {
Module: 'DispatchErrorModule',
ConsumerRemaining: 'Null',
NoProviders: 'Null',
Token: 'TokenError'
Token: 'TokenError',
Arithmetic: 'ArithmeticError'
}
},
DispatchErrorModule: {
@@ -358,6 +366,8 @@ export default {
'CannotCreate',
'UnknownAsset',
'Frozen',
// these are dropped, but still in older versions
// (if this adjusts, will need to take a re-look)
'Underflow',
'Overflow'
]
@@ -48,6 +48,13 @@ export interface ApplyExtrinsicResult extends Result<DispatchOutcome, Transactio
readonly asOk: DispatchOutcome;
}
/** @name ArithmeticError */
export interface ArithmeticError extends Enum {
readonly isUnderflow: boolean;
readonly isOverflow: boolean;
readonly isDivisionByZero: boolean;
}
/** @name BlockLength */
export interface BlockLength extends Struct {
readonly max: PerDispatchClassU32;
@@ -96,6 +103,8 @@ export interface DispatchError extends Enum {
readonly isNoProviders: boolean;
readonly isToken: boolean;
readonly asToken: TokenError;
readonly isArithmetic: boolean;
readonly asArithmetic: ArithmeticError;
}
/** @name DispatchErrorModule */
+2 -1
View File
@@ -7,6 +7,7 @@ export * from './authorship/types';
export * from './aura/types';
export * from './babe/types';
export * from './balances/types';
export * from './beefy/types';
export * from './collective/types';
export * from './consensus/types';
export * from './contracts/types';
@@ -37,9 +38,9 @@ export * from './txpayment/types';
export * from './utility/types';
export * from './vesting/types';
export * from './attestations/types';
export * from './beefy/types';
export * from './claims/types';
export * from './crowdloan/types';
export * from './cumulus/types';
export * from './parachains/types';
export * from './poll/types';
export * from './purchase/types';
+1 -1
View File
@@ -3,4 +3,4 @@
// Auto-generated by @polkadot/dev, do not edit
export const packageInfo = { name: '@polkadot/types', version: '4.9.1' };
export const packageInfo = { name: '@polkadot/types', version: '4.10.1' };
+5 -2
View File
@@ -5,13 +5,13 @@ import type { CodecTo } from '../types';
import { Raw } from '../codec/Raw';
import { TypeRegistry } from '../create';
import { Text } from '.';
import { Bytes, Text } from '.';
describe('Text', (): void => {
const registry = new TypeRegistry();
describe('decode', (): void => {
const testDecode = (type: string, input: null | string | Uint8Array | { toString: () => string }, expected: string, toFn: 'toString' | 'toHex' = 'toString'): void =>
const testDecode = (type: string, input: null | string | Uint8Array | { toString: () => string }, expected: string, toFn: 'toString' | 'toHex' | 'toHuman' = 'toString'): void =>
it(`can decode from ${type}`, (): void => {
expect(new Text(registry, input)[toFn]()).toBe(expected);
});
@@ -20,6 +20,9 @@ describe('Text', (): void => {
testDecode('Text', new Text(registry, 'foo'), 'foo');
testDecode('Uint8Array', Uint8Array.from([12, 102, 111, 111]), 'foo');
testDecode('Raw', new Raw(registry, Uint8Array.from([102, 111, 111])), 'foo'); // no length
testDecode('Raw', new Raw(registry, Uint8Array.from([102, 111, 111])), 'foo', 'toHuman'); // no length
testDecode('Bytes', new Bytes(registry, Uint8Array.from([12, 102, 111, 111])), 'foo'); // length-aware encoding
testDecode('Bytes', new Bytes(registry, Uint8Array.from([12, 102, 111, 111])), 'foo', 'toHuman'); // length-aware encoding
testDecode('object with `toString()`', { toString (): string { return 'foo'; } }, 'foo');
testDecode('hex input value', new Text(registry, '0x12345678'), '0x12345678', 'toHex');
testDecode('null', null, '');
+1 -1
View File
@@ -109,7 +109,7 @@ export class Text extends String implements Codec {
* @description Returns a hex string representation of the value
*/
public toHex (): string {
// like with Vec<u8>, when we are encoding to hex, we don't actually add
// like with Vec<u8>, when we are encoding to hex, we don't actually add
// the length prefix (it is already implied by the actual string length)
return u8aToHex(this.toU8a(true));
}
-1
View File
@@ -12,7 +12,6 @@ export type DefinitionTypeStruct = Record<string, DefinitionTypeType> | { _alias
export type DefinitionType = string | DefinitionTypeEnum | DefinitionTypeSet | DefinitionTypeStruct;
export interface DefinitionRpcParam {
isCached?: boolean;
isHistoric?: boolean;
isOptional?: boolean;
name: string;
+253 -253
View File
@@ -57,37 +57,37 @@ __metadata:
languageName: node
linkType: hard
"@babel/core@npm:7.14.0, @babel/core@npm:^7.1.0, @babel/core@npm:^7.14.0, @babel/core@npm:^7.7.5":
version: 7.14.0
resolution: "@babel/core@npm:7.14.0"
"@babel/core@npm:7.14.2, @babel/core@npm:^7.1.0, @babel/core@npm:^7.14.0, @babel/core@npm:^7.14.2, @babel/core@npm:^7.7.5":
version: 7.14.2
resolution: "@babel/core@npm:7.14.2"
dependencies:
"@babel/code-frame": ^7.12.13
"@babel/generator": ^7.14.0
"@babel/generator": ^7.14.2
"@babel/helper-compilation-targets": ^7.13.16
"@babel/helper-module-transforms": ^7.14.0
"@babel/helper-module-transforms": ^7.14.2
"@babel/helpers": ^7.14.0
"@babel/parser": ^7.14.0
"@babel/parser": ^7.14.2
"@babel/template": ^7.12.13
"@babel/traverse": ^7.14.0
"@babel/types": ^7.14.0
"@babel/traverse": ^7.14.2
"@babel/types": ^7.14.2
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: eccd8c6acf33a2782b9213bffc0e766857c9b690649512c3a525a02bb212301c6fdf314d6e7f7404479dc9631beb58a8f5e673ea9f3c1964853a3c65b045a382
checksum: 16dc0a52484da794afc69ac7f13721b7cf2f7e17db6467a36f19fef24fa59a8cea1524faa260d0c05f5a99836fb65acf076cf15abf6846fc66f6c142a94a8327
languageName: node
linkType: hard
"@babel/generator@npm:^7.14.0":
version: 7.14.0
resolution: "@babel/generator@npm:7.14.0"
"@babel/generator@npm:^7.14.2":
version: 7.14.2
resolution: "@babel/generator@npm:7.14.2"
dependencies:
"@babel/types": ^7.14.0
"@babel/types": ^7.14.2
jsesc: ^2.5.1
source-map: ^0.5.0
checksum: ef47e0f9b7b78124e43e1cae8b46570c67022379e52b03f50e121c0cb5aaec9ca7063182417249786a53f4a18f9725bbd7532c31002be575f4b79c0f0d04430d
checksum: eacc93d3446dec6fac064cd884ac6e2ecbcfed65f8de069da72855a8124d33004a9dc9f06833e18fae2e352929c493b46035785f948549d2e9d503af0bef8a79
languageName: node
linkType: hard
@@ -179,14 +179,14 @@ __metadata:
languageName: node
linkType: hard
"@babel/helper-function-name@npm:^7.12.13":
version: 7.12.13
resolution: "@babel/helper-function-name@npm:7.12.13"
"@babel/helper-function-name@npm:^7.12.13, @babel/helper-function-name@npm:^7.14.2":
version: 7.14.2
resolution: "@babel/helper-function-name@npm:7.14.2"
dependencies:
"@babel/helper-get-function-arity": ^7.12.13
"@babel/template": ^7.12.13
"@babel/types": ^7.12.13
checksum: 25f03f303be790618437dc49c6df758d362112a564361d2eae66b58fda4f5ec09e62875473b18090b939c8d3d60b36aa7c9f688768b7fade511512d02ac9d3d0
"@babel/types": ^7.14.2
checksum: 36bf5e4126b5bdf7c7e686ca487f9a91857d723d457a2608645d10ed7b0ba3da0c0e0cd0b31efe71091ea80656bf98578e3bad50c6c7fab771fd5de439aeebad
languageName: node
linkType: hard
@@ -227,9 +227,9 @@ __metadata:
languageName: node
linkType: hard
"@babel/helper-module-transforms@npm:^7.13.0, @babel/helper-module-transforms@npm:^7.14.0":
version: 7.14.0
resolution: "@babel/helper-module-transforms@npm:7.14.0"
"@babel/helper-module-transforms@npm:^7.13.0, @babel/helper-module-transforms@npm:^7.14.0, @babel/helper-module-transforms@npm:^7.14.2":
version: 7.14.2
resolution: "@babel/helper-module-transforms@npm:7.14.2"
dependencies:
"@babel/helper-module-imports": ^7.13.12
"@babel/helper-replace-supers": ^7.13.12
@@ -237,9 +237,9 @@ __metadata:
"@babel/helper-split-export-declaration": ^7.12.13
"@babel/helper-validator-identifier": ^7.14.0
"@babel/template": ^7.12.13
"@babel/traverse": ^7.14.0
"@babel/types": ^7.14.0
checksum: 1049a94cc74247c8ae4f5a804b4a0713ab4ad8f69eb412ea99ac1d03b4a9b9df3d1481286fa5e503239473ffb81dbb4f029d05cc681eff4d5380ae67161ac916
"@babel/traverse": ^7.14.2
"@babel/types": ^7.14.2
checksum: c0a543a2149d15ad9c129f002cb01974c79a16ea10de9e3f9b7a296f2bbe3deaef9457acf6b9d2238e9629d5e98964539d28843cdd4d328b115f559871ccf533
languageName: node
linkType: hard
@@ -357,12 +357,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.14.0":
version: 7.14.0
resolution: "@babel/parser@npm:7.14.0"
"@babel/parser@npm:^7.0.0, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.12.13, @babel/parser@npm:^7.14.2":
version: 7.14.2
resolution: "@babel/parser@npm:7.14.2"
bin:
parser: ./bin/babel-parser.js
checksum: ef6165f3038b9f8761a02768ab14034f4935baf2e050a2924aa093f54e3164732bce7fee81b3c8ff3be03048091e4ea208a72b23a3715debf7fd06b79495c9e9
checksum: 18dffc18a2c15f8877988c9b5a46c87f1763e8a383c3210c9b5b651955b1ac46dc54da27acc09acd7fb917f37e0bd92b8985dc4c9d7f1e750dfccbcea730aa0e
languageName: node
linkType: hard
@@ -1360,7 +1360,7 @@ __metadata:
languageName: node
linkType: hard
"@babel/runtime@npm:^7.13.17, @babel/runtime@npm:^7.13.9, @babel/runtime@npm:^7.14.0, @babel/runtime@npm:^7.8.4":
"@babel/runtime@npm:^7.13.9, @babel/runtime@npm:^7.14.0, @babel/runtime@npm:^7.8.4":
version: 7.14.0
resolution: "@babel/runtime@npm:7.14.0"
dependencies:
@@ -1380,29 +1380,29 @@ __metadata:
languageName: node
linkType: hard
"@babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.14.0":
version: 7.14.0
resolution: "@babel/traverse@npm:7.14.0"
"@babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.14.0, @babel/traverse@npm:^7.14.2":
version: 7.14.2
resolution: "@babel/traverse@npm:7.14.2"
dependencies:
"@babel/code-frame": ^7.12.13
"@babel/generator": ^7.14.0
"@babel/helper-function-name": ^7.12.13
"@babel/generator": ^7.14.2
"@babel/helper-function-name": ^7.14.2
"@babel/helper-split-export-declaration": ^7.12.13
"@babel/parser": ^7.14.0
"@babel/types": ^7.14.0
"@babel/parser": ^7.14.2
"@babel/types": ^7.14.2
debug: ^4.1.0
globals: ^11.1.0
checksum: f2fb957d616c242d8ccd25fbebadebc25aa2df8ea82d7cacb2b09285743a682f72beb6fb2acef01a7a98f141c3e36d19300ebde2dd78c780c5e3dc7692c5f6f2
checksum: 76f57f7a718c5ac17f72eb729e68d6135e37ee6201642d25c92d8add7b87eb492c7af40bd5193c27cca83cb60a649c9ccbe0f500e37569609e044b0560602cb7
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.14.0, @babel/types@npm:^7.14.1, @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.14.1
resolution: "@babel/types@npm:7.14.1"
"@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.14.0, @babel/types@npm:^7.14.1, @babel/types@npm:^7.14.2, @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.14.2
resolution: "@babel/types@npm:7.14.2"
dependencies:
"@babel/helper-validator-identifier": ^7.14.0
to-fast-properties: ^2.0.0
checksum: 27965ef192ded329d8ae28ccd5e5addd02dc477ec46e54145e5cf0d054ad65b2fc760736865295c1819d502ec9598883c17f25efdbe896ad77b400136a1aa971
checksum: 34893ac415826cd2ddead0511be9c3cb876bf626148b00b0a471c4630b193939ba46a9bf9d8b2be88e46fceb3ae9204ed7488ceb6a08a67550211d40df65a7c7
languageName: node
linkType: hard
@@ -1425,9 +1425,9 @@ __metadata:
languageName: node
linkType: hard
"@eslint/eslintrc@npm:^0.4.0":
version: 0.4.0
resolution: "@eslint/eslintrc@npm:0.4.0"
"@eslint/eslintrc@npm:^0.4.1":
version: 0.4.1
resolution: "@eslint/eslintrc@npm:0.4.1"
dependencies:
ajv: ^6.12.4
debug: ^4.1.1
@@ -1438,7 +1438,7 @@ __metadata:
js-yaml: ^3.13.1
minimatch: ^3.0.4
strip-json-comments: ^3.1.1
checksum: d3f51b741997cbf36662d8b5a52985bfa5d2873e48cadccd95c67fcce1706327ec98ebb6f0be79c6ecbc31bdeca32c2b1c4f66fd1cf3934c434d1ac269cbceac
checksum: 418f5810c8dd9897d2457ceef098197d0e5f1ad345fbe4cd9256fd4223d7ea83d5e350f9091b3ab3483b6b1c367fa560df3ba1fccc7eb8ca6e1aae5a5b126d60
languageName: node
linkType: hard
@@ -1841,54 +1841,54 @@ __metadata:
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
dependencies:
"@babel/runtime": ^7.14.0
"@polkadot/api": 4.9.1
"@polkadot/types": 4.9.1
"@polkadot/util": ^6.3.1
"@polkadot/x-rxjs": ^6.3.1
"@polkadot/api": 4.10.1
"@polkadot/types": 4.10.1
"@polkadot/util": ^6.4.1
"@polkadot/x-rxjs": ^6.4.1
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/api-derive@4.9.1, @polkadot/api-derive@workspace:packages/api-derive":
"@polkadot/api-derive@4.10.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.14.0
"@polkadot/api": 4.9.1
"@polkadot/keyring": ^6.3.1
"@polkadot/rpc-core": 4.9.1
"@polkadot/rpc-provider": 4.9.1
"@polkadot/types": 4.9.1
"@polkadot/util": ^6.3.1
"@polkadot/util-crypto": ^6.3.1
"@polkadot/x-rxjs": ^6.3.1
"@polkadot/api": 4.10.1
"@polkadot/keyring": ^6.4.1
"@polkadot/rpc-core": 4.10.1
"@polkadot/rpc-provider": 4.10.1
"@polkadot/types": 4.10.1
"@polkadot/util": ^6.4.1
"@polkadot/util-crypto": ^6.4.1
"@polkadot/x-rxjs": ^6.4.1
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/api@4.9.1, @polkadot/api@workspace:packages/api":
"@polkadot/api@4.10.1, @polkadot/api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@polkadot/api@workspace:packages/api"
dependencies:
"@babel/runtime": ^7.14.0
"@polkadot/api-derive": 4.9.1
"@polkadot/keyring": ^6.3.1
"@polkadot/metadata": 4.9.1
"@polkadot/rpc-core": 4.9.1
"@polkadot/rpc-provider": 4.9.1
"@polkadot/types": 4.9.1
"@polkadot/types-known": 4.9.1
"@polkadot/util": ^6.3.1
"@polkadot/util-crypto": ^6.3.1
"@polkadot/x-rxjs": ^6.3.1
"@polkadot/api-derive": 4.10.1
"@polkadot/keyring": ^6.4.1
"@polkadot/metadata": 4.10.1
"@polkadot/rpc-core": 4.10.1
"@polkadot/rpc-provider": 4.10.1
"@polkadot/types": 4.10.1
"@polkadot/types-known": 4.10.1
"@polkadot/util": ^6.4.1
"@polkadot/util-crypto": ^6.4.1
"@polkadot/x-rxjs": ^6.4.1
bn.js: ^4.11.9
eventemitter3: ^4.0.7
languageName: unknown
linkType: soft
"@polkadot/dev@npm:^0.62.12":
version: 0.62.12
resolution: "@polkadot/dev@npm:0.62.12"
"@polkadot/dev@npm:^0.62.14":
version: 0.62.14
resolution: "@polkadot/dev@npm:0.62.14"
dependencies:
"@babel/cli": ^7.13.16
"@babel/core": ^7.14.0
@@ -1910,8 +1910,8 @@ __metadata:
"@babel/register": ^7.13.16
"@babel/runtime": ^7.14.0
"@rushstack/eslint-patch": ^1.0.6
"@typescript-eslint/eslint-plugin": 4.22.1
"@typescript-eslint/parser": 4.22.1
"@typescript-eslint/eslint-plugin": 4.23.0
"@typescript-eslint/parser": 4.23.0
"@vue/component-compiler-utils": ^3.2.0
babel-jest: ^26.6.3
babel-plugin-module-extension-resolver: ^1.0.0-rc.2
@@ -1920,7 +1920,7 @@ __metadata:
browserslist: ^4.16.6
chalk: ^4.1.1
coveralls: ^3.1.0
eslint: ^7.25.0
eslint: ^7.26.0
eslint-config-standard: ^16.0.2
eslint-import-resolver-node: ^0.3.4
eslint-plugin-header: ^3.1.1
@@ -1934,7 +1934,7 @@ __metadata:
fs-extra: ^10.0.0
gh-pages: ^3.1.0
gh-release: ^5.0.0
glob: ^7.1.6
glob: ^7.1.7
glob2base: ^0.0.12
jest: ^26.6.3
jest-cli: ^26.6.3
@@ -1944,7 +1944,7 @@ __metadata:
madge: ^4.0.2
minimatch: ^3.0.4
mkdirp: ^1.0.4
prettier: ^2.2.1
prettier: ^2.3.0
rimraf: ^3.0.2
typescript: ^4.2.4
yargs: ^17.0.1
@@ -1968,74 +1968,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: a2cb11fadb41e2419a099886b211a28a986da7c239f50174f5211d71d44d07b7269ea334dddc8fd6066603a405955e2e2f0c438b32507764fea6f9d9d5d1688b
checksum: c2d8eb6b18f293166282cf2944426135e880d1ccc641296e5a694fb80b4c1f21acc188fbe9d0e2d17d565b7ebae1bbb16f2a6c06934e0579abc63e1593e8b809
languageName: node
linkType: hard
"@polkadot/keyring@npm:^6.3.1":
version: 6.3.1
resolution: "@polkadot/keyring@npm:6.3.1"
"@polkadot/keyring@npm:^6.4.1":
version: 6.4.1
resolution: "@polkadot/keyring@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@polkadot/util": 6.3.1
"@polkadot/util-crypto": 6.3.1
"@babel/runtime": ^7.14.0
"@polkadot/util": 6.4.1
"@polkadot/util-crypto": 6.4.1
peerDependencies:
"@polkadot/util": 6.3.1
"@polkadot/util-crypto": 6.3.1
checksum: aab63b74f1eebc49ac3c6ddd6b385695ec6d07e15f03ece02f3f516298b07b51ecf47cb8a8f5c38804cc2ae347886716a46f3f0d6ad83281fd11f7494875e1e8
"@polkadot/util": 6.4.1
"@polkadot/util-crypto": 6.4.1
checksum: 40b2fdae19317fc3263f7c51690d8694589fb82e373ba8a74ecd3718bdfe2067fb96164e072c8600a89b1468dc9fd191c45540fe556799f6f3513ad6076da049
languageName: node
linkType: hard
"@polkadot/metadata@4.9.1, @polkadot/metadata@workspace:packages/metadata":
"@polkadot/metadata@4.10.1, @polkadot/metadata@workspace:packages/metadata":
version: 0.0.0-use.local
resolution: "@polkadot/metadata@workspace:packages/metadata"
dependencies:
"@babel/runtime": ^7.14.0
"@polkadot/keyring": ^6.3.1
"@polkadot/types": 4.9.1
"@polkadot/types-known": 4.9.1
"@polkadot/util": ^6.3.1
"@polkadot/util-crypto": ^6.3.1
"@polkadot/keyring": ^6.4.1
"@polkadot/types": 4.10.1
"@polkadot/types-known": 4.10.1
"@polkadot/util": ^6.4.1
"@polkadot/util-crypto": ^6.4.1
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/networks@npm:6.3.1, @polkadot/networks@npm:^6.3.1":
version: 6.3.1
resolution: "@polkadot/networks@npm:6.3.1"
"@polkadot/networks@npm:6.4.1, @polkadot/networks@npm:^6.4.1":
version: 6.4.1
resolution: "@polkadot/networks@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
checksum: 24fea684b71efdf77ac7fbe0da0871c4ea617e9c66c5d3fce5ba627005bafc3874d62559689d72f427795a077319aa96c95114f351037f404f3defa0008b8097
"@babel/runtime": ^7.14.0
checksum: 87acb72f006bf321e6d6b45942639708861f1922e05b7378b36bffbe1aa0d4549c7846e376ddcd6d0f5b05616d12bb21d65342b7a7dce78a78d2fab7effec3bb
languageName: node
linkType: hard
"@polkadot/rpc-core@4.9.1, @polkadot/rpc-core@workspace:packages/rpc-core":
"@polkadot/rpc-core@4.10.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.14.0
"@polkadot/keyring": ^6.3.1
"@polkadot/metadata": 4.9.1
"@polkadot/rpc-provider": 4.9.1
"@polkadot/types": 4.9.1
"@polkadot/util": ^6.3.1
"@polkadot/x-rxjs": ^6.3.1
"@polkadot/keyring": ^6.4.1
"@polkadot/metadata": 4.10.1
"@polkadot/rpc-provider": 4.10.1
"@polkadot/types": 4.10.1
"@polkadot/util": ^6.4.1
"@polkadot/x-rxjs": ^6.4.1
languageName: unknown
linkType: soft
"@polkadot/rpc-provider@4.9.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
"@polkadot/rpc-provider@4.10.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.14.0
"@polkadot/keyring": ^6.3.1
"@polkadot/metadata": 4.9.1
"@polkadot/types": 4.9.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
"@polkadot/keyring": ^6.4.1
"@polkadot/metadata": 4.10.1
"@polkadot/types": 4.10.1
"@polkadot/util": ^6.4.1
"@polkadot/util-crypto": ^6.4.1
"@polkadot/x-fetch": ^6.4.1
"@polkadot/x-global": ^6.4.1
"@polkadot/x-ws": ^6.4.1
bn.js: ^4.11.9
eventemitter3: ^4.0.7
mock-socket: ^9.0.3
@@ -2043,12 +2043,12 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/ts@npm:^0.3.64":
version: 0.3.64
resolution: "@polkadot/ts@npm:0.3.64"
"@polkadot/ts@npm:^0.3.66":
version: 0.3.66
resolution: "@polkadot/ts@npm:0.3.66"
dependencies:
"@types/chrome": ^0.0.136
checksum: 3e3b456f85a35cf57165713556c3e1725c74ba6d84950084b9e70480e5c6f8707d82cb4d59af54a4e6bbae7dc3a616dd0040b4eba5043bffebb4c5df3b689a09
"@types/chrome": ^0.0.140
checksum: 87a6fffc9fbcad3d374d2ee2c7f06af89fcbff2d168e7df1d357ae4a74d584a4aabef48f9d9004f1e8843afddcc5304546362d4e35e36ff7cb56832ef0807d2c
languageName: node
linkType: hard
@@ -2056,14 +2056,14 @@ __metadata:
version: 0.0.0-use.local
resolution: "@polkadot/typegen@workspace:packages/typegen"
dependencies:
"@babel/core": ^7.14.0
"@babel/core": ^7.14.2
"@babel/register": ^7.13.16
"@babel/runtime": ^7.14.0
"@polkadot/api": 4.9.1
"@polkadot/metadata": 4.9.1
"@polkadot/rpc-provider": 4.9.1
"@polkadot/types": 4.9.1
"@polkadot/util": ^6.3.1
"@polkadot/api": 4.10.1
"@polkadot/metadata": 4.10.1
"@polkadot/rpc-provider": 4.10.1
"@polkadot/types": 4.10.1
"@polkadot/util": ^6.4.1
"@types/websocket": ^1.0.2
"@types/yargs": ^16.0.1
handlebars: ^4.7.7
@@ -2078,43 +2078,43 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-known@4.9.1, @polkadot/types-known@workspace:packages/types-known":
"@polkadot/types-known@4.10.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.14.0
"@polkadot/networks": ^6.3.1
"@polkadot/types": 4.9.1
"@polkadot/util": ^6.3.1
"@polkadot/networks": ^6.4.1
"@polkadot/types": 4.10.1
"@polkadot/util": ^6.4.1
"@types/bn.js": ^4.11.6
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@polkadot/types@4.9.1, @polkadot/types@workspace:packages/types":
"@polkadot/types@4.10.1, @polkadot/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@polkadot/types@workspace:packages/types"
dependencies:
"@babel/runtime": ^7.14.0
"@polkadot/keyring": ^6.3.1
"@polkadot/metadata": 4.9.1
"@polkadot/util": ^6.3.1
"@polkadot/util-crypto": ^6.3.1
"@polkadot/x-rxjs": ^6.3.1
"@polkadot/keyring": ^6.4.1
"@polkadot/metadata": 4.10.1
"@polkadot/util": ^6.4.1
"@polkadot/util-crypto": ^6.4.1
"@polkadot/x-rxjs": ^6.4.1
"@types/bn.js": ^4.11.6
bn.js: ^4.11.9
languageName: unknown
linkType: soft
"@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"
"@polkadot/util-crypto@npm:6.4.1, @polkadot/util-crypto@npm:^6.4.1":
version: 6.4.1
resolution: "@polkadot/util-crypto@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@polkadot/networks": 6.3.1
"@polkadot/util": 6.3.1
"@babel/runtime": ^7.14.0
"@polkadot/networks": 6.4.1
"@polkadot/util": 6.4.1
"@polkadot/wasm-crypto": ^4.0.2
"@polkadot/x-randomvalues": 6.3.1
"@polkadot/x-randomvalues": 6.4.1
base-x: ^3.0.8
base64-js: ^1.5.1
blakejs: ^1.1.0
@@ -2127,23 +2127,23 @@ __metadata:
tweetnacl: ^1.0.3
xxhashjs: ^0.2.2
peerDependencies:
"@polkadot/util": 6.3.1
checksum: 69004aaf5a5dd44b909292e671bd357336bfec5ce0d0a5feea09c3c310242a41dd2f69488520510aeba948b80faef0352645a2ca0cdf2c0f5a384bf0dc49a403
"@polkadot/util": 6.4.1
checksum: eef9f8c73bbe8c7caefc905b09d175d4a0190d703bd4a8e65723dc2a5eadeb3646eac6b1a3c1034fe97bcf982aa0a3f7e4e4da01226d6993be488fa7c760684a
languageName: node
linkType: hard
"@polkadot/util@npm:6.3.1, @polkadot/util@npm:^6.3.1":
version: 6.3.1
resolution: "@polkadot/util@npm:6.3.1"
"@polkadot/util@npm:6.4.1, @polkadot/util@npm:^6.4.1":
version: 6.4.1
resolution: "@polkadot/util@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@polkadot/x-textdecoder": 6.3.1
"@polkadot/x-textencoder": 6.3.1
"@babel/runtime": ^7.14.0
"@polkadot/x-textdecoder": 6.4.1
"@polkadot/x-textencoder": 6.4.1
"@types/bn.js": ^4.11.6
bn.js: ^4.11.9
camelcase: ^5.3.1
ip-regex: ^4.3.0
checksum: a4d6e19d9933e70bab809f23dbb0b99d4152333e8c1128b94117cec6e6ea28021379d28ad49c95ab2065743ab4b7555d34e4ab1ae3cb80105b74d490bdb4142a
checksum: dce56aa96b60233cd72c7c7c615b972cdab069cbbd355c87ffbc32c292aff32e6b7bb35b1b365362eab454a876069c0006348282d9807f8846a2ecd9afc16c0d
languageName: node
linkType: hard
@@ -2179,78 +2179,78 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/x-fetch@npm:^6.3.1":
version: 6.3.1
resolution: "@polkadot/x-fetch@npm:6.3.1"
"@polkadot/x-fetch@npm:^6.4.1":
version: 6.4.1
resolution: "@polkadot/x-fetch@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@polkadot/x-global": 6.3.1
"@babel/runtime": ^7.14.0
"@polkadot/x-global": 6.4.1
"@types/node-fetch": ^2.5.10
node-fetch: ^2.6.1
checksum: 74e0957bf96b91aa7db7759a2466f57ee8b31b94993be92efafab3ea2047461331391ba14dd2df12ec62c70449b4ad25cef46073f31bf8963862a15e9d6dcd9f
checksum: 0cfe81498eba0ba84602deb09de6c889d9dccc3df43c1ddbba2302264ef27de3d4f9a3d323985fc6b99d8a45851fa53c56e5929e143fd813e768fbb2140d93c6
languageName: node
linkType: hard
"@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"
"@polkadot/x-global@npm:6.4.1, @polkadot/x-global@npm:^6.4.1":
version: 6.4.1
resolution: "@polkadot/x-global@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@babel/runtime": ^7.14.0
"@types/node-fetch": ^2.5.10
node-fetch: ^2.6.1
checksum: fa8ffbdc402da35ef5d19716030c8294680abf798d139d17d819f227f7bdcc2b4fb838986c8ce78c2873c12581e5c0af04070b39c3e4f9bc3f0a53e3bcf2f262
checksum: 396c051cf05fe9354ffa801b73f11617c10a72dc4f86950137b2db804d6a3229c7177b4747225a0685efa46090ee6652a471fadec50fb02f78c6c1700770c3ed
languageName: node
linkType: hard
"@polkadot/x-randomvalues@npm:6.3.1":
version: 6.3.1
resolution: "@polkadot/x-randomvalues@npm:6.3.1"
"@polkadot/x-randomvalues@npm:6.4.1":
version: 6.4.1
resolution: "@polkadot/x-randomvalues@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@polkadot/x-global": 6.3.1
checksum: 3f970f8623a917c36283a6301ca9158a47a51ca2d968a7c5a27d66fcb8376d0e86f68284090f37290a8855610f9a29d67a7cdb215cb0a6e8c8b2864612bef466
"@babel/runtime": ^7.14.0
"@polkadot/x-global": 6.4.1
checksum: e16d39aa9d6765bb86a8a82cb6a596dea5303e153f505266b3b52b8f7febc7f9e84195fa5068b1fa4f13b33788fcbad0f30f0f5a3443803daea3d48d6eba330a
languageName: node
linkType: hard
"@polkadot/x-rxjs@npm:^6.3.1":
version: 6.3.1
resolution: "@polkadot/x-rxjs@npm:6.3.1"
"@polkadot/x-rxjs@npm:^6.4.1":
version: 6.4.1
resolution: "@polkadot/x-rxjs@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@babel/runtime": ^7.14.0
rxjs: ^6.6.7
checksum: 6c3e3a0785e583df6e1adfcc667f680ddb55d961883c14f62e49d6970b99a5aa577f6b63f436ae196ed7368ee21314be5c68dc230eeb7d8966dc38afe67561ff
checksum: cd73834f610d8cd5d7a229a013afede97364775a66459d74662d66f13fcdab962493185645680083cca05dc973a65c276c061d58a4513d59a3b323e6ef9ca35f
languageName: node
linkType: hard
"@polkadot/x-textdecoder@npm:6.3.1":
version: 6.3.1
resolution: "@polkadot/x-textdecoder@npm:6.3.1"
"@polkadot/x-textdecoder@npm:6.4.1":
version: 6.4.1
resolution: "@polkadot/x-textdecoder@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@polkadot/x-global": 6.3.1
checksum: b917de465bc96c8adae88d36cf9de3bd459bc5987b755246a8e477082edbc74efa468983cff133da3dd6b38d0684c7183ee46aab2d5efd9b2912954266be50c2
"@babel/runtime": ^7.14.0
"@polkadot/x-global": 6.4.1
checksum: f6d9c4c1c3292746f55d6898cd0668e35a92f18f55d3acaa8c3691c77b36affba2e05b8083c25130cd19cd83bd8a2a717d59e467cd94c352dc88c0e0237c5e65
languageName: node
linkType: hard
"@polkadot/x-textencoder@npm:6.3.1":
version: 6.3.1
resolution: "@polkadot/x-textencoder@npm:6.3.1"
"@polkadot/x-textencoder@npm:6.4.1":
version: 6.4.1
resolution: "@polkadot/x-textencoder@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@polkadot/x-global": 6.3.1
checksum: 80457f236f08cea895919d6cb29535eeece8ff2324956890b4f07dd59745ad2ef8344892ab0b2a9576ce624e576a706ec91a2cc9464c99fecb164c6bc891c8ac
"@babel/runtime": ^7.14.0
"@polkadot/x-global": 6.4.1
checksum: f276956fed01935bf5453c89cecaecd48ef1ebd53537d2960f134b0eefccdad0183107dafbc4edf74f24e0b402d5e3f830c6e0a488b2c5857587d540e2f8550b
languageName: node
linkType: hard
"@polkadot/x-ws@npm:^6.3.1":
version: 6.3.1
resolution: "@polkadot/x-ws@npm:6.3.1"
"@polkadot/x-ws@npm:^6.4.1":
version: 6.4.1
resolution: "@polkadot/x-ws@npm:6.4.1"
dependencies:
"@babel/runtime": ^7.13.17
"@polkadot/x-global": 6.3.1
"@babel/runtime": ^7.14.0
"@polkadot/x-global": 6.4.1
"@types/websocket": ^1.0.2
websocket: ^1.0.34
checksum: e8a2332ae30698eea4428020203291414ef3fc7be3b676df41fff1c5c4312c6008a2f9240baa92f6f8c542714ee7e39b923d5dd8ec9f0a6811f610a5cb87a45f
checksum: b2bba50723c67b4cb9d289c0c0aa2248f4510eaafe4a03cbd51676b2c2b7fc03c20d14f78192a0b4cf7be2ff095111997737ffccefab4db361f803b9dbbd10b8
languageName: node
linkType: hard
@@ -2345,13 +2345,13 @@ __metadata:
languageName: node
linkType: hard
"@types/chrome@npm:^0.0.136":
version: 0.0.136
resolution: "@types/chrome@npm:0.0.136"
"@types/chrome@npm:^0.0.140":
version: 0.0.140
resolution: "@types/chrome@npm:0.0.140"
dependencies:
"@types/filesystem": "*"
"@types/har-format": "*"
checksum: 1ac7be0b47988d0a322ce557982b670a3e9c0ce862be97216561756cdfc9f8f1cfee9660d17b7f868245672267cafc3b19dbaf714cf03d57a9b8fd03daa4cb27
checksum: 6f69793227b13a5988043f8fc649bc24269d5f62798c4b7b7f5efa036955ebafa274dfb3abdbfe25ed94ada03d44a74107601ec9cd408f8c8e23daf72049382b
languageName: node
linkType: hard
@@ -2526,12 +2526,12 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/eslint-plugin@npm:4.22.1":
version: 4.22.1
resolution: "@typescript-eslint/eslint-plugin@npm:4.22.1"
"@typescript-eslint/eslint-plugin@npm:4.23.0":
version: 4.23.0
resolution: "@typescript-eslint/eslint-plugin@npm:4.23.0"
dependencies:
"@typescript-eslint/experimental-utils": 4.22.1
"@typescript-eslint/scope-manager": 4.22.1
"@typescript-eslint/experimental-utils": 4.23.0
"@typescript-eslint/scope-manager": 4.23.0
debug: ^4.1.1
functional-red-black-tree: ^1.0.1
lodash: ^4.17.15
@@ -2544,66 +2544,66 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
checksum: 6b3384e155583779285089e83b85a38f6c6965e6529b7b6bdcf630122164981c30139468d19fade482b7b45f007f9cd83b9c8c54eca385c8f0d6269bac2138be
checksum: 846ecf021aaa7de34ac306866e2aca5ffa89711bc2c4ffe916fc632dde880eb94f0665009161086d3d91ccc21f2600a27271e041de505363758548511c463907
languageName: node
linkType: hard
"@typescript-eslint/experimental-utils@npm:4.22.1":
version: 4.22.1
resolution: "@typescript-eslint/experimental-utils@npm:4.22.1"
"@typescript-eslint/experimental-utils@npm:4.23.0":
version: 4.23.0
resolution: "@typescript-eslint/experimental-utils@npm:4.23.0"
dependencies:
"@types/json-schema": ^7.0.3
"@typescript-eslint/scope-manager": 4.22.1
"@typescript-eslint/types": 4.22.1
"@typescript-eslint/typescript-estree": 4.22.1
"@typescript-eslint/scope-manager": 4.23.0
"@typescript-eslint/types": 4.23.0
"@typescript-eslint/typescript-estree": 4.23.0
eslint-scope: ^5.0.0
eslint-utils: ^2.0.0
peerDependencies:
eslint: "*"
checksum: ddea7a1af501e0ba2a551de68e436c6f65e8ec5d68bff4f00a71ffeba8b73160f30f92de5dbdf01dcfd3f3bf5ab1ea18fe00dbd6401a256b2960c60cf475aa29
checksum: 8583b9f016c08199789e0439af3a77bc46304165d3878a5d0851dfbeee8d89807ceda9d33a74b8854022f7dfe82cbe1eb4debb59ce7085d7f376d79abf78d09d
languageName: node
linkType: hard
"@typescript-eslint/parser@npm:4.22.1":
version: 4.22.1
resolution: "@typescript-eslint/parser@npm:4.22.1"
"@typescript-eslint/parser@npm:4.23.0":
version: 4.23.0
resolution: "@typescript-eslint/parser@npm:4.23.0"
dependencies:
"@typescript-eslint/scope-manager": 4.22.1
"@typescript-eslint/types": 4.22.1
"@typescript-eslint/typescript-estree": 4.22.1
"@typescript-eslint/scope-manager": 4.23.0
"@typescript-eslint/types": 4.23.0
"@typescript-eslint/typescript-estree": 4.23.0
debug: ^4.1.1
peerDependencies:
eslint: ^5.0.0 || ^6.0.0 || ^7.0.0
peerDependenciesMeta:
typescript:
optional: true
checksum: ff57b68f83c984d146a00ad122f2e4bdf53649380e125f1764b66dce3bb7418c96729499987301c3daad2856c1a3a04f897c33cf36a9d7e48ddb8848ee608d74
checksum: 364874cf13b50e8e7adf5a424f5b0364689046ebdffaa715146b5b2f25e008ed99bd52d190e33d1b06378bfa35f0c9140c26ccb943a01732e952ee2032bd715c
languageName: node
linkType: hard
"@typescript-eslint/scope-manager@npm:4.22.1":
version: 4.22.1
resolution: "@typescript-eslint/scope-manager@npm:4.22.1"
"@typescript-eslint/scope-manager@npm:4.23.0":
version: 4.23.0
resolution: "@typescript-eslint/scope-manager@npm:4.23.0"
dependencies:
"@typescript-eslint/types": 4.22.1
"@typescript-eslint/visitor-keys": 4.22.1
checksum: 3309e33e8d8ad2ac5531a12055553817123346e63b64a77a67e429a3574c13334576dc9f11c632d9f01aa2ba07dfdc5d0840f90130fa9a764e10e0125c4f662b
"@typescript-eslint/types": 4.23.0
"@typescript-eslint/visitor-keys": 4.23.0
checksum: d51c7efa22946bc0d7d9d330b51fe114df1f8a9a64194d403043d6e3ed7564fea8452d8b57cbc74a92b03894fd6cc12e64445220961edbee2348421608e5fdc6
languageName: node
linkType: hard
"@typescript-eslint/types@npm:4.22.1":
version: 4.22.1
resolution: "@typescript-eslint/types@npm:4.22.1"
checksum: ce4e0673bff31ac2b75319aeaa9feffd4dd0a6cce7f335c50bcd654aa96774d168c14903990e905c7515b0df0974b050edc328d7866d329f8379b552f525cac5
"@typescript-eslint/types@npm:4.23.0":
version: 4.23.0
resolution: "@typescript-eslint/types@npm:4.23.0"
checksum: b0ddf4ca0176566f27388ea6b74a32d7efe585c79db998ec1d51515ab7ef88de651d4b531410a763ef73a04a645b181d78559960c08e6c9d0e21796cc0708888
languageName: node
linkType: hard
"@typescript-eslint/typescript-estree@npm:4.22.1, @typescript-eslint/typescript-estree@npm:^4.8.2":
version: 4.22.1
resolution: "@typescript-eslint/typescript-estree@npm:4.22.1"
"@typescript-eslint/typescript-estree@npm:4.23.0, @typescript-eslint/typescript-estree@npm:^4.8.2":
version: 4.23.0
resolution: "@typescript-eslint/typescript-estree@npm:4.23.0"
dependencies:
"@typescript-eslint/types": 4.22.1
"@typescript-eslint/visitor-keys": 4.22.1
"@typescript-eslint/types": 4.23.0
"@typescript-eslint/visitor-keys": 4.23.0
debug: ^4.1.1
globby: ^11.0.1
is-glob: ^4.0.1
@@ -2612,17 +2612,17 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
checksum: 7de4827b870324e668ec84fc2b40c76465e72bdec6b8eb47ca493378d9c81e0d76bb3c5d4396400c70254c6fd2d57c81bde1236fe760d698d20ead80a295ffc4
checksum: dec87f62c7301f7f6dec1cd8b30c0d4ba6c86cb78c3acb2070ee7ca2fcf9e2d1613fbbfb64561c2f4a6267217d435f7a48b3b1189ada8c938e2814b2e9b05b09
languageName: node
linkType: hard
"@typescript-eslint/visitor-keys@npm:4.22.1":
version: 4.22.1
resolution: "@typescript-eslint/visitor-keys@npm:4.22.1"
"@typescript-eslint/visitor-keys@npm:4.23.0":
version: 4.23.0
resolution: "@typescript-eslint/visitor-keys@npm:4.23.0"
dependencies:
"@typescript-eslint/types": 4.22.1
"@typescript-eslint/types": 4.23.0
eslint-visitor-keys: ^2.0.0
checksum: b696851b5b7383368c29136374119ba53b39ca6f239899b00cd914c301c6c223c2e99541a6bb94f039511c160cc737b2773a2dc4fb8c817e2b079d0df12a0b94
checksum: a5e86b76e37fa11d061c5b1dcbc77e8faca6afb112c93240880563cc26306c7ba52d9baa824fd8b75b9deda1736340f93f38cae1782d3fe9e4e46d335b6236d1
languageName: node
linkType: hard
@@ -4826,12 +4826,12 @@ __metadata:
languageName: node
linkType: hard
"eslint@npm:^7.25.0":
version: 7.25.0
resolution: "eslint@npm:7.25.0"
"eslint@npm:^7.26.0":
version: 7.26.0
resolution: "eslint@npm:7.26.0"
dependencies:
"@babel/code-frame": 7.12.11
"@eslint/eslintrc": ^0.4.0
"@eslint/eslintrc": ^0.4.1
ajv: ^6.10.0
chalk: ^4.0.0
cross-spawn: ^7.0.2
@@ -4869,7 +4869,7 @@ __metadata:
v8-compile-cache: ^2.0.3
bin:
eslint: bin/eslint.js
checksum: 6e1782e2264ebf987504746ee82e996bf0ef2c29a2eaea869b54cb8aa1eaf10945b1d563618515e65ac934ca626f3609282127773f45868ad4a98744458a3c62
checksum: 08f99befd764fbd6ea811e9eec27d5c6b9dc9d1bbfe5ffa1016e4f1fe526a4f45ea127c4e30c554c423ee55eb290ce9af4fb7fedf9b7af3f84076a444c2bbdf6
languageName: node
linkType: hard
@@ -5667,9 +5667,9 @@ fsevents@~2.1.2:
languageName: node
linkType: hard
"glob@npm:^7.0.0, glob@npm:^7.0.3, glob@npm:^7.0.5, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6":
version: 7.1.6
resolution: "glob@npm:7.1.6"
"glob@npm:^7.0.0, glob@npm:^7.0.3, glob@npm:^7.0.5, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.1.7":
version: 7.1.7
resolution: "glob@npm:7.1.7"
dependencies:
fs.realpath: ^1.0.0
inflight: ^1.0.4
@@ -5677,7 +5677,7 @@ fsevents@~2.1.2:
minimatch: ^3.0.4
once: ^1.3.0
path-is-absolute: ^1.0.0
checksum: 789977b52432865bd63846da5c75a6efc2c56abdc0cb5ffcdb8e91eeb67a58fa5594c1195d18b2b4aff99675b0739ed6bd61024b26562e0cca18c8f993efdc82
checksum: 352f74f08247db5420161a2f68f2bd84b53228b5fcfc9dcc37cd54d3f19ec0232495d84aeff1286d0727059e9fdc1031400e00b971bdc59e30f8f82b199c9d02
languageName: node
linkType: hard
@@ -8800,12 +8800,12 @@ fsevents@~2.1.2:
languageName: node
linkType: hard
"prettier@npm:^2.2.1":
version: 2.2.1
resolution: "prettier@npm:2.2.1"
"prettier@npm:^2.3.0":
version: 2.3.0
resolution: "prettier@npm:2.3.0"
bin:
prettier: bin-prettier.js
checksum: 92c6c9f4b87eba1f28466edee57dd18c80d00b858edda77d46d1950d20e6e302b68ee255fc91133ba931e63c4577b5ae30da194d9626a8f3c0177778b91bf056
checksum: 652640cc8b71bc5277cfb8bf6f161783ca588efcf683c3d630837b39da8d57fef35c9e00ae5855a8e3c75136c42274046c913cc2b2d2968558315f31c6a26981
languageName: node
linkType: hard
@@ -9484,11 +9484,11 @@ resolve@^2.0.0-next.3:
version: 0.0.0-use.local
resolution: "root-workspace-0b6124@workspace:."
dependencies:
"@babel/core": ^7.14.0
"@babel/core": ^7.14.2
"@babel/register": ^7.13.16
"@babel/runtime": ^7.14.0
"@polkadot/dev": ^0.62.12
"@polkadot/ts": ^0.3.64
"@polkadot/dev": ^0.62.14
"@polkadot/ts": ^0.3.66
"@polkadot/typegen": "workspace:packages/typegen"
"@types/jest": ^26.0.23
copyfiles: ^2.4.1