Skip to content

getOwnedNFT

Returns token ids of owned tokens for the provided address. The function implements calls the standard balanceOf and tokenOfOwnerByIndex functions of ERC20, ERC721 and ERC1155 standards.

ParamDescription
contractAddressesArray of contract addresses
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.getOwnedNFT(contractAddresses, walletAddress);
};

Returns

Object with contract addresses as keys and array of token ids as values.