@ape.swap/bonds-sdk 4.5.7-test.0 → 4.5.7
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/Tooltip/ButtonsRow.d.ts +3 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -1
- package/dist/components/uikit-sdk/Svg/Icons/Bubble.d.ts +4 -0
- package/dist/components/uikit-sdk/Svg/types.d.ts +1 -2
- package/dist/main.js +39 -47
- package/dist/state/historicalPrice/useHistoricalPrice.d.ts +2 -2
- package/dist/views/Bonds/components/BondRows/BondRow.d.ts +0 -1
- package/package.json +6 -6
- package/dist/components/uikit-sdk/Svg/Icons/CoinGecko.d.ts +0 -4
- package/dist/components/uikit-sdk/Svg/Icons/DexScreener.d.ts +0 -4
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ChainId } from '@ape.swap/apeswap-lists';
|
|
2
3
|
declare const ButtonsRow: React.FC<{
|
|
3
4
|
projectLink?: string;
|
|
4
5
|
twitter?: string;
|
|
5
|
-
|
|
6
|
+
bubble?: string;
|
|
6
7
|
audit?: string;
|
|
7
|
-
|
|
8
|
+
chain?: ChainId;
|
|
8
9
|
}>;
|
|
9
10
|
export default ButtonsRow;
|
package/dist/main.js
CHANGED
|
@@ -4240,8 +4240,7 @@ var icons;
|
|
|
4240
4240
|
icons["EXPAND"] = "expand";
|
|
4241
4241
|
icons["LINE_CHART"] = "lineChart";
|
|
4242
4242
|
icons["URL"] = "URL";
|
|
4243
|
-
icons["
|
|
4244
|
-
icons["COINGECKO"] = "coingecko";
|
|
4243
|
+
icons["BUBBLE"] = "bubble";
|
|
4245
4244
|
icons["AUDIT"] = "audit";
|
|
4246
4245
|
icons["FIRE"] = "fire";
|
|
4247
4246
|
icons["TAG"] = "tag";
|
|
@@ -4625,7 +4624,7 @@ const URL$1 = ({ direction = 'down', color = 'text', width, getStyles }) => {
|
|
|
4625
4624
|
return (jsx$2("svg", { width: width || '11', height: "24", viewBox: "0 0 24 24", sx: style, children: jsx$2("path", { d: "M11.99 2C6.47 2 2 6.48 2 12C2 17.52 6.47 22 11.99 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 11.99 2ZM18.92 8H15.97C15.65 6.75 15.19 5.55 14.59 4.44C16.43 5.07 17.96 6.35 18.92 8ZM12 4.04C12.83 5.24 13.48 6.57 13.91 8H10.09C10.52 6.57 11.17 5.24 12 4.04ZM4.26 14C4.1 13.36 4 12.69 4 12C4 11.31 4.1 10.64 4.26 10H7.64C7.56 10.66 7.5 11.32 7.5 12C7.5 12.68 7.56 13.34 7.64 14H4.26ZM5.08 16H8.03C8.35 17.25 8.81 18.45 9.41 19.56C7.57 18.93 6.04 17.66 5.08 16ZM8.03 8H5.08C6.04 6.34 7.57 5.07 9.41 4.44C8.81 5.55 8.35 6.75 8.03 8ZM12 19.96C11.17 18.76 10.52 17.43 10.09 16H13.91C13.48 17.43 12.83 18.76 12 19.96ZM14.34 14H9.66C9.57 13.34 9.5 12.68 9.5 12C9.5 11.32 9.57 10.65 9.66 10H14.34C14.43 10.65 14.5 11.32 14.5 12C14.5 12.68 14.43 13.34 14.34 14ZM14.59 19.56C15.19 18.45 15.65 17.25 15.97 16H18.92C17.96 17.65 16.43 18.93 14.59 19.56ZM16.36 14C16.44 13.34 16.5 12.68 16.5 12C16.5 11.32 16.44 10.66 16.36 10H19.74C19.9 10.64 20 11.31 20 12C20 12.69 19.9 13.36 19.74 14H16.36Z" }) }));
|
|
4626
4625
|
};
|
|
4627
4626
|
|
|
4628
|
-
const
|
|
4627
|
+
const Bubble = ({ direction = 'down', color = 'text', width, getStyles }) => {
|
|
4629
4628
|
const deg = {
|
|
4630
4629
|
left: 90,
|
|
4631
4630
|
up: 180,
|
|
@@ -4636,21 +4635,7 @@ const DexScreener = ({ direction = 'down', color = 'text', width, getStyles }) =
|
|
|
4636
4635
|
degree: deg[direction],
|
|
4637
4636
|
color,
|
|
4638
4637
|
});
|
|
4639
|
-
return (jsxs("svg", {
|
|
4640
|
-
};
|
|
4641
|
-
|
|
4642
|
-
const CoinGecko = ({ direction = 'down', color = 'text', width, getStyles }) => {
|
|
4643
|
-
const deg = {
|
|
4644
|
-
left: 90,
|
|
4645
|
-
up: 180,
|
|
4646
|
-
right: 270,
|
|
4647
|
-
down: 0,
|
|
4648
|
-
};
|
|
4649
|
-
const style = getStyles({
|
|
4650
|
-
degree: deg[direction],
|
|
4651
|
-
color,
|
|
4652
|
-
});
|
|
4653
|
-
return (jsxs("svg", { width: width || '18', height: width || '18', viewBox: "0 0 1000 1011", sx: style, children: [jsx$2("g", { clipPath: "url(#clip0_732_1340)", children: jsx$2("path", { d: "M497.766 0.392197C773.882 -0.828538 998.745 223.585 999.995 501.717C1001.14 757.094 813.355 968.919 568.881 1002.85C381.112 1029.33 197.133 948.682 89.6367 791.779C33.5576 710.813 0.483151 612.448 0.00585938 506.257C-1.24422 228.125 221.611 1.65123 497.766 0.392197ZM497.903 31.6422C239.215 32.8217 30.0815 245.033 31.2549 506.117C31.6665 597.691 57.8948 683.018 102.939 755.165C134.57 668.589 140.089 587.87 148.695 483.863C155.815 373.914 185.259 282.593 370.885 231.071C411.689 221.202 454.151 224.377 497.148 234.113C563.17 221.606 636.337 219.49 685.125 300.153C708.309 309.046 731.18 317.264 753.562 323.782L753.523 323.744C944.667 376.291 926.371 481.338 833.185 569.352C809.543 594.008 784.074 617.251 767.66 634.082C700.727 702.699 585.608 832.129 586.387 968.326C804.705 927.334 969.788 733.9 968.745 501.858C967.572 240.775 756.555 30.4985 497.903 31.6422ZM429.07 282.553C375.696 282.553 332.398 326.085 332.397 379.88C332.398 433.675 375.696 477.246 429.07 477.246C482.445 477.246 525.743 433.675 525.743 379.88C525.743 326.124 482.445 282.553 429.07 282.553ZM429.07 298.178C437.715 298.178 446.05 299.546 453.872 302.08C437.212 307.802 423.443 323.825 416.208 345.052L467.438 379.206L416.203 413.361C423.738 435.478 438.364 451.95 455.964 457.009C447.543 459.997 438.49 461.621 429.07 461.621C384.426 461.621 348.023 425.147 348.022 379.88C348.023 334.622 384.418 298.178 429.07 298.178Z", fill: "currentColor" }) }), jsx$2("defs", { children: jsx$2("clipPath", { id: "clip0_732_1340", children: jsx$2("rect", { width: "1000", height: "1010.61", fill: "white", transform: "translate(0 0.38739)" }) }) })] }));
|
|
4638
|
+
return (jsxs("svg", { width: width || '13', height: "19", viewBox: "0 0 19 13", sx: style, children: [jsxs("g", { clipPath: "url(#clip0_241_4869)", children: [jsx$2("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.223615 11.8591C0.223615 11.8591 -0.502465 9.34304 0.649961 8.18498C1.54141 7.28917 2.98866 7.28943 3.87985 8.18498C4.77105 9.08053 4.7713 10.5349 3.87985 11.4307C2.72743 12.5887 0.223615 11.8591 0.223615 11.8591Z", fill: "#4D4040" }), jsx$2("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.79913 4.50158C2.98474 3.08414 4.33367 0.842317 4.33367 0.842317C4.33367 0.842317 6.94048 0.7891 7.75487 2.20653L11.4688 8.67068C12.0995 9.76837 11.7245 11.1726 10.6328 11.806C9.54116 12.4394 8.14378 12.0634 7.51311 10.9657L3.79913 4.50158Z", fill: "#4D4040" }), jsx$2("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0234 4.50158C10.209 3.08414 11.558 0.842317 11.558 0.842317C11.558 0.842317 14.1648 0.7891 14.9792 2.20653L18.6931 8.67068C19.3238 9.76837 18.9488 11.1726 17.8572 11.806C16.7655 12.4394 15.3681 12.0634 14.7374 10.9657L11.0234 4.50158Z", fill: "#4D4040" })] }), jsx$2("defs", { children: jsx$2("clipPath", { id: "clip0_241_4869", children: jsx$2("rect", { width: "19", height: "11.3095", fill: "white", transform: "translate(0 0.845215)" }) }) })] }));
|
|
4654
4639
|
};
|
|
4655
4640
|
|
|
4656
4641
|
const Audit = ({ direction = 'down', color = 'text', width, getStyles }) => {
|
|
@@ -4923,10 +4908,8 @@ const Svg = (_a) => {
|
|
|
4923
4908
|
return jsx$2(PlaceholderMonkey$1, Object.assign({}, props, { getStyles: getStyles }));
|
|
4924
4909
|
case icons.URL:
|
|
4925
4910
|
return jsx$2(URL$1, Object.assign({}, props, { getStyles: getStyles }));
|
|
4926
|
-
case icons.
|
|
4927
|
-
return jsx$2(
|
|
4928
|
-
case icons.COINGECKO:
|
|
4929
|
-
return jsx$2(CoinGecko, Object.assign({}, props, { getStyles: getStyles }));
|
|
4911
|
+
case icons.BUBBLE:
|
|
4912
|
+
return jsx$2(Bubble, Object.assign({}, props, { getStyles: getStyles }));
|
|
4930
4913
|
case icons.AUDIT:
|
|
4931
4914
|
return jsx$2(Audit, Object.assign({}, props, { getStyles: getStyles }));
|
|
4932
4915
|
case icons.FIRE:
|
|
@@ -76120,10 +76103,19 @@ const styles$a = {
|
|
|
76120
76103
|
},
|
|
76121
76104
|
};
|
|
76122
76105
|
|
|
76123
|
-
const ButtonsRow = ({ projectLink, twitter,
|
|
76124
|
-
const
|
|
76125
|
-
|
|
76126
|
-
|
|
76106
|
+
const ButtonsRow = ({ projectLink, twitter, bubble, audit, chain }) => {
|
|
76107
|
+
const bubbleChainStringMap = {
|
|
76108
|
+
[main.ChainId.BSC]: 'bsc',
|
|
76109
|
+
[main.ChainId.MAINNET]: 'eth',
|
|
76110
|
+
[main.ChainId.ARBITRUM]: 'arbi',
|
|
76111
|
+
[main.ChainId.MATIC]: 'poly',
|
|
76112
|
+
[main.ChainId.BASE]: 'base',
|
|
76113
|
+
// [ChainId.SONIC]: 'sonic'
|
|
76114
|
+
};
|
|
76115
|
+
//@ts-ignore
|
|
76116
|
+
const bubbleChain = bubbleChainStringMap[chain];
|
|
76117
|
+
const bubbleURL = `https://app.bubblemaps.io/${bubbleChain}/token/${bubble}`;
|
|
76118
|
+
return (jsxs(Flex, { sx: { justifyContent: 'center' }, children: [jsx$2(Flex, { sx: styles$a.iconButton, as: Link, href: projectLink, target: "_blank", children: jsx$2(Svg, { icon: "URL", width: 18 }) }), jsx$2(Flex, { sx: styles$a.iconButton, as: Link, href: twitter, target: "_blank", children: jsx$2(Svg, { icon: "twitter", width: 18, color: "text" }) }), bubble && bubbleChain && (jsx$2(Flex, { sx: styles$a.iconButton, as: Link, href: bubbleURL, target: "_blank", children: jsx$2(Svg, { icon: "bubble", width: 18, color: "text" }) })), audit && (jsxs(Flex, { sx: Object.assign(Object.assign({}, styles$a.iconButton), { margin: '0 0 5px 0', '& svg': { marginRight: '5px' } }), as: Link, href: audit, target: "_blank", children: [jsx$2(Svg, { icon: "audit", width: 18, color: "text" }), jsx$2(Text, { sx: { paddingRight: '5px' }, children: 'Audit' })] }))] }));
|
|
76127
76119
|
};
|
|
76128
76120
|
|
|
76129
76121
|
const ExpandedViewButton = ({ handleNavigation, rightPos }) => {
|
|
@@ -76143,7 +76135,7 @@ const ExpandedViewButton = ({ handleNavigation, rightPos }) => {
|
|
|
76143
76135
|
}, onClick: handleNavigation, children: ["Project Info", jsx$2(Flex, { sx: { ml: '4px' }, children: jsx$2(Svg, { icon: "expand", width: 20, color: "white" }) })] }) }));
|
|
76144
76136
|
};
|
|
76145
76137
|
|
|
76146
|
-
const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, projectLink, twitter, audit, chain, isSoldOut = false, billType,
|
|
76138
|
+
const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, projectLink, twitter, audit, chain, isSoldOut = false, billType, }) => {
|
|
76147
76139
|
const config = useSDKConfig();
|
|
76148
76140
|
const explorerLink = BLOCK_EXPLORER[chain];
|
|
76149
76141
|
const urlPage = chain === main.ChainId.SOL ? 'account' : 'address';
|
|
@@ -76162,11 +76154,11 @@ const BondInfoTooltip = ({ earnTokenContract, earnTokenSymbol, bondContract, pro
|
|
|
76162
76154
|
},
|
|
76163
76155
|
});
|
|
76164
76156
|
};
|
|
76165
|
-
return (jsxs(Flex, { sx: { flexDirection: 'column', flexWrap: 'wrap' }, children: [jsx$2(ButtonsRow, { twitter: twitter, projectLink: projectLink,
|
|
76157
|
+
return (jsxs(Flex, { sx: { flexDirection: 'column', flexWrap: 'wrap' }, children: [jsx$2(ButtonsRow, { twitter: twitter, projectLink: projectLink, bubble: earnTokenContract, audit: audit, chain: chain }), (config === null || config === void 0 ? void 0 : config.referenceId) === 'apebond' && !isSoldOut && billType !== 'fcfs' && chain !== main.ChainId.SOL && (jsx$2(Flex, { sx: { width: '100%', my: '5px', justifyContent: 'center', position: 'relative', height: '25px' }, children: jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation, rightPos: '-5px' }) })), jsx$2(Flex, { sx: { justifyContent: 'center' }, children: jsxs(Flex, { sx: { width: '144px', flexDirection: 'column' }, children: [jsx$2(Flex, { sx: styles$a.linkRow, children: tokenLink && (jsxs(Link, { href: tokenLink, sx: styles$a.link, target: "_blank", children: ["View Token Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$a.linkRow, children: bondLink && (jsxs(Link, { href: bondLink, sx: styles$a.link, target: "_blank", children: ["View Bond Contract", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) }), jsx$2(Flex, { sx: styles$a.linkRow, children: billType !== 'fcfs' && chain !== main.ChainId.SOL && (jsxs(Link, { href: bondDashboard, sx: styles$a.link, target: "_blank", children: ["View Bond Insights", jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "external", color: "text", width: 10 }) })] })) })] }) })] }));
|
|
76166
76158
|
};
|
|
76167
76159
|
|
|
76168
76160
|
const UserBondRow = ({ bill }) => {
|
|
76169
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
76161
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
76170
76162
|
// Hooks
|
|
76171
76163
|
const userChainId = useChainId();
|
|
76172
76164
|
const SDKConfig = useSDKConfig();
|
|
@@ -76241,7 +76233,7 @@ const UserBondRow = ({ bill }) => {
|
|
|
76241
76233
|
}
|
|
76242
76234
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
76243
76235
|
}, [isConfirmed]);
|
|
76244
|
-
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: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, 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
|
|
76236
|
+
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: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, 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: {
|
|
76245
76237
|
opacity: 0.8,
|
|
76246
76238
|
}, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsx$2(Flex$1, { sx: { width: '125px' }, children: jsx$2(ProfitCard, { userBond: bill }) }), 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) * earnTokenPrice).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(pending(bill), 3), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(pending(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: getPercentageVested(bill) }), style: {
|
|
76247
76239
|
width: '127px',
|
|
@@ -76251,12 +76243,12 @@ const UserBondRow = ({ bill }) => {
|
|
|
76251
76243
|
display: ['none', 'none', 'none', 'flex'],
|
|
76252
76244
|
}, showTooltip: true, toolTip: getTimeLeftForFullyVested(bill) > 0
|
|
76253
76245
|
? `Fully vested in ${getPendingVestingString(bill)}.`
|
|
76254
|
-
: `Fully Vested.` }) }), jsx$2("div", { className: "your-bonds-column-button", children: userChainId !== ((
|
|
76246
|
+
: `Fully Vested.` }) }), jsx$2("div", { className: "your-bonds-column-button", children: userChainId !== ((_t = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _t === void 0 ? void 0 : _t.chainId) ? (jsxs(Button, { className: "button", disabled: claimable(bill) === 0 || load, load: load, onClick: (event) => {
|
|
76255
76247
|
var _a;
|
|
76256
76248
|
event.stopPropagation();
|
|
76257
76249
|
// Add your claim logic here
|
|
76258
76250
|
switchChain({ chainId: (_a = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _a === void 0 ? void 0 : _a.chainId });
|
|
76259
|
-
}, fullWidth: true, children: ["Switch to ", NETWORK_LABEL[(
|
|
76251
|
+
}, fullWidth: true, children: ["Switch to ", NETWORK_LABEL[(_u = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _u === void 0 ? void 0 : _u.chainId].replace(/testnet/i, '[T]')] })) : (jsx$2(Button, { className: "button", disabled: claimable(bill) === 0 || load || isPendingCliff, load: load, onClick: (event) => {
|
|
76260
76252
|
event.stopPropagation();
|
|
76261
76253
|
handleClaim(bill.id, bill.address);
|
|
76262
76254
|
}, fullWidth: true, children: isPendingCliff
|
|
@@ -76265,7 +76257,7 @@ const UserBondRow = ({ bill }) => {
|
|
|
76265
76257
|
};
|
|
76266
76258
|
|
|
76267
76259
|
const UserBondRowSolana = ({ bill }) => {
|
|
76268
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
|
76260
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
76269
76261
|
// Hooks
|
|
76270
76262
|
const SDKConfig = useSDKConfig();
|
|
76271
76263
|
const { setVisible } = useWalletModal();
|
|
@@ -76376,7 +76368,7 @@ const UserBondRowSolana = ({ bill }) => {
|
|
|
76376
76368
|
setLoadingTx(false);
|
|
76377
76369
|
}
|
|
76378
76370
|
});
|
|
76379
|
-
return (jsxs("div", { className: "your-bonds", onClick: () => onOpenPurchasedBond(), children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_e = bill.bond) === null || _e === void 0 ? void 0 : _e.earnToken.symbol, chain: (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.chainId, vestEnds: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_g = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _g === void 0 ? void 0 : _g.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.earnToken.symbol) || '', bondContract: (_j = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _j !== void 0 ? _j : '', projectLink: (_k = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _k === void 0 ? void 0 : _k.projectLink, twitter: (_l = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _l === void 0 ? void 0 : _l.twitter, audit: (_m = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _m === void 0 ? void 0 : _m.audit, chain: (_o = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _o === void 0 ? void 0 : _o.chainId
|
|
76371
|
+
return (jsxs("div", { className: "your-bonds", onClick: () => onOpenPurchasedBond(), children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_e = bill.bond) === null || _e === void 0 ? void 0 : _e.earnToken.symbol, chain: (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.chainId, vestEnds: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_g = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _g === void 0 ? void 0 : _g.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.earnToken.symbol) || '', bondContract: (_j = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _j !== void 0 ? _j : '', projectLink: (_k = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _k === void 0 ? void 0 : _k.projectLink, twitter: (_l = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _l === void 0 ? void 0 : _l.twitter, audit: (_m = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _m === void 0 ? void 0 : _m.audit, chain: (_o = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _o === void 0 ? void 0 : _o.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex, { sx: {
|
|
76380
76372
|
opacity: 0.8,
|
|
76381
76373
|
}, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsx$2(Flex, { sx: { width: '125px' }, children: jsx$2(ProfitCard, { userBond: bill }) }), 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), 4), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(claimable(bill) * earnTokenPrice).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(pending(bill), 4), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(pending(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: getPercentageVested(bill) }), style: {
|
|
76382
76374
|
width: '127px',
|
|
@@ -76389,7 +76381,7 @@ const UserBondRowSolana = ({ bill }) => {
|
|
|
76389
76381
|
: `Fully Vested.` }) }), jsx$2("div", { className: "your-bonds-column-button", children: !accountSolana ? (jsxs(Button, { className: "button", disabled: claimable(bill) === 0 || loadingTx, load: loadingTx, onClick: (event) => {
|
|
76390
76382
|
event.stopPropagation();
|
|
76391
76383
|
setVisible(true);
|
|
76392
|
-
}, fullWidth: true, children: ["Connect to ", NETWORK_LABEL[(
|
|
76384
|
+
}, fullWidth: true, children: ["Connect to ", NETWORK_LABEL[(_p = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _p === void 0 ? void 0 : _p.chainId]] })) : (jsx$2(Button, { className: "button", disabled: claimable(bill) === 0 || loadingTx || isPendingCliff, load: loadingTx, onClick: (event) => {
|
|
76393
76385
|
event.stopPropagation();
|
|
76394
76386
|
if (!loadingTx)
|
|
76395
76387
|
handleClaim();
|
|
@@ -81822,7 +81814,7 @@ const BonusContainer = ({ trueBondPrices, minTier, bonus, airdropTooltip, toolti
|
|
|
81822
81814
|
return (jsx$2("div", { className: `discount-column`, children: jsx$2(BonusComponent, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip, tooltipPosition: isMobile ? tooltipPosition : 'bottomLeft' }) }));
|
|
81823
81815
|
};
|
|
81824
81816
|
|
|
81825
|
-
const BondRow = ({ bondAddress, bondChain, marketingCampaign, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, shortDescription, soldoutBondsCount, isOpen,
|
|
81817
|
+
const BondRow = ({ bondAddress, bondChain, marketingCampaign, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, shortDescription, soldoutBondsCount, isOpen, }) => {
|
|
81826
81818
|
var _a, _b, _c;
|
|
81827
81819
|
const SDKConfig = useSDKConfig();
|
|
81828
81820
|
const locationPath = window.location.pathname.replace('/', '');
|
|
@@ -81858,7 +81850,7 @@ const BondRow = ({ bondAddress, bondChain, marketingCampaign, payoutToken, billT
|
|
|
81858
81850
|
flexDirection: 'column',
|
|
81859
81851
|
justifyContent: 'center',
|
|
81860
81852
|
display: ['none', 'none', 'none', 'flex'],
|
|
81861
|
-
}, showTooltip: true, toolTip: remainingTokensString })) }), jsx$2("div", { className: "tooltip-column", children: soldoutBondsCount ? (jsxs(Flex, { sx: { gap: '5px', fontSize: '13px', fontWeight: 500, opacity: 0.5 }, children: ["(", soldoutBondsCount, ")", jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down', width: "8px" })] })) : (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_b = (_a = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.address) === null || _a === void 0 ? void 0 : _a[bondChain]) !== null && _b !== void 0 ? _b : '', earnTokenSymbol: (_c = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol) !== null && _c !== void 0 ? _c : '', bondContract: bondAddress !== null && bondAddress !== void 0 ? bondAddress : '', projectLink: projectURL, twitter: twitterURL, audit: auditURL, chain: bondChain, isSoldOut: bondSoldOut, billType: billType
|
|
81853
|
+
}, showTooltip: true, toolTip: remainingTokensString })) }), jsx$2("div", { className: "tooltip-column", children: soldoutBondsCount ? (jsxs(Flex, { sx: { gap: '5px', fontSize: '13px', fontWeight: 500, opacity: 0.5 }, children: ["(", soldoutBondsCount, ")", jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down', width: "8px" })] })) : (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_b = (_a = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.address) === null || _a === void 0 ? void 0 : _a[bondChain]) !== null && _b !== void 0 ? _b : '', earnTokenSymbol: (_c = payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol) !== null && _c !== void 0 ? _c : '', bondContract: bondAddress !== null && bondAddress !== void 0 ? bondAddress : '', projectLink: projectURL, twitter: twitterURL, audit: auditURL, chain: bondChain, isSoldOut: bondSoldOut, billType: billType }), width: "205px", placement: "bottomRight", transformTip: "translate(7%, -2%)", children: jsx$2(Flex, { className: "more-icon", sx: { opacity: 0.8 }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) })) })] })] }, `${bondAddress}-${bondChain}`));
|
|
81862
81854
|
};
|
|
81863
81855
|
|
|
81864
81856
|
// import useUserApiStats from '../../../../state/bondApiStats/useUserApiStats'
|
|
@@ -82047,7 +82039,7 @@ const HotBondCard = ({ bond }) => {
|
|
|
82047
82039
|
},
|
|
82048
82040
|
});
|
|
82049
82041
|
};
|
|
82050
|
-
return (jsx$2(Flex, { sx: styles$7.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
|
|
82042
|
+
return (jsx$2(Flex, { sx: styles$7.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 = getTimePeriods(bond === null || bond === void 0 ? void 0 : bond.vestingTerm, true)) === null || _m === void 0 ? void 0 : _m.days)
|
|
82051
82043
|
? `${(_o = getTimePeriods(bond === null || bond === void 0 ? void 0 : bond.vestingTerm, true)) === null || _o === void 0 ? void 0 : _o.days} D`
|
|
82052
82044
|
: '-' })] })] })] }) }));
|
|
82053
82045
|
};
|
|
@@ -87349,7 +87341,7 @@ const ActiveBondRows = ({ chain, bonds, hideTitles, showHotBonds }) => {
|
|
|
87349
87341
|
const bond = bondFromMap;
|
|
87350
87342
|
const bondAddress = (_u = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _u === void 0 ? void 0 : _u[bond === null || bond === void 0 ? void 0 : bond.chainId];
|
|
87351
87343
|
const remainingTokensString = getRemainingTokensString(bond);
|
|
87352
|
-
return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, marketingCampaign: bond.marketingCampaign, payoutToken: bond.earnToken, billType: bond.billType, tag: (_v = bond.tags) === null || _v === void 0 ? void 0 : _v[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' ? `${(_w = bond === null || bond === void 0 ? void 0 : bond.discountWithFee) === null || _w === void 0 ? void 0 : _w.toFixed(2)}%` : undefined, shortDescription: bond.shortDescription
|
|
87344
|
+
return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, marketingCampaign: bond.marketingCampaign, payoutToken: bond.earnToken, billType: bond.billType, tag: (_v = bond.tags) === null || _v === void 0 ? void 0 : _v[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' ? `${(_w = bond === null || bond === void 0 ? void 0 : bond.discountWithFee) === null || _w === void 0 ? void 0 : _w.toFixed(2)}%` : undefined, shortDescription: bond.shortDescription }, `${bondAddress}-${bond.chainId}-${index}`));
|
|
87353
87345
|
}
|
|
87354
87346
|
}), showHotBonds && (jsx$2(SwiperProvider, { children: jsx$2(HotBondCards, {}) }))] }, key))] }) }, key));
|
|
87355
87347
|
};
|
|
@@ -104287,23 +104279,23 @@ const PriceChart = ({ selectedBond, historicalPrices, }) => {
|
|
|
104287
104279
|
return (jsxs(Flex, { sx: styles.priceContainer, children: [jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', mb: '15px', pr: '20px' }, children: [jsx$2(Flex, { children: "Prices" }), jsxs(Flex, { children: [jsxs(Flex, { sx: { color: hasDiscount ? 'success' : 'error', fontSize: '12px', fontWeight: 500, mr: '15px' }, children: ["Bond Price: $", bondPrice] }), jsxs(Flex, { sx: { color: 'textDisabledButton', fontSize: '12px', fontWeight: 500 }, children: ["Market Price: $", getFirstNonZeroDigits(earnTokenPrice !== null && earnTokenPrice !== void 0 ? earnTokenPrice : 0)] })] })] }), show && (jsxs(Flex, { sx: styles.container, children: [jsxs(Flex, { sx: styles.buttonsContainer, children: [jsx$2(Flex, { sx: Object.assign(Object.assign({}, styles.button), { mr: '15px' }), onClick: () => setChartOption('line'), children: jsx$2(Svg, { icon: "lineChart", width: 20 }) }), jsx$2(Flex, { sx: styles.button, onClick: () => setChartOption('candleStick'), children: "D" })] }), historicalPrices && historicalPrices.length > 0 ? (chartOption === 'line' ? (jsx$2(LineChart, { historicalPrices: historicalPrices, hasDiscount: hasDiscount, bondPrice: bondPrice, tokenPrice: (_c = selectedBond.payoutTokenPrice) !== null && _c !== void 0 ? _c : '0' })) : (jsx$2(CandleStickChart, { historicalPrices: historicalPrices, hasDiscount: hasDiscount, bondPrice: bondPrice, tokenPrice: (_d = selectedBond.payoutTokenPrice) !== null && _d !== void 0 ? _d : '0' }))) : (jsxs(Flex, { sx: { flexDirection: 'column', justifyContent: 'center', alignItems: 'center', width: '100%' }, children: [jsx$2(Svg, { icon: "placeholderMonkey" }), jsx$2(Flex, { sx: { mt: '15px' }, children: "No Historical Price for this Token" })] }))] }))] }));
|
|
104288
104280
|
};
|
|
104289
104281
|
|
|
104290
|
-
function useHistoricalPrice(
|
|
104282
|
+
function useHistoricalPrice(cmcId) {
|
|
104291
104283
|
const queryClient = useQueryClient();
|
|
104292
104284
|
return useQuery({
|
|
104293
|
-
queryKey: [QUERY_KEYS.HISTORICAL_PRICE,
|
|
104294
|
-
queryFn: () => getHistoricalPrice(
|
|
104285
|
+
queryKey: [QUERY_KEYS.HISTORICAL_PRICE, cmcId || ''],
|
|
104286
|
+
queryFn: () => getHistoricalPrice(cmcId, queryClient),
|
|
104295
104287
|
refetchOnWindowFocus: false,
|
|
104296
104288
|
refetchInterval: 300000,
|
|
104297
|
-
enabled: !!
|
|
104289
|
+
enabled: !!cmcId,
|
|
104298
104290
|
retry: 0,
|
|
104299
104291
|
});
|
|
104300
104292
|
}
|
|
104301
|
-
const getHistoricalPrice = (
|
|
104293
|
+
const getHistoricalPrice = (cmcId, queryClient) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
104302
104294
|
const { urls } = queryClient === null || queryClient === void 0 ? void 0 : queryClient.getQueryData([QUERY_KEYS.SDK_CONFIG]);
|
|
104303
104295
|
const apiUrl = urls['apiV2'];
|
|
104304
|
-
if (!
|
|
104296
|
+
if (!cmcId)
|
|
104305
104297
|
return [];
|
|
104306
|
-
const res = yield fetch(`${apiUrl}/stats/historical-prices?
|
|
104298
|
+
const res = yield fetch(`${apiUrl}/stats/historical-prices?cmcId=${cmcId}`);
|
|
104307
104299
|
const data = yield res.json();
|
|
104308
104300
|
return data;
|
|
104309
104301
|
});
|
|
@@ -104318,7 +104310,7 @@ const ProjectView = ({ bondAddress, bondChain }) => {
|
|
|
104318
104310
|
return ((_b = (_a = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId]) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === (bondAddress === null || bondAddress === void 0 ? void 0 : bondAddress.toLowerCase()) &&
|
|
104319
104311
|
bondChain === bond.chainId.toString();
|
|
104320
104312
|
});
|
|
104321
|
-
const { data: historicalPrices } = useHistoricalPrice(bondData === null || bondData === void 0 ? void 0 : bondData.
|
|
104313
|
+
const { data: historicalPrices } = useHistoricalPrice(bondData === null || bondData === void 0 ? void 0 : bondData.cmcId);
|
|
104322
104314
|
useEffect(() => {
|
|
104323
104315
|
var _a;
|
|
104324
104316
|
if (((_a = bonds === null || bonds === void 0 ? void 0 : bonds.length) !== null && _a !== void 0 ? _a : 0) > 0 && !bondData) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { QueryClient, UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import { HistoricalPrices } from '../../views/ProjectView/ProjectView';
|
|
3
|
-
export default function useHistoricalPrice(
|
|
4
|
-
export declare const getHistoricalPrice: (
|
|
3
|
+
export default function useHistoricalPrice(cmcId?: number): UseQueryResult<HistoricalPrices[]>;
|
|
4
|
+
export declare const getHistoricalPrice: (cmcId?: number, queryClient?: QueryClient) => Promise<HistoricalPrices[]>;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Ape Bond SDK",
|
|
4
4
|
"author": "Ape Bond",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "4.5.7
|
|
6
|
+
"version": "4.5.7",
|
|
7
7
|
"module": "dist/main.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"types": "dist/main.d.ts",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@rainbow-me/rainbowkit": "^2.1.7",
|
|
34
|
+
"@tanstack/react-query": "5.x",
|
|
34
35
|
"@solana/kit": "2.3.0",
|
|
35
36
|
"@solana/spl-token": "^0.4.14",
|
|
36
37
|
"@solana/wallet-adapter-react": "^0.15.39",
|
|
37
38
|
"@solana/wallet-adapter-react-ui": "^0.9.39",
|
|
38
39
|
"@solana/web3.js": "^1.98.4",
|
|
39
|
-
"@tanstack/react-query": "5.x",
|
|
40
40
|
"axios": "^1.8.2",
|
|
41
41
|
"react": ">=17 <19",
|
|
42
42
|
"react-dom": ">=17 <19",
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"typescript": "^5.0.0",
|
|
75
75
|
"typescript-eslint": "^8.34.0",
|
|
76
76
|
"vite": "^7.2.6",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
77
|
+
"yalc": "^1.0.0-pre.53",
|
|
78
|
+
"wagmi": "2.19.5"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@ape.swap/apeswap-lists": "^4.5.3",
|
|
82
|
-
"@emotion/react": "11.14.0",
|
|
83
81
|
"@jup-ag/api": "6.0.45",
|
|
82
|
+
"@ape.swap/apeswap-lists": "4.5.2",
|
|
83
|
+
"@emotion/react": "11.14.0",
|
|
84
84
|
"bignumber.js": "^9.1.2",
|
|
85
85
|
"buffer": "^6.0.3",
|
|
86
86
|
"chart.js": "4.5.0",
|