Function useMintNFT

  • Beta

    Mint an NFT to a specific wallet

    Type Parameters

    Parameters

    Returns UseMutationResult<MintNFTReturnType<TContract>, unknown, MintNFTParams, unknown>

    a mutation object that can be used to mint a new NFT token to the connected 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>
    );
    };

    Twfeature

    ERC721Mintable | ERC1155Mintable

    See

    Documentation

Generated using TypeDoc