@lifi/widget 1.23.1 → 1.25.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 (144) hide show
  1. package/AppDrawer.style.d.ts +1 -1
  2. package/AppProvider.js +1 -1
  3. package/cjs/AppDrawer.style.d.ts +1 -1
  4. package/cjs/AppProvider.js +1 -1
  5. package/cjs/components/ActiveSwaps/ActiveSwapItem.js +2 -1
  6. package/cjs/components/BottomSheet/types.d.ts +1 -1
  7. package/cjs/components/Card/Card.d.ts +2 -2
  8. package/cjs/components/Card/CardTitle.d.ts +1 -1
  9. package/cjs/components/ChainSelect/ChainSelect.js +6 -1
  10. package/cjs/components/ChainSelect/useChainSelect.d.ts +3 -1
  11. package/cjs/components/ChainSelect/useChainSelect.js +12 -3
  12. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  13. package/cjs/components/StepActions/StepActions.js +2 -2
  14. package/cjs/components/SwapInput/FitInputText.d.ts +3 -0
  15. package/cjs/components/SwapInput/FitInputText.js +19 -0
  16. package/cjs/components/SwapInput/FormPriceHelperText.d.ts +1 -3
  17. package/cjs/components/SwapInput/FormPriceHelperText.js +1 -1
  18. package/cjs/components/SwapInput/SwapInput.js +12 -24
  19. package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
  20. package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +3 -0
  21. package/cjs/components/SwapInput/{SwapInputAdornment.js → SwapInputEndAdornment.js} +3 -3
  22. package/cjs/components/SwapInput/SwapInputStartAdornment.d.ts +3 -0
  23. package/cjs/components/SwapInput/SwapInputStartAdornment.js +21 -0
  24. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
  25. package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +1 -1
  26. package/cjs/components/Token/Token.style.d.ts +1 -1
  27. package/cjs/components/TokenList/useTokenSelect.js +12 -9
  28. package/cjs/config/version.d.ts +1 -1
  29. package/cjs/config/version.js +1 -1
  30. package/cjs/hooks/useGasSufficiency.js +1 -1
  31. package/cjs/hooks/useRouteExecution.js +1 -1
  32. package/cjs/hooks/useSwapRoutes.js +12 -9
  33. package/cjs/hooks/useTelemetry.js +3 -1
  34. package/cjs/hooks/useTools.d.ts +5 -2
  35. package/cjs/i18n/en.json +3 -1
  36. package/cjs/i18n/uk.json +11 -6
  37. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +2 -1
  38. package/cjs/pages/SettingsPage/SlippageInput.js +2 -1
  39. package/cjs/pages/SwapHistoryPage/SwapHistoryItem.js +4 -2
  40. package/cjs/pages/SwapPage/StatusBottomSheet.js +63 -15
  41. package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -2
  42. package/cjs/pages/SwapPage/StatusBottomSheet.style.js +5 -2
  43. package/cjs/pages/SwapPage/SwapPage.js +8 -6
  44. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
  45. package/cjs/providers/I18nProvider/types.d.ts +5 -5
  46. package/cjs/providers/SwapFormProvider/FormUpdater.d.ts +5 -0
  47. package/cjs/providers/{WalletProvider/WalletFormUpdate.js → SwapFormProvider/FormUpdater.js} +24 -21
  48. package/cjs/providers/SwapFormProvider/SwapFormProvider.js +12 -7
  49. package/cjs/providers/SwapFormProvider/types.d.ts +2 -2
  50. package/cjs/providers/WalletProvider/WalletProvider.d.ts +1 -1
  51. package/cjs/providers/WalletProvider/WalletProvider.js +1 -2
  52. package/cjs/providers/WalletProvider/types.d.ts +3 -3
  53. package/cjs/providers/WidgetProvider/WidgetProvider.js +4 -0
  54. package/cjs/providers/WidgetProvider/types.d.ts +1 -1
  55. package/cjs/stores/routes/types.d.ts +8 -1
  56. package/cjs/stores/routes/types.js +10 -0
  57. package/cjs/stores/routes/useExecutingRoutesIds.js +3 -1
  58. package/cjs/stores/routes/useRouteExecutionStore.js +53 -18
  59. package/cjs/stores/routes/useSwapHistory.js +4 -1
  60. package/cjs/stores/routes/utils.d.ts +3 -1
  61. package/cjs/stores/routes/utils.js +12 -4
  62. package/cjs/stores/settings/types.d.ts +6 -6
  63. package/cjs/stores/settings/useSettingsStore.d.ts +12 -9
  64. package/cjs/stores/settings/useSettingsStore.js +22 -5
  65. package/cjs/types/events.d.ts +1 -1
  66. package/cjs/types/widget.d.ts +13 -8
  67. package/cjs/utils/enum.d.ts +1 -0
  68. package/cjs/utils/enum.js +5 -0
  69. package/cjs/utils/index.d.ts +1 -0
  70. package/cjs/utils/index.js +1 -0
  71. package/cjs/utils/navigationRoutes.d.ts +1 -1
  72. package/components/ActiveSwaps/ActiveSwapItem.js +2 -1
  73. package/components/BottomSheet/types.d.ts +1 -1
  74. package/components/Card/Card.d.ts +2 -2
  75. package/components/Card/CardTitle.d.ts +1 -1
  76. package/components/ChainSelect/ChainSelect.js +6 -1
  77. package/components/ChainSelect/useChainSelect.d.ts +3 -1
  78. package/components/ChainSelect/useChainSelect.js +13 -4
  79. package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  80. package/components/StepActions/StepActions.js +2 -2
  81. package/components/SwapInput/FitInputText.d.ts +3 -0
  82. package/components/SwapInput/FitInputText.js +16 -0
  83. package/components/SwapInput/FormPriceHelperText.d.ts +1 -3
  84. package/components/SwapInput/FormPriceHelperText.js +1 -1
  85. package/components/SwapInput/SwapInput.js +16 -28
  86. package/components/SwapInput/SwapInput.style.d.ts +1 -1
  87. package/components/SwapInput/SwapInputEndAdornment.d.ts +3 -0
  88. package/components/SwapInput/{SwapInputAdornment.js → SwapInputEndAdornment.js} +1 -1
  89. package/components/SwapInput/SwapInputStartAdornment.d.ts +3 -0
  90. package/components/SwapInput/SwapInputStartAdornment.js +17 -0
  91. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
  92. package/components/SwapRoutes/SwapRoutes.style.d.ts +1 -1
  93. package/components/Token/Token.style.d.ts +1 -1
  94. package/components/TokenList/useTokenSelect.js +13 -10
  95. package/config/version.d.ts +1 -1
  96. package/config/version.js +1 -1
  97. package/hooks/useGasSufficiency.js +2 -2
  98. package/hooks/useRouteExecution.js +2 -2
  99. package/hooks/useSwapRoutes.js +12 -9
  100. package/hooks/useTelemetry.js +3 -1
  101. package/hooks/useTools.d.ts +5 -2
  102. package/i18n/en.json +3 -1
  103. package/i18n/uk.json +11 -6
  104. package/package.json +13 -13
  105. package/pages/SettingsPage/RoutePrioritySelect.js +2 -1
  106. package/pages/SettingsPage/SlippageInput.js +2 -1
  107. package/pages/SwapHistoryPage/SwapHistoryItem.js +4 -2
  108. package/pages/SwapPage/StatusBottomSheet.js +64 -16
  109. package/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -2
  110. package/pages/SwapPage/StatusBottomSheet.style.js +5 -2
  111. package/pages/SwapPage/SwapPage.js +8 -6
  112. package/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
  113. package/providers/I18nProvider/types.d.ts +5 -5
  114. package/providers/SwapFormProvider/FormUpdater.d.ts +5 -0
  115. package/providers/{WalletProvider/WalletFormUpdate.js → SwapFormProvider/FormUpdater.js} +23 -20
  116. package/providers/SwapFormProvider/SwapFormProvider.js +12 -7
  117. package/providers/SwapFormProvider/types.d.ts +2 -2
  118. package/providers/WalletProvider/WalletProvider.d.ts +1 -1
  119. package/providers/WalletProvider/WalletProvider.js +2 -3
  120. package/providers/WalletProvider/types.d.ts +3 -3
  121. package/providers/WidgetProvider/WidgetProvider.js +5 -1
  122. package/providers/WidgetProvider/types.d.ts +1 -1
  123. package/stores/routes/types.d.ts +8 -1
  124. package/stores/routes/types.js +9 -1
  125. package/stores/routes/useExecutingRoutesIds.js +3 -1
  126. package/stores/routes/useRouteExecutionStore.js +51 -16
  127. package/stores/routes/useSwapHistory.js +4 -1
  128. package/stores/routes/utils.d.ts +3 -1
  129. package/stores/routes/utils.js +8 -2
  130. package/stores/settings/types.d.ts +6 -6
  131. package/stores/settings/useSettingsStore.d.ts +12 -9
  132. package/stores/settings/useSettingsStore.js +20 -4
  133. package/tsconfig.cjs.tsbuildinfo +1 -1
  134. package/types/events.d.ts +1 -1
  135. package/types/widget.d.ts +13 -8
  136. package/utils/enum.d.ts +1 -0
  137. package/utils/enum.js +1 -0
  138. package/utils/index.d.ts +1 -0
  139. package/utils/index.js +1 -0
  140. package/utils/navigationRoutes.d.ts +1 -1
  141. package/cjs/components/SwapInput/SwapInputAdornment.d.ts +0 -3
  142. package/cjs/providers/WalletProvider/WalletFormUpdate.d.ts +0 -5
  143. package/components/SwapInput/SwapInputAdornment.d.ts +0 -3
  144. package/providers/WalletProvider/WalletFormUpdate.d.ts +0 -5
