Skip to main content

NFTCollection class

Create a collection of one-of-one NFTs.

Example

import { ThirdwebSDK } from "@thirdweb-dev/sdk";

const sdk = new ThirdwebSDK("{{chainName}}");
const contract = sdk.getNFTCollection("{{contract_address}}");

Constructors

ConstructorModifiersDescription
(constructor)(network, address, storage, options, contractWrapper)Constructs a new instance of the NFTCollection class

Properties

PropertyModifiersTypeDescription
contractAbistaticany
contractRolesstaticreadonly ["admin", "minter", "transfer"]
contractTypestatic"nft-collection"
encoderContractEncoder<TokenERC721>
estimatorGasCostEstimator<TokenERC721>
eventsContractEvents<TokenERC721>
metadataContractMetadata<TokenERC721, typeof NFTCollection.schema>
platformFeesContractPlatformFee<TokenERC721>
rolesContractRoles<TokenERC721, typeof NFTCollection.contractRoles[number]>
royaltiesContractRoyalty<TokenERC721, typeof NFTCollection.schema>Configure royalties
salesContractPrimarySale<TokenERC721>
signatureErc721WithQuantitySignatureMintableSignature Minting

Methods

MethodModifiersDescription
burnToken(tokenId)Burn a single NFT
getAll(queryParams)Get All Minted NFTs
getOwned(walletAddress)Get Owned NFTs
getOwnedTokenIds(walletAddress)Get all token ids of NFTs owned by a specific wallet.
isTransferRestricted()Get whether users can transfer NFTs from this contract
mintBatch(metadata)Mint Many unique NFTs
mintBatchTo(walletAddress, metadata)Mint Many unique NFTs
mintTo(walletAddress, metadata)Mint a unique NFT
mintToSelf(metadata)Mint a unique NFT
totalSupply()Get the total count NFTs minted in this contract

Signature:

export declare class NFTCollection extends Erc721<TokenERC721>

Extends: Erc721<TokenERC721