@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.
Files changed (137) hide show
  1. package/App.js +15 -2
  2. package/AppDrawer.d.ts +4 -2
  3. package/AppDrawer.style.d.ts +2 -2
  4. package/cjs/App.js +14 -1
  5. package/cjs/AppDrawer.d.ts +4 -2
  6. package/cjs/AppDrawer.style.d.ts +2 -2
  7. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
  8. package/cjs/components/Card/Card.d.ts +1 -1
  9. package/cjs/components/Card/CardTitle.d.ts +1 -1
  10. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -1
  11. package/cjs/components/ChainSelect/ChainSelect.style.js +1 -1
  12. package/cjs/components/Header/Header.style.d.ts +2 -2
  13. package/cjs/components/Menu.js +1 -1
  14. package/cjs/components/PoweredBy/PoweredBy.js +5 -2
  15. package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
  16. package/cjs/components/SelectTokenButton/SelectTokenButton.js +1 -1
  17. package/cjs/components/SendToWallet/SendToWallet.js +20 -6
  18. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  19. package/cjs/components/SendToWallet/SendToWallet.style.js +6 -0
  20. package/cjs/components/SendToWallet/SendToWalletButton.js +5 -6
  21. package/cjs/components/SmallAvatar.d.ts +20 -0
  22. package/cjs/components/SmallAvatar.js +15 -1
  23. package/cjs/components/Step/StepProcess.style.d.ts +1 -1
  24. package/cjs/components/SwapButton/SwapButton.d.ts +1 -1
  25. package/cjs/components/SwapButton/SwapButton.js +4 -6
  26. package/cjs/components/SwapButton/index.d.ts +1 -0
  27. package/cjs/components/SwapButton/index.js +15 -0
  28. package/cjs/components/SwapButton/types.d.ts +1 -2
  29. package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
  30. package/cjs/components/SwapInput/SwapInput.style.js +1 -0
  31. package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  32. package/cjs/components/SwapInput/SwapInputStartAdornment.js +1 -1
  33. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +2 -2
  34. package/cjs/components/Token/Token.d.ts +3 -0
  35. package/cjs/components/Token/Token.js +16 -2
  36. package/cjs/components/Token/Token.style.d.ts +1 -1
  37. package/cjs/components/TokenAvatar/TokenAvatar.d.ts +2 -1
  38. package/cjs/components/TokenAvatar/TokenAvatar.js +8 -8
  39. package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
  40. package/cjs/components/TokenAvatar/TokenAvatar.style.js +3 -3
  41. package/cjs/components/TokenList/VirtualizedTokenList.js +1 -1
  42. package/cjs/config/theme.js +2 -2
  43. package/cjs/config/version.d.ts +1 -1
  44. package/cjs/config/version.js +1 -1
  45. package/cjs/i18n/de.json +30 -6
  46. package/cjs/i18n/fr.json +30 -6
  47. package/cjs/i18n/it.json +30 -6
  48. package/cjs/i18n/uk.json +38 -20
  49. package/cjs/i18n/zh.json +30 -6
  50. package/cjs/index.d.ts +3 -1
  51. package/cjs/pages/MainPage/MainSwapButton.js +4 -4
  52. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -2
  53. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  54. package/cjs/pages/SettingsPage/LanguageSelect.js +3 -2
  55. package/cjs/pages/SettingsPage/ShowDestinationWallet.js +4 -2
  56. package/cjs/pages/SwapPage/StartSwapButton.d.ts +3 -0
  57. package/cjs/pages/SwapPage/StartSwapButton.js +11 -0
  58. package/cjs/pages/SwapPage/SwapPage.js +2 -4
  59. package/cjs/stores/routes/useRouteExecutionStore.js +13 -1
  60. package/cjs/stores/settings/index.d.ts +1 -0
  61. package/cjs/stores/settings/index.js +1 -0
  62. package/cjs/stores/settings/types.d.ts +8 -0
  63. package/cjs/{components/SendToWallet/store.d.ts → stores/settings/useSendToWalletStore.d.ts} +0 -0
  64. package/cjs/stores/settings/useSendToWalletStore.js +16 -0
  65. package/cjs/types/widget.d.ts +31 -8
  66. package/cjs/types/widget.js +10 -3
  67. package/components/ActiveSwaps/ActiveSwapItem.js +1 -1
  68. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
  69. package/components/Card/Card.d.ts +1 -1
  70. package/components/Card/CardTitle.d.ts +1 -1
  71. package/components/ChainSelect/ChainSelect.style.d.ts +1 -1
  72. package/components/ChainSelect/ChainSelect.style.js +1 -1
  73. package/components/Header/Header.style.d.ts +2 -2
  74. package/components/Header/WalletHeader.js +1 -1
  75. package/components/Menu.js +1 -1
  76. package/components/PoweredBy/PoweredBy.js +5 -2
  77. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
  78. package/components/SelectTokenButton/SelectTokenButton.js +2 -2
  79. package/components/SendToWallet/SendToWallet.js +21 -7
  80. package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  81. package/components/SendToWallet/SendToWallet.style.js +6 -0
  82. package/components/SendToWallet/SendToWalletButton.js +7 -8
  83. package/components/SmallAvatar.d.ts +20 -0
  84. package/components/SmallAvatar.js +14 -1
  85. package/components/Step/StepProcess.style.d.ts +1 -1
  86. package/components/SwapButton/SwapButton.d.ts +1 -1
  87. package/components/SwapButton/SwapButton.js +3 -6
  88. package/components/SwapButton/index.d.ts +1 -0
  89. package/components/SwapButton/index.js +1 -0
  90. package/components/SwapButton/types.d.ts +1 -2
  91. package/components/SwapInput/SwapInput.style.d.ts +1 -1
  92. package/components/SwapInput/SwapInput.style.js +1 -0
  93. package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  94. package/components/SwapInput/SwapInputStartAdornment.js +2 -2
  95. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +2 -2
  96. package/components/Token/Token.d.ts +3 -0
  97. package/components/Token/Token.js +13 -1
  98. package/components/Token/Token.style.d.ts +1 -1
  99. package/components/TokenAvatar/TokenAvatar.d.ts +2 -1
  100. package/components/TokenAvatar/TokenAvatar.js +9 -9
  101. package/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
  102. package/components/TokenAvatar/TokenAvatar.style.js +2 -2
  103. package/components/TokenList/VirtualizedTokenList.js +1 -1
  104. package/config/theme.js +2 -2
  105. package/config/version.d.ts +1 -1
  106. package/config/version.js +1 -1
  107. package/hooks/useRouteExecution.js +1 -1
  108. package/i18n/de.json +30 -6
  109. package/i18n/fr.json +30 -6
  110. package/i18n/it.json +30 -6
  111. package/i18n/uk.json +38 -20
  112. package/i18n/zh.json +30 -6
  113. package/index.d.ts +3 -1
  114. package/package.json +14 -14
  115. package/pages/MainPage/MainSwapButton.js +3 -4
  116. package/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -2
  117. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  118. package/pages/SettingsPage/LanguageSelect.js +3 -2
  119. package/pages/SettingsPage/ShowDestinationWallet.js +6 -4
  120. package/pages/SwapPage/StartSwapButton.d.ts +3 -0
  121. package/pages/SwapPage/StartSwapButton.js +7 -0
  122. package/pages/SwapPage/SwapPage.js +2 -4
  123. package/stores/routes/useRouteExecutionStore.js +13 -1
  124. package/stores/settings/index.d.ts +1 -0
  125. package/stores/settings/index.js +1 -0
  126. package/stores/settings/types.d.ts +8 -0
  127. package/{components/SendToWallet/store.d.ts → stores/settings/useSendToWalletStore.d.ts} +0 -0
  128. package/stores/settings/useSendToWalletStore.js +13 -0
  129. package/tsconfig.cjs.tsbuildinfo +1 -1
  130. package/types/widget.d.ts +31 -8
  131. package/types/widget.js +9 -2
  132. package/cjs/components/SendToWallet/store.js +0 -12
  133. package/cjs/components/SendToWallet/types.d.ts +0 -6
  134. package/cjs/components/SendToWallet/types.js +0 -2
  135. package/components/SendToWallet/store.js +0 -9
  136. package/components/SendToWallet/types.d.ts +0 -6
  137. 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.26.4",
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.0",
45
+ "@lifi/sdk": "^1.7.1",
46
46
  "@lifi/wallet-management": "^1.2.2",
