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 = await sdk.getContract(
"{{contract_address}}",
"nft-collection",
);

Constructors

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

Properties

PropertyModifiersTypeDescription
abiAbi
contractRolesstaticreadonly ["admin", "minter", "transfer"]
encoderContractEncoder<TokenERC721>
erc721Erc721<TokenERC721>
estimatorGasCostEstimator<TokenERC721>
eventsContractEvents<TokenERC721>
metadataContractMetadata<TokenERC721, typeof TokenErc721ContractSchema>
ownerContractOwner<TokenERC721>
platformFeesContractPlatformFee<TokenERC721>
rolesContractRoles<TokenERC721, typeof NFTCollection.contractRoles[number]>
royaltiesContractRoyalty<TokenERC721, typeof TokenErc721ContractSchema>Configure royalties
salesContractPrimarySale<TokenERC721>
signatureErc721WithQuantitySignatureMintableSignature Minting

Methods

MethodModifiersDescription
burn(tokenId)Burn a single NFT
getAddress()
getMintTransaction(receiver, metadata)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.
isTransferRestricted()Get whether users can transfer NFTs from this contract
mint(metadata)Mint a unique NFT
mintBatch(metadata)Mint Many unique NFTs
mintBatchTo(walletAddress, metadata)Mint Many unique NFTs
mintTo(walletAddress, metadata)Mint a unique NFT

Signature:

export declare class NFTCollection extends StandardErc721<TokenERC721>

Extends: StandardErc721<TokenERC721>