@lifi/widget 2.0.0-beta.13 → 2.0.0-beta.15

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 (554) 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/AppProvider.js +4 -4
  6. package/AppRoutes.js +16 -16
  7. package/cjs/App.js +2 -2
  8. package/cjs/AppDrawer.d.ts +3 -2
  9. package/cjs/AppDrawer.js +7 -3
  10. package/cjs/AppDrawer.style.d.ts +2 -2
  11. package/cjs/AppProvider.js +3 -3
  12. package/cjs/AppRoutes.js +16 -16
  13. package/cjs/components/{ActiveSwaps/ActiveSwapItem.d.ts → ActiveTransactions/ActiveTransactionItem.d.ts} +1 -1
  14. package/cjs/components/{ActiveSwaps/ActiveSwapItem.js → ActiveTransactions/ActiveTransactionItem.js} +6 -6
  15. package/cjs/{pages/SwapRoutesPage/SwapRoutesPage.d.ts → components/ActiveTransactions/ActiveTransactions.d.ts} +1 -1
  16. package/cjs/components/{ActiveSwaps/ActiveSwaps.js → ActiveTransactions/ActiveTransactions.js} +7 -7
  17. package/cjs/components/{ActiveSwaps/ActiveSwaps.style.d.ts → ActiveTransactions/ActiveTransactions.style.d.ts} +4 -4
  18. package/cjs/components/ActiveTransactions/index.d.ts +2 -0
  19. package/cjs/components/{ActiveSwaps → ActiveTransactions}/index.js +2 -2
  20. package/cjs/components/{SwapInput/SwapInput.d.ts → AmountInput/AmountInput.d.ts} +3 -3
  21. package/cjs/components/{SwapInput/SwapInput.js → AmountInput/AmountInput.js} +14 -14
  22. package/{components/SwapInput/SwapInput.style.d.ts → cjs/components/AmountInput/AmountInput.style.d.ts} +1 -1
  23. package/{components/SwapInput/SwapInputAdornment.style.d.ts → cjs/components/AmountInput/AmountInputAdornment.style.d.ts} +2 -2
  24. package/cjs/components/AmountInput/AmountInputEndAdornment.d.ts +2 -0
  25. package/cjs/components/{SwapInput/SwapInputEndAdornment.js → AmountInput/AmountInputEndAdornment.js} +8 -8
  26. package/cjs/components/AmountInput/AmountInputStartAdornment.d.ts +3 -0
  27. package/cjs/components/{SwapInput/SwapInputStartAdornment.js → AmountInput/AmountInputStartAdornment.js} +5 -5
  28. package/cjs/components/AmountInput/FormPriceHelperText.d.ts +9 -0
  29. package/cjs/components/{SwapInput → AmountInput}/FormPriceHelperText.js +4 -4
  30. package/cjs/components/AmountInput/index.d.ts +1 -0
  31. package/cjs/{pages/SwapPage → components/AmountInput}/index.js +1 -1
  32. package/cjs/components/Card/CardIconButton.d.ts +2 -2
  33. package/cjs/components/Card/CardLabel.d.ts +1 -1
  34. package/cjs/components/ChainSelect/ChainSelect.d.ts +2 -2
  35. package/cjs/components/ChainSelect/ChainSelect.js +1 -1
  36. package/cjs/components/ChainSelect/useChainSelect.d.ts +2 -2
  37. package/cjs/components/ChainSelect/useChainSelect.js +5 -5
  38. package/cjs/components/ContractComponent/ContractComponent.d.ts +2 -2
  39. package/cjs/components/ContractComponent/ContractComponent.js +3 -5
  40. package/cjs/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +3 -0
  41. package/cjs/components/DefaultTransactionButton/DefaultTransactionButton.js +36 -0
  42. package/cjs/components/DefaultTransactionButton/index.d.ts +2 -0
  43. package/cjs/components/{SwapButton → DefaultTransactionButton}/index.js +3 -3
  44. package/cjs/components/{SwapButton → DefaultTransactionButton}/types.d.ts +1 -2
  45. package/cjs/components/GasMessage/FundsSufficiencyMessage.js +1 -1
  46. package/cjs/components/GasMessage/GasRefuelMessage.js +1 -1
  47. package/cjs/components/GasMessage/GasSufficiencyMessage.js +2 -2
  48. package/cjs/components/Header/Header.style.d.ts +2 -2
  49. package/cjs/components/Header/NavigationHeader.js +19 -19
  50. package/cjs/components/Header/NavigationTabs.js +3 -3
  51. package/cjs/components/Header/NavigationTabs.style.js +2 -2
  52. package/cjs/components/Header/index.d.ts +1 -1
  53. package/cjs/components/Header/index.js +1 -1
  54. package/cjs/components/Header/types.d.ts +5 -2
  55. package/cjs/components/Header/useHeaderStore.d.ts +2 -0
  56. package/cjs/components/Header/{useHeaderActionStore.js → useHeaderStore.js} +13 -2
  57. package/cjs/components/Insurance/InsuranceCard.js +9 -12
  58. package/cjs/components/Insurance/InsuranceCollapsed.js +1 -1
  59. package/cjs/components/ListItemButton.d.ts +1 -1
  60. package/cjs/components/NFT/NFT.d.ts +1 -2
  61. package/cjs/components/NFT/NFT.js +15 -13
  62. package/cjs/components/NFT/NFT.style.d.ts +1 -1
  63. package/cjs/components/NFT/NFTBase.d.ts +3 -0
  64. package/cjs/components/NFT/NFTBase.js +13 -0
  65. package/cjs/components/NFT/index.d.ts +1 -0
  66. package/cjs/components/NFT/index.js +1 -0
  67. package/cjs/components/NFT/types.d.ts +3 -1
  68. package/cjs/components/ProgressToNextUpdate/ProgressToNextUpdate.js +3 -3
  69. package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +9 -9
  70. package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
  71. package/cjs/components/RouteCard/RouteCard.d.ts +4 -0
  72. package/cjs/components/{SwapRouteCard/SwapRouteCard.js → RouteCard/RouteCard.js} +14 -14
  73. package/cjs/components/RouteCard/RouteCardEssentials.d.ts +3 -0
  74. package/cjs/components/{SwapRouteCard/SwapRouteCardEssentials.js → RouteCard/RouteCardEssentials.js} +7 -7
  75. package/cjs/components/RouteCard/RouteCardSkeleton.d.ts +4 -0
  76. package/cjs/components/{SwapRouteCard/SwapRouteCardSkeleton.js → RouteCard/RouteCardSkeleton.js} +6 -6
  77. package/cjs/components/RouteCard/RouteNotFoundCard.d.ts +2 -0
  78. package/cjs/components/{SwapRouteCard/SwapRouteNotFoundCard.js → RouteCard/RouteNotFoundCard.js} +4 -4
  79. package/cjs/components/RouteCard/index.d.ts +3 -0
  80. package/cjs/components/{SwapRoutes → RouteCard}/index.js +3 -2
  81. package/cjs/components/{SwapRouteCard → RouteCard}/types.d.ts +3 -3
  82. package/cjs/components/{SwapRoutes/SwapRoutes.d.ts → Routes/Routes.d.ts} +1 -1
  83. package/cjs/components/Routes/Routes.js +37 -0
  84. package/cjs/components/Routes/RoutesExpanded.d.ts +2 -0
  85. package/cjs/components/Routes/RoutesExpanded.js +44 -0
  86. package/cjs/components/Routes/index.d.ts +2 -0
  87. package/cjs/components/Routes/index.js +18 -0
  88. package/cjs/components/SelectChainAndToken.js +7 -7
  89. package/cjs/components/SelectTokenButton/SelectTokenButton.d.ts +2 -2
  90. package/cjs/components/SelectTokenButton/SelectTokenButton.js +11 -11
  91. package/cjs/components/SendToWallet/SendToWallet.js +9 -10
  92. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  93. package/cjs/components/SendToWallet/SendToWalletButton.js +2 -2
  94. package/cjs/components/SmallAvatar.d.ts +1 -1
  95. package/cjs/components/Step/DestinationWalletAddress.js +2 -2
  96. package/cjs/components/Step/GasStepProcess.js +1 -1
  97. package/cjs/components/Step/Step.js +13 -13
  98. package/cjs/components/Step/StepTimer.js +2 -2
  99. package/cjs/components/StepActions/StepActions.d.ts +3 -3
  100. package/cjs/components/StepActions/StepActions.js +20 -16
  101. package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
  102. package/cjs/components/StepActions/types.d.ts +2 -2
  103. package/cjs/components/Token/Token.js +1 -1
  104. package/cjs/components/TokenList/TokenList.js +2 -2
  105. package/cjs/components/TokenList/TokenList.style.d.ts +4 -4
  106. package/cjs/components/TokenList/TokenList.style.js +11 -8
  107. package/cjs/components/TokenList/TokenListItem.js +3 -7
  108. package/cjs/components/TokenList/TokenNotFound.d.ts +2 -2
  109. package/cjs/components/TokenList/TokenNotFound.js +2 -2
  110. package/cjs/components/TokenList/VirtualizedTokenList.js +2 -2
  111. package/cjs/components/TokenList/types.d.ts +2 -2
  112. package/cjs/components/TokenList/useTokenSelect.d.ts +2 -2
  113. package/cjs/components/TokenList/useTokenSelect.js +11 -9
  114. package/cjs/config/version.d.ts +1 -1
  115. package/cjs/config/version.js +1 -1
  116. package/cjs/hooks/index.d.ts +1 -1
  117. package/cjs/hooks/index.js +1 -1
  118. package/cjs/hooks/useChains.js +4 -4
  119. package/cjs/hooks/useFundsSufficiency.js +1 -5
  120. package/cjs/hooks/useGasRefuel.js +4 -4
  121. package/cjs/hooks/useProcessMessage.d.ts +2 -2
  122. package/cjs/hooks/useProcessMessage.js +46 -46
  123. package/cjs/hooks/useRouteExecution.js +0 -2
  124. package/cjs/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
  125. package/cjs/hooks/{useSwapRoutes.js → useRoutes.js} +24 -24
  126. package/cjs/i18n/bn.json +80 -80
  127. package/cjs/i18n/de.json +74 -74
  128. package/cjs/i18n/en.json +132 -131
  129. package/cjs/i18n/es.json +72 -72
  130. package/cjs/i18n/fr.json +102 -85
  131. package/cjs/i18n/id.json +86 -86
  132. package/cjs/i18n/it.json +86 -86
  133. package/cjs/i18n/ko.json +102 -85
  134. package/cjs/i18n/pt.json +86 -86
  135. package/cjs/i18n/th.json +102 -85
  136. package/cjs/i18n/tr.json +72 -72
  137. package/cjs/i18n/uk.json +97 -97
  138. package/cjs/i18n/vi.json +86 -86
  139. package/cjs/i18n/zh.json +86 -86
  140. package/cjs/index.d.ts +2 -0
  141. package/cjs/index.js +5 -1
  142. package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.d.ts +2 -0
  143. package/cjs/pages/{ActiveSwapsPage/ActiveSwapsEmpty.js → ActiveTransactionsPage/ActiveTransactionsEmpty.js} +4 -4
  144. package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.d.ts +1 -0
  145. package/cjs/pages/{ActiveSwapsPage/ActiveSwapsPage.js → ActiveTransactionsPage/ActiveTransactionsPage.js} +8 -8
  146. package/cjs/pages/ActiveTransactionsPage/index.d.ts +1 -0
  147. package/cjs/pages/{ActiveSwapsPage → ActiveTransactionsPage}/index.js +1 -1
  148. package/cjs/pages/MainPage/MainGasMessage.js +1 -1
  149. package/cjs/pages/MainPage/MainPage.js +7 -7
  150. package/cjs/pages/MainPage/ReviewButton.d.ts +2 -0
  151. package/cjs/pages/MainPage/ReviewButton.js +62 -0
  152. package/{components/SwapRoutes/SwapRoutes.d.ts → cjs/pages/RoutesPage/RoutesPage.d.ts} +1 -1
  153. package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.js → RoutesPage/RoutesPage.js} +11 -11
  154. package/cjs/pages/RoutesPage/index.d.ts +1 -0
  155. package/cjs/{components/SwapInput → pages/RoutesPage}/index.js +1 -1
  156. package/cjs/pages/SelectChainPage/types.d.ts +2 -2
  157. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +1 -1
  158. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
  159. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +2 -2
  160. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
  161. package/cjs/pages/SelectTokenPage/SearchTokenInput.js +3 -3
  162. package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -2
  163. package/cjs/pages/SelectTokenPage/types.js +1 -1
  164. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
  165. package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
  166. package/cjs/pages/SettingsPage/ResetSettingsButton.js +1 -1
  167. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +1 -1
  168. package/cjs/pages/TransactionDetailsPage/TransactionDetailsPage.d.ts +2 -0
  169. package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.js → TransactionDetailsPage/TransactionDetailsPage.js} +9 -9
  170. package/cjs/pages/TransactionDetailsPage/index.d.ts +1 -0
  171. package/cjs/pages/{SwapDetailsPage → TransactionDetailsPage}/index.js +1 -1
  172. package/cjs/pages/TransactionHistoryPage/TransactionHistoryEmpty.d.ts +2 -0
  173. package/cjs/pages/{SwapHistoryPage/SwapHistoryEmpty.js → TransactionHistoryPage/TransactionHistoryEmpty.js} +4 -4
  174. package/{pages/SwapHistoryPage/SwapHistoryItem.d.ts → cjs/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts} +1 -1
  175. package/cjs/pages/{SwapHistoryPage/SwapHistoryItem.js → TransactionHistoryPage/TransactionHistoryItem.js} +4 -4
  176. package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +2 -0
  177. package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js +35 -0
  178. package/cjs/pages/TransactionHistoryPage/index.d.ts +1 -0
  179. package/cjs/pages/TransactionHistoryPage/index.js +17 -0
  180. package/cjs/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.js +3 -3
  181. package/cjs/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
  182. package/cjs/pages/TransactionPage/StartTransactionButton.js +21 -0
  183. package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +24 -21
  184. package/cjs/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.js +1 -1
  185. package/cjs/pages/TransactionPage/TransactionPage.d.ts +2 -0
  186. package/cjs/pages/TransactionPage/TransactionPage.js +125 -0
  187. package/cjs/pages/TransactionPage/index.d.ts +1 -0
  188. package/cjs/pages/{SwapHistoryPage → TransactionPage}/index.js +1 -1
  189. package/cjs/pages/TransactionPage/types.d.ts +6 -0
  190. package/cjs/providers/{SwapFormProvider/SwapFormProvider.d.ts → FormProvider/FormProvider.d.ts} +1 -1
  191. package/cjs/providers/{SwapFormProvider/SwapFormProvider.js → FormProvider/FormProvider.js} +11 -11
  192. package/cjs/providers/FormProvider/FormUpdater.d.ts +5 -0
  193. package/cjs/providers/{SwapFormProvider → FormProvider}/FormUpdater.js +14 -14
  194. package/cjs/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.js +6 -6
  195. package/cjs/providers/{SwapFormProvider → FormProvider}/index.d.ts +1 -1
  196. package/cjs/providers/{SwapFormProvider → FormProvider}/index.js +1 -1
  197. package/cjs/providers/FormProvider/types.d.ts +37 -0
  198. package/cjs/providers/FormProvider/types.js +23 -0
  199. package/cjs/providers/index.d.ts +1 -1
  200. package/cjs/providers/index.js +1 -1
  201. package/cjs/stores/routes/createRouteExecutionStore.js +1 -1
  202. package/cjs/stores/routes/index.d.ts +1 -1
  203. package/cjs/stores/routes/index.js +1 -1
  204. package/cjs/stores/routes/types.js +1 -1
  205. package/cjs/stores/routes/useTransactionHistory.d.ts +2 -0
  206. package/cjs/stores/routes/{useSwapHistory.js → useTransactionHistory.js} +3 -3
  207. package/cjs/types/events.js +1 -1
  208. package/cjs/types/widget.d.ts +4 -3
  209. package/cjs/types/widget.js +3 -3
  210. package/cjs/utils/elements.js +1 -1
  211. package/cjs/utils/navigationRoutes.d.ts +5 -5
  212. package/cjs/utils/navigationRoutes.js +15 -15
  213. package/components/{ActiveSwaps/ActiveSwapItem.d.ts → ActiveTransactions/ActiveTransactionItem.d.ts} +1 -1
  214. package/components/{ActiveSwaps/ActiveSwapItem.js → ActiveTransactions/ActiveTransactionItem.js} +3 -3
  215. package/components/ActiveTransactions/ActiveTransactions.d.ts +3 -0
  216. package/components/{ActiveSwaps/ActiveSwaps.js → ActiveTransactions/ActiveTransactions.js} +5 -5
  217. package/components/{ActiveSwaps/ActiveSwaps.style.d.ts → ActiveTransactions/ActiveTransactions.style.d.ts} +4 -4
  218. package/components/ActiveTransactions/index.d.ts +2 -0
  219. package/components/ActiveTransactions/index.js +2 -0
  220. package/components/{SwapInput/SwapInput.d.ts → AmountInput/AmountInput.d.ts} +3 -3
  221. package/components/{SwapInput/SwapInput.js → AmountInput/AmountInput.js} +11 -11
  222. package/{cjs/components/SwapInput/SwapInput.style.d.ts → components/AmountInput/AmountInput.style.d.ts} +1 -1
  223. package/{cjs/components/SwapInput/SwapInputAdornment.style.d.ts → components/AmountInput/AmountInputAdornment.style.d.ts} +2 -2
  224. package/components/AmountInput/AmountInputEndAdornment.d.ts +2 -0
  225. package/components/{SwapInput/SwapInputEndAdornment.js → AmountInput/AmountInputEndAdornment.js} +6 -6
  226. package/components/AmountInput/AmountInputStartAdornment.d.ts +3 -0
  227. package/components/{SwapInput/SwapInputStartAdornment.js → AmountInput/AmountInputStartAdornment.js} +4 -4
  228. package/components/AmountInput/FormPriceHelperText.d.ts +9 -0
  229. package/components/{SwapInput → AmountInput}/FormPriceHelperText.js +5 -5
  230. package/components/AmountInput/index.d.ts +1 -0
  231. package/components/AmountInput/index.js +1 -0
  232. package/components/Card/CardIconButton.d.ts +2 -2
  233. package/components/Card/CardLabel.d.ts +1 -1
  234. package/components/ChainSelect/ChainSelect.d.ts +2 -2
  235. package/components/ChainSelect/ChainSelect.js +2 -2
  236. package/components/ChainSelect/useChainSelect.d.ts +2 -2
  237. package/components/ChainSelect/useChainSelect.js +6 -6
  238. package/components/ContractComponent/ContractComponent.d.ts +2 -2
  239. package/components/ContractComponent/ContractComponent.js +3 -5
  240. package/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +3 -0
  241. package/components/DefaultTransactionButton/DefaultTransactionButton.js +32 -0
  242. package/components/DefaultTransactionButton/index.d.ts +2 -0
  243. package/components/DefaultTransactionButton/index.js +2 -0
  244. package/components/{SwapButton → DefaultTransactionButton}/types.d.ts +1 -2
  245. package/components/GasMessage/FundsSufficiencyMessage.js +1 -1
  246. package/components/GasMessage/GasRefuelMessage.js +1 -1
  247. package/components/GasMessage/GasSufficiencyMessage.js +2 -2
  248. package/components/Header/Header.style.d.ts +2 -2
  249. package/components/Header/NavigationHeader.js +19 -19
  250. package/components/Header/NavigationTabs.js +4 -4
  251. package/components/Header/NavigationTabs.style.js +2 -2
  252. package/components/Header/index.d.ts +1 -1
  253. package/components/Header/index.js +1 -1
  254. package/components/Header/types.d.ts +5 -2
  255. package/components/Header/useHeaderStore.d.ts +2 -0
  256. package/components/Header/useHeaderStore.js +25 -0
  257. package/components/Insurance/InsuranceCard.js +9 -12
  258. package/components/Insurance/InsuranceCollapsed.js +2 -2
  259. package/components/ListItemButton.d.ts +1 -1
  260. package/components/NFT/NFT.d.ts +1 -2
  261. package/components/NFT/NFT.js +17 -15
  262. package/components/NFT/NFT.style.d.ts +1 -1
  263. package/components/NFT/NFTBase.d.ts +3 -0
  264. package/components/NFT/NFTBase.js +9 -0
  265. package/components/NFT/index.d.ts +1 -0
  266. package/components/NFT/index.js +1 -0
  267. package/components/NFT/types.d.ts +3 -1
  268. package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +4 -4
  269. package/components/ReverseTokensButton/ReverseTokensButton.js +10 -10
  270. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
  271. package/components/RouteCard/RouteCard.d.ts +4 -0
  272. package/components/{SwapRouteCard/SwapRouteCard.js → RouteCard/RouteCard.js} +13 -13
  273. package/components/RouteCard/RouteCardEssentials.d.ts +3 -0
  274. package/components/{SwapRouteCard/SwapRouteCardEssentials.js → RouteCard/RouteCardEssentials.js} +3 -3
  275. package/components/RouteCard/RouteCardSkeleton.d.ts +4 -0
  276. package/components/{SwapRouteCard/SwapRouteCardSkeleton.js → RouteCard/RouteCardSkeleton.js} +4 -4
  277. package/components/RouteCard/RouteNotFoundCard.d.ts +2 -0
  278. package/components/{SwapRouteCard/SwapRouteNotFoundCard.js → RouteCard/RouteNotFoundCard.js} +2 -2
  279. package/components/RouteCard/index.d.ts +3 -0
  280. package/components/RouteCard/index.js +3 -0
  281. package/components/{SwapRouteCard → RouteCard}/types.d.ts +3 -3
  282. package/{cjs/components/ActiveSwaps/ActiveSwaps.d.ts → components/Routes/Routes.d.ts} +1 -1
  283. package/components/Routes/Routes.js +33 -0
  284. package/components/Routes/RoutesExpanded.d.ts +2 -0
  285. package/components/{SwapRoutes/SwapRoutesExpanded.js → Routes/RoutesExpanded.js} +12 -10
  286. package/components/Routes/index.d.ts +2 -0
  287. package/components/Routes/index.js +2 -0
  288. package/components/SelectChainAndToken.js +8 -8
  289. package/components/SelectTokenButton/SelectTokenButton.d.ts +2 -2
  290. package/components/SelectTokenButton/SelectTokenButton.js +12 -12
  291. package/components/SendToWallet/SendToWallet.js +10 -11
  292. package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  293. package/components/SendToWallet/SendToWalletButton.js +3 -3
  294. package/components/SmallAvatar.d.ts +1 -1
  295. package/components/Step/DestinationWalletAddress.js +2 -2
  296. package/components/Step/GasStepProcess.js +1 -1
  297. package/components/Step/Step.js +13 -13
  298. package/components/Step/StepTimer.js +2 -2
  299. package/components/StepActions/StepActions.d.ts +3 -3
  300. package/components/StepActions/StepActions.js +20 -16
  301. package/components/StepActions/StepActions.style.d.ts +1 -1
  302. package/components/StepActions/types.d.ts +2 -2
  303. package/components/Token/Token.js +1 -1
  304. package/components/TokenList/TokenList.js +3 -3
  305. package/components/TokenList/TokenList.style.d.ts +4 -4
  306. package/components/TokenList/TokenList.style.js +11 -8
  307. package/components/TokenList/TokenListItem.js +4 -8
  308. package/components/TokenList/TokenNotFound.d.ts +2 -2
  309. package/components/TokenList/TokenNotFound.js +3 -3
  310. package/components/TokenList/VirtualizedTokenList.js +2 -2
  311. package/components/TokenList/types.d.ts +2 -2
  312. package/components/TokenList/useTokenSelect.d.ts +2 -2
  313. package/components/TokenList/useTokenSelect.js +12 -10
  314. package/config/version.d.ts +1 -1
  315. package/config/version.js +1 -1
  316. package/hooks/index.d.ts +1 -1
  317. package/hooks/index.js +1 -1
  318. package/hooks/useChains.js +5 -5
  319. package/hooks/useFundsSufficiency.js +2 -6
  320. package/hooks/useGasRefuel.js +5 -5
  321. package/hooks/useProcessMessage.d.ts +2 -2
  322. package/hooks/useProcessMessage.js +46 -46
  323. package/hooks/useRouteExecution.js +0 -2
  324. package/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
  325. package/hooks/{useSwapRoutes.js → useRoutes.js} +23 -23
  326. package/i18n/bn.json +80 -80
  327. package/i18n/de.json +74 -74
  328. package/i18n/en.json +132 -131
  329. package/i18n/es.json +72 -72
  330. package/i18n/fr.json +102 -85
  331. package/i18n/id.json +86 -86
  332. package/i18n/it.json +86 -86
  333. package/i18n/ko.json +102 -85
  334. package/i18n/pt.json +86 -86
  335. package/i18n/th.json +102 -85
  336. package/i18n/tr.json +72 -72
  337. package/i18n/uk.json +97 -97
  338. package/i18n/vi.json +86 -86
  339. package/i18n/zh.json +86 -86
  340. package/index.d.ts +2 -0
  341. package/index.js +2 -0
  342. package/package.json +30 -16
  343. package/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.d.ts +2 -0
  344. package/pages/{ActiveSwapsPage/ActiveSwapsEmpty.js → ActiveTransactionsPage/ActiveTransactionsEmpty.js} +2 -2
  345. package/pages/ActiveTransactionsPage/ActiveTransactionsPage.d.ts +1 -0
  346. package/pages/{ActiveSwapsPage/ActiveSwapsPage.js → ActiveTransactionsPage/ActiveTransactionsPage.js} +7 -7
  347. package/pages/ActiveTransactionsPage/index.d.ts +1 -0
  348. package/pages/ActiveTransactionsPage/index.js +1 -0
  349. package/pages/MainPage/MainGasMessage.js +2 -2
  350. package/pages/MainPage/MainPage.js +7 -7
  351. package/pages/MainPage/ReviewButton.d.ts +2 -0
  352. package/pages/MainPage/ReviewButton.js +58 -0
  353. package/{components/ActiveSwaps/ActiveSwaps.d.ts → pages/RoutesPage/RoutesPage.d.ts} +1 -1
  354. package/pages/{SwapRoutesPage/SwapRoutesPage.js → RoutesPage/RoutesPage.js} +11 -11
  355. package/pages/RoutesPage/index.d.ts +1 -0
  356. package/pages/RoutesPage/index.js +1 -0
  357. package/pages/SelectChainPage/types.d.ts +2 -2
  358. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +2 -2
  359. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
  360. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +2 -2
  361. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
  362. package/pages/SelectTokenPage/SearchTokenInput.js +4 -4
  363. package/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -2
  364. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
  365. package/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
  366. package/pages/SettingsPage/ResetSettingsButton.js +1 -1
  367. package/pages/SettingsPage/RoutePrioritySelect.js +1 -1
  368. package/pages/TransactionDetailsPage/TransactionDetailsPage.d.ts +2 -0
  369. package/pages/{SwapDetailsPage/SwapDetailsPage.js → TransactionDetailsPage/TransactionDetailsPage.js} +7 -7
  370. package/pages/TransactionDetailsPage/index.d.ts +1 -0
  371. package/pages/TransactionDetailsPage/index.js +1 -0
  372. package/pages/TransactionHistoryPage/TransactionHistoryEmpty.d.ts +2 -0
  373. package/pages/{SwapHistoryPage/SwapHistoryEmpty.js → TransactionHistoryPage/TransactionHistoryEmpty.js} +2 -2
  374. package/{cjs/pages/SwapHistoryPage/SwapHistoryItem.d.ts → pages/TransactionHistoryPage/TransactionHistoryItem.d.ts} +1 -1
  375. package/pages/{SwapHistoryPage/SwapHistoryItem.js → TransactionHistoryPage/TransactionHistoryItem.js} +2 -2
  376. package/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +2 -0
  377. package/pages/TransactionHistoryPage/TransactionHistoryPage.js +31 -0
  378. package/pages/TransactionHistoryPage/index.d.ts +1 -0
  379. package/pages/TransactionHistoryPage/index.js +1 -0
  380. package/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.js +3 -3
  381. package/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
  382. package/pages/TransactionPage/StartTransactionButton.js +16 -0
  383. package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +25 -22
  384. package/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.js +1 -1
  385. package/pages/TransactionPage/TransactionPage.d.ts +2 -0
  386. package/pages/TransactionPage/TransactionPage.js +121 -0
  387. package/pages/TransactionPage/index.d.ts +1 -0
  388. package/pages/TransactionPage/index.js +1 -0
  389. package/pages/TransactionPage/types.d.ts +6 -0
  390. package/providers/{SwapFormProvider/SwapFormProvider.d.ts → FormProvider/FormProvider.d.ts} +1 -1
  391. package/providers/{SwapFormProvider/SwapFormProvider.js → FormProvider/FormProvider.js} +12 -12
  392. package/providers/FormProvider/FormUpdater.d.ts +5 -0
  393. package/providers/{SwapFormProvider → FormProvider}/FormUpdater.js +14 -14
  394. package/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.js +7 -7
  395. package/providers/{SwapFormProvider → FormProvider}/index.d.ts +1 -1
  396. package/providers/{SwapFormProvider → FormProvider}/index.js +1 -1
  397. package/providers/FormProvider/types.d.ts +37 -0
  398. package/providers/FormProvider/types.js +20 -0
  399. package/providers/index.d.ts +1 -1
  400. package/providers/index.js +1 -1
  401. package/stores/routes/createRouteExecutionStore.js +1 -1
  402. package/stores/routes/index.d.ts +1 -1
  403. package/stores/routes/index.js +1 -1
  404. package/stores/routes/useTransactionHistory.d.ts +2 -0
  405. package/stores/routes/{useSwapHistory.js → useTransactionHistory.js} +1 -1
  406. package/tsconfig.cjs.tsbuildinfo +1 -1
  407. package/types/widget.d.ts +4 -3
  408. package/utils/navigationRoutes.d.ts +5 -5
  409. package/utils/navigationRoutes.js +15 -15
  410. package/cjs/components/ActiveSwaps/index.d.ts +0 -2
  411. package/cjs/components/Header/useHeaderActionStore.d.ts +0 -2
  412. package/cjs/components/SwapButton/SwapButton.d.ts +0 -3
  413. package/cjs/components/SwapButton/SwapButton.js +0 -56
  414. package/cjs/components/SwapButton/index.d.ts +0 -2
  415. package/cjs/components/SwapInput/FormPriceHelperText.d.ts +0 -9
  416. package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -2
  417. package/cjs/components/SwapInput/SwapInputStartAdornment.d.ts +0 -3
  418. package/cjs/components/SwapInput/index.d.ts +0 -1
  419. package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +0 -4
  420. package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +0 -3
  421. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.d.ts +0 -4
  422. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +0 -2
  423. package/cjs/components/SwapRouteCard/index.d.ts +0 -3
  424. package/cjs/components/SwapRouteCard/index.js +0 -19
  425. package/cjs/components/SwapRoutes/SwapRoutes.js +0 -37
  426. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -2
  427. package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +0 -42
  428. package/cjs/components/SwapRoutes/index.d.ts +0 -2
  429. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +0 -2
  430. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  431. package/cjs/pages/ActiveSwapsPage/index.d.ts +0 -1
  432. package/cjs/pages/MainPage/MainSwapButton.d.ts +0 -2
  433. package/cjs/pages/MainPage/MainSwapButton.js +0 -27
  434. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.d.ts +0 -2
  435. package/cjs/pages/SwapDetailsPage/index.d.ts +0 -1
  436. package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.d.ts +0 -2
  437. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.d.ts +0 -2
  438. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +0 -35
  439. package/cjs/pages/SwapHistoryPage/index.d.ts +0 -1
  440. package/cjs/pages/SwapPage/StartSwapButton.d.ts +0 -4
  441. package/cjs/pages/SwapPage/StartSwapButton.js +0 -21
  442. package/cjs/pages/SwapPage/SwapPage.d.ts +0 -2
  443. package/cjs/pages/SwapPage/SwapPage.js +0 -111
  444. package/cjs/pages/SwapPage/index.d.ts +0 -1
  445. package/cjs/pages/SwapPage/types.d.ts +0 -9
  446. package/cjs/pages/SwapRoutesPage/index.d.ts +0 -1
  447. package/cjs/pages/SwapRoutesPage/index.js +0 -17
  448. package/cjs/providers/SwapFormProvider/FormUpdater.d.ts +0 -5
  449. package/cjs/providers/SwapFormProvider/types.d.ts +0 -37
  450. package/cjs/providers/SwapFormProvider/types.js +0 -23
  451. package/cjs/stores/routes/useSwapHistory.d.ts +0 -2
  452. package/components/ActiveSwaps/index.d.ts +0 -2
  453. package/components/ActiveSwaps/index.js +0 -2
  454. package/components/Header/useHeaderActionStore.d.ts +0 -2
  455. package/components/Header/useHeaderActionStore.js +0 -14
  456. package/components/SwapButton/SwapButton.d.ts +0 -3
  457. package/components/SwapButton/SwapButton.js +0 -52
  458. package/components/SwapButton/index.d.ts +0 -2
  459. package/components/SwapButton/index.js +0 -2
  460. package/components/SwapInput/FormPriceHelperText.d.ts +0 -9
  461. package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -2
  462. package/components/SwapInput/SwapInputStartAdornment.d.ts +0 -3
  463. package/components/SwapInput/index.d.ts +0 -1
  464. package/components/SwapInput/index.js +0 -1
  465. package/components/SwapRouteCard/SwapRouteCard.d.ts +0 -4
  466. package/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +0 -3
  467. package/components/SwapRouteCard/SwapRouteCardSkeleton.d.ts +0 -4
  468. package/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +0 -2
  469. package/components/SwapRouteCard/index.d.ts +0 -3
  470. package/components/SwapRouteCard/index.js +0 -3
  471. package/components/SwapRoutes/SwapRoutes.js +0 -33
  472. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -2
  473. package/components/SwapRoutes/index.d.ts +0 -2
  474. package/components/SwapRoutes/index.js +0 -2
  475. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +0 -2
  476. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  477. package/pages/ActiveSwapsPage/index.d.ts +0 -1
  478. package/pages/ActiveSwapsPage/index.js +0 -1
  479. package/pages/MainPage/MainSwapButton.d.ts +0 -2
  480. package/pages/MainPage/MainSwapButton.js +0 -23
  481. package/pages/SwapDetailsPage/SwapDetailsPage.d.ts +0 -2
  482. package/pages/SwapDetailsPage/index.d.ts +0 -1
  483. package/pages/SwapDetailsPage/index.js +0 -1
  484. package/pages/SwapHistoryPage/SwapHistoryEmpty.d.ts +0 -2
  485. package/pages/SwapHistoryPage/SwapHistoryPage.d.ts +0 -2
  486. package/pages/SwapHistoryPage/SwapHistoryPage.js +0 -31
  487. package/pages/SwapHistoryPage/index.d.ts +0 -1
  488. package/pages/SwapHistoryPage/index.js +0 -1
  489. package/pages/SwapPage/StartSwapButton.d.ts +0 -4
  490. package/pages/SwapPage/StartSwapButton.js +0 -16
  491. package/pages/SwapPage/SwapPage.d.ts +0 -2
  492. package/pages/SwapPage/SwapPage.js +0 -107
  493. package/pages/SwapPage/index.d.ts +0 -1
  494. package/pages/SwapPage/index.js +0 -1
  495. package/pages/SwapPage/types.d.ts +0 -9
  496. package/pages/SwapRoutesPage/SwapRoutesPage.d.ts +0 -3
  497. package/pages/SwapRoutesPage/index.d.ts +0 -1
  498. package/pages/SwapRoutesPage/index.js +0 -1
  499. package/providers/SwapFormProvider/FormUpdater.d.ts +0 -5
  500. package/providers/SwapFormProvider/types.d.ts +0 -37
  501. package/providers/SwapFormProvider/types.js +0 -20
  502. package/stores/routes/useSwapHistory.d.ts +0 -2
  503. /package/cjs/components/{ActiveSwaps/ActiveSwaps.style.js → ActiveTransactions/ActiveTransactions.style.js} +0 -0
  504. /package/cjs/components/{SwapInput/SwapInput.style.js → AmountInput/AmountInput.style.js} +0 -0
  505. /package/cjs/components/{SwapInput/SwapInputAdornment.style.js → AmountInput/AmountInputAdornment.style.js} +0 -0
  506. /package/cjs/components/{SwapButton → DefaultTransactionButton}/types.js +0 -0
  507. /package/cjs/components/{SwapRouteCard/SwapRouteCard.style.d.ts → RouteCard/RouteCard.style.d.ts} +0 -0
  508. /package/cjs/components/{SwapRouteCard/SwapRouteCard.style.js → RouteCard/RouteCard.style.js} +0 -0
  509. /package/cjs/components/{SwapRouteCard → RouteCard}/types.js +0 -0
  510. /package/cjs/components/{SwapRouteCard → RouteCard}/utils.d.ts +0 -0
  511. /package/cjs/components/{SwapRouteCard → RouteCard}/utils.js +0 -0
  512. /package/cjs/components/{SwapRoutes/SwapRoutesExpanded.style.d.ts → Routes/RoutesExpanded.style.d.ts} +0 -0
  513. /package/cjs/components/{SwapRoutes/SwapRoutesExpanded.style.js → Routes/RoutesExpanded.style.js} +0 -0
  514. /package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.style.d.ts → RoutesPage/RoutesPage.style.d.ts} +0 -0
  515. /package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.style.js → RoutesPage/RoutesPage.style.js} +0 -0
  516. /package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.style.d.ts → TransactionDetailsPage/TransactionDetailsPage.style.d.ts} +0 -0
  517. /package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.style.js → TransactionDetailsPage/TransactionDetailsPage.style.js} +0 -0
  518. /package/cjs/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.d.ts +0 -0
  519. /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.d.ts +0 -0
  520. /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.d.ts +0 -0
  521. /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.js +0 -0
  522. /package/cjs/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.d.ts +0 -0
  523. /package/cjs/pages/{SwapPage/SwapPage.style.d.ts → TransactionPage/TransactionPage.style.d.ts} +0 -0
  524. /package/cjs/pages/{SwapPage/SwapPage.style.js → TransactionPage/TransactionPage.style.js} +0 -0
  525. /package/cjs/pages/{SwapPage → TransactionPage}/types.js +0 -0
  526. /package/cjs/pages/{SwapPage → TransactionPage}/utils.d.ts +0 -0
  527. /package/cjs/pages/{SwapPage → TransactionPage}/utils.js +0 -0
  528. /package/cjs/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.d.ts +0 -0
  529. /package/components/{ActiveSwaps/ActiveSwaps.style.js → ActiveTransactions/ActiveTransactions.style.js} +0 -0
  530. /package/components/{SwapInput/SwapInput.style.js → AmountInput/AmountInput.style.js} +0 -0
  531. /package/components/{SwapInput/SwapInputAdornment.style.js → AmountInput/AmountInputAdornment.style.js} +0 -0
  532. /package/components/{SwapButton → DefaultTransactionButton}/types.js +0 -0
  533. /package/components/{SwapRouteCard/SwapRouteCard.style.d.ts → RouteCard/RouteCard.style.d.ts} +0 -0
  534. /package/components/{SwapRouteCard/SwapRouteCard.style.js → RouteCard/RouteCard.style.js} +0 -0
  535. /package/components/{SwapRouteCard → RouteCard}/types.js +0 -0
  536. /package/components/{SwapRouteCard → RouteCard}/utils.d.ts +0 -0
  537. /package/components/{SwapRouteCard → RouteCard}/utils.js +0 -0
  538. /package/components/{SwapRoutes/SwapRoutesExpanded.style.d.ts → Routes/RoutesExpanded.style.d.ts} +0 -0
  539. /package/components/{SwapRoutes/SwapRoutesExpanded.style.js → Routes/RoutesExpanded.style.js} +0 -0
  540. /package/pages/{SwapRoutesPage/SwapRoutesPage.style.d.ts → RoutesPage/RoutesPage.style.d.ts} +0 -0
  541. /package/pages/{SwapRoutesPage/SwapRoutesPage.style.js → RoutesPage/RoutesPage.style.js} +0 -0
  542. /package/pages/{SwapDetailsPage/SwapDetailsPage.style.d.ts → TransactionDetailsPage/TransactionDetailsPage.style.d.ts} +0 -0
  543. /package/pages/{SwapDetailsPage/SwapDetailsPage.style.js → TransactionDetailsPage/TransactionDetailsPage.style.js} +0 -0
  544. /package/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.d.ts +0 -0
  545. /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.d.ts +0 -0
  546. /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.d.ts +0 -0
  547. /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.js +0 -0
  548. /package/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.d.ts +0 -0
  549. /package/pages/{SwapPage/SwapPage.style.d.ts → TransactionPage/TransactionPage.style.d.ts} +0 -0
  550. /package/pages/{SwapPage/SwapPage.style.js → TransactionPage/TransactionPage.style.js} +0 -0
  551. /package/pages/{SwapPage → TransactionPage}/types.js +0 -0
  552. /package/pages/{SwapPage → TransactionPage}/utils.d.ts +0 -0
  553. /package/pages/{SwapPage → TransactionPage}/utils.js +0 -0
  554. /package/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.d.ts +0 -0
