Nodejs Script to Transfer NFT from owner wallet to another Wallet

Job ID: 35788947

Budget: $10 – $30 USD

I need a nodejs script to Transfer NFT from owner wallet to another Wallet. My nft has the following function.

function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;

I will be running this script on a node for my private blockchain. do not use any API.

use httpprovider and the following method to unlock owner account.

// Connect to the private blockchain node
const web3 = new Web3(new Web3.providers.HttpProvider('http://88.xxx.241.58:8545'));

// Account A keystore file path
const keystorePath = './data/keystore/UTC--2023-01-17T21-32-41114034552Z--8268aa1f53e9f1b5ef01f3755893a316809c53f9.json';

// Account A keystore file password
const keystorePassword = 'a61b24a3fce56cf28090ba06c6f58a04';
Related categories: Node.js Blockchain Ethereum