Skip to main content

ERC721 Standard

You can utilize these features of the SDK if your contract implements the ERC721 standard.

View NFT Balance

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

const walletAddress = "{{wallet_address}}";
const balance = await contract.erc721.balanceOf(walletAddress);
console.log(balance);

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Get NFT Metadata

Read the URI this NFT points to and fetch that data automatically.

If the metadata is stored on IPFS, this function uses our IPFS gateway (or the one you specify) to read the data.

const tokenId = 0;
const nft = await contract.erc721.get(tokenId);

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation

Transfer NFT

Transfer an NFT from the connected wallet to another wallet.

const walletAddress = "{{wallet_address}}";
const tokenId = 0;
await contract.erc721.transfer(walletAddress, tokenId);

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation