import { Account, TransactionType } from "@klever/sdk-node";
const payload = {
amount,
receiver,
kda,
};
const privateKey = "yourPrivateKey";
const account = new Account(privateKey);
await account.ready;
const unsignedTx = await account.buildTransaction([
{
payload,
type: TransactionType.Transfer,
},
]);
const signedTx = await account.signTransaction(unsignedTx);
const broadcastRes = await account.broadcastTransactions([signedTx]);
console.log(broadcastRes);
import { Account, TransactionType } from "@klever/sdk-node";
const payload = {
amount,
receiver,
kda,
};
const privateKey = "yourPrivateKey";
const account = new Account(privateKey);
await account.ready;
const broadcastRes = await account.quickSend([
{
payload,
type: TransactionType.Transfer,
},
]); //the same as buildTransaction + signTransaction + broadcastTransactions
console.log(broadcastRes);