@lifi/widget 1.32.4 → 1.32.5

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 (94) hide show
  1. package/AppDrawer.js +2 -1
  2. package/cjs/AppDrawer.js +3 -2
  3. package/cjs/components/ActiveSwaps/ActiveSwapItem.js +6 -4
  4. package/cjs/components/ChainSelect/useChainSelect.js +1 -1
  5. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +2 -2
  6. package/cjs/components/Header/NavigationHeader.js +5 -3
  7. package/cjs/components/Header/WalletHeader.js +8 -4
  8. package/cjs/components/NotFound.js +2 -2
  9. package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +3 -2
  10. package/cjs/components/SendToWallet/SendToWalletButton.js +2 -2
  11. package/cjs/components/Step/CircularProgress.js +8 -5
  12. package/cjs/components/Step/DestinationWalletAddress.js +4 -3
  13. package/cjs/components/Step/GasStepProcess.js +2 -2
  14. package/cjs/components/Step/StepProcess.js +2 -2
  15. package/cjs/components/StepActions/StepActions.js +2 -2
  16. package/cjs/components/SwapRouteCard/SwapRouteCard.js +8 -4
  17. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.js +2 -2
  18. package/cjs/components/SwapRoutes/SwapRoutes.js +2 -2
  19. package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +1 -2
  20. package/cjs/components/TokenList/TokenNotFound.js +2 -2
  21. package/cjs/config/version.d.ts +1 -1
  22. package/cjs/config/version.js +1 -1
  23. package/cjs/hooks/useRouteExecution.js +1 -1
  24. package/cjs/hooks/useSwapRoutes.d.ts +2 -4
  25. package/cjs/hooks/useSwapRoutes.js +19 -0
  26. package/cjs/hooks/useTokenAddressBalance.js +1 -0
  27. package/cjs/hooks/useTokenBalance.js +7 -10
  28. package/cjs/hooks/useTokenBalances.js +0 -1
  29. package/cjs/hooks/useTokenSearch.js +6 -4
  30. package/cjs/i18n/index.js +0 -1
  31. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +2 -2
  32. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +2 -3
  33. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +6 -3
  34. package/cjs/pages/SelectTokenPage/SearchTokenInput.js +2 -2
  35. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +4 -2
  36. package/cjs/pages/SettingsPage/EnabledToolsButton.js +3 -3
  37. package/cjs/pages/SettingsPage/GasPriceSelect.js +2 -2
  38. package/cjs/pages/SettingsPage/LanguageSelect.js +2 -2
  39. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +2 -2
  40. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +4 -3
  41. package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.js +2 -2
  42. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -3
  43. package/cjs/pages/SwapPage/ExchangeRateBottomSheet.js +2 -2
  44. package/cjs/pages/SwapPage/StatusBottomSheet.js +6 -4
  45. package/cjs/pages/SwapPage/SwapPage.js +2 -2
  46. package/cjs/pages/SwapPage/TokenValueBottomSheet.js +2 -2
  47. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -2
  48. package/components/ActiveSwaps/ActiveSwapItem.js +5 -3
  49. package/components/ChainSelect/useChainSelect.js +1 -1
  50. package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +2 -2
  51. package/components/Header/NavigationHeader.js +5 -3
  52. package/components/Header/WalletHeader.js +6 -2
  53. package/components/NotFound.js +1 -1
  54. package/components/ReverseTokensButton/ReverseTokensButton.js +2 -1
  55. package/components/SendToWallet/SendToWalletButton.js +1 -1
  56. package/components/Step/CircularProgress.js +8 -5
  57. package/components/Step/DestinationWalletAddress.js +3 -2
  58. package/components/Step/GasStepProcess.js +2 -2
  59. package/components/Step/StepProcess.js +2 -2
  60. package/components/StepActions/StepActions.js +1 -1
  61. package/components/SwapRouteCard/SwapRouteCard.js +7 -3
  62. package/components/SwapRouteCard/SwapRouteNotFoundCard.js +1 -1
  63. package/components/SwapRoutes/SwapRoutes.js +1 -1
  64. package/components/SwapRoutes/SwapRoutes.style.d.ts +1 -2
  65. package/components/TokenList/TokenNotFound.js +1 -1
  66. package/config/version.d.ts +1 -1
  67. package/config/version.js +1 -1
  68. package/hooks/useRouteExecution.js +1 -1
  69. package/hooks/useSwapRoutes.d.ts +2 -4
  70. package/hooks/useSwapRoutes.js +19 -0
  71. package/hooks/useTokenAddressBalance.js +1 -0
  72. package/hooks/useTokenBalance.js +7 -10
  73. package/hooks/useTokenBalances.js +0 -1
  74. package/hooks/useTokenSearch.js +6 -4
  75. package/i18n/index.js +0 -1
  76. package/package.json +8 -8
  77. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +1 -1
  78. package/pages/ActiveSwapsPage/ActiveSwapsPage.js +2 -3
  79. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +6 -3
  80. package/pages/SelectTokenPage/SearchTokenInput.js +1 -1
  81. package/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -1
  82. package/pages/SettingsPage/EnabledToolsButton.js +2 -2
  83. package/pages/SettingsPage/GasPriceSelect.js +1 -1
  84. package/pages/SettingsPage/LanguageSelect.js +1 -1
  85. package/pages/SettingsPage/RoutePrioritySelect.js +1 -1
  86. package/pages/SwapDetailsPage/SwapDetailsPage.js +3 -2
  87. package/pages/SwapHistoryPage/SwapHistoryEmpty.js +2 -2
  88. package/pages/SwapHistoryPage/SwapHistoryPage.js +2 -3
  89. package/pages/SwapPage/ExchangeRateBottomSheet.js +2 -2
  90. package/pages/SwapPage/StatusBottomSheet.js +6 -4
  91. package/pages/SwapPage/SwapPage.js +1 -1
  92. package/pages/SwapPage/TokenValueBottomSheet.js +2 -2
  93. package/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -2
  94. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { EvStationOutlined as EvStationIcon } from '@mui/icons-material';
