@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
@@ -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": {
@@ -9,10 +9,12 @@ export declare const resources: {
9
9
  swap: string;
10
10
  from: string;
11
11
  to: string;
12
+ selectChain: string;
12
13
  settings: string;
13
14
  routes: string;
14
15
  swapHistory: string;
15
16
  swapDetails: string;
17
+ activeSwaps: string;
16
18
  };
17
19
  button: {
18
20
  connectWallet: string;
@@ -34,6 +36,7 @@ export declare const resources: {
34
36
  delete: string;
35
37
  hide: string;
36
38
  max: string;
39
+ showAll: string;
37
40
  contactSupport: string;
38
41
  lifiSwap: string;
39
42
  };
@@ -56,7 +59,6 @@ export declare const resources: {
56
59
  featuredTokens: string;
57
60
  otherTokens: string;
58
61
  inProgress: string;
59
- activeTransfers: string;
60
62
  couldntFindTokens: string;
61
63
  stepSwap: string;
62
64
  stepBridge: string;
@@ -66,7 +68,7 @@ export declare const resources: {
66
68
  swapStepDetails: string;
67
69
  tokenOnChain: string;
68
70
  tokenOnChainAmount: string;
69
- routeId: string;
71
+ supportId: string;
70
72
  sendToWallet: string;
71
73
  walletAddressOrEns: string;
72
74
  tags: {
@@ -88,10 +90,12 @@ export declare const resources: {
88
90
  title: {
89
91
  routeNotFound: string;
90
92
  emptySwapHistory: string;
93
+ emptyActiveSwaps: string;
91
94
  };
92
95
  message: {
93
96
  routeNotFound: string;
94
97
  emptySwapHistory: string;
98
+ emptyActiveSwaps: string;
95
99
  };
96
100
  };
97
101
  warning: {
@@ -108,18 +112,19 @@ export declare const resources: {
108
112
  };
109
113
  error: {
110
114
  title: {
115
+ failed: string;
111
116
  chainSwitch: string;
112
117
  transactionFailed: string;
113
118
  transactionUnderpriced: string;
114
119
  transactionUnprepared: string;
120
+ transactionRejected: string;
115
121
  unknown: string;
116
- userRejectedSignatureRequest: string;
117
122
  slippageTooLarge: string;
118
123
  walletAddressInvalid: string;
119
124
  walletEnsAddressInvalid: string;
120
125
  };
121
126
  message: {
122
- signatureRequired: string;
127
+ transactionRejected: string;
123
128
  transactionFailed: string;
124
129
  transactionNotSent: string;
125
130
  slippageTooLarge: string;
@@ -132,7 +137,7 @@ export declare const resources: {
132
137
  done: string;
133
138
  };
134
139
  switchChain: {
135
- pending: string;
140
+ actionRequired: string;
136
141
  done: string;
137
142
  };
138
143
  swap: {
package/cjs/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import './fonts/inter.css';
3
+ export { useWidgetEvents } from './hooks';
3
4
  export * from './types';
4
5
  export declare const LiFiWidget: import("react").FC<import("./AppProvider").AppProps>;
5
6
  export declare const LiFiWidgetDrawer: import("react").ForwardRefExoticComponent<Pick<import("./AppDrawer").AppDrawerProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "elementRef" | "components" | "componentsProps" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "container" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "onClose" | "config" | "elevation" | "ModalProps" | "PaperProps" | "SlideProps"> & import("react").RefAttributes<import("./AppDrawer").AppDrawerBase>>;
package/cjs/index.js CHANGED
@@ -14,11 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.LiFiWidgetDrawer = exports.LiFiWidget = void 0;
17
+ exports.LiFiWidgetDrawer = exports.LiFiWidget = exports.useWidgetEvents = void 0;
18
18
  const App_1 = require("./App");
19
19
  const AppDrawer_1 = require("./AppDrawer");
20
20
  require("./fonts/inter.css");
21
21
  const i18n_1 = require("./i18n");
22
+ var hooks_1 = require("./hooks");
23
+ Object.defineProperty(exports, "useWidgetEvents", { enumerable: true, get: function () { return hooks_1.useWidgetEvents; } });
22
24
  __exportStar(require("./types"), exports);
23
25
  (0, i18n_1.configureReactI18next)();
24
26
  // ClassNameGenerator.configure((componentName) =>
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ActiveSwapsEmpty: React.FC;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActiveSwapsEmpty = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const icons_material_1 = require("@mui/icons-material");
6
+ const material_1 = require("@mui/material");
7
+ const react_i18next_1 = require("react-i18next");
8
+ const ActiveSwapsEmpty = () => {
9
+ const { t } = (0, react_i18next_1.useTranslation)();
10
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, Object.assign({ sx: {
11
+ display: 'flex',
12
+ flex: 1,
13
+ flexDirection: 'column',
14
+ alignItems: 'center',
15
+ justifyContent: 'center',
16
+ } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 48 }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.SwapHoriz, { fontSize: "inherit" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: 700 }, { children: t('swap.info.title.emptyActiveSwaps') })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2 }, { children: t('swap.info.message.emptyActiveSwaps') }))] })));
17
+ };
18
+ exports.ActiveSwapsEmpty = ActiveSwapsEmpty;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ActiveSwapsPage: () => JSX.Element;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActiveSwapsPage = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const material_1 = require("@mui/material");
6
+ const ActiveSwaps_1 = require("../../components/ActiveSwaps");
7
+ const providers_1 = require("../../providers");
8
+ const stores_1 = require("../../stores");
9
+ const ActiveSwapsEmpty_1 = require("./ActiveSwapsEmpty");
10
+ const ActiveSwapsPage = () => {
11
+ const { account } = (0, providers_1.useWallet)();
12
+ const executingRoutes = (0, stores_1.useExecutingRoutesIds)(account.address);
13
+ if (!executingRoutes.length) {
14
+ return (0, jsx_runtime_1.jsx)(ActiveSwapsEmpty_1.ActiveSwapsEmpty, {});
15
+ }
16
+ return ((0, jsx_runtime_1.jsx)(material_1.Container, Object.assign({ disableGutters: true }, { children: (0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ sx: {
17
+ paddingLeft: 1.5,
18
+ paddingRight: 1.5,
19
+ } }, { children: executingRoutes.map((routeId) => ((0, jsx_runtime_1.jsx)(ActiveSwaps_1.ActiveSwapItem, { routeId: routeId }, routeId))) })) })));
20
+ };
21
+ exports.ActiveSwapsPage = ActiveSwapsPage;
@@ -0,0 +1 @@
1
+ export * from './ActiveSwapsPage';
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./SwapsInProgress"), exports);
17
+ __exportStar(require("./ActiveSwapsPage"), exports);
@@ -3,14 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MainPage = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
+ const ActiveSwaps_1 = require("../../components/ActiveSwaps");
6
7
  const SelectChainAndToken_1 = require("../../components/SelectChainAndToken");
