diff --git a/CHANGELOG.md b/CHANGELOG.md index b5c20f10ae..4ae5a54f30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Changes: - Convert metadata & API to use lazy decoration +- Move PortableRegistry location inside `@polkadot/types/metadata` ## 6.6.1 Nov 1, 2021 diff --git a/packages/api-contract/src/Abi/index.ts b/packages/api-contract/src/Abi/index.ts index f3bcd8ad1b..c9082445a2 100644 --- a/packages/api-contract/src/Abi/index.ts +++ b/packages/api-contract/src/Abi/index.ts @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/api-contract authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { Bytes } from '@polkadot/types'; +import type { Bytes, PortableRegistry } from '@polkadot/types'; import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageParamSpec, ContractMessageSpec, ContractMetadataLatest, ContractProjectInfo } from '@polkadot/types/interfaces'; import type { AnyJson, Codec, Registry } from '@polkadot/types/types'; import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from '../types'; @@ -45,7 +45,7 @@ function parseJson (json: AnyJson, chainProperties?: ChainProperties): [AnyJson, const latest = metadata.isV0 ? toLatest(registry, metadata.asV0) : metadata.asV1; - const lookup = registry.createType('PortableRegistry', { types: latest.types }); + const lookup = registry.createType('PortableRegistry', { types: latest.types }); // attach the lookup to the registry - now the types are known registry.setLookup(lookup); diff --git a/packages/typegen/src/generate/lookup.ts b/packages/typegen/src/generate/lookup.ts index bb52a67628..a59c99fdb3 100644 --- a/packages/typegen/src/generate/lookup.ts +++ b/packages/typegen/src/generate/lookup.ts @@ -1,7 +1,8 @@ // Copyright 2017-2021 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { PortableRegistry, PortableType, SiLookupTypeId, SiPath, SiTypeParameter } from '@polkadot/types/interfaces'; +import type { PortableType, SiLookupTypeId, SiPath, SiTypeParameter } from '@polkadot/types/interfaces'; +import type { PortableRegistry } from '@polkadot/types/metadata'; import type { TypeDef } from '@polkadot/types/types'; import Handlebars from 'handlebars'; diff --git a/packages/typegen/src/generate/query.ts b/packages/typegen/src/generate/query.ts index fdacda8964..e857a682e2 100644 --- a/packages/typegen/src/generate/query.ts +++ b/packages/typegen/src/generate/query.ts @@ -1,8 +1,8 @@ // Copyright 2017-2021 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { PortableRegistry, StorageEntryMetadataLatest } from '@polkadot/types/interfaces/metadata'; -import type { Metadata } from '@polkadot/types/metadata/Metadata'; +import type { StorageEntryMetadataLatest } from '@polkadot/types/interfaces'; +import type { Metadata, PortableRegistry } from '@polkadot/types/metadata'; import type { Registry } from '@polkadot/types/types'; import type { ExtraTypes } from './types'; diff --git a/packages/typegen/src/metadataMd.ts b/packages/typegen/src/metadataMd.ts index fdbbb7a811..49d8afb942 100644 --- a/packages/typegen/src/metadataMd.ts +++ b/packages/typegen/src/metadataMd.ts @@ -1,7 +1,8 @@ // Copyright 2017-2021 @polkadot/typegen authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { MetadataLatest, PortableRegistry, SiLookupTypeId } from '@polkadot/types/interfaces'; +import type { MetadataLatest, SiLookupTypeId } from '@polkadot/types/interfaces'; +import type { PortableRegistry } from '@polkadot/types/metadata'; import type { Codec, DefinitionRpcParam } from '@polkadot/types/types'; import fs from 'fs'; diff --git a/packages/typegen/src/util/imports.ts b/packages/typegen/src/util/imports.ts index cf3b6862f0..d7b306e742 100644 --- a/packages/typegen/src/util/imports.ts +++ b/packages/typegen/src/util/imports.ts @@ -44,7 +44,7 @@ export function setImports (allDefs: Record, imports: TypeI // do nothing } else if (['AnyNumber', 'CallFunction', 'Codec', 'IExtrinsic', 'ITuple'].includes(type)) { typesTypes[type] = true; - } else if (type === 'Metadata') { + } else if (['Metadata', 'PortableRegistry'].includes(type)) { metadataTypes[type] = true; } else if ((codecClasses as Record)[type]) { codecTypes[type] = true; diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index 0dec227b6e..8e1af8c337 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -32,7 +32,7 @@ import type { AuthorityIndex, AuthorityList, AuthoritySet, AuthoritySetChange, A import type { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityInfoTo198, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement, RegistrationTo198 } from '@polkadot/types/interfaces/identity'; import type { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline'; import type { CallIndex, LotteryConfig } from '@polkadot/types/interfaces/lottery'; -import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableRegistry, PortableRegistryV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; +import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV13, ErrorMetadataV14, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV13, EventMetadataV14, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, ExtrinsicMetadataV13, ExtrinsicMetadataV14, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV13, FunctionArgumentMetadataV14, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV13, FunctionMetadataV14, FunctionMetadataV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14, MetadataV9, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV13, ModuleConstantMetadataV9, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV13, ModuleMetadataV9, PalletCallMetadataLatest, PalletCallMetadataV14, PalletConstantMetadataLatest, PalletConstantMetadataV14, PalletErrorMetadataLatest, PalletErrorMetadataV14, PalletEventMetadataLatest, PalletEventMetadataV14, PalletMetadataLatest, PalletMetadataV14, PalletStorageMetadataLatest, PalletStorageMetadataV14, PortableType, PortableTypeV14, SignedExtensionMetadataLatest, SignedExtensionMetadataV14, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV13, StorageEntryMetadataV14, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV13, StorageEntryModifierV14, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV13, StorageEntryTypeV14, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV13, StorageHasherV14, StorageHasherV9, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV13, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata'; import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; @@ -698,8 +698,6 @@ declare module '@polkadot/types/types/registry' { Phase: Phase; PhragmenScore: PhragmenScore; Points: Points; - PortableRegistry: PortableRegistry; - PortableRegistryV14: PortableRegistryV14; PortableType: PortableType; PortableTypeV14: PortableTypeV14; Precommits: Precommits; diff --git a/packages/types/src/bundle.ts b/packages/types/src/bundle.ts index d28084ea04..e723a75a0b 100644 --- a/packages/types/src/bundle.ts +++ b/packages/types/src/bundle.ts @@ -10,7 +10,7 @@ export * from './index.types'; export * from './metadata'; export { TypeDefInfo } from './create/types'; -export { convertSiV0toV1 } from './generic/PortableRegistry'; +export { convertSiV0toV1 } from './metadata/PortableRegistry'; export { packageInfo } from './packageInfo'; export { unwrapStorageType } from './primitive/StorageKey'; diff --git a/packages/types/src/create/lazy.ts b/packages/types/src/create/lazy.ts index 8dc7a7f8b9..9172ba47c2 100644 --- a/packages/types/src/create/lazy.ts +++ b/packages/types/src/create/lazy.ts @@ -1,7 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { PortableRegistry, SiLookupTypeId, SiVariant } from '../interfaces'; +import type { SiLookupTypeId, SiVariant } from '../interfaces'; +import type { PortableRegistry } from '../metadata'; import { lazyMethod } from '@polkadot/util'; diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index 38f3b1fbd2..0cd29c1dec 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { ExtDef } from '../extrinsic/signedExtensions/types'; -import type { ChainProperties, CodecHash, DispatchErrorModule, Hash, MetadataLatest, PortableRegistry, SiField, SiLookupTypeId, SiVariant } from '../interfaces/types'; +import type { ChainProperties, CodecHash, DispatchErrorModule, Hash, MetadataLatest, SiField, SiLookupTypeId, SiVariant } from '../interfaces/types'; import type { CallFunction, Codec, CodecHasher, Constructor, DetectCodec, DetectConstructor, RegisteredTypes, Registry, RegistryError, RegistryTypes } from '../types'; import type { CreateOptions } from './types'; @@ -19,6 +19,7 @@ import * as definitions from '../interfaces/definitions'; import { decorateConstants, filterCallsSome, filterEventsSome } from '../metadata/decorate'; import { createCallFunction } from '../metadata/decorate/extrinsics'; import { Metadata } from '../metadata/Metadata'; +import { PortableRegistry } from '../metadata/PortableRegistry'; import { createClass } from './createClass'; import { createTypeUnsafe } from './createType'; import { lazyVariants } from './lazy'; @@ -168,7 +169,7 @@ export class TypeRegistry implements Registry { public createdAtHash?: Hash; constructor (createdAtHash?: Hash | Uint8Array | string) { - this.#knownDefaults = objectSpread({ Json, Metadata, Raw }, baseTypes); + this.#knownDefaults = objectSpread({ Json, Metadata, PortableRegistry, Raw }, baseTypes); this.#knownDefinitions = definitions as unknown as Record; this.init(); diff --git a/packages/types/src/generic/index.ts b/packages/types/src/generic/index.ts index d2e766d3bc..fa59063e8c 100644 --- a/packages/types/src/generic/index.ts +++ b/packages/types/src/generic/index.ts @@ -12,5 +12,4 @@ export { GenericConsensusEngineId } from './ConsensusEngineId'; export { GenericEvent, GenericEventData } from './Event'; export { GenericLookupSource } from './LookupSource'; export { GenericMultiAddress, GenericMultiAddress as GenericAddress } from './MultiAddress'; -export { GenericPortableRegistry } from './PortableRegistry'; export { GenericVote } from './Vote'; diff --git a/packages/types/src/interfaces/metadata/definitions.ts b/packages/types/src/interfaces/metadata/definitions.ts index 98b5c124b6..0beb49aba8 100644 --- a/packages/types/src/interfaces/metadata/definitions.ts +++ b/packages/types/src/interfaces/metadata/definitions.ts @@ -21,10 +21,6 @@ export { AllHashers }; export default { rpc: {}, types: objectSpread({}, v9, v10, v11, v12, v13, v14, { - // registry mapping to latest - PortableRegistry: 'PortableRegistryV14', - PortableType: 'PortableTypeV14', - // latest mappings ErrorMetadataLatest: 'ErrorMetadataV14', EventMetadataLatest: 'EventMetadataV14', @@ -38,6 +34,7 @@ export default { PalletEventMetadataLatest: 'PalletEventMetadataV14', PalletMetadataLatest: 'PalletMetadataV14', PalletStorageMetadataLatest: 'PalletStorageMetadataV14', + PortableType: 'PortableTypeV14', SignedExtensionMetadataLatest: 'SignedExtensionMetadataV14', StorageEntryMetadataLatest: 'StorageEntryMetadataV14', StorageEntryModifierLatest: 'StorageEntryModifierV14', diff --git a/packages/types/src/interfaces/metadata/types.ts b/packages/types/src/interfaces/metadata/types.ts index 34868a1940..156e1f1c93 100644 --- a/packages/types/src/interfaces/metadata/types.ts +++ b/packages/types/src/interfaces/metadata/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { Bytes, Enum, GenericPortableRegistry, Option, Struct, Text, Type, Vec, bool, u8 } from '@polkadot/types'; +import type { Bytes, Enum, Option, PortableRegistry, Struct, Text, Type, Vec, bool, u8 } from '@polkadot/types'; import type { Si1Field, Si1LookupTypeId, Si1Type, SiLookupTypeId } from '@polkadot/types/interfaces/scaleInfo'; /** @name ErrorMetadataLatest */ @@ -331,12 +331,6 @@ export interface PalletStorageMetadataV14 extends Struct { readonly items: Vec; } -/** @name PortableRegistry */ -export interface PortableRegistry extends PortableRegistryV14 {} - -/** @name PortableRegistryV14 */ -export interface PortableRegistryV14 extends GenericPortableRegistry {} - /** @name PortableType */ export interface PortableType extends PortableTypeV14 {} diff --git a/packages/types/src/interfaces/metadata/v14.ts b/packages/types/src/interfaces/metadata/v14.ts index b5e4853269..eaae29ec5e 100644 --- a/packages/types/src/interfaces/metadata/v14.ts +++ b/packages/types/src/interfaces/metadata/v14.ts @@ -12,7 +12,6 @@ import { Si1Variant } from '../scaleInfo/v1'; export const v14: DefinitionsTypes = { // registry - PortableRegistryV14: 'GenericPortableRegistry', PortableTypeV14: { id: 'Si1LookupTypeId', type: 'Si1Type' diff --git a/packages/types/src/generic/PortableRegistry/PortableRegistry.ts b/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts similarity index 98% rename from packages/types/src/generic/PortableRegistry/PortableRegistry.ts rename to packages/types/src/metadata/PortableRegistry/PortableRegistry.ts index a268ac29b9..d7de32f60e 100644 --- a/packages/types/src/generic/PortableRegistry/PortableRegistry.ts +++ b/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts @@ -98,7 +98,7 @@ function getPrimitivePath (path: SiPath): string | null { : null; } -function removeDuplicateNames (lookup: GenericPortableRegistry, names: [number, string | null, SiTypeParameter[]][]): [number, string][] { +function removeDuplicateNames (lookup: PortableRegistry, names: [number, string | null, SiTypeParameter[]][]): [number, string][] { const rewrite: Record = {}; return names @@ -219,7 +219,7 @@ function extractName (types: PortableType[], { id, type: { params, path } }: Por return [lookupIndex, typeName, params]; } -function extractNames (lookup: GenericPortableRegistry, types: PortableType[]): Record { +function extractNames (lookup: PortableRegistry, types: PortableType[]): Record { const dedup = removeDuplicateNames(lookup, types.map((t) => extractName(types, t) )); @@ -253,7 +253,7 @@ function extractTypeMap (types: PortableType[]): Record { return result; } -export class GenericPortableRegistry extends Struct { +export class PortableRegistry extends Struct { #names: Record; #typeDefs: Record = {}; #types: Record; diff --git a/packages/types/src/generic/PortableRegistry/index.ts b/packages/types/src/metadata/PortableRegistry/index.ts similarity index 71% rename from packages/types/src/generic/PortableRegistry/index.ts rename to packages/types/src/metadata/PortableRegistry/index.ts index 57b4751eac..b3f569dd12 100644 --- a/packages/types/src/generic/PortableRegistry/index.ts +++ b/packages/types/src/metadata/PortableRegistry/index.ts @@ -1,5 +1,5 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -export { GenericPortableRegistry } from './PortableRegistry'; +export { PortableRegistry } from './PortableRegistry'; export { toV1 as convertSiV0toV1 } from './toV1'; diff --git a/packages/types/src/generic/PortableRegistry/toV1.ts b/packages/types/src/metadata/PortableRegistry/toV1.ts similarity index 100% rename from packages/types/src/generic/PortableRegistry/toV1.ts rename to packages/types/src/metadata/PortableRegistry/toV1.ts diff --git a/packages/types/src/metadata/decorate/errors/index.ts b/packages/types/src/metadata/decorate/errors/index.ts index 56e4dff9a7..279c518ef9 100644 --- a/packages/types/src/metadata/decorate/errors/index.ts +++ b/packages/types/src/metadata/decorate/errors/index.ts @@ -1,7 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { DispatchErrorModule, MetadataLatest, PortableRegistry, SiField, SiVariant } from '../../../interfaces'; +import type { DispatchErrorModule, MetadataLatest, SiField, SiVariant } from '../../../interfaces'; +import type { PortableRegistry } from '../../../metadata'; import type { Text, u8 } from '../../../primitive'; import type { Registry } from '../../../types'; import type { Errors, IsError } from '../types'; diff --git a/packages/types/src/metadata/decorate/extrinsics/index.ts b/packages/types/src/metadata/decorate/extrinsics/index.ts index 77d4d86eb0..c3018f911a 100644 --- a/packages/types/src/metadata/decorate/extrinsics/index.ts +++ b/packages/types/src/metadata/decorate/extrinsics/index.ts @@ -1,7 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { MetadataLatest, PalletMetadataLatest, PortableRegistry, SiVariant } from '../../../interfaces'; +import type { MetadataLatest, PalletMetadataLatest, SiVariant } from '../../../interfaces'; +import type { PortableRegistry } from '../../../metadata'; import type { CallFunction, Registry } from '../../../types'; import type { Extrinsics } from '../types'; diff --git a/packages/types/src/metadata/index.ts b/packages/types/src/metadata/index.ts index 19fbfdccc9..1ef837f52e 100644 --- a/packages/types/src/metadata/index.ts +++ b/packages/types/src/metadata/index.ts @@ -2,4 +2,5 @@ // SPDX-License-Identifier: Apache-2.0 export { Metadata } from './Metadata'; +export { PortableRegistry } from './PortableRegistry'; export { decorateConstants, decorateExtrinsics, decorateStorage, expandMetadata } from './decorate'; diff --git a/packages/types/src/metadata/util/getSiName.ts b/packages/types/src/metadata/util/getSiName.ts index e68caae6db..992b5dff8d 100644 --- a/packages/types/src/metadata/util/getSiName.ts +++ b/packages/types/src/metadata/util/getSiName.ts @@ -1,7 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { PortableRegistry, SiLookupTypeId } from '../../interfaces'; +import type { SiLookupTypeId } from '../../interfaces'; +import type { PortableRegistry } from '../../metadata'; export function getSiName (lookup: PortableRegistry, type: SiLookupTypeId): string { const typeDef = lookup.getTypeDef(type); diff --git a/packages/types/src/metadata/util/getUniqTypes.ts b/packages/types/src/metadata/util/getUniqTypes.ts index c522272655..1e259826d7 100644 --- a/packages/types/src/metadata/util/getUniqTypes.ts +++ b/packages/types/src/metadata/util/getUniqTypes.ts @@ -1,7 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { MetadataLatest, PortableRegistry, SiLookupTypeId } from '../../interfaces'; +import type { MetadataLatest, SiLookupTypeId } from '../../interfaces'; +import type { PortableRegistry } from '../../metadata'; import type { Registry } from '../../types'; import { flattenUniq } from './flattenUniq'; diff --git a/packages/types/src/types/registry.ts b/packages/types/src/types/registry.ts index ea5cbaff5d..642cdd82af 100644 --- a/packages/types/src/types/registry.ts +++ b/packages/types/src/types/registry.ts @@ -5,11 +5,11 @@ import type { Observable } from 'rxjs'; import type { BN } from '@polkadot/util'; import type { CreateOptions } from '../create/types'; import type { ExtDef } from '../extrinsic/signedExtensions/types'; -import type { MetadataLatest, PortableRegistry } from '../interfaces/metadata'; +import type { MetadataLatest } from '../interfaces/metadata'; import type { CodecHash, Hash } from '../interfaces/runtime'; import type { SiField, SiLookupTypeId } from '../interfaces/scaleInfo'; import type { ChainProperties } from '../interfaces/system'; -import type { Metadata } from '../metadata'; +import type { Metadata, PortableRegistry } from '../metadata'; import type { CallFunction } from './calls'; import type { Codec, Constructor } from './codec'; import type { DefinitionRpc, DefinitionRpcSub } from './definitions';