BN import from util (#3637)

* BN import from util

* Update packages/api-derive/src/staking/stakerRewards.ts
This commit is contained in:
Jaco
2021-06-11 12:52:21 +02:00
committed by GitHub
parent 4fa77b3654
commit bdaacfdd56
58 changed files with 945 additions and 1021 deletions
+2 -2
View File
@@ -22,8 +22,8 @@
"@babel/runtime": "^7.14.0",
"@polkadot/api": "4.13.2-5",
"@polkadot/types": "4.13.2-5",
"@polkadot/util": "^6.7.1",
"@polkadot/x-rxjs": "^6.7.1",
"@polkadot/util": "^6.7.2-7",
"@polkadot/x-rxjs": "^6.7.2-7",
"bn.js": "^4.11.9"
}
}
+1 -3
View File
@@ -9,12 +9,10 @@ import type { AnyJson, CodecArg, ISubmittableResult } from '@polkadot/types/type
import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent } from '../types';
import type { ContractCallResult, ContractCallSend, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types';
import BN from 'bn.js';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { createTypeUnsafe } from '@polkadot/types';
import { assert, BN_HUNDRED, BN_ONE, BN_ZERO, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
import { assert, BN, BN_HUNDRED, BN_ONE, BN_ZERO, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
import { map } from '@polkadot/x-rxjs/operators';
import { Abi } from '../Abi';
+1 -1
View File
@@ -1,11 +1,11 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
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 { BN } from '@polkadot/util';
import type { Observable } from '@polkadot/x-rxjs';
import type { AbiMessage, BlueprintOptions, ContractCallOutcome, ContractOptions } from '../types';
+1 -1
View File
@@ -1,11 +1,11 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { SubmittableResult } from '@polkadot/api';
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes } from '@polkadot/api/types';
import type { CodecArg } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { AbiConstructor, BlueprintOptions } from '../types';
import type { BlueprintDeploy, ContractGeneric } from './types';
+1 -1
View File
@@ -1,12 +1,12 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { ApiBase } from '@polkadot/api/base';
import type { ApiTypes } from '@polkadot/api/types';
import type { Text, u64 } from '@polkadot/types';
import type { ContractExecResultResult, ContractSelector } from '@polkadot/types/interfaces';
import type { Codec, CodecArg, TypeDef } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { Abi } from '.';
export interface ContractBase<ApiType extends ApiTypes> {
+1 -1
View File
@@ -1,10 +1,10 @@
// Copyright 2017-2021 @polkadot/rpc-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { SubmittableResult } from '@polkadot/api';
import type { EventRecord } from '@polkadot/types/interfaces';
import type { CodecArg } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { BlueprintOptions, ContractOptions } from './types';
import { isBigInt, isBn, isNumber, isString } from '@polkadot/util';
+4 -4
View File
@@ -23,13 +23,13 @@
"@polkadot/api": "4.13.2-5",
"@polkadot/rpc-core": "4.13.2-5",
"@polkadot/types": "4.13.2-5",
"@polkadot/util": "^6.7.1",
"@polkadot/util-crypto": "^6.7.1",
"@polkadot/x-rxjs": "^6.7.1",
"@polkadot/util": "^6.7.2-7",
"@polkadot/util-crypto": "^6.7.2-7",
"@polkadot/x-rxjs": "^6.7.2-7",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^6.7.1",
"@polkadot/keyring": "^6.7.2-7",
"@polkadot/rpc-provider": "4.13.2-5"
}
}
+1 -3
View File
@@ -7,9 +7,7 @@ import type { AccountId, AccountIndex, Address, Balance, BalanceLock, BalanceLoc
import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveBalancesAccount, DeriveBalancesAccountData, DeriveBalancesAll, DeriveBalancesAllAccountData } from '../types';
import BN from 'bn.js';
import { bnMax, isFunction } from '@polkadot/util';
import { BN, bnMax, isFunction } from '@polkadot/util';
import { combineLatest, of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
+1 -1
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { BN } from '@polkadot/util';
import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveContractFees } from '../types';
+1 -1
View File
@@ -1,10 +1,10 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
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 { BN } from '@polkadot/util';
import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveDemocracyLock } from '../types';
@@ -1,9 +1,9 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { ReferendumIndex } from '@polkadot/types/interfaces';
import type { BN } from '@polkadot/util';
import type { Observable } from '@polkadot/x-rxjs';
import { of } from '@polkadot/x-rxjs';
@@ -1,10 +1,10 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { Option, Vec } from '@polkadot/types';
import type { AccountId, ReferendumInfo, ReferendumInfoTo239, Vote, Voting, VotingDelegating, VotingDirectVote } from '@polkadot/types/interfaces';
import type { BN } from '@polkadot/util';
import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveBalancesAccount, DeriveReferendum, DeriveReferendumVote, DeriveReferendumVotes } from '../types';
@@ -1,8 +1,8 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { BN } from '@polkadot/util';
import type { Observable } from '@polkadot/x-rxjs';
import { bnSqrt } from '@polkadot/util';
+1 -1
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { Vec } from '@polkadot/types';
import type { AccountId, Balance, BlockNumber, Hash, PropIndex, Proposal, ReferendumIndex, ReferendumInfoTo239, ReferendumStatus, Vote, VoteThreshold } from '@polkadot/types/interfaces';
import type { BN } from '@polkadot/util';
export interface DeriveDemocracyLock {
balance: Balance;
+1 -3
View File
@@ -7,9 +7,7 @@ import type { AccountId, Balance, BlockNumber, PreimageStatus, Proposal, Referen
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';
import { BN, bnSqrt } from '@polkadot/util';
type PreimageInfo = [Bytes, AccountId, Balance, BlockNumber];
type OldPreimage = ITuple<PreimageInfo>;
+1 -3
View File
@@ -5,9 +5,7 @@ import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { Balance, StakingLedger, UnlockChunk } from '@polkadot/types/interfaces';
import type { DeriveSessionInfo, DeriveStakingAccount, DeriveStakingKeys, DeriveStakingQuery, DeriveUnlocking } from '../types';
import BN from 'bn.js';
import { BN_ZERO } from '@polkadot/util';
import { BN, BN_ZERO } from '@polkadot/util';
import { combineLatest, Observable } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
@@ -1,12 +1,13 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { Option, u32 } from '@polkadot/types';
import type { ActiveEraInfo, EraIndex } from '@polkadot/types/interfaces';
import type { BN } from '@polkadot/util';
import type { Observable } from '@polkadot/x-rxjs';
import { BN_ONE, BN_ZERO } from '@polkadot/util';
import { map } from '@polkadot/x-rxjs/operators';
import { memo } from '../util';
@@ -23,12 +24,12 @@ export function erasHistoric (instanceId: string, api: ApiInterfaceRx): (withAct
const activeEra: BN = activeEraOpt.unwrapOrDefault().index;
let lastEra = activeEra;
while (lastEra.gten(0) && (result.length < max)) {
while (lastEra.gte(BN_ZERO) && (result.length < max)) {
if ((lastEra !== activeEra) || (withActive === true)) {
result.push(api.registry.createType('EraIndex', lastEra));
}
lastEra = lastEra.subn(1);
lastEra = lastEra.sub(BN_ONE);
}
// go from oldest to newest
@@ -1,9 +1,9 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { AccountId, EraIndex, StakingLedger } from '@polkadot/types/interfaces';
import type { BN } from '@polkadot/util';
import type { Observable } from '@polkadot/x-rxjs';
import type { DeriveEraPoints, DeriveEraPrefs, DeriveEraRewards, DeriveEraValPrefs, DeriveStakerExposure, DeriveStakerReward, DeriveStakerRewardValidator } from '../types';
import type { DeriveStakingQuery } from './types';
@@ -164,17 +164,21 @@ export function _stakerRewards (instanceId: string, api: ApiInterfaceRx): (accou
const [allValidators, stashValidators] = allUniqValidators(allRewards);
return api.derive.staking.queryMulti(allValidators, { withLedger: true }).pipe(
map((queriedVals): DeriveStakerReward[][] => {
return queries.map(({ stakingLedger }, index): DeriveStakerReward[] => {
const rewards = allRewards[index];
const ownValidators = stashValidators[index].map((validatorId): [string, DeriveStakingQuery] => [
validatorId,
queriedVals.find((q) => q.accountId.eq(validatorId)) as DeriveStakingQuery
]);
return filterRewards(eras, ownValidators, { rewards, stakingLedger });
});
})
map((queriedVals): DeriveStakerReward[][] =>
queries.map(({ stakingLedger }, index): DeriveStakerReward[] =>
filterRewards(
eras,
stashValidators[index].map((validatorId): [string, DeriveStakingQuery] => [
validatorId,
queriedVals.find((q) => q.accountId.eq(validatorId)) as DeriveStakingQuery
]),
{
rewards: allRewards[index],
stakingLedger
}
)
)
)
);
})
)
+1 -1
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { AccountId, Balance, EraIndex, Exposure, RewardDestination, RewardPoint, StakingLedger, ValidatorPrefs } from '@polkadot/types/interfaces';
import type { BN } from '@polkadot/util';
import type { DeriveSessionIndexes } from '../session/types';
export type DeriveEraValPoints = Record<string, RewardPoint>;
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import BN from 'bn.js';
import { BN } from '@polkadot/util';
export const FALLBACK_MAX_HASH_COUNT = 250;
+1 -1
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { u32 } from '@polkadot/types';
import type { AccountId, Balance, BalanceLock, BalanceLockTo212, BalanceOf, Bid, BidKind, BlockNumber, Bounty, BountyIndex, Hash, Index, Proposal, ProposalIndex, SetIndex, SocietyVote, StrikeCount, TreasuryProposal, Votes, VouchingStatus } from '@polkadot/types/interfaces';
import type { BN } from '@polkadot/util';
export * from './accounts/types';
export * from './council/types';
+4 -4
View File
@@ -21,15 +21,15 @@
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/api-derive": "4.13.2-5",
"@polkadot/keyring": "^6.7.1",
"@polkadot/keyring": "^6.7.2-7",
"@polkadot/metadata": "4.13.2-5",
"@polkadot/rpc-core": "4.13.2-5",
"@polkadot/rpc-provider": "4.13.2-5",
"@polkadot/types": "4.13.2-5",
"@polkadot/types-known": "4.13.2-5",
"@polkadot/util": "^6.7.1",
"@polkadot/util-crypto": "^6.7.1",
"@polkadot/x-rxjs": "^6.7.1",
"@polkadot/util": "^6.7.2-7",
"@polkadot/util-crypto": "^6.7.2-7",
"@polkadot/x-rxjs": "^6.7.2-7",
"bn.js": "^4.11.9",
"eventemitter3": "^4.0.7"
}
+1 -3
View File
@@ -10,8 +10,6 @@ import type { AnyFunction, AnyTuple, CallFunction, Codec, CodecArg as Arg, Defin
import type { SubmittableExtrinsic } from '../submittable/types';
import type { ApiInterfaceRx, ApiOptions, ApiTypes, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecoratedRpcSection, DecorateMethod, PaginationOptions, QueryableConsts, QueryableModuleStorage, QueryableStorage, QueryableStorageEntry, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics, SubmittableModuleExtrinsics } from '../types';
import BN from 'bn.js';
import { decorateDerive, ExactDerive } from '@polkadot/api-derive';
import { memo } from '@polkadot/api-derive/util';
import { expandMetadata, Metadata } from '@polkadot/metadata';
@@ -20,7 +18,7 @@ import { WsProvider } from '@polkadot/rpc-provider';
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 { arrayChunk, arrayFlatten, assert, compactStripLength, logger, u8aToHex } from '@polkadot/util';
import { arrayChunk, arrayFlatten, assert, BN, compactStripLength, logger, u8aToHex } from '@polkadot/util';
import { BehaviorSubject, combineLatest, Observable, of } from '@polkadot/x-rxjs';
import { map, switchMap, tap, toArray } from '@polkadot/x-rxjs/operators';
+1 -1
View File
@@ -1,11 +1,11 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { RpcInterfaceMethod } from '@polkadot/rpc-core/types';
import type { Text } from '@polkadot/types';
import type { ChainProperties, Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { Observable, Subscription } from '@polkadot/x-rxjs';
import type { ApiBase, ApiOptions, ApiTypes, DecorateMethod } from '../types';
import type { VersionedRegistry } from './types';
+1 -1
View File
@@ -1,10 +1,10 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { Metadata } from '@polkadot/metadata';
import type { Constants } from '@polkadot/metadata/decorate/types';
import type { Registry } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
export interface VersionedRegistry {
isDefault: boolean;
+1 -1
View File
@@ -4,7 +4,6 @@
// Augment the modules
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';
@@ -12,6 +11,7 @@ import type { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { DefinitionRpc, DefinitionRpcSub, RegisteredTypes, Registry, SignatureOptions, Signer } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { ApiBase } from '../base';
import type { DeriveAllSections } from '../util/decorate';
import type { QueryableConsts } from './consts';
+3 -3
View File
@@ -22,11 +22,11 @@
"@babel/runtime": "^7.14.0",
"@polkadot/types": "4.13.2-5",
"@polkadot/types-known": "4.13.2-5",
"@polkadot/util": "^6.7.1",
"@polkadot/util-crypto": "^6.7.1",
"@polkadot/util": "^6.7.2-7",
"@polkadot/util-crypto": "^6.7.2-7",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^6.7.1"
"@polkadot/keyring": "^6.7.2-7"
}
}
@@ -1,10 +1,9 @@
// Copyright 2017-2021 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import BN from 'bn.js';
import { createTestPairs } from '@polkadot/keyring/testingPairs';
import { TypeRegistry } from '@polkadot/types/create';
import { BN } from '@polkadot/util';
import { Metadata } from '../../Metadata';
import metadataStatic from '../../static';
@@ -1,10 +1,10 @@
// Copyright 2017-2021 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { StorageEntryMetadataLatest, StorageHasher } from '@polkadot/types/interfaces/metadata';
import type { StorageEntry } from '@polkadot/types/primitive/types';
import type { Codec, Registry } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import { Raw } from '@polkadot/types/codec';
import { StorageKey, Type } from '@polkadot/types/primitive';
+3 -3
View File
@@ -23,10 +23,10 @@
"@polkadot/metadata": "4.13.2-5",
"@polkadot/rpc-provider": "4.13.2-5",
"@polkadot/types": "4.13.2-5",
"@polkadot/util": "^6.7.1",
"@polkadot/x-rxjs": "^6.7.1"
"@polkadot/util": "^6.7.2-7",
"@polkadot/x-rxjs": "^6.7.2-7"
},
"devDependencies": {
"@polkadot/keyring": "^6.7.1"
"@polkadot/keyring": "^6.7.2-7"
}
}
+6 -6
View File
@@ -21,16 +21,16 @@
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/types": "4.13.2-5",
"@polkadot/util": "^6.7.1",
"@polkadot/util-crypto": "^6.7.1",
"@polkadot/x-fetch": "^6.7.1",
"@polkadot/x-global": "^6.7.1",
"@polkadot/x-ws": "^6.7.1",
"@polkadot/util": "^6.7.2-7",
"@polkadot/util-crypto": "^6.7.2-7",
"@polkadot/x-fetch": "^6.7.2-7",
"@polkadot/x-global": "^6.7.2-7",
"@polkadot/x-ws": "^6.7.2-7",
"bn.js": "^4.11.9",
"eventemitter3": "^4.0.7"
},
"devDependencies": {
"@polkadot/keyring": "^6.7.1",
"@polkadot/keyring": "^6.7.2-7",
"@polkadot/metadata": "4.13.2-5",
"mock-socket": "^9.0.3",
"nock": "^13.1.0"
+1 -2
View File
@@ -8,7 +8,6 @@ import type { Codec, Registry } from '@polkadot/types/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';
@@ -17,7 +16,7 @@ import rpcMetadata from '@polkadot/metadata/static';
import jsonrpc from '@polkadot/types/interfaces/jsonrpc';
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';
import { assert, BN, bnToU8a, logger, u8aToHex } from '@polkadot/util';
import { randomAsU8a } from '@polkadot/util-crypto';
const INTERVAL = 1000;
+1 -1
View File
@@ -33,7 +33,7 @@
"@polkadot/metadata": "4.13.2-5",
"@polkadot/rpc-provider": "4.13.2-5",
"@polkadot/types": "4.13.2-5",
"@polkadot/util": "^6.7.1",
"@polkadot/util": "^6.7.2-7",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.0.1"
+2 -2
View File
@@ -20,9 +20,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme",
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/networks": "^6.7.1",
"@polkadot/networks": "^6.7.2-7",
"@polkadot/types": "4.13.2-5",
"@polkadot/util": "^6.7.1",
"@polkadot/util": "^6.7.2-7",
"bn.js": "^4.11.9"
},
"devDependencies": {
+1 -1
View File
@@ -3,11 +3,11 @@
import './detectPackage';
import type BN from 'bn.js';
import type { Text } from '@polkadot/types';
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
import type { Hash } from '@polkadot/types/interfaces';
import type { ChainUpgradeVersion, CodecHasher, DefinitionRpc, DefinitionRpcSub, OverrideModuleType, OverrideVersionedType, Registry, RegistryTypes } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import { bnToBn, isUndefined } from '@polkadot/util';
+1 -3
View File
@@ -4,10 +4,8 @@
import type { ChainUpgrades } from '@polkadot/types/types';
import type { ChainUpgradesRaw } from './types';
import BN from 'bn.js';
import networks from '@polkadot/networks';
import { assert, hexToU8a, stringify } from '@polkadot/util';
import { assert, BN, hexToU8a, stringify } from '@polkadot/util';
import kusama from './kusama';
import polkadot from './polkadot';
+4 -4
View File
@@ -21,13 +21,13 @@
"dependencies": {
"@babel/runtime": "^7.14.0",
"@polkadot/metadata": "4.13.2-5",
"@polkadot/util": "^6.7.1",
"@polkadot/util-crypto": "^6.7.1",
"@polkadot/x-rxjs": "^6.7.1",
"@polkadot/util": "^6.7.2-7",
"@polkadot/util-crypto": "^6.7.2-7",
"@polkadot/x-rxjs": "^6.7.2-7",
"@types/bn.js": "^4.11.6",
"bn.js": "^4.11.9"
},
"devDependencies": {
"@polkadot/keyring": "^6.7.1"
"@polkadot/keyring": "^6.7.2-7"
}
}
+1 -3
View File
@@ -5,9 +5,7 @@ import type { CodecHash, Hash } from '../interfaces/runtime';
import type { AnyNumber, Codec, Registry } from '../types';
import type { UIntBitLength } from './types';
import BN from 'bn.js';
import { assert, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, stringify, u8aToBn } from '@polkadot/util';
import { assert, BN, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isHex, isString, isU8a, stringify, u8aToBn } from '@polkadot/util';
export const DEFAULT_UINT_BITS = 64;
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import BN from 'bn.js';
import { BN } from '@polkadot/util';
import { TypeRegistry } from '../create';
import { U32 } from '../primitive';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { BN } from '@polkadot/util';
import type { CodecHash, Hash } from '../interfaces';
import type { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types';
import type { CompactEncodable } from './types';
+1 -1
View File
@@ -3,7 +3,7 @@
import type { CodecTo } from '../types';
import BN from 'bn.js';
import { BN } from '@polkadot/util';
import { TypeRegistry } from '../create';
import { U64 } from '../primitive';
+1 -3
View File
@@ -5,9 +5,7 @@ import type { CodecHash, Hash } from '../interfaces/runtime';
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';
import { BN, bnToBn, bnToHex, bnToU8a, isString, isU8a, u8aToBn } from '@polkadot/util';
const BITLENGTH: UIntBitLength = 64;
+1 -3
View File
@@ -4,9 +4,7 @@
import type { CodecHash, Hash } from '../interfaces/runtime';
import type { Codec, Constructor, Registry } from '../types';
import BN from 'bn.js';
import { assert, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, stringCamelCase, stringify, stringUpperFirst, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
import { assert, BN, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, stringCamelCase, stringify, stringUpperFirst, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
import { compareArray } from './utils';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import BN from 'bn.js';
import { BN } from '@polkadot/util';
import { TypeRegistry } from '../create';
import { UInt } from '.';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { BN } from '@polkadot/util';
import type { Codec } from '../types';
export interface CompactEncodable extends Codec {
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { BN } from '@polkadot/util';
import type { Registry } from '../types';
import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { BN } from '@polkadot/util';
import type { AnyU8a, IExtrinsicEra, Registry } from '../types';
import { assert, bnToBn, formatNumber, hexToU8a, isHex, isObject, isU8a, u8aToBn, u8aToU8a } from '@polkadot/util';
@@ -1,11 +1,10 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import BN from 'bn.js';
import { createTestPairs } from '@polkadot/keyring/testingPairs';
import { decorateExtrinsics, Metadata } from '@polkadot/metadata';
import rpcMetadata from '@polkadot/metadata/static';
import { BN } from '@polkadot/util';
import { TypeRegistry } from '../../create';
import { GenericExtrinsicV4 as Extrinsic } from '.';
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import BN from 'bn.js';
import { BN } from '@polkadot/util';
import { TypeRegistry } from '../create';
import { GenericAccountIndex as AccountIndex } from '.';
+1 -3
View File
@@ -3,9 +3,7 @@
import type { AnyNumber, Registry } from '../types';
import BN from 'bn.js';
import { bnToBn, isBigInt, isBn, isHex, isNumber, isU8a } from '@polkadot/util';
import { BN, bnToBn, isBigInt, isBn, isHex, isNumber, isU8a } from '@polkadot/util';
import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';
import { u32 } from '../primitive/U32';
@@ -4,9 +4,7 @@
import type { AccountId } from '../interfaces/runtime';
import type { AnyU8a, Registry } from '../types';
import BN from 'bn.js';
import { bnToU8a, isNumber, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util';
import { BN, bnToU8a, isNumber, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util';
import { U8aFixed } from '../codec/U8aFixed';
import { Bytes } from '../primitive/Bytes';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { BN } from '@polkadot/util';
import type { Registry } from '../types';
import { isBigInt, isBn, isHex, isNumber, isU8a, u8aConcat, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
@@ -3,7 +3,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import BN from 'bn.js';
import { BN } from '@polkadot/util';
import { TypeRegistry } from '../../create';
import json1 from '../../json/Header.001.json';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { BN } from '@polkadot/util';
import type { Hash } from '../interfaces/runtime';
import type { Registry } from './registry';
+1 -1
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { SignOptions } from '@polkadot/keyring/types';
import type { BN } from '@polkadot/util';
import type { FunctionMetadataLatest, StorageEntryMetadataLatest } from '../interfaces/metadata';
import type { Hash } from '../interfaces/runtime';
import type { AnyTuple, ArgsDef, Codec } from './codec';
+1 -1
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type BN from 'bn.js';
import type { Metadata } from '@polkadot/metadata';
import type { BN } from '@polkadot/util';
import type { Observable } from '@polkadot/x-rxjs';
import type { ExtDef } from '../extrinsic/signedExtensions/types';
import type { CodecHash, Hash } from '../interfaces/runtime';