7
- const SendToWallet_1 = require("../../components/SendToWallet");
8
8
  const SwapInput_1 = require("../../components/SwapInput");
9
- const SwapsInProgress_1 = require("../../components/SwapsInProgress");
10
9
  const MainPage_style_1 = require("./MainPage.style");
11
10
  const MainSwapButton_1 = require("./MainSwapButton");
12
11
  const SwapRoutes_1 = require("./SwapRoutes");
13
12
  const MainPage = () => {
14
- return ((0, jsx_runtime_1.jsxs)(MainPage_style_1.FormContainer, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsx)(SwapsInProgress_1.SwapsInProgress, { mx: 3, mt: 1, mb: 2 }), (0, jsx_runtime_1.jsx)(SelectChainAndToken_1.SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mx: 3, mb: 3 }, { children: (0, jsx_runtime_1.jsx)(SwapInput_1.SwapInput, { formType: "from" }) })), (0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWallet, { mx: 3, mb: 3 }), (0, jsx_runtime_1.jsx)(SwapRoutes_1.SwapRoutes, { mx: 3, mb: 3 }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mx: 3, mb: 1 }, { children: (0, jsx_runtime_1.jsx)(MainSwapButton_1.MainSwapButton, {}) }))] })));
13
+ return ((0, jsx_runtime_1.jsxs)(MainPage_style_1.FormContainer, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsx)(ActiveSwaps_1.ActiveSwaps, { mx: 3, mt: 1, mb: 2 }), (0, jsx_runtime_1.jsx)(SelectChainAndToken_1.SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mx: 3, mb: 3 }, { children: (0, jsx_runtime_1.jsx)(SwapInput_1.SwapInput, { formType: "from" }) })), (0, jsx_runtime_1.jsx)(SwapRoutes_1.SwapRoutes, { mx: 3, mb: 3 }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mx: 3, mb: 1 }, { children: (0, jsx_runtime_1.jsx)(MainSwapButton_1.MainSwapButton, {}) }))] })));
15
14
  };
