@ape.swap/bonds-sdk 5.0.3 → 5.0.5

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.
@@ -4,5 +4,6 @@ declare const ButtonsRow: React.FC<{
4
4
  twitter?: string;
5
5
  earnTokenContract?: string;
6
6
  cgId?: string;
7
+ dexscreener?: string;
7
8
  }>;
8
9
  export default ButtonsRow;
@@ -9,6 +9,7 @@ export interface TooltipProps {
9
9
  isSoldOut?: boolean;
10
10
  billType?: string;
11
11
  cgId?: string;
12
+ dexscreener?: string;
12
13
  }
13
14
  declare const BondInfoTooltip: React.FunctionComponent<TooltipProps>;
14
15
  export default BondInfoTooltip;
package/dist/main.js CHANGED
@@ -59700,8 +59700,8 @@ const styles$a = {
59700
59700
  },
59701
59701
  };
59702
59702
 
59703
- const ButtonsRow = ({ projectLink, twitter, earnTokenContract, cgId }) => {
59704
- const dexscreenerURL = earnTokenContract ? `https://dexscreener.com/search?q=${earnTokenContract}` : undefined;
59703
+ const ButtonsRow = ({ projectLink, twitter, earnTokenContract, cgId, dexscreener }) => {
59704
+ const dexscreenerURL = dexscreener || (earnTokenContract ? `https://dexscreener.com/search?q=${earnTokenContract}` : undefined);
59705
59705
  const coingeckoURL = cgId ? `https://www.coingecko.com/en/coins/${cgId}` : undefined;
59706
59706
  return (jsxs(Flex, { sx: { justifyContent: 'center' }, children: [jsx$2(Flex, { sx: styles$a.iconButton, as: Link, href: projectLink, target: "_blank", children: jsx$2(Svg, { icon: "URL", width: 18 }) }), jsx$2(Flex, { sx: styles$a.iconButton, as: Link, href: twitter, target: "_blank", children: jsx$2(Svg, { icon: "twitter", width: 18, color: "text" }) }), dexscreenerURL && (jsx$2(Flex, { sx: styles$a.iconButton, as: Link, href: dexscreenerURL, target: "_blank", children: jsx$2(Svg, { icon: "dexscreener", width: 18, color: "text" }) })), coingeckoURL && (jsx$2(Flex, { sx: styles$a.iconButton, as: Link, href: coingeckoURL, target: "_blank", children: jsx$2(Svg, { icon: "coingecko", width: 18, color: "text" }) }))] }));
59707
59707
  };
@@ -59723,7 +59723,7 @@ const ExpandedViewButton = ({ handleNavigation, rightPos }) => {
59723
59723
  }, onClick: handleNavigation, children: ["Project Info", jsx$2(Flex, { sx: { ml: '4px' }, children: jsx$2(Svg, { icon: "expand", width: 20, color: "white" }) })] }) }));
59724
59724
  };
59725
59725
 
59726
- const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, projectLink, twitter, chain, isSoldOut = false, billType, cgId, }) => {
59726
+ const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, projectLink, twitter, chain, isSoldOut = false, billType, cgId, dexscreener, }) => {
59727
59727
  const config = useSDKConfig();
59728
59728
  const explorerLink = BLOCK_EXPLORER[chain];
59729
59729
  const urlPage = chain === main.ChainId.SOL ? 'account' : 'address';
@@ -59742,11 +59742,11 @@ const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, pro
59742
59742
  },
59743
59743
  });
59744
59744
  };
