@ape.swap/bonds-sdk 3.0.23 → 3.0.24
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { icons } from '../../components/uikit-sdk/Svg/types';
|
|
2
2
|
import { ChainId } from '@ape.swap/apeswap-lists';
|
|
3
3
|
export declare const MAINNET_CHAINS: ChainId[];
|
|
4
|
+
export declare const TESTNET_CHAINS: ChainId[];
|
|
4
5
|
export declare const NETWORK_ICONS: Partial<Record<number, icons>>;
|
|
5
6
|
export declare const NETWORK_LABEL: Record<number, string>;
|
|
6
7
|
export declare const BLOCK_EXPLORER: Record<number, string>;
|
package/dist/main.js
CHANGED
|
@@ -18659,9 +18659,10 @@ const MAINNET_CHAINS = [
|
|
|
18659
18659
|
types.ChainId.AVAX,
|
|
18660
18660
|
types.ChainId.BLAST,
|
|
18661
18661
|
types.ChainId.CROSSFI,
|
|
18662
|
-
types.ChainId.MONAD_TESTNET,
|
|
18663
18662
|
types.ChainId.SONIC,
|
|
18663
|
+
types.ChainId.MONAD_TESTNET,
|
|
18664
18664
|
];
|
|
18665
|
+
const TESTNET_CHAINS = [types.ChainId.MONAD_TESTNET];
|
|
18665
18666
|
// Network Icons
|
|
18666
18667
|
const NETWORK_ICONS = {
|
|
18667
18668
|
[types.ChainId.BSC]: icons.BNB_TOKEN,
|
|
@@ -71536,15 +71537,30 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
|
|
|
71536
71537
|
// Hooks
|
|
71537
71538
|
const SDKConfig = useSDKConfig();
|
|
71538
71539
|
const chains = SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.chains;
|
|
71540
|
+
const mainnetChains = chains.filter((item) => !TESTNET_CHAINS.includes(item));
|
|
71541
|
+
const testnetChains = chains.filter((item) => TESTNET_CHAINS.includes(item));
|
|
71539
71542
|
// State
|
|
71540
71543
|
const [isOpen, setIsOpen] = useState(false);
|
|
71541
71544
|
// Handlers
|
|
71542
71545
|
const handleCheckbox = (newChain) => {
|
|
71543
|
-
const prevChainFilterOptions = chainFilterOption;
|
|
71546
|
+
const prevChainFilterOptions = chainFilterOption.map(String);
|
|
71544
71547
|
let newChainFilterOption;
|
|
71545
71548
|
if (newChain === 'All Chains') {
|
|
71546
71549
|
newChainFilterOption = ['All Chains'];
|
|
71547
71550
|
}
|
|
71551
|
+
else if (newChain === 'All Testnet') {
|
|
71552
|
+
if (prevChainFilterOptions.includes('All Testnet')) {
|
|
71553
|
+
newChainFilterOption = prevChainFilterOptions.filter((option) => ![...testnetChains.map((t) => t.toString()), 'All Testnet'].includes(option));
|
|
71554
|
+
}
|
|
71555
|
+
else {
|
|
71556
|
+
newChainFilterOption = [
|
|
71557
|
+
...prevChainFilterOptions.filter((option) => option !== 'All Chains'),
|
|
71558
|
+
...testnetChains.map((t) => t.toString()),
|
|
71559
|
+
'All Testnet',
|
|
71560
|
+
];
|
|
71561
|
+
}
|
|
71562
|
+
newChainFilterOption = newChainFilterOption.length === 0 ? ['All Chains'] : newChainFilterOption;
|
|
71563
|
+
}
|
|
71548
71564
|
else {
|
|
71549
71565
|
if (prevChainFilterOptions.includes(newChain)) {
|
|
71550
71566
|
const filteredChains = prevChainFilterOptions.filter((option) => option !== newChain);
|
|
@@ -71552,8 +71568,8 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
|
|
|
71552
71568
|
}
|
|
71553
71569
|
else {
|
|
71554
71570
|
const newArray = [...prevChainFilterOptions.filter((option) => option !== 'All Chains'), newChain];
|
|
71555
|
-
const
|
|
71556
|
-
newChainFilterOption =
|
|
71571
|
+
const allMainnetsSelected = MAINNET_CHAINS.every((chain) => newArray.includes(chain.toString()));
|
|
71572
|
+
newChainFilterOption = allMainnetsSelected ? ['All Chains'] : newArray;
|
|
71557
71573
|
}
|
|
71558
71574
|
}
|
|
71559
71575
|
setChainFilterOption(newChainFilterOption);
|
|
@@ -71576,7 +71592,7 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
|
|
|
71576
71592
|
alignItems: 'center',
|
|
71577
71593
|
width: '100%',
|
|
71578
71594
|
justifyContent: 'space-between',
|
|
71579
|
-
}, 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 && (
|
|
71595
|
+
}, 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 && (jsxs(Flex, { sx: {
|
|
71580
71596
|
flexDirection: ['column', 'column', 'column'],
|
|
71581
71597
|
position: 'absolute',
|
|
71582
71598
|
top: '45px',
|
|
@@ -71587,15 +71603,25 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
|
|
|
71587
71603
|
borderRadius: 'normal',
|
|
71588
71604
|
background: 'white2',
|
|
71589
71605
|
zIndex: 1001,
|
|
71590
|
-
}, children: ['All Chains', ...
|
|
71591
|
-
|
|
71592
|
-
|
|
71593
|
-
|
|
71594
|
-
|
|
71595
|
-
|
|
71596
|
-
|
|
71597
|
-
|
|
71598
|
-
|
|
71606
|
+
}, children: [['All Chains', ...mainnetChains].map((chainId) => {
|
|
71607
|
+
return (jsx$2(Flex, { sx: {
|
|
71608
|
+
borderRadius: 'normal',
|
|
71609
|
+
p: '5px 15px',
|
|
71610
|
+
minHeight: '40px',
|
|
71611
|
+
cursor: 'pointer',
|
|
71612
|
+
'&:hover': { bg: 'white3' },
|
|
71613
|
+
}, onClick: () => handleCheckbox(chainId.toString()), children: jsxs(Flex, { sx: { width: '100%', alignItems: 'center', fontSize: '14px' }, children: [jsx$2(Checkbox, { checked: chainFilterOption.includes(chainId.toString()) }), chainId === 'All Chains' ? (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px' }, children: jsx$2(Svg, { icon: "AllChains", width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: "All Chains" })] })) : (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px', borderRadius: '50px', overflow: 'hidden' }, children: jsx$2(Svg, { icon: NETWORK_ICONS[chainId], width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: NETWORK_LABEL[chainId] })] }))] }) }, chainId));
|
|
71614
|
+
}), testnetChains.length > 0 &&
|
|
71615
|
+
['All Testnet', ...testnetChains].map((chainId) => {
|
|
71616
|
+
return (jsx$2(Flex, { sx: {
|
|
71617
|
+
borderRadius: 'normal',
|
|
71618
|
+
p: '5px 15px',
|
|
71619
|
+
minHeight: '40px',
|
|
71620
|
+
cursor: 'pointer',
|
|
71621
|
+
'&:hover': { bg: 'white3' },
|
|
71622
|
+
pl: chainId !== 'All Testnet' ? '35px' : '15px',
|
|
71623
|
+
}, onClick: () => handleCheckbox(chainId.toString()), children: jsxs(Flex, { sx: { width: '100%', alignItems: 'center', fontSize: '14px' }, children: [jsx$2(Checkbox, { checked: chainFilterOption.includes(chainId.toString()) }), chainId === 'All Testnet' ? (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px' }, children: jsx$2(Svg, { icon: "AllChains", width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: "All Testnet" })] })) : (jsxs(Fragment$1, { children: [jsx$2(Flex, { sx: { mx: '8px', borderRadius: '50px', overflow: 'hidden' }, children: jsx$2(Svg, { icon: NETWORK_ICONS[chainId], width: "22px" }) }), jsx$2(Text, { sx: { lineHeight: '22px', fontWeight: 400 }, children: NETWORK_LABEL[chainId] })] }))] }) }, chainId));
|
|
71624
|
+
})] }))] }));
|
|
71599
71625
|
};
|
|
71600
71626
|
|
|
71601
71627
|
const BondFilters = ({ setChainFilterOption, chainFilterOption, filterOptions, filterOption, setFilterOption, onHandleQueryChange, }) => {
|
|
@@ -76728,7 +76754,7 @@ const GetUpToComponent = ({ bond, depositAmount }) => {
|
|
|
76728
76754
|
};
|
|
76729
76755
|
|
|
76730
76756
|
const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isProjectView }) => {
|
|
76731
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
76757
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
76732
76758
|
const SDKConfig = useSDKConfig();
|
|
76733
76759
|
const { data: geoData } = useGeoFencing();
|
|
76734
76760
|
// Hooks
|
|
@@ -76759,6 +76785,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
76759
76785
|
const inputToken = useTokenFromZapList(inputTokenString, bondData === null || bondData === void 0 ? void 0 : bondData.chainId, bondData === null || bondData === void 0 ? void 0 : bondData.lpToken);
|
|
76760
76786
|
const isZap = (inputTokenString === null || inputTokenString === void 0 ? void 0 : inputTokenString.toLowerCase()) !== ((_e = (_d = (_c = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _c === void 0 ? void 0 : _c.address) === null || _d === void 0 ? void 0 : _d[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) === null || _e === void 0 ? void 0 : _e.toLowerCase());
|
|
76761
76787
|
const [fetchingZapQuote, zapData, zapDepositAmount, zapError, zapTrueBondPrice] = useSoulZapBondQuote(inputValue, inputToken, bondData, account, tierProofSig);
|
|
76788
|
+
const rateChanged = parseFloat(zapTrueBondPrice !== null && zapTrueBondPrice !== void 0 ? zapTrueBondPrice : '0') > parseFloat(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0');
|
|
76762
76789
|
const inputTokenPrice = useCurrencyPrice(inputToken !== null && inputToken !== void 0 ? inputToken : null, bondChain);
|
|
76763
76790
|
const { data: inputCurrencyBalance } = useCurrencyBalance(inputToken !== null && inputToken !== void 0 ? inputToken : null, account !== null && account !== void 0 ? account : null, (_f = bondData === null || bondData === void 0 ? void 0 : bondData.chainId) !== null && _f !== void 0 ? _f : null);
|
|
76764
76791
|
// Estimations
|
|
@@ -76775,8 +76802,6 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
76775
76802
|
setInputValue('');
|
|
76776
76803
|
setInputTokenString(newInputToken);
|
|
76777
76804
|
}, []);
|
|
76778
|
-
// Modals
|
|
76779
|
-
const [onOpenZapModal] = useModal(jsx$2(ZapModal, { outputToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, account: account, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId }), true, true, 'zapModal');
|
|
76780
76805
|
const handleOpenZapModal = () => {
|
|
76781
76806
|
var _a;
|
|
76782
76807
|
onOpenZapModal();
|
|
@@ -76803,6 +76828,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
76803
76828
|
});
|
|
76804
76829
|
});
|
|
76805
76830
|
};
|
|
76831
|
+
// This is the regular buy bond interaction (a.k.a. write method called "deposit" in smartcontract)
|
|
76806
76832
|
const handleBuyCallback = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
76807
76833
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
76808
76834
|
const billAddress = bondData === null || bondData === void 0 ? void 0 : bondData.billAddress;
|
|
@@ -76817,7 +76843,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
76817
76843
|
},
|
|
76818
76844
|
});
|
|
76819
76845
|
try {
|
|
76820
|
-
const maxPrice = new BigNumber$1(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0').times(102).div(100).toFixed(0);
|
|
76846
|
+
const maxPrice = new BigNumber$1(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0').times(102).div(100).toFixed(0); // multiply it by 1.02
|
|
76821
76847
|
const rawAmount = adjustDecimals(inputValue);
|
|
76822
76848
|
const amount = new BigNumber$1(rawAmount).times(new BigNumber$1(10).pow(decimals !== null && decimals !== void 0 ? decimals : 18)).toString();
|
|
76823
76849
|
const shouldUseSig = (bondData === null || bondData === void 0 ? void 0 : bondData.billVersion) === types.BillVersion.V4 && SDKConfig.useTiers;
|
|
@@ -76854,6 +76880,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
76854
76880
|
addToastError(error.shortMessage);
|
|
76855
76881
|
}
|
|
76856
76882
|
});
|
|
76883
|
+
// ignore this for SOL migration
|
|
76857
76884
|
const handleZapCallback = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
76858
76885
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
76859
76886
|
if (zapData && ((_a = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _a === void 0 ? void 0 : _a.to) && ((_b = zapData === null || zapData === void 0 ? void 0 : zapData.txData) === null || _b === void 0 ? void 0 : _b.data)) {
|
|
@@ -76911,23 +76938,15 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
76911
76938
|
}
|
|
76912
76939
|
}
|
|
76913
76940
|
});
|
|
76914
|
-
const [openGeofencingModal] = useModal(jsx$2(RestrictedRegionModal, {}));
|
|
76915
|
-
const blockedBondsForAE = [
|
|
76916
|
-
'0x0719CCaF2f07f59b23DB7d80E3d2791A0836bdfD'.toLowerCase(),
|
|
76917
|
-
'0xBc48794a04777E7170bD5633E8b728f8a0945971'.toLowerCase(),
|
|
76918
|
-
'0x94A283756B70c2A77bc58Ae0E2615Caf14310186'.toLowerCase(),
|
|
76919
|
-
'0x6639D4acAe77967c253C75cBfEd7C612682E2704'.toLowerCase(),
|
|
76920
|
-
];
|
|
76921
|
-
const rateChanged = parseFloat(zapTrueBondPrice !== null && zapTrueBondPrice !== void 0 ? zapTrueBondPrice : '0') > parseFloat(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0');
|
|
76922
|
-
const [openNewRateModal] = useModal(jsx$2(NewRateModal, { bond: bondData, zapTrueBondPrice: zapTrueBondPrice, depositAmount: depositAmount, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError, handleZap: () => handleZapCallback().finally(() => setLoadingTx(false)) }), true, false);
|
|
76923
76941
|
const handleBothPurchases = () => {
|
|
76924
76942
|
var _a, _b;
|
|
76925
76943
|
if ((geoData === null || geoData === void 0 ? void 0 : geoData.countryCode) === 'AE' && blockedBondsForAE.includes((_b = (_a = bondData === null || bondData === void 0 ? void 0 : bondData.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '')) {
|
|
76926
|
-
openGeofencingModal();
|
|
76944
|
+
openGeofencingModal(); // ignore this for SOL migration
|
|
76927
76945
|
}
|
|
76928
76946
|
else {
|
|
76929
76947
|
setLoadingTx(true);
|
|
76930
76948
|
if (isZap) {
|
|
76949
|
+
// ignore this for SOL migration
|
|
76931
76950
|
if (rateChanged) {
|
|
76932
76951
|
openNewRateModal();
|
|
76933
76952
|
}
|
|
@@ -76940,7 +76959,6 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
76940
76959
|
}
|
|
76941
76960
|
}
|
|
76942
76961
|
};
|
|
76943
|
-
const [openNoBonusModal] = useModal(jsx$2(NoBonusModal, { onAcknowledge: handleBothPurchases, showcaseTokenName: bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName }), true, true, 'NoBonusModal');
|
|
76944
76962
|
const handleOpenModal = () => {
|
|
76945
76963
|
var _a;
|
|
76946
76964
|
const bonus = (_a = trueBondPriceData === null || trueBondPriceData === void 0 ? void 0 : trueBondPriceData.bonusWithFee) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -76952,16 +76970,25 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
76952
76970
|
}
|
|
76953
76971
|
};
|
|
76954
76972
|
const openExternal = () => {
|
|
76955
|
-
|
|
76956
|
-
|
|
76957
|
-
|
|
76958
|
-
if ((bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === types.ChainId.GRAPHLINQ) {
|
|
76959
|
-
window.open('https://hub.graphlinq.io/swap', '_blank');
|
|
76973
|
+
var _a, _b;
|
|
76974
|
+
if ((_a = bondData.lpToken.getLpUrl) === null || _a === void 0 ? void 0 : _a[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) {
|
|
76975
|
+
window.open((_b = bondData.lpToken.getLpUrl) === null || _b === void 0 ? void 0 : _b[bondData === null || bondData === void 0 ? void 0 : bondData.chainId], '_blank');
|
|
76960
76976
|
}
|
|
76961
76977
|
else {
|
|
76962
76978
|
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');
|
|
76963
76979
|
}
|
|
76964
76980
|
};
|
|
76981
|
+
// Modals
|
|
76982
|
+
const [onOpenZapModal] = useModal(jsx$2(ZapModal, { outputToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, account: account, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId }), true, true, 'zapModal');
|
|
76983
|
+
const [openNewRateModal] = useModal(jsx$2(NewRateModal, { bond: bondData, zapTrueBondPrice: zapTrueBondPrice, depositAmount: depositAmount, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError, handleZap: () => handleZapCallback().finally(() => setLoadingTx(false)) }), true, false);
|
|
76984
|
+
const [openNoBonusModal] = useModal(jsx$2(NoBonusModal, { onAcknowledge: handleBothPurchases, showcaseTokenName: bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName }), true, true, 'NoBonusModal');
|
|
76985
|
+
const [openGeofencingModal] = useModal(jsx$2(RestrictedRegionModal, {}));
|
|
76986
|
+
const blockedBondsForAE = [
|
|
76987
|
+
'0x0719CCaF2f07f59b23DB7d80E3d2791A0836bdfD'.toLowerCase(),
|
|
76988
|
+
'0xBc48794a04777E7170bD5633E8b728f8a0945971'.toLowerCase(),
|
|
76989
|
+
'0x94A283756B70c2A77bc58Ae0E2615Caf14310186'.toLowerCase(),
|
|
76990
|
+
'0x6639D4acAe77967c253C75cBfEd7C612682E2704'.toLowerCase(),
|
|
76991
|
+
];
|
|
76965
76992
|
// Effects
|
|
76966
76993
|
const [hasChecked, setHasChecked] = useState(false);
|
|
76967
76994
|
useEffect(() => {
|
|
@@ -76977,7 +77004,13 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
76977
77004
|
console.log('change to native');
|
|
76978
77005
|
}
|
|
76979
77006
|
}, [inputCurrencyBalance]);
|
|
76980
|
-
return bondData ? (jsxs(Flex, { className: `modal-content ${isGoldRush ? 'gold-rush' : ''}`, children: [jsx$2("div", { className: "gold-ribbon" }), 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, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString, 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, inputDisabled: isUserRestricted }), SDKConfig.useTiers && jsx$2(GetUpToComponent, { bond: bondData, depositAmount: depositAmount }),
|
|
77007
|
+
return bondData ? (jsxs(Flex, { className: `modal-content ${isGoldRush ? 'gold-rush' : ''}`, children: [jsx$2("div", { className: "gold-ribbon" }), 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, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString, 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, inputDisabled: isUserRestricted }), SDKConfig.useTiers && jsx$2(GetUpToComponent, { bond: bondData, depositAmount: depositAmount }), ((_k = NETWORK_LABEL[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) === null || _k === void 0 ? void 0 : _k.toLowerCase().includes('testnet')) && (jsx$2(Flex, { sx: {
|
|
77008
|
+
width: '100%',
|
|
77009
|
+
background: '#DE62F366',
|
|
77010
|
+
justifyContent: 'center',
|
|
77011
|
+
mt: '15px',
|
|
77012
|
+
borderRadius: 'normal',
|
|
77013
|
+
}, children: jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, p: '2px 10px' }, children: "Testnet Bonds use fake tokens for testing purposes only." }) })), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (jsx$2(Flex, { className: "button-container get", children: jsx$2(Button, { className: "action-button", onClick: () => bondData.billVersion === types.BillVersion.V4 && SDKConfig.useTiers
|
|
76981
77014
|
? window.open('http://ape.bond/tier-staking', '_blank')
|
|
76982
77015
|
: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId)
|
|
76983
77016
|
? handleOpenZapModal()
|
|
@@ -77081,6 +77114,8 @@ const CheckUrl = () => {
|
|
|
77081
77114
|
};
|
|
77082
77115
|
|
|
77083
77116
|
const ChainTitle = ({ chain, pt, hideTitles, isOpen, }) => {
|
|
77117
|
+
var _a;
|
|
77118
|
+
const isMobile = useIsMobile();
|
|
77084
77119
|
return (jsxs(Flex, { className: "chaintitle", sx: {
|
|
77085
77120
|
pt,
|
|
77086
77121
|
pb: '10px',
|
|
@@ -77092,7 +77127,7 @@ const ChainTitle = ({ chain, pt, hideTitles, isOpen, }) => {
|
|
|
77092
77127
|
display: hideTitles ? 'none' : 'flex',
|
|
77093
77128
|
width: '300px',
|
|
77094
77129
|
alignItems: 'center',
|
|
77095
|
-
}, children: [NETWORK_LABEL[chain], " Bonds", jsx$2(Flex, { sx: { ml: '7px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }), NETWORK_LABEL[chain].includes('
|
|
77130
|
+
}, children: [NETWORK_LABEL[chain], " Bonds", jsx$2(Flex, { sx: { ml: '7px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }), ((_a = NETWORK_LABEL[chain]) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('testnet')) && (jsxs(Flex, { sx: { ml: '15px' }, children: [jsx$2(Text, { sx: { fontSize: '12px', color: '#DE62F3', fontWeight: 700, mr: '7px' }, children: "TESTNET" }), jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Testnet Bonds let you experiment with fake tokens for free on upcoming chains still in development." }), width: isMobile ? '272px' : '280px', placement: isMobile ? 'bottomRight' : 'bottomLeft', transformTip: isMobile ? 'translate(10%, -5%)' : 'translate(-5%, -5%)', children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) })] }))] }));
|
|
77096
77131
|
};
|
|
77097
77132
|
|
|
77098
77133
|
const ProgressBar = ({ value, color = 'text' }) => {
|
|
@@ -77295,6 +77330,31 @@ const HotBondCards = () => {
|
|
|
77295
77330
|
}) })] })] }));
|
|
77296
77331
|
};
|
|
77297
77332
|
|
|
77333
|
+
const BANNER_INFO = {
|
|
77334
|
+
[types.ChainId.MONAD_TESTNET]: {
|
|
77335
|
+
title: 'Test and Play on Monad Testnet',
|
|
77336
|
+
subtitle: 'Explore Monad for free, earn points and qualify for potential airdrops.',
|
|
77337
|
+
buttons: [
|
|
77338
|
+
{ label: 'GET MON TOKENS', href: 'https://testnet.monad.xyz' },
|
|
77339
|
+
],
|
|
77340
|
+
background: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner_jpkg38.png',
|
|
77341
|
+
backgroundMobile: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner-mobile_y6xveu.png',
|
|
77342
|
+
logo: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/monad-logo_lkstid.png',
|
|
77343
|
+
},
|
|
77344
|
+
};
|
|
77345
|
+
const BannerTestnet = ({ chainId }) => {
|
|
77346
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
77347
|
+
return (jsxs("div", { className: "banner-container", sx: {
|
|
77348
|
+
backgroundImage: [
|
|
77349
|
+
`url(${(_a = BANNER_INFO[chainId]) === null || _a === void 0 ? void 0 : _a.backgroundMobile})`,
|
|
77350
|
+
`url(${(_b = BANNER_INFO[chainId]) === null || _b === void 0 ? void 0 : _b.backgroundMobile})`,
|
|
77351
|
+
`url(${(_c = BANNER_INFO[chainId]) === null || _c === void 0 ? void 0 : _c.backgroundMobile})`,
|
|
77352
|
+
`url(${(_d = BANNER_INFO[chainId]) === null || _d === void 0 ? void 0 : _d.background})`,
|
|
77353
|
+
`url(${(_e = BANNER_INFO[chainId]) === null || _e === void 0 ? void 0 : _e.background})`,
|
|
77354
|
+
],
|
|
77355
|
+
}, children: [jsxs("div", { className: "banner-logos", children: [jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/apebond-logo_vzt4dl.png", alt: "apebond-white-logo", style: { width: '100px' } }), jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1743089809/logos/x-icono_va7sdu.png", alt: "x-white-logo" }), jsx$2("img", { src: `${(_f = BANNER_INFO[chainId]) === null || _f === void 0 ? void 0 : _f.logo}`, alt: "partner-logo" })] }), jsx$2("div", { className: "banner-title", children: (_g = BANNER_INFO[chainId]) === null || _g === void 0 ? void 0 : _g.title }), jsx$2("div", { className: "banner-subtitle", children: (_h = BANNER_INFO[chainId]) === null || _h === void 0 ? void 0 : _h.subtitle }), jsx$2("div", { className: "banner-actions", children: (_j = BANNER_INFO[chainId]) === null || _j === void 0 ? void 0 : _j.buttons.map((button, index) => (jsx$2(Button, { className: "action-button", onClick: () => window.open(button.href, '_blank'), children: button.label }, `banner-button-${index}`))) })] }, `banner-container-${chainId}`));
|
|
77356
|
+
};
|
|
77357
|
+
|
|
77298
77358
|
const BondRowsWithTitle = ({ chain, bonds, hideTitles, showHotBonds }) => {
|
|
77299
77359
|
const billsFilteredByChain = bonds.filter((bill) => bill.chainId === chain);
|
|
77300
77360
|
const key = chain;
|
|
@@ -77304,7 +77364,7 @@ const BondRowsWithTitle = ({ chain, bonds, hideTitles, showHotBonds }) => {
|
|
|
77304
77364
|
overflow: 'hidden',
|
|
77305
77365
|
width: '100%',
|
|
77306
77366
|
marginTop: '0px',
|
|
77307
|
-
}, className: "bonds-card-container", children: [billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map((bond, index) => {
|
|
77367
|
+
}, className: "bonds-card-container", children: [TESTNET_CHAINS.includes(chain) && jsx$2(BannerTestnet, { chainId: chain }), billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map((bond, index) => {
|
|
77308
77368
|
var _a, _b;
|
|
77309
77369
|
return (jsx$2(BondRow
|
|
77310
77370
|
//@ts-ignore
|
package/dist/styles.css
CHANGED
|
@@ -1906,3 +1906,78 @@ span.flex-inline {
|
|
|
1906
1906
|
font-size: 12px;
|
|
1907
1907
|
font-weight: 400;
|
|
1908
1908
|
}
|
|
1909
|
+
|
|
1910
|
+
.banner-container {
|
|
1911
|
+
width: 100%;
|
|
1912
|
+
min-height: 160px;
|
|
1913
|
+
border-radius: 8px;
|
|
1914
|
+
display: flex;
|
|
1915
|
+
flex-direction: column;
|
|
1916
|
+
align-items: center;
|
|
1917
|
+
justify-content: center;
|
|
1918
|
+
margin-bottom: 10px;
|
|
1919
|
+
gap: 5px;
|
|
1920
|
+
background-size: cover;
|
|
1921
|
+
background-repeat: no-repeat;
|
|
1922
|
+
padding: 20px;
|
|
1923
|
+
}
|
|
1924
|
+
.banner-container .banner-logos {
|
|
1925
|
+
display: flex;
|
|
1926
|
+
align-items: center;
|
|
1927
|
+
justify-content: center;
|
|
1928
|
+
gap: 10px;
|
|
1929
|
+
}
|
|
1930
|
+
.banner-container .banner-title {
|
|
1931
|
+
font-weight: 700;
|
|
1932
|
+
font-size: 25.26px;
|
|
1933
|
+
line-height: 30.26px;
|
|
1934
|
+
letter-spacing: 0%;
|
|
1935
|
+
text-align: center;
|
|
1936
|
+
vertical-align: middle;
|
|
1937
|
+
background: linear-gradient(180deg, #FFFFFF 50%, #666666 100%);
|
|
1938
|
+
background-clip: text;
|
|
1939
|
+
-webkit-background-clip: text;
|
|
1940
|
+
-webkit-text-fill-color: transparent;
|
|
1941
|
+
}
|
|
1942
|
+
.banner-container .banner-subtitle {
|
|
1943
|
+
font-weight: 400;
|
|
1944
|
+
font-size: 14.26px;
|
|
1945
|
+
line-height: 30.26px;
|
|
1946
|
+
letter-spacing: 0%;
|
|
1947
|
+
text-align: center;
|
|
1948
|
+
vertical-align: middle;
|
|
1949
|
+
background: linear-gradient(180deg, #FFFFFF 50%, #666666 100%);
|
|
1950
|
+
background-clip: text;
|
|
1951
|
+
-webkit-background-clip: text;
|
|
1952
|
+
-webkit-text-fill-color: transparent;
|
|
1953
|
+
}
|
|
1954
|
+
.banner-container .banner-actions {
|
|
1955
|
+
display: flex;
|
|
1956
|
+
align-items: center;
|
|
1957
|
+
justify-content: center;
|
|
1958
|
+
gap: 10px;
|
|
1959
|
+
}
|
|
1960
|
+
.banner-container .banner-actions .action-button {
|
|
1961
|
+
height: 35px;
|
|
1962
|
+
font-size: 12px;
|
|
1963
|
+
font-weight: 700;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
@media (max-width: 575px) {
|
|
1967
|
+
.banner-container .banner-title {
|
|
1968
|
+
width: 50%;
|
|
1969
|
+
font-size: 18px;
|
|
1970
|
+
line-height: 21px;
|
|
1971
|
+
}
|
|
1972
|
+
.banner-container .banner-subtitle {
|
|
1973
|
+
width: 55%;
|
|
1974
|
+
font-size: 12px;
|
|
1975
|
+
line-height: 14px;
|
|
1976
|
+
margin-bottom: 10px;
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
@media (min-width: 800px) and (max-width: 1000px) {
|
|
1980
|
+
.banner-container {
|
|
1981
|
+
background-position: bottom center;
|
|
1982
|
+
}
|
|
1983
|
+
}
|