Transfers an NFT token from one address to another.
import { L1XProvider, NFTTokenTransferArg } from "@l1x/l1x-wallet-sdk";
let l1xProvider = new L1XProvider({
clusterType: "mainnet",
endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});
let params: NFTTokenTransferArg = {
attrib: {
contract_address: "4669899603735f7b06645c73fb73376b4a5c6f43",
recipient_address: "346fb07c43e88b58c058e8d6c4bf2f5080a01999",
token_id: 1,
},
private_key: "YOUR_PRIVATE_KEY",
fee_limit: 1,
};
l1xProvider.tokens.NFT.transferFrom(params)
.then((response) => console.log(response)) // log response
.catch((err) => console.error(err)); // log error
The attribute for transferring the token.
{
attrib: {
contract_address: "4669899603735f7b06645c73fb73376b4a5c6f43",
recipient_address: "346fb07c43e88b58c058e8d6c4bf2f5080a01999",
token_id: 1,
},
private_key: "YOUR_PRIVATE_KEY",
fee_limit: 1,
}
The response of the transfer operation.
{
"hash": "dc224ba854d5fbd3371f6d509b9a0b5451fff78a70ad3a209b5c273f8da0abfb"
}