@lifi/widget 2.4.4 → 2.4.6

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 (126) hide show
  1. package/AppDrawer.style.d.ts +6 -71
  2. package/cjs/AppDrawer.style.d.ts +6 -71
  3. package/cjs/components/ActiveTransactions/ActiveTransactions.style.d.ts +6 -65
  4. package/cjs/components/AmountInput/AmountInput.style.d.ts +2 -16
  5. package/cjs/components/AmountInput/AmountInputAdornment.style.d.ts +2 -32
  6. package/cjs/components/AppContainer.d.ts +4 -16
  7. package/cjs/components/Card/Card.d.ts +3 -8
  8. package/cjs/components/Card/CardHeader.d.ts +2 -16
  9. package/cjs/components/Card/CardIconButton.d.ts +2 -27
  10. package/cjs/components/Card/CardLabel.d.ts +5 -20
  11. package/cjs/components/Card/CardTitle.d.ts +2 -12
  12. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +5 -15
  13. package/cjs/components/GasMessage/GasMessage.style.d.ts +8 -28
  14. package/cjs/components/Header/Header.style.d.ts +8 -61
  15. package/cjs/components/Header/NavigationTabs.style.d.ts +4 -29
  16. package/cjs/components/ListItemButton.d.ts +2 -18
  17. package/cjs/components/NFT/NFT.style.d.ts +2 -14
  18. package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -27
  19. package/cjs/components/RouteCard/RouteCard.style.d.ts +2 -12
  20. package/cjs/components/Routes/RoutesExpanded.style.d.ts +8 -28
  21. package/cjs/components/SelectTokenButton/SelectTokenButton.style.d.ts +2 -16
  22. package/cjs/components/SendToWallet/SendToWallet.js +4 -1
  23. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +2 -16
  24. package/cjs/components/SmallAvatar.d.ts +6 -31
  25. package/cjs/components/Step/CircularProgress.style.d.ts +2 -7
  26. package/cjs/components/StepActions/StepActions.style.d.ts +2 -14
  27. package/cjs/components/StepDivider/StepDivider.style.d.ts +2 -9
  28. package/cjs/components/Token/Token.style.d.ts +6 -26
  29. package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +4 -14
  30. package/cjs/components/TokenList/TokenList.style.d.ts +4 -33
  31. package/cjs/config/version.d.ts +1 -1
  32. package/cjs/config/version.js +1 -1
  33. package/cjs/i18n/en.json +2 -1
  34. package/cjs/pages/MainPage/MainPage.style.d.ts +2 -9
  35. package/cjs/pages/RoutesPage/RoutesPage.style.d.ts +2 -9
  36. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +2 -18
  37. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +6 -1
  38. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -31
  39. package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +2 -18
  40. package/cjs/pages/SettingsPage/ResetSettingsButton.js +29 -1
  41. package/cjs/pages/SettingsPage/ResetSettingsButton.style.d.ts +4 -0
  42. package/cjs/pages/SettingsPage/ResetSettingsButton.style.js +13 -0
  43. package/cjs/pages/TransactionDetailsPage/TransactionDetailsPage.style.d.ts +2 -9
  44. package/cjs/pages/TransactionPage/StatusBottomSheet.style.d.ts +4 -14
  45. package/cjs/pages/TransactionPage/TransactionPage.style.d.ts +2 -9
  46. package/cjs/stores/StoreProvider.js +3 -1
  47. package/cjs/stores/chains/ChainOrderStore.d.ts +3 -2
  48. package/cjs/stores/chains/createChainOrderStore.d.ts +1 -1
  49. package/cjs/stores/chains/createChainOrderStore.js +3 -3
  50. package/cjs/stores/header/types.d.ts +3 -2
  51. package/cjs/stores/header/useHeaderStore.d.ts +1 -1
  52. package/cjs/stores/header/useHeaderStore.js +3 -3
  53. package/cjs/stores/routes/RouteExecutionStore.d.ts +3 -2
  54. package/cjs/stores/routes/createRouteExecutionStore.d.ts +1 -1
  55. package/cjs/stores/routes/createRouteExecutionStore.js +4 -4
  56. package/cjs/stores/settings/types.d.ts +7 -5
  57. package/cjs/stores/settings/useSendToWalletStore.d.ts +1 -1
  58. package/cjs/stores/settings/useSendToWalletStore.js +3 -3
  59. package/cjs/stores/settings/useSettingsStore.d.ts +2 -2
  60. package/cjs/stores/settings/useSettingsStore.js +10 -6
  61. package/cjs/stores/settings/useSplitSubvariantStore.d.ts +1 -1
  62. package/cjs/stores/settings/useSplitSubvariantStore.js +4 -4
  63. package/cjs/types/widget.d.ts +2 -0
  64. package/components/ActiveTransactions/ActiveTransactions.style.d.ts +6 -65
  65. package/components/AmountInput/AmountInput.style.d.ts +2 -16
  66. package/components/AmountInput/AmountInputAdornment.style.d.ts +2 -32
  67. package/components/AppContainer.d.ts +4 -16
  68. package/components/Card/Card.d.ts +3 -8
  69. package/components/Card/CardHeader.d.ts +2 -16
  70. package/components/Card/CardIconButton.d.ts +2 -27
  71. package/components/Card/CardLabel.d.ts +5 -20
  72. package/components/Card/CardTitle.d.ts +2 -12
  73. package/components/ChainSelect/ChainSelect.style.d.ts +5 -15
  74. package/components/GasMessage/GasMessage.style.d.ts +8 -28
  75. package/components/Header/Header.style.d.ts +8 -61
  76. package/components/Header/NavigationTabs.style.d.ts +4 -29
  77. package/components/ListItemButton.d.ts +2 -18
  78. package/components/NFT/NFT.style.d.ts +2 -14
  79. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -27
  80. package/components/RouteCard/RouteCard.style.d.ts +2 -12
  81. package/components/Routes/RoutesExpanded.style.d.ts +8 -28
  82. package/components/SelectTokenButton/SelectTokenButton.style.d.ts +2 -16
  83. package/components/SendToWallet/SendToWallet.js +4 -1
  84. package/components/SendToWallet/SendToWallet.style.d.ts +2 -16
  85. package/components/SmallAvatar.d.ts +6 -31
  86. package/components/Step/CircularProgress.style.d.ts +2 -7
  87. package/components/StepActions/StepActions.style.d.ts +2 -14
  88. package/components/StepDivider/StepDivider.style.d.ts +2 -9
  89. package/components/Token/Token.style.d.ts +6 -26
  90. package/components/TokenAvatar/TokenAvatar.style.d.ts +4 -14
  91. package/components/TokenList/TokenList.style.d.ts +4 -33
  92. package/config/version.d.ts +1 -1
  93. package/config/version.js +1 -1
  94. package/i18n/en.json +2 -1
  95. package/package.json +14 -14
  96. package/pages/MainPage/MainPage.style.d.ts +2 -9
  97. package/pages/RoutesPage/RoutesPage.style.d.ts +2 -9
  98. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +2 -18
  99. package/pages/SelectWalletPage/SelectWalletPage.js +7 -2
  100. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -31
  101. package/pages/SettingsPage/EnabledToolsButton.style.d.ts +2 -18
  102. package/pages/SettingsPage/ResetSettingsButton.js +30 -2
  103. package/pages/SettingsPage/ResetSettingsButton.style.d.ts +4 -0
  104. package/pages/SettingsPage/ResetSettingsButton.style.js +10 -0
  105. package/pages/TransactionDetailsPage/TransactionDetailsPage.style.d.ts +2 -9
  106. package/pages/TransactionPage/StatusBottomSheet.style.d.ts +4 -14
  107. package/pages/TransactionPage/TransactionPage.style.d.ts +2 -9
  108. package/stores/StoreProvider.js +3 -1
  109. package/stores/chains/ChainOrderStore.d.ts +3 -2
  110. package/stores/chains/createChainOrderStore.d.ts +1 -1
  111. package/stores/chains/createChainOrderStore.js +3 -3
  112. package/stores/header/types.d.ts +3 -2
  113. package/stores/header/useHeaderStore.d.ts +1 -1
  114. package/stores/header/useHeaderStore.js +3 -3
  115. package/stores/routes/RouteExecutionStore.d.ts +3 -2
  116. package/stores/routes/createRouteExecutionStore.d.ts +1 -1
  117. package/stores/routes/createRouteExecutionStore.js +4 -4
  118. package/stores/settings/types.d.ts +7 -5
  119. package/stores/settings/useSendToWalletStore.d.ts +1 -1
  120. package/stores/settings/useSendToWalletStore.js +3 -3
  121. package/stores/settings/useSettingsStore.d.ts +2 -2
  122. package/stores/settings/useSettingsStore.js +10 -6
  123. package/stores/settings/useSplitSubvariantStore.d.ts +1 -1
  124. package/stores/settings/useSplitSubvariantStore.js +4 -4
  125. package/tsconfig.cjs.tsbuildinfo +1 -1
  126. package/types/widget.d.ts +2 -0
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const ResetButtonContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,10 @@
1
+ import { getContrastAlphaColor } from '../../utils';
2
+ import { Box, styled } from '@mui/material';
3
+ export const ResetButtonContainer = styled(Box)(({ theme }) => ({
4
+ background: getContrastAlphaColor(theme.palette.mode, '4%'),
5
+ borderRadius: '16px',
6
+ padding: '16px',
7
+ [`svg`]: {
8
+ fill: getContrastAlphaColor(theme.palette.mode, '40%'),
9
+ },
10
+ }));
@@ -1,11 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const Container: import("@emotion/styled").StyledComponent<{
3
- children?: import("react").ReactNode;
4
- classes?: Partial<import("@mui/material").ContainerClasses> | undefined;
5
- disableGutters?: boolean | undefined;
6
- fixed?: boolean | undefined;
7
- maxWidth?: false | import("@mui/material").Breakpoint | undefined;
8
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
9
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
2
+ export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/material").ContainerOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
3
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "maxWidth" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
+ }, "className" | "style" | "classes" | "children" | "sx" | "maxWidth" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -2,22 +2,12 @@
2
2
  import type { Theme } from '@mui/material';
