@lifi/widget 2.0.0-beta.6 → 2.0.0-beta.8

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 (114) hide show
  1. package/App.d.ts +4 -3
  2. package/AppDrawer.d.ts +1 -1
  3. package/cjs/App.d.ts +4 -3
  4. package/cjs/AppDrawer.d.ts +1 -1
  5. package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -1
  6. package/cjs/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -1
  7. package/cjs/components/Header/Header.style.d.ts +10 -3
  8. package/cjs/components/Header/NavigationHeader.js +1 -1
  9. package/cjs/components/Header/NavigationTabs.d.ts +1 -1
  10. package/cjs/components/Header/NavigationTabs.style.d.ts +4 -71
  11. package/cjs/components/Header/WalletHeader.js +1 -1
  12. package/cjs/components/SelectChainAndToken.js +8 -7
  13. package/cjs/components/SendToWallet/SendToWallet.js +2 -2
  14. package/cjs/components/SmallAvatar.d.ts +1 -1
  15. package/cjs/components/Step/CircularProgress.d.ts +1 -1
  16. package/cjs/components/Step/Step.js +1 -1
  17. package/cjs/components/Step/StepList.d.ts +1 -1
  18. package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +1 -1
  19. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -2
  20. package/cjs/components/TokenList/TokenList.js +5 -2
  21. package/cjs/components/TokenList/TokenList.style.d.ts +5 -2
  22. package/cjs/components/TokenList/TokenList.style.js +20 -1
  23. package/cjs/components/TokenList/TokenListItem.d.ts +1 -1
  24. package/cjs/components/TokenList/TokenListItem.js +27 -4
  25. package/cjs/components/TokenList/VirtualizedTokenList.js +3 -3
  26. package/cjs/components/TokenList/types.d.ts +4 -0
  27. package/cjs/config/version.d.ts +1 -1
  28. package/cjs/config/version.js +1 -1
  29. package/cjs/hooks/useFundsSufficiency.js +2 -2
  30. package/cjs/hooks/useGasRefuel.d.ts +1 -1
  31. package/cjs/hooks/useGasRefuel.js +5 -15
  32. package/cjs/hooks/useGasSufficiency.js +2 -2
  33. package/cjs/hooks/useRouteExecution.js +3 -3
  34. package/cjs/hooks/useSwapRoutes.js +4 -4
  35. package/cjs/hooks/useTokenBalance.js +2 -2
  36. package/cjs/i18n/en.json +1 -1
  37. package/cjs/icons/InsuraceLogo.d.ts +1 -1
  38. package/cjs/icons/LiFiFullLogo.d.ts +1 -1
  39. package/cjs/icons/LiFiLogo.d.ts +1 -1
  40. package/cjs/icons/LiFiToolLogo.d.ts +1 -1
  41. package/cjs/index.d.ts +1 -1
  42. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -1
  43. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -1
  44. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -1
  45. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -1
  46. package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -1
  47. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -1
  48. package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -1
  49. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
  50. package/cjs/pages/SwapPage/StatusBottomSheet.js +3 -3
  51. package/cjs/providers/WalletProvider/WalletProvider.js +73 -47
  52. package/cjs/providers/WalletProvider/types.d.ts +0 -2
  53. package/cjs/stores/routes/RouteExecutionStore.d.ts +1 -1
  54. package/cjs/stores/settings/useSplitSubvariantStore.d.ts +1 -1
  55. package/cjs/types/widget.d.ts +1 -0
  56. package/cjs/types/widget.js +1 -0
  57. package/cjs/utils/wallet.d.ts +1 -1
  58. package/cjs/utils/wallet.js +3 -3
  59. package/components/ChainSelect/ChainSelect.d.ts +1 -1
  60. package/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -1
  61. package/components/Header/Header.style.d.ts +10 -3
  62. package/components/Header/NavigationHeader.js +1 -1
  63. package/components/Header/NavigationTabs.d.ts +1 -1
  64. package/components/Header/NavigationTabs.style.d.ts +4 -71
  65. package/components/Header/WalletHeader.js +2 -2
  66. package/components/SelectChainAndToken.js +9 -8
  67. package/components/SendToWallet/SendToWallet.js +2 -2
  68. package/components/SmallAvatar.d.ts +1 -1
  69. package/components/Step/CircularProgress.d.ts +1 -1
  70. package/components/Step/Step.js +2 -2
  71. package/components/Step/StepList.d.ts +1 -1
  72. package/components/SwapInput/SwapInputEndAdornment.d.ts +1 -1
  73. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -2
  74. package/components/TokenList/TokenList.js +6 -3
  75. package/components/TokenList/TokenList.style.d.ts +5 -2
  76. package/components/TokenList/TokenList.style.js +21 -2
  77. package/components/TokenList/TokenListItem.d.ts +1 -1
  78. package/components/TokenList/TokenListItem.js +31 -8
  79. package/components/TokenList/VirtualizedTokenList.js +3 -3
  80. package/components/TokenList/types.d.ts +4 -0
  81. package/config/version.d.ts +1 -1
  82. package/config/version.js +1 -1
  83. package/hooks/useFundsSufficiency.js +2 -2
  84. package/hooks/useGasRefuel.d.ts +1 -1
  85. package/hooks/useGasRefuel.js +5 -15
  86. package/hooks/useGasSufficiency.js +2 -2
  87. package/hooks/useRouteExecution.js +3 -3
  88. package/hooks/useSwapRoutes.js +4 -4
  89. package/hooks/useTokenBalance.js +2 -2
  90. package/i18n/en.json +1 -1
  91. package/icons/InsuraceLogo.d.ts +1 -1
  92. package/icons/LiFiFullLogo.d.ts +1 -1
  93. package/icons/LiFiLogo.d.ts +1 -1
  94. package/icons/LiFiToolLogo.d.ts +1 -1
  95. package/index.d.ts +1 -1
  96. package/package.json +6 -6
  97. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -1
  98. package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -1
  99. package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -1
  100. package/pages/SettingsPage/GasPriceSelect.d.ts +1 -1
  101. package/pages/SettingsPage/SettingsPage.d.ts +1 -1
  102. package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -1
  103. package/pages/SettingsPage/SlippageInput.d.ts +1 -1
  104. package/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
  105. package/pages/SwapPage/StatusBottomSheet.js +4 -4
  106. package/providers/WalletProvider/WalletProvider.js +74 -48
  107. package/providers/WalletProvider/types.d.ts +0 -2
  108. package/stores/routes/RouteExecutionStore.d.ts +1 -1
  109. package/stores/settings/useSplitSubvariantStore.d.ts +1 -1
  110. package/tsconfig.cjs.tsbuildinfo +1 -1
  111. package/types/widget.d.ts +1 -0
  112. package/types/widget.js +1 -0
  113. package/utils/wallet.d.ts +1 -1
  114. package/utils/wallet.js +1 -1
