typescript-sdk

Home > @3rdweb/sdk > NFTModule > mintTo

NFTModule.mintTo() method

Mint NFT

Signature:

mintTo(to: string, metadata: MetadataURIOrObject): Promise<NFTMetadata>;

Parameters

Parameter Type Description
to string  
metadata MetadataURIOrObject  

Returns:

Promise<NFTMetadata>

Remarks

Mint an NFT to a specified wallet.

Example

// Address of the wallet you want to mint the NFT to
const toAddress = ""

// 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
}

await module.mintTo(toAddress, metadata);