@lifi/widget 1.20.3 → 1.22.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/App.d.ts +2 -2
- package/App.js +5 -3
- package/AppDrawer.d.ts +3 -8
- package/AppDrawer.style.d.ts +1 -1
- package/AppProvider.d.ts +2 -5
- package/AppProvider.js +2 -2
- package/AppRoutes.js +5 -0
- package/cjs/App.d.ts +2 -2
- package/cjs/App.js +5 -4
- package/cjs/AppDrawer.d.ts +3 -8
- package/cjs/AppDrawer.style.d.ts +1 -1
- package/cjs/AppProvider.d.ts +2 -5
- package/cjs/AppProvider.js +1 -1
- package/cjs/AppRoutes.js +5 -0
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/cjs/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/cjs/components/ChainSelect/ChainSelect.js +1 -3
- package/cjs/components/ChainSelect/useChainSelect.d.ts +1 -1
- package/cjs/components/Header/Header.style.d.ts +34 -1
- package/cjs/components/Header/Header.style.js +19 -1
- package/cjs/components/Header/NavigationHeader.js +4 -1
- package/cjs/components/Header/WalletHeader.js +34 -9
- package/cjs/components/Menu.d.ts +1 -0
- package/cjs/components/Menu.js +24 -0
- package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/cjs/components/SelectChainAndToken.js +6 -1
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +8 -6
- package/cjs/components/SelectTokenButton/SelectTokenButton.style.js +2 -1
- package/cjs/components/SendToWallet/SendToWallet.js +5 -0
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWalletButton.js +5 -1
- package/cjs/components/Step/CircularProgress.d.ts +0 -1
- package/cjs/components/Step/StepProcess.style.d.ts +2 -2
- package/cjs/components/Step/StepTimer.js +1 -1
- package/cjs/components/StepActions/StepActions.js +6 -1
- package/cjs/components/SwapInput/FormPriceHelperText.js +4 -4
- package/cjs/components/SwapInput/SwapInput.js +5 -2
- package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputAdornment.d.ts +0 -1
- package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +5 -3
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +3 -1
- package/cjs/components/SwapRoutes/SwapRoutes.js +8 -3
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/cjs/components/Token/Token.js +6 -5
- package/cjs/components/TokenAvatar/TokenAvatar.d.ts +6 -1
- package/cjs/components/TokenAvatar/TokenAvatar.js +10 -3
- package/cjs/components/TokenList/TokenList.js +2 -23
- package/cjs/components/TokenList/TokenListItem.d.ts +2 -1
- package/cjs/components/TokenList/TokenListItem.js +12 -6
- package/cjs/components/TokenList/index.d.ts +1 -0
- package/cjs/components/TokenList/index.js +1 -0
- package/cjs/components/TokenList/types.d.ts +6 -0
- package/cjs/components/TokenList/useTokenSelect.d.ts +2 -0
- package/cjs/components/TokenList/useTokenSelect.js +33 -0
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/useChain.d.ts +2 -2
- package/cjs/hooks/useChains.d.ts +2 -2
- package/cjs/hooks/useExpandableVariant.js +3 -5
- package/cjs/hooks/useProcessMessage.d.ts +2 -2
- package/cjs/hooks/useSwapRoutes.js +11 -7
- package/cjs/i18n/de.json +199 -0
- package/cjs/i18n/{en/translation.json → en.json} +157 -150
- package/cjs/i18n/es.json +199 -0
- package/cjs/i18n/fr.json +199 -0
- package/cjs/i18n/index.d.ts +8 -199
- package/cjs/i18n/index.js +16 -22
- package/cjs/i18n/it.json +199 -0
- package/cjs/i18n/uk.json +200 -0
- package/cjs/i18n/zh.json +199 -0
- package/cjs/index.d.ts +6 -3
- package/cjs/index.js +3 -2
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/cjs/pages/SelectChainPage/SelectChainPage.d.ts +1 -1
- package/cjs/pages/SelectChainPage/SelectChainPage.js +2 -5
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +3 -0
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +21 -0
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.d.ts +21 -0
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +20 -0
- package/cjs/pages/SelectNativeTokenPage/index.d.ts +1 -0
- package/cjs/pages/SelectNativeTokenPage/index.js +17 -0
- package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/cjs/pages/SettingsPage/LanguageSelect.d.ts +2 -0
- package/cjs/pages/SettingsPage/LanguageSelect.js +38 -0
- package/cjs/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/cjs/pages/SettingsPage/SettingsPage.js +2 -1
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -2
- package/cjs/pages/SettingsPage/ShowDestinationWallet.js +6 -0
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +4 -2
- package/cjs/pages/SwapHistoryPage/SwapHistoryItem.js +4 -2
- package/cjs/pages/SwapPage/StatusBottomSheet.js +3 -3
- package/cjs/pages/SwapPage/TokenValueBottomSheet.js +1 -1
- package/cjs/providers/I18nProvider/I18nProvider.d.ts +2 -0
- package/cjs/providers/I18nProvider/I18nProvider.js +62 -0
- package/cjs/providers/I18nProvider/index.d.ts +2 -0
- package/cjs/providers/I18nProvider/index.js +18 -0
- package/cjs/providers/I18nProvider/types.d.ts +16 -0
- package/cjs/providers/I18nProvider/types.js +2 -0
- package/cjs/providers/WidgetProvider/utils.d.ts +1 -1
- package/cjs/providers/WidgetProvider/utils.js +4 -4
- package/cjs/providers/index.d.ts +1 -0
- package/cjs/providers/index.js +1 -0
- package/cjs/stores/settings/types.d.ts +1 -0
- package/cjs/stores/settings/useSettingsStore.d.ts +2 -0
- package/cjs/types/widget.d.ts +30 -8
- package/cjs/types/widget.js +8 -0
- package/cjs/utils/deepMerge.d.ts +1 -0
- package/cjs/utils/deepMerge.js +18 -0
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.js +1 -0
- package/cjs/utils/navigationRoutes.d.ts +8 -7
- package/cjs/utils/navigationRoutes.js +10 -7
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/components/ChainSelect/ChainSelect.js +1 -3
- package/components/ChainSelect/useChainSelect.d.ts +1 -1
- package/components/Header/Header.style.d.ts +34 -1
- package/components/Header/Header.style.js +19 -1
- package/components/Header/NavigationHeader.js +4 -1
- package/components/Header/WalletHeader.js +37 -12
- package/components/Menu.d.ts +1 -0
- package/components/Menu.js +21 -0
- package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/components/SelectChainAndToken.js +7 -2
- package/components/SelectTokenButton/SelectTokenButton.js +9 -7
- package/components/SelectTokenButton/SelectTokenButton.style.js +2 -1
- package/components/SendToWallet/SendToWallet.js +6 -1
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SendToWallet/SendToWalletButton.js +6 -2
- package/components/Step/CircularProgress.d.ts +0 -1
- package/components/Step/StepProcess.style.d.ts +2 -2
- package/components/Step/StepTimer.js +1 -1
- package/components/StepActions/StepActions.js +6 -1
- package/components/SwapInput/FormPriceHelperText.js +4 -4
- package/components/SwapInput/SwapInput.js +6 -3
- package/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/components/SwapInput/SwapInputAdornment.d.ts +0 -1
- package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/components/SwapRouteCard/SwapRouteCard.js +5 -3
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/components/SwapRouteCard/SwapRouteCardSkeleton.js +3 -1
- package/components/SwapRoutes/SwapRoutes.js +8 -3
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/components/Token/Token.js +7 -6
- package/components/TokenAvatar/TokenAvatar.d.ts +6 -1
- package/components/TokenAvatar/TokenAvatar.js +8 -2
- package/components/TokenList/TokenList.js +4 -25
- package/components/TokenList/TokenListItem.d.ts +2 -1
- package/components/TokenList/TokenListItem.js +10 -5
- package/components/TokenList/index.d.ts +1 -0
- package/components/TokenList/index.js +1 -0
- package/components/TokenList/types.d.ts +6 -0
- package/components/TokenList/useTokenSelect.d.ts +2 -0
- package/components/TokenList/useTokenSelect.js +29 -0
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useChain.d.ts +2 -2
- package/hooks/useChains.d.ts +2 -2
- package/hooks/useExpandableVariant.js +3 -5
- package/hooks/useProcessMessage.d.ts +2 -2
- package/hooks/useSwapRoutes.js +12 -8
- package/i18n/de.json +199 -0
- package/i18n/{en/translation.json → en.json} +157 -150
- package/i18n/es.json +199 -0
- package/i18n/fr.json +199 -0
- package/i18n/index.d.ts +8 -199
- package/i18n/index.js +9 -20
- package/i18n/it.json +199 -0
- package/i18n/uk.json +200 -0
- package/i18n/zh.json +199 -0
- package/index.d.ts +6 -3
- package/index.js +3 -2
- package/package.json +18 -17
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/pages/SelectChainPage/SelectChainPage.d.ts +1 -1
- package/pages/SelectChainPage/SelectChainPage.js +2 -5
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +3 -0
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +17 -0
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.d.ts +21 -0
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +17 -0
- package/pages/SelectNativeTokenPage/index.d.ts +1 -0
- package/pages/SelectNativeTokenPage/index.js +1 -0
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/pages/SettingsPage/LanguageSelect.d.ts +2 -0
- package/pages/SettingsPage/LanguageSelect.js +34 -0
- package/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/pages/SettingsPage/SettingsPage.js +2 -1
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -2
- package/pages/SettingsPage/ShowDestinationWallet.js +6 -0
- package/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/pages/SwapDetailsPage/SwapDetailsPage.js +4 -2
- package/pages/SwapHistoryPage/SwapHistoryItem.js +4 -2
- package/pages/SwapPage/StatusBottomSheet.js +3 -3
- package/pages/SwapPage/TokenValueBottomSheet.js +1 -1
- package/providers/I18nProvider/I18nProvider.d.ts +2 -0
- package/providers/I18nProvider/I18nProvider.js +58 -0
- package/providers/I18nProvider/index.d.ts +2 -0
- package/providers/I18nProvider/index.js +2 -0
- package/providers/I18nProvider/types.d.ts +16 -0
- package/providers/I18nProvider/types.js +1 -0
- package/providers/WidgetProvider/utils.d.ts +1 -1
- package/providers/WidgetProvider/utils.js +4 -4
- package/providers/index.d.ts +1 -0
- package/providers/index.js +1 -0
- package/stores/settings/types.d.ts +1 -0
- package/stores/settings/useSettingsStore.d.ts +2 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +30 -8
- package/types/widget.js +7 -1
- package/utils/deepMerge.d.ts +1 -0
- package/utils/deepMerge.js +14 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/navigationRoutes.d.ts +8 -7
- package/utils/navigationRoutes.js +10 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.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",
|
|
@@ -37,33 +37,34 @@
|
|
|
37
37
|
"lifi"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@emotion/react": "^11.10.
|
|
41
|
-
"@emotion/styled": "^11.10.
|
|
40
|
+
"@emotion/react": "^11.10.5",
|
|
41
|
+
"@emotion/styled": "^11.10.5",
|
|
42
42
|
"@ethersproject/address": "^5.7.0",
|
|
43
43
|
"@ethersproject/experimental": "^5.7.0",
|
|
44
|
-
"@ethersproject/providers": "^5.7.
|
|
45
|
-
"@lifi/sdk": "^1.6.
|
|
46
|
-
"@lifi/wallet-management": "^1.1.
|
|
44
|
+
"@ethersproject/providers": "^5.7.2",
|
|
45
|
+
"@lifi/sdk": "^1.6.3",
|
|
46
|
+
"@lifi/wallet-management": "^1.1.11",
|
|
47
47
|
"@mui/icons-material": "^5.10.9",
|
|
48
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
49
|
-
"@mui/material": "^5.10.
|
|
50
|
-
"@sentry/integrations": "^7.
|
|
51
|
-
"@sentry/react": "^7.
|
|
52
|
-
"@sentry/tracing": "^7.
|
|
53
|
-
"@tanstack/react-query": "^4.
|
|
48
|
+
"@mui/lab": "^5.0.0-alpha.105",
|
|
49
|
+
"@mui/material": "^5.10.11",
|
|
50
|
+
"@sentry/integrations": "^7.16.0",
|
|
51
|
+
"@sentry/react": "^7.16.0",
|
|
52
|
+
"@sentry/tracing": "^7.16.0",
|
|
53
|
+
"@tanstack/react-query": "^4.13.0",
|
|
54
54
|
"@tanstack/react-virtual": "^3.0.0-beta.18",
|
|
55
55
|
"big.js": "^6.2.1",
|
|
56
|
-
"i18next": "^
|
|
57
|
-
"
|
|
56
|
+
"i18next": "^22.0.3",
|
|
57
|
+
"i18next-browser-languagedetector": "^7.0.0",
|
|
58
|
+
"immer": "^9.0.16",
|
|
58
59
|
"microdiff": "^1.3.1",
|
|
59
60
|
"mitt": "^3.0.0",
|
|
60
61
|
"react": "^18.2.0",
|
|
61
62
|
"react-dom": "^18.2.0",
|
|
62
|
-
"react-hook-form": "^7.
|
|
63
|
-
"react-i18next": "^
|
|
63
|
+
"react-hook-form": "^7.38.0",
|
|
64
|
+
"react-i18next": "^12.0.0",
|
|
64
65
|
"react-router-dom": "^6.4.2",
|
|
65
66
|
"react-timer-hook": "^3.0.5",
|
|
66
|
-
"zustand": "^4.1.
|
|
67
|
+
"zustand": "^4.1.3"
|
|
67
68
|
},
|
|
68
69
|
"peerDependencies": {
|
|
69
70
|
"@types/react": "^18.0.0",
|
|
@@ -9,15 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Avatar, Container, List, ListItemAvatar } from '@mui/material';
|
|
12
|
-
import { useLocation } from 'react-router-dom';
|
|
13
12
|
import { useChainSelect } from '../../components/ChainSelect';
|
|
14
13
|
import { useNavigateBack } from '../../hooks';
|
|
15
14
|
import { ListItemButton, ListItemText } from './SelectChainPage.style';
|
|
16
|
-
export const SelectChainPage = ({ formType
|
|
15
|
+
export const SelectChainPage = ({ formType }) => {
|
|
17
16
|
const { navigateBack } = useNavigateBack();
|
|
18
|
-
const {
|
|
19
|
-
const formTypeState = (state === null || state === void 0 ? void 0 : state.formType) || formType;
|
|
20
|
-
const { chains, setCurrentChain } = useChainSelect(formTypeState);
|
|
17
|
+
const { chains, setCurrentChain } = useChainSelect(formType);
|
|
21
18
|
const handleClick = (chainId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
19
|
setCurrentChain(chainId);
|
|
23
20
|
navigateBack();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Container, List, ListItemAvatar } from '@mui/material';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { TokenAvatar } from '../../components/TokenAvatar';
|
|
5
|
+
import { useTokenSelect } from '../../components/TokenList';
|
|
6
|
+
import { useChains, useNavigateBack } from '../../hooks';
|
|
7
|
+
import { ListItemButton, ListItemText } from './SelectNativeTokenPage.style';
|
|
8
|
+
export const SelectNativeTokenPage = ({ formType, }) => {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
const { navigateBack } = useNavigateBack();
|
|
11
|
+
const { chains } = useChains();
|
|
12
|
+
const selectToken = useTokenSelect(formType, navigateBack);
|
|
13
|
+
return (_jsx(Container, Object.assign({ disableGutters: true }, { children: _jsx(List, Object.assign({ sx: {
|
|
14
|
+
paddingLeft: 1.5,
|
|
15
|
+
paddingRight: 1.5,
|
|
16
|
+
} }, { children: chains === null || chains === void 0 ? void 0 : chains.map((chain) => (_jsxs(ListItemButton, Object.assign({ onClick: () => selectToken(chain.nativeToken.address, chain.id), disableRipple: true }, { children: [_jsx(ListItemAvatar, { children: _jsx(TokenAvatar, { token: chain.nativeToken, chain: chain }) }), _jsx(ListItemText, { primary: chain.nativeToken.symbol, secondary: t('swap.onChain', { chainName: chain.name }) })] }), chain.id))) })) })));
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
|
|
3
|
+
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
4
|
+
centerRipple?: boolean | undefined;
|
|
5
|
+
children?: import("react").ReactNode;
|
|
6
|
+
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
disableRipple?: boolean | undefined;
|
|
9
|
+
disableTouchRipple?: boolean | undefined;
|
|
10
|
+
focusRipple?: boolean | undefined;
|
|
11
|
+
focusVisibleClassName?: string | undefined;
|
|
12
|
+
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
13
|
+
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
14
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
15
|
+
tabIndex?: number | undefined;
|
|
16
|
+
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
17
|
+
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
18
|
+
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
19
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
20
|
+
}, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
21
|
+
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>, {}, {}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ListItemButton as MuiListItemButton, ListItemText as MuiListItemText, } from '@mui/material';
|
|
2
|
+
import { listItemTextClasses } from '@mui/material/ListItemText';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import { getContrastAlphaColor } from '../../utils';
|
|
5
|
+
export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
|
|
6
|
+
borderRadius: theme.shape.borderRadiusSecondary,
|
|
7
|
+
paddingLeft: theme.spacing(1.5),
|
|
8
|
+
height: 56,
|
|
9
|
+
'&:hover': {
|
|
10
|
+
backgroundColor: getContrastAlphaColor(theme, '4%'),
|
|
11
|
+
},
|
|
12
|
+
}));
|
|
13
|
+
export const ListItemText = styled(MuiListItemText)(({ theme }) => ({
|
|
14
|
+
[`.${listItemTextClasses.primary}`]: {
|
|
15
|
+
fontWeight: 400,
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SelectNativeTokenPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SelectNativeTokenPage';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const ToggleButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").ToggleButtonClasses> | undefined;
|
|
5
|
-
color?: "
|
|
5
|
+
color?: "error" | "success" | "warning" | "primary" | "secondary" | "info" | "standard" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
fullWidth?: boolean | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
|
|
3
|
+
import { FormControl, MenuItem } from '@mui/material';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { Card, CardTitle } from '../../components/Card';
|
|
6
|
+
import { Select } from '../../components/Select';
|
|
7
|
+
import { useWidgetConfig } from '../../providers';
|
|
8
|
+
import { useSettings, useSettingsStore } from '../../stores';
|
|
9
|
+
export const LanguageSelect = () => {
|
|
10
|
+
var _a;
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const { languages, disableI18n } = useWidgetConfig();
|
|
13
|
+
const { i18n } = useTranslation();
|
|
14
|
+
const setValue = useSettingsStore((state) => state.setValue);
|
|
15
|
+
const { language } = useSettings(['language']);
|
|
16
|
+
if (disableI18n) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const handleChangeLanguage = (event) => {
|
|
20
|
+
const language = event.target.value;
|
|
21
|
+
setValue('language', language);
|
|
22
|
+
i18n.changeLanguage(language);
|
|
23
|
+
};
|
|
24
|
+
const filteredLanguages = Object.keys(i18n.store.data).sort();
|
|
25
|
+
if (filteredLanguages.length <= 1) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const value = filteredLanguages.includes(language || i18n.resolvedLanguage)
|
|
29
|
+
? language || i18n.resolvedLanguage
|
|
30
|
+
: (languages === null || languages === void 0 ? void 0 : languages.default) || ((_a = languages === null || languages === void 0 ? void 0 : languages.allow) === null || _a === void 0 ? void 0 : _a[0]);
|
|
31
|
+
return (_jsxs(Card, Object.assign({ mb: 2 }, { children: [_jsx(CardTitle, { children: t(`language.title`) }), _jsx(FormControl, Object.assign({ fullWidth: true }, { children: _jsx(Select, Object.assign({ MenuProps: { elevation: 2 }, value: value, onChange: handleChangeLanguage, IconComponent: KeyboardArrowDownIcon, dense: true }, { children: filteredLanguages.map((lng) => {
|
|
32
|
+
return (_jsx(MenuItem, Object.assign({ value: lng }, { children: t('language.name', { lng }) }), lng));
|
|
33
|
+
}) })) }))] })));
|
|
34
|
+
};
|
|
@@ -3,9 +3,10 @@ import { Box, Container } from '@mui/material';
|
|
|
3
3
|
import { AdvancedPreferences } from './AdvancedPreferences';
|
|
4
4
|
import { ColorSchemeButtonGroup } from './ColorSchemeButtonGroup';
|
|
5
5
|
import { GasPriceSelect } from './GasPriceSelect';
|
|
6
|
+
import { LanguageSelect } from './LanguageSelect';
|
|
6
7
|
import { RoutePrioritySelect } from './RoutePrioritySelect';
|
|
7
8
|
import { ShowDestinationWallet } from './ShowDestinationWallet';
|
|
8
9
|
import { SlippageInput } from './SlippageInput';
|
|
9
10
|
export const SettingsPage = () => {
|
|
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, {})] })));
|
|
11
|
+
return (_jsxs(Container, Object.assign({ disableGutters: true }, { children: [_jsxs(Box, Object.assign({ px: 3, pt: 1 }, { children: [_jsx(ColorSchemeButtonGroup, {}), _jsx(LanguageSelect, {}), _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, {})] })));
|
|
11
12
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ShowDestinationWallet: () => JSX.Element;
|
|
1
|
+
export declare const ShowDestinationWallet: () => JSX.Element | null;
|
|
@@ -2,11 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Typography } from '@mui/material';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Switch } from '../../components/Switch';
|
|
5
|
+
import { useWidgetConfig } from '../../providers';
|
|
5
6
|
import { useSettings, useSettingsStore } from '../../stores';
|
|
7
|
+
import { DisabledUI } from '../../types';
|
|
6
8
|
export const ShowDestinationWallet = () => {
|
|
7
9
|
const { t } = useTranslation();
|
|
10
|
+
const { disabledUI } = useWidgetConfig();
|
|
8
11
|
const setValue = useSettingsStore((state) => state.setValue);
|
|
9
12
|
const { showDestinationWallet } = useSettings(['showDestinationWallet']);
|
|
13
|
+
if (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.ToAddress)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
10
16
|
const onChange = (_, checked) => {
|
|
11
17
|
setValue('showDestinationWallet', checked);
|
|
12
18
|
};
|
|
@@ -24,7 +24,7 @@ import { useRouteExecutionStore } from '../../stores';
|
|
|
24
24
|
import { Container } from './SwapDetailsPage.style';
|
|
25
25
|
export const SwapDetailsPage = () => {
|
|
26
26
|
var _a, _b;
|
|
27
|
-
const { t } = useTranslation();
|
|
27
|
+
const { t, i18n } = useTranslation();
|
|
28
28
|
const { navigateBack } = useNavigateBack();
|
|
29
29
|
const { state } = useLocation();
|
|
30
30
|
const [routeExecution, deleteRoute] = useRouteExecutionStore((store) => [store.routes[state === null || state === void 0 ? void 0 : state.routeId], store.deleteRoute], shallow);
|
|
@@ -50,7 +50,9 @@ export const SwapDetailsPage = () => {
|
|
|
50
50
|
display: 'flex',
|
|
51
51
|
flex: 1,
|
|
52
52
|
justifyContent: 'space-between',
|
|
53
|
-
}, pb: 1 }, { children: [_jsx(Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(
|
|
53
|
+
}, pb: 1 }, { children: [_jsx(Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) })), _jsx(Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, {
|
|
54
|
+
timeStyle: 'short',
|
|
55
|
+
}).format(startedAt) }))] })), routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.steps.map((step, index, steps) => {
|
|
54
56
|
var _a, _b;
|
|
55
57
|
return (_jsxs(Fragment, { children: [_jsx(Step, { step: step, fromToken: index === 0
|
|
56
58
|
? Object.assign(Object.assign({}, step.action.fromToken), { amount: step.action.fromAmount }) : undefined, toToken: index === steps.length - 1
|
|
@@ -7,7 +7,7 @@ import { Token, TokenDivider } from '../../components/Token';
|
|
|
7
7
|
import { navigationRoutes } from '../../utils';
|
|
8
8
|
export const SwapHistoryItem = ({ route }) => {
|
|
9
9
|
var _a, _b, _c, _d, _e;
|
|
10
|
-
const {
|
|
10
|
+
const { i18n } = useTranslation();
|
|
11
11
|
const navigate = useNavigate();
|
|
12
12
|
const handleClick = () => {
|
|
13
13
|
navigate(navigationRoutes.swapDetails, {
|
|
@@ -19,5 +19,7 @@ export const SwapHistoryItem = ({ route }) => {
|
|
|
19
19
|
display: 'flex',
|
|
20
20
|
flex: 1,
|
|
21
21
|
justifyContent: 'space-between',
|
|
22
|
-
}, pt: 1.75, px: 2 }, { children: [_jsx(Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(
|
|
22
|
+
}, pt: 1.75, px: 2 }, { children: [_jsx(Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) })), _jsx(Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, {
|
|
23
|
+
timeStyle: 'short',
|
|
24
|
+
}).format(startedAt) }))] })), _jsxs(Box, Object.assign({ py: 1 }, { children: [_jsx(Token, { token: Object.assign(Object.assign({}, route.fromToken), { amount: route.fromAmount }), px: 2, pt: 1, connected: true }), _jsx(TokenDivider, {}), _jsx(Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: (_e = (_d = (_c = route.steps.at(-1)) === null || _c === void 0 ? void 0 : _c.execution) === null || _d === void 0 ? void 0 : _d.toAmount) !== null && _e !== void 0 ? _e : route.toAmount }), px: 2, pt: 0.5, pb: 1 })] }))] })));
|
|
23
25
|
};
|
|
@@ -43,8 +43,8 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
43
43
|
let message;
|
|
44
44
|
switch (status) {
|
|
45
45
|
case 'success':
|
|
46
|
-
title = t('swap.success.title.
|
|
47
|
-
message = t('swap.success.message.
|
|
46
|
+
title = t('swap.success.title.swapSuccessful');
|
|
47
|
+
message = t('swap.success.message.swapSuccessful', {
|
|
48
48
|
amount: token === null || token === void 0 ? void 0 : token.amount,
|
|
49
49
|
tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol,
|
|
50
50
|
chainName: (_a = getChainById(route.toChainId)) === null || _a === void 0 ? void 0 : _a.name,
|
|
@@ -76,5 +76,5 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
76
76
|
(_b = ref.current) === null || _b === void 0 ? void 0 : _b.open();
|
|
77
77
|
}
|
|
78
78
|
}, [refetch, refetchNewBalance, status]);
|
|
79
|
-
return (_jsx(BottomSheet, Object.assign({ ref: ref }, { children: _jsxs(Box, Object.assign({ p: 3 }, { children: [_jsxs(IconContainer, { children: [_jsxs(IconCircle, Object.assign({ status: status, mb: 1 }, { children: [status === 'idle' ? _jsx(InfoIcon, { color: "primary" }) : null, status === 'success' ? _jsx(DoneIcon, { color: "success" }) : null, status === 'error' ? _jsx(WarningIcon, { color: "error" }) : null] })), _jsx(Typography, Object.assign({ py: 1, fontSize: 18, fontWeight: 700 }, { children: title })), status === 'success' ? (_jsx(Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: (_g = (_e = (_d = (_c = route.steps.at(-1)) === null || _c === void 0 ? void 0 : _c.execution) === null || _d === void 0 ? void 0 : _d.toAmount) !== null && _e !== void 0 ? _e : (_f = route.steps.at(-1)) === null || _f === void 0 ? void 0 : _f.estimate.toAmount) !== null && _g !== void 0 ? _g : route.toAmount }), py: 1 })) : null] }), _jsx(Typography, Object.assign({ py: 1 }, { children: message })), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsxs(Button, Object.assign({ variant: "contained", fullWidth: true, onClick: status === 'success' ? handleDone : handleClose }, { children: [status === 'idle' ? t('button.
|
|
79
|
+
return (_jsx(BottomSheet, Object.assign({ ref: ref }, { children: _jsxs(Box, Object.assign({ p: 3 }, { children: [_jsxs(IconContainer, { children: [_jsxs(IconCircle, Object.assign({ status: status, mb: 1 }, { children: [status === 'idle' ? _jsx(InfoIcon, { color: "primary" }) : null, status === 'success' ? _jsx(DoneIcon, { color: "success" }) : null, status === 'error' ? _jsx(WarningIcon, { color: "error" }) : null] })), _jsx(Typography, Object.assign({ py: 1, fontSize: 18, fontWeight: 700 }, { children: title })), status === 'success' ? (_jsx(Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: (_g = (_e = (_d = (_c = route.steps.at(-1)) === null || _c === void 0 ? void 0 : _c.execution) === null || _d === void 0 ? void 0 : _d.toAmount) !== null && _e !== void 0 ? _e : (_f = route.steps.at(-1)) === null || _f === void 0 ? void 0 : _f.estimate.toAmount) !== null && _g !== void 0 ? _g : route.toAmount }), py: 1 })) : null] }), _jsx(Typography, Object.assign({ py: 1 }, { children: message })), _jsx(Box, Object.assign({ mt: 2 }, { children: _jsxs(Button, Object.assign({ variant: "contained", fullWidth: true, onClick: status === 'success' ? handleDone : handleClose }, { children: [status === 'idle' ? t('button.ok') : null, status === 'success' ? t('button.done') : null, status === 'error' ? t('button.seeDetails') : null] })) })), status === 'success' ? (_jsx(Box, Object.assign({ mt: 2 }, { children: _jsx(Button, Object.assign({ variant: "text", fullWidth: true, onClick: handleSeeDetails }, { children: t('button.seeDetails') })) }))) : null] })) })));
|
|
80
80
|
};
|
|
@@ -19,7 +19,7 @@ const TokenValueBottomSheetContent = ({ route, onCancel, onContinue, }) => {
|
|
|
19
19
|
const { t } = useTranslation();
|
|
20
20
|
const ref = useRef();
|
|
21
21
|
useSetContentHeight(ref);
|
|
22
|
-
return (_jsxs(Box, Object.assign({ p: 3, ref: ref }, { children: [_jsxs(IconContainer, { children: [_jsx(IconCircle, Object.assign({ status: "warning", mb: 1 }, { children: _jsx(WarningIcon, { color: "warning" }) })), _jsx(Typography, Object.assign({ py: 1, fontSize: 18, fontWeight: 700 }, { children: t('swap.warning.title.highValueLoss') }))] }), _jsx(Typography, Object.assign({ py: 1 }, { children: t('swap.warning.message.highValueLoss') })), _jsxs(Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 1 }, { children: [_jsx(Typography, { children: t('swap.swapping') }), _jsx(Typography, Object.assign({ fontWeight: 600 }, { children: t('
|
|
22
|
+
return (_jsxs(Box, Object.assign({ p: 3, ref: ref }, { children: [_jsxs(IconContainer, { children: [_jsx(IconCircle, Object.assign({ status: "warning", mb: 1 }, { children: _jsx(WarningIcon, { color: "warning" }) })), _jsx(Typography, Object.assign({ py: 1, fontSize: 18, fontWeight: 700 }, { children: t('swap.warning.title.highValueLoss') }))] }), _jsx(Typography, Object.assign({ py: 1 }, { children: t('swap.warning.message.highValueLoss') })), _jsxs(Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 1 }, { children: [_jsx(Typography, { children: t('swap.swapping') }), _jsx(Typography, Object.assign({ fontWeight: 600 }, { children: t('format.currency', { value: route.fromAmountUSD }) }))] })), _jsxs(Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 0.25 }, { children: [_jsx(Typography, { children: t('swap.gasCost') }), _jsx(Typography, Object.assign({ fontWeight: 600 }, { children: t('format.currency', { value: route.gasCostUSD }) }))] })), _jsxs(Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 0.25 }, { children: [_jsx(Typography, { children: t('swap.receiving') }), _jsx(Typography, Object.assign({ fontWeight: 600 }, { children: t('format.currency', { value: route.toAmountUSD }) }))] })), _jsxs(Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 0.25 }, { children: [_jsx(Typography, { children: t('swap.valueLoss') }), _jsxs(Typography, Object.assign({ fontWeight: 600 }, { children: [Big(route.toAmountUSD || 0)
|
|
23
23
|
.div(Big(route.fromAmountUSD || 0).plus(Big(route.gasCostUSD || 0)))
|
|
24
24
|
.minus(1)
|
|
25
25
|
.mul(100)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import i18next from 'i18next';
|
|
3
|
+
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { I18nextProvider, initReactI18next } from 'react-i18next';
|
|
6
|
+
import * as supportedLanguages from '../../i18n';
|
|
7
|
+
import { useSettings } from '../../stores';
|
|
8
|
+
import { deepMerge } from '../../utils';
|
|
9
|
+
import { isItemAllowed, useWidgetConfig } from '../WidgetProvider';
|
|
10
|
+
export const I18nProvider = ({ children, }) => {
|
|
11
|
+
const { languageResources, languages, disableI18n } = useWidgetConfig();
|
|
12
|
+
const { language } = useSettings(['language']);
|
|
13
|
+
const i18n = useMemo(() => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
let resources = Object.keys(supportedLanguages)
|
|
16
|
+
.filter((lng) => isItemAllowed(lng, languages))
|
|
17
|
+
.reduce((resources, lng) => {
|
|
18
|
+
resources[lng] = {
|
|
19
|
+
translation: (languageResources === null || languageResources === void 0 ? void 0 : languageResources[lng])
|
|
20
|
+
? deepMerge(supportedLanguages[lng], languageResources[lng])
|
|
21
|
+
: supportedLanguages[lng],
|
|
22
|
+
};
|
|
23
|
+
return resources;
|
|
24
|
+
}, {});
|
|
25
|
+
if (languageResources) {
|
|
26
|
+
resources = Object.keys(languageResources).reduce((resources, lng) => {
|
|
27
|
+
if (!resources[lng]) {
|
|
28
|
+
resources[lng] = {
|
|
29
|
+
translation: languageResources[lng],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return resources;
|
|
33
|
+
}, resources);
|
|
34
|
+
}
|
|
35
|
+
let i18n = i18next.createInstance({
|
|
36
|
+
lng: (languages === null || languages === void 0 ? void 0 : languages.default) || language,
|
|
37
|
+
fallbackLng: resources.en
|
|
38
|
+
? 'en'
|
|
39
|
+
: (languages === null || languages === void 0 ? void 0 : languages.default) ||
|
|
40
|
+
((_a = languages === null || languages === void 0 ? void 0 : languages.allow) === null || _a === void 0 ? void 0 : _a[0]) ||
|
|
41
|
+
((_b = Object.keys(resources)) === null || _b === void 0 ? void 0 : _b[0]),
|
|
42
|
+
lowerCaseLng: true,
|
|
43
|
+
interpolation: {
|
|
44
|
+
escapeValue: false,
|
|
45
|
+
},
|
|
46
|
+
resources,
|
|
47
|
+
detection: {
|
|
48
|
+
caches: [],
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
if (!language && !(languages === null || languages === void 0 ? void 0 : languages.default) && !disableI18n) {
|
|
52
|
+
i18n = i18n.use(LanguageDetector);
|
|
53
|
+
}
|
|
54
|
+
i18n.use(initReactI18next).init();
|
|
55
|
+
return i18n;
|
|
56
|
+
}, [disableI18n, language, languageResources, languages]);
|
|
57
|
+
return _jsx(I18nextProvider, Object.assign({ i18n: i18n }, { children: children }));
|
|
58
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as languages from '../../i18n';
|
|
2
|
+
export declare type PartialResource<T> = T extends object ? {
|
|
3
|
+
[P in keyof T]?: PartialResource<T[P]>;
|
|
4
|
+
} : T;
|
|
5
|
+
export declare type LanguageKey = keyof typeof languages;
|
|
6
|
+
export declare type LanguageResources = {
|
|
7
|
+
[language in LanguageKey]?: PartialResource<typeof languages.en>;
|
|
8
|
+
} | {
|
|
9
|
+
[language: string]: PartialResource<typeof languages.en>;
|
|
10
|
+
};
|
|
11
|
+
export declare type LanguageTranslationResource = {
|
|
12
|
+
[namespace in 'translation']: PartialResource<typeof languages.en>;
|
|
13
|
+
};
|
|
14
|
+
export declare type LanguageTranslationResources = {
|
|
15
|
+
[language: string]: LanguageTranslationResource;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const isItemAllowed = (
|
|
1
|
+
export const isItemAllowed = (itemId, items,
|
|
2
2
|
/** @deprecated Remove in the next major release */
|
|
3
3
|
disabledChains) => {
|
|
4
4
|
var _a, _b;
|
|
5
|
-
if ((_a =
|
|
6
|
-
return
|
|
5
|
+
if ((_a = items === null || items === void 0 ? void 0 : items.allow) === null || _a === void 0 ? void 0 : _a.length) {
|
|
6
|
+
return items.allow.includes(itemId);
|
|
7
7
|
}
|
|
8
|
-
return !((disabledChains === null || disabledChains === void 0 ? void 0 : disabledChains.includes(
|
|
8
|
+
return !((disabledChains === null || disabledChains === void 0 ? void 0 : disabledChains.includes(itemId)) || ((_b = items === null || items === void 0 ? void 0 : items.deny) === null || _b === void 0 ? void 0 : _b.includes(itemId)));
|
|
9
9
|
};
|
package/providers/index.d.ts
CHANGED
package/providers/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<Omit
|
|
|
10
10
|
advancedPreferences: boolean;
|
|
11
11
|
appearance: import("../..").Appearance;
|
|
12
12
|
gasPrice: string;
|
|
13
|
+
language?: string | undefined;
|
|
13
14
|
routePriority: "RECOMMENDED" | "FASTEST" | "CHEAPEST" | "SAFEST";
|
|
14
15
|
showDestinationWallet: boolean;
|
|
15
16
|
slippage: string;
|
|
@@ -29,6 +30,7 @@ export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<Omit
|
|
|
29
30
|
advancedPreferences: boolean;
|
|
30
31
|
appearance: import("../..").Appearance;
|
|
31
32
|
gasPrice: string;
|
|
33
|
+
language?: string | undefined;
|
|
32
34
|
routePriority: "RECOMMENDED" | "FASTEST" | "CHEAPEST" | "SAFEST";
|
|
33
35
|
showDestinationWallet: boolean;
|
|
34
36
|
slippage: string;
|