From c1589f5b89985babd8f259e285b46d17e2ec5ac2 Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Fri, 16 Dec 2022 18:25:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A01155=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=BD=99=E9=A2=9D=E7=9A=84=E6=96=B9=E6=B3=95=E6=BC=8F=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 13 +++++++++++++ src/standards/ERC1155Standard.ts | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 2fcd2e4..16fd2a4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -581,6 +581,19 @@ export default class JCWallet { }); } + public async erc1155Balance( + address: string, + account: string, + tokenId: string + ) { + let result = await this.erc1155Standard.getBalanceOf( + address, + account, + tokenId + ); + return result; + } + public async erc1155Info(address: string) {} public async erc1155List(address: string, account?: string) { diff --git a/src/standards/ERC1155Standard.ts b/src/standards/ERC1155Standard.ts index 5ce5f59..ff6a6dd 100644 --- a/src/standards/ERC1155Standard.ts +++ b/src/standards/ERC1155Standard.ts @@ -93,7 +93,7 @@ export class ERC1155Standard { address: string, tokenId: string ): Promise => { - const contract = new this.web3.eth.Contract(abiERC1155, address); + const contract = new this.web3.eth.Contract(abiERC1155, contractAddress); return new Promise((resolve, reject) => { contract.methods.balanceOf( address,