Docs

mintTo

Mints a "supply" number of new ERC1155 tokens to the specified "to" 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/erc1155";
const transaction = mintTo({
contract,
to: "0x...",
supply: 10n,
nft: {
name: "My NFT",
description: "This is my NFT",
image: "https://example.com/image.png",
},
});
const { transactionHash } = await sendTransaction({
transaction,
account,
});

Parameters

Returns

A promise that resolves to the transaction result.