2
+ import EvStationOutlinedIcon from '@mui/icons-material/EvStationOutlined';
3
3
  import { Box, Typography } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { CircularIcon } from './CircularProgress.style';
@@ -9,7 +9,7 @@ export const GasStepProcess = ({ step }) => {
9
9
  return (_jsx(Box, { px: 2, py: 1, children: _jsxs(Box, { sx: {
10
10
  display: 'flex',
11
11
  alignItems: 'center',
12
- }, children: [_jsx(CircularIcon, { status: isDone ? 'DONE' : 'NOT_STARTED', children: _jsx(EvStationIcon, { color: isDone ? 'success' : 'inherit', sx: {
12
+ }, children: [_jsx(CircularIcon, { status: isDone ? 'DONE' : 'NOT_STARTED', children: _jsx(EvStationOutlinedIcon, { color: isDone ? 'success' : 'inherit', sx: {
13
13
  position: 'absolute',
14
14
  fontSize: '1rem',
15
15
  } }) }), _jsxs(Typography, { ml: 2, fontSize: 14, fontWeight: 400, children: [t('format.currency', {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { LinkRounded as LinkIcon } from '@mui/icons-material';
2
+ import LinkRoundedIcon from '@mui/icons-material/LinkRounded';
3
3
  import { Box, Link, Typography } from '@mui/material';
4
4
  import { useProcessMessage } from '../../hooks';
5
5
  import { CircularProgress } from './CircularProgress';
@@ -13,5 +13,5 @@ export const StepProcess = ({ step, process }) => {
13
13
  display: 'flex',
14
14
  flex: 1,
15
15
  justifyContent: 'flex-end',
16
- }, children: _jsx(LinkButton, { size: "small", edge: "end", LinkComponent: Link, href: process.txLink, target: "_blank", rel: "nofollow noreferrer", children: _jsx(LinkIcon, {}) }) })) : null] }), message ? (_jsx(Typography, { ml: 6, fontSize: 14, fontWeight: 500, color: "text.secondary", children: message })) : null] }));
16
+ }, children: _jsx(LinkButton, { size: "small", edge: "end", LinkComponent: Link, href: process.txLink, target: "_blank", rel: "nofollow noreferrer", children: _jsx(LinkRoundedIcon, {}) }) })) : null] }), message ? (_jsx(Typography, { ml: 6, fontSize: 14, fontWeight: 500, color: "text.secondary", children: message })) : null] }));
17
17
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ArrowForward as ArrowForwardIcon } from '@mui/icons-material';
2
+ import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
3
3
  import { Box, Step as MuiStep, Stepper, Typography } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useChains } from '../../hooks';
@@ -1,5 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { AccessTime as AccessTimeIcon, EvStationOutlined as EvStationIcon, ExpandLess as ExpandLessIcon, ExpandMore as ExpandMoreIcon, LayersOutlined as LayersIcon, } from '@mui/icons-material';
2
+ import AccessTimeIcon from '@mui/icons-material/AccessTime';
3
+ import EvStationOutlinedIcon from '@mui/icons-material/EvStationOutlined';
4
+ import ExpandLessIcon from '@mui/icons-material/ExpandLess';
5
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
6
+ import LayersOutlinedIcon from '@mui/icons-material/LayersOutlined';
3
7
  import { Box, Collapse, Tooltip, Typography } from '@mui/material';
4
8
  import { useState } from 'react';
5
9
  import { useTranslation } from 'react-i18next';
@@ -34,7 +38,7 @@ export const SwapRouteCardEssentials = ({ route, dense }) => {
34
38
  .reduce((duration, x) => duration + x, 0) / 60);
35
39
  const gasCostUSD = parseFloat(route.gasCostUSD ?? '') || 0.01;
36
40
  const gasCosts = getGasCostsBreakdown(route);
