How to use the augur-abi.number 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 / test / client / orders.js View on Github external
it(JSON.stringify(t), function () {
            var shares = augur.orders.limit.sharesToTrade(t.q, t.outcome, t.alpha, t.cap, t.isBuy);
            assert.notProperty(shares, "error");
            var zero = augur.orders.limit.f(shares, augur.utils.toDecimal(t.q), t.outcome, augur.utils.toDecimal(t.alpha), augur.utils.toDecimal(t.cap));
            assert.closeTo(zero.toNumber(), 0, 1e-12);
            assert.strictEqual(abi.number(shares).toFixed(5), t.expected);
        });
    };
github AugurProject / augur.js / test / integration / markets / markets.js View on Github external
var test = function (t) {
    var output = t.output;
    assert.isAbove(abi.number(output), 0);
    t.done();
  };
  for (var i = 0; i < numMarkets; ++i) {
github AugurProject / augur / app / components / market-create-page / MarketCreatePage.jsx View on Github external
onChangeMaximum: function (event) {
    var maxValue = event.target.value;
    if (utilities.isNumeric(maxValue)) maxValue = abi.number(maxValue);
    this.setState({maxValue: maxValue}, () => {
      this.validateStep1("minMax");
    });
  },
  validateMinimum: function () {
github AugurProject / augur / app / components / market-create-page / MarketCreatePage.jsx View on Github external
onChangeMinimum: function (event) {
    var minValue = event.target.value;
    if (utilities.isNumeric(minValue)) minValue = abi.number(minValue);
    this.setState({minValue: minValue}, () => {
      this.validateStep1("minMax");
    });
  },
  onChangeMaximum: function (event) {
github AugurProject / augur / app / components / Outcomes.jsx View on Github external
handleChange: function () {
        let rawValue = this.refs.inputShares.getValue();
        this.setState({value: rawValue, inputError: null});
        if (utils.isNumeric(rawValue)) {
            this.debounceChange(abi.number(rawValue));
        } else {
            this.setState({simulation: null});
        }
    },

augur-abi

Contract ABI serialization

MIT
Latest version published 7 years ago

Package Health Score

46 / 100
Full package analysis

Similar packages