Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
payment.setXrpAmount(xrpAmount);
payment.setDestination(destination);
const transaction = new Transaction();
transaction.setAccount(sender.getAddress());
transaction.setFee(fee);
transaction.setSequence(accountInfo.getSequence());
transaction.setPayment(payment);
transaction.setLastLedgerSequence(
ledgerSequence + ledgerSequenceMargin
);
transaction.setSigningPublicKeyHex(sender.getPublicKey());
var signedTransaction;
try {
signedTransaction = Signer.signTransaction(transaction, sender);
} catch (signingError) {
const signingErrorMessage =
XpringClientErrorMessages.signingFailure +
". " +
signingError.message;
return Promise.reject(new Error(signingErrorMessage));
}
if (signedTransaction == undefined) {
return Promise.reject(
new Error(XpringClientErrorMessages.signingFailure)
);
}
const submitSignedTransactionRequest = new SubmitSignedTransactionRequest();
submitSignedTransactionRequest.setSignedTransaction(
signedTransaction