Blockchain transactions are not that different from banking transactions. Sending money to someone, moving money to your savings account, and even taking out loans are all things that can easily be done digitally with most banks nowadays. The internet era has given us the ability to execute most of these actions online without any physical interaction.
import Web3 from 'web3'const SENDER_ADDRESS = "Sender Ethereum Address"const SENDER_PRIVATE_KEY = "<Sender Private Key>"const RECEIVER_ADDRESS = "<Recieiver address>"const AMOUNT = 10 //const web3Client = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io"));try {const txnOption = {nonce: await web3Client.eth.getTransactionCount(SENDER_ADDRESS, "latest"),from: SENDER_ADDRESS,to: RECEIVER_ADDRESS,value: web3Client.utils.toWei(AMOUNT.toString(), "ether"),gas: 21000,chainId: await web3Client.eth.getChainId(),};const signedTx = await web3Client.eth.accounts.signTransaction(txnOption, SENDER_PRIVATE_KEY);const result = await web3Client.eth.sendSignedTransaction(signedTx.rawTransaction);console.log("Result ==>", result)} catch (error) {console.log("Error While Transfer", error);}