37
- return (_jsxs(Box, { display: "flex", justifyContent: dense ? 'space-between' : 'flex-end', flex: 1, pl: dense ? 0 : 2, mt: dense ? 2 : 0, children: [_jsx(Tooltip, { title: _jsxs(Box, { component: "span", children: [t(`tooltip.estimatedNetworkFee`), gasCosts.map((gas) => (_jsxs(Typography, { fontSize: 11, children: [gas.amount?.toFixed(6), " ", gas.token.symbol, " (", t(`format.currency`, { value: gas.amountUSD }), ")"] }, `${gas.token.address}${gas.token.symbol}`)))] }), placement: "top", enterDelay: 400, arrow: true, children: _jsxs(Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [_jsx(Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: _jsx(EvStationIcon, { fontSize: dense ? 'medium' : 'small' }) }), _jsx(Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t(`format.currency`, { value: gasCostUSD }) })] }) }), _jsx(Tooltip, { title: t(`tooltip.estimatedTime`), placement: "top", enterDelay: 400, arrow: true, children: _jsxs(Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [_jsx(Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: _jsx(AccessTimeIcon, { fontSize: dense ? 'medium' : 'small' }) }), _jsx(Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t('swap.estimatedTime', {
41
+ return (_jsxs(Box, { display: "flex", justifyContent: dense ? 'space-between' : 'flex-end', flex: 1, pl: dense ? 0 : 2, mt: dense ? 2 : 0, children: [_jsx(Tooltip, { title: _jsxs(Box, { component: "span", children: [t(`tooltip.estimatedNetworkFee`), gasCosts.map((gas) => (_jsxs(Typography, { fontSize: 11, children: [gas.amount?.toFixed(6), " ", gas.token.symbol, " (", t(`format.currency`, { value: gas.amountUSD }), ")"] }, `${gas.token.address}${gas.token.symbol}`)))] }), placement: "top", enterDelay: 400, arrow: true, children: _jsxs(Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [_jsx(Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: _jsx(EvStationOutlinedIcon, { fontSize: dense ? 'medium' : 'small' }) }), _jsx(Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t(`format.currency`, { value: gasCostUSD }) })] }) }), _jsx(Tooltip, { title: t(`tooltip.estimatedTime`), placement: "top", enterDelay: 400, arrow: true, children: _jsxs(Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [_jsx(Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: _jsx(AccessTimeIcon, { fontSize: dense ? 'medium' : 'small' }) }), _jsx(Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t('swap.estimatedTime', {
38
42
  value: executionTimeMinutes,
39
- }) })] }) }), !dense ? (_jsx(Tooltip, { title: t(`tooltip.numberOfSteps`), placement: "top", enterDelay: 400, arrow: true, children: _jsxs(Box, { display: "flex", alignItems: "center", children: [_jsx(Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: _jsx(LayersIcon, { fontSize: dense ? 'medium' : 'small' }) }), _jsx(Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: route.steps.length })] }) })) : null] }));
43
+ }) })] }) }), !dense ? (_jsx(Tooltip, { title: t(`tooltip.numberOfSteps`), placement: "top", enterDelay: 400, arrow: true, children: _jsxs(Box, { display: "flex", alignItems: "center", children: [_jsx(Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: _jsx(LayersOutlinedIcon, { fontSize: dense ? 'medium' : 'small' }) }), _jsx(Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: route.steps.length })] }) })) : null] }));
40
44
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Route as RouteIcon } from '@mui/icons-material';
2
+ import RouteIcon from '@mui/icons-material/Route';
3
3
  import { Box, Typography } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  export const SwapRouteNotFoundCard = () => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { KeyboardArrowRight as KeyboardArrowRightIcon } from '@mui/icons-material';
2
+ import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
3
3
  import { Box, IconButton } from '@mui/material';
4
4
  import { useFormState } from 'react-hook-form';
5
5
  import { useTranslation } from 'react-i18next';
@@ -32,7 +32,6 @@ export declare const Header: import("@emotion/styled").StyledComponent<import("@
32
32
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
33
33
  }, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
34
34
  export declare const Stack: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
35
- ref?: import("react").Ref<unknown> | undefined;
36
35
  children?: import("react").ReactNode;
37
36
  direction?: import("@mui/system").ResponsiveStyleValue<"column" | "column-reverse" | "row" | "row-reverse"> | undefined;
38
37
  spacing?: import("@mui/system").ResponsiveStyleValue<string | number> | undefined;
