Dev bump (#2839)
* Adjust internal generic imports * Update dev * Adjust primitive imports * Class exports has uppercase variant * common * to* chenges * Adjust EventData for registry creation
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
"version": "2.6.2-6",
|
||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"Polkadot",
|
||||
@@ -20,7 +19,7 @@
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/api": "2.6.2-6",
|
||||
"@polkadot/types": "2.6.2-6",
|
||||
"@polkadot/util": "^4.0.2-11",
|
||||
"@polkadot/util": "^4.0.2-12",
|
||||
"bn.js": "^5.1.3",
|
||||
"rxjs": "^6.6.3"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"version": "2.6.2-6",
|
||||
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"Polkadot",
|
||||
@@ -22,14 +21,14 @@
|
||||
"@polkadot/api": "2.6.2-6",
|
||||
"@polkadot/rpc-core": "2.6.2-6",
|
||||
"@polkadot/types": "2.6.2-6",
|
||||
"@polkadot/util": "^4.0.2-11",
|
||||
"@polkadot/util-crypto": "^4.0.2-11",
|
||||
"@polkadot/util": "^4.0.2-12",
|
||||
"@polkadot/util-crypto": "^4.0.2-12",
|
||||
"bn.js": "^5.1.3",
|
||||
"memoizee": "^0.4.14",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^4.0.2-11",
|
||||
"@polkadot/keyring": "^4.0.2-12",
|
||||
"@polkadot/rpc-provider": "2.6.2-6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"version": "2.6.2-6",
|
||||
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"Polkadot",
|
||||
@@ -19,14 +18,14 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/api-derive": "2.6.2-6",
|
||||
"@polkadot/keyring": "^4.0.2-11",
|
||||
"@polkadot/keyring": "^4.0.2-12",
|
||||
"@polkadot/metadata": "2.6.2-6",
|
||||
"@polkadot/rpc-core": "2.6.2-6",
|
||||
"@polkadot/rpc-provider": "2.6.2-6",
|
||||
"@polkadot/types": "2.6.2-6",
|
||||
"@polkadot/types-known": "2.6.2-6",
|
||||
"@polkadot/util": "^4.0.2-11",
|
||||
"@polkadot/util-crypto": "^4.0.2-11",
|
||||
"@polkadot/util": "^4.0.2-12",
|
||||
"@polkadot/util-crypto": "^4.0.2-12",
|
||||
"bn.js": "^5.1.3",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^6.6.3"
|
||||
|
||||
@@ -175,7 +175,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* The schedule must have a greater version than the stored schedule.
|
||||
**/
|
||||
updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; instructionWeights?: any; hostFnWeights?: any; enablePrintln?: any; maxEventTopics?: any; maxStackHeight?: any; maxMemoryPages?: any; maxTableSize?: any; maxSubjectLen?: any; maxCodeSize?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
|
||||
updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; enablePrintln?: any; limits?: any; instructionWeights?: any; hostFnWeights?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
|
||||
};
|
||||
council: {
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"version": "2.6.2-6",
|
||||
"description": "Helpers to extract information from runtime metadata",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"sideEffects": false,
|
||||
"repository": "github:polkadot-js/api",
|
||||
"keywords": [
|
||||
@@ -19,11 +18,11 @@
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/types": "2.6.2-6",
|
||||
"@polkadot/types-known": "2.6.2-6",
|
||||
"@polkadot/util": "^4.0.2-11",
|
||||
"@polkadot/util-crypto": "^4.0.2-11",
|
||||
"@polkadot/util": "^4.0.2-12",
|
||||
"@polkadot/util-crypto": "^4.0.2-12",
|
||||
"bn.js": "^5.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^4.0.2-11"
|
||||
"@polkadot/keyring": "^4.0.2-12"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { AnyNumber, Registry } from '@polkadot/types/types';
|
||||
|
||||
import { assert } from '@polkadot/util';
|
||||
|
||||
import { u32 as U32 } from '@polkadot/types/primitive';
|
||||
import { U32 } from '@polkadot/types/primitive';
|
||||
|
||||
export const MAGIC_NUMBER = 0x6174656d; // `meta`, reversed for Little Endian encoding
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ import { Struct } from '@polkadot/types/codec';
|
||||
import { assert } from '@polkadot/util';
|
||||
|
||||
import { MagicNumber } from './MagicNumber';
|
||||
import { toV10 as v9ToV10 } from './v9/toV10';
|
||||
import { toV11 as v10ToV11 } from './v10/toV11';
|
||||
import { toV12 as v11ToV12 } from './v11/toV12';
|
||||
import { toLatest as v12ToLatest } from './v12/toLatest';
|
||||
import { toV10 } from './v9/toV10';
|
||||
import { toV11 } from './v10/toV11';
|
||||
import { toV12 } from './v11/toV12';
|
||||
import { toLatest } from './v12/toLatest';
|
||||
import { getUniqTypes, toCallsOnly } from './util';
|
||||
|
||||
type MetaMapped = MetadataV9 | MetadataV10 | MetadataV11 | MetadataV12;
|
||||
@@ -77,21 +77,21 @@ export class MetadataVersioned extends Struct {
|
||||
* @description Returns the wrapped values as a V10 object
|
||||
*/
|
||||
public get asV10 (): MetadataV10 {
|
||||
return this._getVersion(10, v9ToV10);
|
||||
return this._getVersion(10, toV10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the wrapped values as a V10 object
|
||||
*/
|
||||
public get asV11 (): MetadataV11 {
|
||||
return this._getVersion(11, v10ToV11);
|
||||
return this._getVersion(11, toV11);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the wrapped values as a V10 object
|
||||
*/
|
||||
public get asV12 (): MetadataV11 {
|
||||
return this._getVersion(12, v11ToV12);
|
||||
return this._getVersion(12, toV12);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ export class MetadataVersioned extends Struct {
|
||||
*/
|
||||
public get asLatest (): MetadataLatest {
|
||||
// This is non-existent & latest - applied here to do the module-specific type conversions
|
||||
return this._getVersion(13, v12ToLatest);
|
||||
return this._getVersion(13, toLatest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"version": "2.6.2-6",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"Polkadot",
|
||||
@@ -21,11 +20,11 @@
|
||||
"@polkadot/metadata": "2.6.2-6",
|
||||
"@polkadot/rpc-provider": "2.6.2-6",
|
||||
"@polkadot/types": "2.6.2-6",
|
||||
"@polkadot/util": "^4.0.2-11",
|
||||
"@polkadot/util": "^4.0.2-12",
|
||||
"memoizee": "^0.4.14",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^4.0.2-11"
|
||||
"@polkadot/keyring": "^4.0.2-12"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"version": "2.6.2-6",
|
||||
"description": "Transport providers for the API",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"Polkadot",
|
||||
@@ -19,15 +18,15 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/types": "2.6.2-6",
|
||||
"@polkadot/util": "^4.0.2-11",
|
||||
"@polkadot/util-crypto": "^4.0.2-11",
|
||||
"@polkadot/x-fetch": "^4.0.2-11",
|
||||
"@polkadot/x-ws": "^4.0.2-11",
|
||||
"@polkadot/util": "^4.0.2-12",
|
||||
"@polkadot/util-crypto": "^4.0.2-12",
|
||||
"@polkadot/x-fetch": "^4.0.2-12",
|
||||
"@polkadot/x-ws": "^4.0.2-12",
|
||||
"bn.js": "^5.1.3",
|
||||
"eventemitter3": "^4.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^4.0.2-11",
|
||||
"@polkadot/keyring": "^4.0.2-12",
|
||||
"@polkadot/metadata": "2.6.2-6",
|
||||
"mock-socket": "^9.0.3",
|
||||
"nock": "^13.0.4"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"version": "2.6.2-6",
|
||||
"description": "Type generation scripts",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"sideEffects": false,
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.js",
|
||||
@@ -31,7 +30,7 @@
|
||||
"@polkadot/metadata": "2.6.2-6",
|
||||
"@polkadot/rpc-provider": "2.6.2-6",
|
||||
"@polkadot/types": "2.6.2-6",
|
||||
"@polkadot/util": "^4.0.2-11",
|
||||
"@polkadot/util": "^4.0.2-12",
|
||||
"handlebars": "^4.7.6",
|
||||
"websocket": "^1.0.32",
|
||||
"yargs": "^16.1.0"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"version": "2.6.2-6",
|
||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"Polkadot",
|
||||
@@ -19,7 +18,7 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/types": "2.6.2-6",
|
||||
"@polkadot/util": "^4.0.2-11",
|
||||
"@polkadot/util": "^4.0.2-12",
|
||||
"bn.js": "^5.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"version": "2.6.2-6",
|
||||
"description": "Implementation of the Parity codec",
|
||||
"main": "index.js",
|
||||
"module": "esm/index.js",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"Polkadot",
|
||||
@@ -19,15 +18,15 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"@polkadot/metadata": "2.6.2-6",
|
||||
"@polkadot/util": "^4.0.2-11",
|
||||
"@polkadot/util-crypto": "^4.0.2-11",
|
||||
"@polkadot/util": "^4.0.2-12",
|
||||
"@polkadot/util-crypto": "^4.0.2-12",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"bn.js": "^5.1.3",
|
||||
"memoizee": "^0.4.14",
|
||||
"rxjs": "^6.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^4.0.2-11",
|
||||
"@polkadot/keyring": "^4.0.2-12",
|
||||
"@types/memoizee": "^0.4.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import { Compact, Json, Option, Raw, Vec } from '@polkadot/types/codec';
|
||||
import { BitVec, Bytes, Data, DoNotConstruct, Null, StorageKey, Text, Type, U256, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types/primitive';
|
||||
import { BitVec, Bool, Bytes, Data, DoNotConstruct, I128, I16, I256, I32, I64, I8, Null, StorageKey, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types/primitive';
|
||||
import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
|
||||
import { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
|
||||
import { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
|
||||
@@ -14,7 +14,7 @@ import { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
|
||||
import { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims';
|
||||
import { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
|
||||
import { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
|
||||
import { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, Gas, HostFnWeights, InstructionWeights, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, Gas, HostFnWeights, InstructionWeights, Limits, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import { 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 { 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 { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
||||
@@ -58,6 +58,9 @@ declare module '@polkadot/types/types/registry' {
|
||||
bool: bool;
|
||||
'Option<bool>': Option<bool>;
|
||||
'Vec<bool>': Vec<bool>;
|
||||
Bool: Bool;
|
||||
'Option<Bool>': Option<Bool>;
|
||||
'Vec<Bool>': Vec<Bool>;
|
||||
Bytes: Bytes;
|
||||
'Option<Bytes>': Option<Bytes>;
|
||||
'Vec<Bytes>': Vec<Bytes>;
|
||||
@@ -70,21 +73,39 @@ declare module '@polkadot/types/types/registry' {
|
||||
i8: i8;
|
||||
'Option<i8>': Option<i8>;
|
||||
'Vec<i8>': Vec<i8>;
|
||||
I8: I8;
|
||||
'Option<I8>': Option<I8>;
|
||||
'Vec<I8>': Vec<I8>;
|
||||
i16: i16;
|
||||
'Option<i16>': Option<i16>;
|
||||
'Vec<i16>': Vec<i16>;
|
||||
I16: I16;
|
||||
'Option<I16>': Option<I16>;
|
||||
'Vec<I16>': Vec<I16>;
|
||||
i32: i32;
|
||||
'Option<i32>': Option<i32>;
|
||||
'Vec<i32>': Vec<i32>;
|
||||
I32: I32;
|
||||
'Option<I32>': Option<I32>;
|
||||
'Vec<I32>': Vec<I32>;
|
||||
i64: i64;
|
||||
'Option<i64>': Option<i64>;
|
||||
'Vec<i64>': Vec<i64>;
|
||||
I64: I64;
|
||||
'Option<I64>': Option<I64>;
|
||||
'Vec<I64>': Vec<I64>;
|
||||
i128: i128;
|
||||
'Option<i128>': Option<i128>;
|
||||
'Vec<i128>': Vec<i128>;
|
||||
I128: I128;
|
||||
'Option<I128>': Option<I128>;
|
||||
'Vec<I128>': Vec<I128>;
|
||||
i256: i256;
|
||||
'Option<i256>': Option<i256>;
|
||||
'Vec<i256>': Vec<i256>;
|
||||
I256: I256;
|
||||
'Option<I256>': Option<I256>;
|
||||
'Vec<I256>': Vec<I256>;
|
||||
Null: Null;
|
||||
'Option<Null>': Option<Null>;
|
||||
'Vec<Null>': Vec<Null>;
|
||||
@@ -101,22 +122,42 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Compact<u8>': Compact<u8>;
|
||||
'Option<u8>': Option<u8>;
|
||||
'Vec<u8>': Vec<u8>;
|
||||
U8: U8;
|
||||
'Compact<U8>': Compact<U8>;
|
||||
'Option<U8>': Option<U8>;
|
||||
'Vec<U8>': Vec<U8>;
|
||||
u16: u16;
|
||||
'Compact<u16>': Compact<u16>;
|
||||
'Option<u16>': Option<u16>;
|
||||
'Vec<u16>': Vec<u16>;
|
||||
U16: U16;
|
||||
'Compact<U16>': Compact<U16>;
|
||||
'Option<U16>': Option<U16>;
|
||||
'Vec<U16>': Vec<U16>;
|
||||
u32: u32;
|
||||
'Compact<u32>': Compact<u32>;
|
||||
'Option<u32>': Option<u32>;
|
||||
'Vec<u32>': Vec<u32>;
|
||||
U32: U32;
|
||||
'Compact<U32>': Compact<U32>;
|
||||
'Option<U32>': Option<U32>;
|
||||
'Vec<U32>': Vec<U32>;
|
||||
u64: u64;
|
||||
'Compact<u64>': Compact<u64>;
|
||||
'Option<u64>': Option<u64>;
|
||||
'Vec<u64>': Vec<u64>;
|
||||
U64: U64;
|
||||
'Compact<U64>': Compact<U64>;
|
||||
'Option<U64>': Option<U64>;
|
||||
'Vec<U64>': Vec<U64>;
|
||||
u128: u128;
|
||||
'Compact<u128>': Compact<u128>;
|
||||
'Option<u128>': Option<u128>;
|
||||
'Vec<u128>': Vec<u128>;
|
||||
U128: U128;
|
||||
'Compact<U128>': Compact<U128>;
|
||||
'Option<U128>': Option<U128>;
|
||||
'Vec<U128>': Vec<U128>;
|
||||
u256: u256;
|
||||
'Compact<u256>': Compact<u256>;
|
||||
'Option<u256>': Option<u256>;
|
||||
@@ -129,6 +170,10 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Compact<usize>': Compact<usize>;
|
||||
'Option<usize>': Option<usize>;
|
||||
'Vec<usize>': Vec<usize>;
|
||||
USize: USize;
|
||||
'Compact<USize>': Compact<USize>;
|
||||
'Option<USize>': Option<USize>;
|
||||
'Vec<USize>': Vec<USize>;
|
||||
Json: Json;
|
||||
'Option<Json>': Option<Json>;
|
||||
'Vec<Json>': Vec<Json>;
|
||||
@@ -527,6 +572,9 @@ declare module '@polkadot/types/types/registry' {
|
||||
InstructionWeights: InstructionWeights;
|
||||
'Option<InstructionWeights>': Option<InstructionWeights>;
|
||||
'Vec<InstructionWeights>': Vec<InstructionWeights>;
|
||||
Limits: Limits;
|
||||
'Option<Limits>': Option<Limits>;
|
||||
'Vec<Limits>': Vec<Limits>;
|
||||
PrefabWasmModule: PrefabWasmModule;
|
||||
'Option<PrefabWasmModule>': Option<PrefabWasmModule>;
|
||||
'Vec<PrefabWasmModule>': Vec<PrefabWasmModule>;
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Text from '../primitive/Text';
|
||||
import U32 from '../primitive/U32';
|
||||
import { Text, U32 } from '../primitive';
|
||||
import { BTreeMap, Struct } from '.';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
import { CodecTo } from '../types';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Text from '../primitive/Text';
|
||||
import U32 from '../primitive/U32';
|
||||
import { Text, U32 } from '../primitive';
|
||||
|
||||
import { BTreeSet, Struct } from '.';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import BN from 'bn.js';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import U32 from '../primitive/U32';
|
||||
import { U32 } from '../primitive';
|
||||
import { CodecDate } from './Date';
|
||||
import { Compact } from '.';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CodecTo } from '../types';
|
||||
import BN from 'bn.js';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import U64 from '../primitive/U64';
|
||||
import { U64 } from '../primitive';
|
||||
import { CodecDate } from './Date';
|
||||
|
||||
describe('Date', (): void => {
|
||||
|
||||
@@ -6,9 +6,7 @@ import { Registry } from '../types';
|
||||
import { u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Null from '../primitive/Null';
|
||||
import Text from '../primitive/Text';
|
||||
import U32 from '../primitive/U32';
|
||||
import { Null, Text, U32 } from '../primitive';
|
||||
import { Enum } from '.';
|
||||
|
||||
describe('Enum', (): void => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'
|
||||
|
||||
import { assert, hexToU8a, isHex, isNumber, isObject, isString, isU8a, isUndefined, stringCamelCase, stringUpperFirst, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import Null from '../primitive/Null';
|
||||
import { Null } from '../primitive/Null';
|
||||
import { mapToTypeMap } from './utils';
|
||||
import { Struct } from './Struct';
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Text from '../primitive/Text';
|
||||
import U32 from '../primitive/U32';
|
||||
import { Text, U32 } from '../primitive';
|
||||
import { HashMap, Struct } from '.';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
import { CodecTo } from '../types';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Text from '../primitive/Text';
|
||||
import U32 from '../primitive/U32';
|
||||
|
||||
import { Text, U32 } from '../primitive';
|
||||
import { CodecMap } from '.';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Bytes from '../primitive/Bytes';
|
||||
import U32 from '../primitive/U32';
|
||||
import Text from '../primitive/Text';
|
||||
import { Bytes, Text, U32 } from '../primitive';
|
||||
import { Option } from '.';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -6,7 +6,7 @@ import { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'
|
||||
|
||||
import { assert, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import Null from '../primitive/Null';
|
||||
import { Null } from '../primitive/Null';
|
||||
import { typeToConstructor } from './utils';
|
||||
|
||||
/** @internal */
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
import { CodecTo } from '../types';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Text from '../primitive/Text';
|
||||
import U32 from '../primitive/U32';
|
||||
import { Text, U32 } from '../primitive';
|
||||
import { Struct, Vec } from '.';
|
||||
|
||||
describe('Struct', (): void => {
|
||||
|
||||
@@ -9,9 +9,7 @@ import { Metadata } from '@polkadot/metadata';
|
||||
import rpcMetadata from '@polkadot/metadata/static';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Text from '../primitive/Text';
|
||||
import U32 from '../primitive/U32';
|
||||
import U128 from '../primitive/U128';
|
||||
import { Text, U32, u128 as U128 } from '../primitive';
|
||||
import { Tuple } from '.';
|
||||
|
||||
describe('Tuple', (): void => {
|
||||
|
||||
@@ -9,7 +9,7 @@ import rpcMetadata from '@polkadot/metadata/static';
|
||||
|
||||
import { createTypeUnsafe, TypeRegistry } from '../create';
|
||||
import { GenericAccountId as AccountId } from '../generic';
|
||||
import Text from '../primitive/Text';
|
||||
import { Text } from '../primitive';
|
||||
import { Tuple, Vec } from '.';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Text from '../primitive/Text';
|
||||
import { Text } from '../primitive';
|
||||
import { VecFixed } from './VecFixed';
|
||||
|
||||
describe('VecFixed', (): void => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../../create';
|
||||
import U32 from '../../primitive/U32';
|
||||
import { U32 } from '../../primitive';
|
||||
import { compareArray } from '.';
|
||||
|
||||
describe('compareArray', (): void => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { Codec } from '../../types';
|
||||
import { TypeRegistry } from '../../create';
|
||||
import U32 from '../../primitive/U32';
|
||||
import { U32 } from '../../primitive';
|
||||
import { compareMap } from '.';
|
||||
|
||||
describe('compareMap', (): void => {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { UIntBitLength } from '../codec/AbstractInt';
|
||||
import { BitLength as U8aFixedBitLength } from '../codec/U8aFixed';
|
||||
import { BTreeMap, BTreeSet, CodecSet, Compact, Enum, HashMap, Int, Option, Result, Struct, Tuple, U8aFixed, UInt, Vec } from '../codec';
|
||||
import { VecFixed } from '../codec/VecFixed';
|
||||
import DoNotConstruct from '../primitive/DoNotConstruct';
|
||||
import { DoNotConstruct } from '../primitive';
|
||||
|
||||
import { getTypeDef } from './getTypeDef';
|
||||
|
||||
|
||||
@@ -8,10 +8,8 @@ import { Codec, Constructor } from '../types';
|
||||
import { isChildClass, u8aToU8a } from '@polkadot/util';
|
||||
import { keccakAsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
import { Struct } from '../codec/Struct';
|
||||
import DoNotConstruct from '../primitive/DoNotConstruct';
|
||||
import Text from '../primitive/Text';
|
||||
import U32 from '../primitive/U32';
|
||||
import { Struct } from '../codec';
|
||||
import { DoNotConstruct, Text, U32 } from '../primitive';
|
||||
import { TypeRegistry } from '.';
|
||||
|
||||
describe('TypeRegistry', (): void => {
|
||||
|
||||
@@ -10,11 +10,10 @@ import { Metadata, extrinsicsFromMeta } from '@polkadot/metadata';
|
||||
import { BN_ZERO, assert, assertReturn, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, u8aToHex } from '@polkadot/util';
|
||||
import { blake2AsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
import { Json } from '../codec/Json';
|
||||
import { Raw } from '../codec/Raw';
|
||||
import { Json, Raw } from '../codec';
|
||||
import { defaultExtensions, expandExtensionTypes, findUnknownExtensions } from '../extrinsic/signedExtensions';
|
||||
import { EventData } from '../generic/Event';
|
||||
import DoNotConstruct from '../primitive/DoNotConstruct';
|
||||
import { GenericEventData } from '../generic';
|
||||
import { DoNotConstruct } from '../primitive';
|
||||
import { createClass, getTypeClass } from './createClass';
|
||||
import { createType } from './createType';
|
||||
import { getTypeDef } from './getTypeDef';
|
||||
@@ -47,7 +46,7 @@ function decorateErrors (_: Registry, metadata: RegistryMetadata, metadataErrors
|
||||
}
|
||||
|
||||
// create event classes from metadata
|
||||
function decorateEvents (registry: Registry, metadata: RegistryMetadata, metadataEvents: Record<string, Constructor<EventData>>): void {
|
||||
function decorateEvents (registry: Registry, metadata: RegistryMetadata, metadataEvents: Record<string, Constructor<GenericEventData>>): void {
|
||||
const modules = metadata.asLatest.modules;
|
||||
const isIndexed = modules.some(({ index }) => !index.eqn(255));
|
||||
|
||||
@@ -73,9 +72,9 @@ function decorateEvents (registry: Registry, metadata: RegistryMetadata, metadat
|
||||
l.error(error);
|
||||
}
|
||||
|
||||
metadataEvents[u8aToHex(eventIndex)] = class extends EventData {
|
||||
metadataEvents[u8aToHex(eventIndex)] = class extends GenericEventData {
|
||||
constructor (registry: Registry, value: Uint8Array) {
|
||||
super(registry, Types, value, typeDef, meta, sectionName, methodName);
|
||||
super(registry, value, Types, typeDef, meta, sectionName, methodName);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -103,7 +102,7 @@ export class TypeRegistry implements Registry {
|
||||
|
||||
readonly #metadataErrors: Record<string, RegistryError> = {};
|
||||
|
||||
readonly #metadataEvents: Record<string, Constructor<EventData>> = {};
|
||||
readonly #metadataEvents: Record<string, Constructor<GenericEventData>> = {};
|
||||
|
||||
#unknownTypes = new Map<string, boolean>();
|
||||
|
||||
@@ -209,7 +208,7 @@ export class TypeRegistry implements Registry {
|
||||
return assertReturn(this.#metadataErrors[hexIndex], `findMetaError: Unable to find Error with index ${hexIndex}/[${errorIndex.toString()}]`);
|
||||
}
|
||||
|
||||
public findMetaEvent (eventIndex: Uint8Array): Constructor<EventData> {
|
||||
public findMetaEvent (eventIndex: Uint8Array): Constructor<GenericEventData> {
|
||||
const hexIndex = u8aToHex(eventIndex);
|
||||
|
||||
return assertReturn(this.#metadataEvents[hexIndex], `findMetaEvent: Unable to find Event with index ${hexIndex}/[${eventIndex.toString()}]`);
|
||||
|
||||
@@ -9,7 +9,7 @@ import { assert, bnToBn, formatNumber, hexToU8a, isHex, isU8a, isObject, u8aToBn
|
||||
import { Enum } from '../codec/Enum';
|
||||
import { Tuple } from '../codec/Tuple';
|
||||
import { Raw } from '../codec/Raw';
|
||||
import U64 from '../primitive/U64';
|
||||
import { u64 as U64 } from '../primitive/U64';
|
||||
import { IMMORTAL_ERA } from './constants';
|
||||
|
||||
type MortalEraValue = [U64, U64];
|
||||
|
||||
@@ -10,7 +10,7 @@ import { u8aToHex } from '@polkadot/util';
|
||||
import { Base } from '../codec/Base';
|
||||
import { Compact } from '../codec/Compact';
|
||||
import { Raw } from '../codec/Raw';
|
||||
import u32 from '../primitive/U32';
|
||||
import { u32 } from '../primitive/U32';
|
||||
import { GenericExtrinsicEra } from './ExtrinsicEra';
|
||||
import { DEFAULT_VERSION } from './constants';
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import { u8aToHex } from '@polkadot/util';
|
||||
import { Compact } from '../codec/Compact';
|
||||
import { Struct } from '../codec/Struct';
|
||||
import { Vec } from '../codec/Vec';
|
||||
import Text from '../primitive/Text';
|
||||
import u8 from '../primitive/U8';
|
||||
import { Text } from '../primitive/Text';
|
||||
import { u8 } from '../primitive/U8';
|
||||
|
||||
export interface SignerPayloadType extends Codec {
|
||||
address: Address;
|
||||
|
||||
@@ -7,8 +7,8 @@ import { ExtrinsicPayloadValue, IKeyringPair, Registry } from '../../types';
|
||||
|
||||
import { Compact } from '../../codec/Compact';
|
||||
import { Struct } from '../../codec/Struct';
|
||||
import Bytes from '../../primitive/Bytes';
|
||||
import u32 from '../../primitive/U32';
|
||||
import { Bytes } from '../../primitive/Bytes';
|
||||
import { u32 } from '../../primitive/U32';
|
||||
import { sign } from '../util';
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import BN from 'bn.js';
|
||||
import { bnToBn, isBn, isBigInt, isNumber, isU8a, isHex } from '@polkadot/util';
|
||||
import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';
|
||||
|
||||
import U32 from '../primitive/U32';
|
||||
import { u32 } from '../primitive/U32';
|
||||
|
||||
export const ENUMSET_SIZE = new BN(64);
|
||||
|
||||
@@ -39,7 +39,7 @@ function decodeAccountIndex (value: AnyNumber): BN | BigInt | Uint8Array | numbe
|
||||
* A wrapper around an AccountIndex, which is a shortened, variable-length encoding
|
||||
* for an Account. We extends from [[U32]] to provide the number-like properties.
|
||||
*/
|
||||
export class GenericAccountIndex extends U32 {
|
||||
export class GenericAccountIndex extends u32 {
|
||||
constructor (registry: Registry, value: AnyNumber = new BN(0)) {
|
||||
super(registry, decodeAccountIndex(value));
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ import { AccountId } from '../interfaces/runtime';
|
||||
import BN from 'bn.js';
|
||||
import { bnToBn } from '@polkadot/util';
|
||||
|
||||
import Bytes from '../primitive/Bytes';
|
||||
import U32 from '../primitive/U32';
|
||||
import { Bytes } from '../primitive/Bytes';
|
||||
import { u32 } from '../primitive/U32';
|
||||
|
||||
// there are all reversed since it is actually encoded as u32, LE,
|
||||
// this means that FRNK has the bytes as KNRF
|
||||
@@ -23,7 +23,7 @@ export { CID_AURA, CID_BABE, CID_GRPA, CID_POW };
|
||||
* @description
|
||||
* A 4-byte identifier (actually a [u8; 4]) identifying the engine, e.g. for Aura it would be [b'a', b'u', b'r', b'a']
|
||||
*/
|
||||
export class GenericConsensusEngineId extends U32 {
|
||||
export class GenericConsensusEngineId extends u32 {
|
||||
public static idToString (input: number | BN): string {
|
||||
return bnToBn(input)
|
||||
.toArray('le')
|
||||
@@ -79,7 +79,7 @@ export class GenericConsensusEngineId extends U32 {
|
||||
const digest = this.registry.createType('RawBabePreDigestCompat', bytes.toU8a(true));
|
||||
|
||||
return sessionValidators[
|
||||
(digest.value as U32).toNumber()
|
||||
(digest.value as u32).toNumber()
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import { AnyJson, Constructor, Registry, RegistryMetadataEvent } from '../types'
|
||||
|
||||
import { Struct } from '../codec/Struct';
|
||||
import { Tuple } from '../codec/Tuple';
|
||||
import Null from '../primitive/Null';
|
||||
import { Null } from '../primitive/Null';
|
||||
|
||||
/**
|
||||
* @name EventData
|
||||
* @name GenericEventData
|
||||
* @description
|
||||
* Wrapper for the actual data that forms part of an [[Event]]
|
||||
*/
|
||||
export class EventData extends Tuple {
|
||||
export class GenericEventData extends Tuple {
|
||||
readonly #meta: EventMetadataLatest;
|
||||
|
||||
readonly #method: string;
|
||||
@@ -24,7 +24,7 @@ export class EventData extends Tuple {
|
||||
|
||||
readonly #typeDef: TypeDef[];
|
||||
|
||||
constructor (registry: Registry, Types: Constructor[], value: Uint8Array, typeDef: TypeDef[], meta: RegistryMetadataEvent, section: string, method: string) {
|
||||
constructor (registry: Registry, value: Uint8Array, Types: Constructor[] = [], typeDef: TypeDef[] = [], meta: RegistryMetadataEvent, section = '<unknown>', method = '<unknown>') {
|
||||
super(registry, Types, value);
|
||||
|
||||
this.#meta = meta as EventMetadataLatest;
|
||||
@@ -82,7 +82,7 @@ export class GenericEvent extends Struct {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
public static decodeEvent (registry: Registry, value: Uint8Array = new Uint8Array()): { DataType: Constructor<Null> | Constructor<EventData>; value?: { index: Uint8Array; data: Uint8Array } } {
|
||||
public static decodeEvent (registry: Registry, value: Uint8Array = new Uint8Array()): { DataType: Constructor<Null> | Constructor<GenericEventData>; value?: { index: Uint8Array; data: Uint8Array } } {
|
||||
if (!value.length) {
|
||||
return { DataType: Null };
|
||||
}
|
||||
@@ -101,8 +101,8 @@ export class GenericEvent extends Struct {
|
||||
/**
|
||||
* @description The wrapped [[EventData]]
|
||||
*/
|
||||
public get data (): EventData {
|
||||
return this.get('data') as EventData;
|
||||
public get data (): GenericEventData {
|
||||
return this.get('data') as GenericEventData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Conviction } from '../interfaces/democracy';
|
||||
import { isBoolean, isNumber, isU8a, isUndefined } from '@polkadot/util';
|
||||
|
||||
import { U8aFixed } from '../codec/U8aFixed';
|
||||
import Bool from '../primitive/Bool';
|
||||
import { bool as Bool } from '../primitive/Bool';
|
||||
|
||||
interface VoteType {
|
||||
aye: boolean;
|
||||
|
||||
@@ -8,7 +8,7 @@ export { GenericAccountIndex } from './AccountIndex';
|
||||
export { GenericBlock } from './Block';
|
||||
export { GenericCall } from './Call';
|
||||
export { GenericConsensusEngineId } from './ConsensusEngineId';
|
||||
export { GenericEvent } from './Event';
|
||||
export { GenericEvent, GenericEventData } from './Event';
|
||||
export { GenericLookupSource } from './LookupSource';
|
||||
export { GenericMultiAddress } from './MultiAddress';
|
||||
export { GenericVote } from './Vote';
|
||||
|
||||
@@ -159,8 +159,70 @@ export interface HostFnWeights extends Struct {
|
||||
|
||||
/** @name InstructionWeights */
|
||||
export interface InstructionWeights extends Struct {
|
||||
readonly growMem: Weight;
|
||||
readonly regular: Weight;
|
||||
readonly i64const: u32;
|
||||
readonly i64load: u32;
|
||||
readonly i64store: u32;
|
||||
readonly select: u32;
|
||||
readonly rIf: u32;
|
||||
readonly br: u32;
|
||||
readonly brIf: u32;
|
||||
readonly brIable: u32;
|
||||
readonly brIablePerEntry: u32;
|
||||
readonly call: u32;
|
||||
readonly callIndirect: u32;
|
||||
readonly callIndirectPerParam: u32;
|
||||
readonly localGet: u32;
|
||||
readonly localSet: u32;
|
||||
readonly local_tee: u32;
|
||||
readonly globalGet: u32;
|
||||
readonly globalSet: u32;
|
||||
readonly memoryCurrent: u32;
|
||||
readonly memoryGrow: u32;
|
||||
readonly i64clz: u32;
|
||||
readonly i64ctz: u32;
|
||||
readonly i64popcnt: u32;
|
||||
readonly i64eqz: u32;
|
||||
readonly i64extendsi32: u32;
|
||||
readonly i64extendui32: u32;
|
||||
readonly i32wrapi64: u32;
|
||||
readonly i64eq: u32;
|
||||
readonly i64ne: u32;
|
||||
readonly i64lts: u32;
|
||||
readonly i64ltu: u32;
|
||||
readonly i64gts: u32;
|
||||
readonly i64gtu: u32;
|
||||
readonly i64les: u32;
|
||||
readonly i64leu: u32;
|
||||
readonly i64ges: u32;
|
||||
readonly i64geu: u32;
|
||||
readonly i64add: u32;
|
||||
readonly i64sub: u32;
|
||||
readonly i64mul: u32;
|
||||
readonly i64divs: u32;
|
||||
readonly i64divu: u32;
|
||||
readonly i64rems: u32;
|
||||
readonly i64remu: u32;
|
||||
readonly i64and: u32;
|
||||
readonly i64or: u32;
|
||||
readonly i64xor: u32;
|
||||
readonly i64shl: u32;
|
||||
readonly i64shrs: u32;
|
||||
readonly i64shru: u32;
|
||||
readonly i64rotl: u32;
|
||||
readonly i64rotr: u32;
|
||||
}
|
||||
|
||||
/** @name Limits */
|
||||
export interface Limits extends Struct {
|
||||
readonly eventTopics: u32;
|
||||
readonly stackHeight: u32;
|
||||
readonly globals: u32;
|
||||
readonly parameters: u32;
|
||||
readonly memoryPages: u32;
|
||||
readonly tableSize: u32;
|
||||
readonly brTableSize: u32;
|
||||
readonly subjectLen: u32;
|
||||
readonly codeSize: u32;
|
||||
}
|
||||
|
||||
/** @name PrefabWasmModule */
|
||||
@@ -178,15 +240,10 @@ export interface PrefabWasmModuleReserved extends Option<Null> {}
|
||||
/** @name Schedule */
|
||||
export interface Schedule extends Struct {
|
||||
readonly version: u32;
|
||||
readonly enablePrintln: bool;
|
||||
readonly limits: Limits;
|
||||
readonly instructionWeights: InstructionWeights;
|
||||
readonly hostFnWeights: HostFnWeights;
|
||||
readonly enablePrintln: bool;
|
||||
readonly maxEventTopics: u32;
|
||||
readonly maxStackHeight: u32;
|
||||
readonly maxMemoryPages: u32;
|
||||
readonly maxTableSize: u32;
|
||||
readonly maxSubjectLen: u32;
|
||||
readonly maxCodeSize: u32;
|
||||
}
|
||||
|
||||
/** @name ScheduleTo212 */
|
||||
|
||||
@@ -10,8 +10,8 @@ export default {
|
||||
rpc: {},
|
||||
types: {
|
||||
Account: {
|
||||
nonce: 'U256',
|
||||
balance: 'U256'
|
||||
nonce: 'u256',
|
||||
balance: 'u256'
|
||||
},
|
||||
Log: {
|
||||
address: 'H160',
|
||||
@@ -19,7 +19,7 @@ export default {
|
||||
data: 'Bytes'
|
||||
},
|
||||
Vicinity: {
|
||||
gasPrice: 'U256',
|
||||
gasPrice: 'u256',
|
||||
origin: 'H160'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import { Struct, Vec } from '@polkadot/types/codec';
|
||||
import { Bytes, U256 } from '@polkadot/types/primitive';
|
||||
import { Bytes, u256 } from '@polkadot/types/primitive';
|
||||
import { H160, H256 } from '@polkadot/types/interfaces/runtime';
|
||||
|
||||
/** @name Account */
|
||||
export interface Account extends Struct {
|
||||
readonly nonce: U256;
|
||||
readonly balance: U256;
|
||||
readonly nonce: u256;
|
||||
readonly balance: u256;
|
||||
}
|
||||
|
||||
/** @name Log */
|
||||
@@ -20,7 +20,7 @@ export interface Log extends Struct {
|
||||
|
||||
/** @name Vicinity */
|
||||
export interface Vicinity extends Struct {
|
||||
readonly gasPrice: U256;
|
||||
readonly gasPrice: u256;
|
||||
readonly origin: H160;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ function decodeBitVec (value?: AnyU8a): Uint8Array | undefined {
|
||||
* A BitVec that represents an array of bits. The bits are however stored encoded. The difference between this
|
||||
* and a normal Bytes would be that the length prefix indicates the number of bits encoded, not the bytes
|
||||
*/
|
||||
export default class BitVec extends Raw {
|
||||
export class BitVec extends Raw {
|
||||
constructor (registry: Registry, value?: AnyU8a) {
|
||||
super(registry, decodeBitVec(value));
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { CodecTo } from '../types';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Bool from './Bool';
|
||||
import { Bool } from '.';
|
||||
|
||||
describe('Bool', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -18,16 +18,16 @@ function decodeBool (value: any): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Bool
|
||||
* @name bool
|
||||
* @description
|
||||
* Representation for a boolean value in the system. It extends the base JS `Boolean` class
|
||||
* @noInheritDoc
|
||||
*/
|
||||
export default class Bool extends Boolean implements Codec {
|
||||
export class bool extends Boolean implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
constructor (registry: Registry, value: Bool | Boolean | Uint8Array | boolean | number = false) {
|
||||
constructor (registry: Registry, value: bool | Boolean | Uint8Array | boolean | number = false) {
|
||||
super(decodeBool(value));
|
||||
|
||||
this.registry = registry;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Bytes from './Bytes';
|
||||
import { Bytes } from '.';
|
||||
|
||||
describe('Bytes', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -46,7 +46,7 @@ function decodeBytes (value?: AnyU8a): Uint8Array | undefined {
|
||||
* is that this version allows for length-encoding. (i.e. it is a variable-item codec, the same
|
||||
* as what is found in [[Text]] and [[Vec]])
|
||||
*/
|
||||
export default class Bytes extends Raw {
|
||||
export class Bytes extends Raw {
|
||||
constructor (registry: Registry, value?: AnyU8a) {
|
||||
super(registry, decodeBytes(value));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Data from './Data';
|
||||
import { Data } from '.';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Registry } from '../types';
|
||||
import { isString, isU8a, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
import { Enum } from '../codec/Enum';
|
||||
import Bytes from './Bytes';
|
||||
import { Bytes } from './Bytes';
|
||||
|
||||
/** @internal */
|
||||
function decodeDataU8a (registry: Registry, value: Uint8Array): [undefined | Uint8Array, number | undefined] {
|
||||
@@ -45,7 +45,7 @@ function decodeData (registry: Registry, value?: Record<string, any> | Uint8Arra
|
||||
* @description
|
||||
* A [[Data]] container with node, raw or hashed data
|
||||
*/
|
||||
export default class Data extends Enum {
|
||||
export class Data extends Enum {
|
||||
constructor (registry: Registry, value?: Record<string, any> | Uint8Array | Enum | string) {
|
||||
super(registry, {
|
||||
None: 'Null', // 0
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import DoNotConstruct from './DoNotConstruct';
|
||||
import { DoNotConstruct } from '.';
|
||||
|
||||
describe('DoNotConstruct', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
|
||||
import { Constructor, Registry } from '../types';
|
||||
|
||||
import Null from './Null';
|
||||
import { Null } from './Null';
|
||||
|
||||
/**
|
||||
* @name DoNotConstruct
|
||||
* @description
|
||||
* An unknown type that fails on construction with the type info
|
||||
*/
|
||||
export default class DoNotConstruct extends Null {
|
||||
export class DoNotConstruct extends Null {
|
||||
constructor (registry: Registry, typeName = 'DoNotConstruct') {
|
||||
super(registry);
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { Int } from '../codec/Int';
|
||||
|
||||
/**
|
||||
* @name I128
|
||||
* @name i128
|
||||
* @description
|
||||
* A 128-bit signed integer
|
||||
*/
|
||||
export default class I128 extends Int.with(128) {}
|
||||
export class i128 extends Int.with(128) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { Int } from '../codec/Int';
|
||||
|
||||
/**
|
||||
* @name I16
|
||||
* @name i16
|
||||
* @description
|
||||
* A 16-bit signed integer
|
||||
*/
|
||||
export default class I16 extends Int.with(16) {}
|
||||
export class i16 extends Int.with(16) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { Int } from '../codec/Int';
|
||||
|
||||
/**
|
||||
* @name I256
|
||||
* @name i256
|
||||
* @description
|
||||
* A 256-bit signed integer
|
||||
*/
|
||||
export default class I256 extends Int.with(256) {}
|
||||
export class i256 extends Int.with(256) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { Int } from '../codec/Int';
|
||||
|
||||
/**
|
||||
* @name I32
|
||||
* @name i32
|
||||
* @description
|
||||
* A 32-bit signed integer
|
||||
*/
|
||||
export default class I32 extends Int.with(32) {}
|
||||
export class i32 extends Int.with(32) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { Int } from '../codec/Int';
|
||||
|
||||
/**
|
||||
* @name I64
|
||||
* @name i64
|
||||
* @description
|
||||
* A 64-bit signed integer
|
||||
*/
|
||||
export default class I64 extends Int.with(64) {}
|
||||
export class i64 extends Int.with(64) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { Int } from '../codec/Int';
|
||||
|
||||
/**
|
||||
* @name I8
|
||||
* @name i8
|
||||
* @description
|
||||
* An 8-bit signed integer
|
||||
*/
|
||||
export default class I8 extends Int.with(8) {}
|
||||
export class i8 extends Int.with(8) {}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Null from './Null';
|
||||
import { Null } from '.';
|
||||
|
||||
describe('Null', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -11,7 +11,7 @@ import { isNull } from '@polkadot/util';
|
||||
* @description
|
||||
* Implements a type that does not contain anything (apart from `null`)
|
||||
*/
|
||||
export default class Null implements Codec {
|
||||
export class Null implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
constructor (registry: Registry) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Metadata, storageFromMeta } from '@polkadot/metadata';
|
||||
import rpcDataV11 from '@polkadot/metadata/v11/static';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import StorageKey from './StorageKey';
|
||||
import { StorageKey } from '.';
|
||||
|
||||
describe('StorageKey', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -8,7 +8,7 @@ import { StorageEntry } from './types';
|
||||
import { assert, isFunction, isString, isU8a } from '@polkadot/util';
|
||||
|
||||
import { AllHashers } from '@polkadot/types/interfaces/metadata/definitions';
|
||||
import Bytes from './Bytes';
|
||||
import { Bytes } from './Bytes';
|
||||
|
||||
interface Decoded {
|
||||
key?: Uint8Array | string;
|
||||
@@ -130,7 +130,7 @@ function decodeArgsFromMeta (registry: Registry, value: Uint8Array, meta?: Stora
|
||||
* A representation of a storage key (typically hashed) in the system. It can be
|
||||
* constructed by passing in a raw key or a StorageEntry with (optional) arguments.
|
||||
*/
|
||||
export default class StorageKey extends Bytes {
|
||||
export class StorageKey extends Bytes {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore This is assigned via this.decodeArgsFromMeta()
|
||||
private _args: Codec[];
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { CodecTo } from '../types';
|
||||
import { TypeRegistry } from '../create';
|
||||
import { Raw } from '../codec/Raw';
|
||||
import Text from './Text';
|
||||
import { Text } from '.';
|
||||
|
||||
describe('Text', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -47,7 +47,7 @@ function decodeText (value?: null | Text | string | AnyU8a | { toString: () => s
|
||||
*/
|
||||
// TODO
|
||||
// - Strings should probably be trimmed (docs do come through with extra padding)
|
||||
export default class Text extends String implements Codec {
|
||||
export class Text extends String implements Codec {
|
||||
public readonly registry: Registry;
|
||||
|
||||
#override: string | null = null;
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
import { stringToU8a, u8aConcat } from '@polkadot/util';
|
||||
|
||||
import { TypeRegistry } from '../create';
|
||||
import Text from './Text';
|
||||
import Type from './Type';
|
||||
import { Text, Type } from '.';
|
||||
|
||||
describe('Type', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { Registry } from '../types';
|
||||
|
||||
import sanitize from '../create/sanitize';
|
||||
import Text from './Text';
|
||||
import { Text } from '.';
|
||||
|
||||
/**
|
||||
* @name Type
|
||||
@@ -13,7 +13,7 @@ import Text from './Text';
|
||||
* on what string provides us, however we also adjust the types received from the runtime,
|
||||
* i.e. we remove the `T::` prefixes found in some types for consistency across implementation.
|
||||
*/
|
||||
export default class Type extends Text {
|
||||
export class Type extends Text {
|
||||
constructor (registry: Registry, value: Text | Uint8Array | string = '') {
|
||||
super(registry, value);
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { UInt } from '../codec/UInt';
|
||||
|
||||
/**
|
||||
* @name U128
|
||||
* @name u128
|
||||
* @description
|
||||
* A 128-bit unsigned integer
|
||||
*/
|
||||
export default class U128 extends UInt.with(128) {}
|
||||
export class u128 extends UInt.with(128) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { UInt } from '../codec/UInt';
|
||||
|
||||
/**
|
||||
* @name U16
|
||||
* @name u16
|
||||
* @description
|
||||
* A 16-bit unsigned integer
|
||||
*/
|
||||
export default class U16 extends UInt.with(16) {}
|
||||
export class u16 extends UInt.with(16) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { UInt } from '../codec/UInt';
|
||||
|
||||
/**
|
||||
* @name U256
|
||||
* @name u256
|
||||
* @description
|
||||
* A 256-bit unsigned integer
|
||||
*/
|
||||
export default class U256 extends UInt.with(256) {}
|
||||
export class u256 extends UInt.with(256) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { UInt } from '../codec/UInt';
|
||||
|
||||
/**
|
||||
* @name U32
|
||||
* @name u32
|
||||
* @description
|
||||
* A 32-bit unsigned integer
|
||||
*/
|
||||
export default class U32 extends UInt.with(32) {}
|
||||
export class u32 extends UInt.with(32) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { UInt } from '../codec/UInt';
|
||||
|
||||
/**
|
||||
* @name U64
|
||||
* @name u64
|
||||
* @description
|
||||
* A 64-bit unsigned integer
|
||||
*/
|
||||
export default class U64 extends UInt.with(64) {}
|
||||
export class u64 extends UInt.with(64) {}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import { UInt } from '../codec/UInt';
|
||||
|
||||
/**
|
||||
* @name U8
|
||||
* @name u8
|
||||
* @description
|
||||
* An 8-bit unsigned integer
|
||||
*/
|
||||
export default class U8 extends UInt.with(8) {}
|
||||
export class u8 extends UInt.with(8) {}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { Registry } from '../types';
|
||||
|
||||
import U32 from './U32';
|
||||
import { u32 } from './U32';
|
||||
|
||||
/**
|
||||
* @name USize
|
||||
@@ -12,7 +12,7 @@ import U32 from './U32';
|
||||
* data. It is a wrapper for [[U32]] as a WASM default (as generated by Rust bindings).
|
||||
* It is not to be used, since it created consensus mismatches.
|
||||
*/
|
||||
export default class USize extends U32 {
|
||||
export class usize extends u32 {
|
||||
constructor (registry: Registry, value?: unknown) {
|
||||
super(registry, value);
|
||||
|
||||
|
||||
@@ -4,25 +4,25 @@
|
||||
/**
|
||||
* @summary Type definitions that are used in the system
|
||||
*/
|
||||
export { default as BitVec } from './BitVec';
|
||||
export { default as bool } from './Bool';
|
||||
export { default as Bytes } from './Bytes';
|
||||
export { default as Data } from './Data';
|
||||
export { default as DoNotConstruct } from './DoNotConstruct';
|
||||
export { default as i8 } from './I8';
|
||||
export { default as i16 } from './I16';
|
||||
export { default as i32 } from './I32';
|
||||
export { default as i64 } from './I64';
|
||||
export { default as i128 } from './I128';
|
||||
export { default as i256 } from './I256';
|
||||
export { default as Null } from './Null';
|
||||
export { default as StorageKey } from './StorageKey';
|
||||
export { default as Text } from './Text';
|
||||
export { default as Type } from './Type';
|
||||
export { default as u8 } from './U8';
|
||||
export { default as u16 } from './U16';
|
||||
export { default as u32 } from './U32';
|
||||
export { default as u64 } from './U64';
|
||||
export { default as u128 } from './U128';
|
||||
export { default as u256, default as U256 } from './U256';
|
||||
export { default as usize } from './USize';
|
||||
export { BitVec } from './BitVec';
|
||||
export { bool, bool as Bool } from './Bool';
|
||||
export { Bytes } from './Bytes';
|
||||
export { Data } from './Data';
|
||||
export { DoNotConstruct } from './DoNotConstruct';
|
||||
export { i8, i8 as I8 } from './I8';
|
||||
export { i16, i16 as I16 } from './I16';
|
||||
export { i32, i32 as I32 } from './I32';
|
||||
export { i64, i64 as I64 } from './I64';
|
||||
export { i128, i128 as I128 } from './I128';
|
||||
export { i256, i256 as I256 } from './I256';
|
||||
export { Null } from './Null';
|
||||
export { StorageKey } from './StorageKey';
|
||||
export { Text } from './Text';
|
||||
export { Type } from './Type';
|
||||
export { u8, u8 as U8 } from './U8';
|
||||
export { u16, u16 as U16 } from './U16';
|
||||
export { u32, u32 as U32 } from './U32';
|
||||
export { u64, u64 as U64 } from './U64';
|
||||
export { u128, u128 as U128 } from './U128';
|
||||
export { u256, u256 as U256 } from './U256';
|
||||
export { usize, usize as USize } from './USize';
|
||||
|
||||
Reference in New Issue
Block a user