Docs

useNFTBalance

Hook to get the quantity a user owns of a specific ERC1155 NFT.

Available to use on smart contracts that implement the ERC1155 standard.

Example

import { useNFTBalance, useContract } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress);
const { isLoading, data, error } = useNFTBalance(
contract,
"{{wallet_address}}",
"{{token_id}}",
);
}

Parameters

Returns

The hook's data property, once loaded, returns a BigNumber representing the quantity of the NFT owned by the wallet.