@@ -40,4 +39,4 @@ export declare const Stack: import("@emotion/styled").StyledComponent<import("@m
40
39
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
41
40
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
42
41
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
43
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | "direction" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "divider" | "spacing"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
42
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "direction" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "divider" | "spacing"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { SearchOff as SearchOffIcon } from '@mui/icons-material';
2
+ import SearchOffIcon from '@mui/icons-material/SearchOff';
3
3
  import { Box, Typography } from '@mui/material';
4
4
  import { useWatch } from 'react-hook-form';
5
5
  import { useTranslation } from 'react-i18next';
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.32.4";
2
+ export declare const version = "1.32.5";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '1.32.4';
2
+ export const version = '1.32.5';
@@ -66,7 +66,7 @@ export const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchan
66
66
  if (!routeExecution?.route) {
67
67
  throw Error('Execution route not found.');
68
68
  }
69
- queryClient.removeQueries(['routes']);
69
+ queryClient.removeQueries(['routes'], { exact: false });
70
70
  return lifi.executeRoute(account.signer, routeExecution.route, {
71
71
  updateCallback,
72
72
  switchChainHook,
@@ -1,4 +1,4 @@
1
- import type { Route } from '@lifi/sdk';
1
+ import type { Route, RoutesResponse } from '@lifi/sdk';
2
2
  export declare const useSwapRoutes: () => {
3
3
  routes: Route[] | undefined;
4
4
  isLoading: boolean;
@@ -6,7 +6,5 @@ export declare const useSwapRoutes: () => {
6
6
  isFetched: boolean;
7
7
  dataUpdatedAt: number;
8
8
  refetchTime: number;
9
- refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@lifi/sdk").RoutesResponse | {
10
- routes: Route[];
11
- }, any>>;
9
+ refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<RoutesResponse, any>>;
12
10
  };
@@ -151,6 +151,25 @@ export const useSwapRoutes = () => {
151
151
  }
152
152
  return true;
153
153
  },
154
+ onSuccess(data) {
155
+ if (data.routes[0]) {
156
+ // Update local tokens cache to keep priceUSD in sync
157
+ const { fromToken, toToken } = data.routes[0];
158
+ [fromToken, toToken].forEach((token) => {
159
+ queryClient.setQueriesData(['token-balances', account.address, token.chainId], (data) => {
160
+ if (data) {
161
+ const clonedData = [...data];
162
+ const index = clonedData.findIndex((dataToken) => dataToken.address === token.address);
163
+ clonedData[index] = {
164
+ ...clonedData[index],
165
+ ...token,
166
+ };
167
+ return clonedData;
168
+ }
169
+ });
170
+ });
171
+ }
172
+ },
154
173
  });
155
174
  return {
156
175
  routes: data?.routes,
@@ -3,6 +3,7 @@ import { useTokenBalances } from './useTokenBalances';
3
3
  export const useTokenAddressBalance = (chainId, tokenAddress) => {
4
4
  const { tokens, tokensWithBalance, isBalanceLoading, refetch } = useTokenBalances(chainId);
5
5
  const token = useMemo(() => {
6
+ console.log('useTokenAddressBalance');
6
7
  const token = (tokensWithBalance ?? tokens)?.find((token) => token.address === tokenAddress && token.chainId === chainId);
7
8
  return token;
8
9
  }, [chainId, tokenAddress, tokens, tokensWithBalance]);
@@ -51,15 +51,16 @@ export const useTokenBalance = (token, accountAddress) => {
51
51
  staleTime: defaultRefetchInterval,
52
52
  });
53
53
  }
