Skip to main content

useRevealLazyMint

Hook for revealing a batch of delayed reveal NFTs using delayed reveal.

Available to use on contracts that implement the ERC721Revealable or ERC1155Revealable interfaces.

import { useRevealLazyMint } from "@thirdweb-dev/react";

Usage

Provide your contract instance from the useContract hook as an argument.

import {
useContract,
useRevealLazyMint,
Web3Button,
} from "@thirdweb-dev/react";

const contractAddress = "{{contract_address}}";

function App() {
// Contract must be an ERC-721 or ERC-1155 contract that implements the ERC721Revealable or ERC1155Revealable interface
const { contract } = useContract(contractAddress);
const {
mutateAsync: revealLazyMint,
isLoading,
error,
} = useRevealLazyMint(contract);

return (
<Web3Button
contractAddress={contractAddress}
action={() =>
revealLazyMint({
batchId: "{{batch_id}}", // ID of the batch to reveal (use useBatchesToReveal to get the batch IDs)
password: "{{password}}", // Password to reveal the batch
})
}
>
Reveal Lazy Mint
</Web3Button>
);
}