@ape.swap/bonds-sdk 3.0.89 → 3.0.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -58352,15 +58352,17 @@ const stagingUrls = {
58352
58352
  };
58353
58353
  const useSDKConfig = (config) => {
58354
58354
  const urls = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls;
58355
+ const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.1.2' });
58355
58356
  const { data } = useQuery({
58356
58357
  queryKey: [QUERY_KEYS.SDK_CONFIG],
58357
- initialData: Object.assign(Object.assign({ useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.1.2' }),
58358
+ initialData,
58358
58359
  });
58359
58360
  return data;
58360
58361
  };
58361
58362
  const useURLByEnvironment = (key) => {
58363
+ var _a;
58362
58364
  const config = useSDKConfig();
58363
- return config === null || config === void 0 ? void 0 : config.urls[key];
58365
+ return (_a = config === null || config === void 0 ? void 0 : config.urls) === null || _a === void 0 ? void 0 : _a[key];
58364
58366
  };
58365
58367
 
58366
58368
  function reportError$1(_a) {
@@ -73613,6 +73615,7 @@ const PreTgeUserRow = ({ userBond }) => {
73613
73615
  const YourBonds = ({ showOnly }) => {
73614
73616
  useTokenPrices();
73615
73617
  // Hooks
73618
+ const SDKConfig = useSDKConfig();
73616
73619
  const { address: account } = useAccount();
73617
73620
  const { data: userBonds, isFetched: userBondsFetched } = useUserBonds();
73618
73621
  const { data: chainFilterOption, setChainFilterOption } = useChainFilterOption();
@@ -73638,6 +73641,16 @@ const YourBonds = ({ showOnly }) => {
73638
73641
  return [];
73639
73642
  let bondsToReturn = userBonds;
73640
73643
  // Handle Filtering //
73644
+ bondsToReturn = bondsToReturn === null || bondsToReturn === void 0 ? void 0 : bondsToReturn.filter((bond) => {
73645
+ var _a;
73646
+ return ((_a = bond.bond) === null || _a === void 0 ? void 0 : _a.onlyPartner) ? bond.bond.bondPartner === SDKConfig.bondPartner : true;
73647
+ });
73648
+ if (SDKConfig.bondPartner) {
73649
+ bondsToReturn = bondsToReturn === null || bondsToReturn === void 0 ? void 0 : bondsToReturn.filter((bond) => {
73650
+ var _a;
73651
+ return ((_a = bond.bond) === null || _a === void 0 ? void 0 : _a.bondPartner) === SDKConfig.bondPartner;
73652
+ });
73653
+ }
73641
73654
  // Filter Single Token View
73642
73655
  if (showOnly) {
73643
73656
  bondsToReturn = bondsToReturn === null || bondsToReturn === void 0 ? void 0 : bondsToReturn.filter((bond) => {
@@ -73709,11 +73722,11 @@ const YourBonds = ({ showOnly }) => {
73709
73722
  return 0;
73710
73723
  });
73711
73724
  return bondsToReturn;
73712
- }, [userBonds, showOnly, inputValue, chainFilterOption, filterOption, sortConfig]);
73725
+ }, [userBonds, showOnly, inputValue, chainFilterOption, filterOption, sortConfig, SDKConfig.bondPartner]);
73713
73726
  const handleFilterOption = useCallback((newOption) => {
73714
73727
  setFilterOption(newOption);
73715
73728
  }, []);
73716
- return (jsxs(Flex$1, { className: "yourbonds table-container", children: [!showOnly && (jsx$2(YourBondsMenu, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleFilterOption, setInputValue: setInputValue, inputValue: inputValue, handleSort: handleSort })), !account ? (jsx$2(PlaceholderMonkey, { text: 'You are not connected.' })) : (bondsToRender && (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.length) > 0) || (preTGEBondsToRender && preTGEBondsToRender.length > 0) ? (jsxs(Fragment$1, { children: [preTGEBondsToRender === null || preTGEBondsToRender === void 0 ? void 0 : preTGEBondsToRender.map((userBond, index) => jsx$2(PreTgeUserRow, { userBond: userBond }, index)), bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.map((bill, index) => jsx$2(UserBondRow, { bill: bill }, `${bill.id}-${index}`))] })) : inputValue !== '' || !chainFilterOption.includes('All Chains') ? (jsx$2(PlaceholderMonkey, { text: 'No results, change filters.' })) : userBondsFetched && (userBonds === null || userBonds === void 0 ? void 0 : userBonds.length) === 0 ? (jsx$2(PlaceholderMonkey, { text: 'You do not own any Bonds.' })) : (jsx$2(Flex$1, { className: "yourbonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
73729
+ return (jsxs(Flex$1, { className: "yourbonds table-container", children: [!showOnly && (jsx$2(YourBondsMenu, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleFilterOption, setInputValue: setInputValue, inputValue: inputValue, handleSort: handleSort })), !account ? (jsx$2(PlaceholderMonkey, { text: 'You are not connected.' })) : (bondsToRender && (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.length) > 0) || (preTGEBondsToRender && preTGEBondsToRender.length > 0) ? (jsxs(Fragment$1, { children: [preTGEBondsToRender === null || preTGEBondsToRender === void 0 ? void 0 : preTGEBondsToRender.map((userBond, index) => jsx$2(PreTgeUserRow, { userBond: userBond }, index)), bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.map((bill, index) => jsx$2(UserBondRow, { bill: bill }, `${bill.id}-${index}`))] })) : inputValue !== '' || !chainFilterOption.includes('All Chains') ? (jsx$2(PlaceholderMonkey, { text: 'No results, change filters.' })) : userBondsFetched && (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.length) === 0 ? (jsx$2(PlaceholderMonkey, { text: 'You do not own any Bonds.' })) : (jsx$2(Flex$1, { className: "yourbonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
73717
73730
  };
73718
73731
 
73719
73732
  // This basically returns the 2 tags with the higher active bond count
@@ -78737,9 +78750,28 @@ const BonusTable = ({ trueBondPrices, minTier, hideTitle, }) => {
78737
78750
  }), !hideTitle && (jsx$2(Button, { variant: "secondary", sx: { width: '100%', mt: '10px' }, onClick: () => window.open('https://ape.bond/tier-staking', '_blank'), children: "get tier" }))] }));
78738
78751
  };
78739
78752
 
78740
- const BonusComponent = ({ trueBondPrices, minTier, bonus, tooltipPosition, }) => {
78753
+ const useIsMobile = () => {
78754
+ const [isMobile, setIsMobile] = useState(window.innerWidth < 852);
78755
+ // Hardcoded toggle for debounce
78756
+ const useDebounce = false;
78757
+ useEffect(() => {
78758
+ const resizeHandler = () => {
78759
+ {
78760
+ setIsMobile(window.innerWidth < 852);
78761
+ }
78762
+ };
78763
+ window.addEventListener('resize', resizeHandler);
78764
+ return () => {
78765
+ window.removeEventListener('resize', resizeHandler);
78766
+ };
78767
+ }, [useDebounce]);
78768
+ return isMobile;
78769
+ };
78770
+
78771
+ const BonusComponent = ({ trueBondPrices, minTier, bonus, airdropTooltip, tooltipPosition, }) => {
78741
78772
  var _a, _b;
78742
78773
  const SDKConfig = useSDKConfig();
78774
+ const isMobile = useIsMobile();
78743
78775
  const highestPointsElement = trueBondPrices === null || trueBondPrices === void 0 ? void 0 : trueBondPrices.reduce((max, current) => {
78744
78776
  return new BigNumber$1(current.points).isGreaterThan(new BigNumber$1(max.points)) ? current : max;
78745
78777
  }, trueBondPrices[0]);
@@ -78767,25 +78799,7 @@ const BonusComponent = ({ trueBondPrices, minTier, bonus, tooltipPosition, }) =>
78767
78799
  ? 'success'
78768
78800
  : 'error',
78769
78801
  fontSize: ['14px', '14px', '16px', '16px'],
78770
- }, children: [(_a = highestPointsElement === null || highestPointsElement === void 0 ? void 0 : highestPointsElement.bonusWithFee) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%"] })] })] }) })) : (jsx$2(Flex, { sx: { height: '20px', width: '20px' }, children: jsx$2(TooltipBubble, { body: 'This bond is currently on cooldown and has no bonus. Please check back soon.', width: "205px", placement: "bottomRight", transformTip: "translate(10%, 0%)", children: jsx$2(Svg, { icon: "Timer", width: "20px", color: "#81CFEA" }) }) })) })) : baseTrueBondPrice ? (jsx$2(Flex, { sx: { alignItems: 'center' }, className: `${getDiscountColor(+(baseTrueBondPrice === null || baseTrueBondPrice === void 0 ? void 0 : baseTrueBondPrice.bonusWithFee))}`, children: (baseTrueBondPrice === null || baseTrueBondPrice === void 0 ? void 0 : baseTrueBondPrice.bonusWithFee) > 0 ? (`${(_b = baseTrueBondPrice === null || baseTrueBondPrice === void 0 ? void 0 : baseTrueBondPrice.bonusWithFee) === null || _b === void 0 ? void 0 : _b.toFixed(2)}%`) : (jsx$2(Flex, { sx: { height: '20px', width: '20px' }, children: jsx$2(TooltipBubble, { body: 'This bond is currently on cooldown and has no bonus. Please check back soon.', width: "205px", placement: "bottomRight", transformTip: "translate(10%, 0%)", children: jsx$2(Svg, { icon: "Timer", width: "20px", color: "#81CFEA" }) }) })) })) : (jsx$2(Flex, { className: bonus && 'discount-positive', children: bonus || '-' })) }));
78771
- };
78772
-
78773
- const useIsMobile = () => {
78774
- const [isMobile, setIsMobile] = useState(window.innerWidth < 852);
78775
- // Hardcoded toggle for debounce
78776
- const useDebounce = false;
78777
- useEffect(() => {
78778
- const resizeHandler = () => {
78779
- {
78780
- setIsMobile(window.innerWidth < 852);
78781
- }
78782
- };
78783
- window.addEventListener('resize', resizeHandler);
78784
- return () => {
78785
- window.removeEventListener('resize', resizeHandler);
78786
- };
78787
- }, [useDebounce]);
78788
- return isMobile;
78802
+ }, children: [(_a = highestPointsElement === null || highestPointsElement === void 0 ? void 0 : highestPointsElement.bonusWithFee) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%"] })] })] }) })) : (jsx$2(Flex, { sx: { height: '20px', width: '20px' }, children: jsx$2(TooltipBubble, { body: 'This bond is currently on cooldown and has no bonus. Please check back soon.', width: "205px", placement: "bottomRight", transformTip: "translate(10%, 0%)", children: jsx$2(Svg, { icon: "Timer", width: "20px", color: "#81CFEA" }) }) })) })) : baseTrueBondPrice ? (jsx$2(Flex, { sx: { alignItems: 'center' }, className: `${getDiscountColor(+(baseTrueBondPrice === null || baseTrueBondPrice === void 0 ? void 0 : baseTrueBondPrice.bonusWithFee))}`, children: (baseTrueBondPrice === null || baseTrueBondPrice === void 0 ? void 0 : baseTrueBondPrice.bonusWithFee) > 0 ? (`${(_b = baseTrueBondPrice === null || baseTrueBondPrice === void 0 ? void 0 : baseTrueBondPrice.bonusWithFee) === null || _b === void 0 ? void 0 : _b.toFixed(2)}%`) : (jsx$2(Flex, { sx: { height: '20px', width: '20px' }, children: jsx$2(TooltipBubble, { body: 'This bond is currently on cooldown and has no bonus. Please check back soon.', width: "205px", placement: "bottomRight", transformTip: "translate(10%, 0%)", children: jsx$2(Svg, { icon: "Timer", width: "20px", color: "#81CFEA" }) }) })) })) : (jsxs(Flex, { sx: { color: bonus && 'success', alignItems: 'center' }, children: [bonus || '-', airdropTooltip && (jsx$2(TooltipBubble, { body: jsx$2(Fragment$1, { children: airdropTooltip }), width: "230px", placement: isMobile ? 'bottomRight' : 'bottomLeft', transformTip: isMobile ? 'translate(9%, 6%)' : 'translate(-3%, 6%)', children: jsx$2(Flex, { sx: { width: '20px', height: '20px', alignItems: 'center', ml: '5px' }, children: jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1750345773/airdrop_qvh4ow.png", alt: "airdrop-img", style: { width: '20px', height: '20px' } }) }) }))] })) }));
78789
78803
  };
78790
78804
 
78791
78805
  const ProgressBar = ({ value }) => {
@@ -79654,9 +79668,12 @@ const styles$8 = {
79654
79668
  });
79655
79669
 
79656
79670
  const BondCards = ({ bond }) => {
79657
- var _a, _b, _c, _d, _e;
79658
- const bonus = (_a = bond === null || bond === void 0 ? void 0 : bond.trueBondPrices) === null || _a === void 0 ? void 0 : _a[0].bonus;
79659
- const initialRelease = ((_b = bond === null || bond === void 0 ? void 0 : bond.initialRelease) !== null && _b !== void 0 ? _b : 0) * 100;
79671
+ var _a, _b, _c, _d, _e, _f, _g;
79672
+ const isMobile = useIsMobile();
79673
+ const bonus = (_b = (_a = bond === null || bond === void 0 ? void 0 : bond.trueBondPrices) === null || _a === void 0 ? void 0 : _a[0].bonus) !== null && _b !== void 0 ? _b : 0;
79674
+ const airdropBonus = (_c = bond.airdropBonus) !== null && _c !== void 0 ? _c : 0;
79675
+ const bonusToUse = bonus + airdropBonus;
79676
+ const initialRelease = ((_d = bond === null || bond === void 0 ? void 0 : bond.initialRelease) !== null && _d !== void 0 ? _d : 0) * 100;
79660
79677
  return (jsxs("div", { className: "bonds-cards", children: [jsxs("div", { className: "bond-card-block", sx: {
79661
79678
  borderRadius: ['0px', '0px', '0px', 'normal'],
79662
79679
  '&:first-of-type': {
@@ -79667,7 +79684,7 @@ const BondCards = ({ bond }) => {
79667
79684
  borderBottomRightRadius: 'normal',
79668
79685
  borderBottomLeftRadius: 'normal',
79669
79686
  },
79670
- }, children: [jsxs(Flex, { className: "bond-card-title", sx: { alignItems: 'center' }, children: ["Bonus", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: "This is the percentage of additional tokens you\u2019ll get compared to buying at market price." }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsxs(Flex, { sx: { color: 'success' }, children: [bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(0), "%"] })] }), jsxs("div", { className: "bond-card-block", sx: {
79687
+ }, children: [jsxs(Flex, { className: "bond-card-title", sx: { alignItems: 'center' }, children: ["Bonus", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: "This is the percentage of additional tokens you\u2019ll get compared to buying at market price." }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsxs(Flex, { sx: { color: 'success', alignItems: 'center' }, children: [bonusToUse === null || bonusToUse === void 0 ? void 0 : bonusToUse.toFixed(0), "%", bond.airdropTooltip && (jsx$2(TooltipBubble, { body: jsx$2(Fragment$1, { children: bond.airdropTooltip }), width: "230px", placement: isMobile ? 'bottomRight' : 'bottomLeft', transformTip: isMobile ? 'translate(9%, 6%)' : 'translate(-3%, 6%)', children: jsx$2(Flex, { sx: { width: '20px', height: '20px', alignItems: 'center', ml: '5px' }, children: jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1750345773/airdrop_qvh4ow.png", alt: "airdrop-img", style: { width: '20px', height: '20px' } }) }) }))] })] }), jsxs("div", { className: "bond-card-block", sx: {
79671
79688
  fontSize: '13px !important',
79672
79689
  borderRadius: ['0px', '0px', '0px', 'normal'],
79673
79690
  '&:first-of-type': {
@@ -79698,7 +79715,7 @@ const BondCards = ({ bond }) => {
79698
79715
  borderBottomRightRadius: 'normal',
79699
79716
  borderBottomLeftRadius: 'normal',
79700
79717
  },
79701
- }, children: [jsxs("div", { className: "bond-card-title", children: ["Vesting Terms", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["Remaining tokens will vest linearly over ", getTimePeriods((_c = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _c !== void 0 ? _c : 0).months, " months after claiming the initial release."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), (_e = getTimePeriods((_d = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _d !== void 0 ? _d : 0)) === null || _e === void 0 ? void 0 : _e.months, " Mo"] })] }));
79718
+ }, children: [jsxs("div", { className: "bond-card-title", children: ["Vesting Terms", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["Remaining tokens will vest linearly over ", getTimePeriods((_e = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _e !== void 0 ? _e : 0).months, " months after claiming the initial release."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), (_g = getTimePeriods((_f = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _f !== void 0 ? _f : 0)) === null || _g === void 0 ? void 0 : _g.months, " Mo"] })] }));
79702
79719
  };
79703
79720
 
79704
79721
  const PreTGEBuyComponent = ({ bondAddress, bondChain, onDismiss, handlePurchasedBond, }) => {
@@ -79944,12 +79961,12 @@ const ChainTitle = ({ chain, pt, hideTitles, isOpen, }) => {
79944
79961
  }, 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" }) })] }))] }));
79945
79962
  };
79946
79963
 
79947
- const BonusContainer = ({ trueBondPrices, minTier, bonus, tooltipPosition = 'bottomRight', }) => {
79964
+ const BonusContainer = ({ trueBondPrices, minTier, bonus, airdropTooltip, tooltipPosition = 'bottomRight', }) => {
79948
79965
  const isMobile = useIsMobile();
79949
- return (jsx$2("div", { className: `discount-column`, children: jsx$2(BonusComponent, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, tooltipPosition: isMobile ? tooltipPosition : 'bottomLeft' }) }));
79966
+ return (jsx$2("div", { className: `discount-column`, children: jsx$2(BonusComponent, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip, tooltipPosition: isMobile ? tooltipPosition : 'bottomLeft' }) }));
79950
79967
  };
79951
79968
 
79952
- const BondRow = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, }) => {
79969
+ const BondRow = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, }) => {
79953
79970
  var _a, _b, _c;
79954
79971
  const locationPath = window.location.pathname.replace('/', '');
79955
79972
  // Modal
@@ -79978,7 +79995,7 @@ const BondRow = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSoldO
79978
79995
  });
79979
79996
  };
79980
79997
  return (jsxs("div", { className: "bond-row" // Insert special campaign styles here
79981
- , onClick: handleOpenModal, sx: { borderRadius: 'normal' }, children: [jsx$2("div", { className: "gold-ribbon" }), jsx$2("div", { className: "token-info-container", sx: { width: ['70%', '70%', '65%', '30%'] }, children: jsx$2(TokenInfoAndName, { tokenSymbol: payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol, chain: bondChain, tag: tag }) }), jsxs("div", { className: "bond-info-columns", sx: { width: '55%' }, children: [jsx$2(BonusContainer, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus }), 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: {
79998
+ , onClick: handleOpenModal, sx: { borderRadius: 'normal' }, children: [jsx$2("div", { className: "gold-ribbon" }), jsx$2("div", { className: "token-info-container", sx: { width: ['70%', '70%', '65%', '30%'] }, children: jsx$2(TokenInfoAndName, { tokenSymbol: payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol, chain: bondChain, tag: tag }) }), jsxs("div", { className: "bond-info-columns", sx: { width: '55%' }, children: [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: {
79982
79999
  width: '127px',
79983
80000
  height: '25px',
79984
80001
  flexDirection: 'column',
@@ -80135,7 +80152,7 @@ const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
80135
80152
  width: '100%',
80136
80153
  marginTop: '0px',
80137
80154
  }, className: "bonds-card-container", children: [TESTNET_CHAINS.includes(chain) && jsx$2(BannerTestnet, { chainId: chain }), bonds === null || bonds === void 0 ? void 0 : bonds.map((bondFromMap, index) => {
80138
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
80155
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
80139
80156
  if (bondFromMap.soldOut) {
80140
80157
  const bond = bondFromMap;
80141
80158
  return (jsx$2(BondRow, { bondAddress: (_a = bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId], bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_b = bond.tags) === null || _b === void 0 ? void 0 : _b[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 }, `${bond.contractAddress}-${bond.chainId}-${index}`));
@@ -80148,13 +80165,16 @@ const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
80148
80165
  const tokensRemainingUSD = tokensRemaining * ((_l = bond === null || bond === void 0 ? void 0 : bond.initPrice) !== null && _l !== void 0 ? _l : 0);
80149
80166
  const percentageAvailable = 100 - Math.floor((totalPrincipalBilled * 100) / raiseGoal);
80150
80167
  const earnToken = (_m = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _m === void 0 ? void 0 : _m.symbol;
80151
- return (jsx$2(BondRow, { bondAddress: (_o = bond.contractAddress) === null || _o === void 0 ? void 0 : _o[bond.chainId], bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_p = bond.tags) === null || _p === void 0 ? void 0 : _p[0], bonus: `${(_r = (_q = bond === null || bond === void 0 ? void 0 : bond.trueBondPrices) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.bonus}%`, percentageAvailable: percentageAvailable, remainingTokensString: `${formatNumberSI(tokensRemaining, 0)} ${earnToken} ($${formatNumberSI(tokensRemainingUSD, 2)})`, vestingTermString: `${getTimePeriods((_s = bond.vestingTerm) !== null && _s !== void 0 ? _s : 0).months} Mo`, projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit }, `${bond.contractAddress}-${bond.chainId}-${index}`));
80168
+ const baseBonus = (_q = (_p = (_o = bond === null || bond === void 0 ? void 0 : bond.trueBondPrices) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.bonus) !== null && _q !== void 0 ? _q : 0;
80169
+ const airdropBonus = (_r = bond === null || bond === void 0 ? void 0 : bond.airdropBonus) !== null && _r !== void 0 ? _r : 0;
80170
+ const bonus = baseBonus + airdropBonus;
80171
+ return (jsx$2(BondRow, { bondAddress: (_s = bond.contractAddress) === null || _s === void 0 ? void 0 : _s[bond.chainId], bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_t = bond.tags) === null || _t === void 0 ? void 0 : _t[0], bonus: `${bonus}%`, airdropTooltip: bond.airdropTooltip, percentageAvailable: percentageAvailable, remainingTokensString: `${formatNumberSI(tokensRemaining, 0)} ${earnToken} ($${formatNumberSI(tokensRemainingUSD, 2)})`, vestingTermString: `${getTimePeriods((_u = bond.vestingTerm) !== null && _u !== void 0 ? _u : 0).months} Mo`, projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit }, `${bond.contractAddress}-${bond.chainId}-${index}`));
80152
80172
  }
80153
80173
  else {
80154
80174
  const bond = bondFromMap;
80155
- const bondAddress = (_t = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _t === void 0 ? void 0 : _t[bond === null || bond === void 0 ? void 0 : bond.chainId];
80175
+ const bondAddress = (_v = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _v === void 0 ? void 0 : _v[bond === null || bond === void 0 ? void 0 : bond.chainId];
80156
80176
  const remainingTokensString = getRemainingTokensString(bond);
80157
- return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_u = bond.tags) === null || _u === void 0 ? void 0 : _u[0], trueBondPrices: bond.trueBondPrices, 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, auditURL: bond.audit }, `${bondAddress}-${bond.chainId}-${index}`));
80177
+ return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_w = bond.tags) === null || _w === void 0 ? void 0 : _w[0], trueBondPrices: bond.trueBondPrices, 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, auditURL: bond.audit }, `${bondAddress}-${bond.chainId}-${index}`));
80158
80178
  }
80159
80179
  }), showHotBonds && (jsx$2(SwiperProvider, { children: jsx$2(HotBondCards, {}) }))] }, key))] }) }, key));
80160
80180
  };
@@ -80413,7 +80433,10 @@ const Bonds = () => {
80413
80433
  const filterOptions = ['ALL', 'FAVORITES', ...topTags, 'SOLD OUT'];
80414
80434
  const billsToRender = useMemo(() => {
80415
80435
  let billsToReturn = filterOption === 'SOLD OUT' ? [...(allPreBonds !== null && allPreBonds !== void 0 ? allPreBonds : []), ...(allBonds !== null && allBonds !== void 0 ? allBonds : [])] : (sortedBonds !== null && sortedBonds !== void 0 ? sortedBonds : []);
80416
- billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => isBondSupported(SDKConfig.highestCompatibleVersion, bill.version));
80436
+ billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
80437
+ return (isBondSupported(SDKConfig.highestCompatibleVersion, bill.version) &&
80438
+ (bill.onlyPartner ? SDKConfig.bondPartner === bill.bondPartner : true));
80439
+ });
80417
80440
  if (searchQuery) {
80418
80441
  billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
80419
80442
  var _a, _b;
@@ -80425,6 +80448,9 @@ const Bonds = () => {
80425
80448
  return 'minTier' in bill ? bill.minTier === null || bill.minTier === undefined : true; //TODO: check this
80426
80449
  });
80427
80450
  }
80451
+ if (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.bondPartner) {
80452
+ billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => bill.bondPartner === SDKConfig.bondPartner);
80453
+ }
80428
80454
  if (topTags.includes(filterOption)) {
80429
80455
  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); });
80430
80456
  }
@@ -80463,7 +80489,7 @@ const Bonds = () => {
80463
80489
  const handleChangeFilterOption = useCallback((newOption) => {
80464
80490
  setFilterOption(newOption);
80465
80491
  }, []);
80466
- return (jsxs(Flex$1, { 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 && jsx$2(BuyAgainRow, {}), (billsToRender === null || billsToRender === void 0 ? void 0 : billsToRender.length) > 0 ? (jsx$2(BondRowsByChain, { bonds: billsToRender, hideTitles: searchQuery !== '' })) : searchQuery ? (jsx$2(PlaceholderMonkey, { text: 'No results' })) : filterOption === 'FAVORITES' ? (jsxs(Flex$1, { sx: {
80492
+ return (jsxs(Flex$1, { 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 !== '' })) : searchQuery ? (jsx$2(PlaceholderMonkey, { text: 'No results' })) : filterOption === 'FAVORITES' ? (jsxs(Flex$1, { sx: {
80467
80493
  width: '100%',
80468
80494
  height: '300px',
80469
80495
  background: 'white2',
@@ -1,29 +1,29 @@
1
- export interface SDKProps {
1
+ export interface SDKPropsDTO {
2
2
  referenceId: string;
3
3
  chains: number[];
4
- useRainbowKit: boolean;
4
+ useRainbowKit?: boolean;
5
5
  useHotBonds?: boolean;
6
6
  useTiers?: boolean;
7
7
  useTGEBonds?: boolean;
8
8
  showLowValueBonds?: boolean;
9
+ bondPartner?: string;
9
10
  urls?: Partial<Record<URLKeys, string>>;
10
11
  theme?: any;
12
+ highestCompatibleVersion?: string;
11
13
  }
12
- export declare const useSDKConfig: (config?: SDKProps) => {
13
- urls: {
14
- apiV2: string;
15
- realTimeApi: string;
16
- mainUrl: string;
17
- };
18
- highestCompatibleVersion: string;
19
- referenceId?: string | undefined;
20
- chains?: number[] | undefined;
14
+ export interface SDKProps {
15
+ referenceId: string;
16
+ chains: number[];
21
17
  useRainbowKit: boolean;
22
18
  useHotBonds: boolean;
23
19
  useTiers: boolean;
24
20
  useTGEBonds: boolean;
25
21
  showLowValueBonds: boolean;
26
- theme?: any;
27
- };
22
+ bondPartner?: string;
23
+ urls: Record<URLKeys, string>;
24
+ theme: any;
25
+ highestCompatibleVersion?: string;
26
+ }
27
+ export declare const useSDKConfig: (config?: SDKPropsDTO) => SDKProps;
28
28
  export type URLKeys = 'apiV2' | 'realTimeApi' | 'mainUrl';
29
29
  export declare const useURLByEnvironment: (key: URLKeys) => string;
@@ -11,6 +11,7 @@ interface BondRowProps {
11
11
  trueBondPrices?: TrueBondPrices[];
12
12
  minTier?: LaunchBondTiers;
13
13
  bonus?: string;
14
+ airdropTooltip?: string;
14
15
  vestingTermString: string;
15
16
  vestingCliffString?: string;
16
17
  percentageAvailable: number;
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import { TrueBondPrices } from '../../../../types/bonds';
3
3
  import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
4
- declare const BonusComponent: ({ trueBondPrices, minTier, bonus, tooltipPosition, }: {
4
+ declare const BonusComponent: ({ trueBondPrices, minTier, bonus, airdropTooltip, tooltipPosition, }: {
5
5
  trueBondPrices?: TrueBondPrices[];
6
6
  minTier?: LaunchBondTiers;
7
7
  bonus?: string;
8
+ airdropTooltip?: string;
8
9
  tooltipPosition: "bottomRight" | "bottomLeft";
9
10
  }) => React.JSX.Element;
10
11
  export default BonusComponent;
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
3
3
  import { TrueBondPrices } from '../../../../types/bonds';
4
- declare const BonusContainer: ({ trueBondPrices, minTier, bonus, tooltipPosition, }: {
4
+ declare const BonusContainer: ({ trueBondPrices, minTier, bonus, airdropTooltip, tooltipPosition, }: {
5
5
  trueBondPrices?: TrueBondPrices[];
6
6
  minTier?: LaunchBondTiers;
7
7
  bonus?: string;
8
+ airdropTooltip?: string;
8
9
  tooltipPosition?: "bottomRight" | "bottomLeft";
9
10
  }) => React.JSX.Element;
10
11
  export default BonusContainer;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { SDKProps } from '../../state/useSDKConfig';
3
- declare const BondsWithProviders: React.FC<SDKProps>;
2
+ import { SDKPropsDTO } from '../../state/useSDKConfig';
3
+ declare const BondsWithProviders: React.FC<SDKPropsDTO>;
4
4
  export default BondsWithProviders;
@@ -1,7 +1,7 @@
1
1
  import { BondsData } from '../../types/bonds';
2
2
  import { SortOptions } from './Bonds';
3
3
  import { BillsConfig } from '@ape.swap/apeswap-lists';
4
- export declare const isBondSoldOut: (bill: BondsData, showLowValueBonds: boolean) => boolean;
4
+ export declare const isBondSoldOut: (bill: BondsData, showLowValueBonds?: boolean) => boolean;
5
5
  export declare const sortBonds: (sortConfig?: SortOptions, bonds?: BondsData[]) => BondsData[];
6
6
  export declare const vestingTime: (vestingTerm?: number) => {
7
7
  years: number;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { SDKProps } from '../../state/useSDKConfig';
3
- declare const FullBondsViewWithProviders: React.FC<SDKProps>;
2
+ import { SDKPropsDTO } from '../../state/useSDKConfig';
3
+ declare const FullBondsViewWithProviders: React.FC<SDKPropsDTO>;
4
4
  export default FullBondsViewWithProviders;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { SDKProps } from '../../state/useSDKConfig';
2
+ import { SDKPropsDTO } from '../../state/useSDKConfig';
3
3
  import { ProjectViewProps } from './ProjectView';
4
- interface Props extends SDKProps, ProjectViewProps {
4
+ interface Props extends SDKPropsDTO, ProjectViewProps {
5
5
  }
6
6
  declare const ProjectViewWithProviders: React.FC<Props>;
7
7
  export default ProjectViewWithProviders;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { SDKProps } from '../../state/useSDKConfig';
2
+ import { SDKPropsDTO } from '../../state/useSDKConfig';
3
3
  import { SingleBondProps } from './SingleBond';
4
- interface Props extends SDKProps, SingleBondProps {
4
+ interface Props extends SDKPropsDTO, SingleBondProps {
5
5
  }
6
6
  declare const SingleBondWithProviders: React.FC<Props>;
7
7
  export default SingleBondWithProviders;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { SDKProps } from '../../state/useSDKConfig';
3
- declare const YourBondsWithProviders: React.FC<SDKProps>;
2
+ import { SDKPropsDTO } from '../../state/useSDKConfig';
3
+ declare const YourBondsWithProviders: React.FC<SDKPropsDTO>;
4
4
  export default YourBondsWithProviders;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "3.0.89",
6
+ "version": "3.0.91",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",
@@ -68,7 +68,7 @@
68
68
  "yalc": "^1.0.0-pre.53"
69
69
  },
70
70
  "dependencies": {
71
- "@ape.swap/apeswap-lists": "4.3.25",
71
+ "@ape.swap/apeswap-lists": "4.3.27",
72
72
  "@emotion/react": "11.11.4",
73
73
  "bignumber.js": "^9.1.2",
74
74
  "chart.js": "4.2.0",
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { BondsData } from '../../../../types/bonds';
3
- declare const PreTGEBonusTable: ({ bond }: {
4
- bond: BondsData;
5
- }) => React.JSX.Element;
6
- export default PreTGEBonusTable;