@ape.swap/bonds-sdk 4.2.3-test.1 → 4.2.3-test.3

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.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SvgProps } from './types';
3
+ declare const TurnArrow: React.FC<SvgProps>;
4
+ export default TurnArrow;
@@ -1,4 +1,5 @@
1
1
  export declare enum icons {
2
+ TURN_ARROW = "turnArrow",
2
3
  CARET = "caret",
3
4
  EXTERNAL = "external",
4
5
  MORE = "more",
@@ -1,2 +1 @@
1
- import { BondsData } from '../types/bonds';
2
- export declare const useTopTags: (initialBondList?: BondsData[]) => string[];
1
+ export declare const useTopTags: () => string[];
package/dist/main.js CHANGED
@@ -4219,6 +4219,7 @@ var tslib_es6$1 = /*#__PURE__*/Object.freeze({
4219
4219
 
4220
4220
  var icons;
4221
4221
  (function (icons) {
4222
+ icons["TURN_ARROW"] = "turnArrow";
4222
4223
  icons["CARET"] = "caret";
4223
4224
  icons["EXTERNAL"] = "external";
4224
4225
  icons["MORE"] = "more";
@@ -4849,6 +4850,10 @@ const BASE$1 = ({ width }) => {
4849
4850
  return (jsxs("svg", { width: width || '30', height: width || '30', viewBox: "0 0 30 30", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx$2("rect", { width: "30", height: "30", fill: "#0052FF" }), jsx$2("path", { d: "M14.9646 25.5633C20.7986 25.5633 25.528 20.8339 25.528 14.9999C25.528 9.16591 20.7986 4.43652 14.9646 4.43652C9.43001 4.43652 4.88952 8.69296 4.43809 14.1109H20.1134V15.87H4.43652C4.87896 21.297 9.42354 25.5633 14.9646 25.5633Z", fill: "white" })] }));
4850
4851
  };
4851
4852
 
4853
+ const TurnArrow = ({ width }) => {
4854
+ return (jsx$2("svg", { xmlns: "http://www.w3.org/2000/svg", width: width || '30', height: width || '30', viewBox: "0 0 24 24", sx: { transform: 'rotate(270deg)' }, children: jsxs("g", { fill: "none", stroke: "#73728E", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "0.5", children: [jsx$2("path", { d: "m14 15l-5 5l-5-5" }), jsx$2("path", { d: "M20 4h-7a4 4 0 0 0-4 4v12" })] }) }));
4855
+ };
4856
+
4852
4857
  const Svg = (_a) => {
4853
4858
  var { icon } = _a, props = __rest(_a, ["icon"]);
4854
4859
  const getStyles = ({ degree, color, margin }) => dynamicStyles$1.generic({
@@ -4933,6 +4938,8 @@ const Svg = (_a) => {
4933
4938
  return jsx$2(Timer, Object.assign({}, props, { getStyles: getStyles }));
4934
4939
  case icons.TICK:
4935
4940
  return jsx$2(Tick, Object.assign({}, props, { getStyles: getStyles }));
4941
+ case icons.TURN_ARROW:
4942
+ return jsx$2(TurnArrow, Object.assign({}, props, { getStyles: getStyles }));
4936
4943
  // ONLY TOKENS BELOW
4937
4944
  case icons.BLAST:
4938
4945
  return jsx$2(BLAST, Object.assign({}, props, { getStyles: getStyles }));
@@ -75998,8 +76005,9 @@ const ExpandedViewButton = ({ handleNavigation, rightPos }) => {
75998
76005
  const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, projectLink, twitter, audit, chain, isSoldOut = false, billType, }) => {
75999
76006
  const config = useSDKConfig();
76000
76007
  const explorerLink = BLOCK_EXPLORER[chain];
76001
- const tokenLink = `${explorerLink}/address/${earnTokenContract}`;
76002
- const bondLink = `${explorerLink}/address/${bondContract}`;
76008
+ const urlPage = chain === main.ChainId.SOL ? 'account' : 'address';
76009
+ const tokenLink = `${explorerLink}/${urlPage}/${earnTokenContract}`;
76010
+ const bondLink = `${explorerLink}/${urlPage}/${bondContract}`;
76003
76011
  const bondDashboard = `https://dashboard.ape.bond/bond/${bondContract}`;
76004
76012
  const handleProjectViewNavigation = () => {
76005
76013
  window.location.href = `/bonds/${bondContract}/${chain}`;
@@ -76669,39 +76677,44 @@ const YourBonds = ({ showOnly }) => {
76669
76677
  };
76670
76678
 
76671
76679
  // This basically returns the 2 tags with the higher active bond count
76672
- const useTopTags = (initialBondList) => {
76680
+ const useTopTags = () => {
76681
+ const { data: bonds } = useBondsData();
76673
76682
  const SDKConfig = useSDKConfig();
76674
76683
  const chains = SDKConfig.chains;
76675
- const bonds = initialBondList;
76676
- const countTagsInBonds = (bonds) => {
76677
- const tagCount = {};
76678
- bonds === null || bonds === void 0 ? void 0 : bonds.forEach((bond) => {
76679
- var _a;
76680
- if (bond.soldOut)
76681
- return;
76682
- (_a = bond.tags) === null || _a === void 0 ? void 0 : _a.forEach((tag) => {
76683
- if (tag in tagCount) {
76684
- tagCount[tag] += 1;
76685
- }
76686
- else {
76687
- tagCount[tag] = 1;
76688
- }
76684
+ return useMemo(() => {
76685
+ if (!bonds || bonds.length === 0)
76686
+ return [];
76687
+ const countTagsInBonds = (bonds) => {
76688
+ const tagCount = {};
76689
+ bonds === null || bonds === void 0 ? void 0 : bonds.forEach((bond) => {
76690
+ var _a;
76691
+ if (bond.soldOut)
76692
+ return;
76693
+ (_a = bond.tags) === null || _a === void 0 ? void 0 : _a.forEach((tag) => {
76694
+ if (tag in tagCount) {
76695
+ tagCount[tag] += 1;
76696
+ }
76697
+ else {
76698
+ tagCount[tag] = 1;
76699
+ }
76700
+ });
76689
76701
  });
76702
+ return tagCount;
76703
+ };
76704
+ const activeBonds = bonds === null || bonds === void 0 ? void 0 : bonds.filter((bond) => !bond.soldOut && (chains === null || chains === void 0 ? void 0 : chains.includes(bond.chainId)));
76705
+ const filteredBonds = activeBonds === null || activeBonds === void 0 ? void 0 : activeBonds.filter((bond) => {
76706
+ var _a, _b;
76707
+ if (SDKConfig.bondPartner) {
76708
+ return ((_a = bond === null || bond === void 0 ? void 0 : bond.bondPartner) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.bondPartner) === null || _b === void 0 ? void 0 : _b.toLowerCase());
76709
+ }
76710
+ else
76711
+ return true;
76690
76712
  });
76691
- return tagCount;
76692
- };
76693
- const activeBonds = bonds === null || bonds === void 0 ? void 0 : bonds.filter((bond) => !bond.soldOut && (chains === null || chains === void 0 ? void 0 : chains.includes(bond.chainId)));
76694
- const filteredBonds = activeBonds === null || activeBonds === void 0 ? void 0 : activeBonds.filter((bond) => {
76695
- var _a, _b;
76696
- if (SDKConfig.bondPartner) {
76697
- return ((_a = bond === null || bond === void 0 ? void 0 : bond.bondPartner) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.bondPartner) === null || _b === void 0 ? void 0 : _b.toLowerCase());
76698
- }
76699
- else
76700
- return true;
76701
- });
76702
- const countedTags = countTagsInBonds(filteredBonds);
76703
- const sortedTagsArray = Object.entries(countedTags).sort((a, b) => b[1] - a[1]);
76704
- return sortedTagsArray.slice(0, 2).map((tagCountArray) => tagCountArray[0]);
76713
+ const countedTags = countTagsInBonds(filteredBonds);
76714
+ const sortedTagsArray = Object.entries(countedTags).sort((a, b) => b[1] - a[1]);
76715
+ return sortedTagsArray.slice(0, 2).map((tagCountArray) => tagCountArray[0]);
76716
+ /* eslint-disable react-hooks/exhaustive-deps */
76717
+ }, [bonds === null || bonds === void 0 ? void 0 : bonds.length]);
76705
76718
  };
76706
76719
 
76707
76720
  function adjustDecimals(numStr) {
@@ -80265,21 +80278,151 @@ const CheckUrl = () => {
80265
80278
  return jsx$2(Fragment$1, {});
80266
80279
  };
80267
80280
 
80268
- const ChainTitle = ({ chain, pt, hideTitles, isOpen, }) => {
80281
+ const styles$8 = {
80282
+ smallCardContainer: {
80283
+ width: '100%',
80284
+ p: '6px 12px',
80285
+ background: 'white2',
80286
+ borderRadius: 'normal',
80287
+ justifyContent: 'space-between',
80288
+ alignItems: 'center',
80289
+ cursor: 'pointer',
80290
+ mr: '10px',
80291
+ ':last-of-type': {
80292
+ mr: '0px',
80293
+ },
80294
+ },
80295
+ subTitle: {
80296
+ color: 'textDisabledButton',
80297
+ fontSize: '12px',
80298
+ fontWeight: 400,
80299
+ lineHeight: '16px',
80300
+ },
80301
+ };
80302
+
80303
+ const SmallRecommendationCard = ({ recommendation }) => {
80269
80304
  var _a;
80270
- const isMobile = useIsMobile();
80271
- return (jsxs(Flex, { id: `${NETWORK_LABEL[chain].toLowerCase().replace(/\s+/g, '')}`, className: "chaintitle", sx: {
80272
- pt,
80273
- pb: '10px',
80274
- color: 'textDisabledButton',
80275
- fontSize: '13px',
80276
- fontWeight: 500,
80277
- cursor: 'pointer',
80278
- textTransform: 'uppercase',
80279
- display: hideTitles ? 'none' : 'flex',
80280
- width: '300px',
80281
- alignItems: 'center',
80282
- }, children: [NETWORK_LABEL[chain], " Bonds", jsx$2(Flex, { sx: { ml: '7px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }), ((_a = NETWORK_LABEL[chain]) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('testnet')) && (jsxs(Flex, { sx: { ml: '15px' }, children: [jsx$2(Text, { sx: { fontSize: '12px', color: '#DE62F3', fontWeight: 700, mr: '7px' }, children: "TESTNET" }), jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Testnet Bonds let you experiment with fake tokens for free on upcoming chains still in development." }), width: isMobile ? '272px' : '280px', placement: isMobile ? 'bottomRight' : 'bottomLeft', transformTip: isMobile ? 'translate(10%, -5%)' : 'translate(-5%, -5%)', children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) })] }))] }));
80305
+ const vestingTime = getTimePeriods((_a = recommendation.vestingTerm) !== null && _a !== void 0 ? _a : 0, true);
80306
+ return (jsxs(Flex, { sx: styles$8.smallCardContainer, onClick: () => window.open(`${window.location.origin}/bonds?bondAddress=${recommendation.contractAddress}&bondChain=${recommendation.chainId}`, '_self'), children: [jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(TokenImage, { symbol: recommendation.payoutTokenName, size: 32, chain: recommendation.chainId }), jsxs(Flex, { sx: { mx: '10px', alignItems: 'center' }, children: [jsx$2(Flex, { sx: { fontSize: '14px', px: '6px' }, children: recommendation.payoutTokenName }), jsxs(Flex, { sx: styles$8.subTitle, children: [vestingTime.days, "D"] })] })] }), jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(Flex, { sx: styles$8.subTitle, children: "Bonus" }), jsxs(Flex, { sx: { fontSize: '12px', color: recommendation.bonus > 0 ? 'success' : 'error', ml: '6px' }, children: [recommendation.bonus.toFixed(2), "%"] })] })] }));
80307
+ };
80308
+
80309
+ function useHotBondContracts() {
80310
+ const apiUrl = useURLByEnvironment('apiV2');
80311
+ return useQuery({
80312
+ queryKey: [QUERY_KEYS.HOT_BONDS_CONTRACTS],
80313
+ queryFn: () => getHotBondsContracts(apiUrl),
80314
+ staleTime: Infinity,
80315
+ refetchOnWindowFocus: false,
80316
+ refetchOnMount: false,
80317
+ retry: 1,
80318
+ });
80319
+ }
80320
+ function useHotBonds() {
80321
+ const { data: bondsData } = useBondsData();
80322
+ const { data: hotBondContracts } = useHotBondContracts();
80323
+ return useQuery({
80324
+ queryKey: [QUERY_KEYS.HOT_BONDS, bondsData === null || bondsData === void 0 ? void 0 : bondsData.length, hotBondContracts === null || hotBondContracts === void 0 ? void 0 : hotBondContracts.length],
80325
+ queryFn: () => getHotBonds(bondsData, hotBondContracts),
80326
+ refetchOnWindowFocus: false,
80327
+ refetchInterval: 30000,
80328
+ enabled: !!bondsData && bondsData.length > 0 && !!hotBondContracts && hotBondContracts.length > 0,
80329
+ retry: 0,
80330
+ });
80331
+ }
80332
+ const getHotBondsContracts = (apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
80333
+ try {
80334
+ const response = yield axios.get(`${STRAPI_URL}/hot-bonds`);
80335
+ return response.data.map((bond) => bond.BondAddress.toLowerCase());
80336
+ }
80337
+ catch (e) {
80338
+ reportError({
80339
+ apiUrl,
80340
+ error: e,
80341
+ extraInfo: { type: 'getHotBondsContracts', e },
80342
+ });
80343
+ return [];
80344
+ }
80345
+ });
80346
+ const getHotBonds = (bondData, hotBondContracts) => __awaiter$9(void 0, void 0, void 0, function* () {
80347
+ return bondData.filter((bond) => { var _a, _b, _c; return hotBondContracts.includes((_c = (_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()) !== null && _c !== void 0 ? _c : ''); });
80348
+ });
80349
+
80350
+ const RecommendationCards$1 = () => {
80351
+ const topTags = useTopTags();
80352
+ const { address: account } = useEVMAccount();
80353
+ const options = account ? ['For You', 'Hot', ...topTags] : ['Hot', ...topTags];
80354
+ const [activeOption, setActiveOption] = useState(options[0]);
80355
+ const { data: hotRecommendations } = useHotBonds();
80356
+ const { data: bonds } = useBondsData();
80357
+ const SDKConfig = useSDKConfig();
80358
+ const { data: forYouRecommendations } = useGetBondRecommendations(account, undefined, '3');
80359
+ const sortedBonds = bonds && (bonds === null || bonds === void 0 ? void 0 : bonds.length) > 0
80360
+ ? [...bonds].sort((a, b) => {
80361
+ var _a, _b, _c, _d;
80362
+ return ((_b = (_a = findHighestTrueBondPrice('0', b === null || b === void 0 ? void 0 : b.trueBondPrices)) === null || _a === void 0 ? void 0 : _a.bonusWithFee) !== null && _b !== void 0 ? _b : 0) -
80363
+ ((_d = (_c = findHighestTrueBondPrice('0', a === null || a === void 0 ? void 0 : a.trueBondPrices)) === null || _c === void 0 ? void 0 : _c.bonusWithFee) !== null && _d !== void 0 ? _d : 0);
80364
+ })
80365
+ : undefined;
80366
+ const filteredBonds = sortedBonds === null || sortedBonds === void 0 ? void 0 : sortedBonds.filter((bond) => { var _a, _b; return ((_a = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _a === void 0 ? void 0 : _a.includes(activeOption)) && !(bond === null || bond === void 0 ? void 0 : bond.soldOut) && ((_b = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains) === null || _b === void 0 ? void 0 : _b.includes(bond.chainId)); });
80367
+ const selectedBonds = activeOption === 'For You' ? forYouRecommendations : activeOption === 'Hot' ? hotRecommendations : filteredBonds;
80368
+ const slicedBonds = selectedBonds === null || selectedBonds === void 0 ? void 0 : selectedBonds.filter((bond) => { var _a; return (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains) === null || _a === void 0 ? void 0 : _a.includes(bond.chainId); }).slice(0, 3);
80369
+ const parsedBondsToRender = slicedBonds === null || slicedBonds === void 0 ? void 0 : slicedBonds.map((bond) => {
80370
+ var _a, _b, _c, _d;
80371
+ const contractAddress = 'billAddress' in bond ? bond.billAddress : (_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];
80372
+ const payoutTokenName = 'payoutTokenName' in bond ? bond.payoutTokenName : bond.earnToken.symbol;
80373
+ return {
80374
+ payoutTokenName: payoutTokenName,
80375
+ contractAddress,
80376
+ vestingTerm: (_b = bond.vestingTerm) !== null && _b !== void 0 ? _b : 0,
80377
+ bonus: 'bonus' in bond ? bond.bonus : ((_d = (_c = findHighestTrueBondPrice('0', bond === null || bond === void 0 ? void 0 : bond.trueBondPrices)) === null || _c === void 0 ? void 0 : _c.bonusWithFee) !== null && _d !== void 0 ? _d : 0),
80378
+ chainId: bond.chainId,
80379
+ };
80380
+ });
80381
+ useEffect(() => {
80382
+ if (account) {
80383
+ setActiveOption('For You');
80384
+ }
80385
+ else {
80386
+ setActiveOption('Hot');
80387
+ }
80388
+ }, [account]);
80389
+ return (jsxs(Flex, { sx: { mt: '15px', flexDirection: 'column', width: '100%', display: ['none', 'none', 'none', 'flex'] }, children: [jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsxs(Flex, { children: [jsx$2(Flex, { sx: {
80390
+ width: ['60px', '60px', '60px', 'unset'],
80391
+ mr: ['0px', '0px', '0px', '15px'],
80392
+ alignItems: 'center',
80393
+ color: 'grey',
80394
+ fontSize: ['11px'],
80395
+ fontWeight: 500,
80396
+ }, children: "BONDS MARKETS:" }), jsx$2(RecommendationSelector, { options: options, activeOption: activeOption, setActiveOption: setActiveOption })] }), jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex'] } })] }), jsx$2(Flex, { sx: {
80397
+ my: '10px',
80398
+ minHeight: '47.45px',
80399
+ }, children: parsedBondsToRender &&
80400
+ parsedBondsToRender.length > 0 &&
80401
+ parsedBondsToRender.map((bond, index) => {
80402
+ return jsx$2(SmallRecommendationCard, { recommendation: bond }, `${bond.payoutTokenName}-${index}`);
80403
+ }) })] }));
80404
+ };
80405
+
80406
+ // import track from 'utils/track'
80407
+ const FavIcon = ({ filterOption, setFilterOption, }) => {
80408
+ const handleFilterOption = (newOption) => {
80409
+ setFilterOption(newOption);
80410
+ };
80411
+ return (jsx$2(Flex, { sx: { justifyContent: 'center', alignItems: 'center', minWidth: '25px', cursor: 'pointer', ml: '15px' }, className: "search-fav-icon", onClick: () => {
80412
+ handleFilterOption(filterOption !== 'FAVORITES' ? 'FAVORITES' : 'ALL');
80413
+ }, children: jsx$2(AnimatePresence, { mode: "wait", children: jsx$2(motion.div, { initial: false, animate: { opacity: 1, scale: 1.0 }, exit: { opacity: 0, scale: 0.8 }, transition: { duration: 0.2 }, style: { display: 'flex', alignItems: 'center' }, children: filterOption === 'FAVORITES' ? (jsx$2(Svg, { icon: "StarFilled", width: 22, height: 22 })) : (jsx$2(Svg, { icon: "Star", width: 20, height: 20 })) }, filterOption === 'FAVORITES' ? 'StarFilled' : 'Star') }) }));
80414
+ };
80415
+
80416
+ const BondsMenu = ({ searchQuery, setSearchQuery, setChainFilterOption, chainFilterOption, filterOptions, filterOption, setFilterOption, onSort, }) => {
80417
+ const { namingPreference } = useSDKConfig();
80418
+ 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: () => setSearchQuery('') }), jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container", children: jsxs(Flex$1, { sx: { width: '100%', maxWidth: '340px' }, children: [jsx$2(Input, { value: searchQuery, onChange: (event) => setSearchQuery(event.target.value), variant: "search", width: '100%', sx: {
80419
+ fontWeight: 600,
80420
+ background: 'white2',
80421
+ height: '30px',
80422
+ fontSize: '14px',
80423
+ color: 'white',
80424
+ width: ['calc(50vw - 25px)'],
80425
+ }, placeholder: 'Search...' }), jsx$2(FavIcon, { filterOption: filterOption, setFilterOption: setFilterOption })] }) }), jsxs("div", { className: "headers-container", children: [jsx$2(Flex$1, { sx: { width: '125px' } }), jsxs("div", { className: "discount-header", onClick: () => onSort('bonus'), children: [namingPreference.toUpperCase(), jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: 10, color: "textDisabledButton" }) })] }), jsxs("div", { className: "terms-header", onClick: () => onSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "tokens-remaining-header", onClick: () => onSort('tokensRemaining'), children: ["TOKENS REMAINING", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2("div", { className: "tooltip-header" })] })] })] }));
80283
80426
  };
