ERC721BatchMintable
Functionality available for contracts that implement the
IERC721
,
IMintableERC721
, and
IMulticall
interfaces.
Allows you to mint multiple NFTs at once to a wallet.
By default, the NFT metadata is uploaded and pinned to IPFS before minting. You can override this default behavior by providing an array of URLs as string
s
that point to valid metadata objects.
mintBatchTo
Mint multiple NFTs to a specified wallet address.
// Address of the wallet you want to mint the NFT to
const walletAddress = "{{wallet_address}}";
// Custom metadata of the NFTs you want to mint.
const metadatas = [
{
name: "Cool NFT #1",
description: "This is a cool NFT",
image: "https://example.com/image.png", // URL, IPFS URI, or File object
// ... Any other metadata you want to include
},
{
name: "Cool NFT #2",
description: "This is a cool NFT",
image: "https://example.com/image.png", // URL, IPFS URI, or File object
// ... Any other metadata you want to include
},
];
const tx = await contract.erc721.mintBatchTo(walletAddress, metadatas);
Configuration
receiver
The wallet address to mint the NFTs to.
Must be a string
.
const metadatas = [
// ...
];
const tx = await contract.erc721.mintBatchTo(
"{{wallet_address}}",
metadatas,
);
metadatas
An array of metadata objects for the NFTs you want to mint.
Must be an array
of object
s that conform to the metadata standards.
Alternatively, you can provide an array of string
s that point to valid metadata objects,
to override the default behavior of uploading and pinning the metadata to IPFS (shown below).
const metadatas = [
"https://example.com/metadata1.json",
"ipfs://my-ipfs-hash",
"https://some-other-url.com/metadata2.json",
];
const tx = await contract.erc721.mintBatchTo(
"{{wallet_address}}",
metadatas,
);