16
15
  exports.MainPage = MainPage;
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MainSwapButton = void 0;
13
13
  const jsx_runtime_1 = require("react/jsx-runtime");
14
+ const react_hook_form_1 = require("react-hook-form");
14
15
  const react_router_dom_1 = require("react-router-dom");
15
16
  const SwapButton_1 = require("../../components/SwapButton");
16
17
  const hooks_1 = require("../../hooks");
@@ -18,6 +19,7 @@ const stores_1 = require("../../stores");
18
19
  const utils_1 = require("../../utils");
19
20
  const MainSwapButton = () => {
20
21
  const navigate = (0, react_router_dom_1.useNavigate)();
22
+ const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
21
23
  const setExecutableRoute = (0, stores_1.useSetExecutableRoute)();
22
24
  const { routes: swapRoutes, isLoading, isFetching } = (0, hooks_1.useSwapRoutes)();
23
25
  const currentRoute = swapRoutes === null || swapRoutes === void 0 ? void 0 : swapRoutes[0];
@@ -29,6 +31,6 @@ const MainSwapButton = () => {
29
31
  });
30
32
  }
31
33
  });
32
- return ((0, jsx_runtime_1.jsx)(SwapButton_1.SwapButton, { onClick: handleClick, currentRoute: currentRoute, loading: isLoading || isFetching || !currentRoute }));
34
+ return ((0, jsx_runtime_1.jsx)(SwapButton_1.SwapButton, { onClick: handleClick, currentRoute: currentRoute, disable: isLoading || isFetching || !currentRoute || isValidating || !isValid }));
33
35
  };
34
36
  exports.MainSwapButton = MainSwapButton;
@@ -6,11 +6,13 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const icons_material_1 = require("@mui/icons-material");
7
7
  const material_1 = require("@mui/material");
8
8
  const react_1 = require("react");
9
+ const react_hook_form_1 = require("react-hook-form");
9
10
  const react_i18next_1 = require("react-i18next");
10
11
  const react_router_dom_1 = require("react-router-dom");
11
12
  const Card_1 = require("../../components/Card");
12
13
  const GasSufficiencyMessage_1 = require("../../components/GasSufficiencyMessage");
13
14
  const ProgressToNextUpdate_1 = require("../../components/ProgressToNextUpdate");
15
+ const SendToWallet_1 = require("../../components/SendToWallet");
14
16
  const SwapRouteCard_1 = require("../../components/SwapRouteCard");
15
17
  const hooks_1 = require("../../hooks");
16
18
  const utils_1 = require("../../utils");
