diff --git a/packages/api/src/augment/consts.ts b/packages/api/src/augment/consts.ts index 8e10a09b32..3ae86698f0 100644 --- a/packages/api/src/augment/consts.ts +++ b/packages/api/src/augment/consts.ts @@ -1,14 +1,13 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import { Vec } from '@polkadot/types/codec'; -import { u16, u32, u64 } from '@polkadot/types/primitive'; -import { Codec } from '@polkadot/types/types'; -import { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime'; -import { SessionIndex } from '@polkadot/types/interfaces/session'; -import { EraIndex } from '@polkadot/types/interfaces/staking'; -import { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; -import { ApiTypes } from '@polkadot/api/types'; +import type { Vec, u16, u32, u64 } from '@polkadot/types'; +import type { Codec } from '@polkadot/types/types'; +import type { Balance, BalanceOf, BlockNumber, LockIdentifier, ModuleId, Moment, Perbill, Percent, Permill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime'; +import type { SessionIndex } from '@polkadot/types/interfaces/session'; +import type { EraIndex } from '@polkadot/types/interfaces/staking'; +import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; +import type { ApiTypes } from '@polkadot/api/types'; declare module '@polkadot/api/types/consts' { export interface AugmentedConsts { diff --git a/packages/api/src/augment/query.ts b/packages/api/src/augment/query.ts index d9cd23d630..f9cdeec417 100644 --- a/packages/api/src/augment/query.ts +++ b/packages/api/src/augment/query.ts @@ -1,34 +1,33 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import { Option, U8aFixed, Vec } from '@polkadot/types/codec'; -import { Bytes, Data, bool, u32, u64 } from '@polkadot/types/primitive'; -import { AnyNumber, ITuple, Observable } from '@polkadot/types/types'; -import { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; -import { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe'; -import { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances'; -import { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective'; -import { AuthorityId } from '@polkadot/types/interfaces/consensus'; -import { CodeHash, ContractInfo, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts'; -import { PreimageStatus, PropIndex, Proposal, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy'; -import { VoteThreshold } from '@polkadot/types/interfaces/elections'; -import { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa'; -import { RegistrarInfo, Registration } from '@polkadot/types/interfaces/identity'; -import { AuthIndex } from '@polkadot/types/interfaces/imOnline'; -import { DeferredOffenceOf, Kind, OffenceDetails, OpaqueTimeSlot, ReportIdOf } from '@polkadot/types/interfaces/offences'; -import { ProxyAnnouncement, ProxyDefinition } from '@polkadot/types/interfaces/proxy'; -import { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; -import { AccountId, AccountIndex, Balance, BalanceOf, BlockNumber, ExtrinsicsWeight, Hash, KeyTypeId, Moment, OpaqueCall, Perbill, Releases, ValidatorId } from '@polkadot/types/interfaces/runtime'; -import { Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler'; -import { Keys, SessionIndex } from '@polkadot/types/interfaces/session'; -import { Bid, BidKind, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; -import { ActiveEraInfo, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, RewardDestination, SlashingSpans, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs } from '@polkadot/types/interfaces/staking'; -import { AccountInfo, DigestOf, EventIndex, EventRecord, LastRuntimeUpgradeInfo, Phase } from '@polkadot/types/interfaces/system'; -import { Bounty, BountyIndex, OpenTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; -import { Multiplier } from '@polkadot/types/interfaces/txpayment'; -import { Multisig } from '@polkadot/types/interfaces/utility'; -import { VestingInfo } from '@polkadot/types/interfaces/vesting'; -import { ApiTypes } from '@polkadot/api/types'; +import type { Bytes, Data, Option, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types'; +import type { AnyNumber, ITuple, Observable } from '@polkadot/types/types'; +import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; +import type { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe'; +import type { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances'; +import type { ProposalIndex, Votes } from '@polkadot/types/interfaces/collective'; +import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; +import type { CodeHash, ContractInfo, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts'; +import type { PreimageStatus, PropIndex, Proposal, ReferendumIndex, ReferendumInfo, Voting } from '@polkadot/types/interfaces/democracy'; +import type { VoteThreshold } from '@polkadot/types/interfaces/elections'; +import type { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa'; +import type { RegistrarInfo, Registration } from '@polkadot/types/interfaces/identity'; +import type { AuthIndex } from '@polkadot/types/interfaces/imOnline'; +import type { DeferredOffenceOf, Kind, OffenceDetails, OpaqueTimeSlot, ReportIdOf } from '@polkadot/types/interfaces/offences'; +import type { ProxyAnnouncement, ProxyDefinition } from '@polkadot/types/interfaces/proxy'; +import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; +import type { AccountId, AccountIndex, Balance, BalanceOf, BlockNumber, ExtrinsicsWeight, Hash, KeyTypeId, Moment, OpaqueCall, Perbill, Releases, ValidatorId } from '@polkadot/types/interfaces/runtime'; +import type { Scheduled, TaskAddress } from '@polkadot/types/interfaces/scheduler'; +import type { Keys, SessionIndex } from '@polkadot/types/interfaces/session'; +import type { Bid, BidKind, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; +import type { ActiveEraInfo, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, RewardDestination, SlashingSpans, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs } from '@polkadot/types/interfaces/staking'; +import type { AccountInfo, DigestOf, EventIndex, EventRecord, LastRuntimeUpgradeInfo, Phase } from '@polkadot/types/interfaces/system'; +import type { Bounty, BountyIndex, OpenTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; +import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; +import type { Multisig } from '@polkadot/types/interfaces/utility'; +import type { VestingInfo } from '@polkadot/types/interfaces/vesting'; +import type { ApiTypes } from '@polkadot/api/types'; declare module '@polkadot/api/types/storage' { export interface AugmentedQueries { diff --git a/packages/api/src/augment/rpc.ts b/packages/api/src/augment/rpc.ts index bcd53533d4..c8e89cae11 100644 --- a/packages/api/src/augment/rpc.ts +++ b/packages/api/src/augment/rpc.ts @@ -1,25 +1,24 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import { Metadata } from '@polkadot/metadata'; -import { HashMap, Json, Option, Vec } from '@polkadot/types/codec'; -import { Bytes, Null, StorageKey, Text, bool, u32, u64 } from '@polkadot/types/primitive'; -import { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types'; -import { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; -import { EpochAuthorship } from '@polkadot/types/interfaces/babe'; -import { BlockHash } from '@polkadot/types/interfaces/chain'; -import { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; -import { AuthorityId } from '@polkadot/types/interfaces/consensus'; -import { ContractCallRequest, ContractExecResult } from '@polkadot/types/interfaces/contracts'; -import { CreatedBlock } from '@polkadot/types/interfaces/engine'; -import { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; -import { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa'; -import { StorageKind } from '@polkadot/types/interfaces/offchain'; -import { RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; -import { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import { AccountId, BlockNumber, H256, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime'; -import { ReadProof, RuntimeVersion } from '@polkadot/types/interfaces/state'; -import { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system'; +import type { Metadata } from '@polkadot/metadata'; +import type { Bytes, HashMap, Json, Null, Option, StorageKey, Text, Vec, bool, u32, u64 } from '@polkadot/types'; +import type { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types'; +import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; +import type { EpochAuthorship } from '@polkadot/types/interfaces/babe'; +import type { BlockHash } from '@polkadot/types/interfaces/chain'; +import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; +import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; +import type { ContractCallRequest, ContractExecResult } from '@polkadot/types/interfaces/contracts'; +import type { CreatedBlock } from '@polkadot/types/interfaces/engine'; +import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; +import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa'; +import type { StorageKind } from '@polkadot/types/interfaces/offchain'; +import type { RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; +import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; +import type { AccountId, BlockNumber, H256, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime'; +import type { ReadProof, RuntimeVersion } from '@polkadot/types/interfaces/state'; +import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system'; declare module '@polkadot/rpc-core/types.jsonrpc' { export interface RpcInterface { diff --git a/packages/api/src/augment/tx.ts b/packages/api/src/augment/tx.ts index 717a0c447d..329920c4b7 100644 --- a/packages/api/src/augment/tx.ts +++ b/packages/api/src/augment/tx.ts @@ -1,29 +1,28 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import { Compact, Option, U8aFixed, Vec } from '@polkadot/types/codec'; -import { Bytes, Data, bool, u16, u32, u64 } from '@polkadot/types/primitive'; -import { AnyNumber, ITuple } from '@polkadot/types/types'; -import { BabeEquivocationProof } from '@polkadot/types/interfaces/babe'; -import { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective'; -import { CodeHash, Gas, Schedule } from '@polkadot/types/interfaces/contracts'; -import { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy'; -import { DefunctVoter, Renouncing } from '@polkadot/types/interfaces/elections'; -import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics'; -import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa'; -import { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity'; -import { Heartbeat } from '@polkadot/types/interfaces/imOnline'; -import { ProxyType } from '@polkadot/types/interfaces/proxy'; -import { AccountId, AccountIndex, Address, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime'; -import { Period, Priority } from '@polkadot/types/interfaces/scheduler'; -import { Keys } from '@polkadot/types/interfaces/session'; -import { SocietyJudgement } from '@polkadot/types/interfaces/society'; -import { CompactAssignments, ElectionScore, ElectionSize, EraIndex, RewardDestination, ValidatorIndex, ValidatorPrefs } from '@polkadot/types/interfaces/staking'; -import { Key } from '@polkadot/types/interfaces/system'; -import { BountyIndex } from '@polkadot/types/interfaces/treasury'; -import { Timepoint } from '@polkadot/types/interfaces/utility'; -import { VestingInfo } from '@polkadot/types/interfaces/vesting'; -import { ApiTypes, SubmittableExtrinsic } from '@polkadot/api/types'; +import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u16, u32, u64 } from '@polkadot/types'; +import type { AnyNumber, ITuple } from '@polkadot/types/types'; +import type { BabeEquivocationProof } from '@polkadot/types/interfaces/babe'; +import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective'; +import type { CodeHash, Gas, Schedule } from '@polkadot/types/interfaces/contracts'; +import type { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy'; +import type { DefunctVoter, Renouncing } from '@polkadot/types/interfaces/elections'; +import type { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics'; +import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa'; +import type { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity'; +import type { Heartbeat } from '@polkadot/types/interfaces/imOnline'; +import type { ProxyType } from '@polkadot/types/interfaces/proxy'; +import type { AccountId, AccountIndex, Address, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime'; +import type { Period, Priority } from '@polkadot/types/interfaces/scheduler'; +import type { Keys } from '@polkadot/types/interfaces/session'; +import type { SocietyJudgement } from '@polkadot/types/interfaces/society'; +import type { CompactAssignments, ElectionScore, ElectionSize, EraIndex, RewardDestination, ValidatorIndex, ValidatorPrefs } from '@polkadot/types/interfaces/staking'; +import type { Key } from '@polkadot/types/interfaces/system'; +import type { BountyIndex } from '@polkadot/types/interfaces/treasury'; +import type { Timepoint } from '@polkadot/types/interfaces/utility'; +import type { VestingInfo } from '@polkadot/types/interfaces/vesting'; +import type { ApiTypes, SubmittableExtrinsic } from '@polkadot/api/types'; declare module '@polkadot/api/types/submittable' { export interface AugmentedSubmittables { diff --git a/packages/typegen/src/util/formatting.ts b/packages/typegen/src/util/formatting.ts index 1780d50aee..c0ab05e5a7 100644 --- a/packages/typegen/src/util/formatting.ts +++ b/packages/typegen/src/util/formatting.ts @@ -11,14 +11,18 @@ import { isString } from '@polkadot/util'; import { setImports, ModuleTypes, TypeImports } from './imports'; import { readTemplate } from './file'; +interface ImportDef { + file: string; + types: string[]; +} + interface This { imports: TypeImports; - types: { - file: string; - types: string[]; - }[] + types: ImportDef[]; } +const NO_CODEC = ['Tuple', 'VecFixed']; + export const HEADER = (type: 'chain' | 'defs'): string => `// Auto-generated via \`yarn polkadot-types-from-${type}\`, do not edit\n/* eslint-disable */\n\n`; Handlebars.registerPartial({ @@ -35,22 +39,13 @@ Handlebars.registerHelper({ types: Object.keys(imports.metadataTypes) }, { - file: '@polkadot/types/codec', - types: Object - .keys(imports.codecTypes) - .filter((name) => name !== 'Tuple') - }, - { - file: '@polkadot/types/extrinsic', - types: Object.keys(imports.extrinsicTypes) - }, - { - file: '@polkadot/types/generic', - types: Object.keys(imports.genericTypes) - }, - { - file: '@polkadot/types/primitive', - types: Object.keys(imports.primitiveTypes) + file: '@polkadot/types', + types: [ + ...Object.keys(imports.codecTypes).filter((name) => !NO_CODEC.includes(name)), + ...Object.keys(imports.extrinsicTypes), + ...Object.keys(imports.genericTypes), + ...Object.keys(imports.primitiveTypes) + ] }, { file: '@polkadot/types/types', @@ -61,7 +56,7 @@ Handlebars.registerHelper({ return defs.reduce((result, { file, types }): string => { return types.length - ? `${result}import { ${types.sort().join(', ')} } from '${file}';\n` + ? `${result}import type { ${types.sort().join(', ')} } from '${file}';\n` : result; }, ''); }, diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index 0ab5f65a15..6f41a953a3 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -1,54 +1,53 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Compact, Json, Option, Raw, Vec } from '@polkadot/types/codec'; -import { BitVec, Bool, Bytes, Data, DoNotConstruct, I128, I16, I256, I32, I64, I8, Null, StorageKey, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types/primitive'; -import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; -import { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; -import { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; -import { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; -import { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; -import { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; -import { BlockHash } from '@polkadot/types/interfaces/chain'; -import { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; -import { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims'; -import { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective'; -import { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus'; -import { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, Gas, HostFnWeights, InstructionWeights, Limits, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; -import { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi'; -import { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy'; -import { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections'; -import { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine'; -import { EthereumAccountId, EthereumLookupSource } from '@polkadot/types/interfaces/ethereum'; -import { Account, Log, Vicinity } from '@polkadot/types/interfaces/evm'; -import { AnySignature, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics'; -import { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset'; -import { AuthorityIndex, AuthorityList, AuthorityWeight, EncodedFinalityProofs, GrandpaEquivocation, GrandpaEquivocationProof, GrandpaEquivocationValue, GrandpaPrevote, JustificationNotification, KeyOwnerProof, NextAuthority, PendingPause, PendingResume, Precommits, Prevotes, ReportedRoundStates, RoundState, SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa'; -import { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement } from '@polkadot/types/interfaces/identity'; -import { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline'; -import { DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV12, DoubleMapTypeV9, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV9, MapTypeLatest, MapTypeV10, MapTypeV11, MapTypeV12, MapTypeV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV9, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; -import { StorageKind } from '@polkadot/types/interfaces/offchain'; -import { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; -import { AbridgedCandidateReceipt, AttestedCandidate, AuctionIndex, Bidder, CandidateCommitments, CandidateReceipt, CollatorId, CollatorSignature, DoubleVoteReport, DownwardMessage, GlobalValidationSchedule, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, LocalValidationData, NewBidder, ParaId, ParaInfo, ParaPastCodeMeta, ParaScheduling, ParachainDispatchOrigin, ParachainProposal, RegisteredParachainInfo, RelayChainBlockNumber, Remark, Retriable, Scheduling, SigningContext, SlotRange, Statement, SubId, UpwardMessage, ValidationCode, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; -import { RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; -import { Approvals } from '@polkadot/types/interfaces/poll'; -import { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; -import { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; -import { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; -import { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, GenericAddress, H160, H256, H512, Hash, Header, I32F32, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, StorageData, TransactionPriority, U32F32, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; -import { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; -import { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; -import { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, ValidatorCount } from '@polkadot/types/interfaces/session'; -import { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; -import { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RewardDestination, RewardDestinationTo257, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196 } from '@polkadot/types/interfaces/staking'; -import { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state'; -import { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; -import { AccountInfo, ApplyExtrinsicResult, ChainProperties, ChainType, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction } from '@polkadot/types/interfaces/system'; -import { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; -import { Multiplier } from '@polkadot/types/interfaces/txpayment'; -import { Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; -import { VestingInfo } from '@polkadot/types/interfaces/vesting'; +import type { BitVec, Bool, Bytes, Compact, Data, DoNotConstruct, I128, I16, I256, I32, I64, I8, Json, Null, Option, Raw, StorageKey, Text, Type, U128, U16, U256, U32, U64, U8, USize, Vec, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types'; +import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; +import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; +import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; +import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; +import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; +import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; +import type { BlockHash } from '@polkadot/types/interfaces/chain'; +import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; +import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims'; +import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective'; +import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus'; +import type { AliveContractInfo, CodeHash, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractInfo, ContractStorageKey, Gas, HostFnWeights, InstructionWeights, Limits, PrefabWasmModule, PrefabWasmModuleReserved, Schedule, ScheduleTo212, ScheduleTo258, SeedOf, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; +import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpec, ContractEventSpec, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpec, ContractMessageSpec, ContractProject, ContractProjectContract, ContractProjectSource, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi'; +import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy'; +import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections'; +import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine'; +import type { EthereumAccountId, EthereumLookupSource } from '@polkadot/types/interfaces/ethereum'; +import type { Account, Log, Vicinity } from '@polkadot/types/interfaces/evm'; +import type { AnySignature, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics'; +import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset'; +import type { AuthorityIndex, AuthorityList, AuthorityWeight, EncodedFinalityProofs, GrandpaEquivocation, GrandpaEquivocationProof, GrandpaEquivocationValue, GrandpaPrevote, JustificationNotification, KeyOwnerProof, NextAuthority, PendingPause, PendingResume, Precommits, Prevotes, ReportedRoundStates, RoundState, SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa'; +import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement } from '@polkadot/types/interfaces/identity'; +import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline'; +import type { DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV12, DoubleMapTypeV9, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV9, MapTypeLatest, MapTypeV10, MapTypeV11, MapTypeV12, MapTypeV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV9, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; +import type { StorageKind } from '@polkadot/types/interfaces/offchain'; +import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; +import type { AbridgedCandidateReceipt, AttestedCandidate, AuctionIndex, Bidder, CandidateCommitments, CandidateReceipt, CollatorId, CollatorSignature, DoubleVoteReport, DownwardMessage, GlobalValidationSchedule, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, LocalValidationData, NewBidder, ParaId, ParaInfo, ParaPastCodeMeta, ParaScheduling, ParachainDispatchOrigin, ParachainProposal, RegisteredParachainInfo, RelayChainBlockNumber, Remark, Retriable, Scheduling, SigningContext, SlotRange, Statement, SubId, UpwardMessage, ValidationCode, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; +import type { RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; +import type { Approvals } from '@polkadot/types/interfaces/poll'; +import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; +import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; +import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; +import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; +import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, GenericAddress, H160, H256, H512, Hash, Header, I32F32, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, StorageData, TransactionPriority, U32F32, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; +import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; +import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; +import type { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, ValidatorCount } from '@polkadot/types/interfaces/session'; +import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society'; +import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RewardDestination, RewardDestinationTo257, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196 } from '@polkadot/types/interfaces/staking'; +import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state'; +import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; +import type { AccountInfo, ApplyExtrinsicResult, ChainProperties, ChainType, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction } from '@polkadot/types/interfaces/system'; +import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; +import type { Multiplier } from '@polkadot/types/interfaces/txpayment'; +import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; +import type { VestingInfo } from '@polkadot/types/interfaces/vesting'; declare module '@polkadot/types/types/registry' { export interface InterfaceTypes { diff --git a/packages/types/src/codec/AbstractInt.ts b/packages/types/src/codec/AbstractInt.ts index d3eb59b975..3a3d8940ce 100644 --- a/packages/types/src/codec/AbstractInt.ts +++ b/packages/types/src/codec/AbstractInt.ts @@ -3,12 +3,11 @@ import { H256 } from '../interfaces/runtime'; import { AnyNumber, Codec, Registry } from '../types'; +import { 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'; -export type UIntBitLength = 8 | 16 | 32 | 64 | 128 | 256; - export const DEFAULT_UINT_BITS = 64; const MUL_P = new BN(1_00_00); diff --git a/packages/types/src/codec/Compact.ts b/packages/types/src/codec/Compact.ts index b81021958e..0776963281 100644 --- a/packages/types/src/codec/Compact.ts +++ b/packages/types/src/codec/Compact.ts @@ -2,19 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 import { H256 } from '@polkadot/types/interfaces'; -import { AnyJson, AnyNumber, Codec, Constructor, ICompact, InterfaceTypes, Registry } from '../types'; +import { AnyJson, AnyNumber, Constructor, ICompact, InterfaceTypes, Registry } from '../types'; +import { CompactEncodable, UIntBitLength } from './types'; import BN from 'bn.js'; import { compactFromU8a, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util'; import { typeToConstructor } from './utils'; -import { UIntBitLength } from './AbstractInt'; - -export interface CompactEncodable extends Codec { - bitLength (): number; - toBn (): BN; - toNumber (): number; -} /** * @name Compact diff --git a/packages/types/src/codec/Date.ts b/packages/types/src/codec/Date.ts index 375b9f2a20..bea5a1db77 100644 --- a/packages/types/src/codec/Date.ts +++ b/packages/types/src/codec/Date.ts @@ -3,12 +3,11 @@ import { H256 } from '../interfaces/runtime'; import { AnyNumber, Codec, Registry } from '../types'; +import { UIntBitLength } from './types'; import BN from 'bn.js'; import { bnToBn, bnToHex, bnToU8a, isString, isU8a, u8aToBn } from '@polkadot/util'; -import { UIntBitLength } from './AbstractInt'; - const BITLENGTH: UIntBitLength = 64; /** diff --git a/packages/types/src/codec/Int.ts b/packages/types/src/codec/Int.ts index bbf6db6a15..274f4a375e 100644 --- a/packages/types/src/codec/Int.ts +++ b/packages/types/src/codec/Int.ts @@ -2,8 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import { AnyNumber, Constructor, Registry } from '../types'; +import { UIntBitLength } from './types'; -import { AbstractInt, UIntBitLength } from './AbstractInt'; +import { AbstractInt } from './AbstractInt'; /** * @name Int diff --git a/packages/types/src/codec/U8aFixed.ts b/packages/types/src/codec/U8aFixed.ts index c6366c85bf..2efe0fc6eb 100644 --- a/packages/types/src/codec/U8aFixed.ts +++ b/packages/types/src/codec/U8aFixed.ts @@ -2,19 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 import { AnyU8a, Constructor, Registry } from '../types'; +import { U8aBitLength } from './types'; import { isString, u8aToU8a } from '@polkadot/util'; import { Raw } from './Raw'; -// The 520 here is a weird one - it is explicitly for a [u8; 65] as found as a EcdsaSignature, -// and 264 here is explicity for a [u8; 33] as found as EcdsaPublic key. -// Likewise 160 is for [u8; 20], which is also a H160, i.e. an Ethereum address. Both these are -// as a result of the Polkadot claims module. (Technically we don't need the 520 in here) -export type BitLength = 8 | 16 | 32 | 64 | 128 | 160 | 256 | 264 | 512 | 520 | 1024 | 2048; - /** @internal */ -function decodeU8aFixed (value: AnyU8a, bitLength: BitLength): AnyU8a { +function decodeU8aFixed (value: AnyU8a, bitLength: U8aBitLength): AnyU8a { if (Array.isArray(value) || isString(value)) { return decodeU8aFixed(u8aToU8a(value), bitLength); } @@ -42,11 +37,11 @@ function decodeU8aFixed (value: AnyU8a, bitLength: BitLength): AnyU8a { * to be used directly, rather is should be subclassed with the specific lengths. */ export class U8aFixed extends Raw { - constructor (registry: Registry, value: AnyU8a = new Uint8Array(), bitLength: BitLength = 256) { + constructor (registry: Registry, value: AnyU8a = new Uint8Array(), bitLength: U8aBitLength = 256) { super(registry, decodeU8aFixed(value, bitLength)); } - public static with (bitLength: BitLength, typeName?: string): Constructor { + public static with (bitLength: U8aBitLength, typeName?: string): Constructor { return class extends U8aFixed { constructor (registry: Registry, value?: AnyU8a) { super(registry, value, bitLength); diff --git a/packages/types/src/codec/UInt.ts b/packages/types/src/codec/UInt.ts index 149c6692d0..3009437ea1 100644 --- a/packages/types/src/codec/UInt.ts +++ b/packages/types/src/codec/UInt.ts @@ -2,8 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import { AnyNumber, Constructor, Registry } from '../types'; +import { UIntBitLength } from './types'; -import { AbstractInt, UIntBitLength } from './AbstractInt'; +import { AbstractInt } from './AbstractInt'; /** * @name UInt diff --git a/packages/types/src/codec/VecFixed.spec.ts b/packages/types/src/codec/VecFixed.spec.ts index 0caabc0e73..4934c81d3f 100644 --- a/packages/types/src/codec/VecFixed.spec.ts +++ b/packages/types/src/codec/VecFixed.spec.ts @@ -3,7 +3,7 @@ import { TypeRegistry } from '../create'; import { Text } from '../primitive'; -import { VecFixed } from './VecFixed'; +import { VecFixed } from '.'; describe('VecFixed', (): void => { const registry = new TypeRegistry(); diff --git a/packages/types/src/codec/VecFixed.ts b/packages/types/src/codec/VecFixed.ts index 1a151ebad4..cabc654748 100644 --- a/packages/types/src/codec/VecFixed.ts +++ b/packages/types/src/codec/VecFixed.ts @@ -4,6 +4,7 @@ import { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { assert, isU8a, u8aConcat, compactToU8a } from '@polkadot/util'; + import { AbstractArray } from './AbstractArray'; import { Vec } from './Vec'; import { typeToConstructor } from './utils'; diff --git a/packages/types/src/codec/index.ts b/packages/types/src/codec/index.ts index 3d8e4f2955..fe25c565dd 100644 --- a/packages/types/src/codec/index.ts +++ b/packages/types/src/codec/index.ts @@ -27,4 +27,4 @@ export { UInt } from './UInt'; export { U8aFixed } from './U8aFixed'; export { Vec } from './Vec'; // export { VecAny } from './VecAny'; -// export { VecFixed } from './VecFixed'; +export { VecFixed } from './VecFixed'; diff --git a/packages/types/src/codec/types.ts b/packages/types/src/codec/types.ts new file mode 100644 index 0000000000..2610047c7e --- /dev/null +++ b/packages/types/src/codec/types.ts @@ -0,0 +1,20 @@ +// Copyright 2017-2020 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import { Codec } from '../types'; + +import type BN from 'bn.js'; + +export interface CompactEncodable extends Codec { + bitLength (): number; + toBn (): BN; + toNumber (): number; +} + +export type UIntBitLength = 8 | 16 | 32 | 64 | 128 | 256; + +// The 520 here is a weird one - it is explicitly for a [u8; 65] as found as a EcdsaSignature, +// and 264 here is explicity for a [u8; 33] as found as EcdsaPublic key. +// Likewise 160 is for [u8; 20], which is also a H160, i.e. an Ethereum address. Both these are +// as a result of the Polkadot claims module. (Technically we don't need the 520 in here) +export type U8aBitLength = 8 | 16 | 32 | 64 | 128 | 160 | 256 | 264 | 512 | 520 | 1024 | 2048; diff --git a/packages/types/src/create/createClass.ts b/packages/types/src/create/createClass.ts index df8d8aed55..31bde96b7d 100644 --- a/packages/types/src/create/createClass.ts +++ b/packages/types/src/create/createClass.ts @@ -1,15 +1,13 @@ // Copyright 2017-2020 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { UIntBitLength, U8aBitLength } from '../codec/types'; import { Codec, Constructor, InterfaceTypes, Registry } from '../types'; import { FromReg, TypeDef, TypeDefInfo } from './types'; import { assert, isNumber, isUndefined } from '@polkadot/util'; -import { UIntBitLength } from '../codec/AbstractInt'; -import { BitLength as U8aFixedBitLength } from '../codec/U8aFixed'; -import { BTreeMap, BTreeSet, CodecSet, Compact, Enum, HashMap, Int, Option, Result, Struct, Tuple, U8aFixed, UInt, Vec } from '../codec'; -import { VecFixed } from '../codec/VecFixed'; +import { BTreeMap, BTreeSet, CodecSet, Compact, Enum, HashMap, Int, Option, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed } from '../codec'; import { DoNotConstruct } from '../primitive'; import { getTypeDef } from './getTypeDef'; @@ -159,7 +157,7 @@ const infoMapping: Record C return ( (sub as TypeDef).type === 'u8' - ? U8aFixed.with((length * 8) as U8aFixedBitLength, displayName) + ? U8aFixed.with((length * 8) as U8aBitLength, displayName) : VecFixed.with((sub as TypeDef).type as keyof InterfaceTypes, length) ); } diff --git a/packages/types/src/interfaces/attestations/types.ts b/packages/types/src/interfaces/attestations/types.ts index b576b8a08f..a849c1dee4 100644 --- a/packages/types/src/interfaces/attestations/types.ts +++ b/packages/types/src/interfaces/attestations/types.ts @@ -1,10 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct, Vec } from '@polkadot/types/codec'; -import { CandidateReceipt, ParaId } from '@polkadot/types/interfaces/parachains'; -import { AccountId, BlockNumber, H256, Hash } from '@polkadot/types/interfaces/runtime'; -import { SessionIndex } from '@polkadot/types/interfaces/session'; +import type { Struct, Vec } from '@polkadot/types'; +import type { CandidateReceipt, ParaId } from '@polkadot/types/interfaces/parachains'; +import type { AccountId, BlockNumber, H256, Hash } from '@polkadot/types/interfaces/runtime'; +import type { SessionIndex } from '@polkadot/types/interfaces/session'; /** @name BlockAttestations */ export interface BlockAttestations extends Struct { diff --git a/packages/types/src/interfaces/aura/types.ts b/packages/types/src/interfaces/aura/types.ts index ab6aca7c74..0357ecb629 100644 --- a/packages/types/src/interfaces/aura/types.ts +++ b/packages/types/src/interfaces/aura/types.ts @@ -1,8 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct } from '@polkadot/types/codec'; -import { u64 } from '@polkadot/types/primitive'; +import type { Struct, u64 } from '@polkadot/types'; /** @name RawAuraPreDigest */ export interface RawAuraPreDigest extends Struct { diff --git a/packages/types/src/interfaces/author/types.ts b/packages/types/src/interfaces/author/types.ts index cd20a6d7a0..537a3c4c2b 100644 --- a/packages/types/src/interfaces/author/types.ts +++ b/packages/types/src/interfaces/author/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Vec } from '@polkadot/types/codec'; -import { Bytes, Text } from '@polkadot/types/primitive'; -import { Hash } from '@polkadot/types/interfaces/runtime'; +import type { Bytes, Enum, Text, Vec } from '@polkadot/types'; +import type { Hash } from '@polkadot/types/interfaces/runtime'; /** @name ExtrinsicOrHash */ export interface ExtrinsicOrHash extends Enum { diff --git a/packages/types/src/interfaces/authorship/types.ts b/packages/types/src/interfaces/authorship/types.ts index 028c230572..24628436c5 100644 --- a/packages/types/src/interfaces/authorship/types.ts +++ b/packages/types/src/interfaces/authorship/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Option } from '@polkadot/types/codec'; -import { ITuple } from '@polkadot/types/types'; -import { AccountId, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; +import type { Enum, Option } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AccountId, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; /** @name UncleEntryItem */ export interface UncleEntryItem extends Enum { diff --git a/packages/types/src/interfaces/babe/types.ts b/packages/types/src/interfaces/babe/types.ts index 1362e7451f..b4176c36fb 100644 --- a/packages/types/src/interfaces/babe/types.ts +++ b/packages/types/src/interfaces/babe/types.ts @@ -1,11 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec'; -import { u32, u64 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AuthorityId } from '@polkadot/types/interfaces/consensus'; -import { Hash, Header } from '@polkadot/types/interfaces/runtime'; +import type { Enum, Option, Struct, U8aFixed, Vec, u32, u64 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; +import type { Hash, Header } from '@polkadot/types/interfaces/runtime'; /** @name AllowedSlots */ export interface AllowedSlots extends Enum { diff --git a/packages/types/src/interfaces/balances/types.ts b/packages/types/src/interfaces/balances/types.ts index 112213a937..c7acdd51c0 100644 --- a/packages/types/src/interfaces/balances/types.ts +++ b/packages/types/src/interfaces/balances/types.ts @@ -1,8 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Set, Struct } from '@polkadot/types/codec'; -import { Balance, BlockNumber, LockIdentifier } from '@polkadot/types/interfaces/runtime'; +import type { Enum, Set, Struct } from '@polkadot/types'; +import type { Balance, BlockNumber, LockIdentifier } from '@polkadot/types/interfaces/runtime'; /** @name AccountData */ export interface AccountData extends Struct { diff --git a/packages/types/src/interfaces/chain/types.ts b/packages/types/src/interfaces/chain/types.ts index ffe9a8f159..6bf5e92d96 100644 --- a/packages/types/src/interfaces/chain/types.ts +++ b/packages/types/src/interfaces/chain/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Hash } from '@polkadot/types/interfaces/runtime'; +import type { Hash } from '@polkadot/types/interfaces/runtime'; /** @name BlockHash */ export interface BlockHash extends Hash {} diff --git a/packages/types/src/interfaces/childstate/types.ts b/packages/types/src/interfaces/childstate/types.ts index db7af42afc..4b1bd80cfd 100644 --- a/packages/types/src/interfaces/childstate/types.ts +++ b/packages/types/src/interfaces/childstate/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { StorageKey } from '@polkadot/types/primitive'; +import type { StorageKey } from '@polkadot/types'; /** @name PrefixedStorageKey */ export interface PrefixedStorageKey extends StorageKey {} diff --git a/packages/types/src/interfaces/claims/types.ts b/packages/types/src/interfaces/claims/types.ts index 5fcc127f2e..80f08a9ba6 100644 --- a/packages/types/src/interfaces/claims/types.ts +++ b/packages/types/src/interfaces/claims/types.ts @@ -1,8 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum } from '@polkadot/types/codec'; -import { H160 } from '@polkadot/types/interfaces/runtime'; +import type { Enum } from '@polkadot/types'; +import type { H160 } from '@polkadot/types/interfaces/runtime'; /** @name EthereumAddress */ export interface EthereumAddress extends H160 {} diff --git a/packages/types/src/interfaces/collective/types.ts b/packages/types/src/interfaces/collective/types.ts index 56b17f3ca1..a3ee2b04c7 100644 --- a/packages/types/src/interfaces/collective/types.ts +++ b/packages/types/src/interfaces/collective/types.ts @@ -1,10 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Struct, Vec } from '@polkadot/types/codec'; -import { u32 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AccountId, BlockNumber } from '@polkadot/types/interfaces/runtime'; +import type { Enum, Struct, Vec, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AccountId, BlockNumber } from '@polkadot/types/interfaces/runtime'; /** @name CollectiveOrigin */ export interface CollectiveOrigin extends Enum { diff --git a/packages/types/src/interfaces/consensus/types.ts b/packages/types/src/interfaces/consensus/types.ts index a1847b127c..ffee2d2c5f 100644 --- a/packages/types/src/interfaces/consensus/types.ts +++ b/packages/types/src/interfaces/consensus/types.ts @@ -1,8 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { U8aFixed } from '@polkadot/types/codec'; -import { AccountId } from '@polkadot/types/interfaces/runtime'; +import type { U8aFixed } from '@polkadot/types'; +import type { AccountId } from '@polkadot/types/interfaces/runtime'; /** @name AuthorityId */ export interface AuthorityId extends AccountId {} diff --git a/packages/types/src/interfaces/contracts/types.ts b/packages/types/src/interfaces/contracts/types.ts index 8cdba92b43..538dd4988d 100644 --- a/packages/types/src/interfaces/contracts/types.ts +++ b/packages/types/src/interfaces/contracts/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Compact, Enum, Option, Raw, Struct, U8aFixed } from '@polkadot/types/codec'; -import { Bytes, Null, Text, bool, u32, u64, u8 } from '@polkadot/types/primitive'; -import { AccountId, Balance, BlockNumber, Hash, Weight } from '@polkadot/types/interfaces/runtime'; +import type { Bytes, Compact, Enum, Null, Option, Raw, Struct, Text, U8aFixed, bool, u32, u64, u8 } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber, Hash, Weight } from '@polkadot/types/interfaces/runtime'; /** @name AliveContractInfo */ export interface AliveContractInfo extends Struct { diff --git a/packages/types/src/interfaces/contractsAbi/types.ts b/packages/types/src/interfaces/contractsAbi/types.ts index 054b47e93e..ed17748ebc 100644 --- a/packages/types/src/interfaces/contractsAbi/types.ts +++ b/packages/types/src/interfaces/contractsAbi/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { BTreeMap, Enum, Option, Raw, Struct, U8aFixed, Vec } from '@polkadot/types/codec'; -import { Bytes, Text, bool, u32, u64 } from '@polkadot/types/primitive'; -import { SiLookupTypeId, SiPath, SiType } from '@polkadot/types/interfaces/scaleInfo'; +import type { BTreeMap, Bytes, Enum, Option, Raw, Struct, Text, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types'; +import type { SiLookupTypeId, SiPath, SiType } from '@polkadot/types/interfaces/scaleInfo'; /** @name ContractConstructorSpec */ export interface ContractConstructorSpec extends Struct { diff --git a/packages/types/src/interfaces/democracy/types.ts b/packages/types/src/interfaces/democracy/types.ts index 31433d9f80..28ba17c607 100644 --- a/packages/types/src/interfaces/democracy/types.ts +++ b/packages/types/src/interfaces/democracy/types.ts @@ -1,11 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Option, Struct, Vec } from '@polkadot/types/codec'; -import { Bytes, bool, u32 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { Vote, VoteThreshold } from '@polkadot/types/interfaces/elections'; -import { AccountId, Balance, BlockNumber, Call, Hash } from '@polkadot/types/interfaces/runtime'; +import type { Bytes, Enum, Option, Struct, Vec, bool, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { Vote, VoteThreshold } from '@polkadot/types/interfaces/elections'; +import type { AccountId, Balance, BlockNumber, Call, Hash } from '@polkadot/types/interfaces/runtime'; /** @name AccountVote */ export interface AccountVote extends Enum { diff --git a/packages/types/src/interfaces/elections/types.ts b/packages/types/src/interfaces/elections/types.ts index 73a3f64263..157aac5692 100644 --- a/packages/types/src/interfaces/elections/types.ts +++ b/packages/types/src/interfaces/elections/types.ts @@ -1,10 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Compact, Enum, Struct } from '@polkadot/types/codec'; -import { GenericVote } from '@polkadot/types/generic'; -import { u32 } from '@polkadot/types/primitive'; -import { AccountId, Balance } from '@polkadot/types/interfaces/runtime'; +import type { Compact, Enum, GenericVote, Struct, u32 } from '@polkadot/types'; +import type { AccountId, Balance } from '@polkadot/types/interfaces/runtime'; /** @name ApprovalFlag */ export interface ApprovalFlag extends u32 {} diff --git a/packages/types/src/interfaces/engine/types.ts b/packages/types/src/interfaces/engine/types.ts index 0e36568491..fd93ca49d0 100644 --- a/packages/types/src/interfaces/engine/types.ts +++ b/packages/types/src/interfaces/engine/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct } from '@polkadot/types/codec'; -import { bool } from '@polkadot/types/primitive'; -import { BlockHash } from '@polkadot/types/interfaces/chain'; +import type { Struct, bool } from '@polkadot/types'; +import type { BlockHash } from '@polkadot/types/interfaces/chain'; /** @name CreatedBlock */ export interface CreatedBlock extends Struct { diff --git a/packages/types/src/interfaces/ethereum/types.ts b/packages/types/src/interfaces/ethereum/types.ts index 70efe71d46..88712e5d2a 100644 --- a/packages/types/src/interfaces/ethereum/types.ts +++ b/packages/types/src/interfaces/ethereum/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { GenericEthereumAccountId, GenericEthereumLookupSource } from '@polkadot/types/generic'; +import type { GenericEthereumAccountId, GenericEthereumLookupSource } from '@polkadot/types'; /** @name EthereumAccountId */ export interface EthereumAccountId extends GenericEthereumAccountId {} diff --git a/packages/types/src/interfaces/evm/types.ts b/packages/types/src/interfaces/evm/types.ts index 2ef47c53ca..acb812fe9a 100644 --- a/packages/types/src/interfaces/evm/types.ts +++ b/packages/types/src/interfaces/evm/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct, Vec } from '@polkadot/types/codec'; -import { Bytes, u256 } from '@polkadot/types/primitive'; -import { H160, H256 } from '@polkadot/types/interfaces/runtime'; +import type { Bytes, Struct, Vec, u256 } from '@polkadot/types'; +import type { H160, H256 } from '@polkadot/types/interfaces/runtime'; /** @name Account */ export interface Account extends Struct { diff --git a/packages/types/src/interfaces/extrinsics/types.ts b/packages/types/src/interfaces/extrinsics/types.ts index 23ef938f26..3841235a8a 100644 --- a/packages/types/src/interfaces/extrinsics/types.ts +++ b/packages/types/src/interfaces/extrinsics/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, U8aFixed } from '@polkadot/types/codec'; -import { GenericExtrinsic, GenericExtrinsicEra, GenericExtrinsicPayload, GenericExtrinsicPayloadUnknown, GenericExtrinsicPayloadV4, GenericExtrinsicSignatureV4, GenericExtrinsicUnknown, GenericExtrinsicV4, GenericImmortalEra, GenericMortalEra, GenericSignerPayload } from '@polkadot/types/extrinsic'; -import { H512 } from '@polkadot/types/interfaces/runtime'; +import type { Enum, GenericExtrinsic, GenericExtrinsicEra, GenericExtrinsicPayload, GenericExtrinsicPayloadUnknown, GenericExtrinsicPayloadV4, GenericExtrinsicSignatureV4, GenericExtrinsicUnknown, GenericExtrinsicV4, GenericImmortalEra, GenericMortalEra, GenericSignerPayload, U8aFixed } from '@polkadot/types'; +import type { H512 } from '@polkadot/types/interfaces/runtime'; /** @name AnySignature */ export interface AnySignature extends H512 {} diff --git a/packages/types/src/interfaces/genericAsset/types.ts b/packages/types/src/interfaces/genericAsset/types.ts index 276d544cff..575b317a57 100644 --- a/packages/types/src/interfaces/genericAsset/types.ts +++ b/packages/types/src/interfaces/genericAsset/types.ts @@ -1,8 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Compact, Enum, Struct } from '@polkadot/types/codec'; -import { AccountId, Balance } from '@polkadot/types/interfaces/runtime'; +import type { Compact, Enum, Struct } from '@polkadot/types'; +import type { AccountId, Balance } from '@polkadot/types/interfaces/runtime'; /** @name AssetOptions */ export interface AssetOptions extends Struct { diff --git a/packages/types/src/interfaces/grandpa/types.ts b/packages/types/src/interfaces/grandpa/types.ts index 992616cb71..b9a956c29c 100644 --- a/packages/types/src/interfaces/grandpa/types.ts +++ b/packages/types/src/interfaces/grandpa/types.ts @@ -1,13 +1,12 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { BTreeSet, Enum, Struct, Vec } from '@polkadot/types/codec'; -import { Bytes, u32, u64 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AuthorityId } from '@polkadot/types/interfaces/consensus'; -import { AuthoritySignature } from '@polkadot/types/interfaces/imOnline'; -import { BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; -import { MembershipProof } from '@polkadot/types/interfaces/session'; +import type { BTreeSet, Bytes, Enum, Struct, Vec, u32, u64 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; +import type { AuthoritySignature } from '@polkadot/types/interfaces/imOnline'; +import type { BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; +import type { MembershipProof } from '@polkadot/types/interfaces/session'; /** @name AuthorityIndex */ export interface AuthorityIndex extends u64 {} diff --git a/packages/types/src/interfaces/identity/types.ts b/packages/types/src/interfaces/identity/types.ts index 2b3d4142f6..51b7c87be3 100644 --- a/packages/types/src/interfaces/identity/types.ts +++ b/packages/types/src/interfaces/identity/types.ts @@ -1,10 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Option, Set, Struct, Vec } from '@polkadot/types/codec'; -import { Data, u32 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AccountId, Balance, H160 } from '@polkadot/types/interfaces/runtime'; +import type { Data, Enum, Option, Set, Struct, Vec, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AccountId, Balance, H160 } from '@polkadot/types/interfaces/runtime'; /** @name IdentityFields */ export interface IdentityFields extends Set { diff --git a/packages/types/src/interfaces/imOnline/types.ts b/packages/types/src/interfaces/imOnline/types.ts index d171ecf8bb..c1dffb58b2 100644 --- a/packages/types/src/interfaces/imOnline/types.ts +++ b/packages/types/src/interfaces/imOnline/types.ts @@ -1,11 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct, Vec } from '@polkadot/types/codec'; -import { Bytes, u32 } from '@polkadot/types/primitive'; -import { Signature } from '@polkadot/types/interfaces/extrinsics'; -import { BlockNumber } from '@polkadot/types/interfaces/runtime'; -import { SessionIndex } from '@polkadot/types/interfaces/session'; +import type { Bytes, Struct, Vec, u32 } from '@polkadot/types'; +import type { Signature } from '@polkadot/types/interfaces/extrinsics'; +import type { BlockNumber } from '@polkadot/types/interfaces/runtime'; +import type { SessionIndex } from '@polkadot/types/interfaces/session'; /** @name AuthIndex */ export interface AuthIndex extends u32 {} diff --git a/packages/types/src/interfaces/metadata/types.ts b/packages/types/src/interfaces/metadata/types.ts index 8a26ac710b..25d70301f6 100644 --- a/packages/types/src/interfaces/metadata/types.ts +++ b/packages/types/src/interfaces/metadata/types.ts @@ -1,8 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Option, Struct, Vec } from '@polkadot/types/codec'; -import { Bytes, Text, Type, bool, u8 } from '@polkadot/types/primitive'; +import type { Bytes, Enum, Option, Struct, Text, Type, Vec, bool, u8 } from '@polkadot/types'; /** @name DoubleMapTypeLatest */ export interface DoubleMapTypeLatest extends DoubleMapTypeV12 {} diff --git a/packages/types/src/interfaces/offchain/types.ts b/packages/types/src/interfaces/offchain/types.ts index 64682777d8..dad140d501 100644 --- a/packages/types/src/interfaces/offchain/types.ts +++ b/packages/types/src/interfaces/offchain/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum } from '@polkadot/types/codec'; +import type { Enum } from '@polkadot/types'; /** @name StorageKind */ export interface StorageKind extends Enum { diff --git a/packages/types/src/interfaces/offences/types.ts b/packages/types/src/interfaces/offences/types.ts index 87cad5a839..a541b9afbe 100644 --- a/packages/types/src/interfaces/offences/types.ts +++ b/packages/types/src/interfaces/offences/types.ts @@ -1,11 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct, U8aFixed, Vec } from '@polkadot/types/codec'; -import { Bytes } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AccountId, Hash, Perbill } from '@polkadot/types/interfaces/runtime'; -import { IdentificationTuple, SessionIndex } from '@polkadot/types/interfaces/session'; +import type { Bytes, Struct, U8aFixed, Vec } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AccountId, Hash, Perbill } from '@polkadot/types/interfaces/runtime'; +import type { IdentificationTuple, SessionIndex } from '@polkadot/types/interfaces/session'; /** @name DeferredOffenceOf */ export interface DeferredOffenceOf extends ITuple<[Vec, Vec, SessionIndex]> {} diff --git a/packages/types/src/interfaces/parachains/types.ts b/packages/types/src/interfaces/parachains/types.ts index 55d41b2dc4..315a2ef99b 100644 --- a/packages/types/src/interfaces/parachains/types.ts +++ b/packages/types/src/interfaces/parachains/types.ts @@ -1,12 +1,11 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec'; -import { BitVec, Bytes, u32 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { Signature } from '@polkadot/types/interfaces/extrinsics'; -import { AccountId, Balance, BlockNumber, Hash, ValidatorId } from '@polkadot/types/interfaces/runtime'; -import { MembershipProof, SessionIndex } from '@polkadot/types/interfaces/session'; +import type { BitVec, Bytes, Enum, Option, Struct, U8aFixed, Vec, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { Signature } from '@polkadot/types/interfaces/extrinsics'; +import type { AccountId, Balance, BlockNumber, Hash, ValidatorId } from '@polkadot/types/interfaces/runtime'; +import type { MembershipProof, SessionIndex } from '@polkadot/types/interfaces/session'; /** @name AbridgedCandidateReceipt */ export interface AbridgedCandidateReceipt extends Struct { diff --git a/packages/types/src/interfaces/payment/types.ts b/packages/types/src/interfaces/payment/types.ts index 2144b08062..2b70e92899 100644 --- a/packages/types/src/interfaces/payment/types.ts +++ b/packages/types/src/interfaces/payment/types.ts @@ -1,9 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct } from '@polkadot/types/codec'; -import { Balance, Weight } from '@polkadot/types/interfaces/runtime'; -import { DispatchClass } from '@polkadot/types/interfaces/system'; +import type { Struct } from '@polkadot/types'; +import type { Balance, Weight } from '@polkadot/types/interfaces/runtime'; +import type { DispatchClass } from '@polkadot/types/interfaces/system'; /** @name RuntimeDispatchInfo */ export interface RuntimeDispatchInfo extends Struct { diff --git a/packages/types/src/interfaces/poll/types.ts b/packages/types/src/interfaces/poll/types.ts index 4dbab37f97..f6d9947a5d 100644 --- a/packages/types/src/interfaces/poll/types.ts +++ b/packages/types/src/interfaces/poll/types.ts @@ -1,8 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Vec } from '@polkadot/types/codec'; -import { bool } from '@polkadot/types/primitive'; +import type { Vec, bool } from '@polkadot/types'; /** @name Approvals */ export interface Approvals extends Vec {} diff --git a/packages/types/src/interfaces/proxy/types.ts b/packages/types/src/interfaces/proxy/types.ts index 5137d2b18e..39c9f04f7c 100644 --- a/packages/types/src/interfaces/proxy/types.ts +++ b/packages/types/src/interfaces/proxy/types.ts @@ -1,8 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Struct } from '@polkadot/types/codec'; -import { AccountId, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; +import type { Enum, Struct } from '@polkadot/types'; +import type { AccountId, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; /** @name ProxyAnnouncement */ export interface ProxyAnnouncement extends Struct { diff --git a/packages/types/src/interfaces/purchase/types.ts b/packages/types/src/interfaces/purchase/types.ts index 6869017749..f0f41f1e37 100644 --- a/packages/types/src/interfaces/purchase/types.ts +++ b/packages/types/src/interfaces/purchase/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Struct } from '@polkadot/types/codec'; -import { Bytes } from '@polkadot/types/primitive'; -import { Balance, Permill } from '@polkadot/types/interfaces/runtime'; +import type { Bytes, Enum, Struct } from '@polkadot/types'; +import type { Balance, Permill } from '@polkadot/types/interfaces/runtime'; /** @name AccountStatus */ export interface AccountStatus extends Struct { diff --git a/packages/types/src/interfaces/recovery/types.ts b/packages/types/src/interfaces/recovery/types.ts index cdf58f0fb6..8cbbb6f851 100644 --- a/packages/types/src/interfaces/recovery/types.ts +++ b/packages/types/src/interfaces/recovery/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct, Vec } from '@polkadot/types/codec'; -import { u16 } from '@polkadot/types/primitive'; -import { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces/runtime'; +import type { Struct, Vec, u16 } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces/runtime'; /** @name ActiveRecovery */ export interface ActiveRecovery extends Struct { diff --git a/packages/types/src/interfaces/rpc/types.ts b/packages/types/src/interfaces/rpc/types.ts index 63ead2b8fb..e6a6a3023c 100644 --- a/packages/types/src/interfaces/rpc/types.ts +++ b/packages/types/src/interfaces/rpc/types.ts @@ -1,8 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct, Vec } from '@polkadot/types/codec'; -import { Text, u32 } from '@polkadot/types/primitive'; +import type { Struct, Text, Vec, u32 } from '@polkadot/types'; /** @name RpcMethods */ export interface RpcMethods extends Struct { diff --git a/packages/types/src/interfaces/runtime/types.ts b/packages/types/src/interfaces/runtime/types.ts index 3edbcaf0b5..e34fb81860 100644 --- a/packages/types/src/interfaces/runtime/types.ts +++ b/packages/types/src/interfaces/runtime/types.ts @@ -1,13 +1,11 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Compact, Enum, Int, Struct, U8aFixed, UInt, Vec } from '@polkadot/types/codec'; -import { GenericAccountId, GenericAccountIndex, GenericBlock, GenericCall, GenericConsensusEngineId, GenericLookupSource, GenericMultiAddress } from '@polkadot/types/generic'; -import { Bytes, DoNotConstruct, Null, StorageKey, u16, u32, u64, u8 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AuthorityId } from '@polkadot/types/interfaces/consensus'; -import { Signature } from '@polkadot/types/interfaces/extrinsics'; -import { SystemOrigin } from '@polkadot/types/interfaces/system'; +import type { Bytes, Compact, DoNotConstruct, Enum, GenericAccountId, GenericAccountIndex, GenericBlock, GenericCall, GenericConsensusEngineId, GenericLookupSource, GenericMultiAddress, Int, Null, StorageKey, Struct, U8aFixed, UInt, Vec, u16, u32, u64, u8 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; +import type { Signature } from '@polkadot/types/interfaces/extrinsics'; +import type { SystemOrigin } from '@polkadot/types/interfaces/system'; /** @name AccountId */ export interface AccountId extends GenericAccountId {} diff --git a/packages/types/src/interfaces/scaleInfo/types.ts b/packages/types/src/interfaces/scaleInfo/types.ts index 9bf31003fc..2c1a81c1fd 100644 --- a/packages/types/src/interfaces/scaleInfo/types.ts +++ b/packages/types/src/interfaces/scaleInfo/types.ts @@ -1,8 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Option, Struct, Vec } from '@polkadot/types/codec'; -import { Text, u16, u32, u64 } from '@polkadot/types/primitive'; +import type { Enum, Option, Struct, Text, Vec, u16, u32, u64 } from '@polkadot/types'; /** @name SiField */ export interface SiField extends Struct { diff --git a/packages/types/src/interfaces/scheduler/types.ts b/packages/types/src/interfaces/scheduler/types.ts index b59be0e8e5..6418329346 100644 --- a/packages/types/src/interfaces/scheduler/types.ts +++ b/packages/types/src/interfaces/scheduler/types.ts @@ -1,10 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Option, Struct } from '@polkadot/types/codec'; -import { Bytes, u32, u8 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { BlockNumber, Call, PalletsOrigin } from '@polkadot/types/interfaces/runtime'; +import type { Bytes, Option, Struct, u32, u8 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { BlockNumber, Call, PalletsOrigin } from '@polkadot/types/interfaces/runtime'; /** @name Period */ export interface Period extends ITuple<[BlockNumber, u32]> {} diff --git a/packages/types/src/interfaces/session/types.ts b/packages/types/src/interfaces/session/types.ts index 6ed6df9047..de0817d8f6 100644 --- a/packages/types/src/interfaces/session/types.ts +++ b/packages/types/src/interfaces/session/types.ts @@ -1,11 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct, Vec } from '@polkadot/types/codec'; -import { Bytes, u32 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AccountId, ValidatorId } from '@polkadot/types/interfaces/runtime'; -import { Exposure } from '@polkadot/types/interfaces/staking'; +import type { Bytes, Struct, Vec, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AccountId, ValidatorId } from '@polkadot/types/interfaces/runtime'; +import type { Exposure } from '@polkadot/types/interfaces/staking'; /** @name FullIdentification */ export interface FullIdentification extends Exposure {} diff --git a/packages/types/src/interfaces/society/types.ts b/packages/types/src/interfaces/society/types.ts index ad6256ccbd..e7e0277e75 100644 --- a/packages/types/src/interfaces/society/types.ts +++ b/packages/types/src/interfaces/society/types.ts @@ -1,10 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Struct } from '@polkadot/types/codec'; -import { u32 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AccountId, Balance } from '@polkadot/types/interfaces/runtime'; +import type { Enum, Struct, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AccountId, Balance } from '@polkadot/types/interfaces/runtime'; /** @name Bid */ export interface Bid extends Struct { diff --git a/packages/types/src/interfaces/staking/types.ts b/packages/types/src/interfaces/staking/types.ts index 0056e821a4..7d3e09ccbb 100644 --- a/packages/types/src/interfaces/staking/types.ts +++ b/packages/types/src/interfaces/staking/types.ts @@ -1,10 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { BTreeMap, Compact, Enum, Option, Struct, Vec } from '@polkadot/types/codec'; -import { bool, u128, u16, u32 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AccountId, Balance, BlockNumber, Moment, PerU16, Perbill } from '@polkadot/types/interfaces/runtime'; +import type { BTreeMap, Compact, Enum, Option, Struct, Vec, bool, u128, u16, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AccountId, Balance, BlockNumber, Moment, PerU16, Perbill } from '@polkadot/types/interfaces/runtime'; /** @name ActiveEraInfo */ export interface ActiveEraInfo extends Struct { diff --git a/packages/types/src/interfaces/state/types.ts b/packages/types/src/interfaces/state/types.ts index df4f68a426..fdc611a2dd 100644 --- a/packages/types/src/interfaces/state/types.ts +++ b/packages/types/src/interfaces/state/types.ts @@ -1,10 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec'; -import { Bytes, StorageKey, Text, u32 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { Hash, StorageData } from '@polkadot/types/interfaces/runtime'; +import type { Bytes, Option, StorageKey, Struct, Text, U8aFixed, Vec, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { Hash, StorageData } from '@polkadot/types/interfaces/runtime'; /** @name ApiId */ export interface ApiId extends U8aFixed {} diff --git a/packages/types/src/interfaces/support/types.ts b/packages/types/src/interfaces/support/types.ts index 45e53e9d20..40b7af6c4a 100644 --- a/packages/types/src/interfaces/support/types.ts +++ b/packages/types/src/interfaces/support/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct } from '@polkadot/types/codec'; -import { bool, u8 } from '@polkadot/types/primitive'; -import { Balance, Perbill } from '@polkadot/types/interfaces/runtime'; +import type { Struct, bool, u8 } from '@polkadot/types'; +import type { Balance, Perbill } from '@polkadot/types/interfaces/runtime'; /** @name WeightToFeeCoefficient */ export interface WeightToFeeCoefficient extends Struct { diff --git a/packages/types/src/interfaces/system/types.ts b/packages/types/src/interfaces/system/types.ts index 50cec25d40..e55cc19095 100644 --- a/packages/types/src/interfaces/system/types.ts +++ b/packages/types/src/interfaces/system/types.ts @@ -1,12 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Compact, Enum, HashMap, Option, Result, Struct, U8aFixed, Vec } from '@polkadot/types/codec'; -import { GenericEvent } from '@polkadot/types/generic'; -import { Bytes, Text, bool, i32, u32, u64, u8 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AccountData } from '@polkadot/types/interfaces/balances'; -import { AccountId, BlockNumber, Digest, Hash, Index, Pays, Weight } from '@polkadot/types/interfaces/runtime'; +import type { Bytes, Compact, Enum, GenericEvent, HashMap, Option, Result, Struct, Text, U8aFixed, Vec, bool, i32, u32, u64, u8 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AccountData } from '@polkadot/types/interfaces/balances'; +import type { AccountId, BlockNumber, Digest, Hash, Index, Pays, Weight } from '@polkadot/types/interfaces/runtime'; /** @name AccountInfo */ export interface AccountInfo extends Struct { diff --git a/packages/types/src/interfaces/treasury/types.ts b/packages/types/src/interfaces/treasury/types.ts index 5893549fc8..e0dd0b65fa 100644 --- a/packages/types/src/interfaces/treasury/types.ts +++ b/packages/types/src/interfaces/treasury/types.ts @@ -1,10 +1,9 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Enum, Option, Struct, Vec } from '@polkadot/types/codec'; -import { bool, u32 } from '@polkadot/types/primitive'; -import { ITuple } from '@polkadot/types/types'; -import { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; +import type { Enum, Option, Struct, Vec, bool, u32 } from '@polkadot/types'; +import type { ITuple } from '@polkadot/types/types'; +import type { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; /** @name Bounty */ export interface Bounty extends Struct { diff --git a/packages/types/src/interfaces/txpayment/types.ts b/packages/types/src/interfaces/txpayment/types.ts index 0078bc33e3..f7d35bde34 100644 --- a/packages/types/src/interfaces/txpayment/types.ts +++ b/packages/types/src/interfaces/txpayment/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Fixed128 } from '@polkadot/types/interfaces/runtime'; +import type { Fixed128 } from '@polkadot/types/interfaces/runtime'; /** @name Multiplier */ export interface Multiplier extends Fixed128 {} diff --git a/packages/types/src/interfaces/utility/types.ts b/packages/types/src/interfaces/utility/types.ts index f46ed57306..21350f05af 100644 --- a/packages/types/src/interfaces/utility/types.ts +++ b/packages/types/src/interfaces/utility/types.ts @@ -1,9 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct, Vec } from '@polkadot/types/codec'; -import { u32 } from '@polkadot/types/primitive'; -import { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces/runtime'; +import type { Struct, Vec, u32 } from '@polkadot/types'; +import type { AccountId, Balance, BlockNumber } from '@polkadot/types/interfaces/runtime'; /** @name Multisig */ export interface Multisig extends Struct { diff --git a/packages/types/src/interfaces/vesting/types.ts b/packages/types/src/interfaces/vesting/types.ts index ad3a1934fa..9892d21ae9 100644 --- a/packages/types/src/interfaces/vesting/types.ts +++ b/packages/types/src/interfaces/vesting/types.ts @@ -1,8 +1,8 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import { Struct } from '@polkadot/types/codec'; -import { Balance, BlockNumber } from '@polkadot/types/interfaces/runtime'; +import type { Struct } from '@polkadot/types'; +import type { Balance, BlockNumber } from '@polkadot/types/interfaces/runtime'; /** @name VestingInfo */ export interface VestingInfo extends Struct { diff --git a/packages/types/src/types/interfaces.ts b/packages/types/src/types/interfaces.ts index 2e180a64dd..aba966249c 100644 --- a/packages/types/src/types/interfaces.ts +++ b/packages/types/src/types/interfaces.ts @@ -3,6 +3,7 @@ import type BN from 'bn.js'; import { SignOptions } from '@polkadot/keyring/types'; + import { Hash } from '../interfaces/runtime'; import { FunctionMetadataLatest } from '../interfaces/metadata'; import { ArgsDef, Codec } from './codec';