Mint ERC721 NFTs

Remarks

NFT minting functionality that handles IPFS storage for you.

Example

const contract = await sdk.getContract("{{contract_address}}");
await contract.nft.mint.to(walletAddress, nftMetadata);

Hierarchy

  • Erc721Mintable

Implements

  • DetectableFeature

Constructors

Properties

batch: undefined | Erc721BatchMintable
contractWrapper: ContractWrapper<IMintableERC721>
erc721: Erc721<BaseERC721>
featureName: "ERC721Mintable" = FEATURE_NFT_MINTABLE.name
storage: ThirdwebStorage<IpfsUploadBatchOptions>
to: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Mint a unique NFT

      Parameters

      • Rest ...args: [to: string, metadata: string | objectInputType<{
            animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                data: ZodUnion<[ZodTypeAny, ZodString]>;
                name: ZodString;
            }, "strip", ZodTypeAny, {
                data?: any;
                name: string;
            }, {
                data?: any;
                name: string;
            }>]>, ZodString]>>>;
            attributes: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
            background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>;
            description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>;
            external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                data: ZodUnion<[ZodTypeAny, ZodString]>;
                name: ZodString;
            }, "strip", ZodTypeAny, {
                data?: any;
                name: string;
            }, {
                data?: any;
                name: string;
            }>]>, ZodString]>>>;
            image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                data: ZodUnion<[ZodTypeAny, ZodString]>;
                name: ZodString;
            }, "strip", ZodTypeAny, {
                data?: any;
                name: string;
            }, {
                data?: any;
                name: string;
            }>]>, ZodString]>>>;
            name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>;
            properties: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
        }, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">]

      Returns Promise<TResult>

      Remarks

      Mint a unique NFT to a specified wallet.

      Example

      // Address of the wallet you want to mint the NFT to
      const walletAddress = "{{wallet_address}}";

      // Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
      const metadata = {
      name: "Cool NFT",
      description: "This is a cool NFT",
      image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
      };

      const tx = await contract.nft.mint.to(walletAddress, metadata);
      const receipt = tx.receipt; // the transaction receipt
      const tokenId = tx.id; // the id of the NFT minted
      const nft = await tx.data(); // (optional) fetch details of minted NFT
  • prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>)
      • (...args): Promise<Transaction<TransactionResultWithId<NFT>>>
      • Parameters

        • Rest ...args: [to: string, metadata: string | objectInputType<{
              animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                  data: ZodUnion<[ZodTypeAny, ZodString]>;
                  name: ZodString;
              }, "strip", ZodTypeAny, {
                  data?: any;
                  name: string;
              }, {
                  data?: any;
                  name: string;
              }>]>, ZodString]>>>;
              attributes: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
              background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>;
              description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>;
              external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                  data: ZodUnion<[ZodTypeAny, ZodString]>;
                  name: ZodString;
              }, "strip", ZodTypeAny, {
                  data?: any;
                  name: string;
              }, {
                  data?: any;
                  name: string;
              }>]>, ZodString]>>>;
              image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
                  data: ZodUnion<[ZodTypeAny, ZodString]>;
                  name: ZodString;
              }, "strip", ZodTypeAny, {
                  data?: any;
                  name: string;
              }, {
                  data?: any;
                  name: string;
              }>]>, ZodString]>>>;
              name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>;
              properties: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
          }, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">]

        Returns Promise<Transaction<TransactionResultWithId<NFT>>>

Methods

  • Parameters

    • to: string
    • metadata: string | objectInputType<{
          animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
              data: ZodUnion<[ZodTypeAny, ZodString]>;
              name: ZodString;
          }, "strip", ZodTypeAny, {
              data?: any;
              name: string;
          }, {
              data?: any;
              name: string;
          }>]>, ZodString]>>>;
          attributes: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
          background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>;
          description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>;
          external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
              data: ZodUnion<[ZodTypeAny, ZodString]>;
              name: ZodString;
          }, "strip", ZodTypeAny, {
              data?: any;
              name: string;
          }, {
              data?: any;
              name: string;
          }>]>, ZodString]>>>;
          image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{
              data: ZodUnion<[ZodTypeAny, ZodString]>;
              name: ZodString;
          }, "strip", ZodTypeAny, {
              data?: any;
              name: string;
          }, {
              data?: any;
              name: string;
          }>]>, ZodString]>>>;
          name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>;
          properties: ZodNullable<ZodOptional<ZodUnion<[ZodArray<ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>, "many">, ZodObject<{}, "strip", ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, objectOutputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">, objectInputType<{}, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">>]>>>;
      }, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">

    Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

    Deprecated

    Use contract.erc721.mint.prepare(...args) instead

Generated using TypeDoc