@ape.swap/bonds-sdk 4.0.0-test.34 → 4.0.0-test.36

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.
Files changed (2) hide show
  1. package/dist/main.js +5 -5
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -63817,7 +63817,7 @@ const formatTransactionAmount = (num, maxDigits = 9) => {
63817
63817
  };
63818
63818
 
63819
63819
  const isBondSoldOut = (bill, showLowValueBonds) => {
63820
- var _a, _b, _c, _d, _e;
63820
+ var _a, _b, _c, _d;
63821
63821
  if (bill.soldOut)
63822
63822
  return true;
63823
63823
  if (bill.inactive)
@@ -63836,11 +63836,11 @@ const isBondSoldOut = (bill, showLowValueBonds) => {
63836
63836
  if (showLowValueBonds)
63837
63837
  return false;
63838
63838
  const thresholdToHide = new BigNumber$1(100).div(payoutTokenPrice !== null && payoutTokenPrice !== void 0 ? payoutTokenPrice : 0);
63839
- if (((_d = (_c = (_b = bill === null || bill === void 0 ? void 0 : bill.trueBondPrices) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.bonusWithFee) !== null && _d !== void 0 ? _d : 0) > 50) {
63839
+ if (((_c = (_b = findHighestTrueBondPrice('0', bill === null || bill === void 0 ? void 0 : bill.trueBondPrices)) === null || _b === void 0 ? void 0 : _b.bonusWithFee) !== null && _c !== void 0 ? _c : 0) > 50) {
63840
63840
  //if bonus is higher than 50% for regular bonds, hide them
63841
63841
  return true;
63842
63842
  }
63843
- if ((_e = new BigNumber$1(tokensRemaining)) === null || _e === void 0 ? void 0 : _e.lte(thresholdToHide)) {
63843
+ if ((_d = new BigNumber$1(tokensRemaining)) === null || _d === void 0 ? void 0 : _d.lte(thresholdToHide)) {
63844
63844
  // If there's less than 100 usd bond will be hidden
63845
63845
  return true;
63846
63846
  }
@@ -86270,7 +86270,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, isProjectView, setBillId }
86270
86270
  $${formatUSDNumber((parseFloat(inputValue) * parseFloat((_d = bondData === null || bondData === void 0 ? void 0 : bondData.principalTokenPrice) !== null && _d !== void 0 ? _d : '0')).toString())}`;
86271
86271
  // Validations
86272
86272
  const exceedsMaxBuy = maxBuy(bondData).lt(getPayoutAmount(bondData, depositAmount, '0'));
86273
- const exceedsBalance = false;
86273
+ const exceedsBalance = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0').lt(inputValue);
86274
86274
  // Loading State
86275
86275
  const [loadingTx, setLoadingTx] = useState(false);
86276
86276
  const load = loadingTx;
@@ -86460,7 +86460,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, isProjectView, setBillId }
86460
86460
  !inputValue ||
86461
86461
  parseFloat(inputValue) === 0 ||
86462
86462
  exceedsMaxBuy ||
86463
- exceedsBalance, onClick: handleOpenModal, sx: { width: ['100%', '100%', '100%', '65%'] }, children: exceedsMaxBuy ? 'Exceeds Max Buy' : `buy` })] })) }) })] }) })) : (jsx$2(Fragment$1, {}));
86463
+ exceedsBalance, onClick: handleOpenModal, sx: { width: ['100%', '100%', '100%', '65%'] }, children: exceedsMaxBuy ? 'Exceeds Max Buy' : exceedsBalance ? 'Insufficient balance' : `buy` })] })) }) })] }) })) : (jsx$2(Fragment$1, {}));
86464
86464
  };
86465
86465
 
86466
86466
  const BuyBondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, setBillId, }) => {
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": "4.0.0-test.34",
6
+ "version": "4.0.0-test.36",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",