@ape.swap/bonds-sdk 3.0.42 → 3.0.44

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.
package/dist/main.js CHANGED
@@ -18020,7 +18020,6 @@ var types = {};
18020
18020
  // ShadowExchangeV3 = 'ShadowExchangeV3',
18021
18021
  LiquidityDex['SwapX'] = 'SwapX';
18022
18022
  LiquidityDex['SwapXAlgebraIntegral'] = 'SwapXAlgebraIntegral';
18023
- LiquidityDex['Equalizer'] = 'Equalizer';
18024
18023
  //BERACHAIN
18025
18024
  LiquidityDex['KodiakV2'] = 'KodiakV2';
18026
18025
  LiquidityDex['KodiakV3'] = 'KodiakV3';
@@ -18381,7 +18380,6 @@ var types = {};
18381
18380
  // },
18382
18381
  (_p[LiquidityDex.SwapX] = {
18383
18382
  factory: '0x05c1be79d3aC21Cc4B727eeD58C9B2fF757F5663',
18384
- router: '0xF5F7231073b3B41c04BA655e1a7438b1a7b29c27',
18385
18383
  protocol: Protocols.Solidly,
18386
18384
  }),
18387
18385
  (_p[LiquidityDex.SwapXAlgebraIntegral] = {
@@ -18392,11 +18390,6 @@ var types = {};
18392
18390
  factory: '0x56CFC796bC88C9c7e1b38C2b0aF9B7120B079aef',
18393
18391
  protocol: Protocols.V3,
18394
18392
  }),
18395
- (_p[LiquidityDex.Equalizer] = {
18396
- factory: '0xDDD9845Ba0D8f38d3045f804f67A1a8B9A528FcC',
18397
- router: '0x7635cD591CFE965bE8beC60Da6eA69b6dcD27e4b',
18398
- protocol: Protocols.Solidly,
18399
- }),
18400
18393
  _p)),
18401
18394
  (_a[ChainId.MONAD_TESTNET] =
18402
18395
  ((_q = {}),
@@ -18708,7 +18701,6 @@ var types = {};
18708
18701
  (_8[LiquidityDex.TrebleAlgebraIntegral] = {}),
18709
18702
  (_8[LiquidityDex.KodiakV2] = {}),
18710
18703
  (_8[LiquidityDex.KodiakV3] = {}),
18711
- (_8[LiquidityDex.Equalizer] = {}),
18712
18704
  _8);
18713
18705
 
18714
18706
  } (types));
@@ -21917,6 +21909,17 @@ const findHighestTrueBondPrice = (userPoints, bondData) => {
21917
21909
  return currentPoints.isGreaterThan(highestPoints) ? current : highest;
21918
21910
  });
21919
21911
  };
21912
+ /**
21913
+ * Finds the TrueBondPrices element with the highest points in the array, regardless of user points.
21914
+ * @param bondData - Bond Data containing an array of TrueBondPrices to analyze.
21915
+ * @returns The TrueBondPrices element with the highest points, or `undefined` if no data is available.
21916
+ */
21917
+ const findHighestTrueBondPriceUserAgnostic = (bondData) => {
21918
+ var _a;
21919
+ if (!((_a = bondData === null || bondData === void 0 ? void 0 : bondData.trueBondPrices) === null || _a === void 0 ? void 0 : _a.length))
21920
+ return undefined;
21921
+ return bondData.trueBondPrices.reduce((highest, current) => new BigNumber$1(current.points).isGreaterThan(new BigNumber$1(highest.points)) ? current : highest);
21922
+ };
21920
21923
 
21921
21924
  var lensContractABI = [
21922
21925
  {
@@ -58135,13 +58138,16 @@ const multicall = (chainId, abi, calls, batch, batchSize) => __awaiter$9(void 0,
58135
58138
  }
58136
58139
  });
58137
58140
 
