How to use the js-xdr.Hyper function in js-xdr

To help you get started, we’ve selected a few js-xdr 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 tokend / new-js-sdk / lib / base / index.js View on Github external
get: function get() {
    return _jsXdr.Hyper;
  }
});
github tokend / new-js-sdk / lib / base / operation.js View on Github external
}

        if ((0, _isUndefined.default)(opts.fee.lowerBound)) {
          opts.fee.lowerBound = '0';
        }

        if ((0, _isUndefined.default)(opts.fee.upperBound)) {
          opts.fee.upperBound = _base_operation.BaseOperation.MAX_INT64_AMOUNT;
        }

        var feeData = {
          fixedFee: Operation._toXDRAmount(opts.fee.fixedFee),
          percentFee: Operation._toXDRAmount(opts.fee.percentFee),
          feeType: opts.fee.feeType,
          asset: opts.fee.asset,
          subtype: _jsXdr.Hyper.fromString(opts.fee.subtype),
          lowerBound: Operation._toXDRAmount(opts.fee.lowerBound),
          upperBound: Operation._toXDRAmount(opts.fee.upperBound),
          ext: new _xdr_generated.default.FeeEntryExt(_xdr_generated.default.LedgerVersion.emptyVersion())
        };
        var data = "type:".concat(opts.fee.feeType.value, "asset:").concat(opts.fee.asset, "subtype:").concat(opts.fee.subtype.toString());

        if (opts.fee.accountId) {
          if (!_keypair.Keypair.isValidPublicKey(opts.fee.accountId)) {
            throw new TypeError('accountId is invalid');
          } else {
            feeData.accountId = _keypair.Keypair.fromAccountId(opts.fee.accountId).xdrAccountId();
            data += "accountID:".concat(opts.fee.accountId);
          }
        }

        if (opts.fee.accountType) {
github stellar / js-stellar-base / lib / index.js View on Github external
var xdr = _interopRequire(require("./generated/stellar-xdr_generated"));

exports.xdr = xdr;
exports.hash = require("./hashing").hash;

var _signing = require("./signing");

exports.sign = _signing.sign;
exports.verify = _signing.verify;
exports.Keypair = require("./keypair").Keypair;

var _jsXdr = require("js-xdr");

exports.UnsignedHyper = _jsXdr.UnsignedHyper;
exports.Hyper = _jsXdr.Hyper;
exports.Transaction = require("./transaction").Transaction;
exports.TransactionBuilder = require("./transaction_builder").TransactionBuilder;
exports.Asset = require("./asset").Asset;
exports.Operation = require("./operation").Operation;
exports.Memo = require("./memo").Memo;
exports.Account = require("./account").Account;

_defaults(exports, _interopRequireWildcard(require("./strkey")));
github tokend / new-js-sdk / lib / base / operations / base_operation.js View on Github external
value: function _toXDRAmount(value) {
      var amount = new _bignumber.default(value).mul(ONE);
      return _jsXdr.Hyper.fromString(amount.toString());
    }
    /**

js-xdr

Read/write XDR encoded data structures (RFC 4506)

Apache-2.0
Latest version published 4 months ago

Package Health Score

56 / 100
Full package analysis

Similar packages