11// Copyright 2017-2021 @polkadot/api-contract authors & contributors
22// SPDX-License-Identifier: Apache-2.0
33
4- import type { Bytes , PortableRegistry } from '@polkadot/types' ;
5- import type { ChainProperties , ContractConstructorSpecLatest , ContractEventSpecLatest , ContractMessageParamSpecLatest , ContractMessageSpecLatest , ContractMetadataLatest , ContractProjectInfo } from '@polkadot/types/interfaces' ;
4+ import type { Bytes } from '@polkadot/types' ;
5+ import type { ChainProperties , ContractConstructorSpecLatest , ContractEventSpecLatest , ContractMessageParamSpecLatest , ContractMessageSpecLatest , ContractMetadata , ContractMetadataLatest , ContractProjectInfo } from '@polkadot/types/interfaces' ;
66import type { Codec , Registry } from '@polkadot/types/types' ;
77import type { AbiConstructor , AbiEvent , AbiMessage , AbiParam , DecodedEvent , DecodedMessage } from '../types' ;
88
@@ -36,7 +36,7 @@ function getLatestMeta (registry: Registry, json: Record<string, unknown>): Cont
3636 : isObject ( json . V1 )
3737 ? { V1 : json . V1 }
3838 : { V0 : json }
39- ) ;
39+ ) as unknown as ContractMetadata ;
4040
4141 return metadata . isV2
4242 ? metadata . asV2
@@ -47,9 +47,9 @@ function getLatestMeta (registry: Registry, json: Record<string, unknown>): Cont
4747
4848function parseJson ( json : Record < string , unknown > , chainProperties ?: ChainProperties ) : [ Record < string , unknown > , Registry , ContractMetadataLatest , ContractProjectInfo ] {
4949 const registry = new TypeRegistry ( ) ;
50- const info = registry . createType ( 'ContractProjectInfo' , json ) ;
50+ const info = registry . createType ( 'ContractProjectInfo' , json ) as unknown as ContractProjectInfo ;
5151 const latest = getLatestMeta ( registry , json ) ;
52- const lookup = registry . createType < PortableRegistry > ( 'PortableRegistry' , { types : latest . types } ) ;
52+ const lookup = registry . createType ( 'PortableRegistry' , { types : latest . types } ) ;
5353
5454 // attach the lookup to the registry - now the types are known
5555 registry . setLookup ( lookup ) ;
0 commit comments