@lifi/widget 1.28.4 → 1.29.1

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 (184) hide show
  1. package/AppDrawer.style.d.ts +1 -1
  2. package/AppProvider.js +2 -2
  3. package/cjs/AppDrawer.style.d.ts +1 -1
  4. package/cjs/AppProvider.js +2 -2
  5. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +2 -2
  6. package/cjs/components/ActiveSwaps/ActiveSwaps.style.js +1 -1
  7. package/cjs/components/AppContainer.d.ts +2 -2
  8. package/cjs/components/BottomSheet/BottomSheet.d.ts +1 -1
  9. package/cjs/components/Card/Card.d.ts +5 -3
  10. package/cjs/components/Card/Card.js +1 -3
  11. package/cjs/components/ChainSelect/ChainSelect.d.ts +0 -1
  12. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +7 -5
  13. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +2 -2
  14. package/cjs/components/Header/Header.style.d.ts +3 -3
  15. package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
  16. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  17. package/cjs/components/SmallAvatar.d.ts +2 -2
  18. package/cjs/components/Step/CircularProgress.d.ts +0 -1
  19. package/cjs/components/Step/CircularProgress.style.d.ts +2 -2
  20. package/cjs/components/Step/StepList.d.ts +0 -1
  21. package/cjs/components/Step/StepProcess.style.d.ts +1 -1
  22. package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
  23. package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  24. package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
  25. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
  26. package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +1 -1
  27. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +3 -1
  28. package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +6 -6
  29. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
  30. package/cjs/components/Switch.js +1 -1
  31. package/cjs/components/Token/Token.style.d.ts +4 -4
  32. package/cjs/components/Token/Token.style.js +3 -1
  33. package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +4 -4
  34. package/cjs/components/TokenList/TokenList.style.d.ts +1 -1
  35. package/cjs/components/TokenList/TokenList.style.js +1 -1
  36. package/cjs/config/theme.js +22 -27
  37. package/cjs/config/version.d.ts +1 -1
  38. package/cjs/config/version.js +1 -1
  39. package/cjs/hooks/useChains.js +2 -3
  40. package/cjs/hooks/useRouteExecution.js +4 -3
  41. package/cjs/hooks/useTools.js +2 -1
  42. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  43. package/cjs/pages/SelectChainPage/SelectChainPage.style.js +1 -1
  44. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +1 -1
  45. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
  46. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
  47. package/cjs/pages/SelectWalletPage/SelectWalletPage.style.js +1 -1
  48. package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
  49. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  50. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  51. package/cjs/pages/SettingsPage/SettingsPage.d.ts +0 -1
  52. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
  53. package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
  54. package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -4
  55. package/cjs/providers/WalletProvider/WalletProvider.js +1 -1
  56. package/cjs/providers/WidgetProvider/WidgetProvider.js +3 -2
  57. package/cjs/stores/StoreProvider.d.ts +3 -0
  58. package/cjs/stores/StoreProvider.js +13 -0
  59. package/cjs/stores/chains/ChainOrderStore.d.ts +9 -0
  60. package/cjs/stores/chains/ChainOrderStore.js +44 -0
  61. package/cjs/stores/chains/createChainOrderStore.d.ts +4 -0
  62. package/cjs/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +4 -4
  63. package/cjs/stores/chains/index.d.ts +2 -1
  64. package/cjs/stores/chains/index.js +2 -1
  65. package/cjs/stores/chains/types.d.ts +2 -2
  66. package/cjs/stores/chains/useChainOrder.js +2 -2
  67. package/cjs/stores/index.d.ts +1 -0
  68. package/cjs/stores/index.js +1 -0
  69. package/cjs/stores/routes/RouteExecutionStore.d.ts +9 -0
  70. package/cjs/stores/routes/RouteExecutionStore.js +44 -0
  71. package/cjs/stores/routes/createRouteExecutionStore.d.ts +3 -0
  72. package/cjs/stores/routes/{useRouteExecutionStore.js → createRouteExecutionStore.js} +6 -4
  73. package/cjs/stores/routes/index.d.ts +1 -1
  74. package/cjs/stores/routes/index.js +1 -1
  75. package/cjs/stores/routes/types.d.ts +5 -5
  76. package/cjs/stores/routes/useExecutingRoutesIds.js +2 -2
  77. package/cjs/stores/routes/useSetExecutableRoute.js +2 -2
  78. package/cjs/stores/routes/useSwapHistory.js +2 -2
  79. package/cjs/stores/settings/SettingsStore.d.ts +11 -0
  80. package/cjs/stores/settings/SettingsStore.js +58 -0
  81. package/cjs/stores/settings/createSettingsStore.d.ts +5 -0
  82. package/cjs/stores/settings/{useSettingsStore.js → createSettingsStore.js} +4 -19
  83. package/cjs/stores/settings/index.d.ts +1 -1
  84. package/cjs/stores/settings/index.js +1 -1
  85. package/cjs/stores/settings/types.d.ts +4 -4
  86. package/cjs/stores/settings/useAppearance.js +2 -2
  87. package/cjs/stores/settings/useSettings.js +2 -2
  88. package/cjs/stores/types.d.ts +5 -0
  89. package/cjs/stores/types.js +2 -0
  90. package/cjs/types/widget.d.ts +1 -0
  91. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +2 -2
  92. package/components/ActiveSwaps/ActiveSwaps.style.js +1 -1
  93. package/components/AppContainer.d.ts +2 -2
  94. package/components/BottomSheet/BottomSheet.d.ts +1 -1
  95. package/components/Card/Card.d.ts +5 -3
  96. package/components/Card/Card.js +1 -3
  97. package/components/ChainSelect/ChainSelect.d.ts +0 -1
  98. package/components/ChainSelect/ChainSelect.style.d.ts +7 -5
  99. package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +2 -2
  100. package/components/Header/Header.style.d.ts +3 -3
  101. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
  102. package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  103. package/components/SmallAvatar.d.ts +2 -2
  104. package/components/Step/CircularProgress.d.ts +0 -1
  105. package/components/Step/CircularProgress.style.d.ts +2 -2
  106. package/components/Step/StepList.d.ts +0 -1
  107. package/components/Step/StepProcess.style.d.ts +1 -1
  108. package/components/SwapInput/SwapInput.style.d.ts +1 -1
  109. package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  110. package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
  111. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
  112. package/components/SwapRouteCard/SwapRouteCard.style.js +1 -1
  113. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +3 -1
  114. package/components/SwapRoutes/SwapRoutes.style.d.ts +6 -6
  115. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
  116. package/components/Switch.js +1 -1
  117. package/components/Token/Token.style.d.ts +4 -4
  118. package/components/Token/Token.style.js +4 -2
  119. package/components/TokenAvatar/TokenAvatar.style.d.ts +4 -4
  120. package/components/TokenList/TokenList.style.d.ts +1 -1
  121. package/components/TokenList/TokenList.style.js +1 -1
  122. package/config/theme.js +22 -27
  123. package/config/version.d.ts +1 -1
  124. package/config/version.js +1 -1
  125. package/hooks/useChains.js +3 -4
  126. package/hooks/useRouteExecution.js +5 -4
  127. package/hooks/useTools.js +3 -2
  128. package/package.json +11 -11
  129. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  130. package/pages/SelectChainPage/SelectChainPage.style.js +1 -1
  131. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +1 -1
  132. package/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
  133. package/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
  134. package/pages/SelectWalletPage/SelectWalletPage.style.js +1 -1
  135. package/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
  136. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  137. package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  138. package/pages/SettingsPage/SettingsPage.d.ts +0 -1
  139. package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
  140. package/pages/SettingsPage/SlippageInput.d.ts +0 -1
  141. package/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -4
  142. package/providers/WalletProvider/WalletProvider.js +1 -1
  143. package/providers/WidgetProvider/WidgetProvider.js +4 -3
  144. package/stores/StoreProvider.d.ts +3 -0
  145. package/stores/StoreProvider.js +9 -0
  146. package/stores/chains/ChainOrderStore.d.ts +9 -0
  147. package/stores/chains/ChainOrderStore.js +38 -0
  148. package/stores/chains/createChainOrderStore.d.ts +4 -0
  149. package/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +2 -3
  150. package/stores/chains/index.d.ts +2 -1
  151. package/stores/chains/index.js +2 -1
  152. package/stores/chains/types.d.ts +2 -2
  153. package/stores/chains/useChainOrder.js +1 -1
  154. package/stores/index.d.ts +1 -0
  155. package/stores/index.js +1 -0
  156. package/stores/routes/RouteExecutionStore.d.ts +9 -0
  157. package/stores/routes/RouteExecutionStore.js +38 -0
  158. package/stores/routes/createRouteExecutionStore.d.ts +3 -0
  159. package/stores/routes/{useRouteExecutionStore.js → createRouteExecutionStore.js} +4 -3
  160. package/stores/routes/index.d.ts +1 -1
  161. package/stores/routes/index.js +1 -1
  162. package/stores/routes/types.d.ts +5 -5
  163. package/stores/routes/useExecutingRoutesIds.js +1 -1
  164. package/stores/routes/useSetExecutableRoute.js +1 -1
  165. package/stores/routes/useSwapHistory.js +1 -1
  166. package/stores/settings/SettingsStore.d.ts +11 -0
  167. package/stores/settings/SettingsStore.js +51 -0
  168. package/stores/settings/createSettingsStore.d.ts +5 -0
  169. package/stores/settings/{useSettingsStore.js → createSettingsStore.js} +2 -17
  170. package/stores/settings/index.d.ts +1 -1
  171. package/stores/settings/index.js +1 -1
  172. package/stores/settings/types.d.ts +4 -4
  173. package/stores/settings/useAppearance.js +1 -1
  174. package/stores/settings/useSettings.js +1 -1
  175. package/stores/types.d.ts +5 -0
  176. package/stores/types.js +1 -0
  177. package/tsconfig.cjs.tsbuildinfo +1 -1
  178. package/types/widget.d.ts +1 -0
  179. package/cjs/stores/chains/useChainOrderStore.d.ts +0 -17
  180. package/cjs/stores/routes/useRouteExecutionStore.d.ts +0 -16
  181. package/cjs/stores/settings/useSettingsStore.d.ts +0 -44
  182. package/stores/chains/useChainOrderStore.d.ts +0 -17
  183. package/stores/routes/useRouteExecutionStore.d.ts +0 -16
  184. package/stores/settings/useSettingsStore.d.ts +0 -44
