@@ -2,7 +2,7 @@ import { TransactionInput, InvokeCodeParams, ExtraGenerateParams, Payment, Payme
2
2
import { v4 as newUUID , parse , stringify } from 'uuid'
3
3
import { Encoder } from "../mixin/encoder"
4
4
import { base64url } from "../mixin/sign"
5
- import { ethers , utils } from "ethers"
5
+ import { BigNumber , ethers , utils } from "ethers"
6
6
import { JsonFragment } from "@ethersproject/abi"
7
7
import { registryAbi , registryAddress , registryProcess } from "../mixin/mvm_registry"
8
8
import axios from 'axios'
@@ -114,6 +114,7 @@ export const getContractByUserIDs = (ids: string | string[], threshold?: number,
114
114
export const getAssetIDByAddress = async ( contract_address : string , processAddress = registryAddress ) : Promise < string > => {
115
115
const registry = getRegistryContract ( processAddress )
116
116
let res = await registry . assets ( contract_address )
117
+ res instanceof BigNumber && ( res = res . _hex )
117
118
if ( res . length <= 2 ) return ""
118
119
res = res . slice ( 2 )
119
120
return stringify ( Buffer . from ( res , 'hex' ) )
@@ -122,6 +123,7 @@ export const getAssetIDByAddress = async (contract_address: string, processAddre
122
123
export const getUserIDByAddress = async ( contract_address : string , processAddress = registryAddress ) : Promise < string > => {
123
124
const registry = getRegistryContract ( processAddress )
124
125
let res = await registry . users ( contract_address )
126
+ res instanceof BigNumber && ( res = res . _hex )
125
127
if ( res . length <= 2 ) return ""
126
128
res = res . slice ( 6 )
127
129
res = res . slice ( 0 , 32 )
0 commit comments