@lifi/widget 1.26.4 → 1.27.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.js +15 -2
- package/AppDrawer.d.ts +4 -2
- package/AppDrawer.style.d.ts +2 -2
- package/cjs/App.js +14 -1
- package/cjs/AppDrawer.d.ts +4 -2
- package/cjs/AppDrawer.style.d.ts +2 -2
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/cjs/components/Card/Card.d.ts +1 -1
- package/cjs/components/Card/CardTitle.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.style.js +1 -1
- package/cjs/components/Header/Header.style.d.ts +2 -2
- package/cjs/components/Menu.js +1 -1
- package/cjs/components/PoweredBy/PoweredBy.js +5 -2
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +1 -1
- package/cjs/components/SendToWallet/SendToWallet.js +20 -6
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWallet.style.js +6 -0
- package/cjs/components/SendToWallet/SendToWalletButton.js +5 -6
- package/cjs/components/SmallAvatar.d.ts +20 -0
- package/cjs/components/SmallAvatar.js +15 -1
- package/cjs/components/Step/StepProcess.style.d.ts +1 -1
- package/cjs/components/SwapButton/SwapButton.d.ts +1 -1
- package/cjs/components/SwapButton/SwapButton.js +4 -6
- package/cjs/components/SwapButton/index.d.ts +1 -0
- package/cjs/components/SwapButton/index.js +15 -0
- package/cjs/components/SwapButton/types.d.ts +1 -2
- package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInput.style.js +1 -0
- package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputStartAdornment.js +1 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +2 -2
- package/cjs/components/Token/Token.d.ts +3 -0
- package/cjs/components/Token/Token.js +16 -2
- package/cjs/components/Token/Token.style.d.ts +1 -1
- package/cjs/components/TokenAvatar/TokenAvatar.d.ts +2 -1
- package/cjs/components/TokenAvatar/TokenAvatar.js +8 -8
- package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
- package/cjs/components/TokenAvatar/TokenAvatar.style.js +3 -3
- package/cjs/components/TokenList/VirtualizedTokenList.js +1 -1
- package/cjs/config/theme.js +2 -2
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/i18n/de.json +30 -6
- package/cjs/i18n/fr.json +30 -6
- package/cjs/i18n/it.json +30 -6
- package/cjs/i18n/uk.json +38 -20
- package/cjs/i18n/zh.json +30 -6
- package/cjs/index.d.ts +3 -1
- package/cjs/pages/MainPage/MainSwapButton.js +4 -4
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -2
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/LanguageSelect.js +3 -2
- package/cjs/pages/SettingsPage/ShowDestinationWallet.js +4 -2
- package/cjs/pages/SwapPage/StartSwapButton.d.ts +3 -0
- package/cjs/pages/SwapPage/StartSwapButton.js +11 -0
- package/cjs/pages/SwapPage/SwapPage.js +2 -4
- package/cjs/stores/routes/useRouteExecutionStore.js +13 -1
- package/cjs/stores/settings/index.d.ts +1 -0
- package/cjs/stores/settings/index.js +1 -0
- package/cjs/stores/settings/types.d.ts +8 -0
- package/cjs/{components/SendToWallet/store.d.ts → stores/settings/useSendToWalletStore.d.ts} +0 -0
- package/cjs/stores/settings/useSendToWalletStore.js +16 -0
- package/cjs/types/widget.d.ts +31 -8
- package/cjs/types/widget.js +10 -3
- package/components/ActiveSwaps/ActiveSwapItem.js +1 -1
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/components/Card/Card.d.ts +1 -1
- package/components/Card/CardTitle.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.style.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.style.js +1 -1
- package/components/Header/Header.style.d.ts +2 -2
- package/components/Header/WalletHeader.js +1 -1
- package/components/Menu.js +1 -1
- package/components/PoweredBy/PoweredBy.js +5 -2
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/components/SelectTokenButton/SelectTokenButton.js +2 -2
- package/components/SendToWallet/SendToWallet.js +21 -7
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SendToWallet/SendToWallet.style.js +6 -0
- package/components/SendToWallet/SendToWalletButton.js +7 -8
- package/components/SmallAvatar.d.ts +20 -0
- package/components/SmallAvatar.js +14 -1
- package/components/Step/StepProcess.style.d.ts +1 -1
- package/components/SwapButton/SwapButton.d.ts +1 -1
- package/components/SwapButton/SwapButton.js +3 -6
- package/components/SwapButton/index.d.ts +1 -0
- package/components/SwapButton/index.js +1 -0
- package/components/SwapButton/types.d.ts +1 -2
- package/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/components/SwapInput/SwapInput.style.js +1 -0
- package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/components/SwapInput/SwapInputStartAdornment.js +2 -2
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +2 -2
- package/components/Token/Token.d.ts +3 -0
- package/components/Token/Token.js +13 -1
- package/components/Token/Token.style.d.ts +1 -1
- package/components/TokenAvatar/TokenAvatar.d.ts +2 -1
- package/components/TokenAvatar/TokenAvatar.js +9 -9
- package/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
- package/components/TokenAvatar/TokenAvatar.style.js +2 -2
- package/components/TokenList/VirtualizedTokenList.js +1 -1
- package/config/theme.js +2 -2
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useRouteExecution.js +1 -1
- package/i18n/de.json +30 -6
- package/i18n/fr.json +30 -6
- package/i18n/it.json +30 -6
- package/i18n/uk.json +38 -20
- package/i18n/zh.json +30 -6
- package/index.d.ts +3 -1
- package/package.json +14 -14
- package/pages/MainPage/MainSwapButton.js +3 -4
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/pages/SettingsPage/LanguageSelect.js +3 -2
- package/pages/SettingsPage/ShowDestinationWallet.js +6 -4
- package/pages/SwapPage/StartSwapButton.d.ts +3 -0
- package/pages/SwapPage/StartSwapButton.js +7 -0
- package/pages/SwapPage/SwapPage.js +2 -4
- package/stores/routes/useRouteExecutionStore.js +13 -1
- package/stores/settings/index.d.ts +1 -0
- package/stores/settings/index.js +1 -0
- package/stores/settings/types.d.ts +8 -0
- package/{components/SendToWallet/store.d.ts → stores/settings/useSendToWalletStore.d.ts} +0 -0
- package/stores/settings/useSendToWalletStore.js +13 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +31 -8
- package/types/widget.js +9 -2
- package/cjs/components/SendToWallet/store.js +0 -12
- package/cjs/components/SendToWallet/types.d.ts +0 -6
- package/cjs/components/SendToWallet/types.js +0 -2
- package/components/SendToWallet/store.js +0 -9
- package/components/SendToWallet/types.d.ts +0 -6
- package/components/SendToWallet/types.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.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",
|
|
@@ -42,28 +42,28 @@
|
|
|
42
42
|
"@ethersproject/address": "^5.7.0",
|
|
43
43
|
"@ethersproject/experimental": "^5.7.0",
|
|
44
44
|
"@ethersproject/providers": "^5.7.2",
|
|
45
|
-
"@lifi/sdk": "^1.7.
|
|
45
|
+
"@lifi/sdk": "^1.7.1",
|
|
46
46
|
"@lifi/wallet-management": "^1.2.2",
|
|
47
|
-
"@mui/icons-material": "^5.
|
|
48
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
49
|
-
"@mui/material": "^5.
|
|
50
|
-
"@sentry/integrations": "^7.
|
|
51
|
-
"@sentry/react": "^7.
|
|
52
|
-
"@sentry/tracing": "^7.
|
|
53
|
-
"@tanstack/react-query": "^4.
|
|
54
|
-
"@tanstack/react-virtual": "^3.0.0-beta.
|
|
47
|
+
"@mui/icons-material": "^5.11.0",
|
|
48
|
+
"@mui/lab": "^5.0.0-alpha.112",
|
|
49
|
+
"@mui/material": "^5.11.0",
|
|
50
|
+
"@sentry/integrations": "^7.25.0",
|
|
51
|
+
"@sentry/react": "^7.25.0",
|
|
52
|
+
"@sentry/tracing": "^7.25.0",
|
|
53
|
+
"@tanstack/react-query": "^4.19.1",
|
|
54
|
+
"@tanstack/react-virtual": "^3.0.0-beta.30",
|
|
55
55
|
"big.js": "^6.2.1",
|
|
56
|
-
"i18next": "22.
|
|
56
|
+
"i18next": "22.4.5",
|
|
57
57
|
"i18next-browser-languagedetector": "^7.0.1",
|
|
58
58
|
"microdiff": "^1.3.1",
|
|
59
59
|
"mitt": "^3.0.0",
|
|
60
60
|
"react": "^18.2.0",
|
|
61
61
|
"react-dom": "^18.2.0",
|
|
62
62
|
"react-hook-form": "^7.40.0",
|
|
63
|
-
"react-i18next": "^12.
|
|
64
|
-
"react-router-dom": "^6.4.
|
|
63
|
+
"react-i18next": "^12.1.1",
|
|
64
|
+
"react-router-dom": "^6.4.5",
|
|
65
65
|
"react-timer-hook": "^3.0.5",
|
|
66
|
-
"zustand": "^4.1.
|
|
66
|
+
"zustand": "^4.1.5"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@types/react": "^18.0.0",
|
|
@@ -8,14 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { forwardRef } from 'react';
|
|
12
11
|
import { useFormState } from 'react-hook-form';
|
|
13
12
|
import { useNavigate } from 'react-router-dom';
|
|
14
13
|
import { SwapButton } from '../../components/SwapButton';
|
|
15
14
|
import { useSwapRoutes } from '../../hooks';
|
|
16
15
|
import { useSetExecutableRoute } from '../../stores';
|
|
17
16
|
import { navigationRoutes } from '../../utils';
|
|
18
|
-
export const MainSwapButton =
|
|
17
|
+
export const MainSwapButton = () => {
|
|
19
18
|
const navigate = useNavigate();
|
|
20
19
|
const { isValid, isValidating } = useFormState();
|
|
21
20
|
const setExecutableRoute = useSetExecutableRoute();
|
|
@@ -29,5 +28,5 @@ export const MainSwapButton = forwardRef((_, ref) => {
|
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
30
|
});
|
|
32
|
-
return (_jsx(SwapButton, { onClick: handleClick, currentRoute: currentRoute,
|
|
33
|
-
}
|
|
31
|
+
return (_jsx(SwapButton, { onClick: handleClick, currentRoute: currentRoute, disabled: isLoading || isFetching || isValidating || !isValid }));
|
|
32
|
+
};
|
|
@@ -4,12 +4,13 @@ import { Box, ToggleButtonGroup } from '@mui/material';
|
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { useWidgetConfig } from '../../providers';
|
|
6
6
|
import { useAppearance } from '../../stores';
|
|
7
|
+
import { HiddenUI } from '../../types';
|
|
7
8
|
import { ToggleButton } from './ColorSchemeButtonGroup.style';
|
|
8
9
|
export const ColorSchemeButtonGroup = () => {
|
|
9
10
|
const { t } = useTranslation();
|
|
10
|
-
const { disableAppearance } = useWidgetConfig();
|
|
11
|
+
const { disableAppearance, hiddenUI } = useWidgetConfig();
|
|
11
12
|
const [appearance, setAppearance] = useAppearance();
|
|
12
|
-
if (disableAppearance) {
|
|
13
|
+
if (disableAppearance || (hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(HiddenUI.Appearance))) {
|
|
13
14
|
return null;
|
|
14
15
|
}
|
|
15
16
|
return (_jsx(Box, Object.assign({ pb: 2 }, { children: _jsxs(ToggleButtonGroup, Object.assign({ color: "primary", value: appearance, onChange: (_, value) => {
|
|
@@ -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?: "success" | "warning" | "error" | "
|
|
5
|
+
color?: "success" | "warning" | "error" | "secondary" | "primary" | "info" | "standard" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
fullWidth?: boolean | undefined;
|
|
@@ -6,14 +6,15 @@ import { Card, CardTitle } from '../../components/Card';
|
|
|
6
6
|
import { Select } from '../../components/Select';
|
|
7
7
|
import { useWidgetConfig } from '../../providers';
|
|
8
8
|
import { useSettings, useSettingsStore } from '../../stores';
|
|
9
|
+
import { HiddenUI } from '../../types';
|
|
9
10
|
export const LanguageSelect = () => {
|
|
10
11
|
var _a;
|
|
11
12
|
const { t } = useTranslation();
|
|
12
|
-
const { languages,
|
|
13
|
+
const { languages, hiddenUI } = useWidgetConfig();
|
|
13
14
|
const { i18n } = useTranslation();
|
|
14
15
|
const setValue = useSettingsStore((state) => state.setValue);
|
|
15
16
|
const { language } = useSettings(['language']);
|
|
16
|
-
if (
|
|
17
|
+
if (hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(HiddenUI.Language)) {
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
20
|
const handleChangeLanguage = (event) => {
|
|
@@ -3,18 +3,20 @@ import { Box, Typography } from '@mui/material';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { Switch } from '../../components/Switch';
|
|
5
5
|
import { useWidgetConfig } from '../../providers';
|
|
6
|
-
import { useSettings, useSettingsStore } from '../../stores';
|
|
7
|
-
import {
|
|
6
|
+
import { useSendToWalletStore, useSettings, useSettingsStore, } from '../../stores';
|
|
7
|
+
import { HiddenUI } from '../../types';
|
|
8
8
|
export const ShowDestinationWallet = () => {
|
|
9
9
|
const { t } = useTranslation();
|
|
10
|
-
const {
|
|
10
|
+
const { hiddenUI } = useWidgetConfig();
|
|
11
|
+
const setSendToWallet = useSendToWalletStore((state) => state.setSendToWallet);
|
|
11
12
|
const setValue = useSettingsStore((state) => state.setValue);
|
|
12
13
|
const { showDestinationWallet } = useSettings(['showDestinationWallet']);
|
|
13
|
-
if (
|
|
14
|
+
if (hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(HiddenUI.ToAddress)) {
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
16
17
|
const onChange = (_, checked) => {
|
|
17
18
|
setValue('showDestinationWallet', checked);
|
|
19
|
+
setSendToWallet(false);
|
|
18
20
|
};
|
|
19
21
|
return (_jsx(Box, Object.assign({ px: 3, pt: 2 }, { children: _jsxs(Box, Object.assign({ sx: {
|
|
20
22
|
display: 'flex',
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SwapButton } from '../../components/SwapButton';
|
|
3
|
+
import { useGasSufficiency } from '../../hooks';
|
|
4
|
+
export const StartSwapButton = ({ onClick, currentRoute, text, }) => {
|
|
5
|
+
const { insufficientFunds, insufficientGas, isLoading: isGasSufficiencyLoading, } = useGasSufficiency(currentRoute);
|
|
6
|
+
return (_jsx(SwapButton, { onClick: onClick, text: text, currentRoute: currentRoute, disabled: insufficientFunds || !!(insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length), loading: isGasSufficiencyLoading }));
|
|
7
|
+
};
|
|
@@ -16,11 +16,11 @@ import { useTranslation } from 'react-i18next';
|
|
|
16
16
|
import { useLocation } from 'react-router-dom';
|
|
17
17
|
import { GasSufficiencyMessage } from '../../components/GasSufficiencyMessage';
|
|
18
18
|
import { getStepList } from '../../components/Step';
|
|
19
|
-
import { SwapButton } from '../../components/SwapButton';
|
|
20
19
|
import { useNavigateBack, useRouteExecution } from '../../hooks';
|
|
21
20
|
import { SwapFormKey } from '../../providers';
|
|
22
21
|
import { RouteExecutionStatus } from '../../stores';
|
|
23
22
|
import { ExchangeRateBottomSheet } from './ExchangeRateBottomSheet';
|
|
23
|
+
import { StartSwapButton } from './StartSwapButton';
|
|
24
24
|
import { StatusBottomSheet } from './StatusBottomSheet';
|
|
25
25
|
import { Container } from './SwapPage.style';
|
|
26
26
|
import { getTokenValueLossThreshold, TokenValueBottomSheet, } from './TokenValueBottomSheet';
|
|
@@ -74,9 +74,7 @@ export const SwapPage = () => {
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
return (_jsxs(Container, { children: [getStepList(route), status === RouteExecutionStatus.Idle ||
|
|
77
|
-
status === RouteExecutionStatus.Failed ? (_jsxs(_Fragment, { children: [_jsx(GasSufficiencyMessage, { route: route, mt: 2 }), _jsxs(Box, Object.assign({ mt: 2, display: "flex" }, { children: [_jsx(
|
|
78
|
-
// disable={status === 'idle' && (isValidating || !isValid)}
|
|
79
|
-
enableLoading: true }), status === RouteExecutionStatus.Failed ? (_jsx(Tooltip, Object.assign({ title: t('button.removeSwap'), placement: "bottom-end", enterDelay: 400, arrow: true }, { children: _jsx(Button, Object.assign({ onClick: handleRemoveRoute, sx: {
|
|
77
|
+
status === RouteExecutionStatus.Failed ? (_jsxs(_Fragment, { children: [_jsx(GasSufficiencyMessage, { route: route, mt: 2 }), _jsxs(Box, Object.assign({ mt: 2, display: "flex" }, { children: [_jsx(StartSwapButton, { text: getSwapButtonText(), onClick: handleSwapClick, currentRoute: route }), status === RouteExecutionStatus.Failed ? (_jsx(Tooltip, Object.assign({ title: t('button.removeSwap'), placement: "bottom-end", enterDelay: 400, arrow: true }, { children: _jsx(Button, Object.assign({ onClick: handleRemoveRoute, sx: {
|
|
80
78
|
minWidth: 48,
|
|
81
79
|
marginLeft: 1,
|
|
82
80
|
} }, { children: _jsx(DeleteIcon, {}) })) }))) : null] }))] })) : null, route && status ? (_jsx(StatusBottomSheet, { status: status, route: route })) : null, route ? (_jsx(TokenValueBottomSheet, { route: route, ref: tokenValueBottomSheetRef, onContinue: handleExecuteRoute })) : null, route ? (_jsx(ExchangeRateBottomSheet, { ref: exchangeRateBottomSheetRef })) : null] }));
|
|
@@ -96,6 +96,18 @@ export const useRouteExecutionStore = create()(persist((set, get) => ({
|
|
|
96
96
|
merge: (persistedState, currentState) => {
|
|
97
97
|
const state = Object.assign(Object.assign({}, currentState), persistedState);
|
|
98
98
|
try {
|
|
99
|
+
// Move swaps to history after 1 day
|
|
100
|
+
const currentTime = new Date().getTime();
|
|
101
|
+
const oneDay = 1000 * 60 * 60 * 24;
|
|
102
|
+
Object.values(state.routes).forEach((routeExecution) => {
|
|
103
|
+
var _a, _b, _c, _d, _e;
|
|
104
|
+
const startedAt = (_e = (_d = (_c = (_b = (_a = routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.steps) === null || _a === void 0 ? void 0 : _a.find((step) => { var _a; return ((_a = step.execution) === null || _a === void 0 ? void 0 : _a.status) === 'FAILED'; })) === null || _b === void 0 ? void 0 : _b.execution) === null || _c === void 0 ? void 0 : _c.process.find((process) => process.startedAt)) === null || _d === void 0 ? void 0 : _d.startedAt) !== null && _e !== void 0 ? _e : 0;
|
|
105
|
+
const outdated = startedAt > 0 && currentTime - startedAt > oneDay;
|
|
106
|
+
if ((routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route) && outdated) {
|
|
107
|
+
routeExecution.status |= RouteExecutionStatus.Done;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
// migrate old routes
|
|
99
111
|
const routeString = localStorage.getItem('routes');
|
|
100
112
|
if (routeString) {
|
|
101
113
|
const routes = JSON.parse(routeString);
|
|
@@ -122,8 +134,8 @@ export const useRouteExecutionStore = create()(persist((set, get) => ({
|
|
|
122
134
|
state.routes[route.id].status = RouteExecutionStatus.Pending;
|
|
123
135
|
}
|
|
124
136
|
});
|
|
137
|
+
localStorage.removeItem('routes');
|
|
125
138
|
}
|
|
126
|
-
localStorage.removeItem('routes');
|
|
127
139
|
}
|
|
128
140
|
catch (error) {
|
|
129
141
|
console.log(error);
|
package/stores/settings/index.js
CHANGED
|
@@ -23,3 +23,11 @@ export interface SettingsStore extends SettingsState {
|
|
|
23
23
|
initializeTools(toolType: SettingsToolType, tools: string[]): void;
|
|
24
24
|
setTools(toolType: SettingsToolType, tools: string[], availableTools: (Pick<Bridge, 'key'> | Pick<Exchange, 'key'>)[]): void;
|
|
25
25
|
}
|
|
26
|
+
export interface SendToWalletState {
|
|
27
|
+
showSendToWallet: boolean;
|
|
28
|
+
showSendToWalletDirty: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface SendToWalletStore extends SendToWalletState {
|
|
31
|
+
toggleSendToWallet(): void;
|
|
32
|
+
setSendToWallet(value: boolean): void;
|
|
33
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import create from 'zustand';
|
|
2
|
+
export const useSendToWalletStore = create((set) => ({
|
|
3
|
+
showSendToWallet: false,
|
|
4
|
+
showSendToWalletDirty: false,
|
|
5
|
+
toggleSendToWallet: () => set((state) => ({
|
|
6
|
+
showSendToWallet: !state.showSendToWallet,
|
|
7
|
+
showSendToWalletDirty: true,
|
|
8
|
+
})),
|
|
9
|
+
setSendToWallet: (value) => set({
|
|
10
|
+
showSendToWallet: value,
|
|
11
|
+
showSendToWalletDirty: true,
|
|
12
|
+
}),
|
|
13
|
+
}));
|