@@ -39,7 +39,7 @@ export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
39
39
  } | undefined;
40
40
  }, {}, {}>;
41
41
  export declare const DrawerButtonTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
42
- align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
42
+ align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
43
43
  children?: import("react").ReactNode;
44
44
  classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
45
45
  gutterBottom?: boolean | undefined;
package/AppProvider.js CHANGED
@@ -6,7 +6,7 @@ import { queryClient } from './config/queryClient';
6
6
  import { I18nProvider, SDKProvider, SwapFormProvider, TelemetryProvider, ThemeProvider, WalletProvider, WidgetProvider, } from './providers';
7
7
  const QueryProvider = QueryClientProvider;
8
8
  export const AppProvider = ({ children, config, }) => {
9
- return (_jsx(QueryProvider, Object.assign({ client: queryClient }, { children: _jsx(WidgetProvider, Object.assign({ config: config }, { children: _jsx(SDKProvider, { children: _jsx(TelemetryProvider, { children: _jsx(SwapFormProvider, { children: _jsx(ThemeProvider, { children: _jsx(I18nProvider, { children: _jsx(WalletProvider, { children: _jsx(AppRouter, { children: children }) }) }) }) }) }) }) })) })));
9
+ return (_jsx(QueryProvider, Object.assign({ client: queryClient }, { children: _jsx(WidgetProvider, Object.assign({ config: config }, { children: _jsx(SDKProvider, { children: _jsx(TelemetryProvider, { children: _jsx(ThemeProvider, { children: _jsx(I18nProvider, { children: _jsx(WalletProvider, { children: _jsx(SwapFormProvider, { children: _jsx(AppRouter, { children: children }) }) }) }) }) }) }) })) })));
10
10
  };
