ERC721TieredDrop
Functionality available for contracts that implement the
IERC721
interface and
TieredDrop
contract.
claimWithSignature
Use a signature generated by an authorized wallet with the MINTER
permission to
claim an NFT from the drop.
See generate
for more information on how to generate a signed payload.
// ... Logic to generate signed payload from an authorized wallet (on server-side)
// Use the signed payload to claim an NFT (on client-side)
const txResult = await contract.erc721.tieredDrop.claimWithSignature(
signedPayload, // Type: TieredDropPayloadWithSignature
);
Configuration
createBatchWithTier
Lazy mint a new batch of NFTs into a tier.
By default, the NFT metadata is uploaded and pinned to IPFS before lazy minting.
You can override this default behavior by providing a string
that points to valid
metadata object instead of an object.
The metadata object can either be a string that points to valid metadata that conforms to the metadata standards, or an object that conforms to the same standards.
const txResult = await contract.erc721.tieredDrop.createBatchWithTier(
[
{
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: "ipfs://...", // URL, IPFS URI, or File object
// ... Any other metadata you want to include
},
],
"tier-name", // Name of the tier to add the NFTs to
);
Configuration
createDelayedRevealBatchWithTier
The same as createBatchWithTier
, but the batch is uploaded with a delayed
reveal, meaning the NFTs will have placeholder metadata until you reveal
them.
const txResult =
await contract.erc721.tieredDrop.createDelayedRevealBatchWithTier(
{
name: "Hidden NFT",
description: "Will be revealed next week!",
},
[
{
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: "ipfs://...", // URL, IPFS URI, or File object
// ... Any other metadata you want to include
},
],
"my secret password", // Password to reveal the NFTs
"tier-name", // Name of the tier to add the NFTs to
);
Configuration
generate
Generate a signed payload that can be used to claim an NFT from the drop.
const txResult = await contract.erc721.tieredDrop.generate({
tierPriority: ["tier-name"], // (Required) the tier(s) to allow the user to claim from
to: "{{wallet_address}}", // (Required) the wallet to mint the tokens to
currencyAddress: "{{currency_contract_address}}", // (Optional) the currency to pay with
price: 0.5, // (Optional) the price to pay for minting those tokens (in the currency above)
mintStartTime: new Date(), // (Optional) can mint anytime from now
mintEndTime: new Date(Date.now() + 60 * 60 * 24 * 1000), // (Optional) to 24h from now,
primarySaleRecipient: "0x...", // (Optional) custom sale recipient for this token mint
quantity: "{{quantity}}", // (Optional) the quantity to mint
royaltyBps: 100, // (Optional) the royalty fee on secondary sales (in bps: i.e. 100 = 1%)
royaltyRecipient: "{{wallet_address}}", // (Optional) the royalty recipient on secondary sales
});
Configuration
generateBatch
The same as generate
, but allows you to generate multiple signatures at once.
const signedPayloads = await contract.erc721.tieredDrop.generateBatch([
{
tierPriority: ["tier-name"],
to: "{{wallet_address}}",
},
{
tierPriority: ["tier-name"],
to: "{{wallet_address}}",
},
]);
Configuration
getMetadataInTier
Get the metadata of NFTs in a tier.
const metadatas = await contract.erc721.tieredDrop.getMetadataInTier(
"tier-name",
);
Configuration
getTokensInTier
Get the information about NFTs in a tier.
const tokens = await contract.erc721.tieredDrop.getTokensInTier("tier-name");
Configuration
reveal
Reveal a batch of NFTs that were lazy minted with
createDelayedRevealBatchWithTier
.
const txResult = await contract.erc721.tieredDrop.reveal(
"{{batch_id}}", // ID of the batch to reveal
"my secret password", // The password used to reveal the batch
);
Configuration
verify
Verify that a payload is correctly signed.
This allows you to provide a payload, and prove that it was valid and was generated by a wallet with permission to generate signatures.
// Provide the generated payload to verify that it is valid
const isValid = await contract.erc721.tieredDrop.verify(payload);