Skip to main content

Delayed Reveals

Delayed reveals are a way to show placeholder metadata for NFTs, and use a password to reveal the metadata at a later time.

Currently, delayed reveal is only supported on the NFT Drop contract.

For a step-by-step tutorial on how to set up an NFT Drop with delayed reveal, check out our guide: Release an NFT drop with delayed reveal without writing any code.

Create a delayed reveal

// the real NFTs, these will be encrypted until your reveal them!
const realNFTs = [{
name: "Common NFT #1",
description: "Common NFT, one of many.",
image: fs.readFileSync("path/to/image.png"),
}, {
name: "Super Rare NFT #2",
description: "You got a Super Rare NFT!",
image: fs.readFileSync("path/to/image.png"),
}];
// A placeholder NFT that people will get immediately in their wallet, until the reveal happens!
const placeholderNFT = {
name: "Hidden NFT",
description: "Will be revealed next week!"
};
// Create and encrypt the NFTs
await contract.revealer.createDelayedRevealBatch(
placeholderNFT,
realNFTs,
"my secret password",
);
// Whenever you're ready, reveal your NFTs at any time!
const batchId = 0; // the batch to reveal
await contract.revealer.reveal(batchId, "my secret password");

View Unrevealed Batches

const batches = await contract.revealer.getBatchesToReveal();

Reveal Hidden NFTs

// the batch to reveal
const batchId = 0;
// reveal the batch
await contract.revealer.reveal(batchId, "my secret password");