Optional
roles: ContractRoles<TokenERC1155, "transfer" | "minter" | "admin">Private
contractMint a dynamically generated NFT
Rest
...args: [signedPayload: SignedPayload1155]Mint a dynamic NFT with a previously generated signature.
// see how to craft a payload to sign in the `generate()` documentation
const signedPayload = contract.erc1155.signature.generate(payload);
// now anyone can mint the NFT
const tx = contract.erc1155.signature.mint(signedPayload);
ERC1155SignatureMintable
Rest
...args: [signedPayload: SignedPayload1155]Mint any number of dynamically generated NFT at once
Rest
...args: [signedPayloads: SignedPayload1155[]]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)
// see how to craft a batch of payloads to sign in the `generateBatch()` documentation
const signedPayloads = contract.erc1155.signature.generateBatch(payloads);
// now anyone can mint the NFT
const tx = contract.erc1155.signature.mintBatch(signedPayloads);
ERC1155SignatureMintable
Rest
...args: [signedPayloads: SignedPayload1155[]]Private
rolesPrivate
storageGenerate a signature that can be used to mint an NFT dynamically.
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
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.erc1155.signature.generate(payload);
// now anyone can use these to mint the NFT using `contract.erc1155.signature.mint(signedPayload)`
ERC1155SignatureMintable
Generate a batch of signatures that can be used to mint many new NFTs dynamically.
the payloads to sign
an array of payloads and signatures
Generate a batch of signatures that can be used to mint new NFTs or additionally supply to existing NFTs dynamically.
the payloads to sign with tokenIds specified
an array of payloads and signatures
Generate a signature that can be used to mint additionally supply to an existing 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
royaltyOptional
royaltyOptional
uid?: stringthe signed payload and the corresponding signature
Takes in a payload with the token ID of an existing NFT, and signs it with your private key. The generated signature can then be used to mint additional supply to the 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 = {
tokenId: 0, // Instead of metadata, we specify the token ID of the NFT to mint supply to
to: {{wallet_address}}, // Who will receive the NFT (or AddressZero for anyone)
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.erc1155.signature.generateFromTokenId(payload);
// now anyone can use these to mint the NFT using `contract.erc1155.signature.mint(signedPayload)`
ERC1155SignatureMintable
Verify that a payload is correctly signed
the payload to verify
ERC1155SignatureMintable
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 = contract.erc1155.signature.generate(payload);
// Now you can verify that the payload is valid
const isValid = await contract.erc1155.signature.verify(signedPayload);
Generated using TypeDoc
Enables generating dynamic ERC1155 NFTs with rules and an associated signature, which can then be minted by anyone securely