@ape.swap/bonds-sdk 3.0.33 → 3.0.35

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
@@ -58384,11 +58384,13 @@ const getVestingTermsTooltipString = (bond) => {
58384
58384
  const vestingCliffString = getTimePeriods(vestingCliff);
58385
58385
  return `${vestingCliffString.days} days cliff + ${vestingTime.days} days linear vesting.`;
58386
58386
  };
58387
- const discountEarnTokenPrice = (bond) => {
58388
- var _a, _b;
58389
- const earnTokenPrice = parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0');
58390
- const trueBondPrice = findHighestTrueBondPrice(TIERS_WEIGHT[types.LaunchBondTiers.Legend], bond);
58391
- return getFirstNonZeroDigits(earnTokenPrice - earnTokenPrice * (((_b = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.bonusWithFee) !== null && _b !== void 0 ? _b : 0) / 100));
58387
+ const discountEarnTokenPrice = (bond, useTiers) => {
58388
+ var _a, _b, _c;
58389
+ const fee = (_a = bond === null || bond === void 0 ? void 0 : bond.feeInPayout) !== null && _a !== void 0 ? _a : 0;
58390
+ const principalTokenPrice = parseFloat((_b = bond.principalTokenPrice) !== null && _b !== void 0 ? _b : '0');
58391
+ const trueBondPrice = (_c = findHighestTrueBondPrice(useTiers ? TIERS_WEIGHT[types.LaunchBondTiers.Legend] : '0', bond)) === null || _c === void 0 ? void 0 : _c.trueBondPrice;
58392
+ const trueBondPriceWithFee = getBalanceNumber(new BigNumber$1(trueBondPrice).times((100 + fee) / 100));
58393
+ return getFirstNonZeroDigits(principalTokenPrice * trueBondPriceWithFee);
58392
58394
  };
58393
58395
  const maxBuy = (bond) => {
58394
58396
  var _a, _b, _c, _d, _e, _f;
@@ -70868,7 +70870,7 @@ const ButtonsRow = ({ projectLink, twitter, bubble, audit, chain }) => {
70868
70870
  };
70869
70871
 
70870
70872
  const ExpandedViewButton = ({ handleNavigation, rightPos }) => {
70871
- return (jsx$2(Flex, { sx: { justifyContent: 'flex-end', position: 'absolute', top: '6px', right: rightPos !== null && rightPos !== void 0 ? rightPos : '10px', width: '122px' }, children: jsxs(Flex, { sx: {
70873
+ return (jsx$2(Flex, { sx: { justifyContent: 'flex-end', position: 'absolute', top: '6px', right: rightPos !== null && rightPos !== void 0 ? rightPos : '35px', width: '122px' }, children: jsxs(Flex, { sx: {
70872
70874
  fontSize: '12px',
70873
70875
  fontWeight: 500,
70874
70876
  mr: '15px',
@@ -71525,18 +71527,19 @@ const ClaimAll = () => {
71525
71527
  const { address: account } = useAccount();
71526
71528
  const [onOpenModal] = useModal(jsx$2(ClaimAllModal, {}));
71527
71529
  return (jsx$2(Button, { onClick: onOpenModal, disabled: !account, sx: {
71528
- height: ['36px', '36px', '36px', '26px'],
71530
+ height: '30px',
71529
71531
  lineHeight: '12px',
71530
71532
  fontSize: '14px',
71531
71533
  fontWeight: 600,
71532
71534
  width: '100%',
71533
71535
  opacity: 1,
71536
+ ml: ['10px', '10px', '10px', '0'],
71534
71537
  }, children: "Claim All" }));
71535
71538
  };
71536
71539
 
71537
71540
  const YourBondsMenu = ({ chainFilterOption, setChainFilterOption, filterOptions, filterOption, setFilterOption, setInputValue, inputValue, handleSort, }) => {
71538
71541
  const SDKConfig = useSDKConfig();
71539
- return (jsxs("div", { className: "bonds-menu", children: [jsx$2(BondFilters, { chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: setFilterOption, onHandleQueryChange: () => setInputValue('') }), jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container", children: jsx$2(Flex$1, { sx: { width: '100%', maxWidth: '300px' }, children: jsx$2(Input, { className: "search-input", value: inputValue, onChange: (event) => setInputValue(event.target.value), variant: "search", sx: { fontWeight: 600, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('claimable'), children: ["CLAIMABLE", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('pending'), children: ["PENDING", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2(Flex$1, { className: "claim-all-button-container", children: SDKConfig.referenceId === 'apebond' && jsx$2(ClaimAll, {}) })] })] })] }));
71542
+ return (jsxs("div", { className: "bonds-menu", children: [jsx$2(BondFilters, { chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: setFilterOption, onHandleQueryChange: () => setInputValue('') }), jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container", children: jsx$2(Flex$1, { sx: { width: '100%', maxWidth: '300px' }, children: jsx$2(Input, { className: "search-input", value: inputValue, onChange: (event) => setInputValue(event.target.value), variant: "search", sx: { fontWeight: 600, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) }) }), jsxs("div", { className: "headers-container", sx: { pr: ['0', '0', '0', '20px'] }, children: [jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('claimable'), children: ["CLAIMABLE", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('pending'), children: ["PENDING", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2(Flex$1, { className: "claim-all-button-container", children: SDKConfig.referenceId === 'apebond' && jsx$2(ClaimAll, {}) })] })] })] }));
71540
71543
  };
71541
71544
 
71542
71545
  const YourBonds = ({ showOnly }) => {
@@ -76246,13 +76249,14 @@ const BondModalMinTierHeader = ({ minTier }) => {
76246
76249
  width: ['100%', '100%', '100%', 'auto', 'auto'],
76247
76250
  }, children: Object.values(TIERS_NAMES).map((tier, index) => {
76248
76251
  if (index >= minTier) {
76249
- return (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { sx: { justifyContent: 'center' }, children: tier }), width: "100px", placement: "bottomLeft", transformTip: "translate(1%, -5%)", children: jsx$2("img", { src: `/images/launch/${tier.toLowerCase()}.png`, alt: "minTier", style: { width: '30px', height: '30px', marginLeft: '3px', zIndex: 1 } }, `tier-logo-${index}`) }, tier));
76252
+ return (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { sx: { justifyContent: 'center' }, children: tier }), width: "100px", placement: "bottomLeft", transformTip: "translate(1%, -5%)", children: jsx$2("img", { src: `/images/launch/${tier.toLowerCase()}.png`, alt: "minTier", style: { width: '25px', height: '25px', marginLeft: '3px', zIndex: 1 } }, `tier-logo-${index}`) }, tier));
76250
76253
  }
76251
76254
  }) })) }));
76252
76255
  };
76253
76256
 
76254
76257
  const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
76255
76258
  var _a, _b;
76259
+ const SDKConfig = useSDKConfig();
76256
76260
  const [onOpenSlippageModal] = useModal(jsx$2(SlippageModal, {}));
76257
76261
  const minTier = bondData.minTier !== undefined ? bondData.minTier : null;
76258
76262
  const handleClose = () => {
@@ -76273,7 +76277,32 @@ const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
76273
76277
  },
76274
76278
  });
76275
76279
  };
76276
- return (jsxs(Flex, { className: "modaltable-container title-container", sx: { flexDirection: 'column', justifyContent: 'center', alignItems: 'start' }, children: [jsxs(Flex, { className: "slipagge-close-icon", sx: { width: '100%', height: '30px', mb: ['10px', '10px', '10px', '0px'] }, children: [jsx$2(Flex, { sx: { display: ['flex', 'flex', 'flex', 'none', 'none'] }, children: jsx$2(BondModalMinTierHeader, { minTier: minTier }) }), jsx$2(Flex, { sx: { flexDirection: 'column', position: 'absolute', right: '0px' }, children: onDismiss ? (jsxs(Fragment$1, { children: [showProjectInfoButton && jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation }), jsx$2(IconButton, { icon: "close", color: "text", variant: "transparent", onClick: handleClose }), jsx$2(Flex, { sx: { py: '3px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })] })) : (jsx$2(Flex, { sx: { py: '3px', mt: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) })] }), jsxs(Flex, { sx: { width: '100%' }, children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: (_a = bondData.showcaseTokenName) !== null && _a !== void 0 ? _a : bondData.earnToken.symbol, size: 50, chain: bondData.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, jsx$2(ListTag, { text: (_b = bondData === null || bondData === void 0 ? void 0 : bondData.tags) === null || _b === void 0 ? void 0 : _b[0] })] }), jsxs(Flex, { className: "title-container price-container", sx: { flexDirection: 'column', paddingLeft: '20px' }, children: [jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bondData)] }), jsxs(Flex, { className: "price-container discounted", children: ["$", discountEarnTokenPrice(bondData)] })] }), jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex', 'flex'], ml: '10px' }, children: jsx$2(BondModalMinTierHeader, { minTier: minTier }) })] })] }));
76280
+ return (jsxs(Flex, { className: "modaltable-container title-container", sx: { flexDirection: 'column', justifyContent: 'center', alignItems: 'start' }, children: [jsxs(Flex, { sx: {
76281
+ width: '100%',
76282
+ height: '30px',
76283
+ mb: ['10px', '10px', '10px', '0px'],
76284
+ justifyContent: ['space-between', 'space-between', 'space-between', 'flex-end'],
76285
+ }, children: [jsx$2(Flex, { sx: { display: ['flex', 'flex', 'flex', 'none'] }, children: jsx$2(BondModalMinTierHeader, { minTier: minTier }) }), jsx$2(Flex, { sx: { cursor: 'pointer' }, children: onDismiss ? (jsxs(Fragment$1, { children: [showProjectInfoButton && jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation }), jsx$2(Flex, { sx: { mx: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) }), jsx$2(Flex, { onClick: handleClose, children: jsx$2(Svg, { icon: "close", color: "text" }) })] })) : (jsx$2(Flex, { sx: { py: '3px', mt: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) })] }), jsxs(Flex, { sx: { width: '100%' }, children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: (_a = bondData.showcaseTokenName) !== null && _a !== void 0 ? _a : bondData.earnToken.symbol, size: 50, chain: bondData.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, jsx$2(ListTag, { text: (_b = bondData === null || bondData === void 0 ? void 0 : bondData.tags) === null || _b === void 0 ? void 0 : _b[0] })] }), jsxs(Flex, { className: "title-container price-container", sx: { flexDirection: 'column', pl: '20px' }, children: [jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bondData)] }), SDKConfig.useTiers ? (jsxs(Flex, { sx: {
76286
+ p: '3px 6px',
76287
+ border: '1px solid var(--theme-ui-colors-primaryButton)',
76288
+ borderRadius: 'normal',
76289
+ background: 'transparent',
76290
+ position: 'relative',
76291
+ overflow: 'hidden',
76292
+ }, children: [jsx$2(Flex, { sx: {
76293
+ position: 'absolute',
76294
+ width: '100%',
76295
+ height: '100%',
76296
+ top: 0,
76297
+ left: 0,
76298
+ zIndex: 1,
76299
+ background: 'primaryButton',
76300
+ opacity: 0.3,
76301
+ } }), jsxs(Flex, { sx: { width: '100%', zIndex: 2, alignItems: 'center' }, children: [jsx$2("img", { src: `/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { fontSize: '14px', mr: '3px' }, children: "Up to" }), jsxs(Flex, { sx: {
76302
+ color: findHighestTrueBondPrice(TIERS_WEIGHT[types.LaunchBondTiers.Legend], bondData).bonusWithFee > 0
76303
+ ? 'success'
76304
+ : 'error',
76305
+ }, children: ["$", discountEarnTokenPrice(bondData, true)] })] })] })) : (jsxs(Flex, { sx: { fontSize: '24px', fontWeight: 700 }, children: ["$", discountEarnTokenPrice(bondData)] }))] }), jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex'], ml: '10px' }, children: jsx$2(BondModalMinTierHeader, { minTier: minTier }) })] })] }));
76277
76306
  };
76278
76307
 
76279
76308
  const YouTooltip = () => {
@@ -77724,7 +77753,7 @@ const SelectItem = (_a) => {
77724
77753
  };
77725
77754
 
77726
77755
  const ListTag = ({ text = '' }) => {
77727
- return (jsx$2(Flex, { className: "list-tag", sx: {
77756
+ return (jsx$2(Flex, { sx: {
77728
77757
  background: '#3C6AB530',
77729
77758
  color: '#3b78d3',
77730
77759
  fontSize: '10px',
@@ -77733,6 +77762,7 @@ const ListTag = ({ text = '' }) => {
77733
77762
  p: '2px 6px',
77734
77763
  borderRadius: '5px',
77735
77764
  ml: '5px',
77765
+ width: 'fit-content',
77736
77766
  }, children: text }));
77737
77767
  };
77738
77768
 
package/dist/styles.css CHANGED
@@ -169,14 +169,6 @@
169
169
  flex-direction: column;
170
170
  }
171
171
 
172
- .modaltable-container.title-container {
173
- width: 100%;
174
- font-weight: bold;
175
- font-size: 1.5rem;
176
- display: flex;
177
- align-items: center;
178
- }
179
-
180
172
  .title-container.bondicon {
181
173
  display: flex;
182
174
  flex-direction: row;
@@ -219,8 +211,9 @@
219
211
  .title-container.bondname {
220
212
  display: flex;
221
213
  flex-direction: column;
222
- align-items: center;
223
214
  padding-left: 20px;
215
+ font-size: 24px;
216
+ font-weight: 700;
224
217
  }
225
218
 
226
219
  .title-container.bondname-small {
@@ -234,11 +227,7 @@
234
227
  font-size: 14px;
235
228
  text-decoration: line-through;
236
229
  opacity: 0.5;
237
- font-weight: 600;
238
- }
239
-
240
- .price-container.discounted {
241
- display: flex;
230
+ font-weight: 400;
242
231
  }
243
232
 
244
233
  .title-container.tokentags {
@@ -713,10 +702,6 @@ span.flex-inline {
713
702
  .bond-row.gold-rush {
714
703
  background: linear-gradient(90deg, rgba(227, 164, 85, 0.6) 7%, rgba(103, 61, 34, 0.6) 18%, rgba(246, 219, 166, 0.6) 36%, rgba(255, 235, 195, 0.6) 43%, rgba(240, 190, 121, 0.6) 53%, rgba(238, 188, 112, 0.6) 77%, rgba(63, 31, 15, 0.6) 92%), linear-gradient(0deg, #FFAE00 0%, #FFAE00 100%), var(--Neutral-Elevation-1, #161420);
715
704
  }
716
- .bond-row.gold-rush .list-tag {
717
- color: white;
718
- background: linear-gradient(99.09deg, #A16552 0%, #FFB300 106.96%);
719
- }
720
705
  .bond-row.gold-rush .gold-ribbon {
721
706
  display: block;
722
707
  }
@@ -813,9 +798,14 @@ span.flex-inline {
813
798
  .bonds-menu .table-header-container {
814
799
  display: flex;
815
800
  width: 100%;
816
- padding: 20px 0 10px 0;
817
801
  justify-content: space-between;
818
802
  overflow: hidden;
803
+ padding: 10px 0;
804
+ }
805
+ @media screen and (min-width: 1000px) {
806
+ .bonds-menu .table-header-container {
807
+ padding: 20px 0 10px 0;
808
+ }
819
809
  }
820
810
  .bonds-menu .search-container {
821
811
  display: flex;
@@ -19,7 +19,7 @@ export declare const vestingTimeRemainingString: (userBill?: UserBill) => string
19
19
  export declare const getPendingVestingString: (bond?: UserBill) => string;
20
20
  export declare const getVestingTermsString: (bond?: BondsData | BillsConfig) => string;
21
21
  export declare const getVestingTermsTooltipString: (bond?: BondsData | BillsConfig) => string;
22
- export declare const discountEarnTokenPrice: (bond: BondsData) => string;
22
+ export declare const discountEarnTokenPrice: (bond: BondsData, useTiers?: boolean) => string;
23
23
  export declare const maxBuy: (bond: BondsData) => BigNumber;
24
24
  export declare function formatNumber(input: string): string;
25
25
  export declare function formatUSDNumber(input: string): string;
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.33",
6
+ "version": "3.0.35",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",