@lifi/widget 2.0.0-beta.9 → 2.0.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 (609) hide show
  1. package/App.js +2 -2
  2. package/AppDrawer.d.ts +3 -2
  3. package/AppDrawer.js +7 -3
  4. package/AppDrawer.style.d.ts +2 -2
  5. package/AppDrawer.style.js +5 -0
  6. package/AppProvider.js +4 -4
  7. package/AppRoutes.js +16 -16
  8. package/cjs/App.js +2 -2
  9. package/cjs/AppDrawer.d.ts +3 -2
  10. package/cjs/AppDrawer.js +7 -3
  11. package/cjs/AppDrawer.style.d.ts +2 -2
  12. package/cjs/AppDrawer.style.js +5 -0
  13. package/cjs/AppProvider.js +3 -3
  14. package/cjs/AppRoutes.js +16 -16
  15. package/cjs/components/{ActiveSwaps/ActiveSwapItem.d.ts → ActiveTransactions/ActiveTransactionItem.d.ts} +1 -1
  16. package/cjs/components/{ActiveSwaps/ActiveSwapItem.js → ActiveTransactions/ActiveTransactionItem.js} +6 -6
  17. package/cjs/{pages/SwapRoutesPage/SwapRoutesPage.d.ts → components/ActiveTransactions/ActiveTransactions.d.ts} +1 -1
  18. package/cjs/components/{ActiveSwaps/ActiveSwaps.js → ActiveTransactions/ActiveTransactions.js} +7 -7
  19. package/cjs/components/{ActiveSwaps/ActiveSwaps.style.d.ts → ActiveTransactions/ActiveTransactions.style.d.ts} +4 -4
  20. package/cjs/components/ActiveTransactions/index.d.ts +2 -0
  21. package/cjs/components/{ActiveSwaps → ActiveTransactions}/index.js +2 -2
  22. package/cjs/components/AmountInput/AmountInput.d.ts +12 -0
  23. package/cjs/components/AmountInput/AmountInput.js +57 -0
  24. package/{components/SwapInput/SwapInput.style.d.ts → cjs/components/AmountInput/AmountInput.style.d.ts} +1 -1
  25. package/{components/SwapInput/SwapInputAdornment.style.d.ts → cjs/components/AmountInput/AmountInputAdornment.style.d.ts} +2 -2
  26. package/cjs/components/AmountInput/AmountInputEndAdornment.d.ts +2 -0
  27. package/cjs/components/{SwapInput/SwapInputEndAdornment.js → AmountInput/AmountInputEndAdornment.js} +9 -9
  28. package/cjs/components/AmountInput/AmountInputStartAdornment.d.ts +3 -0
  29. package/cjs/components/{SwapInput/SwapInputStartAdornment.js → AmountInput/AmountInputStartAdornment.js} +5 -5
  30. package/cjs/components/AmountInput/FormPriceHelperText.d.ts +9 -0
  31. package/cjs/components/{SwapInput → AmountInput}/FormPriceHelperText.js +15 -9
  32. package/cjs/components/AmountInput/index.d.ts +1 -0
  33. package/cjs/{pages/SwapPage → components/AmountInput}/index.js +1 -1
  34. package/cjs/components/Card/CardIconButton.d.ts +2 -2
  35. package/cjs/components/Card/CardLabel.d.ts +1 -1
  36. package/cjs/components/ChainSelect/ChainSelect.d.ts +2 -2
  37. package/cjs/components/ChainSelect/ChainSelect.js +1 -1
  38. package/cjs/components/ChainSelect/useChainSelect.d.ts +2 -2
  39. package/cjs/components/ChainSelect/useChainSelect.js +5 -5
  40. package/cjs/components/ContractComponent/ContractComponent.d.ts +2 -2
  41. package/cjs/components/ContractComponent/ContractComponent.js +3 -5
  42. package/cjs/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +3 -0
  43. package/cjs/components/DefaultTransactionButton/DefaultTransactionButton.js +36 -0
  44. package/cjs/components/DefaultTransactionButton/index.d.ts +2 -0
  45. package/cjs/components/{SwapButton → DefaultTransactionButton}/index.js +3 -3
  46. package/cjs/components/{SwapButton → DefaultTransactionButton}/types.d.ts +1 -2
  47. package/cjs/components/GasMessage/FundsSufficiencyMessage.js +1 -1
  48. package/cjs/components/GasMessage/GasRefuelMessage.js +1 -1
  49. package/cjs/components/GasMessage/GasSufficiencyMessage.js +2 -2
  50. package/cjs/components/Header/Header.style.d.ts +2 -2
  51. package/cjs/components/Header/NavigationHeader.js +19 -19
  52. package/cjs/components/Header/NavigationTabs.js +3 -3
  53. package/cjs/components/Header/NavigationTabs.style.js +3 -3
  54. package/cjs/components/Header/index.d.ts +1 -1
  55. package/cjs/components/Header/index.js +1 -1
  56. package/cjs/components/Header/types.d.ts +5 -2
  57. package/cjs/components/Header/useHeaderStore.d.ts +2 -0
  58. package/cjs/components/Header/{useHeaderActionStore.js → useHeaderStore.js} +13 -2
  59. package/cjs/components/Insurance/Insurance.js +2 -2
  60. package/cjs/components/Insurance/InsuranceCard.js +10 -7
  61. package/cjs/components/Insurance/InsuranceCollapsed.js +7 -3
  62. package/cjs/components/Insurance/index.d.ts +1 -0
  63. package/cjs/components/Insurance/index.js +1 -0
  64. package/cjs/components/Insurance/types.d.ts +11 -7
  65. package/cjs/components/ListItemButton.d.ts +1 -1
  66. package/cjs/components/NFT/NFT.d.ts +1 -2
  67. package/cjs/components/NFT/NFT.js +15 -13
  68. package/cjs/components/NFT/NFT.style.d.ts +1 -1
  69. package/cjs/components/NFT/NFTBase.d.ts +3 -0
  70. package/cjs/components/NFT/NFTBase.js +13 -0
  71. package/cjs/components/NFT/index.d.ts +1 -0
  72. package/cjs/components/NFT/index.js +1 -0
  73. package/cjs/components/NFT/types.d.ts +3 -1
  74. package/cjs/components/ProgressToNextUpdate/ProgressToNextUpdate.js +3 -3
  75. package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +9 -9
  76. package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
  77. package/cjs/components/RouteCard/RouteCard.d.ts +4 -0
  78. package/cjs/components/{SwapRouteCard/SwapRouteCard.js → RouteCard/RouteCard.js} +16 -12
  79. package/cjs/components/RouteCard/RouteCardEssentials.d.ts +3 -0
  80. package/cjs/components/{SwapRouteCard/SwapRouteCardEssentials.js → RouteCard/RouteCardEssentials.js} +7 -7
  81. package/cjs/components/RouteCard/RouteCardSkeleton.d.ts +4 -0
  82. package/cjs/components/{SwapRouteCard/SwapRouteCardSkeleton.js → RouteCard/RouteCardSkeleton.js} +6 -6
  83. package/cjs/components/RouteCard/RouteNotFoundCard.d.ts +2 -0
  84. package/cjs/components/{SwapRouteCard/SwapRouteNotFoundCard.js → RouteCard/RouteNotFoundCard.js} +4 -4
  85. package/cjs/components/RouteCard/index.d.ts +3 -0
  86. package/cjs/components/{SwapRoutes → RouteCard}/index.js +3 -2
  87. package/cjs/components/{SwapRouteCard → RouteCard}/types.d.ts +3 -3
  88. package/cjs/components/{SwapRoutes/SwapRoutes.d.ts → Routes/Routes.d.ts} +1 -1
  89. package/cjs/components/Routes/Routes.js +37 -0
  90. package/cjs/components/Routes/RoutesExpanded.d.ts +2 -0
  91. package/cjs/components/Routes/RoutesExpanded.js +44 -0
  92. package/cjs/components/Routes/index.d.ts +2 -0
  93. package/cjs/components/Routes/index.js +18 -0
  94. package/cjs/components/SelectChainAndToken.js +7 -7
  95. package/cjs/components/SelectTokenButton/SelectTokenButton.d.ts +2 -2
  96. package/cjs/components/SelectTokenButton/SelectTokenButton.js +11 -11
  97. package/cjs/components/SendToWallet/SendToWallet.js +9 -10
  98. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  99. package/cjs/components/SendToWallet/SendToWalletButton.js +2 -2
  100. package/cjs/components/SmallAvatar.d.ts +1 -1
  101. package/cjs/components/Step/DestinationWalletAddress.js +2 -2
  102. package/cjs/components/Step/GasStepProcess.js +1 -1
  103. package/cjs/components/Step/Step.js +13 -13
  104. package/cjs/components/Step/StepList.d.ts +2 -1
  105. package/cjs/components/Step/StepList.js +4 -2
  106. package/cjs/components/Step/StepTimer.js +2 -2
  107. package/cjs/components/StepActions/StepActions.d.ts +3 -3
  108. package/cjs/components/StepActions/StepActions.js +31 -18
  109. package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
  110. package/cjs/components/StepActions/types.d.ts +2 -2
  111. package/cjs/components/Token/Token.js +1 -1
  112. package/cjs/components/TokenList/TokenList.js +2 -2
  113. package/cjs/components/TokenList/TokenList.style.d.ts +4 -4
  114. package/cjs/components/TokenList/TokenList.style.js +11 -8
  115. package/cjs/components/TokenList/TokenListItem.js +5 -9
  116. package/cjs/components/TokenList/TokenNotFound.d.ts +2 -2
  117. package/cjs/components/TokenList/TokenNotFound.js +2 -2
  118. package/cjs/components/TokenList/VirtualizedTokenList.js +2 -2
  119. package/cjs/components/TokenList/types.d.ts +2 -2
  120. package/cjs/components/TokenList/useTokenSelect.d.ts +2 -2
  121. package/cjs/components/TokenList/useTokenSelect.js +11 -9
  122. package/cjs/config/theme.js +1 -2
  123. package/cjs/config/version.d.ts +1 -1
  124. package/cjs/config/version.js +1 -1
  125. package/cjs/hooks/index.d.ts +1 -1
  126. package/cjs/hooks/index.js +1 -1
  127. package/cjs/hooks/useChains.js +4 -4
  128. package/cjs/hooks/useFundsSufficiency.js +1 -5
  129. package/cjs/hooks/useGasRecommendation.d.ts +1 -1
  130. package/cjs/hooks/useGasRecommendation.js +5 -0
  131. package/cjs/hooks/useGasRefuel.js +4 -4
  132. package/cjs/hooks/useProcessMessage.d.ts +2 -2
  133. package/cjs/hooks/useProcessMessage.js +46 -46
  134. package/cjs/hooks/useRouteExecution.js +3 -4
  135. package/cjs/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
  136. package/cjs/hooks/{useSwapRoutes.js → useRoutes.js} +22 -24
  137. package/cjs/hooks/useTokenBalance.js +4 -5
  138. package/cjs/hooks/useTokenBalances.js +1 -5
  139. package/cjs/hooks/useTokens.js +21 -9
  140. package/cjs/i18n/bn.json +80 -80
  141. package/cjs/i18n/de.json +74 -74
  142. package/cjs/i18n/en.json +132 -131
  143. package/cjs/i18n/es.json +72 -72
  144. package/cjs/i18n/fr.json +102 -85
  145. package/cjs/i18n/id.json +145 -127
  146. package/cjs/i18n/it.json +154 -125
  147. package/cjs/i18n/ko.json +102 -85
  148. package/cjs/i18n/pt.json +133 -130
  149. package/cjs/i18n/th.json +102 -85
  150. package/cjs/i18n/tr.json +72 -72
  151. package/cjs/i18n/uk.json +131 -128
  152. package/cjs/i18n/vi.json +104 -79
  153. package/cjs/i18n/zh.json +104 -87
  154. package/cjs/index.d.ts +2 -0
  155. package/cjs/index.js +5 -1
  156. package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.d.ts +2 -0
  157. package/cjs/pages/{ActiveSwapsPage/ActiveSwapsEmpty.js → ActiveTransactionsPage/ActiveTransactionsEmpty.js} +4 -4
  158. package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.d.ts +1 -0
  159. package/cjs/pages/{ActiveSwapsPage/ActiveSwapsPage.js → ActiveTransactionsPage/ActiveTransactionsPage.js} +8 -8
  160. package/cjs/pages/ActiveTransactionsPage/index.d.ts +1 -0
  161. package/cjs/pages/{ActiveSwapsPage → ActiveTransactionsPage}/index.js +1 -1
  162. package/cjs/pages/MainPage/MainGasMessage.js +1 -1
  163. package/cjs/pages/MainPage/MainPage.js +7 -7
  164. package/cjs/pages/MainPage/ReviewButton.d.ts +2 -0
  165. package/cjs/pages/MainPage/ReviewButton.js +62 -0
  166. package/{components/SwapRoutes/SwapRoutes.d.ts → cjs/pages/RoutesPage/RoutesPage.d.ts} +1 -1
  167. package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.js → RoutesPage/RoutesPage.js} +11 -11
  168. package/cjs/pages/RoutesPage/index.d.ts +1 -0
  169. package/cjs/{components/SwapInput → pages/RoutesPage}/index.js +1 -1
  170. package/cjs/pages/SelectChainPage/types.d.ts +2 -2
  171. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +1 -1
  172. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
  173. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +2 -2
  174. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
  175. package/cjs/pages/SelectTokenPage/SearchTokenInput.js +3 -3
  176. package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -2
  177. package/cjs/pages/SelectTokenPage/types.js +1 -1
  178. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
  179. package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
  180. package/cjs/pages/SettingsPage/LanguageSelect.js +1 -1
  181. package/cjs/pages/SettingsPage/ResetSettingsButton.js +1 -1
  182. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +1 -1
  183. package/cjs/pages/TransactionDetailsPage/TransactionDetailsPage.d.ts +2 -0
  184. package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.js → TransactionDetailsPage/TransactionDetailsPage.js} +10 -9
  185. package/cjs/pages/TransactionDetailsPage/index.d.ts +1 -0
  186. package/cjs/pages/{SwapDetailsPage → TransactionDetailsPage}/index.js +1 -1
  187. package/cjs/pages/TransactionHistoryPage/TransactionHistoryEmpty.d.ts +2 -0
  188. package/cjs/pages/{SwapHistoryPage/SwapHistoryEmpty.js → TransactionHistoryPage/TransactionHistoryEmpty.js} +4 -4
  189. package/cjs/pages/{SwapHistoryPage/SwapHistoryItem.d.ts → TransactionHistoryPage/TransactionHistoryItem.d.ts} +1 -1
  190. package/cjs/pages/{SwapHistoryPage/SwapHistoryItem.js → TransactionHistoryPage/TransactionHistoryItem.js} +4 -4
  191. package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +2 -0
  192. package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js +35 -0
  193. package/cjs/pages/TransactionHistoryPage/index.d.ts +1 -0
  194. package/cjs/pages/TransactionHistoryPage/index.js +17 -0
  195. package/cjs/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.js +5 -4
  196. package/cjs/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
  197. package/cjs/pages/TransactionPage/StartTransactionButton.js +21 -0
  198. package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +27 -24
  199. package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.js +5 -1
  200. package/cjs/pages/TransactionPage/TokenValueBottomSheet.js +38 -0
  201. package/cjs/pages/TransactionPage/TransactionPage.d.ts +2 -0
  202. package/cjs/pages/TransactionPage/TransactionPage.js +129 -0
  203. package/cjs/pages/TransactionPage/index.d.ts +1 -0
  204. package/cjs/pages/{SwapHistoryPage → TransactionPage}/index.js +1 -1
  205. package/cjs/pages/TransactionPage/types.d.ts +6 -0
  206. package/cjs/pages/TransactionPage/utils.d.ts +2 -0
  207. package/cjs/pages/TransactionPage/utils.js +10 -0
  208. package/cjs/providers/{SwapFormProvider/SwapFormProvider.d.ts → FormProvider/FormProvider.d.ts} +1 -1
  209. package/cjs/providers/{SwapFormProvider/SwapFormProvider.js → FormProvider/FormProvider.js} +11 -11
  210. package/cjs/providers/FormProvider/FormUpdater.d.ts +5 -0
  211. package/cjs/providers/{SwapFormProvider → FormProvider}/FormUpdater.js +14 -14
  212. package/cjs/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.js +6 -6
  213. package/cjs/providers/{SwapFormProvider → FormProvider}/index.d.ts +1 -1
  214. package/cjs/providers/{SwapFormProvider → FormProvider}/index.js +1 -1
  215. package/cjs/providers/FormProvider/types.d.ts +37 -0
  216. package/cjs/providers/FormProvider/types.js +23 -0
  217. package/cjs/providers/WalletProvider/WalletProvider.js +5 -3
  218. package/cjs/providers/WalletProvider/types.d.ts +1 -1
  219. package/cjs/providers/WidgetProvider/WidgetProvider.js +1 -1
  220. package/cjs/providers/index.d.ts +1 -1
  221. package/cjs/providers/index.js +1 -1
  222. package/cjs/stores/routes/createRouteExecutionStore.js +1 -1
  223. package/cjs/stores/routes/index.d.ts +1 -1
  224. package/cjs/stores/routes/index.js +1 -1
  225. package/cjs/stores/routes/types.js +1 -1
  226. package/cjs/stores/routes/useTransactionHistory.d.ts +2 -0
  227. package/cjs/stores/routes/{useSwapHistory.js → useTransactionHistory.js} +3 -3
  228. package/cjs/stores/routes/utils.d.ts +1 -0
  229. package/cjs/stores/routes/utils.js +5 -1
  230. package/cjs/types/events.d.ts +9 -1
  231. package/cjs/types/events.js +2 -1
  232. package/cjs/types/widget.d.ts +6 -4
  233. package/cjs/types/widget.js +3 -3
  234. package/cjs/utils/elements.js +1 -1
  235. package/cjs/utils/format.d.ts +1 -1
  236. package/cjs/utils/format.js +13 -15
  237. package/cjs/utils/navigationRoutes.d.ts +5 -5
  238. package/cjs/utils/navigationRoutes.js +15 -15
  239. package/components/{ActiveSwaps/ActiveSwapItem.d.ts → ActiveTransactions/ActiveTransactionItem.d.ts} +1 -1
  240. package/components/{ActiveSwaps/ActiveSwapItem.js → ActiveTransactions/ActiveTransactionItem.js} +3 -3
  241. package/components/ActiveTransactions/ActiveTransactions.d.ts +3 -0
  242. package/components/{ActiveSwaps/ActiveSwaps.js → ActiveTransactions/ActiveTransactions.js} +5 -5
  243. package/components/{ActiveSwaps/ActiveSwaps.style.d.ts → ActiveTransactions/ActiveTransactions.style.d.ts} +4 -4
  244. package/components/ActiveTransactions/index.d.ts +2 -0
  245. package/components/ActiveTransactions/index.js +2 -0
  246. package/components/AmountInput/AmountInput.d.ts +12 -0
  247. package/components/AmountInput/AmountInput.js +52 -0
  248. package/{cjs/components/SwapInput/SwapInput.style.d.ts → components/AmountInput/AmountInput.style.d.ts} +1 -1
  249. package/{cjs/components/SwapInput/SwapInputAdornment.style.d.ts → components/AmountInput/AmountInputAdornment.style.d.ts} +2 -2
  250. package/components/AmountInput/AmountInputEndAdornment.d.ts +2 -0
  251. package/components/{SwapInput/SwapInputEndAdornment.js → AmountInput/AmountInputEndAdornment.js} +7 -7
  252. package/components/AmountInput/AmountInputStartAdornment.d.ts +3 -0
  253. package/components/{SwapInput/SwapInputStartAdornment.js → AmountInput/AmountInputStartAdornment.js} +4 -4
  254. package/components/AmountInput/FormPriceHelperText.d.ts +9 -0
  255. package/components/{SwapInput → AmountInput}/FormPriceHelperText.js +14 -9
  256. package/components/AmountInput/index.d.ts +1 -0
  257. package/components/AmountInput/index.js +1 -0
  258. package/components/Card/CardIconButton.d.ts +2 -2
  259. package/components/Card/CardLabel.d.ts +1 -1
  260. package/components/ChainSelect/ChainSelect.d.ts +2 -2
  261. package/components/ChainSelect/ChainSelect.js +2 -2
  262. package/components/ChainSelect/useChainSelect.d.ts +2 -2
  263. package/components/ChainSelect/useChainSelect.js +6 -6
  264. package/components/ContractComponent/ContractComponent.d.ts +2 -2
  265. package/components/ContractComponent/ContractComponent.js +3 -5
  266. package/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +3 -0
  267. package/components/DefaultTransactionButton/DefaultTransactionButton.js +32 -0
  268. package/components/DefaultTransactionButton/index.d.ts +2 -0
  269. package/components/DefaultTransactionButton/index.js +2 -0
  270. package/components/{SwapButton → DefaultTransactionButton}/types.d.ts +1 -2
  271. package/components/GasMessage/FundsSufficiencyMessage.js +1 -1
  272. package/components/GasMessage/GasRefuelMessage.js +1 -1
  273. package/components/GasMessage/GasSufficiencyMessage.js +2 -2
  274. package/components/Header/Header.style.d.ts +2 -2
  275. package/components/Header/NavigationHeader.js +19 -19
  276. package/components/Header/NavigationTabs.js +4 -4
  277. package/components/Header/NavigationTabs.style.js +3 -3
  278. package/components/Header/index.d.ts +1 -1
  279. package/components/Header/index.js +1 -1
  280. package/components/Header/types.d.ts +5 -2
  281. package/components/Header/useHeaderStore.d.ts +2 -0
  282. package/components/Header/useHeaderStore.js +25 -0
  283. package/components/Insurance/Insurance.js +2 -2
  284. package/components/Insurance/InsuranceCard.js +11 -8
  285. package/components/Insurance/InsuranceCollapsed.js +8 -4
  286. package/components/Insurance/index.d.ts +1 -0
  287. package/components/Insurance/index.js +1 -0
  288. package/components/Insurance/types.d.ts +11 -7
  289. package/components/ListItemButton.d.ts +1 -1
  290. package/components/NFT/NFT.d.ts +1 -2
  291. package/components/NFT/NFT.js +17 -15
  292. package/components/NFT/NFT.style.d.ts +1 -1
  293. package/components/NFT/NFTBase.d.ts +3 -0
  294. package/components/NFT/NFTBase.js +9 -0
  295. package/components/NFT/index.d.ts +1 -0
  296. package/components/NFT/index.js +1 -0
  297. package/components/NFT/types.d.ts +3 -1
  298. package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +4 -4
  299. package/components/ReverseTokensButton/ReverseTokensButton.js +10 -10
  300. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
  301. package/components/RouteCard/RouteCard.d.ts +4 -0
  302. package/components/{SwapRouteCard/SwapRouteCard.js → RouteCard/RouteCard.js} +15 -11
  303. package/components/RouteCard/RouteCardEssentials.d.ts +3 -0
  304. package/components/{SwapRouteCard/SwapRouteCardEssentials.js → RouteCard/RouteCardEssentials.js} +3 -3
  305. package/components/RouteCard/RouteCardSkeleton.d.ts +4 -0
  306. package/components/{SwapRouteCard/SwapRouteCardSkeleton.js → RouteCard/RouteCardSkeleton.js} +4 -4
  307. package/components/RouteCard/RouteNotFoundCard.d.ts +2 -0
  308. package/components/{SwapRouteCard/SwapRouteNotFoundCard.js → RouteCard/RouteNotFoundCard.js} +2 -2
  309. package/components/RouteCard/index.d.ts +3 -0
  310. package/components/RouteCard/index.js +3 -0
  311. package/components/{SwapRouteCard → RouteCard}/types.d.ts +3 -3
  312. package/{cjs/components/ActiveSwaps/ActiveSwaps.d.ts → components/Routes/Routes.d.ts} +1 -1
  313. package/components/Routes/Routes.js +33 -0
  314. package/components/Routes/RoutesExpanded.d.ts +2 -0
  315. package/components/{SwapRoutes/SwapRoutesExpanded.js → Routes/RoutesExpanded.js} +12 -10
  316. package/components/Routes/index.d.ts +2 -0
  317. package/components/Routes/index.js +2 -0
  318. package/components/SelectChainAndToken.js +8 -8
  319. package/components/SelectTokenButton/SelectTokenButton.d.ts +2 -2
  320. package/components/SelectTokenButton/SelectTokenButton.js +12 -12
  321. package/components/SendToWallet/SendToWallet.js +10 -11
  322. package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  323. package/components/SendToWallet/SendToWalletButton.js +3 -3
  324. package/components/SmallAvatar.d.ts +1 -1
  325. package/components/Step/DestinationWalletAddress.js +2 -2
  326. package/components/Step/GasStepProcess.js +1 -1
  327. package/components/Step/Step.js +13 -13
  328. package/components/Step/StepList.d.ts +2 -1
  329. package/components/Step/StepList.js +4 -2
  330. package/components/Step/StepTimer.js +2 -2
  331. package/components/StepActions/StepActions.d.ts +3 -3
  332. package/components/StepActions/StepActions.js +31 -18
  333. package/components/StepActions/StepActions.style.d.ts +1 -1
  334. package/components/StepActions/types.d.ts +2 -2
  335. package/components/Token/Token.js +1 -1
  336. package/components/TokenList/TokenList.js +3 -3
  337. package/components/TokenList/TokenList.style.d.ts +4 -4
  338. package/components/TokenList/TokenList.style.js +11 -8
  339. package/components/TokenList/TokenListItem.js +7 -11
  340. package/components/TokenList/TokenNotFound.d.ts +2 -2
  341. package/components/TokenList/TokenNotFound.js +3 -3
  342. package/components/TokenList/VirtualizedTokenList.js +2 -2
  343. package/components/TokenList/types.d.ts +2 -2
  344. package/components/TokenList/useTokenSelect.d.ts +2 -2
  345. package/components/TokenList/useTokenSelect.js +12 -10
  346. package/config/theme.js +1 -2
  347. package/config/version.d.ts +1 -1
  348. package/config/version.js +1 -1
  349. package/hooks/index.d.ts +1 -1
  350. package/hooks/index.js +1 -1
  351. package/hooks/useChains.js +5 -5
  352. package/hooks/useFundsSufficiency.js +2 -6
  353. package/hooks/useGasRecommendation.d.ts +1 -1
  354. package/hooks/useGasRecommendation.js +5 -0
  355. package/hooks/useGasRefuel.js +5 -5
  356. package/hooks/useProcessMessage.d.ts +2 -2
  357. package/hooks/useProcessMessage.js +46 -46
  358. package/hooks/useRouteExecution.js +3 -4
  359. package/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
  360. package/hooks/{useSwapRoutes.js → useRoutes.js} +21 -23
  361. package/hooks/useTokenBalance.js +4 -5
  362. package/hooks/useTokenBalances.js +1 -5
  363. package/hooks/useTokens.js +21 -9
  364. package/i18n/bn.json +80 -80
  365. package/i18n/de.json +74 -74
  366. package/i18n/en.json +132 -131
  367. package/i18n/es.json +72 -72
  368. package/i18n/fr.json +102 -85
  369. package/i18n/id.json +145 -127
  370. package/i18n/it.json +154 -125
  371. package/i18n/ko.json +102 -85
  372. package/i18n/pt.json +133 -130
  373. package/i18n/th.json +102 -85
  374. package/i18n/tr.json +72 -72
  375. package/i18n/uk.json +131 -128
  376. package/i18n/vi.json +104 -79
  377. package/i18n/zh.json +104 -87
  378. package/index.d.ts +2 -0
  379. package/index.js +2 -0
  380. package/package.json +13 -13
  381. package/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.d.ts +2 -0
  382. package/pages/{ActiveSwapsPage/ActiveSwapsEmpty.js → ActiveTransactionsPage/ActiveTransactionsEmpty.js} +2 -2
  383. package/pages/ActiveTransactionsPage/ActiveTransactionsPage.d.ts +1 -0
  384. package/pages/{ActiveSwapsPage/ActiveSwapsPage.js → ActiveTransactionsPage/ActiveTransactionsPage.js} +7 -7
  385. package/pages/ActiveTransactionsPage/index.d.ts +1 -0
  386. package/pages/ActiveTransactionsPage/index.js +1 -0
  387. package/pages/MainPage/MainGasMessage.js +2 -2
  388. package/pages/MainPage/MainPage.js +7 -7
  389. package/pages/MainPage/ReviewButton.d.ts +2 -0
  390. package/pages/MainPage/ReviewButton.js +58 -0
  391. package/{components/ActiveSwaps/ActiveSwaps.d.ts → pages/RoutesPage/RoutesPage.d.ts} +1 -1
  392. package/pages/{SwapRoutesPage/SwapRoutesPage.js → RoutesPage/RoutesPage.js} +11 -11
  393. package/pages/RoutesPage/index.d.ts +1 -0
  394. package/pages/RoutesPage/index.js +1 -0
  395. package/pages/SelectChainPage/types.d.ts +2 -2
  396. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +2 -2
  397. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
  398. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +2 -2
  399. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
  400. package/pages/SelectTokenPage/SearchTokenInput.js +4 -4
  401. package/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -2
  402. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
  403. package/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
  404. package/pages/SettingsPage/LanguageSelect.js +1 -1
  405. package/pages/SettingsPage/ResetSettingsButton.js +1 -1
  406. package/pages/SettingsPage/RoutePrioritySelect.js +1 -1
  407. package/pages/TransactionDetailsPage/TransactionDetailsPage.d.ts +2 -0
  408. package/pages/{SwapDetailsPage/SwapDetailsPage.js → TransactionDetailsPage/TransactionDetailsPage.js} +8 -7
  409. package/pages/TransactionDetailsPage/index.d.ts +1 -0
  410. package/pages/TransactionDetailsPage/index.js +1 -0
  411. package/pages/TransactionHistoryPage/TransactionHistoryEmpty.d.ts +2 -0
  412. package/pages/{SwapHistoryPage/SwapHistoryEmpty.js → TransactionHistoryPage/TransactionHistoryEmpty.js} +2 -2
  413. package/pages/{SwapHistoryPage/SwapHistoryItem.d.ts → TransactionHistoryPage/TransactionHistoryItem.d.ts} +1 -1
  414. package/pages/{SwapHistoryPage/SwapHistoryItem.js → TransactionHistoryPage/TransactionHistoryItem.js} +2 -2
  415. package/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +2 -0
  416. package/pages/TransactionHistoryPage/TransactionHistoryPage.js +31 -0
  417. package/pages/TransactionHistoryPage/index.d.ts +1 -0
  418. package/pages/TransactionHistoryPage/index.js +1 -0
  419. package/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.js +5 -4
  420. package/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
  421. package/pages/TransactionPage/StartTransactionButton.js +16 -0
  422. package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +28 -25
  423. package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.js +5 -1
  424. package/pages/TransactionPage/TokenValueBottomSheet.js +34 -0
  425. package/pages/TransactionPage/TransactionPage.d.ts +2 -0
  426. package/pages/TransactionPage/TransactionPage.js +125 -0
  427. package/pages/TransactionPage/index.d.ts +1 -0
  428. package/pages/TransactionPage/index.js +1 -0
  429. package/pages/TransactionPage/types.d.ts +6 -0
  430. package/pages/TransactionPage/utils.d.ts +2 -0
  431. package/pages/TransactionPage/utils.js +6 -0
  432. package/providers/{SwapFormProvider/SwapFormProvider.d.ts → FormProvider/FormProvider.d.ts} +1 -1
  433. package/providers/{SwapFormProvider/SwapFormProvider.js → FormProvider/FormProvider.js} +12 -12
  434. package/providers/FormProvider/FormUpdater.d.ts +5 -0
  435. package/providers/{SwapFormProvider → FormProvider}/FormUpdater.js +14 -14
  436. package/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.js +7 -7
  437. package/providers/{SwapFormProvider → FormProvider}/index.d.ts +1 -1
  438. package/providers/{SwapFormProvider → FormProvider}/index.js +1 -1
  439. package/providers/FormProvider/types.d.ts +37 -0
  440. package/providers/FormProvider/types.js +20 -0
  441. package/providers/WalletProvider/WalletProvider.js +5 -3
  442. package/providers/WalletProvider/types.d.ts +1 -1
  443. package/providers/WidgetProvider/WidgetProvider.js +2 -2
  444. package/providers/index.d.ts +1 -1
  445. package/providers/index.js +1 -1
  446. package/stores/routes/createRouteExecutionStore.js +1 -1
  447. package/stores/routes/index.d.ts +1 -1
  448. package/stores/routes/index.js +1 -1
  449. package/stores/routes/useTransactionHistory.d.ts +2 -0
  450. package/stores/routes/{useSwapHistory.js → useTransactionHistory.js} +1 -1
  451. package/stores/routes/utils.d.ts +1 -0
  452. package/stores/routes/utils.js +3 -0
  453. package/tsconfig.cjs.tsbuildinfo +1 -1
  454. package/types/events.d.ts +9 -1
  455. package/types/events.js +1 -0
  456. package/types/widget.d.ts +6 -4
  457. package/utils/format.d.ts +1 -1
  458. package/utils/format.js +11 -13
  459. package/utils/navigationRoutes.d.ts +5 -5
  460. package/utils/navigationRoutes.js +15 -15
  461. package/cjs/components/ActiveSwaps/index.d.ts +0 -2
  462. package/cjs/components/Header/useHeaderActionStore.d.ts +0 -2
  463. package/cjs/components/SwapButton/SwapButton.d.ts +0 -3
  464. package/cjs/components/SwapButton/SwapButton.js +0 -56
  465. package/cjs/components/SwapButton/index.d.ts +0 -2
  466. package/cjs/components/SwapInput/FitInputText.d.ts +0 -3
  467. package/cjs/components/SwapInput/FitInputText.js +0 -19
  468. package/cjs/components/SwapInput/FormPriceHelperText.d.ts +0 -3
  469. package/cjs/components/SwapInput/SwapInput.d.ts +0 -4
  470. package/cjs/components/SwapInput/SwapInput.js +0 -41
  471. package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -2
  472. package/cjs/components/SwapInput/SwapInputStartAdornment.d.ts +0 -3
  473. package/cjs/components/SwapInput/index.d.ts +0 -1
  474. package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +0 -4
  475. package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +0 -3
  476. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.d.ts +0 -4
  477. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +0 -2
  478. package/cjs/components/SwapRouteCard/index.d.ts +0 -3
  479. package/cjs/components/SwapRouteCard/index.js +0 -19
  480. package/cjs/components/SwapRoutes/SwapRoutes.js +0 -37
  481. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -2
  482. package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +0 -42
  483. package/cjs/components/SwapRoutes/index.d.ts +0 -2
  484. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +0 -2
  485. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  486. package/cjs/pages/ActiveSwapsPage/index.d.ts +0 -1
  487. package/cjs/pages/MainPage/MainSwapButton.d.ts +0 -2
  488. package/cjs/pages/MainPage/MainSwapButton.js +0 -27
  489. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.d.ts +0 -2
  490. package/cjs/pages/SwapDetailsPage/index.d.ts +0 -1
  491. package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.d.ts +0 -2
  492. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.d.ts +0 -2
  493. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +0 -35
  494. package/cjs/pages/SwapHistoryPage/index.d.ts +0 -1
  495. package/cjs/pages/SwapPage/StartSwapButton.d.ts +0 -4
  496. package/cjs/pages/SwapPage/StartSwapButton.js +0 -21
  497. package/cjs/pages/SwapPage/SwapPage.d.ts +0 -2
  498. package/cjs/pages/SwapPage/SwapPage.js +0 -99
  499. package/cjs/pages/SwapPage/TokenValueBottomSheet.js +0 -43
  500. package/cjs/pages/SwapPage/index.d.ts +0 -1
  501. package/cjs/pages/SwapPage/types.d.ts +0 -9
  502. package/cjs/pages/SwapRoutesPage/index.d.ts +0 -1
  503. package/cjs/pages/SwapRoutesPage/index.js +0 -17
  504. package/cjs/providers/SwapFormProvider/FormUpdater.d.ts +0 -5
  505. package/cjs/providers/SwapFormProvider/types.d.ts +0 -37
  506. package/cjs/providers/SwapFormProvider/types.js +0 -23
  507. package/cjs/stores/routes/useSwapHistory.d.ts +0 -2
  508. package/components/ActiveSwaps/index.d.ts +0 -2
  509. package/components/ActiveSwaps/index.js +0 -2
  510. package/components/Header/useHeaderActionStore.d.ts +0 -2
  511. package/components/Header/useHeaderActionStore.js +0 -14
  512. package/components/SwapButton/SwapButton.d.ts +0 -3
  513. package/components/SwapButton/SwapButton.js +0 -52
  514. package/components/SwapButton/index.d.ts +0 -2
  515. package/components/SwapButton/index.js +0 -2
  516. package/components/SwapInput/FitInputText.d.ts +0 -3
  517. package/components/SwapInput/FitInputText.js +0 -16
  518. package/components/SwapInput/FormPriceHelperText.d.ts +0 -3
  519. package/components/SwapInput/SwapInput.d.ts +0 -4
  520. package/components/SwapInput/SwapInput.js +0 -37
  521. package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -2
  522. package/components/SwapInput/SwapInputStartAdornment.d.ts +0 -3
  523. package/components/SwapInput/index.d.ts +0 -1
  524. package/components/SwapInput/index.js +0 -1
  525. package/components/SwapRouteCard/SwapRouteCard.d.ts +0 -4
  526. package/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +0 -3
  527. package/components/SwapRouteCard/SwapRouteCardSkeleton.d.ts +0 -4
  528. package/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +0 -2
  529. package/components/SwapRouteCard/index.d.ts +0 -3
  530. package/components/SwapRouteCard/index.js +0 -3
  531. package/components/SwapRoutes/SwapRoutes.js +0 -33
  532. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -2
  533. package/components/SwapRoutes/index.d.ts +0 -2
  534. package/components/SwapRoutes/index.js +0 -2
  535. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +0 -2
  536. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  537. package/pages/ActiveSwapsPage/index.d.ts +0 -1
  538. package/pages/ActiveSwapsPage/index.js +0 -1
  539. package/pages/MainPage/MainSwapButton.d.ts +0 -2
  540. package/pages/MainPage/MainSwapButton.js +0 -23
  541. package/pages/SwapDetailsPage/SwapDetailsPage.d.ts +0 -2
  542. package/pages/SwapDetailsPage/index.d.ts +0 -1
  543. package/pages/SwapDetailsPage/index.js +0 -1
  544. package/pages/SwapHistoryPage/SwapHistoryEmpty.d.ts +0 -2
  545. package/pages/SwapHistoryPage/SwapHistoryPage.d.ts +0 -2
  546. package/pages/SwapHistoryPage/SwapHistoryPage.js +0 -31
  547. package/pages/SwapHistoryPage/index.d.ts +0 -1
  548. package/pages/SwapHistoryPage/index.js +0 -1
  549. package/pages/SwapPage/StartSwapButton.d.ts +0 -4
  550. package/pages/SwapPage/StartSwapButton.js +0 -16
  551. package/pages/SwapPage/SwapPage.d.ts +0 -2
  552. package/pages/SwapPage/SwapPage.js +0 -95
  553. package/pages/SwapPage/TokenValueBottomSheet.js +0 -39
  554. package/pages/SwapPage/index.d.ts +0 -1
  555. package/pages/SwapPage/index.js +0 -1
  556. package/pages/SwapPage/types.d.ts +0 -9
  557. package/pages/SwapRoutesPage/SwapRoutesPage.d.ts +0 -3
  558. package/pages/SwapRoutesPage/index.d.ts +0 -1
  559. package/pages/SwapRoutesPage/index.js +0 -1
  560. package/providers/SwapFormProvider/FormUpdater.d.ts +0 -5
  561. package/providers/SwapFormProvider/types.d.ts +0 -37
  562. package/providers/SwapFormProvider/types.js +0 -20
  563. package/stores/routes/useSwapHistory.d.ts +0 -2
  564. /package/cjs/components/{ActiveSwaps/ActiveSwaps.style.js → ActiveTransactions/ActiveTransactions.style.js} +0 -0
  565. /package/cjs/components/{SwapInput/SwapInput.style.js → AmountInput/AmountInput.style.js} +0 -0
  566. /package/cjs/components/{SwapInput/SwapInputAdornment.style.js → AmountInput/AmountInputAdornment.style.js} +0 -0
  567. /package/cjs/components/{SwapButton → DefaultTransactionButton}/types.js +0 -0
  568. /package/cjs/components/{SwapRouteCard/SwapRouteCard.style.d.ts → RouteCard/RouteCard.style.d.ts} +0 -0
  569. /package/cjs/components/{SwapRouteCard/SwapRouteCard.style.js → RouteCard/RouteCard.style.js} +0 -0
  570. /package/cjs/components/{SwapRouteCard → RouteCard}/types.js +0 -0
  571. /package/cjs/components/{SwapRouteCard → RouteCard}/utils.d.ts +0 -0
  572. /package/cjs/components/{SwapRouteCard → RouteCard}/utils.js +0 -0
  573. /package/cjs/components/{SwapRoutes/SwapRoutesExpanded.style.d.ts → Routes/RoutesExpanded.style.d.ts} +0 -0
  574. /package/cjs/components/{SwapRoutes/SwapRoutesExpanded.style.js → Routes/RoutesExpanded.style.js} +0 -0
  575. /package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.style.d.ts → RoutesPage/RoutesPage.style.d.ts} +0 -0
  576. /package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.style.js → RoutesPage/RoutesPage.style.js} +0 -0
  577. /package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.style.d.ts → TransactionDetailsPage/TransactionDetailsPage.style.d.ts} +0 -0
  578. /package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.style.js → TransactionDetailsPage/TransactionDetailsPage.style.js} +0 -0
  579. /package/cjs/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.d.ts +0 -0
  580. /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.d.ts +0 -0
  581. /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.d.ts +0 -0
  582. /package/cjs/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.d.ts +0 -0
  583. /package/cjs/pages/{SwapPage/SwapPage.style.d.ts → TransactionPage/TransactionPage.style.d.ts} +0 -0
  584. /package/cjs/pages/{SwapPage/SwapPage.style.js → TransactionPage/TransactionPage.style.js} +0 -0
  585. /package/cjs/pages/{SwapPage → TransactionPage}/types.js +0 -0
  586. /package/cjs/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.d.ts +0 -0
  587. /package/components/{ActiveSwaps/ActiveSwaps.style.js → ActiveTransactions/ActiveTransactions.style.js} +0 -0
  588. /package/components/{SwapInput/SwapInput.style.js → AmountInput/AmountInput.style.js} +0 -0
  589. /package/components/{SwapInput/SwapInputAdornment.style.js → AmountInput/AmountInputAdornment.style.js} +0 -0
  590. /package/components/{SwapButton → DefaultTransactionButton}/types.js +0 -0
  591. /package/components/{SwapRouteCard/SwapRouteCard.style.d.ts → RouteCard/RouteCard.style.d.ts} +0 -0
  592. /package/components/{SwapRouteCard/SwapRouteCard.style.js → RouteCard/RouteCard.style.js} +0 -0
  593. /package/components/{SwapRouteCard → RouteCard}/types.js +0 -0
  594. /package/components/{SwapRouteCard → RouteCard}/utils.d.ts +0 -0
  595. /package/components/{SwapRouteCard → RouteCard}/utils.js +0 -0
  596. /package/components/{SwapRoutes/SwapRoutesExpanded.style.d.ts → Routes/RoutesExpanded.style.d.ts} +0 -0
  597. /package/components/{SwapRoutes/SwapRoutesExpanded.style.js → Routes/RoutesExpanded.style.js} +0 -0
  598. /package/pages/{SwapRoutesPage/SwapRoutesPage.style.d.ts → RoutesPage/RoutesPage.style.d.ts} +0 -0
  599. /package/pages/{SwapRoutesPage/SwapRoutesPage.style.js → RoutesPage/RoutesPage.style.js} +0 -0
  600. /package/pages/{SwapDetailsPage/SwapDetailsPage.style.d.ts → TransactionDetailsPage/TransactionDetailsPage.style.d.ts} +0 -0
  601. /package/pages/{SwapDetailsPage/SwapDetailsPage.style.js → TransactionDetailsPage/TransactionDetailsPage.style.js} +0 -0
  602. /package/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.d.ts +0 -0
  603. /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.d.ts +0 -0
  604. /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.d.ts +0 -0
  605. /package/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.d.ts +0 -0
  606. /package/pages/{SwapPage/SwapPage.style.d.ts → TransactionPage/TransactionPage.style.d.ts} +0 -0
  607. /package/pages/{SwapPage/SwapPage.style.js → TransactionPage/TransactionPage.style.js} +0 -0
  608. /package/pages/{SwapPage → TransactionPage}/types.js +0 -0
  609. /package/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LinkButton = exports.ListItem = exports.ListItemButton = void 0;