54
- queryClient.setQueryData(['token-balances', accountAddress, token.chainId], (data) => {
54
+ queryClient.setQueriesData(['token-balances', accountAddress, token.chainId], (data) => {
55
55
  if (data) {
56
- const index = data.findIndex((dataToken) => dataToken.address === token.address);
57
- data[index] = {
58
- ...data[index],
56
+ const clonedData = [...data];
57
+ const index = clonedData.findIndex((dataToken) => dataToken.address === token.address);
58
+ clonedData[index] = {
59
+ ...clonedData[index],
59
60
  amount: formattedAmount,
60
61
  };
62
+ return clonedData;
61
63
  }
62
- return data;
63
64
  });
64
65
  return {
65
66
  ...tokenBalances[0],
@@ -71,11 +72,7 @@ export const useTokenBalance = (token, accountAddress) => {
71
72
  staleTime: defaultRefetchInterval,
72
73
  });
73
74
  const refetchAllBalances = () => {
74
- queryClient.refetchQueries([
75
- 'token-balances',
76
- token?.chainId,
77
- accountAddress,
78
- ]);
75
+ queryClient.refetchQueries(['token-balances', accountAddress, token?.chainId], { exact: false });
79
76
  };
80
77
  const refetchNewBalance = useCallback(() => {
81
78
  queryClient.setQueryDefaults(tokenBalanceQueryKey, {
@@ -1,4 +1,3 @@
1
- /* eslint-disable consistent-return */
2
1
  import { useQuery } from '@tanstack/react-query';
3
2
  import { useState } from 'react';
4
3
  import { useLiFi, useWallet } from '../providers';
@@ -9,11 +9,13 @@ export const useTokenSearch = (chainId, tokenQuery, enabled) => {
9
9
  });
10
10
  if (token) {
11
11
  queryClient.setQueriesData(['tokens'], (data) => {
12
- if (!data?.tokens[chainId].some((t) => t.address === token.address)) {
13
- data?.tokens[chainId].push(token);
12
+ if (data &&
13
+ !data.tokens[chainId].some((t) => t.address === token.address)) {
14
+ const clonedData = { ...data };
15
+ clonedData.tokens[chainId].push(token);
16
+ return clonedData;
14
17
  }
15
- return data;
16
- }, { updatedAt: Date.now() });
18
+ });
17
19
  }
18
20
  return token;
19
21
  }, {
package/i18n/index.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable camelcase */
2
1
  import de from './de.json';
3
2
  import en from './en.json';
4
3
  import es from './es.json';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "1.32.4",
3
+ "version": "1.32.5",
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",
@@ -44,12 +44,12 @@
44
44
  "@ethersproject/experimental": "^5.7.0",
45
45
  "@ethersproject/providers": "^5.7.2",
46
46
  "@lifi/sdk": "^1.7.2",
47
- "@lifi/wallet-management": "^1.2.8",
48
- "@mui/icons-material": "^5.11.9",
49
- "@mui/lab": "^5.0.0-alpha.120",
50
- "@mui/material": "^5.11.10",
47
+ "@lifi/wallet-management": "^1.2.9",
48
+ "@mui/icons-material": "^5.11.11",
49
+ "@mui/lab": "^5.0.0-alpha.121",
50
+ "@mui/material": "^5.11.11",
51
51
  "@tanstack/react-query": "^4.24.10",
52
- "@tanstack/react-virtual": "^3.0.0-beta.49",
52
+ "@tanstack/react-virtual": "^3.0.0-beta.52",
53
53
  "big.js": "^6.2.1",
54
54
  "i18next": "^22.4.10",
55
55
  "i18next-browser-languagedetector": "^7.0.1",
@@ -59,10 +59,10 @@
59
59
  "react-dom": "^18.2.0",
60
60
  "react-hook-form": "^7.43.2",
61
61
  "react-i18next": "^12.2.0",
62
- "react-router-dom": "^6.8.1",
62
+ "react-router-dom": "^6.8.2",
63
63
  "react-timer-hook": "^3.0.5",
64
64
  "uuid": "^9.0.0",
65
- "zustand": "^4.3.3"
65
+ "zustand": "^4.3.5"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@types/react": "^18.0.0",
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { SwapHoriz as SwapHorizIcon } from '@mui/icons-material';
2
+ import SwapHorizIcon from '@mui/icons-material/SwapHoriz';
3
3
  import { Container, Typography } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  export const ActiveSwapsEmpty = () => {
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /* eslint-disable consistent-return */
3
- import { DeleteOutline as DeleteIcon } from '@mui/icons-material';
2
+ import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
4
3
  import { Button, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton, List, } from '@mui/material';
5
4
  import { useCallback, useEffect, useState } from 'react';
6
5
  import { useTranslation } from 'react-i18next';
@@ -21,7 +20,7 @@ export const ActiveSwapsPage = () => {
21
20
  }, []);
22
21
  useEffect(() => {
23
22
  if (executingRoutes.length) {
24
- return useHeaderActionStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteIcon, {}) }));
23
+ return useHeaderActionStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteOutlineIcon, {}) }));
25
24
  }
26
25
  }, [executingRoutes.length, toggleDialog]);
27
26
  if (!executingRoutes.length) {
@@ -1,5 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CheckBox, CheckBoxOutlineBlankOutlined, CheckBoxOutlined, IndeterminateCheckBoxOutlined, } from '@mui/icons-material';
2
+ import CheckBoxIcon from '@mui/icons-material/CheckBox';
3
+ import CheckBoxOutlineBlankOutlinedIcon from '@mui/icons-material/CheckBoxOutlineBlankOutlined';
4
+ import CheckBoxOutlinedIcon from '@mui/icons-material/CheckBoxOutlined';
5
+ import IndeterminateCheckBoxOutlinedIcon from '@mui/icons-material/IndeterminateCheckBoxOutlined';
3
6
  import { Avatar, Container, IconButton, List, ListItemAvatar, } from '@mui/material';
4
7
  import { useHeaderActionStore } from '../../components/Header';
5
8
  import { useEffect } from 'react';
@@ -38,10 +41,10 @@ export const SelectEnabledToolsPage = ({ type }) => {
38
41
  setTools(type, toolKeys, toolKeys);
39
42
  }
40
43
  };
41
- return useHeaderActionStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleCheckboxes, children: allToolsSelected ? (_jsx(CheckBoxOutlined, {})) : enabledTools.length ? (_jsx(IndeterminateCheckBoxOutlined, {})) : (_jsx(CheckBoxOutlineBlankOutlined, {})) }));
44
+ return useHeaderActionStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleCheckboxes, children: allToolsSelected ? (_jsx(CheckBoxOutlinedIcon, {})) : enabledTools.length ? (_jsx(IndeterminateCheckBoxOutlinedIcon, {})) : (_jsx(CheckBoxOutlineBlankOutlinedIcon, {})) }));
42
45
  }, [enabledTools.length, setTools, tools, type, typeKey]);
