@lifi/widget 3.0.0-alpha.10 → 3.0.0-alpha.11
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/AppProvider.tsx +4 -8
- package/_cjs/AppProvider.js +2 -2
- package/_cjs/AppProvider.js.map +1 -1
- package/_cjs/components/AmountInput/AmountInput.d.ts +1 -1
- package/_cjs/components/AmountInput/AmountInput.js +5 -11
- package/_cjs/components/AmountInput/AmountInput.js.map +1 -1
- package/_cjs/components/AmountInput/AmountInputEndAdornment.d.ts +1 -1
- package/_cjs/components/AmountInput/AmountInputEndAdornment.js +5 -11
- package/_cjs/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/_cjs/components/AmountInput/AmountInputStartAdornment.d.ts +1 -1
- package/_cjs/components/AmountInput/AmountInputStartAdornment.js +2 -8
- package/_cjs/components/AmountInput/AmountInputStartAdornment.js.map +1 -1
- package/_cjs/components/AmountInput/FormPriceHelperText.d.ts +1 -1
- package/_cjs/components/AmountInput/FormPriceHelperText.js +3 -11
- package/_cjs/components/AmountInput/FormPriceHelperText.js.map +1 -1
- package/_cjs/components/ChainSelect/ChainSelect.d.ts +1 -1
- package/_cjs/components/ChainSelect/ChainSelect.js +1 -5
- package/_cjs/components/ChainSelect/ChainSelect.js.map +1 -1
- package/_cjs/components/ChainSelect/useChainSelect.d.ts +1 -1
- package/_cjs/components/ChainSelect/useChainSelect.js +10 -14
- package/_cjs/components/ChainSelect/useChainSelect.js.map +1 -1
- package/_cjs/components/Header/NavigationTabs.js +4 -6
- package/_cjs/components/Header/NavigationTabs.js.map +1 -1
- package/_cjs/components/ListItemText.d.ts +1 -1
- package/_cjs/components/NFT/NFT.js +13 -14
- package/_cjs/components/NFT/NFT.js.map +1 -1
- package/_cjs/components/ReverseTokensButton/ReverseTokensButton.js +7 -14
- package/_cjs/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/_cjs/components/Routes/Routes.js +2 -2
- package/_cjs/components/Routes/Routes.js.map +1 -1
- package/_cjs/components/Routes/RoutesExpanded.js +1 -2
- package/_cjs/components/Routes/RoutesExpanded.js.map +1 -1
- package/_cjs/components/SelectChainAndToken.js +6 -13
- package/_cjs/components/SelectChainAndToken.js.map +1 -1
- package/_cjs/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
- package/_cjs/components/SelectTokenButton/SelectTokenButton.js +3 -5
- package/_cjs/components/SelectTokenButton/SelectTokenButton.js.map +1 -1
- package/_cjs/components/SendToWallet/SendToWallet.js +43 -32
- package/_cjs/components/SendToWallet/SendToWallet.js.map +1 -1
- package/_cjs/components/SendToWallet/SendToWalletButton.js +2 -3
- package/_cjs/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/_cjs/components/Step/StepProcess.style.d.ts +2 -2
- package/_cjs/components/Tabs/Tabs.style.d.ts +1 -1
- package/_cjs/components/TokenList/TokenList.js +3 -6
- package/_cjs/components/TokenList/TokenList.js.map +1 -1
- package/_cjs/components/TokenList/TokenList.style.d.ts +2 -2
- package/_cjs/components/TokenList/TokenNotFound.d.ts +1 -1
- package/_cjs/components/TokenList/TokenNotFound.js +2 -5
- package/_cjs/components/TokenList/TokenNotFound.js.map +1 -1
- package/_cjs/components/TokenList/types.d.ts +1 -1
- package/_cjs/components/TokenList/useTokenSelect.d.ts +1 -1
- package/_cjs/components/TokenList/useTokenSelect.js +15 -18
- package/_cjs/components/TokenList/useTokenSelect.js.map +1 -1
- package/_cjs/config/version.d.ts +1 -1
- package/_cjs/config/version.js +1 -1
- package/_cjs/hooks/useDebouncedWatch.d.ts +2 -1
- package/_cjs/hooks/useDebouncedWatch.js +3 -7
- package/_cjs/hooks/useDebouncedWatch.js.map +1 -1
- package/_cjs/hooks/useFromTokenSufficiency.js +1 -5
- package/_cjs/hooks/useFromTokenSufficiency.js.map +1 -1
- package/_cjs/hooks/useGasRefuel.js +2 -10
- package/_cjs/hooks/useGasRefuel.js.map +1 -1
- package/_cjs/hooks/useRequiredToAddress.js +2 -4
- package/_cjs/hooks/useRequiredToAddress.js.map +1 -1
- package/_cjs/hooks/useRoutes.js +2 -15
- package/_cjs/hooks/useRoutes.js.map +1 -1
- package/_cjs/index.d.ts +2 -2
- package/_cjs/index.js +5 -5
- package/_cjs/index.js.map +1 -1
- package/_cjs/pages/MainPage/ReviewButton.js +1 -2
- package/_cjs/pages/MainPage/ReviewButton.js.map +1 -1
- package/_cjs/pages/SelectChainPage/types.d.ts +1 -1
- package/_cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +1 -1
- package/_cjs/pages/SelectTokenPage/SearchTokenInput.js +11 -6
- package/_cjs/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/_cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +1 -1
- package/_cjs/pages/TransactionPage/StatusBottomSheet.js +10 -11
- package/_cjs/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/_cjs/pages/TransactionPage/TransactionPage.js +4 -5
- package/_cjs/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/_cjs/providers/index.d.ts +0 -1
- package/_cjs/providers/index.js +0 -1
- package/_cjs/providers/index.js.map +1 -1
- package/_cjs/stores/StoreProvider.js +4 -3
- package/_cjs/stores/StoreProvider.js.map +1 -1
- package/_cjs/stores/chains/ChainOrderStore.js +6 -10
- package/_cjs/stores/chains/ChainOrderStore.js.map +1 -1
- package/_cjs/stores/form/FormStore.d.ts +6 -0
- package/_cjs/stores/form/FormStore.js +44 -0
- package/_cjs/stores/form/FormStore.js.map +1 -0
- package/_cjs/stores/form/FormUpdater.d.ts +5 -0
- package/_cjs/stores/form/FormUpdater.js +62 -0
- package/_cjs/stores/form/FormUpdater.js.map +1 -0
- package/_cjs/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.js +9 -12
- package/_cjs/stores/form/URLSearchParamsBuilder.js.map +1 -0
- package/_cjs/stores/form/createFormStore.d.ts +3 -0
- package/_cjs/stores/form/createFormStore.js +177 -0
- package/_cjs/stores/form/createFormStore.js.map +1 -0
- package/_cjs/stores/form/index.d.ts +10 -0
- package/_cjs/{providers/FormProvider → stores/form}/index.js +9 -2
- package/_cjs/stores/form/index.js.map +1 -0
- package/_cjs/stores/form/types.d.ts +108 -0
- package/_cjs/stores/form/types.js.map +1 -0
- package/_cjs/stores/form/useFieldActions.d.ts +2 -0
- package/_cjs/stores/form/useFieldActions.js +19 -0
- package/_cjs/stores/form/useFieldActions.js.map +1 -0
- package/_cjs/stores/form/useFieldController.d.ts +11 -0
- package/_cjs/stores/form/useFieldController.js +24 -0
- package/_cjs/stores/form/useFieldController.js.map +1 -0
- package/_cjs/stores/form/useFieldValues.d.ts +2 -0
- package/_cjs/stores/form/useFieldValues.js +11 -0
- package/_cjs/stores/form/useFieldValues.js.map +1 -0
- package/_cjs/stores/form/useTouchedFields.d.ts +1 -0
- package/_cjs/stores/form/useTouchedFields.js +11 -0
- package/_cjs/stores/form/useTouchedFields.js.map +1 -0
- package/_cjs/stores/form/useValidation.d.ts +2 -0
- package/_cjs/stores/form/useValidation.js +15 -0
- package/_cjs/stores/form/useValidation.js.map +1 -0
- package/_cjs/stores/form/useValidationActions.d.ts +2 -0
- package/_cjs/stores/form/useValidationActions.js +19 -0
- package/_cjs/stores/form/useValidationActions.js.map +1 -0
- package/_cjs/stores/index.d.ts +1 -0
- package/_cjs/stores/index.js +1 -0
- package/_cjs/stores/index.js.map +1 -1
- package/_esm/AppProvider.js +3 -3
- package/_esm/AppProvider.js.map +1 -1
- package/_esm/components/AmountInput/AmountInput.d.ts +1 -1
- package/_esm/components/AmountInput/AmountInput.js +5 -11
- package/_esm/components/AmountInput/AmountInput.js.map +1 -1
- package/_esm/components/AmountInput/AmountInputEndAdornment.d.ts +1 -1
- package/_esm/components/AmountInput/AmountInputEndAdornment.js +5 -11
- package/_esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/_esm/components/AmountInput/AmountInputStartAdornment.d.ts +1 -1
- package/_esm/components/AmountInput/AmountInputStartAdornment.js +2 -8
- package/_esm/components/AmountInput/AmountInputStartAdornment.js.map +1 -1
- package/_esm/components/AmountInput/FormPriceHelperText.d.ts +1 -1
- package/_esm/components/AmountInput/FormPriceHelperText.js +3 -11
- package/_esm/components/AmountInput/FormPriceHelperText.js.map +1 -1
- package/_esm/components/ChainSelect/ChainSelect.d.ts +1 -1
- package/_esm/components/ChainSelect/ChainSelect.js +2 -6
- package/_esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/_esm/components/ChainSelect/useChainSelect.d.ts +1 -1
- package/_esm/components/ChainSelect/useChainSelect.js +11 -15
- package/_esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/_esm/components/Header/NavigationTabs.js +5 -7
- package/_esm/components/Header/NavigationTabs.js.map +1 -1
- package/_esm/components/ListItemText.d.ts +1 -1
- package/_esm/components/NFT/NFT.js +13 -14
- package/_esm/components/NFT/NFT.js.map +1 -1
- package/_esm/components/ReverseTokensButton/ReverseTokensButton.js +7 -14
- package/_esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/_esm/components/Routes/Routes.js +2 -2
- package/_esm/components/Routes/Routes.js.map +1 -1
- package/_esm/components/Routes/RoutesExpanded.js +2 -3
- package/_esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/_esm/components/SelectChainAndToken.js +7 -14
- package/_esm/components/SelectChainAndToken.js.map +1 -1
- package/_esm/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
- package/_esm/components/SelectTokenButton/SelectTokenButton.js +3 -5
- package/_esm/components/SelectTokenButton/SelectTokenButton.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWallet.js +45 -34
- package/_esm/components/SendToWallet/SendToWallet.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWalletButton.js +4 -5
- package/_esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/_esm/components/Step/StepProcess.style.d.ts +2 -2
- package/_esm/components/Tabs/Tabs.style.d.ts +1 -1
- package/_esm/components/TokenList/TokenList.js +3 -6
- package/_esm/components/TokenList/TokenList.js.map +1 -1
- package/_esm/components/TokenList/TokenList.style.d.ts +2 -2
- package/_esm/components/TokenList/TokenNotFound.d.ts +1 -1
- package/_esm/components/TokenList/TokenNotFound.js +2 -5
- package/_esm/components/TokenList/TokenNotFound.js.map +1 -1
- package/_esm/components/TokenList/types.d.ts +1 -1
- package/_esm/components/TokenList/useTokenSelect.d.ts +1 -1
- package/_esm/components/TokenList/useTokenSelect.js +15 -18
- package/_esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/_esm/config/version.d.ts +1 -1
- package/_esm/config/version.js +1 -1
- package/_esm/hooks/useDebouncedWatch.d.ts +2 -1
- package/_esm/hooks/useDebouncedWatch.js +3 -7
- package/_esm/hooks/useDebouncedWatch.js.map +1 -1
- package/_esm/hooks/useFromTokenSufficiency.js +2 -6
- package/_esm/hooks/useFromTokenSufficiency.js.map +1 -1
- package/_esm/hooks/useGasRefuel.js +2 -10
- package/_esm/hooks/useGasRefuel.js.map +1 -1
- package/_esm/hooks/useRequiredToAddress.js +3 -5
- package/_esm/hooks/useRequiredToAddress.js.map +1 -1
- package/_esm/hooks/useRoutes.js +4 -17
- package/_esm/hooks/useRoutes.js.map +1 -1
- package/_esm/index.d.ts +2 -2
- package/_esm/index.js +2 -2
- package/_esm/index.js.map +1 -1
- package/_esm/pages/MainPage/ReviewButton.js +2 -3
- package/_esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/_esm/pages/SelectChainPage/types.d.ts +1 -1
- package/_esm/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +1 -1
- package/_esm/pages/SelectTokenPage/SearchTokenInput.js +11 -6
- package/_esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/_esm/pages/SelectTokenPage/SelectTokenPage.d.ts +1 -1
- package/_esm/pages/TransactionPage/StatusBottomSheet.js +12 -13
- package/_esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/_esm/pages/TransactionPage/TransactionPage.js +6 -7
- package/_esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/_esm/providers/index.d.ts +0 -1
- package/_esm/providers/index.js +0 -1
- package/_esm/providers/index.js.map +1 -1
- package/_esm/stores/StoreProvider.js +4 -3
- package/_esm/stores/StoreProvider.js.map +1 -1
- package/_esm/stores/chains/ChainOrderStore.js +6 -10
- package/_esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/_esm/stores/form/FormStore.d.ts +6 -0
- package/_esm/stores/form/FormStore.js +39 -0
- package/_esm/stores/form/FormStore.js.map +1 -0
- package/_esm/stores/form/FormUpdater.d.ts +5 -0
- package/_esm/stores/form/FormUpdater.js +58 -0
- package/_esm/stores/form/FormUpdater.js.map +1 -0
- package/_esm/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.js +9 -12
- package/_esm/stores/form/URLSearchParamsBuilder.js.map +1 -0
- package/_esm/stores/form/createFormStore.d.ts +3 -0
- package/_esm/stores/form/createFormStore.js +173 -0
- package/_esm/stores/form/createFormStore.js.map +1 -0
- package/_esm/stores/form/index.d.ts +10 -0
- package/_esm/stores/form/index.js +11 -0
- package/_esm/stores/form/index.js.map +1 -0
- package/_esm/stores/form/types.d.ts +108 -0
- package/_esm/stores/form/types.js.map +1 -0
- package/_esm/stores/form/useFieldActions.d.ts +2 -0
- package/_esm/stores/form/useFieldActions.js +15 -0
- package/_esm/stores/form/useFieldActions.js.map +1 -0
- package/_esm/stores/form/useFieldController.d.ts +11 -0
- package/_esm/stores/form/useFieldController.js +20 -0
- package/_esm/stores/form/useFieldController.js.map +1 -0
- package/_esm/stores/form/useFieldValues.d.ts +2 -0
- package/_esm/stores/form/useFieldValues.js +7 -0
- package/_esm/stores/form/useFieldValues.js.map +1 -0
- package/_esm/stores/form/useTouchedFields.d.ts +1 -0
- package/_esm/stores/form/useTouchedFields.js +7 -0
- package/_esm/stores/form/useTouchedFields.js.map +1 -0
- package/_esm/stores/form/useValidation.d.ts +2 -0
- package/_esm/stores/form/useValidation.js +11 -0
- package/_esm/stores/form/useValidation.js.map +1 -0
- package/_esm/stores/form/useValidationActions.d.ts +2 -0
- package/_esm/stores/form/useValidationActions.js +15 -0
- package/_esm/stores/form/useValidationActions.js.map +1 -0
- package/_esm/stores/index.d.ts +1 -0
- package/_esm/stores/index.js +1 -0
- package/_esm/stores/index.js.map +1 -1
- package/components/AmountInput/AmountInput.tsx +12 -14
- package/components/AmountInput/AmountInputEndAdornment.tsx +10 -12
- package/components/AmountInput/AmountInputStartAdornment.tsx +6 -9
- package/components/AmountInput/FormPriceHelperText.tsx +7 -13
- package/components/ChainSelect/ChainSelect.tsx +4 -7
- package/components/ChainSelect/useChainSelect.ts +18 -18
- package/components/Header/NavigationTabs.tsx +6 -7
- package/components/NFT/NFT.tsx +14 -14
- package/components/ReverseTokensButton/ReverseTokensButton.tsx +8 -14
- package/components/Routes/Routes.tsx +2 -2
- package/components/Routes/RoutesExpanded.tsx +2 -3
- package/components/SelectChainAndToken.tsx +13 -14
- package/components/SelectTokenButton/SelectTokenButton.tsx +7 -6
- package/components/SendToWallet/SendToWallet.tsx +58 -38
- package/components/SendToWallet/SendToWalletButton.tsx +8 -5
- package/components/TokenList/TokenList.tsx +3 -6
- package/components/TokenList/TokenNotFound.tsx +3 -6
- package/components/TokenList/types.ts +1 -1
- package/components/TokenList/useTokenSelect.ts +21 -19
- package/config/version.ts +1 -1
- package/hooks/useDebouncedWatch.ts +7 -8
- package/hooks/useFromTokenSufficiency.ts +6 -6
- package/hooks/useGasRefuel.ts +7 -10
- package/hooks/useRequiredToAddress.ts +3 -5
- package/hooks/useRoutes.ts +14 -17
- package/index.ts +2 -2
- package/package.json +10 -11
- package/pages/MainPage/ReviewButton.tsx +6 -3
- package/pages/SelectChainPage/types.ts +1 -1
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx +1 -1
- package/pages/SelectTokenPage/SearchTokenInput.tsx +11 -6
- package/pages/SelectTokenPage/SelectTokenPage.tsx +1 -1
- package/pages/TransactionPage/StatusBottomSheet.tsx +18 -15
- package/pages/TransactionPage/TransactionPage.tsx +10 -7
- package/providers/index.ts +0 -1
- package/stores/StoreProvider.tsx +18 -15
- package/stores/chains/ChainOrderStore.tsx +9 -10
- package/stores/form/FormStore.tsx +66 -0
- package/stores/form/FormUpdater.tsx +69 -0
- package/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.tsx +11 -15
- package/stores/form/createFormStore.ts +225 -0
- package/stores/form/index.ts +10 -0
- package/stores/form/types.ts +138 -0
- package/stores/form/useFieldActions.ts +28 -0
- package/stores/form/useFieldController.ts +31 -0
- package/stores/form/useFieldValues.ts +12 -0
- package/stores/form/useTouchedFields.ts +8 -0
- package/stores/form/useValidation.ts +15 -0
- package/stores/form/useValidationActions.ts +24 -0
- package/stores/index.ts +1 -0
- package/_cjs/providers/FormProvider/FormProvider.d.ts +0 -12
- package/_cjs/providers/FormProvider/FormProvider.js +0 -40
- package/_cjs/providers/FormProvider/FormProvider.js.map +0 -1
- package/_cjs/providers/FormProvider/FormUpdater.d.ts +0 -5
- package/_cjs/providers/FormProvider/FormUpdater.js +0 -72
- package/_cjs/providers/FormProvider/FormUpdater.js.map +0 -1
- package/_cjs/providers/FormProvider/URLSearchParamsBuilder.js.map +0 -1
- package/_cjs/providers/FormProvider/index.d.ts +0 -3
- package/_cjs/providers/FormProvider/index.js.map +0 -1
- package/_cjs/providers/FormProvider/types.d.ts +0 -37
- package/_cjs/providers/FormProvider/types.js.map +0 -1
- package/_esm/providers/FormProvider/FormProvider.d.ts +0 -12
- package/_esm/providers/FormProvider/FormProvider.js +0 -36
- package/_esm/providers/FormProvider/FormProvider.js.map +0 -1
- package/_esm/providers/FormProvider/FormUpdater.d.ts +0 -5
- package/_esm/providers/FormProvider/FormUpdater.js +0 -68
- package/_esm/providers/FormProvider/FormUpdater.js.map +0 -1
- package/_esm/providers/FormProvider/URLSearchParamsBuilder.js.map +0 -1
- package/_esm/providers/FormProvider/index.d.ts +0 -3
- package/_esm/providers/FormProvider/index.js +0 -4
- package/_esm/providers/FormProvider/index.js.map +0 -1
- package/_esm/providers/FormProvider/types.d.ts +0 -37
- package/_esm/providers/FormProvider/types.js.map +0 -1
- package/providers/FormProvider/FormProvider.tsx +0 -55
- package/providers/FormProvider/FormUpdater.tsx +0 -86
- package/providers/FormProvider/index.ts +0 -3
- package/providers/FormProvider/types.ts +0 -44
- /package/_cjs/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.d.ts +0 -0
- /package/_cjs/{providers/FormProvider → stores/form}/types.js +0 -0
- /package/_esm/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.d.ts +0 -0
- /package/_esm/{providers/FormProvider → stores/form}/types.js +0 -0
package/AppProvider.tsx
CHANGED
|
@@ -4,15 +4,13 @@ import { Fragment } from 'react';
|
|
|
4
4
|
import { MemoryRouter, useInRouterContext } from 'react-router-dom';
|
|
5
5
|
import { queryClient } from './config/queryClient';
|
|
6
6
|
import {
|
|
7
|
-
FormProvider,
|
|
8
7
|
I18nProvider,
|
|
9
8
|
ThemeProvider,
|
|
10
|
-
URLSearchParamsBuilder,
|
|
11
9
|
WalletProvider,
|
|
12
10
|
WidgetProvider,
|
|
13
11
|
useWidgetConfig,
|
|
14
12
|
} from './providers';
|
|
15
|
-
import { StoreProvider } from './stores';
|
|
13
|
+
import { StoreProvider, URLSearchParamsBuilder } from './stores';
|
|
16
14
|
import type { WidgetConfigProps } from './types';
|
|
17
15
|
|
|
18
16
|
export const AppProvider: React.FC<PropsWithChildren<WidgetConfigProps>> = ({
|
|
@@ -25,11 +23,9 @@ export const AppProvider: React.FC<PropsWithChildren<WidgetConfigProps>> = ({
|
|
|
25
23
|
<ThemeProvider>
|
|
26
24
|
<I18nProvider>
|
|
27
25
|
<WalletProvider>
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
</StoreProvider>
|
|
32
|
-
</FormProvider>
|
|
26
|
+
<StoreProvider config={config}>
|
|
27
|
+
<AppRouter>{children}</AppRouter>
|
|
28
|
+
</StoreProvider>
|
|
33
29
|
</WalletProvider>
|
|
34
30
|
</I18nProvider>
|
|
35
31
|
</ThemeProvider>
|
package/_cjs/AppProvider.js
CHANGED
|
@@ -9,14 +9,14 @@ const queryClient_1 = require("./config/queryClient");
|
|
|
9
9
|
const providers_1 = require("./providers");
|
|
10
10
|
const stores_1 = require("./stores");
|
|
11
11
|
const AppProvider = ({ children, config, }) => {
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient_1.queryClient, children: (0, jsx_runtime_1.jsx)(providers_1.WidgetProvider, { config: config, children: (0, jsx_runtime_1.jsx)(providers_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.I18nProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.WalletProvider, { children: (0, jsx_runtime_1.jsx)(
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient_1.queryClient, children: (0, jsx_runtime_1.jsx)(providers_1.WidgetProvider, { config: config, children: (0, jsx_runtime_1.jsx)(providers_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.I18nProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.WalletProvider, { children: (0, jsx_runtime_1.jsx)(stores_1.StoreProvider, { config: config, children: (0, jsx_runtime_1.jsx)(exports.AppRouter, { children: children }) }) }) }) }) }) }));
|
|
13
13
|
};
|
|
14
14
|
exports.AppProvider = AppProvider;
|
|
15
15
|
const AppRouter = ({ children }) => {
|
|
16
16
|
const { buildUrl } = (0, providers_1.useWidgetConfig)();
|
|
17
17
|
const inRouterContext = (0, react_router_dom_1.useInRouterContext)();
|
|
18
18
|
const Router = inRouterContext ? react_1.Fragment : react_router_dom_1.MemoryRouter;
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(Router, { children: [children, buildUrl ? (0, jsx_runtime_1.jsx)(
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(Router, { children: [children, buildUrl ? (0, jsx_runtime_1.jsx)(stores_1.URLSearchParamsBuilder, {}) : null] }));
|
|
20
20
|
};
|
|
21
21
|
exports.AppRouter = AppRouter;
|
|
22
22
|
//# sourceMappingURL=AppProvider.js.map
|
package/_cjs/AppProvider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppProvider.js","sourceRoot":"","sources":["../AppProvider.tsx"],"names":[],"mappings":";;;;AAAA,uDAA4D;AAE5D,iCAAiC;AACjC,uDAAoE;AACpE,sDAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"AppProvider.js","sourceRoot":"","sources":["../AppProvider.tsx"],"names":[],"mappings":";;;;AAAA,uDAA4D;AAE5D,iCAAiC;AACjC,uDAAoE;AACpE,sDAAmD;AACnD,2CAMqB;AACrB,qCAAiE;AAG1D,MAAM,WAAW,GAAmD,CAAC,EAC1E,QAAQ,EACR,MAAM,GACP,EAAE,EAAE;IACH,OAAO,CACL,uBAAC,iCAAmB,IAAC,MAAM,EAAE,yBAAW,YACtC,uBAAC,0BAAc,IAAC,MAAM,EAAE,MAAM,YAC5B,uBAAC,yBAAa,cACZ,uBAAC,wBAAY,cACX,uBAAC,0BAAc,cACb,uBAAC,sBAAa,IAAC,MAAM,EAAE,MAAM,YAC3B,uBAAC,iBAAS,cAAE,QAAQ,GAAa,GACnB,GACD,GACJ,GACD,GACD,GACG,CACvB,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,WAAW,eAmBtB;AAEK,MAAM,SAAS,GAAoC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,2BAAe,GAAE,CAAC;IACvC,MAAM,eAAe,GAAG,IAAA,qCAAkB,GAAE,CAAC;IAC7C,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,gBAAQ,CAAC,CAAC,CAAC,+BAAY,CAAC;IACzD,OAAO,CACL,wBAAC,MAAM,eACJ,QAAQ,EACR,QAAQ,CAAC,CAAC,CAAC,uBAAC,+BAAsB,KAAG,CAAC,CAAC,CAAC,IAAI,IACtC,CACV,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,SAAS,aAUpB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Token } from '@lifi/sdk';
|
|
2
2
|
import type { BoxProps } from '@mui/material';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
|
-
import type { FormTypeProps } from '../../
|
|
4
|
+
import type { FormTypeProps } from '../../stores';
|
|
5
5
|
export declare const AmountInput: React.FC<FormTypeProps & BoxProps>;
|
|
6
6
|
export declare const AmountInputBase: React.FC<FormTypeProps & BoxProps & {
|
|
7
7
|
token?: Token;
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AmountInputBase = exports.AmountInput = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
7
6
|
const react_i18next_1 = require("react-i18next");
|
|
8
7
|
const hooks_1 = require("../../hooks");
|
|
8
|
+
const stores_1 = require("../../stores");
|
|
9
9
|
const providers_1 = require("../../providers");
|
|
10
10
|
const types_1 = require("../../types");
|
|
11
11
|
const utils_1 = require("../../utils");
|
|
@@ -14,14 +14,10 @@ const AmountInput_style_1 = require("./AmountInput.style");
|
|
|
14
14
|
const AmountInputEndAdornment_1 = require("./AmountInputEndAdornment");
|
|
15
15
|
const AmountInputStartAdornment_1 = require("./AmountInputStartAdornment");
|
|
16
16
|
const FormPriceHelperText_1 = require("./FormPriceHelperText");
|
|
17
|
+
const stores_2 = require("../../stores");
|
|
17
18
|
const AmountInput = ({ formType, ...props }) => {
|
|
18
19
|
const { disabledUI } = (0, providers_1.useWidgetConfig)();
|
|
19
|
-
const [chainId, tokenAddress] = (0,
|
|
20
|
-
name: [
|
|
21
|
-
providers_1.FormKeyHelper.getChainKey(formType),
|
|
22
|
-
providers_1.FormKeyHelper.getTokenKey(formType),
|
|
23
|
-
],
|
|
24
|
-
});
|
|
20
|
+
const [chainId, tokenAddress] = (0, stores_2.useFieldValues)(stores_1.FormKeyHelper.getChainKey(formType), stores_1.FormKeyHelper.getTokenKey(formType));
|
|
25
21
|
const { token } = (0, hooks_1.useToken)(chainId, tokenAddress);
|
|
26
22
|
const disabled = disabledUI?.includes(types_1.DisabledUI.FromAmount);
|
|
27
23
|
return ((0, jsx_runtime_1.jsx)(exports.AmountInputBase, { formType: formType, token: token, startAdornment: (0, jsx_runtime_1.jsx)(AmountInputStartAdornment_1.AmountInputStartAdornment, { formType: formType }), endAdornment: !disabled ? (0, jsx_runtime_1.jsx)(AmountInputEndAdornment_1.AmountInputEndAdornment, { formType: formType }) : undefined, bottomAdornment: (0, jsx_runtime_1.jsx)(FormPriceHelperText_1.FormPriceHelperText, { formType: formType }), disabled: disabled, ...props }));
|
|
@@ -29,10 +25,8 @@ const AmountInput = ({ formType, ...props }) => {
|
|
|
29
25
|
exports.AmountInput = AmountInput;
|
|
30
26
|
const AmountInputBase = ({ formType, token, startAdornment, endAdornment, bottomAdornment, disabled, ...props }) => {
|
|
31
27
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
32
|
-
const amountKey =
|
|
33
|
-
const {
|
|
34
|
-
name: amountKey,
|
|
35
|
-
});
|
|
28
|
+
const amountKey = stores_1.FormKeyHelper.getAmountKey(formType);
|
|
29
|
+
const { onChange, onBlur, value } = (0, stores_2.useFieldController)({ name: amountKey });
|
|
36
30
|
const ref = (0, react_1.useRef)(null);
|
|
37
31
|
const handleChange = (event) => {
|
|
38
32
|
const { value } = event.target;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountInput.js","sourceRoot":"","sources":["../../../components/AmountInput/AmountInput.tsx"],"names":[],"mappings":";;;;AAGA,iCAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"AmountInput.js","sourceRoot":"","sources":["../../../components/AmountInput/AmountInput.tsx"],"names":[],"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AW,IAAC,SAAS,mBACpB,uBAAC,yBAAK,IACJ,QAAQ,EAAE,GAAG,EACb,IAAI,EAAC,OAAO,EACZ,YAAY,EAAC,KAAK,EAClB,WAAW,EAAC,GAAG,EACf,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE;4BACV,SAAS,EAAE,SAAS;yBACrB,EACD,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,QAAQ,EAClB,QAAQ,SACR,EACD,eAAe,IACJ,IACT,CACR,CAAC;AACJ,CAAC,CAAC;AAxEW,QAAA,eAAe,mBAwE1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { FormTypeProps } from '../../
|
|
1
|
+
import type { FormTypeProps } from '../../stores';
|
|
2
2
|
export declare const AmountInputEndAdornment: ({ formType }: FormTypeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,22 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AmountInputEndAdornment = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
7
6
|
const react_i18next_1 = require("react-i18next");
|
|
8
7
|
const viem_1 = require("viem");
|
|
9
8
|
const hooks_1 = require("../../hooks");
|
|
10
|
-
const providers_1 = require("../../providers");
|
|
11
9
|
const AmountInputAdornment_style_1 = require("./AmountInputAdornment.style");
|
|
10
|
+
const stores_1 = require("../../stores");
|
|
12
11
|
const AmountInputEndAdornment = ({ formType }) => {
|
|
13
12
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
14
|
-
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
15
13
|
const { getChainById } = (0, hooks_1.useAvailableChains)();
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
providers_1.FormKeyHelper.getChainKey(formType),
|
|
19
|
-
providers_1.FormKeyHelper.getTokenKey(formType),
|
|
20
|
-
],
|
|
21
|
-
});
|
|
14
|
+
const { setFieldValue } = (0, stores_1.useFieldActions)();
|
|
15
|
+
const [chainId, tokenAddress] = (0, stores_1.useFieldValues)(stores_1.FormKeyHelper.getChainKey(formType), stores_1.FormKeyHelper.getTokenKey(formType));
|
|
22
16
|
// We get gas recommendations for the source chain to make sure that after pressing the Max button
|
|
23
17
|
// the user will have enough funds remaining to cover gas costs
|
|
24
18
|
const { data } = (0, hooks_1.useGasRecommendation)(chainId);
|
|
@@ -35,8 +29,8 @@ const AmountInputEndAdornment = ({ formType }) => {
|
|
|
35
29
|
maxAmount = tokenAmount - recommendedAmount;
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
setFieldValue(stores_1.FormKeyHelper.getAmountKey(formType), maxAmount && token ? (0, viem_1.formatUnits)(maxAmount, token.decimals) : '', {
|
|
33
|
+
isTouched: true,
|
|
40
34
|
});
|
|
41
35
|
};
|
|
42
36
|
return ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 46, height: 24, sx: { borderRadius: 0.5 } })) : formType === 'from' && token?.amount ? ((0, jsx_runtime_1.jsx)(AmountInputAdornment_style_1.Button, { onClick: handleMax, children: t('button.max') })) : null }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountInputEndAdornment.js","sourceRoot":"","sources":["../../../components/AmountInput/AmountInputEndAdornment.tsx"],"names":[],"mappings":";;;;AAAA,4CAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"AmountInputEndAdornment.js","sourceRoot":"","sources":["../../../components/AmountInput/AmountInputEndAdornment.tsx"],"names":[],"mappings":";;;;AAAA,4CAAyD;AACzD,iDAA+C;AAC/C,+BAAmC;AACnC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AAC,EACpC,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,IAAA,kBAAW,EAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAChE;YACE,SAAS,EAAE,IAAI;SAChB,CACF,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,yBAAc,IAAC,QAAQ,EAAC,KAAK,YAC3B,SAAS,IAAI,YAAY,CAAC,CAAC,CAAC,CAC3B,uBAAC,mBAAQ,IACP,OAAO,EAAC,aAAa,EACrB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,GACzB,CACH,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,IAAI,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CACzC,uBAAC,mCAAM,IAAC,OAAO,EAAE,SAAS,YAAG,CAAC,CAAC,YAAY,CAAC,GAAU,CACvD,CAAC,CAAC,CAAC,IAAI,GACO,CAClB,CAAC;AACJ,CAAC,CAAC;AAtDW,QAAA,uBAAuB,2BAsDlC"}
|
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AmountInputStartAdornment = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
6
5
|
const hooks_1 = require("../../hooks");
|
|
7
|
-
const providers_1 = require("../../providers");
|
|
8
6
|
const TokenAvatar_1 = require("../TokenAvatar");
|
|
7
|
+
const stores_1 = require("../../stores");
|
|
9
8
|
const AmountInputStartAdornment = ({ formType, }) => {
|
|
10
|
-
const [chainId, tokenAddress] = (0,
|
|
11
|
-
name: [
|
|
12
|
-
providers_1.FormKeyHelper.getChainKey(formType),
|
|
13
|
-
providers_1.FormKeyHelper.getTokenKey(formType),
|
|
14
|
-
],
|
|
15
|
-
});
|
|
9
|
+
const [chainId, tokenAddress] = (0, stores_1.useFieldValues)(stores_1.FormKeyHelper.getChainKey(formType), stores_1.FormKeyHelper.getTokenKey(formType));
|
|
16
10
|
const { chain } = (0, hooks_1.useChain)(chainId);
|
|
17
11
|
const { token } = (0, hooks_1.useToken)(chainId, tokenAddress);
|
|
18
12
|
const isSelected = !!(chain && token);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountInputStartAdornment.js","sourceRoot":"","sources":["../../../components/AmountInput/AmountInputStartAdornment.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"AmountInputStartAdornment.js","sourceRoot":"","sources":["../../../components/AmountInput/AmountInputStartAdornment.tsx"],"names":[],"mappings":";;;;AAAA,uCAAiD;AAEjD,gDAAiE;AACjE,yCAA6D;AAEtD,MAAM,yBAAyB,GAA4B,CAAC,EACjE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,IAAA,uBAAc,EAC5C,sBAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,EACnC,sBAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CACpC,CAAC;IAEF,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,CAAC;IACpC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,gBAAQ,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC;IAEtC,OAAO,UAAU,CAAC,CAAC,CAAC,CAClB,uBAAC,yBAAW,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,GAAI,CACnE,CAAC,CAAC,CAAC,CACF,uBAAC,gCAAkB,IAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,GAAI,CAC9C,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,yBAAyB,6BAiBpC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { TokenAmount } from '@lifi/sdk';
|
|
3
|
-
import type { FormTypeProps } from '../../
|
|
3
|
+
import type { FormTypeProps } from '../../stores';
|
|
4
4
|
export declare const FormPriceHelperText: React.FC<FormTypeProps>;
|
|
5
5
|
export declare const FormPriceHelperTextBase: React.FC<FormTypeProps & {
|
|
6
6
|
isLoading?: boolean;
|
|
@@ -3,27 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FormPriceHelperTextBase = exports.FormPriceHelperText = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
7
6
|
const react_i18next_1 = require("react-i18next");
|
|
8
7
|
const hooks_1 = require("../../hooks");
|
|
9
|
-
const providers_1 = require("../../providers");
|
|
10
8
|
const utils_1 = require("../../utils");
|
|
9
|
+
const stores_1 = require("../../stores");
|
|
11
10
|
const FormPriceHelperText = ({ formType }) => {
|
|
12
|
-
const [chainId, tokenAddress] = (0,
|
|
13
|
-
name: [
|
|
14
|
-
providers_1.FormKeyHelper.getChainKey(formType),
|
|
15
|
-
providers_1.FormKeyHelper.getTokenKey(formType),
|
|
16
|
-
],
|
|
17
|
-
});
|
|
11
|
+
const [chainId, tokenAddress] = (0, stores_1.useFieldValues)(stores_1.FormKeyHelper.getChainKey(formType), stores_1.FormKeyHelper.getTokenKey(formType));
|
|
18
12
|
const { token, isLoading } = (0, hooks_1.useTokenAddressBalance)(chainId, tokenAddress);
|
|
19
13
|
return ((0, jsx_runtime_1.jsx)(exports.FormPriceHelperTextBase, { formType: formType, isLoading: isLoading, tokenAddress: tokenAddress, token: token }));
|
|
20
14
|
};
|
|
21
15
|
exports.FormPriceHelperText = FormPriceHelperText;
|
|
22
16
|
const FormPriceHelperTextBase = ({ formType, isLoading, tokenAddress, token }) => {
|
|
23
17
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
24
|
-
const amount = (0,
|
|
25
|
-
name: providers_1.FormKeyHelper.getAmountKey(formType),
|
|
26
|
-
});
|
|
18
|
+
const [amount] = (0, stores_1.useFieldValues)(stores_1.FormKeyHelper.getAmountKey(formType));
|
|
27
19
|
const fromAmountTokenPrice = (0, utils_1.formatTokenPrice)(amount, token?.priceUSD);
|
|
28
20
|
return ((0, jsx_runtime_1.jsxs)(material_1.FormHelperText, { component: "div", sx: { display: 'flex', justifyContent: 'space-between', margin: 0 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { color: fromAmountTokenPrice ? 'text.secondary' : 'grey.600', fontWeight: 400, fontSize: 12, marginLeft: 8, lineHeight: 1.3334, flex: 1, sx: {
|
|
29
21
|
wordBreak: 'break-word',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormPriceHelperText.js","sourceRoot":"","sources":["../../../components/AmountInput/FormPriceHelperText.tsx"],"names":[],"mappings":";;;;AACA,4CAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"FormPriceHelperText.js","sourceRoot":"","sources":["../../../components/AmountInput/FormPriceHelperText.tsx"],"names":[],"mappings":";;;;AACA,4CAAqE;AACrE,iDAA+C;AAC/C,uCAAqD;AAErD,uCAAkE;AAClE,yCAA6D;AAEtD,MAAM,mBAAmB,GAA4B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3E,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,IAAA,uBAAc,EAC5C,sBAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,EACnC,sBAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CACpC,CAAC;IACF,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAA,8BAAsB,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAE3E,OAAO,C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E,IAAI,EAAE,GAC1B,CACH,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAClB,uBAAC,qBAAU,IACT,UAAU,EAAE,GAAG,EACf,QAAQ,EAAE,EAAE,EACZ,KAAK,EAAC,gBAAgB,EACtB,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,IAAI,YAEP,KAAK,CAAC,CAAC,eAAe,EAAE;oBACvB,KAAK,EAAE,IAAA,yBAAiB,EAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC;iBACvD,CAAC,EAAE,GACO,CACd,CAAC,CAAC,CAAC,IAAI,IACO,CAClB,CAAC;AACJ,CAAC,CAAC;AAvDW,QAAA,uBAAuB,2BAuDlC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { FormTypeProps } from '../../
|
|
1
|
+
import type { FormTypeProps } from '../../stores';
|
|
2
2
|
export declare const ChainSelect: ({ formType }: FormTypeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,9 +4,7 @@ exports.ChainSelect = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
8
7
|
const react_router_dom_1 = require("react-router-dom");
|
|
9
|
-
const providers_1 = require("../../providers");
|
|
10
8
|
const stores_1 = require("../../stores");
|
|
11
9
|
const utils_1 = require("../../utils");
|
|
12
10
|
const ChainSelect_style_1 = require("./ChainSelect.style");
|
|
@@ -14,9 +12,7 @@ const useChainSelect_1 = require("./useChainSelect");
|
|
|
14
12
|
const ChainSelect = ({ formType }) => {
|
|
15
13
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
16
14
|
const { chainOrder, chains, getChains, isLoading, setChainOrder, setCurrentChain, } = (0, useChainSelect_1.useChainSelect)(formType);
|
|
17
|
-
const [chainId] = (0,
|
|
18
|
-
name: [providers_1.FormKeyHelper.getChainKey(formType)],
|
|
19
|
-
});
|
|
15
|
+
const [chainId] = (0, stores_1.useFieldValues)(stores_1.FormKeyHelper.getChainKey(formType));
|
|
20
16
|
(0, react_1.useEffect)(() => {
|
|
21
17
|
const hasChainInOrderedList = chainOrder.includes(chainId);
|
|
22
18
|
// If we don't have a chain in the ordered chain list we should add it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainSelect.js","sourceRoot":"","sources":["../../../components/ChainSelect/ChainSelect.tsx"],"names":[],"mappings":";;;;AAEA,4CAA2E;AAC3E,iCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"ChainSelect.js","sourceRoot":"","sources":["../../../components/ChainSelect/ChainSelect.tsx"],"names":[],"mappings":";;;;AAEA,4CAA2E;AAC3E,iCAAkC;AAClC,uDAA+C;AAE/C,yCAA8E;AAC9E,uCAA+C;AAC/C,2DAAgE;AAChE,qDAAkD;AAE3C,MAAM,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAiB,EAAE,EAAE;IACzD,MAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAC;IAC/B,MAAM,EACJ,UAAU,EACV,MAAM,EACN,SAAS,EACT,SAAS,EACT,aAAa,EACb,eAAe,GAChB,GAAG,IAAA,+BAAc,EAAC,QAAQ,CAAC,CAAC;IAE7B,MAAM,CAAC,OAAO,CAAC,GAAG,IAAA,uBAAc,EAAC,sBAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEtE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,qBAAqB,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3D,uEAAuE;QACvE,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC3B,aAAa,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IAEzC,MA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C,CAAC,CAAC,CAAC,CAClB,uBAAC,6BAAS,IAAC,OAAO,EAAE,aAAa,YAC/B,uBAAC,cAAG,IACF,EAAE,EAAE;wBACF,KAAK,EAAE,EAAE;wBACT,MAAM,EAAE,EAAE;wBACV,OAAO,EAAE,MAAM;wBACf,UAAU,EAAE,QAAQ;qBACrB,YAED,wBAAC,qBAAU,IAAC,UAAU,EAAE,GAAG,kBAAI,YAAY,IAAc,GACrD,GACI,CACb,CAAC,CAAC,CAAC,IAAI,IACO,CAClB,CAAC;AACJ,CAAC,CAAC;AA7EW,QAAA,WAAW,eA6EtB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EVMChain } from '@lifi/sdk';
|
|
2
|
-
import type { FormType } from '../../
|
|
2
|
+
import type { FormType } from '../../stores';
|
|
3
3
|
export declare const useChainSelect: (formType: FormType) => {
|
|
4
4
|
chainOrder: number[];
|
|
5
5
|
chains: import("@lifi/sdk").ExtendedChain[] | undefined;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useChainSelect = void 0;
|
|
4
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
5
4
|
const hooks_1 = require("../../hooks");
|
|
6
5
|
const providers_1 = require("../../providers");
|
|
7
6
|
const stores_1 = require("../../stores");
|
|
8
7
|
const types_1 = require("../../types");
|
|
9
8
|
const useChainSelect = (formType) => {
|
|
10
9
|
const { requiredUI } = (0, providers_1.useWidgetConfig)();
|
|
11
|
-
const chainKey =
|
|
12
|
-
const {
|
|
13
|
-
const {
|
|
10
|
+
const chainKey = stores_1.FormKeyHelper.getChainKey(formType);
|
|
11
|
+
const { onChange, onBlur } = (0, stores_1.useFieldController)({ name: chainKey });
|
|
12
|
+
const { setFieldValue, getFieldValues } = (0, stores_1.useFieldActions)();
|
|
14
13
|
const { chains, isLoading, getChainById } = (0, hooks_1.useChains)();
|
|
15
14
|
const [chainOrder, setChainOrder] = (0, stores_1.useChainOrder)();
|
|
16
15
|
const swapOnly = (0, hooks_1.useSwapOnly)();
|
|
@@ -27,17 +26,14 @@ const useChainSelect = (formType) => {
|
|
|
27
26
|
onChange(chainId);
|
|
28
27
|
onBlur();
|
|
29
28
|
if (swapOnly) {
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
setFieldValue(stores_1.FormKeyHelper.getChainKey('to'), chainId, {
|
|
30
|
+
isTouched: true,
|
|
32
31
|
});
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const [fromChainId, toChainId] =
|
|
38
|
-
providers_1.FormKey.FromChain,
|
|
39
|
-
providers_1.FormKey.ToChain,
|
|
40
|
-
]);
|
|
33
|
+
setFieldValue(stores_1.FormKeyHelper.getTokenKey(formType), '');
|
|
34
|
+
setFieldValue(stores_1.FormKeyHelper.getAmountKey(formType), '');
|
|
35
|
+
setFieldValue('tokenSearchFilter', '');
|
|
36
|
+
const [fromChainId, toChainId] = getFieldValues('fromChain', 'toChain');
|
|
41
37
|
const fromChain = getChainById(fromChainId);
|
|
42
38
|
const toChain = getChainById(toChainId);
|
|
43
39
|
const differentChainType = fromChain && toChain && fromChain.chainType !== toChain.chainType;
|
|
@@ -49,7 +45,7 @@ const useChainSelect = (formType) => {
|
|
|
49
45
|
// prevents cases when after we switch the chain from one type to another "Send to wallet" field hides,
|
|
50
46
|
// but it keeps toAddress value set for the previous chain pair.
|
|
51
47
|
if (!requiredToAddress) {
|
|
52
|
-
|
|
48
|
+
setFieldValue('toAddress', '');
|
|
53
49
|
}
|
|
54
50
|
setChainOrder(chainId);
|
|
55
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChainSelect.js","sourceRoot":"","sources":["../../../components/ChainSelect/useChainSelect.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"useChainSelect.js","sourceRoot":"","sources":["../../../components/ChainSelect/useChainSelect.ts"],"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D,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;QACD,aAAa,CAAC,sBAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;QACvD,aAAa,CAAC,sBAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;QACxD,aAAa,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QAEvC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAExE,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;QAExC,MAAM,kBAAkB,GACtB,SAAS,IAAI,OAAO,IAAI,SAAS,CAAC,SAAS,KAAK,OAAO,CAAC,SAAS,CAAC;QAEpE,MAAM,iBAAiB,GACrB,UAAU,EAAE,QAAQ,CAAC,kBAAU,CAAC,SAAS,CAAC,IAAI,kBAAkB,CAAC;QAEnE,qEAAqE;QACrE,qEAAqE;QACrE,4EAA4E;QAC5E,mFAAmF;QACnF,uGAAuG;QACvG,gEAAgE;QAChE,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,aAAa,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC;QACD,aAAa,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO;QACL,UAAU;QACV,MAAM;QACN,SAAS;QACT,SAAS;QACT,aAAa;QACb,eAAe;KAChB,CAAC;AACJ,CAAC,CAAC;AAhEW,QAAA,cAAc,kBAgEzB"}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NavigationTabs = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
6
5
|
const react_i18next_1 = require("react-i18next");
|
|
7
|
-
const providers_1 = require("../../providers");
|
|
8
6
|
const stores_1 = require("../../stores");
|
|
9
7
|
const Header_style_1 = require("./Header.style");
|
|
10
8
|
const Tabs_1 = require("../Tabs");
|
|
@@ -14,11 +12,11 @@ const NavigationTabs = () => {
|
|
|
14
12
|
state.state,
|
|
15
13
|
state.setState,
|
|
16
14
|
]);
|
|
17
|
-
const {
|
|
15
|
+
const { setFieldValue } = (0, stores_1.useFieldActions)();
|
|
18
16
|
const handleChange = (_, value) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
setFieldValue('fromAmount', '');
|
|
18
|
+
setFieldValue('fromToken', '');
|
|
19
|
+
setFieldValue('toToken', '');
|
|
22
20
|
setState(value === 0 ? 'swap' : 'bridge');
|
|
23
21
|
};
|
|
24
22
|
return ((0, jsx_runtime_1.jsx)(Header_style_1.HeaderAppBar, { elevation: 0, sx: { py: 1 }, children: (0, jsx_runtime_1.jsxs)(Header_style_1.SplitTabs, { value: state === 'swap' ? 0 : 1, onChange: handleChange, "aria-label": "tabs", indicatorColor: "primary", children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { label: t('header.swap'), disableRipple: true }), (0, jsx_runtime_1.jsx)(Tabs_1.Tab, { label: t('header.bridge'), disableRipple: true })] }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationTabs.js","sourceRoot":"","sources":["../../../components/Header/NavigationTabs.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"NavigationTabs.js","sourceRoot":"","sources":["../../../components/Header/NavigationTabs.tsx"],"names":[],"mappings":";;;;AAAA,iDAA+C;AAC/C,yCAAwE;AACxE,iDAAyD;AACzD,kCAA8B;AAEvB,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,GAAE,CAAC;IAC/B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gCAAuB,EAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QAC3D,KAAK,CAAC,KAAK;QACX,KAAK,CAAC,QAAQ;KACf,CAAC,CAAC;IAEH,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,wBAAe,GAAE,CAAC;IAC5C,MAAM,YAAY,GAAG,CAAC,CAAuB,EAAE,KAAa,EAAE,EAAE;QAC9D,aAAa,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAChC,aAAa,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC/B,aAAa,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QAC7B,QAAQ,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,2BAAY,IAAC,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,YACvC,wBAAC,wBAAS,IACR,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC/B,QAAQ,EAAE,YAAY,gBACX,MAAM,EACjB,cAAc,EAAC,SAAS,aAExB,uBAAC,UAAG,IAAC,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,aAAa,SAAG,EAC9C,uBAAC,UAAG,IAAC,KAAK,EAAE,CAAC,CAAC,eAAe,CAAC,EAAE,aAAa,SAAG,IACtC,GACC,CAChB,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,cAAc,kBA4BzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
2
|
+
export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>, import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -3,31 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NFT = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
7
|
-
const providers_1 = require("../../providers");
|
|
8
6
|
const NFTBase_1 = require("./NFTBase");
|
|
7
|
+
const stores_1 = require("../../stores");
|
|
9
8
|
const NFT = ({ imageUrl, isLoading, collectionName, assetName, owner, token, contract, }) => {
|
|
10
|
-
const {
|
|
9
|
+
const { setFieldValue } = (0, stores_1.useFieldActions)();
|
|
11
10
|
(0, react_1.useEffect)(() => {
|
|
12
11
|
if (token) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
setFieldValue('toChain', token.chainId, { isTouched: true });
|
|
13
|
+
setFieldValue('toToken', token.address, { isTouched: true });
|
|
14
|
+
setFieldValue('toAmount', token.amount?.toString(), {
|
|
15
|
+
isTouched: true,
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
18
|
if (contract) {
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
setFieldValue('toContractAddress', contract.address, {
|
|
20
|
+
isTouched: true,
|
|
22
21
|
});
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
setFieldValue('toContractCallData', contract.callData, {
|
|
23
|
+
isTouched: true,
|
|
25
24
|
});
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
setFieldValue('toContractGasLimit', contract.gasLimit, {
|
|
26
|
+
isTouched: true,
|
|
28
27
|
});
|
|
29
28
|
}
|
|
30
|
-
}, [contract,
|
|
29
|
+
}, [contract, setFieldValue, token]);
|
|
31
30
|
return ((0, jsx_runtime_1.jsx)(NFTBase_1.NFTBase, { isLoading: isLoading, imageUrl: imageUrl, collectionName: collectionName, assetName: assetName, owner: owner, token: token }));
|
|
32
31
|
};
|
|
33
32
|
exports.NFT = NFT;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NFT.js","sourceRoot":"","sources":["../../../components/NFT/NFT.tsx"],"names":[],"mappings":";;;;AAAA,iCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"NFT.js","sourceRoot":"","sources":["../../../components/NFT/NFT.tsx"],"names":[],"mappings":";;;;AAAA,iCAAkC;AAClC,uCAAoC;AAEpC,yCAA+C;AAExC,MAAM,GAAG,GAAuB,CAAC,EACtC,QAAQ,EACR,SAAS,EACT,cAAc,EACd,SAAS,EACT,KAAK,EACL,KAAK,EACL,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,wBAAe,GAAE,CAAC;IAE5C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,EAAE,CAAC;YACV,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7D,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7D,aAAa,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;gBAClD,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;QACD,IAAI,QAAQ,EAAE,CAAC;YACb,aAAa,CAAC,mBAAmB,EAAE,QAAQ,CAAC,OAAO,EAAE;gBACnD,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;YACH,aAAa,CAAC,oBAAoB,EAAE,QAAQ,CAAC,QAAQ,EAAE;gBACrD,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;YACH,aAAa,CAAC,oBAAoB,EAAE,QAAQ,CAAC,QAAQ,EAAE;gBACrD,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;IACrC,OAAO,CACL,uBAAC,iBAAO,IACN,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,GACZ,CACH,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,GAAG,OAyCd"}
|
|
@@ -4,23 +4,16 @@ exports.ReverseTokensButton = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const SwapHoriz_1 = require("@mui/icons-material/SwapHoriz");
|
|
6
6
|
const SwapVert_1 = require("@mui/icons-material/SwapVert");
|
|
7
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
8
|
-
const providers_1 = require("../../providers");
|
|
9
7
|
const ReverseTokensButton_style_1 = require("./ReverseTokensButton.style");
|
|
8
|
+
const stores_1 = require("../../stores");
|
|
10
9
|
const ReverseTokensButton = ({ vertical, }) => {
|
|
11
|
-
const {
|
|
10
|
+
const { setAsTouched, setFieldValue } = (0, stores_1.useFieldActions)();
|
|
12
11
|
const handleClick = () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
]);
|
|
19
|
-
setValue(providers_1.FormKey.FromAmount, '', { shouldTouch: true });
|
|
20
|
-
setValue(providers_1.FormKey.FromChain, toChain, { shouldTouch: true });
|
|
21
|
-
setValue(providers_1.FormKey.FromToken, toToken, { shouldTouch: true });
|
|
22
|
-
setValue(providers_1.FormKey.ToChain, fromChain, { shouldTouch: true });
|
|
23
|
-
setValue(providers_1.FormKey.ToToken, fromToken, { shouldTouch: true });
|
|
12
|
+
setFieldValue('fromAmount', '', { isTouched: true });
|
|
13
|
+
setAsTouched('fromChain');
|
|
14
|
+
setAsTouched('fromToken');
|
|
15
|
+
setAsTouched('toChain');
|
|
16
|
+
setAsTouched('toToken');
|
|
24
17
|
};
|
|
25
18
|
return ((0, jsx_runtime_1.jsx)(ReverseTokensButton_style_1.IconButton, { onClick: handleClick, size: "small", children: vertical ? (0, jsx_runtime_1.jsx)(SwapVert_1.default, {}) : (0, jsx_runtime_1.jsx)(SwapHoriz_1.default, {}) }));
|
|
26
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReverseTokensButton.js","sourceRoot":"","sources":["../../../components/ReverseTokensButton/ReverseTokensButton.tsx"],"names":[],"mappings":";;;;AAAA,6DAA0D;AAC1D,2DAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"ReverseTokensButton.js","sourceRoot":"","sources":["../../../components/ReverseTokensButton/ReverseTokensButton.tsx"],"names":[],"mappings":";;;;AAAA,6DAA0D;AAC1D,2DAAwD;AACxD,2EAAyD;AACzD,yCAA+C;AAExC,MAAM,mBAAmB,GAAqC,CAAC,EACpE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,IAAA,wBAAe,GAAE,CAAC;IAE1D,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,aAAa,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1B,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1B,YAAY,CAAC,SAAS,CAAC,CAAC;QACxB,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC;IACF,OAAO,CACL,uBAAC,sCAAU,IAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAC,OAAO,YAC3C,QAAQ,CAAC,CAAC,CAAC,uBAAC,kBAAY,KAAG,CAAC,CAAC,CAAC,uBAAC,mBAAa,KAAG,GACrC,CACd,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,mBAAmB,uBAiB9B"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Routes = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
7
6
|
const react_i18next_1 = require("react-i18next");
|
|
8
7
|
const react_router_dom_1 = require("react-router-dom");
|
|
9
8
|
const hooks_1 = require("../../hooks");
|
|
@@ -12,11 +11,12 @@ const utils_1 = require("../../utils");
|
|
|
12
11
|
const Card_1 = require("../Card");
|
|
13
12
|
const ProgressToNextUpdate_1 = require("../ProgressToNextUpdate");
|
|
14
13
|
const RouteCard_1 = require("../RouteCard");
|
|
14
|
+
const stores_1 = require("../../stores");
|
|
15
15
|
const Routes = (props) => {
|
|
16
16
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
17
17
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
18
18
|
const { subvariant, useRecommendedRoute } = (0, providers_1.useWidgetConfig)();
|
|
19
|
-
const { isValid, isValidating } = (0,
|
|
19
|
+
const { isValid, isValidating } = (0, stores_1.useValidation)();
|
|
20
20
|
const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = (0, hooks_1.useRoutes)();
|
|
21
21
|
const currentRoute = routes?.[0];
|
|
22
22
|
if (!currentRoute && !isLoading && !isFetching && !isFetched) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Routes.js","sourceRoot":"","sources":["../../../components/Routes/Routes.tsx"],"names":[],"mappings":";;;;AACA,4CAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"Routes.js","sourceRoot":"","sources":["../../../components/Routes/Routes.tsx"],"names":[],"mappings":";;;;AACA,4CAAsD;AACtD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CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GACvD,EACZ,uBAAC,2CAAoB,IACnB,SAAS,EAAE,aAAa,IAAI,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,EAChD,YAAY,EAAE,WAAW,EACzB,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EACxB,EAAE,EAAE;oBACF,QAAQ,EAAE,UAAU;oBACpB,GAAG,EAAE,CAAC;oBACN,KAAK,EAAE,CAAC;iBACT,GACD,EACF,wBAAC,cAAG,IAAC,CAAC,EAAE,CAAC,aACN,SAAS,CAAC,CAAC,CAAC,CACX,uBAAC,6BAAiB,IAAC,OAAO,EAAC,UAAU,GAAG,CACzC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAClB,uBAAC,6BAAiB,KAAG,CACtB,CAAC,CAAC,CAAC,CACF,uBAAC,qBAAS,IAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAC,UAAU,EAAC,MAAM,SAAG,CAC7D,EAED,uBAAC,mBAAQ,IAAC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,aAAa,QAAC,YAAY,QAAC,MAAM,kBACpE,uBAAC,cAAG,IAAC,EAAE,EAAE,CAAC,YACR,uBAAC,iBAAM,IACL,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,YAAY,IAAI,CAAC,OAAO,EAClC,SAAS,kBAER,CAAC,CAAC,gBAAgB,CAAC,GACb,GACL,GACG,IACP,IACD,CACR,CAAC;AACJ,CAAC,CAAC;AArEW,QAAA,MAAM,UAqEjB"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RoutesExpandedElement = exports.RoutesExpanded = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
7
6
|
const react_i18next_1 = require("react-i18next");
|
|
8
7
|
const react_router_dom_1 = require("react-router-dom");
|
|
9
8
|
const hooks_1 = require("../../hooks");
|
|
@@ -24,7 +23,7 @@ const RoutesExpandedElement = () => {
|
|
|
24
23
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
25
24
|
const setExecutableRoute = (0, stores_1.useSetExecutableRoute)();
|
|
26
25
|
const { subvariant, containerStyle } = (0, providers_1.useWidgetConfig)();
|
|
27
|
-
const { isValid, isValidating } = (0,
|
|
26
|
+
const { isValid, isValidating } = (0, stores_1.useValidation)();
|
|
28
27
|
const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = (0, hooks_1.useRoutes)();
|
|
29
28
|
const currentRoute = routes?.[0];
|
|
30
29
|
const handleRouteClick = (route) => {
|