I have the following code now and it works fine. However, it can only mint 1 NFT per time.
await transactionBuilder()
.add(setComputeUnitLimit(umi, { units: 800_000 }))
.add(
mintV2(umi, {
candyMachine: candyMachine.publicKey,
nftMint,
collectionMint: publicKey(candyMachine.collectionMint),
collectionUpdateAuthority: publicKey(candyMachine.authority),
group: some(this.currentStageLabel),
tokenStandard: candyMachine.tokenStandard,
candyGuard: publicKey(candyMachine.mintAuthority),
minter: umi.identity,
mintArgs: {
mintLimit: some({ id: this.nftMaxLimitId }),
solPayment: some({ destination: publicKey(this.treasury) }),
allowList: some({ merkleRoot: getMerkleRoot(allowList) }),
},
})
)
.sendAndConfirm(umi).then(({ signature }) => {
console.log("Signature: ", signature);
sig = signature;
});
How do I mint more than 1 NFT at a time without adding another mintV2 instruction?
Thanks!