3
3
  import { RouteExecutionStatus } from '../../stores';
4
4
  type StatusColor = RouteExecutionStatus | 'warning';
5
- export declare const CenterContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<Theme> & {
6
- children?: import("react").ReactNode;
7
- component?: import("react").ElementType<any> | undefined;
8
- ref?: import("react").Ref<unknown> | undefined;
9
- sx?: import("@mui/material").SxProps<Theme> | undefined;
10
- } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
5
+ export declare const CenterContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
11
6
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
12
- }, "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<Theme>, {}, {}>;
13
- export declare const IconCircle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<Theme> & {
14
- children?: import("react").ReactNode;
15
- component?: import("react").ElementType<any> | undefined;
16
- ref?: import("react").Ref<unknown> | undefined;
17
- sx?: import("@mui/material").SxProps<Theme> | undefined;
18
- } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
7
+ }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
8
+ export declare const IconCircle: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
19
9
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
- }, "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<Theme> & {
10
+ }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme> & {
21
11
  status: StatusColor;
22
12
  }, {}, {}>;
23
13
  export {};
@@ -1,11 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const Container: import("@emotion/styled").StyledComponent<{
3
- children?: import("react").ReactNode;
4
- classes?: Partial<import("@mui/material").ContainerClasses> | undefined;
5
- disableGutters?: boolean | undefined;
6
- fixed?: boolean | undefined;
7
- maxWidth?: false | import("@mui/material").Breakpoint | undefined;
8
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
9
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
2
+ export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/material").ContainerOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
3
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "maxWidth" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
+ }, "className" | "style" | "classes" | "children" | "sx" | "maxWidth" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -4,5 +4,7 @@ import { HeaderStoreProvider } from './header';
4
4
  import { RouteExecutionStoreProvider } from './routes';