59745
- return (jsxs(Flex, { sx: { flexDirection: 'column', flexWrap: 'wrap' }, children: [jsx$2(ButtonsRow, { twitter: twitter, projectLink: projectLink, earnTokenContract: earnTokenContract, cgId: cgId }), (config === null || config === void 0 ? void 0 : config.referenceId) === 'apebond' && !isSoldOut && billType !== 'fcfs' && (jsx$2(Flex, { sx: { width: '100%', my: '5px', justifyContent: 'center', position: 'relative', height: '25px' }, children: jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation, rightPos: '-5px' }) })), jsx$2(Flex, { sx: { justifyContent: 'center' }, children: jsxs(Flex, { sx: { width: '144px', flexDirection: 'column' }, children: [jsx$2(Flex, { sx: styles$a.linkRow, children: tokenLink && (jsxs(Link, { href: tokenLink, sx: styles$a.link, target: "_blank", children: ["View Token Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$a.linkRow, children: bondLink && (jsxs(Link, { href: bondLink, sx: styles$a.link, target: "_blank", children: ["View Bond Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$a.linkRow, children: billType !== 'fcfs' && (jsxs(Link, { href: bondDashboard, sx: styles$a.link, target: "_blank", rel: "noopener noreferrer", children: ["View Bond Insights", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) })] }) })] }));
59745
+ return (jsxs(Flex, { sx: { flexDirection: 'column', flexWrap: 'wrap' }, children: [jsx$2(ButtonsRow, { twitter: twitter, projectLink: projectLink, earnTokenContract: earnTokenContract, cgId: cgId, dexscreener: dexscreener }), (config === null || config === void 0 ? void 0 : config.referenceId) === 'apebond' && !isSoldOut && billType !== 'fcfs' && (jsx$2(Flex, { sx: { width: '100%', my: '5px', justifyContent: 'center', position: 'relative', height: '25px' }, children: jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation, rightPos: '-5px' }) })), jsx$2(Flex, { sx: { justifyContent: 'center' }, children: jsxs(Flex, { sx: { width: '144px', flexDirection: 'column' }, children: [jsx$2(Flex, { sx: styles$a.linkRow, children: tokenLink && (jsxs(Link, { href: tokenLink, sx: styles$a.link, target: "_blank", children: ["View Token Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$a.linkRow, children: bondLink && (jsxs(Link, { href: bondLink, sx: styles$a.link, target: "_blank", children: ["View Bond Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$a.linkRow, children: billType !== 'fcfs' && (jsxs(Link, { href: bondDashboard, sx: styles$a.link, target: "_blank", rel: "noopener noreferrer", children: ["View Bond Insights", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) })] }) })] }));
59746
59746
  };
59747
59747
 
59748
59748
  const UserBondRow = ({ bill }) => {
59749
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
59749
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
59750
59750
  // Hooks
59751
59751
  const userChainId = useChainId();
59752
59752
  const SDKConfig = useSDKConfig();
@@ -59828,7 +59828,7 @@ const UserBondRow = ({ bill }) => {
59828
59828
  }
59829
59829
  /* eslint-disable react-hooks/exhaustive-deps */
59830
59830
  }, [isConfirmed]);
59831
- return (jsxs("div", { className: "your-bonds", onClick: onOpenPurchasedBond, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_g = (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.earnToken) === null || _g === void 0 ? void 0 : _g.symbol, chain: (_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.chainId, tag: (_k = (_j = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _j === void 0 ? void 0 : _j.tags) === null || _k === void 0 ? void 0 : _k[0], vestEnds: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_l = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _l === void 0 ? void 0 : _l.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_m = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _m === void 0 ? void 0 : _m.earnToken.symbol) || '', bondContract: (_o = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _o !== void 0 ? _o : '', projectLink: (_p = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _p === void 0 ? void 0 : _p.projectLink, twitter: (_q = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _q === void 0 ? void 0 : _q.twitter, chain: (_r = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _r === void 0 ? void 0 : _r.chainId, cgId: (_s = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _s === void 0 ? void 0 : _s.cgId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
59831
+ return (jsxs("div", { className: "your-bonds", onClick: onOpenPurchasedBond, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_g = (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.earnToken) === null || _g === void 0 ? void 0 : _g.symbol, chain: (_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.chainId, tag: (_k = (_j = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _j === void 0 ? void 0 : _j.tags) === null || _k === void 0 ? void 0 : _k[0], vestEnds: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_l = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _l === void 0 ? void 0 : _l.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_m = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _m === void 0 ? void 0 : _m.earnToken.symbol) || '', bondContract: (_o = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _o !== void 0 ? _o : '', projectLink: (_p = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _p === void 0 ? void 0 : _p.projectLink, twitter: (_q = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _q === void 0 ? void 0 : _q.twitter, chain: (_r = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _r === void 0 ? void 0 : _r.chainId, cgId: (_s = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _s === void 0 ? void 0 : _s.cgId, dexscreener: (_t = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _t === void 0 ? void 0 : _t.dexscreener }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
59832
59832
  opacity: 0.8,
59833
59833
  }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsx$2(Flex$1, { sx: { width: '125px' }, children: jsx$2(ProfitCard, { userBond: bill }) }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(claimable(bill), 3), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(claimable(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(pending(bill), 3), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(pending(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: getPercentageVested(bill) }), style: {
59834
59834
  width: '127px',
@@ -59849,7 +59849,7 @@ const UserBondRow = ({ bill }) => {
59849
59849
  };
59850
59850
 
59851
59851
  const UserBondRowSolana = ({ bill }) => {
59852
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
59852
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
59853
59853
  // Hooks
59854
59854
  const SDKConfig = useSDKConfig();
59855
59855
  const { setVisible } = useWalletModal();
@@ -59960,7 +59960,7 @@ const UserBondRowSolana = ({ bill }) => {
59960
59960
  setLoadingTx(false);
59961
59961
  }
59962
59962
  };
59963
- return (jsxs("div", { className: "your-bonds", onClick: () => onOpenPurchasedBond(), children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_e = bill.bond) === null || _e === void 0 ? void 0 : _e.earnToken.symbol, chain: (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.chainId, vestEnds: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_g = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _g === void 0 ? void 0 : _g.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.earnToken.symbol) || '', bondContract: (_j = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _j !== void 0 ? _j : '', projectLink: (_k = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _k === void 0 ? void 0 : _k.projectLink, twitter: (_l = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _l === void 0 ? void 0 : _l.twitter, chain: (_m = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _m === void 0 ? void 0 : _m.chainId, cgId: (_o = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _o === void 0 ? void 0 : _o.cgId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex, { sx: {
59963
+ return (jsxs("div", { className: "your-bonds", onClick: () => onOpenPurchasedBond(), children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_e = bill.bond) === null || _e === void 0 ? void 0 : _e.earnToken.symbol, chain: (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.chainId, vestEnds: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_g = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _g === void 0 ? void 0 : _g.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.earnToken.symbol) || '', bondContract: (_j = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _j !== void 0 ? _j : '', projectLink: (_k = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _k === void 0 ? void 0 : _k.projectLink, twitter: (_l = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _l === void 0 ? void 0 : _l.twitter, chain: (_m = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _m === void 0 ? void 0 : _m.chainId, cgId: (_o = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _o === void 0 ? void 0 : _o.cgId, dexscreener: (_p = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _p === void 0 ? void 0 : _p.dexscreener }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex, { sx: {
59964
59964
  opacity: 0.8,
59965
59965
  }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsx$2(Flex, { sx: { width: '125px' }, children: jsx$2(ProfitCard, { userBond: bill }) }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(claimable(bill), 4), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(claimable(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(pending(bill), 4), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(pending(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: getPercentageVested(bill) }), style: {
59966
59966
  width: '127px',
@@ -59973,7 +59973,7 @@ const UserBondRowSolana = ({ bill }) => {
59973
59973
  : `Fully Vested.` }) }), jsx$2("div", { className: "your-bonds-column-button", children: !accountSolana ? (jsxs(Button, { className: "button", disabled: claimable(bill) === 0 || loadingTx, load: loadingTx, onClick: (event) => {
59974
59974
  event.stopPropagation();
59975
59975
  setVisible(true);
59976
- }, fullWidth: true, children: ["Connect to ", NETWORK_LABEL[(_p = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _p === void 0 ? void 0 : _p.chainId]] })) : (jsx$2(Button, { className: "button", disabled: claimable(bill) === 0 || loadingTx || isPendingCliff, load: loadingTx, onClick: (event) => {
59976
+ }, fullWidth: true, children: ["Connect to ", NETWORK_LABEL[(_q = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _q === void 0 ? void 0 : _q.chainId]] })) : (jsx$2(Button, { className: "button", disabled: claimable(bill) === 0 || loadingTx || isPendingCliff, load: loadingTx, onClick: (event) => {
59977
59977
  event.stopPropagation();
59978
59978
  if (!loadingTx)
59979
59979
  handleClaim();
@@ -67226,7 +67226,7 @@ const BonusContainer = ({ trueBondPrices, minTier, bonus, airdropTooltip, toolti
67226
67226
  return (jsx$2("div", { className: `discount-column`, children: jsx$2(BonusComponent, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip, tooltipPosition: isMobile ? tooltipPosition : 'bottomLeft' }) }));
67227
67227
  };
67228
67228
 
67229
- const BondRow = ({ bondAddress, bondChain, marketingCampaign, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, shortDescription, soldoutBondsCount, isOpen, cgId, }) => {
67229
+ const BondRow = ({ bondAddress, bondChain, marketingCampaign, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, shortDescription, soldoutBondsCount, isOpen, cgId, dexscreener, }) => {
67230
67230
  var _a, _b, _c;
67231
67231
  const SDKConfig = useSDKConfig();
67232
67232
  const locationPath = window.location.pathname.replace('/', '');
@@ -67262,36 +67262,18 @@ const BondRow = ({ bondAddress, bondChain, marketingCampaign, payoutToken, billT
67262
67262
  flexDirection: 'column',
67263
67263
  justifyContent: 'center',
67264
67264
  display: ['none', 'none', 'none', 'flex'],
67265
- }, 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, chain: bondChain, isSoldOut: bondSoldOut, billType: billType, cgId: cgId }), 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}`));
67265
+ }, 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, chain: bondChain, isSoldOut: bondSoldOut, billType: billType, cgId: cgId, dexscreener: dexscreener }), 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}`));
67266
67266
  };
67267
67267
 
67268
- // import useUserApiStats from '../../../../state/bondApiStats/useUserApiStats'
67269
67268
  const BuyAgainRow = () => {
67270
67269
  var _a, _b, _c;
67271
- // const { data: userData } = useUserApiStats()
67272
67270
  const { data: bills } = useBondsData();
67273
67271
  const SDKConfig = useSDKConfig();
67272
+ const highlightedBond = SDKConfig.highlightedBond;
67274
67273
  const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
67275
- // const bond = useMemo(() => {
67276
- // if (userData && userData?.Sales.length > 0) {
67277
- // const sortedPurchases = userData?.Sales.sort((a, b) => b.dollarValue - a.dollarValue)
67278
- // const activeBills = bills?.filter(
67279
- // (bill) => !isBondSoldOut(bill, SDKConfig.showLowValueBonds) && chains?.includes(bill.chainId),
67280
- // )
67281
- // const highestActivePurchase = sortedPurchases?.find((purchase) =>
67282
- // activeBills?.find((bill) => {
67283
- // if (purchase.contractAddress.toLowerCase() === bill?.contractAddress?.[bill.chainId]?.toLowerCase())
67284
- // return true
67285
- // }),
67286
- // )
67287
- // return activeBills?.find(
67288
- // (bill) =>
67289
- // bill?.contractAddress?.[bill.chainId]?.toLowerCase() ===
67290
- // highestActivePurchase?.contractAddress?.toLowerCase(),
67291
- // )
67292
- // }
67293
- // }, [SDKConfig.showLowValueBonds, bills, chains, userData])
67294
- const bond = useMemo(() => bills === null || bills === void 0 ? void 0 : bills.find((bill) => bill.earnToken.symbol === 'pmUSD' && !bill.soldOut && chains.includes(bill.chainId)), [bills, chains]);
67274
+ const bond = useMemo(() => bills === null || bills === void 0 ? void 0 : bills.find((bill) => bill.earnToken.symbol.toLowerCase() === (highlightedBond === null || highlightedBond === void 0 ? void 0 : highlightedBond.toLowerCase()) &&
67275
+ !bill.soldOut &&
67276
+ chains.includes(bill.chainId)), [bills, chains, highlightedBond]);
67295
67277
  const bondAddress = (_a = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId];
67296
67278
  const remainingTokensFormat = (bond) => {
67297
67279
  const tokensRemaining = 'tokensRemaining' in bond ? bond.tokensRemaining : '0';
@@ -67451,7 +67433,7 @@ const HotBondCard = ({ bond }) => {
67451
67433
  },
67452
67434
  });
67453
67435
  };
67454
- 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, chain: bond === null || bond === void 0 ? void 0 : bond.chainId, cgId: bond === null || bond === void 0 ? void 0 : bond.cgId }), 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 = getTimePeriods(bond === null || bond === void 0 ? void 0 : bond.vestingTerm, true)) === null || _m === void 0 ? void 0 : _m.days)
67436
+ 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, chain: bond === null || bond === void 0 ? void 0 : bond.chainId, cgId: bond === null || bond === void 0 ? void 0 : bond.cgId, dexscreener: bond === null || bond === void 0 ? void 0 : bond.dexscreener }), 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 = getTimePeriods(bond === null || bond === void 0 ? void 0 : bond.vestingTerm, true)) === null || _m === void 0 ? void 0 : _m.days)
67455
67437
  ? `${(_o = getTimePeriods(bond === null || bond === void 0 ? void 0 : bond.vestingTerm, true)) === null || _o === void 0 ? void 0 : _o.days} D`
67456
67438
  : '-' })] })] })] }) }));
67457
67439
  };
@@ -72753,7 +72735,7 @@ const ActiveBondRows = ({ chain, bonds, hideTitles, showHotBonds }) => {
72753
72735
  const bond = bondFromMap;
72754
72736
  const bondAddress = (_u = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _u === void 0 ? void 0 : _u[bond === null || bond === void 0 ? void 0 : bond.chainId];
72755
72737
  const remainingTokensString = getRemainingTokensString(bond);
72756
- return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, marketingCampaign: bond.marketingCampaign, payoutToken: bond.earnToken, billType: bond.billType, tag: (_v = bond.tags) === null || _v === void 0 ? void 0 : _v[0], trueBondPrices: namingPreference === 'Bonus' ? bond.trueBondPrices : undefined, minTier: bond === null || bond === void 0 ? void 0 : bond.minTier, vestingTermString: getVestingTermsString(bond), vestingCliffString: getVestingTermsTooltipString(bond), percentageAvailable: remainingPercentage(bond), remainingTokensString: remainingTokensString, projectURL: bond.projectLink, twitterURL: bond.twitter, bonus: namingPreference === 'Discount' ? `${(_w = bond === null || bond === void 0 ? void 0 : bond.discountWithFee) === null || _w === void 0 ? void 0 : _w.toFixed(2)}%` : undefined, shortDescription: bond.shortDescription, cgId: bond.cgId }, `${bondAddress}-${bond.chainId}-${index}`));
72738
+ return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, marketingCampaign: bond.marketingCampaign, payoutToken: bond.earnToken, billType: bond.billType, tag: (_v = bond.tags) === null || _v === void 0 ? void 0 : _v[0], trueBondPrices: namingPreference === 'Bonus' ? bond.trueBondPrices : undefined, minTier: bond === null || bond === void 0 ? void 0 : bond.minTier, vestingTermString: getVestingTermsString(bond), vestingCliffString: getVestingTermsTooltipString(bond), percentageAvailable: remainingPercentage(bond), remainingTokensString: remainingTokensString, projectURL: bond.projectLink, twitterURL: bond.twitter, bonus: namingPreference === 'Discount' ? `${(_w = bond === null || bond === void 0 ? void 0 : bond.discountWithFee) === null || _w === void 0 ? void 0 : _w.toFixed(2)}%` : undefined, shortDescription: bond.shortDescription, cgId: bond.cgId, dexscreener: bond === null || bond === void 0 ? void 0 : bond.dexscreener }, `${bondAddress}-${bond.chainId}-${index}`));
72757
72739
  }
72758
72740
  }), showHotBonds && (jsx$2(SwiperProvider, { children: jsx$2(HotBondCards, {}) }))] }, key))] }) }, key));
72759
72741
  };
@@ -15,6 +15,7 @@ export interface SDKPropsDTO {
15
15
  highestCompatibleVersion?: string;
16
16
  blockSales?: boolean;
17
17
  customBranch?: string;
18
+ highlightedBond?: string;
18
19
  }
19
20
  export interface SDKProps {
20
21
  referenceId: string;
@@ -35,6 +36,7 @@ export interface SDKProps {
35
36
  useCardsView?: boolean;
36
37
  blockSales?: boolean;
37
38
  customBranch?: string;
39
+ highlightedBond?: string;
38
40
  }
39
41
  export declare const useSDKConfig: (config?: SDKPropsDTO) => SDKProps;
40
42
  export type URLKeys = 'apiV2' | 'realTimeApi' | 'mainUrl' | 'priceApi';
@@ -23,6 +23,7 @@ interface BondRowProps {
23
23
  soldoutBondsCount?: number;
24
24
  isOpen?: boolean;
25
25
  cgId?: string;
26
+ dexscreener?: string;
26
27
  }
27
28
  declare const BondRow: React.FC<BondRowProps>;
28
29
  export default BondRow;
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": "5.0.3",
6
+ "version": "5.0.5",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",
@@ -81,7 +81,7 @@
81
81
  "yalc": "^1.0.0-pre.53"
82
82
  },
83
83
  "dependencies": {
84
- "@ape.swap/apeswap-lists": "4.5.9",
84
+ "@ape.swap/apeswap-lists": "4.5.10",
85
85
  "@emotion/react": "11.14.0",
86
86
  "@jup-ag/api": "6.0.45",
87
87
  "bignumber.js": "^9.1.2",