11
11
  export const AppRouter = ({ children }) => {
12
12
  const inRouterContext = useInRouterContext();
@@ -39,7 +39,7 @@ export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
39
39
  } | undefined;
40
40
  }, {}, {}>;
41
41
  export declare const DrawerButtonTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
42
- align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
42
+ align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
43
43
  children?: import("react").ReactNode;
44
44
  classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
45
45
  gutterBottom?: boolean | undefined;
@@ -9,7 +9,7 @@ const queryClient_1 = require("./config/queryClient");
9
9
  const providers_1 = require("./providers");
10
10
  const QueryProvider = react_query_1.QueryClientProvider;
11
11
  const AppProvider = ({ children, config, }) => {
12
- return ((0, jsx_runtime_1.jsx)(QueryProvider, Object.assign({ client: queryClient_1.queryClient }, { children: (0, jsx_runtime_1.jsx)(providers_1.WidgetProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(providers_1.SDKProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.TelemetryProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.SwapFormProvider, { 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)(exports.AppRouter, { children: children }) }) }) }) }) }) }) })) })));
12
+ return ((0, jsx_runtime_1.jsx)(QueryProvider, Object.assign({ client: queryClient_1.queryClient }, { children: (0, jsx_runtime_1.jsx)(providers_1.WidgetProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(providers_1.SDKProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.TelemetryProvider, { 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)(providers_1.SwapFormProvider, { children: (0, jsx_runtime_1.jsx)(exports.AppRouter, { children: children }) }) }) }) }) }) }) })) })));
13
13
  };
14
14
  exports.AppProvider = AppProvider;
15
15
  const AppRouter = ({ children }) => {
@@ -6,6 +6,7 @@ const icons_material_1 = require("@mui/icons-material");
6
6
  const material_1 = require("@mui/material");
7
7
  const react_router_dom_1 = require("react-router-dom");
8
8
  const hooks_1 = require("../../hooks");
9
+ const stores_1 = require("../../stores");
9
10
  const utils_1 = require("../../utils");
10
11
  const StepTimer_1 = require("../Step/StepTimer");
11
12
  const TokenAvatar_1 = require("../TokenAvatar");
@@ -40,6 +41,6 @@ const ActiveSwapItem = ({ routeId, dense }) => {
40
41
  alignItems: 'center',
41
42
  marginLeft: 2,
42
43
  height: 16,
43
- } }, { children: [route.fromToken.symbol, (0, jsx_runtime_1.jsx)(icons_material_1.ArrowForward, { sx: { paddingX: 0.5 } }), route.toToken.symbol] })), secondary: status !== 'success' ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 400, fontSize: 12, color: "text.secondary", lineHeight: 1, mt: 0.75, ml: 2 }, { children: title }))) : null }), getStatusComponent()] })));
44
+ } }, { children: [route.fromToken.symbol, (0, jsx_runtime_1.jsx)(icons_material_1.ArrowForward, { sx: { paddingX: 0.5 } }), route.toToken.symbol] })), secondary: status !== stores_1.RouteExecutionStatus.Done ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 400, fontSize: 12, color: "text.secondary", lineHeight: 1, mt: 0.75, ml: 2 }, { children: title }))) : null }), getStatusComponent()] })));
44
45
  };
45
46
  exports.ActiveSwapItem = ActiveSwapItem;
@@ -1,6 +1,6 @@
1
1
  import type { DrawerProps } from '@mui/material';
2
2
  import type { RefObject } from 'react';