58138
- const boostMap = {
58141
+ /**
58142
+ * @deprecated This map is deprecated. Boost values are now being retrieved from the Realtime API.
58143
+ */
58144
+ ({
58139
58145
  [types.LaunchBondTiers.Bronze]: '+1%',
58140
58146
  [types.LaunchBondTiers.Silver]: '+2%',
58141
58147
  [types.LaunchBondTiers.Gold]: '+3%',
58142
58148
  [types.LaunchBondTiers.Diamond]: '+4%',
58143
58149
  [types.LaunchBondTiers.Legend]: '+5%',
58144
- };
58150
+ });
58145
58151
  const TIERS_COLORS = {
58146
58152
  [types.LaunchBondTiers.Bronze]: 'linear-gradient(90deg, #473129 0%, #33231D 100%)',
58147
58153
  [types.LaunchBondTiers.Silver]: 'linear-gradient(90deg, #3A3A3C 0%, #2C2C2F 100%)',
@@ -58254,7 +58260,7 @@ const BonusTable = ({ bond, hideTitle }) => {
58254
58260
  return (jsxs(Flex, { sx: { width: '100%', flexDirection: 'column' }, children: [!hideTitle && jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center', mb: '10px' }, children: "Ape Tier Bonuses" }), bond.trueBondPrices
58255
58261
  .sort((a, b) => new BigNumber$1(b.points).minus(new BigNumber$1(a.points)).toNumber())
58256
58262
  .map((tier, i) => {
58257
- var _a, _b;
58263
+ var _a, _b, _c;
58258
58264
  const tierToUse = getUserTier(tier.points);
58259
58265
  const tierName = `${TIERS_NAMES[tierToUse]}`;
58260
58266
  const you = tier.points === (usersTrueBondPrices === null || usersTrueBondPrices === void 0 ? void 0 : usersTrueBondPrices.points);
@@ -58274,7 +58280,7 @@ const BonusTable = ({ bond, hideTitle }) => {
58274
58280
  px: '4px',
58275
58281
  ml: '3px',
58276
58282
  color: 'success',
58277
- }, children: boostMap[tierToUse] }))] }))] }, tier.points));
58283
+ }, children: `+${(_c = tier === null || tier === void 0 ? void 0 : tier.boost) !== null && _c !== void 0 ? _c : 0}%` }))] }))] }, tier.points));
58278
58284
  }), !hideTitle && (jsx$2(Button, { variant: "secondary", sx: { width: '100%', mt: '10px' }, onClick: () => window.open('https://ape.bond/tier-staking', '_blank'), children: "get tier" }))] }));
58279
58285
  };
58280
58286
 
@@ -76556,7 +76562,7 @@ const BondCards = ({ bondData }) => {
76556
76562
  };
76557
76563
 
76558
76564
  const Estimations = ({ depositAmount, bondData, youSpendString, isZap, fetchingZapQuote, zapError, }) => {
76559
- var _a, _b, _c, _d;
76565
+ var _a, _b, _c, _d, _e;
76560
76566
  const { data: userPoints } = useTierPoints();
76561
76567
  const trueBondPrice = findHighestTrueBondPrice(userPoints, bondData);
76562
76568
  const SDKConfig = useSDKConfig();
@@ -76586,7 +76592,7 @@ const Estimations = ({ depositAmount, bondData, youSpendString, isZap, fetchingZ
76586
76592
  background: 'primaryButton',
76587
76593
  opacity: 0.3,
76588
76594
  borderRadius: 'normal',
76589
- } }), jsxs(Flex, { className: "row-container premium", sx: { zIndex: 1 }, children: [jsx$2("img", { src: `/images/launch/${tierName === null || tierName === void 0 ? void 0 : tierName.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { color: 'success', mr: '3px', fontWeight: 700 }, children: boostMap[userTier] }), "Boost:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Boost }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val premium-positive`, children: ["$ ", formatUSDNumber(boostAmount.toString())] }))] })), !!bondData.feeInPayout && (jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["Fee:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["This is the platform fee (", bondData.feeInPayout, "%)."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val`, children: ["$ ", formatUSDNumber(feeUSD.toString())] }))] })), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You Get (over ", vestingTime(((_c = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _c !== void 0 ? _c : 0) - ((_d = bondData.vestingCliff) !== null && _d !== void 0 ? _d : 0)).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumber$1(estimatedOutputAmount.toString()), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatUSDNumber(estimatedOutputUSD.toString())] }))] })] }));
76595
+ } }), jsxs(Flex, { className: "row-container premium", sx: { zIndex: 1 }, children: [jsx$2("img", { src: `/images/launch/${tierName === null || tierName === void 0 ? void 0 : tierName.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { color: 'success', mr: '3px', fontWeight: 700 }, children: `+${(_c = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _c !== void 0 ? _c : 0}%` }), "Boost:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Boost }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val premium-positive`, children: ["$ ", formatUSDNumber(boostAmount.toString())] }))] })), !!bondData.feeInPayout && (jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["Fee:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["This is the platform fee (", bondData.feeInPayout, "%)."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val`, children: ["$ ", formatUSDNumber(feeUSD.toString())] }))] })), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You Get (over ", vestingTime(((_d = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _d !== void 0 ? _d : 0) - ((_e = bondData.vestingCliff) !== null && _e !== void 0 ? _e : 0)).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumber$1(estimatedOutputAmount.toString()), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatUSDNumber(estimatedOutputUSD.toString())] }))] })] }));
76590
76596
  };