43
46
  return (_jsx(Container, { disableGutters: true, children: _jsx(List, { sx: {
44
47
  paddingLeft: 1.5,
45
48
  paddingRight: 1.5,
46
- }, children: tools?.[typeKey].map((tool) => (_jsxs(ListItemButton, { onClick: () => handleClick(tool.key), children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: tool.logoURI, alt: tool.name, children: tool.name[0] }) }), _jsx(ListItemText, { primary: tool.name }), enabledTools?.includes(tool.key) ? (_jsx(CheckBox, { color: "primary" })) : (_jsx(CheckBoxOutlineBlankOutlined, {}))] }, tool.name))) }) }));
49
+ }, children: tools?.[typeKey].map((tool) => (_jsxs(ListItemButton, { onClick: () => handleClick(tool.key), children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: tool.logoURI, alt: tool.name, children: tool.name[0] }) }), _jsx(ListItemText, { primary: tool.name }), enabledTools?.includes(tool.key) ? (_jsx(CheckBoxIcon, { color: "primary" })) : (_jsx(CheckBoxOutlineBlankOutlinedIcon, {}))] }, tool.name))) }) }));
47
50
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Search as SearchIcon } from '@mui/icons-material';
2
+ import SearchIcon from '@mui/icons-material/Search';
3
3
  import { FormControl, InputAdornment } from '@mui/material';
4
4
  import { useEffect } from 'react';
5
5
  import { useFormContext } from 'react-hook-form';
@@ -1,5 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Brightness4 as Brightness4Icon, DarkMode as DarkModeIcon, LightMode as LightModeIcon, } from '@mui/icons-material';
2
+ import Brightness4Icon from '@mui/icons-material/Brightness4';
3
+ import DarkModeIcon from '@mui/icons-material/DarkMode';
4
+ import LightModeIcon from '@mui/icons-material/LightMode';
3
5
  import { Box, ToggleButtonGroup } from '@mui/material';
4
6
  import { useTranslation } from 'react-i18next';
5
7
  import { useWidgetConfig } from '../../providers';
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChevronRight as ChevronRightIcon } from '@mui/icons-material';
2
+ import ChevronRightIcon from '@mui/icons-material/ChevronRight';
3
3
  import { Box } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useNavigate } from 'react-router-dom';
@@ -12,7 +12,7 @@ export const EnabledToolsButton = ({ type }) => {
12
12
  const navigate = useNavigate();
13
13
  const [enabledTools, tools] = useSettingsStore((state) => {
14
14
  const enabledTools = Object.values(state[`_enabled${type}`] ?? {});
15
- return [enabledTools.filter((tool) => tool).length, enabledTools.length];
15
+ return [enabledTools.filter(Boolean).length, enabledTools.length];
16
16
  }, shallow);
17
17
  const handleClick = () => {
18
18
  navigate(navigationRoutes[type.toLowerCase()]);
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
2
+ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
3
3
  import { FormControl, MenuItem } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Card, CardTitle } from '../../components/Card';
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
2
+ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
3
3
  import { FormControl, MenuItem } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Card, CardTitle } from '../../components/Card';
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Orders } from '@lifi/sdk';
3
- import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
3
+ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
4
4
  import { FormControl, MenuItem } from '@mui/material';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { Card, CardTitle } from '../../components/Card';
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ContentCopy as ContentCopyIcon, DeleteOutline as DeleteIcon, } from '@mui/icons-material';
2
+ import ContentCopyIcon from '@mui/icons-material/ContentCopy';
3
+ import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
3
4
  import { Box, Button, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton, Typography, } from '@mui/material';
4
5
  import { useCallback, useEffect, useState } from 'react';
5
6
  import { useTranslation } from 'react-i18next';
@@ -37,7 +38,7 @@ export const SwapDetailsPage = () => {
37
38
  await navigator.clipboard.writeText(supportId);
38
39
  };
39
40
  useEffect(() => {
40
- return useHeaderActionStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteIcon, {}) }));
41
+ return useHeaderActionStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteOutlineIcon, {}) }));
41
42
  }, [toggleDialog]);
42
43
  const startedAt = new Date(routeExecution?.route.steps[0].execution?.process[0].startedAt ?? 0);
43
44
  return (_jsxs(Container, { children: [_jsxs(Box, { sx: {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ReceiptLongRounded as HistoryIcon } from '@mui/icons-material';
2
+ import ReceiptLongRoundedIcon from '@mui/icons-material/ReceiptLongRounded';
3
3
  import { Container, Typography } from '@mui/material';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  export const SwapHistoryEmpty = () => {
@@ -11,5 +11,5 @@ export const SwapHistoryEmpty = () => {
11
11
  alignItems: 'center',
12
12
  justifyContent: 'center',
13
13
  paddingY: 12,
14
- }, children: [_jsx(Typography, { fontSize: 48, children: _jsx(HistoryIcon, { fontSize: "inherit" }) }), _jsx(Typography, { fontSize: 18, fontWeight: 700, children: t('swap.info.title.emptySwapHistory') }), _jsx(Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, children: t('swap.info.message.emptySwapHistory') })] }));
14
+ }, children: [_jsx(Typography, { fontSize: 48, children: _jsx(ReceiptLongRoundedIcon, { fontSize: "inherit" }) }), _jsx(Typography, { fontSize: 18, fontWeight: 700, children: t('swap.info.title.emptySwapHistory') }), _jsx(Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, children: t('swap.info.message.emptySwapHistory') })] }));
15
15
  };
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /* eslint-disable consistent-return */
3
- import { DeleteOutline as DeleteIcon } from '@mui/icons-material';
2
+ import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
4
3
  import { Button, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton, Stack, } from '@mui/material';
