Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then(response => {
console.log("Final transaction result:", response)
// Re-calculate checkID to work around issue ripple-lib#876
const checkIDhasher = createHash('sha512')
checkIDhasher.update(Buffer.from('0043', 'hex'))
checkIDhasher.update(new Buffer(decodeAddress(response.address)))
const seqBuf = Buffer.alloc(4)
seqBuf.writeUInt32BE(response.sequence, 0)
checkIDhasher.update(seqBuf)
const checkID = checkIDhasher.digest('hex').slice(0,64).toUpperCase()
console.log("Calculated checkID:", checkID)
// Disconnect and return
}).then(() => {
api.disconnect().then(() => {
this.tx_json.Signers.sort((a, b) => {
return (new Buffer(decodeAddress(a.Signer.Account))).compare(
new Buffer(decodeAddress(b.Signer.Account)));
});