@@ -18,6 +20,7 @@ const SwapRoutes_style_1 = require("./SwapRoutes.style");
18
20
  const SwapRoutes = (props) => {
19
21
  const { t } = (0, react_i18next_1.useTranslation)();
20
22
  const navigate = (0, react_router_dom_1.useNavigate)();
23
+ const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
21
24
  const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = (0, hooks_1.useSwapRoutes)();
22
25
  const handleCardClick = (0, react_1.useCallback)(() => {
23
26
  navigate(utils_1.navigationRoutes.swapRoutes);
@@ -35,6 +38,6 @@ const SwapRoutes = (props) => {
35
38
  borderWidth: !routeNotFound && (isFetching || (routes && routes.length > 1))
36
39
  ? 1
37
40
  : 0,
38
- } }, { children: isLoading || isFetching ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", dense: true }), (0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", dense: true })] })) : !currentRoute ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, { minWidth: "100%", dense: true })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: routes.length > 1 ? '80%' : '100%', route: currentRoute, active: true, dense: true }), routes.length > 1 ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: "80%", route: routes[1], dense: true })) : null] })) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: !routeNotFound ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ py: 1, pr: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleCardClick, size: "medium", "aria-label": "swap-routes" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowRight, {}) })) }))) : null }))] }))] })), (0, jsx_runtime_1.jsx)(GasSufficiencyMessage_1.GasSufficiencyMessage, Object.assign({ route: !isFetching ? currentRoute : undefined }, props))] }));
41
+ } }, { children: isLoading || isFetching ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", dense: true }), (0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", dense: true })] })) : !currentRoute ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, { minWidth: "100%", dense: true })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: routes.length > 1 ? '80%' : '100%', route: currentRoute, active: true, dense: true }), routes.length > 1 ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: "80%", route: routes[1], dense: true })) : null] })) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: !routeNotFound ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ py: 1, pr: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleCardClick, size: "medium", "aria-label": "swap-routes", disabled: isValidating || !isValid }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowRight, {}) })) }))) : null }))] }))] })), (0, jsx_runtime_1.jsx)(GasSufficiencyMessage_1.GasSufficiencyMessage, Object.assign({ route: !isFetching ? currentRoute : undefined }, props)), (0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWallet, { mx: 3, mb: 3 })] }));
39
42
  };
40
43
  exports.SwapRoutes = SwapRoutes;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { SwapFormTypeProps } from '../../providers';
3
+ export declare const SelectChainPage: React.FC<Partial<SwapFormTypeProps>>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SelectChainPage = void 0;
13
+ const jsx_runtime_1 = require("react/jsx-runtime");
14
+ const material_1 = require("@mui/material");
15
+ const react_router_dom_1 = require("react-router-dom");
16
+ const ChainSelect_1 = require("../../components/ChainSelect");
17
+ const hooks_1 = require("../../hooks");
18
+ const SelectChainPage_style_1 = require("./SelectChainPage.style");
19
+ const SelectChainPage = ({ formType, }) => {
20
+ const { navigateBack } = (0, hooks_1.useNavigateBack)();
21
+ const { state } = (0, react_router_dom_1.useLocation)();
22
+ const formTypeState = (state === null || state === void 0 ? void 0 : state.formType) || formType;
23
+ const { chains, setCurrentChain } = (0, ChainSelect_1.useChainSelect)(formTypeState);
24
+ const handleClick = (chainId) => __awaiter(void 0, void 0, void 0, function* () {
25
+ setCurrentChain(chainId);
26
+ navigateBack();
27
+ });
28
+ return ((0, jsx_runtime_1.jsx)(material_1.Container, Object.assign({ disableGutters: true }, { children: (0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ sx: {
29
+ paddingLeft: 1.5,
30
+ paddingRight: 1.5,
31
+ } }, { children: chains === null || chains === void 0 ? void 0 : chains.map((chain) => ((0, jsx_runtime_1.jsxs)(SelectChainPage_style_1.ListItemButton, Object.assign({ onClick: () => handleClick(chain.id), disableRipple: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] })) }), (0, jsx_runtime_1.jsx)(SelectChainPage_style_1.ListItemText, { primary: chain.name })] }), chain.id))) })) })));
32
+ };
33
+ exports.SelectChainPage = SelectChainPage;
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export declare const ListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
3
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
4
+ centerRipple?: boolean | undefined;
5
+ children?: import("react").ReactNode;
6
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
7
+ disabled?: boolean | undefined;
8
+ disableRipple?: boolean | undefined;
9
+ disableTouchRipple?: boolean | undefined;
10
+ focusRipple?: boolean | undefined;
11
+ focusVisibleClassName?: string | undefined;
12
+ LinkComponent?: import("react").ElementType<any> | undefined;
13
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
14
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
15
+ tabIndex?: number | undefined;
16
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
17
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
18
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
19
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
+ }, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
+ export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListItemText = exports.ListItemButton = void 0;
4
+ const material_1 = require("@mui/material");
5
+ const ListItemText_1 = require("@mui/material/ListItemText");
6
+ const styles_1 = require("@mui/material/styles");
7
+ const utils_1 = require("../../utils");
8
+ exports.ListItemButton = (0, styles_1.styled)(material_1.ListItemButton)(({ theme }) => ({
9
+ borderRadius: theme.shape.borderRadiusSecondary,
10
+ paddingLeft: theme.spacing(1.5),
11
+ height: 56,
12
+ '&:hover': {
13
+ backgroundColor: (0, utils_1.getContrastAlphaColor)(theme, '4%'),
14
+ },
15
+ }));
16
+ exports.ListItemText = (0, styles_1.styled)(material_1.ListItemText)(({ theme }) => ({
17
+ [`.${ListItemText_1.listItemTextClasses.primary}`]: {
18
+ fontWeight: 400,
19
+ },
20
+ }));
@@ -0,0 +1 @@
1
+ export * from './SelectChainPage';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./SelectChainPage"), exports);
@@ -1,5 +1,3 @@
1
1
  import type { FC } from 'react';