47
- "@mui/icons-material": "^5.10.16",
48
- "@mui/lab": "^5.0.0-alpha.110",
49
- "@mui/material": "^5.10.16",
50
- "@sentry/integrations": "^7.22.0",
51
- "@sentry/react": "^7.22.0",
52
- "@sentry/tracing": "^7.22.0",
53
- "@tanstack/react-query": "^4.18.0",
54
- "@tanstack/react-virtual": "^3.0.0-beta.23",
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.0.4",
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.0.0",
64
- "react-router-dom": "^6.4.3",
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.4"
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 = forwardRef((_, ref) => {
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, disable: isLoading || isFetching || isValidating || !isValid, ref: ref }));
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" | "primary" | "secondary" | "info" | "standard" | undefined;
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, disableI18n } = useWidgetConfig();
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 (disableI18n) {
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 { DisabledUI } from '../../types';
6
+ import { useSendToWalletStore, useSettings, useSettingsStore, } from '../../stores';
7
+ import { HiddenUI } from '../../types';
8
8
  export const ShowDestinationWallet = () => {
9
9
  const { t } = useTranslation();
10
- const { disabledUI } = useWidgetConfig();
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 (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(DisabledUI.ToAddress)) {
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,3 @@
1
+ /// <reference types="react" />
2
+ import type { SwapButtonProps } from '../../components/SwapButton';
3
+ export declare const StartSwapButton: React.FC<SwapButtonProps>;
@@ -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(SwapButton, { text: getSwapButtonText(), onClick: handleSwapClick, currentRoute: route,
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);
@@ -1,4 +1,5 @@
1
1
  export * from './types';
2
2
  export * from './useAppearance';
3
+ export * from './useSendToWalletStore';
3
4
  export * from './useSettings';
4
5
  export * from './useSettingsStore';
@@ -1,4 +1,5 @@
1
1
  export * from './types';
2
2
  export * from './useAppearance';
3
+ export * from './useSendToWalletStore';
3
4
  export * from './useSettings';
4
5
  export * from './useSettingsStore';
@@ -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
+ }
@@ -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
+ }));