Send a Transaction
Here's an small example how to send a transaction using NodeJS for the backend.
Here's how to import the wallet keys.
Here we'll create the script that will be sending the transaction.
/**
* Send a transaction
* @param transaction Transaction to send already signed
*/
async function SendATransaction(transaction: Transaction){
let transactionSignedBytes = transaction.toString(true); // Get the transaction in bytes convert it to string
let txHash = await RPC.sendRawTransaction(transactionSignedBytes); // Send the transaction to the network
await delay(5000); // Wait 5 seconds or more
let result = await GetATransaction(txHash); // Get the result of the transaction
return result;
}
Transfer Tokens
Last updated