@@ -17,5 +17,5 @@ export declare const ListItemButton: import("@emotion/styled").StyledComponent<i
17
17
  touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
18
18
  }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
19
19
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
- }, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
20
+ }, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "divider" | "dense" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
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>, {}, {}>;
@@ -24,6 +24,6 @@ const ResetSettingsButton = () => {
24
24
  }
25
25
  toggleDialog();
26
26
  };
27
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { px: 3, mt: 1.5, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, fullWidth: true, children: t('button.resetSettings') }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('swap.warning.title.resetSettings') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.resetSettings') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: handleReset, autoFocus: true, children: t('button.reset') })] })] })] }));
27
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { px: 3, mt: 1.5, mb: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, fullWidth: true, children: t('button.resetSettings') }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('warning.title.resetSettings') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('warning.message.resetSettings') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: handleReset, autoFocus: true, children: t('button.reset') })] })] })] }));
28
28
  };
29
29
  exports.ResetSettingsButton = ResetSettingsButton;
@@ -15,7 +15,7 @@ const RoutePrioritySelect = () => {
15
15
  const { routePriority } = (0, stores_1.useSettings)(['routePriority']);
16
16
  const value = routePriority ?? '';
17
17
  return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`settings.routePriority`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, { fullWidth: true, children: (0, jsx_runtime_1.jsx)(Select_1.Select, { MenuProps: { elevation: 2 }, value: value, onChange: (event) => setValue('routePriority', event.target.value), IconComponent: KeyboardArrowDown_1.default, dense: true, children: sdk_1.Orders.map((order) => {
18
- const tag = t(`swap.tags.${order.toLowerCase()}`);
18
+ const tag = t(`main.tags.${order.toLowerCase()}`);
19
19
  const tagName = `${tag[0]}${tag.slice(1).toLowerCase()}`;
20
20
  return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: order, children: tagName }, order));
21
21
  }) }) })] }));
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const TransactionDetailsPage: React.FC;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwapDetailsPage = void 0;
3
+ exports.TransactionDetailsPage = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ContentCopyRounded_1 = require("@mui/icons-material/ContentCopyRounded");
6
6
  const DeleteOutline_1 = require("@mui/icons-material/DeleteOutline");