package/App.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { WidgetProps } from './types';
3
- export declare const App: React.FC<WidgetProps>;
4
- export declare const AppDefault: () => JSX.Element;
2
+ import type { WidgetDrawer } from './AppDrawer';
3
+ import type { WidgetConfig } from './types';
4
+ export declare const App: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & import("./types").WidgetConfigPartialProps & import("react").RefAttributes<WidgetDrawer>>;
5
+ export declare const AppDefault: () => import("react/jsx-runtime").JSX.Element;
package/AppDrawer.d.ts CHANGED
@@ -9,4 +9,4 @@ export interface WidgetDrawer {
9
9
  export declare const AppDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & import("./types").WidgetConfigPartialProps & import("react").RefAttributes<WidgetDrawer>>;
10
10
  export declare const DrawerButtonText: ({ open }: {
11
11
  open: boolean;
12
- }) => JSX.Element;
12
+ }) => import("react/jsx-runtime").JSX.Element;
package/cjs/App.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { WidgetProps } from './types';
3
- export declare const App: React.FC<WidgetProps>;
4
- export declare const AppDefault: () => JSX.Element;
2
+ import type { WidgetDrawer } from './AppDrawer';
3
+ import type { WidgetConfig } from './types';
4
+ export declare const App: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & import("./types").WidgetConfigPartialProps & import("react").RefAttributes<WidgetDrawer>>;
5
+ export declare const AppDefault: () => import("react/jsx-runtime").JSX.Element;
@@ -9,4 +9,4 @@ export interface WidgetDrawer {
9
9
  export declare const AppDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & WidgetConfig & import("./types").WidgetConfigPartialProps & import("react").RefAttributes<WidgetDrawer>>;
10
10
  export declare const DrawerButtonText: ({ open }: {
11
11
  open: boolean;
12
- }) => JSX.Element;
12
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import type { SwapFormTypeProps } from '../../providers';
2
- export declare const ChainSelect: ({ formType }: SwapFormTypeProps) => JSX.Element;
2
+ export declare const ChainSelect: ({ formType }: SwapFormTypeProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export declare const FundsSufficiencyMessage: () => JSX.Element;
1
+ export declare const FundsSufficiencyMessage: () => import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,20 @@
1
1
  /// <reference types="react" />
2
- export declare const HeaderAppBar: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").PaperProps, "classes" | "color" | "position"> & {
2
+ export declare const HeaderAppBar: import("@emotion/styled").StyledComponent<{
3
3
  classes?: Partial<import("@mui/material").AppBarClasses> | undefined;
4
4
  color?: import("@mui/types").OverridableStringUnion<"transparent" | import("@mui/material").PropTypes.Color, import("@mui/material").AppBarPropsColorOverrides> | undefined;
5
5
  enableColorOnDark?: boolean | undefined;
6
6
  position?: "fixed" | "absolute" | "relative" | "static" | "sticky" | undefined;
7
7
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
8
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
8
+ } & Omit<{
9
+ children?: import("react").ReactNode;
10
+ classes?: Partial<import("@mui/material").PaperClasses> | undefined;
11
+ elevation?: number | undefined;
12
+ square?: boolean | undefined;
13
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
14
+ variant?: import("@mui/types").OverridableStringUnion<"outlined" | "elevation", import("@mui/material").PaperPropsVariantOverrides> | undefined;
15
+ }, "classes" | "color" | "position"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
9
16
  ref?: ((instance: HTMLElement | null) => void) | import("react").RefObject<HTMLElement> | null | undefined;
10
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "ref" | "key" | "position" | "variant" | "square" | "elevation" | "enableColorOnDark"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
17
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "children" | "sx" | "position" | "variant" | "square" | "elevation" | "enableColorOnDark"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
11
18
  export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
12
19
  children?: import("react").ReactNode;
13
20
  component?: import("react").ElementType<any> | undefined;
@@ -18,7 +18,7 @@ const WalletHeader_1 = require("./WalletHeader");
18
18
  const useHeaderActionStore_1 = require("./useHeaderActionStore");
19
19
  const NavigationHeader = () => {
20
20
  const { t } = (0, react_i18next_1.useTranslation)();
21
- const { variant, subvariant, hiddenUI, walletManagement } = (0, providers_1.useWidgetConfig)();
21
+ const { variant, subvariant, hiddenUI } = (0, providers_1.useWidgetConfig)();
22
22
  const { navigate, navigateBack } = (0, hooks_1.useNavigateBack)();
23
23
  const { account } = (0, providers_1.useWallet)();
24
24
  const { element } = (0, useHeaderActionStore_1.useHeaderActionStore)();
@@ -1 +1 @@
1
- export declare const NavigationTabs: () => JSX.Element;
1
+ export declare const NavigationTabs: () => import("react/jsx-runtime").JSX.Element;
@@ -1,75 +1,8 @@
1
1
  /// <reference types="react" />
2
- export declare const NavbarTabs: import("@emotion/styled").StyledComponent<{
3
- action?: import("react").Ref<import("@mui/material").TabsActions> | undefined;
4
- allowScrollButtonsMobile?: boolean | undefined;
5
- 'aria-label'?: string | undefined;
6
- 'aria-labelledby'?: string | undefined;
7
- centered?: boolean | undefined;
8
- children?: import("react").ReactNode;
9
- classes?: Partial<import("@mui/material").TabsClasses> | undefined;
10
- slots?: {
11
- StartScrollButtonIcon?: import("react").ElementType<any> | undefined;
12
- EndScrollButtonIcon?: import("react").ElementType<any> | undefined;
13
- } | undefined;
14
- slotProps?: {
15
- startScrollButtonIcon?: import("@mui/base").SlotComponentProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
16
- muiName: string;
17
- }, import("@mui/material").TabsStartScrollButtonIconSlotPropsOverrides, import("@mui/material").TabsOwnerState> | undefined;
18
- endScrollButtonIcon?: import("@mui/base").SlotComponentProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
19
- muiName: string;
20
- }, import("@mui/material").TabsEndScrollButtonIconSlotPropsOverrides, import("@mui/material").TabsOwnerState> | undefined;
21
- } | undefined;
22
- indicatorColor?: import("@mui/types").OverridableStringUnion<"primary" | "secondary", import("@mui/material").TabsPropsIndicatorColorOverrides> | undefined;
23
- onChange?: ((event: import("react").SyntheticEvent<Element, Event>, value: any) => void) | undefined;
24
- orientation?: "horizontal" | "vertical" | undefined;
25
- ScrollButtonComponent?: import("react").ElementType<any> | undefined;
26
- scrollButtons?: boolean | "auto" | undefined;
27
- selectionFollowsFocus?: boolean | undefined;
28
- TabIndicatorProps?: (import("react").HTMLAttributes<HTMLDivElement> & {
29
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
30
- }) | undefined;
31
- TabScrollButtonProps?: Partial<import("@mui/material").TabScrollButtonProps> | undefined;
32
- textColor?: "inherit" | "primary" | "secondary" | undefined;
33
- value?: any;
34
- variant?: "fullWidth" | "standard" | "scrollable" | undefined;
35
- visibleScrollbar?: boolean | undefined;
36
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
37
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<{
38
- action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
39
- centerRipple?: boolean | undefined;
40
- children?: import("react").ReactNode;
41
- classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
42
- disabled?: boolean | undefined;
43
- disableRipple?: boolean | undefined;
44
- disableTouchRipple?: boolean | undefined;
45
- focusRipple?: boolean | undefined;
46
- focusVisibleClassName?: string | undefined;
47
- LinkComponent?: import("react").ElementType<any> | undefined;
48
- onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
49
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
50
- tabIndex?: number | undefined;
51
- TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
52
- touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
53
- } & Omit<{
54
- action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
55
- centerRipple?: boolean | undefined;
56
- children?: import("react").ReactNode;
57
- classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
58
- disabled?: boolean | undefined;
59
- disableRipple?: boolean | undefined;
60
- disableTouchRipple?: boolean | undefined;
61
- focusRipple?: boolean | undefined;
62
- focusVisibleClassName?: string | undefined;
63
- LinkComponent?: import("react").ElementType<any> | undefined;
64
- onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
65
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
66
- tabIndex?: number | undefined;
67
- TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
68
- touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
69
- }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
70
- ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
71
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef">, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "aria-label" | "aria-labelledby" | "onChange" | "action" | "sx" | "variant" | "value" | "slotProps" | "slots" | "orientation" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "ScrollButtonComponent" | "scrollButtons" | "selectionFollowsFocus" | "TabIndicatorProps" | "TabScrollButtonProps" | "textColor" | "visibleScrollbar"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
72
- export declare const NavbarTab: import("@emotion/styled").StyledComponent<{
2
+ import type { StyledComponent } from '@emotion/styled';
3
+ import type { TabsProps } from '@mui/material';
4
+ export declare const NavbarTabs: StyledComponent<TabsProps>;
5
+ export declare const NavbarTab: StyledComponent<{
73
6
  children?: null | undefined;
74
7
  classes?: Partial<import("@mui/material").TabClasses> | undefined;
75
8
  disabled?: boolean | undefined;
@@ -47,7 +47,7 @@ const ConnectedButton = () => {
47
47
  const { t } = (0, react_i18next_1.useTranslation)();
48
48
  const { subvariant } = (0, providers_1.useWidgetConfig)();
49
49
  const { account, disconnect } = (0, providers_1.useWallet)();
50
- const walletAddress = (0, utils_1.shortenWalletAddress)(account.address);
50
+ const walletAddress = (0, utils_1.shortenAddress)(account.address);
51
51
  const { chain } = (0, hooks_1.useChain)(account.chainId);
52
52
  const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
53
53
  const handleClick = (event) => {
@@ -10,7 +10,7 @@ const providers_1 = require("../providers");
10
10
  const types_1 = require("../types");
11
11
  const SelectChainAndToken = (props) => {
12
12
  const prefersNarrowView = (0, material_1.useMediaQuery)((theme) => theme.breakpoints.down('sm'));
13
- const { disabledUI, variant } = (0, providers_1.useWidgetConfig)();
13
+ const { disabledUI, hiddenUI, variant } = (0, providers_1.useWidgetConfig)();
14
14
  const [fromChain, toChain, fromToken, toToken] = (0, react_hook_form_1.useWatch)({
15
15
  name: [
16
16
  providers_1.SwapFormKey.FromChain,
@@ -19,20 +19,21 @@ const SelectChainAndToken = (props) => {
19
19
  providers_1.SwapFormKey.ToToken,
20
20
  ],
21
21
  });
22
- const disabledReverse = variant === 'refuel' ||
22
+ const hiddenReverse = variant === 'refuel' ||
23
23
  disabledUI?.includes(types_1.DisabledUI.FromToken) ||
24
- disabledUI?.includes(types_1.DisabledUI.ToToken);
25
- const nftVariant = variant === 'nft';
24
+ disabledUI?.includes(types_1.DisabledUI.ToToken) ||
25
+ hiddenUI?.includes(types_1.HiddenUI.ToToken);
26
+ const hiddenToToken = variant === 'nft' || hiddenUI?.includes(types_1.HiddenUI.ToToken);
26
27
  const isCompact = fromChain &&
27
28
  toChain &&
28
29
  fromToken &&
29
30
  toToken &&
30
31
  !prefersNarrowView &&
31
- !nftVariant;
32
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' }, ...props, children: [(0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "from", compact: isCompact }), !nftVariant ? ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
32
+ !hiddenToToken;
33
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' }, ...props, children: [(0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "from", compact: isCompact }), !hiddenToToken ? ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
33
34
  display: 'flex',
34
35
  justifyContent: 'center',
35
36
  alignItems: 'center',
36
- }, m: !disabledReverse ? -1.125 : 1, children: !disabledReverse ? ((0, jsx_runtime_1.jsx)(ReverseTokensButton_1.ReverseTokensButton, { vertical: !isCompact })) : null })) : null, !nftVariant ? ((0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "to", compact: isCompact })) : null] }));
37
+ }, m: !hiddenReverse ? -1.125 : 1, children: !hiddenReverse ? ((0, jsx_runtime_1.jsx)(ReverseTokensButton_1.ReverseTokensButton, { vertical: !isCompact })) : null })) : null, !hiddenToToken ? ((0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "to", compact: isCompact })) : null] }));
37
38
  };
