Mint ERC1155 NFTs

Remarks

NFT minting functionality that handles IPFS storage for you.

Example

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

Hierarchy

  • Erc1155Mintable

Implements

  • DetectableFeature

Constructors

Properties

additionalSupplyTo: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Increase the supply of an existing NFT and mint it to a given wallet address

      Parameters

      • Rest ...args: [to: string, tokenId: BigNumberish, additionalSupply: BigNumberish]

      Returns Promise<TResult>

      Example

      // Address of the wallet you want to mint the NFT to
      const toAddress = "{{wallet_address}}"
      const tokenId = 0;
      const additionalSupply = 1000;

      const tx = await contract.edition.mint.additionalSupplyTo(toAddress, tokenId, additionalSupply);
  • prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>)
batch: undefined | Erc1155BatchMintable

Batch mint Tokens to many addresses

contractWrapper: ContractWrapper<IMintableERC1155>
erc1155: Erc1155<BaseERC1155 | BaseSignatureMintERC1155>
featureName: "ERC1155Mintable" = FEATURE_EDITION_MINTABLE.name
storage: ThirdwebStorage<IpfsUploadBatchOptions>
to: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithId<NFT>>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Mint an NFT with a limited supply

      Parameters

      • Rest ...args: [to: string, metadataWithSupply: {
            metadata: Object;
            supply: Object;
        }]

      Returns Promise<TResult>

      Remarks

      Mint an NFT with a limited supply to a specified wallet.

      Example

      // Address of the wallet you want to mint the NFT to
      const toAddress = "{{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 metadataWithSupply = {
      metadata,
      supply: 1000, // The number of this NFT you want to mint
      }

      const tx = await contract.edition.mint.to(toAddress, metadataWithSupply);
      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>>>)

Methods

  • Parameters

    • to: string
    • metadataWithSupply: {
          metadata: Object;
          supply: Object;
      }
      • metadata: Object
      • supply: Object

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

    Deprecated

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

Generated using TypeDoc