NFT
nft()
nft()
Creates an NftBuilder
class instance, which provides methods to build transactions for the NFT Pallet on The Root Network. It expects four parameters:
api
: the trnApi to use for interaction.signer
: the signer to use for signing transactions.walletAddress
: the wallet address to use for interaction. Note: It should be the EOA address for the signer, not the FuturePass address.collectionId
: the Collection ID to target. Optional parameter.
Example:
The nft
method allows developers to mint
, transfer,
burn
, amongst other actions listed below.
mint()
mint()
Sets the base extrinsic to mint NFTs with the given quantity to the provided wallet address. It expects two parameters.
quantity
: the number of NFTs to mint.walletAddress
: the wallet address to mint the NFTs to.
Example:
transfer()
transfer()
Sets the base extrinsic to transfer NFTs with the given serial numbers. It expects two parameters:
serialNumbers
: an array of serial numbers of the NFTs to transfer.walletAddress
: the wallet address to mint the NFTs to.
Example:
burn()
burn()
Sets the base extrinsic to burn NFTs with the given serial number. It expects one parameter:
serialNumber
: the serial number of the NFT to burn.
Example:
createCollection()
createCollection()
Creates a new NFT Collection. It expects seven parameters.
name
: the name of the collection.initialIssuance
: the initial issuance of the collection. Optional parameter. The value can be a number, bigint or string. Defaults tonull
.maxIssuance
: the maximum issuance of the collection. Optional parameter. The value can be a number, bigint or string. Defaults tonull
.tokenOwner
: the owner of the collection.metadataUri
: the metadata URI of the collection.royalties
: the royalties of the collection.crossChain
: the cross chain compatibility of the collection.
publicMintOn()
publicMintOn()
Toggles public minting on or off. It expects one parameter:
publicMintOn
: value to set public minting to.
setCollectionId()
setCollectionId()
Set the collection ID. It expects one parameter:
collectionId
: the collection ID to set.
setPrice()
setPrice()
Updates the mint fee of the collection. It expects two parameters:
token
: the token to update the mint fee for.price
: the price to update to.
transferCollection()
transferCollection()
Transfer ownership of the collection. It expects one parameter:
newOwner
: the new owner to update to.
updateMetadataUri()
updateMetadataUri()
Updates the metadata URI of the collection. It expects one parameter.
uri
: the metadata URI to update to.
updateMaxIssuance()
updateMaxIssuance()
Update the max issuance of the collection. It expects one parameter.
maxIssuance
: the max issuance to update to.
updateRoyalties()
updateRoyalties()
Updates the royalties of the collection. It expects one parameter.
royalties
: the royalties to update to.
More examples of the methods above can be found in Guides.
Last updated