38
39
  exports.SelectChainAndToken = SelectChainAndToken;
@@ -15,7 +15,7 @@ const SendToWallet_style_1 = require("./SendToWallet.style");
15
15
  exports.SendToWallet = (0, react_1.forwardRef)((props, ref) => {
16
16
  const { t } = (0, react_i18next_1.useTranslation)();
17
17
  const { trigger, getValues, clearErrors } = (0, react_hook_form_1.useFormContext)();
18
- const { account, provider } = (0, providers_1.useWallet)();
18
+ const { account } = (0, providers_1.useWallet)();
19
19
  const { disabledUI, hiddenUI, requiredUI, toAddress } = (0, providers_1.useWidgetConfig)();
20
20
  const { showSendToWallet, showSendToWalletDirty, setSendToWallet } = (0, stores_1.useSendToWalletStore)();
21
21
  const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
@@ -33,7 +33,7 @@ exports.SendToWallet = (0, react_1.forwardRef)((props, ref) => {
33
33
  if (!value) {
34
34
  return true;
35
35
  }
36
- const address = await provider?.resolveName(value);
36
+ const address = await account.signer?.provider?.resolveName(value);
37
37
  return ((0, address_1.isAddress)(address || value) ||
38
38
  t('swap.error.title.walletAddressInvalid'));
39
39
  }
@@ -33,4 +33,4 @@ export declare const SmallAvatarSkeletonContainer: import("@emotion/styled").Sty
33
33
  } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
34
34
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
35
35
  }, "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>, {}, {}>;
36
- export declare const SmallAvatarSkeleton: () => JSX.Element;
36
+ export declare const SmallAvatarSkeleton: () => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import type { Process } from '@lifi/sdk';
2
2
  export declare function CircularProgress({ process }: {
3
3
  process: Process;
4
- }): JSX.Element;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -43,7 +43,7 @@ const Step = ({ step, fromToken, toToken, toAddress }) => {
43
43
  : t('swap.stepSwap');
44
44
  }
45
45
  };
