From 8e6a1c8fb1c42225e814d586ea1d7942ba5fca6f Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 7 Dec 2020 16:26:19 +0100 Subject: [PATCH] Bump dev (sort imports) (#2923) * Bump dev (sort imports) * Resort * Adjust ApiInterfaceRx --- package.json | 4 +- packages/api-contract/src/Abi.spec.ts | 3 +- packages/api-contract/src/Abi.ts | 2 +- .../api-contract/src/MetaRegistry.spec.ts | 3 +- packages/api-contract/src/MetaRegistry.ts | 4 +- packages/api-contract/src/base/Blueprint.ts | 5 ++- packages/api-contract/src/base/Code.spec.ts | 3 +- packages/api-contract/src/base/Code.ts | 2 +- packages/api-contract/src/base/Contract.ts | 3 +- packages/api-contract/src/base/types.ts | 2 +- .../api-contract/src/checkTypes.manual.ts | 2 +- packages/api-contract/src/util.ts | 3 +- packages/api-derive/src/accounts/accountId.ts | 5 ++- .../api-derive/src/accounts/idAndIndex.ts | 3 +- packages/api-derive/src/accounts/idToIndex.ts | 2 +- packages/api-derive/src/accounts/identity.ts | 1 + packages/api-derive/src/accounts/indexToId.ts | 3 +- packages/api-derive/src/accounts/indexes.ts | 1 + packages/api-derive/src/accounts/info.ts | 1 + packages/api-derive/src/balances/account.ts | 5 ++- packages/api-derive/src/balances/all.ts | 1 + .../api-derive/src/balances/votingBalances.ts | 2 +- packages/api-derive/src/chain/bestNumber.ts | 2 +- .../src/chain/bestNumberFinalized.ts | 2 +- .../api-derive/src/chain/bestNumberLag.ts | 2 +- packages/api-derive/src/chain/getBlock.ts | 2 +- packages/api-derive/src/chain/getHeader.ts | 2 +- .../api-derive/src/chain/subscribeNewHeads.ts | 2 +- .../api-derive/src/collective/proposals.ts | 1 + packages/api-derive/src/council/votes.ts | 2 +- packages/api-derive/src/council/votesOf.ts | 3 +- .../api-derive/src/democracy/dispatchQueue.ts | 3 +- packages/api-derive/src/democracy/locks.ts | 3 +- .../api-derive/src/democracy/preimages.ts | 2 +- .../api-derive/src/democracy/proposals.ts | 3 +- .../src/democracy/referendumsInfo.ts | 3 +- .../src/democracy/sqrtElectorate.ts | 3 +- packages/api-derive/src/democracy/types.ts | 2 +- packages/api-derive/src/democracy/util.ts | 1 + packages/api-derive/src/elections/info.ts | 2 +- packages/api-derive/src/elections/types.ts | 2 +- .../src/imOnline/receivedHeartbeats.ts | 1 + packages/api-derive/src/index.spec.ts | 3 +- packages/api-derive/src/parachains/info.ts | 4 +- .../api-derive/src/parachains/overview.ts | 2 +- packages/api-derive/src/parachains/types.ts | 2 +- packages/api-derive/src/session/eraLength.ts | 2 +- .../api-derive/src/session/eraProgress.ts | 2 +- packages/api-derive/src/session/indexes.ts | 1 + packages/api-derive/src/session/info.ts | 2 +- packages/api-derive/src/session/progress.ts | 1 + .../api-derive/src/session/sessionProgress.ts | 2 +- packages/api-derive/src/session/types.ts | 2 +- packages/api-derive/src/society/info.ts | 2 +- packages/api-derive/src/staking/account.ts | 1 + .../api-derive/src/staking/currentPoints.ts | 2 +- packages/api-derive/src/staking/erasPoints.ts | 1 + .../api-derive/src/staking/ownExposure.ts | 2 +- packages/api-derive/src/staking/query.ts | 1 + .../api-derive/src/staking/stakerExposure.ts | 2 +- .../api-derive/src/staking/stakerRewards.ts | 1 + packages/api-derive/src/tx/events.ts | 2 +- packages/api-derive/src/tx/signingInfo.ts | 3 +- .../api-derive/src/type/HeaderExtended.ts | 2 +- .../src/type/SignedBlockExtended.ts | 2 +- packages/api-derive/src/types.ts | 2 +- .../src/util/approvalFlagsToBools.ts | 2 +- packages/api-derive/src/util/memo.ts | 1 + packages/api/src/base/Decorate.ts | 11 ++--- packages/api/src/base/Init.ts | 5 ++- packages/api/src/base/types.ts | 2 +- packages/api/src/checkTypes.manual.ts | 2 +- packages/api/src/promise/index.ts | 3 +- packages/api/src/rx/index.spec.ts | 1 + packages/api/src/submittable/Result.ts | 2 +- packages/api/src/submittable/createClass.ts | 7 +-- packages/api/src/submittable/types.ts | 4 +- packages/api/src/types/base.ts | 2 +- packages/api/src/types/index.ts | 6 +-- packages/api/src/types/rpc.ts | 2 +- packages/api/src/types/storage.ts | 2 +- packages/api/src/util/validate.spec.ts | 3 +- packages/api/src/util/validate.ts | 2 +- packages/metadata/src/MagicNumber.spec.ts | 2 +- packages/metadata/src/MagicNumber.ts | 3 +- packages/metadata/src/Metadata.spec.ts | 2 +- packages/metadata/src/MetadataVersioned.ts | 2 +- .../src/decorate/consts/fromMetadata.ts | 2 +- .../src/decorate/extrinsics/index.spec.ts | 1 + .../src/decorate/storage/createFunction.ts | 3 +- .../src/decorate/storage/getHasher.ts | 2 +- packages/metadata/src/decorate/types.ts | 2 +- packages/metadata/src/types.ts | 2 +- packages/metadata/src/util/getUniqTypes.ts | 2 +- packages/metadata/src/util/testUtil.ts | 2 +- .../metadata/src/util/toCallsOnly.spec.ts | 2 +- packages/metadata/src/v10/Metadata.spec.ts | 4 +- packages/metadata/src/v11/Metadata.spec.ts | 4 +- packages/metadata/src/v12/Metadata.spec.ts | 4 +- packages/metadata/src/v12/toLatest.ts | 6 +-- packages/metadata/src/v9/Metadata.spec.ts | 4 +- packages/rpc-core/src/index.ts | 3 +- packages/rpc-core/src/replay.spec.ts | 1 + packages/rpc-core/src/util/drr.ts | 3 +- packages/rpc-provider/src/coder/index.ts | 2 +- packages/rpc-provider/src/http/index.ts | 2 +- packages/rpc-provider/src/http/send.spec.ts | 4 +- packages/rpc-provider/src/http/types.ts | 1 - packages/rpc-provider/src/mock/index.ts | 7 +-- packages/rpc-provider/src/mock/types.ts | 3 +- packages/rpc-provider/src/ws/connect.spec.ts | 4 +- packages/rpc-provider/src/ws/index.spec.ts | 3 +- packages/rpc-provider/src/ws/index.ts | 3 +- packages/rpc-provider/src/ws/send.spec.ts | 3 +- .../rpc-provider/src/ws/subscribe.spec.ts | 3 +- .../rpc-provider/src/ws/unsubscribe.spec.ts | 3 +- packages/typegen/package.json | 4 +- packages/typegen/src/extractChain.ts | 1 + packages/typegen/src/fromChain.ts | 1 + packages/typegen/src/fromDefs.ts | 1 + packages/typegen/src/generate/consts.ts | 4 +- packages/typegen/src/generate/query.ts | 6 +-- packages/typegen/src/generate/rpc.ts | 3 +- packages/typegen/src/generate/tsDef.ts | 5 ++- packages/typegen/src/generate/tx.ts | 7 +-- packages/typegen/src/metadataMd.ts | 7 +-- packages/typegen/src/util/derived.ts | 10 ++--- packages/typegen/src/util/formatting.ts | 2 +- packages/typegen/src/util/imports.ts | 3 +- packages/types-known/src/index.spec.ts | 1 + packages/types-known/src/index.ts | 2 +- packages/types-known/src/upgrades/index.ts | 1 + packages/types/src/codec/AbstractInt.ts | 3 +- packages/types/src/codec/BTreeMap.ts | 2 +- packages/types/src/codec/BTreeSet.spec.ts | 1 - packages/types/src/codec/BTreeSet.ts | 4 +- packages/types/src/codec/Compact.ts | 1 + packages/types/src/codec/Date.ts | 1 + packages/types/src/codec/Enum.ts | 2 +- packages/types/src/codec/HashMap.ts | 2 +- packages/types/src/codec/Linkage.ts | 2 +- packages/types/src/codec/Map.ts | 4 +- packages/types/src/codec/Result.spec.ts | 2 +- packages/types/src/codec/Set.ts | 3 +- packages/types/src/codec/Tuple.ts | 6 +-- packages/types/src/codec/Vec.ts | 2 +- packages/types/src/codec/VecFixed.ts | 4 +- .../types/src/codec/utils/compareMap.spec.ts | 1 + packages/types/src/create/createClass.ts | 2 +- packages/types/src/create/encodeTypes.spec.ts | 3 +- packages/types/src/create/getTypeDef.spec.ts | 2 +- packages/types/src/create/registry.ts | 6 +-- packages/types/src/ethereum/AccountId.spec.ts | 2 +- packages/types/src/ethereum/LookupSource.ts | 3 +- packages/types/src/extrinsic/Extrinsic.ts | 6 +-- packages/types/src/extrinsic/ExtrinsicEra.ts | 5 ++- .../types/src/extrinsic/ExtrinsicPayload.ts | 2 +- .../types/src/extrinsic/v4/Extrinsic.spec.ts | 3 +- packages/types/src/generic/AccountId.spec.ts | 2 +- packages/types/src/generic/AccountId.ts | 2 +- packages/types/src/generic/AccountIndex.ts | 3 +- packages/types/src/generic/Block.ts | 4 +- packages/types/src/generic/Call.ts | 2 +- .../src/generic/ConsensusEngineId.spec.ts | 2 +- .../types/src/generic/ConsensusEngineId.ts | 3 +- packages/types/src/generic/LookupSource.ts | 3 +- packages/types/src/generic/Vote.ts | 4 +- packages/types/src/index.spec.ts | 2 +- .../interfaces/author/ExtrinsicStatus.spec.ts | 2 +- .../interfaces/identity/Registration.spec.ts | 2 +- .../staking/CompactAssignments.spec.ts | 2 +- packages/types/src/primitive/Text.spec.ts | 2 +- packages/types/src/primitive/Text.ts | 2 +- packages/types/src/types/codec.ts | 9 ++-- packages/types/src/types/helpers.ts | 5 +-- packages/types/src/types/interfaces.ts | 4 +- yarn.lock | 45 ++++++++++++++----- 177 files changed, 302 insertions(+), 230 deletions(-) diff --git a/package.json b/package.json index 591098f30a..9245a076d5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "build:release": "polkadot-ci-ghact-build", "docs:metadata": "polkadot-types-internal-metadata", "chain:info": "polkadot-types-chain-info", - "lint": "polkadot-dev-run-lint", + "lint": "polkadot-dev-run-lint --fix", "clean": "polkadot-dev-clean-build", "postinstall": "polkadot-dev-yarn-only", "test": "polkadot-dev-run-test --coverage --runInBand --testPathIgnorePatterns e2e", @@ -26,7 +26,7 @@ "@babel/core": "^7.12.9", "@babel/register": "^7.12.1", "@babel/runtime": "^7.12.5", - "@polkadot/dev": "^0.60.8", + "@polkadot/dev": "^0.60.11", "@polkadot/ts": "^0.3.57", "@polkadot/typegen": "workspace:packages/typegen", "@types/jest": "^26.0.16", diff --git a/packages/api-contract/src/Abi.spec.ts b/packages/api-contract/src/Abi.spec.ts index b211aab613..69d13ce0c3 100644 --- a/packages/api-contract/src/Abi.spec.ts +++ b/packages/api-contract/src/Abi.spec.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Abi } from '.'; - import abis from '../test/contracts'; +import { Abi } from '.'; interface JSONAbi { spec: { diff --git a/packages/api-contract/src/Abi.ts b/packages/api-contract/src/Abi.ts index 6fa8d7d8be..423a6824f8 100644 --- a/packages/api-contract/src/Abi.ts +++ b/packages/api-contract/src/Abi.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { Bytes } from '@polkadot/types'; +import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageParamSpec, ContractMessageSpec, ContractProject } from '@polkadot/types/interfaces'; import type { AnyJson, Codec, CodecArg } from '@polkadot/types/types'; -import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageSpec, ContractMessageParamSpec, ContractProject } from '@polkadot/types/interfaces'; import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from './types'; import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, u8aConcat, u8aToHex } from '@polkadot/util'; diff --git a/packages/api-contract/src/MetaRegistry.spec.ts b/packages/api-contract/src/MetaRegistry.spec.ts index 3688771726..dc4a997be0 100644 --- a/packages/api-contract/src/MetaRegistry.spec.ts +++ b/packages/api-contract/src/MetaRegistry.spec.ts @@ -4,9 +4,8 @@ import fs from 'fs'; import path from 'path'; -import { Abi } from '.'; - import abis from '../test/contracts'; +import { Abi } from '.'; describe('MetaRegistry', (): void => { Object.keys(abis).forEach((abiName) => { diff --git a/packages/api-contract/src/MetaRegistry.ts b/packages/api-contract/src/MetaRegistry.ts index ae15034d56..584f9482e4 100644 --- a/packages/api-contract/src/MetaRegistry.ts +++ b/packages/api-contract/src/MetaRegistry.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ContractDisplayName, ChainProperties, SiField, SiLookupTypeId, SiType, SiTypeDefArray, SiTypeDefVariant, SiTypeDefSequence, SiTypeDefTuple, SiVariant } from '@polkadot/types/interfaces'; +import type { ChainProperties, ContractDisplayName, SiField, SiLookupTypeId, SiType, SiTypeDefArray, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces'; import type { InterfaceTypes, TypeDef } from '@polkadot/types/types'; -import { assert, isUndefined } from '@polkadot/util'; import { TypeRegistry, withTypeString } from '@polkadot/types/create'; import { TypeDefInfo } from '@polkadot/types/types'; +import { assert, isUndefined } from '@polkadot/util'; interface PartialTypeSpec { readonly type: SiLookupTypeId; diff --git a/packages/api-contract/src/base/Blueprint.ts b/packages/api-contract/src/base/Blueprint.ts index c0cb067122..e4f6c64a58 100644 --- a/packages/api-contract/src/base/Blueprint.ts +++ b/packages/api-contract/src/base/Blueprint.ts @@ -1,18 +1,19 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; +import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { AccountId, EventRecord, Hash } from '@polkadot/types/interfaces'; import type { AnyJson, CodecArg, ISubmittableResult } from '@polkadot/types/types'; import type { AbiConstructor, BlueprintOptions } from '../types'; import type { BlueprintDeploy, ContractGeneric, MapConstructorExec } from './types'; import BN from 'bn.js'; + import { SubmittableResult } from '@polkadot/api'; import { ApiBase } from '@polkadot/api/base'; import { Bytes } from '@polkadot/types'; -import { isUndefined, stringCamelCase, compactAddLength, u8aToU8a } from '@polkadot/util'; +import { compactAddLength, isUndefined, stringCamelCase, u8aToU8a } from '@polkadot/util'; import { randomAsU8a } from '@polkadot/util-crypto'; import { Abi } from '../Abi'; diff --git a/packages/api-contract/src/base/Code.spec.ts b/packages/api-contract/src/base/Code.spec.ts index 043dcaf09d..5255246e02 100644 --- a/packages/api-contract/src/base/Code.spec.ts +++ b/packages/api-contract/src/base/Code.spec.ts @@ -3,12 +3,13 @@ import fs from 'fs'; import path from 'path'; + import { decorateMethod } from '@polkadot/api/promise'; import contractFlipper from '../../test/contracts/ink/flipper.contract.json'; import abiFlipper from '../../test/contracts/ink/flipper.json'; -import { mockApi } from './mock'; import { Code } from './Code'; +import { mockApi } from './mock'; const wasmFlipper = fs.readFileSync(path.join(__dirname, '../../test/contracts/ink/flipper.wasm')); diff --git a/packages/api-contract/src/base/Code.ts b/packages/api-contract/src/base/Code.ts index 411b349413..0ebbcbc229 100644 --- a/packages/api-contract/src/base/Code.ts +++ b/packages/api-contract/src/base/Code.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; +import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { EventRecord, Hash } from '@polkadot/types/interfaces'; import type { AnyJson, ISubmittableResult } from '@polkadot/types/types'; diff --git a/packages/api-contract/src/base/Contract.ts b/packages/api-contract/src/base/Contract.ts index e202b6d311..5b9e76e79b 100644 --- a/packages/api-contract/src/base/Contract.ts +++ b/packages/api-contract/src/base/Contract.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; +import type { ApiTypes, DecorateMethod } from '@polkadot/api/types'; import type { Bytes } from '@polkadot/types'; import type { AccountId, ContractExecResult, EventRecord } from '@polkadot/types/interfaces'; import type { AnyJson, CodecArg, ISubmittableResult, Registry } from '@polkadot/types/types'; @@ -11,6 +11,7 @@ import type { ContractCallResult, ContractCallSend, ContractGeneric, ContractQue import BN from 'bn.js'; import { map } from 'rxjs/operators'; + import { SubmittableResult } from '@polkadot/api'; import { ApiBase } from '@polkadot/api/base'; import { assert, bnToBn, isFunction, isUndefined, logger, stringCamelCase } from '@polkadot/util'; diff --git a/packages/api-contract/src/base/types.ts b/packages/api-contract/src/base/types.ts index 639195c655..e70f171820 100644 --- a/packages/api-contract/src/base/types.ts +++ b/packages/api-contract/src/base/types.ts @@ -3,8 +3,8 @@ import type BN from 'bn.js'; import type { Observable } from 'rxjs'; -import type { ApiTypes, ObsInnerType } from '@polkadot/api/types'; import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types'; +import type { ApiTypes, ObsInnerType } from '@polkadot/api/types'; import type { AccountId } from '@polkadot/types/interfaces'; import type { CodecArg } from '@polkadot/types/types'; import type { AbiMessage, BlueprintOptions, ContractCallOutcome, ContractOptions } from '../types'; diff --git a/packages/api-contract/src/checkTypes.manual.ts b/packages/api-contract/src/checkTypes.manual.ts index 06671f4d9c..50ba9c1f5a 100644 --- a/packages/api-contract/src/checkTypes.manual.ts +++ b/packages/api-contract/src/checkTypes.manual.ts @@ -4,7 +4,7 @@ // Simple non-runnable checks to test type definitions in the editor itself import { ApiPromise } from '@polkadot/api'; -import { TestKeyringMap, createTestPairs } from '@polkadot/keyring/testingPairs'; +import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs'; import abiIncrementer from '../test/contracts/ink/incrementer.json'; import { BlueprintPromise, ContractPromise } from '.'; diff --git a/packages/api-contract/src/util.ts b/packages/api-contract/src/util.ts index 22e8a94924..f48c20bb2a 100644 --- a/packages/api-contract/src/util.ts +++ b/packages/api-contract/src/util.ts @@ -8,8 +8,9 @@ import type { Codec, CodecArg, Registry, TypeDef } from '@polkadot/types/types'; import type { BlueprintOptions, ContractOptions } from './types'; import BN from 'bn.js'; + import { createTypeUnsafe } from '@polkadot/types/create'; -import { isBn, isBigInt, isNumber, isString } from '@polkadot/util'; +import { isBigInt, isBn, isNumber, isString } from '@polkadot/util'; type ContractEvents = 'CodeStored' | 'ContractExecution' | 'Instantiated'; diff --git a/packages/api-derive/src/accounts/accountId.ts b/packages/api-derive/src/accounts/accountId.ts index 4623bb4f1b..38eaa98062 100644 --- a/packages/api-derive/src/accounts/accountId.ts +++ b/packages/api-derive/src/accounts/accountId.ts @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import { of } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; -import { isU8a, assertReturn } from '@polkadot/util'; + +import { assertReturn, isU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; import { memo } from '../util'; diff --git a/packages/api-derive/src/accounts/idAndIndex.ts b/packages/api-derive/src/accounts/idAndIndex.ts index b3fc1377c2..e4b29a3df4 100644 --- a/packages/api-derive/src/accounts/idAndIndex.ts +++ b/packages/api-derive/src/accounts/idAndIndex.ts @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import type { AccountIdAndIndex } from '../types'; import { of } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; + import { isU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; diff --git a/packages/api-derive/src/accounts/idToIndex.ts b/packages/api-derive/src/accounts/idToIndex.ts index acc2e3c830..8b21803bdd 100644 --- a/packages/api-derive/src/accounts/idToIndex.ts +++ b/packages/api-derive/src/accounts/idToIndex.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { AccountId, AccountIndex } from '@polkadot/types/interfaces'; import type { AccountIndexes } from '../types'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/accounts/identity.ts b/packages/api-derive/src/accounts/identity.ts index 7fc432e543..d0e6c703e2 100644 --- a/packages/api-derive/src/accounts/identity.ts +++ b/packages/api-derive/src/accounts/identity.ts @@ -10,6 +10,7 @@ import type { DeriveAccountRegistration, DeriveHasIdentity } from '../types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { isHex, u8aToString } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/accounts/indexToId.ts b/packages/api-derive/src/accounts/indexToId.ts index e69b5ed1fe..704f2cfd44 100644 --- a/packages/api-derive/src/accounts/indexToId.ts +++ b/packages/api-derive/src/accounts/indexToId.ts @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { Option, Vec } from '@polkadot/types'; import type { AccountId, AccountIndex, BalanceOf } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; import { of } from 'rxjs'; import { map, startWith } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; + import { ENUMSET_SIZE } from '@polkadot/types/generic/AccountIndex'; import { isFunction } from '@polkadot/util'; diff --git a/packages/api-derive/src/accounts/indexes.ts b/packages/api-derive/src/accounts/indexes.ts index 1cc6efbb10..3c66b4af2d 100644 --- a/packages/api-derive/src/accounts/indexes.ts +++ b/packages/api-derive/src/accounts/indexes.ts @@ -9,6 +9,7 @@ import type { AccountIndexes } from '../types'; import { of } from 'rxjs'; import { map, startWith, switchMap } from 'rxjs/operators'; + import { ENUMSET_SIZE } from '@polkadot/types/generic/AccountIndex'; import { isFunction } from '@polkadot/util'; diff --git a/packages/api-derive/src/accounts/info.ts b/packages/api-derive/src/accounts/info.ts index 71af21d77c..82d857fd2c 100644 --- a/packages/api-derive/src/accounts/info.ts +++ b/packages/api-derive/src/accounts/info.ts @@ -10,6 +10,7 @@ import type { DeriveAccountInfo, DeriveAccountRegistration } from '../types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { u8aToString } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/balances/account.ts b/packages/api-derive/src/balances/account.ts index 61243d301b..39a178acad 100644 --- a/packages/api-derive/src/balances/account.ts +++ b/packages/api-derive/src/balances/account.ts @@ -2,13 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { AccountId, AccountData, AccountIndex, AccountInfo, Address, Balance, Index } from '@polkadot/types/interfaces'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { AccountData, AccountId, AccountIndex, AccountInfo, Address, Balance, Index } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; import type { DeriveBalancesAccount } from '../types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; + import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/balances/all.ts b/packages/api-derive/src/balances/all.ts index 0721e3c048..4c05bf509d 100644 --- a/packages/api-derive/src/balances/all.ts +++ b/packages/api-derive/src/balances/all.ts @@ -10,6 +10,7 @@ import type { DeriveBalancesAccount, DeriveBalancesAll } from '../types'; import BN from 'bn.js'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { bnMax, isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/balances/votingBalances.ts b/packages/api-derive/src/balances/votingBalances.ts index a1fdc92028..8d98c99e72 100644 --- a/packages/api-derive/src/balances/votingBalances.ts +++ b/packages/api-derive/src/balances/votingBalances.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces'; import type { DeriveBalancesAccount } from '../types'; import { combineLatest, of } from 'rxjs'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/chain/bestNumber.ts b/packages/api-derive/src/chain/bestNumber.ts index cf0cf53fda..6eebcf25e7 100644 --- a/packages/api-derive/src/chain/bestNumber.ts +++ b/packages/api-derive/src/chain/bestNumber.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/chain/bestNumberFinalized.ts b/packages/api-derive/src/chain/bestNumberFinalized.ts index 7533736bba..50a5868798 100644 --- a/packages/api-derive/src/chain/bestNumberFinalized.ts +++ b/packages/api-derive/src/chain/bestNumberFinalized.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/chain/bestNumberLag.ts b/packages/api-derive/src/chain/bestNumberLag.ts index 9040b8cd07..7a20e7b666 100644 --- a/packages/api-derive/src/chain/bestNumberLag.ts +++ b/packages/api-derive/src/chain/bestNumberLag.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; import { combineLatest } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/chain/getBlock.ts b/packages/api-derive/src/chain/getBlock.ts index e6a948bf62..dc45cbddc1 100644 --- a/packages/api-derive/src/chain/getBlock.ts +++ b/packages/api-derive/src/chain/getBlock.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import { ApiInterfaceRx } from '@polkadot/api/types'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import { combineLatest, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; diff --git a/packages/api-derive/src/chain/getHeader.ts b/packages/api-derive/src/chain/getHeader.ts index 3a461470be..0f85afc219 100644 --- a/packages/api-derive/src/chain/getHeader.ts +++ b/packages/api-derive/src/chain/getHeader.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import { ApiInterfaceRx } from '@polkadot/api/types'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import { combineLatest, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; diff --git a/packages/api-derive/src/chain/subscribeNewHeads.ts b/packages/api-derive/src/chain/subscribeNewHeads.ts index eebf8327fb..6a07ed02b8 100644 --- a/packages/api-derive/src/chain/subscribeNewHeads.ts +++ b/packages/api-derive/src/chain/subscribeNewHeads.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import { ApiInterfaceRx } from '@polkadot/api/types'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import { combineLatest, of } from 'rxjs'; import { map } from 'rxjs/operators'; diff --git a/packages/api-derive/src/collective/proposals.ts b/packages/api-derive/src/collective/proposals.ts index 3fed74bf26..ebe5a5558c 100644 --- a/packages/api-derive/src/collective/proposals.ts +++ b/packages/api-derive/src/collective/proposals.ts @@ -9,6 +9,7 @@ import type { DeriveCollectiveProposal } from '../types'; import { combineLatest, of } from 'rxjs'; import { catchError, map, switchMap } from 'rxjs/operators'; + import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/council/votes.ts b/packages/api-derive/src/council/votes.ts index 86cfed3d6c..6bb722641e 100644 --- a/packages/api-derive/src/council/votes.ts +++ b/packages/api-derive/src/council/votes.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { Vec } from '@polkadot/types'; import type { AccountId, Balance } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; -import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { DeriveCouncilVote, DeriveCouncilVotes } from '../types'; import { combineLatest } from 'rxjs'; diff --git a/packages/api-derive/src/council/votesOf.ts b/packages/api-derive/src/council/votesOf.ts index fce6d03fa3..4db6081123 100644 --- a/packages/api-derive/src/council/votesOf.ts +++ b/packages/api-derive/src/council/votesOf.ts @@ -2,11 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { AccountId } from '@polkadot/types/interfaces'; import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { AccountId } from '@polkadot/types/interfaces'; import type { DeriveCouncilVote } from '../types'; import { map } from 'rxjs/operators'; + import { memo } from '../util'; export function votesOf (instanceId: string, api: ApiInterfaceRx): (accountId: string | Uint8Array | AccountId) => Observable { diff --git a/packages/api-derive/src/democracy/dispatchQueue.ts b/packages/api-derive/src/democracy/dispatchQueue.ts index 223a6abdfc..f62c3d9547 100644 --- a/packages/api-derive/src/democracy/dispatchQueue.ts +++ b/packages/api-derive/src/democracy/dispatchQueue.ts @@ -3,13 +3,14 @@ import type { Observable } from 'rxjs'; import type { ApiInterfaceRx } from '@polkadot/api/types'; -import type { Option, Vec, u64 } from '@polkadot/types'; +import type { Option, u64, Vec } from '@polkadot/types'; import type { BlockNumber, Hash, ReferendumIndex, Scheduled } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; import type { DeriveDispatch, DeriveProposalImage } from '../types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { isFunction, stringToHex } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/locks.ts b/packages/api-derive/src/democracy/locks.ts index 0a780de4ce..2ac08376cb 100644 --- a/packages/api-derive/src/democracy/locks.ts +++ b/packages/api-derive/src/democracy/locks.ts @@ -2,14 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { Option } from '@polkadot/types'; import type { AccountId, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, Vote, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces'; -import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { DeriveDemocracyLock } from '../types'; import BN from 'bn.js'; import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { BN_ZERO, isUndefined } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/preimages.ts b/packages/api-derive/src/democracy/preimages.ts index 944d38aca3..e07a2eed0f 100644 --- a/packages/api-derive/src/democracy/preimages.ts +++ b/packages/api-derive/src/democracy/preimages.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { Bytes, Option } from '@polkadot/types'; import type { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; -import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { DeriveProposalImage } from '../types'; import { map } from 'rxjs/operators'; diff --git a/packages/api-derive/src/democracy/proposals.ts b/packages/api-derive/src/democracy/proposals.ts index ad717d09ae..811f0a0fbc 100644 --- a/packages/api-derive/src/democracy/proposals.ts +++ b/packages/api-derive/src/democracy/proposals.ts @@ -6,10 +6,11 @@ import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { Option, Vec } from '@polkadot/types'; import type { AccountId, Balance, Hash, PropIndex } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; -import type { DeriveProposalImage, DeriveProposal } from '../types'; +import type { DeriveProposal, DeriveProposalImage } from '../types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/referendumsInfo.ts b/packages/api-derive/src/democracy/referendumsInfo.ts index 021e0d3421..0d6e7af855 100644 --- a/packages/api-derive/src/democracy/referendumsInfo.ts +++ b/packages/api-derive/src/democracy/referendumsInfo.ts @@ -4,12 +4,13 @@ import type { Observable } from 'rxjs'; import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { Option, Vec } from '@polkadot/types'; -import type { AccountId, ReferendumInfo, ReferendumInfoTo239, Vote, Voting, VotingDirectVote, VotingDelegating } from '@polkadot/types/interfaces'; +import type { AccountId, ReferendumInfo, ReferendumInfoTo239, Vote, Voting, VotingDelegating, VotingDirectVote } from '@polkadot/types/interfaces'; import type { DeriveBalancesAccount, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes } from '../types'; import BN from 'bn.js'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/sqrtElectorate.ts b/packages/api-derive/src/democracy/sqrtElectorate.ts index c4cd8e27e9..421ea4f197 100644 --- a/packages/api-derive/src/democracy/sqrtElectorate.ts +++ b/packages/api-derive/src/democracy/sqrtElectorate.ts @@ -2,10 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import { ApiInterfaceRx } from '@polkadot/api/types'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import BN from 'bn.js'; import { map } from 'rxjs/operators'; + import { bnSqrt } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/democracy/types.ts b/packages/api-derive/src/democracy/types.ts index 3a1d07bd37..f774e43241 100644 --- a/packages/api-derive/src/democracy/types.ts +++ b/packages/api-derive/src/democracy/types.ts @@ -3,7 +3,7 @@ import type BN from 'bn.js'; import type { Vec } from '@polkadot/types'; -import type { AccountId, Balance, BlockNumber, Hash, Proposal, PropIndex, ReferendumInfoTo239, ReferendumStatus, Vote, ReferendumIndex, VoteThreshold } from '@polkadot/types/interfaces'; +import type { AccountId, Balance, BlockNumber, Hash, PropIndex, Proposal, ReferendumIndex, ReferendumInfoTo239, ReferendumStatus, Vote, VoteThreshold } from '@polkadot/types/interfaces'; export interface DeriveDemocracyLock { balance: Balance; diff --git a/packages/api-derive/src/democracy/util.ts b/packages/api-derive/src/democracy/util.ts index fc5c80e7d1..e32b097c3f 100644 --- a/packages/api-derive/src/democracy/util.ts +++ b/packages/api-derive/src/democracy/util.ts @@ -8,6 +8,7 @@ import type { ITuple } from '@polkadot/types/types'; import type { DeriveProposalImage, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes, DeriveReferendumVoteState } from '../types'; import BN from 'bn.js'; + import { bnSqrt } from '@polkadot/util'; type PreimageInfo = [Bytes, AccountId, Balance, BlockNumber]; diff --git a/packages/api-derive/src/elections/info.ts b/packages/api-derive/src/elections/info.ts index 8695dedad2..8a4be07d63 100644 --- a/packages/api-derive/src/elections/info.ts +++ b/packages/api-derive/src/elections/info.ts @@ -3,7 +3,7 @@ import type { Observable } from 'rxjs'; import type { ApiInterfaceRx } from '@polkadot/api/types'; -import type { Vec, u32 } from '@polkadot/types'; +import type { u32, Vec } from '@polkadot/types'; import type { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; import type { DeriveElectionsInfo } from './types'; diff --git a/packages/api-derive/src/elections/types.ts b/packages/api-derive/src/elections/types.ts index 68fc05bf44..1d3dfef170 100644 --- a/packages/api-derive/src/elections/types.ts +++ b/packages/api-derive/src/elections/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AccountId, Balance, BlockNumber, SetIndex, VoteIndex } from '@polkadot/types/interfaces'; import type { u32 } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber, SetIndex, VoteIndex } from '@polkadot/types/interfaces'; export interface DeriveElectionsInfo { candidates: AccountId[]; diff --git a/packages/api-derive/src/imOnline/receivedHeartbeats.ts b/packages/api-derive/src/imOnline/receivedHeartbeats.ts index ad29e6f084..3e9613fa9d 100644 --- a/packages/api-derive/src/imOnline/receivedHeartbeats.ts +++ b/packages/api-derive/src/imOnline/receivedHeartbeats.ts @@ -9,6 +9,7 @@ import type { DeriveHeartbeats } from '../types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { BN_ZERO } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/index.spec.ts b/packages/api-derive/src/index.spec.ts index 7ee1ab6771..69b9989359 100644 --- a/packages/api-derive/src/index.spec.ts +++ b/packages/api-derive/src/index.spec.ts @@ -5,7 +5,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ -import { Observable, from } from 'rxjs'; +import { from, Observable } from 'rxjs'; + import { ApiRx } from '@polkadot/api/rx'; import { MockProvider } from '@polkadot/rpc-provider/mock'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/api-derive/src/parachains/info.ts b/packages/api-derive/src/parachains/info.ts index aff05f18bc..02ac55ff65 100644 --- a/packages/api-derive/src/parachains/info.ts +++ b/packages/api-derive/src/parachains/info.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { CollatorId, ParaId } from '@polkadot/types/interfaces'; -import type { DeriveParachainInfo, DeriveParachainFull, DeriveParachainActive } from '../types'; +import type { DeriveParachainActive, DeriveParachainFull, DeriveParachainInfo } from '../types'; import type { Active, DidUpdate, Heads, ParaInfoResult, PendingSwap, RelayDispatchQueue, RetryQueue, SelectedThreads } from './types'; import { of } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; import { didUpdateToBool } from './util'; diff --git a/packages/api-derive/src/parachains/overview.ts b/packages/api-derive/src/parachains/overview.ts index 9fc5920102..734c833977 100644 --- a/packages/api-derive/src/parachains/overview.ts +++ b/packages/api-derive/src/parachains/overview.ts @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { ParaId } from '@polkadot/types/interfaces'; import type { DeriveParachain, DeriveParachainInfo } from '../types'; import type { DidUpdate, ParaInfoResult, PendingSwap, RelayDispatchQueueSize } from './types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; import { didUpdateToBool } from './util'; diff --git a/packages/api-derive/src/parachains/types.ts b/packages/api-derive/src/parachains/types.ts index 8bbdf1585b..22df1b1ff0 100644 --- a/packages/api-derive/src/parachains/types.ts +++ b/packages/api-derive/src/parachains/types.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Bytes, Option, u32, Vec } from '@polkadot/types'; import type { CollatorId, ParaId, ParaInfo, Retriable, UpwardMessage } from '@polkadot/types/interfaces'; import type { ITuple } from '@polkadot/types/types'; -import type { Bytes, Option, u32, Vec } from '@polkadot/types'; export type ParaInfoResult = Option; export type PendingSwap = Option; diff --git a/packages/api-derive/src/session/eraLength.ts b/packages/api-derive/src/session/eraLength.ts index 27cc04a407..b26c67703a 100644 --- a/packages/api-derive/src/session/eraLength.ts +++ b/packages/api-derive/src/session/eraLength.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/session/eraProgress.ts b/packages/api-derive/src/session/eraProgress.ts index eb02939a87..c682409d18 100644 --- a/packages/api-derive/src/session/eraProgress.ts +++ b/packages/api-derive/src/session/eraProgress.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/session/indexes.ts b/packages/api-derive/src/session/indexes.ts index e445b24d0d..8adf72579b 100644 --- a/packages/api-derive/src/session/indexes.ts +++ b/packages/api-derive/src/session/indexes.ts @@ -9,6 +9,7 @@ import type { DeriveSessionIndexes } from '../types'; import { of } from 'rxjs'; import { map } from 'rxjs/operators'; + import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/session/info.ts b/packages/api-derive/src/session/info.ts index 5c170b1d85..f06d4e952e 100644 --- a/packages/api-derive/src/session/info.ts +++ b/packages/api-derive/src/session/info.ts @@ -5,7 +5,7 @@ import type { Observable } from 'rxjs'; import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { u64 } from '@polkadot/types'; import type { SessionIndex } from '@polkadot/types/interfaces'; -import type { DeriveSessionInfo, DeriveSessionIndexes } from '../types'; +import type { DeriveSessionIndexes, DeriveSessionInfo } from '../types'; import { map } from 'rxjs/operators'; diff --git a/packages/api-derive/src/session/progress.ts b/packages/api-derive/src/session/progress.ts index 07f0aae31c..e4ef36ba14 100644 --- a/packages/api-derive/src/session/progress.ts +++ b/packages/api-derive/src/session/progress.ts @@ -9,6 +9,7 @@ import type { DeriveSessionInfo, DeriveSessionProgress } from '../types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/session/sessionProgress.ts b/packages/api-derive/src/session/sessionProgress.ts index 9f05dd62a5..bfe81e834d 100644 --- a/packages/api-derive/src/session/sessionProgress.ts +++ b/packages/api-derive/src/session/sessionProgress.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { BlockNumber } from '@polkadot/types/interfaces'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/session/types.ts b/packages/api-derive/src/session/types.ts index bde4fdd328..24723a48e4 100644 --- a/packages/api-derive/src/session/types.ts +++ b/packages/api-derive/src/session/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { BlockNumber, EraIndex, Moment, SessionIndex } from '@polkadot/types/interfaces'; import type { Option, u32 } from '@polkadot/types'; +import type { BlockNumber, EraIndex, Moment, SessionIndex } from '@polkadot/types/interfaces'; export interface DeriveSessionIndexes { activeEra: EraIndex; diff --git a/packages/api-derive/src/society/info.ts b/packages/api-derive/src/society/info.ts index 3408bf75f6..fd2c219f10 100644 --- a/packages/api-derive/src/society/info.ts +++ b/packages/api-derive/src/society/info.ts @@ -3,7 +3,7 @@ import type { Observable } from 'rxjs'; import type { ApiInterfaceRx } from '@polkadot/api/types'; -import type { Option, Vec, u32 } from '@polkadot/types'; +import type { Option, u32, Vec } from '@polkadot/types'; import type { AccountId, BalanceOf, Bid } from '@polkadot/types/interfaces'; import type { DeriveSociety } from '../types'; diff --git a/packages/api-derive/src/staking/account.ts b/packages/api-derive/src/staking/account.ts index b4508e2b88..e3e5fcb4b6 100644 --- a/packages/api-derive/src/staking/account.ts +++ b/packages/api-derive/src/staking/account.ts @@ -8,6 +8,7 @@ import type { DeriveSessionInfo, DeriveStakingAccount, DeriveStakingKeys, Derive import BN from 'bn.js'; import { combineLatest, Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { BN_ZERO } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/currentPoints.ts b/packages/api-derive/src/staking/currentPoints.ts index ec49ec887f..553d52a751 100644 --- a/packages/api-derive/src/staking/currentPoints.ts +++ b/packages/api-derive/src/staking/currentPoints.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { AccountId, EraPoints, EraRewardPoints, RewardPoint } from '@polkadot/types/interfaces'; import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { AccountId, EraPoints, EraRewardPoints, RewardPoint } from '@polkadot/types/interfaces'; import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; diff --git a/packages/api-derive/src/staking/erasPoints.ts b/packages/api-derive/src/staking/erasPoints.ts index 29c5e88797..b410adaf2f 100644 --- a/packages/api-derive/src/staking/erasPoints.ts +++ b/packages/api-derive/src/staking/erasPoints.ts @@ -8,6 +8,7 @@ import type { DeriveEraPoints, DeriveEraValPoints } from '../types'; import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { BN_ZERO } from '@polkadot/util'; import { deriveCache, memo } from '../util'; diff --git a/packages/api-derive/src/staking/ownExposure.ts b/packages/api-derive/src/staking/ownExposure.ts index 9ce332e5c4..9e271b56a7 100644 --- a/packages/api-derive/src/staking/ownExposure.ts +++ b/packages/api-derive/src/staking/ownExposure.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { EraIndex, Exposure } from '@polkadot/types/interfaces'; import type { ApiInterfaceRx } from '@polkadot/api/types'; +import type { EraIndex, Exposure } from '@polkadot/types/interfaces'; import type { DeriveOwnExposure } from '../types'; import { combineLatest, of } from 'rxjs'; diff --git a/packages/api-derive/src/staking/query.ts b/packages/api-derive/src/staking/query.ts index d962299f40..9314b9b35f 100644 --- a/packages/api-derive/src/staking/query.ts +++ b/packages/api-derive/src/staking/query.ts @@ -10,6 +10,7 @@ import type { DeriveStakingQuery } from '../types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/staking/stakerExposure.ts b/packages/api-derive/src/staking/stakerExposure.ts index fad3291fe4..381d647865 100644 --- a/packages/api-derive/src/staking/stakerExposure.ts +++ b/packages/api-derive/src/staking/stakerExposure.ts @@ -4,7 +4,7 @@ import type { Observable } from 'rxjs'; import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { EraIndex } from '@polkadot/types/interfaces'; -import type { DeriveStakerExposure, DeriveEraValidatorExposure } from '../types'; +import type { DeriveEraValidatorExposure, DeriveStakerExposure } from '../types'; import { map, switchMap } from 'rxjs/operators'; diff --git a/packages/api-derive/src/staking/stakerRewards.ts b/packages/api-derive/src/staking/stakerRewards.ts index 4f63cf9cde..365adeaf41 100644 --- a/packages/api-derive/src/staking/stakerRewards.ts +++ b/packages/api-derive/src/staking/stakerRewards.ts @@ -11,6 +11,7 @@ import type { DeriveStakingQuery } from './types'; import BN from 'bn.js'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { isFunction } from '@polkadot/util'; import { memo } from '../util'; diff --git a/packages/api-derive/src/tx/events.ts b/packages/api-derive/src/tx/events.ts index f49e872a0d..9cab63896f 100644 --- a/packages/api-derive/src/tx/events.ts +++ b/packages/api-derive/src/tx/events.ts @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { EventRecord, Hash, SignedBlock } from '@polkadot/types/interfaces'; import { combineLatest } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; import { memo } from '../util'; diff --git a/packages/api-derive/src/tx/signingInfo.ts b/packages/api-derive/src/tx/signingInfo.ts index 836255e779..26390bd29e 100644 --- a/packages/api-derive/src/tx/signingInfo.ts +++ b/packages/api-derive/src/tx/signingInfo.ts @@ -2,12 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; +import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { Header, Index } from '@polkadot/types/interfaces'; import type { AnyNumber, Codec, IExtrinsicEra } from '@polkadot/types/types'; import { combineLatest, of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; -import { ApiInterfaceRx } from '@polkadot/api/types'; + import { isNumber, isUndefined } from '@polkadot/util'; import { FALLBACK_MAX_HASH_COUNT, FALLBACK_PERIOD, MAX_FINALITY_LAG, MORTAL_PERIOD } from './constants'; diff --git a/packages/api-derive/src/type/HeaderExtended.ts b/packages/api-derive/src/type/HeaderExtended.ts index 1c5887516b..1abf7a02cc 100644 --- a/packages/api-derive/src/type/HeaderExtended.ts +++ b/packages/api-derive/src/type/HeaderExtended.ts @@ -4,8 +4,8 @@ import type { AccountId, Header } from '@polkadot/types/interfaces'; import type { AnyJson, Constructor, Registry } from '@polkadot/types/types'; -import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions'; import { Struct } from '@polkadot/types'; +import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions'; import { extractAuthor } from './util'; diff --git a/packages/api-derive/src/type/SignedBlockExtended.ts b/packages/api-derive/src/type/SignedBlockExtended.ts index d1bd0be0f3..58f629c0c7 100644 --- a/packages/api-derive/src/type/SignedBlockExtended.ts +++ b/packages/api-derive/src/type/SignedBlockExtended.ts @@ -4,8 +4,8 @@ import type { AccountId, SignedBlock } from '@polkadot/types/interfaces'; import type { AnyJson, Constructor, Registry } from '@polkadot/types/types'; -import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions'; import { Struct } from '@polkadot/types'; +import runtimeTypes from '@polkadot/types/interfaces/runtime/definitions'; import { extractAuthor } from './util'; diff --git a/packages/api-derive/src/types.ts b/packages/api-derive/src/types.ts index a6459f1d71..b22ccc866b 100644 --- a/packages/api-derive/src/types.ts +++ b/packages/api-derive/src/types.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type BN from 'bn.js'; -import type { AccountId, Balance, BalanceLock, BalanceLockTo212, BalanceOf, Bid, BidKind, BlockNumber, Hash, Index, Proposal, ProposalIndex, SetIndex, SocietyVote, StrikeCount, TreasuryProposal, Votes, VouchingStatus } from '@polkadot/types/interfaces'; import type { u32 } from '@polkadot/types'; +import type { AccountId, Balance, BalanceLock, BalanceLockTo212, BalanceOf, Bid, BidKind, BlockNumber, Hash, Index, Proposal, ProposalIndex, SetIndex, SocietyVote, StrikeCount, TreasuryProposal, Votes, VouchingStatus } from '@polkadot/types/interfaces'; export * from './accounts/types'; export * from './chain/types'; diff --git a/packages/api-derive/src/util/approvalFlagsToBools.ts b/packages/api-derive/src/util/approvalFlagsToBools.ts index bee881f16a..9aac3a1786 100644 --- a/packages/api-derive/src/util/approvalFlagsToBools.ts +++ b/packages/api-derive/src/util/approvalFlagsToBools.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ApprovalFlag } from '@polkadot/types/interfaces/elections'; import type { Vec } from '@polkadot/types'; +import type { ApprovalFlag } from '@polkadot/types/interfaces/elections'; /** @internal */ export function approvalFlagsToBools (flags: Vec | ApprovalFlag[]): boolean[] { diff --git a/packages/api-derive/src/util/memo.ts b/packages/api-derive/src/util/memo.ts index daaf5743fb..b01980ef11 100644 --- a/packages/api-derive/src/util/memo.ts +++ b/packages/api-derive/src/util/memo.ts @@ -5,6 +5,7 @@ import type { Observer, TeardownLogic } from 'rxjs'; import createMemo from 'memoizee'; import { Observable } from 'rxjs'; + import { drr, normalizer } from '@polkadot/rpc-core/util'; type ObsFn = (...params: any[]) => Observable; diff --git a/packages/api/src/base/Decorate.ts b/packages/api/src/base/Decorate.ts index 616993d530..b12faa9d0f 100644 --- a/packages/api/src/base/Decorate.ts +++ b/packages/api/src/base/Decorate.ts @@ -8,18 +8,19 @@ import type { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces'; import type { StorageEntry } from '@polkadot/types/primitive/types'; import type { AnyFunction, CallFunction, Codec, CodecArg as Arg, InterfaceTypes, Registry, RegistryTypes } from '@polkadot/types/types'; import type { SubmittableExtrinsic } from '../submittable/types'; -import type { ApiInterfaceRx, ApiOptions, ApiTypes, DecorateMethod, DecoratedRpc, DecoratedRpcSection, PaginationOptions, QueryableConsts, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types'; +import type { ApiInterfaceRx, ApiOptions, ApiTypes, DecoratedRpc, DecoratedRpcSection, DecorateMethod, PaginationOptions, QueryableConsts, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types'; import BN from 'bn.js'; -import { BehaviorSubject, Observable, combineLatest, of } from 'rxjs'; +import { BehaviorSubject, combineLatest, Observable, of } from 'rxjs'; import { map, switchMap, take, tap, toArray } from 'rxjs/operators'; -import { ExactDerive, decorateDerive } from '@polkadot/api-derive'; + +import { decorateDerive, ExactDerive } from '@polkadot/api-derive'; import { memo } from '@polkadot/api-derive/util'; -import { Metadata, expandMetadata } from '@polkadot/metadata'; +import { expandMetadata, Metadata } from '@polkadot/metadata'; import { RpcCore } from '@polkadot/rpc-core'; import { WsProvider } from '@polkadot/rpc-provider'; -import { DEFAULT_VERSION as EXTRINSIC_DEFAULT_VERSION } from '@polkadot/types/extrinsic/constants'; import { TypeRegistry } from '@polkadot/types/create'; +import { DEFAULT_VERSION as EXTRINSIC_DEFAULT_VERSION } from '@polkadot/types/extrinsic/constants'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { assert, compactStripLength, logger, u8aToHex } from '@polkadot/util'; diff --git a/packages/api/src/base/Init.ts b/packages/api/src/base/Init.ts index 3a0dda5cab..d12e048141 100644 --- a/packages/api/src/base/Init.ts +++ b/packages/api/src/base/Init.ts @@ -3,7 +3,7 @@ import type { Observable, Subscription } from 'rxjs'; import type { Text } from '@polkadot/types'; -import type { ChainProperties, SignedBlock, RuntimeVersion } from '@polkadot/types/interfaces'; +import type { ChainProperties, RuntimeVersion, SignedBlock } from '@polkadot/types/interfaces'; import type { Registry } from '@polkadot/types/types'; import type { ApiBase, ApiOptions, ApiTypes, DecorateMethod } from '../types'; import type { VersionedRegistry } from './types'; @@ -11,11 +11,12 @@ import type { VersionedRegistry } from './types'; import BN from 'bn.js'; import { of } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; + import { Metadata } from '@polkadot/metadata'; import { TypeRegistry } from '@polkadot/types/create'; 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'; +import { assert, BN_ZERO, logger, u8aEq, u8aToU8a } from '@polkadot/util'; import { cryptoWaitReady } from '@polkadot/util-crypto'; import { Decorate } from './Decorate'; diff --git a/packages/api/src/base/types.ts b/packages/api/src/base/types.ts index 7f765db345..e088f1b2a0 100644 --- a/packages/api/src/base/types.ts +++ b/packages/api/src/base/types.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type BN from 'bn.js'; -import type { Constants } from '@polkadot/metadata/decorate/types'; import type { Metadata } from '@polkadot/metadata'; +import type { Constants } from '@polkadot/metadata/decorate/types'; import type { Registry } from '@polkadot/types/types'; export interface VersionedRegistry { diff --git a/packages/api/src/checkTypes.manual.ts b/packages/api/src/checkTypes.manual.ts index 768c773b7a..ed36dcfc32 100644 --- a/packages/api/src/checkTypes.manual.ts +++ b/packages/api/src/checkTypes.manual.ts @@ -8,7 +8,7 @@ import type { IExtrinsic, IMethod } from '@polkadot/types/types'; import { ApiPromise } from '@polkadot/api'; import { HeaderExtended } from '@polkadot/api-derive'; -import { TestKeyringMap, createTestPairs } from '@polkadot/keyring/testingPairs'; +import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs'; import { createTypeUnsafe, TypeRegistry } from '@polkadot/types/create'; import { SubmittableResult } from './'; diff --git a/packages/api/src/promise/index.ts b/packages/api/src/promise/index.ts index c03c5de882..8f5aea6d63 100644 --- a/packages/api/src/promise/index.ts +++ b/packages/api/src/promise/index.ts @@ -6,7 +6,8 @@ import type { ApiOptions, DecorateFn, DecorateMethodOptions, ObsInnerType, Stora import { EMPTY, Observable, Subscription } from 'rxjs'; import { catchError, tap } from 'rxjs/operators'; -import { isFunction, assert } from '@polkadot/util'; + +import { assert, isFunction } from '@polkadot/util'; import { ApiBase } from '../base'; import { Combinator, CombinatorCallback, CombinatorFunction } from './Combinator'; diff --git a/packages/api/src/rx/index.spec.ts b/packages/api/src/rx/index.spec.ts index 7f25734fcd..9d019efadb 100644 --- a/packages/api/src/rx/index.spec.ts +++ b/packages/api/src/rx/index.spec.ts @@ -5,6 +5,7 @@ import type { Observable } from 'rxjs'; import type { SubmittableExtrinsic } from '../submittable/types'; import { map, switchMap } from 'rxjs/operators'; + import { createTestPairs } from '@polkadot/keyring/testingPairs'; import { MockProvider } from '@polkadot/rpc-provider/mock'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/api/src/submittable/Result.ts b/packages/api/src/submittable/Result.ts index 76375539ec..7a7395968b 100644 --- a/packages/api/src/submittable/Result.ts +++ b/packages/api/src/submittable/Result.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DispatchError, DispatchInfo, ExtrinsicStatus, EventRecord } from '@polkadot/types/interfaces'; +import type { DispatchError, DispatchInfo, EventRecord, ExtrinsicStatus } from '@polkadot/types/interfaces'; import type { AnyJson, ISubmittableResult } from '@polkadot/types/types'; import type { SubmittableResultValue } from './types'; diff --git a/packages/api/src/submittable/createClass.ts b/packages/api/src/submittable/createClass.ts index 5b5ee6c3ef..77e1b140fc 100644 --- a/packages/api/src/submittable/createClass.ts +++ b/packages/api/src/submittable/createClass.ts @@ -5,16 +5,17 @@ import type { Observable } from 'rxjs'; import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo } from '@polkadot/types/interfaces'; -import type { Callback, Codec, Constructor, IKeyringPair, Registry, SignatureOptions, ISubmittableResult } from '@polkadot/types/types'; +import type { Callback, Codec, Constructor, IKeyringPair, ISubmittableResult, Registry, SignatureOptions } from '@polkadot/types/types'; import type { ApiInterfaceRx, ApiTypes, SignerResult } from '../types'; -import type { AddressOrPair, SignerOptions, SubmittableExtrinsic, SubmittableDryRunResult, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription, SubmittableThis } from './types'; +import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, SubmittableExtrinsic, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription, SubmittableThis } from './types'; import { of } from 'rxjs'; import { first, map, mapTo, mergeMap, switchMap, tap } from 'rxjs/operators'; + import { assert, isBn, isFunction, isNumber, isString, isU8a } from '@polkadot/util'; -import { filterEvents, isKeyringPair } from '../util'; import { ApiBase } from '../base'; +import { filterEvents, isKeyringPair } from '../util'; import { SubmittableResult } from './Result'; interface SubmittableOptions { diff --git a/packages/api/src/submittable/types.ts b/packages/api/src/submittable/types.ts index aa6ed33d84..8cabc0acf9 100644 --- a/packages/api/src/submittable/types.ts +++ b/packages/api/src/submittable/types.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { AccountId, Address, ApplyExtrinsicResult, DispatchError, DispatchInfo, Extrinsic, ExtrinsicStatus, EventRecord, Hash, RuntimeDispatchInfo } from '@polkadot/types/interfaces'; -import type { AnyNumber, Callback, Codec, IExtrinsicEra, IKeyringPair, Signer, ISubmittableResult } from '@polkadot/types/types'; +import type { AccountId, Address, ApplyExtrinsicResult, DispatchError, DispatchInfo, EventRecord, Extrinsic, ExtrinsicStatus, Hash, RuntimeDispatchInfo } from '@polkadot/types/interfaces'; +import type { AnyNumber, Callback, Codec, IExtrinsicEra, IKeyringPair, ISubmittableResult, Signer } from '@polkadot/types/types'; import type { ApiTypes } from '../types'; export interface SubmittableResultValue { diff --git a/packages/api/src/types/base.ts b/packages/api/src/types/base.ts index 188a889156..a8989249a1 100644 --- a/packages/api/src/types/base.ts +++ b/packages/api/src/types/base.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Observable } from 'rxjs'; // eslint-disable-next-line @typescript-eslint/no-unused-vars +import type { Observable } from 'rxjs'; import type { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types'; // Prepend an element V onto the beginning of a tuple T. diff --git a/packages/api/src/types/index.ts b/packages/api/src/types/index.ts index e50fc716f7..f0828c3cac 100644 --- a/packages/api/src/types/index.ts +++ b/packages/api/src/types/index.ts @@ -6,13 +6,13 @@ import '@polkadot/api/augment'; import type BN from 'bn.js'; import type { DeriveCustom, ExactDerive } from '@polkadot/api-derive'; +import type { Metadata } from '@polkadot/metadata'; import type { RpcInterface } from '@polkadot/rpc-core/types'; import type { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types'; -import type { Metadata } from '@polkadot/metadata'; import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces'; -import type { DefinitionRpc, DefinitionRpcSub, Signer, SignatureOptions, Registry, RegisteredTypes } from '@polkadot/types/types'; -import type { DeriveAllSections } from '../util/decorate'; +import type { DefinitionRpc, DefinitionRpcSub, RegisteredTypes, Registry, SignatureOptions, Signer } from '@polkadot/types/types'; import type { ApiBase } from '../base'; +import type { DeriveAllSections } from '../util/decorate'; import type { QueryableConsts } from './consts'; import type { DecoratedRpc } from './rpc'; import type { QueryableStorage, QueryableStorageMulti } from './storage'; diff --git a/packages/api/src/types/rpc.ts b/packages/api/src/types/rpc.ts index 4a989c8fe2..3e4613cfc1 100644 --- a/packages/api/src/types/rpc.ts +++ b/packages/api/src/types/rpc.ts @@ -6,7 +6,7 @@ import type { Json, Raw } from '@polkadot/types/codec'; import type { AnyFunction, Callback } from '@polkadot/types/types'; // eslint-disable-next-line @typescript-eslint/no-unused-vars -import { ApiTypes, Push, PromiseResult, RxResult, UnsubscribePromise } from './base'; +import { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './base'; export interface RpcRxResult extends RxResult { json (...args: Parameters): Observable; diff --git a/packages/api/src/types/storage.ts b/packages/api/src/types/storage.ts index c876d6f087..526022f2fe 100644 --- a/packages/api/src/types/storage.ts +++ b/packages/api/src/types/storage.ts @@ -4,8 +4,8 @@ import type { Observable } from 'rxjs'; import type { StorageKey, u64 } from '@polkadot/types'; import type { Hash } from '@polkadot/types/interfaces'; -import type { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types'; import type { StorageEntry } from '@polkadot/types/primitive/types'; +import type { AnyFunction, Callback, Codec, CodecArg } from '@polkadot/types/types'; import type { ApiTypes, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base'; interface StorageEntryObservableMulti { diff --git a/packages/api/src/util/validate.spec.ts b/packages/api/src/util/validate.spec.ts index 15bcf6c1f3..7219733bea 100644 --- a/packages/api/src/util/validate.spec.ts +++ b/packages/api/src/util/validate.spec.ts @@ -1,9 +1,8 @@ // Copyright 2017-2019 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Storage } from '@polkadot/metadata/decorate/types'; - import { Metadata, storageFromMeta } from '@polkadot/metadata'; +import { Storage } from '@polkadot/metadata/decorate/types'; import metaStatic from '@polkadot/metadata/static'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/api/src/util/validate.ts b/packages/api/src/util/validate.ts index f997da4f9b..2b42891c1e 100644 --- a/packages/api/src/util/validate.ts +++ b/packages/api/src/util/validate.ts @@ -1,8 +1,8 @@ // Copyright 2017-2019 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { StorageEntry } from '@polkadot/types/primitive/types'; import type { Type } from '@polkadot/types'; +import type { StorageEntry } from '@polkadot/types/primitive/types'; import { assert, isUndefined } from '@polkadot/util'; diff --git a/packages/metadata/src/MagicNumber.spec.ts b/packages/metadata/src/MagicNumber.spec.ts index a57be42ebf..33d69b7cbb 100644 --- a/packages/metadata/src/MagicNumber.spec.ts +++ b/packages/metadata/src/MagicNumber.spec.ts @@ -3,7 +3,7 @@ import { TypeRegistry } from '@polkadot/types/create'; -import { MagicNumber, MAGIC_NUMBER } from './MagicNumber'; +import { MAGIC_NUMBER, MagicNumber } from './MagicNumber'; describe('MagicNumber', (): void => { const registry = new TypeRegistry(); diff --git a/packages/metadata/src/MagicNumber.ts b/packages/metadata/src/MagicNumber.ts index fd71530b74..fac4216084 100644 --- a/packages/metadata/src/MagicNumber.ts +++ b/packages/metadata/src/MagicNumber.ts @@ -3,9 +3,8 @@ import type { AnyNumber, Registry } from '@polkadot/types/types'; -import { assert } from '@polkadot/util'; - import { U32 } from '@polkadot/types/primitive'; +import { assert } from '@polkadot/util'; export const MAGIC_NUMBER = 0x6174656d; // `meta`, reversed for Little Endian encoding diff --git a/packages/metadata/src/Metadata.spec.ts b/packages/metadata/src/Metadata.spec.ts index d45470203d..eceb921323 100644 --- a/packages/metadata/src/Metadata.spec.ts +++ b/packages/metadata/src/Metadata.spec.ts @@ -3,8 +3,8 @@ import { TypeRegistry } from '@polkadot/types/create'; -import substrateData from './static'; import { Metadata } from './Metadata'; +import substrateData from './static'; describe('Metadata', (): void => { it('allows creation from hex with JSON equivalence', (): void => { diff --git a/packages/metadata/src/MetadataVersioned.ts b/packages/metadata/src/MetadataVersioned.ts index ecc5f90fc6..4d5d823076 100644 --- a/packages/metadata/src/MetadataVersioned.ts +++ b/packages/metadata/src/MetadataVersioned.ts @@ -7,11 +7,11 @@ import type { Registry } from '@polkadot/types/types'; import { Struct } from '@polkadot/types/codec'; import { assert } from '@polkadot/util'; -import { MagicNumber } from './MagicNumber'; import { toV10 } from './v9/toV10'; import { toV11 } from './v10/toV11'; import { toV12 } from './v11/toV12'; import { toLatest } from './v12/toLatest'; +import { MagicNumber } from './MagicNumber'; import { getUniqTypes, toCallsOnly } from './util'; type MetaMapped = MetadataV9 | MetadataV10 | MetadataV11 | MetadataV12; diff --git a/packages/metadata/src/decorate/consts/fromMetadata.ts b/packages/metadata/src/decorate/consts/fromMetadata.ts index 537637b6ad..69ffb17093 100644 --- a/packages/metadata/src/decorate/consts/fromMetadata.ts +++ b/packages/metadata/src/decorate/consts/fromMetadata.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Registry } from '@polkadot/types/types'; -import type { Constants, ConstantCodec, ModuleConstants } from '../types'; +import type { ConstantCodec, Constants, ModuleConstants } from '../types'; import { hexToU8a, stringCamelCase } from '@polkadot/util'; diff --git a/packages/metadata/src/decorate/extrinsics/index.spec.ts b/packages/metadata/src/decorate/extrinsics/index.spec.ts index b8a7190e93..b833ab1647 100644 --- a/packages/metadata/src/decorate/extrinsics/index.spec.ts +++ b/packages/metadata/src/decorate/extrinsics/index.spec.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import BN from 'bn.js'; + import { createTestPairs } from '@polkadot/keyring/testingPairs'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/metadata/src/decorate/storage/createFunction.ts b/packages/metadata/src/decorate/storage/createFunction.ts index 93c12d983a..d95de50751 100644 --- a/packages/metadata/src/decorate/storage/createFunction.ts +++ b/packages/metadata/src/decorate/storage/createFunction.ts @@ -6,12 +6,13 @@ import type { StorageEntry } from '@polkadot/types/primitive/types'; import type { Codec, Registry } from '@polkadot/types/types'; import BN from 'bn.js'; + import { Raw } from '@polkadot/types/codec'; import { StorageKey } from '@polkadot/types/primitive'; import { assert, compactAddLength, compactStripLength, isNull, isUndefined, stringLowerFirst, u8aConcat } from '@polkadot/util'; import { xxhashAsU8a } from '@polkadot/util-crypto'; -import { HasherFunction, getHasher } from './getHasher'; +import { getHasher, HasherFunction } from './getHasher'; export interface CreateItemOptions { key?: string; diff --git a/packages/metadata/src/decorate/storage/getHasher.ts b/packages/metadata/src/decorate/storage/getHasher.ts index 27ca39013b..227f81bb0e 100644 --- a/packages/metadata/src/decorate/storage/getHasher.ts +++ b/packages/metadata/src/decorate/storage/getHasher.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AllHashers } from '@polkadot/types/interfaces/metadata/definitions'; import type { StorageHasher } from '@polkadot/types/interfaces'; +import type { AllHashers } from '@polkadot/types/interfaces/metadata/definitions'; import { u8aConcat, u8aToU8a } from '@polkadot/util'; import { blake2AsU8a, xxhashAsU8a } from '@polkadot/util-crypto'; diff --git a/packages/metadata/src/decorate/types.ts b/packages/metadata/src/decorate/types.ts index 1caf895c15..3fd7880653 100644 --- a/packages/metadata/src/decorate/types.ts +++ b/packages/metadata/src/decorate/types.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { AugmentedConst, QueryableConsts, QueryableModuleConsts } from '@polkadot/api/types/consts'; -import type { Codec, ModulesWithCalls } from '@polkadot/types/types'; import type { StorageEntry } from '@polkadot/types/primitive/types'; +import type { Codec, ModulesWithCalls } from '@polkadot/types/types'; export interface ModuleStorage { [key: string]: StorageEntry; diff --git a/packages/metadata/src/types.ts b/packages/metadata/src/types.ts index c91cc87f90..6002c1880c 100644 --- a/packages/metadata/src/types.ts +++ b/packages/metadata/src/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec } from '@polkadot/types/types'; import type { Vec } from '@polkadot/types/codec'; +import type { Codec } from '@polkadot/types/types'; export interface MetadataInterface extends Codec { modules: Vec; diff --git a/packages/metadata/src/util/getUniqTypes.ts b/packages/metadata/src/util/getUniqTypes.ts index 479f954b8b..2dce17e1c7 100644 --- a/packages/metadata/src/util/getUniqTypes.ts +++ b/packages/metadata/src/util/getUniqTypes.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Codec, Registry } from '@polkadot/types/types'; import type { Option, Vec } from '@polkadot/types/codec'; import type { Text, Type } from '@polkadot/types/primitive'; +import type { Codec, Registry } from '@polkadot/types/types'; import { flattenUniq } from './flattenUniq'; import { validateTypes } from './validateTypes'; diff --git a/packages/metadata/src/util/testUtil.ts b/packages/metadata/src/util/testUtil.ts index 3e89e2fb2b..0324db419a 100644 --- a/packages/metadata/src/util/testUtil.ts +++ b/packages/metadata/src/util/testUtil.ts @@ -6,8 +6,8 @@ import type { MetadataInterface } from '../types'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; -import { getUniqTypes } from './getUniqTypes'; import { Metadata } from '../Metadata'; +import { getUniqTypes } from './getUniqTypes'; /** @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 b568d37c73..678dfcf48c 100644 --- a/packages/metadata/src/util/toCallsOnly.spec.ts +++ b/packages/metadata/src/util/toCallsOnly.spec.ts @@ -3,8 +3,8 @@ import { TypeRegistry } from '@polkadot/types/create'; -import staticData from '../static'; import { Metadata } from '../Metadata'; +import staticData from '../static'; describe('toCallsOnly', (): void => { const registry = new TypeRegistry(); diff --git a/packages/metadata/src/v10/Metadata.spec.ts b/packages/metadata/src/v10/Metadata.spec.ts index 514228f255..f8fd816fc0 100644 --- a/packages/metadata/src/v10/Metadata.spec.ts +++ b/packages/metadata/src/v10/Metadata.spec.ts @@ -3,9 +3,9 @@ import { TypeRegistry } from '@polkadot/types/create'; -import substrateJson from './static-substrate.json'; -import substrateData from './static'; import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil'; +import substrateData from './static'; +import substrateJson from './static-substrate.json'; describe('MetadataV10 (substrate)', (): void => { const registry = new TypeRegistry(); diff --git a/packages/metadata/src/v11/Metadata.spec.ts b/packages/metadata/src/v11/Metadata.spec.ts index a77aece86f..204d153470 100644 --- a/packages/metadata/src/v11/Metadata.spec.ts +++ b/packages/metadata/src/v11/Metadata.spec.ts @@ -3,9 +3,9 @@ import { TypeRegistry } from '@polkadot/types/create'; -import substrateJson from './static-substrate.json'; -import substrateData from './static'; import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil'; +import substrateData from './static'; +import substrateJson from './static-substrate.json'; describe('MetadataV11 (substrate)', (): void => { const registry = new TypeRegistry(); diff --git a/packages/metadata/src/v12/Metadata.spec.ts b/packages/metadata/src/v12/Metadata.spec.ts index 2ec39f5e85..d99f30ba63 100644 --- a/packages/metadata/src/v12/Metadata.spec.ts +++ b/packages/metadata/src/v12/Metadata.spec.ts @@ -3,9 +3,9 @@ import { TypeRegistry } from '@polkadot/types/create'; -import substrateJson from './static-substrate.json'; -import substrateData from './static'; import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil'; +import substrateData from './static'; +import substrateJson from './static-substrate.json'; describe('MetadataV12 (substrate)', (): void => { const registry = new TypeRegistry(); diff --git a/packages/metadata/src/v12/toLatest.ts b/packages/metadata/src/v12/toLatest.ts index 5c12edb54d..d03efc4502 100644 --- a/packages/metadata/src/v12/toLatest.ts +++ b/packages/metadata/src/v12/toLatest.ts @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/metadata authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { EventMetadataV12, EventMetadataLatest, FunctionMetadataV12, FunctionMetadataLatest, MetadataV12, MetadataLatest, ModuleMetadataLatest, ModuleMetadataV12, StorageMetadataV12, StorageMetadataLatest, StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; -import type { Registry, OverrideModuleType } from '@polkadot/types/types'; +import type { EventMetadataLatest, EventMetadataV12, FunctionMetadataLatest, FunctionMetadataV12, MetadataLatest, MetadataV12, ModuleMetadataLatest, ModuleMetadataV12, StorageEntryMetadataLatest, StorageMetadataLatest, StorageMetadataV12 } from '@polkadot/types/interfaces/metadata'; +import type { OverrideModuleType, Registry } from '@polkadot/types/types'; -import { getModuleTypes } from '@polkadot/types-known'; import { Type } from '@polkadot/types/primitive'; +import { getModuleTypes } from '@polkadot/types-known'; import { stringCamelCase } from '@polkadot/util'; // Since we don't have insight into the origin specification, we can only define what we know about diff --git a/packages/metadata/src/v9/Metadata.spec.ts b/packages/metadata/src/v9/Metadata.spec.ts index 0399fcbaa5..b5882c3149 100644 --- a/packages/metadata/src/v9/Metadata.spec.ts +++ b/packages/metadata/src/v9/Metadata.spec.ts @@ -3,9 +3,9 @@ import { TypeRegistry } from '@polkadot/types/create'; -import substrateJson from './static-substrate.json'; -import substrateData from './static'; import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil'; +import substrateData from './static'; +import substrateJson from './static-substrate.json'; describe('MetadataV9 (substrate)', (): void => { const registry = new TypeRegistry(); diff --git a/packages/rpc-core/src/index.ts b/packages/rpc-core/src/index.ts index 6b9f55c70c..bc10fcf997 100644 --- a/packages/rpc-core/src/index.ts +++ b/packages/rpc-core/src/index.ts @@ -11,9 +11,10 @@ import type { RpcInterface, RpcInterfaceMethod } from './types'; import memoizee from 'memoizee'; import { Observable } from 'rxjs'; import { publishReplay, refCount } from 'rxjs/operators'; -import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; + import { Option } from '@polkadot/types'; import { createClass, createTypeUnsafe } from '@polkadot/types/create'; +import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; import { assert, hexToU8a, isFunction, isNull, isUndefined, logger, u8aToU8a } from '@polkadot/util'; import { drr, normalizer, refCountDelay } from './util'; diff --git a/packages/rpc-core/src/replay.spec.ts b/packages/rpc-core/src/replay.spec.ts index bf1be9008e..daa0309e44 100644 --- a/packages/rpc-core/src/replay.spec.ts +++ b/packages/rpc-core/src/replay.spec.ts @@ -4,6 +4,7 @@ import type { Observable } from 'rxjs'; import { of } from 'rxjs'; + import { MockProvider } from '@polkadot/rpc-provider/mock'; import { TypeRegistry } from '@polkadot/types/create'; diff --git a/packages/rpc-core/src/util/drr.ts b/packages/rpc-core/src/util/drr.ts index 69ba79b3c9..bb2ea7fb20 100644 --- a/packages/rpc-core/src/util/drr.ts +++ b/packages/rpc-core/src/util/drr.ts @@ -3,7 +3,8 @@ import type { Observable } from 'rxjs'; -import { catchError, distinctUntilChanged, publishReplay, tap, refCount } from 'rxjs/operators'; +import { catchError, distinctUntilChanged, publishReplay, refCount, tap } from 'rxjs/operators'; + import { logger } from '@polkadot/util'; import { refCountDelay } from './refCountDelay'; diff --git a/packages/rpc-provider/src/coder/index.ts b/packages/rpc-provider/src/coder/index.ts index cce1f83ead..43a64cfe51 100644 --- a/packages/rpc-provider/src/coder/index.ts +++ b/packages/rpc-provider/src/coder/index.ts @@ -3,7 +3,7 @@ import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '../types'; -import { assert, isUndefined, isNumber, isString } from '@polkadot/util'; +import { assert, isNumber, isString, isUndefined } from '@polkadot/util'; function formatErrorData (data?: string | number): string { if (isUndefined(data)) { diff --git a/packages/rpc-provider/src/http/index.ts b/packages/rpc-provider/src/http/index.ts index 95bcee935e..ed566bd2c1 100644 --- a/packages/rpc-provider/src/http/index.ts +++ b/packages/rpc-provider/src/http/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitted, ProviderInterfaceEmitCb } from '../types'; +import type { ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types'; import { assert, logger } from '@polkadot/util'; import fetch from '@polkadot/x-fetch'; diff --git a/packages/rpc-provider/src/http/send.spec.ts b/packages/rpc-provider/src/http/send.spec.ts index e0c4e4fdb9..f6c33aab34 100644 --- a/packages/rpc-provider/src/http/send.spec.ts +++ b/packages/rpc-provider/src/http/send.spec.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Mock } from './../mock/types'; -import { mockHttp, TEST_HTTP_URL } from '../../test/mockHttp'; +import type { Mock } from './../mock/types'; +import { mockHttp, TEST_HTTP_URL } from '../../test/mockHttp'; import { HttpProvider } from './'; describe('send', (): void => { diff --git a/packages/rpc-provider/src/http/types.ts b/packages/rpc-provider/src/http/types.ts index 634c27d255..1ad9af7334 100644 --- a/packages/rpc-provider/src/http/types.ts +++ b/packages/rpc-provider/src/http/types.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { Logger } from '@polkadot/util/types'; - import type { RpcCoder } from '../coder'; export interface HttpState { diff --git a/packages/rpc-provider/src/mock/index.ts b/packages/rpc-provider/src/mock/index.ts index be71f5caf9..0570840273 100644 --- a/packages/rpc-provider/src/mock/index.ts +++ b/packages/rpc-provider/src/mock/index.ts @@ -5,15 +5,16 @@ import type { Header } from '@polkadot/types/interfaces'; import type { Codec, Registry } from '@polkadot/types/types'; -import type { ProviderInterface, ProviderInterfaceEmitted, ProviderInterfaceEmitCb } from '../types'; -import type { MockStateSubscriptions, MockStateSubscriptionCallback, MockStateDb } from './types'; +import type { ProviderInterface, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types'; +import type { MockStateDb, MockStateSubscriptionCallback, MockStateSubscriptions } from './types'; import BN from 'bn.js'; import EventEmitter from 'eventemitter3'; + +import { createTestKeyring } from '@polkadot/keyring/testing'; import { Metadata, storageFromMeta } from '@polkadot/metadata'; import rpcMetadata from '@polkadot/metadata/static'; import jsonrpc from '@polkadot/types/interfaces/jsonrpc'; -import { createTestKeyring } from '@polkadot/keyring/testing'; import rpcHeader from '@polkadot/types/json/Header.004.json'; import rpcSignedBlock from '@polkadot/types/json/SignedBlock.004.immortal.json'; import { assert, bnToU8a, logger, u8aToHex } from '@polkadot/util'; diff --git a/packages/rpc-provider/src/mock/types.ts b/packages/rpc-provider/src/mock/types.ts index 7eaca90af2..66be1a42e7 100644 --- a/packages/rpc-provider/src/mock/types.ts +++ b/packages/rpc-provider/src/mock/types.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Constructor } from '@polkadot/types/types'; - import type { Server } from 'mock-socket'; +import type { Constructor } from '@polkadot/types/types'; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access export interface Global extends NodeJS.Global { diff --git a/packages/rpc-provider/src/ws/connect.spec.ts b/packages/rpc-provider/src/ws/connect.spec.ts index b59943d2a2..18ccde64ab 100644 --- a/packages/rpc-provider/src/ws/connect.spec.ts +++ b/packages/rpc-provider/src/ws/connect.spec.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Mock } from './../mock/types'; -import { mockWs, TEST_WS_URL } from '../../test/mockWs'; +import type { Mock } from './../mock/types'; +import { mockWs, TEST_WS_URL } from '../../test/mockWs'; import { WsProvider } from './'; function sleepMs (ms = 0): Promise { diff --git a/packages/rpc-provider/src/ws/index.spec.ts b/packages/rpc-provider/src/ws/index.spec.ts index bb0b41db8c..c82c288b4d 100644 --- a/packages/rpc-provider/src/ws/index.spec.ts +++ b/packages/rpc-provider/src/ws/index.spec.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/rpc-provider authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Mock } from './../mock/types'; import { mockWs, TEST_WS_URL } from '../../test/mockWs'; - +import { Mock } from './../mock/types'; import { WsProvider } from './'; let ws: WsProvider; diff --git a/packages/rpc-provider/src/ws/index.ts b/packages/rpc-provider/src/ws/index.ts index e287cdd257..bfa8693858 100644 --- a/packages/rpc-provider/src/ws/index.ts +++ b/packages/rpc-provider/src/ws/index.ts @@ -3,9 +3,10 @@ /* eslint-disable camelcase */ -import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitted, ProviderInterfaceEmitCb } from '../types'; +import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types'; import EventEmitter from 'eventemitter3'; + import { assert, isChildClass, isNull, isUndefined, logger } from '@polkadot/util'; import WS from '@polkadot/x-ws'; diff --git a/packages/rpc-provider/src/ws/send.spec.ts b/packages/rpc-provider/src/ws/send.spec.ts index d8ccbc0a21..efcff23f90 100644 --- a/packages/rpc-provider/src/ws/send.spec.ts +++ b/packages/rpc-provider/src/ws/send.spec.ts @@ -3,9 +3,8 @@ import type { Constructor } from '@polkadot/types/types'; -import { Global, Mock } from './../mock/types'; import { mockWs, TEST_WS_URL } from '../../test/mockWs'; - +import { Global, Mock } from './../mock/types'; import { WsProvider } from './'; declare const global: Global; diff --git a/packages/rpc-provider/src/ws/subscribe.spec.ts b/packages/rpc-provider/src/ws/subscribe.spec.ts index 544220c042..dab8f9935d 100644 --- a/packages/rpc-provider/src/ws/subscribe.spec.ts +++ b/packages/rpc-provider/src/ws/subscribe.spec.ts @@ -3,9 +3,8 @@ import type { Constructor } from '@polkadot/types/types'; -import { Global, Mock } from './../mock/types'; import { mockWs, TEST_WS_URL } from '../../test/mockWs'; - +import { Global, Mock } from './../mock/types'; import { WsProvider } from './'; declare const global: Global; diff --git a/packages/rpc-provider/src/ws/unsubscribe.spec.ts b/packages/rpc-provider/src/ws/unsubscribe.spec.ts index f3e85cacca..0c4ed8ae12 100644 --- a/packages/rpc-provider/src/ws/unsubscribe.spec.ts +++ b/packages/rpc-provider/src/ws/unsubscribe.spec.ts @@ -3,9 +3,8 @@ import type { Constructor } from '@polkadot/types/types'; -import { Global, Mock } from './../mock/types'; import { mockWs, TEST_WS_URL } from '../../test/mockWs'; - +import { Global, Mock } from './../mock/types'; import { WsProvider } from './'; declare const global: Global; diff --git a/packages/typegen/package.json b/packages/typegen/package.json index 5457197069..bedb3bd7f4 100644 --- a/packages/typegen/package.json +++ b/packages/typegen/package.json @@ -33,10 +33,10 @@ "@polkadot/util": "^4.2.1", "handlebars": "^4.7.6", "websocket": "^1.0.32", - "yargs": "^16.1.1" + "yargs": "^16.2.0" }, "devDependencies": { "@types/websocket": "^1.0.1", - "@types/yargs": "^15.0.10" + "@types/yargs": "^15.0.11" } } diff --git a/packages/typegen/src/extractChain.ts b/packages/typegen/src/extractChain.ts index 59b0a91210..736c9fe79d 100644 --- a/packages/typegen/src/extractChain.ts +++ b/packages/typegen/src/extractChain.ts @@ -6,6 +6,7 @@ import process from 'process'; import yargs from 'yargs'; + import { ApiPromise, WsProvider } from '@polkadot/api/index'; /** @internal */ diff --git a/packages/typegen/src/fromChain.ts b/packages/typegen/src/fromChain.ts index 4966cf65ea..e47123e676 100644 --- a/packages/typegen/src/fromChain.ts +++ b/packages/typegen/src/fromChain.ts @@ -3,6 +3,7 @@ import path from 'path'; import yargs from 'yargs'; + import { formatNumber } from '@polkadot/util'; import WS from '@polkadot/x-ws'; diff --git a/packages/typegen/src/fromDefs.ts b/packages/typegen/src/fromDefs.ts index 2d11ea8613..dbd3de2cfe 100644 --- a/packages/typegen/src/fromDefs.ts +++ b/packages/typegen/src/fromDefs.ts @@ -3,6 +3,7 @@ import path from 'path'; import yargs from 'yargs'; + import * as substrateDefs from '@polkadot/types/interfaces/definitions'; import { generateInterfaceTypes } from './generate/interfaceRegistry'; diff --git a/packages/typegen/src/generate/consts.ts b/packages/typegen/src/generate/consts.ts index 917ac63a10..afb50a416d 100644 --- a/packages/typegen/src/generate/consts.ts +++ b/packages/typegen/src/generate/consts.ts @@ -3,13 +3,13 @@ import Handlebars from 'handlebars'; -import staticData from '@polkadot/metadata/static'; import { Metadata } from '@polkadot/metadata'; +import staticData from '@polkadot/metadata/static'; import { TypeRegistry } from '@polkadot/types/create'; import * as defaultDefs from '@polkadot/types/interfaces/definitions'; import { stringCamelCase } from '@polkadot/util'; -import { createImports, compareName, formatType, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; +import { compareName, createImports, formatType, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; const template = readTemplate('consts'); const generateForMetaTemplate = Handlebars.compile(template); diff --git a/packages/typegen/src/generate/query.ts b/packages/typegen/src/generate/query.ts index b8ef1071e7..f56b85e58f 100644 --- a/packages/typegen/src/generate/query.ts +++ b/packages/typegen/src/generate/query.ts @@ -6,14 +6,14 @@ import type { Registry } from '@polkadot/types/types'; import Handlebars from 'handlebars'; -import staticData from '@polkadot/metadata/static'; import { Metadata } from '@polkadot/metadata'; +import staticData from '@polkadot/metadata/static'; +import { TypeRegistry } from '@polkadot/types/create'; import * as defaultDefs from '@polkadot/types/interfaces/definitions'; import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; -import { TypeRegistry } from '@polkadot/types/create'; import { stringCamelCase } from '@polkadot/util'; -import { TypeImports, createImports, compareName, formatType, getSimilarTypes, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; +import { compareName, createImports, formatType, getSimilarTypes, readTemplate, registerDefinitions, setImports, TypeImports, writeFile } from '../util'; import { ModuleTypes } from '../util/imports'; // From a storage entry metadata, we return [args, returnType] diff --git a/packages/typegen/src/generate/rpc.ts b/packages/typegen/src/generate/rpc.ts index 5f225d8fce..d118cf026e 100644 --- a/packages/typegen/src/generate/rpc.ts +++ b/packages/typegen/src/generate/rpc.ts @@ -4,10 +4,11 @@ import type { Definitions } from '@polkadot/types/types'; import Handlebars from 'handlebars'; + import { TypeRegistry } from '@polkadot/types/create'; import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'; -import { createImports, getSimilarTypes, formatType, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; +import { createImports, formatType, getSimilarTypes, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; const StorageKeyTye = 'StorageKey | string | Uint8Array | any'; diff --git a/packages/typegen/src/generate/tsDef.ts b/packages/typegen/src/generate/tsDef.ts index e9bfb3b33d..2c4cdf7b71 100644 --- a/packages/typegen/src/generate/tsDef.ts +++ b/packages/typegen/src/generate/tsDef.ts @@ -6,12 +6,13 @@ import type { ModuleTypes } from '../util/imports'; import Handlebars from 'handlebars'; import path from 'path'; + import { getTypeDef } from '@polkadot/types/create'; import { TypeDefInfo } from '@polkadot/types/create/types'; import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'; -import { isString, stringCamelCase, stringUpperFirst, assert } from '@polkadot/util'; +import { assert, isString, stringCamelCase, stringUpperFirst } from '@polkadot/util'; -import { TypeImports, createImports, exportInterface, exportType, readTemplate, formatType, setImports, writeFile } from '../util'; +import { createImports, exportInterface, exportType, formatType, readTemplate, setImports, TypeImports, writeFile } from '../util'; interface Imports extends TypeImports { interfaces: [string, string][]; diff --git a/packages/typegen/src/generate/tx.ts b/packages/typegen/src/generate/tx.ts index bc95b96904..005e13d83d 100644 --- a/packages/typegen/src/generate/tx.ts +++ b/packages/typegen/src/generate/tx.ts @@ -4,14 +4,15 @@ import type { Registry } from '@polkadot/types/types'; import Handlebars from 'handlebars'; -import staticData from '@polkadot/metadata/static'; + import { Metadata } from '@polkadot/metadata'; +import staticData from '@polkadot/metadata/static'; +import { TypeRegistry } from '@polkadot/types/create'; import * as defaultDefs from '@polkadot/types/interfaces/definitions'; import { Text } from '@polkadot/types/primitive'; -import { TypeRegistry } from '@polkadot/types/create'; import { stringCamelCase } from '@polkadot/util'; -import { createImports, compareName, getSimilarTypes, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; +import { compareName, createImports, getSimilarTypes, readTemplate, registerDefinitions, setImports, writeFile } from '../util'; const MAPPED_NAMES: Record = { new: 'updated' diff --git a/packages/typegen/src/metadataMd.ts b/packages/typegen/src/metadataMd.ts index c5e4d69a1d..e5311443c3 100644 --- a/packages/typegen/src/metadataMd.ts +++ b/packages/typegen/src/metadataMd.ts @@ -5,14 +5,15 @@ import type { MetadataLatest } from '@polkadot/types/interfaces/metadata'; import type { Codec, DefinitionRpcParam } from '@polkadot/types/types'; import fs from 'fs'; + import { Metadata } from '@polkadot/metadata'; import rpcdata from '@polkadot/metadata/static'; -import { GenericCall as Call } from '@polkadot/types/generic'; -import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; -import { TypeRegistry } from '@polkadot/types/create'; import { Vec } from '@polkadot/types/codec'; +import { TypeRegistry } from '@polkadot/types/create'; +import { GenericCall as Call } from '@polkadot/types/generic'; import * as definitions from '@polkadot/types/interfaces/definitions'; import { Text } from '@polkadot/types/primitive'; +import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey'; import { stringCamelCase, stringLowerFirst } from '@polkadot/util'; interface Page { diff --git a/packages/typegen/src/util/derived.ts b/packages/typegen/src/util/derived.ts index 90145808ae..02a8e643da 100644 --- a/packages/typegen/src/util/derived.ts +++ b/packages/typegen/src/util/derived.ts @@ -4,19 +4,19 @@ import type { TypeDef } from '@polkadot/types/create/types'; import type { Constructor, Registry } from '@polkadot/types/types'; -import { ClassOfUnsafe, getTypeDef } from '@polkadot/types/create'; -import { Compact, Enum, Option, Struct, UInt, Vec, Tuple } from '@polkadot/types/codec'; +import { Compact, Enum, Option, Struct, Tuple, UInt, Vec } from '@polkadot/types/codec'; import { AbstractInt } from '@polkadot/types/codec/AbstractInt'; -import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions'; -import { GenericAccountId, GenericLookupSource, GenericVote } from '@polkadot/types/generic'; +import { ClassOfUnsafe, getTypeDef } from '@polkadot/types/create'; import { TypeDefInfo } from '@polkadot/types/create/types'; +import { GenericAccountId, GenericLookupSource, GenericVote } from '@polkadot/types/generic'; +import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions'; import { Null } from '@polkadot/types/primitive'; import * as primitiveClasses from '@polkadot/types/primitive'; import { isChildClass } from '@polkadot/util'; import { isCompactEncodable } from './class'; import { formatType } from './formatting'; -import { setImports, ModuleTypes, TypeImports } from './imports'; +import { ModuleTypes, setImports, TypeImports } from './imports'; function arrayToStrType (arr: string[]): string { return `${arr.map((c) => `'${c}'`).join(' | ')}`; diff --git a/packages/typegen/src/util/formatting.ts b/packages/typegen/src/util/formatting.ts index 3d6b070947..9776207342 100644 --- a/packages/typegen/src/util/formatting.ts +++ b/packages/typegen/src/util/formatting.ts @@ -9,8 +9,8 @@ import { getTypeDef, paramsNotation } from '@polkadot/types/create'; import { TypeDefInfo } from '@polkadot/types/create/types'; import { isString } from '@polkadot/util'; -import { setImports, ModuleTypes, TypeImports } from './imports'; import { readTemplate } from './file'; +import { ModuleTypes, setImports, TypeImports } from './imports'; interface ImportDef { file: string; diff --git a/packages/typegen/src/util/imports.ts b/packages/typegen/src/util/imports.ts index a3334687e6..234cbe55a2 100644 --- a/packages/typegen/src/util/imports.ts +++ b/packages/typegen/src/util/imports.ts @@ -1,10 +1,9 @@ // Copyright 2017-2020 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeDefInfo } from '@polkadot/types/create/types'; - import * as codecClasses from '@polkadot/types/codec'; import { getTypeDef } from '@polkadot/types/create'; +import { TypeDefInfo } from '@polkadot/types/create/types'; import * as extrinsicClasses from '@polkadot/types/extrinsic'; import * as genericClasses from '@polkadot/types/generic'; import * as primitiveClasses from '@polkadot/types/primitive'; diff --git a/packages/types-known/src/index.spec.ts b/packages/types-known/src/index.spec.ts index b7316663d9..a80fc789b9 100644 --- a/packages/types-known/src/index.spec.ts +++ b/packages/types-known/src/index.spec.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { TypeRegistry } from '@polkadot/types/create/registry'; + import { getModuleTypes } from './'; const registry = new TypeRegistry(); diff --git a/packages/types-known/src/index.ts b/packages/types-known/src/index.ts index b64bf89d15..a228a03a19 100644 --- a/packages/types-known/src/index.ts +++ b/packages/types-known/src/index.ts @@ -4,7 +4,7 @@ import type BN from 'bn.js'; import type { Text } from '@polkadot/types'; import type { Hash } from '@polkadot/types/interfaces'; -import type { ChainUpgradeVersion, DefinitionRpc, DefinitionRpcSub, Registry, RegistryTypes, OverrideModuleType, OverrideVersionedType } from '@polkadot/types/types'; +import type { ChainUpgradeVersion, DefinitionRpc, DefinitionRpcSub, OverrideModuleType, OverrideVersionedType, Registry, RegistryTypes } from '@polkadot/types/types'; import { bnToBn, isUndefined } from '@polkadot/util'; diff --git a/packages/types-known/src/upgrades/index.ts b/packages/types-known/src/upgrades/index.ts index bd26425fb7..0603a9142f 100644 --- a/packages/types-known/src/upgrades/index.ts +++ b/packages/types-known/src/upgrades/index.ts @@ -5,6 +5,7 @@ import type { ChainUpgrades } from '@polkadot/types/types'; import type { ChainUpgradesRaw } from './types'; import BN from 'bn.js'; + import { assert, hexToU8a } from '@polkadot/util'; import kusama from './kusama'; diff --git a/packages/types/src/codec/AbstractInt.ts b/packages/types/src/codec/AbstractInt.ts index 5138e4a02c..37aae5dee3 100644 --- a/packages/types/src/codec/AbstractInt.ts +++ b/packages/types/src/codec/AbstractInt.ts @@ -6,7 +6,8 @@ import type { AnyNumber, Codec, Registry } from '../types'; import type { UIntBitLength } from './types'; import BN from 'bn.js'; -import { BN_ZERO, assert, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, u8aToBn } from '@polkadot/util'; + +import { assert, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, u8aToBn } from '@polkadot/util'; export const DEFAULT_UINT_BITS = 64; diff --git a/packages/types/src/codec/BTreeMap.ts b/packages/types/src/codec/BTreeMap.ts index 26959b5940..a486dbd74c 100644 --- a/packages/types/src/codec/BTreeMap.ts +++ b/packages/types/src/codec/BTreeMap.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { CodecMap } from './Map'; diff --git a/packages/types/src/codec/BTreeSet.spec.ts b/packages/types/src/codec/BTreeSet.spec.ts index a4803055fc..d7b0e72ecd 100644 --- a/packages/types/src/codec/BTreeSet.spec.ts +++ b/packages/types/src/codec/BTreeSet.spec.ts @@ -5,7 +5,6 @@ import type { CodecTo } from '../types'; import { TypeRegistry } from '../create'; import { Text, U32 } from '../primitive'; - import { BTreeSet, Struct } from '.'; const registry = new TypeRegistry(); diff --git a/packages/types/src/codec/BTreeSet.ts b/packages/types/src/codec/BTreeSet.ts index 71bcdc2e90..0d3355c9b9 100644 --- a/packages/types/src/codec/BTreeSet.ts +++ b/packages/types/src/codec/BTreeSet.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { H256 } from '../interfaces/runtime'; -import type { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'; -import { isHex, hexToU8a, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a, compactFromU8a, compactToU8a } from '@polkadot/util'; +import { compactFromU8a, compactToU8a, hexToU8a, isHex, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; import { compareSet, decodeU8a, typeToConstructor } from './utils'; diff --git a/packages/types/src/codec/Compact.ts b/packages/types/src/codec/Compact.ts index 222594b790..67605def9a 100644 --- a/packages/types/src/codec/Compact.ts +++ b/packages/types/src/codec/Compact.ts @@ -6,6 +6,7 @@ import type { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registr import type { CompactEncodable, UIntBitLength } from './types'; import BN from 'bn.js'; + import { compactFromU8a, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util'; import { typeToConstructor } from './utils'; diff --git a/packages/types/src/codec/Date.ts b/packages/types/src/codec/Date.ts index e428680b55..81bcce3430 100644 --- a/packages/types/src/codec/Date.ts +++ b/packages/types/src/codec/Date.ts @@ -6,6 +6,7 @@ import type { AnyNumber, Codec, Registry } from '../types'; import type { UIntBitLength } from './types'; import BN from 'bn.js'; + import { bnToBn, bnToHex, bnToU8a, isString, isU8a, u8aToBn } from '@polkadot/util'; const BITLENGTH: UIntBitLength = 64; diff --git a/packages/types/src/codec/Enum.ts b/packages/types/src/codec/Enum.ts index 15a8587f0f..b82981537e 100644 --- a/packages/types/src/codec/Enum.ts +++ b/packages/types/src/codec/Enum.ts @@ -7,8 +7,8 @@ import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../t import { assert, hexToU8a, isHex, isNumber, isObject, isString, isU8a, isUndefined, stringCamelCase, stringUpperFirst, u8aConcat, u8aToHex } from '@polkadot/util'; import { Null } from '../primitive/Null'; -import { mapToTypeMap } from './utils'; import { Struct } from './Struct'; +import { mapToTypeMap } from './utils'; // export interface, this is used in Enum.with, so required as public by TS export interface EnumConstructor { diff --git a/packages/types/src/codec/HashMap.ts b/packages/types/src/codec/HashMap.ts index 2985ff7d24..a6c9f599f9 100644 --- a/packages/types/src/codec/HashMap.ts +++ b/packages/types/src/codec/HashMap.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { CodecMap } from './Map'; diff --git a/packages/types/src/codec/Linkage.ts b/packages/types/src/codec/Linkage.ts index 9ff3f59589..5969849ca3 100644 --- a/packages/types/src/codec/Linkage.ts +++ b/packages/types/src/codec/Linkage.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { Option } from './Option'; import { Struct } from './Struct'; diff --git a/packages/types/src/codec/Map.ts b/packages/types/src/codec/Map.ts index 5718aae2b2..d2e228ce10 100644 --- a/packages/types/src/codec/Map.ts +++ b/packages/types/src/codec/Map.ts @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { H256 } from '../interfaces/runtime'; -import type { AnyJson, Constructor, Codec, InterfaceTypes, Registry } from '../types'; +import type { AnyJson, Codec, Constructor, InterfaceTypes, Registry } from '../types'; -import { isHex, hexToU8a, isObject, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a, compactFromU8a, compactToU8a } from '@polkadot/util'; +import { compactFromU8a, compactToU8a, hexToU8a, isHex, isObject, isU8a, logger, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; import { compareMap, decodeU8a, typeToConstructor } from './utils'; diff --git a/packages/types/src/codec/Result.spec.ts b/packages/types/src/codec/Result.spec.ts index f281b5380f..be4914e2b2 100644 --- a/packages/types/src/codec/Result.spec.ts +++ b/packages/types/src/codec/Result.spec.ts @@ -3,8 +3,8 @@ import { hexToString } from '@polkadot/util'; -import { u32, Text } from '../primitive'; import { TypeRegistry } from '../create'; +import { Text, u32 } from '../primitive'; import { Result } from '.'; describe('Result', (): void => { diff --git a/packages/types/src/codec/Set.ts b/packages/types/src/codec/Set.ts index ca0f081234..062e72d86e 100644 --- a/packages/types/src/codec/Set.ts +++ b/packages/types/src/codec/Set.ts @@ -5,7 +5,8 @@ import type { H256 } from '../interfaces/runtime'; import type { Codec, Constructor, Registry } from '../types'; import BN from 'bn.js'; -import { assert, bnToBn, bnToU8a, isBn, isU8a, isNumber, isString, isUndefined, stringCamelCase, stringUpperFirst, u8aToHex, u8aToBn, u8aToU8a } from '@polkadot/util'; + +import { assert, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, stringCamelCase, stringUpperFirst, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util'; import { compareArray } from './utils'; diff --git a/packages/types/src/codec/Tuple.ts b/packages/types/src/codec/Tuple.ts index 70dda6440c..fa63141d75 100644 --- a/packages/types/src/codec/Tuple.ts +++ b/packages/types/src/codec/Tuple.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyNumber, AnyU8a, AnyString, Codec, Constructor, InterfaceTypes, Registry } from '../types'; +import type { AnyNumber, AnyString, AnyU8a, Codec, Constructor, InterfaceTypes, Registry } from '../types'; -import { isU8a, isHex, hexToU8a, u8aConcat } from '@polkadot/util'; +import { hexToU8a, isHex, isU8a, u8aConcat } from '@polkadot/util'; -import { decodeU8a, mapToTypeMap, typeToConstructor } from './utils'; import { AbstractArray } from './AbstractArray'; +import { decodeU8a, mapToTypeMap, typeToConstructor } from './utils'; type AnyTuple = AnyU8a | string | (Codec | AnyU8a | AnyNumber | AnyString | undefined | null)[]; diff --git a/packages/types/src/codec/Vec.ts b/packages/types/src/codec/Vec.ts index ffc6e4bde7..9c29c520ce 100644 --- a/packages/types/src/codec/Vec.ts +++ b/packages/types/src/codec/Vec.ts @@ -5,8 +5,8 @@ import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { assert, compactFromU8a, logger, u8aToU8a } from '@polkadot/util'; -import { decodeU8a, typeToConstructor } from './utils'; import { AbstractArray } from './AbstractArray'; +import { decodeU8a, typeToConstructor } from './utils'; const MAX_LENGTH = 64 * 1024; diff --git a/packages/types/src/codec/VecFixed.ts b/packages/types/src/codec/VecFixed.ts index 0fdc162479..154bee376c 100644 --- a/packages/types/src/codec/VecFixed.ts +++ b/packages/types/src/codec/VecFixed.ts @@ -3,11 +3,11 @@ import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; -import { assert, isU8a, u8aConcat, compactToU8a } from '@polkadot/util'; +import { assert, compactToU8a, isU8a, u8aConcat } from '@polkadot/util'; import { AbstractArray } from './AbstractArray'; -import { Vec } from './Vec'; import { typeToConstructor } from './utils'; +import { Vec } from './Vec'; /** * @name VecFixed diff --git a/packages/types/src/codec/utils/compareMap.spec.ts b/packages/types/src/codec/utils/compareMap.spec.ts index 2b8664793f..4e9dcdc38b 100644 --- a/packages/types/src/codec/utils/compareMap.spec.ts +++ b/packages/types/src/codec/utils/compareMap.spec.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Codec } from '../../types'; + import { TypeRegistry } from '../../create'; import { U32 } from '../../primitive'; import { compareMap } from '.'; diff --git a/packages/types/src/create/createClass.ts b/packages/types/src/create/createClass.ts index f29c60721d..3e859f6b4e 100644 --- a/packages/types/src/create/createClass.ts +++ b/packages/types/src/create/createClass.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { UIntBitLength, U8aBitLength } from '../codec/types'; +import type { U8aBitLength, UIntBitLength } from '../codec/types'; import type { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import type { FromReg, TypeDef } from './types'; diff --git a/packages/types/src/create/encodeTypes.spec.ts b/packages/types/src/create/encodeTypes.spec.ts index 471e514572..e03cfcfd7f 100644 --- a/packages/types/src/create/encodeTypes.spec.ts +++ b/packages/types/src/create/encodeTypes.spec.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeDefInfo } from './types'; - import { encodeTypeDef } from './encodeTypes'; +import { TypeDefInfo } from './types'; describe('encodeTypeDef', (): void => { it('correctly encodes a complex struct', (): void => { diff --git a/packages/types/src/create/getTypeDef.spec.ts b/packages/types/src/create/getTypeDef.spec.ts index c0cfc76fe8..bed157f3ed 100644 --- a/packages/types/src/create/getTypeDef.spec.ts +++ b/packages/types/src/create/getTypeDef.spec.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { TypeDefInfo } from './types'; -import { TypeRegistry, getTypeDef } from '.'; +import { getTypeDef, TypeRegistry } from '.'; describe('getTypeDef', (): void => { it('maps empty tuples to empty tuple', (): void => { diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index 45b8547832..c6f5af6787 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -4,10 +4,10 @@ /* eslint-disable @typescript-eslint/no-var-requires */ import type { ChainProperties, DispatchErrorModule, H256 } from '../interfaces/types'; -import type { CallFunction, Codec, Constructor, InterfaceTypes, RegistryError, RegistryTypes, Registry, RegistryMetadata, RegisteredTypes } from '../types'; +import type { CallFunction, Codec, Constructor, InterfaceTypes, RegisteredTypes, Registry, RegistryError, RegistryMetadata, RegistryTypes } from '../types'; -import { Metadata, extrinsicsFromMeta } from '@polkadot/metadata'; -import { BN_ZERO, assert, assertReturn, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, u8aToHex } from '@polkadot/util'; +import { extrinsicsFromMeta, Metadata } from '@polkadot/metadata'; +import { assert, assertReturn, BN_ZERO, formatBalance, isFunction, isString, isU8a, logger, stringCamelCase, u8aToHex } from '@polkadot/util'; import { blake2AsU8a } from '@polkadot/util-crypto'; import { Json, Raw } from '../codec'; diff --git a/packages/types/src/ethereum/AccountId.spec.ts b/packages/types/src/ethereum/AccountId.spec.ts index 919e5d41f9..0378724b12 100644 --- a/packages/types/src/ethereum/AccountId.spec.ts +++ b/packages/types/src/ethereum/AccountId.spec.ts @@ -3,8 +3,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { TypeRegistry } from '../create'; import { Raw } from '../codec/Raw'; +import { TypeRegistry } from '../create'; import { GenericEthereumAccountId as AccountId } from './AccountId'; describe('EthereumAccountId', (): void => { diff --git a/packages/types/src/ethereum/LookupSource.ts b/packages/types/src/ethereum/LookupSource.ts index 62b96c19e4..6d274dd5a2 100644 --- a/packages/types/src/ethereum/LookupSource.ts +++ b/packages/types/src/ethereum/LookupSource.ts @@ -4,7 +4,8 @@ import type { Registry } from '../types'; import BN from 'bn.js'; -import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToHex, u8aToU8a, u8aToBn } from '@polkadot/util'; + +import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; import { Base } from '../codec/Base'; diff --git a/packages/types/src/extrinsic/Extrinsic.ts b/packages/types/src/extrinsic/Extrinsic.ts index d4c50995df..47e097b05f 100644 --- a/packages/types/src/extrinsic/Extrinsic.ts +++ b/packages/types/src/extrinsic/Extrinsic.ts @@ -1,17 +1,17 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { FunctionMetadataLatest } from '../interfaces/metadata/types'; import type { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics'; +import type { FunctionMetadataLatest } from '../interfaces/metadata/types'; import type { Address, Balance, Call, Index } from '../interfaces/runtime'; import type { AnyJson, AnyU8a, ArgsDef, Codec, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, InterfaceTypes, Registry, SignatureOptions } from '../types'; +import type { GenericExtrinsicEra } from './ExtrinsicEra'; +import type { ExtrinsicValueV4 } from './v4/Extrinsic'; import { assert, compactAddLength, compactFromU8a, isHex, isU8a, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util'; import { Base } from '../codec/Base'; import { Compact } from '../codec/Compact'; -import { ExtrinsicValueV4 } from './v4/Extrinsic'; -import { GenericExtrinsicEra } from './ExtrinsicEra'; import { BIT_SIGNED, BIT_UNSIGNED, DEFAULT_VERSION, UNMASK_VERSION } from './constants'; interface CreateOptions { diff --git a/packages/types/src/extrinsic/ExtrinsicEra.ts b/packages/types/src/extrinsic/ExtrinsicEra.ts index bbfe45d8e1..aedcde9c54 100644 --- a/packages/types/src/extrinsic/ExtrinsicEra.ts +++ b/packages/types/src/extrinsic/ExtrinsicEra.ts @@ -4,11 +4,12 @@ import type { AnyU8a, IExtrinsicEra, Registry } from '../types'; import BN from 'bn.js'; -import { assert, bnToBn, formatNumber, hexToU8a, isHex, isU8a, isObject, u8aToBn, u8aToU8a } from '@polkadot/util'; + +import { assert, bnToBn, formatNumber, hexToU8a, isHex, isObject, isU8a, u8aToBn, u8aToU8a } from '@polkadot/util'; import { Enum } from '../codec/Enum'; -import { Tuple } from '../codec/Tuple'; import { Raw } from '../codec/Raw'; +import { Tuple } from '../codec/Tuple'; import { u64 as U64 } from '../primitive/U64'; import { IMMORTAL_ERA } from './constants'; diff --git a/packages/types/src/extrinsic/ExtrinsicPayload.ts b/packages/types/src/extrinsic/ExtrinsicPayload.ts index ebb1ad97a9..82a60aaf48 100644 --- a/packages/types/src/extrinsic/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/ExtrinsicPayload.ts @@ -11,8 +11,8 @@ import { Base } from '../codec/Base'; import { Compact } from '../codec/Compact'; import { Raw } from '../codec/Raw'; import { u32 } from '../primitive/U32'; -import { GenericExtrinsicEra } from './ExtrinsicEra'; import { DEFAULT_VERSION } from './constants'; +import { GenericExtrinsicEra } from './ExtrinsicEra'; interface ExtrinsicPayloadOptions { version?: number; diff --git a/packages/types/src/extrinsic/v4/Extrinsic.spec.ts b/packages/types/src/extrinsic/v4/Extrinsic.spec.ts index 428b2081be..ce5d4de81d 100644 --- a/packages/types/src/extrinsic/v4/Extrinsic.spec.ts +++ b/packages/types/src/extrinsic/v4/Extrinsic.spec.ts @@ -2,8 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import BN from 'bn.js'; + import { createTestPairs } from '@polkadot/keyring/testingPairs'; -import { Metadata, extrinsicsFromMeta } from '@polkadot/metadata'; +import { extrinsicsFromMeta, Metadata } from '@polkadot/metadata'; import rpcMetadata from '@polkadot/metadata/static'; import { TypeRegistry } from '../../create'; diff --git a/packages/types/src/generic/AccountId.spec.ts b/packages/types/src/generic/AccountId.spec.ts index 70f29e2dcd..57553c1fb2 100644 --- a/packages/types/src/generic/AccountId.spec.ts +++ b/packages/types/src/generic/AccountId.spec.ts @@ -3,8 +3,8 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { TypeRegistry } from '../create'; import { Raw } from '../codec/Raw'; +import { TypeRegistry } from '../create'; import jsonVec from '../json/AccountIdVec.001.json'; import { GenericAccountId as AccountId } from '.'; diff --git a/packages/types/src/generic/AccountId.ts b/packages/types/src/generic/AccountId.ts index 63baa38ff8..314bb27c14 100644 --- a/packages/types/src/generic/AccountId.ts +++ b/packages/types/src/generic/AccountId.ts @@ -3,7 +3,7 @@ import type { AnyString, AnyU8a, Registry } from '../types'; -import { hexToU8a, isHex, isString, isU8a, u8aToU8a, assert } from '@polkadot/util'; +import { assert, hexToU8a, isHex, isString, isU8a, u8aToU8a } from '@polkadot/util'; import { decodeAddress, encodeAddress } from '@polkadot/util-crypto'; import { U8aFixed } from '../codec/U8aFixed'; diff --git a/packages/types/src/generic/AccountIndex.ts b/packages/types/src/generic/AccountIndex.ts index 3e9cba2207..530253992b 100644 --- a/packages/types/src/generic/AccountIndex.ts +++ b/packages/types/src/generic/AccountIndex.ts @@ -4,7 +4,8 @@ import type { AnyNumber, Registry } from '../types'; import BN from 'bn.js'; -import { bnToBn, isBn, isBigInt, isNumber, isU8a, isHex } from '@polkadot/util'; + +import { bnToBn, isBigInt, isBn, isHex, isNumber, isU8a } from '@polkadot/util'; import { decodeAddress, encodeAddress } from '@polkadot/util-crypto'; import { u32 } from '../primitive/U32'; diff --git a/packages/types/src/generic/Block.ts b/packages/types/src/generic/Block.ts index 16a0540b5f..fcb9c1b598 100644 --- a/packages/types/src/generic/Block.ts +++ b/packages/types/src/generic/Block.ts @@ -1,12 +1,12 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { Vec } from '../codec/Vec'; +import type { GenericExtrinsic } from '../extrinsic/Extrinsic'; import type { Digest, DigestItem, H256, Header } from '../interfaces/runtime'; import type { AnyNumber, AnyU8a, Registry } from '../types'; -import { GenericExtrinsic } from '../extrinsic/Extrinsic'; import { Struct } from '../codec/Struct'; -import { Vec } from '../codec/Vec'; export interface HeaderValue { digest?: Digest | { logs: DigestItem[] }; diff --git a/packages/types/src/generic/Call.ts b/packages/types/src/generic/Call.ts index e6d0be27e1..6a90b04e4b 100644 --- a/packages/types/src/generic/Call.ts +++ b/packages/types/src/generic/Call.ts @@ -6,9 +6,9 @@ import type { AnyJson, AnyU8a, ArgsDef, CallFunction, Codec, IMethod, Registry } import { isHex, isObject, isU8a, u8aToU8a } from '@polkadot/util'; -import { getTypeDef, getTypeClass } from '../create'; import { Struct } from '../codec/Struct'; import { U8aFixed } from '../codec/U8aFixed'; +import { getTypeClass, getTypeDef } from '../create'; interface DecodeMethodInput { args: unknown; diff --git a/packages/types/src/generic/ConsensusEngineId.spec.ts b/packages/types/src/generic/ConsensusEngineId.spec.ts index 84e7ccf5af..ac6d244f9c 100644 --- a/packages/types/src/generic/ConsensusEngineId.spec.ts +++ b/packages/types/src/generic/ConsensusEngineId.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { GenericConsensusEngineId as ConsensusEngineId, CID_AURA, CID_BABE, CID_GRPA } from './ConsensusEngineId'; +import { CID_AURA, CID_BABE, CID_GRPA, GenericConsensusEngineId as ConsensusEngineId } from './ConsensusEngineId'; describe('ConsensusEngineId', (): void => { it('creates a valid id for aura', (): void => { diff --git a/packages/types/src/generic/ConsensusEngineId.ts b/packages/types/src/generic/ConsensusEngineId.ts index 014001445b..2fcf3227ce 100644 --- a/packages/types/src/generic/ConsensusEngineId.ts +++ b/packages/types/src/generic/ConsensusEngineId.ts @@ -1,9 +1,10 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { AccountId } from '../interfaces/runtime'; +import type { AccountId } from '../interfaces/runtime'; import BN from 'bn.js'; + import { bnToBn } from '@polkadot/util'; import { Bytes } from '../primitive/Bytes'; diff --git a/packages/types/src/generic/LookupSource.ts b/packages/types/src/generic/LookupSource.ts index 69d80e4a3c..ab856fb48b 100644 --- a/packages/types/src/generic/LookupSource.ts +++ b/packages/types/src/generic/LookupSource.ts @@ -4,7 +4,8 @@ import type { Registry } from '../types'; import BN from 'bn.js'; -import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToHex, u8aToU8a, u8aToBn } from '@polkadot/util'; + +import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; import { Base } from '../codec/Base'; diff --git a/packages/types/src/generic/Vote.ts b/packages/types/src/generic/Vote.ts index 9ff9c9b89e..e4895c1467 100644 --- a/packages/types/src/generic/Vote.ts +++ b/packages/types/src/generic/Vote.ts @@ -1,9 +1,9 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyJson, ArrayElementType, Registry } from '../types'; -import type { AllConvictions } from '../interfaces/democracy/definitions'; import type { Conviction } from '../interfaces/democracy'; +import type { AllConvictions } from '../interfaces/democracy/definitions'; +import type { AnyJson, ArrayElementType, Registry } from '../types'; import { isBoolean, isNumber, isU8a, isUndefined } from '@polkadot/util'; diff --git a/packages/types/src/index.spec.ts b/packages/types/src/index.spec.ts index 93cc4b7b11..c64c2443aa 100644 --- a/packages/types/src/index.spec.ts +++ b/packages/types/src/index.spec.ts @@ -6,9 +6,9 @@ import type { Codec } from './types'; import { Metadata } from '@polkadot/metadata'; import metadataStatic from '@polkadot/metadata/static'; +import * as definitions from './interfaces/definitions'; import { createTypeUnsafe, TypeRegistry } from './create'; import * as exported from './index.types'; -import * as definitions from './interfaces/definitions'; // NOTE This is not a shortcut to implementing types incorrectly. This is here // specifically for the types that _should_ throw in the constrtuctor, i.e diff --git a/packages/types/src/interfaces/author/ExtrinsicStatus.spec.ts b/packages/types/src/interfaces/author/ExtrinsicStatus.spec.ts index 994d08c3c2..f229f82743 100644 --- a/packages/types/src/interfaces/author/ExtrinsicStatus.spec.ts +++ b/packages/types/src/interfaces/author/ExtrinsicStatus.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { ExtrinsicStatus } from './types'; +import type { ExtrinsicStatus } from './types'; import { TypeRegistry } from '../../create'; import rpc from '../../json/ExtrinsicStatus.001.json'; diff --git a/packages/types/src/interfaces/identity/Registration.spec.ts b/packages/types/src/interfaces/identity/Registration.spec.ts index 27823d04d0..969aefe826 100644 --- a/packages/types/src/interfaces/identity/Registration.spec.ts +++ b/packages/types/src/interfaces/identity/Registration.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeRegistry, createType } from '../../create'; +import { createType, TypeRegistry } from '../../create'; const registry = new TypeRegistry(); diff --git a/packages/types/src/interfaces/staking/CompactAssignments.spec.ts b/packages/types/src/interfaces/staking/CompactAssignments.spec.ts index b31375328b..a75c4e5cce 100644 --- a/packages/types/src/interfaces/staking/CompactAssignments.spec.ts +++ b/packages/types/src/interfaces/staking/CompactAssignments.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { TypeRegistry, createTypeUnsafe } from '../../create'; +import { createTypeUnsafe, TypeRegistry } from '../../create'; const ACTUAL = '0x' + // Vec diff --git a/packages/types/src/primitive/Text.spec.ts b/packages/types/src/primitive/Text.spec.ts index 1c5fdcdcaf..c1f2178a01 100644 --- a/packages/types/src/primitive/Text.spec.ts +++ b/packages/types/src/primitive/Text.spec.ts @@ -3,8 +3,8 @@ import type { CodecTo } from '../types'; -import { TypeRegistry } from '../create'; import { Raw } from '../codec/Raw'; +import { TypeRegistry } from '../create'; import { Text } from '.'; describe('Text', (): void => { diff --git a/packages/types/src/primitive/Text.ts b/packages/types/src/primitive/Text.ts index 20dcd43e98..f052554913 100644 --- a/packages/types/src/primitive/Text.ts +++ b/packages/types/src/primitive/Text.ts @@ -4,7 +4,7 @@ import type { H256 } from '../interfaces/runtime'; import type { AnyU8a, Codec, Registry } from '../types'; -import { assert, hexToU8a, isHex, isString, stringToU8a, u8aToString, u8aToHex, compactFromU8a, compactAddLength } from '@polkadot/util'; +import { assert, compactAddLength, compactFromU8a, hexToU8a, isHex, isString, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util'; import { Raw } from '../codec/Raw'; diff --git a/packages/types/src/types/codec.ts b/packages/types/src/types/codec.ts index d058b90444..280d4fdefe 100644 --- a/packages/types/src/types/codec.ts +++ b/packages/types/src/types/codec.ts @@ -1,11 +1,10 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { H256 } from '../interfaces/runtime'; -import { AnyJson, BareOpts } from './helpers'; -import { Registry } from './registry'; - -import BN from 'bn.js'; +import type BN from 'bn.js'; +import type { H256 } from '../interfaces/runtime'; +import type { AnyJson, BareOpts } from './helpers'; +import type { Registry } from './registry'; export type CodecTo = 'toHex' | 'toJSON' | 'toString' | 'toU8a'; diff --git a/packages/types/src/types/helpers.ts b/packages/types/src/types/helpers.ts index c774dad60e..97ab11c5e2 100644 --- a/packages/types/src/types/helpers.ts +++ b/packages/types/src/types/helpers.ts @@ -1,9 +1,8 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { Codec } from './codec'; - -import BN from 'bn.js'; +import type BN from 'bn.js'; +import type { Codec } from './codec'; export type AnyFunction = (...args: any[]) => any; diff --git a/packages/types/src/types/interfaces.ts b/packages/types/src/types/interfaces.ts index aba966249c..86a54a3750 100644 --- a/packages/types/src/types/interfaces.ts +++ b/packages/types/src/types/interfaces.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type BN from 'bn.js'; -import { SignOptions } from '@polkadot/keyring/types'; +import type { SignOptions } from '@polkadot/keyring/types'; -import { Hash } from '../interfaces/runtime'; import { FunctionMetadataLatest } from '../interfaces/metadata'; +import { Hash } from '../interfaces/runtime'; import { ArgsDef, Codec } from './codec'; export interface ICompact extends Codec { diff --git a/yarn.lock b/yarn.lock index b0c334985c..d1b25ac50f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1763,9 +1763,9 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/dev@npm:^0.60.8": - version: 0.60.8 - resolution: "@polkadot/dev@npm:0.60.8" +"@polkadot/dev@npm:^0.60.11": + version: 0.60.11 + resolution: "@polkadot/dev@npm:0.60.11" dependencies: "@babel/cli": ^7.12.8 "@babel/core": ^7.12.9 @@ -1807,6 +1807,7 @@ __metadata: eslint-plugin-promise: ^4.2.1 eslint-plugin-react: ^7.21.5 eslint-plugin-react-hooks: ^4.2.0 + eslint-plugin-simple-import-sort: ^7.0.0-beta.1 eslint-plugin-sort-destructure-keys: ^1.3.5 fs-extra: ^9.0.1 gh-pages: ^3.1.0 @@ -1827,7 +1828,7 @@ __metadata: typedoc-plugin-markdown: ^3.0.11 typedoc-plugin-no-inherit: ^1.2.0 typescript: ^4.1.2 - yargs: ^16.1.1 + yargs: ^16.2.0 bin: polkadot-ci-ghact-build: scripts/polkadot-ci-ghact-build.cjs polkadot-ci-ghact-docs: scripts/polkadot-ci-ghact-docs.cjs @@ -1851,7 +1852,7 @@ __metadata: polkadot-exec-typedoc: scripts/polkadot-exec-typedoc.cjs polkadot-exec-vuepress: scripts/polkadot-exec-vuepress.cjs polkadot-exec-webpack: scripts/polkadot-exec-webpack.cjs - checksum: e9b4dd08aa90de176f719fdfa4b2b810e9219fb554b7c1137dc6ae28f6ea7aa608447ce0050c16a739a98bbae979f4fd09e41a77ad08c7ada04784dcbf61fcc0 + checksum: d583afb3162f8e806d1226ae71cf2860a276fb9e3b2a89c91596d6fec4dd3638555cdfa7568a2f09371bb1a77db485a61d82354aa3867458d8dea60212a99664 languageName: node linkType: hard @@ -1948,10 +1949,10 @@ __metadata: "@polkadot/types": 2.10.1 "@polkadot/util": ^4.2.1 "@types/websocket": ^1.0.1 - "@types/yargs": ^15.0.10 + "@types/yargs": ^15.0.11 handlebars: ^4.7.6 websocket: ^1.0.32 - yargs: ^16.1.1 + yargs: ^16.2.0 bin: polkadot-types-chain-info: ./scripts/polkadot-types-chain-info.js polkadot-types-from-chain: ./scripts/polkadot-types-from-chain.js @@ -2350,7 +2351,7 @@ __metadata: languageName: node linkType: hard -"@types/yargs@npm:^15.0.0, @types/yargs@npm:^15.0.10": +"@types/yargs@npm:^15.0.0, @types/yargs@npm:^15.0.11": version: 15.0.11 resolution: "@types/yargs@npm:15.0.11" dependencies: @@ -4554,6 +4555,15 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-simple-import-sort@npm:^7.0.0-beta.1": + version: 7.0.0-beta.1 + resolution: "eslint-plugin-simple-import-sort@npm:7.0.0-beta.1" + peerDependencies: + eslint: ">=5.0.0" + checksum: ca77161eed5babb78a55182478dcc3534ffb2f4bff543ba8746944000eb04191eb53b8c634e1b61e69ee175088e098f50290e75c9bea1db7e3d0843c4155d8e7 + languageName: node + linkType: hard + "eslint-plugin-sort-destructure-keys@npm:^1.3.5": version: 1.3.5 resolution: "eslint-plugin-sort-destructure-keys@npm:1.3.5" @@ -9245,7 +9255,7 @@ fsevents@~2.1.2: "@babel/core": ^7.12.9 "@babel/register": ^7.12.1 "@babel/runtime": ^7.12.5 - "@polkadot/dev": ^0.60.8 + "@polkadot/dev": ^0.60.11 "@polkadot/ts": ^0.3.57 "@polkadot/typegen": "workspace:packages/typegen" "@types/jest": ^26.0.16 @@ -11072,7 +11082,7 @@ fsevents@~2.1.2: languageName: node linkType: hard -"yargs@npm:^16.0.3, yargs@npm:^16.1.0, yargs@npm:^16.1.1": +"yargs@npm:^16.0.3, yargs@npm:^16.1.0": version: 16.1.1 resolution: "yargs@npm:16.1.1" dependencies: @@ -11086,3 +11096,18 @@ fsevents@~2.1.2: checksum: f88462770b6d65107b7295bdd68c38bc3cba9ab0362df476f44c5f6770ee2f39f48bca9813e8a9dc792a15f93e051a7e37346c0f66cf0ec35c63869963c43e0c languageName: node linkType: hard + +"yargs@npm:^16.2.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: ^7.0.2 + escalade: ^3.1.1 + get-caller-file: ^2.0.5 + require-directory: ^2.1.1 + string-width: ^4.2.0 + y18n: ^5.0.5 + yargs-parser: ^20.2.2 + checksum: a79ce1f043021cd645de1ffebb6149541d382ba68f4a6b5eca5d2ad65af51893371bbd78e240dc3b6cf0cbb419511ba5bda715dec992e4266e6863ea49f14feb + languageName: node + linkType: hard