3
+ exports.IconButton = exports.ListItem = exports.ListItemButton = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const ListItemSecondaryAction_1 = require("@mui/material/ListItemSecondaryAction");
6
6
  const ListItemText_1 = require("@mui/material/ListItemText");
@@ -23,28 +23,31 @@ exports.ListItem = (0, styles_1.styled)(material_1.ListItem)(({ theme }) => ({
23
23
  [`.${ListItemSecondaryAction_1.listItemSecondaryActionClasses.root}`]: {
24
24
  right: theme.spacing(3),
25
25
  },
26
+ [`& .${ListItemText_1.listItemTextClasses.primary}`]: {
27
+ height: 22,
28
+ },
26
29
  [`& .${ListItemText_1.listItemTextClasses.primary}, & .${ListItemText_1.listItemTextClasses.secondary}`]: {
27
30
  textOverflow: 'ellipsis',
28
31
  overflow: 'hidden',
29
32
  whiteSpace: 'nowrap',
30
33
  },
31
34
  }));
32
- exports.LinkButton = (0, styles_1.styled)(material_1.Button)(({ theme }) => ({
35
+ exports.IconButton = (0, styles_1.styled)(material_1.IconButton)(({ theme }) => ({
33
36
  lineHeight: 1,
34
37
  fontSize: '0.75rem',
35
38
  fontWeight: 400,
36
- padding: theme.spacing(0.375, 0.75),
39
+ padding: theme.spacing(0.375, 0.375),
40
+ marginLeft: theme.spacing(0.25),
37
41
  color: 'inherit',
38
42
  backgroundColor: 'unset',
43
+ minWidth: 'unset',
44
+ borderRadius: '50%',
39
45
  '&:hover': {
40
46
  backgroundColor: theme.palette.mode === 'light'
41
47
  ? (0, styles_1.alpha)(theme.palette.common.black, 0.04)
42
48
  : (0, styles_1.alpha)(theme.palette.common.white, 0.08),
43
49
  },
44
- [`.${material_1.buttonClasses.endIcon}`]: {
45
- marginLeft: theme.spacing(0.25),
46
- },
47
- [`.${material_1.buttonClasses.endIcon} > *:nth-of-type(1)`]: {
48
- fontSize: '0.75rem',
50
+ svg: {
51
+ fontSize: '0.875rem',
49
52
  },
50
53
  }));
@@ -30,18 +30,14 @@ const TokenListItemButton = ({ onClick, token, chain, showBalance, isBalanceLoad
30
30
  setShowAddress(false);
31
31
  }
32
32
  };
33
- return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, dense: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondaryTypographyProps: {
33
+ return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, dense: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol?.[0] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondaryTypographyProps: {
34
34
  component: 'div',
35
- sx: {
36
- overflow: 'auto',
37
- marginLeft: -0.75,
38
- },
39
- }, secondary: (0, jsx_runtime_1.jsxs)(material_1.Box, { position: "relative", height: 18, ref: container, children: [(0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "down", in: !showAddress, container: container.current, style: {
35
+ }, secondary: (0, jsx_runtime_1.jsxs)(material_1.Box, { position: "relative", height: 20, ref: container, children: [(0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "down", in: !showAddress, container: container.current, style: {
40
36
  position: 'absolute',
41
- }, appear: false, children: (0, jsx_runtime_1.jsx)(material_1.Box, { pl: 0.75, children: token.name }) }), (0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "up", in: showAddress, container: container.current, style: {
37
+ }, appear: false, children: (0, jsx_runtime_1.jsx)(material_1.Box, { pt: 0.25, children: token.name }) }), (0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "up", in: showAddress, container: container.current, style: {
42
38
  position: 'absolute',
43
- }, appear: false, mountOnEnter: true, children: (0, jsx_runtime_1.jsx)(TokenList_style_1.LinkButton, { size: "small", LinkComponent: material_1.Link, href: `${chain?.metamask.blockExplorerUrls[0]}address/${token.address}`, target: "_blank", rel: "nofollow noreferrer", onClick: (e) => e.stopPropagation(), endIcon: (0, jsx_runtime_1.jsx)(OpenInNewRounded_1.default, {}), children: (0, utils_1.shortenAddress)(token.address) }) })] }) }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", noWrap: true, children: t('format.number', {
44
- value: token.amount,
39
+ }, appear: false, mountOnEnter: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", alignItems: "center", pt: 0.125, children: (0, utils_1.shortenAddress)(token.address) }), (0, jsx_runtime_1.jsx)(TokenList_style_1.IconButton, { size: "small", LinkComponent: material_1.Link, href: `${chain?.metamask.blockExplorerUrls[0]}address/${token.address}`, target: "_blank", rel: "nofollow noreferrer", onClick: (e) => e.stopPropagation(), children: (0, jsx_runtime_1.jsx)(OpenInNewRounded_1.default, {}) })] }) })] }) }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", noWrap: true, children: t('format.number', {
40
+ value: (0, utils_1.formatTokenAmount)(token.amount),
45
41
  }) })) : null, tokenPrice ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD, children: t(`format.currency`, {
46
42
  value: tokenPrice,
47
43
  }) })) : null] }))) : null] }));
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import type { SwapFormTypeProps } from '../../providers';
3
- export declare const TokenNotFound: React.FC<SwapFormTypeProps>;
2
+ import type { FormTypeProps } from '../../providers';
3
+ export declare const TokenNotFound: React.FC<FormTypeProps>;
@@ -11,7 +11,7 @@ const providers_1 = require("../../providers");
11
11
  const TokenNotFound = ({ formType }) => {
12
12
  const { t } = (0, react_i18next_1.useTranslation)();
13
13
  const [selectedChainId] = (0, react_hook_form_1.useWatch)({
14
- name: [providers_1.SwapFormKeyHelper.getChainKey(formType)],
14
+ name: [providers_1.FormKeyHelper.getChainKey(formType)],
15
15
  });
16
16
  const { getChainById } = (0, hooks_1.useChains)();
17
17
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
@@ -21,7 +21,7 @@ const TokenNotFound = ({ formType }) => {
21
21
  flexDirection: 'column',
22
22
  flex: 1,
23
23
  padding: 3,
24
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, lineHeight: 1, children: (0, jsx_runtime_1.jsx)(SearchOff_1.default, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, px: 2, children: t('swap.info.message.emptyTokenList', {
24
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, lineHeight: 1, children: (0, jsx_runtime_1.jsx)(SearchOff_1.default, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, px: 2, children: t('info.message.emptyTokenList', {
25
25
  chainName: getChainById(selectedChainId)?.name,
26
26
  }) })] }));
