Skip to main content

Erc1155.balanceOf() method

Get NFT Balance

Example

// Address of the wallet to check NFT balance
const walletAddress = "{{wallet_address}}";
const tokenId = 0; // Id of the NFT to check
const balance = await contract.balanceOf(walletAddress, tokenId);

Signature:

balanceOf(address: string, tokenId: BigNumberish): Promise<BigNumber>;

Parameters

ParameterTypeDescription
addressstring
tokenIdBigNumberish

Returns:

Promise<BigNumber>

Remarks

Get a wallets NFT balance (number of NFTs in this contract owned by the wallet).