@ape.swap/bonds-sdk 4.0.0-test.33 → 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 +7 -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
  }
@@ -86253,7 +86253,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, isProjectView, setBillId }
86253
86253
  const { publicKey: accountSolana, signTransaction } = useWallet();
86254
86254
  const { data: bonds } = useBondsData();
86255
86255
  const { addToastError, addToastSuccess } = usePopups();
86256
- const [slippage] = useSlippage();
86256
+ useSlippage();
86257
86257
  const bondData = bonds === null || bonds === void 0 ? void 0 : bonds.find((bond) => { var _a, _b; return ((_b = (_a = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond === null || bond === void 0 ? void 0 : bond.chainId]) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === (bondAddress === null || bondAddress === void 0 ? void 0 : bondAddress.toLowerCase()); });
86258
86258
  // Tier Gating
86259
86259
  const trueBondPriceData = findHighestTrueBondPrice('0', bondData === null || bondData === void 0 ? void 0 : bondData.trueBondPrices);
@@ -86300,6 +86300,8 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, isProjectView, setBillId }
86300
86300
  const amountBigInt = BigInt(depositAmount.toFixed(0));
86301
86301
  const user = accountSolana;
86302
86302
  const trueBondPriceWithoutFee = (_c = (_b = bondData === null || bondData === void 0 ? void 0 : bondData.trueBondPrices) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.trueBondPrice;
86303
+ const feeInPrincipal = bondData === null || bondData === void 0 ? void 0 : bondData.feeInPrincipal;
86304
+ const slippage = 0.5 - (feeInPrincipal !== null && feeInPrincipal !== void 0 ? feeInPrincipal : 0);
86303
86305
  const maxPrice = new BigNumber$1(trueBondPriceWithoutFee !== null && trueBondPriceWithoutFee !== void 0 ? trueBondPriceWithoutFee : '0')
86304
86306
  .times((100 + slippage) / 100)
86305
86307
  .dividedBy(new BigNumber$1(1e6))
@@ -86512,7 +86514,7 @@ const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
86512
86514
  setTimeout(() => {
86513
86515
  console.log('Trigger');
86514
86516
  refetch();
86515
- }, 1000);
86517
+ }, 1500);
86516
86518
  }
86517
86519
  /* eslint-disable react-hooks/exhaustive-deps */
86518
86520
  }, [billId]);
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.33",
6
+ "version": "4.0.0-test.36",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",