How to use the ripple-address-codec.decodeSeed 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 / ripple-lib / src / core / seed.js View on Github external
Seed.prototype.parse_base58 = function(j) {
  if (typeof j !== 'string') {
    throw new Error('Value must be a string');
  }
  if (!j.length || j[0] !== 's') {
    this._value = NaN;
  } else {
    try {
      const {bytes, type} = decodeSeed(j);
      this._value = new BN(bytes);
      this._type = type;
    } catch (e) {
      this._value = NaN;
    }
  }
  return this;
};