@ape.swap/bonds-sdk 1.1.0-test.78 → 1.1.0-test.80
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/components/SafeHTMLComponent/index.d.ts +5 -0
- package/dist/main.js +95 -35
- package/dist/styles.css +161 -29
- package/dist/views/BondModal/BondModal.d.ts +0 -1
- package/dist/views/BondModal/components/BondCards.d.ts +6 -0
- package/dist/views/BondModal/components/BondModalHeader.d.ts +7 -0
- package/dist/views/BondModal/components/Estimations.d.ts +14 -0
- package/dist/views/BondModal/components/ProjectDescription.d.ts +5 -0
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -17598,7 +17598,7 @@ const styles$a = {
|
|
|
17598
17598
|
transform: 'translate(-50%, -50%)',
|
|
17599
17599
|
width: '380px',
|
|
17600
17600
|
minWidth: ['95%', 'min(360px, 90%)', '320px'],
|
|
17601
|
-
overflowY: 'auto',
|
|
17601
|
+
overflowY: ['auto', 'auto', 'auto', 'unset'],
|
|
17602
17602
|
maxHeight: 'calc(100% - 30px)',
|
|
17603
17603
|
maxWidth: '95vw',
|
|
17604
17604
|
},
|
|
@@ -19382,11 +19382,10 @@ const TokenInfoAndName = ({ bill, vestEnds, isHotBond, }) => {
|
|
|
19382
19382
|
const tokenName = 'showcaseTokenName' in bill ? bill.showcaseTokenName : bill.earnToken.symbol;
|
|
19383
19383
|
return (jsxs(Flex, { className: "tokeninfoname container", children: [jsx$2(Flex, { className: "tokeninfoname chain", children: jsx$2(Svg, { width: 20, height: 20, icon: (_a = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _a !== void 0 ? _a : 'question' }) }), jsx$2(Flex, { className: "tokeninfoname gradient", sx: {
|
|
19384
19384
|
background: isHotBond ? 'transparent' : NETWORK_COLORS[bill.chainId],
|
|
19385
|
-
} }), jsxs(Flex, { className: "tokeninfoname tokencontainer", children: [jsx$2(TokenImage, { symbol: tokenName, size: 33 }), jsxs(Flex, { className: "tokeninfoname tokentext", children: [tokenName, vestEnds && (jsx$2(Flex, { sx: { fontSize: '12px', fontWeight: 400, opacity: 0.6, lineHeight: '14px' }, children: vestEnds }))] }), jsx$2(Flex, { sx: { minWidth: '25px', p: '5px' }, children: jsx$2(AddFavToken, { tokenSymbol: tokenName, hotBond:
|
|
19385
|
+
} }), jsxs(Flex, { className: "tokeninfoname tokencontainer", children: [jsx$2(TokenImage, { symbol: tokenName, size: 33 }), jsxs(Flex, { className: "tokeninfoname tokentext", children: [tokenName, vestEnds && (jsx$2(Flex, { sx: { fontSize: '12px', fontWeight: 400, opacity: 0.6, lineHeight: '14px' }, children: vestEnds }))] }), jsx$2(Flex, { sx: { minWidth: '25px', p: '5px' }, children: jsx$2(AddFavToken, { tokenSymbol: tokenName, hotBond: isHotBond }) })] }), jsx$2(Flex, { sx: {
|
|
19386
19386
|
display: isHotBond ? 'flex' : ['none', 'none', 'none', 'flex'],
|
|
19387
19387
|
justifyContent: isHotBond ? 'center' : 'flex-start',
|
|
19388
19388
|
width: '100%',
|
|
19389
|
-
ml: '10px',
|
|
19390
19389
|
}, children: ((_b = bill.tags) === null || _b === void 0 ? void 0 : _b[0]) && (jsx$2(ListTag, { variant: ((_c = bill.tags) === null || _c === void 0 ? void 0 : _c[0]) === 'Cex Fund' ? 'cex_fund' : 'liquidity', text: (_e = (_d = bill.tags) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.toUpperCase() })) })] }));
|
|
19391
19390
|
};
|
|
19392
19391
|
|
|
@@ -65986,7 +65985,7 @@ const getBillContractURL = (bond) => {
|
|
|
65986
65985
|
const getDiscountColor = (discount) => {
|
|
65987
65986
|
if (!discount)
|
|
65988
65987
|
return 'white';
|
|
65989
|
-
return discount < 0 ? '
|
|
65988
|
+
return discount < 0 ? '#DF4141' : '#38A611';
|
|
65990
65989
|
};
|
|
65991
65990
|
const calculateARR = (bond) => {
|
|
65992
65991
|
const discount2 = 'discount' in bond ? bond.discount : undefined;
|
|
@@ -67313,10 +67312,85 @@ const useSendReferenceId = () => {
|
|
|
67313
67312
|
}), [config === null || config === void 0 ? void 0 : config.referenceId]);
|
|
67314
67313
|
};
|
|
67315
67314
|
|
|
67315
|
+
const BondModalHeader = ({ bondData, onDismiss }) => {
|
|
67316
|
+
var _a, _b, _c;
|
|
67317
|
+
const [onOpenSlippageModal] = useModal(jsx$2(SlippageModal, {}));
|
|
67318
|
+
const handleClose = () => {
|
|
67319
|
+
if (typeof window !== 'undefined') {
|
|
67320
|
+
window.history.pushState({}, '', `/bonds`);
|
|
67321
|
+
}
|
|
67322
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
67323
|
+
};
|
|
67324
|
+
return (jsxs(Flex, { className: "modaltable-container title-container", children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: (_a = bondData.showcaseTokenName) !== null && _a !== void 0 ? _a : bondData.earnToken.symbol, size: 50, chain: bondData.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, jsx$2(ListTag, { text: (_b = bondData === null || bondData === void 0 ? void 0 : bondData.tags) === null || _b === void 0 ? void 0 : _b[0], variant: ((_c = bondData === null || bondData === void 0 ? void 0 : bondData.tags) === null || _c === void 0 ? void 0 : _c[0]) === 'Cex Fund' ? 'cex_fund' : 'liquidity' })] }), jsxs(Flex, { className: "title-container price-container", children: [jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bondData)] }), jsxs(Flex, { className: "price-container discounted", children: ["$", discountEarnTokenPrice(bondData)] })] }), jsx$2(Flex, { className: "slipagge-close-icons", children: onDismiss ? (jsxs(Fragment$1, { children: [jsx$2(IconButton, { icon: "close", color: "text", variant: "transparent", onClick: handleClose }), jsx$2(Flex, { sx: { py: '3px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })] })) : (jsx$2(Flex, { sx: { py: '3px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) })] }));
|
|
67325
|
+
};
|
|
67326
|
+
|
|
67327
|
+
const BondCards = ({ bondData }) => {
|
|
67328
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
67329
|
+
return (jsxs("div", { className: "bonds-cards", children: [jsxs("div", { className: "bond-card-block", style: { color: getDiscountColor(bondData === null || bondData === void 0 ? void 0 : bondData.discount) }, children: [jsxs("div", { className: "bond-card-title", children: ["Discount", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: `${(_a = bondData === null || bondData === void 0 ? void 0 : bondData.discount) === null || _a === void 0 ? void 0 : _a.toFixed(2)}%` })] }), jsxs("div", { className: "bond-card-block hide-mobile", children: [jsxs("div", { className: "bond-card-title", children: ["ARR", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: `${((((_b = bondData === null || bondData === void 0 ? void 0 : bondData.discount) !== null && _b !== void 0 ? _b : 0) * 365) / vestingTime((_c = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _c !== void 0 ? _c : 0).days).toFixed(2)}%` })] }), jsxs("div", { className: "bond-card-block", children: [jsxs("div", { className: "bond-card-title", children: ["Terms", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: vestingTime((_d = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _d !== void 0 ? _d : 0).days ? `${vestingTime((_e = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _e !== void 0 ? _e : 0).days} D` : '-' })] }), jsxs("div", { className: "bond-card-block", children: [jsxs("div", { className: "bond-card-title", children: ["Max Buy", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.MaxBuy((_f = bondData === null || bondData === void 0 ? void 0 : bondData.earnToken) === null || _f === void 0 ? void 0 : _f.symbol) }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsxs("div", { className: "bond-card-content", children: [jsx$2("div", { style: { paddingRight: '3px' }, children: jsx$2(TokenImage, { symbol: (_g = bondData.showcaseTokenName) !== null && _g !== void 0 ? _g : bondData.earnToken.symbol, size: 20 }) }), (_h = parseFloat(maxBuy(bondData).toFixed(0))) === null || _h === void 0 ? void 0 : _h.toLocaleString('en-US')] })] })] }));
|
|
67330
|
+
};
|
|
67331
|
+
|
|
67332
|
+
const Estimations = ({ bondData, inputValue, inputToken, estimatedOutput, inputTokenPrice, isZap, fetchingZapQuote, zapError, }) => {
|
|
67333
|
+
var _a, _b;
|
|
67334
|
+
// Estimations
|
|
67335
|
+
const estimatedOutputUSD = estimatedOutput * parseFloat((_a = bondData === null || bondData === void 0 ? void 0 : bondData.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0');
|
|
67336
|
+
const estimatedInputUSD = parseFloat(inputValue) * (inputTokenPrice !== null && inputTokenPrice !== void 0 ? inputTokenPrice : 0);
|
|
67337
|
+
const normalPremium = premium(bondData, inputValue);
|
|
67338
|
+
const premiumString = isZap ? formatUSDNumber((estimatedOutputUSD - estimatedInputUSD).toString()) : normalPremium;
|
|
67339
|
+
return (jsxs(Flex, { className: "modaltable-container text-container", children: [jsxs(Flex, { className: "text-container row", children: [jsx$2(Flex, { className: "row-container spend", children: "You spend:" }), jsxs(Flex, { className: "row-container spend-val", children: [youSpend(inputValue), " ", getSymbol(inputToken, bondData.chainId), " = $", ' ', formatUSDNumber(estimatedInputUSD === null || estimatedInputUSD === void 0 ? void 0 : estimatedInputUSD.toString())] })] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["Premium:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Premium }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val ${getPremiumColor(premiumString)}`, children: ["$ ", premiumString] }))] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You get (over ", vestingTime((_b = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _b !== void 0 ? _b : 0).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumber$1(estimatedOutput.toString()), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatUSDNumber(estimatedOutputUSD.toString())] }))] })] }));
|
|
67340
|
+
};
|
|
67341
|
+
|
|
67342
|
+
// Custom HTML sanitizer
|
|
67343
|
+
function sanitizeHTML(html) {
|
|
67344
|
+
var _a;
|
|
67345
|
+
const tagWhitelist = ['a', 'br', 'span']; // Allowed tags
|
|
67346
|
+
const attrWhitelist = ['target', 'rel', 'style', 'href']; // Allowed attributes
|
|
67347
|
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
67348
|
+
const elements = doc.body.querySelectorAll('*');
|
|
67349
|
+
for (let el of elements) {
|
|
67350
|
+
// Remove elements that are not in the whitelist
|
|
67351
|
+
if (!tagWhitelist.includes(el.tagName.toLowerCase())) {
|
|
67352
|
+
(_a = el === null || el === void 0 ? void 0 : el.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(el);
|
|
67353
|
+
continue;
|
|
67354
|
+
}
|
|
67355
|
+
// Loop through the element's attributes and remove those that are not in the whitelist
|
|
67356
|
+
Array.from(el.attributes).forEach((attr) => {
|
|
67357
|
+
if (!attrWhitelist.includes(attr.name.toLowerCase())) {
|
|
67358
|
+
el.removeAttribute(attr.name);
|
|
67359
|
+
}
|
|
67360
|
+
});
|
|
67361
|
+
}
|
|
67362
|
+
return doc.body.innerHTML;
|
|
67363
|
+
}
|
|
67364
|
+
const SafeHTMLComponent = ({ html }) => {
|
|
67365
|
+
const sanitizedHTML = sanitizeHTML(html);
|
|
67366
|
+
return jsx$2("div", { dangerouslySetInnerHTML: { __html: sanitizedHTML } });
|
|
67367
|
+
};
|
|
67368
|
+
|
|
67369
|
+
const ProjectDescription = ({ description }) => {
|
|
67370
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
67371
|
+
return (jsxs(Flex, { className: "modaltable-container description-container", children: [jsxs(Flex, { sx: { display: ['flex', 'flex', 'flex', 'none'], flexDirection: 'column' }, children: [jsx$2(Text, { sx: {
|
|
67372
|
+
fontSize: ['12px', '12px', '12px', '14px'],
|
|
67373
|
+
mt: '10px',
|
|
67374
|
+
lineHeight: ['18px', '18px', '18px', '21px'],
|
|
67375
|
+
fontWeight: 400,
|
|
67376
|
+
overflow: 'hidden',
|
|
67377
|
+
maxHeight: isOpen ? 'unset' : '54px',
|
|
67378
|
+
}, children: description && jsx$2(SafeHTMLComponent, { html: description }) }), !isOpen && (jsxs(Text, { sx: {
|
|
67379
|
+
color: 'primaryButton',
|
|
67380
|
+
fontSize: '12px',
|
|
67381
|
+
lineHeight: '18px',
|
|
67382
|
+
fontWeight: 400,
|
|
67383
|
+
cursor: 'pointer',
|
|
67384
|
+
}, onClick: () => setIsOpen(true), children: ["View More ", '>'] }))] }), jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex'] }, children: jsx$2(SafeHTMLComponent, { html: description !== null && description !== void 0 ? description : '' }) })] }));
|
|
67385
|
+
};
|
|
67386
|
+
|
|
67316
67387
|
const BondModal = ({ onDismiss, bondAddress, bondChain,
|
|
67317
67388
|
// ??
|
|
67318
67389
|
accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = false, }) => {
|
|
67319
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
|
67390
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
67391
|
+
const SDKConfig = useSDKConfig();
|
|
67392
|
+
// State
|
|
67393
|
+
const [modalVariant, setModalVariant] = useState(SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.modalVariant);
|
|
67320
67394
|
// Hooks
|
|
67321
67395
|
const userChainId = useChainId();
|
|
67322
67396
|
const { address: account } = useAccount();
|
|
@@ -67324,10 +67398,8 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
67324
67398
|
const { writeContractAsync } = useWriteContract();
|
|
67325
67399
|
const { sendTransactionAsync } = useSendTransaction();
|
|
67326
67400
|
const { data: bonds } = useBondsData();
|
|
67327
|
-
const SDKConfig = useSDKConfig();
|
|
67328
67401
|
const sendReferenceId = useSendReferenceId();
|
|
67329
67402
|
// State
|
|
67330
|
-
const [modalVariant, setModalVariant] = useState(SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.modalVariant);
|
|
67331
67403
|
const bondData = useMemo(() => bonds === null || bonds === void 0 ? void 0 : bonds.find((bond) => { var _a; return ((_a = bond === null || bond === void 0 ? void 0 : bond.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (bondAddress === null || bondAddress === void 0 ? void 0 : bondAddress.toLowerCase()); }), [bondAddress]);
|
|
67332
67404
|
const [buyTxHash, setBuyTxHash] = useState();
|
|
67333
67405
|
const [inputValue, setInputValue] = useState('');
|
|
@@ -67344,7 +67416,7 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
67344
67416
|
const estimatedOutputUSD = estimatedOutput * parseFloat((_h = bondData === null || bondData === void 0 ? void 0 : bondData.payoutTokenPrice) !== null && _h !== void 0 ? _h : '0');
|
|
67345
67417
|
const estimatedInputUSD = parseFloat(inputValue) * ((_j = inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price) !== null && _j !== void 0 ? _j : 0);
|
|
67346
67418
|
const normalPremium = premium(bondData, inputValue);
|
|
67347
|
-
|
|
67419
|
+
isZap ? formatUSDNumber((estimatedOutputUSD - estimatedInputUSD).toString()) : normalPremium;
|
|
67348
67420
|
// Loading State
|
|
67349
67421
|
const [loadingTx, setLoadingTx] = useState(false);
|
|
67350
67422
|
const { addToastError } = usePopups();
|
|
@@ -67355,15 +67427,8 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
67355
67427
|
setInputValue('');
|
|
67356
67428
|
setInputTokenString(newInputToken);
|
|
67357
67429
|
}, []);
|
|
67358
|
-
const handleClose = () => {
|
|
67359
|
-
if (typeof window !== 'undefined') {
|
|
67360
|
-
window.history.pushState({}, '', `/bonds`);
|
|
67361
|
-
}
|
|
67362
|
-
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
67363
|
-
};
|
|
67364
67430
|
// Modals
|
|
67365
67431
|
const [onOpenZapModal] = useModal(jsx$2(ZapModal, { outputToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, account: account, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId }), true, true, 'zapModal');
|
|
67366
|
-
const [onOpenSlippageModal] = useModal(jsx$2(SlippageModal, {}));
|
|
67367
67432
|
// Approve & Purchase Functions
|
|
67368
67433
|
const [approvalState, approveCallback] = useApproval(inputValue, inputToken !== null && inputToken !== void 0 ? inputToken : null, (_k = (isZap ? SoulZapTokenManager === null || SoulZapTokenManager === void 0 ? void 0 : SoulZapTokenManager[bondData === null || bondData === void 0 ? void 0 : bondData.chainId] : bondData === null || bondData === void 0 ? void 0 : bondData.billAddress)) !== null && _k !== void 0 ? _k : null, account !== null && account !== void 0 ? account : null, (_l = bondData === null || bondData === void 0 ? void 0 : bondData.chainId) !== null && _l !== void 0 ? _l : null);
|
|
67369
67434
|
const handleBuyCallback = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
@@ -67431,12 +67496,10 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
67431
67496
|
window.open(`https://ape.bond/swap?outputcurrency=${bondData === null || bondData === void 0 ? void 0 : bondData.lpToken.address[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]}&outputChain=${bondData === null || bondData === void 0 ? void 0 : bondData.chainId}`, '_blank');
|
|
67432
67497
|
}
|
|
67433
67498
|
};
|
|
67434
|
-
return (jsx$2(Modal, { className: "modal", children:
|
|
67435
|
-
? `${vestingTime((_u = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _u !== void 0 ? _u : 0).days} D`
|
|
67436
|
-
: '-' })] }), jsxs(Flex, { className: "modal-block block-maxbuy", children: [jsxs(Flex, { className: "block-header", children: ["Max Buy", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.MaxBuy(bondData.earnToken.symbol) }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2(Flex, { className: "header-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsxs(Flex, { className: "block-content", children: [jsx$2(Flex, { sx: { pr: '3px' }, children: jsx$2(TokenImage, { symbol: (_v = bondData.showcaseTokenName) !== null && _v !== void 0 ? _v : bondData.earnToken.symbol, size: 20 }) }), (_w = parseFloat(maxBuy(bondData).toFixed(0))) === null || _w === void 0 ? void 0 : _w.toLocaleString('en-US')] })] })] }), jsxs(Flex, { className: "modaltable-container text-container", children: [jsxs(Flex, { className: "text-container row", children: [jsx$2(Flex, { className: "row-container spend", children: "You spend:" }), jsxs(Flex, { className: "row-container spend-val", children: [youSpend(inputValue), " ", getSymbol(inputToken, bondData.chainId), " = $", ' ', formatUSDNumber(estimatedInputUSD === null || estimatedInputUSD === void 0 ? void 0 : estimatedInputUSD.toString())] })] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["Premium:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Premium }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val ${getPremiumColor(premiumString)}`, children: ["$ ", premiumString] }))] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You get (over ", vestingTime((_x = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _x !== void 0 ? _x : 0).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumber$1(estimatedOutput.toString()), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatUSDNumber(estimatedOutputUSD.toString())] }))] })] }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleMaxBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }), jsxs(Flex, { className: "modaltable-container button-container", children: [jsx$2(Flex, { className: "button-container get", children: jsxs(Button, { className: "action-button", onClick: () => (supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId) ? onOpenZapModal() : openExternal()), variant: "secondary", children: ["Get ", getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)] }) }), jsx$2(Flex, { className: "button-container buy", children: !account ? (jsx$2(ConnectButton, {})) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
|
|
67499
|
+
return (jsx$2(Modal, { className: "modal", children: modalVariant === 'standard' ? (jsx$2(Fragment$1, { children: bondData && (jsxs(Flex, { className: "modal-content", children: [window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white', fontSize: '14px', mb: '10px' }, children: ["Dev mode - Current view: \"standard\"", jsx$2(Text, { onClick: () => setModalVariant('alt'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), jsx$2(BondCards, { bondData: bondData }), jsx$2(Estimations, { bondData: bondData, inputValue: inputValue, inputToken: inputToken, estimatedOutput: estimatedOutput, inputTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleMaxBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }), jsxs(Flex, { className: "modaltable-container button-container", children: [jsx$2(Flex, { className: "button-container get", children: jsxs(Button, { className: "action-button", onClick: () => (supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId) ? onOpenZapModal() : openExternal()), variant: "secondary", children: ["Get ", getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)] }) }), jsx$2(Flex, { className: "button-container buy", children: !account ? (jsx$2(ConnectButton, {})) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
|
|
67437
67500
|
event.stopPropagation();
|
|
67438
67501
|
switchChain({ chainId: bondData.chainId });
|
|
67439
|
-
}, children: `Switch to ${NETWORK_LABEL[bondData.chainId]}` })) : approvalState === ApprovalState.APPROVED ? (jsx$2(Button, { className: "action-button", load: load || fetchingZapQuote, disabled: load ||
|
|
67502
|
+
}, style: { fontSize: '14px', padding: '6px', marginLeft: '0px' }, children: `Switch to ${NETWORK_LABEL[bondData.chainId]}` })) : approvalState === ApprovalState.APPROVED ? (jsx$2(Button, { className: "action-button", load: load || fetchingZapQuote, disabled: load ||
|
|
67440
67503
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
67441
67504
|
!account ||
|
|
67442
67505
|
!inputValue ||
|
|
@@ -67446,15 +67509,7 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
67446
67509
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
67447
67510
|
!account ||
|
|
67448
67511
|
!inputValue ||
|
|
67449
|
-
parseFloat(inputValue) === 0, onClick: approveCallback, children: ["approve ", isZap ? 'zap' : 'normal'] })) })] }), accordionVisible && (jsx$2(Flex, { className: "modaltable-container accordion-container", children: jsx$2(AccordionText, { title: accordionTitle, body: accordionBody, isVisible: accordionVisible }) }))] })] })) : (
|
|
67450
|
-
// </Flex>
|
|
67451
|
-
//
|
|
67452
|
-
//
|
|
67453
|
-
// ALTERNATIVE VIEW!!
|
|
67454
|
-
//
|
|
67455
|
-
//
|
|
67456
|
-
// <Flex className="modal-backdrop" onClick={handleClose}>
|
|
67457
|
-
jsxs(Flex, { className: "modal-content font-small gpt", children: [window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white' }, children: ["Dev Mode - Current view: \"", modalVariant, "\"", jsx$2(Text, { onClick: () => setModalVariant('standard'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), jsx$2(Flex, { className: "modal-header" }), jsxs(Flex, { className: "modaltable-container", sx: { flexDirection: 'row', gap: '20px' }, children: [jsxs(Flex, { sx: { width: '500px', flexDirection: 'column' }, children: [jsx$2("img", { src: "https://placehold.co/400x200" }), jsx$2(Flex, { className: "modaltable-container description-container paragraph-spaced", sx: { marginTop: '20px' }, children: bondData === null || bondData === void 0 ? void 0 : bondData.shortDescription })] }), jsxs(Flex, { sx: { flexDirection: 'column', width: '600px' }, children: [jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(Flex, { sx: { minWidth: '300px' }, children: jsxs("h2", { sx: { margin: '0px' }, children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, ' ', jsx$2(Svg, { width: 20, height: 20, icon: (_y = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bondData.chainId]) !== null && _y !== void 0 ? _y : 'question' })] }) }), jsxs(Flex, { sx: { justifyContent: 'space-between', flexGrow: 1 }, children: [jsx$2(TokenImage, { symbol: (_z = bondData.showcaseTokenName) !== null && _z !== void 0 ? _z : bondData.earnToken.symbol, size: 20 }), jsx$2("span", { children: bondData.earnToken.symbol }), " ", jsx$2("span", { children: "|" }), ' ', jsxs("span", { children: ["Market Price: $", earnTokenPrice(bondData)] })] })] }), jsxs(Flex, { sx: { flexDirection: 'column', marginTop: '20px' }, children: [jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleMaxBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: true, bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }), jsxs(Flex, { sx: { justifyContent: 'space-between', alignItems: 'center' }, children: [jsxs(Flex, { children: ["You will receive:", jsx$2(Flex, { sx: { marginLeft: '15px', marginRight: '5px' }, children: jsx$2(TokenImage, { symbol: (_0 = bondData.showcaseTokenName) !== null && _0 !== void 0 ? _0 : bondData.earnToken.symbol, size: 20 }) }), (lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0), ' ', bondData.earnToken.symbol, " + \u00A0", (youGet(bondData, inputValue) -
|
|
67512
|
+
parseFloat(inputValue) === 0, onClick: approveCallback, children: ["approve ", isZap ? 'zap' : 'normal'] })) })] }), accordionVisible && (jsx$2(Flex, { className: "modaltable-container accordion-container", children: jsx$2(AccordionText, { title: accordionTitle, body: accordionBody, isVisible: accordionVisible }) }))] })] })) })) : (jsx$2(Fragment$1, { children: bondData && (jsxs(Flex, { className: "modal-content font-small gpt", children: [window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white' }, children: ["Dev Mode - Current view: \"alt\"", jsx$2(Text, { onClick: () => setModalVariant('standard'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), jsx$2(Flex, { className: "modal-header" }), jsxs(Flex, { className: "modaltable-container", sx: { flexDirection: 'row', gap: '20px' }, children: [jsxs(Flex, { sx: { width: '500px', flexDirection: 'column' }, children: [jsx$2("img", { src: "https://placehold.co/400x200" }), jsx$2(Flex, { className: "modaltable-container description-container paragraph-spaced", sx: { marginTop: '20px' }, children: bondData === null || bondData === void 0 ? void 0 : bondData.shortDescription })] }), jsxs(Flex, { sx: { flexDirection: 'column', width: '600px' }, children: [jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(Flex, { sx: { minWidth: '300px' }, children: jsxs("h2", { sx: { margin: '0px' }, children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, ' ', jsx$2(Svg, { width: 20, height: 20, icon: (_m = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bondData.chainId]) !== null && _m !== void 0 ? _m : 'question' })] }) }), jsxs(Flex, { sx: { justifyContent: 'space-between', flexGrow: 1 }, children: [jsx$2(TokenImage, { symbol: (_o = bondData.showcaseTokenName) !== null && _o !== void 0 ? _o : bondData.earnToken.symbol, size: 20 }), jsx$2("span", { children: bondData.earnToken.symbol }), " ", jsx$2("span", { children: "|" }), ' ', jsxs("span", { children: ["Market Price: $", earnTokenPrice(bondData)] })] })] }), jsxs(Flex, { sx: { flexDirection: 'column', marginTop: '20px' }, children: [jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleMaxBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: true, bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }), jsxs(Flex, { sx: { justifyContent: 'space-between', alignItems: 'center' }, children: [jsxs(Flex, { children: ["You will receive:", jsx$2(Flex, { sx: { marginLeft: '15px', marginRight: '5px' }, children: jsx$2(TokenImage, { symbol: (_p = bondData.showcaseTokenName) !== null && _p !== void 0 ? _p : bondData.earnToken.symbol, size: 20 }) }), (lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0), ' ', bondData.earnToken.symbol, " + \u00A0", (youGet(bondData, inputValue) -
|
|
67458
67513
|
lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0), jsx$2("span", { className: "text-highlight", children: "\u00A0additional" })] }), jsx$2(Flex, { className: "button-container buy", sx: { justifyContent: 'end' }, children: !account ? (jsx$2(ConnectButton, {})) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button button-narrow", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
|
|
67459
67514
|
event.stopPropagation();
|
|
67460
67515
|
switchChain({ chainId: bondData.chainId });
|
|
@@ -67462,7 +67517,7 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
67462
67517
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
67463
67518
|
!account ||
|
|
67464
67519
|
!inputValue ||
|
|
67465
|
-
parseFloat(inputValue) === 0, onClick: approveCallback, children: ["approve ", isZap ? 'zap' : 'normal'] })) })] }), jsx$2(Flex, { sx: { width: '100%', marginTop: '10px', marginBottom: '10px' }, children: jsx$2("hr", { className: "fading-hr" }) }), jsxs(Flex, { sx: { width: '100%' }, children: [jsxs(Flex, { sx: { width: '50%', flexDirection: 'column' }, children: ["Market Price: $", formatUSDNumber((youGet(bondData, inputValue) * lodashExports.toNumber(earnTokenPrice(bondData))).toString()), jsx$2("hr", { className: "fading-hr" }), jsx$2("span", { className: "text-highlight flex-inline", children: "Our price: " }), jsxs("span", { className: "flex-inline", children: ["$", formatUSDNumber((lodashExports.toNumber(inputValue) * lodashExports.toNumber(bondData.principalTokenPrice)).toString()), ' '] }), jsxs("span", { className: "text-highlight flex-inline", children: ["(discount rate ", bondData === null || bondData === void 0 ? void 0 : bondData.discount.toFixed(2), "%)"] })] }), jsx$2(Flex, { sx: { width: '50px', alignItems: 'center', justifyContent: 'center' }, children: "vs." }), jsxs(Flex, { sx: { width: '50%', flexDirection: 'column' }, children: ["If purchased from market:", ' ', (lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0), ' ', bondData.earnToken.symbol, jsx$2("hr", { className: "fading-hr" }), jsx$2("span", { className: "text-highlight flex-inline", children: "Amount you will get:" }), ' ', youGet(bondData, inputValue).toFixed(0), ' ', jsx$2("span", { className: "flex-inline", children: bondData.earnToken.symbol })] })] })] })] })] }), jsxs(Flex, { className: "footer-details", children: [jsxs(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: ["Vesting start date:", ' ', new Intl.DateTimeFormat('en-GB', { day: '2-digit', month: 'short', year: 'numeric' }).format(new Date())] }), jsxs(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: ["Vesting end date:", ' ', new Intl.DateTimeFormat('en-GB', { day: '2-digit', month: 'short', year: 'numeric' }).format(new Date(Date.now() + vestingTime((
|
|
67520
|
+
parseFloat(inputValue) === 0, onClick: approveCallback, children: ["approve ", isZap ? 'zap' : 'normal'] })) })] }), jsx$2(Flex, { sx: { width: '100%', marginTop: '10px', marginBottom: '10px' }, children: jsx$2("hr", { className: "fading-hr" }) }), jsxs(Flex, { sx: { width: '100%' }, children: [jsxs(Flex, { sx: { width: '50%', flexDirection: 'column' }, children: ["Market Price: $", formatUSDNumber((youGet(bondData, inputValue) * lodashExports.toNumber(earnTokenPrice(bondData))).toString()), jsx$2("hr", { className: "fading-hr" }), jsx$2("span", { className: "text-highlight flex-inline", children: "Our price: " }), jsxs("span", { className: "flex-inline", children: ["$", formatUSDNumber((lodashExports.toNumber(inputValue) * lodashExports.toNumber(bondData.principalTokenPrice)).toString()), ' '] }), jsxs("span", { className: "text-highlight flex-inline", children: ["(discount rate ", bondData === null || bondData === void 0 ? void 0 : bondData.discount.toFixed(2), "%)"] })] }), jsx$2(Flex, { sx: { width: '50px', alignItems: 'center', justifyContent: 'center' }, children: "vs." }), jsxs(Flex, { sx: { width: '50%', flexDirection: 'column' }, children: ["If purchased from market:", ' ', (lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0), ' ', bondData.earnToken.symbol, jsx$2("hr", { className: "fading-hr" }), jsx$2("span", { className: "text-highlight flex-inline", children: "Amount you will get:" }), ' ', youGet(bondData, inputValue).toFixed(0), ' ', jsx$2("span", { className: "flex-inline", children: bondData.earnToken.symbol })] })] })] })] })] }), jsxs(Flex, { className: "footer-details", children: [jsxs(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: ["Vesting start date:", ' ', new Intl.DateTimeFormat('en-GB', { day: '2-digit', month: 'short', year: 'numeric' }).format(new Date())] }), jsxs(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: ["Vesting end date:", ' ', new Intl.DateTimeFormat('en-GB', { day: '2-digit', month: 'short', year: 'numeric' }).format(new Date(Date.now() + vestingTime((_q = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _q !== void 0 ? _q : 0).days * 86400000))] }), jsx$2(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: "Vesting type: Linear" }), jsx$2(Flex, { sx: { width: '25%', justifyContent: 'center' }, children: "What are bonds?" })] }), accordionVisible && (jsx$2(Flex, { className: "modaltable-container accordion-container", children: jsx$2(AccordionText, { title: accordionTitle, body: accordionBody, isVisible: accordionVisible }) }))] })) })) }));
|
|
67466
67521
|
};
|
|
67467
67522
|
|
|
67468
67523
|
/** CheckURL purpose is to open the buy bond modal ONLY IF a user has opened the site with a custom URL */
|
|
@@ -67781,7 +67836,7 @@ const BondRow = ({ bond }) => {
|
|
|
67781
67836
|
const tokens = new BigNumber$1(tokensRemaining);
|
|
67782
67837
|
return tokens.times(payoutTokenPrice);
|
|
67783
67838
|
};
|
|
67784
|
-
return (jsxs(
|
|
67839
|
+
return (jsxs("div", { className: "bond-row", onClick: handleOpenModal, children: [jsx$2("div", { className: "token-info-container", children: jsx$2(TokenInfoAndName, { bill: bond }) }), jsxs("div", { className: "bond-info-columns", children: [jsx$2("div", { className: "discount-column", style: { color: getDiscountColor(discount) }, children: discount !== undefined ? `${discount === null || discount === void 0 ? void 0 : discount.toFixed(2)}%` : '-' }), jsx$2("div", { className: "arr-column", children: calculateARR(bond) !== undefined ? calculateARR(bond) : '-' }), jsx$2("div", { className: "terms-column", children: ((_a = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _a === void 0 ? void 0 : _a.days) ? `${(_b = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _b === void 0 ? void 0 : _b.days} D` : '-' }), jsx$2("div", { className: "tokens-remaining-column", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: remainingPercentage(bond) }), style: {
|
|
67785
67840
|
width: '127px',
|
|
67786
67841
|
height: '25px',
|
|
67787
67842
|
flexDirection: 'column',
|
|
@@ -67790,7 +67845,7 @@ const BondRow = ({ bond }) => {
|
|
|
67790
67845
|
}, showTooltip: true, toolTip: `${remainingTokensFormat(bond)} ${bond.earnToken.symbol} (${formatDollar({
|
|
67791
67846
|
num: remainingTokensUsd(bond).toNumber(),
|
|
67792
67847
|
isPrice: true,
|
|
67793
|
-
})})` }) }), jsx$2(
|
|
67848
|
+
})})` }) }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Tooltip, { tokenContract: (bond === null || bond === void 0 ? void 0 : bond.earnToken.address[bond.chainId]) || '', secondURL: getBillContractURL(bond), secondURLTitle: 'View Bond Contract', thirdURL: `https://dashboard.ape.bond/bond/${billAddress === null || billAddress === void 0 ? void 0 : billAddress.toLowerCase()}`, thirdURLTitle: 'View Insights', twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: (_c = bond.chainId) !== null && _c !== void 0 ? _c : types.ChainId.BSC }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Svg, { icon: "more", width: "25px" }) }) })] })] }, billAddress));
|
|
67794
67849
|
};
|
|
67795
67850
|
|
|
67796
67851
|
const SwiperContext$1 = createContext({
|
|
@@ -67829,11 +67884,13 @@ const styles$5 = {
|
|
|
67829
67884
|
width: '100%',
|
|
67830
67885
|
justifyContent: 'space-between',
|
|
67831
67886
|
flexDirection: ['column', 'column', 'column', 'row'],
|
|
67832
|
-
display:
|
|
67887
|
+
display: 'none',
|
|
67888
|
+
'@media screen and (min-width: 1000px)': {
|
|
67889
|
+
display: 'flex',
|
|
67890
|
+
},
|
|
67833
67891
|
},
|
|
67834
67892
|
desktopCard: {
|
|
67835
67893
|
width: '100%',
|
|
67836
|
-
pl: '20px',
|
|
67837
67894
|
background: 'white3',
|
|
67838
67895
|
borderRadius: 'normal',
|
|
67839
67896
|
cursor: 'pointer',
|
|
@@ -73458,8 +73515,11 @@ const HotBondCards = () => {
|
|
|
73458
73515
|
width: '100%',
|
|
73459
73516
|
alignItems: 'center',
|
|
73460
73517
|
mb: '15px',
|
|
73461
|
-
display: ['flex', 'flex', 'flex', 'none'],
|
|
73462
73518
|
overflow: 'hidden',
|
|
73519
|
+
display: 'flex',
|
|
73520
|
+
'@media screen and (min-width: 1000px)': {
|
|
73521
|
+
display: 'none',
|
|
73522
|
+
},
|
|
73463
73523
|
}, children: [jsx$2(Swiper, { id: "hotbondsSweper", onSwiper: setSwiper, slidesPerView: "auto", centeredSlides: true, lazy: true, preloadImages: false, onSlideChange: handleSlide, style: { width: '100%', paddingBottom: '15px', overflow: 'visible' }, children: filteredBonds === null || filteredBonds === void 0 ? void 0 : filteredBonds.map((bond, index) => {
|
|
73464
73524
|
return (jsx$2(SwiperSlide, { style: {
|
|
73465
73525
|
width: '100%',
|
|
@@ -73670,7 +73730,7 @@ const BondsMenu = ({ searchQuery, setSearchQuery, setChainFilterOption, chainFil
|
|
|
73670
73730
|
height: '30px',
|
|
73671
73731
|
fontSize: '14px',
|
|
73672
73732
|
color: 'white',
|
|
73673
|
-
}, placeholder: 'Search...' }), jsx$2(FavIcon, { filterOption: filterOption, setFilterOption: setFilterOption })] }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "discount-header", onClick: () => onSort('discount'), children: ["DISCOUNT", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: 10, color: "textDisabledButton" }) })] }), jsxs("div", { className: "header
|
|
73733
|
+
}, placeholder: 'Search...' }), jsx$2(FavIcon, { filterOption: filterOption, setFilterOption: setFilterOption })] }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "discount-header", onClick: () => onSort('discount'), children: ["DISCOUNT", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: 10, color: "textDisabledButton" }) })] }), jsxs("div", { className: "arr-header", onClick: () => onSort('arr'), children: ["ARR", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "terms-header", onClick: () => onSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "tokens-remaining-header", onClick: () => onSort('tokensRemaining'), children: ["TOKENS REMAINING", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2("div", { className: "tooltip-header" })] })] })] }));
|
|
73674
73734
|
};
|
|
73675
73735
|
|
|
73676
73736
|
const Bonds = ({ chains = [] }) => {
|
package/dist/styles.css
CHANGED
|
@@ -61,17 +61,74 @@
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
.
|
|
65
|
-
position: fixed;
|
|
66
|
-
top: 0;
|
|
67
|
-
left: 0;
|
|
68
|
-
width: 100%;
|
|
69
|
-
height: 100%;
|
|
70
|
-
background-color: rgba(66, 66, 66, 0.5);
|
|
64
|
+
.bonds-cards {
|
|
71
65
|
display: flex;
|
|
72
|
-
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
}
|
|
68
|
+
@media screen and (min-width: 800px) {
|
|
69
|
+
.bonds-cards {
|
|
70
|
+
flex-direction: row;
|
|
71
|
+
gap: 5px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
.bonds-cards .bond-card-block {
|
|
75
|
+
display: flex;
|
|
76
|
+
padding: 8px 12px;
|
|
77
|
+
background: var(--theme-ui-colors-white3);
|
|
78
|
+
width: 100%;
|
|
73
79
|
align-items: center;
|
|
74
|
-
|
|
80
|
+
justify-content: space-between;
|
|
81
|
+
margin-bottom: 1px;
|
|
82
|
+
}
|
|
83
|
+
@media screen and (min-width: 800px) {
|
|
84
|
+
.bonds-cards .bond-card-block {
|
|
85
|
+
width: 350px;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
border-radius: 10px;
|
|
88
|
+
padding: 12px;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
.bonds-cards .bond-card-block .bond-card-title {
|
|
92
|
+
display: flex;
|
|
93
|
+
color: white;
|
|
94
|
+
font-weight: 400;
|
|
95
|
+
font-size: 12px;
|
|
96
|
+
}
|
|
97
|
+
@media screen and (min-width: 800px) {
|
|
98
|
+
.bonds-cards .bond-card-block .bond-card-title {
|
|
99
|
+
padding-bottom: 5px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
.bonds-cards .bond-card-block .bond-card-tooltip {
|
|
103
|
+
padding-left: 5px;
|
|
104
|
+
align-items: flex-start;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
}
|
|
107
|
+
.bonds-cards .bond-card-block .bond-card-content {
|
|
108
|
+
display: flex;
|
|
109
|
+
font-size: 12px;
|
|
110
|
+
font-weight: 700;
|
|
111
|
+
}
|
|
112
|
+
@media screen and (min-width: 800px) {
|
|
113
|
+
.bonds-cards .bond-card-block .bond-card-content {
|
|
114
|
+
font-size: 16px;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
.bonds-cards .bond-card-block:first-child {
|
|
118
|
+
border-top-right-radius: 10px;
|
|
119
|
+
border-top-left-radius: 10px;
|
|
120
|
+
}
|
|
121
|
+
.bonds-cards .bond-card-block:last-of-type {
|
|
122
|
+
border-bottom-right-radius: 10px;
|
|
123
|
+
border-bottom-left-radius: 10px;
|
|
124
|
+
}
|
|
125
|
+
.bonds-cards .hide-mobile {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
@media screen and (min-width: 800px) {
|
|
129
|
+
.bonds-cards .hide-mobile {
|
|
130
|
+
display: flex;
|
|
131
|
+
}
|
|
75
132
|
}
|
|
76
133
|
|
|
77
134
|
.modal {
|
|
@@ -115,7 +172,6 @@
|
|
|
115
172
|
display: flex;
|
|
116
173
|
flex-direction: row;
|
|
117
174
|
align-items: center;
|
|
118
|
-
padding-bottom: 5px;
|
|
119
175
|
}
|
|
120
176
|
|
|
121
177
|
.title-container.bondicon {
|
|
@@ -158,9 +214,9 @@
|
|
|
158
214
|
|
|
159
215
|
.title-container.bondname {
|
|
160
216
|
display: flex;
|
|
161
|
-
flex-direction:
|
|
217
|
+
flex-direction: column;
|
|
162
218
|
align-items: center;
|
|
163
|
-
padding-left:
|
|
219
|
+
padding-left: 20px;
|
|
164
220
|
}
|
|
165
221
|
|
|
166
222
|
.title-container.bondname-small {
|
|
@@ -173,7 +229,7 @@
|
|
|
173
229
|
.title-container.price-container {
|
|
174
230
|
display: flex;
|
|
175
231
|
flex-direction: column;
|
|
176
|
-
padding-left:
|
|
232
|
+
padding-left: 20px;
|
|
177
233
|
}
|
|
178
234
|
|
|
179
235
|
.price-container.price {
|
|
@@ -221,7 +277,7 @@
|
|
|
221
277
|
font-size: 16px;
|
|
222
278
|
border-radius: 10px;
|
|
223
279
|
height: 90%;
|
|
224
|
-
padding:
|
|
280
|
+
padding: 13px;
|
|
225
281
|
}
|
|
226
282
|
|
|
227
283
|
.block-header {
|
|
@@ -239,7 +295,6 @@
|
|
|
239
295
|
|
|
240
296
|
.block-content {
|
|
241
297
|
align-items: center;
|
|
242
|
-
padding-bottom: 10px;
|
|
243
298
|
font-weight: 700;
|
|
244
299
|
}
|
|
245
300
|
|
|
@@ -539,20 +594,80 @@ span.flex-inline {
|
|
|
539
594
|
fill: #38A611;
|
|
540
595
|
}
|
|
541
596
|
|
|
542
|
-
.
|
|
597
|
+
.bond-row {
|
|
543
598
|
display: flex;
|
|
544
599
|
flex-direction: row;
|
|
545
600
|
width: 100%;
|
|
546
601
|
height: 70px;
|
|
547
602
|
justify-content: space-around;
|
|
548
603
|
background-color: var(--theme-ui-colors-white2);
|
|
549
|
-
margin-bottom: 5px;
|
|
550
604
|
border-radius: 10px;
|
|
551
605
|
cursor: pointer;
|
|
606
|
+
margin-bottom: 5px;
|
|
552
607
|
}
|
|
553
|
-
.
|
|
608
|
+
.bond-row:hover {
|
|
554
609
|
background-color: var(--theme-ui-colors-white3);
|
|
555
610
|
}
|
|
611
|
+
.bond-row .token-info-container {
|
|
612
|
+
display: flex;
|
|
613
|
+
width: 50%;
|
|
614
|
+
}
|
|
615
|
+
.bond-row .bond-info-columns {
|
|
616
|
+
display: flex;
|
|
617
|
+
flex-direction: row;
|
|
618
|
+
align-items: center;
|
|
619
|
+
width: 50%;
|
|
620
|
+
justify-content: flex-end;
|
|
621
|
+
}
|
|
622
|
+
@media screen and (min-width: 1000px) {
|
|
623
|
+
.bond-row .bond-info-columns {
|
|
624
|
+
justify-content: space-between;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
.bond-row .bond-info-columns .discount-column {
|
|
628
|
+
display: flex;
|
|
629
|
+
width: 85px;
|
|
630
|
+
align-items: flex-end;
|
|
631
|
+
justify-content: center;
|
|
632
|
+
}
|
|
633
|
+
.bond-row .bond-info-columns .arr-column {
|
|
634
|
+
display: none;
|
|
635
|
+
width: 85px;
|
|
636
|
+
align-items: flex-end;
|
|
637
|
+
justify-content: center;
|
|
638
|
+
}
|
|
639
|
+
@media screen and (min-width: 1000px) {
|
|
640
|
+
.bond-row .bond-info-columns .arr-column {
|
|
641
|
+
display: flex;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
.bond-row .bond-info-columns .terms-column {
|
|
645
|
+
display: none;
|
|
646
|
+
width: 85px;
|
|
647
|
+
align-items: flex-end;
|
|
648
|
+
justify-content: center;
|
|
649
|
+
}
|
|
650
|
+
@media screen and (min-width: 1000px) {
|
|
651
|
+
.bond-row .bond-info-columns .terms-column {
|
|
652
|
+
display: flex;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
.bond-row .bond-info-columns .tokens-remaining-column {
|
|
656
|
+
display: none;
|
|
657
|
+
width: 135px;
|
|
658
|
+
align-items: flex-end;
|
|
659
|
+
justify-content: center;
|
|
660
|
+
}
|
|
661
|
+
@media screen and (min-width: 1000px) {
|
|
662
|
+
.bond-row .bond-info-columns .tokens-remaining-column {
|
|
663
|
+
display: flex;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
.bond-row .bond-info-columns .tooltip-column {
|
|
667
|
+
width: 50px;
|
|
668
|
+
display: flex;
|
|
669
|
+
opacity: 0.8;
|
|
670
|
+
}
|
|
556
671
|
|
|
557
672
|
.column.column-tokens {
|
|
558
673
|
display: flex;
|
|
@@ -656,43 +771,61 @@ span.flex-inline {
|
|
|
656
771
|
.bonds-menu .headers-container {
|
|
657
772
|
display: flex;
|
|
658
773
|
width: 50%;
|
|
659
|
-
|
|
660
|
-
|
|
774
|
+
opacity: 0.6;
|
|
775
|
+
justify-content: flex-end;
|
|
776
|
+
}
|
|
777
|
+
@media screen and (min-width: 1000px) {
|
|
778
|
+
.bonds-menu .headers-container {
|
|
779
|
+
justify-content: space-between;
|
|
780
|
+
}
|
|
661
781
|
}
|
|
662
782
|
.bonds-menu .discount-header {
|
|
663
783
|
display: flex;
|
|
664
784
|
width: 85px;
|
|
665
785
|
align-items: flex-end;
|
|
786
|
+
justify-content: center;
|
|
787
|
+
cursor: pointer;
|
|
666
788
|
}
|
|
667
|
-
.bonds-menu .header
|
|
789
|
+
.bonds-menu .arr-header {
|
|
668
790
|
display: none;
|
|
669
791
|
width: 85px;
|
|
670
792
|
align-items: flex-end;
|
|
793
|
+
justify-content: center;
|
|
794
|
+
cursor: pointer;
|
|
671
795
|
}
|
|
672
796
|
@media screen and (min-width: 1000px) {
|
|
673
|
-
.bonds-menu .header
|
|
797
|
+
.bonds-menu .arr-header {
|
|
674
798
|
display: flex;
|
|
675
799
|
}
|
|
676
800
|
}
|
|
677
|
-
.bonds-menu .
|
|
801
|
+
.bonds-menu .terms-header {
|
|
678
802
|
display: none;
|
|
679
|
-
width:
|
|
803
|
+
width: 85px;
|
|
680
804
|
align-items: flex-end;
|
|
805
|
+
justify-content: center;
|
|
806
|
+
cursor: pointer;
|
|
681
807
|
}
|
|
682
808
|
@media screen and (min-width: 1000px) {
|
|
683
|
-
.bonds-menu .
|
|
809
|
+
.bonds-menu .terms-header {
|
|
684
810
|
display: flex;
|
|
685
811
|
}
|
|
686
812
|
}
|
|
687
|
-
.bonds-menu .
|
|
688
|
-
width: 50px;
|
|
813
|
+
.bonds-menu .tokens-remaining-header {
|
|
689
814
|
display: none;
|
|
815
|
+
width: 135px;
|
|
816
|
+
align-items: flex-end;
|
|
817
|
+
justify-content: center;
|
|
818
|
+
cursor: pointer;
|
|
690
819
|
}
|
|
691
820
|
@media screen and (min-width: 1000px) {
|
|
692
|
-
.bonds-menu .
|
|
821
|
+
.bonds-menu .tokens-remaining-header {
|
|
693
822
|
display: flex;
|
|
694
823
|
}
|
|
695
824
|
}
|
|
825
|
+
.bonds-menu .tooltip-header {
|
|
826
|
+
width: 50px;
|
|
827
|
+
display: flex;
|
|
828
|
+
}
|
|
696
829
|
|
|
697
830
|
.bonds-menu-header.filters {
|
|
698
831
|
display: flex;
|
|
@@ -839,7 +972,6 @@ span.flex-inline {
|
|
|
839
972
|
justify-content: space-between;
|
|
840
973
|
height: 100%;
|
|
841
974
|
align-items: center;
|
|
842
|
-
margin-left: -30px;
|
|
843
975
|
padding-left: 20px;
|
|
844
976
|
overflow: hidden;
|
|
845
977
|
border-radius: 10px;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Token } from '@ape.swap/apeswap-lists';
|
|
3
|
+
import { BondsData } from '../../../types/bonds';
|
|
4
|
+
declare const Estimations: ({ bondData, inputValue, inputToken, estimatedOutput, inputTokenPrice, isZap, fetchingZapQuote, zapError, }: {
|
|
5
|
+
bondData: BondsData;
|
|
6
|
+
inputValue: string;
|
|
7
|
+
inputToken: Token | "NATIVE" | undefined;
|
|
8
|
+
estimatedOutput: number;
|
|
9
|
+
inputTokenPrice?: number;
|
|
10
|
+
isZap?: boolean;
|
|
11
|
+
fetchingZapQuote?: boolean;
|
|
12
|
+
zapError?: boolean;
|
|
13
|
+
}) => React.JSX.Element;
|
|
14
|
+
export default Estimations;
|