27
27
  };
@@ -49,10 +49,10 @@ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef,
49
49
  }
50
50
  return ((0, jsx_runtime_1.jsx)(material_1.List, { style: { height: getTotalSize() }, disablePadding: true, children: getVirtualItems().map((item) => {
51
51
  const token = tokens[item.index];
52
- return ((0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, chain: chain, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('swap.featuredTokens') })) : null, endAdornment: hasFeaturedTokens &&
52
+ return ((0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, chain: chain, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('main.featuredTokens') })) : null, endAdornment: hasFeaturedTokens &&
53
53
  token.featured &&
54
54
  item.index === featuredTokensLastIndex &&
55
- item.index !== tokensLastIndex ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, py: 1.25, children: t('swap.otherTokens') })) : null }, item.key));
55
+ item.index !== tokensLastIndex ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, py: 1.25, children: t('main.otherTokens') })) : null }, item.key));
56
56
  }) }));
57
57
  };
58
58
  exports.VirtualizedTokenList = VirtualizedTokenList;
@@ -1,9 +1,9 @@
1
1
  import type { ExtendedChain } from '@lifi/sdk';
2
2
  import type { MutableRefObject } from 'react';
3
- import type { SwapFormType } from '../../providers';
3
+ import type { FormType } from '../../providers';
4
4
  import type { TokenAmount } from '../../types';
