Skip to content

Commit 76e2fb3

Browse files
author
Neo
committed
asset_id fixed
1 parent b662542 commit 76e2fb3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mixin-node-sdk",
3-
"version": "3.0.29",
3+
"version": "3.0.30",
44
"license": "MIT",
55
"main": "dist/index.js",
66
"typings": "dist/index.d.ts",

src/client/mvm.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { TransactionInput, InvokeCodeParams, ExtraGenerateParams, Payment, Payme
22
import { v4 as newUUID, parse, stringify } from 'uuid'
33
import { Encoder } from "../mixin/encoder"
44
import { base64url } from "../mixin/sign"
5-
import { ethers, utils } from "ethers"
5+
import { BigNumber, ethers, utils } from "ethers"
66
import { JsonFragment } from "@ethersproject/abi"
77
import { registryAbi, registryAddress, registryProcess } from "../mixin/mvm_registry"
88
import axios from 'axios'
@@ -114,6 +114,7 @@ export const getContractByUserIDs = (ids: string | string[], threshold?: number,
114114
export 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
122123
export 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

Comments
 (0)