@ape.swap/bonds-sdk 2.0.8 → 2.1.0
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/AccordionText/index.d.ts +0 -2
- package/dist/components/TokenSelectorPanel/index.d.ts +3 -2
- package/dist/main.js +141 -66
- package/dist/state/useSDKConfig.d.ts +2 -0
- package/dist/styles.css +53 -20
- package/dist/views/BondModal/BondModal.d.ts +0 -3
- package/dist/views/BondModal/components/ImageAndShortDescription.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ChainId, Token } from '@ape.swap/apeswap-lists';
|
|
3
|
-
declare const TokenSelectorPanel: ({ typedValue, setTypedValue, selectedToken, chainId,
|
|
3
|
+
declare const TokenSelectorPanel: ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, }: {
|
|
4
4
|
typedValue: string;
|
|
5
5
|
setTypedValue: (value: React.SetStateAction<string>) => void;
|
|
6
6
|
selectedToken?: "NATIVE" | Token;
|
|
7
7
|
chainId: ChainId;
|
|
8
|
-
|
|
8
|
+
handleValueBtn?: (value: string) => void;
|
|
9
9
|
handleCurrencySelect: (value: string) => void;
|
|
10
10
|
enableZap?: boolean;
|
|
11
11
|
tokenBalance?: string;
|
|
12
12
|
selectedTokenPrice?: number;
|
|
13
13
|
bondPrincipalToken?: Token;
|
|
14
14
|
bondEarnToken?: Token;
|
|
15
|
+
modalVariant?: "alt" | "standard";
|
|
15
16
|
}) => React.JSX.Element;
|
|
16
17
|
export default TokenSelectorPanel;
|
package/dist/main.js
CHANGED
|
@@ -18687,6 +18687,25 @@ const AddFavToken = ({ tokenSymbol, hotBond }) => {
|
|
|
18687
18687
|
}, children: jsx$2(AnimatePresence, { mode: "wait", children: jsx$2(motion.div, { initial: false, animate: { opacity: 1, scale: 1.0 }, exit: { opacity: 0, scale: 0.8 }, transition: { duration: 0.2 }, style: { display: 'flex' }, children: isFavToken ? (jsx$2(Svg, { icon: "StarFilled", width: 22, height: 22 })) : (jsx$2(Svg, { icon: hotBond ? 'FirePink' : 'Star', width: hotBond ? 25 : 20, height: hotBond ? 25 : 20 })) }, isFavToken ? 'StarFilled' : 'Star') }) }));
|
|
18688
18688
|
};
|
|
18689
18689
|
|
|
18690
|
+
const defaultUrls = {
|
|
18691
|
+
apiV2: 'https://api.ape.bond',
|
|
18692
|
+
realTimeApi: 'https://realtime-api.ape.bond/bonds',
|
|
18693
|
+
apeswapLists: 'https://raw.githubusercontent.com/ApeSwapFinance/apeswap-lists/main',
|
|
18694
|
+
mainUrl: 'https://ape.bond',
|
|
18695
|
+
};
|
|
18696
|
+
const useSDKConfig = (config) => {
|
|
18697
|
+
var _a;
|
|
18698
|
+
const { data } = useQuery({
|
|
18699
|
+
queryKey: [QUERY_KEYS.SDK_CONFIG],
|
|
18700
|
+
initialData: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.config), { urls: Object.assign(Object.assign({}, defaultUrls), (_a = config === null || config === void 0 ? void 0 : config.config) === null || _a === void 0 ? void 0 : _a.urls) }),
|
|
18701
|
+
});
|
|
18702
|
+
return data;
|
|
18703
|
+
};
|
|
18704
|
+
const useURLByEnvironment = (key) => {
|
|
18705
|
+
const config = useSDKConfig();
|
|
18706
|
+
return config === null || config === void 0 ? void 0 : config.urls[key];
|
|
18707
|
+
};
|
|
18708
|
+
|
|
18690
18709
|
const NETWORK_COLORS = {
|
|
18691
18710
|
[types.ChainId.BSC]: '#F3BA2F',
|
|
18692
18711
|
[types.ChainId.MAINNET]: '#627eea',
|
|
@@ -18700,15 +18719,21 @@ const NETWORK_COLORS = {
|
|
|
18700
18719
|
[types.ChainId.AVAX]: '#e74344',
|
|
18701
18720
|
};
|
|
18702
18721
|
const TokenInfoAndName = ({ bill, vestEnds, isHotBond, }) => {
|
|
18703
|
-
var _a, _b, _c, _d;
|
|
18722
|
+
var _a, _b, _c, _d, _e;
|
|
18723
|
+
const SDKConfig = useSDKConfig();
|
|
18704
18724
|
const tokenName = 'showcaseTokenName' in bill ? bill.showcaseTokenName : bill.earnToken.symbol;
|
|
18705
|
-
return (jsxs(Flex, { className: "tokeninfoname container", children: [
|
|
18706
|
-
|
|
18707
|
-
|
|
18725
|
+
return (jsxs(Flex, { className: "tokeninfoname container", children: [SDKConfig.referenceId === 'seedify' ? (jsx$2(Flex, { sx: {
|
|
18726
|
+
p: '10px',
|
|
18727
|
+
opacity: 0.2,
|
|
18728
|
+
position: 'absolute',
|
|
18729
|
+
left: '-20px',
|
|
18730
|
+
}, children: jsx$2(Flex, { sx: { borderRadius: '56px', overflow: 'hidden' }, children: jsx$2(Svg, { width: 100, height: 100, 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' }) }) })) : (jsxs(Fragment$1, { children: [jsx$2(Flex, { className: "tokeninfoname chain", children: jsx$2(Svg, { width: 20, height: 20, icon: (_b = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bill === null || bill === void 0 ? void 0 : bill.chainId]) !== null && _b !== void 0 ? _b : 'question' }) }), jsx$2(Flex, { className: "tokeninfoname gradient", sx: {
|
|
18731
|
+
background: isHotBond || vestEnds ? 'transparent' : NETWORK_COLORS[bill.chainId],
|
|
18732
|
+
} })] })), jsxs(Flex, { className: "tokeninfoname tokencontainer", sx: { marginTop: vestEnds ? ['10px', '10px', '10px', '0px'] : 0 }, 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, { className: "tokeninfofav", sx: { minWidth: '25px', p: '5px' }, children: jsx$2(AddFavToken, { tokenSymbol: tokenName, hotBond: isHotBond }) })] }), jsx$2(Flex, { sx: {
|
|
18708
18733
|
display: isHotBond ? 'flex' : ['none', 'none', 'none', 'none', 'flex'],
|
|
18709
18734
|
justifyContent: isHotBond ? 'center' : 'flex-start',
|
|
18710
18735
|
width: '100%',
|
|
18711
|
-
}, children: ((
|
|
18736
|
+
}, children: ((_c = bill.tags) === null || _c === void 0 ? void 0 : _c[0]) && jsx$2(ListTag, { text: (_e = (_d = bill.tags) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.toUpperCase() }) })] }));
|
|
18712
18737
|
};
|
|
18713
18738
|
|
|
18714
18739
|
const MINUTE_IN_SECONDS = 60;
|
|
@@ -41466,25 +41491,6 @@ const getBillNftBatchData = (apiV2URL, billNftIds, billNftAddress, chainId) => _
|
|
|
41466
41491
|
}
|
|
41467
41492
|
});
|
|
41468
41493
|
|
|
41469
|
-
const defaultUrls = {
|
|
41470
|
-
apiV2: 'https://api.ape.bond',
|
|
41471
|
-
realTimeApi: 'https://realtime-api.ape.bond/bonds',
|
|
41472
|
-
apeswapLists: 'https://raw.githubusercontent.com/ApeSwapFinance/apeswap-lists/main',
|
|
41473
|
-
mainUrl: 'https://ape.bond',
|
|
41474
|
-
};
|
|
41475
|
-
const useSDKConfig = (config) => {
|
|
41476
|
-
var _a;
|
|
41477
|
-
const { data } = useQuery({
|
|
41478
|
-
queryKey: [QUERY_KEYS.SDK_CONFIG],
|
|
41479
|
-
initialData: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.config), { urls: Object.assign(Object.assign({}, defaultUrls), (_a = config === null || config === void 0 ? void 0 : config.config) === null || _a === void 0 ? void 0 : _a.urls) }),
|
|
41480
|
-
});
|
|
41481
|
-
return data;
|
|
41482
|
-
};
|
|
41483
|
-
const useURLByEnvironment = (key) => {
|
|
41484
|
-
const config = useSDKConfig();
|
|
41485
|
-
return config === null || config === void 0 ? void 0 : config.urls[key];
|
|
41486
|
-
};
|
|
41487
|
-
|
|
41488
41494
|
function useBondNFTData(id, billNftAddress, chainId) {
|
|
41489
41495
|
const apiV2URL = useURLByEnvironment('apiV2');
|
|
41490
41496
|
return useQuery({
|
|
@@ -71308,8 +71314,9 @@ const MenuSelect = (_a) => {
|
|
|
71308
71314
|
display: 'flex',
|
|
71309
71315
|
width: '100%',
|
|
71310
71316
|
paddingRight: '4px',
|
|
71311
|
-
|
|
71312
|
-
|
|
71317
|
+
background: 'white2',
|
|
71318
|
+
} }, props, { className: "dropdown", children: options === null || options === void 0 ? void 0 : options.map((option) => {
|
|
71319
|
+
return (jsx$2(SelectItem, { size: "xsm", value: option.value, children: jsx$2(Text, { sx: { fontWeight: 400, pl: '10px' }, className: "menu-selector", children: option.label }) }, option.label));
|
|
71313
71320
|
}) })));
|
|
71314
71321
|
};
|
|
71315
71322
|
|
|
@@ -71352,7 +71359,7 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
|
|
|
71352
71359
|
alignItems: 'center',
|
|
71353
71360
|
width: '100%',
|
|
71354
71361
|
justifyContent: 'space-between',
|
|
71355
|
-
}, onClick: () => setIsOpen(!isOpen), children: [jsx$2(Text, { sx: { lineHeight: '22px', fontSize: '14px', fontWeight: 400, px: '10px' }, children: chainFilterOption.includes('All Chains') ? 'All Chains' : `Chains (${chainFilterOption.length})` }), jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down' }) })] }), isOpen && (jsx$2(Flex, { sx: {
|
|
71362
|
+
}, onClick: () => setIsOpen(!isOpen), className: "dropdown", children: [jsx$2(Text, { sx: { lineHeight: '22px', fontSize: '14px', fontWeight: 400, px: '10px' }, children: chainFilterOption.includes('All Chains') ? 'All Chains' : `Chains (${chainFilterOption.length})` }), jsx$2(Flex, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down' }) })] }), isOpen && (jsx$2(Flex, { sx: {
|
|
71356
71363
|
flexDirection: ['column', 'column', 'column'],
|
|
71357
71364
|
position: 'absolute',
|
|
71358
71365
|
top: '45px',
|
|
@@ -71386,7 +71393,7 @@ const BondFilters = ({ setChainFilterOption, chainFilterOption, filterOptions, f
|
|
|
71386
71393
|
setChainFilterOption(['All Chains']);
|
|
71387
71394
|
setFilterOption(newOption);
|
|
71388
71395
|
}, [setChainFilterOption, setFilterOption]);
|
|
71389
|
-
return (jsxs("div", { className: "bonds-filters", children: [jsx$2("div", { className: "desktop-rec-container", children: jsx$2(RecommendationSelector, { options: filterOptions, activeOption: filterOption, setActiveOption: handleFilterSelection }) }), jsx$2("div", { className: "mobile-rec-container", children: jsx$2(MenuSelect, { selectedOption: filterOption, setOption: setFilterOption, options: mappedFilters
|
|
71396
|
+
return (jsxs("div", { className: "bonds-filters", children: [jsx$2("div", { className: "desktop-rec-container", children: jsx$2(RecommendationSelector, { options: filterOptions, activeOption: filterOption, setActiveOption: handleFilterSelection }) }), jsx$2("div", { className: "mobile-rec-container", children: jsx$2(MenuSelect, { selectedOption: filterOption, setOption: setFilterOption, options: mappedFilters }) }), jsx$2("div", { className: "network-filter", children: jsx$2(NetworkFilter, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption }) }), jsxs("div", { className: "clear-all-button", onClick: () => {
|
|
71390
71397
|
setChainFilterOption(['All Chains']);
|
|
71391
71398
|
setFilterOption(asPath.includes('yourBonds') ? 'CLAIMABLE' : 'ALL');
|
|
71392
71399
|
onHandleQueryChange('');
|
|
@@ -71394,7 +71401,7 @@ const BondFilters = ({ setChainFilterOption, chainFilterOption, filterOptions, f
|
|
|
71394
71401
|
};
|
|
71395
71402
|
|
|
71396
71403
|
const YourBondsMenu = ({ chainFilterOption, setChainFilterOption, filterOptions, filterOption, setFilterOption, setInputValue, inputValue, handleSort, }) => {
|
|
71397
|
-
return (jsxs("div", { className: "bonds-menu", children: [jsx$2(BondFilters, { chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: setFilterOption, onHandleQueryChange: () => setInputValue('') }), jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container", children: jsx$2(Flex$1, { sx: { width: '100%', maxWidth: '300px' }, children: jsx$2(Input, { value: inputValue, onChange: (event) => setInputValue(event.target.value), variant: "search", sx: { fontWeight: 600, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('claimable'), children: ["CLAIMABLE", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('pending'), children: ["PENDING", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2(Flex$1, { className: "claim-all-button-container" })] })] })] }));
|
|
71404
|
+
return (jsxs("div", { className: "bonds-menu", children: [jsx$2(BondFilters, { chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: setFilterOption, onHandleQueryChange: () => setInputValue('') }), jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container", children: jsx$2(Flex$1, { sx: { width: '100%', maxWidth: '300px' }, children: jsx$2(Input, { className: "search-input", value: inputValue, onChange: (event) => setInputValue(event.target.value), variant: "search", sx: { fontWeight: 600, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('claimable'), children: ["CLAIMABLE", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('pending'), children: ["PENDING", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2(Flex$1, { className: "claim-all-button-container" })] })] })] }));
|
|
71398
71405
|
};
|
|
71399
71406
|
|
|
71400
71407
|
const YourBonds = () => {
|
|
@@ -71596,8 +71603,8 @@ const remainingPercentage = (bond) => {
|
|
|
71596
71603
|
};
|
|
71597
71604
|
const getDiscountColor = (discount) => {
|
|
71598
71605
|
if (!discount)
|
|
71599
|
-
return '
|
|
71600
|
-
return discount < 0 ? '
|
|
71606
|
+
return '';
|
|
71607
|
+
return discount < 0 ? 'discount-negative' : 'discount-positive';
|
|
71601
71608
|
};
|
|
71602
71609
|
const calculateARR = (bond) => {
|
|
71603
71610
|
const discount2 = 'discount' in bond ? bond.discount : undefined;
|
|
@@ -72230,7 +72237,7 @@ const TokenSelectorModal = ({ bondPrincipalToken, bondEarnToken, handleCurrencyS
|
|
|
72230
72237
|
const checksummedInput = isAddress(input);
|
|
72231
72238
|
setSearchQuery(checksummedInput || input);
|
|
72232
72239
|
}, [setSearchQuery]);
|
|
72233
|
-
return (jsx$2(Modal, { onDismiss: onDismiss, title: "Tokens", children: jsx$2(Flex, { sx: {
|
|
72240
|
+
return (jsx$2(Modal, { onDismiss: onDismiss, title: "Tokens", className: "token-selector-modal", children: jsx$2(Flex, { sx: {
|
|
72234
72241
|
flexDirection: 'column',
|
|
72235
72242
|
maxHeight: 'none',
|
|
72236
72243
|
height: 'auto',
|
|
@@ -72247,7 +72254,7 @@ const TokenSelectorModal = ({ bondPrincipalToken, bondEarnToken, handleCurrencyS
|
|
|
72247
72254
|
}) })] }) }) }));
|
|
72248
72255
|
};
|
|
72249
72256
|
|
|
72250
|
-
const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId,
|
|
72257
|
+
const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, }) => {
|
|
72251
72258
|
var _a, _b;
|
|
72252
72259
|
const tokenBalanceString = tokenBalance ? new BigNumber$1(tokenBalance).toPrecision(5) : 'loading';
|
|
72253
72260
|
const splited = typeof selectedToken !== 'string' ? (_a = selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.symbol) === null || _a === void 0 ? void 0 : _a.split('-') : undefined;
|
|
@@ -72255,7 +72262,7 @@ const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId,
|
|
|
72255
72262
|
setTypedValue(event.target.value);
|
|
72256
72263
|
};
|
|
72257
72264
|
const [onTokenSelectorModal] = useModal(jsx$2(TokenSelectorModal, { bondPrincipalToken: bondPrincipalToken, bondEarnToken: bondEarnToken, handleCurrencySelect: handleCurrencySelect, chainId: chainId }), true, false, `tokenSelectorOnLiquidityModal${(_b = bondPrincipalToken === null || bondPrincipalToken === void 0 ? void 0 : bondPrincipalToken.address) === null || _b === void 0 ? void 0 : _b[chainId]}-${bondPrincipalToken === null || bondPrincipalToken === void 0 ? void 0 : bondPrincipalToken.symbol}`);
|
|
72258
|
-
return (jsxs(Flex$1, { className: "
|
|
72265
|
+
return (jsxs(Flex$1, { className: "token-selector-panel", children: [jsxs(Flex$1, { className: "input-container inputrow", children: [jsx$2(Flex$1, { className: "input-container input", children: jsx$2(Input$1, { placeholder: "0.0", value: typedValue, pattern: "^[0-9]*[.,]?[0-9]*$", onChange: handleInputChange, onInput: (v) => {
|
|
72259
72266
|
if (v.currentTarget.value.includes(',')) {
|
|
72260
72267
|
v.currentTarget.value = v.currentTarget.value.replace(/,/g, '.');
|
|
72261
72268
|
}
|
|
@@ -72269,7 +72276,9 @@ const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId,
|
|
|
72269
72276
|
!!v.currentTarget.value && isNumber$1(v.currentTarget.value) && parseFloat(v.currentTarget.value) >= 0
|
|
72270
72277
|
? v.currentTarget.value
|
|
72271
72278
|
: v.currentTarget.value.slice(0, v.currentTarget.value.length - 1);
|
|
72272
|
-
} }) }), jsxs(Flex$1, { className: "input-container token", onClick: () => (enableZap ? onTokenSelectorModal() : null), sx: { cursor: enableZap ? 'pointer' : 'default' }, children: [jsxs(Flex$1, { children: [jsx$2(Flex$1, { className: "input-container bondicon", children: lodashExports.isArray(splited) ? (jsx$2(TokenImage, { symbol: splited[0], symbol2: splited[1], size: 28, chain: chainId })) : (jsx$2(TokenImage, { symbol: getSymbol(selectedToken, chainId), size: 28, chain: chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: getSymbol(selectedToken, chainId) })] }), enableZap && (jsx$2(Flex$1, { sx: { mr: '8px' }, children: jsx$2(Svg, { icon: "caret" }) }))] })] }),
|
|
72279
|
+
} }) }), jsxs(Flex$1, { className: "input-container token", onClick: () => (enableZap ? onTokenSelectorModal() : null), sx: { cursor: enableZap ? 'pointer' : 'default' }, children: [jsxs(Flex$1, { children: [jsx$2(Flex$1, { className: "input-container bondicon", children: lodashExports.isArray(splited) ? (jsx$2(TokenImage, { symbol: splited[0], symbol2: splited[1], size: 28, chain: chainId })) : (jsx$2(TokenImage, { symbol: getSymbol(selectedToken, chainId), size: 28, chain: chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: getSymbol(selectedToken, chainId) })] }), enableZap && (jsx$2(Flex$1, { sx: { mr: '8px' }, children: jsx$2(Svg, { icon: "caret" }) }))] })] }), jsxs(Flex$1, { className: "input-container balancerow", children: [jsx$2(Flex$1, { children: selectedTokenPrice && typedValue
|
|
72280
|
+
? `$${formatUSDNumber((selectedTokenPrice * parseFloat(typedValue)).toFixed(2))}`
|
|
72281
|
+
: '' }), jsxs(Flex$1, { children: [jsxs(Flex$1, { className: "balancerow text", children: ["Balance: ", tokenBalanceString] }), jsxs(Flex$1, { className: "balancerow max", children: [tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant !== 'alt' && (jsx$2(Fragment$1, { children: jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" }) })), tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant === 'alt' && (jsxs(Flex$1, { children: [jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 4).toString()), children: "25%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 2).toString()), children: "50%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) * 0.75).toString()), children: "75%" }), jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" })] }))] })] })] })] }));
|
|
72273
72282
|
};
|
|
72274
72283
|
|
|
72275
72284
|
var NetworkNames;
|
|
@@ -72863,7 +72872,7 @@ const ZapModal = ({ onDismiss, outputToken, account, chainId }) => {
|
|
|
72863
72872
|
});
|
|
72864
72873
|
});
|
|
72865
72874
|
};
|
|
72866
|
-
return (jsxs(Modal, { children: [jsx$2(ModalHeader, { onDismiss: onDismiss, children: jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsxs(Text, { sx: { fontSize: '22px', fontWeight: 700, lineHeight: '30px' }, children: ["Zap ", jsx$2(Svg, { icon: "ZapIcon" })] }), jsx$2(Flex, { onClick: onOpenSlippageModal, sx: { mr: '15px' }, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })] }) }), jsxs(Flex, { sx: { flexDirection: 'column', pt: '10px', gap: '10px' }, children: [jsx$2(Flex, { sx: { position: 'relative' }, children: jsx$2(Text, { children: "From:" }) }), jsx$2(Flex, { sx: { width: '100%', height: 'auto', justifyContent: 'space-between' }, children: jsx$2(TokenSelectorPanel, { typedValue: typedValue, setTypedValue: setTypedValue, selectedToken: inputToken,
|
|
72875
|
+
return (jsxs(Modal, { children: [jsx$2(ModalHeader, { onDismiss: onDismiss, children: jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between' }, children: [jsxs(Text, { sx: { fontSize: '22px', fontWeight: 700, lineHeight: '30px' }, children: ["Zap ", jsx$2(Svg, { icon: "ZapIcon" })] }), jsx$2(Flex, { onClick: onOpenSlippageModal, sx: { mr: '15px' }, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })] }) }), jsxs(Flex, { sx: { flexDirection: 'column', pt: '10px', gap: '10px' }, children: [jsx$2(Flex, { sx: { position: 'relative' }, children: jsx$2(Text, { children: "From:" }) }), jsx$2(Flex, { sx: { width: '100%', height: 'auto', justifyContent: 'space-between' }, children: jsx$2(TokenSelectorPanel, { typedValue: typedValue, setTypedValue: setTypedValue, selectedToken: inputToken, handleValueBtn: handleMaxInput, handleCurrencySelect: handleCurrencySelect, chainId: chainId, enableZap: true, tokenBalance: inputTokenBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, bondEarnToken: outputToken }) }), jsxs(Flex, { sx: { position: 'relative', mt: '10px' }, children: [jsx$2(Text, { children: "To:" }), jsx$2(Box$1, { sx: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)' }, children: jsx$2(Svg, { icon: "ZapArrow" }) })] }), jsx$2(TokenSelectorPanel, { typedValue: isWrap ? typedValue : outputValue === 0 ? '' : outputValue.toFixed(18), setTypedValue: () => null, selectedToken: outputToken, handleCurrencySelect: () => null, chainId: chainId, enableZap: false, tokenBalance: outputTokenBalanceString, selectedTokenPrice: outputTokenPrice === null || outputTokenPrice === void 0 ? void 0 : outputTokenPrice.price }), jsx$2(Flex, { className: "button-container zap", children: !account ? (jsx$2(ConnectButton, {})) : userChainId !== chainId ? (jsxs(Button, { className: "switch-button zap", onClick: (event) => {
|
|
72867
72876
|
event.stopPropagation();
|
|
72868
72877
|
switchChain({ chainId: chainId });
|
|
72869
72878
|
}, children: ["Switch to ", NETWORK_LABEL[chainId]] })) : approvalState === ApprovalState.NOT_APPROVED || approvalState === ApprovalState.PENDING ? (jsx$2(Button, { onClick: handleApprove, fullWidth: true, load: approvalState === ApprovalState.PENDING, disable: approvalState === ApprovalState.PENDING, children: pendingTx || approvalState === ApprovalState.PENDING ? 'ENABLING' : 'ENABLE' })) : (jsx$2(Button, { onClick: soulZapCallback, fullWidth: true, load: pendingTx || fetchingQuote || isConfirming, disabled: pendingTx || fetchingQuote || !zapData || !hasEnoughBalance || isConfirming || zapError, children: zapError
|
|
@@ -72875,15 +72884,11 @@ const ZapModal = ({ onDismiss, outputToken, account, chainId }) => {
|
|
|
72875
72884
|
: 'BUY' })) }), jsx$2(Flex, { sx: { marginTop: '10px', justifyContent: 'center' }, children: jsx$2(Link, { href: "https://docs.ape.bond/apebond/products-and-features/zap", target: "_blank", rel: "noopener noreferrer", sx: { textDecoration: 'none' }, children: jsxs(Text, { style: { fontSize: '12px', lineHeight: '18px', fontWeight: 400, borderBottom: '1px solid' }, children: ["Learn more", '>'] }) }) })] })] }));
|
|
72876
72885
|
};
|
|
72877
72886
|
|
|
72878
|
-
const AccordionText = ({
|
|
72879
|
-
const [isDropdownExpanded, setIsDropdownExpanded] = useState(false);
|
|
72880
|
-
const toggleDropdown = () => {
|
|
72881
|
-
setIsDropdownExpanded(!isDropdownExpanded);
|
|
72882
|
-
};
|
|
72887
|
+
const AccordionText = ({ isVisible = false }) => {
|
|
72883
72888
|
if (!isVisible) {
|
|
72884
72889
|
return null;
|
|
72885
72890
|
}
|
|
72886
|
-
return (jsxs(Fragment$1, { children: [
|
|
72891
|
+
return (jsxs(Fragment$1, { children: [jsx$2(Flex, { className: "accordion-title", children: "Bonds at Seedify are an exciting new product!" }), jsx$2(AnimatePresence, { children: jsx$2(motion.div, { initial: { height: 0 }, animate: { height: 'fit-content' }, transition: { opacity: { duration: 0.2 } }, exit: { height: 0 }, sx: { overflow: 'hidden', width: '100%' }, children: jsxs(Flex, { className: "accordion-body", sx: { flexDirection: 'column' }, children: [jsx$2(Flex, { sx: { mt: '10px' }, children: "Are you a strong believer in a project? Do you want to buy project tokens at a discount compared to the market? If so, you've arrived at the right place!" }), jsx$2(Flex, { sx: { mt: '10px' }, children: "Bonds allow you to purchase project tokens at a discounted price with a short-term linear vesting. Its a perfect solution for projects you're planning to buy and hold tokens of!" }), jsx$2(Flex, { sx: { mt: '10px' }, children: "When you buy a Bond, you essentially are given an NFT (which you can transfer across your wallets). Whichever wallet owns the NFT will be able to Claim tokens of that project post-purchase until vesting period ends. Bonds at Seedify can range their vesting from 7 Days to 90 Days, with 30 Days being the standard." })] }) }) })] }));
|
|
72887
72892
|
};
|
|
72888
72893
|
|
|
72889
72894
|
const useSoulZapBondQuote = (typedValue, inputCurrency, bond, account) => {
|
|
@@ -73098,7 +73103,7 @@ const SafeHTMLComponent = ({ html }) => {
|
|
|
73098
73103
|
|
|
73099
73104
|
const ProjectDescription = ({ description }) => {
|
|
73100
73105
|
const [isOpen, setIsOpen] = useState(false);
|
|
73101
|
-
return (jsxs(Flex, { className: "
|
|
73106
|
+
return (jsxs(Flex, { className: "description-container", children: [jsxs(Flex, { sx: { display: ['flex', 'flex', 'flex', 'none'], flexDirection: 'column' }, children: [jsx$2(Text, { sx: {
|
|
73102
73107
|
fontSize: ['12px', '12px', '12px', '14px'],
|
|
73103
73108
|
mt: '10px',
|
|
73104
73109
|
lineHeight: ['18px', '18px', '18px', '21px'],
|
|
@@ -73122,16 +73127,65 @@ const BondModalHeaderAlt = ({ bondData, onDismiss, showProjectInfoButton, }) =>
|
|
|
73122
73127
|
}
|
|
73123
73128
|
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
73124
73129
|
};
|
|
73125
|
-
|
|
73130
|
+
// const handleProjectViewNavigation = () => {
|
|
73131
|
+
// window.open(`${window.location.origin}/bonds/${bondData.billAddress}/${bondData.chainId}`, '_self')
|
|
73132
|
+
// track({
|
|
73133
|
+
// event: 'projectInfoClick',
|
|
73134
|
+
// chain: bondData.chainId,
|
|
73135
|
+
// data: {
|
|
73136
|
+
// cat: 'Modal',
|
|
73137
|
+
// bond: bondData.earnToken.symbol,
|
|
73138
|
+
// bondChain: bondData.chainId,
|
|
73139
|
+
// },
|
|
73140
|
+
// })
|
|
73141
|
+
// }
|
|
73142
|
+
return (jsx$2(Flex, { className: "modaltable-container title-container", children: jsx$2(Flex, { className: "slipagge-close-icons", sx: { flexDirection: 'row' }, children: onDismiss ? (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { pr: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) }), jsx$2(IconButton, { icon: "close", color: "text", variant: "transparent", onClick: handleClose })] })) : (jsx$2(Flex, { sx: {}, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) }) }));
|
|
73143
|
+
};
|
|
73144
|
+
|
|
73145
|
+
const ImageAndShortDescription = ({ bondData, onDismiss }) => {
|
|
73146
|
+
var _a;
|
|
73147
|
+
const SDKConfig = useSDKConfig();
|
|
73148
|
+
// Swiper logic for the alt view
|
|
73149
|
+
const [activeSlide, setActiveSlide] = useState(0);
|
|
73150
|
+
const { swiper, setSwiper } = useSwiper();
|
|
73151
|
+
const imagesLength = 3;
|
|
73152
|
+
const handleSlide = (event) => {
|
|
73153
|
+
const slideNumber = getDotPos(event.activeIndex, imagesLength);
|
|
73154
|
+
setActiveSlide(slideNumber);
|
|
73155
|
+
};
|
|
73156
|
+
const slideTo = (index) => {
|
|
73157
|
+
setActiveSlide(index);
|
|
73158
|
+
swiper === null || swiper === void 0 ? void 0 : swiper.slideTo(index);
|
|
73159
|
+
};
|
|
73160
|
+
return (jsxs(Flex, { sx: { maxWidth: ['unset', 'unset', 'unset', '500px'], flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Flex, { sx: {
|
|
73161
|
+
flexDirection: 'column',
|
|
73162
|
+
width: '100%',
|
|
73163
|
+
alignItems: 'center',
|
|
73164
|
+
overflow: 'hidden',
|
|
73165
|
+
position: 'relative',
|
|
73166
|
+
}, children: [jsxs(Swiper, { id: "hotbondsSweper", onSwiper: setSwiper, slidesPerView: "auto", centeredSlides: true, lazy: true, preloadImages: false, onSlideChange: handleSlide, style: { width: '100%', overflow: 'visible' }, children: [jsx$2(SwiperSlide, { style: {
|
|
73167
|
+
width: '100%',
|
|
73168
|
+
display: 'flex',
|
|
73169
|
+
justifyContent: 'center',
|
|
73170
|
+
}, children: jsx$2("img", { className: "project-image", src: "https://placehold.co/400x200" }) }, 0), jsx$2(SwiperSlide, { style: {
|
|
73171
|
+
width: '100%',
|
|
73172
|
+
display: 'flex',
|
|
73173
|
+
justifyContent: 'center',
|
|
73174
|
+
}, children: jsx$2("img", { className: "project-image", src: "https://placehold.co/400x200" }) }, 1), jsx$2(SwiperSlide, { style: {
|
|
73175
|
+
width: '100%',
|
|
73176
|
+
display: 'flex',
|
|
73177
|
+
justifyContent: 'center',
|
|
73178
|
+
}, children: jsx$2("img", { className: "project-image", src: "https://placehold.co/400x200" }) }, 2)] }), jsx$2(Flex, { sx: { position: 'absolute', bottom: ['15px', '15px', '15px', '20px'], left: 'calc(50% - 28,5px)', zIndex: 2 }, children: [...Array(imagesLength)].map((_, i) => {
|
|
73179
|
+
return jsx$2(SwiperDots, { isActive: i === activeSlide, onClick: () => slideTo(i) }, i);
|
|
73180
|
+
}) })] }), jsxs(Flex, { sx: { alignItems: 'center', display: ['flex', 'flex', 'flex', 'none'], p: '10px', width: '100%' }, children: [jsxs(Flex, { sx: { width: ['50%', '50%', '50%', '100%'], alignItems: 'center' }, children: [jsx$2(Flex, { sx: { mr: '5px' }, children: jsx$2(TokenImage, { symbol: (_a = bondData.showcaseTokenName) !== null && _a !== void 0 ? _a : bondData.earnToken.symbol, size: 30, chain: bondData.chainId }) }), jsxs("h2", { className: "modal-tokenname-chainicon", sx: { margin: '0px' }, children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, ' '] })] }), jsx$2(Flex, { className: "modal-marketprice-header", sx: { justifyContent: 'flex-end', alignItems: 'center' }, children: jsxs("span", { className: "modal-marketprice", children: ["Market Price: $", earnTokenPrice(bondData)] }) }), jsx$2(Flex, { className: "bondmodal-header-alt", sx: { mb: '10px' }, children: jsx$2(BondModalHeaderAlt, { bondData: bondData, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }) })] }), jsx$2(Flex, { className: "description-container paragraph-spaced", sx: { px: '10px', opacity: 0.7, mt: ['0', '0', '0', '10px'] }, children: jsx$2(ProjectDescription, { description: bondData === null || bondData === void 0 ? void 0 : bondData.shortDescription }) })] }));
|
|
73126
73181
|
};
|
|
73127
73182
|
|
|
73128
|
-
const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond
|
|
73129
|
-
// ??
|
|
73130
|
-
accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = false, }) => {
|
|
73183
|
+
const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) => {
|
|
73131
73184
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
73132
73185
|
const SDKConfig = useSDKConfig();
|
|
73133
73186
|
// State
|
|
73134
73187
|
const [modalVariant, setModalVariant] = useState(SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.modalVariant);
|
|
73188
|
+
const [accordionVisible, setAccordionVisible] = useState(false);
|
|
73135
73189
|
// Hooks
|
|
73136
73190
|
const userChainId = useChainId();
|
|
73137
73191
|
const { address: account } = useAccount();
|
|
@@ -73316,7 +73370,7 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
73316
73370
|
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');
|
|
73317
73371
|
}
|
|
73318
73372
|
};
|
|
73319
|
-
return (jsx$2(Modal, { className: "modal", onDismiss: onDismiss, children: modalVariant === 'standard' ? (jsx$2(Fragment$1, { children: bondData && (jsxs(Flex, { className: "modal-content", children: [typeof window !== 'undefined' && 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, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), 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,
|
|
73373
|
+
return (jsx$2(Modal, { className: "modal", onDismiss: onDismiss, children: modalVariant === 'standard' ? (jsx$2(Fragment$1, { children: bondData && (jsxs(Flex, { className: "modal-content", children: [typeof window !== 'undefined' && 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, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), 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, handleValueBtn: () => { 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) ? handleOpenZapModal() : 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) => {
|
|
73320
73374
|
event.stopPropagation();
|
|
73321
73375
|
switchChain({ chainId: bondData.chainId });
|
|
73322
73376
|
}, 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 ||
|
|
@@ -73329,15 +73383,35 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
73329
73383
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
73330
73384
|
!account ||
|
|
73331
73385
|
!inputValue ||
|
|
73332
|
-
parseFloat(inputValue) === 0, onClick: handleApprove, children: "enable" })) })] })
|
|
73333
|
-
|
|
73334
|
-
|
|
73335
|
-
|
|
73336
|
-
|
|
73337
|
-
|
|
73338
|
-
|
|
73339
|
-
|
|
73340
|
-
|
|
73386
|
+
parseFloat(inputValue) === 0, onClick: handleApprove, children: "enable" })) })] })] })] })) })) : (jsx$2(Fragment$1, { children: bondData && (jsxs(Fragment$1, { children: [jsxs(Flex, { className: "modal-content font-small", children: [typeof window !== 'undefined' && 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" })] })), jsxs(Flex, { className: "modaltable-container", sx: { flexDirection: 'row', gap: ['0px', '0px', '0px', '20px'] }, children: [jsx$2(ImageAndShortDescription, { bondData: bondData, onDismiss: onDismiss }), jsxs(Flex, { sx: { flexDirection: 'column', width: '600px' }, children: [jsxs(Flex, { sx: { alignItems: 'center', display: ['none', 'none', 'none', 'flex'] }, children: [jsx$2(Flex, { sx: { width: ['50%', '50%', '50%', '50%'], ml: ['0px', '0px', '0px', '10px'] }, children: jsxs(Flex, { className: "modal-tokenname-chainicon", sx: { margin: '0px' }, children: [jsx$2(Flex, { sx: { fontSize: '26px', fontWeight: 700, mr: '4px' }, children: bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName }), jsx$2(Svg, { width: 20, height: 20, icon: (_k = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bondData.chainId]) !== null && _k !== void 0 ? _k : 'question' })] }) }), jsxs(Flex, { className: "modal-marketprice-header", sx: { justifyContent: 'space-between', width: '100%', alignItems: 'center' }, children: [jsx$2(TokenImage, { symbol: (_l = bondData.showcaseTokenName) !== null && _l !== void 0 ? _l : bondData.earnToken.symbol, size: 30 }), jsx$2("span", { className: "modal-marketprice-token", children: bondData.earnToken.symbol }), jsx$2("hr", { className: "fading-hr rotate-hr" }), jsxs("span", { className: "modal-marketprice", children: ["Market Price: $", earnTokenPrice(bondData)] }), jsx$2("hr", { className: "fading-hr rotate-hr" })] }), jsx$2(Flex, { className: "bondmodal-header-alt", sx: { mb: '10px' }, children: jsx$2(BondModalHeaderAlt, { bondData: bondData, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }) })] }), jsxs(Flex, { sx: { flexDirection: 'column', marginTop: '20px', mx: '10px' }, children: [jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: (value) => setInputValue(value), 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, modalVariant: modalVariant }), jsxs(Flex, { className: "modal-youreceive-row", sx: { justifyContent: 'space-between', alignItems: 'center', fontSize: '14px' }, children: [jsxs(Flex, { className: "modal-youreceive-textbox", children: [jsx$2(Flex, { sx: { opacity: 0.8 }, children: "You will receive:" }), jsxs(Flex, { children: [jsx$2(Flex, { className: "modal-youreceive-tokenimage", sx: { marginLeft: '15px', marginRight: '5px' }, children: jsx$2(TokenImage, { symbol: (_m = bondData.showcaseTokenName) !== null && _m !== void 0 ? _m : bondData.earnToken.symbol, size: 20 }) }), jsxs(Flex, { className: "modal-receive-text", sx: { opacity: 0.8 }, children: [formatNumber$2((lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0)), ' ', bondData.earnToken.symbol, " + \u00A0", formatNumber$2((youGet(bondData, inputValue) -
|
|
73387
|
+
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) => {
|
|
73388
|
+
event.stopPropagation();
|
|
73389
|
+
switchChain({ chainId: bondData.chainId });
|
|
73390
|
+
}, children: `Switch Chain` })) : approvalState === ApprovalState.APPROVED ? (jsxs(Button, { className: "action-button", load: load, disabled: load || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) || !account || !inputValue || parseFloat(inputValue) === 0, onClick: handleBothPurchases, children: ["buy", ' ', isZap ? (jsx$2("span", { style: { marginLeft: '8px' }, children: jsx$2(Svg, { icon: "ZapIcon" }) })) : ('')] })) : (jsx$2(Button, { className: "action-button", load: approvalState === ApprovalState.PENDING, disabled: approvalState === ApprovalState.PENDING ||
|
|
73391
|
+
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
73392
|
+
!account ||
|
|
73393
|
+
!inputValue ||
|
|
73394
|
+
parseFloat(inputValue) === 0, onClick: handleApprove, children: "enable" })) })] }), jsx$2(Flex, { sx: { width: '100%', margin: ['0', '0', '0', '10px 0'] }, children: jsx$2("hr", { className: "fading-hr" }) }), jsxs(Flex, { sx: { width: '100%', fontSize: '14px', display: ['none', 'none', 'none', 'flex'] }, children: [jsxs(Flex, { sx: { width: '50%', flexDirection: 'column', opacity: 0.8 }, 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', opacity: 0.8 }, children: ["If purchased from market:", ' ', formatNumber$2((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:" }), ' ', formatNumber$2(youGet(bondData, inputValue).toFixed(0)), ' ', jsx$2("span", { className: "flex-inline", children: bondData.earnToken.symbol })] })] }), jsxs(Flex, { sx: {
|
|
73395
|
+
width: '100%',
|
|
73396
|
+
fontSize: '14px',
|
|
73397
|
+
display: ['flex', 'flex', 'flex', 'none'],
|
|
73398
|
+
flexDirection: 'column',
|
|
73399
|
+
}, children: [jsxs(Flex, { sx: { opacity: 0.8 }, children: ["Market Price: $", formatUSDNumber((youGet(bondData, inputValue) * lodashExports.toNumber(earnTokenPrice(bondData))).toString())] }), jsxs(Flex, { sx: { opacity: 0.8 }, children: ["If purchased from market:", ' ', formatNumber$2((lodashExports.toNumber(inputValue) / lodashExports.toNumber(earnTokenPrice(bondData))).toFixed(0)), ' ', bondData.earnToken.symbol] }), jsxs(Flex, { sx: { mt: '10px' }, children: [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), "%)"] })] }), jsxs(Flex, { sx: { mt: '10px' }, children: [jsx$2("span", { className: "text-highlight flex-inline", children: "Amount you will get:" }), ' ', formatNumber$2(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: '100%', flexDirection: 'row', justifyContent: 'space-around' }, children: [jsxs(Flex, { sx: {
|
|
73400
|
+
width: '100%',
|
|
73401
|
+
justifyContent: 'center',
|
|
73402
|
+
flexDirection: ['column', 'column', 'column', 'row'],
|
|
73403
|
+
}, children: [jsx$2(Flex, { className: "modal-footer-header", children: "Vesting start Date:\u00A0" }), jsxs(Flex, { children: [' ', new Intl.DateTimeFormat('en-GB', { day: '2-digit', month: 'short', year: 'numeric' }).format(new Date())] })] }), jsxs(Flex, { sx: {
|
|
73404
|
+
width: '100%',
|
|
73405
|
+
justifyContent: 'center',
|
|
73406
|
+
flexDirection: ['column', 'column', 'column', 'row'],
|
|
73407
|
+
}, children: [jsx$2(Flex, { className: "modal-footer-header", sx: { justifyContent: ['flex-end', 'flex-end', 'flex-end', 'flex-start'] }, children: "Vesting end Date:\u00A0" }), jsxs(Flex, { sx: { justifyContent: ['flex-end', 'flex-end', 'flex-end', 'flex-start'] }, children: [' ', new Intl.DateTimeFormat('en-GB', { day: '2-digit', month: 'short', year: 'numeric' }).format(new Date(Date.now() + vestingTime((_o = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _o !== void 0 ? _o : 0).days * 86400000))] })] })] }), jsx$2("hr", { className: "fading-hr hide-mobile" }), jsxs(Flex, { sx: {
|
|
73408
|
+
width: '100%',
|
|
73409
|
+
justifyContent: ['space-between', 'space-between', 'space-between', 'space-around'],
|
|
73410
|
+
}, children: [jsxs(Flex, { sx: { justifyContent: 'center', flexDirection: ['column', 'column', 'column', 'row'] }, children: [jsx$2(Flex, { className: "modal-footer-header", children: "Vesting type:\u00A0" }), " ", jsx$2(Flex, { children: " Linear" })] }), jsxs(Flex, { sx: {
|
|
73411
|
+
justifyContent: 'center',
|
|
73412
|
+
cursor: 'pointer',
|
|
73413
|
+
alignItems: 'center',
|
|
73414
|
+
}, onClick: () => setAccordionVisible(!accordionVisible), className: "modal-expander", children: ["What are bonds? \u00A0 ", jsx$2(Svg, { icon: "caret", direction: accordionVisible ? 'up' : 'down' })] })] })] })] }), accordionVisible && (jsx$2(Flex, { className: "modaltable-container accordion-container", children: jsx$2(AccordionText, { isVisible: accordionVisible }) }))] })) })) }));
|
|
73341
73415
|
};
|
|
73342
73416
|
|
|
73343
73417
|
/*
|
|
@@ -73570,7 +73644,7 @@ const BondRow = ({ bond }) => {
|
|
|
73570
73644
|
const tokens = new BigNumber$1(tokensRemaining);
|
|
73571
73645
|
return tokens.times(payoutTokenPrice);
|
|
73572
73646
|
};
|
|
73573
|
-
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:
|
|
73647
|
+
return (jsxs("div", { className: "bond-row", onClick: handleOpenModal, children: [jsx$2("div", { className: "token-info-container bond-market", children: jsx$2(TokenInfoAndName, { bill: bond }) }), jsxs("div", { className: "bond-info-columns", children: [jsx$2("div", { className: `discount-column ${getDiscountColor(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: {
|
|
73574
73648
|
width: '127px',
|
|
73575
73649
|
height: '25px',
|
|
73576
73650
|
flexDirection: 'column',
|
|
@@ -73579,7 +73653,7 @@ const BondRow = ({ bond }) => {
|
|
|
73579
73653
|
}, showTooltip: true, toolTip: `${remainingTokensFormat(bond)} ${bond.earnToken.symbol} (${formatDollar({
|
|
73580
73654
|
num: remainingTokensUsd(bond).toNumber(),
|
|
73581
73655
|
isPrice: true,
|
|
73582
|
-
})})` }) }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_e = (_d = (_c = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _c === void 0 ? void 0 : _c.address) === null || _d === void 0 ? void 0 : _d[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _e !== void 0 ? _e : '', earnTokenSymbol: (_g = (_f = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _f === void 0 ? void 0 : _f.symbol) !== null && _g !== void 0 ? _g : '', bondContract: billAddress !== null && billAddress !== void 0 ? billAddress : '', 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(7%, -2%)", children: jsx$2(Flex, { sx: { opacity: 0.8 }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] })] }, billAddress));
|
|
73656
|
+
})})` }) }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_e = (_d = (_c = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _c === void 0 ? void 0 : _c.address) === null || _d === void 0 ? void 0 : _d[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _e !== void 0 ? _e : '', earnTokenSymbol: (_g = (_f = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _f === void 0 ? void 0 : _f.symbol) !== null && _g !== void 0 ? _g : '', bondContract: billAddress !== null && billAddress !== void 0 ? billAddress : '', 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(7%, -2%)", children: jsx$2(Flex, { className: "more-icon", sx: { opacity: 0.8 }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] })] }, billAddress));
|
|
73583
73657
|
};
|
|
73584
73658
|
|
|
73585
73659
|
const HotBondCard = ({ bond }) => {
|
|
@@ -73598,7 +73672,7 @@ const HotBondCard = ({ bond }) => {
|
|
|
73598
73672
|
},
|
|
73599
73673
|
});
|
|
73600
73674
|
};
|
|
73601
|
-
return (jsx$2(Flex, { sx: styles$a.desktopCard, onClick: handleOpenModal, children: jsxs(Flex, { sx: { flexDirection: 'column', width: '100%' }, children: [jsxs(Flex, { sx: { width: '100%', height: '75px' }, children: [jsx$2(Flex, { sx: { width: '66.66%' }, children: jsx$2(TokenInfoAndName, { bill: bond, isHotBond: true }) }), jsx$2(Flex, { className: "column column-tokenicons", sx: { width: '33.33% !important', justifyContent: 'center !important', alignItems: 'center' }, children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_c = (_b = (_a = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _c !== void 0 ? _c : '', earnTokenSymbol: (_e = (_d = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _d === void 0 ? void 0 : _d.symbol) !== null && _e !== void 0 ? _e : '', bondContract: (_f = bond === null || bond === void 0 ? void 0 : bond.billAddress) !== null && _f !== void 0 ? _f : '', projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: bond === null || bond === void 0 ? void 0 : bond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)", children: jsx$2(Svg, { icon: "more", width: "20px" }) }) })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-around' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400 }, children: "Discount" }), jsx$2(Flex, { className: `${getDiscountColor(discount)}`, sx: { width: '100%', justifyContent: 'center' }, children: discount !== undefined ? `${discount === null || discount === void 0 ? void 0 : discount.toFixed(2)}%` : '-' })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "ARR" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: calculateARR(bond) !== undefined ? calculateARR(bond) : '-' })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "Terms" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: ((_g = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _g === void 0 ? void 0 : _g.days) ? `${(_h = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _h === void 0 ? void 0 : _h.days} D` : '-' })] })] })] }) }));
|
|
73675
|
+
return (jsx$2(Flex, { sx: styles$a.desktopCard, className: "hot-bond-card", onClick: handleOpenModal, children: jsxs(Flex, { sx: { flexDirection: 'column', width: '100%' }, children: [jsxs(Flex, { sx: { width: '100%', height: '75px' }, children: [jsx$2(Flex, { sx: { width: '66.66%' }, children: jsx$2(TokenInfoAndName, { bill: bond, isHotBond: true }) }), jsx$2(Flex, { className: "column column-tokenicons", sx: { width: '33.33% !important', justifyContent: 'center !important', alignItems: 'center' }, children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_c = (_b = (_a = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _c !== void 0 ? _c : '', earnTokenSymbol: (_e = (_d = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _d === void 0 ? void 0 : _d.symbol) !== null && _e !== void 0 ? _e : '', bondContract: (_f = bond === null || bond === void 0 ? void 0 : bond.billAddress) !== null && _f !== void 0 ? _f : '', projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: bond === null || bond === void 0 ? void 0 : bond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)", children: jsx$2(Svg, { icon: "more", width: "20px" }) }) })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-around' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400 }, children: "Discount" }), jsx$2(Flex, { className: `${getDiscountColor(discount)}`, sx: { width: '100%', justifyContent: 'center' }, children: discount !== undefined ? `${discount === null || discount === void 0 ? void 0 : discount.toFixed(2)}%` : '-' })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "ARR" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: calculateARR(bond) !== undefined ? calculateARR(bond) : '-' })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "Terms" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: ((_g = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _g === void 0 ? void 0 : _g.days) ? `${(_h = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _h === void 0 ? void 0 : _h.days} D` : '-' })] })] })] }) }));
|
|
73602
73676
|
};
|
|
73603
73677
|
|
|
73604
73678
|
function useHotBondContracts() {
|
|
@@ -73695,7 +73769,7 @@ const BondRowsByChain = ({ bonds, hideTitles }) => {
|
|
|
73695
73769
|
const SDKConfig = useSDKConfig();
|
|
73696
73770
|
const validatedChains = (_a = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains) === null || _a === void 0 ? void 0 : _a.filter((chain) => MAINNET_CHAINS.includes(chain));
|
|
73697
73771
|
return (jsx$2(Flex$1, { className: "bondrowsbychain", children: validatedChains === null || validatedChains === void 0 ? void 0 : validatedChains.map((chain) => {
|
|
73698
|
-
return (jsx$2(BondRowsWithTitle, { chain: chain, bonds: bonds, hideTitles: hideTitles, showHotBonds: chain === types.ChainId.BASE || chain === types.ChainId.MAINNET }, chain));
|
|
73772
|
+
return (jsx$2(BondRowsWithTitle, { chain: chain, bonds: bonds, hideTitles: hideTitles, showHotBonds: SDKConfig.useHotBonds ? chain === types.ChainId.BASE || chain === types.ChainId.MAINNET : false }, chain));
|
|
73699
73773
|
}) }));
|
|
73700
73774
|
};
|
|
73701
73775
|
|
|
@@ -73743,7 +73817,7 @@ const BuyAgainRow = () => {
|
|
|
73743
73817
|
background: 'linear-gradient(0deg, rgba(170, 128, 249, 0.20) 0%, rgba(170, 128, 249, 0.20) 100%), var(--Neutral-Elevation-2, #1F1D29)',
|
|
73744
73818
|
borderRadius: 'normal',
|
|
73745
73819
|
flexDirection: 'column',
|
|
73746
|
-
}, children: [jsx$2(Flex, { sx: {
|
|
73820
|
+
}, children: [jsx$2(Flex, { className: "buy-again-header", sx: {
|
|
73747
73821
|
width: '100%',
|
|
73748
73822
|
fontSize: '12px',
|
|
73749
73823
|
fontWeight: 500,
|
|
@@ -73786,7 +73860,7 @@ const styles$7 = {
|
|
|
73786
73860
|
const SmallRecommendationCard = ({ recommendation }) => {
|
|
73787
73861
|
var _a;
|
|
73788
73862
|
const vestingTime = getTimePeriods((_a = recommendation.vestingTerm) !== null && _a !== void 0 ? _a : 0, true);
|
|
73789
|
-
return (jsxs(Flex, { sx: styles$7.smallCardContainer, onClick: () => window.open(`${window.location.origin}/bonds
|
|
73863
|
+
return (jsxs(Flex, { sx: styles$7.smallCardContainer, onClick: () => window.open(`${window.location.origin}/bonds?bondAddress=${recommendation.contractAddress}&bondChain=${recommendation.chainId}`, '_self'), children: [jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(TokenImage, { symbol: recommendation.payoutTokenName, size: 32, chain: recommendation.chainId }), jsxs(Flex, { sx: { mx: '10px', alignItems: 'center' }, children: [jsx$2(Flex, { sx: { fontSize: '14px', px: '6px' }, children: recommendation.payoutTokenName }), jsxs(Flex, { sx: styles$7.subTitle, children: [vestingTime.days, "D"] })] })] }), jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(Flex, { sx: styles$7.subTitle, children: "Discount" }), jsxs(Flex, { sx: { fontSize: '12px', color: recommendation.discount > 0 ? 'success' : 'error', ml: '6px' }, children: [recommendation.discount.toFixed(2), "%"] })] })] }));
|
|
73790
73864
|
};
|
|
73791
73865
|
|
|
73792
73866
|
const RecommendationCards$1 = () => {
|
|
@@ -73848,7 +73922,7 @@ const FavIcon = ({ filterOption, setFilterOption, }) => {
|
|
|
73848
73922
|
const handleFilterOption = (newOption) => {
|
|
73849
73923
|
setFilterOption(newOption);
|
|
73850
73924
|
};
|
|
73851
|
-
return (jsx$2(Flex, { sx: { justifyContent: 'center', alignItems: 'center', minWidth: '25px', cursor: 'pointer', ml: '15px' }, onClick: () => {
|
|
73925
|
+
return (jsx$2(Flex, { sx: { justifyContent: 'center', alignItems: 'center', minWidth: '25px', cursor: 'pointer', ml: '15px' }, className: "search-fav-icon", onClick: () => {
|
|
73852
73926
|
handleFilterOption(filterOption !== 'FAVORITES' ? 'FAVORITES' : 'ALL');
|
|
73853
73927
|
}, children: jsx$2(AnimatePresence, { mode: "wait", children: jsx$2(motion.div, { initial: false, animate: { opacity: 1, scale: 1.0 }, exit: { opacity: 0, scale: 0.8 }, transition: { duration: 0.2 }, style: { display: 'flex', alignItems: 'center' }, children: filterOption === 'FAVORITES' ? (jsx$2(Svg, { icon: "StarFilled", width: 22, height: 22 })) : (jsx$2(Svg, { icon: "Star", width: 20, height: 20 })) }, filterOption === 'FAVORITES' ? 'StarFilled' : 'Star') }) }));
|
|
73854
73928
|
};
|
|
@@ -73871,6 +73945,7 @@ const Bonds = () => {
|
|
|
73871
73945
|
const { data: allBonds } = useBondsList();
|
|
73872
73946
|
const { data: chainFilterOption, setChainFilterOption } = useChainFilterOption();
|
|
73873
73947
|
const { data: tokenPrices } = useTokenPrices();
|
|
73948
|
+
const SDKConfig = useSDKConfig();
|
|
73874
73949
|
useEffect(() => {
|
|
73875
73950
|
//@ts-ignore
|
|
73876
73951
|
if ((bondData === null || bondData === void 0 ? void 0 : bondData.length) === 0 && (tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices.length) > 0 && (allBonds === null || allBonds === void 0 ? void 0 : allBonds.length) > 0) {
|
|
@@ -73884,7 +73959,7 @@ const Bonds = () => {
|
|
|
73884
73959
|
const [filterOption, setFilterOption] = useState('ALL');
|
|
73885
73960
|
const sortedBonds = sortBonds(sortConfig, bondData);
|
|
73886
73961
|
const topTags = useTopTags(sortedBonds);
|
|
73887
|
-
const filterOptions = ['ALL', 'FAVORITES', ...topTags, 'SOLD OUT'];
|
|
73962
|
+
const filterOptions = SDKConfig.referenceId !== 'seedify' ? ['ALL', 'FAVORITES', ...topTags, 'SOLD OUT'] : ['ALL', ...topTags, 'SOLD OUT'];
|
|
73888
73963
|
const billsToRender = useMemo(() => {
|
|
73889
73964
|
let billsToReturn = filterOption === 'SOLD OUT' ? (allBonds !== null && allBonds !== void 0 ? allBonds : []) : (sortedBonds !== null && sortedBonds !== void 0 ? sortedBonds : []);
|
|
73890
73965
|
if (searchQuery) {
|
|
@@ -90504,7 +90579,7 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
|
|
|
90504
90579
|
p: '20px',
|
|
90505
90580
|
borderRadius: '10px',
|
|
90506
90581
|
mt: '5px',
|
|
90507
|
-
}, children: [jsx$2(BondModalHeader, { bondData: bondData }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), 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,
|
|
90582
|
+
}, children: [jsx$2(BondModalHeader, { bondData: bondData }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), 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, handleValueBtn: () => { 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) ? handleOpenZapModal() : 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) => {
|
|
90508
90583
|
event.stopPropagation();
|
|
90509
90584
|
switchChain({ chainId: bondData.chainId });
|
|
90510
90585
|
}, 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 ||
|
|
@@ -3,6 +3,7 @@ export interface SDKProps {
|
|
|
3
3
|
referenceId: string;
|
|
4
4
|
chains: number[];
|
|
5
5
|
useRainbowKit: boolean;
|
|
6
|
+
useHotBonds: boolean;
|
|
6
7
|
modalVariant: 'alt' | 'standard';
|
|
7
8
|
urls?: Partial<Record<URLKeys, string>>;
|
|
8
9
|
};
|
|
@@ -17,6 +18,7 @@ export declare const useSDKConfig: (config?: SDKProps) => {
|
|
|
17
18
|
referenceId?: string | undefined;
|
|
18
19
|
chains?: number[] | undefined;
|
|
19
20
|
useRainbowKit?: boolean | undefined;
|
|
21
|
+
useHotBonds?: boolean | undefined;
|
|
20
22
|
modalVariant?: "alt" | "standard" | undefined;
|
|
21
23
|
};
|
|
22
24
|
export type URLKeys = 'apiV2' | 'realTimeApi' | 'apeswapLists' | 'mainUrl';
|
package/dist/styles.css
CHANGED
|
@@ -133,6 +133,17 @@
|
|
|
133
133
|
|
|
134
134
|
.modal {
|
|
135
135
|
width: fit-content !important;
|
|
136
|
+
max-width: 95%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.project-image {
|
|
140
|
+
border-radius: 6px;
|
|
141
|
+
width: 100%;
|
|
142
|
+
}
|
|
143
|
+
@media (min-width: 1100px) {
|
|
144
|
+
.project-image {
|
|
145
|
+
width: 475px;
|
|
146
|
+
}
|
|
136
147
|
}
|
|
137
148
|
|
|
138
149
|
.modal-content {
|
|
@@ -147,10 +158,6 @@
|
|
|
147
158
|
min-width: 700px;
|
|
148
159
|
}
|
|
149
160
|
|
|
150
|
-
.gpt {
|
|
151
|
-
max-width: 1100px;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
161
|
.modaltable-container {
|
|
155
162
|
width: 100%;
|
|
156
163
|
display: flex;
|
|
@@ -251,11 +258,10 @@
|
|
|
251
258
|
.modaltable-container.description-container {
|
|
252
259
|
display: flex;
|
|
253
260
|
align-items: flex-start;
|
|
254
|
-
padding-top: 10px;
|
|
255
|
-
padding-bottom: 10px;
|
|
256
261
|
font-weight: 400;
|
|
257
262
|
font-size: 14px;
|
|
258
263
|
line-height: 21px;
|
|
264
|
+
padding: 10px 0;
|
|
259
265
|
}
|
|
260
266
|
|
|
261
267
|
.modaltable-container.blocks-container {
|
|
@@ -389,7 +395,7 @@
|
|
|
389
395
|
flex-direction: column;
|
|
390
396
|
background: var(--theme-ui-colors-white3);
|
|
391
397
|
border-radius: 10px;
|
|
392
|
-
min-height:
|
|
398
|
+
min-height: 96px;
|
|
393
399
|
padding: 10px;
|
|
394
400
|
}
|
|
395
401
|
|
|
@@ -438,7 +444,7 @@
|
|
|
438
444
|
border-radius: 10px;
|
|
439
445
|
border: medium;
|
|
440
446
|
padding-right: 10px;
|
|
441
|
-
width:
|
|
447
|
+
width: 100%;
|
|
442
448
|
height: 50px;
|
|
443
449
|
font-size: 22px;
|
|
444
450
|
}
|
|
@@ -463,6 +469,10 @@
|
|
|
463
469
|
justify-content: space-between;
|
|
464
470
|
}
|
|
465
471
|
|
|
472
|
+
.input-container.bondicon {
|
|
473
|
+
margin-left: 5px;
|
|
474
|
+
}
|
|
475
|
+
|
|
466
476
|
.modaltable-container.button-container {
|
|
467
477
|
width: 100%;
|
|
468
478
|
padding-top: 10px;
|
|
@@ -498,8 +508,18 @@
|
|
|
498
508
|
|
|
499
509
|
.modaltable-container.accordion-container {
|
|
500
510
|
display: flex;
|
|
511
|
+
position: absolute;
|
|
512
|
+
padding: 30px 50px;
|
|
513
|
+
background: #12131A;
|
|
501
514
|
width: 100%;
|
|
502
|
-
|
|
515
|
+
border-radius: 0 0 10px 10px;
|
|
516
|
+
gap: 10px !important;
|
|
517
|
+
}
|
|
518
|
+
@media (min-width: 1100px) {
|
|
519
|
+
.modaltable-container.accordion-container {
|
|
520
|
+
width: 90%;
|
|
521
|
+
left: 5%;
|
|
522
|
+
}
|
|
503
523
|
}
|
|
504
524
|
|
|
505
525
|
.toast {
|
|
@@ -575,18 +595,14 @@
|
|
|
575
595
|
margin: 20px 0; /* Adjust margin for spacing */
|
|
576
596
|
}
|
|
577
597
|
|
|
578
|
-
|
|
579
|
-
|
|
598
|
+
.rotate-hr {
|
|
599
|
+
rotate: 90deg;
|
|
600
|
+
margin: 0px !important;
|
|
601
|
+
width: 20px !important;
|
|
580
602
|
}
|
|
581
603
|
|
|
582
|
-
.
|
|
583
|
-
|
|
584
|
-
margin-right: -20px !important;
|
|
585
|
-
margin-bottom: -20px !important;
|
|
586
|
-
margin-top: 20px !important;
|
|
587
|
-
height: 50px;
|
|
588
|
-
align-items: center;
|
|
589
|
-
border-top: 1px solid #FFFFFF;
|
|
604
|
+
span.flex-inline {
|
|
605
|
+
display: contents;
|
|
590
606
|
}
|
|
591
607
|
|
|
592
608
|
.expand-icon {
|
|
@@ -594,6 +610,24 @@ span.flex-inline {
|
|
|
594
610
|
fill: #38A611;
|
|
595
611
|
}
|
|
596
612
|
|
|
613
|
+
.modal-receive-text {
|
|
614
|
+
padding-left: 5px;
|
|
615
|
+
font-size: 14px;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.bondmodal-header-alt {
|
|
619
|
+
padding-left: 50px;
|
|
620
|
+
margin: 0px 0px 10px 0px !important;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.token-selector-panel {
|
|
624
|
+
flex-direction: column;
|
|
625
|
+
border-radius: 10px;
|
|
626
|
+
background: var(--theme-ui-colors-white3);
|
|
627
|
+
padding: 10px;
|
|
628
|
+
min-height: 92px;
|
|
629
|
+
}
|
|
630
|
+
|
|
597
631
|
.bond-row {
|
|
598
632
|
display: flex;
|
|
599
633
|
flex-direction: row;
|
|
@@ -1286,7 +1320,6 @@ span.flex-inline {
|
|
|
1286
1320
|
flex-direction: column;
|
|
1287
1321
|
border-radius: 10px;
|
|
1288
1322
|
background-color: var(--theme-ui-colors-white2);
|
|
1289
|
-
border-radius: 10px;
|
|
1290
1323
|
z-index: 1001;
|
|
1291
1324
|
max-width: 1200px;
|
|
1292
1325
|
min-width: 1000px;
|
|
@@ -4,9 +4,6 @@ export interface BondModalProps {
|
|
|
4
4
|
bondAddress?: string;
|
|
5
5
|
bondChain?: number;
|
|
6
6
|
handlePurchasedBond?: (hash: string) => void;
|
|
7
|
-
accordionTitle?: string;
|
|
8
|
-
accordionBody?: string;
|
|
9
|
-
accordionVisible?: boolean;
|
|
10
7
|
}
|
|
11
8
|
declare const BondModal: React.FC<BondModalProps>;
|
|
12
9
|
export default BondModal;
|