🔗transferNFT
Description
The transferNFT
function allows users to transfer non-fungible tokens (NFTs) from their wallet to another user's wallet on a specified blockchain.
It uses the appropriate smart contract for the selected blockchain to execute the transfer.
Parameters
blockchain
string
The name of the blockchain where the NFT is being transferred
privateKey
string
The private key of the user's wallet
tokenId
string
The ID of the NFT being transferred
nftAddress
string
The address of the NFT contract on the blockchain
Response
code
number
Indicates success (1) or failure (0) of the operation
receipt
object
The receipt of the transfer transaction if successful
error
string
The error message if the operation fails
Example Request and Response
Prerequisites
Before making requests with QUBIT SDK, you must have it installed.
You can install QUBIT SDK using either npm
or yarn
. Use the following commands to install QUBIT SDK:
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
Request
Here is an example of how to make a transferNFT
request using the QUBIT SDK:
const { NFTMarketPlace } = require('@nest25/evm-chains-lib')
const nftMarketPlace = new NFTMarketPlace();
const privateKey = 'your private key here'
const contractAddress = 'your contract address here'
const main = async () => {
const contract = await nftMarketPlace.transferNFT(
'klay',
privateKey,
contractAddress,
1,
)
console.log(contract);
}
main()
Response
Use Cases
Crypto Wallets: The
transferNFT
function can be used by crypto wallets to facilitate the transfer of NFTs between users on a specific blockchain.NFT Marketplaces: The function can be used by NFT marketplaces to allow users to transfer their NFTs to other users on the platform.
NFT Collectors: The
transferNFT
function can be used by NFT collectors to transfer their NFTs to other collectors or buyers on a specific blockchain.
Last updated