PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo-express/node_modules/ripple-lib/dist/npm/ledger

Просмотр файла: accountinfo.js

'use strict'; // eslint-disable-line strict

var utils = require('./utils');
var _utils$common = utils.common,
    validate = _utils$common.validate,
    removeUndefined = _utils$common.removeUndefined;


function formatAccountInfo(response) {
  var data = response.account_data;
  return removeUndefined({
    sequence: data.Sequence,
    xrpBalance: utils.common.dropsToXrp(data.Balance),
    ownerCount: data.OwnerCount,
    previousInitiatedTransactionID: data.AccountTxnID,
    previousAffectingTransactionID: data.PreviousTxnID,
    previousAffectingTransactionLedgerVersion: data.PreviousTxnLgrSeq
  });
}

function getAccountInfo(address) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

  validate.getAccountInfo({ address: address, options: options });

  var request = {
    command: 'account_info',
    account: address,
    ledger_index: options.ledgerVersion || 'validated'
  };

  return this.connection.request(request).then(formatAccountInfo);
}

module.exports = getAccountInfo;

Выполнить команду


Для локальной разработки. Не используйте в интернете!