PHP WebShell

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

Просмотр файла: payment-channel.js

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

var utils = require('./utils');
var parsePaymentChannel = require('./parse/payment-channel');
var validate = utils.common.validate;

var NotFoundError = utils.common.errors.NotFoundError;

function formatResponse(response) {
  if (response.node !== undefined && response.node.LedgerEntryType === 'PayChannel') {
    return parsePaymentChannel(response.node);
  } else {
    throw new NotFoundError('Payment channel ledger entry not found');
  }
}

function getPaymentChannel(id) {
  validate.getPaymentChannel({ id: id });

  var request = {
    command: 'ledger_entry',
    index: id,
    binary: false,
    ledger_index: 'validated'
  };

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

module.exports = getPaymentChannel;

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


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