76591
76597
 
76592
76598
  const ProjectDescription = ({ description, isProjectView }) => {
@@ -76708,12 +76714,14 @@ const getTierProofSig = (apiAddress, account, bondAddress, chainId) => __awaiter
76708
76714
  });
76709
76715
 
76710
76716
  const GetUpToComponent = ({ bond, depositAmount }) => {
76717
+ var _a;
76711
76718
  // Hooks & Data
76712
76719
  const { data: userPoints } = useTierPoints();
76713
76720
  const userTier = getUserTier(userPoints);
76714
76721
  const bonusString = getRawBonus$1(bond, depositAmount, TIERS_WEIGHT[types.LaunchBondTiers.Legend]);
76715
76722
  const noTierAmount = getRawBonus$1(bond, depositAmount, '0');
76716
76723
  const boostAmount = parseFloat(bonusString) - parseFloat(noTierAmount);
76724
+ const trueBondPrice = findHighestTrueBondPriceUserAgnostic(bond);
76717
76725
  //State
76718
76726
  const [isOpen, setIsOpen] = useState(false);
76719
76727
  return (userTier !== types.LaunchBondTiers.Legend &&
@@ -76744,7 +76752,7 @@ const GetUpToComponent = ({ bond, depositAmount }) => {
76744
76752
  zIndex: 0,
76745
76753
  background: 'primaryButton',
76746
76754
  opacity: 0.3,
76747
- } }), jsxs(Flex, { sx: { alignItems: 'center', display: ['ruby', 'ruby', 'ruby', 'flex'] }, children: [jsx$2("img", { src: `/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), "Get up to", jsx$2(Flex, { sx: { color: 'success', mx: '3px', fontWeight: 700 }, children: boostMap[types.LaunchBondTiers.Legend] }), "Boost By locking ABOND"] }), jsxs(Flex, { sx: { color: 'success', fontWeight: 700, minWidth: '65px', justifyContent: 'flex-end' }, children: ["$ ", formatUSDNumber(boostAmount.toString()), jsx$2(Flex, { sx: { ml: '4px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down' }) })] })] }), jsx$2(AnimatePresence, { children: isOpen && (jsx$2(motion.div, { initial: { height: 0 }, animate: { height: 'fit-content' }, transition: { opacity: { duration: 0.2 } }, exit: { height: 0 }, sx: { overflow: 'hidden', width: '100%', marginTop: '5px' }, children: jsx$2(BonusTable, { bond: bond, hideTitle: true }) })) })] })));
76755
+ } }), jsxs(Flex, { sx: { alignItems: 'center', display: ['ruby', 'ruby', 'ruby', 'flex'] }, children: [jsx$2("img", { src: `/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), "Get up to", jsx$2(Flex, { sx: { color: 'success', mx: '3px', fontWeight: 700 }, children: `+${(_a = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _a !== void 0 ? _a : 0}%` }), "Boost By locking ABOND"] }), jsxs(Flex, { sx: { color: 'success', fontWeight: 700, minWidth: '65px', justifyContent: 'flex-end' }, children: ["$ ", formatUSDNumber(boostAmount.toString()), jsx$2(Flex, { sx: { ml: '4px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down' }) })] })] }), jsx$2(AnimatePresence, { children: isOpen && (jsx$2(motion.div, { initial: { height: 0 }, animate: { height: 'fit-content' }, transition: { opacity: { duration: 0.2 } }, exit: { height: 0 }, sx: { overflow: 'hidden', width: '100%', marginTop: '5px' }, children: jsx$2(BonusTable, { bond: bond, hideTitle: true }) })) })] })));
76748
76756
  };