@@ -19,11 +19,11 @@ const hooks_1 = require("../../hooks");
19
19
  const providers_1 = require("../../providers");
20
20
  const stores_1 = require("../../stores");
21
21
  const utils_1 = require("../../utils");
22
- const SwapDetailsPage_style_1 = require("./SwapDetailsPage.style");
23
- const SwapDetailsPage = () => {
22
+ const TransactionDetailsPage_style_1 = require("./TransactionDetailsPage.style");
23
+ const TransactionDetailsPage = () => {
24
24
  const { t, i18n } = (0, react_i18next_1.useTranslation)();
25
25
  const { navigateBack } = (0, hooks_1.useNavigateBack)();
26
- const { variant } = (0, providers_1.useWidgetConfig)();
26
+ const { subvariant, contractComponent, contractSecondaryComponent } = (0, providers_1.useWidgetConfig)();
27
27
  const { state } = (0, react_router_dom_1.useLocation)();
28
28
  const [routeExecution, deleteRoute] = (0, stores_1.useRouteExecutionStore)((store) => [store.routes[state?.routeId], store.deleteRoute], shallow_1.shallow);
29
29
  const [open, setOpen] = (0, react_1.useState)(false);
@@ -48,18 +48,18 @@ const SwapDetailsPage = () => {
48
48
  await navigator.clipboard.writeText(supportId);
49
49
  };
50
50
  (0, react_1.useEffect)(() => {
51
- return Header_1.useHeaderActionStore.getState().setAction((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: (0, jsx_runtime_1.jsx)(DeleteOutline_1.default, {}) }));
51
+ return Header_1.useHeaderStore.getState().setAction((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: (0, jsx_runtime_1.jsx)(DeleteOutline_1.default, {}) }));
52
52
  }, [toggleDialog]);