3
- export declare type BottomSheetProps = DrawerProps & {
3
+ export type BottomSheetProps = DrawerProps & {
4
4
  elementRef?: RefObject<HTMLDivElement>;
5
5
  };
6
6
  export interface BottomSheetBase {
@@ -1,7 +1,7 @@
1
1
  import type { BoxProps, Theme } from '@mui/material';
2
2
  import type { MouseEventHandler } from 'react';
3
- declare type CardVariant = 'default' | 'selected' | 'error';
4
- export declare type CardProps = {
3
+ type CardVariant = 'default' | 'selected' | 'error';
4
+ export type CardProps = {
5
5
  variant?: CardVariant;
6
6
  selectionColor?: 'primary' | 'secondary';
7
7
  dense?: boolean;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const CardTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
3
- align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
3
+ align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
4
4
  children?: import("react").ReactNode;
5
5
  classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
6
6
  gutterBottom?: boolean | undefined;
@@ -13,10 +13,15 @@ const useChainSelect_1 = require("./useChainSelect");
13
13
  const ChainSelect = ({ formType }) => {
14
14
  var _a;
15
15
  const navigate = (0, react_router_dom_1.useNavigate)();
16
- const { chains, getChains, setCurrentChain, isLoading } = (0, useChainSelect_1.useChainSelect)(formType);
16
+ const { chainOrder, chains, getChains, isLoading, setChainOrder, setCurrentChain, } = (0, useChainSelect_1.useChainSelect)(formType);
17
17
  const [chainId] = (0, react_hook_form_1.useWatch)({
18
18
  name: [providers_1.SwapFormKeyHelper.getChainKey(formType)],
19
19
  });
20
+ const hasChainInOrderedList = chainOrder.includes(chainId);
21
+ // If we don't have a chain in the ordered chain list we should add it.
22
+ if (!hasChainInOrderedList) {
23
+ setChainOrder(chainId);
24
+ }
20
25
  const showAllChains = () => {
21
26
  navigate(utils_1.navigationRoutes[`${formType}Chain`]);
22
27
  };
@@ -1,8 +1,10 @@
1
1
  import type { EVMChain } from '@lifi/sdk';
2
2
  import type { SwapFormType } from '../../providers';
3
3
  export declare const useChainSelect: (formType: SwapFormType) => {
4
+ chainOrder: number[];
4
5
  chains: import("@lifi/sdk").ExtendedChain[] | undefined;
5
6
  getChains: () => EVMChain[];
6
- setCurrentChain: (chainId: number) => void;
7
7
  isLoading: boolean;
8
+ setChainOrder: (chainId: number) => void;
9
+ setCurrentChain: (chainId: number) => void;
8
10
  };
@@ -6,10 +6,11 @@ const hooks_1 = require("../../hooks");
6
6
  const providers_1 = require("../../providers");
7
7
  const stores_1 = require("../../stores");
8
8
  const useChainSelect = (formType) => {
9
+ const chainKey = providers_1.SwapFormKeyHelper.getChainKey(formType);
10
+ const { field: { onChange, onBlur }, } = (0, react_hook_form_1.useController)({ name: chainKey });
9
11
  const { setValue } = (0, react_hook_form_1.useFormContext)();
10
12
  const { chains, isLoading } = (0, hooks_1.useChains)();
11
13
  const [chainOrder, setChainOrder] = (0, stores_1.useChainOrder)();
12
- const chainKey = providers_1.SwapFormKeyHelper.getChainKey(formType);
13
14
  const getChains = () => {
14
15
  if (!chains) {
15
16
  return [];
@@ -20,12 +21,20 @@ const useChainSelect = (formType) => {
20
21
  return selectedChains;
21
22
  };
22
23
  const setCurrentChain = (chainId) => {
23
- setValue(chainKey, chainId, { shouldTouch: true });
24
+ onChange(chainId);
25
+ onBlur();
24
26
  setValue(providers_1.SwapFormKeyHelper.getTokenKey(formType), '');
25
27
  setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
26
28
  setValue(providers_1.SwapFormKey.TokenSearchFilter, '');
27
29
  setChainOrder(chainId);
28
30
  };
29
- return { chains, getChains, setCurrentChain, isLoading };
31
+ return {
32
+ chainOrder,
33
+ chains,
34
+ getChains,
35
+ isLoading,
36
+ setChainOrder,
37
+ setCurrentChain,
38
+ };
30
39
  };
31
40
  exports.useChainSelect = useChainSelect;
@@ -8,7 +8,7 @@ export declare const FormControl: import("@emotion/styled").StyledComponent<{
8
8
  fullWidth?: boolean | undefined;
9
9
  focused?: boolean | undefined;
10
10
  hiddenLabel?: boolean | undefined;
11
- margin?: "none" | "normal" | "dense" | undefined;
11
+ margin?: "normal" | "none" | "dense" | undefined;
12
12
  required?: boolean | undefined;
13
13
  size?: "small" | "medium" | undefined;
14
14
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
@@ -44,13 +44,13 @@ const StepActions = (_a) => {
44
44
  };
45
45
  exports.StepActions = StepActions;
46
46
  const StepDetailsContent = ({ step }) => {
47
- var _a, _b, _c, _d, _e;
47
+ var _a, _b, _c, _d, _e, _f, _g, _h;
48
48
  const { t } = (0, react_i18next_1.useTranslation)();
49
49
  return ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ fontSize: 12, fontWeight: "500", color: "text.secondary", alignItems: "center", display: "flex" }, { children: [t('format.number', {
50
50
  value: (0, utils_1.formatTokenAmount)(step.estimate.fromAmount, step.action.fromToken.decimals),
51
51
  }), ' ', step.action.fromToken.symbol, (0, jsx_runtime_1.jsx)(icons_material_1.ArrowForward, { sx: { fontSize: 18, paddingX: 0.5 } }), t('format.number', {
52
52
  value: (0, utils_1.formatTokenAmount)((_b = (_a = step.execution) === null || _a === void 0 ? void 0 : _a.toAmount) !== null && _b !== void 0 ? _b : step.estimate.toAmount, (_e = (_d = (_c = step.execution) === null || _c === void 0 ? void 0 : _c.toToken) === null || _d === void 0 ? void 0 : _d.decimals) !== null && _e !== void 0 ? _e : step.action.toToken.decimals),
53
- }), ' ', step.action.toToken.symbol] })));
53
+ }), ' ', (_h = (_g = (_f = step.execution) === null || _f === void 0 ? void 0 : _f.toToken) === null || _g === void 0 ? void 0 : _g.symbol) !== null && _h !== void 0 ? _h : step.action.toToken.symbol] })));
54
54
  };
55
55
  exports.StepDetailsContent = StepDetailsContent;
