Home > @3rdweb/sdk > BundleModule > createAndMint
Mint NFT
Signature:
createAndMint(metadataWithSupply: INFTBundleCreateArgs): Promise<BundleMetadata>;
Parameter | Type | Description |
---|---|---|
metadataWithSupply | INFTBundleCreateArgs |
Returns:
Promise<BundleMetadata>
Mint an NFT with a specified supply.
// 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);