5
5
  export interface TokenListProps {
6
- formType: SwapFormType;
6
+ formType: FormType;
7
7
  height: number;
8
8
  onClick?(): void;
9
9
  }
@@ -1,2 +1,2 @@
1
- import type { SwapFormType } from '../../providers';
2
- export declare const useTokenSelect: (formType: SwapFormType, onClick?: () => void) => (tokenAddress: string, chainId?: number) => void;
1
+ import type { FormType } from '../../providers';
2
+ export declare const useTokenSelect: (formType: FormType, onClick?: () => void) => (tokenAddress: string, chainId?: number) => void;
@@ -5,32 +5,34 @@ const react_1 = require("react");
5
5
  const react_hook_form_1 = require("react-hook-form");
6
6
  const providers_1 = require("../../providers");
7
7
  const useTokenSelect = (formType, onClick) => {
8
- const tokenKey = providers_1.SwapFormKeyHelper.getTokenKey(formType);
8
+ const tokenKey = providers_1.FormKeyHelper.getTokenKey(formType);
9
9
  const { field: { onChange, onBlur }, } = (0, react_hook_form_1.useController)({ name: tokenKey });
10
10
  const { setValue, getValues } = (0, react_hook_form_1.useFormContext)();
11
+ const { subvariant } = (0, providers_1.useWidgetConfig)();
11
12
  return (0, react_1.useCallback)((tokenAddress, chainId) => {
12
13
  onChange(tokenAddress);
13
14
  onBlur();
14
- const selectedChainId = chainId ?? getValues(providers_1.SwapFormKeyHelper.getChainKey(formType));
15
+ const selectedChainId = chainId ?? getValues(providers_1.FormKeyHelper.getChainKey(formType));
15
16
  // Set chain again to trigger URL builder update
16
- setValue(providers_1.SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
17
+ setValue(providers_1.FormKeyHelper.getChainKey(formType), selectedChainId, {
17
18
  shouldDirty: true,
18
19
  shouldTouch: true,
19
20
  });
20
- setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
21
+ setValue(providers_1.FormKeyHelper.getAmountKey(formType), '');
21
22
  const oppositeFormType = formType === 'from' ? 'to' : 'from';
22
23
  const [selectedOppositeToken, selectedOppositeChainId] = getValues([
23
- providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType),
24
- providers_1.SwapFormKeyHelper.getChainKey(oppositeFormType),
24
+ providers_1.FormKeyHelper.getTokenKey(oppositeFormType),
25
+ providers_1.FormKeyHelper.getChainKey(oppositeFormType),
25
26
  ]);
26
27
  if (selectedOppositeToken === tokenAddress &&
27
- selectedOppositeChainId === selectedChainId) {
28
- setValue(providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType), '', {
28
+ selectedOppositeChainId === selectedChainId &&
29
+ subvariant !== 'nft') {
30
+ setValue(providers_1.FormKeyHelper.getTokenKey(oppositeFormType), '', {
29
31
  shouldDirty: true,
30
32
  shouldTouch: true,
31
33
  });
32
34
  }
33
35
  onClick?.();
34
- }, [formType, getValues, onBlur, onChange, onClick, setValue]);
36
+ }, [formType, getValues, onBlur, onChange, onClick, setValue, subvariant]);
35
37
  };
