import { generateInterfaceTypes } from '@polkadot/typegen/generate/interfaceRegistry' ; import { generateTsDef } from '@polkadot/typegen/generate/tsDef' ; import { generateDefaultConsts , generateDefaultQuery , generateDefaultTx , generateDefaultRpc } from '@polkadot/typegen/generate' ; import metadata from '../src/metadata/static-latest' ; import * as defaultDefinations from '@polkadot/types/interfaces/definitions' ; import * as ormlDefinations from '@open-web3/orml-types/interfaces/definitions' ; import * as acalaDefinations from '../src/interfaces/definitions' ; const { runtime , ... substrateDefinations } = defaultDefinations ; const { runtime : _runtime , ... ormlModulesDefinations } = ormlDefinations ; const definations = { '@polkadot/types/interfaces' : substrateDefinations , '@open-web3/orml-types/interfaces' : ormlModulesDefinations , '@acala-network/types/interfaces' : acalaDefinations } as any ; const customLookupDefinitions = { rpc : { } , types : require ( '../src/interfaces/lookup.ts' ) . default } as Definitions ; generateTsDef ( definations , 'packages/types/src/interfaces' , '@acala-network/types/interfaces' ) ; generateInterfaceTypes ( definations , 'packages/types/src/interfaces/augment-types.ts' ) ; generateDefaultConsts ( 'packages/types/src/interfaces/augment-api-consts.ts' , metadata , definations , false , customLookupDefinitions ) ; generateDefaultTx ( 'packages/types/src/interfaces/augment-api-tx.ts' , metadata , definations , false , customLookupDefinitions ) ; generateDefaultRpc ( 'packages/types/src/interfaces/augment-api-rpc.ts' , definations ) ;