46
- const formattedToAddress = (0, utils_1.shortenWalletAddress)(toAddress);
46
+ const formattedToAddress = (0, utils_1.shortenAddress)(toAddress);
47
47
  const toAddressLink = toAddress
48
48
  ? `${getChainById(step.action.toChainId)?.metamask.blockExplorerUrls[0]}address/${toAddress}`
49
49
  : undefined;
@@ -1,2 +1,2 @@
1
1
  import type { Route } from '@lifi/sdk';
2
- export declare const getStepList: (route?: Route) => JSX.Element[] | undefined;
2
+ export declare const getStepList: (route?: Route) => import("react/jsx-runtime").JSX.Element[] | undefined;
@@ -1,2 +1,2 @@
1
1
  import type { SwapFormTypeProps } from '../../providers';
2
- export declare const SwapInputEndAdornment: ({ formType }: SwapFormTypeProps) => JSX.Element;
2
+ export declare const SwapInputEndAdornment: ({ formType }: SwapFormTypeProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- export declare const SwapRoutesExpanded: () => JSX.Element;
2
- export declare const SwapRoutesExpandedElement: () => JSX.Element;
1
+ export declare const SwapRoutesExpanded: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const SwapRoutesExpandedElement: () => import("react/jsx-runtime").JSX.Element;
@@ -17,6 +17,7 @@ const TokenList = ({ formType, height, onClick, }) => {
17
17
  name: [providers_1.SwapFormKeyHelper.getChainKey(formType)],
18
18
  });
