@goodaofi/bonds-sdk 3.0.169 → 3.0.170
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 +63 -410
- package/dist/views/GooSale/GooSale.d.ts +1 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -19823,7 +19823,7 @@ const TokenImage = ({ symbol, symbol2, size, chain, }) => {
|
|
|
19823
19823
|
[main.ChainId.KATANA]: '#068be34d',
|
|
19824
19824
|
[main.ChainId.UNICHAIN]: '#f50db44d',
|
|
19825
19825
|
});
|
|
19826
|
-
const TokenInfoAndName
|
|
19826
|
+
const TokenInfoAndName = ({ tokenSymbol,
|
|
19827
19827
|
// chain,
|
|
19828
19828
|
tag, vestEnds, isHotBond, }) => {
|
|
19829
19829
|
return (jsxs(Flex, { className: "tokeninfoname container", children: [jsxs(Flex, { className: "tokeninfoname tokencontainer", sx: {
|
|
@@ -71328,7 +71328,7 @@ const UserBondRow = ({ bill }) => {
|
|
|
71328
71328
|
const lastBlockTimestamp = parseInt((_e = bill === null || bill === void 0 ? void 0 : bill.lastBlockTimestamp) !== null && _e !== void 0 ? _e : '0');
|
|
71329
71329
|
const isPendingCliff = vestingCliff ? currentTime - lastBlockTimestamp < vestingCliff : false;
|
|
71330
71330
|
const cliffCountdown = getTimePeriods(lastBlockTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
|
|
71331
|
-
return (jsxs("div", { className: "your-bonds", onClick: onOpenPurchasedBond, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName
|
|
71331
|
+
return (jsxs("div", { className: "your-bonds", onClick: onOpenPurchasedBond, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_g = (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.earnToken) === null || _g === void 0 ? void 0 : _g.symbol, chain: (_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.chainId, tag: (_k = (_j = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _j === void 0 ? void 0 : _j.tags) === null || _k === void 0 ? void 0 : _k[0], vestEnds: `Ends in ${getPendingVestingString(bill)}`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_l = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _l === void 0 ? void 0 : _l.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_m = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _m === void 0 ? void 0 : _m.earnToken.symbol) || '', bondContract: (_o = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _o !== void 0 ? _o : '', projectLink: (_p = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _p === void 0 ? void 0 : _p.projectLink, twitter: (_q = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _q === void 0 ? void 0 : _q.twitter, audit: (_r = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _r === void 0 ? void 0 : _r.audit, chain: (_s = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _s === void 0 ? void 0 : _s.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
|
|
71332
71332
|
opacity: 0.8,
|
|
71333
71333
|
}, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(claimable(bill), 3), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(claimable(bill) * ((_t = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.price) !== null && _t !== void 0 ? _t : 0)).toFixed(2)})` })] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(totalPending(bill), 3), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(totalPending(bill) * ((_u = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.price) !== null && _u !== void 0 ? _u : 0)).toFixed(2)})` })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: vestingTimeRemainingString(bill) }), jsx$2("div", { className: "your-bonds-column-button", children: userChainId !== ((_v = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _v === void 0 ? void 0 : _v.chainId) ? (jsxs(Button, { className: "button", disabled: claimable(bill) === 0 || load, load: load, onClick: (event) => {
|
|
71334
71334
|
var _a;
|
|
@@ -74266,7 +74266,7 @@ const PreTgeUserRow = ({ userBond, isGooSale }) => {
|
|
|
74266
74266
|
const claimableUSD = claimableAmount * ((_v = userBond.initPrice) !== null && _v !== void 0 ? _v : 0);
|
|
74267
74267
|
const pendingAmount = hasRedeemed ? payout : depositAmount / truePricePaid;
|
|
74268
74268
|
const pendingUSD = pendingAmount * ((_w = userBond === null || userBond === void 0 ? void 0 : userBond.earnTokenPrice) !== null && _w !== void 0 ? _w : 0);
|
|
74269
|
-
return (jsxs("div", { className: "your-bonds", onClick: () => null, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName
|
|
74269
|
+
return (jsxs("div", { className: "your-bonds", onClick: () => null, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: userBond.earnToken.symbol, chain: userBond.chainId, tag: (_x = userBond.tags) === null || _x === void 0 ? void 0 : _x[0], vestEnds: `Ends in ${vestingString}`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (userBond === null || userBond === void 0 ? void 0 : userBond.earnToken.address[userBond === null || userBond === void 0 ? void 0 : userBond.chainId]) || '', earnTokenSymbol: (userBond === null || userBond === void 0 ? void 0 : userBond.earnToken.symbol) || '', bondContract: ((_y = userBond === null || userBond === void 0 ? void 0 : userBond.contractAddress) === null || _y === void 0 ? void 0 : _y[userBond === null || userBond === void 0 ? void 0 : userBond.chainId]) || '', projectLink: userBond === null || userBond === void 0 ? void 0 : userBond.projectLink, twitter: userBond === null || userBond === void 0 ? void 0 : userBond.twitter, audit: userBond === null || userBond === void 0 ? void 0 : userBond.audit, chain: userBond === null || userBond === void 0 ? void 0 : userBond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
|
|
74270
74270
|
opacity: 0.8,
|
|
74271
74271
|
}, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(claimableAmount, 3), isGooSale && ' GOO', !isGooSale && (jsxs("div", { className: "your-bonds-content-tokens-usd-amount", children: ["($", formatUSDNumber$1(claimableUSD), ")"] }))] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(pendingAmount, 3), isGooSale && ' GOO', !isGooSale && jsxs("div", { className: "your-bonds-content-tokens-usd-amount", children: ["($", formatUSDNumber$1(pendingUSD), ")"] })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: vestingString }), jsx$2("div", { className: "your-bonds-column-button", children: jsx$2(PreTgeActions, { userBond: userBond }) })] })] }));
|
|
74272
74272
|
};
|
|
@@ -79771,7 +79771,7 @@ const BonusComponent = ({ trueBondPrices, minTier, bonus, airdropTooltip, toolti
|
|
|
79771
79771
|
}, 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' } }) }) }))] })) }));
|
|
79772
79772
|
};
|
|
79773
79773
|
|
|
79774
|
-
const ProgressBar
|
|
79774
|
+
const ProgressBar = ({ value }) => {
|
|
79775
79775
|
return (jsx$2(Flex$1, { sx: { width: ['100px', '100px', '100px', '100%'], alignItems: 'center', flexDirection: 'row', mt: '5px' }, children: jsx$2(Box$1, { className: "progressbar-background", children: jsx$2(Box$1, { className: "progressbar-completed", style: {
|
|
79776
79776
|
width: `${value <= 3 ? 3 : value}%`,
|
|
79777
79777
|
} }) }) }));
|
|
@@ -79839,7 +79839,7 @@ const BondCards$2 = ({ bondData }) => {
|
|
|
79839
79839
|
borderBottomRightRadius: 'normal',
|
|
79840
79840
|
borderBottomLeftRadius: 'normal',
|
|
79841
79841
|
},
|
|
79842
|
-
}, children: [jsxs(Flex, { className: "bond-card-title", children: ["Tokens Remaining", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.TokensRemaining }), 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(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar
|
|
79842
|
+
}, children: [jsxs(Flex, { className: "bond-card-title", children: ["Tokens Remaining", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.TokensRemaining }), 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(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: remainingPercentage(bondData) }), style: {
|
|
79843
79843
|
width: '127px',
|
|
79844
79844
|
height: '25px',
|
|
79845
79845
|
flexDirection: 'column',
|
|
@@ -80924,7 +80924,7 @@ const BonusContainer = ({ trueBondPrices, minTier, bonus, airdropTooltip, toolti
|
|
|
80924
80924
|
return (jsx$2("div", { className: `discount-column`, children: jsx$2(BonusComponent, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip, tooltipPosition: isMobile ? tooltipPosition : 'bottomLeft' }) }));
|
|
80925
80925
|
};
|
|
80926
80926
|
|
|
80927
|
-
const BondRow
|
|
80927
|
+
const BondRow = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, }) => {
|
|
80928
80928
|
var _a, _b, _c;
|
|
80929
80929
|
const locationPath = window.location.pathname.replace('/', '');
|
|
80930
80930
|
// Modal
|
|
@@ -80953,7 +80953,7 @@ const BondRow$1 = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSol
|
|
|
80953
80953
|
});
|
|
80954
80954
|
};
|
|
80955
80955
|
return (jsxs("div", { className: "bond-row" // Insert special campaign styles here
|
|
80956
|
-
, 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
|
|
80956
|
+
, 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, 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: {
|
|
80957
80957
|
width: '127px',
|
|
80958
80958
|
height: '25px',
|
|
80959
80959
|
flexDirection: 'column',
|
|
@@ -80979,7 +80979,7 @@ const HotBondCard = ({ bond }) => {
|
|
|
80979
80979
|
},
|
|
80980
80980
|
});
|
|
80981
80981
|
};
|
|
80982
|
-
return (jsx$2(Flex, { sx: styles$c.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
|
|
80982
|
+
return (jsx$2(Flex, { sx: styles$c.desktopCard, className: "hot-bond-card", onClick: handleOpenModal, children: jsxs(Flex, { sx: { flexDirection: 'column', width: '100%' }, children: [jsxs(Flex, { sx: { width: '100%', height: '75px' }, children: [jsx$2(Flex, { sx: { width: '66.66%' }, children: jsx$2(TokenInfoAndName, { tokenSymbol: bond.earnToken.symbol, chain: bond.chainId, tag: (_d = bond.tags) === null || _d === void 0 ? void 0 : _d[0], isHotBond: true }) }), jsx$2(Flex, { className: "column column-tokenicons", sx: { width: '33.33% !important', justifyContent: 'center !important', alignItems: 'center' }, children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_g = (_f = (_e = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _g !== void 0 ? _g : '', earnTokenSymbol: (_j = (_h = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _h === void 0 ? void 0 : _h.symbol) !== null && _j !== void 0 ? _j : '', bondContract: (_l = (_k = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _k === void 0 ? void 0 : _k[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _l !== void 0 ? _l : '', projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: bond === null || bond === void 0 ? void 0 : bond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)", children: jsx$2(Svg, { icon: "more", width: "20px" }) }) })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-around' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400 }, children: "Bonus" }), jsx$2(Flex, { className: `${getDiscountColor(bonus)}`, sx: { width: '100%', justifyContent: 'center' }, children: bonus !== undefined ? (bonus < 0 ? '0%' : `${bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(2)}%`) : '-' })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "ARR" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: calculateARR(bond, SDKConfig.useTiers) })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "Terms" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: ((_m = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _m === void 0 ? void 0 : _m.days) ? `${(_o = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _o === void 0 ? void 0 : _o.days} D` : '-' })] })] })] }) }));
|
|
80983
80983
|
};
|
|
80984
80984
|
|
|
80985
80985
|
function useHotBondContracts() {
|
|
@@ -81071,7 +81071,7 @@ const HotBondCards = () => {
|
|
|
81071
81071
|
}) })] })] }));
|
|
81072
81072
|
};
|
|
81073
81073
|
|
|
81074
|
-
const BANNER_INFO
|
|
81074
|
+
const BANNER_INFO = {
|
|
81075
81075
|
[main.ChainId.MONAD_TESTNET]: {
|
|
81076
81076
|
title: 'Test and Play on Monad Testnet',
|
|
81077
81077
|
subtitle: 'Explore Bonds on the Monad Testnet for free.',
|
|
@@ -81088,20 +81088,20 @@ const BANNER_INFO$1 = {
|
|
|
81088
81088
|
logo: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/monad-logo_lkstid.png',
|
|
81089
81089
|
},
|
|
81090
81090
|
};
|
|
81091
|
-
const BannerTestnet
|
|
81091
|
+
const BannerTestnet = ({ chainId }) => {
|
|
81092
81092
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
81093
81093
|
return (jsxs("div", { className: "banner-container", sx: {
|
|
81094
81094
|
backgroundImage: [
|
|
81095
|
-
`url(${(_a = BANNER_INFO
|
|
81096
|
-
`url(${(_b = BANNER_INFO
|
|
81097
|
-
`url(${(_c = BANNER_INFO
|
|
81098
|
-
`url(${(_d = BANNER_INFO
|
|
81099
|
-
`url(${(_e = BANNER_INFO
|
|
81095
|
+
`url(${(_a = BANNER_INFO[chainId]) === null || _a === void 0 ? void 0 : _a.backgroundMobile})`,
|
|
81096
|
+
`url(${(_b = BANNER_INFO[chainId]) === null || _b === void 0 ? void 0 : _b.backgroundMobile})`,
|
|
81097
|
+
`url(${(_c = BANNER_INFO[chainId]) === null || _c === void 0 ? void 0 : _c.backgroundMobile})`,
|
|
81098
|
+
`url(${(_d = BANNER_INFO[chainId]) === null || _d === void 0 ? void 0 : _d.background})`,
|
|
81099
|
+
`url(${(_e = BANNER_INFO[chainId]) === null || _e === void 0 ? void 0 : _e.background})`,
|
|
81100
81100
|
],
|
|
81101
|
-
}, children: [jsxs("div", { className: "banner-logos", children: [jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/apebond-logo_vzt4dl.png", alt: "apebond-white-logo", style: { width: '100px' } }), jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/x-icono_va7sdu.png", alt: "x-white-logo" }), jsx$2("img", { src: `${(_f = BANNER_INFO
|
|
81101
|
+
}, children: [jsxs("div", { className: "banner-logos", children: [jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/apebond-logo_vzt4dl.png", alt: "apebond-white-logo", style: { width: '100px' } }), jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/x-icono_va7sdu.png", alt: "x-white-logo" }), jsx$2("img", { src: `${(_f = BANNER_INFO[chainId]) === null || _f === void 0 ? void 0 : _f.logo}`, alt: "partner-logo" })] }), jsx$2("div", { className: "banner-title", children: (_g = BANNER_INFO[chainId]) === null || _g === void 0 ? void 0 : _g.title }), jsx$2("div", { className: "banner-subtitle", children: (_h = BANNER_INFO[chainId]) === null || _h === void 0 ? void 0 : _h.subtitle }), jsx$2("div", { className: "banner-actions", children: (_j = BANNER_INFO[chainId]) === null || _j === void 0 ? void 0 : _j.buttons.map((button, index) => (jsx$2(Button, { className: "action-button", onClick: () => window.open(button.href, '_blank'), variant: button.variant || variants.PRIMARY, children: button.label }, `banner-button-${index}`))) })] }, `banner-container-${chainId}`));
|
|
81102
81102
|
};
|
|
81103
81103
|
|
|
81104
|
-
const BondRowsWithTitle
|
|
81104
|
+
const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
|
|
81105
81105
|
const key = chain;
|
|
81106
81106
|
const { namingPreference } = useSDKConfig();
|
|
81107
81107
|
return (jsx$2(Flex$1, { className: "bondrowswithtitle", children: jsx$2(AnimatePresence, { initial: false, children: bonds.length > 0 && (jsxs(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
|
|
@@ -81109,11 +81109,11 @@ const BondRowsWithTitle$1 = ({ chain, bonds, showHotBonds }) => {
|
|
|
81109
81109
|
overflow: 'hidden',
|
|
81110
81110
|
width: '100%',
|
|
81111
81111
|
marginTop: '0px',
|
|
81112
|
-
}, className: "bonds-card-container", children: [TESTNET_CHAINS.includes(chain) && jsx$2(BannerTestnet
|
|
81112
|
+
}, 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) => {
|
|
81113
81113
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
81114
81114
|
if (bondFromMap.soldOut) {
|
|
81115
81115
|
const bond = bondFromMap;
|
|
81116
|
-
return (jsx$2(BondRow
|
|
81116
|
+
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}`));
|
|
81117
81117
|
}
|
|
81118
81118
|
if (bondFromMap.billType === 'fcfs') {
|
|
81119
81119
|
const bond = bondFromMap;
|
|
@@ -81127,18 +81127,18 @@ const BondRowsWithTitle$1 = ({ chain, bonds, showHotBonds }) => {
|
|
|
81127
81127
|
const airdropBonus = (_r = bond === null || bond === void 0 ? void 0 : bond.airdropBonus) !== null && _r !== void 0 ? _r : 0;
|
|
81128
81128
|
const bonus = baseBonus + airdropBonus;
|
|
81129
81129
|
const initialRelease = ((_s = bond === null || bond === void 0 ? void 0 : bond.initialRelease) !== null && _s !== void 0 ? _s : 0) * 100;
|
|
81130
|
-
return (jsx$2(BondRow
|
|
81130
|
+
return (jsx$2(BondRow, { bondAddress: (_t = bond.contractAddress) === null || _t === void 0 ? void 0 : _t[bond.chainId], bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_u = bond.tags) === null || _u === void 0 ? void 0 : _u[0], bonus: `${bonus}%`, airdropTooltip: bond.airdropTooltip, percentageAvailable: percentageAvailable, remainingTokensString: `${formatNumberSI(tokensRemaining, 0)} ${earnToken} ($${formatNumberSI(tokensRemainingUSD, 2)})`, vestingTermString: initialRelease === 100 ? `0 D` : `${getTimePeriods((_v = bond.vestingTerm) !== null && _v !== void 0 ? _v : 0).months} Mo`, projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit }, `${bond.contractAddress}-${bond.chainId}-${index}`));
|
|
81131
81131
|
}
|
|
81132
81132
|
else {
|
|
81133
81133
|
const bond = bondFromMap;
|
|
81134
81134
|
const bondAddress = (_w = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _w === void 0 ? void 0 : _w[bond === null || bond === void 0 ? void 0 : bond.chainId];
|
|
81135
81135
|
const remainingTokensString = getRemainingTokensString(bond);
|
|
81136
|
-
return (jsx$2(BondRow
|
|
81136
|
+
return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_x = bond.tags) === null || _x === void 0 ? void 0 : _x[0], trueBondPrices: namingPreference === 'Bonus' ? bond.trueBondPrices : undefined, minTier: bond === null || bond === void 0 ? void 0 : bond.minTier, vestingTermString: getVestingTermsString(bond), vestingCliffString: getVestingTermsTooltipString(bond), percentageAvailable: remainingPercentage(bond), remainingTokensString: remainingTokensString, projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit, bonus: namingPreference === 'Discount' ? `${(_y = bond === null || bond === void 0 ? void 0 : bond.discountWithFee) === null || _y === void 0 ? void 0 : _y.toFixed(2)}%` : undefined }, `${bondAddress}-${bond.chainId}-${index}`));
|
|
81137
81137
|
}
|
|
81138
81138
|
}), showHotBonds && (jsx$2(SwiperProvider, { children: jsx$2(HotBondCards, {}) }))] }, key)) }) }, key));
|
|
81139
81139
|
};
|
|
81140
81140
|
|
|
81141
|
-
const BondRowsByChain
|
|
81141
|
+
const BondRowsByChain = ({ bonds, hideTitles }) => {
|
|
81142
81142
|
var _a;
|
|
81143
81143
|
const SDKConfig = useSDKConfig();
|
|
81144
81144
|
const validatedChains = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains) === null || _a === void 0 ? void 0 : _a.filter((chain) => MAINNET_CHAINS.includes(chain));
|
|
@@ -81152,7 +81152,7 @@ const BondRowsByChain$1 = ({ bonds, hideTitles }) => {
|
|
|
81152
81152
|
}, {});
|
|
81153
81153
|
return (jsx$2(Flex$1, { className: "bondrowsbychain", children: validatedChains === null || validatedChains === void 0 ? void 0 : validatedChains.map((chain) => {
|
|
81154
81154
|
var _a, _b;
|
|
81155
|
-
return (jsx$2(BondRowsWithTitle
|
|
81155
|
+
return (jsx$2(BondRowsWithTitle, { chain: chain, bonds: (_a = groupedBonds[chain]) !== null && _a !== void 0 ? _a : [], showHotBonds: hideTitles ? false : SDKConfig.useHotBonds ? (_b = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.hotBondChains) === null || _b === void 0 ? void 0 : _b.includes(chain) : false }, chain));
|
|
81156
81156
|
}) }));
|
|
81157
81157
|
};
|
|
81158
81158
|
|
|
@@ -81319,7 +81319,7 @@ const RecommendationCards$1 = () => {
|
|
|
81319
81319
|
}) })] }));
|
|
81320
81320
|
};
|
|
81321
81321
|
|
|
81322
|
-
const BondsMenu
|
|
81322
|
+
const BondsMenu = ({ onSort }) => {
|
|
81323
81323
|
const { namingPreference } = useSDKConfig();
|
|
81324
81324
|
return (jsx$2("div", { className: "bonds-menu", children: jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container", children: jsx$2(Flex$1, { sx: { width: '100%', maxWidth: '340px' } }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "discount-header", onClick: () => onSort('bonus'), children: [namingPreference.toUpperCase(), jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: 10, color: "textDisabledButton" }) })] }), jsxs("div", { className: "terms-header", onClick: () => onSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "tokens-remaining-header", onClick: () => onSort('tokensRemaining'), children: ["TOKENS REMAINING", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2("div", { className: "tooltip-header" })] })] }) }));
|
|
81325
81325
|
};
|
|
@@ -81409,7 +81409,7 @@ const BuyAgainRow = () => {
|
|
|
81409
81409
|
bond: bond.earnToken.symbol,
|
|
81410
81410
|
},
|
|
81411
81411
|
});
|
|
81412
|
-
}, sx: { position: 'absolute', top: '32px', left: '1px', width: 'calc(100% - 2px)' }, children: jsx$2(BondRow
|
|
81412
|
+
}, sx: { position: 'absolute', top: '32px', left: '1px', width: 'calc(100% - 2px)' }, children: jsx$2(BondRow, { bondAddress: (_b = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _b === void 0 ? void 0 : _b[bond === null || bond === void 0 ? void 0 : bond.chainId], bondChain: bond.chainId, billType: bond.billType, payoutToken: bond.earnToken, tag: (_c = bond.tags) === null || _c === void 0 ? void 0 : _c[0], bondSoldOut: isBondSoldOut(bond, SDKConfig.showLowValueBonds), trueBondPrices: bond === null || bond === void 0 ? void 0 : bond.trueBondPrices, minTier: bond === null || bond === void 0 ? void 0 : bond.minTier, vestingTermString: getVestingTermsString(bond), vestingCliffString: getVestingTermsTooltipString(bond), percentageAvailable: remainingPercentage(bond), remainingTokensString: remainingTokensString }, `${bondAddress}-${bond.chainId}`) })] }) })) : null;
|
|
81413
81413
|
};
|
|
81414
81414
|
|
|
81415
81415
|
const Bonds = () => {
|
|
@@ -81513,7 +81513,7 @@ const Bonds = () => {
|
|
|
81513
81513
|
const handleChangeFilterOption = useCallback((newOption) => {
|
|
81514
81514
|
setFilterOption(newOption);
|
|
81515
81515
|
}, []);
|
|
81516
|
-
return (jsxs(Flex$1, { className: "bonds-container", children: [jsx$2(CheckUrl$1, {}), jsx$2(BondsMenu
|
|
81516
|
+
return (jsxs(Flex$1, { className: "bonds-container", children: [jsx$2(CheckUrl$1, {}), 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: {
|
|
81517
81517
|
width: '100%',
|
|
81518
81518
|
height: '300px',
|
|
81519
81519
|
background: 'white2',
|
|
@@ -99793,83 +99793,15 @@ const BuyBondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }
|
|
|
99793
99793
|
return (jsx$2(Modal, { className: "modal", onDismiss: onDismiss, sx: { width: '400px' }, children: jsx$2(Flex, { sx: { width: '100%', maxWidth: '700px', mt: '-10px' }, children: jsx$2(BuyBond, { onDismiss: onDismiss, bondAddress: bondAddress, bondChain: bondChain, handlePurchasedBond: handlePurchasedBond }) }) }));
|
|
99794
99794
|
};
|
|
99795
99795
|
|
|
99796
|
-
const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
|
|
99797
|
-
// Hooks
|
|
99798
|
-
const SDKConfig = useSDKConfig();
|
|
99799
|
-
const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
|
|
99800
|
-
// State
|
|
99801
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
99802
|
-
// Handlers - Single selection only
|
|
99803
|
-
const handleSelection = (selectedChain) => {
|
|
99804
|
-
setChainFilterOption([selectedChain]);
|
|
99805
|
-
setIsOpen(false); // Close dropdown after selection
|
|
99806
|
-
};
|
|
99807
|
-
return (jsxs(Flex, { sx: { width: '100%', position: 'relative' }, children: [isOpen && (
|
|
99808
|
-
// Backdrop that closes the dropdown if a user clicks outside of it
|
|
99809
|
-
jsx$2(Flex, { sx: {
|
|
99810
|
-
background: 'transparent',
|
|
99811
|
-
position: 'fixed',
|
|
99812
|
-
top: 0,
|
|
99813
|
-
left: 0,
|
|
99814
|
-
width: '100vw',
|
|
99815
|
-
height: '100vh',
|
|
99816
|
-
zIndex: 1000,
|
|
99817
|
-
}, onClick: () => setIsOpen(false) })), jsxs(Flex, { sx: {
|
|
99818
|
-
background: 'white2',
|
|
99819
|
-
p: '6px',
|
|
99820
|
-
borderRadius: 'normal',
|
|
99821
|
-
cursor: 'pointer',
|
|
99822
|
-
alignItems: 'center',
|
|
99823
|
-
width: '100%',
|
|
99824
|
-
justifyContent: 'space-between',
|
|
99825
|
-
}, onClick: () => setIsOpen(!isOpen), className: "dropdown", children: [jsx$2(Flex, { sx: { borderRadius: '50px', overflow: 'hidden' }, children: jsx$2(Svg, { icon: NETWORK_ICONS[chainFilterOption[0]], width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontSize: '14px', fontWeight: 400, px: '10px' }, children: NETWORK_LABEL[parseInt(chainFilterOption[0])] || chainFilterOption[0] }), jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down' }) })] }), isOpen && (jsx$2(Flex, { sx: {
|
|
99826
|
-
flexDirection: ['column', 'column', 'column'],
|
|
99827
|
-
position: 'absolute',
|
|
99828
|
-
top: '45px',
|
|
99829
|
-
left: '0px',
|
|
99830
|
-
maxHeight: ['300px', '300px', '350px'],
|
|
99831
|
-
borderRadius: 'normal',
|
|
99832
|
-
background: 'white2',
|
|
99833
|
-
boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.5)',
|
|
99834
|
-
zIndex: 1001,
|
|
99835
|
-
}, children: [...chains].map((chainId) => {
|
|
99836
|
-
return (jsx$2(Flex, { sx: {
|
|
99837
|
-
borderRadius: 'normal',
|
|
99838
|
-
p: '5px 15px',
|
|
99839
|
-
minHeight: '40px',
|
|
99840
|
-
cursor: 'pointer',
|
|
99841
|
-
'&:hover': { bg: 'white3' },
|
|
99842
|
-
}, onClick: () => handleSelection(chainId.toString()), children: jsx$2(Flex, { sx: { width: '100%', alignItems: 'center', fontSize: '14px' }, children: jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mr: '8px', borderRadius: '50px', overflow: 'hidden' }, children: jsx$2(Svg, { icon: NETWORK_ICONS[chainId], width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: NETWORK_LABEL[chainId] })] }) }) }, chainId));
|
|
99843
|
-
}) }))] }));
|
|
99844
|
-
};
|
|
99845
|
-
|
|
99846
|
-
const BondFilters = ({ setChainFilterOption, chainFilterOption }) => {
|
|
99847
|
-
const { activeView } = useActiveView();
|
|
99848
|
-
return (jsx$2("div", { className: "network-filter", children: activeView === BondsViewOptions$1.BONDSMARKET && (jsx$2(NetworkFilter, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption })) }));
|
|
99849
|
-
};
|
|
99850
|
-
|
|
99851
99796
|
var BondsViewOptions$1;
|
|
99852
99797
|
(function (BondsViewOptions) {
|
|
99853
99798
|
BondsViewOptions["BONDSMARKET"] = "Bonds Market";
|
|
99854
99799
|
BondsViewOptions["YOURBONDS"] = "Your Bonds";
|
|
99855
99800
|
})(BondsViewOptions$1 || (BondsViewOptions$1 = {}));
|
|
99856
|
-
|
|
99801
|
+
({
|
|
99857
99802
|
[BondsViewOptions$1.BONDSMARKET]: 'GOO Sale',
|
|
99858
99803
|
[BondsViewOptions$1.YOURBONDS]: 'Your GOO',
|
|
99859
|
-
};
|
|
99860
|
-
const BondsMenu = ({ setChainFilterOption, chainFilterOption, handleToogle }) => {
|
|
99861
|
-
const { namingPreference } = useSDKConfig();
|
|
99862
|
-
const { activeView } = useActiveView();
|
|
99863
|
-
const toggleOptions = [BondsViewOptions$1.BONDSMARKET, BondsViewOptions$1.YOURBONDS].map((option) => TOGGLE_DISPLAY_TEXT[option]);
|
|
99864
|
-
const handleToggleWithMapping = (displayText) => {
|
|
99865
|
-
var _a;
|
|
99866
|
-
const enumValue = (_a = Object.entries(TOGGLE_DISPLAY_TEXT).find(([, text]) => text === displayText)) === null || _a === void 0 ? void 0 : _a[0];
|
|
99867
|
-
if (enumValue) {
|
|
99868
|
-
handleToogle(enumValue);
|
|
99869
|
-
}
|
|
99870
|
-
};
|
|
99871
|
-
return (jsxs("div", { className: "bonds-menu", children: [jsxs(Flex$1, { sx: { mb: '10px', justifyContent: 'space-between', width: '100%' }, children: [jsx$2(BondFilters, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption }), jsx$2(Flex$1, { sx: { width: ['260px', '260px', '300px', '300px'], ml: '10px' }, children: jsx$2(Toggle, { options: toggleOptions, activeOption: TOGGLE_DISPLAY_TEXT[activeView], handleToggle: handleToggleWithMapping }) })] }), jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container" }), activeView === BondsViewOptions$1.BONDSMARKET && (jsxs("div", { className: "headers-container", children: [jsx$2("div", { className: "discount-header", children: namingPreference.toUpperCase() }), jsx$2("div", { className: "terms-header", children: "TERMS" }), jsx$2(Button, { variant: "secondary", sx: { mr: '10px', opacity: 0, pointerEvents: 'none' }, children: "BUY" })] }))] })] }));
|
|
99872
|
-
};
|
|
99804
|
+
});
|
|
99873
99805
|
|
|
99874
99806
|
/*
|
|
99875
99807
|
* Basically this is a handler that controls which Modal is displayed to the user.
|
|
@@ -99942,282 +99874,6 @@ const CheckUrl = () => {
|
|
|
99942
99874
|
return jsx$2(Fragment$1, {});
|
|
99943
99875
|
};
|
|
99944
99876
|
|
|
99945
|
-
const ChainTitle = ({ chain, pt, hideTitles }) => {
|
|
99946
|
-
var _a;
|
|
99947
|
-
const isMobile = useIsMobile();
|
|
99948
|
-
return (jsxs(Flex, { id: `${NETWORK_LABEL[chain].toLowerCase().replace(/\s+/g, '')}`, className: "chaintitle", sx: {
|
|
99949
|
-
pt,
|
|
99950
|
-
pb: '10px',
|
|
99951
|
-
color: 'textDisabledButton',
|
|
99952
|
-
fontSize: '13px',
|
|
99953
|
-
fontWeight: 500,
|
|
99954
|
-
textTransform: 'uppercase',
|
|
99955
|
-
display: hideTitles ? 'none' : 'flex',
|
|
99956
|
-
width: '300px',
|
|
99957
|
-
alignItems: 'center',
|
|
99958
|
-
}, children: [NETWORK_LABEL[chain], " Chain", jsx$2(Flex, { sx: { ml: '7px' } }), ((_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" }) })] }))] }));
|
|
99959
|
-
};
|
|
99960
|
-
|
|
99961
|
-
const NETWORK_COLORS = {
|
|
99962
|
-
[main.ChainId.BSC]: '#F3BA2F4d',
|
|
99963
|
-
[main.ChainId.MAINNET]: '#627eea4d',
|
|
99964
|
-
[main.ChainId.MATIC]: '#8247e54d',
|
|
99965
|
-
[main.ChainId.LIGHTLINK]: '#6087ff4d',
|
|
99966
|
-
[main.ChainId.BASE]: '#0052ff4d',
|
|
99967
|
-
[main.ChainId.ARBITRUM]: '#289fef4d',
|
|
99968
|
-
[main.ChainId.LINEA]: '#ffffff4d',
|
|
99969
|
-
[main.ChainId.IOTA]: '#ffffff4d',
|
|
99970
|
-
[main.ChainId.GRAPHLINQ]: '#ded2ff4d',
|
|
99971
|
-
[main.ChainId.AVAX]: '#e743444d',
|
|
99972
|
-
[main.ChainId.BLAST]: '#fcfc034d',
|
|
99973
|
-
[main.ChainId.CROSSFI]: '#7c80844d',
|
|
99974
|
-
[main.ChainId.MONAD_TESTNET]: '#836EF94d',
|
|
99975
|
-
[main.ChainId.SONIC]: '#fb9a4c4d',
|
|
99976
|
-
[main.ChainId.BERACHAIN]: '#783e244d',
|
|
99977
|
-
[main.ChainId.KATANA]: '#068be34d',
|
|
99978
|
-
[main.ChainId.UNICHAIN]: '#f50db44d',
|
|
99979
|
-
};
|
|
99980
|
-
const TokenInfoAndName = ({ tokenSymbol, chain, tag, vestEnds, isHotBond, }) => {
|
|
99981
|
-
return (jsxs(Flex, { className: "tokeninfoname container", children: [jsx$2(Flex, { sx: {
|
|
99982
|
-
width: '125px',
|
|
99983
|
-
height: '100%',
|
|
99984
|
-
position: 'absolute',
|
|
99985
|
-
left: 0,
|
|
99986
|
-
top: 0,
|
|
99987
|
-
borderRadius: 'normal',
|
|
99988
|
-
background: isHotBond
|
|
99989
|
-
? 'transparent'
|
|
99990
|
-
: `linear-gradient(90deg, ${chain ? NETWORK_COLORS[chain] : '#FFFFFF33'} 0%, rgba(0,0,0,0) 75%)`,
|
|
99991
|
-
} }), jsx$2(Flex, { className: "tokeninfoname chain", children: jsx$2(Svg, { width: 20, height: 20, icon: chain ? NETWORK_ICONS[chain] : 'question' }) }), jsxs(Flex, { className: "tokeninfoname tokencontainer", sx: {
|
|
99992
|
-
marginTop: vestEnds ? ['10px', '10px', '10px', '0px'] : 0,
|
|
99993
|
-
maxWidth: ['175px', '175px', '140px', '190px', '190px'],
|
|
99994
|
-
}, children: [jsx$2(TokenImage, { symbol: tokenSymbol, size: 33 }), jsxs(Flex, { className: "tokeninfoname tokentext", children: [jsx$2(Flex, { sx: { justifyContent: 'space-between', width: '100%', alignItems: 'center' }, children: jsx$2(Text, { sx: { fontSize: ['12px', '12px', '14px', '16px'] }, children: tokenSymbol }) }), vestEnds && (jsx$2(Flex, { sx: { fontSize: '12px', fontWeight: 400, opacity: 0.6, lineHeight: '14px' }, children: vestEnds }))] })] }), jsx$2(Flex, { sx: {
|
|
99995
|
-
justifyContent: isHotBond ? 'center' : 'flex-start',
|
|
99996
|
-
alignItems: 'center',
|
|
99997
|
-
}, children: jsx$2(Flex, { sx: { display: isHotBond ? 'flex' : ['none', 'none', 'none', 'none', 'flex'] }, children: tag && jsx$2(ListTag, { text: tag === null || tag === void 0 ? void 0 : tag.toUpperCase() }) }) })] }));
|
|
99998
|
-
};
|
|
99999
|
-
|
|
100000
|
-
const BondRow = ({ bondAddress, bondChain, contractType, tag, bondSoldOut, discount, vestingTermString, vestingCliffString,
|
|
100001
|
-
// percentageAvailable,
|
|
100002
|
-
// remainingTokensString,
|
|
100003
|
-
}) => {
|
|
100004
|
-
const locationPath = window.location.pathname.replace('/', '');
|
|
100005
|
-
const payoutTokenSymbol = contractType.toLowerCase() === 'goo' ? 'GOO' : 'sGOO';
|
|
100006
|
-
// Modal
|
|
100007
|
-
const [openBuyModal] = useModal(jsx$2(ModalHandler, { bondAddress: bondAddress, bondChain: bondChain }), true, true, `buyBondModal-${bondAddress.toLowerCase()}-${bondChain}`);
|
|
100008
|
-
const handleOpenModal = () => {
|
|
100009
|
-
if (bondSoldOut)
|
|
100010
|
-
return;
|
|
100011
|
-
openBuyModal();
|
|
100012
|
-
if (typeof window !== 'undefined') {
|
|
100013
|
-
window.history.pushState({}, '', `${locationPath}?bondAddress=${bondAddress}&bondChain=${bondChain}`);
|
|
100014
|
-
}
|
|
100015
|
-
track({
|
|
100016
|
-
event: 'buyModalOpen',
|
|
100017
|
-
chain: bondChain,
|
|
100018
|
-
data: {
|
|
100019
|
-
cat: 'Row',
|
|
100020
|
-
bond: payoutTokenSymbol,
|
|
100021
|
-
bondChain: bondChain,
|
|
100022
|
-
},
|
|
100023
|
-
});
|
|
100024
|
-
};
|
|
100025
|
-
return (jsxs("div", { className: "bond-row" // Insert special campaign styles here
|
|
100026
|
-
, 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: payoutTokenSymbol, chain: bondChain, tag: tag }) }), jsxs("div", { className: "bond-info-columns", sx: { width: '55%' }, children: [jsxs("div", { className: `discount-column`, sx: { color: discount && 'success' }, children: [(Number(discount) * 100).toFixed(0), "%"] }), jsxs("div", { className: "terms-column", children: [getGooSaleVestingString(Number(vestingCliffString), Number(vestingTermString)), vestingCliffString && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: `${vestingCliffString} days cliff + ${vestingTermString} days linear vesting after TGE` }), 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(Button, { variant: "secondary", sx: { mr: '10px' }, children: "Buy" })] })] }, `${bondAddress}-${bondChain}`));
|
|
100027
|
-
};
|
|
100028
|
-
|
|
100029
|
-
const BANNER_INFO = {
|
|
100030
|
-
[main.ChainId.MONAD_TESTNET]: {
|
|
100031
|
-
title: 'Test and Play on Monad Testnet',
|
|
100032
|
-
subtitle: 'Explore Bonds on the Monad Testnet for free.',
|
|
100033
|
-
buttons: [
|
|
100034
|
-
{
|
|
100035
|
-
label: 'LEARN MORE',
|
|
100036
|
-
href: 'https://apebond.medium.com/apebond-integrates-testnet-bonds-paving-the-way-for-exciting-new-chains-3f62e2204746?source=social.tw',
|
|
100037
|
-
variant: variants.SECONDARY,
|
|
100038
|
-
},
|
|
100039
|
-
{ label: 'GET MON TOKENS', href: 'https://testnet.monad.xyz' },
|
|
100040
|
-
],
|
|
100041
|
-
background: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner_jpkg38.png',
|
|
100042
|
-
backgroundMobile: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner-mobile_y6xveu.png',
|
|
100043
|
-
logo: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/monad-logo_lkstid.png',
|
|
100044
|
-
},
|
|
100045
|
-
};
|
|
100046
|
-
const BannerTestnet = ({ chainId }) => {
|
|
100047
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
100048
|
-
return (jsxs("div", { className: "banner-container", sx: {
|
|
100049
|
-
backgroundImage: [
|
|
100050
|
-
`url(${(_a = BANNER_INFO[chainId]) === null || _a === void 0 ? void 0 : _a.backgroundMobile})`,
|
|
100051
|
-
`url(${(_b = BANNER_INFO[chainId]) === null || _b === void 0 ? void 0 : _b.backgroundMobile})`,
|
|
100052
|
-
`url(${(_c = BANNER_INFO[chainId]) === null || _c === void 0 ? void 0 : _c.backgroundMobile})`,
|
|
100053
|
-
`url(${(_d = BANNER_INFO[chainId]) === null || _d === void 0 ? void 0 : _d.background})`,
|
|
100054
|
-
`url(${(_e = BANNER_INFO[chainId]) === null || _e === void 0 ? void 0 : _e.background})`,
|
|
100055
|
-
],
|
|
100056
|
-
}, children: [jsxs("div", { className: "banner-logos", children: [jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/apebond-logo_vzt4dl.png", alt: "apebond-white-logo", style: { width: '100px' } }), jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/x-icono_va7sdu.png", alt: "x-white-logo" }), jsx$2("img", { src: `${(_f = BANNER_INFO[chainId]) === null || _f === void 0 ? void 0 : _f.logo}`, alt: "partner-logo" })] }), jsx$2("div", { className: "banner-title", children: (_g = BANNER_INFO[chainId]) === null || _g === void 0 ? void 0 : _g.title }), jsx$2("div", { className: "banner-subtitle", children: (_h = BANNER_INFO[chainId]) === null || _h === void 0 ? void 0 : _h.subtitle }), jsx$2("div", { className: "banner-actions", children: (_j = BANNER_INFO[chainId]) === null || _j === void 0 ? void 0 : _j.buttons.map((button, index) => (jsx$2(Button, { className: "action-button", onClick: () => window.open(button.href, '_blank'), variant: button.variant || variants.PRIMARY, children: button.label }, `banner-button-${index}`))) })] }, `banner-container-${chainId}`));
|
|
100057
|
-
};
|
|
100058
|
-
|
|
100059
|
-
const BondRowsWithTitle = ({ chain, bonds }) => {
|
|
100060
|
-
const key = chain;
|
|
100061
|
-
// const { data: saleInfo } = useSaleInfo()
|
|
100062
|
-
return (jsx$2(Flex$1, { className: "bondrowswithtitle", children: jsxs(AnimatePresence, { initial: false, children: [jsx$2(ChainTitle, { chain: chain, pt: '5px', hideTitles: bonds.length <= 0 }), bonds.length > 0 && (jsxs(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
|
|
100063
|
-
position: 'relative',
|
|
100064
|
-
overflow: 'hidden',
|
|
100065
|
-
width: '100%',
|
|
100066
|
-
marginTop: '0px',
|
|
100067
|
-
}, className: "bonds-card-container", children: [TESTNET_CHAINS.includes(chain) && jsx$2(BannerTestnet, { chainId: chain }), bonds === null || bonds === void 0 ? void 0 : bonds.map((bond, index) => {
|
|
100068
|
-
return (jsx$2(BondRow, { bondAddress: bond.address, bondChain: chain, contractType: bond.type, vestingTermString: bond.vestingLinear.toString(), vestingCliffString: bond.vestingCliff.toString(),
|
|
100069
|
-
// percentageAvailable={saleInfo?.currentStage?.remainingPercentage ?? 50}
|
|
100070
|
-
// remainingTokensString={`${saleInfo?.currentStage?.remainingPercentage?.toFixed(2)} %`}
|
|
100071
|
-
discount: bond.discount.toString() }, `${bond.address}-${chain}-${index}`));
|
|
100072
|
-
})] }, key))] }) }, key));
|
|
100073
|
-
};
|
|
100074
|
-
|
|
100075
|
-
const BondRowsByChain = ({ contractsByChain }) => {
|
|
100076
|
-
var _a;
|
|
100077
|
-
const SDKConfig = useSDKConfig();
|
|
100078
|
-
const validatedChains = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains) === null || _a === void 0 ? void 0 : _a.filter((chain) => MAINNET_CHAINS.includes(chain));
|
|
100079
|
-
if (!contractsByChain) {
|
|
100080
|
-
return null;
|
|
100081
|
-
}
|
|
100082
|
-
return (jsx$2(Flex$1, { className: "bondrowsbychain", children: validatedChains === null || validatedChains === void 0 ? void 0 : validatedChains.map((chain) => {
|
|
100083
|
-
var _a;
|
|
100084
|
-
const bonds = (_a = contractsByChain[chain]) !== null && _a !== void 0 ? _a : [];
|
|
100085
|
-
return jsx$2(BondRowsWithTitle, { chain: chain, bonds: bonds }, chain);
|
|
100086
|
-
}) }));
|
|
100087
|
-
};
|
|
100088
|
-
|
|
100089
|
-
const ProgressBar = ({ saleInfo }) => {
|
|
100090
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
100091
|
-
const nextStageNumber = (_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _a === void 0 ? void 0 : _a.stageNumber;
|
|
100092
|
-
const stage = (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) && nextStageNumber
|
|
100093
|
-
? saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages.find((stage) => stage.stageNumber === nextStageNumber - 1)
|
|
100094
|
-
: saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage;
|
|
100095
|
-
const previousStagesBilled = useMemo(() => {
|
|
100096
|
-
var _a, _b, _c;
|
|
100097
|
-
const currentStageNumber = (_a = stage === null || stage === void 0 ? void 0 : stage.stageNumber) !== null && _a !== void 0 ? _a : 1;
|
|
100098
|
-
const previousStages = (_c = (_b = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages) === null || _b === void 0 ? void 0 : _b.filter((s) => s.stageNumber < currentStageNumber)) !== null && _c !== void 0 ? _c : [];
|
|
100099
|
-
const totalPreviousSats = previousStages.reduce((sum, s) => { var _a; return sum + ((_a = s.totalBilledSats) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
100100
|
-
return totalPreviousSats / 100000000;
|
|
100101
|
-
}, [saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages, stage === null || stage === void 0 ? void 0 : stage.stageNumber]);
|
|
100102
|
-
const baseAmount = 100 + previousStagesBilled;
|
|
100103
|
-
const hardCap = useMemo(() => { var _a; return ((_a = stage === null || stage === void 0 ? void 0 : stage.hardCapSats) !== null && _a !== void 0 ? _a : 0) / 100000000 + baseAmount; }, [stage, baseAmount]);
|
|
100104
|
-
const billed = useMemo(() => { var _a; return ((_a = stage === null || stage === void 0 ? void 0 : stage.totalBilledSats) !== null && _a !== void 0 ? _a : 0) / 100000000 + baseAmount; }, [stage, baseAmount]);
|
|
100105
|
-
const isTimeProgress = true;
|
|
100106
|
-
const [timeLeft, setTimeLeft] = useState('');
|
|
100107
|
-
const [timeProgress, setTimeProgress] = useState(0);
|
|
100108
|
-
const value = useMemo(() => (timeProgress ), [isTimeProgress, timeProgress, billed, hardCap]);
|
|
100109
|
-
const stageNumber = useMemo(() => { var _a; return (_a = stage === null || stage === void 0 ? void 0 : stage.stageNumber) !== null && _a !== void 0 ? _a : 1; }, [stage]);
|
|
100110
|
-
const contractsByChain = (_c = (_b = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.contractsByChain;
|
|
100111
|
-
const saleContracts = contractsByChain === null || contractsByChain === void 0 ? void 0 : contractsByChain[main.ChainId.BASE];
|
|
100112
|
-
const saleData = saleContracts === null || saleContracts === void 0 ? void 0 : saleContracts[0];
|
|
100113
|
-
// Get BTC price
|
|
100114
|
-
const btcPriceData = useCurrencyPrice(saleData === null || saleData === void 0 ? void 0 : saleData.principalToken, main.ChainId.BASE);
|
|
100115
|
-
const btcPrice = (_d = btcPriceData === null || btcPriceData === void 0 ? void 0 : btcPriceData.price) !== null && _d !== void 0 ? _d : 0;
|
|
100116
|
-
const totalBilledBTC = ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.totalBilled) ? (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.totalBilled) / 100000000 : 0) + 100;
|
|
100117
|
-
const totalBilledUSD = (totalBilledBTC * btcPrice).toLocaleString('en-US', {
|
|
100118
|
-
style: 'currency',
|
|
100119
|
-
currency: 'USD',
|
|
100120
|
-
maximumFractionDigits: 0,
|
|
100121
|
-
});
|
|
100122
|
-
// Determine if we're in refund or TGE period
|
|
100123
|
-
const isRefundPeriod = (_e = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod) !== null && _e !== void 0 ? _e : false;
|
|
100124
|
-
const isTGEPeriod = ((_f = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _f === void 0 ? void 0 : _f.key) === 'TGE';
|
|
100125
|
-
const endTime = useMemo(() => {
|
|
100126
|
-
const timestamp = stage === null || stage === void 0 ? void 0 : stage.endTime;
|
|
100127
|
-
if (!timestamp)
|
|
100128
|
-
return 'N/A';
|
|
100129
|
-
// endTime is a Unix timestamp in seconds, multiply by 1000 for milliseconds
|
|
100130
|
-
return new Date(timestamp * 1000).toLocaleString('en-US', {
|
|
100131
|
-
timeZone: 'UTC',
|
|
100132
|
-
hour12: false,
|
|
100133
|
-
month: 'long',
|
|
100134
|
-
day: 'numeric',
|
|
100135
|
-
hour: '2-digit',
|
|
100136
|
-
minute: '2-digit',
|
|
100137
|
-
});
|
|
100138
|
-
}, [stage]);
|
|
100139
|
-
useEffect(() => {
|
|
100140
|
-
const calculateTimeLeft = () => {
|
|
100141
|
-
const startTimestamp = stage === null || stage === void 0 ? void 0 : stage.startTime;
|
|
100142
|
-
const endTimestamp = stage === null || stage === void 0 ? void 0 : stage.endTime;
|
|
100143
|
-
if (!endTimestamp || !startTimestamp) {
|
|
100144
|
-
setTimeLeft('');
|
|
100145
|
-
setTimeProgress(0);
|
|
100146
|
-
return;
|
|
100147
|
-
}
|
|
100148
|
-
const now = Math.floor(Date.now() / 1000);
|
|
100149
|
-
const diff = endTimestamp - now;
|
|
100150
|
-
const totalDuration = endTimestamp - startTimestamp;
|
|
100151
|
-
const elapsed = now - startTimestamp;
|
|
100152
|
-
const progress = Math.min(100, Math.max(0, (elapsed / totalDuration) * 100));
|
|
100153
|
-
setTimeProgress(progress);
|
|
100154
|
-
if (diff <= 0) {
|
|
100155
|
-
setTimeLeft('Ended');
|
|
100156
|
-
return;
|
|
100157
|
-
}
|
|
100158
|
-
const days = Math.floor(diff / 86400);
|
|
100159
|
-
const hours = Math.floor((diff % 86400) / 3600);
|
|
100160
|
-
const minutes = Math.floor((diff % 3600) / 60);
|
|
100161
|
-
setTimeLeft(`${days}d, ${hours}h, ${minutes}m left`);
|
|
100162
|
-
};
|
|
100163
|
-
calculateTimeLeft();
|
|
100164
|
-
const interval = setInterval(calculateTimeLeft, 60000);
|
|
100165
|
-
return () => clearInterval(interval);
|
|
100166
|
-
}, [stage === null || stage === void 0 ? void 0 : stage.startTime, stage === null || stage === void 0 ? void 0 : stage.endTime]);
|
|
100167
|
-
const nextStageStartTime = useMemo(() => {
|
|
100168
|
-
var _a, _b;
|
|
100169
|
-
return ((_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _a === void 0 ? void 0 : _a.startTime)
|
|
100170
|
-
? new Date(((_b = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _b === void 0 ? void 0 : _b.startTime) * 1000).toLocaleString('en-US', {
|
|
100171
|
-
timeZone: 'UTC',
|
|
100172
|
-
hour12: false,
|
|
100173
|
-
month: 'long',
|
|
100174
|
-
day: 'numeric',
|
|
100175
|
-
hour: '2-digit',
|
|
100176
|
-
minute: '2-digit',
|
|
100177
|
-
})
|
|
100178
|
-
: 'N/A';
|
|
100179
|
-
}, [saleInfo]);
|
|
100180
|
-
return (jsxs(Fragment$1, { children: [jsxs(Flex$1, { sx: { alignItems: 'end', justifyContent: 'space-between', flexDirection: 'row', mt: '1rem' }, children: [jsxs(Flex$1, { sx: { flexDirection: 'column', width: '250px', alignItems: 'start' }, children: [(jsxs(Fragment$1, { children: [jsx$2(Text, { sx: {
|
|
100181
|
-
fontSize: '14px',
|
|
100182
|
-
fontWeight: '700',
|
|
100183
|
-
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
100184
|
-
mb: '0.2rem',
|
|
100185
|
-
}, children: "Total Raised" }), jsxs(Flex$1, { sx: { flexDirection: 'row', alignItems: 'center' }, children: [jsx$2(Text, { sx: { fontSize: '22px', fontWeight: '700' }, children: `${totalBilledBTC.toFixed(0)} BTC` }), jsx$2(Text, { sx: { fontSize: '14px', fontWeight: '400', ml: '10px' }, children: `(${totalBilledUSD})` })] })] })), (jsxs(Fragment$1, { children: [jsx$2(Text, { sx: {
|
|
100186
|
-
fontSize: '14px',
|
|
100187
|
-
fontWeight: '700',
|
|
100188
|
-
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
100189
|
-
mb: '0.2rem',
|
|
100190
|
-
mt: '1rem',
|
|
100191
|
-
}, children: isRefundPeriod ? 'Refund Period' : 'Sale' }), jsx$2(Text, { sx: { fontSize: '22px', fontWeight: '700' }, children: `${timeLeft}` })] })) ] }), jsx$2(Text, { sx: {
|
|
100192
|
-
fontSize: '12px',
|
|
100193
|
-
fontWeight: '400',
|
|
100194
|
-
textAlign: 'right',
|
|
100195
|
-
ml: '10px',
|
|
100196
|
-
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
100197
|
-
}, children: (stage === null || stage === void 0 ? void 0 : stage.hasEnded)
|
|
100198
|
-
? ((_g = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _g === void 0 ? void 0 : _g.key) === 'refund'
|
|
100199
|
-
? 'Refund Period starts: ' + nextStageStartTime + ' UTC'
|
|
100200
|
-
: ((_h = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _h === void 0 ? void 0 : _h.key) === 'TGE'
|
|
100201
|
-
? 'TGE starts: ' + nextStageStartTime + ' UTC'
|
|
100202
|
-
: 'Stage ' + nextStageNumber + ' starts: ' + nextStageStartTime + ' UTC'
|
|
100203
|
-
: isRefundPeriod
|
|
100204
|
-
? 'Refund Period Ends: ' + endTime + ' UTC'
|
|
100205
|
-
: isTGEPeriod
|
|
100206
|
-
? 'TGE Ends: ' + endTime + ' UTC'
|
|
100207
|
-
: 'Stage ' + stageNumber + ' Ends: ' + endTime + ' UTC' })] }), jsx$2(Flex$1, { sx: { width: ['100%'], alignItems: 'center', flexDirection: 'row', my: '1rem' }, children: jsx$2(Box$1, { style: {
|
|
100208
|
-
width: '100%',
|
|
100209
|
-
height: '11px',
|
|
100210
|
-
backgroundColor: 'var(--theme-ui-colors-white4)',
|
|
100211
|
-
borderRadius: '10px',
|
|
100212
|
-
overflow: 'hidden',
|
|
100213
|
-
}, children: jsx$2(Box$1, { style: {
|
|
100214
|
-
width: `${value <= 3 ? 3 : value}%`,
|
|
100215
|
-
borderRadius: '10px',
|
|
100216
|
-
height: '100%',
|
|
100217
|
-
background: 'linear-gradient(90deg, #312E7A 0%,#5C4FAE 33%,#AD6568 66%, #AD6E66 100%)',
|
|
100218
|
-
} }) }) })] }));
|
|
100219
|
-
};
|
|
100220
|
-
|
|
100221
99877
|
const YourGoo = ({ yourGoo, isLoading, isFetching, }) => {
|
|
100222
99878
|
var _a, _b, _c;
|
|
100223
99879
|
const { data: saleInfo } = useSaleInfo();
|
|
@@ -100855,19 +100511,17 @@ var BondsViewOptions;
|
|
|
100855
100511
|
BondsViewOptions["YOURBONDS"] = "Your Bonds";
|
|
100856
100512
|
})(BondsViewOptions || (BondsViewOptions = {}));
|
|
100857
100513
|
const GooSale = () => {
|
|
100858
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
100514
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
100859
100515
|
// Fetch data
|
|
100860
100516
|
const { data: chainFilterOption, setChainFilterOption } = useChainFilterOption();
|
|
100861
100517
|
const { data: saleInfo, isLoading: isLoadingSaleInfo } = useSaleInfo();
|
|
100862
100518
|
const currentStageNumber = (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod)
|
|
100863
100519
|
? ((_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _a === void 0 ? void 0 : _a.stageNumber) || 1
|
|
100864
100520
|
: ((_b = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _b === void 0 ? void 0 : _b.stageNumber) || 1;
|
|
100865
|
-
const { activeView, handleToogle } = useActiveView(true);
|
|
100866
100521
|
const { address } = useAccount();
|
|
100867
100522
|
const { data: yourGoo, isLoading, isFetching } = useYourGoo(address);
|
|
100868
100523
|
const userParticipated = address && !isLoading && !isFetching && ((yourGoo === null || yourGoo === void 0 ? void 0 : yourGoo.depositToGooBond) !== '0' || (yourGoo === null || yourGoo === void 0 ? void 0 : yourGoo.depositToSGooBond) !== '0');
|
|
100869
100524
|
const chainId = useChainId();
|
|
100870
|
-
const { switchChain } = useSwitchChain();
|
|
100871
100525
|
const { data: elegibleForSale, cbBTCBalance, isCbBTCBalanceLoading, cbBTCBalanceChecked, checkCbBTCBalance, addToWhitelist, isAddingToWhitelist, addToWhitelistSuccess, addToWhitelistError, } = useGooEligibility();
|
|
100872
100526
|
const [checkButtonPushed, setCheckButtonPushed] = useState(false);
|
|
100873
100527
|
const whitelisted = checkButtonPushed ? elegibleForSale : undefined;
|
|
@@ -100880,17 +100534,20 @@ const GooSale = () => {
|
|
|
100880
100534
|
}
|
|
100881
100535
|
});
|
|
100882
100536
|
const currentStageSoldOut = ((_c = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _c === void 0 ? void 0 : _c.progressPercentage) === 100;
|
|
100883
|
-
// Wrapper function that sets chain filter AND switches wallet chain
|
|
100884
|
-
const handleChainFilterChange = useCallback(
|
|
100885
|
-
|
|
100886
|
-
|
|
100887
|
-
|
|
100888
|
-
|
|
100889
|
-
|
|
100890
|
-
|
|
100891
|
-
|
|
100892
|
-
|
|
100893
|
-
}
|
|
100537
|
+
// // Wrapper function that sets chain filter AND switches wallet chain
|
|
100538
|
+
// const handleChainFilterChange = useCallback(
|
|
100539
|
+
// (newChainFilter: string[]) => {
|
|
100540
|
+
// setChainFilterOption(newChainFilter)
|
|
100541
|
+
// // Switch wallet to the selected chain if it's different from current
|
|
100542
|
+
// if (newChainFilter.length > 0 && switchChain) {
|
|
100543
|
+
// const targetChainId = parseInt(newChainFilter[0])
|
|
100544
|
+
// if (targetChainId !== chainId) {
|
|
100545
|
+
// switchChain({ chainId: targetChainId })
|
|
100546
|
+
// }
|
|
100547
|
+
// }
|
|
100548
|
+
// },
|
|
100549
|
+
// [setChainFilterOption, switchChain, chainId],
|
|
100550
|
+
// )
|
|
100894
100551
|
// Sync chain filter with connected chain
|
|
100895
100552
|
useEffect(() => {
|
|
100896
100553
|
if (chainId) {
|
|
@@ -100901,21 +100558,19 @@ const GooSale = () => {
|
|
|
100901
100558
|
}
|
|
100902
100559
|
}
|
|
100903
100560
|
}, [chainId, chainFilterOption, setChainFilterOption]);
|
|
100904
|
-
// Filter contracts by chain
|
|
100905
|
-
const filteredContractsByChain = useMemo(() => {
|
|
100906
|
-
|
|
100907
|
-
|
|
100908
|
-
|
|
100909
|
-
|
|
100910
|
-
|
|
100911
|
-
|
|
100912
|
-
|
|
100913
|
-
|
|
100914
|
-
|
|
100915
|
-
|
|
100916
|
-
|
|
100917
|
-
return filtered;
|
|
100918
|
-
}, [(_d = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _d === void 0 ? void 0 : _d.contractsByChain, chainFilterOption]);
|
|
100561
|
+
// // Filter contracts by chain
|
|
100562
|
+
// const filteredContractsByChain = useMemo(() => {
|
|
100563
|
+
// const contractsByChain = saleInfo?.currentStage?.contractsByChain
|
|
100564
|
+
// if (!contractsByChain) return undefined
|
|
100565
|
+
// // Filter by selected chains
|
|
100566
|
+
// const filtered: Record<number, GooSaleContractData[]> = {}
|
|
100567
|
+
// Object.entries(contractsByChain).forEach(([chainId, contracts]) => {
|
|
100568
|
+
// if (chainFilterOption?.includes(chainId)) {
|
|
100569
|
+
// filtered[parseInt(chainId)] = contracts
|
|
100570
|
+
// }
|
|
100571
|
+
// })
|
|
100572
|
+
// return filtered
|
|
100573
|
+
// }, [saleInfo?.currentStage?.contractsByChain, chainFilterOption])
|
|
100919
100574
|
// Dynamic title based on current period (hidden during refund period)
|
|
100920
100575
|
const pageTitle = useMemo(() => {
|
|
100921
100576
|
var _a;
|
|
@@ -100924,15 +100579,15 @@ const GooSale = () => {
|
|
|
100924
100579
|
if (((_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _a === void 0 ? void 0 : _a.key) === 'TGE')
|
|
100925
100580
|
return 'GOO Token Generation Event';
|
|
100926
100581
|
return 'Buy GOO at a discount';
|
|
100927
|
-
}, [saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod, (
|
|
100582
|
+
}, [saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod, (_d = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _d === void 0 ? void 0 : _d.key]);
|
|
100928
100583
|
return (jsxs(Flex, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), pageTitle && (jsx$2(Flex, { sx: { justifyContent: 'center', alignItems: 'center', width: '100%' }, children: jsx$2(Text, { sx: { fontSize: '24px', fontWeight: 700, opacity: '0.9' }, children: pageTitle }) })), ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) || currentStageSoldOut) &&
|
|
100929
100584
|
(saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) &&
|
|
100930
100585
|
!isLoadingSaleInfo &&
|
|
100931
|
-
!(saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isSaleEnded) && (jsxs(Flex, { sx: { width: '100%', justifyContent: 'center', mt: '40px', flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Text, { sx: { fontSize: '20px', fontWeight: 'bold', mb: '20px' }, children: [((
|
|
100586
|
+
!(saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isSaleEnded) && (jsxs(Flex, { sx: { width: '100%', justifyContent: 'center', mt: '40px', flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Text, { sx: { fontSize: '20px', fontWeight: 'bold', mb: '20px' }, children: [((_e = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _e === void 0 ? void 0 : _e.key) === 'refund'
|
|
100932
100587
|
? 'Refund Period '
|
|
100933
|
-
: ((
|
|
100588
|
+
: ((_f = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _f === void 0 ? void 0 : _f.key) === 'TGE'
|
|
100934
100589
|
? 'TGE '
|
|
100935
|
-
: 'Stage ' + ((
|
|
100590
|
+
: 'Stage ' + ((_g = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _g === void 0 ? void 0 : _g.stageNumber) + ' ', "starts in:"] }), jsx$2(CountdownTimer, { targetTime: ((_h = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _h === void 0 ? void 0 : _h.startTime) || 0 }), !(((_j = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _j === void 0 ? void 0 : _j.key) === 'refund' || ((_k = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _k === void 0 ? void 0 : _k.key) === 'TGE') ? (jsxs(Fragment$1, { children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center', mt: '30px' }, children: [address && (jsxs(Flex, { sx: {
|
|
100936
100591
|
mr: '1rem',
|
|
100937
100592
|
p: '10px',
|
|
100938
100593
|
borderRadius: 'normal',
|
|
@@ -100968,13 +100623,11 @@ const GooSale = () => {
|
|
|
100968
100623
|
px: '12%',
|
|
100969
100624
|
pt: ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) || currentStageSoldOut) && (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) ? '4rem' : '1rem',
|
|
100970
100625
|
pb: '4rem',
|
|
100971
|
-
}, children: [jsx$2(StepBubble, { number: 1, title: 'STAGE 1', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 2, title: 'STAGE 2', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 3, title: 'REFUND', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 4, title: 'TGE', currentStep: currentStageNumber, loading: false, hideBar: true })] }), jsx$2(Divider, { sx: { width: '100%', height: '2px', backgroundColor: 'white2' } }),
|
|
100626
|
+
}, children: [jsx$2(StepBubble, { number: 1, title: 'STAGE 1', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 2, title: 'STAGE 2', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 3, title: 'REFUND', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 4, title: 'TGE', currentStep: currentStageNumber, loading: false, hideBar: true })] }), jsx$2(Divider, { sx: { width: '100%', height: '2px', backgroundColor: 'white2' } }), (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod) ? (
|
|
100972
100627
|
// Refund period - show refund view for ALL chains
|
|
100973
|
-
jsx$2(RefundView, {})) :
|
|
100974
|
-
// Active sale period - show normal bonds market / your goo tabs
|
|
100975
|
-
jsxs(Fragment$1, { children: [jsx$2(BondsMenu, { setChainFilterOption: handleChainFilterChange, chainFilterOption: chainFilterOption, handleToogle: handleToogle }), activeView === BondsViewOptions.BONDSMARKET && filteredContractsByChain && !isLoadingSaleInfo ? (jsx$2(BondRowsByChain, { contractsByChain: filteredContractsByChain })) : activeView === BondsViewOptions.YOURBONDS && !isLoadingSaleInfo ? (jsx$2(YourGoo, { yourGoo: yourGoo, isLoading: isLoading, isFetching: isFetching })) : (jsx$2(Fragment$1, {}))] })) : userParticipated ? (
|
|
100628
|
+
jsx$2(RefundView, {})) : userParticipated ? (
|
|
100976
100629
|
// Break period but user has participated - show their goo
|
|
100977
|
-
|
|
100630
|
+
jsx$2(Fragment$1, { children: jsx$2(YourGoo, { yourGoo: yourGoo, isLoading: isLoading, isFetching: isFetching }) })) : (jsx$2(Fragment$1, {}))] }));
|
|
100978
100631
|
};
|
|
100979
100632
|
|
|
100980
100633
|
const GooSaleWithProviders = (props) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export declare enum BondsViewOptions {
|
|
3
2
|
BONDSMARKET = "Bonds Market",
|
|
4
3
|
YOURBONDS = "Your Bonds"
|
|
5
4
|
}
|
|
6
|
-
declare const GooSale: () =>
|
|
5
|
+
declare const GooSale: () => import("react").JSX.Element;
|
|
7
6
|
export default GooSale;
|