typescript-sdk

Home > @3rdweb/sdk > BundleModule > createAndMint

BundleModule.createAndMint() method

Mint NFT

Signature:

createAndMint(metadataWithSupply: INFTBundleCreateArgs): Promise<BundleMetadata>;

Parameters

Parameter Type Description
metadataWithSupply INFTBundleCreateArgs  

Returns:

Promise<BundleMetadata>

Remarks

Mint an NFT with a specified supply.

Example

// 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: 1, // The number of this NFT you want to mint
}

await module.createAndMint(metadataWithSupply);