2
- import type { SwapFormDirection } from '../../providers';
3
- export declare const SelectTokenPage: FC<{
4
- formType: SwapFormDirection;
5
- }>;
2
+ import type { SwapFormTypeProps } from '../../providers';
3
+ export declare const SelectTokenPage: FC<SwapFormTypeProps>;
@@ -4,11 +4,11 @@ exports.SelectTokenPage = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const react_1 = require("react");
7
+ const ChainSelect_1 = require("../../components/ChainSelect");
7
8
  const TokenList_1 = require("../../components/TokenList");
8
9
  const hooks_1 = require("../../hooks");
9
- const ChainSelect_1 = require("./ChainSelect");
10
10
  const SearchTokenInput_1 = require("./SearchTokenInput");
11
- const SelectTokenPage = ({ formType, }) => {
11
+ const SelectTokenPage = ({ formType }) => {
12
12
  (0, hooks_1.useScrollableOverflowHidden)();
13
13
  const { navigateBack } = (0, hooks_1.useNavigateBack)();
14
14
  const headerRef = (0, react_1.useRef)(null);
@@ -28,7 +28,7 @@ const SelectWalletPage = () => {
28
28
  const closeDialog = () => {
29
29
  setWalletIdentity((state) => (Object.assign(Object.assign({}, state), { show: false })));
30
30
  };
31
- const handleConnect = (0, react_1.useCallback)((event, wallet) => __awaiter(void 0, void 0, void 0, function* () {
31
+ const handleConnect = (0, react_1.useCallback)((wallet) => __awaiter(void 0, void 0, void 0, function* () {
32
32
  const { ethereum } = window;
33
33
  const identityCheckPassed = wallet.checkProviderIdentity({
34
34
  provider: ethereum,
@@ -44,9 +44,9 @@ const SelectWalletPage = () => {
44
44
  yield connect(wallet);
45
45
  }), [connect, navigateBack]);
46
46
  return ((0, jsx_runtime_1.jsxs)(material_1.Container, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ sx: {
47
- paddingLeft: 2,
48
- paddingRight: 2,
49
- } }, { children: wallet_management_1.supportedWallets.map((wallet) => ((0, jsx_runtime_1.jsxs)(SelectWalletPage_style_1.WalletListItemButton, Object.assign({ onClick: (event) => handleConnect(event, wallet), disableRipple: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ src: wallet.icon.src || wallet.icon, alt: wallet.name }, { children: wallet.name[0] })) }), (0, jsx_runtime_1.jsx)(SelectWalletPage_style_1.WalletListItemText, { primary: wallet.name })] }), wallet.name))) })), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, Object.assign({ open: walletIdentity.show, onClose: closeDialog }, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('wallet.extensionNotFound', {
47
+ paddingLeft: 1.5,
48
+ paddingRight: 1.5,
49
+ } }, { children: wallet_management_1.supportedWallets.map((wallet) => ((0, jsx_runtime_1.jsxs)(SelectWalletPage_style_1.ListItemButton, Object.assign({ onClick: () => handleConnect(wallet), disableRipple: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ src: wallet.icon.src || wallet.icon, alt: wallet.name }, { children: wallet.name[0] })) }), (0, jsx_runtime_1.jsx)(SelectWalletPage_style_1.ListItemText, { primary: wallet.name })] }), wallet.name))) })), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, Object.assign({ open: walletIdentity.show, onClose: closeDialog }, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('wallet.extensionNotFound', {
50
50
  name: (_a = walletIdentity.wallet) === null || _a === void 0 ? void 0 : _a.name,
51
51
  }) }) }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: closeDialog, autoFocus: true }, { children: t('button.ok') })) })] }))] })));