76749
76757
 
76750
76758
  const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isProjectView }) => {
@@ -77015,7 +77023,8 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
77015
77023
  justifyContent: 'center',
77016
77024
  mt: '10px',
77017
77025
  borderRadius: 'normal',
77018
- }, children: jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, p: '2px 10px' }, children: jsx$2(SafeHTMLComponent, { html: bondData === null || bondData === void 0 ? void 0 : bondData.warningCard }) }) })), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (jsx$2(Flex, { className: "button-container get", children: jsx$2(Button, { className: "action-button", onClick: () => bondData.billVersion === types.BillVersion.V4 && SDKConfig.useTiers
77026
+ p: '2px 10px',
77027
+ }, children: jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400, display: 'flex', alignItems: 'center', gap: '10px' }, children: [jsx$2(SafeHTMLComponent, { html: bondData === null || bondData === void 0 ? void 0 : bondData.warningCard }), (bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === types.ChainId.SONIC && (bondData === null || bondData === void 0 ? void 0 : bondData.earnToken.symbol.toLowerCase()) === 'moon' && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Open the 'cog' icon menu in the top right and set the Slippage Tolerance to 5% or more." }), width: '315px', placement: 'topRight', transformTip: 'translate(9%, -10%)', children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) }))] }) })), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (jsx$2(Flex, { className: "button-container get", children: jsx$2(Button, { className: "action-button", onClick: () => bondData.billVersion === types.BillVersion.V4 && SDKConfig.useTiers
77019
77028
  ? window.open('http://ape.bond/tier-staking', '_blank')
77020
77029
  : zapEnabled
77021
77030
  ? handleOpenZapModal()
@@ -1,4 +1,7 @@
1
1
  import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
2
+ /**
3
+ * @deprecated This map is deprecated. Boost values are now being retrieved from the Realtime API.
4
+ */
2
5
  export declare const boostMap: {
3
6
  0: string;
4
7
  1: string;
@@ -4,6 +4,7 @@ export interface TrueBondPrices {
4
4
  trueBondPrice: string;
5
5
  bonus: number;
6
6
  bonusWithFee: number;
7
+ boost?: number;
7
8
  }
8
9
  export interface BondsData {
9
10
  index?: number;
@@ -6,3 +6,9 @@ import { BondsData, TrueBondPrices } from '../../types/bonds';
6
6
  * @returns The highest TrueBondPrices element where userPoints is higher than the item's points, or `undefined` if none matches.
7
7
  */
8
8
  export declare const findHighestTrueBondPrice: (userPoints?: string | null, bondData?: BondsData) => TrueBondPrices;
9
+ /**
10
+ * Finds the TrueBondPrices element with the highest points in the array, regardless of user points.
11
+ * @param bondData - Bond Data containing an array of TrueBondPrices to analyze.
12
+ * @returns The TrueBondPrices element with the highest points, or `undefined` if no data is available.
13
+ */
14
+ export declare const findHighestTrueBondPriceUserAgnostic: (bondData?: BondsData) => TrueBondPrices;
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": "3.0.42",
6
+ "version": "3.0.44",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",