@@ -2,7 +2,7 @@ import { TransactionInput, InvokeCodeParams, ExtraGenerateParams, Payment, Payme
22import { v4 as newUUID , parse , stringify } from 'uuid'
33import { Encoder } from "../mixin/encoder"
44import { base64url } from "../mixin/sign"
5- import { ethers , utils } from "ethers"
5+ import { BigNumber , ethers , utils } from "ethers"
66import { JsonFragment } from "@ethersproject/abi"
77import { registryAbi , registryAddress , registryProcess } from "../mixin/mvm_registry"
88import axios from 'axios'
@@ -114,6 +114,7 @@ export const getContractByUserIDs = (ids: string | string[], threshold?: number,
114114export const getAssetIDByAddress = async ( contract_address : string , processAddress = registryAddress ) : Promise < string > => {
115115 const registry = getRegistryContract ( processAddress )
116116 let res = await registry . assets ( contract_address )
117+ res instanceof BigNumber && ( res = res . _hex )
117118 if ( res . length <= 2 ) return ""
118119 res = res . slice ( 2 )
119120 return stringify ( Buffer . from ( res , 'hex' ) )
@@ -122,6 +123,7 @@ export const getAssetIDByAddress = async (contract_address: string, processAddre
122123export const getUserIDByAddress = async ( contract_address : string , processAddress = registryAddress ) : Promise < string > => {
123124 const registry = getRegistryContract ( processAddress )
124125 let res = await registry . users ( contract_address )
126+ res instanceof BigNumber && ( res = res . _hex )
125127 if ( res . length <= 2 ) return ""
126128 res = res . slice ( 6 )
127129 res = res . slice ( 0 , 32 )
0 commit comments