53
53
  const startedAt = new Date(routeExecution?.route.steps[0].execution?.process[0].startedAt ?? 0);
54
- return ((0, jsx_runtime_1.jsxs)(SwapDetailsPage_style_1.Container, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
54
+ return ((0, jsx_runtime_1.jsxs)(TransactionDetailsPage_style_1.Container, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
55
55
  display: 'flex',
56
56
  flex: 1,
57
57
  justifyContent: 'space-between',
58
58
  }, pb: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, {
59
59
  timeStyle: 'short',
60
- }).format(startedAt) })] }), (0, Step_1.getStepList)(routeExecution?.route), variant === 'nft' ? (0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mt: 2 }) : null, routeExecution?.route?.insurance?.state === 'INSURED' ? ((0, jsx_runtime_1.jsx)(Insurance_1.Insurance, { mt: 2, status: routeExecution.status, feeAmountUsd: routeExecution.route.insurance.feeAmountUsd, insuredAmount: (0, utils_1.formatTokenAmount)(routeExecution.route.toAmountMin, routeExecution.route.toToken.decimals), insuredTokenSymbol: routeExecution.route.toToken.symbol, insurableRouteId: routeExecution.route.id, insuranceCoverageId: insuranceCoverageId })) : null, (0, jsx_runtime_1.jsxs)(Card_1.Card, { mt: 2, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
60
+ }).format(startedAt) })] }), (0, Step_1.getStepList)(routeExecution?.route), subvariant === 'nft' ? ((0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mt: 2, children: contractSecondaryComponent || contractComponent })) : null, routeExecution?.route?.insurance?.state === 'INSURED' ? ((0, jsx_runtime_1.jsx)(Insurance_1.Insurance, { mt: 2, status: routeExecution.status, feeAmountUsd: routeExecution.route.insurance.feeAmountUsd, insuredAmount: (0, utils_1.formatTokenAmount)(routeExecution.route.toAmountMin, routeExecution.route.toToken.decimals), insuredTokenSymbol: routeExecution.route.toToken.symbol, insurableRouteId: routeExecution.route.id, insuranceCoverageId: insuranceCoverageId })) : null, (0, jsx_runtime_1.jsxs)(Card_1.Card, { mt: 2, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
61
61
  display: 'flex',
62
62
  flex: 1,
63
- }, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { flex: 1, children: t('swap.supportId') }), (0, jsx_runtime_1.jsx)(material_1.Box, { mr: 1, mt: 1, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", onClick: copySupportId, children: (0, jsx_runtime_1.jsx)(ContentCopyRounded_1.default, { fontSize: "small" }) }) })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { mt: 2, children: (0, jsx_runtime_1.jsx)(material_1.Button, { href: "https://discord.gg/lifi", target: "_blank", rel: "nofollow noreferrer", fullWidth: true, children: t('button.contactSupport') }) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('swap.warning.title.deleteSwap') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.deleteSwapHistory') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: handleDeleteRoute, autoFocus: true, children: t('button.delete') })] })] })] }));
63
+ }, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { flex: 1, children: t('main.supportId') }), (0, jsx_runtime_1.jsx)(material_1.Box, { mr: 1, mt: 1, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", onClick: copySupportId, children: (0, jsx_runtime_1.jsx)(ContentCopyRounded_1.default, { fontSize: "small" }) }) })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { mt: 2, children: (0, jsx_runtime_1.jsx)(material_1.Button, { href: "https://discord.gg/lifi", target: "_blank", rel: "nofollow noreferrer", fullWidth: true, children: t('button.contactSupport') }) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('warning.title.deleteTransaction') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('warning.message.deleteTransactionHistory') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: handleDeleteRoute, autoFocus: true, children: t('button.delete') })] })] })] }));
64
64
  };
65
- exports.SwapDetailsPage = SwapDetailsPage;
65
+ exports.TransactionDetailsPage = TransactionDetailsPage;
@@ -0,0 +1 @@
1
+ export * from './TransactionDetailsPage';
@@ -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("./SwapDetailsPage"), exports);
17
+ __exportStar(require("./TransactionDetailsPage"), exports);
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const TransactionHistoryEmpty: React.FC;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwapHistoryEmpty = void 0;
3
+ exports.TransactionHistoryEmpty = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ReceiptLongRounded_1 = require("@mui/icons-material/ReceiptLongRounded");
6
6
  const material_1 = require("@mui/material");
