typescript-sdk

Home > @3rdweb/sdk > NFTModule

NFTModule class

Create a collection of one-of-one NFTs.

Signature:

export declare class NFTModule extends ModuleWithRoles<SignatureMint721> implements ITransferable, ISignatureMinter 

Extends: ModuleWithRoles<SignatureMint721>

Implements: ITransferable, ISignatureMinter

Example

import { ThirdwebSDK } from "@3rdweb/sdk";

// You can switch out this provider with any wallet or provider setup you like.
const provider = ethers.Wallet.createRandom();
const sdk = new ThirdwebSDK(provider);
const module = sdk.getNFTModule("");

Properties

Property Modifiers Type Description
moduleType static ModuleType  
roles static readonly [“admin”, “minter”, “transfer”]  

Methods

Method Modifiers Description
balance()    
balanceOf(address)   Get NFT Balance
burn(tokenId)   Burn NFT
generateSignature(mintRequest)    
generateSignatureBatch(payloads)    
get(tokenId)   Fetches an NFT from storage with the resolved metadata.
getAll()   Get All NFTs
getAllWithOwner()    
getDefaultSaleRecipient()    
getModuleRoles()    
getOwned(_address)   Get Owned NFTs
getPrimarySaleRecipient()    
getRoyaltyBps()   Gets the royalty BPS (basis points) of the contract
getRoyaltyRecipientAddress()   Gets the address of the royalty recipient
getWithOwner(tokenId)    
isApproved(address, operator)    
isTransferRestricted()    
isV1()   Check if contract is v1 or v2. If the contract doesn’t have nextTokenIdToMint = v1 contract.
mint(metadata)    
mintBatch(metadatas)    
mintBatchTo(to, metadatas)   Mint Many NFTs
mintTo(to, metadata)   Mint NFT
mintWithSignature(req, signature)    
ownerOf(tokenId)   Checks the owner of a particular NFT
setApproval(operator, approved)    
setDefaultSaleRecipient(recipient)   Set the default primary sales recipient for this contract
setModuleMetadata(metadata)    
setPrimarySaleRecipient(address)   Set the default primary sales recipient for this contract
setRestrictedTransfer(restricted)    
setRoyaltyBps(amount)    
totalSupply()    
transfer(to, tokenId)   Transfer NFT
transferFrom(from, to, tokenId)    
verify(mintRequest, signature)