mintTo

Mints a new ERC721 token and assigns it to the specified address. If the nft parameter is a string, it will be used as the token URI. If the nft parameter is a file, it will be uploaded to the storage server and the resulting URI will be used as the token URI.

Example

import { mintTo } from "thirdweb/extensions/erc721";
import { sendTransaction } from "thirdweb";
const transaction = mintTo({
contract,
to: "0x...",
nft: {
name: "My NFT",
description: "This is my NFT",
image: "https://example.com/image.png",
},
});
await sendTransaction({ transaction, account });

Parameters

Returns

A promise that resolves to the transaction result.