SFT

stf()

Creates an SftBuilder class instance, which provides methods to build transactions for the SFT 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:

const sftBuilder = await TransactionBuilder.sft(api, signer, walletAddress, collectionId)

The sft method allows developers to mint, transfer, and burn NFTs.

mint()

Sets the base extrinsic to mint SFTs with the given serial numbers and quantities. It expects two parameters:

  • serialNumbers: an array with the serial numbers of the SFTs to mint. Each element in the array should be an object with a tokenId and quantity property, e.g., serialNumbers = [{tokenId, quantity}, {tokenId, quantity}].

  • walletAddress: the wallet address to mint the NFTs to.

Example:

const sftBuilder = await TransactionBuilder.sft(api, signer, walletAddress, collectionId).mint({serialNumbers, walletAddress: userSession?.futurepass });

transfer()

Sets the base extrinsic to transfer SFTs with the given serial numbers and quantities to the given wallet address. It expects two parameters:

  • serialNumbers: an array with the serial numbers of the SFTs to transfer. Each element in the array should be an object with a tokenId and quantity property, e.g., serialNumbers = [{tokenId, quantity}, {tokenId, quantity}].

  • walletAddress: the wallet address to transfer the SFTs to.

Example:

const sftBuilder = await TransactionBuilder.sft(api, signer, walletAddress, collectionId).transfer({serialNumbers, walletAddress: userSession?.futurepass });

burn()

Sets the base extrinsic to burn SFTs with the given serial numbers and quantities. It expects one parameter:

  • serialNumbers: an array with the serial numbers of the SFTs to burn. Each element in the array should be an object with a tokenId and quantity property, e.g., serialNumbers = [{tokenId, quantity}, {tokenId, quantity}].

Example:

const sftBuilder = await TransactionBuilder.sft(api, signer, walletAddress, collectionId).burn([serialNumbers]);

Last updated

© 2023 -> ♾️