56
56
  const CrossStepDetailsLabel = ({ step }) => {
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { SwapFormTypeProps } from '../../providers';
3
+ export declare const FitInputText: import("react").ForwardRefExoticComponent<SwapFormTypeProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FitInputText = void 0;
4
+ const react_1 = require("react");
5
+ const react_hook_form_1 = require("react-hook-form");
6
+ const providers_1 = require("../../providers");
7
+ const utils_1 = require("../../utils");
8
+ const SwapInput_style_1 = require("./SwapInput.style");
9
+ exports.FitInputText = (0, react_1.forwardRef)(({ formType }, ref) => {
10
+ const amountKey = providers_1.SwapFormKeyHelper.getAmountKey(formType);
11
+ const [amount] = (0, react_hook_form_1.useWatch)({
12
+ name: [amountKey],
13
+ });
14
+ (0, react_1.useLayoutEffect)(() => {
15
+ (0, utils_1.fitInputText)(SwapInput_style_1.maxInputFontSize, SwapInput_style_1.minInputFontSize, ref
16
+ .current);
17
+ }, [amount, ref]);
18
+ return null;
19
+ });
@@ -1,5 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { SwapFormTypeProps } from '../../providers';
3
- export declare const FormPriceHelperText: React.FC<SwapFormTypeProps & {
4
- selected: boolean;
5
- }>;
3
+ export declare const FormPriceHelperText: React.FC<SwapFormTypeProps>;
@@ -8,7 +8,7 @@ const react_i18next_1 = require("react-i18next");
8
8
  const hooks_1 = require("../../hooks");
9
9
  const providers_1 = require("../../providers");
10
10
  const utils_1 = require("../../utils");
11
- const FormPriceHelperText = ({ formType, selected }) => {
11
+ const FormPriceHelperText = ({ formType, }) => {
12
12
  const { t } = (0, react_i18next_1.useTranslation)();
13
13
  const [amount, chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
14
14
  name: [
@@ -5,49 +5,37 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const react_hook_form_1 = require("react-hook-form");
7
7
  const react_i18next_1 = require("react-i18next");
8
- const hooks_1 = require("../../hooks");
9
8
  const providers_1 = require("../../providers");
10
9
  const types_1 = require("../../types");
11
10
  const utils_1 = require("../../utils");
12
11
  const Card_1 = require("../Card");
13
- const TokenAvatar_1 = require("../TokenAvatar");
12
+ const FitInputText_1 = require("./FitInputText");
14
13
  const FormPriceHelperText_1 = require("./FormPriceHelperText");
15
14
  const SwapInput_style_1 = require("./SwapInput.style");
16
- const SwapInputAdornment_1 = require("./SwapInputAdornment");
15
+ const SwapInputEndAdornment_1 = require("./SwapInputEndAdornment");
16
+ const SwapInputStartAdornment_1 = require("./SwapInputStartAdornment");
17
17
  const SwapInput = ({ formType }) => {
18
18
  const { t } = (0, react_i18next_1.useTranslation)();
19
- const { setValue } = (0, react_hook_form_1.useFormContext)();
20
- const { disabledUI } = (0, providers_1.useWidgetConfig)();
21
- const ref = (0, react_1.useRef)(null);
22
19
  const amountKey = providers_1.SwapFormKeyHelper.getAmountKey(formType);
23
- const [amount, chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
24
- name: [
25
- amountKey,
26
- providers_1.SwapFormKeyHelper.getChainKey(formType),
27
- providers_1.SwapFormKeyHelper.getTokenKey(formType),
28
- ],
20
+ const { field: { onChange, onBlur, value }, } = (0, react_hook_form_1.useController)({
21
+ name: amountKey,
29
22
  });
30
- const { chain } = (0, hooks_1.useChain)(chainId);
31
- const { token } = (0, hooks_1.useToken)(chainId, tokenAddress);
32
- const isSelected = !!(chain && token);
23
+ const { disabledUI } = (0, providers_1.useWidgetConfig)();
24
+ const ref = (0, react_1.useRef)(null);
33
25
  const handleChange = (event) => {
34
26
  const { value } = event.target;
35
27
  const formattedAmount = (0, utils_1.formatAmount)(value, true);
36
- setValue(amountKey, formattedAmount, {
37
- shouldTouch: true,
38
- });
28
+ onChange(formattedAmount);
39
29
  };
40
30
  const handleBlur = (event) => {
41
31
  const { value } = event.target;
42
32
  const formattedAmount = (0, utils_1.formatAmount)(value);
43
- setValue(amountKey, formattedAmount);
33
+ onChange(formattedAmount);
34
+ onBlur();
44
35
  };
45
- (0, react_1.useLayoutEffect)(() => {
46
- (0, utils_1.fitInputText)(SwapInput_style_1.maxInputFontSize, SwapInput_style_1.minInputFontSize, ref.current);
47
- }, [amount]);
48
36
  const disabled = disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.FromAmount);
49
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.fromAmount') }), (0, jsx_runtime_1.jsxs)(SwapInput_style_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(SwapInput_style_1.Input, { inputRef: ref, size: "small", autoComplete: "off", placeholder: "0", startAdornment: isSelected ? ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: token, chain: chain, sx: { marginLeft: 2 } })) : ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatarSkeleton, { sx: { marginLeft: 2 } })), endAdornment: !disabled ? (0, jsx_runtime_1.jsx)(SwapInputAdornment_1.SwapInputAdornment, { formType: formType }) : undefined, inputProps: {
37
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.fromAmount') }), (0, jsx_runtime_1.jsxs)(SwapInput_style_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(SwapInput_style_1.Input, { inputRef: ref, size: "small", autoComplete: "off", placeholder: "0", startAdornment: (0, jsx_runtime_1.jsx)(SwapInputStartAdornment_1.SwapInputStartAdornment, { formType: formType }), endAdornment: !disabled ? ((0, jsx_runtime_1.jsx)(SwapInputEndAdornment_1.SwapInputEndAdornment, { formType: formType })) : undefined, inputProps: {
50
38
  inputMode: 'decimal',
51
- }, onChange: handleChange, onBlur: handleBlur, value: amount, name: amountKey, disabled: disabled, required: true }), (0, jsx_runtime_1.jsx)(FormPriceHelperText_1.FormPriceHelperText, { selected: isSelected, formType: formType })] }))] }));
39
+ }, onChange: handleChange, onBlur: handleBlur, value: value, name: amountKey, disabled: disabled, required: true }), (0, jsx_runtime_1.jsx)(FormPriceHelperText_1.FormPriceHelperText, { formType: formType })] })), (0, jsx_runtime_1.jsx)(FitInputText_1.FitInputText, { ref: ref, formType: formType })] }));
52
40
  };
