Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
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;
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);
}