Hook to get the quantity a user owns of a specific ERC1155 NFT.
Available to use on smart contracts that implement the ERC1155 standard.
ERC1155
import { useNFTBalance, useContract } from "@thirdweb-dev/react"; function App() { const { contract } = useContract(contractAddress); const { isLoading, data, error } = useNFTBalance( contract, "{{wallet_address}}", "{{token_id}}", );}
The hook's data property, once loaded, returns a BigNumber representing the quantity of the NFT owned by the wallet.
data
BigNumber