@lifi/widget 1.15.0 → 1.16.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 (289) hide show
  1. package/App.js +21 -0
  2. package/AppProvider.d.ts +0 -4
  3. package/AppProvider.js +2 -10
  4. package/cjs/App.js +21 -0
  5. package/cjs/AppProvider.d.ts +0 -4
  6. package/cjs/AppProvider.js +3 -12
  7. package/cjs/components/ActiveSwaps/ActiveSwapItem.d.ts +5 -0
  8. package/cjs/components/ActiveSwaps/ActiveSwapItem.js +45 -0
  9. package/cjs/components/{SwapsInProgress/SwapsInProgress.d.ts → ActiveSwaps/ActiveSwaps.d.ts} +1 -1
  10. package/cjs/components/ActiveSwaps/ActiveSwaps.js +30 -0
  11. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +78 -0
  12. package/cjs/components/ActiveSwaps/ActiveSwaps.style.js +40 -0
  13. package/cjs/components/ActiveSwaps/index.d.ts +2 -0
  14. package/cjs/components/ActiveSwaps/index.js +18 -0
  15. package/cjs/components/AppContainer.js +2 -2
  16. package/cjs/components/Card/Card.d.ts +7 -4
  17. package/cjs/components/Card/Card.js +38 -28
  18. package/cjs/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +0 -0
  19. package/cjs/components/ChainSelect/ChainSelect.js +35 -0
  20. package/cjs/components/{SwapsInProgress/SwapsInProgress.style.d.ts → ChainSelect/ChainSelect.style.d.ts} +10 -19
  21. package/cjs/components/ChainSelect/ChainSelect.style.js +19 -0
  22. package/cjs/components/ChainSelect/index.d.ts +2 -0
  23. package/cjs/components/ChainSelect/index.js +18 -0
  24. package/cjs/components/ChainSelect/useChainSelect.d.ts +8 -0
  25. package/cjs/components/ChainSelect/useChainSelect.js +33 -0
  26. package/cjs/components/Header/Header.js +1 -9
  27. package/cjs/components/Header/NavigationHeader.js +6 -11
  28. package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  29. package/cjs/components/PoweredBy/PoweredBy.style.js +1 -0
  30. package/cjs/components/SelectChainAndToken.js +5 -5
  31. package/cjs/components/SendToWallet/SendToWallet.js +6 -6
  32. package/cjs/components/Step/CircularProgress.js +1 -1
  33. package/cjs/components/Step/CircularProgress.style.js +1 -1
  34. package/cjs/components/Step/StepProcess.js +1 -5
  35. package/cjs/components/Step/StepProcess.style.d.ts +1 -1
  36. package/cjs/components/Step/StepTimer.d.ts +1 -0
  37. package/cjs/components/Step/StepTimer.js +6 -6
  38. package/cjs/components/SwapButton/SwapButton.js +5 -12
  39. package/cjs/components/SwapButton/types.d.ts +2 -2
  40. package/cjs/components/SwapRouteCard/SwapRouteCard.js +1 -1
  41. package/cjs/components/TokenAvatar/TokenAvatar.style.js +0 -3
  42. package/cjs/components/TokenList/TokenList.js +6 -2
  43. package/cjs/config/theme.js +24 -23
  44. package/cjs/config/version.d.ts +1 -1
  45. package/cjs/config/version.js +1 -1
  46. package/cjs/hooks/index.d.ts +2 -0
  47. package/cjs/hooks/index.js +2 -0
  48. package/cjs/hooks/useChains.d.ts +1 -97
  49. package/cjs/hooks/useChains.js +12 -19
  50. package/cjs/hooks/useFeaturedTokens.js +2 -2
  51. package/cjs/hooks/useGasSufficiency.js +6 -7
  52. package/cjs/hooks/useInitializer.js +6 -0
  53. package/cjs/{components/Step/utils.d.ts → hooks/useProcessMessage.d.ts} +4 -0
  54. package/cjs/{components/Step/utils.js → hooks/useProcessMessage.js} +16 -10
  55. package/cjs/hooks/useRouteExecution.d.ts +1 -1
  56. package/cjs/hooks/useRouteExecution.js +26 -35
  57. package/cjs/hooks/useSwapRoutes.js +10 -11
  58. package/cjs/hooks/useTokenBalances.js +4 -4
  59. package/cjs/hooks/useTokenSearch.js +3 -2
  60. package/cjs/hooks/useTokens.js +3 -2
  61. package/cjs/hooks/useTools.js +3 -2
  62. package/cjs/hooks/useWidgetEvents.d.ts +3 -0
  63. package/cjs/hooks/useWidgetEvents.js +13 -0
  64. package/cjs/i18n/en/translation.json +13 -8
  65. package/cjs/i18n/index.d.ts +10 -5
  66. package/cjs/index.d.ts +1 -0
  67. package/cjs/index.js +3 -1
  68. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +2 -0
  69. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +18 -0
  70. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +2 -0
  71. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +21 -0
  72. package/cjs/pages/ActiveSwapsPage/index.d.ts +1 -0
  73. package/cjs/{components/SwapsInProgress → pages/ActiveSwapsPage}/index.js +1 -1
  74. package/cjs/pages/MainPage/MainPage.js +2 -3
  75. package/cjs/pages/MainPage/MainSwapButton.js +3 -1
  76. package/cjs/pages/MainPage/SwapRoutes.js +4 -1
  77. package/cjs/pages/SelectChainPage/SelectChainPage.d.ts +3 -0
  78. package/cjs/pages/SelectChainPage/SelectChainPage.js +33 -0
  79. package/cjs/pages/SelectChainPage/SelectChainPage.style.d.ts +21 -0
  80. package/cjs/pages/SelectChainPage/SelectChainPage.style.js +20 -0
  81. package/cjs/pages/SelectChainPage/index.d.ts +1 -0
  82. package/cjs/pages/SelectChainPage/index.js +17 -0
  83. package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
  84. package/cjs/pages/SelectTokenPage/SelectTokenPage.js +2 -2
  85. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +4 -4
  86. package/cjs/pages/SelectWalletPage/SelectWalletPage.style.d.ts +2 -27
  87. package/cjs/pages/SelectWalletPage/SelectWalletPage.style.js +4 -14
  88. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  89. package/cjs/pages/SettingsPage/EnabledBridgesSelect.js +3 -6
  90. package/cjs/pages/SettingsPage/EnabledExchangesSelect.js +3 -5
  91. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +5 -1
  92. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
  93. package/cjs/pages/SwapPage/StatusBottomSheet.js +25 -36
  94. package/cjs/pages/SwapPage/SwapPage.js +5 -1
  95. package/cjs/providers/SDKProvider/SDKProvider.d.ts +4 -0
  96. package/cjs/providers/SDKProvider/SDKProvider.js +27 -0
  97. package/cjs/providers/SDKProvider/index.d.ts +1 -0
  98. package/cjs/providers/SDKProvider/index.js +17 -0
  99. package/cjs/providers/SwapFormProvider/SwapFormProvider.js +39 -11
  100. package/cjs/providers/TelemetryProvider/TelemetryProvider.d.ts +4 -0
  101. package/cjs/providers/TelemetryProvider/TelemetryProvider.js +11 -0
  102. package/cjs/providers/TelemetryProvider/index.d.ts +1 -0
  103. package/cjs/providers/TelemetryProvider/index.js +17 -0
  104. package/cjs/providers/WalletProvider/WalletProvider.d.ts +1 -4
  105. package/cjs/providers/WalletProvider/WalletProvider.js +10 -3
  106. package/cjs/providers/WidgetProvider/WidgetProvider.js +1 -16
  107. package/cjs/providers/index.d.ts +2 -0
  108. package/cjs/providers/index.js +2 -0
  109. package/cjs/stores/chains/index.d.ts +4 -0
  110. package/cjs/stores/chains/index.js +20 -0
  111. package/cjs/stores/chains/types.d.ts +8 -0
  112. package/cjs/stores/chains/types.js +2 -0
  113. package/cjs/stores/chains/useChainOrder.d.ts +1 -0
  114. package/cjs/stores/chains/useChainOrder.js +12 -0
  115. package/cjs/stores/chains/useChainOrderStore.d.ts +19 -0
  116. package/cjs/stores/chains/useChainOrderStore.js +42 -0
  117. package/cjs/stores/chains/useInitializeChainOrder.d.ts +1 -0
  118. package/cjs/stores/chains/useInitializeChainOrder.js +12 -0
  119. package/cjs/stores/route/index.d.ts +2 -1
  120. package/cjs/stores/route/index.js +2 -1
  121. package/cjs/stores/route/useExecutingRoutesIds.d.ts +1 -0
  122. package/cjs/stores/route/useExecutingRoutesIds.js +20 -0
  123. package/cjs/stores/route/useRouteStore.js +5 -4
  124. package/cjs/stores/route/utils.d.ts +4 -0
  125. package/cjs/stores/route/utils.js +21 -0
  126. package/cjs/stores/settings/useSettingsStore.js +5 -2
  127. package/cjs/types/events.d.ts +5 -0
  128. package/cjs/types/events.js +9 -0
  129. package/cjs/types/index.d.ts +1 -0
  130. package/cjs/types/index.js +1 -0
  131. package/cjs/types/widget.d.ts +2 -1
  132. package/cjs/utils/colors.d.ts +1 -1
  133. package/cjs/utils/navigationRoutes.d.ts +5 -0
  134. package/cjs/utils/navigationRoutes.js +31 -4
  135. package/components/ActiveSwaps/ActiveSwapItem.d.ts +5 -0
  136. package/components/ActiveSwaps/ActiveSwapItem.js +41 -0
  137. package/components/{SwapsInProgress/SwapsInProgress.d.ts → ActiveSwaps/ActiveSwaps.d.ts} +1 -1
  138. package/components/ActiveSwaps/ActiveSwaps.js +26 -0
  139. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +78 -0
  140. package/components/ActiveSwaps/ActiveSwaps.style.js +37 -0
  141. package/components/ActiveSwaps/index.d.ts +2 -0
  142. package/components/ActiveSwaps/index.js +2 -0
  143. package/components/AppContainer.js +1 -1
  144. package/components/Card/Card.d.ts +7 -4
  145. package/components/Card/Card.js +39 -29
  146. package/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +0 -0
  147. package/components/ChainSelect/ChainSelect.js +31 -0
  148. package/components/{SwapsInProgress/SwapsInProgress.style.d.ts → ChainSelect/ChainSelect.style.d.ts} +10 -19
  149. package/components/ChainSelect/ChainSelect.style.js +16 -0
  150. package/components/ChainSelect/index.d.ts +2 -0
  151. package/components/ChainSelect/index.js +2 -0
  152. package/components/ChainSelect/useChainSelect.d.ts +8 -0
  153. package/components/ChainSelect/useChainSelect.js +29 -0
  154. package/components/Header/Header.js +1 -9
  155. package/components/Header/NavigationHeader.js +6 -11
  156. package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  157. package/components/PoweredBy/PoweredBy.style.js +1 -0
  158. package/components/SelectChainAndToken.js +1 -1
  159. package/components/SendToWallet/SendToWallet.js +6 -6
  160. package/components/Step/CircularProgress.js +3 -3
  161. package/components/Step/CircularProgress.style.js +1 -1
  162. package/components/Step/StepProcess.js +2 -6
  163. package/components/Step/StepProcess.style.d.ts +1 -1
  164. package/components/Step/StepTimer.d.ts +1 -0
  165. package/components/Step/StepTimer.js +6 -6
  166. package/components/SwapButton/SwapButton.js +6 -13
  167. package/components/SwapButton/types.d.ts +2 -2
  168. package/components/SwapRouteCard/SwapRouteCard.js +1 -1
  169. package/components/TokenAvatar/TokenAvatar.style.js +0 -3
  170. package/components/TokenList/TokenList.js +6 -2
  171. package/config/theme.js +24 -23
  172. package/config/version.d.ts +1 -1
  173. package/config/version.js +1 -1
  174. package/hooks/index.d.ts +2 -0
  175. package/hooks/index.js +2 -0
  176. package/hooks/useChains.d.ts +1 -97
  177. package/hooks/useChains.js +11 -18
  178. package/hooks/useFeaturedTokens.js +1 -1
  179. package/hooks/useGasSufficiency.js +1 -2
  180. package/hooks/useInitializer.js +6 -0
  181. package/{components/Step/utils.d.ts → hooks/useProcessMessage.d.ts} +4 -0
  182. package/{pages/SwapPage/utils.js → hooks/useProcessMessage.js} +15 -10
  183. package/hooks/useRouteExecution.d.ts +1 -1
  184. package/hooks/useRouteExecution.js +26 -35
  185. package/hooks/useSwapRoutes.js +3 -4
  186. package/hooks/useTokenBalances.js +3 -3
  187. package/hooks/useTokenSearch.js +3 -2
  188. package/hooks/useTokens.js +3 -2
  189. package/hooks/useTools.js +3 -2
  190. package/hooks/useWidgetEvents.d.ts +3 -0
  191. package/hooks/useWidgetEvents.js +6 -0
  192. package/i18n/en/translation.json +13 -8
  193. package/i18n/index.d.ts +10 -5
  194. package/index.d.ts +1 -0
  195. package/index.js +1 -0
  196. package/package.json +14 -13
  197. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +2 -0
  198. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +14 -0
  199. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +2 -0
  200. package/pages/ActiveSwapsPage/ActiveSwapsPage.js +17 -0
  201. package/pages/ActiveSwapsPage/index.d.ts +1 -0
  202. package/pages/ActiveSwapsPage/index.js +1 -0
  203. package/pages/MainPage/MainPage.js +2 -3
  204. package/pages/MainPage/MainSwapButton.js +3 -1
  205. package/pages/MainPage/SwapRoutes.js +4 -1
  206. package/pages/SelectChainPage/SelectChainPage.d.ts +3 -0
  207. package/pages/SelectChainPage/SelectChainPage.js +29 -0
  208. package/pages/SelectChainPage/SelectChainPage.style.d.ts +21 -0
  209. package/pages/SelectChainPage/SelectChainPage.style.js +17 -0
  210. package/pages/SelectChainPage/index.d.ts +1 -0
  211. package/pages/SelectChainPage/index.js +1 -0
  212. package/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
  213. package/pages/SelectTokenPage/SelectTokenPage.js +2 -2
  214. package/pages/SelectWalletPage/SelectWalletPage.js +5 -5
  215. package/pages/SelectWalletPage/SelectWalletPage.style.d.ts +2 -27
  216. package/pages/SelectWalletPage/SelectWalletPage.style.js +4 -14
  217. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  218. package/pages/SettingsPage/EnabledBridgesSelect.js +4 -7
  219. package/pages/SettingsPage/EnabledExchangesSelect.js +4 -6
  220. package/pages/SettingsPage/RoutePrioritySelect.js +5 -1
  221. package/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
  222. package/pages/SwapPage/StatusBottomSheet.js +27 -38
  223. package/pages/SwapPage/SwapPage.js +5 -1
  224. package/providers/SDKProvider/SDKProvider.d.ts +4 -0
  225. package/providers/SDKProvider/SDKProvider.js +19 -0
  226. package/providers/SDKProvider/index.d.ts +1 -0
  227. package/providers/SDKProvider/index.js +1 -0
  228. package/providers/SwapFormProvider/SwapFormProvider.js +39 -11
  229. package/providers/TelemetryProvider/TelemetryProvider.d.ts +4 -0
  230. package/providers/TelemetryProvider/TelemetryProvider.js +7 -0
  231. package/providers/TelemetryProvider/index.d.ts +1 -0
  232. package/providers/TelemetryProvider/index.js +1 -0
  233. package/providers/WalletProvider/WalletProvider.d.ts +1 -4
  234. package/providers/WalletProvider/WalletProvider.js +10 -3
  235. package/providers/WidgetProvider/WidgetProvider.js +3 -18
  236. package/providers/index.d.ts +2 -0
  237. package/providers/index.js +2 -0
  238. package/stores/chains/index.d.ts +4 -0
  239. package/stores/chains/index.js +4 -0
  240. package/stores/chains/types.d.ts +8 -0
  241. package/stores/chains/types.js +1 -0
  242. package/stores/chains/useChainOrder.d.ts +1 -0
  243. package/stores/chains/useChainOrder.js +5 -0
  244. package/stores/chains/useChainOrderStore.d.ts +19 -0
  245. package/stores/chains/useChainOrderStore.js +36 -0
  246. package/stores/chains/useInitializeChainOrder.d.ts +1 -0
  247. package/stores/chains/useInitializeChainOrder.js +5 -0
  248. package/stores/route/index.d.ts +2 -1
  249. package/stores/route/index.js +2 -1
  250. package/stores/route/useExecutingRoutesIds.d.ts +1 -0
  251. package/stores/route/useExecutingRoutesIds.js +13 -0
  252. package/stores/route/useRouteStore.js +5 -4
  253. package/stores/route/utils.d.ts +4 -0
  254. package/stores/route/utils.js +15 -0
  255. package/stores/settings/useSettingsStore.js +5 -2
  256. package/tsconfig.cjs.tsbuildinfo +1 -1
  257. package/types/events.d.ts +5 -0
  258. package/types/events.js +6 -0
  259. package/types/index.d.ts +1 -0
  260. package/types/index.js +1 -0
  261. package/types/widget.d.ts +2 -1
  262. package/utils/colors.d.ts +1 -1
  263. package/utils/navigationRoutes.d.ts +5 -0
  264. package/utils/navigationRoutes.js +30 -3
  265. package/cjs/components/SwapButton/SwapButton.style.d.ts +0 -65
  266. package/cjs/components/SwapButton/SwapButton.style.js +0 -15
  267. package/cjs/components/SwapsInProgress/SwapsInProgress.js +0 -29
  268. package/cjs/components/SwapsInProgress/SwapsInProgress.style.js +0 -17
  269. package/cjs/components/SwapsInProgress/index.d.ts +0 -1
  270. package/cjs/config/lifi.d.ts +0 -4
  271. package/cjs/config/lifi.js +0 -14
  272. package/cjs/pages/SelectTokenPage/ChainSelect.js +0 -31
  273. package/cjs/pages/SwapPage/utils.d.ts +0 -6
  274. package/cjs/pages/SwapPage/utils.js +0 -93
  275. package/cjs/stores/route/useExecutingRoutes.d.ts +0 -2
  276. package/cjs/stores/route/useExecutingRoutes.js +0 -13
  277. package/components/Step/utils.js +0 -89
  278. package/components/SwapButton/SwapButton.style.d.ts +0 -65
  279. package/components/SwapButton/SwapButton.style.js +0 -12
  280. package/components/SwapsInProgress/SwapsInProgress.js +0 -25
  281. package/components/SwapsInProgress/SwapsInProgress.style.js +0 -14
  282. package/components/SwapsInProgress/index.d.ts +0 -1
  283. package/components/SwapsInProgress/index.js +0 -1
  284. package/config/lifi.d.ts +0 -4
  285. package/config/lifi.js +0 -7
  286. package/pages/SelectTokenPage/ChainSelect.js +0 -27
  287. package/pages/SwapPage/utils.d.ts +0 -6
  288. package/stores/route/useExecutingRoutes.d.ts +0 -2
  289. package/stores/route/useExecutingRoutes.js +0 -6