53
41
  exports.SwapInput = SwapInput;
@@ -10,7 +10,7 @@ export declare const FormControl: import("@emotion/styled").StyledComponent<{
10
10
  fullWidth?: boolean | undefined;
11
11
  focused?: boolean | undefined;
12
12
  hiddenLabel?: boolean | undefined;
13
- margin?: "none" | "normal" | "dense" | undefined;
13
+ margin?: "normal" | "none" | "dense" | undefined;
14
14
  required?: boolean | undefined;
15
15
  size?: "small" | "medium" | undefined;
16
16
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { SwapFormTypeProps } from '../../providers';
3
+ export declare const SwapInputEndAdornment: ({ formType }: SwapFormTypeProps) => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwapInputAdornment = void 0;
3
+ exports.SwapInputEndAdornment = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const react_hook_form_1 = require("react-hook-form");
@@ -8,7 +8,7 @@ const react_i18next_1 = require("react-i18next");
8
8
  const hooks_1 = require("../../hooks");
9
9
  const providers_1 = require("../../providers");
10
10
  const SwapInputAdornment_style_1 = require("./SwapInputAdornment.style");
11
- const SwapInputAdornment = ({ formType }) => {
11
+ const SwapInputEndAdornment = ({ formType }) => {
12
12
  const { t } = (0, react_i18next_1.useTranslation)();
13
13
  const { setValue } = (0, react_hook_form_1.useFormContext)();
14
14
  const [chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
@@ -26,4 +26,4 @@ const SwapInputAdornment = ({ formType }) => {
26
26
  };
27
27
  return ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ 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 === null || token === void 0 ? void 0 : token.amount) ? ((0, jsx_runtime_1.jsx)(SwapInputAdornment_style_1.Button, Object.assign({ onClick: handleMax }, { children: t('button.max') }))) : null })));
28
28
  };
29
- exports.SwapInputAdornment = SwapInputAdornment;
29
+ exports.SwapInputEndAdornment = SwapInputEndAdornment;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { SwapFormTypeProps } from '../../providers';
3
+ export declare const SwapInputStartAdornment: React.FC<SwapFormTypeProps>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SwapInputStartAdornment = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_hook_form_1 = require("react-hook-form");
6
+ const hooks_1 = require("../../hooks");
7
+ const providers_1 = require("../../providers");
8
+ const TokenAvatar_1 = require("../TokenAvatar");
9
+ const SwapInputStartAdornment = ({ formType, }) => {
10
+ const [chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
11
+ name: [
12
+ providers_1.SwapFormKeyHelper.getChainKey(formType),
13
+ providers_1.SwapFormKeyHelper.getTokenKey(formType),
14
+ ],
15
+ });
16
+ const { chain } = (0, hooks_1.useChain)(chainId);
17
+ const { token } = (0, hooks_1.useToken)(chainId, tokenAddress);
18
+ const isSelected = !!(chain && token);
19
+ return isSelected ? ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: token, chain: chain, sx: { marginLeft: 2 } })) : ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatarSkeleton, { sx: { marginLeft: 2 } }));
20
+ };
21
+ exports.SwapInputStartAdornment = SwapInputStartAdornment;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
3
- align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
3
+ align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
4
4
  children?: import("react").ReactNode;
5
5
  classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
6
6
  gutterBottom?: boolean | undefined;
@@ -34,7 +34,7 @@ export declare const Header: import("@emotion/styled").StyledComponent<import("@
34
34
  export declare const Stack: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
35
35
  ref?: import("react").Ref<unknown> | undefined;
36
36
  children?: import("react").ReactNode;
37
- direction?: import("@mui/system").ResponsiveStyleValue<"row" | "column" | "column-reverse" | "row-reverse"> | undefined;
37
+ direction?: import("@mui/system").ResponsiveStyleValue<"column" | "column-reverse" | "row" | "row-reverse"> | undefined;
38
38
  spacing?: import("@mui/system").ResponsiveStyleValue<string | number> | undefined;
39
39
  divider?: import("react").ReactNode;
40
40
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
@@ -10,7 +10,7 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
10
10
  connected?: boolean | undefined;
11
11
  }, {}, {}>;
12
12
  export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
13
- align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
13
+ align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
14
14
  children?: import("react").ReactNode;
15
15
  classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
16
16
  gutterBottom?: boolean | undefined;