19
19
  const [tokenSearchFilter] = (0, hooks_1.useDebouncedWatch)([providers_1.SwapFormKey.TokenSearchFilter], 320);
20
+ const { chain, isLoading: isChainLoading } = (0, hooks_1.useChain)(selectedChainId);
20
21
  const { tokens: chainTokens, tokensWithBalance, isLoading: isTokensLoading, isBalanceLoading, featuredTokens, } = (0, hooks_1.useTokenBalances)(selectedChainId);
21
22
  let filteredTokens = (tokensWithBalance ??
22
23
  chainTokens ??
@@ -32,13 +33,15 @@ const TokenList = ({ formType, height, onClick, }) => {
32
33
  !!tokenSearchFilter &&
33
34
  !!selectedChainId;
34
35
  const { token: searchedToken, isLoading: isSearchedTokenLoading } = (0, hooks_1.useTokenSearch)(selectedChainId, tokenSearchFilter, tokenSearchEnabled);
35
- const isLoading = isTokensLoading || (tokenSearchEnabled && isSearchedTokenLoading);
36
+ const isLoading = isTokensLoading ||
37
+ isChainLoading ||
38
+ (tokenSearchEnabled && isSearchedTokenLoading);
36
39
  const tokens = filteredTokens.length
37
40
  ? filteredTokens
38
41
  : searchedToken
39
42
  ? [searchedToken]
40
43
  : filteredTokens;
41
44
  const handleTokenClick = (0, useTokenSelect_1.useTokenSelect)(formType, onClick);
42
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: parentRef, style: { height, overflow: 'auto' }, children: [!tokens.length && !isLoading ? ((0, jsx_runtime_1.jsx)(TokenNotFound_1.TokenNotFound, { formType: formType })) : null, (0, jsx_runtime_1.jsx)(VirtualizedTokenList_1.VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens?.length, scrollElementRef: parentRef, chainId: selectedChainId, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] }));
45
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: parentRef, style: { height, overflow: 'auto' }, children: [!tokens.length && !isLoading ? ((0, jsx_runtime_1.jsx)(TokenNotFound_1.TokenNotFound, { formType: formType })) : null, (0, jsx_runtime_1.jsx)(VirtualizedTokenList_1.VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens?.length, scrollElementRef: parentRef, chainId: selectedChainId, chain: chain, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] }));
43
46
  };
44
47
  exports.TokenList = TokenList;
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare const ListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
2
+ import type { StyledComponent } from '@emotion/styled';
3
+ import type { ButtonProps, LinkProps } from '@mui/material';
4
+ export declare const ListItemButton: StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
3
5
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
4
6
  centerRipple?: boolean | undefined;
