Skip to content

getTokenBalance

Returns the address' balance of the token for the provided contract address. The function implements calls the standard balanceOf function of ERC20, ERC721 and ERC1155 standards.

ParamDescription
contractAddressContract address
walletAddressOwner's wallet address

Usage

import { BcodeSDK } from "@bcode-tech/bcode-sdk";

const fun = () => {
  const sdk = new BcodeSDK({
    apiKey: "your-api-key",
    config: { env: "MUMBAI" },
  });

  await sdk.getTokenBalance(contractAddress, walletAddress);
};

Returns

Token balance of address for contract address