@@ -5,17 +5,13 @@ const react_1 = require("react");
5
5
  const react_hook_form_1 = require("react-hook-form");
6
6
  const providers_1 = require("../../providers");
7
7
  const useTokenSelect = (formType, onClick) => {
8
+ const tokenKey = providers_1.SwapFormKeyHelper.getTokenKey(formType);
9
+ const { field: { onChange, onBlur }, } = (0, react_hook_form_1.useController)({ name: tokenKey });
8
10
  const { setValue, getValues } = (0, react_hook_form_1.useFormContext)();
9
11
  return (0, react_1.useCallback)((tokenAddress, chainId) => {
12
+ onChange(tokenAddress);
13
+ onBlur();
10
14
  const selectedChainId = chainId !== null && chainId !== void 0 ? chainId : getValues(providers_1.SwapFormKeyHelper.getChainKey(formType));
11
- setValue(providers_1.SwapFormKeyHelper.getTokenKey(formType), tokenAddress, {
12
- shouldTouch: true,
13
- });
14
- // Set chain again to trigger URL builder update
15
- setValue(providers_1.SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
16
- shouldTouch: true,
17
- });
18
- setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
19
15
  const oppositeFormType = formType === 'from' ? 'to' : 'from';
20
16
  const [selectedOppositeToken, selectedOppositeChainId] = getValues([
21
17
  providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType),
@@ -24,10 +20,17 @@ const useTokenSelect = (formType, onClick) => {
24
20
  if (selectedOppositeToken === tokenAddress &&
25
21
  selectedOppositeChainId === selectedChainId) {
26
22
  setValue(providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType), '', {
23
+ shouldDirty: true,
27
24
  shouldTouch: true,
28
25
  });
29
26
  }
27
+ // Set chain again to trigger URL builder update
28
+ setValue(providers_1.SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
29
+ shouldDirty: true,
30
+ shouldTouch: true,
31
+ });
32
+ setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
30
33
  onClick === null || onClick === void 0 ? void 0 : onClick();
31
- }, [formType, getValues, onClick, setValue]);
34
+ }, [formType, getValues, onBlur, onChange, onClick, setValue]);
32
35
  };
33
36
  exports.useTokenSelect = useTokenSelect;
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.23.1";
2
+ export declare const version = "1.25.0";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/widget';
5
- exports.version = '1.23.1';
5
+ exports.version = '1.25.0';
@@ -78,7 +78,7 @@ const useGasSufficiency = (route) => {
78
78
  });