5
7
  children?: import("react").ReactNode;
@@ -18,7 +20,7 @@ export declare const ListItemButton: import("@emotion/styled").StyledComponent<i
18
20
  }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
19
21
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
22
  }, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
- export declare const ListItem: import("@emotion/styled").StyledComponent<{
23
+ export declare const ListItem: StyledComponent<{
22
24
  button?: false | undefined;
23
25
  } & import("@mui/material").ListItemBaseProps & {
24
26
  components?: {
@@ -36,3 +38,4 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<{
36
38
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
37
39
  ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
38
40
  }, "button" | "className" | "style" | "classes" | "autoFocus" | "children" | "disabled" | "sx" | "alignItems" | "dense" | "divider" | "components" | "slotProps" | "slots" | "componentsProps" | "selected" | "disableGutters" | "ContainerComponent" | "ContainerProps" | "disablePadding" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
41
+ export declare const LinkButton: StyledComponent<ButtonProps & LinkProps>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ListItem = exports.ListItemButton = void 0;
3
+ exports.LinkButton = exports.ListItem = exports.ListItemButton = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const ListItemSecondaryAction_1 = require("@mui/material/ListItemSecondaryAction");
6
6
  const ListItemText_1 = require("@mui/material/ListItemText");
@@ -29,3 +29,22 @@ exports.ListItem = (0, styles_1.styled)(material_1.ListItem)(({ theme }) => ({
29
29
  whiteSpace: 'nowrap',
30
30
  },
31
31
  }));
32
+ exports.LinkButton = (0, styles_1.styled)(material_1.Button)(({ theme }) => ({
33
+ lineHeight: 1,
34
+ fontSize: '0.75rem',
35
+ fontWeight: 400,
36
+ padding: theme.spacing(0.375, 0.75),
37
+ color: 'inherit',
38
+ backgroundColor: 'unset',
39
+ '&:hover': {
40
+ backgroundColor: theme.palette.mode === 'light'
41
+ ? (0, styles_1.alpha)(theme.palette.common.black, 0.04)
42
+ : (0, styles_1.alpha)(theme.palette.common.white, 0.08),
43
+ },
44
+ [`.${material_1.buttonClasses.endIcon}`]: {
45
+ marginLeft: theme.spacing(0.25),
46
+ },
47
+ [`.${material_1.buttonClasses.endIcon} > *:nth-of-type(1)`]: {
48
+ fontSize: '0.75rem',
49
+ },
50
+ }));
@@ -2,5 +2,5 @@
2
2
  import type { TokenListItemButtonProps, TokenListItemProps } from './types';
3
3
  export declare const TokenListItem: React.FC<TokenListItemProps>;
4
4
  export declare const TokenListItemButton: React.FC<TokenListItemButtonProps>;
5
- export declare const TokenListItemSkeleton: () => JSX.Element;
5
+ export declare const TokenListItemSkeleton: () => import("react/jsx-runtime").JSX.Element;
6
6
  export declare const TokenAmountSkeleton: React.FC;
@@ -2,22 +2,45 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TokenAmountSkeleton = exports.TokenListItemSkeleton = exports.TokenListItemButton = exports.TokenListItem = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const OpenInNewRounded_1 = require("@mui/icons-material/OpenInNewRounded");
5
6
  const material_1 = require("@mui/material");
6
7
  const react_1 = require("react");
7
8
  const react_i18next_1 = require("react-i18next");
8
9
  const utils_1 = require("../../utils");
9
10
  const TokenList_style_1 = require("./TokenList.style");
10
- exports.TokenListItem = (0, react_1.memo)(({ onClick, size, start, token, showBalance, isBalanceLoading, startAdornment, endAdornment, }) => {
11
+ exports.TokenListItem = (0, react_1.memo)(({ onClick, size, start, token, chain, showBalance, isBalanceLoading, startAdornment, endAdornment, }) => {
11
12
  const handleClick = () => onClick?.(token.address);
12
13
  return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItem, { disablePadding: true, style: {
13
14
  height: `${size}px`,
14
15
  transform: `translateY(${start}px)`,
15
- }, children: [startAdornment, (0, jsx_runtime_1.jsx)(exports.TokenListItemButton, { token: token, showBalance: showBalance, isBalanceLoading: isBalanceLoading, onClick: handleClick }), endAdornment] }));
16
+ }, children: [startAdornment, (0, jsx_runtime_1.jsx)(exports.TokenListItemButton, { token: token, chain: chain, showBalance: showBalance, isBalanceLoading: isBalanceLoading, onClick: handleClick }), endAdornment] }));
16
17
  });