7
7
  const react_i18next_1 = require("react-i18next");
8
- const SwapHistoryEmpty = () => {
8
+ const TransactionHistoryEmpty = () => {
9
9
  const { t } = (0, react_i18next_1.useTranslation)();
10
10
  return ((0, jsx_runtime_1.jsxs)(material_1.Container, { sx: {
11
11
  display: 'flex',
@@ -14,6 +14,6 @@ const SwapHistoryEmpty = () => {
14
14
  alignItems: 'center',
15
15
  justifyContent: 'center',
16
16
  paddingY: 12,
17
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, children: (0, jsx_runtime_1.jsx)(ReceiptLongRounded_1.default, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 18, fontWeight: 700, children: t('swap.info.title.emptySwapHistory') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, children: t('swap.info.message.emptySwapHistory') })] }));
17
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, children: (0, jsx_runtime_1.jsx)(ReceiptLongRounded_1.default, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 18, fontWeight: 700, children: t('info.title.emptyTransactionHistory') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, children: t('info.message.emptyTransactionHistory') })] }));
18
18
  };
19
- exports.SwapHistoryEmpty = SwapHistoryEmpty;
19
+ exports.TransactionHistoryEmpty = TransactionHistoryEmpty;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import type { Route } from '@lifi/sdk';
3
- export declare const SwapHistoryItem: React.FC<{
3
+ export declare const TransactionHistoryItem: React.FC<{
4
4
  route: Route;
5
5
  }>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwapHistoryItem = void 0;
3
+ exports.TransactionHistoryItem = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const react_i18next_1 = require("react-i18next");
@@ -8,11 +8,11 @@ const react_router_dom_1 = require("react-router-dom");
8
8
  const Card_1 = require("../../components/Card");
9
9
  const Token_1 = require("../../components/Token");
10
10
  const utils_1 = require("../../utils");
11
- const SwapHistoryItem = ({ route }) => {
11
+ const TransactionHistoryItem = ({ route }) => {
12
12
  const { i18n } = (0, react_i18next_1.useTranslation)();
13
13
  const navigate = (0, react_router_dom_1.useNavigate)();
14
14
  const handleClick = () => {
15
- navigate(utils_1.navigationRoutes.swapDetails, {
15
+ navigate(utils_1.navigationRoutes.transactionDetails, {
16
16
  state: { routeId: route.id },
17
17
  });
18
18
  };
@@ -30,4 +30,4 @@ const SwapHistoryItem = ({ route }) => {
30
30
  timeStyle: 'short',
31
31
  }).format(startedAt) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { py: 1, children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: fromToken, px: 2, pt: 1, connected: true }), (0, jsx_runtime_1.jsx)(Token_1.TokenDivider, {}), (0, jsx_runtime_1.jsx)(Token_1.Token, { token: toToken, px: 2, pt: 0.5, pb: 1 })] })] }));
