typescript-sdk

Home > @3rdweb/sdk > PackModule > balanceOf

PackModule.balanceOf() method

Get Pack Balance

Signature:

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

Parameters

Parameter Type Description
address string  
tokenId string  

Returns:

Promise<BigNumber>

Remarks

Get a wallets pack balance (number of a specific packs in this module owned by the wallet).

Example

// Address of the wallet to check pack balance
const address = """;
// The token ID of the pack you want to check the wallets balance of
const tokenId = "0"

const balance = await module.balanceOf(address, tokenId);
console.log(balance);