52
52
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const WalletListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
2
+ export declare const ListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
3
3
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
4
4
  centerRipple?: boolean | undefined;
5
5
  children?: import("react").ReactNode;
@@ -18,29 +18,4 @@ export declare const WalletListItemButton: import("@emotion/styled").StyledCompo
18
18
  }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
19
19
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
20
  }, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
- export declare const WalletListItem: import("@emotion/styled").StyledComponent<{
22
- button?: false | undefined;
23
- } & import("@mui/material").ListItemBaseProps & {
24
- components?: {
25
- Root?: import("react").ElementType<any> | undefined;
26
- } | undefined;
27
- componentsProps?: {
28
- root?: (import("react").HTMLAttributes<HTMLDivElement> & import("@mui/material").ListItemComponentsPropsOverrides) | undefined;
29
- } | undefined;
30
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof import("react").LiHTMLAttributes<HTMLLIElement>> & {
31
- ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
32
- }, "button" | "className" | "style" | "classes" | "children" | "disabled" | "sx" | "alignItems" | "autoFocus" | "dense" | "divider" | "components" | "componentsProps" | "selected" | "disableGutters" | "ContainerComponent" | "ContainerProps" | "disablePadding" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
33
- export declare const WalletListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
34
- export declare const WalletIdentityPopoverContent: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
35
- align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
36
- children?: import("react").ReactNode;
37
- classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
38
- gutterBottom?: boolean | undefined;
39
- noWrap?: boolean | undefined;
40
- paragraph?: boolean | undefined;
41
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
42
- variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
43
- variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)", string>> | undefined;
44
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
45
- ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
46
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("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") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
+ export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,30 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WalletIdentityPopoverContent = exports.WalletListItemText = exports.WalletListItem = exports.WalletListItemButton = void 0;
3
+ exports.ListItemText = exports.ListItemButton = void 0;
4
4
  const material_1 = require("@mui/material");
5
- const ListItemSecondaryAction_1 = require("@mui/material/ListItemSecondaryAction");
6
5
  const ListItemText_1 = require("@mui/material/ListItemText");
7
6
  const styles_1 = require("@mui/material/styles");
8
7
  const utils_1 = require("../../utils");
9
- exports.WalletListItemButton = (0, styles_1.styled)(material_1.ListItemButton)(({ theme }) => ({
8
+ exports.ListItemButton = (0, styles_1.styled)(material_1.ListItemButton)(({ theme }) => ({
10
9
  borderRadius: theme.shape.borderRadiusSecondary,
11
10
  paddingLeft: theme.spacing(1.5),
12
- height: 64,
11
+ height: 56,
13
12
  '&:hover': {
14
13
  backgroundColor: (0, utils_1.getContrastAlphaColor)(theme, '4%'),
15
14
  },
16
15
  }));
17
- exports.WalletListItem = (0, styles_1.styled)(material_1.ListItem)(({ theme }) => ({
18
- padding: theme.spacing(1.5),
19
- [`.${ListItemSecondaryAction_1.listItemSecondaryActionClasses.root}`]: {
20
- right: theme.spacing(3),
21
- },
22
- }));
23
- exports.WalletListItemText = (0, styles_1.styled)(material_1.ListItemText)(({ theme }) => ({
16
+ exports.ListItemText = (0, styles_1.styled)(material_1.ListItemText)(({ theme }) => ({
24
17
  [`.${ListItemText_1.listItemTextClasses.primary}`]: {
25
18
  fontWeight: 400,
26
19
  },
27
20
  }));
28
- exports.WalletIdentityPopoverContent = (0, styles_1.styled)(material_1.Typography)({
29
- maxWidth: 400,
30
- });
@@ -11,7 +11,7 @@ export declare const ToggleButton: import("@emotion/styled").StyledComponent<{
11
11
  selected?: boolean | undefined;
12
12
  size?: "small" | "medium" | "large" | undefined;
13
13
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
14
- value: unknown;
14
+ value: {};
15
15
  } & Omit<{
16
16
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
17
17
  centerRipple?: boolean | undefined;