useMintNFT
Mint an NFT to a specific wallet
Example
const Component = () => {
const { contract } = useContract("{{contract_address}}");
const { mutate: mintNft, isLoading, error } = useMintNFT(contract);
if (error) {
console.error("failed to mint NFT", error);
}
return (
<button
disabled={isLoading}
onClick={() =>
mintNft({ name: "My awesome NFT!", to: "{{wallet_address}}" })
}
>
Mint!
</button>
);
};
Parameters
Returns
a mutation object that can be used to mint a new NFT token to the connected wallet