17
- const TokenListItemButton = ({ onClick, token, showBalance, isBalanceLoading, }) => {
18
+ const TokenListItemButton = ({ onClick, token, chain, showBalance, isBalanceLoading, }) => {
18
19
  const { t } = (0, react_i18next_1.useTranslation)();
19
20
  const tokenPrice = (0, utils_1.formatTokenPrice)(token.amount, token.priceUSD);
20
- return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, { onClick: onClick, dense: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondary: token.name }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", noWrap: true, children: t('format.number', {
21
+ const container = (0, react_1.useRef)(null);
22
+ const timeoutId = (0, react_1.useRef)();
23
+ const [showAddress, setShowAddress] = (0, react_1.useState)(false);
24
+ const onMouseEnter = () => {
25
+ timeoutId.current = setTimeout(() => setShowAddress(true), 350);
26
+ };
27
+ const onMouseLeave = () => {
28
+ clearTimeout(timeoutId.current);
29
+ if (showAddress) {
30
+ setShowAddress(false);
31
+ }
32
+ };
33
+ return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, dense: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondaryTypographyProps: {
34
+ component: 'div',
35
+ sx: {
36
+ overflow: 'auto',
37
+ marginLeft: -0.75,
38
+ },
39
+ }, secondary: (0, jsx_runtime_1.jsxs)(material_1.Box, { position: "relative", height: 18, ref: container, children: [(0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "down", in: !showAddress, container: container.current, style: {
40
+ position: 'absolute',
41
+ }, appear: false, children: (0, jsx_runtime_1.jsx)(material_1.Box, { pl: 0.75, children: token.name }) }), (0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "up", in: showAddress, container: container.current, style: {
42
+ position: 'absolute',
43
+ }, appear: false, mountOnEnter: true, children: (0, jsx_runtime_1.jsx)(TokenList_style_1.LinkButton, { size: "small", LinkComponent: material_1.Link, href: `${chain?.metamask.blockExplorerUrls[0]}address/${token.address}`, target: "_blank", rel: "nofollow noreferrer", onClick: (e) => e.stopPropagation(), endIcon: (0, jsx_runtime_1.jsx)(OpenInNewRounded_1.default, {}), children: (0, utils_1.shortenAddress)(token.address) }) })] }) }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", noWrap: true, children: t('format.number', {
21
44
  value: token.amount,
22
45
  }) })) : null, tokenPrice ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD, children: t(`format.currency`, {
23
46
  value: tokenPrice,
@@ -7,7 +7,7 @@ const react_virtual_1 = require("@tanstack/react-virtual");
7
7
  const react_1 = require("react");
8
8
  const react_i18next_1 = require("react-i18next");
9
9
  const TokenListItem_1 = require("./TokenListItem");
10
- const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef, chainId, isLoading, isBalanceLoading, showBalance, showFeatured, onClick, }) => {
10
+ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef, chainId, chain, isLoading, isBalanceLoading, showBalance, showFeatured, onClick, }) => {
11
11
  const { t } = (0, react_i18next_1.useTranslation)();
12
12
  const hasFeaturedTokens = !!featuredTokensLength && showFeatured;
13
13
  const featuredTokensLastIndex = (featuredTokensLength ?? 0) - 1;
@@ -35,7 +35,7 @@ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef,
35
35
  }
36
36
  return size;
37
37
  },
38
- getItemKey: (index) => tokens[index].address ?? index,
38
+ getItemKey: (index) => `${tokens[index].address}-${index}`,
39
39
  });
40
40
  (0, react_1.useEffect)(() => {
41
41
  if (getVirtualItems().length) {
@@ -49,7 +49,7 @@ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef,
49
49
  }
50
50
  return ((0, jsx_runtime_1.jsx)(material_1.List, { style: { height: getTotalSize() }, disablePadding: true, children: getVirtualItems().map((item) => {
51
51
  const token = tokens[item.index];
52
- return ((0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('swap.featuredTokens') })) : null, endAdornment: hasFeaturedTokens &&
52
+ return ((0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, chain: chain, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('swap.featuredTokens') })) : null, endAdornment: hasFeaturedTokens &&
53
53
  token.featured &&
54
54
  item.index === featuredTokensLastIndex &&
55
55
  item.index !== tokensLastIndex ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, py: 1.25, children: t('swap.otherTokens') })) : null }, item.key));
@@ -1,3 +1,4 @@
1
+ import type { ExtendedChain } from '@lifi/sdk';
1
2
  import type { MutableRefObject } from 'react';
2
3
  import type { SwapFormType } from '../../providers';
3
4
  import type { TokenAmount } from '../../types';