5
5
  import { SplitSubvariantStoreProvider } from './settings';
6
6
  export const StoreProvider = ({ children, config, }) => {
7
- return (_jsx(SplitSubvariantStoreProvider, { state: config.subvariant === 'split' ? 'swap' : undefined, children: _jsx(HeaderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(ChainOrderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(RouteExecutionStoreProvider, { namePrefix: config?.keyPrefix, children: children }) }) }) }));
7
+ return (_jsx(SplitSubvariantStoreProvider, { state: config.subvariant === 'split'
8
+ ? config.subvariantOptions || 'swap'
9
+ : undefined, children: _jsx(HeaderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(ChainOrderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(RouteExecutionStoreProvider, { namePrefix: config?.keyPrefix, children: children }) }) }) }));
8
10
  };
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- import type { StoreApi, UseBoundStore } from 'zustand';
2
+ import type { StoreApi } from 'zustand';
3
+ import type { UseBoundStoreWithEqualityFn } from 'zustand/traditional';
3
4
  import type { PersistStoreProviderProps } from '../types';
4
5
  import type { ChainOrderState } from './types';
5
- export type ChainOrderStore = UseBoundStore<StoreApi<ChainOrderState>>;
6
+ export type ChainOrderStore = UseBoundStoreWithEqualityFn<StoreApi<ChainOrderState>>;
6
7
  export declare const ChainOrderStoreContext: import("react").Context<ChainOrderStore | null>;