79
79
  const { data: insufficientFunds, isInitialLoading: insufficientFundsLoading, } = (0, react_query_1.useQuery)(['funds-sufficiency-check', account.address, route === null || route === void 0 ? void 0 : route.id], () => __awaiter(void 0, void 0, void 0, function* () {
80
80
  var _c, _d, _e, _f;
81
- if (!account.address || !fromToken || !route || (0, stores_1.isRouteCompleted)(route)) {
81
+ if (!account.address || !fromToken || !route || (0, stores_1.isRouteDone)(route)) {
82
82
  return null;
83
83
  }
84
84
  let currentTokenBalance = (0, big_js_1.default)((_c = fromToken === null || fromToken === void 0 ? void 0 : fromToken.amount) !== null && _c !== void 0 ? _c : 0);
@@ -39,7 +39,7 @@ const useRouteExecution = (routeId, executeInBackground) => {
39
39
  process,
40
40
  });
41
41
  }
42
- if ((0, stores_1.isRouteCompleted)(clonedUpdatedRoute)) {
42
+ if ((0, stores_1.isRouteDone)(clonedUpdatedRoute)) {
43
43
  emitter.emit(events_1.WidgetEvent.RouteExecutionCompleted, clonedUpdatedRoute);
44
44
  }
45
45
  if ((0, stores_1.isRouteFailed)(clonedUpdatedRoute) && process) {
@@ -19,9 +19,9 @@ const providers_1 = require("../providers");
19
19
  const stores_1 = require("../stores");
20
20
  const refetchTime = 60000;
21
21
  const useSwapRoutes = () => {
22
- var _a;
22
+ var _a, _b;
23
23
  const lifi = (0, providers_1.useLiFi)();
24
- const { variant } = (0, providers_1.useWidgetConfig)();
24
+ const { variant, sdkConfig } = (0, providers_1.useWidgetConfig)();
25
25
  const { account, provider } = (0, providers_1.useWallet)();
26
26
  const queryClient = (0, react_query_1.useQueryClient)();
27
27
  const { slippage, enabledBridges, enabledExchanges, routePriority } = (0, stores_1.useSettings)([
@@ -65,22 +65,25 @@ const useSwapRoutes = () => {
65
65
  enabledExchanges,
66
66
  routePriority,
67
67
  variant,
68
+ (_a = sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.defaultRouteOptions) === null || _a === void 0 ? void 0 : _a.allowSwitchChain,
68
69
  ];
69
- const previousDataUpdatedAt = (_a = queryClient.getQueryState(queryKey)) === null || _a === void 0 ? void 0 : _a.dataUpdatedAt;
70
+ const previousDataUpdatedAt = (_b = queryClient.getQueryState(queryKey)) === null || _b === void 0 ? void 0 : _b.dataUpdatedAt;
70
71
  const refetchInterval = previousDataUpdatedAt
71
72
  ? Math.min(Math.abs(refetchTime - (Date.now() - previousDataUpdatedAt)), refetchTime)
72
73
  : refetchTime;
73
- const { data, isLoading, isFetching, isFetched, dataUpdatedAt, refetch } = (0, react_query_1.useQuery)(queryKey, ({ queryKey: [_, fromAddress, fromChainId, fromTokenAddress, fromTokenAmount, toChainId, toTokenAddress, toAddress, slippage, enabledBridges, enabledExchanges, routePriority, variant,], signal, }) => __awaiter(void 0, void 0, void 0, function* () {
74
- var _b, _c;
74
+ const { data, isLoading, isFetching, isFetched, dataUpdatedAt, refetch } = (0, react_query_1.useQuery)(queryKey, ({ queryKey: [_, fromAddress, fromChainId, fromTokenAddress, fromTokenAmount, toChainId, toTokenAddress, toAddress, slippage, enabledBridges, enabledExchanges, routePriority, variant, allowSwitchChain,], signal, }) => __awaiter(void 0, void 0, void 0, function* () {
75
+ var _c, _d;
75
76
  let toWalletAddress;
76
77
  try {
77
78
  toWalletAddress =
78
- (_b = (yield (provider === null || provider === void 0 ? void 0 : provider.resolveName(toAddress)))) !== null && _b !== void 0 ? _b : ((0, address_1.isAddress)(toAddress) ? toAddress : fromAddress);
79
+ (_c = (yield (provider === null || provider === void 0 ? void 0 : provider.resolveName(toAddress)))) !== null && _c !== void 0 ? _c : ((0, address_1.isAddress)(toAddress) ? toAddress : fromAddress);
79
80
  }
80
- catch (_d) {
81
+ catch (_e) {
81
82
  toWalletAddress = (0, address_1.isAddress)(toAddress) ? toAddress : fromAddress;
82
83
  }
83
- const fromAmount = (0, big_js_1.default)(Number(fromTokenAmount) * Math.pow(10, ((_c = fromToken === null || fromToken === void 0 ? void 0 : fromToken.decimals) !== null && _c !== void 0 ? _c : 0))).toString();
84
+ const fromAmount = (0, big_js_1.default)(fromTokenAmount)
85
+ .mul(Math.pow(10, ((_d = fromToken === null || fromToken === void 0 ? void 0 : fromToken.decimals) !== null && _d !== void 0 ? _d : 0)))
86
+ .toString();
84
87
  const formattedSlippage = parseFloat(slippage) / 100;
85
88
  return lifi.getRoutes({
86
89
  fromChainId,
@@ -99,7 +102,7 @@ const useSwapRoutes = () => {
99
102
  allow: enabledExchanges,
100
103
  },
101
104
  order: routePriority,
102
- allowSwitchChain: variant !== 'refuel',
105
+ allowSwitchChain: variant === 'refuel' ? false : allowSwitchChain,
103
106
  },
104
107
  }, { signal });
105
108
  }), {
@@ -5,10 +5,12 @@ exports.useTelemetry = void 0;
5
5
  const react_1 = require("react");
6
6
  const sentry_1 = require("../config/sentry");
7
7
  const version_1 = require("../config/version");
8
+ let warningLogged = false;
8
9
  const useTelemetry = (disabled) => {
9
10
  (0, react_1.useEffect)(() => {
10
11
  if (disabled) {
11
- if (process.env.NODE_ENV === 'development') {
12
+ if (process.env.NODE_ENV === 'development' && !warningLogged) {
13
+ warningLogged = true;
12
14
  console.warn(`[${version_1.name}] Enable crash reports and diagnostic data to be collected. This helps us to better understand how the widget is performing and where improvements need to be made.`);
13
15
  }
14
16
  }
@@ -1,9 +1,12 @@
1
1
  import type { Bridge, Exchange } from '@lifi/sdk';
2
- declare type FormattedTool<T, K extends keyof T> = Record<string, Pick<T, K>>;
2
+ interface WidgetBridge extends Omit<Bridge, 'key'> {
3
+ key: string;
4
+ }
5
+ type FormattedTool<T, K extends keyof T> = Record<string, Pick<T, K>>;
3
6
  export declare const useTools: () => {
4
7
  tools: import("@lifi/sdk").ToolsResponse | undefined;
5
8
  formattedTools: {
6
- bridges: FormattedTool<Bridge, "key" | "name" | "logoURI"> | undefined;
9
+ bridges: FormattedTool<WidgetBridge, "key" | "name" | "logoURI"> | undefined;
7
10
  exchanges: FormattedTool<Exchange, "key" | "name" | "logoURI"> | undefined;
8
11
  };
9
12
  };
package/cjs/i18n/en.json CHANGED
@@ -148,10 +148,12 @@
148
148
  "stepSwapAndBridge": "Swap and bridge",
149
149
  "success": {
150
150
  "message": {
151
- "swapSuccessful": "There are now {{amount, number(maximumFractionDigits: 4)}} {{tokenSymbol}} in wallet {{walletAddress}} on {{chainName}} chain."
151
+ "swapPartiallySuccessful": "We've tried to complete the swap, but {{tool}} ran out of liquidity for {{tokenSymbol}} token.",
152
+ "swapSuccessful": "There are now {{amount, number(maximumFractionDigits: 4)}} {{tokenSymbol}} in {{walletAddress}} wallet on {{chainName}} chain."
152
153
  },
153
154
  "title": {
154
155
  "gasSwapSuccessful": "Gas swap successful",
156
+ "swapPartiallySuccessful": "Swap partially successful",
155
157
  "swapSuccessful": "Swap successful"
156
158
  }
157
159
  },