5
4
  import { useCallback, useEffect, useState } from 'react';
6
5
  import { useTranslation } from 'react-i18next';
@@ -22,7 +21,7 @@ export const SwapHistoryPage = () => {
22
21
  }, []);
23
22
  useEffect(() => {
24
23
  if (swaps.length) {
25
- return useHeaderActionStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteIcon, {}) }));
24
+ return useHeaderActionStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteOutlineIcon, {}) }));
26
25
  }
27
26
  }, [swaps.length, toggleDialog]);
28
27
  if (!swaps.length) {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { WarningRounded as WarningIcon } from '@mui/icons-material';
2
+ import WarningRoundedIcon from '@mui/icons-material/WarningRounded';
3
3
  import { Box, Button, Typography } from '@mui/material';
4
4
  import Big from 'big.js';
5
5
  import { forwardRef, useCallback, useImperativeHandle, useRef, useState, } from 'react';
@@ -44,7 +44,7 @@ const ExchangeRateBottomSheetContent = ({ data, onCancel, onContinue }) => {
44
44
  const { t } = useTranslation();
45
45
  const ref = useRef();
46
46
  useSetContentHeight(ref);
47
- return (_jsxs(Box, { p: 3, ref: ref, children: [_jsxs(IconContainer, { children: [_jsx(IconCircle, { status: "warning", mb: 1, children: _jsx(WarningIcon, { color: "warning" }) }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('swap.warning.title.rateChanged') })] }), _jsx(Typography, { py: 1, children: t('swap.warning.message.rateChanged') }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [_jsx(Typography, { children: t('swap.quotedAmount') }), _jsxs(Typography, { fontWeight: 600, children: [t('format.number', {
47
+ return (_jsxs(Box, { p: 3, ref: ref, children: [_jsxs(IconContainer, { children: [_jsx(IconCircle, { status: "warning", mb: 1, children: _jsx(WarningRoundedIcon, { color: "warning" }) }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('swap.warning.title.rateChanged') })] }), _jsx(Typography, { py: 1, children: t('swap.warning.message.rateChanged') }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [_jsx(Typography, { children: t('swap.quotedAmount') }), _jsxs(Typography, { fontWeight: 600, children: [t('format.number', {
48
48
  value: formatTokenAmount(data?.oldToAmount, data?.toToken.decimals, 5),
49
49
  }), ' ', data?.toToken.symbol] })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('swap.currentAmount') }), _jsxs(Typography, { fontWeight: 600, children: [t('format.number', {
50
50
  value: formatTokenAmount(data?.newToAmount, data?.toToken.decimals, 5),
@@ -1,6 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /* eslint-disable consistent-return */
3
- import { Done as DoneIcon, ErrorRounded as ErrorIcon, InfoRounded as InfoIcon, WarningRounded as WarningIcon, } from '@mui/icons-material';
2
+ import DoneIcon from '@mui/icons-material/Done';
3
+ import ErrorRoundedIcon from '@mui/icons-material/ErrorRounded';
4
+ import InfoRoundedIcon from '@mui/icons-material/InfoRounded';
5
+ import WarningRoundedIcon from '@mui/icons-material/WarningRounded';
4
6
  import { Box, Button, Typography } from '@mui/material';
5
7
  import { useEffect, useRef } from 'react';
6
8
  import { useFormContext } from 'react-hook-form';
@@ -137,8 +139,8 @@ export const StatusBottomSheet = ({ status, route, }) => {
137
139
  ref.current?.open();
138
140
  }
139
141
  }, [refetch, refetchNewBalance, status]);
140
- return (_jsx(BottomSheet, { ref: ref, children: _jsxs(Box, { p: 3, children: [_jsxs(IconContainer, { children: [_jsxs(IconCircle, { status: status, mb: 1, children: [status === RouteExecutionStatus.Idle ? (_jsx(InfoIcon, { color: "primary" })) : null, status === RouteExecutionStatus.Done ? (_jsx(DoneIcon, { color: "success" })) : null, hasEnumFlag(status, RouteExecutionStatus.Partial) ||
141
- hasEnumFlag(status, RouteExecutionStatus.Refunded) ? (_jsx(WarningIcon, { color: "warning" })) : null, hasEnumFlag(status, RouteExecutionStatus.Failed) ? (_jsx(ErrorIcon, { color: "error" })) : null] }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: title }), hasEnumFlag(status, RouteExecutionStatus.Done) ? (_jsx(Token, { token: toToken, py: 1, disableDescription: true })) : null] }), _jsx(Typography, { py: 1, children: primaryMessage }), secondaryMessage ? (_jsx(Typography, { py: 1, children: secondaryMessage })) : null, _jsx(Box, { mt: 2, children: _jsxs(Button, { variant: "contained", fullWidth: true, onClick: handlePrimaryButton, children: [status === RouteExecutionStatus.Idle ? t('button.ok') : null, hasEnumFlag(status, RouteExecutionStatus.Done)
142
+ return (_jsx(BottomSheet, { ref: ref, children: _jsxs(Box, { p: 3, children: [_jsxs(IconContainer, { children: [_jsxs(IconCircle, { status: status, mb: 1, children: [status === RouteExecutionStatus.Idle ? (_jsx(InfoRoundedIcon, { color: "primary" })) : null, status === RouteExecutionStatus.Done ? (_jsx(DoneIcon, { color: "success" })) : null, hasEnumFlag(status, RouteExecutionStatus.Partial) ||
143
+ hasEnumFlag(status, RouteExecutionStatus.Refunded) ? (_jsx(WarningRoundedIcon, { color: "warning" })) : null, hasEnumFlag(status, RouteExecutionStatus.Failed) ? (_jsx(ErrorRoundedIcon, { color: "error" })) : null] }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: title }), hasEnumFlag(status, RouteExecutionStatus.Done) ? (_jsx(Token, { token: toToken, py: 1, disableDescription: true })) : null] }), _jsx(Typography, { py: 1, children: primaryMessage }), secondaryMessage ? (_jsx(Typography, { py: 1, children: secondaryMessage })) : null, _jsx(Box, { mt: 2, children: _jsxs(Button, { variant: "contained", fullWidth: true, onClick: handlePrimaryButton, children: [status === RouteExecutionStatus.Idle ? t('button.ok') : null, hasEnumFlag(status, RouteExecutionStatus.Done)
142
144
  ? t('button.done')
143
145
  : null, status === RouteExecutionStatus.Failed
144
146
  ? t('button.seeDetails')
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Delete as DeleteIcon } from '@mui/icons-material';
2
+ import DeleteIcon from '@mui/icons-material/Delete';
3
3
  import { Box, Button, Tooltip } from '@mui/material';
4
4
  import { useCallback, useRef } from 'react';
5
5
  import { useFormContext } from 'react-hook-form';
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { WarningRounded as WarningIcon } from '@mui/icons-material';
2
+ import WarningRoundedIcon from '@mui/icons-material/WarningRounded';
3
3
  import { Box, Button, Typography } from '@mui/material';
4
4
  import Big from 'big.js';
5
5
  import { forwardRef, useRef } from 'react';
@@ -18,7 +18,7 @@ const TokenValueBottomSheetContent = ({ route, onCancel, onContinue, }) => {
18
18
  const { t } = useTranslation();
19
19
  const ref = useRef();
20
20
  useSetContentHeight(ref);
21
- return (_jsxs(Box, { p: 3, ref: ref, children: [_jsxs(IconContainer, { children: [_jsx(IconCircle, { status: "warning", mb: 1, children: _jsx(WarningIcon, { color: "warning" }) }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('swap.warning.title.highValueLoss') })] }), _jsx(Typography, { py: 1, children: t('swap.warning.message.highValueLoss') }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [_jsx(Typography, { children: t('swap.swapping') }), _jsx(Typography, { fontWeight: 600, children: t('format.currency', { value: route.fromAmountUSD }) })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('swap.gasCost') }), _jsx(Typography, { fontWeight: 600, children: t('format.currency', { value: route.gasCostUSD }) })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('swap.receiving') }), _jsx(Typography, { fontWeight: 600, children: t('format.currency', { value: route.toAmountUSD }) })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('swap.valueLoss') }), _jsxs(Typography, { fontWeight: 600, children: [Big(route.toAmountUSD || 0)
21
+ return (_jsxs(Box, { p: 3, ref: ref, children: [_jsxs(IconContainer, { children: [_jsx(IconCircle, { status: "warning", mb: 1, children: _jsx(WarningRoundedIcon, { color: "warning" }) }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('swap.warning.title.highValueLoss') })] }), _jsx(Typography, { py: 1, children: t('swap.warning.message.highValueLoss') }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [_jsx(Typography, { children: t('swap.swapping') }), _jsx(Typography, { fontWeight: 600, children: t('format.currency', { value: route.fromAmountUSD }) })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('swap.gasCost') }), _jsx(Typography, { fontWeight: 600, children: t('format.currency', { value: route.gasCostUSD }) })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('swap.receiving') }), _jsx(Typography, { fontWeight: 600, children: t('format.currency', { value: route.toAmountUSD }) })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('swap.valueLoss') }), _jsxs(Typography, { fontWeight: 600, children: [Big(route.toAmountUSD || 0)
22
22
  .div(Big(route.fromAmountUSD || 0).plus(Big(route.gasCostUSD || 0)))
23
23
  .minus(1)
24
24
  .mul(100)
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const Stack: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
3
- ref?: import("react").Ref<unknown> | undefined;
4
3
  children?: import("react").ReactNode;
5
4
  direction?: import("@mui/system").ResponsiveStyleValue<"column" | "column-reverse" | "row" | "row-reverse"> | undefined;
6
5
  spacing?: import("@mui/system").ResponsiveStyleValue<string | number> | undefined;
@@ -8,4 +7,4 @@ export declare const Stack: import("@emotion/styled").StyledComponent<import("@m
8
7
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
9
8
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
9
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | "direction" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "divider" | "spacing"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
10
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "direction" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "divider" | "spacing"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;