36
38
  exports.useTokenSelect = useTokenSelect;
@@ -6,7 +6,6 @@ const ButtonBase_1 = require("@mui/material/ButtonBase");
6
6
  const DialogActions_1 = require("@mui/material/DialogActions");
7
7
  const colors_1 = require("@mui/material/colors");
8
8
  const styles_1 = require("@mui/material/styles");
9
- const system_1 = require("@mui/system");
10
9
  const palette = {
11
10
  primary: {
12
11
  main: '#3F49E1',
@@ -46,7 +45,7 @@ const shape = {
46
45
  borderRadius: 12,
47
46
  borderRadiusSecondary: 8,
48
47
  };
49
- const enterKeyframe = (0, system_1.keyframes) `
48
+ const enterKeyframe = (0, styles_1.keyframes) `
50
49
  0% {
51
50
  transform: scale(0);
52
51
  opacity: 0.05;
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.0.0-beta.9";
2
+ export declare const version = "2.0.1";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/widget';
5
- exports.version = '2.0.0-beta.9';
5
+ exports.version = '2.0.1';
@@ -14,9 +14,9 @@ export * from './useInitializer';
14
14
  export * from './useNavigateBack';
15
15
  export * from './useProcessMessage';
16
16
  export * from './useRouteExecution';
17
+ export * from './useRoutes';
17
18
  export * from './useScrollableContainer';
18
19
  export * from './useSwapOnly';
19
- export * from './useSwapRoutes';
20
20
  export * from './useToken';
21
21
  export * from './useTokenAddressBalance';
22
22
  export * from './useTokenBalance';
@@ -30,9 +30,9 @@ __exportStar(require("./useInitializer"), exports);
30
30
  __exportStar(require("./useNavigateBack"), exports);
31
31
  __exportStar(require("./useProcessMessage"), exports);
32
32
  __exportStar(require("./useRouteExecution"), exports);
33
+ __exportStar(require("./useRoutes"), exports);
33
34
  __exportStar(require("./useScrollableContainer"), exports);
34
35
  __exportStar(require("./useSwapOnly"), exports);
35
- __exportStar(require("./useSwapRoutes"), exports);
36
36
  __exportStar(require("./useToken"), exports);
37
37
  __exportStar(require("./useTokenAddressBalance"), exports);
38
38
  __exportStar(require("./useTokenBalance"), exports);
@@ -16,14 +16,14 @@ const useChains = () => {
16
16
  const filteredChains = availableChains.filter((chain) => (0, providers_1.isItemAllowed)(chain.id, chains));
17
17
  const chainOrder = initializeChains(filteredChains.map((chain) => chain.id));
18
18
  const [fromChainValue, toChainValue] = getValues([
19
- providers_1.SwapFormKey.FromChain,
20
- providers_1.SwapFormKey.ToChain,
19
+ providers_1.FormKey.FromChain,
20
+ providers_1.FormKey.ToChain,
21
21
  ]);
22
22
  if (!fromChainValue) {
23
- setValue(providers_1.SwapFormKey.FromChain, chainOrder[0]);
23
+ setValue(providers_1.FormKey.FromChain, chainOrder[0]);
24
24
  }
25
25
  if (!toChainValue) {
26
- setValue(providers_1.SwapFormKey.ToChain, chainOrder[0]);
26
+ setValue(providers_1.FormKey.ToChain, chainOrder[0]);
27
27
  }
28
28
  return { availableChains, filteredChains };
29
29
  }, {
@@ -13,11 +13,7 @@ const useFundsSufficiency = (route) => {
13
13
  const { account } = (0, providers_1.useWallet)();
14
14
  const getTokenBalancesWithRetry = (0, useGetTokenBalancesWithRetry_1.useGetTokenBalancesWithRetry)(account.signer?.provider);
15
15
  const [fromChainId, fromTokenAddress, fromAmount] = (0, react_hook_form_1.useWatch)({
16
- name: [
17
- providers_1.SwapFormKey.FromChain,
18
- providers_1.SwapFormKey.FromToken,
19
- providers_1.SwapFormKey.FromAmount,
20
- ],
16
+ name: [providers_1.FormKey.FromChain, providers_1.FormKey.FromToken, providers_1.FormKey.FromAmount],
21
17
  });
22
18
  let chainId = fromChainId;
23
19
  let tokenAddress = fromTokenAddress;
@@ -1,2 +1,2 @@
1
1
  import type { ChainId } from '@lifi/sdk';
2
- export declare const useGasRecommendation: (chainId: ChainId, fromChain?: ChainId, fromToken?: string) => import("@tanstack/react-query").UseQueryResult<import("@lifi/sdk").GasRecommendationResponse, unknown>;
2
+ export declare const useGasRecommendation: (chainId: ChainId, fromChain?: ChainId, fromToken?: string) => import("@tanstack/react-query").UseQueryResult<import("@lifi/sdk").GasRecommendationResponse | null, unknown>;
@@ -3,10 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGasRecommendation = void 0;
4
4
  const react_query_1 = require("@tanstack/react-query");
5
5
  const providers_1 = require("../providers");
6
+ const useChains_1 = require("./useChains");
6
7
  const refetchInterval = 60000;
7
8
  const useGasRecommendation = (chainId, fromChain, fromToken) => {
8
9
  const lifi = (0, providers_1.useLiFi)();
10
+ const { chains } = (0, useChains_1.useChains)();
9
11
  return (0, react_query_1.useQuery)(['gas-recommendation', chainId, fromChain, fromToken], async ({ queryKey: [_, chainId, fromChain, fromToken] }) => {
12
+ if (!chains?.some((chain) => chain.id === chainId)) {
13
+ return null;
14
+ }
10
15
  const gasRecommendation = await lifi.getGasRecommendation({
11
16
  chainId: chainId,
12
17
  fromChain: fromChain,
@@ -12,10 +12,10 @@ const useGasRefuel = () => {
12
12
  const { getChainById } = (0, _1.useChains)();
13
13
  const [fromChainId, fromTokenAddress, toChainId, toAddress] = (0, react_hook_form_1.useWatch)({
14
14
  name: [
15
- providers_1.SwapFormKey.FromChain,
16
- providers_1.SwapFormKey.FromToken,
17
- providers_1.SwapFormKey.ToChain,
18
- providers_1.SwapFormKey.ToAddress,
15
+ providers_1.FormKey.FromChain,
16
+ providers_1.FormKey.FromToken,
17
+ providers_1.FormKey.ToChain,
18
+ providers_1.FormKey.ToAddress,
19
19
  ],
20
20
  });
21
21
  const toChain = getChainById(toChainId);
@@ -1,11 +1,11 @@
1
1
  import type { EVMChain, LifiStep, Process } from '@lifi/sdk';
2
2
  import type { TFunction } from 'i18next';
3
- import type { WidgetVariant } from '../types';
3
+ import type { WidgetSubvariant } from '../types';
4
4
  export declare const useProcessMessage: (step?: LifiStep, process?: Process) => {
5
5
  title?: string | undefined;
6
6
  message?: string | undefined;
7
7
  };
8
- export declare function getProcessMessage(t: TFunction, getChainById: (chainId: number) => EVMChain | undefined, step: LifiStep, process: Process, variant?: WidgetVariant): {
8
+ export declare function getProcessMessage(t: TFunction, getChainById: (chainId: number) => EVMChain | undefined, step: LifiStep, process: Process, subvariant?: WidgetSubvariant): {
9
9
  title?: string;
10
10
  message?: string;
11
11
  };
@@ -7,45 +7,45 @@ const providers_1 = require("../providers");
7
7
  const utils_1 = require("../utils");
8
8
  const useChains_1 = require("./useChains");
9
9
  const useProcessMessage = (step, process) => {
10
- const { variant } = (0, providers_1.useWidgetConfig)();
10
+ const { subvariant } = (0, providers_1.useWidgetConfig)();
11
11
  const { t } = (0, react_i18next_1.useTranslation)();
12
12
  const { getChainById } = (0, useChains_1.useChains)();
13
13
  if (!step || !process) {
14
14
  return {};
15
15
  }
16
- return getProcessMessage(t, getChainById, step, process, variant);
16
+ return getProcessMessage(t, getChainById, step, process, subvariant);
17
17
  };
18
18
  exports.useProcessMessage = useProcessMessage;
19
19
  const processStatusMessages = {
20
20
  TOKEN_ALLOWANCE: {
21
- STARTED: (t) => t(`swap.process.tokenAllowance.started`),
22
- ACTION_REQUIRED: (t) => t(`swap.process.tokenAllowance.pending`),
23
- PENDING: (t) => t(`swap.process.tokenAllowance.pending`),
24
- DONE: (t) => t(`swap.process.tokenAllowance.done`),
21
+ STARTED: (t) => t(`main.process.tokenAllowance.started`),
22
+ ACTION_REQUIRED: (t) => t(`main.process.tokenAllowance.pending`),
23
+ PENDING: (t) => t(`main.process.tokenAllowance.pending`),
24
+ DONE: (t) => t(`main.process.tokenAllowance.done`),
25
25
  },
26
26
  SWITCH_CHAIN: {
27
- ACTION_REQUIRED: (t) => t(`swap.process.switchChain.actionRequired`),
28
- DONE: (t) => t(`swap.process.switchChain.done`),
27
+ ACTION_REQUIRED: (t) => t(`main.process.switchChain.actionRequired`),
28
+ DONE: (t) => t(`main.process.switchChain.done`),
29
29
  },
30
30
  SWAP: {
31
- STARTED: (t) => t(`swap.process.swap.started`),
32
- ACTION_REQUIRED: (t) => t(`swap.process.swap.actionRequired`),
33
- PENDING: (t) => t(`swap.process.swap.pending`),
34
- DONE: (t, variant) => variant === 'nft'
35
- ? t(`swap.process.nft.done`)
36
- : t(`swap.process.swap.done`),
31
+ STARTED: (t) => t(`main.process.swap.started`),
32
+ ACTION_REQUIRED: (t) => t(`main.process.swap.actionRequired`),
33
+ PENDING: (t) => t(`main.process.swap.pending`),
34
+ DONE: (t, subvariant) => subvariant === 'nft'
35
+ ? t(`main.process.nft.done`)
36
+ : t(`main.process.swap.done`),
37
37
  },
38
38
  CROSS_CHAIN: {
39
- STARTED: (t) => t(`swap.process.crossChain.started`),
40
- ACTION_REQUIRED: (t) => t(`swap.process.crossChain.actionRequired`),
41
- PENDING: (t) => t(`swap.process.crossChain.pending`),
42
- DONE: (t) => t(`swap.process.crossChain.done`),
39
+ STARTED: (t) => t(`main.process.crossChain.started`),
40
+ ACTION_REQUIRED: (t) => t(`main.process.crossChain.actionRequired`),
41
+ PENDING: (t) => t(`main.process.crossChain.pending`),
42
+ DONE: (t) => t(`main.process.crossChain.done`),
43
43
  },
44
44
  RECEIVING_CHAIN: {
45
- PENDING: (t) => t(`swap.process.receivingChain.pending`),
46
- DONE: (t, variant) => variant === 'nft'
47
- ? t(`swap.process.nft.done`)
48
- : t(`swap.process.receivingChain.done`),
45
+ PENDING: (t) => t(`main.process.receivingChain.pending`),
46
+ DONE: (t, subvariant) => subvariant === 'nft'
47
+ ? t(`main.process.nft.done`)
48
+ : t(`main.process.receivingChain.done`),
49
49
  },
50
50
  TRANSACTION: {},
51
51
  };
@@ -62,8 +62,8 @@ const processSubstatusMessages = {
62
62
  },
63
63
  DONE: {
64
64
  // COMPLETED: 'The transfer is complete.',
65
- PARTIAL: (t) => t(`swap.process.receivingChain.partial`),
66
- REFUNDED: (t) => t(`swap.process.receivingChain.partial`),
65
+ PARTIAL: (t) => t(`main.process.receivingChain.partial`),
66
+ REFUNDED: (t) => t(`main.process.receivingChain.partial`),
67
67
  },
68
68
  FAILED: {
69
69
  // TODO: should be moved to failed status
@@ -75,9 +75,9 @@ const processSubstatusMessages = {
75
75
  INVALID: {},
76
76
  NOT_FOUND: {},
77
77
  };
78
- function getProcessMessage(t, getChainById, step, process, variant) {
78
+ function getProcessMessage(t, getChainById, step, process, subvariant) {
79
79
  if (process.error && process.status === 'FAILED') {
80
- const getTransactionNotSentMessage = () => t(`swap.error.message.transactionNotSent`, {
80
+ const getTransactionNotSentMessage = () => t(`error.message.transactionNotSent`, {
81
81
  amount: (0, utils_1.formatTokenAmount)(step.action.fromAmount, step.action.fromToken.decimals),
82
82
  tokenSymbol: step.action.fromToken.symbol,
83
83
  chainName: getChainById(step.action.fromChainId)?.name ?? '',
@@ -86,50 +86,50 @@ function getProcessMessage(t, getChainById, step, process, variant) {
86
86
  let message = '';
87
87
  switch (process.error.code) {
88
88
  case sdk_1.LifiErrorCode.AllowanceRequired:
89
- title = t(`swap.error.title.allowanceRequired`);
90
- message = t(`swap.error.message.allowanceRequired`, {
89
+ title = t(`error.title.allowanceRequired`);
90
+ message = t(`error.message.allowanceRequired`, {
91
91
  tokenSymbol: step.action.fromToken.symbol,
92
92
  });
93
93
  break;
94
94
  case sdk_1.LifiErrorCode.BalanceError:
95
- title = t(`swap.error.title.balanceIsTooLow`);
95
+ title = t(`error.title.balanceIsTooLow`);
96
96
  message = getTransactionNotSentMessage();
97
97
  break;
98
98
  case sdk_1.LifiErrorCode.ChainSwitchError:
99
- title = t(`swap.error.title.chainSwitch`);
99
+ title = t(`error.title.chainSwitch`);
100
100
  message = getTransactionNotSentMessage();
101
101
  break;
102
102
  case sdk_1.LifiErrorCode.GasLimitError:
103
- title = t(`swap.error.title.gasLimitIsTooLow`);
103
+ title = t(`error.title.gasLimitIsTooLow`);
104
104
  message = getTransactionNotSentMessage();
105
105
  break;
106
106
  case sdk_1.LifiErrorCode.InsufficientFunds:
107
- title = t(`swap.error.title.insufficientFunds`);
108
- message = `${t(`swap.error.message.insufficientFunds`)} ${getTransactionNotSentMessage()}`;
107
+ title = t(`error.title.insufficientFunds`);
108
+ message = `${t(`error.message.insufficientFunds`)} ${getTransactionNotSentMessage()}`;
109
109
  break;
110
110
  case sdk_1.LifiErrorCode.SlippageError:
111
- title = t(`swap.error.title.slippageNotMet`);
112
- message = t(`swap.error.message.slippageThreshold`);
111
+ title = t(`error.title.slippageNotMet`);
112
+ message = t(`error.message.slippageThreshold`);
113
113
  break;
114
114
  case sdk_1.LifiErrorCode.TransactionFailed:
115
- title = t(`swap.error.title.transactionFailed`);
116
- message = t(`swap.error.message.transactionFailed`);
115
+ title = t(`error.title.transactionFailed`);
116
+ message = t(`error.message.transactionFailed`);
117
117
  break;
118
118
  case sdk_1.LifiErrorCode.TransactionUnderpriced:
119
- title = t(`swap.error.title.transactionUnderpriced`);
119
+ title = t(`error.title.transactionUnderpriced`);
120
120
  message = getTransactionNotSentMessage();
121
121
  break;
122
122
  case sdk_1.LifiErrorCode.TransactionUnprepared:
123
- title = t(`swap.error.title.transactionUnprepared`);
123
+ title = t(`error.title.transactionUnprepared`);
124
124
  message = getTransactionNotSentMessage();
125
125
  break;
126
126
  case sdk_1.LifiErrorCode.TransactionCanceled:
127
- title = t(`swap.error.title.transactionCanceled`);
127
+ title = t(`error.title.transactionCanceled`);
128
128
  message = getTransactionNotSentMessage();
129
129
  break;
130
130
  case sdk_1.LifiErrorCode.TransactionRejected:
131
- title = t(`swap.error.title.transactionRejected`);
132
- message = t(`swap.error.message.transactionRejected`, {
131
+ title = t(`error.title.transactionRejected`);
132
+ message = t(`error.message.transactionRejected`, {
133
133
  amount: (0, utils_1.formatTokenAmount)(step.action.fromAmount, step.action.fromToken.decimals),
134
134
  tokenSymbol: step.action.fromToken.symbol,
135
135
  chainName: getChainById(step.action.fromChainId)?.name ?? '',
@@ -137,19 +137,19 @@ function getProcessMessage(t, getChainById, step, process, variant) {
137
137
  break;
138
138
  case sdk_1.LifiErrorCode.ProviderUnavailable:
139
139
  default:
140
- title = t(`swap.error.title.unknown`);
140
+ title = t(`error.title.unknown`);
141
141
  if (process.txLink) {
142
- message = t(`swap.error.message.transactionFailed`);
142
+ message = t(`error.message.transactionFailed`);
143
143
  }
144
144
  else {
145
- message = t(`swap.error.message.unknown`);
145
+ message = t(`error.message.unknown`);
146
146
  }
147
147
  break;
148
148
  }
149
149
  return { title, message };
150
150
  }
151
151
  const title = processSubstatusMessages[process.status]?.[process.substatus]?.(t) ??
152
- processStatusMessages[process.type]?.[process.status]?.(t, variant);
152
+ processStatusMessages[process.type]?.[process.status]?.(t, subvariant);
153
153
  return { title };
154
154
  }
155
155
  exports.getProcessMessage = getProcessMessage;
@@ -48,10 +48,11 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
48
48
  }
49
49
  const currentChainId = await account.signer.getChainId();
50
50
  if (currentChainId !== requiredChainId) {
51
- const switched = await switchChain(requiredChainId);
52
- if (!switched) {
51
+ const signer = await switchChain(requiredChainId);
52
+ if (!signer) {
53
53
  throw new Error('Chain was not switched.');
54
54
  }
55
+ return signer;
55
56
  }
56
57
  return account.signer;
57
58
  };
@@ -108,11 +109,9 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
108
109
  executeRouteMutation.mutateAsync(undefined, {
109
110
  onError: (error) => {
110
111
  console.warn('Execution failed!', routeId, error);
111
- // Notification.showNotification(NotificationType.SwapExecution_ERROR);
112
112
  },
113
113
  onSuccess: (route) => {
114
114
  console.log('Executed successfully!', route);
115
- // Notification.showNotification(NotificationType.TRANSACTION_SUCCESSFULL);
116
115
  },
117
116
  });
118
117
  }, [executeRouteMutation, routeId]);
@@ -1,8 +1,8 @@
1
1
  import type { Route, RoutesResponse } from '@lifi/sdk';
2
- interface SwapRoutesProps {
2
+ interface RoutesProps {
3
3
  insurableRoute?: Route;
4
4
  }
5
- export declare const useSwapRoutes: ({ insurableRoute }?: SwapRoutesProps) => {
5
+ export declare const useRoutes: ({ insurableRoute }?: RoutesProps) => {
6
6
  routes: Route[] | undefined;
7
7
  isLoading: boolean;
8
8
  isFetching: boolean;