How to use the ripple-address-codec.decodeAddress function in ripple-address-codec

To help you get started, we’ve selected a few ripple-address-codec examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ripple / xrpl-dev-portal / content / _code-samples / checks / js / getCreateTx.js View on Github external
}).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(() => {
github ripple / ripple-lib / src / core / transaction.js View on Github external
this.tx_json.Signers.sort((a, b) => {
    return (new Buffer(decodeAddress(a.Signer.Account))).compare(
      new Buffer(decodeAddress(b.Signer.Account)));
  });