@upcoming/bee-js 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/bee.js CHANGED
@@ -1293,7 +1293,6 @@ class Bee {
1293
1293
  if (options) {
1294
1294
  options = (0, type_1.prepareTransactionOptions)(options);
1295
1295
  }
1296
- // TODO: Add test for response
1297
1296
  return stake.stake(this.getRequestOptionsForCall(requestOptions), amountString, options);
1298
1297
  }
1299
1298
  /**
@@ -43,7 +43,7 @@ async function getChainState(requestOptions) {
43
43
  block: cafe_utility_1.Types.asNumber(body.block, { name: 'block' }),
44
44
  chainTip: cafe_utility_1.Types.asNumber(body.chainTip, { name: 'chainTip' }),
45
45
  totalAmount: (0, type_1.asNumberString)(body.totalAmount, { name: 'totalAmount' }),
46
- currentPrice: (0, type_1.asNumberString)(body.currentPrice, { name: 'currentPrice' }),
46
+ currentPrice: cafe_utility_1.Types.asNumber(body.currentPrice, { name: 'currentPrice' }),
47
47
  };
48
48
  }
49
49
  exports.getChainState = getChainState;
@@ -52,19 +52,19 @@ class BZZ {
52
52
  return new BZZ(this.state.divide(other)[0]);
53
53
  }
54
54
  gt(other) {
55
- return this.state.value > (other instanceof BZZ ? other.state : new cafe_utility_1.FixedPointNumber(other, BZZ.DIGITS)).value;
55
+ return this.state.compare(other.state) === 1;
56
56
  }
57
57
  gte(other) {
58
- return this.state.value >= (other instanceof BZZ ? other.state : new cafe_utility_1.FixedPointNumber(other, BZZ.DIGITS)).value;
58
+ return this.state.compare(other.state) !== -1;
59
59
  }
60
60
  lt(other) {
61
- return this.state.value < (other instanceof BZZ ? other.state : new cafe_utility_1.FixedPointNumber(other, BZZ.DIGITS)).value;
61
+ return this.state.compare(other.state) === -1;
62
62
  }
63
63
  lte(other) {
64
- return this.state.value <= (other instanceof BZZ ? other.state : new cafe_utility_1.FixedPointNumber(other, BZZ.DIGITS)).value;
64
+ return this.state.compare(other.state) !== 1;
65
65
  }
66
66
  eq(other) {
67
- return this.state.value === (other instanceof BZZ ? other.state : new cafe_utility_1.FixedPointNumber(other, BZZ.DIGITS)).value;
67
+ return this.state.compare(other.state) === 0;
68
68
  }
69
69
  }
70
70
  exports.BZZ = BZZ;
@@ -119,19 +119,19 @@ class DAI {
119
119
  return new DAI(this.state.divide(other)[0]);
120
120
  }
121
121
  gt(other) {
122
- return this.state.value > (other instanceof DAI ? other.state : new cafe_utility_1.FixedPointNumber(other, DAI.DIGITS)).value;
122
+ return this.state.compare(other.state) === 1;
123
123
  }
124
124
  gte(other) {
125
- return this.state.value >= (other instanceof DAI ? other.state : new cafe_utility_1.FixedPointNumber(other, DAI.DIGITS)).value;
125
+ return this.state.compare(other.state) !== -1;
126
126
  }
127
127
  lt(other) {
128
- return this.state.value < (other instanceof DAI ? other.state : new cafe_utility_1.FixedPointNumber(other, DAI.DIGITS)).value;
128
+ return this.state.compare(other.state) === -1;
129
129
  }
130
130
  lte(other) {
131
- return this.state.value <= (other instanceof DAI ? other.state : new cafe_utility_1.FixedPointNumber(other, DAI.DIGITS)).value;
131
+ return this.state.compare(other.state) !== 1;
132
132
  }
133
133
  eq(other) {
134
- return this.state.value === (other instanceof DAI ? other.state : new cafe_utility_1.FixedPointNumber(other, DAI.DIGITS)).value;
134
+ return this.state.compare(other.state) === 0;
135
135
  }
136
136
  }
137
137
  exports.DAI = DAI;