@ape.swap/bonds-sdk 1.0.284 → 1.0.286

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, maxPrice2, amount, tx, error_1;
166
+ var provider, signer, bondContract, maxPrice, maxPrice2, amount, amountWei, tx, error_1;
167
167
  return __generator(this, function (_a) {
168
168
  switch (_a.label) {
169
169
  case 0:
@@ -182,15 +182,16 @@ var BondModal = function (_a) {
182
182
  maxPrice = new BigNumber(bondData[0].trueBillPrice).times(102);
183
183
  maxPrice2 = new BigNumber(bondData[0].trueBillPrice).times(102).div(100);
184
184
  amount = adjustDecimals(inputValue);
185
- console.log('-------');
185
+ amountWei = ethers.utils.parseUnits(amount.toString(), "ether");
186
+ console.log('-------!');
186
187
  console.log(amount);
187
- console.log(ethers.utils.parseUnits(amount, 18));
188
+ console.log(amountWei.toString());
188
189
  console.log(maxPrice);
189
190
  console.log(maxPrice2);
190
191
  console.log(maxPrice2.valueOf());
191
192
  console.log(bondData[0].trueBillPrice);
192
193
  console.log('-------');
193
- return [4 /*yield*/, bondContract.deposit(amount, maxPrice2.valueOf(), account)];
194
+ return [4 /*yield*/, bondContract.deposit(amountWei.toString(), maxPrice2.valueOf(), account)];
194
195
  case 2:
195
196
  tx = _a.sent();
196
197
  return [4 /*yield*/, tx.wait()];
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.284",
6
+ "version": "1.0.286",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",