@ape.swap/bonds-sdk 1.0.279 → 1.0.281

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.
@@ -163,7 +163,7 @@ var BondModal = function (_a) {
163
163
  return parseFloat(getPremium) < 0 ? 'premium-negative' : 'premium-positive';
164
164
  };
165
165
  var handleBuy = function (bond) { return __awaiter(void 0, void 0, void 0, function () {
166
- var provider, signer, bondContract, maxPrice, amount, tx, error_1;
166
+ var provider, signer, bondContract, maxPrice, maxPrice2, amount, tx, error_1;
167
167
  return __generator(this, function (_a) {
168
168
  switch (_a.label) {
169
169
  case 0:
@@ -179,14 +179,17 @@ var BondModal = function (_a) {
179
179
  _a.label = 1;
180
180
  case 1:
181
181
  _a.trys.push([1, 4, , 5]);
182
- maxPrice = new BigNumber(bondData[0].trueBillPrice).times(102).div(100);
182
+ maxPrice = new BigNumber(bondData[0].trueBillPrice).times(102);
183
+ maxPrice2 = new BigNumber(bondData[0].trueBillPrice).times(102).div(100);
183
184
  amount = adjustDecimals(inputValue);
184
185
  console.log('-------');
185
186
  console.log(amount);
186
187
  console.log(maxPrice);
188
+ console.log(maxPrice2);
189
+ console.log(maxPrice2.valueOf());
187
190
  console.log(bondData[0].trueBillPrice);
188
191
  console.log('-------');
189
- return [4 /*yield*/, bondContract.deposit(amount, maxPrice, account)];
192
+ return [4 /*yield*/, bondContract.deposit(amount, maxPrice2.valueOf(), account)];
190
193
  case 2:
191
194
  tx = _a.sent();
192
195
  return [4 /*yield*/, tx.wait()];
@@ -197,7 +200,7 @@ var BondModal = function (_a) {
197
200
  case 4:
198
201
  error_1 = _a.sent();
199
202
  console.error('Approval error', error_1);
200
- alert('Approval Failed');
203
+ alert('Approval Failed!');
201
204
  return [3 /*break*/, 5];
202
205
  case 5: return [2 /*return*/];
203
206
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "1.0.279",
6
+ "version": "1.0.281",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",