@lifi/widget 1.13.7 → 1.15.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/cjs/components/Header/Header.js +2 -2
- package/cjs/components/Header/NavigationHeader.js +5 -7
- package/cjs/components/Header/WalletHeader.js +4 -5
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +10 -10
- package/cjs/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +3 -3
- package/cjs/components/{SwapInProgress/SwapInProgress.d.ts → SendToWallet/SendToWallet.d.ts} +1 -1
- package/cjs/components/SendToWallet/SendToWallet.js +53 -0
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +19 -0
- package/cjs/components/SendToWallet/SendToWallet.style.js +15 -0
- package/cjs/components/SendToWallet/index.d.ts +1 -0
- package/cjs/components/{SwapInProgress → SendToWallet}/index.js +1 -1
- package/cjs/components/Step/StepTimer.js +1 -1
- package/cjs/components/SwapButton/SwapButton.js +11 -8
- package/cjs/components/SwapInput/FormPriceHelperText.d.ts +1 -1
- package/cjs/components/SwapInput/FormPriceHelperText.js +4 -4
- package/cjs/components/SwapInput/SwapInput.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInput.js +4 -4
- package/cjs/components/SwapInput/SwapInputAdornment.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputAdornment.js +4 -4
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +4 -3
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +3 -3
- package/cjs/components/SwapsInProgress/SwapsInProgress.d.ts +3 -0
- package/cjs/components/SwapsInProgress/SwapsInProgress.js +29 -0
- package/cjs/components/{SwapInProgress/SwapInProgress.style.d.ts → SwapsInProgress/SwapsInProgress.style.d.ts} +0 -0
- package/cjs/components/{SwapInProgress/SwapInProgress.style.js → SwapsInProgress/SwapsInProgress.style.js} +0 -0
- package/cjs/components/SwapsInProgress/index.d.ts +1 -0
- package/cjs/components/SwapsInProgress/index.js +17 -0
- package/cjs/components/TokenList/TokenList.js +10 -11
- package/cjs/components/TokenList/VirtualizedTokenList.js +1 -1
- package/cjs/components/TokenList/types.d.ts +1 -1
- package/cjs/config/lifi.js +3 -1
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +1 -0
- package/cjs/hooks/index.js +1 -0
- package/cjs/hooks/useNavigateBack.d.ts +4 -0
- package/cjs/hooks/useNavigateBack.js +18 -0
- package/cjs/hooks/useSwapRoutes.js +18 -7
- package/cjs/i18n/en/translation.json +13 -8
- package/cjs/i18n/index.d.ts +11 -6
- package/cjs/pages/MainPage/MainPage.js +3 -2
- package/cjs/pages/SelectTokenPage/ChainSelect.d.ts +1 -1
- package/cjs/pages/SelectTokenPage/ChainSelect.js +11 -12
- package/cjs/pages/SelectTokenPage/SearchTokenInput.js +3 -3
- package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +1 -1
- package/cjs/pages/SelectTokenPage/SelectTokenPage.js +2 -6
- package/cjs/pages/SelectWalletPage/SelectWalletPage.js +6 -6
- package/cjs/pages/SettingsPage/AdvancedPreferences.js +2 -2
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +2 -2
- package/cjs/pages/SettingsPage/SettingsPage.js +2 -1
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +2 -0
- package/cjs/pages/SettingsPage/ShowDestinationWallet.js +22 -0
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +3 -2
- package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
- package/cjs/pages/SwapPage/StatusBottomSheet.js +4 -5
- package/cjs/pages/SwapPage/SwapPage.js +2 -2
- package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
- package/cjs/providers/SwapFormProvider/SwapFormProvider.d.ts +1 -0
- package/cjs/providers/SwapFormProvider/SwapFormProvider.js +10 -4
- package/cjs/providers/SwapFormProvider/types.d.ts +3 -1
- package/cjs/providers/SwapFormProvider/types.js +1 -0
- package/cjs/providers/WalletProvider/WalletProvider.js +5 -4
- package/cjs/providers/WalletProvider/types.d.ts +4 -2
- package/cjs/providers/WidgetProvider/WidgetProvider.js +4 -0
- package/cjs/providers/index.d.ts +4 -0
- package/cjs/providers/index.js +20 -0
- package/cjs/stores/route/useRouteStore.js +36 -0
- package/cjs/stores/settings/types.d.ts +2 -1
- package/cjs/stores/settings/useSettingsStore.d.ts +4 -2
- package/cjs/stores/settings/useSettingsStore.js +1 -0
- package/cjs/types/widget.d.ts +1 -0
- package/cjs/utils/format.js +7 -2
- package/components/Header/Header.js +1 -1
- package/components/Header/NavigationHeader.js +5 -7
- package/components/Header/WalletHeader.js +1 -2
- package/components/ReverseTokensButton/ReverseTokensButton.js +1 -1
- package/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
- package/components/SelectTokenButton/SelectTokenButton.js +1 -1
- package/components/{SwapInProgress/SwapInProgress.d.ts → SendToWallet/SendToWallet.d.ts} +1 -1
- package/components/SendToWallet/SendToWallet.js +49 -0
- package/components/SendToWallet/SendToWallet.style.d.ts +19 -0
- package/components/SendToWallet/SendToWallet.style.js +12 -0
- package/components/SendToWallet/index.d.ts +1 -0
- package/components/SendToWallet/index.js +1 -0
- package/components/Step/StepTimer.js +1 -1
- package/components/SwapButton/SwapButton.js +9 -6
- package/components/SwapInput/FormPriceHelperText.d.ts +1 -1
- package/components/SwapInput/FormPriceHelperText.js +1 -1
- package/components/SwapInput/SwapInput.d.ts +1 -1
- package/components/SwapInput/SwapInput.js +1 -1
- package/components/SwapInput/SwapInputAdornment.d.ts +1 -1
- package/components/SwapInput/SwapInputAdornment.js +1 -1
- package/components/SwapRouteCard/SwapRouteCard.js +4 -3
- package/components/SwapRouteCard/SwapRouteCard.style.js +3 -3
- package/components/SwapsInProgress/SwapsInProgress.d.ts +3 -0
- package/components/{SwapInProgress/SwapInProgress.js → SwapsInProgress/SwapsInProgress.js} +4 -4
- package/components/{SwapInProgress/SwapInProgress.style.d.ts → SwapsInProgress/SwapsInProgress.style.d.ts} +0 -0
- package/components/{SwapInProgress/SwapInProgress.style.js → SwapsInProgress/SwapsInProgress.style.js} +0 -0
- package/components/SwapsInProgress/index.d.ts +1 -0
- package/components/SwapsInProgress/index.js +1 -0
- package/components/TokenList/TokenList.js +1 -2
- package/components/TokenList/VirtualizedTokenList.js +1 -1
- package/components/TokenList/types.d.ts +1 -1
- package/config/lifi.js +3 -1
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/useNavigateBack.d.ts +4 -0
- package/hooks/useNavigateBack.js +14 -0
- package/hooks/useSwapRoutes.js +18 -7
- package/i18n/en/translation.json +13 -8
- package/i18n/index.d.ts +11 -6
- package/package.json +9 -12
- package/pages/MainPage/MainPage.js +3 -2
- package/pages/SelectTokenPage/ChainSelect.d.ts +1 -1
- package/pages/SelectTokenPage/ChainSelect.js +9 -10
- package/pages/SelectTokenPage/SearchTokenInput.js +1 -1
- package/pages/SelectTokenPage/SelectTokenPage.d.ts +1 -1
- package/pages/SelectTokenPage/SelectTokenPage.js +3 -7
- package/pages/SelectWalletPage/SelectWalletPage.js +5 -5
- package/pages/SettingsPage/AdvancedPreferences.js +2 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +1 -1
- package/pages/SettingsPage/SettingsPage.js +2 -1
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +2 -0
- package/pages/SettingsPage/ShowDestinationWallet.js +18 -0
- package/pages/SwapDetailsPage/SwapDetailsPage.js +4 -3
- package/pages/SwapHistoryPage/SwapHistoryPage.js +1 -1
- package/pages/SwapPage/StatusBottomSheet.js +4 -5
- package/pages/SwapPage/SwapPage.js +4 -4
- package/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
- package/providers/SwapFormProvider/SwapFormProvider.d.ts +1 -0
- package/providers/SwapFormProvider/SwapFormProvider.js +10 -4
- package/providers/SwapFormProvider/types.d.ts +3 -1
- package/providers/SwapFormProvider/types.js +1 -0
- package/providers/WalletProvider/WalletProvider.js +5 -4
- package/providers/WalletProvider/types.d.ts +4 -2
- package/providers/WidgetProvider/WidgetProvider.js +5 -1
- package/providers/index.d.ts +4 -0
- package/providers/index.js +4 -0
- package/stores/route/useRouteStore.js +36 -0
- package/stores/settings/types.d.ts +2 -1
- package/stores/settings/useSettingsStore.d.ts +4 -2
- package/stores/settings/useSettingsStore.js +1 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +1 -0
- package/utils/format.js +7 -2
- package/cjs/components/SwapInProgress/SwapInProgress.js +0 -29
- package/cjs/components/SwapInProgress/index.d.ts +0 -1
- package/components/SwapInProgress/index.d.ts +0 -1
- package/components/SwapInProgress/index.js +0 -1
package/config/lifi.js
CHANGED
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "1.
|
|
2
|
+
export declare const version = "1.15.0";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '1.
|
|
2
|
+
export const version = '1.15.0';
|
package/hooks/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './useDebouncedWatch';
|
|
|
5
5
|
export * from './useFeaturedTokens';
|
|
6
6
|
export * from './useGasSufficiency';
|
|
7
7
|
export * from './useInitializer';
|
|
8
|
+
export * from './useNavigateBack';
|
|
8
9
|
export * from './useRouteExecution';
|
|
9
10
|
export * from './useScrollableContainer';
|
|
10
11
|
export * from './useSwapRoutes';
|
package/hooks/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export * from './useDebouncedWatch';
|
|
|
5
5
|
export * from './useFeaturedTokens';
|
|
6
6
|
export * from './useGasSufficiency';
|
|
7
7
|
export * from './useInitializer';
|
|
8
|
+
export * from './useNavigateBack';
|
|
8
9
|
export * from './useRouteExecution';
|
|
9
10
|
export * from './useScrollableContainer';
|
|
10
11
|
export * from './useSwapRoutes';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
export const useNavigateBack = () => {
|
|
4
|
+
const navigate = useNavigate();
|
|
5
|
+
const navigateBack = useCallback(() => {
|
|
6
|
+
if (window.history.state && window.history.state.idx > 0) {
|
|
7
|
+
navigate(-1);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
navigate(window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')) || '/', { replace: true });
|
|
11
|
+
}
|
|
12
|
+
}, [navigate]);
|
|
13
|
+
return { navigateBack, navigate };
|
|
14
|
+
};
|
package/hooks/useSwapRoutes.js
CHANGED
|
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { isAddress } from '@ethersproject/address';
|
|
10
11
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
11
12
|
import Big from 'big.js';
|
|
12
13
|
import { useWatch } from 'react-hook-form';
|
|
@@ -18,7 +19,7 @@ import { useSettings } from '../stores';
|
|
|
18
19
|
const refetchTime = 60000;
|
|
19
20
|
export const useSwapRoutes = () => {
|
|
20
21
|
var _a;
|
|
21
|
-
const { account } = useWallet();
|
|
22
|
+
const { account, provider } = useWallet();
|
|
22
23
|
const queryClient = useQueryClient();
|
|
23
24
|
const { slippage, enabledBridges, enabledExchanges, routePriority } = useSettings([
|
|
24
25
|
'slippage',
|
|
@@ -26,12 +27,13 @@ export const useSwapRoutes = () => {
|
|
|
26
27
|
'enabledBridges',
|
|
27
28
|
'enabledExchanges',
|
|
28
29
|
]);
|
|
29
|
-
const [fromChainId, fromTokenAddress, toChainId, toTokenAddress] = useWatch({
|
|
30
|
+
const [fromChainId, fromTokenAddress, toChainId, toTokenAddress, toAddress] = useWatch({
|
|
30
31
|
name: [
|
|
31
32
|
SwapFormKey.FromChain,
|
|
32
33
|
SwapFormKey.FromToken,
|
|
33
34
|
SwapFormKey.ToChain,
|
|
34
35
|
SwapFormKey.ToToken,
|
|
36
|
+
SwapFormKey.ToAddress,
|
|
35
37
|
],
|
|
36
38
|
});
|
|
37
39
|
const [fromTokenAmount] = useDebouncedWatch([SwapFormKey.FromAmount], 250);
|
|
@@ -53,6 +55,7 @@ export const useSwapRoutes = () => {
|
|
|
53
55
|
fromTokenAmount,
|
|
54
56
|
toChainId,
|
|
55
57
|
toTokenAddress,
|
|
58
|
+
toAddress,
|
|
56
59
|
slippage,
|
|
57
60
|
enabledBridges,
|
|
58
61
|
enabledExchanges,
|
|
@@ -62,16 +65,24 @@ export const useSwapRoutes = () => {
|
|
|
62
65
|
const refetchInterval = previousDataUpdatedAt
|
|
63
66
|
? Math.min(Math.abs(refetchTime - (Date.now() - previousDataUpdatedAt)), refetchTime)
|
|
64
67
|
: refetchTime;
|
|
65
|
-
const { data, isLoading, isFetching, isFetched, dataUpdatedAt, refetch } = useQuery(queryKey, ({ queryKey: [_,
|
|
66
|
-
var _b;
|
|
68
|
+
const { data, isLoading, isFetching, isFetched, dataUpdatedAt, refetch } = useQuery(queryKey, ({ queryKey: [_, fromAddress, fromChainId, fromTokenAddress, fromTokenAmount, toChainId, toTokenAddress, toAddress, slippage, enabledBridges, enabledExchanges, routePriority,], signal, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
+
var _b, _c;
|
|
70
|
+
let toWalletAddress;
|
|
71
|
+
try {
|
|
72
|
+
toWalletAddress =
|
|
73
|
+
(_b = (yield (provider === null || provider === void 0 ? void 0 : provider.resolveName(toAddress)))) !== null && _b !== void 0 ? _b : (isAddress(toAddress) ? toAddress : fromAddress);
|
|
74
|
+
}
|
|
75
|
+
catch (_d) {
|
|
76
|
+
toWalletAddress = isAddress(toAddress) ? toAddress : fromAddress;
|
|
77
|
+
}
|
|
67
78
|
return LiFi.getRoutes({
|
|
68
79
|
fromChainId,
|
|
69
|
-
fromAmount: Big(Number(fromTokenAmount) * Math.pow(10, ((
|
|
80
|
+
fromAmount: Big(Number(fromTokenAmount) * Math.pow(10, ((_c = token === null || token === void 0 ? void 0 : token.decimals) !== null && _c !== void 0 ? _c : 0))).toString(),
|
|
70
81
|
fromTokenAddress,
|
|
71
82
|
toChainId,
|
|
72
83
|
toTokenAddress,
|
|
73
|
-
fromAddress
|
|
74
|
-
toAddress:
|
|
84
|
+
fromAddress,
|
|
85
|
+
toAddress: toWalletAddress,
|
|
75
86
|
options: {
|
|
76
87
|
slippage: slippage / 100,
|
|
77
88
|
bridges: {
|
package/i18n/en/translation.json
CHANGED
|
@@ -52,24 +52,26 @@
|
|
|
52
52
|
"selectChainAndToken": "Select chain and token",
|
|
53
53
|
"featuredTokens": "Featured tokens",
|
|
54
54
|
"otherTokens": "Other tokens",
|
|
55
|
-
"inProgress": "
|
|
55
|
+
"inProgress": "in progress",
|
|
56
|
+
"activeTransfers": "Active transfers",
|
|
56
57
|
"couldntFindTokens": "We couldn't find tokens on this chain or you don't have any.",
|
|
57
58
|
"stepSwap": "Swap",
|
|
58
59
|
"stepBridge": "Bridge",
|
|
59
60
|
"stepSwapAndBridge": "Swap and bridge",
|
|
60
61
|
"estimatedTime": "~{{value}} min.",
|
|
61
|
-
"networkIsBusy": "Network is busy...",
|
|
62
62
|
"crossStepDetails": "Bridge from {{from}} to {{to}} via {{tool}}",
|
|
63
63
|
"swapStepDetails": "Swap on {{chain}} via {{tool}}",
|
|
64
64
|
"tokenOnChain": "{{tokenSymbol}} on {{chainName}}",
|
|
65
65
|
"tokenOnChainAmount": "{{amount}} {{tokenSymbol}} on {{chainName}}",
|
|
66
66
|
"routeId": "Route ID",
|
|
67
|
+
"sendToWallet": "Send to a different wallet",
|
|
68
|
+
"walletAddressOrEns": "Wallet address or ENS name",
|
|
67
69
|
"tags": {
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
70
|
+
"RECOMMENDED": "RECOMMENDED",
|
|
71
|
+
"FASTEST": "FAST",
|
|
72
|
+
"CHEAPEST": "CHEAP",
|
|
73
|
+
"SAFEST": "SAFE",
|
|
74
|
+
"ALTERNATIVE": "ALTERNATIVE"
|
|
73
75
|
},
|
|
74
76
|
"success": {
|
|
75
77
|
"title": {
|
|
@@ -109,7 +111,9 @@
|
|
|
109
111
|
"transactionUnprepared": "Unable to prepare transaction.",
|
|
110
112
|
"unknown": "Something went wrong.",
|
|
111
113
|
"userRejectedSignatureRequest": "Signature required.",
|
|
112
|
-
"slippageTooLarge": "Slippage too large."
|
|
114
|
+
"slippageTooLarge": "Slippage too large.",
|
|
115
|
+
"walletAddressInvalid": "Wallet address is invalid.",
|
|
116
|
+
"walletEnsAddressInvalid": "Wallet address is invalid or network doesn't support ENS."
|
|
113
117
|
},
|
|
114
118
|
"message": {
|
|
115
119
|
"signatureRequired": "Your signature is required to complete the transaction. {{amount}} {{tokenSymbol}} on {{chainName}} remain in your wallet.",
|
|
@@ -156,6 +160,7 @@
|
|
|
156
160
|
"fast": "Fast"
|
|
157
161
|
},
|
|
158
162
|
"advancedPreferences": "Advanced preferences",
|
|
163
|
+
"showDestinationWallet": "Show destination wallet",
|
|
159
164
|
"enabledBridges": "Enabled bridges",
|
|
160
165
|
"selectEnabledBridges": "Select enabled bridges",
|
|
161
166
|
"enabledExchanges": "Enabled exchanges",
|
package/i18n/index.d.ts
CHANGED
|
@@ -56,23 +56,25 @@ export declare const resources: {
|
|
|
56
56
|
featuredTokens: string;
|
|
57
57
|
otherTokens: string;
|
|
58
58
|
inProgress: string;
|
|
59
|
+
activeTransfers: string;
|
|
59
60
|
couldntFindTokens: string;
|
|
60
61
|
stepSwap: string;
|
|
61
62
|
stepBridge: string;
|
|
62
63
|
stepSwapAndBridge: string;
|
|
63
64
|
estimatedTime: string;
|
|
64
|
-
networkIsBusy: string;
|
|
65
65
|
crossStepDetails: string;
|
|
66
66
|
swapStepDetails: string;
|
|
67
67
|
tokenOnChain: string;
|
|
68
68
|
tokenOnChainAmount: string;
|
|
69
69
|
routeId: string;
|
|
70
|
+
sendToWallet: string;
|
|
71
|
+
walletAddressOrEns: string;
|
|
70
72
|
tags: {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
RECOMMENDED: string;
|
|
74
|
+
FASTEST: string;
|
|
75
|
+
CHEAPEST: string;
|
|
76
|
+
SAFEST: string;
|
|
77
|
+
ALTERNATIVE: string;
|
|
76
78
|
};
|
|
77
79
|
success: {
|
|
78
80
|
title: {
|
|
@@ -113,6 +115,8 @@ export declare const resources: {
|
|
|
113
115
|
unknown: string;
|
|
114
116
|
userRejectedSignatureRequest: string;
|
|
115
117
|
slippageTooLarge: string;
|
|
118
|
+
walletAddressInvalid: string;
|
|
119
|
+
walletEnsAddressInvalid: string;
|
|
116
120
|
};
|
|
117
121
|
message: {
|
|
118
122
|
signatureRequired: string;
|
|
@@ -159,6 +163,7 @@ export declare const resources: {
|
|
|
159
163
|
fast: string;
|
|
160
164
|
};
|
|
161
165
|
advancedPreferences: string;
|
|
166
|
+
showDestinationWallet: string;
|
|
162
167
|
enabledBridges: string;
|
|
163
168
|
selectEnabledBridges: string;
|
|
164
169
|
enabledExchanges: string;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
7
|
+
"types": "./index.d.ts",
|
|
7
8
|
"lint-staged": {
|
|
8
9
|
"src/**/*.{ts,tsx}": [
|
|
9
10
|
"yarn run lint:fix",
|
|
@@ -38,13 +39,14 @@
|
|
|
38
39
|
"dependencies": {
|
|
39
40
|
"@emotion/react": "^11.10.0",
|
|
40
41
|
"@emotion/styled": "^11.10.0",
|
|
42
|
+
"@ethersproject/address": "^5.7.0",
|
|
41
43
|
"@ethersproject/experimental": "^5.7.0",
|
|
42
44
|
"@ethersproject/providers": "^5.7.0",
|
|
43
|
-
"@lifi/sdk": "^1.
|
|
44
|
-
"@lifi/wallet-management": "^1.1.
|
|
45
|
-
"@mui/icons-material": "^5.
|
|
46
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
47
|
-
"@mui/material": "^5.10.
|
|
45
|
+
"@lifi/sdk": "^1.2.2",
|
|
46
|
+
"@lifi/wallet-management": "^1.1.8",
|
|
47
|
+
"@mui/icons-material": "^5.10.2",
|
|
48
|
+
"@mui/lab": "^5.0.0-alpha.96",
|
|
49
|
+
"@mui/material": "^5.10.2",
|
|
48
50
|
"@sentry/integrations": "^7.11.1",
|
|
49
51
|
"@sentry/react": "^7.11.1",
|
|
50
52
|
"@sentry/tracing": "^7.11.1",
|
|
@@ -75,10 +77,5 @@
|
|
|
75
77
|
"extends": "../../.eslintrc"
|
|
76
78
|
},
|
|
77
79
|
"sideEffects": false,
|
|
78
|
-
"private": false
|
|
79
|
-
"types": "./index.d.ts",
|
|
80
|
-
"exports": {
|
|
81
|
-
"require": "./cjs/index.js",
|
|
82
|
-
"import": "./index.js"
|
|
83
|
-
}
|
|
80
|
+
"private": false
|
|
84
81
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
3
|
import { SelectChainAndToken } from '../../components/SelectChainAndToken';
|
|
4
|
-
import {
|
|
4
|
+
import { SendToWallet } from '../../components/SendToWallet';
|
|
5
5
|
import { SwapInput } from '../../components/SwapInput';
|
|
6
|
+
import { SwapsInProgress } from '../../components/SwapsInProgress';
|
|
6
7
|
import { FormContainer } from './MainPage.style';
|
|
7
8
|
import { MainSwapButton } from './MainSwapButton';
|
|
8
9
|
import { SwapRoutes } from './SwapRoutes';
|
|
9
10
|
export const MainPage = () => {
|
|
10
|
-
return (_jsxs(FormContainer, Object.assign({ disableGutters: true }, { children: [_jsx(
|
|
11
|
+
return (_jsxs(FormContainer, Object.assign({ disableGutters: true }, { children: [_jsx(SwapsInProgress, { mx: 3, mt: 1, mb: 2 }), _jsx(SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 3 }, { children: _jsx(SwapInput, { formType: "from" }) })), _jsx(SendToWallet, { mx: 3, mb: 3 }), _jsx(SwapRoutes, { mx: 3, mb: 3 }), _jsx(Box, Object.assign({ mx: 3, mb: 1 }, { children: _jsx(MainSwapButton, {}) }))] })));
|
|
11
12
|
};
|
|
@@ -6,8 +6,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
import { Card, CardTitle } from '../../components/Card';
|
|
7
7
|
import { Select } from '../../components/Select';
|
|
8
8
|
import { useChains } from '../../hooks';
|
|
9
|
-
import { SwapFormKey, SwapFormKeyHelper, } from '../../providers
|
|
10
|
-
import { useWidgetConfig } from '../../providers/WidgetProvider';
|
|
9
|
+
import { SwapFormKey, SwapFormKeyHelper, useWidgetConfig, } from '../../providers';
|
|
11
10
|
export const ChainSelect = ({ formType }) => {
|
|
12
11
|
const { t } = useTranslation();
|
|
13
12
|
const { setValue, register } = useFormContext();
|
|
@@ -17,12 +16,12 @@ export const ChainSelect = ({ formType }) => {
|
|
|
17
16
|
const [chainId] = useWatch({
|
|
18
17
|
name: [chainKey],
|
|
19
18
|
});
|
|
20
|
-
const { onChange, onBlur, name, ref } = register(chainKey
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
return !isLoading ? (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`swap.selectChain`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ ref: ref, labelId: chainKey, name: name, MenuProps: { elevation: 2 }, defaultValue: formType === 'from' ? fromChain : toChain, value: chainId, onChange:
|
|
19
|
+
const { onChange, onBlur, name, ref } = register(chainKey, {
|
|
20
|
+
onChange: () => {
|
|
21
|
+
setValue(SwapFormKeyHelper.getTokenKey(formType), '');
|
|
22
|
+
setValue(SwapFormKeyHelper.getAmountKey(formType), '');
|
|
23
|
+
setValue(SwapFormKey.TokenSearchFilter, '');
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
return !isLoading ? (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`swap.selectChain`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ ref: ref, labelId: chainKey, name: name, MenuProps: { elevation: 2 }, defaultValue: formType === 'from' ? fromChain : toChain, value: chainId, onChange: onChange, onBlur: onBlur, IconComponent: KeyboardArrowDownIcon }, { children: chains === null || chains === void 0 ? void 0 : chains.map((chain) => (_jsxs(MenuItem, Object.assign({ value: chain.id }, { children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, Object.assign({ src: chain.logoURI, alt: chain.key }, { children: chain.name[0] })) }), chain.name] }), chain.key))) })) }))] })) : (_jsx(Skeleton, { variant: "rectangular", width: "100%", height: 98, sx: { borderRadius: 1 } }));
|
|
28
27
|
};
|
|
@@ -5,7 +5,7 @@ import { useEffect } from 'react';
|
|
|
5
5
|
import { useFormContext } from 'react-hook-form';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { Card } from '../../components/Card';
|
|
8
|
-
import { SwapFormKey } from '../../providers
|
|
8
|
+
import { SwapFormKey } from '../../providers';
|
|
9
9
|
import { Input } from './SearchTokenInput.style';
|
|
10
10
|
export const SearchTokenInput = () => {
|
|
11
11
|
const { t } = useTranslation();
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Container } from '@mui/material';
|
|
3
3
|
import { useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
-
import { useNavigate } from 'react-router-dom';
|
|
5
4
|
import { TokenList } from '../../components/TokenList';
|
|
6
|
-
import { useContentHeight, useScrollableOverflowHidden } from '../../hooks';
|
|
5
|
+
import { useContentHeight, useNavigateBack, useScrollableOverflowHidden, } from '../../hooks';
|
|
7
6
|
import { ChainSelect } from './ChainSelect';
|
|
8
7
|
import { SearchTokenInput } from './SearchTokenInput';
|
|
9
8
|
export const SelectTokenPage = ({ formType, }) => {
|
|
10
9
|
useScrollableOverflowHidden();
|
|
11
|
-
const
|
|
10
|
+
const { navigateBack } = useNavigateBack();
|
|
12
11
|
const headerRef = useRef(null);
|
|
13
12
|
const contentHeight = useContentHeight();
|
|
14
13
|
const [headerHeight, setHeaderHeight] = useState(0);
|
|
15
|
-
const handleTokenClick = () => {
|
|
16
|
-
navigate(-1);
|
|
17
|
-
};
|
|
18
14
|
useLayoutEffect(() => {
|
|
19
15
|
var _a, _b;
|
|
20
16
|
setHeaderHeight(contentHeight - ((_b = (_a = headerRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0));
|
|
21
17
|
}, [contentHeight]);
|
|
22
|
-
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ pt: 1, pb: 2, px: 3, ref: headerRef }, { children: [_jsx(ChainSelect, { formType: formType }), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(SearchTokenInput, {}) }))] })), _jsx(TokenList, { height: headerHeight, onClick:
|
|
18
|
+
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ pt: 1, pb: 2, px: 3, ref: headerRef }, { children: [_jsx(ChainSelect, { formType: formType }), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(SearchTokenInput, {}) }))] })), _jsx(TokenList, { height: headerHeight, onClick: navigateBack, formType: formType })] })));
|
|
23
19
|
};
|
|
@@ -12,14 +12,14 @@ import { supportedWallets } from '@lifi/wallet-management';
|
|
|
12
12
|
import { Avatar, Button, Container, DialogActions, DialogContent, DialogContentText, List, ListItemAvatar, } from '@mui/material';
|
|
13
13
|
import { useCallback, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { useNavigate } from 'react-router-dom';
|
|
16
15
|
import { Dialog } from '../../components/Dialog';
|
|
17
|
-
import {
|
|
16
|
+
import { useNavigateBack } from '../../hooks';
|
|
17
|
+
import { useWallet } from '../../providers';
|
|
18
18
|
import { WalletListItemButton, WalletListItemText, } from './SelectWalletPage.style';
|
|
19
19
|
export const SelectWalletPage = () => {
|
|
20
20
|
var _a;
|
|
21
21
|
const { t } = useTranslation();
|
|
22
|
-
const
|
|
22
|
+
const { navigateBack } = useNavigateBack();
|
|
23
23
|
const { connect } = useWallet();
|
|
24
24
|
const [walletIdentity, setWalletIdentity] = useState({ show: false });
|
|
25
25
|
const closeDialog = () => {
|
|
@@ -37,9 +37,9 @@ export const SelectWalletPage = () => {
|
|
|
37
37
|
});
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
navigateBack();
|
|
41
41
|
yield connect(wallet);
|
|
42
|
-
}), [connect,
|
|
42
|
+
}), [connect, navigateBack]);
|
|
43
43
|
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsx(List, Object.assign({ sx: {
|
|
44
44
|
paddingLeft: 2,
|
|
45
45
|
paddingRight: 2,
|
|
@@ -12,9 +12,9 @@ export const AdvancedPreferences = () => {
|
|
|
12
12
|
const handleAdvancedPreferences = (_, checked) => {
|
|
13
13
|
setValue('advancedPreferences', checked);
|
|
14
14
|
};
|
|
15
|
-
return (_jsxs(Box, Object.assign({ px: 3, pt:
|
|
15
|
+
return (_jsxs(Box, Object.assign({ px: 3, pt: 2 }, { children: [_jsxs(Box, Object.assign({ sx: {
|
|
16
16
|
display: 'flex',
|
|
17
17
|
justifyContent: 'space-between',
|
|
18
18
|
alignItems: 'center',
|
|
19
|
-
} }, { children: [_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: _jsx(Typography, Object.assign({ variant: "subtitle1", color: "text.primary", lineHeight: "normal" }, { children: t(`settings.advancedPreferences`) })) })), _jsx(Switch, { checked: advancedPreferences, onChange: handleAdvancedPreferences })] })), advancedPreferences && (_jsxs(Box, Object.assign({ mt:
|
|
19
|
+
} }, { children: [_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: _jsx(Typography, Object.assign({ variant: "subtitle1", color: "text.primary", lineHeight: "normal" }, { children: t(`settings.advancedPreferences`) })) })), _jsx(Switch, { checked: advancedPreferences, onChange: handleAdvancedPreferences })] })), advancedPreferences && (_jsxs(Box, Object.assign({ mt: 2, mb: 1 }, { children: [_jsx(EnabledBridgesSelect, {}), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(EnabledExchangesSelect, {}) }))] })))] })));
|
|
20
20
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Brightness4 as Brightness4Icon, DarkMode as DarkModeIcon, LightMode as LightModeIcon, } from '@mui/icons-material';
|
|
3
3
|
import { Box, ToggleButtonGroup } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useWidgetConfig } from '../../providers
|
|
5
|
+
import { useWidgetConfig } from '../../providers';
|
|
6
6
|
import { useAppearance } from '../../stores';
|
|
7
7
|
import { ToggleButton } from './ColorSchemeButtonGroup.style';
|
|
8
8
|
export const ColorSchemeButtonGroup = () => {
|
|
@@ -4,7 +4,8 @@ import { AdvancedPreferences } from './AdvancedPreferences';
|
|
|
4
4
|
import { ColorSchemeButtonGroup } from './ColorSchemeButtonGroup';
|
|
5
5
|
import { GasPriceSelect } from './GasPriceSelect';
|
|
6
6
|
import { RoutePrioritySelect } from './RoutePrioritySelect';
|
|
7
|
+
import { ShowDestinationWallet } from './ShowDestinationWallet';
|
|
7
8
|
import { SlippageInput } from './SlippageInput';
|
|
8
9
|
export const SettingsPage = () => {
|
|
9
|
-
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ px: 3, pt: 1 }, { children: [_jsx(ColorSchemeButtonGroup, {}), _jsx(RoutePrioritySelect, {}), _jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mt: 2 }, { children: [_jsx(Box, Object.assign({ pr: 2, flex: 1 }, { children: _jsx(SlippageInput, {}) })), _jsx(GasPriceSelect, {})] }))] })), _jsx(AdvancedPreferences, {})] })));
|
|
10
|
+
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ px: 3, pt: 1 }, { children: [_jsx(ColorSchemeButtonGroup, {}), _jsx(RoutePrioritySelect, {}), _jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mt: 2 }, { children: [_jsx(Box, Object.assign({ pr: 2, flex: 1 }, { children: _jsx(SlippageInput, {}) })), _jsx(GasPriceSelect, {})] }))] })), _jsx(ShowDestinationWallet, {}), _jsx(AdvancedPreferences, {})] })));
|
|
10
11
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Typography } from '@mui/material';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { Switch } from '../../components/Switch';
|
|
5
|
+
import { useSetSettings, useSettings } from '../../stores';
|
|
6
|
+
export const ShowDestinationWallet = () => {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
const [setValue] = useSetSettings();
|
|
9
|
+
const { showDestinationWallet } = useSettings(['showDestinationWallet']);
|
|
10
|
+
const onChange = (_, checked) => {
|
|
11
|
+
setValue('showDestinationWallet', checked);
|
|
12
|
+
};
|
|
13
|
+
return (_jsx(Box, Object.assign({ px: 3, pt: 2 }, { children: _jsxs(Box, Object.assign({ sx: {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
justifyContent: 'space-between',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
} }, { children: [_jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: _jsx(Typography, Object.assign({ variant: "subtitle1", color: "text.primary", lineHeight: "normal" }, { children: t(`settings.showDestinationWallet`) })) })), _jsx(Switch, { checked: showDestinationWallet, onChange: onChange })] })) })));
|
|
18
|
+
};
|
|
@@ -12,19 +12,20 @@ import { ContentCopy as ContentCopyIcon, DeleteOutline as DeleteIcon, } from '@m
|
|
|
12
12
|
import { Box, Button, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton, Typography, } from '@mui/material';
|
|
13
13
|
import { Fragment, useCallback, useEffect, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { useLocation
|
|
15
|
+
import { useLocation } from 'react-router-dom';
|
|
16
16
|
import shallow from 'zustand/shallow';
|
|
17
17
|
import { Card, CardTitle } from '../../components/Card';
|
|
18
18
|
import { Dialog } from '../../components/Dialog';
|
|
19
19
|
import { useSetHeaderAction } from '../../components/Header';
|
|
20
20
|
import { Step } from '../../components/Step';
|
|
21
21
|
import { StepDivider } from '../../components/StepDivider';
|
|
22
|
+
import { useNavigateBack } from '../../hooks';
|
|
22
23
|
import { useRouteStore } from '../../stores';
|
|
23
24
|
import { Container } from './SwapDetailsPage.style';
|
|
24
25
|
export const SwapDetailsPage = () => {
|
|
25
26
|
var _a, _b;
|
|
26
27
|
const { t } = useTranslation();
|
|
27
|
-
const
|
|
28
|
+
const { navigateBack } = useNavigateBack();
|
|
28
29
|
const setHeaderAction = useSetHeaderAction();
|
|
29
30
|
const { state } = useLocation();
|
|
30
31
|
const [routeExecution, deleteRoute] = useRouteStore((store) => [store.routes[state === null || state === void 0 ? void 0 : state.routeId], store.deleteRoute], shallow);
|
|
@@ -33,7 +34,7 @@ export const SwapDetailsPage = () => {
|
|
|
33
34
|
setOpen((open) => !open);
|
|
34
35
|
}, []);
|
|
35
36
|
const handleDeleteRoute = () => {
|
|
36
|
-
|
|
37
|
+
navigateBack();
|
|
37
38
|
if (routeExecution) {
|
|
38
39
|
deleteRoute(routeExecution.route.id);
|
|
39
40
|
}
|
|
@@ -5,7 +5,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { Dialog } from '../../components/Dialog';
|
|
7
7
|
import { useSetHeaderAction } from '../../components/Header';
|
|
8
|
-
import { useWallet } from '../../providers
|
|
8
|
+
import { useWallet } from '../../providers';
|
|
9
9
|
import { useRouteStore } from '../../stores';
|
|
10
10
|
import { useSwapHistory } from '../../stores/route';
|
|
11
11
|
import { SwapHistoryEmpty } from './SwapHistoryEmpty';
|
|
@@ -4,17 +4,16 @@ import { Box, Button, Typography } from '@mui/material';
|
|
|
4
4
|
import { useEffect, useMemo, useRef } from 'react';
|
|
5
5
|
import { useFormContext } from 'react-hook-form';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useNavigate } from 'react-router-dom';
|
|
8
7
|
import { BottomSheet } from '../../components/BottomSheet';
|
|
9
8
|
import { Token } from '../../components/Token';
|
|
10
|
-
import { useChains, useTokenBalance } from '../../hooks';
|
|
11
|
-
import { SwapFormKey } from '../../providers
|
|
9
|
+
import { useChains, useNavigateBack, useTokenBalance } from '../../hooks';
|
|
10
|
+
import { SwapFormKey } from '../../providers';
|
|
12
11
|
import { IconCircle, IconContainer, iconStyles, } from './StatusBottomSheet.style';
|
|
13
12
|
import { getProcessMessage } from './utils';
|
|
14
13
|
export const StatusBottomSheet = ({ status, route, }) => {
|
|
15
14
|
var _a, _b, _c, _d, _e;
|
|
16
15
|
const { t } = useTranslation();
|
|
17
|
-
const
|
|
16
|
+
const { navigateBack } = useNavigateBack();
|
|
18
17
|
const ref = useRef(null);
|
|
19
18
|
const { getChainById } = useChains();
|
|
20
19
|
const { token, refetch: refetchBalance } = useTokenBalance(route.toChainId, route.toToken.address);
|
|
@@ -25,7 +24,7 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
25
24
|
};
|
|
26
25
|
const handleDone = () => {
|
|
27
26
|
clearFromAmount();
|
|
28
|
-
|
|
27
|
+
navigateBack();
|
|
29
28
|
};
|
|
30
29
|
const handleClose = () => {
|
|
31
30
|
var _a;
|
|
@@ -2,21 +2,21 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Button } from '@mui/material';
|
|
3
3
|
import { Fragment } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useLocation
|
|
5
|
+
import { useLocation } from 'react-router-dom';
|
|
6
6
|
import { GasSufficiencyMessage } from '../../components/GasSufficiencyMessage';
|
|
7
7
|
import { Step } from '../../components/Step';
|
|
8
8
|
import { StepDivider } from '../../components/StepDivider';
|
|
9
9
|
import { SwapButton } from '../../components/SwapButton';
|
|
10
|
-
import { useRouteExecution } from '../../hooks';
|
|
10
|
+
import { useNavigateBack, useRouteExecution } from '../../hooks';
|
|
11
11
|
import { StatusBottomSheet } from './StatusBottomSheet';
|
|
12
12
|
import { Container } from './SwapPage.style';
|
|
13
13
|
export const SwapPage = () => {
|
|
14
14
|
const { t } = useTranslation();
|
|
15
15
|
const { state } = useLocation();
|
|
16
|
-
const
|
|
16
|
+
const { navigateBack } = useNavigateBack();
|
|
17
17
|
const { route, status, executeRoute, restartRoute, deleteRoute } = useRouteExecution(state === null || state === void 0 ? void 0 : state.routeId);
|
|
18
18
|
const handleRemoveRoute = () => {
|
|
19
|
-
|
|
19
|
+
navigateBack();
|
|
20
20
|
deleteRoute();
|
|
21
21
|
};
|
|
22
22
|
const handleSwapClick = () => {
|
|
@@ -12,7 +12,7 @@ export const SwapRoutesPage = () => {
|
|
|
12
12
|
const navigate = useNavigate();
|
|
13
13
|
const { pathname } = useLocation();
|
|
14
14
|
const setHeaderAction = useSetHeaderAction();
|
|
15
|
-
const { routes: swapRoutes, isLoading, isFetching,
|
|
15
|
+
const { routes: swapRoutes, isLoading, isFetching, dataUpdatedAt, refetchTime, refetch, } = useSwapRoutes();
|
|
16
16
|
const setExecutableRoute = useSetExecutableRoute();
|
|
17
17
|
const handleRouteClick = (route) => {
|
|
18
18
|
setExecutableRoute(route);
|