@ape.swap/bonds-sdk 1.0.276 → 1.0.280

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,11 +163,11 @@ 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:
170
- console.log('handle buy clicked');
170
+ console.log('handle buy clicked!');
171
171
  if (!window.ethereum) {
172
172
  console.error('No Ethereum provider found');
173
173
  alert('No Ethereum provider found');
@@ -179,8 +179,16 @@ 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);
185
+ console.log('-------');
186
+ console.log(amount);
187
+ console.log(maxPrice);
188
+ console.log(maxPrice2);
189
+ console.log(maxPrice2.valueOf());
190
+ console.log(bondData[0].trueBillPrice);
191
+ console.log('-------');
184
192
  return [4 /*yield*/, bondContract.deposit(amount, maxPrice, account)];
185
193
  case 2:
186
194
  tx = _a.sent();
@@ -214,7 +222,7 @@ var BondModal = function (_a) {
214
222
  !!v.currentTarget.value && isNumber(v.currentTarget.value) && parseFloat(v.currentTarget.value) >= 0
215
223
  ? v.currentTarget.value
216
224
  : v.currentTarget.value.slice(0, v.currentTarget.value.length - 1);
217
- } }) })), _jsx(Flex, __assign({ className: "input-container token" }, { children: bond === null || bond === void 0 ? void 0 : bond.principalTokenName }))] })), _jsxs(Flex, __assign({ className: "modal-container button-container" }, { children: [_jsx(Flex, __assign({ className: "button-container get" }, { children: _jsxs(Button, { children: ["Get ", bond === null || bond === void 0 ? void 0 : bond.principalTokenName] }) })), _jsx(Flex, __assign({ className: "button-container buy" }, { children: _jsxs(Button, __assign({ onClick: function () { return handleBuy(bond); } }, { children: ["Buy ", bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName] })) }))] }))] }))] })) })) }, bond.billAddress));
225
+ } }) })), _jsx(Flex, __assign({ className: "input-container token" }, { children: bond === null || bond === void 0 ? void 0 : bond.principalTokenName }))] })), _jsxs(Flex, __assign({ className: "modal-container button-container" }, { children: [_jsx(Flex, __assign({ className: "button-container get" }, { children: _jsxs(Button, { children: ["Get ", bond === null || bond === void 0 ? void 0 : bond.principalTokenName] }) })), _jsx(Flex, __assign({ className: "button-container buy" }, { children: _jsxs(Button, __assign({ onClick: function () { return handleBuy(bond); } }, { children: ["Buy: ", bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName] })) }))] }))] }))] })) })) }, bond.billAddress));
218
226
  }) })));
219
227
  };
220
228
  export default BondModal;
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.276",
6
+ "version": "1.0.280",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",
File without changes
File without changes
File without changes