@goodaofi/bonds-sdk 3.0.168 → 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 +96 -417
- package/dist/state/useSDKConfig.d.ts +2 -0
- 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: {
|
|
@@ -70587,16 +70587,42 @@ function useCurrencyPrice(currency, chainId) {
|
|
|
70587
70587
|
}
|
|
70588
70588
|
return currency;
|
|
70589
70589
|
}, [currency, chainId]);
|
|
70590
|
+
// TEMPORARY: GOO/sGOO price override — controlled via SDKConfig.useGooPriceOverride
|
|
70591
|
+
const SDKConfig = useSDKConfig();
|
|
70592
|
+
const GOO_SATS_PRICE = 4;
|
|
70593
|
+
const isGooToken = (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.useGooPriceOverride) &&
|
|
70594
|
+
currency &&
|
|
70595
|
+
currency !== 'NATIVE' &&
|
|
70596
|
+
(currency.symbol === 'GOO' || currency.symbol === 'sGOO');
|
|
70597
|
+
const btcPrice = useMemo(() => {
|
|
70598
|
+
var _a, _b;
|
|
70599
|
+
if (!isGooToken || !tokenPrices)
|
|
70600
|
+
return undefined;
|
|
70601
|
+
const btcToken = BTC_TOKENS[chainId];
|
|
70602
|
+
const btcAddr = (_a = btcToken === null || btcToken === void 0 ? void 0 : btcToken.address) === null || _a === void 0 ? void 0 : _a[chainId];
|
|
70603
|
+
return (_b = tokenPrices.find((tp) => { var _a; return tp.chainId === chainId && ((_a = tp.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (btcAddr === null || btcAddr === void 0 ? void 0 : btcAddr.toLowerCase()); })) === null || _b === void 0 ? void 0 : _b.price;
|
|
70604
|
+
}, [isGooToken, tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length, chainId]);
|
|
70590
70605
|
const token = currencyForPrice === 'NATIVE' && chainId ? WNATIVE[chainId] : currencyForPrice;
|
|
70591
70606
|
const tokenAddress = (_a = token === null || token === void 0 ? void 0 : token.address) === null || _a === void 0 ? void 0 : _a[chainId];
|
|
70592
|
-
return useMemo(() =>
|
|
70593
|
-
|
|
70594
|
-
|
|
70595
|
-
|
|
70596
|
-
|
|
70597
|
-
|
|
70607
|
+
return useMemo(() => {
|
|
70608
|
+
// TEMPORARY: Return synthetic price for GOO/sGOO
|
|
70609
|
+
if (isGooToken && btcPrice) {
|
|
70610
|
+
return {
|
|
70611
|
+
symbol: currency.symbol,
|
|
70612
|
+
address: tokenAddress,
|
|
70613
|
+
price: (GOO_SATS_PRICE / 100000000) * btcPrice,
|
|
70614
|
+
chainId: chainId,
|
|
70615
|
+
};
|
|
70616
|
+
}
|
|
70617
|
+
return tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.find((tokenPrice) => {
|
|
70618
|
+
var _a;
|
|
70619
|
+
return chainId &&
|
|
70620
|
+
tokenPrice.chainId === chainId &&
|
|
70621
|
+
((_a = tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (tokenAddress === null || tokenAddress === void 0 ? void 0 : tokenAddress.toLowerCase());
|
|
70622
|
+
});
|
|
70623
|
+
},
|
|
70598
70624
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
70599
|
-
[tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length, tokenAddress, chainId]);
|
|
70625
|
+
[tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length, tokenAddress, chainId, isGooToken, btcPrice]);
|
|
70600
70626
|
}
|
|
70601
70627
|
|
|
70602
70628
|
const remove0xPrefix = (str) => {
|
|
@@ -71302,7 +71328,7 @@ const UserBondRow = ({ bill }) => {
|
|
|
71302
71328
|
const lastBlockTimestamp = parseInt((_e = bill === null || bill === void 0 ? void 0 : bill.lastBlockTimestamp) !== null && _e !== void 0 ? _e : '0');
|
|
71303
71329
|
const isPendingCliff = vestingCliff ? currentTime - lastBlockTimestamp < vestingCliff : false;
|
|
71304
71330
|
const cliffCountdown = getTimePeriods(lastBlockTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
|
|
71305
|
-
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: {
|
|
71306
71332
|
opacity: 0.8,
|
|
71307
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) => {
|
|
71308
71334
|
var _a;
|
|
@@ -74240,7 +74266,7 @@ const PreTgeUserRow = ({ userBond, isGooSale }) => {
|
|
|
74240
74266
|
const claimableUSD = claimableAmount * ((_v = userBond.initPrice) !== null && _v !== void 0 ? _v : 0);
|
|
74241
74267
|
const pendingAmount = hasRedeemed ? payout : depositAmount / truePricePaid;
|
|
74242
74268
|
const pendingUSD = pendingAmount * ((_w = userBond === null || userBond === void 0 ? void 0 : userBond.earnTokenPrice) !== null && _w !== void 0 ? _w : 0);
|
|
74243
|
-
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: {
|
|
74244
74270
|
opacity: 0.8,
|
|
74245
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 }) })] })] }));
|
|
74246
74272
|
};
|
|
@@ -79745,7 +79771,7 @@ const BonusComponent = ({ trueBondPrices, minTier, bonus, airdropTooltip, toolti
|
|
|
79745
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' } }) }) }))] })) }));
|
|
79746
79772
|
};
|
|
79747
79773
|
|
|
79748
|
-
const ProgressBar
|
|
79774
|
+
const ProgressBar = ({ value }) => {
|
|
79749
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: {
|
|
79750
79776
|
width: `${value <= 3 ? 3 : value}%`,
|
|
79751
79777
|
} }) }) }));
|
|
@@ -79813,7 +79839,7 @@ const BondCards$2 = ({ bondData }) => {
|
|
|
79813
79839
|
borderBottomRightRadius: 'normal',
|
|
79814
79840
|
borderBottomLeftRadius: 'normal',
|
|
79815
79841
|
},
|
|
79816
|
-
}, 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: {
|
|
79817
79843
|
width: '127px',
|
|
79818
79844
|
height: '25px',
|
|
79819
79845
|
flexDirection: 'column',
|
|
@@ -80898,7 +80924,7 @@ const BonusContainer = ({ trueBondPrices, minTier, bonus, airdropTooltip, toolti
|
|
|
80898
80924
|
return (jsx$2("div", { className: `discount-column`, children: jsx$2(BonusComponent, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip, tooltipPosition: isMobile ? tooltipPosition : 'bottomLeft' }) }));
|
|
80899
80925
|
};
|
|
80900
80926
|
|
|
80901
|
-
const BondRow
|
|
80927
|
+
const BondRow = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, }) => {
|
|
80902
80928
|
var _a, _b, _c;
|
|
80903
80929
|
const locationPath = window.location.pathname.replace('/', '');
|
|
80904
80930
|
// Modal
|
|
@@ -80927,7 +80953,7 @@ const BondRow$1 = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSol
|
|
|
80927
80953
|
});
|
|
80928
80954
|
};
|
|
80929
80955
|
return (jsxs("div", { className: "bond-row" // Insert special campaign styles here
|
|
80930
|
-
, 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: {
|
|
80931
80957
|
width: '127px',
|
|
80932
80958
|
height: '25px',
|
|
80933
80959
|
flexDirection: 'column',
|
|
@@ -80953,7 +80979,7 @@ const HotBondCard = ({ bond }) => {
|
|
|
80953
80979
|
},
|
|
80954
80980
|
});
|
|
80955
80981
|
};
|
|
80956
|
-
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` : '-' })] })] })] }) }));
|
|
80957
80983
|
};
|
|
80958
80984
|
|
|
80959
80985
|
function useHotBondContracts() {
|
|
@@ -81045,7 +81071,7 @@ const HotBondCards = () => {
|
|
|
81045
81071
|
}) })] })] }));
|
|
81046
81072
|
};
|
|
81047
81073
|
|
|
81048
|
-
const BANNER_INFO
|
|
81074
|
+
const BANNER_INFO = {
|
|
81049
81075
|
[main.ChainId.MONAD_TESTNET]: {
|
|
81050
81076
|
title: 'Test and Play on Monad Testnet',
|
|
81051
81077
|
subtitle: 'Explore Bonds on the Monad Testnet for free.',
|
|
@@ -81062,20 +81088,20 @@ const BANNER_INFO$1 = {
|
|
|
81062
81088
|
logo: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/monad-logo_lkstid.png',
|
|
81063
81089
|
},
|
|
81064
81090
|
};
|
|
81065
|
-
const BannerTestnet
|
|
81091
|
+
const BannerTestnet = ({ chainId }) => {
|
|
81066
81092
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
81067
81093
|
return (jsxs("div", { className: "banner-container", sx: {
|
|
81068
81094
|
backgroundImage: [
|
|
81069
|
-
`url(${(_a = BANNER_INFO
|
|
81070
|
-
`url(${(_b = BANNER_INFO
|
|
81071
|
-
`url(${(_c = BANNER_INFO
|
|
81072
|
-
`url(${(_d = BANNER_INFO
|
|
81073
|
-
`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})`,
|
|
81074
81100
|
],
|
|
81075
|
-
}, 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}`));
|
|
81076
81102
|
};
|
|
81077
81103
|
|
|
81078
|
-
const BondRowsWithTitle
|
|
81104
|
+
const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
|
|
81079
81105
|
const key = chain;
|
|
81080
81106
|
const { namingPreference } = useSDKConfig();
|
|
81081
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: {
|
|
@@ -81083,11 +81109,11 @@ const BondRowsWithTitle$1 = ({ chain, bonds, showHotBonds }) => {
|
|
|
81083
81109
|
overflow: 'hidden',
|
|
81084
81110
|
width: '100%',
|
|
81085
81111
|
marginTop: '0px',
|
|
81086
|
-
}, 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) => {
|
|
81087
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;
|
|
81088
81114
|
if (bondFromMap.soldOut) {
|
|
81089
81115
|
const bond = bondFromMap;
|
|
81090
|
-
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}`));
|
|
81091
81117
|
}
|
|
81092
81118
|
if (bondFromMap.billType === 'fcfs') {
|
|
81093
81119
|
const bond = bondFromMap;
|
|
@@ -81101,18 +81127,18 @@ const BondRowsWithTitle$1 = ({ chain, bonds, showHotBonds }) => {
|
|
|
81101
81127
|
const airdropBonus = (_r = bond === null || bond === void 0 ? void 0 : bond.airdropBonus) !== null && _r !== void 0 ? _r : 0;
|
|
81102
81128
|
const bonus = baseBonus + airdropBonus;
|
|
81103
81129
|
const initialRelease = ((_s = bond === null || bond === void 0 ? void 0 : bond.initialRelease) !== null && _s !== void 0 ? _s : 0) * 100;
|
|
81104
|
-
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}`));
|
|
81105
81131
|
}
|
|
81106
81132
|
else {
|
|
81107
81133
|
const bond = bondFromMap;
|
|
81108
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];
|
|
81109
81135
|
const remainingTokensString = getRemainingTokensString(bond);
|
|
81110
|
-
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}`));
|
|
81111
81137
|
}
|
|
81112
81138
|
}), showHotBonds && (jsx$2(SwiperProvider, { children: jsx$2(HotBondCards, {}) }))] }, key)) }) }, key));
|
|
81113
81139
|
};
|
|
81114
81140
|
|
|
81115
|
-
const BondRowsByChain
|
|
81141
|
+
const BondRowsByChain = ({ bonds, hideTitles }) => {
|
|
81116
81142
|
var _a;
|
|
81117
81143
|
const SDKConfig = useSDKConfig();
|
|
81118
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));
|
|
@@ -81126,7 +81152,7 @@ const BondRowsByChain$1 = ({ bonds, hideTitles }) => {
|
|
|
81126
81152
|
}, {});
|
|
81127
81153
|
return (jsx$2(Flex$1, { className: "bondrowsbychain", children: validatedChains === null || validatedChains === void 0 ? void 0 : validatedChains.map((chain) => {
|
|
81128
81154
|
var _a, _b;
|
|
81129
|
-
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));
|
|
81130
81156
|
}) }));
|
|
81131
81157
|
};
|
|
81132
81158
|
|
|
@@ -81293,7 +81319,7 @@ const RecommendationCards$1 = () => {
|
|
|
81293
81319
|
}) })] }));
|
|
81294
81320
|
};
|
|
81295
81321
|
|
|
81296
|
-
const BondsMenu
|
|
81322
|
+
const BondsMenu = ({ onSort }) => {
|
|
81297
81323
|
const { namingPreference } = useSDKConfig();
|
|
81298
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" })] })] }) }));
|
|
81299
81325
|
};
|
|
@@ -81383,7 +81409,7 @@ const BuyAgainRow = () => {
|
|
|
81383
81409
|
bond: bond.earnToken.symbol,
|
|
81384
81410
|
},
|
|
81385
81411
|
});
|
|
81386
|
-
}, 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;
|
|
81387
81413
|
};
|
|
81388
81414
|
|
|
81389
81415
|
const Bonds = () => {
|
|
@@ -81487,7 +81513,7 @@ const Bonds = () => {
|
|
|
81487
81513
|
const handleChangeFilterOption = useCallback((newOption) => {
|
|
81488
81514
|
setFilterOption(newOption);
|
|
81489
81515
|
}, []);
|
|
81490
|
-
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: {
|
|
81491
81517
|
width: '100%',
|
|
81492
81518
|
height: '300px',
|
|
81493
81519
|
background: 'white2',
|
|
@@ -99767,83 +99793,15 @@ const BuyBondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }
|
|
|
99767
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 }) }) }));
|
|
99768
99794
|
};
|
|
99769
99795
|
|
|
99770
|
-
const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
|
|
99771
|
-
// Hooks
|
|
99772
|
-
const SDKConfig = useSDKConfig();
|
|
99773
|
-
const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
|
|
99774
|
-
// State
|
|
99775
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
99776
|
-
// Handlers - Single selection only
|
|
99777
|
-
const handleSelection = (selectedChain) => {
|
|
99778
|
-
setChainFilterOption([selectedChain]);
|
|
99779
|
-
setIsOpen(false); // Close dropdown after selection
|
|
99780
|
-
};
|
|
99781
|
-
return (jsxs(Flex, { sx: { width: '100%', position: 'relative' }, children: [isOpen && (
|
|
99782
|
-
// Backdrop that closes the dropdown if a user clicks outside of it
|
|
99783
|
-
jsx$2(Flex, { sx: {
|
|
99784
|
-
background: 'transparent',
|
|
99785
|
-
position: 'fixed',
|
|
99786
|
-
top: 0,
|
|
99787
|
-
left: 0,
|
|
99788
|
-
width: '100vw',
|
|
99789
|
-
height: '100vh',
|
|
99790
|
-
zIndex: 1000,
|
|
99791
|
-
}, onClick: () => setIsOpen(false) })), jsxs(Flex, { sx: {
|
|
99792
|
-
background: 'white2',
|
|
99793
|
-
p: '6px',
|
|
99794
|
-
borderRadius: 'normal',
|
|
99795
|
-
cursor: 'pointer',
|
|
99796
|
-
alignItems: 'center',
|
|
99797
|
-
width: '100%',
|
|
99798
|
-
justifyContent: 'space-between',
|
|
99799
|
-
}, 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: {
|
|
99800
|
-
flexDirection: ['column', 'column', 'column'],
|
|
99801
|
-
position: 'absolute',
|
|
99802
|
-
top: '45px',
|
|
99803
|
-
left: '0px',
|
|
99804
|
-
maxHeight: ['300px', '300px', '350px'],
|
|
99805
|
-
borderRadius: 'normal',
|
|
99806
|
-
background: 'white2',
|
|
99807
|
-
boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.5)',
|
|
99808
|
-
zIndex: 1001,
|
|
99809
|
-
}, children: [...chains].map((chainId) => {
|
|
99810
|
-
return (jsx$2(Flex, { sx: {
|
|
99811
|
-
borderRadius: 'normal',
|
|
99812
|
-
p: '5px 15px',
|
|
99813
|
-
minHeight: '40px',
|
|
99814
|
-
cursor: 'pointer',
|
|
99815
|
-
'&:hover': { bg: 'white3' },
|
|
99816
|
-
}, 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));
|
|
99817
|
-
}) }))] }));
|
|
99818
|
-
};
|
|
99819
|
-
|
|
99820
|
-
const BondFilters = ({ setChainFilterOption, chainFilterOption }) => {
|
|
99821
|
-
const { activeView } = useActiveView();
|
|
99822
|
-
return (jsx$2("div", { className: "network-filter", children: activeView === BondsViewOptions$1.BONDSMARKET && (jsx$2(NetworkFilter, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption })) }));
|
|
99823
|
-
};
|
|
99824
|
-
|
|
99825
99796
|
var BondsViewOptions$1;
|
|
99826
99797
|
(function (BondsViewOptions) {
|
|
99827
99798
|
BondsViewOptions["BONDSMARKET"] = "Bonds Market";
|
|
99828
99799
|
BondsViewOptions["YOURBONDS"] = "Your Bonds";
|
|
99829
99800
|
})(BondsViewOptions$1 || (BondsViewOptions$1 = {}));
|
|
99830
|
-
|
|
99801
|
+
({
|
|
99831
99802
|
[BondsViewOptions$1.BONDSMARKET]: 'GOO Sale',
|
|
99832
99803
|
[BondsViewOptions$1.YOURBONDS]: 'Your GOO',
|
|
99833
|
-
};
|
|
99834
|
-
const BondsMenu = ({ setChainFilterOption, chainFilterOption, handleToogle }) => {
|
|
99835
|
-
const { namingPreference } = useSDKConfig();
|
|
99836
|
-
const { activeView } = useActiveView();
|
|
99837
|
-
const toggleOptions = [BondsViewOptions$1.BONDSMARKET, BondsViewOptions$1.YOURBONDS].map((option) => TOGGLE_DISPLAY_TEXT[option]);
|
|
99838
|
-
const handleToggleWithMapping = (displayText) => {
|
|
99839
|
-
var _a;
|
|
99840
|
-
const enumValue = (_a = Object.entries(TOGGLE_DISPLAY_TEXT).find(([, text]) => text === displayText)) === null || _a === void 0 ? void 0 : _a[0];
|
|
99841
|
-
if (enumValue) {
|
|
99842
|
-
handleToogle(enumValue);
|
|
99843
|
-
}
|
|
99844
|
-
};
|
|
99845
|
-
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" })] }))] })] }));
|
|
99846
|
-
};
|
|
99804
|
+
});
|
|
99847
99805
|
|
|
99848
99806
|
/*
|
|
99849
99807
|
* Basically this is a handler that controls which Modal is displayed to the user.
|
|
@@ -99916,282 +99874,6 @@ const CheckUrl = () => {
|
|
|
99916
99874
|
return jsx$2(Fragment$1, {});
|
|
99917
99875
|
};
|
|
99918
99876
|
|
|
99919
|
-
const ChainTitle = ({ chain, pt, hideTitles }) => {
|
|
99920
|
-
var _a;
|
|
99921
|
-
const isMobile = useIsMobile();
|
|
99922
|
-
return (jsxs(Flex, { id: `${NETWORK_LABEL[chain].toLowerCase().replace(/\s+/g, '')}`, className: "chaintitle", sx: {
|
|
99923
|
-
pt,
|
|
99924
|
-
pb: '10px',
|
|
99925
|
-
color: 'textDisabledButton',
|
|
99926
|
-
fontSize: '13px',
|
|
99927
|
-
fontWeight: 500,
|
|
99928
|
-
textTransform: 'uppercase',
|
|
99929
|
-
display: hideTitles ? 'none' : 'flex',
|
|
99930
|
-
width: '300px',
|
|
99931
|
-
alignItems: 'center',
|
|
99932
|
-
}, 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" }) })] }))] }));
|
|
99933
|
-
};
|
|
99934
|
-
|
|
99935
|
-
const NETWORK_COLORS = {
|
|
99936
|
-
[main.ChainId.BSC]: '#F3BA2F4d',
|
|
99937
|
-
[main.ChainId.MAINNET]: '#627eea4d',
|
|
99938
|
-
[main.ChainId.MATIC]: '#8247e54d',
|
|
99939
|
-
[main.ChainId.LIGHTLINK]: '#6087ff4d',
|
|
99940
|
-
[main.ChainId.BASE]: '#0052ff4d',
|
|
99941
|
-
[main.ChainId.ARBITRUM]: '#289fef4d',
|
|
99942
|
-
[main.ChainId.LINEA]: '#ffffff4d',
|
|
99943
|
-
[main.ChainId.IOTA]: '#ffffff4d',
|
|
99944
|
-
[main.ChainId.GRAPHLINQ]: '#ded2ff4d',
|
|
99945
|
-
[main.ChainId.AVAX]: '#e743444d',
|
|
99946
|
-
[main.ChainId.BLAST]: '#fcfc034d',
|
|
99947
|
-
[main.ChainId.CROSSFI]: '#7c80844d',
|
|
99948
|
-
[main.ChainId.MONAD_TESTNET]: '#836EF94d',
|
|
99949
|
-
[main.ChainId.SONIC]: '#fb9a4c4d',
|
|
99950
|
-
[main.ChainId.BERACHAIN]: '#783e244d',
|
|
99951
|
-
[main.ChainId.KATANA]: '#068be34d',
|
|
99952
|
-
[main.ChainId.UNICHAIN]: '#f50db44d',
|
|
99953
|
-
};
|
|
99954
|
-
const TokenInfoAndName = ({ tokenSymbol, chain, tag, vestEnds, isHotBond, }) => {
|
|
99955
|
-
return (jsxs(Flex, { className: "tokeninfoname container", children: [jsx$2(Flex, { sx: {
|
|
99956
|
-
width: '125px',
|
|
99957
|
-
height: '100%',
|
|
99958
|
-
position: 'absolute',
|
|
99959
|
-
left: 0,
|
|
99960
|
-
top: 0,
|
|
99961
|
-
borderRadius: 'normal',
|
|
99962
|
-
background: isHotBond
|
|
99963
|
-
? 'transparent'
|
|
99964
|
-
: `linear-gradient(90deg, ${chain ? NETWORK_COLORS[chain] : '#FFFFFF33'} 0%, rgba(0,0,0,0) 75%)`,
|
|
99965
|
-
} }), 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: {
|
|
99966
|
-
marginTop: vestEnds ? ['10px', '10px', '10px', '0px'] : 0,
|
|
99967
|
-
maxWidth: ['175px', '175px', '140px', '190px', '190px'],
|
|
99968
|
-
}, 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: {
|
|
99969
|
-
justifyContent: isHotBond ? 'center' : 'flex-start',
|
|
99970
|
-
alignItems: 'center',
|
|
99971
|
-
}, 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() }) }) })] }));
|
|
99972
|
-
};
|
|
99973
|
-
|
|
99974
|
-
const BondRow = ({ bondAddress, bondChain, contractType, tag, bondSoldOut, discount, vestingTermString, vestingCliffString,
|
|
99975
|
-
// percentageAvailable,
|
|
99976
|
-
// remainingTokensString,
|
|
99977
|
-
}) => {
|
|
99978
|
-
const locationPath = window.location.pathname.replace('/', '');
|
|
99979
|
-
const payoutTokenSymbol = contractType.toLowerCase() === 'goo' ? 'GOO' : 'sGOO';
|
|
99980
|
-
// Modal
|
|
99981
|
-
const [openBuyModal] = useModal(jsx$2(ModalHandler, { bondAddress: bondAddress, bondChain: bondChain }), true, true, `buyBondModal-${bondAddress.toLowerCase()}-${bondChain}`);
|
|
99982
|
-
const handleOpenModal = () => {
|
|
99983
|
-
if (bondSoldOut)
|
|
99984
|
-
return;
|
|
99985
|
-
openBuyModal();
|
|
99986
|
-
if (typeof window !== 'undefined') {
|
|
99987
|
-
window.history.pushState({}, '', `${locationPath}?bondAddress=${bondAddress}&bondChain=${bondChain}`);
|
|
99988
|
-
}
|
|
99989
|
-
track({
|
|
99990
|
-
event: 'buyModalOpen',
|
|
99991
|
-
chain: bondChain,
|
|
99992
|
-
data: {
|
|
99993
|
-
cat: 'Row',
|
|
99994
|
-
bond: payoutTokenSymbol,
|
|
99995
|
-
bondChain: bondChain,
|
|
99996
|
-
},
|
|
99997
|
-
});
|
|
99998
|
-
};
|
|
99999
|
-
return (jsxs("div", { className: "bond-row" // Insert special campaign styles here
|
|
100000
|
-
, 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}`));
|
|
100001
|
-
};
|
|
100002
|
-
|
|
100003
|
-
const BANNER_INFO = {
|
|
100004
|
-
[main.ChainId.MONAD_TESTNET]: {
|
|
100005
|
-
title: 'Test and Play on Monad Testnet',
|
|
100006
|
-
subtitle: 'Explore Bonds on the Monad Testnet for free.',
|
|
100007
|
-
buttons: [
|
|
100008
|
-
{
|
|
100009
|
-
label: 'LEARN MORE',
|
|
100010
|
-
href: 'https://apebond.medium.com/apebond-integrates-testnet-bonds-paving-the-way-for-exciting-new-chains-3f62e2204746?source=social.tw',
|
|
100011
|
-
variant: variants.SECONDARY,
|
|
100012
|
-
},
|
|
100013
|
-
{ label: 'GET MON TOKENS', href: 'https://testnet.monad.xyz' },
|
|
100014
|
-
],
|
|
100015
|
-
background: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner_jpkg38.png',
|
|
100016
|
-
backgroundMobile: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner-mobile_y6xveu.png',
|
|
100017
|
-
logo: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/monad-logo_lkstid.png',
|
|
100018
|
-
},
|
|
100019
|
-
};
|
|
100020
|
-
const BannerTestnet = ({ chainId }) => {
|
|
100021
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
100022
|
-
return (jsxs("div", { className: "banner-container", sx: {
|
|
100023
|
-
backgroundImage: [
|
|
100024
|
-
`url(${(_a = BANNER_INFO[chainId]) === null || _a === void 0 ? void 0 : _a.backgroundMobile})`,
|
|
100025
|
-
`url(${(_b = BANNER_INFO[chainId]) === null || _b === void 0 ? void 0 : _b.backgroundMobile})`,
|
|
100026
|
-
`url(${(_c = BANNER_INFO[chainId]) === null || _c === void 0 ? void 0 : _c.backgroundMobile})`,
|
|
100027
|
-
`url(${(_d = BANNER_INFO[chainId]) === null || _d === void 0 ? void 0 : _d.background})`,
|
|
100028
|
-
`url(${(_e = BANNER_INFO[chainId]) === null || _e === void 0 ? void 0 : _e.background})`,
|
|
100029
|
-
],
|
|
100030
|
-
}, 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}`));
|
|
100031
|
-
};
|
|
100032
|
-
|
|
100033
|
-
const BondRowsWithTitle = ({ chain, bonds }) => {
|
|
100034
|
-
const key = chain;
|
|
100035
|
-
// const { data: saleInfo } = useSaleInfo()
|
|
100036
|
-
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: {
|
|
100037
|
-
position: 'relative',
|
|
100038
|
-
overflow: 'hidden',
|
|
100039
|
-
width: '100%',
|
|
100040
|
-
marginTop: '0px',
|
|
100041
|
-
}, 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) => {
|
|
100042
|
-
return (jsx$2(BondRow, { bondAddress: bond.address, bondChain: chain, contractType: bond.type, vestingTermString: bond.vestingLinear.toString(), vestingCliffString: bond.vestingCliff.toString(),
|
|
100043
|
-
// percentageAvailable={saleInfo?.currentStage?.remainingPercentage ?? 50}
|
|
100044
|
-
// remainingTokensString={`${saleInfo?.currentStage?.remainingPercentage?.toFixed(2)} %`}
|
|
100045
|
-
discount: bond.discount.toString() }, `${bond.address}-${chain}-${index}`));
|
|
100046
|
-
})] }, key))] }) }, key));
|
|
100047
|
-
};
|
|
100048
|
-
|
|
100049
|
-
const BondRowsByChain = ({ contractsByChain }) => {
|
|
100050
|
-
var _a;
|
|
100051
|
-
const SDKConfig = useSDKConfig();
|
|
100052
|
-
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));
|
|
100053
|
-
if (!contractsByChain) {
|
|
100054
|
-
return null;
|
|
100055
|
-
}
|
|
100056
|
-
return (jsx$2(Flex$1, { className: "bondrowsbychain", children: validatedChains === null || validatedChains === void 0 ? void 0 : validatedChains.map((chain) => {
|
|
100057
|
-
var _a;
|
|
100058
|
-
const bonds = (_a = contractsByChain[chain]) !== null && _a !== void 0 ? _a : [];
|
|
100059
|
-
return jsx$2(BondRowsWithTitle, { chain: chain, bonds: bonds }, chain);
|
|
100060
|
-
}) }));
|
|
100061
|
-
};
|
|
100062
|
-
|
|
100063
|
-
const ProgressBar = ({ saleInfo }) => {
|
|
100064
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
100065
|
-
const nextStageNumber = (_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _a === void 0 ? void 0 : _a.stageNumber;
|
|
100066
|
-
const stage = (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) && nextStageNumber
|
|
100067
|
-
? saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages.find((stage) => stage.stageNumber === nextStageNumber - 1)
|
|
100068
|
-
: saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage;
|
|
100069
|
-
const previousStagesBilled = useMemo(() => {
|
|
100070
|
-
var _a, _b, _c;
|
|
100071
|
-
const currentStageNumber = (_a = stage === null || stage === void 0 ? void 0 : stage.stageNumber) !== null && _a !== void 0 ? _a : 1;
|
|
100072
|
-
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 : [];
|
|
100073
|
-
const totalPreviousSats = previousStages.reduce((sum, s) => { var _a; return sum + ((_a = s.totalBilledSats) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
100074
|
-
return totalPreviousSats / 100000000;
|
|
100075
|
-
}, [saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages, stage === null || stage === void 0 ? void 0 : stage.stageNumber]);
|
|
100076
|
-
const baseAmount = 100 + previousStagesBilled;
|
|
100077
|
-
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]);
|
|
100078
|
-
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]);
|
|
100079
|
-
const isTimeProgress = true;
|
|
100080
|
-
const [timeLeft, setTimeLeft] = useState('');
|
|
100081
|
-
const [timeProgress, setTimeProgress] = useState(0);
|
|
100082
|
-
const value = useMemo(() => (timeProgress ), [isTimeProgress, timeProgress, billed, hardCap]);
|
|
100083
|
-
const stageNumber = useMemo(() => { var _a; return (_a = stage === null || stage === void 0 ? void 0 : stage.stageNumber) !== null && _a !== void 0 ? _a : 1; }, [stage]);
|
|
100084
|
-
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;
|
|
100085
|
-
const saleContracts = contractsByChain === null || contractsByChain === void 0 ? void 0 : contractsByChain[main.ChainId.BASE];
|
|
100086
|
-
const saleData = saleContracts === null || saleContracts === void 0 ? void 0 : saleContracts[0];
|
|
100087
|
-
// Get BTC price
|
|
100088
|
-
const btcPriceData = useCurrencyPrice(saleData === null || saleData === void 0 ? void 0 : saleData.principalToken, main.ChainId.BASE);
|
|
100089
|
-
const btcPrice = (_d = btcPriceData === null || btcPriceData === void 0 ? void 0 : btcPriceData.price) !== null && _d !== void 0 ? _d : 0;
|
|
100090
|
-
const totalBilledBTC = ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.totalBilled) ? (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.totalBilled) / 100000000 : 0) + 100;
|
|
100091
|
-
const totalBilledUSD = (totalBilledBTC * btcPrice).toLocaleString('en-US', {
|
|
100092
|
-
style: 'currency',
|
|
100093
|
-
currency: 'USD',
|
|
100094
|
-
maximumFractionDigits: 0,
|
|
100095
|
-
});
|
|
100096
|
-
// Determine if we're in refund or TGE period
|
|
100097
|
-
const isRefundPeriod = (_e = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod) !== null && _e !== void 0 ? _e : false;
|
|
100098
|
-
const isTGEPeriod = ((_f = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _f === void 0 ? void 0 : _f.key) === 'TGE';
|
|
100099
|
-
const endTime = useMemo(() => {
|
|
100100
|
-
const timestamp = stage === null || stage === void 0 ? void 0 : stage.endTime;
|
|
100101
|
-
if (!timestamp)
|
|
100102
|
-
return 'N/A';
|
|
100103
|
-
// endTime is a Unix timestamp in seconds, multiply by 1000 for milliseconds
|
|
100104
|
-
return new Date(timestamp * 1000).toLocaleString('en-US', {
|
|
100105
|
-
timeZone: 'UTC',
|
|
100106
|
-
hour12: false,
|
|
100107
|
-
month: 'long',
|
|
100108
|
-
day: 'numeric',
|
|
100109
|
-
hour: '2-digit',
|
|
100110
|
-
minute: '2-digit',
|
|
100111
|
-
});
|
|
100112
|
-
}, [stage]);
|
|
100113
|
-
useEffect(() => {
|
|
100114
|
-
const calculateTimeLeft = () => {
|
|
100115
|
-
const startTimestamp = stage === null || stage === void 0 ? void 0 : stage.startTime;
|
|
100116
|
-
const endTimestamp = stage === null || stage === void 0 ? void 0 : stage.endTime;
|
|
100117
|
-
if (!endTimestamp || !startTimestamp) {
|
|
100118
|
-
setTimeLeft('');
|
|
100119
|
-
setTimeProgress(0);
|
|
100120
|
-
return;
|
|
100121
|
-
}
|
|
100122
|
-
const now = Math.floor(Date.now() / 1000);
|
|
100123
|
-
const diff = endTimestamp - now;
|
|
100124
|
-
const totalDuration = endTimestamp - startTimestamp;
|
|
100125
|
-
const elapsed = now - startTimestamp;
|
|
100126
|
-
const progress = Math.min(100, Math.max(0, (elapsed / totalDuration) * 100));
|
|
100127
|
-
setTimeProgress(progress);
|
|
100128
|
-
if (diff <= 0) {
|
|
100129
|
-
setTimeLeft('Ended');
|
|
100130
|
-
return;
|
|
100131
|
-
}
|
|
100132
|
-
const days = Math.floor(diff / 86400);
|
|
100133
|
-
const hours = Math.floor((diff % 86400) / 3600);
|
|
100134
|
-
const minutes = Math.floor((diff % 3600) / 60);
|
|
100135
|
-
setTimeLeft(`${days}d, ${hours}h, ${minutes}m left`);
|
|
100136
|
-
};
|
|
100137
|
-
calculateTimeLeft();
|
|
100138
|
-
const interval = setInterval(calculateTimeLeft, 60000);
|
|
100139
|
-
return () => clearInterval(interval);
|
|
100140
|
-
}, [stage === null || stage === void 0 ? void 0 : stage.startTime, stage === null || stage === void 0 ? void 0 : stage.endTime]);
|
|
100141
|
-
const nextStageStartTime = useMemo(() => {
|
|
100142
|
-
var _a, _b;
|
|
100143
|
-
return ((_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _a === void 0 ? void 0 : _a.startTime)
|
|
100144
|
-
? new Date(((_b = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _b === void 0 ? void 0 : _b.startTime) * 1000).toLocaleString('en-US', {
|
|
100145
|
-
timeZone: 'UTC',
|
|
100146
|
-
hour12: false,
|
|
100147
|
-
month: 'long',
|
|
100148
|
-
day: 'numeric',
|
|
100149
|
-
hour: '2-digit',
|
|
100150
|
-
minute: '2-digit',
|
|
100151
|
-
})
|
|
100152
|
-
: 'N/A';
|
|
100153
|
-
}, [saleInfo]);
|
|
100154
|
-
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: {
|
|
100155
|
-
fontSize: '14px',
|
|
100156
|
-
fontWeight: '700',
|
|
100157
|
-
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
100158
|
-
mb: '0.2rem',
|
|
100159
|
-
}, 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: {
|
|
100160
|
-
fontSize: '14px',
|
|
100161
|
-
fontWeight: '700',
|
|
100162
|
-
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
100163
|
-
mb: '0.2rem',
|
|
100164
|
-
mt: '1rem',
|
|
100165
|
-
}, children: isRefundPeriod ? 'Refund Period' : 'Sale' }), jsx$2(Text, { sx: { fontSize: '22px', fontWeight: '700' }, children: `${timeLeft}` })] })) ] }), jsx$2(Text, { sx: {
|
|
100166
|
-
fontSize: '12px',
|
|
100167
|
-
fontWeight: '400',
|
|
100168
|
-
textAlign: 'right',
|
|
100169
|
-
ml: '10px',
|
|
100170
|
-
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
100171
|
-
}, children: (stage === null || stage === void 0 ? void 0 : stage.hasEnded)
|
|
100172
|
-
? ((_g = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _g === void 0 ? void 0 : _g.key) === 'refund'
|
|
100173
|
-
? 'Refund Period starts: ' + nextStageStartTime + ' UTC'
|
|
100174
|
-
: ((_h = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _h === void 0 ? void 0 : _h.key) === 'TGE'
|
|
100175
|
-
? 'TGE starts: ' + nextStageStartTime + ' UTC'
|
|
100176
|
-
: 'Stage ' + nextStageNumber + ' starts: ' + nextStageStartTime + ' UTC'
|
|
100177
|
-
: isRefundPeriod
|
|
100178
|
-
? 'Refund Period Ends: ' + endTime + ' UTC'
|
|
100179
|
-
: isTGEPeriod
|
|
100180
|
-
? 'TGE Ends: ' + endTime + ' UTC'
|
|
100181
|
-
: 'Stage ' + stageNumber + ' Ends: ' + endTime + ' UTC' })] }), jsx$2(Flex$1, { sx: { width: ['100%'], alignItems: 'center', flexDirection: 'row', my: '1rem' }, children: jsx$2(Box$1, { style: {
|
|
100182
|
-
width: '100%',
|
|
100183
|
-
height: '11px',
|
|
100184
|
-
backgroundColor: 'var(--theme-ui-colors-white4)',
|
|
100185
|
-
borderRadius: '10px',
|
|
100186
|
-
overflow: 'hidden',
|
|
100187
|
-
}, children: jsx$2(Box$1, { style: {
|
|
100188
|
-
width: `${value <= 3 ? 3 : value}%`,
|
|
100189
|
-
borderRadius: '10px',
|
|
100190
|
-
height: '100%',
|
|
100191
|
-
background: 'linear-gradient(90deg, #312E7A 0%,#5C4FAE 33%,#AD6568 66%, #AD6E66 100%)',
|
|
100192
|
-
} }) }) })] }));
|
|
100193
|
-
};
|
|
100194
|
-
|
|
100195
99877
|
const YourGoo = ({ yourGoo, isLoading, isFetching, }) => {
|
|
100196
99878
|
var _a, _b, _c;
|
|
100197
99879
|
const { data: saleInfo } = useSaleInfo();
|
|
@@ -100829,19 +100511,17 @@ var BondsViewOptions;
|
|
|
100829
100511
|
BondsViewOptions["YOURBONDS"] = "Your Bonds";
|
|
100830
100512
|
})(BondsViewOptions || (BondsViewOptions = {}));
|
|
100831
100513
|
const GooSale = () => {
|
|
100832
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
100514
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
100833
100515
|
// Fetch data
|
|
100834
100516
|
const { data: chainFilterOption, setChainFilterOption } = useChainFilterOption();
|
|
100835
100517
|
const { data: saleInfo, isLoading: isLoadingSaleInfo } = useSaleInfo();
|
|
100836
100518
|
const currentStageNumber = (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod)
|
|
100837
100519
|
? ((_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _a === void 0 ? void 0 : _a.stageNumber) || 1
|
|
100838
100520
|
: ((_b = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _b === void 0 ? void 0 : _b.stageNumber) || 1;
|
|
100839
|
-
const { activeView, handleToogle } = useActiveView(true);
|
|
100840
100521
|
const { address } = useAccount();
|
|
100841
100522
|
const { data: yourGoo, isLoading, isFetching } = useYourGoo(address);
|
|
100842
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');
|
|
100843
100524
|
const chainId = useChainId();
|
|
100844
|
-
const { switchChain } = useSwitchChain();
|
|
100845
100525
|
const { data: elegibleForSale, cbBTCBalance, isCbBTCBalanceLoading, cbBTCBalanceChecked, checkCbBTCBalance, addToWhitelist, isAddingToWhitelist, addToWhitelistSuccess, addToWhitelistError, } = useGooEligibility();
|
|
100846
100526
|
const [checkButtonPushed, setCheckButtonPushed] = useState(false);
|
|
100847
100527
|
const whitelisted = checkButtonPushed ? elegibleForSale : undefined;
|
|
@@ -100854,17 +100534,20 @@ const GooSale = () => {
|
|
|
100854
100534
|
}
|
|
100855
100535
|
});
|
|
100856
100536
|
const currentStageSoldOut = ((_c = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _c === void 0 ? void 0 : _c.progressPercentage) === 100;
|
|
100857
|
-
// Wrapper function that sets chain filter AND switches wallet chain
|
|
100858
|
-
const handleChainFilterChange = useCallback(
|
|
100859
|
-
|
|
100860
|
-
|
|
100861
|
-
|
|
100862
|
-
|
|
100863
|
-
|
|
100864
|
-
|
|
100865
|
-
|
|
100866
|
-
|
|
100867
|
-
}
|
|
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
|
+
// )
|
|
100868
100551
|
// Sync chain filter with connected chain
|
|
100869
100552
|
useEffect(() => {
|
|
100870
100553
|
if (chainId) {
|
|
@@ -100875,21 +100558,19 @@ const GooSale = () => {
|
|
|
100875
100558
|
}
|
|
100876
100559
|
}
|
|
100877
100560
|
}, [chainId, chainFilterOption, setChainFilterOption]);
|
|
100878
|
-
// Filter contracts by chain
|
|
100879
|
-
const filteredContractsByChain = useMemo(() => {
|
|
100880
|
-
|
|
100881
|
-
|
|
100882
|
-
|
|
100883
|
-
|
|
100884
|
-
|
|
100885
|
-
|
|
100886
|
-
|
|
100887
|
-
|
|
100888
|
-
|
|
100889
|
-
|
|
100890
|
-
|
|
100891
|
-
return filtered;
|
|
100892
|
-
}, [(_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])
|
|
100893
100574
|
// Dynamic title based on current period (hidden during refund period)
|
|
100894
100575
|
const pageTitle = useMemo(() => {
|
|
100895
100576
|
var _a;
|
|
@@ -100898,15 +100579,15 @@ const GooSale = () => {
|
|
|
100898
100579
|
if (((_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _a === void 0 ? void 0 : _a.key) === 'TGE')
|
|
100899
100580
|
return 'GOO Token Generation Event';
|
|
100900
100581
|
return 'Buy GOO at a discount';
|
|
100901
|
-
}, [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]);
|
|
100902
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) &&
|
|
100903
100584
|
(saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) &&
|
|
100904
100585
|
!isLoadingSaleInfo &&
|
|
100905
|
-
!(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'
|
|
100906
100587
|
? 'Refund Period '
|
|
100907
|
-
: ((
|
|
100588
|
+
: ((_f = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _f === void 0 ? void 0 : _f.key) === 'TGE'
|
|
100908
100589
|
? 'TGE '
|
|
100909
|
-
: '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: {
|
|
100910
100591
|
mr: '1rem',
|
|
100911
100592
|
p: '10px',
|
|
100912
100593
|
borderRadius: 'normal',
|
|
@@ -100942,13 +100623,11 @@ const GooSale = () => {
|
|
|
100942
100623
|
px: '12%',
|
|
100943
100624
|
pt: ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) || currentStageSoldOut) && (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) ? '4rem' : '1rem',
|
|
100944
100625
|
pb: '4rem',
|
|
100945
|
-
}, 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) ? (
|
|
100946
100627
|
// Refund period - show refund view for ALL chains
|
|
100947
|
-
jsx$2(RefundView, {})) :
|
|
100948
|
-
// Active sale period - show normal bonds market / your goo tabs
|
|
100949
|
-
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 ? (
|
|
100950
100629
|
// Break period but user has participated - show their goo
|
|
100951
|
-
|
|
100630
|
+
jsx$2(Fragment$1, { children: jsx$2(YourGoo, { yourGoo: yourGoo, isLoading: isLoading, isFetching: isFetching }) })) : (jsx$2(Fragment$1, {}))] }));
|
|
100952
100631
|
};
|
|
100953
100632
|
|
|
100954
100633
|
const GooSaleWithProviders = (props) => {
|
|
@@ -14,6 +14,7 @@ export interface SDKPropsDTO {
|
|
|
14
14
|
highestCompatibleVersion?: string;
|
|
15
15
|
isFakeBTC?: boolean;
|
|
16
16
|
privatePartnerName?: string;
|
|
17
|
+
useGooPriceOverride?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export interface SDKProps {
|
|
19
20
|
referenceId: string;
|
|
@@ -31,6 +32,7 @@ export interface SDKProps {
|
|
|
31
32
|
highestCompatibleVersion?: string;
|
|
32
33
|
isFakeBTC?: boolean;
|
|
33
34
|
privatePartnerName?: string;
|
|
35
|
+
useGooPriceOverride?: boolean;
|
|
34
36
|
}
|
|
35
37
|
export declare const useSDKConfig: (config?: SDKPropsDTO) => SDKProps;
|
|
36
38
|
export type URLKeys = 'apiV2' | 'realTimeApi' | 'mainUrl';
|
|
@@ -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;
|