Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
...castVotes({ ...votesChunks[i], timeOffset }),
senderPublicKey: account.publicKey,
recipientId: account.address,
};
// eslint-disable-next-line no-await-in-loop
const signature = await signTransaction({
deviceId: account.hwInfo.deviceId,
index: account.hwInfo.derivationIndex,
tx: transactionObject,
});
signedTransactions.push({
...transactionObject,
signature,
id: utils.getTransactionId({ ...transactionObject, signature }),
});
}
return signedTransactions;
} catch (error) {
throw new Error(i18next.t(
'The transaction has been canceled on your {{model}}',
{ model: account.hwInfo.deviceModel },
));
}
};
const signSendTransaction = async (account, data) => {
const transactionObject = {
...transfer(data),
senderPublicKey: account.info.LSK.publicKey,
};
const transaction = {
deviceId: account.hwInfo.deviceId,
index: account.hwInfo.derivationIndex,
tx: transactionObject,
};
try {
const signature = await signTransaction(transaction);
const signedTransaction = { ...transactionObject, signature };
const result = { ...signedTransaction, id: utils.getTransactionId(signedTransaction) };
return result;
} catch (error) {
throw new Error(error);
}
};