Erc721
Standard ERC721 NFT functions
Basic functionality for a ERC721 contract that handles IPFS storage for you.
const contract = await sdk.getContract("{{contract_address}}");await contract.erc721.transfer(walletAddress, tokenId);
class Erc721< T extends | Multiwrap | SignatureDrop | DropERC721 | TokenERC721 | BaseERC721 = BaseERC721, > implements UpdateableNetwork, DetectableFeature {}
function constructor( contractWrapper: ContractWrapper<T>, chainId: number,
Get NFT balance for the currently connected wallet
function balance(): Promise<BigNumber>;
Get NFT balance of a specific wallet
Get a wallets NFT balance (number of NFTs in this contract owned by the wallet).
const walletAddress = "{{wallet_address}}";const balance = await contract.erc721.balanceOf(walletAddress);console.log(balance);
function balanceOf(address: string): Promise<BigNumber>;
Get a single NFT
const tokenId = 0;const nft = await contract.erc721.get(tokenId);
let returnType: | { id: bigint; owner: string | null; tokenURI: string; type: "ERC721"; } | { id: bigint; owner: string | null; supply: bigint; tokenURI: string; type: "ERC1155"; };
The NFT metadata
Get all NFTs
Get all the data associated with every NFT in this contract.
By default, returns the first 100 NFTs, use queryParams to fetch more.
const nfts = await contract.erc721.getAll();console.log(nfts);
function getAll(queryParams?: { count?: number; start?: number;
let returnType: | { id: bigint; owner: string | null; tokenURI: string; type: "ERC721"; } | { id: bigint; owner: string | null; supply: bigint; tokenURI: string; type: "ERC1155"; };
The NFT metadata for all NFTs queried.
Get all NFT owners
const owners = await contract.erc721.getAllOwners();console.log(owners);
function getAllOwners(queryParams?: { count?: number; start?: number;}): Promise<Array<{ owner: string; tokenId: number }>>;
Use contract.erc721.claim.prepare(...args)
instead
Construct a claim transaction without executing it. This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
function getClaimTransaction( destinationAddress: string, quantity: BigNumberish,): Promise<>;
let returnType: Promise<>;
Use contract.erc721.mint.prepare(...args)
instead
Construct a mint transaction without executing it. This is useful for estimating the gas cost of a mint transaction, overriding transaction options and having fine grained control over the transaction execution.
function getMintTransaction(receiver: string, metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<..., ..., ..., ..., ...>]>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<..., ..., ..., ..., ...>]>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<ZodArray<..., ...>, "many">, Array<objectOutputType<..., ..., ...>>, Array<Array<...>>>, ZodArray<ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">, ZodObject<{ }, "strip", ZodUnion<[..., ...]>, objectOutputType<{ }, ZodUnion<...>, "strip">, objectInputType<{ }, ZodUnion<...>, "strip">>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<..., ..., ..., ..., ...>]>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<ZodArray<..., ...>, "many">, Array<objectOutputType<..., ..., ...>>, Array<Array<...>>>, ZodArray<ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">, ZodObject<{ }, "strip", ZodUnion<[..., ...]>, objectOutputType<{ }, ZodUnion<...>, "strip">, objectInputType<{ }, ZodUnion<...>, "strip">>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)) : Promise<Transaction<TransactionResultWithId<NFT>>>
The metadata of the NFT you want to mint
let metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<..., ..., ..., ..., ...>]>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<..., ..., ..., ..., ...>]>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<ZodArray<..., ...>, "many">, Array<objectOutputType<..., ..., ...>>, Array<Array<...>>>, ZodArray<ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">, ZodObject<{ }, "strip", ZodUnion<[..., ...]>, objectOutputType<{ }, ZodUnion<...>, "strip">, objectInputType<{ }, ZodUnion<...>, "strip">>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<..., ..., ..., ..., ...>]>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<ZodArray<..., ...>, "many">, Array<objectOutputType<..., ..., ...>>, Array<Array<...>>>, ZodArray<ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">, ZodObject<{ }, "strip", ZodUnion<[..., ...]>, objectOutputType<{ }, ZodUnion<...>, "strip">, objectInputType<{ }, ZodUnion<...>, "strip">>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)
Get all NFTs owned by a specific wallet
Get all the data associated with the NFTs owned by a specific wallet.
// Address of the wallet to get the NFTs ofconst address = "{{wallet_address}}";const nfts = await contract.erc721.getOwned(address);console.log(nfts);
function getOwned( walletAddress?: string, queryParams?: { count?: number; start?: number },
let returnType: | { id: bigint; owner: string | null; tokenURI: string; type: "ERC721"; } | { id: bigint; owner: string | null; supply: bigint; tokenURI: string; type: "ERC1155"; };
The NFT metadata for all NFTs in the contract.
Get all token ids of NFTs owned by a specific wallet.
function getOwnedTokenIds( walletAddress?: string,): Promise<Array<BigNumber>>;
Get whether this wallet has approved transfers from the given operator
function isApproved( address: string, operator: string,): Promise<boolean>;
Get the current owner of an NFT
function ownerOf(tokenId: BigNumberish): Promise<string>;
Get the total count NFTs minted in this contract
function totalCirculatingSupply(): Promise<BigNumber>;
Get the claimed supply
Get the number of claimed NFTs in this Drop.
const claimedNFTCount = await contract.totalClaimedSupply();console.log(`NFTs claimed: ${claimedNFTCount}`);
function totalClaimedSupply(): Promise<BigNumber>;
Get the total number of NFTs minted
This returns the total number of NFTs minted in this contract, not the total supply of a given token.
const count = await contract.erc721.totalCount();console.log(count);
function totalCount(): Promise<BigNumber>;
Get the unclaimed supply
Get the number of unclaimed NFTs in this Drop.
const unclaimedNFTCount = await contract.totalUnclaimedSupply();console.log(`NFTs left to claim: ${unclaimedNFTCount}`);
function totalUnclaimedSupply(): Promise<BigNumber>;
function update(tokenId: BigNumberish, metadata: objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{ data: ...; name: ... }, "strip", ZodTypeAny, { data?: ...; name: ... }, { data?: ...; name: ... }>]>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{ data: ...; name: ... }, "strip", ZodTypeAny, { data?: ...; name: ... }, { data?: ...; name: ... }>]>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, "many">, Array<objectOutputType<{ }, ZodUnion<...>, "strip">>, Array<Array<objectInputType<..., ..., ...>>>>, ZodArray<ZodObject<{ }, "strip", ZodUnion<[..., ...]>, objectOutputType<{ }, ZodUnion<...>, "strip">, objectInputType<{ }, ZodUnion<...>, "strip">>, "many">, ZodObject<{ }, "strip", ZodUnion<[ZodEffects<..., ..., ...>, ZodUnknown]>, objectOutputType<{ }, ZodUnion<[..., ...]>, "strip">, objectInputType<{ }, ZodUnion<[..., ...]>, "strip">>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{ data: ...; name: ... }, "strip", ZodTypeAny, { data?: ...; name: ... }, { data?: ...; name: ... }>]>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, "many">, Array<objectOutputType<{ }, ZodUnion<...>, "strip">>, Array<Array<objectInputType<..., ..., ...>>>>, ZodArray<ZodObject<{ }, "strip", ZodUnion<[..., ...]>, objectOutputType<{ }, ZodUnion<...>, "strip">, objectInputType<{ }, ZodUnion<...>, "strip">>, "many">, ZodObject<{ }, "strip", ZodUnion<[ZodEffects<..., ..., ...>, ZodUnknown]>, objectOutputType<{ }, ZodUnion<[..., ...]>, "strip">, objectInputType<{ }, ZodUnion<[..., ...]>, "strip">>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">) : Promise<Omit<TransactionResultWithMetadata<unknown>, "data">>
let metadata: objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{ data: ...; name: ... }, "strip", ZodTypeAny, { data?: ...; name: ... }, { data?: ...; name: ... }>]>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{ data: ...; name: ... }, "strip", ZodTypeAny, { data?: ...; name: ... }, { data?: ...; name: ... }>]>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, "many">, Array<objectOutputType<{ }, ZodUnion<...>, "strip">>, Array<Array<objectInputType<..., ..., ...>>>>, ZodArray<ZodObject<{ }, "strip", ZodUnion<[..., ...]>, objectOutputType<{ }, ZodUnion<...>, "strip">, objectInputType<{ }, ZodUnion<...>, "strip">>, "many">, ZodObject<{ }, "strip", ZodUnion<[ZodEffects<..., ..., ...>, ZodUnknown]>, objectOutputType<{ }, ZodUnion<[..., ...]>, "strip">, objectInputType<{ }, ZodUnion<[..., ...]>, "strip">>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[ZodTypeAny, ZodObject<{ data: ...; name: ... }, "strip", ZodTypeAny, { data?: ...; name: ... }, { data?: ...; name: ... }>]>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, "many">, Array<objectOutputType<{ }, ZodUnion<...>, "strip">>, Array<Array<objectInputType<..., ..., ...>>>>, ZodArray<ZodObject<{ }, "strip", ZodUnion<[..., ...]>, objectOutputType<{ }, ZodUnion<...>, "strip">, objectInputType<{ }, ZodUnion<...>, "strip">>, "many">, ZodObject<{ }, "strip", ZodUnion<[ZodEffects<..., ..., ...>, ZodUnknown]>, objectOutputType<{ }, ZodUnion<[..., ...]>, "strip">, objectInputType<{ }, ZodUnion<[..., ...]>, "strip">>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">
function burn(tokenId: BigNumberish): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling burn.prepare()
with same arguments.Learn more
function cancel(tokenId: BigNumberish): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling cancel.prepare()
with same arguments.Learn more
function claim( quantity: BigNumberish,): Promise<TResult>;
let returnType: Promise<TResult>;
an array of results containing the id of the token claimed, the transaction receipt and a promise to optionally fetch the nft metadata
Preparable
You can also prepare the transaction without executing it by calling claim.prepare()
with same arguments.Learn more
function claimTo( destinationAddress: string, quantity: BigNumberish,): Promise<TResult>;
let returnType: Promise<TResult>;
an array of results containing the id of the token claimed, the transaction receipt and a promise to optionally fetch the nft metadata
Preparable
You can also prepare the transaction without executing it by calling claimTo.prepare()
with same arguments.Learn more
function lazyMint(metadatas: Array<string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)>, options: { onProgress: (event: UploadProgressEvent) => void }) : Promise<TResult>
let metadatas: Array<string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)>
Preparable
You can also prepare the transaction without executing it by calling lazyMint.prepare()
with same arguments.Learn more
function mint(metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<...>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<..., ..., ...>, ZodArray<..., ...>, ZodObject<..., ..., ..., ..., ...>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<..., ..., ...>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<...>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<..., ..., ...>, ZodArray<..., ...>, ZodObject<..., ..., ..., ..., ...>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)) : Promise<TResult>
let metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<...>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<..., ..., ...>, ZodArray<..., ...>, ZodObject<..., ..., ..., ..., ...>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<..., ..., ...>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<...>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<..., ..., ...>, ZodArray<..., ...>, ZodObject<..., ..., ..., ..., ...>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)
Preparable
You can also prepare the transaction without executing it by calling mint.prepare()
with same arguments.Learn more
function mintBatch(metadatas: Array<string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)>) : Promise<TResult>
let metadatas: Array<string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)>
Preparable
You can also prepare the transaction without executing it by calling mintBatch.prepare()
with same arguments.Learn more
function mintBatchTo(receiver: string, metadatas: Array<string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)>) : Promise<TResult>
let metadatas: Array<string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)>
Preparable
You can also prepare the transaction without executing it by calling mintBatchTo.prepare()
with same arguments.Learn more
function mintTo(receiver: string, metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<...>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<..., ..., ...>, ZodArray<..., ...>, ZodObject<..., ..., ..., ..., ...>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<..., ..., ...>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<...>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<..., ..., ...>, ZodArray<..., ...>, ZodObject<..., ..., ..., ..., ...>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)) : Promise<TResult>
let metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<...>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<...>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<..., ..., ...>, ZodArray<..., ...>, ZodObject<..., ..., ..., ..., ...>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<..., ..., ...>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<...>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<..., ..., ...>, ZodArray<..., ...>, ZodObject<..., ..., ..., ..., ...>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)
Preparable
You can also prepare the transaction without executing it by calling mintTo.prepare()
with same arguments.Learn more
function revoke(tokenId: BigNumberish): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling revoke.prepare()
with same arguments.Learn more
function setApprovalForAll( operator: string, approved: boolean,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling setApprovalForAll.prepare()
with same arguments.Learn more
function transfer( to: string, tokenId: BigNumberish,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling transfer.prepare()
with same arguments.Learn more
function transferFrom( from: string, to: string, tokenId: BigNumberish,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling transferFrom.prepare()
with same arguments.Learn more
function updateMetadata(tokenId: BigNumberish, metadata: objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<..., ...>, Array<...>, Array<...>>, ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<..., ...>, Array<...>, Array<...>>, ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">) : Promise<TResult>
let metadata: objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<..., ...>, Array<...>, Array<...>>, ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<..., ...>, Array<...>, Array<...>>, ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">
Preparable
You can also prepare the transaction without executing it by calling updateMetadata.prepare()
with same arguments.Learn more
let featureName: "ERC721";
let chainId: number;
Configure claim conditions
Define who can claim NFTs in the collection, when and how many.
const presaleStartTime = new Date();const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);const claimConditions = [ { startTime: presaleStartTime, // start the presale now maxClaimableSupply: 2, // limit how many mints for this presale price: 0.01, // presale price snapshot: ['0x...', '0x...'], // limit minting to only certain addresses }, { startTime: publicSaleStartTime, // 24h after presale, start public sale price: 0.08, // public sale price }]);await contract.erc721.claimConditions.set(claimConditions);
Mint delayed reveal NFTs
Create a batch of encrypted NFTs that can be revealed at a later time.
// the real NFTs, these will be encrypted until you reveal themconst 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, and will be converted to the real NFT at reveal timeconst placeholderNFT = { name: "Hidden NFT", description: "Will be revealed next week!",};// Create and encrypt the NFTsawait contract.erc721.revealer.createDelayedRevealBatch( placeholderNFT, realNFTs, "my secret password",);// Whenever you're ready, reveal your NFTs at any timeconst batchId = 0; // the batch to revealawait contract.erc721.revealer.reveal(batchId, "my secret password");
Set shared metadata for all NFTs
Set shared metadata for all NFTs in the collection. (Open Edition)
let sharedMetadata: Erc721SharedMetadata;
// defiine the metadataconst metadata = { name: "Shared Metadata", description: "Every NFT in this collection will share this metadata.",}; const tx = contract.erc721.sharedMetadata.set(metadata);
Mint with signature
Generate dynamic NFTs with your own signature, and let others mint them using that signature.
// see how to craft a payload to sign in the `contract.erc721.signature.generate()` documentationconst signedPayload = await contract.erc721.signature.generate(payload); // now anyone can mint the NFTconst tx = await contract.erc721.signature.mint(signedPayload);const receipt = tx.receipt; // the mint transaction receiptconst mintedId = tx.id; // the id of the NFT minted
Tiered Drop
Drop lazy minted NFTs using a tiered drop mechanism.
let tieredDrop: Erc721TieredDrop;