32
32
  };
33
- exports.SwapHistoryItem = SwapHistoryItem;
33
+ exports.TransactionHistoryItem = TransactionHistoryItem;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const TransactionHistoryPage: React.FC;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionHistoryPage = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const DeleteOutline_1 = require("@mui/icons-material/DeleteOutline");
6
+ const material_1 = require("@mui/material");
7
+ const react_1 = require("react");
8
+ const react_i18next_1 = require("react-i18next");
9
+ const Dialog_1 = require("../../components/Dialog");
10
+ const Header_1 = require("../../components/Header");
11
+ const providers_1 = require("../../providers");
12
+ const stores_1 = require("../../stores");
13
+ const routes_1 = require("../../stores/routes");
14
+ const TransactionHistoryEmpty_1 = require("./TransactionHistoryEmpty");
15
+ const TransactionHistoryItem_1 = require("./TransactionHistoryItem");
16
+ const TransactionHistoryPage = () => {
17
+ const { t } = (0, react_i18next_1.useTranslation)();
18
+ const { account } = (0, providers_1.useWallet)();
19
+ const transactions = (0, routes_1.useTransactionHistory)(account.address);
20
+ const deleteRoutes = (0, stores_1.useRouteExecutionStore)((store) => store.deleteRoutes);
21
+ const [open, setOpen] = (0, react_1.useState)(false);
22
+ const toggleDialog = (0, react_1.useCallback)(() => {
23
+ setOpen((open) => !open);
24
+ }, []);
25
+ (0, react_1.useEffect)(() => {
26
+ if (transactions.length) {
27
+ return Header_1.useHeaderStore.getState().setAction((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: (0, jsx_runtime_1.jsx)(DeleteOutline_1.default, {}) }));
28
+ }
29
+ }, [transactions.length, toggleDialog]);
30
+ if (!transactions.length) {
31
+ return (0, jsx_runtime_1.jsx)(TransactionHistoryEmpty_1.TransactionHistoryEmpty, {});
32
+ }
33
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, { spacing: 2, mt: 1, children: transactions.length ? (transactions.map(({ route }) => ((0, jsx_runtime_1.jsx)(TransactionHistoryItem_1.TransactionHistoryItem, { route: route }, route.id)))) : ((0, jsx_runtime_1.jsx)(TransactionHistoryEmpty_1.TransactionHistoryEmpty, {})) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('warning.title.deleteTransactionHistory') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('warning.message.deleteTransactionHistory') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => deleteRoutes('completed'), autoFocus: true, children: t('button.delete') })] })] })] }));
34
+ };
35
+ exports.TransactionHistoryPage = TransactionHistoryPage;
@@ -0,0 +1 @@
1
+ export * from './TransactionHistoryPage';
@@ -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("./TransactionHistoryPage"), exports);
@@ -47,11 +47,11 @@ const ExchangeRateBottomSheetContent = ({ data, onCancel, onContinue }) => {
47
47
  const { t } = (0, react_i18next_1.useTranslation)();
48
48
  const ref = (0, react_1.useRef)();
49
49
  (0, hooks_1.useSetContentHeight)(ref);
50
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { p: 3, ref: ref, children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.CenterContainer, { children: [(0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.IconCircle, { status: "warning", mb: 1, children: (0, jsx_runtime_1.jsx)(WarningRounded_1.default, { color: "warning" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('swap.warning.title.rateChanged') })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, children: t('swap.warning.message.rateChanged') }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.quotedAmount') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [t('format.number', {
50
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { p: 3, ref: ref, children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.CenterContainer, { children: [(0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.IconCircle, { status: "warning", mb: 1, children: (0, jsx_runtime_1.jsx)(WarningRounded_1.default, { color: "warning" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('warning.title.rateChanged') })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, children: t('warning.message.rateChanged') }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.quotedAmount') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [t('format.number', {
51
51
  value: (0, utils_1.formatTokenAmount)(data?.oldToAmount, data?.toToken.decimals, 5),
52
- }), ' ', data?.toToken.symbol] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.currentAmount') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [t('format.number', {
52
+ }), ' ', data?.toToken.symbol] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.currentAmount') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [t('format.number', {
53
53
  value: (0, utils_1.formatTokenAmount)(data?.newToAmount, data?.toToken.decimals, 5),
54
- }), ' ', data?.toToken.symbol] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.rateChange') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [(0, big_js_1.default)(data?.newToAmount || 0)
54
+ }), ' ', data?.toToken.symbol] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.rateChange') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [(0, big_js_1.default)(data?.newToAmount || 0)
55
55
  .div((0, big_js_1.default)(data?.oldToAmount || 0))
56
56
  .minus(1)
