• Beta

    Burn an NFT

    Type Parameters

    Parameters

    Returns UseMutationResult<Omit<{
        data: (() => Promise<unknown>);
        receipt: providers.TransactionReceipt;
    }, "data">, unknown, BurnNFTParams, unknown>

    a mutation object that can be used to burn an NFT token from the connected wallet

    Example

    const Component = () => {
    const { contract } = useContract("{{contract_address}}");
    const {
    mutate: burnNFT,
    isLoading,
    error,
    } = useBurnNFT(contract);

    if (error) {
    console.error("failed to burn NFT", error);
    }

    return (
    <button
    disabled={isLoading}
    onClick={() => burnNFT({ tokenId: 0, amount: 1 })}
    >
    Burn!
    </button>
    );
    };

    Twfeature

    ERC721Burnable | ERC1155Burnable

    See

    Documentation

Generated using TypeDoc