7
8
  export declare function ChainOrderStoreProvider({ children, ...props }: PersistStoreProviderProps): import("react/jsx-runtime").JSX.Element;
8
9
  export declare function useChainOrderStore<T>(selector: (state: ChainOrderState) => T, equalityFn?: (left: T, right: T) => boolean): T;
@@ -1,4 +1,4 @@
1
1
  import type { PersistStoreProps } from '../types';
2
2
  import type { ChainOrderState } from './types';
3
3
  export declare const maxChainToOrder = 9;
4
- export declare const createChainOrderStore: ({ namePrefix }: PersistStoreProps) => import("zustand").UseBoundStore<import("zustand").StoreApi<ChainOrderState>>;
4
+ export declare const createChainOrderStore: ({ namePrefix }: PersistStoreProps) => import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand").StoreApi<ChainOrderState>>;
@@ -1,7 +1,7 @@
1
- import { create } from 'zustand';
2
1
  import { persist } from 'zustand/middleware';
2
+ import { createWithEqualityFn } from 'zustand/traditional';
3
3
  export const maxChainToOrder = 9;
4
- export const createChainOrderStore = ({ namePrefix }) => create(persist((set, get) => ({
4
+ export const createChainOrderStore = ({ namePrefix }) => createWithEqualityFn(persist((set, get) => ({
5
5
  chainOrder: [],
6
6
  availableChains: [],
7
7
  initializeChains: (chainIds) => {
@@ -46,4 +46,4 @@ export const createChainOrderStore = ({ namePrefix }) => create(persist((set, ge
46
46
  name: `${namePrefix || 'li.fi'}-widget-chains-order`,
47
47
  version: 0,
48
48
  partialize: (state) => ({ chainOrder: state.chainOrder }),
49
- }));
49
+ }), Object.is);
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
- import type { StoreApi, UseBoundStore } from 'zustand';
3
- export type HeaderStore = UseBoundStore<StoreApi<HeaderState>>;
2
+ import type { StoreApi } from 'zustand';
3
+ import type { UseBoundStoreWithEqualityFn } from 'zustand/traditional';
4
+ export type HeaderStore = UseBoundStoreWithEqualityFn<StoreApi<HeaderState>>;
4
5
  export interface HeaderStateBase {
5
6
  element?: React.ReactNode | null;
6
7
  title?: string;
@@ -5,4 +5,4 @@ export declare const HeaderStoreContext: import("react").Context<HeaderStore | n
5
5
  export declare function HeaderStoreProvider({ children, ...props }: PersistStoreProviderProps): import("react/jsx-runtime").JSX.Element;
6
6
  export declare function useHeaderStore<T>(selector: (state: HeaderState) => T, equalityFn?: (left: T, right: T) => boolean): T;
7
7
  export declare function useHeaderStoreContext(): HeaderStore;
8
- export declare const createHeaderStore: ({ namePrefix }: PersistStoreProps) => import("zustand").UseBoundStore<import("zustand").StoreApi<HeaderState>>;
8
+ export declare const createHeaderStore: ({ namePrefix }: PersistStoreProps) => import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand").StoreApi<HeaderState>>;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext, useContext, useRef } from 'react';
3
- import { create } from 'zustand';
3
+ import { createWithEqualityFn } from 'zustand/traditional';
4
4
  export const HeaderStoreContext = createContext(null);
5
5
  export function HeaderStoreProvider({ children, ...props }) {
6
6
  const storeRef = useRef();
@@ -23,7 +23,7 @@ export function useHeaderStoreContext() {
23
23
  }
24
24
  return useStore;
25
25
  }
26
- export const createHeaderStore = ({ namePrefix }) => create((set, get) => ({
26
+ export const createHeaderStore = ({ namePrefix }) => createWithEqualityFn((set, get) => ({
27
27
  setAction: (element) => {
28
28
  set(() => ({
29
29
  element,
@@ -46,4 +46,4 @@ export const createHeaderStore = ({ namePrefix }) => create((set, get) => ({
46
46
  title: undefined,
47
47
  }));
48
48
  },
49
- }));
49
+ }), Object.is);
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- import type { StoreApi, UseBoundStore } from 'zustand';
2
+ import type { StoreApi } from 'zustand';
3
+ import type { UseBoundStoreWithEqualityFn } from 'zustand/traditional';
3
4
  import type { PersistStoreProviderProps } from '../types';
4
5
  import type { RouteExecutionState } from './types';
5
- export type RouteExecutionStore = UseBoundStore<StoreApi<RouteExecutionState>>;
6
+ export type RouteExecutionStore = UseBoundStoreWithEqualityFn<StoreApi<RouteExecutionState>>;
6
7
  export declare const RouteExecutionStoreContext: import("react").Context<RouteExecutionStore | null>;
7
8
  export declare function RouteExecutionStoreProvider({ children, ...props }: PersistStoreProviderProps): import("react/jsx-runtime").JSX.Element;
8
9
  export declare function useRouteExecutionStore<T>(selector: (state: RouteExecutionState) => T, equalityFn?: (left: T, right: T) => boolean): T;
@@ -1,3 +1,3 @@
1
1
  import type { PersistStoreProps } from '../types';
2
2
  import type { RouteExecutionState } from './types';
3
- export declare const createRouteExecutionStore: ({ namePrefix }: PersistStoreProps) => import("zustand").UseBoundStore<import("zustand").StoreApi<RouteExecutionState>>;
3
+ export declare const createRouteExecutionStore: ({ namePrefix }: PersistStoreProps) => import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand").StoreApi<RouteExecutionState>>;
@@ -1,9 +1,9 @@
1
- import { create } from 'zustand';
2
1
  import { persist } from 'zustand/middleware';
2
+ import { createWithEqualityFn } from 'zustand/traditional';
3
3
  import { hasEnumFlag } from '../../utils';
4
4
  import { RouteExecutionStatus } from './types';
5
5
  import { isRouteDone, isRouteFailed, isRoutePartiallyDone, isRouteRefunded, } from './utils';
6
- export const createRouteExecutionStore = ({ namePrefix }) => create(persist((set, get) => ({
6
+ export const createRouteExecutionStore = ({ namePrefix }) => createWithEqualityFn(persist((set, get) => ({
7
7
  routes: {},
8
8
  setExecutableRoute: (route, insurableRouteId) => {
9
9
  if (!get().routes[route.id]) {
@@ -151,7 +151,7 @@ export const createRouteExecutionStore = ({ namePrefix }) => create(persist((set
151
151
  }
152
152
  }
153
153
  catch (error) {
154
- console.log(error);
154
+ console.error(error);
155
155
  }
156
156
  return state;
157
157
  },
@@ -181,4 +181,4 @@ export const createRouteExecutionStore = ({ namePrefix }) => create(persist((set
181
181
  }
182
182
  return persistedState;
183
183
  },
184
- }));
184
+ }), Object.is);
@@ -1,6 +1,7 @@
1
1
  import type { Order } from '@lifi/sdk';
2
2
  import type { PropsWithChildren } from 'react';
3
- import type { StoreApi, UseBoundStore } from 'zustand';
3
+ import type { StoreApi } from 'zustand';
4
+ import type { UseBoundStoreWithEqualityFn } from 'zustand/traditional';
4
5
  import type { Appearance, WidgetConfig } from '../../types';
5
6
  export type ValueSetter<S> = <K extends keyof S>(key: K, value: S[Extract<K, string>]) => void;
6
7
  export type ValuesSetter<S> = <K extends keyof S>(values: Record<K, S[Extract<K, string>]>) => void;
@@ -34,12 +35,13 @@ export interface SendToWalletStore extends SendToWalletState {
34
35
  toggleSendToWallet(): void;
35
36
  setSendToWallet(value: boolean): void;
36
37
  }
38
+ export type SplitSubvariantOptions = 'bridge' | 'swap';
37
39
  export interface SplitSubvariantState {
38
- state?: 'swap' | 'bridge';
39
- setState(state: 'swap' | 'bridge'): void;
40
+ state?: SplitSubvariantOptions;
41
+ setState(state: SplitSubvariantOptions): void;
40
42
  }
41
- export type SplitSubvariantStore = UseBoundStore<StoreApi<SplitSubvariantState>>;
43
+ export type SplitSubvariantStore = UseBoundStoreWithEqualityFn<StoreApi<SplitSubvariantState>>;
42
44
  export interface SplitSubvariantProps {
43
- state?: 'swap' | 'bridge';
45
+ state?: SplitSubvariantOptions;
44
46
  }
45
47
  export type SplitSubvariantProviderProps = PropsWithChildren<SplitSubvariantProps>;
@@ -1,2 +1,2 @@
1
1
  import type { SendToWalletStore } from './types';
2
- export declare const useSendToWalletStore: import("zustand").UseBoundStore<import("zustand").StoreApi<SendToWalletStore>>;
2
+ export declare const useSendToWalletStore: import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand").StoreApi<SendToWalletStore>>;
@@ -1,5 +1,5 @@
1
- import { create } from 'zustand';
2
- export const useSendToWalletStore = create((set) => ({
1
+ import { createWithEqualityFn } from 'zustand/traditional';
2
+ export const useSendToWalletStore = createWithEqualityFn((set) => ({
3
3
  showSendToWallet: false,
4
4
  showSendToWalletDirty: false,
5
5
  toggleSendToWallet: () => set((state) => ({
@@ -10,4 +10,4 @@ export const useSendToWalletStore = create((set) => ({
10
10
  showSendToWallet: value,
11
11
  showSendToWalletDirty: true,
12
12
  }),
13
- }));
13
+ }), Object.is);
@@ -1,6 +1,6 @@
1
1
  import type { WidgetConfig } from '../../types';
2
2
  import type { SettingsProps, SettingsState } from './types';
3
- export declare const defaultConfigurableSettings: Pick<SettingsState, 'routePriority' | 'slippage'>;
3
+ export declare const defaultConfigurableSettings: Pick<SettingsState, 'routePriority' | 'slippage' | 'gasPrice'>;
4
4
  export declare const defaultSettings: SettingsProps;
5
- export declare const useSettingsStore: import("zustand").UseBoundStore<import("zustand").StoreApi<SettingsState>>;
5
+ export declare const useSettingsStore: import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand").StoreApi<SettingsState>>;
6
6
  export declare const setDefaultSettings: (config?: WidgetConfig) => void;
@@ -1,9 +1,10 @@
1
- import { create } from 'zustand';
2
1
  import { persist } from 'zustand/middleware';
2
+ import { createWithEqualityFn } from 'zustand/traditional';
3
3
  import { SettingsToolTypes } from './types';
4
4
  export const defaultConfigurableSettings = {
5
5
  routePriority: 'RECOMMENDED',
6
6
  slippage: '0.5',
7
+ gasPrice: 'normal',
7
8
  };
8
9
  export const defaultSettings = {
9
10
  appearance: 'auto',
@@ -13,7 +14,7 @@ export const defaultSettings = {
13
14
  enabledBridges: [],
14
15
  enabledExchanges: [],
15
16
  };
16
- export const useSettingsStore = create(persist((set, get) => ({
17
+ export const useSettingsStore = createWithEqualityFn(persist((set, get) => ({
17
18
  ...defaultSettings,
18
19
  setValue: (key, value) => set(() => ({
19
20
  [key]: value,
@@ -64,10 +65,10 @@ export const useSettingsStore = create(persist((set, get) => ({
64
65
  }, {}),
65
66
  })),
66
67
  reset: (config, bridges, exchanges) => {
68
+ const { appearance, ...restDefaultSettings } = defaultSettings;
67
69
  set(() => ({
68
- ...defaultSettings,
70
+ ...restDefaultSettings,
69
71
  ...defaultConfigurableSettings,
70
- appearance: config.appearance ?? defaultSettings.appearance,
71
72
  }));
72
73
  get().initializeTools('Bridges', bridges, true);
73
74
  get().initializeTools('Exchanges', exchanges, true);
@@ -97,9 +98,9 @@ export const useSettingsStore = create(persist((set, get) => ({
97
98
  }
98
99
  return persistedState;
99
100
  },
100
- }));
101
+ }), Object.is);
101
102
  export const setDefaultSettings = (config) => {
102
- const { slippage, routePriority, setValue } = useSettingsStore.getState();
103
+ const { slippage, routePriority, setValue, gasPrice } = useSettingsStore.getState();
103
104
  const defaultSlippage = (config?.slippage ||
104
105
  config?.sdkConfig?.defaultRouteOptions?.slippage ||
105
106
  0) * 100;
@@ -113,4 +114,7 @@ export const setDefaultSettings = (config) => {
113
114
  if (!routePriority) {
114
115
  setValue('routePriority', defaultConfigurableSettings.routePriority);
115
116
  }
117
+ if (!gasPrice) {
118
+ setValue('gasPrice', defaultConfigurableSettings.gasPrice);
119
+ }
116
120
  };
@@ -4,4 +4,4 @@ export declare const SplitSubvariantStoreContext: import("react").Context<SplitS
4
4
  export declare function SplitSubvariantStoreProvider({ children, ...props }: SplitSubvariantProviderProps): import("react/jsx-runtime").JSX.Element;
5
5
  export declare function useSplitSubvariantStore<T>(selector: (state: SplitSubvariantState) => T, equalityFn?: (left: T, right: T) => boolean): T;
6
6
  export declare function useSplitSubvariantStoreContext(): SplitSubvariantStore;
7
- export declare const createSplitSubvariantStore: ({ state }: SplitSubvariantProps) => import("zustand").UseBoundStore<import("zustand").StoreApi<SplitSubvariantState>>;
7
+ export declare const createSplitSubvariantStore: ({ state }: SplitSubvariantProps) => import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand").StoreApi<SplitSubvariantState>>;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext, useContext, useRef } from 'react';
3
- import { create } from 'zustand';
3
+ import { createWithEqualityFn } from 'zustand/traditional';
4
4
  export const SplitSubvariantStoreContext = createContext(null);
5
5
  const shouldRecreateStore = (store, props) => {
6
6
  const { state } = store.getState();
7
- return (!state && props.state) || (state && !props.state);
7
+ return state !== props.state;
8
8
  };
9
9
  export function SplitSubvariantStoreProvider({ children, ...props }) {
10
10
  const storeRef = useRef();
@@ -27,11 +27,11 @@ export function useSplitSubvariantStoreContext() {
27
27
  }
28
28
  return useStore;
29
29
  }
30
- export const createSplitSubvariantStore = ({ state }) => create((set) => ({
30
+ export const createSplitSubvariantStore = ({ state }) => createWithEqualityFn((set) => ({
31
31
  state,
32
32
  setState(state) {
33
33
  set(() => ({
34
34
  state,
35
35
  }));
36
36
  },
37
- }));
37
+ }), Object.is);