80284
80427
 
80285
80428
  const BonusContainer = ({ trueBondPrices, minTier, bonus, airdropTooltip, tooltipPosition = 'bottomRight', }) => {
@@ -80287,7 +80430,7 @@ const BonusContainer = ({ trueBondPrices, minTier, bonus, airdropTooltip, toolti
80287
80430
  return (jsx$2("div", { className: `discount-column`, children: jsx$2(BonusComponent, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip, tooltipPosition: isMobile ? tooltipPosition : 'bottomLeft' }) }));
80288
80431
  };
80289
80432
 
80290
- const BondRow = ({ bondAddress, bondChain, billArtCollection, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, shortDescription, }) => {
80433
+ const BondRow = ({ bondAddress, bondChain, billArtCollection, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, shortDescription, soldoutBondsCount, isOpen, }) => {
80291
80434
  var _a, _b, _c;
80292
80435
  const SDKConfig = useSDKConfig();
80293
80436
  const locationPath = window.location.pathname.replace('/', '');
@@ -80317,13 +80460,134 @@ const BondRow = ({ bondAddress, bondChain, billArtCollection, payoutToken, billT
80317
80460
  });
80318
80461
  };
80319
80462
  return (jsxs("div", { className: "bond-row" // Insert special campaign styles here
80320
- , onClick: handleOpenModal, sx: Object.assign({ borderRadius: 'normal' }, bondRowCampaignStyles[billArtCollection]), children: [jsx$2("div", { className: "token-info-container", sx: { width: ['40%', '40%', '40%', '30%'] }, children: jsx$2(TokenInfoAndName, { tokenSymbol: payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol, chain: bondChain, tag: tag, billArtCollection: billArtCollection }) }), SDKConfig.useCardsView && shortDescription && (jsx$2("div", { className: "short-description", children: jsx$2(SafeHTMLComponent, { html: shortDescription }) })), jsxs("div", { className: "bond-info-columns", sx: { width: ['60%', '60%', '60%', '70%'] }, children: [!SDKConfig.useCardsView && jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex'], width: '125px' } }), jsx$2(BonusContainer, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip }), jsxs("div", { className: "terms-column", children: [vestingTermString, vestingCliffString && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: vestingCliffString }), width: "180px", placement: "bottomRight", transformTip: "translate(13%, 0%)", children: jsx$2(Flex, { sx: { opacity: 0.6, ml: '6px' }, children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }))] }), jsx$2("div", { className: "tokens-remaining-column", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: percentageAvailable }), style: {
80463
+ , onClick: handleOpenModal, sx: Object.assign(Object.assign({ borderRadius: 'normal' }, bondRowCampaignStyles[billArtCollection]), { cursor: !bondSoldOut || (soldoutBondsCount && !isOpen) ? 'pointer' : 'default' }), children: [jsx$2("div", { className: "token-info-container", sx: { width: ['40%', '40%', '40%', '30%'] }, children: jsx$2(TokenInfoAndName, { tokenSymbol: payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol, chain: bondChain, tag: tag, billArtCollection: billArtCollection }) }), SDKConfig.useCardsView && shortDescription && (jsx$2("div", { className: "short-description", children: jsx$2(SafeHTMLComponent, { html: shortDescription }) })), jsxs("div", { className: "bond-info-columns", sx: { width: ['60%', '60%', '60%', '70%'] }, children: [!SDKConfig.useCardsView && jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex'], width: '125px' } }), jsx$2(BonusContainer, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip }), jsxs("div", { className: "terms-column", children: [vestingTermString, vestingCliffString && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: vestingCliffString }), width: "180px", placement: "bottomRight", transformTip: "translate(13%, 0%)", children: jsx$2(Flex, { sx: { opacity: 0.6, ml: '6px' }, children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }))] }), jsx$2("div", { className: "tokens-remaining-column", children: bondSoldOut ? ('-') : (jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: percentageAvailable }), style: {
80321
80464
  width: '127px',
80322
80465
  height: '25px',
80323
80466
  flexDirection: 'column',
80324
80467
  justifyContent: 'center',
80325
80468
  display: ['none', 'none', 'none', 'flex'],
80326
- }, showTooltip: true, toolTip: remainingTokensString }) }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_b = (_a = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.address) === null || _a === void 0 ? void 0 : _a[bondChain]) !== null && _b !== void 0 ? _b : '', earnTokenSymbol: (_c = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol) !== null && _c !== void 0 ? _c : '', bondContract: bondAddress !== null && bondAddress !== void 0 ? bondAddress : '', projectLink: projectURL, twitter: twitterURL, audit: auditURL, chain: bondChain, isSoldOut: bondSoldOut, billType: billType }), width: "205px", placement: "bottomRight", transformTip: "translate(7%, -2%)", children: jsx$2(Flex, { className: "more-icon", sx: { opacity: 0.8 }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] })] }, `${bondAddress}-${bondChain}`));
80469
+ }, showTooltip: true, toolTip: remainingTokensString })) }), jsx$2("div", { className: "tooltip-column", children: soldoutBondsCount ? (jsxs(Flex, { sx: { gap: '5px', fontSize: '13px', fontWeight: 500, opacity: 0.5 }, children: ["(", soldoutBondsCount, ")", jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down', width: "8px" })] })) : (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_b = (_a = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.address) === null || _a === void 0 ? void 0 : _a[bondChain]) !== null && _b !== void 0 ? _b : '', earnTokenSymbol: (_c = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol) !== null && _c !== void 0 ? _c : '', bondContract: bondAddress !== null && bondAddress !== void 0 ? bondAddress : '', projectLink: projectURL, twitter: twitterURL, audit: auditURL, chain: bondChain, isSoldOut: bondSoldOut, billType: billType }), width: "205px", placement: "bottomRight", transformTip: "translate(7%, -2%)", children: jsx$2(Flex, { className: "more-icon", sx: { opacity: 0.8 }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) })) })] })] }, `${bondAddress}-${bondChain}`));
80470
+ };
80471
+
80472
+ const getUserApiStats = (account) => __awaiter$9(void 0, void 0, void 0, function* () {
80473
+ if (!account)
80474
+ return null;
80475
+ const { data } = yield axios.get(`https://dashboard-api.ape.bond/collector/userSalesInfo/purchased/${account}`);
80476
+ return data;
80477
+ });
80478
+ function useUserApiStats() {
80479
+ const { address: account } = useEVMAccount();
80480
+ return useQuery({
80481
+ queryKey: [`${QUERY_KEYS.USER_STATS}-${account}`],
80482
+ queryFn: () => getUserApiStats(account),
80483
+ staleTime: Infinity,
80484
+ refetchOnWindowFocus: false,
80485
+ refetchOnMount: false,
80486
+ retry: 1,
80487
+ });
80488
+ }
80489
+
80490
+ const BuyAgainRow = () => {
80491
+ var _a, _b, _c;
80492
+ const { data: userData } = useUserApiStats();
80493
+ const { data: bills } = useBondsData();
80494
+ const SDKConfig = useSDKConfig();
80495
+ const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
80496
+ const bond = useMemo(() => {
80497
+ if (userData && (userData === null || userData === void 0 ? void 0 : userData.Sales.length) > 0) {
80498
+ const sortedPurchases = userData === null || userData === void 0 ? void 0 : userData.Sales.sort((a, b) => b.dollarValue - a.dollarValue);
80499
+ const activeBills = bills === null || bills === void 0 ? void 0 : bills.filter((bill) => !isBondSoldOut(bill, SDKConfig.showLowValueBonds) && (chains === null || chains === void 0 ? void 0 : chains.includes(bill.chainId)));
80500
+ const highestActivePurchase = sortedPurchases === null || sortedPurchases === void 0 ? void 0 : sortedPurchases.find((purchase) => activeBills === null || activeBills === void 0 ? void 0 : activeBills.find((bill) => {
80501
+ var _a, _b;
80502
+ if (purchase.contractAddress.toLowerCase() === ((_b = (_a = bill === null || bill === void 0 ? void 0 : bill.contractAddress) === null || _a === void 0 ? void 0 : _a[bill.chainId]) === null || _b === void 0 ? void 0 : _b.toLowerCase()))
80503
+ return true;
80504
+ }));
80505
+ return activeBills === null || activeBills === void 0 ? void 0 : activeBills.find((bill) => {
80506
+ var _a, _b, _c;
80507
+ return ((_b = (_a = bill === null || bill === void 0 ? void 0 : bill.contractAddress) === null || _a === void 0 ? void 0 : _a[bill.chainId]) === null || _b === void 0 ? void 0 : _b.toLowerCase()) ===
80508
+ ((_c = highestActivePurchase === null || highestActivePurchase === void 0 ? void 0 : highestActivePurchase.contractAddress) === null || _c === void 0 ? void 0 : _c.toLowerCase());
80509
+ });
80510
+ }
80511
+ }, [SDKConfig.showLowValueBonds, bills, chains, userData]);
80512
+ const bondAddress = (_a = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId];
80513
+ const remainingTokensFormat = (bond) => {
80514
+ const tokensRemaining = 'tokensRemaining' in bond ? bond.tokensRemaining : '0';
80515
+ return formatNumberSI(parseFloat(tokensRemaining !== null && tokensRemaining !== void 0 ? tokensRemaining : '0'), 0);
80516
+ };
80517
+ const remainingTokensUsd = (bond) => {
80518
+ const tokensRemaining = 'tokensRemaining' in bond ? bond.tokensRemaining : '0';
80519
+ const payoutTokenPrice = 'payoutTokenPrice' in bond ? bond.payoutTokenPrice : 0;
80520
+ const tokens = new BigNumber$1(tokensRemaining !== null && tokensRemaining !== void 0 ? tokensRemaining : '0');
80521
+ return tokens.times(payoutTokenPrice !== null && payoutTokenPrice !== void 0 ? payoutTokenPrice : '0');
80522
+ };
80523
+ const remainingTokensString = bond
80524
+ ? `${remainingTokensFormat(bond)} ${bond.earnToken.symbol} ($${formatNumberSI(remainingTokensUsd(bond).toNumber())})`
80525
+ : '';
80526
+ return bond ? (jsx$2(AnimatePresence, { children: jsxs(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
80527
+ position: 'relative',
80528
+ overflow: 'hidden',
80529
+ width: '100%',
80530
+ mb: '10px',
80531
+ }, children: [jsx$2(Flex, { sx: {
80532
+ p: '0 1px',
80533
+ width: '100%',
80534
+ pt: '5px',
80535
+ background: 'primaryButton',
80536
+ borderRadius: 'normal',
80537
+ flexDirection: 'column',
80538
+ opacity: 0.5,
80539
+ }, children: jsx$2(Flex, { className: "buy-again-header", sx: {
80540
+ width: '100%',
80541
+ fontSize: '12px',
80542
+ fontWeight: 500,
80543
+ pl: '26px',
80544
+ color: 'primaryBright',
80545
+ height: '91px',
80546
+ }, children: "BUY AGAIN" }) }), jsx$2(Flex, { onClick: () => {
80547
+ track({
80548
+ event: 'buyAgainClick',
80549
+ chain: bond.chainId,
80550
+ data: {
80551
+ bond: bond.earnToken.symbol,
80552
+ },
80553
+ });
80554
+ }, sx: { position: 'absolute', top: '25px', left: '1px', width: 'calc(100% - 2px)' }, children: jsx$2(BondRow, { bondAddress: (_b = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _b === void 0 ? void 0 : _b[bond === null || bond === void 0 ? void 0 : bond.chainId], bondChain: bond.chainId, billType: bond.billType, payoutToken: bond.earnToken, tag: (_c = bond.tags) === null || _c === void 0 ? void 0 : _c[0], bondSoldOut: isBondSoldOut(bond, SDKConfig.showLowValueBonds), trueBondPrices: bond === null || bond === void 0 ? void 0 : bond.trueBondPrices, minTier: bond === null || bond === void 0 ? void 0 : bond.minTier, vestingTermString: getVestingTermsString(bond), vestingCliffString: getVestingTermsTooltipString(bond), percentageAvailable: remainingPercentage(bond), remainingTokensString: remainingTokensString }, `${bondAddress}-${bond.chainId}`) })] }) })) : null;
80555
+ };
80556
+
80557
+ const LoadingSkeleton = () => {
80558
+ return (jsxs(Flex$1, { sx: { width: '100%', flexDirection: 'column', mt: '35px' }, children: [Array.from({ length: 5 }).map((_, index) => (jsx$2(Skeleton, { animation: "waves", sx: {
80559
+ width: '100%',
80560
+ height: '70px',
80561
+ borderRadius: 'normal',
80562
+ mb: '5px',
80563
+ } }, `row-shadow-${index}`))), jsx$2(Flex$1, { sx: { width: '100%', gap: '15px', mt: '25px' }, children: Array.from({ length: 3 }).map((_, index) => (jsx$2(Skeleton, { animation: "waves", sx: {
80564
+ width: '100%',
80565
+ height: '125px',
80566
+ borderRadius: 'normal',
80567
+ mb: '5px',
80568
+ } }, `hot-card-shadow${index}`))) }), jsx$2(Flex$1, { sx: { width: '100%', flexDirection: 'column', mt: '25px' }, children: Array.from({ length: 3 }).map((_, index) => (jsx$2(Skeleton, { animation: "waves", sx: {
80569
+ width: '100%',
80570
+ height: '70px',
80571
+ borderRadius: 'normal',
80572
+ mb: '5px',
80573
+ } }, `second-row-shadow-${index}`))) })] }));
80574
+ };
80575
+
80576
+ const ChainTitle = ({ chain, pt, hideTitles, isOpen, }) => {
80577
+ var _a;
80578
+ const isMobile = useIsMobile();
80579
+ return (jsxs(Flex, { id: `${NETWORK_LABEL[chain].toLowerCase().replace(/\s+/g, '')}`, className: "chaintitle", sx: {
80580
+ pt,
80581
+ pb: '10px',
80582
+ color: 'textDisabledButton',
80583
+ fontSize: '13px',
80584
+ fontWeight: 500,
80585
+ cursor: 'pointer',
80586
+ textTransform: 'uppercase',
80587
+ display: hideTitles ? 'none' : 'flex',
80588
+ width: '300px',
80589
+ alignItems: 'center',
80590
+ }, children: [NETWORK_LABEL[chain], " Bonds", jsx$2(Flex, { sx: { ml: '7px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }), ((_a = NETWORK_LABEL[chain]) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('testnet')) && (jsxs(Flex, { sx: { ml: '15px' }, children: [jsx$2(Text, { sx: { fontSize: '12px', color: '#DE62F3', fontWeight: 700, mr: '7px' }, children: "TESTNET" }), jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Testnet Bonds let you experiment with fake tokens for free on upcoming chains still in development." }), width: isMobile ? '272px' : '280px', placement: isMobile ? 'bottomRight' : 'bottomLeft', transformTip: isMobile ? 'translate(10%, -5%)' : 'translate(-5%, -5%)', children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) })] }))] }));
80327
80591
  };
80328
80592
 
80329
80593
  const SwiperContext$1 = createContext$1({
@@ -80342,7 +80606,7 @@ const SwiperProvider = ({ children }) => {
80342
80606
  return jsx$2(SwiperContext$1.Provider, { value: { swiper, setSwiper, destroySwiper }, children: children });
80343
80607
  };
80344
80608
 
80345
- const styles$8 = {
80609
+ const styles$7 = {
80346
80610
  mainComponent: {
80347
80611
  width: '100%',
80348
80612
  flexDirection: 'column',
@@ -80404,7 +80668,7 @@ const HotBondCard = ({ bond }) => {
80404
80668
  },
80405
80669
  });
80406
80670
  };
80407
- return (jsx$2(Flex, { sx: styles$8.desktopCard, className: "hot-bond-card", onClick: handleOpenModal, children: jsxs(Flex, { sx: { flexDirection: 'column', width: '100%' }, children: [jsxs(Flex, { sx: { width: '100%', height: '75px' }, children: [jsx$2(Flex, { sx: { width: '66.66%' }, children: jsx$2(TokenInfoAndName, { tokenSymbol: bond.earnToken.symbol, chain: bond.chainId, tag: (_d = bond.tags) === null || _d === void 0 ? void 0 : _d[0], isHotBond: true }) }), jsx$2(Flex, { className: "column column-tokenicons", sx: { width: '33.33% !important', justifyContent: 'center !important', alignItems: 'center' }, children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_g = (_f = (_e = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _g !== void 0 ? _g : '', earnTokenSymbol: (_j = (_h = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _h === void 0 ? void 0 : _h.symbol) !== null && _j !== void 0 ? _j : '', bondContract: (_l = (_k = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _k === void 0 ? void 0 : _k[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _l !== void 0 ? _l : '', projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: bond === null || bond === void 0 ? void 0 : bond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)", children: jsx$2(Svg, { icon: "more", width: "20px" }) }) })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-around' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400 }, children: "Bonus" }), jsx$2(Flex, { className: `${getDiscountColor(bonus)}`, sx: { width: '100%', justifyContent: 'center' }, children: bonus !== undefined ? (bonus < 0 ? '0%' : `${bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(2)}%`) : '-' })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "ARR" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: calculateARR(bond, SDKConfig.useTiers) })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "Terms" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: ((_m = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _m === void 0 ? void 0 : _m.days) ? `${(_o = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _o === void 0 ? void 0 : _o.days} D` : '-' })] })] })] }) }));
80671
+ return (jsx$2(Flex, { sx: styles$7.desktopCard, className: "hot-bond-card", onClick: handleOpenModal, children: jsxs(Flex, { sx: { flexDirection: 'column', width: '100%' }, children: [jsxs(Flex, { sx: { width: '100%', height: '75px' }, children: [jsx$2(Flex, { sx: { width: '66.66%' }, children: jsx$2(TokenInfoAndName, { tokenSymbol: bond.earnToken.symbol, chain: bond.chainId, tag: (_d = bond.tags) === null || _d === void 0 ? void 0 : _d[0], isHotBond: true }) }), jsx$2(Flex, { className: "column column-tokenicons", sx: { width: '33.33% !important', justifyContent: 'center !important', alignItems: 'center' }, children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_g = (_f = (_e = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _g !== void 0 ? _g : '', earnTokenSymbol: (_j = (_h = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _h === void 0 ? void 0 : _h.symbol) !== null && _j !== void 0 ? _j : '', bondContract: (_l = (_k = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _k === void 0 ? void 0 : _k[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _l !== void 0 ? _l : '', projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: bond === null || bond === void 0 ? void 0 : bond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)", children: jsx$2(Svg, { icon: "more", width: "20px" }) }) })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-around' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400 }, children: "Bonus" }), jsx$2(Flex, { className: `${getDiscountColor(bonus)}`, sx: { width: '100%', justifyContent: 'center' }, children: bonus !== undefined ? (bonus < 0 ? '0%' : `${bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(2)}%`) : '-' })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "ARR" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: calculateARR(bond, SDKConfig.useTiers) })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "Terms" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: ((_m = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _m === void 0 ? void 0 : _m.days) ? `${(_o = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _o === void 0 ? void 0 : _o.days} D` : '-' })] })] })] }) }));
80408
80672
  };
80409
80673
 
80410
80674
  /**
@@ -85555,47 +85819,6 @@ const getDotPos = (index, carouselLength) => {
85555
85819
  : index - carouselLength;
85556
85820
  };
85557
85821
 
85558
- function useHotBondContracts() {
85559
- const apiUrl = useURLByEnvironment('apiV2');
85560
- return useQuery({
85561
- queryKey: [QUERY_KEYS.HOT_BONDS_CONTRACTS],
85562
- queryFn: () => getHotBondsContracts(apiUrl),
85563
- staleTime: Infinity,
85564
- refetchOnWindowFocus: false,
85565
- refetchOnMount: false,
85566
- retry: 1,
85567
- });
85568
- }
85569
- function useHotBonds() {
85570
- const { data: bondsData } = useBondsData();
85571
- const { data: hotBondContracts } = useHotBondContracts();
85572
- return useQuery({
85573
- queryKey: [QUERY_KEYS.HOT_BONDS, bondsData === null || bondsData === void 0 ? void 0 : bondsData.length, hotBondContracts === null || hotBondContracts === void 0 ? void 0 : hotBondContracts.length],
85574
- queryFn: () => getHotBonds(bondsData, hotBondContracts),
85575
- refetchOnWindowFocus: false,
85576
- refetchInterval: 30000,
85577
- enabled: !!bondsData && bondsData.length > 0 && !!hotBondContracts && hotBondContracts.length > 0,
85578
- retry: 0,
85579
- });
85580
- }
85581
- const getHotBondsContracts = (apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
85582
- try {
85583
- const response = yield axios.get(`${STRAPI_URL}/hot-bonds`);
85584
- return response.data.map((bond) => bond.BondAddress.toLowerCase());
85585
- }
85586
- catch (e) {
85587
- reportError({
85588
- apiUrl,
85589
- error: e,
85590
- extraInfo: { type: 'getHotBondsContracts', e },
85591
- });
85592
- return [];
85593
- }
85594
- });
85595
- const getHotBonds = (bondData, hotBondContracts) => __awaiter$9(void 0, void 0, void 0, function* () {
85596
- return bondData.filter((bond) => { var _a, _b, _c; return hotBondContracts.includes((_c = (_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()) !== null && _c !== void 0 ? _c : ''); });
85597
- });
85598
-
85599
85822
  const HotBondCards = () => {
85600
85823
  var _a;
85601
85824
  const { data: hotBonds } = useHotBonds();
@@ -85618,7 +85841,7 @@ const HotBondCards = () => {
85618
85841
  setActiveSlide(index);
85619
85842
  swiper === null || swiper === void 0 ? void 0 : swiper.slideTo(index);
85620
85843
  };
85621
- return (jsxs(Flex, { sx: styles$8.mainComponent, children: [jsx$2(Flex, { sx: styles$8.hotBondTitle, children: "HOT BONDS" }), jsx$2(Flex, { sx: styles$8.desktopCards, children: filteredBonds === null || filteredBonds === void 0 ? void 0 : filteredBonds.slice(0, 3).map((bond, index) => {
85844
+ return (jsxs(Flex, { sx: styles$7.mainComponent, children: [jsx$2(Flex, { sx: styles$7.hotBondTitle, children: "HOT BONDS" }), jsx$2(Flex, { sx: styles$7.desktopCards, children: filteredBonds === null || filteredBonds === void 0 ? void 0 : filteredBonds.slice(0, 3).map((bond, index) => {
85622
85845
  var _a;
85623
85846
  return jsx$2(HotBondCard, { bond: bond }, `${(_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]}-${index}`);
85624
85847
  }) }), jsxs(Flex, { sx: {
@@ -85705,31 +85928,16 @@ const ChainBanner = ({ chainId }) => {
85705
85928
  }, children: "Get Started" }))] })] }, `banner-container-${chainId}`));
85706
85929
  };
85707
85930
 
85708
- const BondRowsWithTitle = ({ chain, bonds, hideTitles, showHotBonds, showSolSkeleton, }) => {
85931
+ const ActiveBondRows = ({ chain, bonds, hideTitles, showHotBonds }) => {
85709
85932
  const { namingPreference } = useSDKConfig();
85710
85933
  const [isOpen, setIsOpen] = useState(true);
85711
85934
  const key = chain;
85712
- const { data: bondList } = useBondsList();
85713
- const solanaBondCount = useMemo(() => {
85714
- var _a, _b;
85715
- return (_b = (_a = bondList === null || bondList === void 0 ? void 0 : bondList.filter((bond) => bond.chainId === main.ChainId.SOL)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
85716
- /* eslint-disable react-hooks/exhaustive-deps */
85717
- }, [bondList === null || bondList === void 0 ? void 0 : bondList.length]);
85718
- return (jsx$2(Flex$1, { className: "bondrowswithtitle", children: jsxs(AnimatePresence, { initial: false, children: [jsx$2(Flex$1, { onClick: () => setIsOpen(!isOpen), sx: { cursor: 'pointer' }, children: jsx$2(ChainTitle, { chain: chain, pt: '5px', hideTitles: (bonds.length <= 0 && chain !== main.ChainId.SOL) ||
85719
- hideTitles ||
85720
- (!showSolSkeleton && chain === main.ChainId.SOL && bonds.length <= 0), isOpen: isOpen }) }), isOpen && (bonds.length > 0 || chain === main.ChainId.SOL) && (jsxs(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
85935
+ return (jsx$2(Flex$1, { className: "bondrowswithtitle", children: jsxs(AnimatePresence, { initial: false, children: [jsx$2(Flex$1, { onClick: () => setIsOpen(!isOpen), sx: { cursor: 'pointer' }, children: jsx$2(ChainTitle, { chain: chain, pt: '5px', hideTitles: (bonds.length <= 0 && chain !== main.ChainId.SOL) || hideTitles, isOpen: isOpen }) }), isOpen && (bonds.length > 0 || chain === main.ChainId.SOL) && (jsxs(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
85721
85936
  position: 'relative',
85722
85937
  overflow: 'hidden',
85723
85938
  width: '100%',
85724
85939
  marginTop: '0px',
85725
- }, className: "bonds-card-container", children: [[main.ChainId.SOL, main.ChainId.MONAD_TESTNET].includes(chain) && !hideTitles && showSolSkeleton && (jsx$2(ChainBanner, { chainId: chain })), bonds.length <= 0 && chain === main.ChainId.SOL && !hideTitles && showSolSkeleton && (jsx$2(Flex$1, { sx: { width: '100%', flexDirection: 'column' }, className: "bonds-card-container", children: Array.from({ length: solanaBondCount }).map((_, index) => {
85726
- return (jsx$2(Skeleton, { animation: "waves", sx: {
85727
- width: '100%',
85728
- height: '70px',
85729
- borderRadius: 'normal',
85730
- mb: '5px',
85731
- } }, `sol-shadow-${index}`));
85732
- }) }, key)), bonds === null || bonds === void 0 ? void 0 : bonds.map((bondFromMap, index) => {
85940
+ }, className: "bonds-card-container", children: [[main.ChainId.SOL, main.ChainId.MONAD_TESTNET].includes(chain) && !hideTitles && jsx$2(ChainBanner, { chainId: chain }), bonds === null || bonds === void 0 ? void 0 : bonds.map((bondFromMap, index) => {
85733
85941
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
85734
85942
  if (bondFromMap.soldOut) {
85735
85943
  const bond = bondFromMap;
@@ -85767,297 +85975,126 @@ const BondRowsWithTitle = ({ chain, bonds, hideTitles, showHotBonds, showSolSkel
85767
85975
  }), showHotBonds && (jsx$2(SwiperProvider, { children: jsx$2(HotBondCards, {}) }))] }, key))] }) }, key));
85768
85976
  };
85769
85977
 
85770
- const BondRowsByChain = ({ bonds, hideTitles, showSolSkeleton }) => {
85771
- var _a;
85772
- const SDKConfig = useSDKConfig();
85773
- const validatedChains = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains) === null || _a === void 0 ? void 0 : _a.filter((chain) => MAINNET_CHAINS.includes(chain));
85774
- const groupedBonds = bonds.reduce((acc, bond) => {
85775
- const { chainId } = bond;
85776
- if (!acc[chainId])
85777
- acc[chainId] = [];
85778
- acc[chainId].push(bond);
85779
- return acc;
85780
- }, {});
85781
- return (jsx$2(Flex$1, { className: "bondrowsbychain", children: validatedChains === null || validatedChains === void 0 ? void 0 : validatedChains.map((chain) => {
85782
- var _a, _b;
85783
- return (jsx$2(BondRowsWithTitle, { chain: chain, bonds: (_a = groupedBonds[chain]) !== null && _a !== void 0 ? _a : [], hideTitles: hideTitles, showHotBonds: hideTitles ? false : SDKConfig.useHotBonds ? (_b = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.hotBondChains) === null || _b === void 0 ? void 0 : _b.includes(chain) : false, showSolSkeleton: showSolSkeleton }, chain));
85784
- }) }));
85785
- };
85786
-
85787
- const styles$7 = {
85788
- smallCardContainer: {
85789
- width: '100%',
85790
- p: '6px 12px',
85791
- background: 'white2',
85792
- borderRadius: 'normal',
85793
- justifyContent: 'space-between',
85794
- alignItems: 'center',
85795
- cursor: 'pointer',
85796
- mr: '10px',
85797
- ':last-of-type': {
85798
- mr: '0px',
85799
- },
85800
- },
85801
- subTitle: {
85802
- color: 'textDisabledButton',
85803
- fontSize: '12px',
85804
- fontWeight: 400,
85805
- lineHeight: '16px',
85806
- },
85807
- };
85808
-
85809
- const SmallRecommendationCard = ({ recommendation }) => {
85810
- var _a;
85811
- const vestingTime = getTimePeriods((_a = recommendation.vestingTerm) !== null && _a !== void 0 ? _a : 0, true);
85812
- return (jsxs(Flex, { sx: styles$7.smallCardContainer, onClick: () => window.open(`${window.location.origin}/bonds?bondAddress=${recommendation.contractAddress}&bondChain=${recommendation.chainId}`, '_self'), children: [jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(TokenImage, { symbol: recommendation.payoutTokenName, size: 32, chain: recommendation.chainId }), jsxs(Flex, { sx: { mx: '10px', alignItems: 'center' }, children: [jsx$2(Flex, { sx: { fontSize: '14px', px: '6px' }, children: recommendation.payoutTokenName }), jsxs(Flex, { sx: styles$7.subTitle, children: [vestingTime.days, "D"] })] })] }), jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(Flex, { sx: styles$7.subTitle, children: "Bonus" }), jsxs(Flex, { sx: { fontSize: '12px', color: recommendation.bonus > 0 ? 'success' : 'error', ml: '6px' }, children: [recommendation.bonus.toFixed(2), "%"] })] })] }));
85813
- };
85814
-
85815
- const RecommendationCards$1 = () => {
85816
- const topTags = useTopTags();
85817
- const { address: account } = useEVMAccount();
85818
- const options = account ? ['For You', 'Hot', ...topTags] : ['Hot', ...topTags];
85819
- const [activeOption, setActiveOption] = useState(options[0]);
85820
- const { data: hotRecommendations } = useHotBonds();
85821
- const { data: bonds } = useBondsData();
85822
- const SDKConfig = useSDKConfig();
85823
- const { data: forYouRecommendations } = useGetBondRecommendations(account, undefined, '3');
85824
- const sortedBonds = bonds && (bonds === null || bonds === void 0 ? void 0 : bonds.length) > 0
85825
- ? [...bonds].sort((a, b) => {
85826
- var _a, _b, _c, _d;
85827
- return ((_b = (_a = findHighestTrueBondPrice('0', b === null || b === void 0 ? void 0 : b.trueBondPrices)) === null || _a === void 0 ? void 0 : _a.bonusWithFee) !== null && _b !== void 0 ? _b : 0) -
85828
- ((_d = (_c = findHighestTrueBondPrice('0', a === null || a === void 0 ? void 0 : a.trueBondPrices)) === null || _c === void 0 ? void 0 : _c.bonusWithFee) !== null && _d !== void 0 ? _d : 0);
85829
- })
85830
- : undefined;
85831
- const filteredBonds = sortedBonds === null || sortedBonds === void 0 ? void 0 : sortedBonds.filter((bond) => { var _a, _b; return ((_a = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _a === void 0 ? void 0 : _a.includes(activeOption)) && !(bond === null || bond === void 0 ? void 0 : bond.soldOut) && ((_b = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains) === null || _b === void 0 ? void 0 : _b.includes(bond.chainId)); });
85832
- const selectedBonds = activeOption === 'For You' ? forYouRecommendations : activeOption === 'Hot' ? hotRecommendations : filteredBonds;
85833
- const slicedBonds = selectedBonds === null || selectedBonds === void 0 ? void 0 : selectedBonds.filter((bond) => { var _a; return (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains) === null || _a === void 0 ? void 0 : _a.includes(bond.chainId); }).slice(0, 3);
85834
- const parsedBondsToRender = slicedBonds === null || slicedBonds === void 0 ? void 0 : slicedBonds.map((bond) => {
85835
- var _a, _b, _c, _d;
85836
- const contractAddress = 'billAddress' in bond ? bond.billAddress : (_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];
85837
- const payoutTokenName = 'payoutTokenName' in bond ? bond.payoutTokenName : bond.earnToken.symbol;
85838
- return {
85839
- payoutTokenName: payoutTokenName,
85840
- contractAddress,
85841
- vestingTerm: (_b = bond.vestingTerm) !== null && _b !== void 0 ? _b : 0,
85842
- bonus: 'bonus' in bond ? bond.bonus : ((_d = (_c = findHighestTrueBondPrice('0', bond === null || bond === void 0 ? void 0 : bond.trueBondPrices)) === null || _c === void 0 ? void 0 : _c.bonusWithFee) !== null && _d !== void 0 ? _d : 0),
85843
- chainId: bond.chainId,
85844
- };
85845
- });
85846
- useEffect(() => {
85847
- if (account) {
85848
- setActiveOption('For You');
85849
- }
85850
- else {
85851
- setActiveOption('Hot');
85852
- }
85853
- }, [account]);
85854
- return (jsxs(Flex, { sx: { mt: '15px', flexDirection: 'column', width: '100%', display: ['none', 'none', 'none', 'flex'] }, children: [jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsxs(Flex, { children: [jsx$2(Flex, { sx: {
85855
- width: ['60px', '60px', '60px', 'unset'],
85856
- mr: ['0px', '0px', '0px', '15px'],
85857
- alignItems: 'center',
85858
- color: 'grey',
85859
- fontSize: ['11px'],
85860
- fontWeight: 500,
85861
- }, children: "BONDS MARKETS:" }), jsx$2(RecommendationSelector, { options: options, activeOption: activeOption, setActiveOption: setActiveOption })] }), jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex'] } })] }), jsx$2(Flex, { sx: {
85862
- my: '10px',
85863
- minHeight: '47.45px',
85864
- }, children: parsedBondsToRender &&
85865
- parsedBondsToRender.length > 0 &&
85866
- parsedBondsToRender.map((bond, index) => {
85867
- return jsx$2(SmallRecommendationCard, { recommendation: bond }, `${bond.payoutTokenName}-${index}`);
85868
- }) })] }));
85869
- };
85870
-
85871
- // import track from 'utils/track'
85872
- const FavIcon = ({ filterOption, setFilterOption, }) => {
85873
- const handleFilterOption = (newOption) => {
85874
- setFilterOption(newOption);
85875
- };
85876
- return (jsx$2(Flex, { sx: { justifyContent: 'center', alignItems: 'center', minWidth: '25px', cursor: 'pointer', ml: '15px' }, className: "search-fav-icon", onClick: () => {
85877
- handleFilterOption(filterOption !== 'FAVORITES' ? 'FAVORITES' : 'ALL');
85878
- }, children: jsx$2(AnimatePresence, { mode: "wait", children: jsx$2(motion.div, { initial: false, animate: { opacity: 1, scale: 1.0 }, exit: { opacity: 0, scale: 0.8 }, transition: { duration: 0.2 }, style: { display: 'flex', alignItems: 'center' }, children: filterOption === 'FAVORITES' ? (jsx$2(Svg, { icon: "StarFilled", width: 22, height: 22 })) : (jsx$2(Svg, { icon: "Star", width: 20, height: 20 })) }, filterOption === 'FAVORITES' ? 'StarFilled' : 'Star') }) }));
85879
- };
85880
-
85881
- const BondsMenu = ({ searchQuery, setSearchQuery, setChainFilterOption, chainFilterOption, filterOptions, filterOption, setFilterOption, onSort, }) => {
85882
- const { namingPreference } = useSDKConfig();
85883
- 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: () => setSearchQuery('') }), jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container", children: jsxs(Flex$1, { sx: { width: '100%', maxWidth: '340px' }, children: [jsx$2(Input, { value: searchQuery, onChange: (event) => setSearchQuery(event.target.value), variant: "search", width: '100%', sx: {
85884
- fontWeight: 600,
85885
- background: 'white2',
85886
- height: '30px',
85887
- fontSize: '14px',
85888
- color: 'white',
85889
- width: ['calc(50vw - 25px)'],
85890
- }, placeholder: 'Search...' }), jsx$2(FavIcon, { filterOption: filterOption, setFilterOption: setFilterOption })] }) }), jsxs("div", { className: "headers-container", children: [jsx$2(Flex$1, { sx: { width: '125px' } }), jsxs("div", { className: "discount-header", onClick: () => onSort('bonus'), children: [namingPreference.toUpperCase(), jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: 10, color: "textDisabledButton" }) })] }), jsxs("div", { className: "terms-header", onClick: () => onSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "tokens-remaining-header", onClick: () => onSort('tokensRemaining'), children: ["TOKENS REMAINING", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2("div", { className: "tooltip-header" })] })] })] }));
85891
- };
85892
-
85893
- const getUserApiStats = (account) => __awaiter$9(void 0, void 0, void 0, function* () {
85894
- if (!account)
85895
- return null;
85896
- const { data } = yield axios.get(`https://dashboard-api.ape.bond/collector/userSalesInfo/purchased/${account}`);
85897
- return data;
85898
- });
85899
- function useUserApiStats() {
85900
- const { address: account } = useEVMAccount();
85901
- return useQuery({
85902
- queryKey: [`${QUERY_KEYS.USER_STATS}-${account}`],
85903
- queryFn: () => getUserApiStats(account),
85904
- staleTime: Infinity,
85905
- refetchOnWindowFocus: false,
85906
- refetchOnMount: false,
85907
- retry: 1,
85908
- });
85909
- }
85910
-
85911
- const BuyAgainRow = () => {
85978
+ const SoldOutRows = ({ bonds }) => {
85912
85979
  var _a, _b, _c;
85913
- const { data: userData } = useUserApiStats();
85914
- const { data: bills } = useBondsData();
85915
- const SDKConfig = useSDKConfig();
85916
- const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
85917
- const bond = useMemo(() => {
85918
- if (userData && (userData === null || userData === void 0 ? void 0 : userData.Sales.length) > 0) {
85919
- const sortedPurchases = userData === null || userData === void 0 ? void 0 : userData.Sales.sort((a, b) => b.dollarValue - a.dollarValue);
85920
- const activeBills = bills === null || bills === void 0 ? void 0 : bills.filter((bill) => !isBondSoldOut(bill, SDKConfig.showLowValueBonds) && (chains === null || chains === void 0 ? void 0 : chains.includes(bill.chainId)));
85921
- const highestActivePurchase = sortedPurchases === null || sortedPurchases === void 0 ? void 0 : sortedPurchases.find((purchase) => activeBills === null || activeBills === void 0 ? void 0 : activeBills.find((bill) => {
85922
- var _a, _b;
85923
- if (purchase.contractAddress.toLowerCase() === ((_b = (_a = bill === null || bill === void 0 ? void 0 : bill.contractAddress) === null || _a === void 0 ? void 0 : _a[bill.chainId]) === null || _b === void 0 ? void 0 : _b.toLowerCase()))
85924
- return true;
85925
- }));
85926
- return activeBills === null || activeBills === void 0 ? void 0 : activeBills.find((bill) => {
85927
- var _a, _b, _c;
85928
- return ((_b = (_a = bill === null || bill === void 0 ? void 0 : bill.contractAddress) === null || _a === void 0 ? void 0 : _a[bill.chainId]) === null || _b === void 0 ? void 0 : _b.toLowerCase()) ===
85929
- ((_c = highestActivePurchase === null || highestActivePurchase === void 0 ? void 0 : highestActivePurchase.contractAddress) === null || _c === void 0 ? void 0 : _c.toLowerCase());
85930
- });
85931
- }
85932
- }, [SDKConfig.showLowValueBonds, bills, chains, userData]);
85933
- const bondAddress = (_a = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId];
85934
- const remainingTokensFormat = (bond) => {
85935
- const tokensRemaining = 'tokensRemaining' in bond ? bond.tokensRemaining : '0';
85936
- return formatNumberSI(parseFloat(tokensRemaining !== null && tokensRemaining !== void 0 ? tokensRemaining : '0'), 0);
85937
- };
85938
- const remainingTokensUsd = (bond) => {
85939
- const tokensRemaining = 'tokensRemaining' in bond ? bond.tokensRemaining : '0';
85940
- const payoutTokenPrice = 'payoutTokenPrice' in bond ? bond.payoutTokenPrice : 0;
85941
- const tokens = new BigNumber$1(tokensRemaining !== null && tokensRemaining !== void 0 ? tokensRemaining : '0');
85942
- return tokens.times(payoutTokenPrice !== null && payoutTokenPrice !== void 0 ? payoutTokenPrice : '0');
85943
- };
85944
- const remainingTokensString = bond
85945
- ? `${remainingTokensFormat(bond)} ${bond.earnToken.symbol} ($${formatNumberSI(remainingTokensUsd(bond).toNumber())})`
85946
- : '';
85947
- return bond ? (jsx$2(AnimatePresence, { children: jsxs(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
85948
- position: 'relative',
85949
- overflow: 'hidden',
85950
- width: '100%',
85951
- mb: '10px',
85952
- }, children: [jsx$2(Flex, { sx: {
85953
- p: '0 1px',
85954
- width: '100%',
85955
- pt: '5px',
85956
- background: 'primaryButton',
85957
- borderRadius: 'normal',
85958
- flexDirection: 'column',
85959
- opacity: 0.5,
85960
- }, children: jsx$2(Flex, { className: "buy-again-header", sx: {
85980
+ const bond = bonds[0];
85981
+ const [isOpen, setIsOpen] = useState(false);
85982
+ return (jsxs(AnimatePresence, { initial: false, children: [jsx$2(Flex, { sx: { cursor: 'pointer' }, onClick: () => setIsOpen(!isOpen), children: jsx$2(BondRow, { bondAddress: (_a = bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId], billArtCollection: (_b = bond.billArt) === null || _b === void 0 ? void 0 : _b.collection, bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_c = bond.tags) === null || _c === void 0 ? void 0 : _c[0], bondSoldOut: true, percentageAvailable: 100, remainingTokensString: `${formatNumberSI(0, 0)} ${bond.earnToken.symbol} ($${formatNumberSI(0, 2)})`, vestingTermString: "-", projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit, shortDescription: bond.shortDescription, soldoutBondsCount: bonds.length > 1 ? bonds.length : undefined, isOpen: isOpen }, `${bond.contractAddress[bond.chainId]}-${bond.chainId}`) }), bonds.length > 1 &&
85983
+ isOpen &&
85984
+ bonds
85985
+ .sort((a, b) => { var _a, _b, _c, _d; return ((_b = (_a = b === null || b === void 0 ? void 0 : b.initTime) === null || _a === void 0 ? void 0 : _a[b.chainId]) !== null && _b !== void 0 ? _b : 0) - ((_d = (_c = a === null || a === void 0 ? void 0 : a.initTime) === null || _c === void 0 ? void 0 : _c[a.chainId]) !== null && _d !== void 0 ? _d : 0); })
85986
+ .map((bond) => {
85987
+ var _a, _b, _c;
85988
+ return (jsx$2(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
85989
+ position: 'relative',
85990
+ overflow: 'hidden',
85961
85991
  width: '100%',
85962
- fontSize: '12px',
85963
- fontWeight: 500,
85964
- pl: '26px',
85965
- color: 'primaryBright',
85966
- height: '91px',
85967
- }, children: "BUY AGAIN" }) }), jsx$2(Flex, { onClick: () => {
85968
- track({
85969
- event: 'buyAgainClick',
85970
- chain: bond.chainId,
85971
- data: {
85972
- bond: bond.earnToken.symbol,
85973
- },
85974
- });
85975
- }, sx: { position: 'absolute', top: '25px', left: '1px', width: 'calc(100% - 2px)' }, children: jsx$2(BondRow, { bondAddress: (_b = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _b === void 0 ? void 0 : _b[bond === null || bond === void 0 ? void 0 : bond.chainId], bondChain: bond.chainId, billType: bond.billType, payoutToken: bond.earnToken, tag: (_c = bond.tags) === null || _c === void 0 ? void 0 : _c[0], bondSoldOut: isBondSoldOut(bond, SDKConfig.showLowValueBonds), trueBondPrices: bond === null || bond === void 0 ? void 0 : bond.trueBondPrices, minTier: bond === null || bond === void 0 ? void 0 : bond.minTier, vestingTermString: getVestingTermsString(bond), vestingCliffString: getVestingTermsTooltipString(bond), percentageAvailable: remainingPercentage(bond), remainingTokensString: remainingTokensString }, `${bondAddress}-${bond.chainId}`) })] }) })) : null;
85976
- };
85977
-
85978
- const LoadingSkeleton = () => {
85979
- return (jsxs(Flex$1, { sx: { width: '100%', flexDirection: 'column', mt: '35px' }, children: [Array.from({ length: 5 }).map((_, index) => (jsx$2(Skeleton, { animation: "waves", sx: {
85980
- width: '100%',
85981
- height: '70px',
85982
- borderRadius: 'normal',
85983
- mb: '5px',
85984
- } }, `row-shadow-${index}`))), jsx$2(Flex$1, { sx: { width: '100%', gap: '15px', mt: '25px' }, children: Array.from({ length: 3 }).map((_, index) => (jsx$2(Skeleton, { animation: "waves", sx: {
85985
- width: '100%',
85986
- height: '125px',
85987
- borderRadius: 'normal',
85988
- mb: '5px',
85989
- } }, `hot-card-shadow${index}`))) }), jsx$2(Flex$1, { sx: { width: '100%', flexDirection: 'column', mt: '25px' }, children: Array.from({ length: 3 }).map((_, index) => (jsx$2(Skeleton, { animation: "waves", sx: {
85990
- width: '100%',
85991
- height: '70px',
85992
- borderRadius: 'normal',
85993
- mb: '5px',
85994
- } }, `second-row-shadow-${index}`))) })] }));
85992
+ marginTop: '0px',
85993
+ }, className: "bonds-card-container", children: jsxs(Flex, { sx: { cursor: 'pointer' }, onClick: () => setIsOpen(!isOpen), children: [jsx$2(Flex, { sx: { alignItems: 'center', pb: '10px' }, children: jsx$2(Svg, { icon: "turnArrow", direction: 'up' }) }), jsx$2(BondRow, { bondAddress: (_a = bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId], billArtCollection: (_b = bond.billArt) === null || _b === void 0 ? void 0 : _b.collection, bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_c = bond.tags) === null || _c === void 0 ? void 0 : _c[0], bondSoldOut: true, percentageAvailable: 100, remainingTokensString: `${formatNumberSI(0, 0)} ${bond.earnToken.symbol} ($${formatNumberSI(0, 2)})`, vestingTermString: "-", projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit, shortDescription: bond.shortDescription })] }) }, `${bond.contractAddress[bond.chainId]}-${bond.chainId}`));
85994
+ })] }));
85995
85995
  };
85996
85996
 
85997
85997
  const Bonds = () => {
85998
- var _a;
85998
+ var _a, _b, _c;
85999
85999
  // Fetch data
86000
86000
  useHotBonds();
86001
+ const SDKConfig = useSDKConfig();
86001
86002
  const { favTokens } = useFavoriteTokens();
86002
86003
  const { data: bondData, refetch } = useBondsData();
86003
86004
  const { data: allBonds } = useBondsList();
86004
86005
  const { data: allPreBonds } = useBondsListPreTGE();
86005
86006
  const { data: chainFilterOption, setChainFilterOption } = useChainFilterOption();
86006
86007
  const { data: tokenPrices } = useTokenPrices();
86007
- const SDKConfig = useSDKConfig();
86008
+ const topTags = useTopTags();
86008
86009
  // State
86009
86010
  const [sortConfig, setSortConfig] = useState({ key: 'bonus', direction: 'desc' });
86010
86011
  const [searchQuery, setSearchQuery] = useState('');
86011
86012
  const [filterOption, setFilterOption] = useState('ALL');
86012
- const sortedBonds = sortBonds(sortConfig, bondData);
86013
- const topTags = useTopTags(sortedBonds);
86013
+ // Static data
86014
86014
  const filterOptions = ['ALL', 'FAVORITES', ...topTags, 'SOLD OUT'];
86015
+ const validatedChains = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains) === null || _a === void 0 ? void 0 : _a.filter((chain) => MAINNET_CHAINS.includes(chain));
86015
86016
  const billsToRender = useMemo(() => {
86016
- let billsToReturn = filterOption === 'SOLD OUT' ? [...(allPreBonds !== null && allPreBonds !== void 0 ? allPreBonds : []), ...(allBonds !== null && allBonds !== void 0 ? allBonds : [])] : (sortedBonds !== null && sortedBonds !== void 0 ? sortedBonds : []);
86017
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
86018
- return (isBondSupported(SDKConfig.highestCompatibleVersion, bill.version) &&
86019
- (bill.onlyPartner ? SDKConfig.bondPartner === bill.bondPartner : true));
86017
+ if (!allBonds || !allPreBonds)
86018
+ return {};
86019
+ const sortedBonds = sortBonds(sortConfig, bondData);
86020
+ const bondsToUse = filterOption === 'SOLD OUT' ? [...allPreBonds, ...allBonds] : sortedBonds;
86021
+ const filteredBonds = bondsToUse === null || bondsToUse === void 0 ? void 0 : bondsToUse.filter((bill) => {
86022
+ var _a, _b, _c, _d, _e, _f;
86023
+ // filter incompatible bonds
86024
+ if (!isBondSupported(SDKConfig.highestCompatibleVersion, bill.version))
86025
+ return false;
86026
+ // filter onlyPartner Bonds
86027
+ if (bill.onlyPartner && SDKConfig.bondPartner !== bill.bondPartner)
86028
+ return false;
86029
+ // filter searchQuery
86030
+ if (searchQuery) {
86031
+ const matchesSearch = [
86032
+ `${(_a = bill === null || bill === void 0 ? void 0 : bill.earnToken) === null || _a === void 0 ? void 0 : _a.symbol.toUpperCase()}`,
86033
+ `${(_b = bill === null || bill === void 0 ? void 0 : bill.lpToken) === null || _b === void 0 ? void 0 : _b.symbol.toUpperCase()}`,
86034
+ ].some((property) => property === null || property === void 0 ? void 0 : property.includes(searchQuery.toUpperCase()));
86035
+ if (!matchesSearch)
86036
+ return false;
86037
+ }
86038
+ // filter tiers
86039
+ if (!(SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.useTiers) && 'minTier' in bill) {
86040
+ if (bill.minTier !== null && bill.minTier !== undefined)
86041
+ return false;
86042
+ }
86043
+ // filter bondPartner
86044
+ if ((SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.bondPartner) && bill.bondPartner !== SDKConfig.bondPartner)
86045
+ return false;
86046
+ // filter topTags
86047
+ if (topTags.includes(filterOption) && !((_c = bill === null || bill === void 0 ? void 0 : bill.tags) === null || _c === void 0 ? void 0 : _c.includes(filterOption)))
86048
+ return false;
86049
+ // filter chainFilterOption
86050
+ if (chainFilterOption && !(chainFilterOption === null || chainFilterOption === void 0 ? void 0 : chainFilterOption.includes('All Chains'))) {
86051
+ if (!(chainFilterOption === null || chainFilterOption === void 0 ? void 0 : chainFilterOption.includes((_d = bill === null || bill === void 0 ? void 0 : bill.chainId) === null || _d === void 0 ? void 0 : _d.toString())))
86052
+ return false;
86053
+ }
86054
+ // filter SOLD OUT
86055
+ if (filterOption === 'SOLD OUT' && !isBondSoldOut(bill, SDKConfig.showLowValueBonds))
86056
+ return false;
86057
+ // filter not SOLD OUT
86058
+ if (filterOption !== 'SOLD OUT' && isBondSoldOut(bill, SDKConfig.showLowValueBonds))
86059
+ return false;
86060
+ // filter FAVORITES
86061
+ if (filterOption === 'FAVORITES' && !favTokens.includes((_f = (_e = bill === null || bill === void 0 ? void 0 : bill.earnToken) === null || _e === void 0 ? void 0 : _e.symbol) === null || _f === void 0 ? void 0 : _f.toLowerCase()))
86062
+ return false;
86063
+ return true;
86020
86064
  });
86021
- if (searchQuery) {
86022
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
86023
- var _a, _b;
86024
- return [`${(_a = bill === null || bill === void 0 ? void 0 : bill.earnToken) === null || _a === void 0 ? void 0 : _a.symbol.toUpperCase()}`, `${(_b = bill === null || bill === void 0 ? void 0 : bill.lpToken) === null || _b === void 0 ? void 0 : _b.symbol.toUpperCase()}`].some((property) => property === null || property === void 0 ? void 0 : property.includes(searchQuery.toUpperCase()));
86025
- });
86026
- }
86027
- if (!(SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.useTiers)) {
86028
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
86029
- return 'minTier' in bill ? bill.minTier === null || bill.minTier === undefined : true; //TODO: check this
86030
- });
86031
- }
86032
- if (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.bondPartner) {
86033
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => bill.bondPartner === SDKConfig.bondPartner);
86034
- }
86035
- if (topTags.includes(filterOption)) {
86036
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => { var _a; return (_a = bill === null || bill === void 0 ? void 0 : bill.tags) === null || _a === void 0 ? void 0 : _a.includes(filterOption); });
86037
- }
86038
- if (!(chainFilterOption === null || chainFilterOption === void 0 ? void 0 : chainFilterOption.includes('All Chains'))) {
86039
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => { var _a; return chainFilterOption === null || chainFilterOption === void 0 ? void 0 : chainFilterOption.includes((_a = bill === null || bill === void 0 ? void 0 : bill.chainId) === null || _a === void 0 ? void 0 : _a.toString()); });
86040
- }
86041
- if (filterOption !== 'SOLD OUT') {
86042
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bond) => !isBondSoldOut(bond, SDKConfig.showLowValueBonds));
86043
- }
86044
86065
  if (filterOption === 'SOLD OUT') {
86045
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bond) => isBondSoldOut(bond, SDKConfig.showLowValueBonds));
86066
+ return filteredBonds === null || filteredBonds === void 0 ? void 0 : filteredBonds.reduce((acc, bond) => {
86067
+ var _a;
86068
+ const symbol = (_a = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _a === void 0 ? void 0 : _a.symbol;
86069
+ const chainId = bond.chainId;
86070
+ if (!acc[chainId])
86071
+ acc[chainId] = {};
86072
+ if (!acc[chainId][symbol])
86073
+ acc[chainId][symbol] = [];
86074
+ acc[chainId][symbol].push(bond);
86075
+ return acc;
86076
+ }, {});
86046
86077
  }
86047
- if (filterOption === 'FAVORITES') {
86048
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => { var _a, _b; return favTokens.includes((_b = (_a = bill === null || bill === void 0 ? void 0 : bill.earnToken) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.toLowerCase()); });
86078
+ else {
86079
+ return filteredBonds === null || filteredBonds === void 0 ? void 0 : filteredBonds.reduce((acc, bond) => {
86080
+ const { chainId } = bond;
86081
+ if (!acc[chainId])
86082
+ acc[chainId] = [];
86083
+ acc[chainId].push(bond);
86084
+ return acc;
86085
+ }, {});
86049
86086
  }
86050
- return billsToReturn;
86051
86087
  }, [
86052
- filterOption,
86053
- allPreBonds,
86054
86088
  allBonds,
86055
- sortedBonds,
86056
- searchQuery,
86057
- SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.useTiers,
86058
- SDKConfig.bondPartner,
86089
+ allPreBonds,
86090
+ sortConfig,
86091
+ bondData,
86092
+ filterOption,
86059
86093
  SDKConfig.highestCompatibleVersion,
86094
+ SDKConfig.bondPartner,
86095
+ SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.useTiers,
86060
86096
  SDKConfig.showLowValueBonds,
86097
+ searchQuery,
86061
86098
  topTags,
86062
86099
  chainFilterOption,
86063
86100
  favTokens,
@@ -86098,8 +86135,11 @@ const Bonds = () => {
86098
86135
  refetch();
86099
86136
  }
86100
86137
  /* eslint-disable react-hooks/exhaustive-deps */
86101
- }, [(_a = Object.keys(tokenPrices !== null && tokenPrices !== void 0 ? tokenPrices : {})) === null || _a === void 0 ? void 0 : _a.length, bondData === null || bondData === void 0 ? void 0 : bondData.length, refetch]);
86102
- return (jsxs(Flex, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), jsx$2(BondsMenu, { searchQuery: searchQuery, setSearchQuery: setSearchQuery, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onSort: handleSortOptions }), SDKConfig.useHotBonds && !SDKConfig.bondPartner && jsx$2(BuyAgainRow, {}), (billsToRender === null || billsToRender === void 0 ? void 0 : billsToRender.length) > 0 ? (jsx$2(BondRowsByChain, { bonds: billsToRender, hideTitles: searchQuery !== '' || filterOption !== 'ALL', showSolSkeleton: chainFilterOption.includes('All Chains') || chainFilterOption.includes(main.ChainId.SOL.toString()) })) : searchQuery || !chainFilterOption.includes('All Chains') ? (jsx$2(Flex, { className: "placeholder-monkey-wrapper", children: jsx$2(PlaceholderMonkey, { text: 'No results, change filters.' }) })) : filterOption === 'FAVORITES' ? (jsxs(Flex, { sx: {
86138
+ }, [(_b = Object.keys(tokenPrices !== null && tokenPrices !== void 0 ? tokenPrices : {})) === null || _b === void 0 ? void 0 : _b.length, bondData === null || bondData === void 0 ? void 0 : bondData.length, refetch]);
86139
+ return (jsxs(Flex, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), jsx$2(BondsMenu, { searchQuery: searchQuery, setSearchQuery: setSearchQuery, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onSort: handleSortOptions }), SDKConfig.useHotBonds && !SDKConfig.bondPartner && filterOption !== 'SOLD OUT' && jsx$2(BuyAgainRow, {}), ((_c = Object.keys(billsToRender)) === null || _c === void 0 ? void 0 : _c.length) > 0 ? (jsx$2(Flex, { className: "bondrowsbychain", children: validatedChains === null || validatedChains === void 0 ? void 0 : validatedChains.map((chain) => {
86140
+ var _a, _b, _c;
86141
+ return filterOption === 'SOLD OUT' ? (Object.entries((_a = billsToRender[chain]) !== null && _a !== void 0 ? _a : {}).map((groupedBonds) => (jsx$2(SoldOutRows, { bonds: groupedBonds[1] }, groupedBonds[0])))) : (jsx$2(ActiveBondRows, { chain: chain, bonds: ((_b = billsToRender[chain]) !== null && _b !== void 0 ? _b : []), hideTitles: searchQuery !== '', showHotBonds: !searchQuery && SDKConfig.useHotBonds && ((_c = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.hotBondChains) === null || _c === void 0 ? void 0 : _c.includes(chain)) }, chain));
86142
+ }) })) : searchQuery || !chainFilterOption.includes('All Chains') ? (jsx$2(Flex, { className: "placeholder-monkey-wrapper", children: jsx$2(PlaceholderMonkey, { text: 'No results, change filters.' }) })) : filterOption === 'FAVORITES' ? (jsxs(Flex, { sx: {
86103
86143
  width: '100%',
86104
86144
  height: '300px',
86105
86145
  background: 'white2',
package/dist/styles.css CHANGED
@@ -608,7 +608,6 @@ span.flex-inline {
608
608
  width: 100%;
609
609
  height: 70px;
610
610
  background-color: var(--theme-ui-colors-white2);
611
- cursor: pointer;
612
611
  margin-bottom: 5px;
613
612
  justify-content: space-between;
614
613
  position: relative;
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
+ import { BondsData } from '../../types/bonds';
3
+ import { BaseBondConfig } from '@ape.swap/apeswap-lists';
2
4
  type SortableKeys = 'bonus' | 'arr' | 'terms' | 'tokensRemaining';
3
5
  type SortDirection = 'asc' | 'desc';
4
6
  export interface SortOptions {
5
7
  key: SortableKeys;
6
8
  direction: SortDirection;
7
9
  }
10
+ export type GroupedByChain = Record<number, (BondsData | BaseBondConfig)[]>;
11
+ export type GroupedBySymbol = Record<number, Record<string, (BondsData | BaseBondConfig)[]>>;
8
12
  declare const Bonds: () => React.JSX.Element;
9
13
  export default Bonds;
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
2
  import { BondsData } from '../../../../types/bonds';
3
3
  import { BaseBondConfig } from '@ape.swap/apeswap-lists';
4
- export interface BondRowsWithTitleProps {
4
+ export interface ActiveBondRowsProps {
5
5
  chain: number;
6
6
  bonds: (BondsData | BaseBondConfig)[];
7
7
  hideTitles: boolean;
8
8
  showHotBonds: boolean;
9
- showSolSkeleton: boolean;
10
9
  }
11
- declare const BondRowsWithTitle: React.FC<BondRowsWithTitleProps>;
12
- export default BondRowsWithTitle;
10
+ declare const ActiveBondRows: React.FC<ActiveBondRowsProps>;
11
+ export default ActiveBondRows;
@@ -21,6 +21,8 @@ interface BondRowProps {
21
21
  twitterURL?: string;
22
22
  auditURL?: string;
23
23
  shortDescription?: string;
24
+ soldoutBondsCount?: number;
25
+ isOpen?: boolean;
24
26
  }
25
27
  declare const BondRow: React.FC<BondRowProps>;
26
28
  export default BondRow;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { BaseBondConfig } from '@ape.swap/apeswap-lists';
3
+ import { BondsData } from '../../../../types/bonds';
4
+ declare const SoldOutRows: ({ bonds }: {
5
+ bonds: (BondsData | BaseBondConfig)[];
6
+ }) => React.JSX.Element;
7
+ export default SoldOutRows;
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.2.3-test.1",
6
+ "version": "4.2.3-test.3",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { BondsData } from '../../../../types/bonds';
3
- import { BaseBondConfig } from '@ape.swap/apeswap-lists';
4
- export interface BondRowsByChainProps {
5
- bonds: (BondsData | BaseBondConfig)[];
6
- hideTitles: boolean;
7
- showSolSkeleton: boolean;
8
- }
9
- declare const BondRowsByChain: React.FC<BondRowsByChainProps>;
10
- export default BondRowsByChain;