Install the project dependencies using the following command:
npmi
Step2: File creation
Once Step1 has been completed, the user can create a javascript file in the root directory and subsequently insert the provided code into the file in order to execute a transaction on the Ethereum network.
const {signTransaction,sendTransaction} =require('./src/index');asyncfunctiontransfer() {constrawTransaction=awaitsignTransaction({ from:'SENDER_WALLET_ADDRESS', to:'RECEIVER_WALLET_ADDRESS', value:'1',// in wei gas:'50000', },{ privateKey:'YOUR_PRIVATE_KEY', xApiKey :'YOUR_API_KEY', chainId :"1"// 5 for goerli }).then(rawTransaction =>sendTransaction({ rawTransaction:rawTransaction.rawTransaction, xApiKey :'YOUR_API_KEY', chainId:"1"// 5 for goerli })).then(res =>console.log(res));}transfer()
Upon completion of the transaction, the user will be provided with the transaction hash.