diff --git a/babel.esnext.js b/babel.esnext-unused.js similarity index 100% rename from babel.esnext.js rename to babel.esnext-unused.js diff --git a/packages/api-contract/package.json b/packages/api-contract/package.json index 3451f4da9c..050323e98e 100644 --- a/packages/api-contract/package.json +++ b/packages/api-contract/package.json @@ -31,7 +31,7 @@ "@babel/runtime": "^7.12.1", "@polkadot/api": "2.6.2-1", "@polkadot/types": "2.6.2-1", - "@polkadot/util": "^4.0.2-5", + "@polkadot/util": "^4.0.2-7", "bn.js": "^5.1.3", "rxjs": "^6.6.3" } diff --git a/packages/api-derive/package.json b/packages/api-derive/package.json index 67ed61d8f1..ceca214084 100644 --- a/packages/api-derive/package.json +++ b/packages/api-derive/package.json @@ -33,14 +33,14 @@ "@polkadot/api": "2.6.2-1", "@polkadot/rpc-core": "2.6.2-1", "@polkadot/types": "2.6.2-1", - "@polkadot/util": "^4.0.2-5", - "@polkadot/util-crypto": "^4.0.2-5", + "@polkadot/util": "^4.0.2-7", + "@polkadot/util-crypto": "^4.0.2-7", "bn.js": "^5.1.3", "memoizee": "^0.4.14", "rxjs": "^6.6.3" }, "devDependencies": { - "@polkadot/keyring": "^4.0.2-5", + "@polkadot/keyring": "^4.0.2-7", "@polkadot/rpc-provider": "2.6.2-1" } } diff --git a/packages/api/package.json b/packages/api/package.json index 0fa5b2ee34..a42322c094 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -30,14 +30,14 @@ "dependencies": { "@babel/runtime": "^7.12.1", "@polkadot/api-derive": "2.6.2-1", - "@polkadot/keyring": "^4.0.2-5", + "@polkadot/keyring": "^4.0.2-7", "@polkadot/metadata": "2.6.2-1", "@polkadot/rpc-core": "2.6.2-1", "@polkadot/rpc-provider": "2.6.2-1", "@polkadot/types": "2.6.2-1", "@polkadot/types-known": "2.6.2-1", - "@polkadot/util": "^4.0.2-5", - "@polkadot/util-crypto": "^4.0.2-5", + "@polkadot/util": "^4.0.2-7", + "@polkadot/util-crypto": "^4.0.2-7", "bn.js": "^5.1.3", "eventemitter3": "^4.0.7", "rxjs": "^6.6.3" diff --git a/packages/api/src/augment/consts.ts b/packages/api/src/augment/consts.ts index 6b9857e176..8e10a09b32 100644 --- a/packages/api/src/augment/consts.ts +++ b/packages/api/src/augment/consts.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import { Codec } from '@polkadot/types/types'; import { Vec } from '@polkadot/types/codec'; import { u16, u32, u64 } from '@polkadot/types/primitive'; +import { Codec } from '@polkadot/types/types'; import { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime'; import { SessionIndex } from '@polkadot/types/interfaces/session'; import { EraIndex } from '@polkadot/types/interfaces/staking'; diff --git a/packages/api/src/augment/query.ts b/packages/api/src/augment/query.ts index e2ab8bd9c8..d9cd23d630 100644 --- a/packages/api/src/augment/query.ts +++ b/packages/api/src/augment/query.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import { AnyNumber, ITuple, Observable } from '@polkadot/types/types'; import { Option, U8aFixed, Vec } from '@polkadot/types/codec'; import { Bytes, Data, bool, u32, u64 } from '@polkadot/types/primitive'; +import { AnyNumber, ITuple, Observable } from '@polkadot/types/types'; import { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; import { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe'; import { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances'; diff --git a/packages/api/src/augment/rpc.ts b/packages/api/src/augment/rpc.ts index 2f996b99e1..bcd53533d4 100644 --- a/packages/api/src/augment/rpc.ts +++ b/packages/api/src/augment/rpc.ts @@ -1,10 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types'; +import { Metadata } from '@polkadot/metadata'; import { HashMap, Json, Option, Vec } from '@polkadot/types/codec'; import { Bytes, Null, StorageKey, Text, bool, u32, u64 } from '@polkadot/types/primitive'; -import { Metadata } from '@polkadot/types'; +import { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types'; import { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import { EpochAuthorship } from '@polkadot/types/interfaces/babe'; import { BlockHash } from '@polkadot/types/interfaces/chain'; diff --git a/packages/api/src/augment/tx.ts b/packages/api/src/augment/tx.ts index d105609aac..4ef1578850 100644 --- a/packages/api/src/augment/tx.ts +++ b/packages/api/src/augment/tx.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import { AnyNumber, ITuple } from '@polkadot/types/types'; import { Compact, Option, U8aFixed, Vec } from '@polkadot/types/codec'; import { Bytes, Data, bool, u16, u32, u64 } from '@polkadot/types/primitive'; +import { AnyNumber, ITuple } from '@polkadot/types/types'; import { BabeEquivocationProof } from '@polkadot/types/interfaces/babe'; import { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective'; import { CodeHash, Gas, Schedule } from '@polkadot/types/interfaces/contracts'; diff --git a/packages/api/src/base/Decorate.ts b/packages/api/src/base/Decorate.ts index 452971cd8d..e1763250e2 100644 --- a/packages/api/src/base/Decorate.ts +++ b/packages/api/src/base/Decorate.ts @@ -4,6 +4,7 @@ import { Constants, DecoratedMeta } from '@polkadot/metadata/decorate/types'; import { RpcInterface } from '@polkadot/rpc-core/types'; import { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces'; +import { StorageEntry } from '@polkadot/types/primitive/types'; import { AnyFunction, CallFunction, Codec, CodecArg as Arg, InterfaceTypes, Registry, RegistryTypes } from '@polkadot/types/types'; import { SubmittableExtrinsic } from '../submittable/types'; import { ApiInterfaceRx, ApiOptions, ApiTypes, DecorateMethod, DecoratedRpc, DecoratedRpcSection, PaginationOptions, QueryableConsts, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types'; @@ -16,9 +17,9 @@ import { memo } from '@polkadot/api-derive/util'; import { Metadata, expandMetadata } from '@polkadot/metadata'; import { RpcCore } from '@polkadot/rpc-core'; import { WsProvider } from '@polkadot/rpc-provider'; -import { Option, Raw, Text, TypeRegistry, u64 } from '@polkadot/types'; +import { Option, Raw, StorageKey, Text, TypeRegistry, u64 } from '@polkadot/types'; import { DEFAULT_VERSION as EXTRINSIC_DEFAULT_VERSION } from '@polkadot/types/extrinsic/constants'; -import StorageKey, { StorageEntry, unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; +import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { assert, compactStripLength, logger, u8aToHex } from '@polkadot/util'; import { createSubmittable } from '../submittable'; diff --git a/packages/api/src/base/Getters.ts b/packages/api/src/base/Getters.ts index 770a3abc24..a1ab613608 100644 --- a/packages/api/src/base/Getters.ts +++ b/packages/api/src/base/Getters.ts @@ -5,7 +5,8 @@ import { RpcInterface } from '@polkadot/rpc-core/types'; import { Hash, RuntimeVersion } from '@polkadot/types/interfaces'; import { ApiInterfaceRx, ApiTypes, DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '../types'; -import { Metadata, Text } from '@polkadot/types'; +import { Metadata } from '@polkadot/metadata'; +import { Text } from '@polkadot/types'; import { assertReturn } from '@polkadot/util'; import Init from './Init'; diff --git a/packages/api/src/base/Init.ts b/packages/api/src/base/Init.ts index a71797ba1e..78902eef5e 100644 --- a/packages/api/src/base/Init.ts +++ b/packages/api/src/base/Init.ts @@ -9,7 +9,8 @@ import { VersionedRegistry } from './types'; import BN from 'bn.js'; import { Observable, Subscription, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { Metadata, Text, TypeRegistry } from '@polkadot/types'; +import { Metadata } from '@polkadot/metadata'; +import { Text, TypeRegistry } from '@polkadot/types'; import { LATEST_EXTRINSIC_VERSION } from '@polkadot/types/extrinsic/Extrinsic'; import { getSpecAlias, getSpecTypes, getUpgradeVersion } from '@polkadot/types-known'; import { BN_ZERO, assert, logger, u8aEq, u8aToU8a } from '@polkadot/util'; @@ -317,6 +318,7 @@ export default abstract class Init extends Decorate ext.hash.toHex()); diff --git a/packages/api/src/util/index.ts b/packages/api/src/util/index.ts index 506c9a75c9..916a128070 100644 --- a/packages/api/src/util/index.ts +++ b/packages/api/src/util/index.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 export * from './decorate'; -export { default as filterEvents } from './filterEvents'; -export { default as isKeyringPair } from './isKeyringPair'; -export { default as l } from './logging'; + +export { filterEvents } from './filterEvents'; +export { isKeyringPair } from './isKeyringPair'; +export { l } from './logging'; diff --git a/packages/api/src/util/isKeyringPair.ts b/packages/api/src/util/isKeyringPair.ts index d22cb26f0f..d0dfa89260 100644 --- a/packages/api/src/util/isKeyringPair.ts +++ b/packages/api/src/util/isKeyringPair.ts @@ -6,6 +6,6 @@ import { IKeyringPair } from '@polkadot/types/types'; import { isFunction } from '@polkadot/util'; -export default function isKeyringPair (account: string | IKeyringPair | AccountId | Address): account is IKeyringPair { +export function isKeyringPair (account: string | IKeyringPair | AccountId | Address): account is IKeyringPair { return isFunction((account as IKeyringPair).sign); } diff --git a/packages/api/src/util/logging.ts b/packages/api/src/util/logging.ts index 2fab275834..4f796278c1 100644 --- a/packages/api/src/util/logging.ts +++ b/packages/api/src/util/logging.ts @@ -3,6 +3,4 @@ import { logger } from '@polkadot/util'; -const l = logger('api/util'); - -export default l; +export const l = logger('api/util'); diff --git a/packages/api/src/util/validate.ts b/packages/api/src/util/validate.ts index 93653a154a..74ff6f58eb 100644 --- a/packages/api/src/util/validate.ts +++ b/packages/api/src/util/validate.ts @@ -1,7 +1,7 @@ // Copyright 2017-2019 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { StorageEntry } from '@polkadot/types/primitive/StorageKey'; +import { StorageEntry } from '@polkadot/types/primitive/types'; import { Type } from '@polkadot/types'; import { assert, isUndefined } from '@polkadot/util'; diff --git a/packages/metadata/package.json b/packages/metadata/package.json index 8d5097df30..3e0482c7d2 100644 --- a/packages/metadata/package.json +++ b/packages/metadata/package.json @@ -31,11 +31,11 @@ "@babel/runtime": "^7.12.1", "@polkadot/types": "2.6.2-1", "@polkadot/types-known": "2.6.2-1", - "@polkadot/util": "^4.0.2-5", - "@polkadot/util-crypto": "^4.0.2-5", + "@polkadot/util": "^4.0.2-7", + "@polkadot/util-crypto": "^4.0.2-7", "bn.js": "^5.1.3" }, "devDependencies": { - "@polkadot/keyring": "^4.0.2-5" + "@polkadot/keyring": "^4.0.2-7" } } diff --git a/packages/metadata/src/MagicNumber.ts b/packages/metadata/src/MagicNumber.ts index 35fa71f175..c1bcf48ab6 100644 --- a/packages/metadata/src/MagicNumber.ts +++ b/packages/metadata/src/MagicNumber.ts @@ -5,7 +5,7 @@ import { AnyNumber, Registry } from '@polkadot/types/types'; import { assert } from '@polkadot/util'; -import U32 from '@polkadot/types/primitive/U32'; +import { u32 as U32 } from '@polkadot/types/primitive'; export const MAGIC_NUMBER = 0x6174656d; // `meta`, reversed for Little Endian encoding diff --git a/packages/metadata/src/MetadataVersioned.ts b/packages/metadata/src/MetadataVersioned.ts index cbf9873f5d..b6ac9f311e 100644 --- a/packages/metadata/src/MetadataVersioned.ts +++ b/packages/metadata/src/MetadataVersioned.ts @@ -4,7 +4,7 @@ import { MetadataAll, MetadataLatest, MetadataV9, MetadataV10, MetadataV11, MetadataV12 } from '@polkadot/types/interfaces/metadata'; import { Registry } from '@polkadot/types/types'; -import Struct from '@polkadot/types/codec/Struct'; +import { Struct } from '@polkadot/types/codec'; import { assert } from '@polkadot/util'; import { MagicNumber } from './MagicNumber'; diff --git a/packages/metadata/src/decorate/consts/fromMetadata.spec.ts b/packages/metadata/src/decorate/consts/fromMetadata.spec.ts index 5af102e88d..3607777352 100644 --- a/packages/metadata/src/decorate/consts/fromMetadata.spec.ts +++ b/packages/metadata/src/decorate/consts/fromMetadata.spec.ts @@ -3,8 +3,9 @@ import { Constants } from '../types'; -import { Metadata, TypeRegistry } from '@polkadot/types'; +import { TypeRegistry } from '@polkadot/types'; +import { Metadata } from '../../Metadata'; import rpcMetadata from '../../static'; import rpcMetadataV10 from '../../v10/static'; import { constantsFromMeta } from './fromMetadata'; diff --git a/packages/metadata/src/decorate/consts/fromMetadata.ts b/packages/metadata/src/decorate/consts/fromMetadata.ts index f899fd5bd5..44ff6df1b0 100644 --- a/packages/metadata/src/decorate/consts/fromMetadata.ts +++ b/packages/metadata/src/decorate/consts/fromMetadata.ts @@ -7,7 +7,7 @@ import { Constants, ConstantCodec, ModuleConstants } from '../types'; import { createTypeUnsafe } from '@polkadot/types/create'; import { hexToU8a, stringCamelCase } from '@polkadot/util'; -import { Metadata } from '../..'; +import { Metadata } from '../../Metadata'; /** @internal */ export function constantsFromMeta (registry: Registry, metadata: Metadata): Constants { diff --git a/packages/metadata/src/decorate/extrinsics/createUnchecked.ts b/packages/metadata/src/decorate/extrinsics/createUnchecked.ts index 9ebbbde35c..43fbdc5e10 100644 --- a/packages/metadata/src/decorate/extrinsics/createUnchecked.ts +++ b/packages/metadata/src/decorate/extrinsics/createUnchecked.ts @@ -7,7 +7,7 @@ import { AnyJson, CallFunction, Registry, RegistryMetadataCall } from '@polkadot import { assert, stringCamelCase } from '@polkadot/util'; /** @internal */ -export default function createDescriptor (registry: Registry, section: string, callIndex: Uint8Array, callMetadata: RegistryMetadataCall): CallFunction { +export default function createUnchecked (registry: Registry, section: string, callIndex: Uint8Array, callMetadata: RegistryMetadataCall): CallFunction { const expectedArgs = callMetadata.args; const funcName = stringCamelCase(callMetadata.name); diff --git a/packages/metadata/src/decorate/extrinsics/fromMetadata.spec.ts b/packages/metadata/src/decorate/extrinsics/fromMetadata.spec.ts index 509656d15b..41dd589b10 100644 --- a/packages/metadata/src/decorate/extrinsics/fromMetadata.spec.ts +++ b/packages/metadata/src/decorate/extrinsics/fromMetadata.spec.ts @@ -1,8 +1,9 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Metadata, TypeRegistry } from '@polkadot/types'; +import { TypeRegistry } from '@polkadot/types'; +import { Metadata } from '../../Metadata'; import json from '../../static'; import { extrinsicsFromMeta } from './fromMetadata'; diff --git a/packages/metadata/src/decorate/extrinsics/index.spec.ts b/packages/metadata/src/decorate/extrinsics/index.spec.ts index d6deafbb11..382d216903 100644 --- a/packages/metadata/src/decorate/extrinsics/index.spec.ts +++ b/packages/metadata/src/decorate/extrinsics/index.spec.ts @@ -3,8 +3,9 @@ import BN from 'bn.js'; import { createTestPairs } from '@polkadot/keyring/testingPairs'; -import { Metadata, TypeRegistry } from '@polkadot/types'; +import { TypeRegistry } from '@polkadot/types'; +import { Metadata } from '../../Metadata'; import metadataStatic from '../../static'; import { extrinsicsFromMeta } from './fromMetadata'; diff --git a/packages/metadata/src/decorate/index.spec.ts b/packages/metadata/src/decorate/index.spec.ts index f812fb3429..8600284ab6 100644 --- a/packages/metadata/src/decorate/index.spec.ts +++ b/packages/metadata/src/decorate/index.spec.ts @@ -4,7 +4,7 @@ import { TypeRegistry } from '@polkadot/types/create'; import { u8aToHex } from '@polkadot/util'; -import { Metadata } from '..'; +import { Metadata } from '../Metadata'; import json from '../static'; import { constantsFromMeta, extrinsicsFromMeta, storageFromMeta } from './'; diff --git a/packages/metadata/src/decorate/index.ts b/packages/metadata/src/decorate/index.ts index f535869ca0..dad4e545fc 100644 --- a/packages/metadata/src/decorate/index.ts +++ b/packages/metadata/src/decorate/index.ts @@ -6,7 +6,7 @@ import { DecoratedMeta } from './types'; import { assert } from '@polkadot/util'; -import { Metadata } from '..'; +import { Metadata } from '../Metadata'; import { constantsFromMeta } from './consts/fromMetadata'; import { extrinsicsFromMeta } from './extrinsics/fromMetadata'; import { storageFromMeta } from './storage/fromMetadata'; diff --git a/packages/metadata/src/decorate/storage/createFunction.ts b/packages/metadata/src/decorate/storage/createFunction.ts index 50462a8ee3..60b0dbeaff 100644 --- a/packages/metadata/src/decorate/storage/createFunction.ts +++ b/packages/metadata/src/decorate/storage/createFunction.ts @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import { StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; +import { StorageEntry } from '@polkadot/types/primitive/types'; import { Codec, Registry } from '@polkadot/types/types'; import BN from 'bn.js'; -import { Compact, Raw } from '@polkadot/types/codec'; +import { Raw } from '@polkadot/types/codec'; import { createTypeUnsafe } from '@polkadot/types/create'; -import StorageKey, { StorageEntry } from '@polkadot/types/primitive/StorageKey'; -import { assert, compactStripLength, isNull, isUndefined, stringLowerFirst, u8aConcat } from '@polkadot/util'; +import { StorageKey } from '@polkadot/types'; +import { assert, compactAddLength, compactStripLength, isNull, isUndefined, stringLowerFirst, u8aConcat } from '@polkadot/util'; import { xxhashAsU8a } from '@polkadot/util-crypto'; import getHasher, { HasherFunction } from './getHasher'; @@ -75,7 +76,7 @@ function createKeyDoubleMap (registry: Registry, itemFn: CreateItemFn, args: [Cr const val2 = createTypeUnsafe(registry, map.key2.toString(), [key2]).toU8a(); // as per createKey, always add the length prefix (underlying it is Bytes) - return Compact.addLengthPrefix(u8aConcat( + return compactAddLength(u8aConcat( createPrefixedKey(itemFn), hasher1(val1), hasher2(val2) @@ -97,7 +98,7 @@ function createKey (registry: Registry, itemFn: CreateItemFn, arg: CreateArgType } // StorageKey is a Bytes, so is length-prefixed - return Compact.addLengthPrefix(u8aConcat( + return compactAddLength(u8aConcat( createPrefixedKey(itemFn), param.length ? hasher(param) diff --git a/packages/metadata/src/decorate/storage/storage.ts b/packages/metadata/src/decorate/storage/storage.ts index 9132e06956..27516f96b7 100644 --- a/packages/metadata/src/decorate/storage/storage.ts +++ b/packages/metadata/src/decorate/storage/storage.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { StorageEntry } from '@polkadot/types/primitive/StorageKey'; +import { StorageEntry } from '@polkadot/types/primitive/types'; import { Registry } from '@polkadot/types/types'; import { Storage } from '../types'; diff --git a/packages/metadata/src/decorate/storage/substrate.ts b/packages/metadata/src/decorate/storage/substrate.ts index 187d459c83..5bab9713fa 100644 --- a/packages/metadata/src/decorate/storage/substrate.ts +++ b/packages/metadata/src/decorate/storage/substrate.ts @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; +import { StorageEntryMetadataLatest } from '@polkadot/types/interfaces'; +import { StorageEntry } from '@polkadot/types/primitive/types'; import { Registry } from '@polkadot/types/types'; -import { StorageEntry } from '@polkadot/types/primitive/StorageKey'; - import createFunction from './createFunction'; interface SubstrateMetadata { diff --git a/packages/metadata/src/decorate/types.ts b/packages/metadata/src/decorate/types.ts index 54504d9c47..af5ff9921d 100644 --- a/packages/metadata/src/decorate/types.ts +++ b/packages/metadata/src/decorate/types.ts @@ -3,7 +3,7 @@ import { AugmentedConst, QueryableConsts, QueryableModuleConsts } from '@polkadot/api/types/consts'; import { Codec, ModulesWithCalls } from '@polkadot/types/types'; -import { StorageEntry } from '@polkadot/types/primitive/StorageKey'; +import { StorageEntry } from '@polkadot/types/primitive/types'; export interface ModuleStorage { [key: string]: StorageEntry; diff --git a/packages/metadata/src/types.ts b/packages/metadata/src/types.ts index e8100ea358..2f1aed3a89 100644 --- a/packages/metadata/src/types.ts +++ b/packages/metadata/src/types.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { Codec } from '@polkadot/types/types'; -import Vec from '@polkadot/types/codec/Vec'; +import { Vec } from '@polkadot/types/codec'; export interface MetadataInterface extends Codec { modules: Vec; diff --git a/packages/metadata/src/util/testUtil.ts b/packages/metadata/src/util/testUtil.ts index 5195c2917a..a4d93adf5e 100644 --- a/packages/metadata/src/util/testUtil.ts +++ b/packages/metadata/src/util/testUtil.ts @@ -7,7 +7,7 @@ import { MetadataInterface } from '../types'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import getUniqTypes from './getUniqTypes'; -import { Metadata } from '..'; +import { Metadata } from '../Metadata'; /** @internal */ export function decodeLatestSubstrate (registry: Registry, version: number, rpcData: string, staticSubstrate: Record): void { diff --git a/packages/metadata/src/util/toCallsOnly.spec.ts b/packages/metadata/src/util/toCallsOnly.spec.ts index 9dc552a523..3f716b11d3 100644 --- a/packages/metadata/src/util/toCallsOnly.spec.ts +++ b/packages/metadata/src/util/toCallsOnly.spec.ts @@ -4,7 +4,7 @@ import { TypeRegistry } from '@polkadot/types'; import staticData from '../static'; -import { Metadata } from '..'; +import { Metadata } from '../Metadata'; describe('toCallsOnly', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index 9f5abb8eeb..7f396a4013 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -32,11 +32,11 @@ "@polkadot/metadata": "2.6.2-1", "@polkadot/rpc-provider": "2.6.2-1", "@polkadot/types": "2.6.2-1", - "@polkadot/util": "^4.0.2-5", + "@polkadot/util": "^4.0.2-7", "memoizee": "^0.4.14", "rxjs": "^6.6.3" }, "devDependencies": { - "@polkadot/keyring": "^4.0.2-5" + "@polkadot/keyring": "^4.0.2-7" } } diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index 07aed597f4..f9097a238a 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -30,15 +30,15 @@ "dependencies": { "@babel/runtime": "^7.12.1", "@polkadot/types": "2.6.2-1", - "@polkadot/util": "^4.0.2-5", - "@polkadot/util-crypto": "^4.0.2-5", - "@polkadot/x-fetch": "^4.0.2-5", - "@polkadot/x-ws": "^4.0.2-5", + "@polkadot/util": "^4.0.2-7", + "@polkadot/util-crypto": "^4.0.2-7", + "@polkadot/x-fetch": "^4.0.2-7", + "@polkadot/x-ws": "^4.0.2-7", "bn.js": "^5.1.3", "eventemitter3": "^4.0.7" }, "devDependencies": { - "@polkadot/keyring": "^4.0.2-5", + "@polkadot/keyring": "^4.0.2-7", "@polkadot/metadata": "2.6.2-1", "mock-socket": "^9.0.3", "nock": "^13.0.4" diff --git a/packages/typegen/package.json b/packages/typegen/package.json index 06b05b3810..cff2ea2e41 100644 --- a/packages/typegen/package.json +++ b/packages/typegen/package.json @@ -42,7 +42,7 @@ "@polkadot/metadata": "2.6.2-1", "@polkadot/rpc-provider": "2.6.2-1", "@polkadot/types": "2.6.2-1", - "@polkadot/util": "^4.0.2-5", + "@polkadot/util": "^4.0.2-7", "handlebars": "^4.7.6", "websocket": "^1.0.32", "yargs": "^16.1.0" diff --git a/packages/typegen/src/util/derived.spec.ts b/packages/typegen/src/util/derived.spec.ts index 9a436862d3..a896d6bab8 100644 --- a/packages/typegen/src/util/derived.spec.ts +++ b/packages/typegen/src/util/derived.spec.ts @@ -20,6 +20,7 @@ describe('getSimilarTypes', (): void => { genericTypes: {}, ignoredTypes: [], localTypes: {}, + metadataTypes: {}, primitiveTypes: {}, typeToModule: {}, typesTypes: {} diff --git a/packages/typegen/src/util/formatting.spec.ts b/packages/typegen/src/util/formatting.spec.ts index 03eb8ac1df..aa0b6f7a99 100644 --- a/packages/typegen/src/util/formatting.spec.ts +++ b/packages/typegen/src/util/formatting.spec.ts @@ -13,6 +13,7 @@ describe('formatType', (): void => { genericTypes: {}, ignoredTypes: [], localTypes: {}, + metadataTypes: {}, primitiveTypes: {}, typeToModule: {}, typesTypes: {} diff --git a/packages/typegen/src/util/formatting.ts b/packages/typegen/src/util/formatting.ts index 2c04e0db9e..a9fb4a02fc 100644 --- a/packages/typegen/src/util/formatting.ts +++ b/packages/typegen/src/util/formatting.ts @@ -20,8 +20,6 @@ interface This { }[] } -const TYPES_NON_PRIMITIVE = ['Metadata']; - export const HEADER = (type: 'chain' | 'defs'): string => `// Auto-generated via \`yarn polkadot-types-from-${type}\`, do not edit\n/* eslint-disable */\n\n`; Handlebars.registerPartial({ @@ -34,8 +32,8 @@ Handlebars.registerHelper({ const { imports, types } = this as unknown as This; const defs = [ { - file: '@polkadot/types/types', - types: Object.keys(imports.typesTypes) + file: '@polkadot/metadata', + types: Object.keys(imports.metadataTypes) }, { file: '@polkadot/types/codec', @@ -53,15 +51,11 @@ Handlebars.registerHelper({ }, { file: '@polkadot/types/primitive', - types: Object - .keys(imports.primitiveTypes) - .filter((name) => !TYPES_NON_PRIMITIVE.includes(name)) + types: Object.keys(imports.primitiveTypes) }, { - file: '@polkadot/types', - types: Object - .keys(imports.primitiveTypes) - .filter((name) => TYPES_NON_PRIMITIVE.includes(name)) + file: '@polkadot/types/types', + types: Object.keys(imports.typesTypes) }, ...types ]; diff --git a/packages/typegen/src/util/imports.ts b/packages/typegen/src/util/imports.ts index 530bdc1ff3..a3334687e6 100644 --- a/packages/typegen/src/util/imports.ts +++ b/packages/typegen/src/util/imports.ts @@ -28,6 +28,7 @@ export interface TypeImports { ignoredTypes: string[]; // No need to import these types localTypes: TypeExistMap; // `import {} from '../something'` primitiveTypes: TypeExist; // `import {} from '@polkadot/types/primitive` + metadataTypes: TypeExist; // `import {} from '@polkadot/metadata` typesTypes: TypeExist; // `import {} from '@polkadot/types/types` definitions: Record; // all definitions typeToModule: Record; @@ -37,20 +38,22 @@ export interface TypeImports { // imports in the output file, dep-duped and sorted /** @internal */ export function setImports (allDefs: Record, imports: TypeImports, types: string[]): void { - const { codecTypes, extrinsicTypes, genericTypes, ignoredTypes, localTypes, primitiveTypes, typesTypes } = imports; + const { codecTypes, extrinsicTypes, genericTypes, ignoredTypes, localTypes, metadataTypes, primitiveTypes, typesTypes } = imports; types.forEach((type): void => { if (ignoredTypes.includes(type)) { // do nothing } else if (['AnyNumber', 'CallFunction', 'Codec', 'IExtrinsic', 'ITuple'].includes(type)) { typesTypes[type] = true; + } else if (type === 'Metadata') { + metadataTypes[type] = true; } else if ((codecClasses as Record)[type]) { codecTypes[type] = true; } else if ((extrinsicClasses as Record)[type]) { extrinsicTypes[type] = true; } else if ((genericClasses as Record)[type]) { genericTypes[type] = true; - } else if ((primitiveClasses as Record)[type] || type === 'Metadata') { + } else if ((primitiveClasses as Record)[type]) { primitiveTypes[type] = true; } else if (type.includes('<') || type.includes('(') || (type.includes('[') && !type.includes('|'))) { // If the type is a bit special (tuple, fixed u8, nested type...), then we @@ -118,6 +121,7 @@ export function createImports (importDefinitions: Record extends Array im public get encodedLength (): number { return this.reduce((total, raw): number => { return total + raw.encodedLength; - }, Compact.encodeU8a(this.length).length); + }, compactToU8a(this.length).length); } /** @@ -124,7 +123,7 @@ export default abstract class AbstractArray extends Array im return isBare ? u8aConcat(...encoded) : u8aConcat( - Compact.encodeU8a(this.length), + compactToU8a(this.length), ...encoded ); } diff --git a/packages/types/src/codec/BTreeSet.ts b/packages/types/src/codec/BTreeSet.ts index c3c8863922..b2deb136f4 100644 --- a/packages/types/src/codec/BTreeSet.ts +++ b/packages/types/src/codec/BTreeSet.ts @@ -4,9 +4,8 @@ import { H256 } from '../interfaces/runtime'; import { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types'; -import { isHex, hexToU8a, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; +import { isHex, hexToU8a, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a, compactFromU8a, compactToU8a } from '@polkadot/util'; -import Compact from './Compact'; import { compareSet, decodeU8a, typeToConstructor } from './utils'; const l = logger('BTreeSet'); @@ -14,7 +13,7 @@ const l = logger('BTreeSet'); /** @internal */ function decodeSetFromU8a (registry: Registry, ValClass: Constructor, u8a: Uint8Array): Set { const output = new Set(); - const [offset, length] = Compact.decodeU8a(u8a); + const [offset, length] = compactFromU8a(u8a); const types = []; for (let i = 0; i < length.toNumber(); i++) { @@ -103,7 +102,7 @@ export default class BTreeSet extends Set implements * @description The length of the value when encoded as a Uint8Array */ public get encodedLength (): number { - let len = Compact.encodeU8a(this.size).length; + let len = compactToU8a(this.size).length; this.forEach((v: V) => { len += v.encodedLength; @@ -188,7 +187,7 @@ export default class BTreeSet extends Set implements const encoded = new Array(); if (!isBare) { - encoded.push(Compact.encodeU8a(this.size)); + encoded.push(compactToU8a(this.size)); } this.forEach((v: V) => { diff --git a/packages/types/src/codec/Compact.spec.ts b/packages/types/src/codec/Compact.spec.ts index 4f9d4f5533..3021f4dabc 100644 --- a/packages/types/src/codec/Compact.spec.ts +++ b/packages/types/src/codec/Compact.spec.ts @@ -7,104 +7,10 @@ import { TypeRegistry } from '../create'; import Moment from './Date'; import U32 from '../primitive/U32'; import Compact from './Compact'; -import UInt from './UInt'; describe('Compact', (): void => { const registry = new TypeRegistry(); - describe('encodeU8a', (): void => { - it('encodes short u8', (): void => { - expect( - Compact.encodeU8a(18) - ).toEqual( - new Uint8Array([18 << 2]) - ); - }); - - it('encodes max u8 values', (): void => { - expect( - Compact.encodeU8a(new (UInt.with(32))(registry, 63)) - ).toEqual( - new Uint8Array([0b11111100]) - ); - }); - - it('encodes basic u16 value', (): void => { - expect( - Compact.encodeU8a(511) - ).toEqual( - new Uint8Array([0b11111101, 0b00000111]) - ); - }); - - it('encodes basic ua6 (not at edge)', (): void => { - expect( - Compact.encodeU8a(111) - ).toEqual( - new Uint8Array([0xbd, 0x01]) - ); - }); - - it('encodes basic u32 values (short)', (): void => { - expect( - Compact.encodeU8a(0xffff) - ).toEqual( - new Uint8Array([254, 255, 3, 0]) - ); - }); - - it('encodes basic u32 values (full)', (): void => { - expect( - Compact.encodeU8a(0xfffffff9) - ).toEqual( - new Uint8Array([3, 249, 255, 255, 255]) - ); - }); - - it('encondes a large balance', (): void => { - expect( - Compact.encodeU8a(registry.createType('Balance', '0x5af3107a4000')) - ).toEqual( - new Uint8Array([ - 3 + ((6 - 4) << 2), - 0x00, 0x40, 0x7a, 0x10, 0xf3, 0x5a - ]) - ); - }); - }); - - describe('decodeU8a', (): void => { - it('decoded u8 value', (): void => { - expect( - Compact.decodeU8a(new Uint8Array([0b11111100]), 32) - ).toEqual([1, new BN(63)]); - }); - - it('decodes from same u16 encoded value', (): void => { - expect( - Compact.decodeU8a(new Uint8Array([0b11111101, 0b00000111]), 32) - ).toEqual([2, new BN(511)]); - }); - - it('decodes from same u32 encoded value (short)', (): void => { - expect( - Compact.decodeU8a(new Uint8Array([254, 255, 3, 0]), 32) - ).toEqual([4, new BN(0xffff)]); - }); - - it('decodes from same u32 encoded value (full)', (): void => { - expect( - Compact.decodeU8a(new Uint8Array([3, 249, 255, 255, 255]), 32) - ).toEqual([5, new BN(0xfffffff9)]); - }); - - it('decodes from same u32 as u64 encoded value (full, default)', (): void => { - expect( - Compact.decodeU8a(new Uint8Array([3, 249, 255, 255, 255]), 64) - ).toEqual([5, new BN(0xfffffff9)]); - }); - }); - describe('constructor', (): void => { it('has support for BigInt', (): void => { expect( @@ -170,12 +76,4 @@ describe('Compact', (): void => { expect(new (Compact.with('u128'))(registry, 12345678987654321n).toBigInt() === 12345678987654321n).toBe(true); }); }); - - describe('helpers', (): void => { - it('correctly adds the length prefix', (): void => { - expect( - Compact.addLengthPrefix(Uint8Array.from([12, 13])) - ).toEqual(Uint8Array.from([2 << 2, 12, 13])); - }); - }); }); diff --git a/packages/types/src/codec/Compact.ts b/packages/types/src/codec/Compact.ts index 6361c3636b..0462d9eb07 100644 --- a/packages/types/src/codec/Compact.ts +++ b/packages/types/src/codec/Compact.ts @@ -5,8 +5,7 @@ import { H256 } from '@polkadot/types/interfaces'; import { AnyJson, AnyNumber, Codec, Constructor, ICompact, InterfaceTypes, Registry } from '../types'; import BN from 'bn.js'; -import { compactAddLength, compactFromU8a, compactStripLength, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util'; -import { DEFAULT_BITLENGTH } from '@polkadot/util/compact/defaults'; +import { compactFromU8a, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util'; import { typeToConstructor } from './utils'; import { UIntBitLength } from './AbstractInt'; @@ -46,23 +45,6 @@ export default class Compact implements ICompact }; } - /** - * Prepend a Uint8Array with its compact length. - * - * @param u8a - The Uint8Array to be prefixed - */ - public static addLengthPrefix = compactAddLength; - - public static decodeU8a = compactFromU8a; - - public static encodeU8a = compactToU8a; - - public static stripLengthPrefix (u8a: Uint8Array, bitLength: UIntBitLength = DEFAULT_BITLENGTH): Uint8Array { - const [, value] = compactStripLength(u8a, bitLength); - - return value; - } - /** @internal */ public static decodeCompact (registry: Registry, Type: Constructor, value: Compact | AnyNumber): CompactEncodable { if (value instanceof Compact) { @@ -71,7 +53,7 @@ export default class Compact implements ICompact return new Type(registry, value); } - const [, _value] = Compact.decodeU8a(value, new Type(registry, 0).bitLength() as UIntBitLength); + const [, _value] = compactFromU8a(value, new Type(registry, 0).bitLength() as UIntBitLength); return new Type(registry, _value); } @@ -177,7 +159,7 @@ export default class Compact implements ICompact */ // eslint-disable-next-line @typescript-eslint/no-unused-vars public toU8a (isBare?: boolean): Uint8Array { - return Compact.encodeU8a(this.#raw.toBn()); + return compactToU8a(this.#raw.toBn()); } /** diff --git a/packages/types/src/codec/Map.ts b/packages/types/src/codec/Map.ts index f14dcaaf7c..5586c59e39 100644 --- a/packages/types/src/codec/Map.ts +++ b/packages/types/src/codec/Map.ts @@ -4,9 +4,8 @@ import { H256 } from '../interfaces/runtime'; import { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types'; -import { isHex, hexToU8a, isObject, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; +import { isHex, hexToU8a, isObject, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a, compactFromU8a, compactToU8a } from '@polkadot/util'; -import Compact from './Compact'; import { compareMap, decodeU8a, typeToConstructor } from './utils'; const l = logger('Map'); @@ -14,7 +13,7 @@ const l = logger('Map'); /** @internal */ function decodeMapFromU8a (registry: Registry, KeyClass: Constructor, ValClass: Constructor, u8a: Uint8Array): Map { const output = new Map(); - const [offset, length] = Compact.decodeU8a(u8a); + const [offset, length] = compactFromU8a(u8a); const types = []; for (let i = 0; i < length.toNumber(); i++) { @@ -110,7 +109,7 @@ export default class CodecMap * @description The length of the value when encoded as a Uint8Array */ public get encodedLength (): number { - let len = Compact.encodeU8a(this.size).length; + let len = compactToU8a(this.size).length; this.forEach((v: V, k: K) => { len += v.encodedLength + k.encodedLength; @@ -195,7 +194,7 @@ export default class CodecMap const encoded = new Array(); if (!isBare) { - encoded.push(Compact.encodeU8a(this.size)); + encoded.push(compactToU8a(this.size)); } this.forEach((v: V, k: K) => { diff --git a/packages/types/src/codec/Raw.ts b/packages/types/src/codec/Raw.ts index 120cb75c0f..cbce6ba25f 100644 --- a/packages/types/src/codec/Raw.ts +++ b/packages/types/src/codec/Raw.ts @@ -96,7 +96,7 @@ export default class Raw extends Uint8Array implements IU8a { } /** - * @description Create a new subarray from the actual buffer. This is needed for compat reasons since a new Uint8Array gets returned here + * @description Create a new subarray from the actual buffer. (compat) * @param begin The position to start at * @param end The position to end at */ diff --git a/packages/types/src/codec/Vec.ts b/packages/types/src/codec/Vec.ts index c07ec81a4b..52e1e9fe97 100644 --- a/packages/types/src/codec/Vec.ts +++ b/packages/types/src/codec/Vec.ts @@ -3,9 +3,8 @@ import { Codec, Constructor, InterfaceTypes, Registry } from '../types'; -import { assert, logger, u8aToU8a } from '@polkadot/util'; +import { assert, compactFromU8a, logger, u8aToU8a } from '@polkadot/util'; -import Compact from './Compact'; import { decodeU8a, typeToConstructor } from './utils'; import AbstractArray from './AbstractArray'; @@ -49,7 +48,7 @@ export default class Vec extends AbstractArray { } const u8a = u8aToU8a(value); - const [offset, length] = Compact.decodeU8a(u8a); + const [offset, length] = compactFromU8a(u8a); assert(length.lten(MAX_LENGTH), `Vec length ${length.toString()} exceeds ${MAX_LENGTH}`); diff --git a/packages/types/src/create/createType.ts b/packages/types/src/create/createType.ts index d450ea9c21..8b0cbe39c8 100644 --- a/packages/types/src/create/createType.ts +++ b/packages/types/src/create/createType.ts @@ -65,6 +65,8 @@ export function createTypeUnsafe(registry, type), params); // , isPedantic); } catch (error) { + l.error(error); + throw new Error(`createType(${type}):: ${(error as Error).message}`); } } diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index 683ac3a893..0993de51fb 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -6,7 +6,7 @@ import { ChainProperties, DispatchErrorModule, H256 } from '../interfaces/types'; import { CallFunction, Codec, Constructor, InterfaceTypes, RegistryError, RegistryTypes, Registry, RegistryMetadata, RegisteredTypes } from '../types'; -import { extrinsicsFromMeta } from '@polkadot/metadata'; +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'; @@ -128,7 +128,7 @@ export class TypeRegistry implements Registry { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const definitions: Record = require('../interfaces/definitions'); - this.#knownDefaults = { Json, Raw, ...baseTypes }; + this.#knownDefaults = { Json, Metadata, Raw, ...baseTypes }; this.#knownDefinitions = definitions; this.init(); diff --git a/packages/types/src/detectPackage.ts b/packages/types/src/detectPackage.ts new file mode 100644 index 0000000000..59995c9f51 --- /dev/null +++ b/packages/types/src/detectPackage.ts @@ -0,0 +1,8 @@ +// Copyright 2017-2020 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { detectPackage } from '@polkadot/util'; + +// FIXME This really should be `import(...).then(...)`, but need to check rejections +// eslint-disable-next-line @typescript-eslint/no-var-requires +detectPackage(require('./package.json'), typeof __dirname !== 'undefined' && __dirname); diff --git a/packages/types/src/extrinsic/Extrinsic.ts b/packages/types/src/extrinsic/Extrinsic.ts index 4c0dbc906b..65c9fe0355 100644 --- a/packages/types/src/extrinsic/Extrinsic.ts +++ b/packages/types/src/extrinsic/Extrinsic.ts @@ -6,7 +6,7 @@ import { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr2551 import { Address, Balance, Call, Index } from '../interfaces/runtime'; import { AnyJson, AnyU8a, ArgsDef, Codec, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, InterfaceTypes, Registry, SignatureOptions } from '../types'; -import { assert, isHex, isU8a, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; +import { assert, compactAddLength, compactFromU8a, isHex, isU8a, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; import Base from '../codec/Base'; import Compact from '../codec/Compact'; @@ -203,7 +203,7 @@ export default class Extrinsic extends ExtrinsicBase implements IExtrinsic { return Extrinsic._newFromValue(registry, new Uint8Array(), version); } - const [offset, length] = Compact.decodeU8a(value); + const [offset, length] = compactFromU8a(value); const total = offset + length.toNumber(); assert(total <= value.length, `Extrinsic: length less than remainder, expected at least ${total}, found ${value.length}`); @@ -292,6 +292,6 @@ export default class Extrinsic extends ExtrinsicBase implements IExtrinsic { return isBare ? encoded - : Compact.addLengthPrefix(encoded); + : compactAddLength(encoded); } } diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index a858cfd3e5..bdd6a22574 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,11 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { detectPackage } from '@polkadot/util'; - -// FIXME This really should be `import(...).then(...)`, but need to check rejections -// eslint-disable-next-line @typescript-eslint/no-var-requires -detectPackage(require('./package.json'), typeof __dirname !== 'undefined' && __dirname); +import './detectPackage'; export * from './codec'; export * from './create'; diff --git a/packages/types/src/index.types.ts b/packages/types/src/index.types.ts index 0e2c845813..273a4b691f 100644 --- a/packages/types/src/index.types.ts +++ b/packages/types/src/index.types.ts @@ -1,8 +1,6 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { Metadata } from '@polkadot/metadata'; - export * from './extrinsic'; export * from './generic'; export * from './primitive'; diff --git a/packages/types/src/interfaces/authorship/types.ts b/packages/types/src/interfaces/authorship/types.ts index da25106631..028c230572 100644 --- a/packages/types/src/interfaces/authorship/types.ts +++ b/packages/types/src/interfaces/authorship/types.ts @@ -1,8 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Enum, Option } from '@polkadot/types/codec'; +import { ITuple } from '@polkadot/types/types'; import { AccountId, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; /** @name UncleEntryItem */ diff --git a/packages/types/src/interfaces/babe/types.ts b/packages/types/src/interfaces/babe/types.ts index 48a31f956c..1362e7451f 100644 --- a/packages/types/src/interfaces/babe/types.ts +++ b/packages/types/src/interfaces/babe/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec'; import { u32, u64 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AuthorityId } from '@polkadot/types/interfaces/consensus'; import { Hash, Header } from '@polkadot/types/interfaces/runtime'; diff --git a/packages/types/src/interfaces/collective/types.ts b/packages/types/src/interfaces/collective/types.ts index 2236ce3ed5..56b17f3ca1 100644 --- a/packages/types/src/interfaces/collective/types.ts +++ b/packages/types/src/interfaces/collective/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Enum, Struct, Vec } from '@polkadot/types/codec'; import { u32 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AccountId, BlockNumber } from '@polkadot/types/interfaces/runtime'; /** @name CollectiveOrigin */ diff --git a/packages/types/src/interfaces/democracy/types.ts b/packages/types/src/interfaces/democracy/types.ts index 5ac538d0f8..31433d9f80 100644 --- a/packages/types/src/interfaces/democracy/types.ts +++ b/packages/types/src/interfaces/democracy/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Enum, Option, Struct, Vec } from '@polkadot/types/codec'; import { Bytes, bool, u32 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { Vote, VoteThreshold } from '@polkadot/types/interfaces/elections'; import { AccountId, Balance, BlockNumber, Call, Hash } from '@polkadot/types/interfaces/runtime'; diff --git a/packages/types/src/interfaces/grandpa/types.ts b/packages/types/src/interfaces/grandpa/types.ts index f199a1db49..992616cb71 100644 --- a/packages/types/src/interfaces/grandpa/types.ts +++ b/packages/types/src/interfaces/grandpa/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { BTreeSet, Enum, Struct, Vec } from '@polkadot/types/codec'; import { Bytes, u32, u64 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AuthorityId } from '@polkadot/types/interfaces/consensus'; import { AuthoritySignature } from '@polkadot/types/interfaces/imOnline'; import { BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; diff --git a/packages/types/src/interfaces/identity/types.ts b/packages/types/src/interfaces/identity/types.ts index 34f4000d7a..2b3d4142f6 100644 --- a/packages/types/src/interfaces/identity/types.ts +++ b/packages/types/src/interfaces/identity/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Enum, Option, Set, Struct, Vec } from '@polkadot/types/codec'; import { Data, u32 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AccountId, Balance, H160 } from '@polkadot/types/interfaces/runtime'; /** @name IdentityFields */ diff --git a/packages/types/src/interfaces/offences/types.ts b/packages/types/src/interfaces/offences/types.ts index 9f1dae9d05..87cad5a839 100644 --- a/packages/types/src/interfaces/offences/types.ts +++ b/packages/types/src/interfaces/offences/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Struct, U8aFixed, Vec } from '@polkadot/types/codec'; import { Bytes } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AccountId, Hash, Perbill } from '@polkadot/types/interfaces/runtime'; import { IdentificationTuple, SessionIndex } from '@polkadot/types/interfaces/session'; diff --git a/packages/types/src/interfaces/parachains/types.ts b/packages/types/src/interfaces/parachains/types.ts index 4fcfad98fc..55d41b2dc4 100644 --- a/packages/types/src/interfaces/parachains/types.ts +++ b/packages/types/src/interfaces/parachains/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec'; import { BitVec, Bytes, u32 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { Signature } from '@polkadot/types/interfaces/extrinsics'; import { AccountId, Balance, BlockNumber, Hash, ValidatorId } from '@polkadot/types/interfaces/runtime'; import { MembershipProof, SessionIndex } from '@polkadot/types/interfaces/session'; diff --git a/packages/types/src/interfaces/runtime/types.ts b/packages/types/src/interfaces/runtime/types.ts index 01fcdd7fe5..3edbcaf0b5 100644 --- a/packages/types/src/interfaces/runtime/types.ts +++ b/packages/types/src/interfaces/runtime/types.ts @@ -1,10 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Compact, Enum, Int, Struct, U8aFixed, UInt, Vec } from '@polkadot/types/codec'; import { GenericAccountId, GenericAccountIndex, GenericBlock, GenericCall, GenericConsensusEngineId, GenericLookupSource, GenericMultiAddress } from '@polkadot/types/generic'; import { Bytes, DoNotConstruct, Null, StorageKey, u16, u32, u64, u8 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AuthorityId } from '@polkadot/types/interfaces/consensus'; import { Signature } from '@polkadot/types/interfaces/extrinsics'; import { SystemOrigin } from '@polkadot/types/interfaces/system'; diff --git a/packages/types/src/interfaces/scheduler/types.ts b/packages/types/src/interfaces/scheduler/types.ts index 64297e82ea..b59be0e8e5 100644 --- a/packages/types/src/interfaces/scheduler/types.ts +++ b/packages/types/src/interfaces/scheduler/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Option, Struct } from '@polkadot/types/codec'; import { Bytes, u32, u8 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { BlockNumber, Call, PalletsOrigin } from '@polkadot/types/interfaces/runtime'; /** @name Period */ diff --git a/packages/types/src/interfaces/session/types.ts b/packages/types/src/interfaces/session/types.ts index 277a07403c..6ed6df9047 100644 --- a/packages/types/src/interfaces/session/types.ts +++ b/packages/types/src/interfaces/session/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Struct, Vec } from '@polkadot/types/codec'; import { Bytes, u32 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AccountId, ValidatorId } from '@polkadot/types/interfaces/runtime'; import { Exposure } from '@polkadot/types/interfaces/staking'; diff --git a/packages/types/src/interfaces/society/types.ts b/packages/types/src/interfaces/society/types.ts index 2ecbb48427..ad6256ccbd 100644 --- a/packages/types/src/interfaces/society/types.ts +++ b/packages/types/src/interfaces/society/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Enum, Struct } from '@polkadot/types/codec'; import { u32 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AccountId, Balance } from '@polkadot/types/interfaces/runtime'; /** @name Bid */ diff --git a/packages/types/src/interfaces/staking/types.ts b/packages/types/src/interfaces/staking/types.ts index 736241feb0..0056e821a4 100644 --- a/packages/types/src/interfaces/staking/types.ts +++ b/packages/types/src/interfaces/staking/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { BTreeMap, Compact, Enum, Option, Struct, Vec } from '@polkadot/types/codec'; import { bool, u128, u16, u32 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AccountId, Balance, BlockNumber, Moment, PerU16, Perbill } from '@polkadot/types/interfaces/runtime'; /** @name ActiveEraInfo */ diff --git a/packages/types/src/interfaces/state/types.ts b/packages/types/src/interfaces/state/types.ts index 2788c68811..df4f68a426 100644 --- a/packages/types/src/interfaces/state/types.ts +++ b/packages/types/src/interfaces/state/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec'; import { Bytes, StorageKey, Text, u32 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { Hash, StorageData } from '@polkadot/types/interfaces/runtime'; /** @name ApiId */ diff --git a/packages/types/src/interfaces/system/types.ts b/packages/types/src/interfaces/system/types.ts index cbbd5982c7..50cec25d40 100644 --- a/packages/types/src/interfaces/system/types.ts +++ b/packages/types/src/interfaces/system/types.ts @@ -1,10 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Compact, Enum, HashMap, Option, Result, Struct, U8aFixed, Vec } from '@polkadot/types/codec'; import { GenericEvent } from '@polkadot/types/generic'; import { Bytes, Text, bool, i32, u32, u64, u8 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AccountData } from '@polkadot/types/interfaces/balances'; import { AccountId, BlockNumber, Digest, Hash, Index, Pays, Weight } from '@polkadot/types/interfaces/runtime'; diff --git a/packages/types/src/interfaces/treasury/types.ts b/packages/types/src/interfaces/treasury/types.ts index fba8d5478f..5893549fc8 100644 --- a/packages/types/src/interfaces/treasury/types.ts +++ b/packages/types/src/interfaces/treasury/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { ITuple } from '@polkadot/types/types'; import { Enum, Option, Struct, Vec } from '@polkadot/types/codec'; import { bool, u32 } from '@polkadot/types/primitive'; +import { ITuple } from '@polkadot/types/types'; import { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; /** @name Bounty */ diff --git a/packages/types/src/primitive/BitVec.ts b/packages/types/src/primitive/BitVec.ts index c12a4bf141..28674d1b80 100644 --- a/packages/types/src/primitive/BitVec.ts +++ b/packages/types/src/primitive/BitVec.ts @@ -3,9 +3,8 @@ import { AnyU8a, Registry } from '../types'; -import { assert, isString, u8aConcat, u8aToU8a } from '@polkadot/util'; +import { assert, compactFromU8a, compactToU8a, isString, u8aConcat, u8aToU8a } from '@polkadot/util'; -import Compact from '../codec/Compact'; import Raw from '../codec/Raw'; /** @internal */ @@ -15,7 +14,7 @@ function decodeBitVecU8a (value?: Uint8Array): Uint8Array { } // handle all other Uint8Array inputs, these do have a length prefix which is the number of bits encoded - const [offset, length] = Compact.decodeU8a(value); + const [offset, length] = compactFromU8a(value); const total = offset + Math.ceil(length.toNumber() / 8); assert(total <= value.length, `BitVec: required length less than remainder, expected at least ${total}, found ${value.length}`); @@ -47,7 +46,7 @@ export default class BitVec extends Raw { * @description The length of the value when encoded as a Uint8Array */ public get encodedLength (): number { - return this.length + Compact.encodeU8a(this.bitLength()).length; + return this.length + compactToU8a(this.bitLength()).length; } /** @@ -66,6 +65,6 @@ export default class BitVec extends Raw { return isBare ? bitVec - : u8aConcat(Compact.encodeU8a(this.bitLength()), bitVec); + : u8aConcat(compactToU8a(this.bitLength()), bitVec); } } diff --git a/packages/types/src/primitive/Bytes.ts b/packages/types/src/primitive/Bytes.ts index 738ae435ab..f40634f905 100644 --- a/packages/types/src/primitive/Bytes.ts +++ b/packages/types/src/primitive/Bytes.ts @@ -3,9 +3,8 @@ import { AnyU8a, Registry } from '../types'; -import { assert, isString, isU8a, u8aToU8a } from '@polkadot/util'; +import { assert, compactAddLength, compactFromU8a, compactToU8a, isString, isU8a, u8aToU8a } from '@polkadot/util'; -import Compact from '../codec/Compact'; import Raw from '../codec/Raw'; // Bytes are used for things like on-chain code, so it has a healthy limit @@ -18,7 +17,7 @@ function decodeBytesU8a (value: Uint8Array): Uint8Array { } // handle all other Uint8Array inputs, these do have a length prefix - const [offset, length] = Compact.decodeU8a(value); + const [offset, length] = compactFromU8a(value); const total = offset + length.toNumber(); assert(length.lten(MAX_LENGTH), `Bytes length ${length.toString()} exceeds ${MAX_LENGTH}`); @@ -56,7 +55,7 @@ export default class Bytes extends Raw { * @description The length of the value when encoded as a Uint8Array */ public get encodedLength (): number { - return this.length + Compact.encodeU8a(this.length).length; + return this.length + compactToU8a(this.length).length; } /** @@ -73,6 +72,6 @@ export default class Bytes extends Raw { public toU8a (isBare?: boolean): Uint8Array { return isBare ? super.toU8a(isBare) - : Compact.addLengthPrefix(this); + : compactAddLength(this); } } diff --git a/packages/types/src/primitive/StorageKey.ts b/packages/types/src/primitive/StorageKey.ts index 4f342f7134..13cf74eabc 100644 --- a/packages/types/src/primitive/StorageKey.ts +++ b/packages/types/src/primitive/StorageKey.ts @@ -3,23 +3,13 @@ import { StorageEntryMetadataLatest, StorageEntryTypeLatest, StorageHasher } from '../interfaces/metadata'; import { AnyJson, AnyU8a, Codec, InterfaceTypes, Registry } from '../types'; +import { StorageEntry } from './types'; import { assert, isFunction, isString, isU8a } from '@polkadot/util'; import { AllHashers } from '@polkadot/types/interfaces/metadata/definitions'; import Bytes from './Bytes'; -export interface StorageEntry { - (arg?: any): Uint8Array; - iterKey?: (arg?: any) => Uint8Array & Codec; - keyPrefix: (arg?: any) => Uint8Array; - meta: StorageEntryMetadataLatest; - method: string; - prefix: string; - section: string; - toJSON: () => any; -} - interface Decoded { key?: Uint8Array | string; method?: string; diff --git a/packages/types/src/primitive/Text.ts b/packages/types/src/primitive/Text.ts index 0b3b7ffe07..885b8924da 100644 --- a/packages/types/src/primitive/Text.ts +++ b/packages/types/src/primitive/Text.ts @@ -4,9 +4,8 @@ import { H256 } from '../interfaces/runtime'; import { AnyU8a, Codec, Registry } from '../types'; -import { assert, hexToU8a, isHex, isString, stringToU8a, u8aToString, u8aToHex } from '@polkadot/util'; +import { assert, hexToU8a, isHex, isString, stringToU8a, u8aToString, u8aToHex, compactFromU8a, compactAddLength } from '@polkadot/util'; -import Compact from '../codec/Compact'; import Raw from '../codec/Raw'; const MAX_LENGTH = 128 * 1024; @@ -26,7 +25,7 @@ function decodeText (value?: null | Text | string | AnyU8a | { toString: () => s return u8aToString(value); } - const [offset, length] = Compact.decodeU8a(value); + const [offset, length] = compactFromU8a(value); const total = offset + length.toNumber(); assert(length.lten(MAX_LENGTH), `Text length ${length.toString()} exceeds ${MAX_LENGTH}`); @@ -152,6 +151,6 @@ export default class Text extends String implements Codec { return isBare ? encoded - : Compact.addLengthPrefix(encoded); + : compactAddLength(encoded); } } diff --git a/packages/types/src/primitive/types.ts b/packages/types/src/primitive/types.ts new file mode 100644 index 0000000000..b11ef91fa9 --- /dev/null +++ b/packages/types/src/primitive/types.ts @@ -0,0 +1,16 @@ +// Copyright 2017-2020 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { StorageEntryMetadataLatest } from '../interfaces/metadata'; +import { Codec } from '../types'; + +export interface StorageEntry { + (arg?: any): Uint8Array; + iterKey?: (arg?: any) => Uint8Array & Codec; + keyPrefix: (arg?: any) => Uint8Array; + meta: StorageEntryMetadataLatest; + method: string; + prefix: string; + section: string; + toJSON: () => any; +} diff --git a/yarn.lock b/yarn.lock index 4e6f118462..1b1e26c7a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1753,7 +1753,7 @@ __metadata: "@babel/runtime": ^7.12.1 "@polkadot/api": 2.6.2-1 "@polkadot/types": 2.6.2-1 - "@polkadot/util": ^4.0.2-5 + "@polkadot/util": ^4.0.2-7 bn.js: ^5.1.3 rxjs: ^6.6.3 languageName: unknown @@ -1765,12 +1765,12 @@ __metadata: dependencies: "@babel/runtime": ^7.12.1 "@polkadot/api": 2.6.2-1 - "@polkadot/keyring": ^4.0.2-5 + "@polkadot/keyring": ^4.0.2-7 "@polkadot/rpc-core": 2.6.2-1 "@polkadot/rpc-provider": 2.6.2-1 "@polkadot/types": 2.6.2-1 - "@polkadot/util": ^4.0.2-5 - "@polkadot/util-crypto": ^4.0.2-5 + "@polkadot/util": ^4.0.2-7 + "@polkadot/util-crypto": ^4.0.2-7 bn.js: ^5.1.3 memoizee: ^0.4.14 rxjs: ^6.6.3 @@ -1783,14 +1783,14 @@ __metadata: dependencies: "@babel/runtime": ^7.12.1 "@polkadot/api-derive": 2.6.2-1 - "@polkadot/keyring": ^4.0.2-5 + "@polkadot/keyring": ^4.0.2-7 "@polkadot/metadata": 2.6.2-1 "@polkadot/rpc-core": 2.6.2-1 "@polkadot/rpc-provider": 2.6.2-1 "@polkadot/types": 2.6.2-1 "@polkadot/types-known": 2.6.2-1 - "@polkadot/util": ^4.0.2-5 - "@polkadot/util-crypto": ^4.0.2-5 + "@polkadot/util": ^4.0.2-7 + "@polkadot/util-crypto": ^4.0.2-7 bn.js: ^5.1.3 eventemitter3: ^4.0.7 rxjs: ^6.6.3 @@ -1889,17 +1889,17 @@ __metadata: languageName: node linkType: hard -"@polkadot/keyring@npm:^4.0.2-5": - version: 4.0.2-5 - resolution: "@polkadot/keyring@npm:4.0.2-5" +"@polkadot/keyring@npm:^4.0.2-7": + version: 4.0.2-7 + resolution: "@polkadot/keyring@npm:4.0.2-7" dependencies: "@babel/runtime": ^7.12.1 - "@polkadot/util": 4.0.2-5 - "@polkadot/util-crypto": 4.0.2-5 + "@polkadot/util": 4.0.2-7 + "@polkadot/util-crypto": 4.0.2-7 peerDependencies: - "@polkadot/util": 4.0.2-5 - "@polkadot/util-crypto": 4.0.2-5 - checksum: 2bb9a76f28f582f410ca5703430be43e99b01c7384a3ddc7511020506fb2a7440739534d804e4a3bedaaf3ce89969670a12398ffe8e6ec8c74cb1a65219870f5 + "@polkadot/util": 4.0.2-7 + "@polkadot/util-crypto": 4.0.2-7 + checksum: 21e0be9ccc5a5adac9ccfaa949c0ff80f1fbc4e171583de631c8a6055f3d91faaccd2dedcd07ee5fce93a4916528deb34dec557bfb2302129f4c09460851e1b6 languageName: node linkType: hard @@ -1908,21 +1908,21 @@ __metadata: resolution: "@polkadot/metadata@workspace:packages/metadata" dependencies: "@babel/runtime": ^7.12.1 - "@polkadot/keyring": ^4.0.2-5 + "@polkadot/keyring": ^4.0.2-7 "@polkadot/types": 2.6.2-1 "@polkadot/types-known": 2.6.2-1 - "@polkadot/util": ^4.0.2-5 - "@polkadot/util-crypto": ^4.0.2-5 + "@polkadot/util": ^4.0.2-7 + "@polkadot/util-crypto": ^4.0.2-7 bn.js: ^5.1.3 languageName: unknown linkType: soft -"@polkadot/networks@npm:4.0.2-5": - version: 4.0.2-5 - resolution: "@polkadot/networks@npm:4.0.2-5" +"@polkadot/networks@npm:4.0.2-7": + version: 4.0.2-7 + resolution: "@polkadot/networks@npm:4.0.2-7" dependencies: "@babel/runtime": ^7.12.1 - checksum: 80bcdd6983e74e507bab734a78323b3706ebf470fc56109dcaf248dc9a13797818320d985ce4cf6cd91edcba086e55e2f6671163112ae899dd9b010859713ecd + checksum: 2502c6db7cb7f5a69b54b8eca7f26479b819cf85065df901ec9aea2979a2932521d5c1bb907ea07c68119adefd92bc91817c6d011e7c4098d3ba193d0fedc7b4 languageName: node linkType: hard @@ -1931,11 +1931,11 @@ __metadata: resolution: "@polkadot/rpc-core@workspace:packages/rpc-core" dependencies: "@babel/runtime": ^7.12.1 - "@polkadot/keyring": ^4.0.2-5 + "@polkadot/keyring": ^4.0.2-7 "@polkadot/metadata": 2.6.2-1 "@polkadot/rpc-provider": 2.6.2-1 "@polkadot/types": 2.6.2-1 - "@polkadot/util": ^4.0.2-5 + "@polkadot/util": ^4.0.2-7 memoizee: ^0.4.14 rxjs: ^6.6.3 languageName: unknown @@ -1946,13 +1946,13 @@ __metadata: resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider" dependencies: "@babel/runtime": ^7.12.1 - "@polkadot/keyring": ^4.0.2-5 + "@polkadot/keyring": ^4.0.2-7 "@polkadot/metadata": 2.6.2-1 "@polkadot/types": 2.6.2-1 - "@polkadot/util": ^4.0.2-5 - "@polkadot/util-crypto": ^4.0.2-5 - "@polkadot/x-fetch": ^4.0.2-5 - "@polkadot/x-ws": ^4.0.2-5 + "@polkadot/util": ^4.0.2-7 + "@polkadot/util-crypto": ^4.0.2-7 + "@polkadot/x-fetch": ^4.0.2-7 + "@polkadot/x-ws": ^4.0.2-7 bn.js: ^5.1.3 eventemitter3: ^4.0.7 mock-socket: ^9.0.3 @@ -1980,7 +1980,7 @@ __metadata: "@polkadot/metadata": 2.6.2-1 "@polkadot/rpc-provider": 2.6.2-1 "@polkadot/types": 2.6.2-1 - "@polkadot/util": ^4.0.2-5 + "@polkadot/util": ^4.0.2-7 "@types/websocket": ^1.0.1 "@types/yargs": ^15.0.9 handlebars: ^4.7.6 @@ -2001,7 +2001,7 @@ __metadata: dependencies: "@babel/runtime": ^7.12.1 "@polkadot/types": 2.6.2-1 - "@polkadot/util": ^4.0.2-5 + "@polkadot/util": ^4.0.2-7 "@types/bn.js": ^4.11.6 bn.js: ^5.1.3 languageName: unknown @@ -2012,10 +2012,10 @@ __metadata: resolution: "@polkadot/types@workspace:packages/types" dependencies: "@babel/runtime": ^7.12.1 - "@polkadot/keyring": ^4.0.2-5 + "@polkadot/keyring": ^4.0.2-7 "@polkadot/metadata": 2.6.2-1 - "@polkadot/util": ^4.0.2-5 - "@polkadot/util-crypto": ^4.0.2-5 + "@polkadot/util": ^4.0.2-7 + "@polkadot/util-crypto": ^4.0.2-7 "@types/bn.js": ^4.11.6 "@types/memoizee": ^0.4.4 bn.js: ^5.1.3 @@ -2024,15 +2024,15 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/util-crypto@npm:4.0.2-5, @polkadot/util-crypto@npm:^4.0.2-5": - version: 4.0.2-5 - resolution: "@polkadot/util-crypto@npm:4.0.2-5" +"@polkadot/util-crypto@npm:4.0.2-7, @polkadot/util-crypto@npm:^4.0.2-7": + version: 4.0.2-7 + resolution: "@polkadot/util-crypto@npm:4.0.2-7" dependencies: "@babel/runtime": ^7.12.1 - "@polkadot/networks": 4.0.2-5 - "@polkadot/util": 4.0.2-5 + "@polkadot/networks": 4.0.2-7 + "@polkadot/util": 4.0.2-7 "@polkadot/wasm-crypto": ^2.0.1 - "@polkadot/x-randomvalues": 4.0.2-5 + "@polkadot/x-randomvalues": 4.0.2-7 base-x: ^3.0.8 blakejs: ^1.1.0 bn.js: ^5.1.3 @@ -2045,23 +2045,23 @@ __metadata: tweetnacl: ^1.0.3 xxhashjs: ^0.2.2 peerDependencies: - "@polkadot/util": 4.0.2-5 - checksum: 376ee7f9d1bd7daa5964b89b7b2b0f301feaee6d169302e405e15beefc6e2499f502425466ead1d8271bdb6e91522cf5330f7cd29390ddfeaf89d01acab34a63 + "@polkadot/util": 4.0.2-7 + checksum: 74096cd049d7dea7c7ef609f9f9f68bf9374f09f7fa1f6b16132d81c4bcb94f196375fafe84656f4cfdbd471e1112a1895d20ac16e1b08a322aed8f410ffe9ae languageName: node linkType: hard -"@polkadot/util@npm:4.0.2-5, @polkadot/util@npm:^4.0.2-5": - version: 4.0.2-5 - resolution: "@polkadot/util@npm:4.0.2-5" +"@polkadot/util@npm:4.0.2-7, @polkadot/util@npm:^4.0.2-7": + version: 4.0.2-7 + resolution: "@polkadot/util@npm:4.0.2-7" dependencies: "@babel/runtime": ^7.12.1 - "@polkadot/x-textdecoder": 4.0.2-5 - "@polkadot/x-textencoder": 4.0.2-5 + "@polkadot/x-textdecoder": 4.0.2-7 + "@polkadot/x-textencoder": 4.0.2-7 "@types/bn.js": ^4.11.6 bn.js: ^5.1.3 camelcase: ^5.3.1 ip-regex: ^4.2.0 - checksum: be10c8f4c1a3953aaf432d96ad5f0117028bdb48ccd1eb4c3784f0cb24266de632ca8089644f066f37c1f3906845f58f7e7ddc6af6f3c15dfbcea961988f3bd8 + checksum: c475919fe9fcf8792eda92f6a89eff82ad593099bf64c562281fee2b71db3767fd7d06c8055138bd63afcacf9c36279b0cb60ff0260db664ba7c9c17eeafef22 languageName: node linkType: hard @@ -2075,52 +2075,52 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-fetch@npm:^4.0.2-5": - version: 4.0.2-5 - resolution: "@polkadot/x-fetch@npm:4.0.2-5" +"@polkadot/x-fetch@npm:^4.0.2-7": + version: 4.0.2-7 + resolution: "@polkadot/x-fetch@npm:4.0.2-7" dependencies: "@babel/runtime": ^7.12.1 "@types/node-fetch": ^2.5.7 node-fetch: ^2.6.1 - checksum: b2fdbd5acdf1dce705a083220cedd266457efa0bdc8a1bf49704fce9ca7e4f02738c76f3d7f25e3c453641bd7006c6eea5ce5d0e57a8a57cb560f6feef480eb9 + checksum: d722d22428324f2c8f5fda43617ea791288ca3ffbbe73ddb0b3babb754073fa64e45c9ea6248cedf124ab7a121f16477915fb59c97770929e7656d64ab31aadd languageName: node linkType: hard -"@polkadot/x-randomvalues@npm:4.0.2-5": - version: 4.0.2-5 - resolution: "@polkadot/x-randomvalues@npm:4.0.2-5" +"@polkadot/x-randomvalues@npm:4.0.2-7": + version: 4.0.2-7 + resolution: "@polkadot/x-randomvalues@npm:4.0.2-7" dependencies: "@babel/runtime": ^7.12.1 - checksum: ec895fc243bafd913818caa5f205c0a644d23ddfb1716296454869f6dc5859ab52b4d3af46fe45c0d92be7f19f21a7533e961109a2f5b18b3d345a07c5282d53 + checksum: afc00c24e876ecacbbc8a2f531e8fc98dcb08a8b02558cc46728c24627913a15bcd69bdd90f660d4ad5e2b50cdff58bbb230de9cf9105939429470b936f26a74 languageName: node linkType: hard -"@polkadot/x-textdecoder@npm:4.0.2-5": - version: 4.0.2-5 - resolution: "@polkadot/x-textdecoder@npm:4.0.2-5" +"@polkadot/x-textdecoder@npm:4.0.2-7": + version: 4.0.2-7 + resolution: "@polkadot/x-textdecoder@npm:4.0.2-7" dependencies: "@babel/runtime": ^7.12.1 - checksum: 2d9b4192338b1dd1a7b64c9b3a64302dd22039bd5245434c8dd8ba64332ffcc8ae833431791127644c2911d5c9397d361db488642898c1f033719924c8b022ec + checksum: bcf46de6c280fce2499a623996ef519abefc06bb9a54d42e35fe827495f30e7424dd53ce570627039349e04b6ba942a30e44fcdc163412d04d0c6eafc6cd3bef languageName: node linkType: hard -"@polkadot/x-textencoder@npm:4.0.2-5": - version: 4.0.2-5 - resolution: "@polkadot/x-textencoder@npm:4.0.2-5" +"@polkadot/x-textencoder@npm:4.0.2-7": + version: 4.0.2-7 + resolution: "@polkadot/x-textencoder@npm:4.0.2-7" dependencies: "@babel/runtime": ^7.12.1 - checksum: fda2c245f7f5413df6f48fb052f6b36484c0942837017707047891959600d327041abb997067fe009d88891541ceabe3a63a9c0076957e2efbc69446a45b87e9 + checksum: 535f96fca8c1c206ccb1f7ed4db9b837d9ff766d2481fdab52e9a1dff5bd4488484a17ff2bc0b668a6177dcebc349d9fdcc6804414d880d466a1c759622cb7a7 languageName: node linkType: hard -"@polkadot/x-ws@npm:^4.0.2-5": - version: 4.0.2-5 - resolution: "@polkadot/x-ws@npm:4.0.2-5" +"@polkadot/x-ws@npm:^4.0.2-7": + version: 4.0.2-7 + resolution: "@polkadot/x-ws@npm:4.0.2-7" dependencies: "@babel/runtime": ^7.12.1 "@types/websocket": ^1.0.1 websocket: ^1.0.32 - checksum: 2be445d505d4d7f79734d64248b202d58c9f8ffd2e21f0360094d3f2026721eec8566e6c8e6cb166ef135ae461c5bb2bcf195c76b1fa503d460d5a94085f18aa + checksum: 1d566c09f9931053a851cb51fd1eb1c59341f196b88ab8d6e458c1184c5d495bb5fdf57976ce03e71245d818af1c440cb7792d69da0c6668bc034bc409110e10 languageName: node linkType: hard