Private
contractMint a dynamically generated NFT
Rest
...args: [signedPayload: SignedPayload721WithQuantitySignature]Mint a dynamic NFT with a previously generated signature.
// see how to craft a payload to sign in the `generate()` documentation
const signedPayload = contract.erc721.signature.generate(payload);
// now anyone can mint the NFT
const tx = contract.erc721.signature.mint(signedPayload);
const receipt = tx.receipt; // the mint transaction receipt
const mintedId = tx.id; // the id of the NFT minted
ERC721SignatureMint
Rest
...args: [signedPayload: SignedPayload721WithQuantitySignature]Mint any number of dynamically generated NFT at once
Rest
...args: [signedPayloads: SignedPayload721WithQuantitySignature[]]Mint multiple dynamic NFTs in one transaction. Note that this is only possible for free mints (cannot batch mints with a price attached to it for security reasons)
ERC721SignatureMint
Rest
...args: [signedPayloads: SignedPayload721WithQuantitySignature[]]Private
storageGenerate a signature that can be used to mint a dynamic NFT
the payload to sign
Optional
currencyOptional
metadata?: string | objectInputType<({ name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; ... 5 more ...; attributes: ZodNullable<...>; }), ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | BN | BigNumber>, ZodUnknown]>, "strip">Optional
mintOptional
mintOptional
price?: string | numberOptional
primaryOptional
quantity?: string | number | bigint | BigNumberOptional
royaltyOptional
royaltyOptional
uid?: stringthe signed payload and the corresponding signature
Takes in an NFT and some information about how it can be minted, uploads the metadata and signs it with your private key. The generated signature can then be used to mint an NFT using the exact payload and signature generated.
const nftMetadata = {
name: "Cool NFT #1",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
};
const startTime = new Date();
const endTime = new Date(Date.now() + 60 * 60 * 24 * 1000);
const payload = {
metadata: nftMetadata, // The NFT to mint
to: {{wallet_address}}, // Who will receive the NFT
quantity: 2, // the quantity of NFTs to mint
price: 0.5, // the price per NFT
currencyAddress: NATIVE_TOKEN_ADDRESS, // the currency to pay with
mintStartTime: startTime, // can mint anytime from now
mintEndTime: endTime, // to 24h from now
royaltyRecipient: "0x...", // custom royalty recipient for this NFT
royaltyBps: 100, // custom royalty fees for this NFT (in bps)
primarySaleRecipient: "0x...", // custom sale recipient for this NFT
};
const signedPayload = await contract.erc721.signature.generate(payload);
// now anyone can use these to mint the NFT using `contract.erc721.signature.mint(signedPayload)`
ERC721SignatureMint
Genrate a batch of signatures that can be used to mint many dynamic NFTs.
the payloads to sign
an array of payloads and signatures
Private
isPrivate
mapVerify that a payload is correctly signed
the payload to verify
ERC721SignatureMint
const nftMetadata = {
name: "Cool NFT #1",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
};
const startTime = new Date();
const endTime = new Date(Date.now() + 60 * 60 * 24 * 1000);
const payload = {
metadata: nftMetadata, // The NFT to mint
to: {{wallet_address}}, // Who will receive the NFT
quantity: 2, // the quantity of NFTs to mint
price: 0.5, // the price per NFT
currencyAddress: NATIVE_TOKEN_ADDRESS, // the currency to pay with
mintStartTime: startTime, // can mint anytime from now
mintEndTime: endTime, // to 24h from now
royaltyRecipient: "0x...", // custom royalty recipient for this NFT
royaltyBps: 100, // custom royalty fees for this NFT (in bps)
primarySaleRecipient: "0x...", // custom sale recipient for this NFT
};
const signedPayload = await contract.erc721.signature.generate(payload);
// Now you can verify if the signed payload is valid
const isValid = await contract.erc721.signature.verify(signedPayload);
Generated using TypeDoc
Enables generating dynamic ERC721 NFTs with rules and an associated signature, which can then be minted by anyone securely