57
57
  .mul(100)
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { StartTransactionButtonProps } from './types';
3
+ export declare const StartTransactionButton: React.FC<StartTransactionButtonProps>;
4
+ export declare const StartInsurableTransactionButton: React.FC<StartTransactionButtonProps>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StartInsurableTransactionButton = exports.StartTransactionButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const DefaultTransactionButton_1 = require("../../components/DefaultTransactionButton");
6
+ const hooks_1 = require("../../hooks");
7
+ const stores_1 = require("../../stores");
8
+ const StartTransactionButton = ({ onClick, route, text, loading, }) => {
9
+ const { insufficientGas, isInitialLoading: isGasSufficiencyLoading } = (0, hooks_1.useGasSufficiency)(route);
10
+ const { insufficientFunds, isInitialLoading: isFundsSufficiencyLoading } = (0, hooks_1.useFundsSufficiency)(route);
11
+ return ((0, jsx_runtime_1.jsx)(DefaultTransactionButton_1.DefaultTransactionButton, { onClick: onClick, text: text, disabled: insufficientFunds || !!insufficientGas?.length, loading: isFundsSufficiencyLoading || isGasSufficiencyLoading || loading }));
12
+ };
13
+ exports.StartTransactionButton = StartTransactionButton;
14
+ const StartInsurableTransactionButton = ({ onClick, text, route, loading, disabled, insurableRouteId }) => {
15
+ const routeExecution = (0, stores_1.useRouteExecutionStore)((state) => state.routes[insurableRouteId]);
16
+ const { isFetching } = (0, hooks_1.useRoutes)({
17
+ insurableRoute: routeExecution?.route,
18
+ });
19
+ return ((0, jsx_runtime_1.jsx)(exports.StartTransactionButton, { onClick: onClick, text: text, route: route, disabled: disabled, loading: loading || isFetching, insurableRouteId: insurableRouteId }));
20
+ };
21
+ exports.StartInsurableTransactionButton = StartInsurableTransactionButton;
@@ -23,7 +23,7 @@ const StatusBottomSheet = ({ status, route, }) => {
23
23
  const ref = (0, react_1.useRef)(null);
24
24
  const { getChainById } = (0, hooks_1.useChains)();
25
25
  const { setValue } = (0, react_hook_form_1.useFormContext)();
26
- const { variant, contractComponent, contractCompactComponent } = (0, providers_1.useWidgetConfig)();
26
+ const { subvariant, contractComponent, contractSecondaryComponent, contractCompactComponent, } = (0, providers_1.useWidgetConfig)();
27
27
  const toToken = {
28
28
  ...(route.steps.at(-1)?.execution?.toToken ?? route.toToken),
29
29
  amount: route.steps.at(-1)?.execution?.toAmount ??
@@ -33,8 +33,8 @@ const StatusBottomSheet = ({ status, route, }) => {
33
33
  const { token, refetch, refetchNewBalance, refetchAllBalances } = (0, hooks_1.useTokenBalance)(toToken, route.toAddress);
34
34
  const clearFromAmount = () => {
35
35
  refetchAllBalances();
36
- setValue(providers_1.SwapFormKey.FromAmount, '');
37
- setValue(providers_1.SwapFormKey.ToAmount, '');
36
+ setValue(providers_1.FormKey.FromAmount, '');
37
+ setValue(providers_1.FormKey.ToAmount, '');
38
38
  };
39
39
  const handleDone = () => {
40
40
  clearFromAmount();
@@ -44,13 +44,13 @@ const StatusBottomSheet = ({ status, route, }) => {
44
44
  clearFromAmount();
45
45
  if (toToken.chainId !== route.toToken.chainId &&
46
46
  toToken.address !== route.toToken.address) {
47
- setValue(providers_1.SwapFormKey.FromAmount, (0, utils_1.formatTokenAmount)(toToken.amount, toToken.decimals), { shouldTouch: true });
48
- setValue(providers_1.SwapFormKey.FromChain, toToken.chainId, { shouldTouch: true });
49
- setValue(providers_1.SwapFormKey.FromToken, toToken.address, { shouldTouch: true });
50
- setValue(providers_1.SwapFormKey.ToChain, route.toToken.chainId, {
47
+ setValue(providers_1.FormKey.FromAmount, (0, utils_1.formatTokenAmount)(toToken.amount, toToken.decimals), { shouldTouch: true });
48
+ setValue(providers_1.FormKey.FromChain, toToken.chainId, { shouldTouch: true });
49
+ setValue(providers_1.FormKey.FromToken, toToken.address, { shouldTouch: true });
50
+ setValue(providers_1.FormKey.ToChain, route.toToken.chainId, {
51
51
  shouldTouch: true,
52
52
  });
53
- setValue(providers_1.SwapFormKey.ToToken, route.toToken.address, {
53
+ setValue(providers_1.FormKey.ToToken, route.toToken.address, {
54
54
  shouldTouch: true,
55
55
  });
56
56
  }
@@ -62,11 +62,12 @@ const StatusBottomSheet = ({ status, route, }) => {
62
62
  };
63
63
  const handleSeeDetails = () => {
64
64
  handleClose();
65
- navigate(utils_1.navigationRoutes.swapDetails, {
65
+ navigate(utils_1.navigationRoutes.transactionDetails, {
66
66
  state: { routeId: route.id },
67
67
  replace: true,
68
68
  });
69
69
  };
70
+ const transactionType = route.fromChainId === route.toChainId ? 'swap' : 'bridge';
70
71
  let title;
71
72
  let primaryMessage;
72
73
  let secondaryMessage;
@@ -74,11 +75,11 @@ const StatusBottomSheet = ({ status, route, }) => {
74
75
  switch (status) {
75
76
  case stores_1.RouteExecutionStatus.Done: {
76
77
  title =
77
- variant === 'nft'
78
- ? t('swap.success.title.purchaseSuccessful')
79
- : t('swap.success.title.swapSuccessful');
78
+ subvariant === 'nft'
79
+ ? t('success.title.purchaseSuccessful')
80
+ : t(`success.title.${transactionType}Successful`);
80
81
  if (token) {
81
- primaryMessage = t('swap.success.message.swapSuccessful', {
82
+ primaryMessage = t('success.message.exchangeSuccessful', {
82
83
  amount: (0, utils_1.formatTokenAmount)(token.amount),
83
84
  tokenSymbol: token.symbol,
84
85
  chainName: getChainById(token.chainId)?.name,
@@ -89,13 +90,13 @@ const StatusBottomSheet = ({ status, route, }) => {
89
90
  break;
90
91
  }
91
92
  case stores_1.RouteExecutionStatus.Done | stores_1.RouteExecutionStatus.Partial: {
92
- title = t('swap.success.title.swapPartiallySuccessful');
93
- primaryMessage = t('swap.success.message.swapPartiallySuccessful', {
93
+ title = t(`success.title.${transactionType}PartiallySuccessful`);
94
+ primaryMessage = t('success.message.exchangePartiallySuccessful', {
94
95
  tool: route.steps.at(-1)?.toolDetails.name,
95
96
  tokenSymbol: route.steps.at(-1)?.action.toToken.symbol,
96
97
  });
97
98
  if (token) {
98
- secondaryMessage = t('swap.success.message.swapSuccessful', {
99
+ secondaryMessage = t('success.message.exchangeSuccessful', {
99
100
  amount: (0, utils_1.formatTokenAmount)(token.amount),
100
101
  tokenSymbol: token.symbol,
101
102
  chainName: getChainById(token.chainId)?.name,
@@ -106,13 +107,13 @@ const StatusBottomSheet = ({ status, route, }) => {
106
107
  break;
107
108
  }
108
109
  case stores_1.RouteExecutionStatus.Done | stores_1.RouteExecutionStatus.Refunded: {
109
- title = t('swap.success.title.refundIssued');
110
- primaryMessage = t('swap.success.message.swapPartiallySuccessful', {
110
+ title = t('success.title.refundIssued');
111
+ primaryMessage = t('success.message.exchangePartiallySuccessful', {
111
112
  tool: route.steps.at(-1)?.toolDetails.name,
112
113
  tokenSymbol: route.steps.at(-1)?.action.toToken.symbol,
113
114
  });
114
115
  if (token) {
115
- secondaryMessage = t('swap.success.message.swapSuccessful', {
116
+ secondaryMessage = t('success.message.exchangeSuccessful', {
116
117
  amount: (0, utils_1.formatTokenAmount)(token.amount),
117
118
  tokenSymbol: token.symbol,
118
119
  chainName: getChainById(token.chainId)?.name,
@@ -147,9 +148,11 @@ const StatusBottomSheet = ({ status, route, }) => {
147
148
  ref.current?.open();
148
149
  }
149
150
  }, [refetch, refetchNewBalance, status]);
150
- const showContractComponent = variant === 'nft' && (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Done);
151
+ const showContractComponent = subvariant === 'nft' && (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Done);
151
152
  return ((0, jsx_runtime_1.jsx)(BottomSheet_1.BottomSheet, { ref: ref, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { p: 3, children: [!showContractComponent ? ((0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.CenterContainer, { children: (0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.IconCircle, { status: status, mb: 1, children: [status === stores_1.RouteExecutionStatus.Idle ? ((0, jsx_runtime_1.jsx)(InfoRounded_1.default, { color: "primary" })) : null, status === stores_1.RouteExecutionStatus.Done ? ((0, jsx_runtime_1.jsx)(Done_1.default, { color: "success" })) : null, (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Partial) ||
152
- (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Refunded) ? ((0, jsx_runtime_1.jsx)(WarningRounded_1.default, { color: "warning" })) : null, (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Failed) ? ((0, jsx_runtime_1.jsx)(ErrorRounded_1.default, { color: "error" })) : null] }) })) : null, (0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.CenterContainer, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, fontSize: 18, fontWeight: 700, children: title }) }), showContractComponent ? (contractCompactComponent || contractComponent) : ((0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.CenterContainer, { children: (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Done) ? ((0, jsx_runtime_1.jsx)(Token_1.Token, { token: toToken, py: 1, disableDescription: true })) : null })), !showContractComponent ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, children: primaryMessage })) : null, secondaryMessage ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, children: secondaryMessage })) : null, (0, jsx_runtime_1.jsx)(material_1.Box, { mt: 2, children: (0, jsx_runtime_1.jsxs)(material_1.Button, { variant: "contained", fullWidth: true, onClick: handlePrimaryButton, children: [status === stores_1.RouteExecutionStatus.Idle ? t('button.ok') : null, (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Done)
153
+ (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Refunded) ? ((0, jsx_runtime_1.jsx)(WarningRounded_1.default, { color: "warning" })) : null, (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Failed) ? ((0, jsx_runtime_1.jsx)(ErrorRounded_1.default, { color: "error" })) : null] }) })) : null, (0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.CenterContainer, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, fontSize: 18, fontWeight: 700, children: title }) }), showContractComponent ? (contractCompactComponent ||
154
+ contractSecondaryComponent ||
155
+ contractComponent) : ((0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.CenterContainer, { children: (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Done) ? ((0, jsx_runtime_1.jsx)(Token_1.Token, { token: toToken, py: 1, disableDescription: true })) : null })), !showContractComponent ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, children: primaryMessage })) : null, secondaryMessage ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, children: secondaryMessage })) : null, (0, jsx_runtime_1.jsx)(material_1.Box, { mt: 2, children: (0, jsx_runtime_1.jsxs)(material_1.Button, { variant: "contained", fullWidth: true, onClick: handlePrimaryButton, children: [status === stores_1.RouteExecutionStatus.Idle ? t('button.ok') : null, (0, utils_1.hasEnumFlag)(status, stores_1.RouteExecutionStatus.Done)
153
156
  ? t('button.done')
154
157
  : null, status === stores_1.RouteExecutionStatus.Failed
155
158
  ? t('button.seeDetails')
@@ -21,7 +21,7 @@ const TokenValueBottomSheetContent = ({ route, onCancel, onContinue, }) => {
21
21
  const { t } = (0, react_i18next_1.useTranslation)();
22
22
  const ref = (0, react_1.useRef)();
23
23
  (0, hooks_1.useSetContentHeight)(ref);
24
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { p: 3, ref: ref, children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.CenterContainer, { children: [(0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.IconCircle, { status: "warning", mb: 1, children: (0, jsx_runtime_1.jsx)(WarningRounded_1.default, { color: "warning" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('swap.warning.title.highValueLoss') })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, children: t('swap.warning.message.highValueLoss') }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.swapping') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 600, children: t('format.currency', { value: route.fromAmountUSD }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.gasCost') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 600, children: t('format.currency', { value: route.gasCostUSD }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.receiving') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 600, children: t('format.currency', { value: route.toAmountUSD }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.valueLoss') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 600, children: (0, utils_1.calcValueLoss)(route) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", mt: 3, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "text", onClick: onCancel, fullWidth: true, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", p: 1 }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: onContinue, fullWidth: true, children: t('button.continue') })] })] }));
24
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { p: 3, ref: ref, children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.CenterContainer, { children: [(0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.IconCircle, { status: "warning", mb: 1, children: (0, jsx_runtime_1.jsx)(WarningRounded_1.default, { color: "warning" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('warning.title.highValueLoss') })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, children: t('warning.message.highValueLoss') }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.sending') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 600, children: t('format.currency', { value: route.fromAmountUSD }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.gasCost') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 600, children: t('format.currency', { value: route.gasCostUSD }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.receiving') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 600, children: t('format.currency', { value: route.toAmountUSD }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.valueLoss') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 600, children: (0, utils_1.calcValueLoss)(route) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", mt: 3, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "text", onClick: onCancel, fullWidth: true, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", p: 1 }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: onContinue, fullWidth: true, children: t('button.continue') })] })] }));
25
25
  };
26
26
  const getTokenValueLossThreshold = (route) => {
27
27
  if (!route) {
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const TransactionPage: React.FC;
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionPage = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Delete_1 = require("@mui/icons-material/Delete");
6
+ const material_1 = require("@mui/material");
7
+ const react_1 = require("react");
8
+ const react_hook_form_1 = require("react-hook-form");
9
+ const react_i18next_1 = require("react-i18next");
10
+ const react_router_dom_1 = require("react-router-dom");
11
+ const ContractComponent_1 = require("../../components/ContractComponent");
12
+ const GasMessage_1 = require("../../components/GasMessage");
13
+ const Header_1 = require("../../components/Header");
14
+ const Insurance_1 = require("../../components/Insurance");
15
+ const Step_1 = require("../../components/Step");
16
+ const hooks_1 = require("../../hooks");
17
+ const providers_1 = require("../../providers");
18
+ const stores_1 = require("../../stores");
19
+ const events_1 = require("../../types/events");
20
+ const utils_1 = require("../../utils");
21
+ const ExchangeRateBottomSheet_1 = require("./ExchangeRateBottomSheet");
22
+ const StartTransactionButton_1 = require("./StartTransactionButton");
23
+ const StatusBottomSheet_1 = require("./StatusBottomSheet");
24
+ const TokenValueBottomSheet_1 = require("./TokenValueBottomSheet");
25
+ const TransactionPage_style_1 = require("./TransactionPage.style");
26
+ const utils_2 = require("./utils");
27
+ const TransactionPage = () => {
28
+ const { t } = (0, react_i18next_1.useTranslation)();
29
+ const { setValue } = (0, react_hook_form_1.useFormContext)();
30
+ const emitter = (0, hooks_1.useWidgetEvents)();
31
+ const { navigateBack } = (0, hooks_1.useNavigateBack)();
32
+ const { subvariant, insurance, contractComponent, contractSecondaryComponent, } = (0, providers_1.useWidgetConfig)();
33
+ const { state } = (0, react_router_dom_1.useLocation)();
34
+ const stateRouteId = state?.routeId;
35
+ const [routeId, setRouteId] = (0, react_1.useState)(stateRouteId);
36
+ const tokenValueBottomSheetRef = (0, react_1.useRef)(null);
37
+ const exchangeRateBottomSheetRef = (0, react_1.useRef)(null);
38
+ const onAcceptExchangeRateUpdate = (resolver, data) => {
39
+ exchangeRateBottomSheetRef.current?.open(resolver, data);
40
+ };
41
+ const { route, status, executeRoute, restartRoute, deleteRoute } = (0, hooks_1.useRouteExecution)({
42
+ routeId: routeId,
43
+ onAcceptExchangeRateUpdate,
44
+ });
45
+ (0, react_1.useEffect)(() => {
46
+ if (route && subvariant !== 'nft') {
47
+ const transactionType = route.fromChainId === route.toChainId ? 'Swap' : 'Bridge';
48
+ return Header_1.useHeaderStore
49
+ .getState()
50
+ .setTitle(status === stores_1.RouteExecutionStatus.Idle
51
+ ? t(`button.review${transactionType}`)
52
+ : t(`header.${transactionType.toLowerCase()}`));
53
+ }
54
+ }, [route, status, subvariant, t]);
55
+ if (!route) {
56
+ return null;
57
+ }
58
+ const tokenValueLossThresholdExceeded = (0, TokenValueBottomSheet_1.getTokenValueLossThreshold)(route);
59
+ const handleExecuteRoute = () => {
60
+ if (tokenValueBottomSheetRef.current?.isOpen()) {
61
+ emitter.emit(events_1.WidgetEvent.RouteHighValueLoss, {
62
+ fromAmountUsd: route.fromAmountUSD,
63
+ gasCostUSD: route.gasCostUSD,
64
+ toAmountUSD: route.toAmountUSD,
65
+ valueLoss: (0, utils_2.calcValueLoss)(route),
66
+ });
67
+ }
68
+ tokenValueBottomSheetRef.current?.close();
69
+ executeRoute();
70
+ setValue(providers_1.FormKey.FromAmount, '');
71
+ };
72
+ const handleStartClick = async () => {
73
+ if (status === stores_1.RouteExecutionStatus.Idle) {
74
+ if (tokenValueLossThresholdExceeded && subvariant !== 'nft') {
75
+ tokenValueBottomSheetRef.current?.open();
76
+ }
77
+ else {
78
+ handleExecuteRoute();
79
+ }
80
+ }
81
+ if (status === stores_1.RouteExecutionStatus.Failed) {
82
+ restartRoute();
83
+ }
84
+ };
85
+ const handleRemoveRoute = () => {
86
+ navigateBack();
87
+ deleteRoute();
88
+ };
89
+ const getButtonText = () => {
90
+ switch (status) {
91
+ case stores_1.RouteExecutionStatus.Idle:
92
+ switch (subvariant) {
93
+ case 'nft':
94
+ return t('button.buyNow');
95
+ case 'refuel':
96
+ return t('button.startBridging');
97
+ default:
98
+ const transactionType = route.fromChainId === route.toChainId ? 'Swapping' : 'Bridging';
99
+ return t(`button.start${transactionType}`);
100
+ }
101
+ case stores_1.RouteExecutionStatus.Failed:
102
+ return t('button.tryAgain');
103
+ default:
104
+ return '';
105
+ }
106
+ };
107
+ const insuredRoute = route.insurance?.state === 'INSURED';
108
+ const insurableRoute = insurance &&
109
+ subvariant !== 'refuel' &&
110
+ status === stores_1.RouteExecutionStatus.Idle &&
111
+ route.insurance?.state === 'INSURABLE';
112
+ const insuranceAvailable = insuredRoute || insurableRoute;
113
+ const StartButton = insurableRoute
114
+ ? StartTransactionButton_1.StartInsurableTransactionButton
115
+ : StartTransactionButton_1.StartTransactionButton;
116
+ const getInsuranceCoverageId = () => route.steps[0].execution?.process
117
+ .filter((process) => process.type !== 'TOKEN_ALLOWANCE')
118
+ .find((process) => process.txHash)?.txHash ?? route.fromAddress;
119
+ return ((0, jsx_runtime_1.jsxs)(TransactionPage_style_1.Container, { children: [(0, Step_1.getStepList)(route), subvariant === 'nft' ? ((0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mt: 2, children: contractSecondaryComponent || contractComponent })) : null, insuranceAvailable ? ((0, jsx_runtime_1.jsx)(Insurance_1.Insurance, { mt: 2, status: status, insurableRouteId: stateRouteId, feeAmountUsd: route.insurance.feeAmountUsd, insuredAmount: (0, utils_1.formatTokenAmount)(route.toAmountMin, route.toToken.decimals), insuredTokenSymbol: route.toToken.symbol, insuranceCoverageId: getInsuranceCoverageId(), onChange: setRouteId })) : null, status === stores_1.RouteExecutionStatus.Idle ||
120
+ status === stores_1.RouteExecutionStatus.Failed ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(GasMessage_1.GasMessage, { mt: 2, route: route }), (0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, display: "flex", children: [(0, jsx_runtime_1.jsx)(StartButton, { text: getButtonText(), onClick: handleStartClick, route: route, insurableRouteId: stateRouteId }), status === stores_1.RouteExecutionStatus.Failed ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t('button.removeTransaction'), placement: "bottom-end", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleRemoveRoute, sx: {
121
+ minWidth: 48,
122
+ marginLeft: 1,
123
+ }, children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }) })) : null] })] })) : null, status ? (0, jsx_runtime_1.jsx)(StatusBottomSheet_1.StatusBottomSheet, { status: status, route: route }) : null, tokenValueLossThresholdExceeded && subvariant !== 'nft' ? ((0, jsx_runtime_1.jsx)(TokenValueBottomSheet_1.TokenValueBottomSheet, { route: route, ref: tokenValueBottomSheetRef, onContinue: handleExecuteRoute })) : null, (0, jsx_runtime_1.jsx)(ExchangeRateBottomSheet_1.ExchangeRateBottomSheet, { ref: exchangeRateBottomSheetRef })] }));
124
+ };
125
+ exports.TransactionPage = TransactionPage;
@@ -0,0 +1 @@
1
+ export * from './TransactionPage';
@@ -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("./SwapHistoryPage"), exports);
17
+ __exportStar(require("./TransactionPage"), exports);
@@ -0,0 +1,6 @@
1
+ import type { Route } from '@lifi/sdk';
2
+ import type { DefaultTransactionButtonProps } from '../../components/DefaultTransactionButton';
3
+ export interface StartTransactionButtonProps extends DefaultTransactionButtonProps {
4
+ route?: Route;
5
+ insurableRouteId: string;
6
+ }
@@ -9,4 +9,4 @@ export declare const formDefaultValues: {
9
9
  ToContractGasLimit: string;
10
10
  toAmount: string;
11
11
  };
12
- export declare const SwapFormProvider: React.FC<React.PropsWithChildren<{}>>;
12
+ export declare const FormProvider: React.FC<React.PropsWithChildren<{}>>;