package/types/widget.d.ts CHANGED
@@ -77,6 +77,7 @@ export interface WidgetConfig {
77
77
  walletManagement?: WidgetWalletManagement;
78
78
  sdkConfig?: SDKConfig;
79
79
  buildSwapUrl?: boolean;
80
+ localStorageKeyPrefix?: string;
80
81
  bridges?: {
81
82
  allow?: string[];
82
83
  deny?: string[];
@@ -1,17 +0,0 @@
1
- import type { ChainOrderStore } from './types';
2
- export declare const maxChainToOrder = 9;
3
- export declare const useChainOrderStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ChainOrderStore>, "persist"> & {
4
- persist: {
5
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<ChainOrderStore, {
6
- chainOrder: number[];
7
- }>>) => void;
8
- clearStorage: () => void;
9
- rehydrate: () => void | Promise<void>;
10
- hasHydrated: () => boolean;
11
- onHydrate: (fn: (state: ChainOrderStore) => void) => () => void;
12
- onFinishHydration: (fn: (state: ChainOrderStore) => void) => () => void;
13
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<ChainOrderStore, {
14
- chainOrder: number[];
15
- }>>;
16
- };
17
- }>;
@@ -1,16 +0,0 @@
1
- import type { RouteExecutionStore } from './types';
2
- export declare const useRouteExecutionStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<RouteExecutionStore>, "persist"> & {
3
- persist: {
4
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<RouteExecutionStore, {
5
- routes: Partial<Record<string, import("./types").RouteExecution>>;
6
- }>>) => void;
7
- clearStorage: () => void;
8
- rehydrate: () => void | Promise<void>;
9
- hasHydrated: () => boolean;
10
- onHydrate: (fn: (state: RouteExecutionStore) => void) => () => void;
11
- onFinishHydration: (fn: (state: RouteExecutionStore) => void) => () => void;
12
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<RouteExecutionStore, {
13
- routes: Partial<Record<string, import("./types").RouteExecution>>;
14
- }>>;
15
- };
16
- }>;
@@ -1,44 +0,0 @@
1
- import type { WidgetConfig } from '../../types';
2
- import type { SettingsState, SettingsStore } from './types';
3
- export declare const defaultConfigurableSettings: Pick<SettingsState, 'routePriority' | 'slippage'>;
4
- export declare const defaultSettings: SettingsState;
5
- export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SettingsStore>, "persist"> & {
6
- persist: {
7
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<SettingsStore, {
8
- setValue: import("./types").ValueSetter<SettingsState>;
9
- setValues: import("./types").ValuesSetter<SettingsState>;
10
- initializeTools(toolType: import("./types").SettingsToolType, tools: string[]): void;
11
- setTools(toolType: import("./types").SettingsToolType, tools: string[], availableTools: (Pick<import("@lifi/types").Bridge, "key"> | Pick<import("@lifi/types").Exchange, "key">)[]): void;
12
- advancedPreferences: boolean;
13
- appearance: import("../../types").Appearance;
14
- gasPrice?: string | undefined;
15
- language?: string | undefined;
16
- routePriority?: "RECOMMENDED" | "FASTEST" | "CHEAPEST" | "SAFEST" | undefined;
17
- showDestinationWallet: boolean;
18
- slippage?: string | undefined;
19
- _enabledBridges?: Record<string, boolean> | undefined;
20
- _enabledExchanges?: Record<string, boolean> | undefined;
21
- }>>) => void;
22
- clearStorage: () => void;
23
- rehydrate: () => void | Promise<void>;
24
- hasHydrated: () => boolean;
25
- onHydrate: (fn: (state: SettingsStore) => void) => () => void;
26
- onFinishHydration: (fn: (state: SettingsStore) => void) => () => void;
27
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<SettingsStore, {
28
- setValue: import("./types").ValueSetter<SettingsState>;
29
- setValues: import("./types").ValuesSetter<SettingsState>;
30
- initializeTools(toolType: import("./types").SettingsToolType, tools: string[]): void;
31
- setTools(toolType: import("./types").SettingsToolType, tools: string[], availableTools: (Pick<import("@lifi/types").Bridge, "key"> | Pick<import("@lifi/types").Exchange, "key">)[]): void;
32
- advancedPreferences: boolean;
33
- appearance: import("../../types").Appearance;
34
- gasPrice?: string | undefined;
35
- language?: string | undefined;
36
- routePriority?: "RECOMMENDED" | "FASTEST" | "CHEAPEST" | "SAFEST" | undefined;
37
- showDestinationWallet: boolean;
38
- slippage?: string | undefined;
39
- _enabledBridges?: Record<string, boolean> | undefined;
40
- _enabledExchanges?: Record<string, boolean> | undefined;
41
- }>>;
42
- };
43
- }>;
44
- export declare const setDefaultSettings: (config?: WidgetConfig) => void;
@@ -1,17 +0,0 @@
1
- import type { ChainOrderStore } from './types';
2
- export declare const maxChainToOrder = 9;
3
- export declare const useChainOrderStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ChainOrderStore>, "persist"> & {
4
- persist: {
5
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<ChainOrderStore, {
6
- chainOrder: number[];
7
- }>>) => void;
8
- clearStorage: () => void;
9
- rehydrate: () => void | Promise<void>;
10
- hasHydrated: () => boolean;
11
- onHydrate: (fn: (state: ChainOrderStore) => void) => () => void;
12
- onFinishHydration: (fn: (state: ChainOrderStore) => void) => () => void;
13
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<ChainOrderStore, {
14
- chainOrder: number[];
15
- }>>;
16
- };
17
- }>;
@@ -1,16 +0,0 @@
1
- import type { RouteExecutionStore } from './types';
2
- export declare const useRouteExecutionStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<RouteExecutionStore>, "persist"> & {
3
- persist: {
4
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<RouteExecutionStore, {
5
- routes: Partial<Record<string, import("./types").RouteExecution>>;
6
- }>>) => void;
7
- clearStorage: () => void;
8
- rehydrate: () => void | Promise<void>;
9
- hasHydrated: () => boolean;
10
- onHydrate: (fn: (state: RouteExecutionStore) => void) => () => void;
11
- onFinishHydration: (fn: (state: RouteExecutionStore) => void) => () => void;
12
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<RouteExecutionStore, {
13
- routes: Partial<Record<string, import("./types").RouteExecution>>;
14
- }>>;
15
- };
16
- }>;
@@ -1,44 +0,0 @@
1
- import type { WidgetConfig } from '../../types';
2
- import type { SettingsState, SettingsStore } from './types';
3
- export declare const defaultConfigurableSettings: Pick<SettingsState, 'routePriority' | 'slippage'>;
4
- export declare const defaultSettings: SettingsState;
5
- export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SettingsStore>, "persist"> & {
6
- persist: {
7
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<SettingsStore, {
8
- setValue: import("./types").ValueSetter<SettingsState>;
9
- setValues: import("./types").ValuesSetter<SettingsState>;
10
- initializeTools(toolType: import("./types").SettingsToolType, tools: string[]): void;
11
- setTools(toolType: import("./types").SettingsToolType, tools: string[], availableTools: (Pick<import("@lifi/types").Bridge, "key"> | Pick<import("@lifi/types").Exchange, "key">)[]): void;
12
- advancedPreferences: boolean;
13
- appearance: import("../../types").Appearance;
14
- gasPrice?: string | undefined;
15
- language?: string | undefined;
16
- routePriority?: "RECOMMENDED" | "FASTEST" | "CHEAPEST" | "SAFEST" | undefined;
17
- showDestinationWallet: boolean;
18
- slippage?: string | undefined;
19
- _enabledBridges?: Record<string, boolean> | undefined;
20
- _enabledExchanges?: Record<string, boolean> | undefined;
21
- }>>) => void;
22
- clearStorage: () => void;
23
- rehydrate: () => void | Promise<void>;
24
- hasHydrated: () => boolean;
25
- onHydrate: (fn: (state: SettingsStore) => void) => () => void;
26
- onFinishHydration: (fn: (state: SettingsStore) => void) => () => void;
27
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<SettingsStore, {
28
- setValue: import("./types").ValueSetter<SettingsState>;
29
- setValues: import("./types").ValuesSetter<SettingsState>;
30
- initializeTools(toolType: import("./types").SettingsToolType, tools: string[]): void;
31
- setTools(toolType: import("./types").SettingsToolType, tools: string[], availableTools: (Pick<import("@lifi/types").Bridge, "key"> | Pick<import("@lifi/types").Exchange, "key">)[]): void;
32
- advancedPreferences: boolean;
33
- appearance: import("../../types").Appearance;
34
- gasPrice?: string | undefined;
35
- language?: string | undefined;
36
- routePriority?: "RECOMMENDED" | "FASTEST" | "CHEAPEST" | "SAFEST" | undefined;
37
- showDestinationWallet: boolean;
38
- slippage?: string | undefined;
39
- _enabledBridges?: Record<string, boolean> | undefined;
40
- _enabledExchanges?: Record<string, boolean> | undefined;
41
- }>>;
42
- };
43
- }>;
44
- export declare const setDefaultSettings: (config?: WidgetConfig) => void;