@ape.swap/bonds-sdk 2.2.1-test.0 → 2.2.1-test.2
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 +22 -23
- package/dist/state/bonds/useGetBondRecommendations.d.ts +1 -0
- package/dist/types/bonds.d.ts +1 -0
- package/dist/views/Bonds/components/RecommendationCards/SmallRecommendationCard.d.ts +1 -0
- package/dist/views/Bonds/components/RecommendationCards/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -41434,7 +41434,7 @@ const useModal = (modal, closeOnOverlayClick = true, updateOnPropsChange = false
|
|
|
41434
41434
|
};
|
|
41435
41435
|
|
|
41436
41436
|
const TooltipText = {
|
|
41437
|
-
Discount:
|
|
41437
|
+
Discount: 'This is the percentage of additional tokens you’ll get based on the current bond’s discount.',
|
|
41438
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.',
|
|
@@ -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: "Bonus" }), jsxs(Text, { sx: { color: 'success' }, children: [bond.
|
|
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 (
|
|
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)) ||
|
|
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;
|
|
@@ -71616,7 +71616,7 @@ const getDiscountColor = (discount) => {
|
|
|
71616
71616
|
return discount < 0 ? 'discount-negative' : 'discount-positive';
|
|
71617
71617
|
};
|
|
71618
71618
|
const calculateARR = (bond) => {
|
|
71619
|
-
const discount2 = '
|
|
71619
|
+
const discount2 = 'bonus' in bond ? bond.bonus : undefined;
|
|
71620
71620
|
const vestingTerm = 'vestingTerm' in bond ? bond === null || bond === void 0 ? void 0 : bond.vestingTerm : undefined;
|
|
71621
71621
|
if (!discount2)
|
|
71622
71622
|
return '-';
|
|
@@ -71641,11 +71641,7 @@ function useBondsData() {
|
|
|
71641
71641
|
const getBondsData = (realTimeApiURL, tokenPrices, bondList) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
71642
71642
|
try {
|
|
71643
71643
|
const response = yield axios.get(realTimeApiURL);
|
|
71644
|
-
|
|
71645
|
-
const bonus = bond.discount && (bond.discount > 0 ? (bond.discount / (100 - bond.discount)) * 100 : 0);
|
|
71646
|
-
return Object.assign(Object.assign({}, bond), { discount: bonus });
|
|
71647
|
-
});
|
|
71648
|
-
return bonds;
|
|
71644
|
+
return response.data.bonds;
|
|
71649
71645
|
}
|
|
71650
71646
|
catch (_a) {
|
|
71651
71647
|
const billData = [];
|
|
@@ -71723,7 +71719,8 @@ const cleanBillsData = (billIds, chunkedBills, tokenPrices, chainId, bills) => {
|
|
|
71723
71719
|
.toString();
|
|
71724
71720
|
//I've added a ts ignore here due to some props marked as optional in the list repo which are actually not optional
|
|
71725
71721
|
//@ts-ignore
|
|
71726
|
-
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
|
|
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() });
|
|
71727
71724
|
return cleanedData;
|
|
71728
71725
|
});
|
|
71729
71726
|
return data;
|
|
@@ -73780,7 +73777,7 @@ const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
|
|
|
73780
73777
|
|
|
73781
73778
|
const BondCards = ({ bondData }) => {
|
|
73782
73779
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
73783
|
-
return (jsxs("div", { className: "bonds-cards", children: [jsxs("div", { className: "bond-card-block", style: { color: getDiscountColor(bondData === null || bondData === void 0 ? void 0 : bondData.
|
|
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.bonus) }, 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.bonus) !== 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')] })] })] }));
|
|
73784
73781
|
};
|
|
73785
73782
|
|
|
73786
73783
|
const Estimations = ({ bondData, inputValue, inputToken, estimatedOutput, inputTokenPrice, isZap, fetchingZapQuote, zapError, }) => {
|
|
@@ -73790,7 +73787,7 @@ const Estimations = ({ bondData, inputValue, inputToken, estimatedOutput, inputT
|
|
|
73790
73787
|
const estimatedInputUSD = parseFloat(inputValue) * (inputTokenPrice !== null && inputTokenPrice !== void 0 ? inputTokenPrice : 0);
|
|
73791
73788
|
const normalPremium = premium(bondData, inputValue);
|
|
73792
73789
|
const premiumString = isZap ? formatUSDNumber((estimatedOutputUSD - estimatedInputUSD).toString()) : normalPremium;
|
|
73793
|
-
return (jsxs(Flex, { className: "modaltable-container text-container", children: [jsxs(Flex, { className: "text-container row", children: [jsx$2(Flex, { className: "row-container spend", children: "You spend:" }), jsxs(Flex, { className: "row-container spend-val", children: [youSpend(inputValue), " ", getSymbol(inputToken, bondData.chainId), " = $", ' ', formatUSDNumber(estimatedInputUSD === null || estimatedInputUSD === void 0 ? void 0 : estimatedInputUSD.toString())] })] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["
|
|
73790
|
+
return (jsxs(Flex, { className: "modaltable-container text-container", children: [jsxs(Flex, { className: "text-container row", children: [jsx$2(Flex, { className: "row-container spend", children: "You spend:" }), jsxs(Flex, { className: "row-container spend-val", children: [youSpend(inputValue), " ", getSymbol(inputToken, bondData.chainId), " = $", ' ', formatUSDNumber(estimatedInputUSD === null || estimatedInputUSD === void 0 ? void 0 : estimatedInputUSD.toString())] })] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["Bonus:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Premium }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val ${getPremiumColor(premiumString)}`, children: ["$ ", premiumString] }))] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You get (over ", vestingTime((_b = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _b !== void 0 ? _b : 0).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumber$2(estimatedOutput.toString()), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatUSDNumber(estimatedOutputUSD.toString())] }))] })] }));
|
|
73794
73791
|
};
|
|
73795
73792
|
|
|
73796
73793
|
// Custom HTML sanitizer
|
|
@@ -74325,7 +74322,7 @@ const BondRow = ({ bond }) => {
|
|
|
74325
74322
|
: 'contractAddress' in bond
|
|
74326
74323
|
? bond.contractAddress[bond.chainId]
|
|
74327
74324
|
: undefined;
|
|
74328
|
-
const
|
|
74325
|
+
const bonus = 'bonus' in bond ? bond.bonus : undefined;
|
|
74329
74326
|
// Modal
|
|
74330
74327
|
const [openBuyModal] = useModal(jsx$2(ModalHandler, { bondAddress: billAddress, bondChain: bond.chainId }), true, true, `buyBondModal-${billAddress}-${bond.chainId}`);
|
|
74331
74328
|
const handleOpenModal = () => {
|
|
@@ -74363,7 +74360,7 @@ const BondRow = ({ bond }) => {
|
|
|
74363
74360
|
const tokens = new BigNumber$1(tokensRemaining);
|
|
74364
74361
|
return tokens.times(payoutTokenPrice);
|
|
74365
74362
|
};
|
|
74366
|
-
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(
|
|
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: {
|
|
74367
74364
|
width: '127px',
|
|
74368
74365
|
height: '25px',
|
|
74369
74366
|
flexDirection: 'column',
|
|
@@ -74377,7 +74374,7 @@ const BondRow = ({ bond }) => {
|
|
|
74377
74374
|
|
|
74378
74375
|
const HotBondCard = ({ bond }) => {
|
|
74379
74376
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
74380
|
-
const {
|
|
74377
|
+
const { bonus } = bond;
|
|
74381
74378
|
// Modal
|
|
74382
74379
|
const [openBuyModal] = useModal(jsx$2(BondModal, { bondAddress: bond.billAddress, bondChain: bond.chainId }), true, true, `buyBondModal-${bond.billAddress}-${bond.chainId}`);
|
|
74383
74380
|
const handleOpenModal = () => {
|
|
@@ -74391,7 +74388,7 @@ const HotBondCard = ({ bond }) => {
|
|
|
74391
74388
|
},
|
|
74392
74389
|
});
|
|
74393
74390
|
};
|
|
74394
|
-
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(
|
|
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` : '-' })] })] })] }) }));
|
|
74395
74392
|
};
|
|
74396
74393
|
|
|
74397
74394
|
function useHotBondContracts() {
|
|
@@ -74431,7 +74428,7 @@ const getHotBonds = (bondData, hotBondContracts) => __awaiter$9(void 0, void 0,
|
|
|
74431
74428
|
const HotBondCards = () => {
|
|
74432
74429
|
var _a;
|
|
74433
74430
|
const { data: hotBonds } = useHotBonds();
|
|
74434
|
-
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.
|
|
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);
|
|
74435
74432
|
const [activeSlide, setActiveSlide] = useState(0);
|
|
74436
74433
|
const { swiper, setSwiper } = useSwiper();
|
|
74437
74434
|
const handleSlide = (event) => {
|
|
@@ -74581,7 +74578,7 @@ const styles$7 = {
|
|
|
74581
74578
|
const SmallRecommendationCard = ({ recommendation }) => {
|
|
74582
74579
|
var _a;
|
|
74583
74580
|
const vestingTime = getTimePeriods((_a = recommendation.vestingTerm) !== null && _a !== void 0 ? _a : 0, true);
|
|
74584
|
-
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.
|
|
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), "%"] })] })] }));
|
|
74585
74582
|
};
|
|
74586
74583
|
|
|
74587
74584
|
const RecommendationCards$1 = () => {
|
|
@@ -74598,7 +74595,7 @@ const RecommendationCards$1 = () => {
|
|
|
74598
74595
|
const selectedBonds = activeOption === 'For You' ? forYouRecommendations : activeOption === 'Hot' ? hotRecommendations : filteredBonds;
|
|
74599
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);
|
|
74600
74597
|
const parsedBondsToRender = slicedBonds === null || slicedBonds === void 0 ? void 0 : slicedBonds.map((bond) => {
|
|
74601
|
-
var _a, _b;
|
|
74598
|
+
var _a, _b, _c;
|
|
74602
74599
|
const contractAddress = bond.billAddress;
|
|
74603
74600
|
const payoutTokenName = 'payoutTokenName' in bond ? bond.payoutTokenName : bond.earnToken.symbol;
|
|
74604
74601
|
return {
|
|
@@ -74606,6 +74603,7 @@ const RecommendationCards$1 = () => {
|
|
|
74606
74603
|
contractAddress,
|
|
74607
74604
|
vestingTerm: (_a = bond.vestingTerm) !== null && _a !== void 0 ? _a : 0,
|
|
74608
74605
|
discount: (_b = bond.discount) !== null && _b !== void 0 ? _b : 0,
|
|
74606
|
+
bonus: (_c = bond.bonus) !== null && _c !== void 0 ? _c : 0,
|
|
74609
74607
|
chainId: bond.chainId,
|
|
74610
74608
|
};
|
|
74611
74609
|
});
|
|
@@ -75664,7 +75662,7 @@ const RecommendationCards = () => {
|
|
|
75664
75662
|
const selectedBonds = activeOption === 'For You' ? forYouRecommendations : activeOption === 'Hot' ? hotRecommendations : filteredBonds;
|
|
75665
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);
|
|
75666
75664
|
const parsedBondsToRender = slicedBonds === null || slicedBonds === void 0 ? void 0 : slicedBonds.map((bond) => {
|
|
75667
|
-
var _a, _b, _c;
|
|
75665
|
+
var _a, _b, _c, _d;
|
|
75668
75666
|
let contractAddress = '';
|
|
75669
75667
|
if ('contractAddress' in bond) {
|
|
75670
75668
|
contractAddress = bond.contractAddress;
|
|
@@ -75677,6 +75675,7 @@ const RecommendationCards = () => {
|
|
|
75677
75675
|
contractAddress,
|
|
75678
75676
|
vestingTerm: (_b = bond.vestingTerm) !== null && _b !== void 0 ? _b : 0,
|
|
75679
75677
|
discount: (_c = bond.discount) !== null && _c !== void 0 ? _c : 0,
|
|
75678
|
+
bonus: (_d = bond.bonus) !== null && _d !== void 0 ? _d : 0,
|
|
75680
75679
|
chainId: bond.chainId,
|
|
75681
75680
|
};
|
|
75682
75681
|
});
|
|
@@ -90420,7 +90419,7 @@ const SalesTable = ({ allSales }) => {
|
|
|
90420
90419
|
fontSize: '12px',
|
|
90421
90420
|
fontWeight: 400,
|
|
90422
90421
|
mb: '5px',
|
|
90423
|
-
}, 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: "
|
|
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 &&
|
|
90424
90423
|
allSales.length > 0 &&
|
|
90425
90424
|
allSales.map((sale, index) => {
|
|
90426
90425
|
var _a;
|
package/dist/types/bonds.d.ts
CHANGED