How to use the augur-abi.bignum function in augur-abi

To help you get started, we’ve selected a few augur-abi 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 AugurProject / augur.js / src / modules / abacus.js View on Github external
calculateTradingFees: function (makerFee, takerFee) {
    var bnMakerFee, tradingFee, makerProportionOfFee;
    bnMakerFee = abi.bignum(makerFee);
    tradingFee = abi.bignum(takerFee).plus(bnMakerFee).dividedBy(ONE_POINT_FIVE);
    makerProportionOfFee = bnMakerFee.dividedBy(tradingFee);
    return {tradingFee: tradingFee, makerProportionOfFee: makerProportionOfFee};
  },
github AugurProject / augur.js / src / modules / abacus.js View on Github external
expandScalarPrice: function (minValue, price) {
    if (minValue.constructor !== BigNumber) minValue = abi.bignum(minValue);
    if (price.constructor !== BigNumber) price = abi.bignum(price);
    return price.plus(minValue).toFixed();
  },
github AugurProject / augur.js / src / modules / abacus.js View on Github external
shrinkScalarPrice: function (minValue, price) {
    if (minValue.constructor !== BigNumber) minValue = abi.bignum(minValue);
    if (price.constructor !== BigNumber) price = abi.bignum(price);
    return price.minus(minValue).toFixed();
  },
github AugurProject / augur.js / src / trading / take-order / execute-trade.js View on Github external
}, function (sharesPurchased) {
              bnSharesPurchased = abi.bignum(sharesPurchased);
              api().Cash.balance({ address: address }, function (cashBalance) {
                bnCashBalance = abi.bignum(cashBalance);
                nextTrade();
              });
            });
          },
github AugurProject / augur.js / src / modules / abacus.js View on Github external
calculateFxpMakerTakerFees: function (tradingFee, makerProportionOfFee) {
    var fxpTradingFee, fxpMakerProportionOfFee, makerFee, takerFee;
    fxpTradingFee = abi.bignum(tradingFee);
    fxpMakerProportionOfFee = abi.bignum(makerProportionOfFee);
    makerFee = fxpTradingFee.times(fxpMakerProportionOfFee).dividedBy(constants.ONE).floor();
    takerFee = ONE_POINT_FIVE.times(fxpTradingFee).dividedBy(constants.ONE).floor().minus(makerFee);
    return {
      trading: fxpTradingFee,
      maker: makerFee,
      taker: takerFee
    };
  },

augur-abi

Contract ABI serialization

MIT
Latest version published 7 years ago

Package Health Score

46 / 100
Full package analysis

Similar packages