@@ -1,101 +1,5 @@
1
1
  export declare const useChains: () => {
2
- error: unknown;
3
- isError: true;
4
- isLoading: false;
5
- isLoadingError: false;
6
- isRefetchError: true;
7
- isSuccess: false;
8
- status: "error";
9
- dataUpdatedAt: number;
10
- errorUpdatedAt: number;
11
- failureCount: number;
12
- errorUpdateCount: number;
13
- isFetched: boolean;
14
- isFetchedAfterMount: boolean;
15
- isFetching: boolean;
16
- isPaused: boolean;
17
- isPlaceholderData: boolean;
18
- isPreviousData: boolean;
19
- isRefetching: boolean;
20
- isStale: boolean;
21
- refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@lifi/types").EVMChain[], unknown>>;
22
- remove: () => void;
23
- fetchStatus: import("@tanstack/react-query").FetchStatus;
24
- chains: import("@lifi/types").EVMChain[] | undefined;
25
- getChainById: (chainId: number) => import("@lifi/types").EVMChain | undefined;
26
- } | {
27
- error: null;
28
- isError: false;
29
- isLoading: false;
30
- isLoadingError: false;
31
- isRefetchError: false;
32
- isSuccess: true;
33
- status: "success";
34
- dataUpdatedAt: number;
35
- errorUpdatedAt: number;
36
- failureCount: number;
37
- errorUpdateCount: number;
38
- isFetched: boolean;
39
- isFetchedAfterMount: boolean;
40
- isFetching: boolean;
41
- isPaused: boolean;
42
- isPlaceholderData: boolean;
43
- isPreviousData: boolean;
44
- isRefetching: boolean;
45
- isStale: boolean;
46
- refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@lifi/types").EVMChain[], unknown>>;
47
- remove: () => void;
48
- fetchStatus: import("@tanstack/react-query").FetchStatus;
49
- chains: import("@lifi/types").EVMChain[] | undefined;
50
- getChainById: (chainId: number) => import("@lifi/types").EVMChain | undefined;
51
- } | {
52
- error: unknown;
53
- isError: true;
54
- isLoading: false;
55
- isLoadingError: true;
56
- isRefetchError: false;
57
- isSuccess: false;
58
- status: "error";
59
- dataUpdatedAt: number;
60
- errorUpdatedAt: number;
61
- failureCount: number;
62
- errorUpdateCount: number;
63
- isFetched: boolean;
64
- isFetchedAfterMount: boolean;
65
- isFetching: boolean;
66
- isPaused: boolean;
67
- isPlaceholderData: boolean;
68
- isPreviousData: boolean;
69
- isRefetching: boolean;
70
- isStale: boolean;
71
- refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@lifi/types").EVMChain[], unknown>>;
72
- remove: () => void;
73
- fetchStatus: import("@tanstack/react-query").FetchStatus;
74
- chains: import("@lifi/types").EVMChain[] | undefined;
75
- getChainById: (chainId: number) => import("@lifi/types").EVMChain | undefined;
76
- } | {
77
- error: null;
78
- isError: false;
79
- isLoading: true;
80
- isLoadingError: false;
81
- isRefetchError: false;
82
- isSuccess: false;
83
- status: "loading";
84
- dataUpdatedAt: number;
85
- errorUpdatedAt: number;
86
- failureCount: number;
87
- errorUpdateCount: number;
88
- isFetched: boolean;
89
- isFetchedAfterMount: boolean;
90
- isFetching: boolean;
91
- isPaused: boolean;
92
- isPlaceholderData: boolean;
93
- isPreviousData: boolean;
94
- isRefetching: boolean;
95
- isStale: boolean;
96
- refetch: <TPageData>(options?: (import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@lifi/types").EVMChain[], unknown>>;
97
- remove: () => void;
98
- fetchStatus: import("@tanstack/react-query").FetchStatus;
99
2
  chains: import("@lifi/types").EVMChain[] | undefined;
100
3
  getChainById: (chainId: number) => import("@lifi/types").EVMChain | undefined;
4
+ isLoading: boolean;
101
5
  };
@@ -7,27 +7,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- var __rest = (this && this.__rest) || function (s, e) {
11
- var t = {};
12
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
- t[p] = s[p];
14
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
- t[p[i]] = s[p[i]];
18
- }
19
- return t;
20
- };
21
10
  import { useQuery } from '@tanstack/react-query';
22
11
  import { useCallback } from 'react';
23
- import { LiFi } from '../config/lifi';
24
- import { useWidgetConfig } from '../providers/WidgetProvider';
12
+ import { useLiFi, useWidgetConfig } from '../providers';
13
+ import { useSetChainOrder } from '../stores/chains';
25
14
  export const useChains = () => {
26
15
  const { disabledChains } = useWidgetConfig();
27
- const _a = useQuery(['chains'], () => __awaiter(void 0, void 0, void 0, function* () {
28
- const chains = yield LiFi.getChains();
29
- return chains.filter((chain) => !(disabledChains === null || disabledChains === void 0 ? void 0 : disabledChains.includes(chain.id)));
30
- })), { data } = _a, other = __rest(_a, ["data"]);
16
+ const lifi = useLiFi();
17
+ const [, initializeChains] = useSetChainOrder();
18
+ const { data, isLoading } = useQuery(['chains'], () => __awaiter(void 0, void 0, void 0, function* () {
19
+ const chains = yield lifi.getChains();
20
+ const filteredChains = chains.filter((chain) => !(disabledChains === null || disabledChains === void 0 ? void 0 : disabledChains.includes(chain.id)));
21
+ initializeChains(filteredChains.map((chain) => chain.id));
22
+ return filteredChains;
23
+ }));
31
24
  const getChainById = useCallback((chainId) => {
32
25
  const chain = data === null || data === void 0 ? void 0 : data.find((chain) => chain.id === chainId);
33
26
  // if (!chain) {
@@ -35,5 +28,5 @@ export const useChains = () => {
35
28
  // }
36
29
  return chain;
37
30
  }, [data]);
38
- return Object.assign({ chains: data, getChainById }, other);
31
+ return { chains: data, getChainById, isLoading };
39
32
  };
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from 'react';
2
- import { useWidgetConfig } from '../providers/WidgetProvider';
2
+ import { useWidgetConfig } from '../providers';
3
3
  export const useFeaturedTokens = (selectedChainId) => {
4
4
  const { featuredTokens } = useWidgetConfig();
5
5
  return useMemo(() => featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.filter((token) => token.chainId === selectedChainId), [featuredTokens, selectedChainId]);
@@ -2,8 +2,7 @@ import Big from 'big.js';
2
2
  import { useMemo } from 'react';
3
3
  import { useWatch } from 'react-hook-form';
4
4
  import { useChains, useDebouncedWatch } from '.';
5
- import { SwapFormKey, SwapFormKeyHelper } from '../providers/SwapFormProvider';
6
- import { useWallet } from '../providers/WalletProvider';
5
+ import { SwapFormKey, SwapFormKeyHelper, useWallet } from '../providers';
7
6
  import { useTokenBalances } from './useTokenBalances';
8
7
  export const useGasSufficiency = (route) => {
9
8
  const { account } = useWallet();
@@ -1,5 +1,11 @@
1
1
  /* eslint-disable no-underscore-dangle */
2
+ import { checkPackageUpdates } from '@lifi/sdk';
3
+ import { useEffect } from 'react';
4
+ import { name, version } from '../config/version';
2
5
  import { useTools } from './useTools';
3
6
  export const useInitializer = () => {
4
7
  useTools();
8
+ useEffect(() => {
9
+ checkPackageUpdates(name, version);
10
+ }, []);
5
11
  };
@@ -1,5 +1,9 @@
1
1
  import type { EVMChain, Process, Step } from '@lifi/sdk';
2
2
  import type { TFunction } from 'react-i18next';
3
+ export declare const useProcessMessage: (step?: Step, process?: Process) => {
4
+ title?: string | undefined;
5
+ message?: string | undefined;
6
+ };
3
7
  export declare function getProcessMessage(t: TFunction<'translation', undefined>, getChainById: (chainId: number) => EVMChain | undefined, step: Step, process: Process): {
4
8
  title?: string;
5
9
  message?: string;
@@ -1,9 +1,14 @@
1
- import { LifiErrorCode, MetaMaskProviderErrorCode } from '@lifi/sdk';
2
- import { formatTokenAmount } from '../../utils';
3
- const formatProcessMessage = (initialMessage, args = {}) => {
4
- return Object.keys(args).reduce((message, key) => {
5
- return message.replace(`{${key}}`, args[key]);
6
- }, initialMessage);
1
+ import { LifiErrorCode } from '@lifi/sdk';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { formatTokenAmount } from '../utils';
4
+ import { useChains } from './useChains';
5
+ export const useProcessMessage = (step, process) => {
6
+ const { t } = useTranslation();
7
+ const { getChainById } = useChains();
8
+ if (!step || !process) {
9
+ return {};
10
+ }
11
+ return getProcessMessage(t, getChainById, step, process);
7
12
  };
8
13
  const processMessages = {
9
14
  TOKEN_ALLOWANCE: {
@@ -12,7 +17,7 @@ const processMessages = {
12
17
  DONE: (t) => t(`swap.process.tokenAllowance.done`),
13
18
  },
14
19
  SWITCH_CHAIN: {
15
- PENDING: (t) => t(`swap.process.switchChain.pending`),
20
+ ACTION_REQUIRED: (t) => t(`swap.process.switchChain.actionRequired`),
16
21
  DONE: (t) => t(`swap.process.switchChain.done`),
17
22
  },
18
23
  SWAP: {
@@ -67,9 +72,9 @@ export function getProcessMessage(t, getChainById, step, process) {
67
72
  title = t(`swap.error.title.slippageTooLarge`);
68
73
  message = t(`swap.error.message.slippageTooLarge`);
69
74
  break;
70
- case MetaMaskProviderErrorCode.userRejectedRequest:
71
- title = t(`swap.error.title.userRejectedSignatureRequest`);
72
- message = t(`swap.error.message.signatureRequired`, {
75
+ case LifiErrorCode.TransactionRejected:
76
+ title = t(`swap.error.title.transactionRejected`);
77
+ message = t(`swap.error.message.transactionRejected`, {
73
78
  amount: formatTokenAmount(step.action.fromAmount, step.action.fromToken.decimals),
74
79
  tokenSymbol: step.action.fromToken.symbol,
75
80
  chainName: (_b = (_a = getChainById(step.action.fromChainId)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '',
@@ -1,5 +1,5 @@
1
1
  import type { Route } from '@lifi/sdk';
2
- export declare const useRouteExecution: (routeId: string) => {
2
+ export declare const useRouteExecution: (routeId: string, executeInBackground?: boolean) => {
3
3
  executeRoute: () => void;
4
4
  restartRoute: () => void;
5
5
  deleteRoute: () => void;
@@ -10,19 +10,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { useMutation } from '@tanstack/react-query';
11
11
  import { useCallback, useEffect, useRef } from 'react';
12
12
  import shallow from 'zustand/shallow';
13
- import { LiFi } from '../config/lifi';
14
- import { useWallet } from '../providers/WalletProvider';
15
- import { useRouteStore } from '../stores';
13
+ import { useLiFi, useWallet } from '../providers';
14
+ import { isRouteActive, isRouteCompleted, isRouteFailed, useRouteStore, } from '../stores';
15
+ import { WidgetEvent } from '../types/events';
16
16
  import { deepClone } from '../utils';
17
- export const useRouteExecution = (routeId) => {
17
+ import { useWidgetEvents } from './useWidgetEvents';
18
+ export const useRouteExecution = (routeId, executeInBackground) => {
19
+ const lifi = useLiFi();
18
20
  const { account, switchChain } = useWallet();
19
21
  const resumedAfterMount = useRef(false);
22
+ const emitter = useWidgetEvents();
20
23
  const routeExecution = useRouteStore((state) => state.routes[routeId]);
21
24
  const [updateRoute, restartRoute, deleteRoute] = useRouteStore((state) => [state.updateRoute, state.restartRoute, state.deleteRoute], shallow);
22
25
  const updateCallback = (updatedRoute) => {
23
26
  const clonedUpdatedRoute = deepClone(updatedRoute);
24
27
  console.log('Route updated.', clonedUpdatedRoute);
25
28
  updateRoute(clonedUpdatedRoute);
29
+ if (isRouteCompleted(clonedUpdatedRoute)) {
30
+ emitter.emit(WidgetEvent.SwapCompleted);
31
+ }
32
+ if (isRouteFailed(clonedUpdatedRoute)) {
33
+ emitter.emit(WidgetEvent.SwapFailed);
34
+ }
26
35
  };
27
36
  const switchChainHook = (requiredChainId) => __awaiter(void 0, void 0, void 0, function* () {
28
37
  if (!account.isActive || !account.signer) {
@@ -44,20 +53,16 @@ export const useRouteExecution = (routeId) => {
44
53
  if (!(routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route)) {
45
54
  throw Error('Execution route not found.');
46
55
  }
47
- return LiFi.executeRoute(account.signer, routeExecution.route, {
56
+ return lifi.executeRoute(account.signer, routeExecution.route, {
48
57
  updateCallback,
49
58
  switchChainHook,
50
59
  infiniteApproval: false,
60
+ executeInBackground,
51
61
  });
52
62
  }, {
53
63
  onMutate: () => {
54
64
  console.log('Execution started.', routeId);
55
- },
56
- onError: () => {
57
- console.warn('Execution failed.', routeId);
58
- },
59
- onSuccess: (route) => {
60
- console.log('Executed successfully.', routeId);
65
+ emitter.emit(WidgetEvent.SwapStarted);
61
66
  },
62
67
  });
63
68
  const resumeRouteMutation = useMutation((resumedRoute) => {
@@ -67,30 +72,25 @@ export const useRouteExecution = (routeId) => {
67
72
  if (!(routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route)) {
68
73
  throw Error('Execution route not found.');
69
74
  }
70
- return LiFi.resumeRoute(account.signer, resumedRoute !== null && resumedRoute !== void 0 ? resumedRoute : routeExecution.route, {
75
+ return lifi.resumeRoute(account.signer, resumedRoute !== null && resumedRoute !== void 0 ? resumedRoute : routeExecution.route, {
71
76
  updateCallback,
72
77
  switchChainHook,
73
78
  infiniteApproval: false,
79
+ executeInBackground,
74
80
  });
75
81
  }, {
76
82
  onMutate: () => {
77
83
  console.log('Resumed to execution.', routeId);
78
84
  },
79
- onError: () => {
80
- console.warn('Resumed execution failed.', routeId);
81
- },
82
- onSuccess: (route) => {
83
- console.log('Resumed execution successful.', route);
84
- },
85
85
  });
86
86
  const executeRoute = useCallback(() => {
87
87
  executeRouteMutation.mutateAsync(undefined, {
88
88
  onError: () => {
89
- console.warn('Real execution failed!', routeId);
89
+ console.warn('Execution failed!', routeId);
90
90
  // Notification.showNotification(NotificationType.SwapExecution_ERROR);
91
91
  },
92
92
  onSuccess: (route) => {
93
- console.log('Real execution successfully!', route);
93
+ console.log('Executed successfully!', route);
94
94
  // Notification.showNotification(NotificationType.TRANSACTION_SUCCESSFULL);
95
95
  },
96
96
  });
@@ -98,10 +98,10 @@ export const useRouteExecution = (routeId) => {
98
98
  const resumeRoute = useCallback((route) => {
99
99
  resumeRouteMutation.mutateAsync(route, {
100
100
  onError: () => {
101
- console.warn('Real resumed execution failed.', routeId);
101
+ console.warn('Resumed execution failed.', routeId);
102
102
  },
103
103
  onSuccess: (route) => {
104
- console.log('Real resumed execution successful.', route);
104
+ console.log('Resumed execution successful.', route);
105
105
  },
106
106
  });
107
107
  }, [resumeRouteMutation, routeId]);
@@ -117,7 +117,7 @@ export const useRouteExecution = (routeId) => {
117
117
  // Resume route execution after page reload
118
118
  useEffect(() => {
119
119
  // Check if route is eligible for automatic resuming
120
- if (isActiveRoute(routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route) &&
120
+ if (isRouteActive(routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route) &&
121
121
  account.isActive &&
122
122
  !resumedAfterMount.current) {
123
123
  resumedAfterMount.current = true;
@@ -129,14 +129,14 @@ export const useRouteExecution = (routeId) => {
129
129
  return () => {
130
130
  var _a;
131
131
  const route = (_a = useRouteStore.getState().routes[routeId]) === null || _a === void 0 ? void 0 : _a.route;
132
- if (!route || !isActiveRoute(route)) {
132
+ if (!route || !isRouteActive(route)) {
133
133
  return;
134
134
  }
135
- LiFi.moveExecutionToBackground(route);
135
+ lifi.updateRouteExecution(route, { executeInBackground: true });
136
136
  console.log('Move route execution to background.', routeId);
137
137
  resumedAfterMount.current = false;
138
138
  };
139
- }, [routeId]);
139
+ }, [lifi, routeId]);
140
140
  return {
141
141
  executeRoute,
142
142
  restartRoute: restartRouteMutation,
@@ -145,12 +145,3 @@ export const useRouteExecution = (routeId) => {
145
145
  status: routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.status,
146
146
  };
147
147
  };
148
- const isActiveRoute = (route) => {
149
- if (!route) {
150
- return false;
151
- }
152
- const allDone = route.steps.every((step) => { var _a; return ((_a = step.execution) === null || _a === void 0 ? void 0 : _a.status) === 'DONE'; });
153
- const isFailed = route.steps.some((step) => { var _a; return ((_a = step.execution) === null || _a === void 0 ? void 0 : _a.status) === 'FAILED'; });
154
- const alreadyStarted = route.steps.some((step) => step.execution);
155
- return !allDone && !isFailed && alreadyStarted;
156
- };
@@ -12,13 +12,12 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';
12
12
  import Big from 'big.js';
13
13
  import { useWatch } from 'react-hook-form';
14
14
  import { useDebouncedWatch, useToken } from '.';
15
- import { LiFi } from '../config/lifi';
16
- import { SwapFormKey } from '../providers/SwapFormProvider';
17
- import { useWallet } from '../providers/WalletProvider';
15
+ import { SwapFormKey, useLiFi, useWallet } from '../providers';
18
16
  import { useSettings } from '../stores';
19
17
  const refetchTime = 60000;
20
18
  export const useSwapRoutes = () => {
21
19
  var _a;
20
+ const lifi = useLiFi();
22
21
  const { account, provider } = useWallet();
23
22
  const queryClient = useQueryClient();
24
23
  const { slippage, enabledBridges, enabledExchanges, routePriority } = useSettings([
@@ -75,7 +74,7 @@ export const useSwapRoutes = () => {
75
74
  catch (_d) {
76
75
  toWalletAddress = isAddress(toAddress) ? toAddress : fromAddress;
77
76
  }
78
- return LiFi.getRoutes({
77
+ return lifi.getRoutes({
79
78
  fromChainId,
80
79
  fromAmount: Big(Number(fromTokenAmount) * Math.pow(10, ((_c = token === null || token === void 0 ? void 0 : token.decimals) !== null && _c !== void 0 ? _c : 0))).toString(),
81
80
  fromTokenAddress,
@@ -10,14 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  /* eslint-disable consistent-return */
11
11
  import { useQuery } from '@tanstack/react-query';
12
12
  import { useState } from 'react';
13
- import { LiFi } from '../config/lifi';
14
- import { useWallet } from '../providers/WalletProvider';
13
+ import { useLiFi, useWallet } from '../providers';
15
14
  import { formatTokenAmount } from '../utils';
16
15
  import { useFeaturedTokens } from './useFeaturedTokens';
17
16
  import { useTokens } from './useTokens';
18
17
  const defaultRefetchInterval = 60000;
19
18
  const minRefetchInterval = 1000;
20
19
  export const useTokenBalances = (selectedChainId) => {
20
+ const lifi = useLiFi();
21
21
  const { account } = useWallet();
22
22
  const featuredTokens = useFeaturedTokens(selectedChainId);
23
23
  const { tokens, isLoading } = useTokens(selectedChainId);
@@ -27,7 +27,7 @@ export const useTokenBalances = (selectedChainId) => {
27
27
  if (!accountAddress || !tokens) {
28
28
  return;
29
29
  }
30
- const tokenBalances = yield LiFi.getTokenBalances(accountAddress, tokens);
30
+ const tokenBalances = yield lifi.getTokenBalances(accountAddress, tokens);
31
31
  if (!(tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.length)) {
32
32
  // Sometimes RPCs (e.g. Arbitrum) don't return balances on first call
33
33
  // TODO: fix and remove backplane
@@ -8,11 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { useQuery, useQueryClient } from '@tanstack/react-query';
11
- import { LiFi } from '../config/lifi';
11
+ import { useLiFi } from '../providers';
12
12
  export const useTokenSearch = (token, chainId, enabled) => {
13
+ const lifi = useLiFi();
13
14
  const queryClient = useQueryClient();
14
15
  const { data, isLoading, isFetching, isFetched } = useQuery(['token-search', chainId, token], ({ queryKey: [, chainId, token], signal }) => __awaiter(void 0, void 0, void 0, function* () {
15
- const data = yield LiFi.getToken(chainId, token, {
16
+ const data = yield lifi.getToken(chainId, token, {
16
17
  signal,
17
18
  });
18
19
  if (data) {
@@ -8,13 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { useQuery } from '@tanstack/react-query';
11
- import { LiFi } from '../config/lifi';
11
+ import { useLiFi } from '../providers';
12
12
  import { useFeaturedTokens } from './useFeaturedTokens';
13
13
  export const useTokens = (selectedChainId) => {
14
+ const lifi = useLiFi();
14
15
  const featuredTokens = useFeaturedTokens(selectedChainId);
15
16
  const { data: tokens, isLoading, isFetching, } = useQuery(['tokens', selectedChainId, featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.length], () => __awaiter(void 0, void 0, void 0, function* () {
16
17
  var _a, _b, _c;
17
- const data = yield LiFi.getTokens({ chains: [selectedChainId] });
18
+ const data = yield lifi.getTokens({ chains: [selectedChainId] });
18
19
  const featuredTokenAddresses = new Set(featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.map((token) => token.address));
19
20
  return [
20
21
  ...((_a = featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.map((token) => {
package/hooks/useTools.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
2
  import { useMemo } from 'react';
3
- import { LiFi } from '../config/lifi';
3
+ import { useLiFi } from '../providers';
4
4
  import { useSettingsStore } from '../stores';
5
5
  export const useTools = () => {
6
+ const lifi = useLiFi();
6
7
  const initializeTools = useSettingsStore((state) => state.initializeTools);
7
- const { data } = useQuery(['tools'], ({ signal }) => LiFi.getTools(undefined, { signal }), {
8
+ const { data } = useQuery(['tools'], ({ signal }) => lifi.getTools(undefined, { signal }), {
8
9
  onSuccess(data) {
9
10
  initializeTools('Bridges', data.bridges.map((bridge) => bridge.key));
10
11
  initializeTools('Exchanges', data.exchanges.map((exchange) => exchange.key));
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ export declare const useWidgetEvents: () => EventEmitter;
@@ -0,0 +1,6 @@
1
+ import { EventEmitter } from 'events';
2
+ import create from 'zustand';
3
+ const emitterStore = create()(() => new EventEmitter());
4
+ export const useWidgetEvents = () => {
5
+ return emitterStore();
6
+ };
@@ -6,10 +6,12 @@
6
6
  "swap": "Swap",
7
7
  "from": "Swap from",
8
8
  "to": "Swap to",
9
+ "selectChain": "Select chain",
9
10
  "settings": "Settings",
10
11
  "routes": "You get",
11
12
  "swapHistory": "Swap history",
12
- "swapDetails": "Swap details"
13
+ "swapDetails": "Swap details",
14
+ "activeSwaps": "Active swaps"
13
15
  },
14
16
  "button": {
15
17
  "connectWallet": "Connect wallet",
@@ -31,6 +33,7 @@
31
33
  "delete": "Delete",
32
34
  "hide": "Hide",
33
35
  "max": "max",
36
+ "showAll": "Show all",
34
37
  "contactSupport": "Contact support",
35
38
  "lifiSwap": "LI.FI Swap"
36
39
  },
@@ -53,7 +56,6 @@
53
56
  "featuredTokens": "Featured tokens",
54
57
  "otherTokens": "Other tokens",
55
58
  "inProgress": "in progress",
56
- "activeTransfers": "Active transfers",
57
59
  "couldntFindTokens": "We couldn't find tokens on this chain or you don't have any.",
58
60
  "stepSwap": "Swap",
59
61
  "stepBridge": "Bridge",
@@ -63,7 +65,7 @@
63
65
  "swapStepDetails": "Swap on {{chain}} via {{tool}}",
64
66
  "tokenOnChain": "{{tokenSymbol}} on {{chainName}}",
65
67
  "tokenOnChainAmount": "{{amount}} {{tokenSymbol}} on {{chainName}}",
66
- "routeId": "Route ID",
68
+ "supportId": "Support ID",
67
69
  "sendToWallet": "Send to a different wallet",
68
70
  "walletAddressOrEns": "Wallet address or ENS name",
69
71
  "tags": {
@@ -84,11 +86,13 @@
84
86
  "info": {
85
87
  "title": {
86
88
  "routeNotFound": "No routes available",
87
- "emptySwapHistory": "No recent swaps"
89
+ "emptySwapHistory": "No recent swaps",
90
+ "emptyActiveSwaps": "No active swaps"
88
91
  },
89
92
  "message": {
90
93
  "routeNotFound": "Try another token combination.",
91
- "emptySwapHistory": "Swap history is only stored locally and will be deleted if you clear your browser data."
94
+ "emptySwapHistory": "Swap history is only stored locally and will be deleted if you clear your browser data.",
95
+ "emptyActiveSwaps": "Swaps in progress will appear here. Once completed, find them in swap history."
92
96
  }
93
97
  },
94
98
  "warning": {
@@ -105,18 +109,19 @@
105
109
  },
106
110
  "error": {
107
111
  "title": {
112
+ "failed": "Swap failed.",
108
113
  "chainSwitch": "Chain switch required.",
109
114
  "transactionFailed": "Transaction has failed.",
110
115
  "transactionUnderpriced": "Transaction is underpriced.",
111
116
  "transactionUnprepared": "Unable to prepare transaction.",
117
+ "transactionRejected": "Signature required.",
112
118
  "unknown": "Something went wrong.",
113
- "userRejectedSignatureRequest": "Signature required.",
114
119
  "slippageTooLarge": "Slippage too large.",
115
120
  "walletAddressInvalid": "Wallet address is invalid.",
116
121
  "walletEnsAddressInvalid": "Wallet address is invalid or network doesn't support ENS."
117
122
  },
118
123
  "message": {
119
- "signatureRequired": "Your signature is required to complete the transaction. {{amount}} {{tokenSymbol}} on {{chainName}} remain in your wallet.",
124
+ "transactionRejected": "Your signature is required to complete the transaction. {{amount}} {{tokenSymbol}} on {{chainName}} remain in your wallet.",
120
125
  "transactionFailed": "Please check the block explorer for more information.",
121
126
  "transactionNotSent": "Transaction was not sent, your funds are still in your wallet ({{amount}} {{tokenSymbol}} on {{chainName}}).",
122
127
  "slippageTooLarge": "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote."
@@ -129,7 +134,7 @@
129
134
  "done": "Token allowance approved."
130
135
  },
131
136
  "switchChain": {
132
- "pending": "Chain switch required.",
137
+ "actionRequired": "Chain switch required.",
133
138
  "done": "Chain switched successfully."
134
139
  },
135
140
  "swap": {