How to use the ripple-lib.Base function in ripple-lib

To help you get started, we’ve selected a few ripple-lib 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 / rippled-network-crawler / src / lib / crawler.js View on Github external
function normalizePubKey(pubKeyStr) {
  if (pubKeyStr.length > 50 && pubKeyStr[0] === 'n') {
    return pubKeyStr;
  }

  var bits = sjcl.codec.base64.toBits(pubKeyStr);
  var bytes = sjcl.codec.bytes.fromBits(bits);
  return ripple.Base.encode_check(ripple.Base.VER_NODE_PUBLIC, bytes);
}
github ripple / rippled-historical-database / lib / ledgerParser / affectedAccounts.js View on Github external
var utils = require('../utils');
var Meta  = require('ripple-lib').Meta;
var Base  = require('ripple-lib').Base;

module.exports = function (tx) {
  var accounts = [];
  var list     = [];
  
  var meta = new Meta(tx.metaData);
  accounts = meta.getAffectedAccounts();
/*
  addAffectedAccount('initiator', tx.Account, tx);
  
  if (tx.metaData.TransactionResult === 'tesSUCCESS') {
    switch(tx.TransactionType) {  
      case 'Payment':
        addAffectedAccount('source', tx.Account, tx);
        addAffectedAccount('destination', tx.Destination, tx);
        break;
github ripple / rippled-network-crawler / src / crawler.js View on Github external
function normalizePubKey(pubKeyStr) {
  if (pubKeyStr.length > 50 && pubKeyStr[0] == 'n') {
    return pubKeyStr;
  }

  var bits = sjcl.codec.base64.toBits(pubKeyStr);
  var bytes = sjcl.codec.bytes.fromBits(bits);
  return ripple.Base.encode_check(ripple.Base.VER_NODE_PUBLIC, bytes);
}