@@ -13,6 +14,7 @@ export interface VirtualizedTokenListProps {
13
14
  isLoading: boolean;
14
15
  isBalanceLoading: boolean;
15
16
  chainId: number;
17
+ chain?: ExtendedChain;
16
18
  showBalance?: boolean;
17
19
  showFeatured?: boolean;
18
20
  onClick(tokenAddress: string): void;
@@ -25,6 +27,7 @@ export interface TokenListItemBaseProps {
25
27
  export interface TokenListItemProps extends TokenListItemBaseProps {
26
28
  showBalance?: boolean;
27
29
  token: TokenAmount;
30
+ chain?: ExtendedChain;
28
31
  isBalanceLoading?: boolean;
29
32
  startAdornment?: React.ReactNode;
30
33
  endAdornment?: React.ReactNode;
@@ -33,5 +36,6 @@ export interface TokenListItemButtonProps {
33
36
  onClick?(): void;
34
37
  showBalance?: boolean;
35
38
  token: TokenAmount;
39
+ chain?: ExtendedChain;
36
40
  isBalanceLoading?: boolean;
37
41
  }
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.0.0-beta.6";
2
+ export declare const version = "2.0.0-beta.8";
@@ -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 = '2.0.0-beta.6';
5
+ exports.version = '2.0.0-beta.8';
@@ -10,8 +10,8 @@ const useGetTokenBalancesWithRetry_1 = require("./useGetTokenBalancesWithRetry")
10
10
  const useTokenAddressBalance_1 = require("./useTokenAddressBalance");
11
11
  const refetchInterval = 30000;
12
12
  const useFundsSufficiency = (route) => {
13
- const { account, provider } = (0, providers_1.useWallet)();
14
- const getTokenBalancesWithRetry = (0, useGetTokenBalancesWithRetry_1.useGetTokenBalancesWithRetry)(provider);
13
+ const { account } = (0, providers_1.useWallet)();
14
+ const getTokenBalancesWithRetry = (0, useGetTokenBalancesWithRetry_1.useGetTokenBalancesWithRetry)(account.signer?.provider);
15
15
  const [fromChainId, fromTokenAddress, fromAmount] = (0, react_hook_form_1.useWatch)({
16
16
  name: [
17
17
  providers_1.SwapFormKey.FromChain,
@@ -3,5 +3,5 @@ export declare const useGasRefuel: () => {
3
3
  availble: boolean | undefined;
4
4
  isLoading: boolean;
5
5
  chain: import("@lifi/types").ExtendedChain | undefined;
6
- gasRecommendation: import("@lifi/types").GasRecommendationResponse | undefined;
6
+ fromAmount: string | undefined;
7
7
  };
@@ -10,12 +10,11 @@ const useGasRecommendation_1 = require("./useGasRecommendation");
10
10
  const useTokenBalance_1 = require("./useTokenBalance");
11
11
  const useGasRefuel = () => {
12
12
  const { getChainById } = (0, _1.useChains)();
13
- const [fromChainId, fromTokenAddress, toChainId, toTokenAddress, toAddress] = (0, react_hook_form_1.useWatch)({
13
+ const [fromChainId, fromTokenAddress, toChainId, toAddress] = (0, react_hook_form_1.useWatch)({
14
14
  name: [
15
15
  providers_1.SwapFormKey.FromChain,
16
16
  providers_1.SwapFormKey.FromToken,
17
17
  providers_1.SwapFormKey.ToChain,
18
- providers_1.SwapFormKey.ToToken,
19
18
  providers_1.SwapFormKey.ToAddress,
20
19
  ],
21
20
  });
@@ -27,10 +26,7 @@ const useGasRefuel = () => {
27
26
  // We don't allow same chain refuel.
28
27
  // If a user runs out of gas, he can't send a source chain transaction.
29
28
  fromChainId === toChainId ||
30
- // We don't want to apply auto refuel when swapping to native tokens
31
- toChain?.nativeToken.address === toTokenAddress ||
32
29
  !gasRecommendation?.available ||
33
- !gasRecommendation.recommended ||
34
30
  !nativeToken) {
35
31
  return false;
36
32
  }
@@ -41,21 +37,15 @@ const useGasRefuel = () => {
41
37
  .div(2);
42
38
  const insufficientGas = tokenBalance.lt(recommendedAmount);
43
39
  return insufficientGas;
44
- }, [
45
- fromChainId,
46
- gasRecommendation?.available,
47
- gasRecommendation?.recommended,
48
- nativeToken,
49
- toChain?.nativeToken.address,
50
- toChainId,
51
- toTokenAddress,
52
- ]);
40
+ }, [fromChainId, gasRecommendation, nativeToken, toChainId]);
53
41
  return {
54
42
  enabled: enabled,
55
43
  availble: gasRecommendation?.available,
56
44
  isLoading: isLoading,
57
45
  chain: toChain,
58
- gasRecommendation,
46
+ fromAmount: gasRecommendation?.available
47
+ ? gasRecommendation.fromAmount
48
+ : undefined,
59
49
  };
60
50
  };
61
51
  exports.useGasRefuel = useGasRefuel;
@@ -7,9 +7,9 @@ const _1 = require(".");
7
7
  const providers_1 = require("../providers");
8
8
  const refetchInterval = 30000;
9
9
  const useGasSufficiency = (route) => {
10
- const { account, provider } = (0, providers_1.useWallet)();
10
+ const { account } = (0, providers_1.useWallet)();
11
11
  const { getChainById } = (0, _1.useChains)();
12
- const getTokenBalancesWithRetry = (0, _1.useGetTokenBalancesWithRetry)(provider);
12
+ const getTokenBalancesWithRetry = (0, _1.useGetTokenBalancesWithRetry)(account.signer?.provider);
13
13
  const { data: insufficientGas, isInitialLoading } = (0, react_query_1.useQuery)(['gas-sufficiency-check', account.address, route?.id], async () => {
14
14
  if (!account.address || !route) {
15
15
  return;