@ape.swap/bonds-sdk 2.1.1 → 2.2.1-test.1

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
@@ -41434,8 +41434,8 @@ const useModal = (modal, closeOnOverlayClick = true, updateOnPropsChange = false
41434
41434
  };
41435
41435
 
41436
41436
  const TooltipText = {
41437
- Discount: "This is the percentage discount relative to the token's current market price.",
41438
- ARR: 'This is the Annualized Rate of Return you would receive considering the current discount, adjusted for APR.',
41437
+ Discount: 'This is the percentage of additional tokens you’ll get based on the current bond’s discount.',
41438
+ ARR: 'This is the Annualized Rate of Return you would receive considering the current bonus, adjusted for APR.',
41439
41439
  Terms: 'This is the amount of days it will take for all tokens in the Bond to fully vest.',
41440
41440
  TokensRemaining: 'This is the amount of remaining tokens for sale in this Bond.',
41441
41441
  MaxBuy: (payoutToken) => `This is the maximum amount of ${payoutToken} you can currently purchase through this Bond.`,
@@ -43029,7 +43029,7 @@ const CardRecommendation = ({ cardIndex, bond, handleBuyBondClick, }) => {
43029
43029
  alignItems: 'center',
43030
43030
  padding: '0px 7px',
43031
43031
  borderRadius: '5px 5px 0px 0px',
43032
- }, children: [jsx$2("div", { className: "yourbondinfo-block header", children: "Discount" }), jsxs(Text, { sx: { color: 'success' }, children: [bond.discount.toFixed(2), "%"] })] }), jsxs(Flex, { sx: {
43032
+ }, children: [jsx$2("div", { className: "yourbondinfo-block header", children: "Bonus" }), jsxs(Text, { sx: { color: 'success' }, children: [bond.bonus.toFixed(2), "%"] })] }), jsxs(Flex, { sx: {
43033
43033
  background: 'white4',
43034
43034
  justifyContent: 'space-between',
43035
43035
  alignItems: 'center',
@@ -71548,7 +71548,7 @@ const useTopTags = (initialBondList) => {
71548
71548
 
71549
71549
  const isBondSoldOut = (bill) => {
71550
71550
  var _a;
71551
- const { tokensRemaining, discount, payoutTokenPrice } = bill;
71551
+ const { tokensRemaining, discount, payoutTokenPrice, bonus } = bill;
71552
71552
  if (bill.soldOut)
71553
71553
  return true;
71554
71554
  if (bill.inactive)
@@ -71556,12 +71556,12 @@ const isBondSoldOut = (bill) => {
71556
71556
  if (!tokensRemaining)
71557
71557
  return false;
71558
71558
  const thresholdToHide = new BigNumber$1(100).div(payoutTokenPrice !== null && payoutTokenPrice !== void 0 ? payoutTokenPrice : 0);
71559
- if (discount && discount > 50) {
71559
+ if (bonus && bonus > 50) {
71560
71560
  // If discount is over 50% it will be hidden
71561
71561
  // console.log('Soldout contract:', billAddress)
71562
71562
  return true;
71563
71563
  }
71564
- if (((_a = new BigNumber$1(tokensRemaining)) === null || _a === void 0 ? void 0 : _a.lte(thresholdToHide)) || discount === 100) {
71564
+ if (((_a = new BigNumber$1(tokensRemaining)) === null || _a === void 0 ? void 0 : _a.lte(thresholdToHide)) || bonus === 100) {
71565
71565
  // If there's less than 100 usd bond will be hidden
71566
71566
  // console.log('Soldout contract: ', billAddress)
71567
71567
  return true;
@@ -71712,13 +71712,15 @@ const cleanBillsData = (billIds, chunkedBills, tokenPrices, chainId, bills) => {
71712
71712
  const [, vestingTerm, , maxPayout] = terms;
71713
71713
  const priceUsd = lpPrice && trueBillPrice && getBalanceNumber(trueBillPrice === null || trueBillPrice === void 0 ? void 0 : trueBillPrice.toString()) * lpPrice;
71714
71714
  const discount = earnTokenPrice && priceUsd && ((earnTokenPrice - priceUsd) / earnTokenPrice) * 100;
71715
+ const bonus = discount && (discount > 0 ? (discount / (100 - discount)) * 100 : 0);
71715
71716
  const tokensRemaining = new BigNumber$1(maxTotalPayout !== null && maxTotalPayout !== void 0 ? maxTotalPayout : '0')
71716
71717
  .minus(new BigNumber$1(totalPayoutGiven))
71717
71718
  .div(new BigNumber$1(10).pow((_c = bill === null || bill === void 0 ? void 0 : bill.earnToken.decimals[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _c !== void 0 ? _c : 18))
71718
71719
  .toString();
71719
71720
  //I've added a ts ignore here due to some props marked as optional in the list repo which are actually not optional
71720
71721
  //@ts-ignore
71721
- const cleanedData = Object.assign(Object.assign({}, bill), { type: (_d = bill === null || bill === void 0 ? void 0 : bill.billType) !== null && _d !== void 0 ? _d : '', billAddress: (_e = bill === null || bill === void 0 ? void 0 : bill.contractAddress[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _e !== void 0 ? _e : '', billNftAddress: (_f = bill === null || bill === void 0 ? void 0 : bill.billNnftAddress[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _f !== void 0 ? _f : '', showcaseTokenName: (_j = (_h = (_g = bill === null || bill === void 0 ? void 0 : bill.showcaseToken) === null || _g === void 0 ? void 0 : _g.symbol) !== null && _h !== void 0 ? _h : bill === null || bill === void 0 ? void 0 : bill.earnToken.symbol) !== null && _j !== void 0 ? _j : '', discount: discount, principalTokenPrice: (_k = lpPrice === null || lpPrice === void 0 ? void 0 : lpPrice.toString()) !== null && _k !== void 0 ? _k : '0', payoutTokenPrice: (_l = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.toString()) !== null && _l !== void 0 ? _l : '0', tokensRemaining, maxTotalPayout: maxTotalPayout === null || maxTotalPayout === void 0 ? void 0 : maxTotalPayout.toString(), trueBillPrice: trueBillPrice === null || trueBillPrice === void 0 ? void 0 : trueBillPrice.toString(), maxPayout: maxPayout === null || maxPayout === void 0 ? void 0 : maxPayout.toString(), totalPayoutGiven: totalPayoutGiven === null || totalPayoutGiven === void 0 ? void 0 : totalPayoutGiven.toString(), vestingTerm: vestingTerm.toNumber() });
71722
+ const cleanedData = Object.assign(Object.assign({}, bill), { type: (_d = bill === null || bill === void 0 ? void 0 : bill.billType) !== null && _d !== void 0 ? _d : '', billAddress: (_e = bill === null || bill === void 0 ? void 0 : bill.contractAddress[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _e !== void 0 ? _e : '', billNftAddress: (_f = bill === null || bill === void 0 ? void 0 : bill.billNnftAddress[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _f !== void 0 ? _f : '', showcaseTokenName: (_j = (_h = (_g = bill === null || bill === void 0 ? void 0 : bill.showcaseToken) === null || _g === void 0 ? void 0 : _g.symbol) !== null && _h !== void 0 ? _h : bill === null || bill === void 0 ? void 0 : bill.earnToken.symbol) !== null && _j !== void 0 ? _j : '', discount,
71723
+ bonus, principalTokenPrice: (_k = lpPrice === null || lpPrice === void 0 ? void 0 : lpPrice.toString()) !== null && _k !== void 0 ? _k : '0', payoutTokenPrice: (_l = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.toString()) !== null && _l !== void 0 ? _l : '0', tokensRemaining, maxTotalPayout: maxTotalPayout === null || maxTotalPayout === void 0 ? void 0 : maxTotalPayout.toString(), trueBillPrice: trueBillPrice === null || trueBillPrice === void 0 ? void 0 : trueBillPrice.toString(), maxPayout: maxPayout === null || maxPayout === void 0 ? void 0 : maxPayout.toString(), totalPayoutGiven: totalPayoutGiven === null || totalPayoutGiven === void 0 ? void 0 : totalPayoutGiven.toString(), vestingTerm: vestingTerm.toNumber() });
71722
71724
  return cleanedData;
71723
71725
  });
71724
71726
  return data;
@@ -73775,7 +73777,7 @@ const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
73775
73777
 
73776
73778
  const BondCards = ({ bondData }) => {
73777
73779
  var _a, _b, _c, _d, _e, _f, _g, _h;
73778
- return (jsxs("div", { className: "bonds-cards", children: [jsxs("div", { className: "bond-card-block", style: { color: getDiscountColor(bondData === null || bondData === void 0 ? void 0 : bondData.discount) }, children: [jsxs("div", { className: "bond-card-title", children: ["Discount", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: `${(_a = bondData === null || bondData === void 0 ? void 0 : bondData.discount) === null || _a === void 0 ? void 0 : _a.toFixed(2)}%` })] }), jsxs("div", { className: "bond-card-block hide-mobile", children: [jsxs("div", { className: "bond-card-title", children: ["ARR", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: `${((((_b = bondData === null || bondData === void 0 ? void 0 : bondData.discount) !== null && _b !== void 0 ? _b : 0) * 365) / vestingTime((_c = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _c !== void 0 ? _c : 0).days).toFixed(2)}%` })] }), jsxs("div", { className: "bond-card-block", children: [jsxs("div", { className: "bond-card-title", children: ["Terms", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: vestingTime((_d = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _d !== void 0 ? _d : 0).days ? `${vestingTime((_e = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _e !== void 0 ? _e : 0).days} D` : '-' })] }), jsxs("div", { className: "bond-card-block", children: [jsxs("div", { className: "bond-card-title", children: ["Max Buy", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.MaxBuy((_f = bondData === null || bondData === void 0 ? void 0 : bondData.earnToken) === null || _f === void 0 ? void 0 : _f.symbol) }), 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("div", { className: "bond-card-content", children: [jsx$2("div", { style: { paddingRight: '3px' }, children: jsx$2(TokenImage, { symbol: (_g = bondData.showcaseTokenName) !== null && _g !== void 0 ? _g : bondData.earnToken.symbol, size: 20 }) }), (_h = parseFloat(maxBuy(bondData).toFixed(0))) === null || _h === void 0 ? void 0 : _h.toLocaleString('en-US')] })] })] }));
73780
+ return (jsxs("div", { className: "bonds-cards", children: [jsxs("div", { className: "bond-card-block", style: { color: getDiscountColor(bondData === null || bondData === void 0 ? void 0 : bondData.discount) }, children: [jsxs("div", { className: "bond-card-title", children: ["Bonus", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: `${(_a = bondData === null || bondData === void 0 ? void 0 : bondData.bonus) === null || _a === void 0 ? void 0 : _a.toFixed(2)}%` })] }), jsxs("div", { className: "bond-card-block hide-mobile", children: [jsxs("div", { className: "bond-card-title", children: ["ARR", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: `${((((_b = bondData === null || bondData === void 0 ? void 0 : bondData.discount) !== null && _b !== void 0 ? _b : 0) * 365) / vestingTime((_c = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _c !== void 0 ? _c : 0).days).toFixed(2)}%` })] }), jsxs("div", { className: "bond-card-block", children: [jsxs("div", { className: "bond-card-title", children: ["Terms", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: vestingTime((_d = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _d !== void 0 ? _d : 0).days ? `${vestingTime((_e = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _e !== void 0 ? _e : 0).days} D` : '-' })] }), jsxs("div", { className: "bond-card-block", children: [jsxs("div", { className: "bond-card-title", children: ["Max Buy", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.MaxBuy((_f = bondData === null || bondData === void 0 ? void 0 : bondData.earnToken) === null || _f === void 0 ? void 0 : _f.symbol) }), 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("div", { className: "bond-card-content", children: [jsx$2("div", { style: { paddingRight: '3px' }, children: jsx$2(TokenImage, { symbol: (_g = bondData.showcaseTokenName) !== null && _g !== void 0 ? _g : bondData.earnToken.symbol, size: 20 }) }), (_h = parseFloat(maxBuy(bondData).toFixed(0))) === null || _h === void 0 ? void 0 : _h.toLocaleString('en-US')] })] })] }));
73779
73781
  };
73780
73782
 
73781
73783
  const Estimations = ({ bondData, inputValue, inputToken, estimatedOutput, inputTokenPrice, isZap, fetchingZapQuote, zapError, }) => {
@@ -74320,7 +74322,7 @@ const BondRow = ({ bond }) => {
74320
74322
  : 'contractAddress' in bond
74321
74323
  ? bond.contractAddress[bond.chainId]
74322
74324
  : undefined;
74323
- const discount = 'discount' in bond ? bond.discount : undefined;
74325
+ const bonus = 'bonus' in bond ? bond.bonus : undefined;
74324
74326
  // Modal
74325
74327
  const [openBuyModal] = useModal(jsx$2(ModalHandler, { bondAddress: billAddress, bondChain: bond.chainId }), true, true, `buyBondModal-${billAddress}-${bond.chainId}`);
74326
74328
  const handleOpenModal = () => {
@@ -74358,7 +74360,7 @@ const BondRow = ({ bond }) => {
74358
74360
  const tokens = new BigNumber$1(tokensRemaining);
74359
74361
  return tokens.times(payoutTokenPrice);
74360
74362
  };
74361
- return (jsxs("div", { className: "bond-row", onClick: handleOpenModal, children: [jsx$2("div", { className: "token-info-container bond-market", children: jsx$2(TokenInfoAndName, { bill: bond }) }), jsxs("div", { className: "bond-info-columns", children: [jsx$2("div", { className: `discount-column ${getDiscountColor(discount)}`, children: discount !== undefined ? `${discount === null || discount === void 0 ? void 0 : discount.toFixed(2)}%` : '-' }), jsx$2("div", { className: "arr-column", children: calculateARR(bond) !== undefined ? calculateARR(bond) : '-' }), jsx$2("div", { className: "terms-column", children: ((_a = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _a === void 0 ? void 0 : _a.days) ? `${(_b = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _b === void 0 ? void 0 : _b.days} D` : '-' }), jsx$2("div", { className: "tokens-remaining-column", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: remainingPercentage(bond) }), style: {
74363
+ return (jsxs("div", { className: "bond-row", onClick: handleOpenModal, children: [jsx$2("div", { className: "token-info-container bond-market", children: jsx$2(TokenInfoAndName, { bill: bond }) }), jsxs("div", { className: "bond-info-columns", children: [jsx$2("div", { className: `discount-column ${getDiscountColor(bonus)}`, children: bonus !== undefined ? `${bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(2)}%` : '-' }), jsx$2("div", { className: "arr-column", children: calculateARR(bond) !== undefined ? calculateARR(bond) : '-' }), jsx$2("div", { className: "terms-column", children: ((_a = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _a === void 0 ? void 0 : _a.days) ? `${(_b = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _b === void 0 ? void 0 : _b.days} D` : '-' }), jsx$2("div", { className: "tokens-remaining-column", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: remainingPercentage(bond) }), style: {
74362
74364
  width: '127px',
74363
74365
  height: '25px',
74364
74366
  flexDirection: 'column',
@@ -74372,7 +74374,7 @@ const BondRow = ({ bond }) => {
74372
74374
 
74373
74375
  const HotBondCard = ({ bond }) => {
74374
74376
  var _a, _b, _c, _d, _e, _f, _g, _h;
74375
- const { discount } = bond;
74377
+ const { bonus } = bond;
74376
74378
  // Modal
74377
74379
  const [openBuyModal] = useModal(jsx$2(BondModal, { bondAddress: bond.billAddress, bondChain: bond.chainId }), true, true, `buyBondModal-${bond.billAddress}-${bond.chainId}`);
74378
74380
  const handleOpenModal = () => {
@@ -74386,7 +74388,7 @@ const HotBondCard = ({ bond }) => {
74386
74388
  },
74387
74389
  });
74388
74390
  };
74389
- return (jsx$2(Flex, { sx: styles$a.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, { bill: bond, 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: (_c = (_b = (_a = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _c !== void 0 ? _c : '', earnTokenSymbol: (_e = (_d = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _d === void 0 ? void 0 : _d.symbol) !== null && _e !== void 0 ? _e : '', bondContract: (_f = bond === null || bond === void 0 ? void 0 : bond.billAddress) !== null && _f !== void 0 ? _f : '', 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: "Discount" }), jsx$2(Flex, { className: `${getDiscountColor(discount)}`, sx: { width: '100%', justifyContent: 'center' }, children: discount !== undefined ? `${discount === null || discount === void 0 ? void 0 : discount.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) !== undefined ? calculateARR(bond) : '-' })] }), 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: ((_g = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _g === void 0 ? void 0 : _g.days) ? `${(_h = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _h === void 0 ? void 0 : _h.days} D` : '-' })] })] })] }) }));
74391
+ return (jsx$2(Flex, { sx: styles$a.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, { bill: bond, 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: (_c = (_b = (_a = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _c !== void 0 ? _c : '', earnTokenSymbol: (_e = (_d = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _d === void 0 ? void 0 : _d.symbol) !== null && _e !== void 0 ? _e : '', bondContract: (_f = bond === null || bond === void 0 ? void 0 : bond.billAddress) !== null && _f !== void 0 ? _f : '', 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 === 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) !== undefined ? calculateARR(bond) : '-' })] }), 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: ((_g = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _g === void 0 ? void 0 : _g.days) ? `${(_h = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _h === void 0 ? void 0 : _h.days} D` : '-' })] })] })] }) }));
74390
74392
  };
74391
74393
 
74392
74394
  function useHotBondContracts() {
@@ -74426,7 +74428,7 @@ const getHotBonds = (bondData, hotBondContracts) => __awaiter$9(void 0, void 0,
74426
74428
  const HotBondCards = () => {
74427
74429
  var _a;
74428
74430
  const { data: hotBonds } = useHotBonds();
74429
- const filteredBonds = (_a = hotBonds === null || hotBonds === void 0 ? void 0 : hotBonds.sort((a, b) => { var _a, _b; return ((_a = b === null || b === void 0 ? void 0 : b.discount) !== null && _a !== void 0 ? _a : 0) - ((_b = a === null || a === void 0 ? void 0 : a.discount) !== null && _b !== void 0 ? _b : 0); })) === null || _a === void 0 ? void 0 : _a.filter((bond) => (bond === null || bond === void 0 ? void 0 : bond.discount) > 0 && (bond === null || bond === void 0 ? void 0 : bond.discount) < 50);
74431
+ const filteredBonds = (_a = hotBonds === null || hotBonds === void 0 ? void 0 : hotBonds.sort((a, b) => { var _a, _b; return ((_a = b === null || b === void 0 ? void 0 : b.bonus) !== null && _a !== void 0 ? _a : 0) - ((_b = a === null || a === void 0 ? void 0 : a.bonus) !== null && _b !== void 0 ? _b : 0); })) === null || _a === void 0 ? void 0 : _a.filter((bond) => (bond === null || bond === void 0 ? void 0 : bond.bonus) > 0 && (bond === null || bond === void 0 ? void 0 : bond.bonus) < 50);
74430
74432
  const [activeSlide, setActiveSlide] = useState(0);
74431
74433
  const { swiper, setSwiper } = useSwiper();
74432
74434
  const handleSlide = (event) => {
@@ -74576,7 +74578,7 @@ const styles$7 = {
74576
74578
  const SmallRecommendationCard = ({ recommendation }) => {
74577
74579
  var _a;
74578
74580
  const vestingTime = getTimePeriods((_a = recommendation.vestingTerm) !== null && _a !== void 0 ? _a : 0, true);
74579
- 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: "Discount" }), jsxs(Flex, { sx: { fontSize: '12px', color: recommendation.discount > 0 ? 'success' : 'error', ml: '6px' }, children: [recommendation.discount.toFixed(2), "%"] })] })] }));
74581
+ 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), "%"] })] })] }));
74580
74582
  };
74581
74583
 
74582
74584
  const RecommendationCards$1 = () => {
@@ -74593,7 +74595,7 @@ const RecommendationCards$1 = () => {
74593
74595
  const selectedBonds = activeOption === 'For You' ? forYouRecommendations : activeOption === 'Hot' ? hotRecommendations : filteredBonds;
74594
74596
  const slicedBonds = (_a = selectedBonds === null || selectedBonds === void 0 ? void 0 : selectedBonds.sort((a, b) => { var _a, _b; return ((_a = b === null || b === void 0 ? void 0 : b.discount) !== null && _a !== void 0 ? _a : 0) - ((_b = a === null || a === void 0 ? void 0 : a.discount) !== null && _b !== void 0 ? _b : 0); })) === null || _a === void 0 ? void 0 : _a.slice(0, 3);
74595
74597
  const parsedBondsToRender = slicedBonds === null || slicedBonds === void 0 ? void 0 : slicedBonds.map((bond) => {
74596
- var _a, _b;
74598
+ var _a, _b, _c;
74597
74599
  const contractAddress = bond.billAddress;
74598
74600
  const payoutTokenName = 'payoutTokenName' in bond ? bond.payoutTokenName : bond.earnToken.symbol;
74599
74601
  return {
@@ -74601,6 +74603,7 @@ const RecommendationCards$1 = () => {
74601
74603
  contractAddress,
74602
74604
  vestingTerm: (_a = bond.vestingTerm) !== null && _a !== void 0 ? _a : 0,
74603
74605
  discount: (_b = bond.discount) !== null && _b !== void 0 ? _b : 0,
74606
+ bonus: (_c = bond.bonus) !== null && _c !== void 0 ? _c : 0,
74604
74607
  chainId: bond.chainId,
74605
74608
  };
74606
74609
  });
@@ -74650,7 +74653,7 @@ const BondsMenu = ({ searchQuery, setSearchQuery, setChainFilterOption, chainFil
74650
74653
  height: '30px',
74651
74654
  fontSize: '14px',
74652
74655
  color: 'white',
74653
- }, placeholder: 'Search...' }), jsx$2(FavIcon, { filterOption: filterOption, setFilterOption: setFilterOption })] }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "discount-header", onClick: () => onSort('discount'), children: ["DISCOUNT", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: 10, color: "textDisabledButton" }) })] }), jsxs("div", { className: "arr-header", onClick: () => onSort('arr'), children: ["ARR", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "terms-header", onClick: () => onSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px' }, 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' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2("div", { className: "tooltip-header" })] })] })] }));
74656
+ }, placeholder: 'Search...' }), jsx$2(FavIcon, { filterOption: filterOption, setFilterOption: setFilterOption })] }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "discount-header", onClick: () => onSort('discount'), children: ["BONUS", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: 10, color: "textDisabledButton" }) })] }), jsxs("div", { className: "arr-header", onClick: () => onSort('arr'), children: ["ARR", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "terms-header", onClick: () => onSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px' }, 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' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2("div", { className: "tooltip-header" })] })] })] }));
74654
74657
  };
74655
74658
 
74656
74659
  const Bonds = () => {
@@ -75659,7 +75662,7 @@ const RecommendationCards = () => {
75659
75662
  const selectedBonds = activeOption === 'For You' ? forYouRecommendations : activeOption === 'Hot' ? hotRecommendations : filteredBonds;
75660
75663
  const slicedBonds = (_a = selectedBonds === null || selectedBonds === void 0 ? void 0 : selectedBonds.sort((a, b) => { var _a, _b; return ((_a = b === null || b === void 0 ? void 0 : b.discount) !== null && _a !== void 0 ? _a : 0) - ((_b = a === null || a === void 0 ? void 0 : a.discount) !== null && _b !== void 0 ? _b : 0); })) === null || _a === void 0 ? void 0 : _a.slice(0, 3);
75661
75664
  const parsedBondsToRender = slicedBonds === null || slicedBonds === void 0 ? void 0 : slicedBonds.map((bond) => {
75662
- var _a, _b, _c;
75665
+ var _a, _b, _c, _d;
75663
75666
  let contractAddress = '';
75664
75667
  if ('contractAddress' in bond) {
75665
75668
  contractAddress = bond.contractAddress;
@@ -75672,6 +75675,7 @@ const RecommendationCards = () => {
75672
75675
  contractAddress,
75673
75676
  vestingTerm: (_b = bond.vestingTerm) !== null && _b !== void 0 ? _b : 0,
75674
75677
  discount: (_c = bond.discount) !== null && _c !== void 0 ? _c : 0,
75678
+ bonus: (_d = bond.bonus) !== null && _d !== void 0 ? _d : 0,
75675
75679
  chainId: bond.chainId,
75676
75680
  };
75677
75681
  });
@@ -90390,7 +90394,7 @@ const TopSaleCard = ({ sale, position }) => {
90390
90394
  ['60px', '60px', '60px', '200px'],
90391
90395
  ['60px', '60px', '60px', '200px'],
90392
90396
  ];
90393
- return (jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$1.topSaleCardContainer), { border: borderColor[position - 1] }), children: [jsxs(Flex, { sx: { width: ['100%', '100%', '100%', '180px'], flexDirection: 'column' }, children: [jsxs(Flex, { children: [jsx$2(Flex, { sx: styles$1.positionNumber, children: position }), jsxs(Flex, { sx: { flexDirection: 'column', ml: '10px' }, children: [jsx$2(Flex, { sx: { fontSize: '10px', color: 'textDisabledButton' }, children: "Buyer" }), jsxs(Flex, { sx: { fontSize: '12px', lineHeight: '13px', position: 'relative' }, children: [buyer === null || buyer === void 0 ? void 0 : buyer.slice(0, 4), "...", buyer === null || buyer === void 0 ? void 0 : buyer.slice((buyer === null || buyer === void 0 ? void 0 : buyer.length) - 4, buyer === null || buyer === void 0 ? void 0 : buyer.length), isUserTheBuyer && jsx$2(Flex, { sx: styles$1.youCard, children: "You" })] })] })] }), jsxs(Flex, { sx: { mt: '20px', width: '100%', fontSize: '12px', fontWeight: 400, flexDirection: 'column' }, children: [jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsx$2(Flex, { children: "Deposit Amount:" }), jsxs(Flex, { children: ["$", sale === null || sale === void 0 ? void 0 : sale.dollarValue.toFixed(2)] })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsx$2(Flex, { children: "Payout Amount:" }), jsxs(Flex, { children: ["$", receivedUsdAmount === null || receivedUsdAmount === void 0 ? void 0 : receivedUsdAmount.toFixed(2)] })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsx$2(Flex, { children: "Discount:" }), jsxs(Flex, { sx: { color: discount > 0 ? 'success' : 'error' }, children: [discount === null || discount === void 0 ? void 0 : discount.toFixed(2), "%"] })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsx$2(Flex, { children: "Date:" }), jsx$2(Flex, { children: formatUTCDate(new Date(((_d = sale === null || sale === void 0 ? void 0 : sale.createdAt) !== null && _d !== void 0 ? _d : 0) * 1000)) })] })] })] }), jsx$2("img", { src: `https://ape.bond/images/singleBondPage/${position}.png`, alt: "ads", sx: Object.assign({ width: size[position - 1], height: size[position - 1] }, styles$1.medals) }), jsx$2(Flex, { sx: {
90397
+ return (jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$1.topSaleCardContainer), { border: borderColor[position - 1] }), children: [jsxs(Flex, { sx: { width: ['100%', '100%', '100%', '180px'], flexDirection: 'column' }, children: [jsxs(Flex, { children: [jsx$2(Flex, { sx: styles$1.positionNumber, children: position }), jsxs(Flex, { sx: { flexDirection: 'column', ml: '10px' }, children: [jsx$2(Flex, { sx: { fontSize: '10px', color: 'textDisabledButton' }, children: "Buyer" }), jsxs(Flex, { sx: { fontSize: '12px', lineHeight: '13px', position: 'relative' }, children: [buyer === null || buyer === void 0 ? void 0 : buyer.slice(0, 4), "...", buyer === null || buyer === void 0 ? void 0 : buyer.slice((buyer === null || buyer === void 0 ? void 0 : buyer.length) - 4, buyer === null || buyer === void 0 ? void 0 : buyer.length), isUserTheBuyer && jsx$2(Flex, { sx: styles$1.youCard, children: "You" })] })] })] }), jsxs(Flex, { sx: { mt: '20px', width: '100%', fontSize: '12px', fontWeight: 400, flexDirection: 'column' }, children: [jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsx$2(Flex, { children: "Deposit Amount:" }), jsxs(Flex, { children: ["$", sale === null || sale === void 0 ? void 0 : sale.dollarValue.toFixed(2)] })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsx$2(Flex, { children: "Payout Amount:" }), jsxs(Flex, { children: ["$", receivedUsdAmount === null || receivedUsdAmount === void 0 ? void 0 : receivedUsdAmount.toFixed(2)] })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsx$2(Flex, { children: "Bonus:" }), jsxs(Flex, { sx: { color: discount > 0 ? 'success' : 'error' }, children: [discount === null || discount === void 0 ? void 0 : discount.toFixed(2), "%"] })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsx$2(Flex, { children: "Date:" }), jsx$2(Flex, { children: formatUTCDate(new Date(((_d = sale === null || sale === void 0 ? void 0 : sale.createdAt) !== null && _d !== void 0 ? _d : 0) * 1000)) })] })] })] }), jsx$2("img", { src: `https://ape.bond/images/singleBondPage/${position}.png`, alt: "ads", sx: Object.assign({ width: size[position - 1], height: size[position - 1] }, styles$1.medals) }), jsx$2(Flex, { sx: {
90394
90398
  position: 'absolute',
90395
90399
  width: '50%',
90396
90400
  right: '0px',
@@ -90415,7 +90419,7 @@ const SalesTable = ({ allSales }) => {
90415
90419
  fontSize: '12px',
90416
90420
  fontWeight: 400,
90417
90421
  mb: '5px',
90418
- }, children: [jsxs(Flex, { sx: { width: '170px' }, children: [jsx$2(Flex, { sx: { width: '30px', justifyContent: 'center' }, children: "#" }), jsx$2(Flex, { children: "Bond" })] }), jsx$2(Flex, { sx: { width: '120px', justifyContent: 'center' }, children: "Purchase Date" }), jsx$2(Flex, { sx: { width: '160px', justifyContent: 'center' }, children: "Buyer" }), jsx$2(Flex, { sx: { width: '110px', justifyContent: 'center' }, children: "Deposit Amount" }), jsx$2(Flex, { sx: { width: '110px', justifyContent: 'center' }, children: "Payout Amount" }), jsx$2(Flex, { sx: { width: '85px', justifyContent: 'center' }, children: "Discount" })] }), jsx$2(Flex, { sx: { width: '100%', flexDirection: 'column' }, children: allSales &&
90422
+ }, children: [jsxs(Flex, { sx: { width: '170px' }, children: [jsx$2(Flex, { sx: { width: '30px', justifyContent: 'center' }, children: "#" }), jsx$2(Flex, { children: "Bond" })] }), jsx$2(Flex, { sx: { width: '120px', justifyContent: 'center' }, children: "Purchase Date" }), jsx$2(Flex, { sx: { width: '160px', justifyContent: 'center' }, children: "Buyer" }), jsx$2(Flex, { sx: { width: '110px', justifyContent: 'center' }, children: "Deposit Amount" }), jsx$2(Flex, { sx: { width: '110px', justifyContent: 'center' }, children: "Payout Amount" }), jsx$2(Flex, { sx: { width: '85px', justifyContent: 'center' }, children: "Bonus" })] }), jsx$2(Flex, { sx: { width: '100%', flexDirection: 'column' }, children: allSales &&
90419
90423
  allSales.length > 0 &&
90420
90424
  allSales.map((sale, index) => {
90421
90425
  var _a;
@@ -7,6 +7,7 @@ export interface BondRecommendation {
7
7
  payoutTokenName: string;
8
8
  billAddress: string;
9
9
  discount: number;
10
+ bonus: number;
10
11
  link: string;
11
12
  billNftAddress: string;
12
13
  initTime: number;
@@ -5,6 +5,7 @@ export interface BondsData {
5
5
  chainId: ChainId;
6
6
  type: string;
7
7
  discount: number;
8
+ bonus: number;
8
9
  billAddress?: string;
9
10
  billNftAddress: string;
10
11
  soldOut?: boolean;
@@ -5,6 +5,7 @@ export interface SmallCardBond {
5
5
  payoutTokenName: string;
6
6
  contractAddress: string;
7
7
  discount: number;
8
+ bonus: number;
8
9
  chainId: ChainId;
9
10
  }
10
11
  declare const SmallRecommendationCard: ({ recommendation }: {
@@ -5,6 +5,7 @@ export interface SmallCardBond {
5
5
  payoutTokenName: string;
6
6
  contractAddress: string;
7
7
  discount: number;
8
+ bonus: number;
8
9
  chainId: ChainId;
9
10
  }
10
11
  declare const RecommendationCards: () => React.JSX.Element;
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": "2.1.1",
6
+ "version": "2.2.1-test.1",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",