@lifi/widget 2.9.3 → 3.0.0-alpha.0

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 (600) hide show
  1. package/AppProvider.js +2 -2
  2. package/AppRoutes.js +75 -67
  3. package/cjs/AppProvider.js +1 -1
  4. package/cjs/AppRoutes.js +74 -66
  5. package/cjs/components/ActiveTransactions/ActiveTransactionItem.js +1 -5
  6. package/cjs/components/ActiveTransactions/ActiveTransactions.js +2 -2
  7. package/cjs/components/AmountInput/AmountInputEndAdornment.js +9 -10
  8. package/cjs/components/AmountInput/FormPriceHelperText.js +1 -1
  9. package/cjs/components/BaseTransactionButton/BaseTransactionButton.js +5 -4
  10. package/cjs/components/Card/CardLabel.d.ts +1 -1
  11. package/cjs/components/ChainSelect/ChainSelect.js +8 -5
  12. package/cjs/components/ChainSelect/useChainSelect.js +21 -2
  13. package/cjs/components/GasMessage/GasMessage.style.js +3 -6
  14. package/cjs/components/GasMessage/GasSufficiencyMessage.js +2 -1
  15. package/cjs/components/Header/Header.style.d.ts +8 -0
  16. package/cjs/components/Header/Header.style.js +16 -1
  17. package/cjs/components/Header/NavigationHeader.d.ts +1 -0
  18. package/cjs/components/Header/NavigationHeader.js +15 -8
  19. package/cjs/components/Header/NavigationTabs.js +2 -2
  20. package/cjs/components/Header/SettingsButton.d.ts +1 -0
  21. package/cjs/components/Header/SettingsButton.js +25 -0
  22. package/cjs/components/Header/SettingsButton.style.d.ts +11 -0
  23. package/cjs/components/Header/SettingsButton.style.js +43 -0
  24. package/cjs/components/Header/WalletHeader.js +11 -24
  25. package/cjs/components/Header/WalletMenu.d.ts +3 -1
  26. package/cjs/components/Header/WalletMenu.js +58 -24
  27. package/cjs/components/Header/WalletMenu.style.d.ts +1 -0
  28. package/cjs/components/Header/WalletMenu.style.js +27 -0
  29. package/cjs/components/Insurance/InsuranceCollapsed.js +1 -1
  30. package/cjs/components/NFT/NFT.js +3 -1
  31. package/cjs/components/NFT/types.d.ts +1 -1
  32. package/cjs/components/PoweredBy/PoweredBy.js +2 -1
  33. package/cjs/components/RouteCard/RouteCard.js +3 -3
  34. package/cjs/components/RouteCard/RouteCardEssentials.js +2 -1
  35. package/cjs/components/RouteCard/utils.d.ts +2 -3
  36. package/cjs/components/RouteCard/utils.js +4 -9
  37. package/cjs/components/SendToWallet/SendToWallet.js +24 -21
  38. package/cjs/components/SendToWallet/SendToWalletButton.js +3 -2
  39. package/{pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts → cjs/components/SettingsListItemButton.d.ts} +1 -1
  40. package/cjs/components/SettingsListItemButton.js +8 -0
  41. package/cjs/components/Step/DestinationWalletAddress.d.ts +2 -2
  42. package/cjs/components/Step/GasStepProcess.d.ts +2 -2
  43. package/cjs/components/Step/Step.d.ts +2 -2
  44. package/cjs/components/Step/Step.js +1 -1
  45. package/cjs/components/Step/StepList.d.ts +2 -2
  46. package/cjs/components/Step/StepList.js +4 -4
  47. package/cjs/components/Step/StepProcess.d.ts +2 -2
  48. package/cjs/components/Step/StepTimer.d.ts +2 -2
  49. package/cjs/components/StepActions/StepActions.d.ts +3 -3
  50. package/cjs/components/StepActions/StepActions.js +11 -14
  51. package/cjs/components/StepActions/types.d.ts +2 -2
  52. package/cjs/components/{Header/NavigationTabs.style.d.ts → Tabs/Tabs.style.d.ts} +2 -2
  53. package/cjs/components/{Header/NavigationTabs.style.js → Tabs/Tabs.style.js} +9 -31
  54. package/cjs/components/Tabs/index.d.ts +1 -0
  55. package/cjs/{providers/SDKProvider → components/Tabs}/index.js +1 -1
  56. package/cjs/components/Token/Token.d.ts +3 -3
  57. package/cjs/components/Token/Token.js +5 -5
  58. package/cjs/components/TokenList/TokenList.js +2 -2
  59. package/cjs/components/TokenList/TokenListItem.js +9 -5
  60. package/cjs/components/TokenList/TokenNotFound.js +1 -1
  61. package/cjs/components/TokenList/VirtualizedTokenList.js +2 -1
  62. package/cjs/config/queryClient.js +0 -4
  63. package/cjs/config/version.d.ts +1 -1
  64. package/cjs/config/version.js +1 -1
  65. package/cjs/hooks/index.d.ts +7 -1
  66. package/cjs/hooks/index.js +7 -1
  67. package/cjs/hooks/useAccount.d.ts +31 -0
  68. package/cjs/hooks/useAccount.js +53 -0
  69. package/cjs/hooks/useAvailableChains.d.ts +6 -0
  70. package/cjs/hooks/useAvailableChains.js +36 -0
  71. package/cjs/hooks/useChain.js +3 -6
  72. package/cjs/hooks/useChains.d.ts +1 -1
  73. package/cjs/hooks/useChains.js +7 -38
  74. package/cjs/hooks/useFromTokenSufficiency.d.ts +3 -3
  75. package/cjs/hooks/useFromTokenSufficiency.js +39 -41
  76. package/cjs/hooks/useGasRecommendation.d.ts +2 -2
  77. package/cjs/hooks/useGasRecommendation.js +23 -18
  78. package/cjs/hooks/useGasRefuel.js +18 -11
  79. package/cjs/hooks/useGasSufficiency.d.ts +6 -7
  80. package/cjs/hooks/useGasSufficiency.js +68 -71
  81. package/cjs/hooks/useLanguages.d.ts +6 -0
  82. package/cjs/hooks/useLanguages.js +28 -0
  83. package/cjs/hooks/useProcessMessage.d.ts +3 -3
  84. package/cjs/hooks/useProcessMessage.js +32 -28
  85. package/cjs/hooks/useRequiredToAddress.d.ts +1 -0
  86. package/cjs/hooks/useRequiredToAddress.js +19 -0
  87. package/cjs/hooks/useRouteExecution.d.ts +2 -2
  88. package/cjs/hooks/useRouteExecution.js +44 -58
  89. package/cjs/hooks/useRoutes.d.ts +1 -1
  90. package/cjs/hooks/useRoutes.js +128 -113
  91. package/cjs/hooks/useSettingMonitor.d.ts +11 -0
  92. package/cjs/hooks/useSettingMonitor.js +57 -0
  93. package/cjs/hooks/useTokenAddressBalance.d.ts +1 -1
  94. package/cjs/hooks/useTokenBalance.d.ts +5 -3
  95. package/cjs/hooks/useTokenBalance.js +77 -47
  96. package/cjs/hooks/useTokenBalances.d.ts +3 -3
  97. package/cjs/hooks/useTokenBalances.js +34 -24
  98. package/cjs/hooks/useTokenSearch.js +18 -17
  99. package/cjs/hooks/useTokens.d.ts +2 -1
  100. package/cjs/hooks/useTokens.js +18 -15
  101. package/cjs/hooks/useTools.d.ts +1 -1
  102. package/cjs/hooks/useTools.js +12 -11
  103. package/cjs/hooks/useTransactionDetails.d.ts +4 -0
  104. package/cjs/hooks/useTransactionDetails.js +56 -0
  105. package/cjs/hooks/useTransactionHistory.d.ts +5 -0
  106. package/cjs/hooks/useTransactionHistory.js +39 -0
  107. package/cjs/i18n/en.json +18 -9
  108. package/cjs/i18n/fr.json +7 -4
  109. package/cjs/i18n/pt.json +7 -4
  110. package/cjs/i18n/tr.json +7 -4
  111. package/cjs/i18n/uk.json +7 -4
  112. package/cjs/i18n/zh.json +7 -4
  113. package/cjs/icons/index.d.ts +1 -3
  114. package/cjs/icons/index.js +1 -3
  115. package/cjs/icons/lifi.d.ts +1 -0
  116. package/cjs/icons/lifi.js +4 -0
  117. package/cjs/index.d.ts +2 -3
  118. package/cjs/index.js +4 -4
  119. package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +2 -2
  120. package/cjs/pages/LanguagesPage/LanguagesPage.d.ts +2 -0
  121. package/cjs/pages/LanguagesPage/LanguagesPage.js +22 -0
  122. package/cjs/pages/LanguagesPage/index.d.ts +1 -0
  123. package/cjs/pages/LanguagesPage/index.js +17 -0
  124. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +15 -5
  125. package/cjs/pages/SelectWalletPage/EVMListItemButton.d.ts +8 -0
  126. package/cjs/pages/SelectWalletPage/EVMListItemButton.js +40 -0
  127. package/cjs/pages/SelectWalletPage/SVMListItemButton.d.ts +6 -0
  128. package/cjs/pages/SelectWalletPage/SVMListItemButton.js +34 -0
  129. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +31 -32
  130. package/cjs/pages/SelectWalletPage/utils.d.ts +3 -0
  131. package/cjs/pages/SelectWalletPage/utils.js +21 -0
  132. package/{pages/SettingsPage/EnabledToolsButton.d.ts → cjs/pages/SettingsPage/BridgeAndExchangeSettings.d.ts} +1 -1
  133. package/cjs/pages/SettingsPage/BridgeAndExchangeSettings.js +36 -0
  134. package/cjs/pages/SettingsPage/GasPriceSettings.d.ts +2 -0
  135. package/cjs/pages/SettingsPage/GasPriceSettings.js +21 -0
  136. package/cjs/pages/SettingsPage/LanguageSetting.d.ts +2 -0
  137. package/cjs/pages/SettingsPage/LanguageSetting.js +26 -0
  138. package/cjs/pages/SettingsPage/ResetSettingsButton.js +3 -30
  139. package/cjs/pages/SettingsPage/RoutePrioritySettings.d.ts +2 -0
  140. package/cjs/pages/SettingsPage/RoutePrioritySettings.js +25 -0
  141. package/cjs/pages/SettingsPage/SendToWalletOptionSetting.d.ts +1 -0
  142. package/cjs/pages/SettingsPage/{ShowDestinationWallet.js → SendToWalletOptionSetting.js} +6 -9
  143. package/cjs/pages/SettingsPage/SettingsCard/BadgedValue.d.ts +8 -0
  144. package/cjs/pages/SettingsPage/SettingsCard/BadgedValue.js +7 -0
  145. package/cjs/pages/SettingsPage/SettingsCard/SettingCard.d.ts +2 -0
  146. package/cjs/pages/SettingsPage/SettingsCard/SettingCard.js +11 -0
  147. package/cjs/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +19 -0
  148. package/cjs/pages/SettingsPage/SettingsCard/SettingCard.style.js +53 -0
  149. package/cjs/pages/SettingsPage/SettingsCard/SettingCardButton.d.ts +7 -0
  150. package/cjs/pages/SettingsPage/SettingsCard/SettingCardButton.js +8 -0
  151. package/cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +7 -0
  152. package/cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +16 -0
  153. package/cjs/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +6 -0
  154. package/cjs/pages/SettingsPage/SettingsCard/SettingsAccordian.js +36 -0
  155. package/cjs/pages/SettingsPage/SettingsCard/index.d.ts +6 -0
  156. package/cjs/pages/SettingsPage/SettingsCard/index.js +22 -0
  157. package/cjs/pages/SettingsPage/SettingsCard/types.d.ts +5 -0
  158. package/cjs/pages/SettingsPage/SettingsPage.js +9 -8
  159. package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.d.ts +2 -0
  160. package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.js +51 -0
  161. package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +16 -0
  162. package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +74 -0
  163. package/cjs/pages/SettingsPage/SlippageSettings/index.d.ts +1 -0
  164. package/cjs/pages/SettingsPage/SlippageSettings/index.js +17 -0
  165. package/cjs/pages/SettingsPage/ThemeSettings.d.ts +2 -0
  166. package/cjs/pages/SettingsPage/ThemeSettings.js +39 -0
  167. package/cjs/pages/TransactionDetailsPage/ContactSupportButton.js +2 -2
  168. package/cjs/pages/TransactionDetailsPage/TransactionDetailsPage.js +33 -28
  169. package/cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.d.ts +1 -0
  170. package/cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +31 -0
  171. package/cjs/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts +4 -2
  172. package/cjs/pages/TransactionHistoryPage/TransactionHistoryItem.js +34 -7
  173. package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js +21 -22
  174. package/cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -0
  175. package/cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +26 -0
  176. package/cjs/pages/TransactionHistoryPage/constants.d.ts +1 -0
  177. package/cjs/pages/TransactionHistoryPage/constants.js +4 -0
  178. package/cjs/pages/TransactionPage/ExchangeRateBottomSheet.js +11 -10
  179. package/cjs/pages/TransactionPage/StartTransactionButton.js +2 -2
  180. package/cjs/pages/TransactionPage/StatusBottomSheet.js +12 -8
  181. package/cjs/pages/TransactionPage/TransactionPage.js +1 -1
  182. package/cjs/providers/FormProvider/FormUpdater.js +4 -4
  183. package/cjs/providers/I18nProvider/I18nProvider.js +3 -7
  184. package/cjs/providers/I18nProvider/types.d.ts +4 -3
  185. package/cjs/providers/WalletProvider/EVMProvider.d.ts +3 -0
  186. package/cjs/providers/WalletProvider/EVMProvider.js +79 -0
  187. package/cjs/providers/WalletProvider/SDKProviders.d.ts +1 -0
  188. package/cjs/providers/WalletProvider/SDKProviders.js +31 -0
  189. package/cjs/providers/WalletProvider/SolanaProvider.d.ts +3 -0
  190. package/cjs/providers/WalletProvider/SolanaProvider.js +35 -0
  191. package/cjs/providers/WalletProvider/WalletProvider.d.ts +1 -15
  192. package/cjs/providers/WalletProvider/WalletProvider.js +5 -183
  193. package/cjs/providers/WalletProvider/index.d.ts +1 -1
  194. package/cjs/providers/WalletProvider/index.js +1 -1
  195. package/cjs/providers/WalletProvider/utils.d.ts +3 -0
  196. package/cjs/providers/WalletProvider/utils.js +25 -0
  197. package/cjs/providers/WidgetProvider/WidgetProvider.js +51 -35
  198. package/cjs/providers/index.d.ts +0 -1
  199. package/cjs/providers/index.js +0 -1
  200. package/cjs/stores/chains/ChainOrderStore.js +24 -0
  201. package/cjs/stores/header/useHeaderStore.d.ts +1 -1
  202. package/cjs/stores/header/useHeaderStore.js +2 -2
  203. package/cjs/stores/routes/createRouteExecutionStore.js +6 -60
  204. package/cjs/stores/routes/index.d.ts +0 -1
  205. package/cjs/stores/routes/index.js +0 -1
  206. package/cjs/stores/routes/types.d.ts +2 -2
  207. package/cjs/stores/routes/utils.d.ts +8 -8
  208. package/cjs/stores/routes/utils.js +7 -5
  209. package/cjs/stores/settings/useSettingsStore.js +2 -4
  210. package/cjs/stores/settings/useSplitSubvariantStore.d.ts +1 -1
  211. package/cjs/stores/settings/useSplitSubvariantStore.js +2 -2
  212. package/cjs/types/events.d.ts +6 -5
  213. package/cjs/types/events.js +1 -1
  214. package/cjs/types/widget.d.ts +7 -14
  215. package/cjs/utils/colors.d.ts +3 -0
  216. package/cjs/utils/colors.js +13 -1
  217. package/cjs/utils/converters.d.ts +3 -0
  218. package/cjs/utils/converters.js +172 -0
  219. package/cjs/utils/format.d.ts +1 -1
  220. package/cjs/utils/format.js +5 -12
  221. package/cjs/utils/index.d.ts +1 -0
  222. package/cjs/utils/index.js +1 -0
  223. package/cjs/utils/navigationRoutes.d.ts +1 -0
  224. package/cjs/utils/navigationRoutes.js +3 -1
  225. package/cjs/utils/svm.d.ts +1 -0
  226. package/cjs/utils/svm.js +14 -0
  227. package/components/ActiveTransactions/ActiveTransactionItem.js +1 -5
  228. package/components/ActiveTransactions/ActiveTransactions.js +2 -2
  229. package/components/AmountInput/AmountInputEndAdornment.js +10 -11
  230. package/components/AmountInput/FormPriceHelperText.js +1 -1
  231. package/components/BaseTransactionButton/BaseTransactionButton.js +6 -5
  232. package/components/Card/CardLabel.d.ts +1 -1
  233. package/components/ChainSelect/ChainSelect.js +8 -5
  234. package/components/ChainSelect/useChainSelect.js +22 -3
  235. package/components/GasMessage/GasMessage.style.js +3 -6
  236. package/components/GasMessage/GasSufficiencyMessage.js +2 -1
  237. package/components/Header/Header.style.d.ts +8 -0
  238. package/components/Header/Header.style.js +16 -1
  239. package/components/Header/NavigationHeader.d.ts +1 -0
  240. package/components/Header/NavigationHeader.js +16 -10
  241. package/components/Header/NavigationTabs.js +3 -3
  242. package/components/Header/SettingsButton.d.ts +1 -0
  243. package/components/Header/SettingsButton.js +21 -0
  244. package/components/Header/SettingsButton.style.d.ts +11 -0
  245. package/components/Header/SettingsButton.style.js +40 -0
  246. package/components/Header/WalletHeader.js +15 -28
  247. package/components/Header/WalletMenu.d.ts +3 -1
  248. package/components/Header/WalletMenu.js +58 -25
  249. package/components/Header/WalletMenu.style.d.ts +1 -0
  250. package/components/Header/WalletMenu.style.js +24 -0
  251. package/components/Insurance/InsuranceCollapsed.js +1 -1
  252. package/components/NFT/NFT.js +3 -1
  253. package/components/NFT/types.d.ts +1 -1
  254. package/components/PoweredBy/PoweredBy.js +2 -1
  255. package/components/RouteCard/RouteCard.js +3 -3
  256. package/components/RouteCard/RouteCardEssentials.js +2 -1
  257. package/components/RouteCard/utils.d.ts +2 -3
  258. package/components/RouteCard/utils.js +4 -9
  259. package/components/SendToWallet/SendToWallet.js +26 -23
  260. package/components/SendToWallet/SendToWalletButton.js +5 -4
  261. package/{cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts → components/SettingsListItemButton.d.ts} +1 -1
  262. package/components/SettingsListItemButton.js +5 -0
  263. package/components/Step/DestinationWalletAddress.d.ts +2 -2
  264. package/components/Step/GasStepProcess.d.ts +2 -2
  265. package/components/Step/Step.d.ts +2 -2
  266. package/components/Step/Step.js +2 -2
  267. package/components/Step/StepList.d.ts +2 -2
  268. package/components/Step/StepList.js +4 -4
  269. package/components/Step/StepProcess.d.ts +2 -2
  270. package/components/Step/StepTimer.d.ts +2 -2
  271. package/components/StepActions/StepActions.d.ts +3 -3
  272. package/components/StepActions/StepActions.js +12 -15
  273. package/components/StepActions/types.d.ts +2 -2
  274. package/components/{Header/NavigationTabs.style.d.ts → Tabs/Tabs.style.d.ts} +2 -2
  275. package/components/Tabs/Tabs.style.js +36 -0
  276. package/components/Tabs/index.d.ts +1 -0
  277. package/components/Tabs/index.js +1 -0
  278. package/components/Token/Token.d.ts +3 -3
  279. package/components/Token/Token.js +5 -5
  280. package/components/TokenList/TokenList.js +4 -4
  281. package/components/TokenList/TokenListItem.js +9 -6
  282. package/components/TokenList/TokenNotFound.js +2 -2
  283. package/components/TokenList/VirtualizedTokenList.js +2 -1
  284. package/config/queryClient.js +0 -4
  285. package/config/version.d.ts +1 -1
  286. package/config/version.js +1 -1
  287. package/hooks/index.d.ts +7 -1
  288. package/hooks/index.js +7 -1
  289. package/hooks/useAccount.d.ts +31 -0
  290. package/hooks/useAccount.js +48 -0
  291. package/hooks/useAvailableChains.d.ts +6 -0
  292. package/hooks/useAvailableChains.js +32 -0
  293. package/hooks/useChain.js +3 -6
  294. package/hooks/useChains.d.ts +1 -1
  295. package/hooks/useChains.js +9 -40
  296. package/hooks/useFromTokenSufficiency.d.ts +3 -3
  297. package/hooks/useFromTokenSufficiency.js +41 -43
  298. package/hooks/useGasRecommendation.d.ts +2 -2
  299. package/hooks/useGasRecommendation.js +23 -18
  300. package/hooks/useGasRefuel.js +19 -12
  301. package/hooks/useGasSufficiency.d.ts +6 -7
  302. package/hooks/useGasSufficiency.js +69 -72
  303. package/hooks/useLanguages.d.ts +6 -0
  304. package/hooks/useLanguages.js +24 -0
  305. package/hooks/useProcessMessage.d.ts +3 -3
  306. package/hooks/useProcessMessage.js +33 -29
  307. package/hooks/useRequiredToAddress.d.ts +1 -0
  308. package/hooks/useRequiredToAddress.js +15 -0
  309. package/hooks/useRouteExecution.d.ts +2 -2
  310. package/hooks/useRouteExecution.js +44 -58
  311. package/hooks/useRoutes.d.ts +1 -1
  312. package/hooks/useRoutes.js +131 -116
  313. package/hooks/useSettingMonitor.d.ts +11 -0
  314. package/hooks/useSettingMonitor.js +53 -0
  315. package/hooks/useTokenAddressBalance.d.ts +1 -1
  316. package/hooks/useTokenBalance.d.ts +5 -3
  317. package/hooks/useTokenBalance.js +74 -45
  318. package/hooks/useTokenBalances.d.ts +3 -3
  319. package/hooks/useTokenBalances.js +34 -24
  320. package/hooks/useTokenSearch.js +18 -17
  321. package/hooks/useTokens.d.ts +2 -1
  322. package/hooks/useTokens.js +19 -16
  323. package/hooks/useTools.d.ts +1 -1
  324. package/hooks/useTools.js +13 -12
  325. package/hooks/useTransactionDetails.d.ts +4 -0
  326. package/hooks/useTransactionDetails.js +52 -0
  327. package/hooks/useTransactionHistory.d.ts +5 -0
  328. package/hooks/useTransactionHistory.js +35 -0
  329. package/i18n/en.json +18 -9
  330. package/i18n/fr.json +7 -4
  331. package/i18n/pt.json +7 -4
  332. package/i18n/tr.json +7 -4
  333. package/i18n/uk.json +7 -4
  334. package/i18n/zh.json +7 -4
  335. package/icons/index.d.ts +1 -3
  336. package/icons/index.js +1 -3
  337. package/icons/lifi.d.ts +1 -0
  338. package/icons/lifi.js +1 -0
  339. package/index.d.ts +2 -3
  340. package/index.js +2 -4
  341. package/package.json +19 -19
  342. package/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +2 -2
  343. package/pages/LanguagesPage/LanguagesPage.d.ts +2 -0
  344. package/pages/LanguagesPage/LanguagesPage.js +18 -0
  345. package/pages/LanguagesPage/index.d.ts +1 -0
  346. package/pages/LanguagesPage/index.js +1 -0
  347. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +16 -6
  348. package/pages/SelectWalletPage/EVMListItemButton.d.ts +8 -0
  349. package/pages/SelectWalletPage/EVMListItemButton.js +36 -0
  350. package/pages/SelectWalletPage/SVMListItemButton.d.ts +6 -0
  351. package/pages/SelectWalletPage/SVMListItemButton.js +30 -0
  352. package/pages/SelectWalletPage/SelectWalletPage.js +34 -35
  353. package/pages/SelectWalletPage/utils.d.ts +3 -0
  354. package/pages/SelectWalletPage/utils.js +17 -0
  355. package/{cjs/pages/SettingsPage/EnabledToolsButton.d.ts → pages/SettingsPage/BridgeAndExchangeSettings.d.ts} +1 -1
  356. package/pages/SettingsPage/BridgeAndExchangeSettings.js +32 -0
  357. package/pages/SettingsPage/GasPriceSettings.d.ts +2 -0
  358. package/pages/SettingsPage/GasPriceSettings.js +17 -0
  359. package/pages/SettingsPage/LanguageSetting.d.ts +2 -0
  360. package/pages/SettingsPage/LanguageSetting.js +22 -0
  361. package/pages/SettingsPage/ResetSettingsButton.js +4 -31
  362. package/pages/SettingsPage/RoutePrioritySettings.d.ts +2 -0
  363. package/pages/SettingsPage/RoutePrioritySettings.js +21 -0
  364. package/pages/SettingsPage/SendToWalletOptionSetting.d.ts +1 -0
  365. package/pages/SettingsPage/{ShowDestinationWallet.js → SendToWalletOptionSetting.js} +4 -7
  366. package/pages/SettingsPage/SettingsCard/BadgedValue.d.ts +8 -0
  367. package/pages/SettingsPage/SettingsCard/BadgedValue.js +3 -0
  368. package/pages/SettingsPage/SettingsCard/SettingCard.d.ts +2 -0
  369. package/pages/SettingsPage/SettingsCard/SettingCard.js +7 -0
  370. package/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +19 -0
  371. package/pages/SettingsPage/SettingsCard/SettingCard.style.js +50 -0
  372. package/pages/SettingsPage/SettingsCard/SettingCardButton.d.ts +7 -0
  373. package/pages/SettingsPage/SettingsCard/SettingCardButton.js +4 -0
  374. package/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +7 -0
  375. package/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +12 -0
  376. package/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +6 -0
  377. package/pages/SettingsPage/SettingsCard/SettingsAccordian.js +31 -0
  378. package/pages/SettingsPage/SettingsCard/index.d.ts +6 -0
  379. package/pages/SettingsPage/SettingsCard/index.js +6 -0
  380. package/pages/SettingsPage/SettingsCard/types.d.ts +5 -0
  381. package/pages/SettingsPage/SettingsPage.js +10 -9
  382. package/pages/SettingsPage/SlippageSettings/SlippageSettings.d.ts +2 -0
  383. package/pages/SettingsPage/SlippageSettings/SlippageSettings.js +47 -0
  384. package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +16 -0
  385. package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +71 -0
  386. package/pages/SettingsPage/SlippageSettings/index.d.ts +1 -0
  387. package/pages/SettingsPage/SlippageSettings/index.js +1 -0
  388. package/pages/SettingsPage/ThemeSettings.d.ts +2 -0
  389. package/pages/SettingsPage/ThemeSettings.js +35 -0
  390. package/pages/TransactionDetailsPage/ContactSupportButton.js +2 -2
  391. package/pages/TransactionDetailsPage/TransactionDetailsPage.js +38 -33
  392. package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.d.ts +1 -0
  393. package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +27 -0
  394. package/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts +4 -2
  395. package/pages/TransactionHistoryPage/TransactionHistoryItem.js +34 -7
  396. package/pages/TransactionHistoryPage/TransactionHistoryPage.js +24 -25
  397. package/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -0
  398. package/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +22 -0
  399. package/pages/TransactionHistoryPage/constants.d.ts +1 -0
  400. package/pages/TransactionHistoryPage/constants.js +1 -0
  401. package/pages/TransactionPage/ExchangeRateBottomSheet.js +11 -10
  402. package/pages/TransactionPage/StartTransactionButton.js +2 -2
  403. package/pages/TransactionPage/StatusBottomSheet.js +14 -10
  404. package/pages/TransactionPage/TransactionPage.js +1 -1
  405. package/providers/FormProvider/FormUpdater.js +4 -4
  406. package/providers/I18nProvider/I18nProvider.js +4 -8
  407. package/providers/I18nProvider/types.d.ts +4 -3
  408. package/providers/WalletProvider/EVMProvider.d.ts +3 -0
  409. package/providers/WalletProvider/EVMProvider.js +74 -0
  410. package/providers/WalletProvider/SDKProviders.d.ts +1 -0
  411. package/providers/WalletProvider/SDKProviders.js +27 -0
  412. package/providers/WalletProvider/SolanaProvider.d.ts +3 -0
  413. package/providers/WalletProvider/SolanaProvider.js +30 -0
  414. package/providers/WalletProvider/WalletProvider.d.ts +1 -15
  415. package/providers/WalletProvider/WalletProvider.js +5 -181
  416. package/providers/WalletProvider/index.d.ts +1 -1
  417. package/providers/WalletProvider/index.js +1 -1
  418. package/providers/WalletProvider/utils.d.ts +3 -0
  419. package/providers/WalletProvider/utils.js +21 -0
  420. package/providers/WidgetProvider/WidgetProvider.js +52 -36
  421. package/providers/index.d.ts +0 -1
  422. package/providers/index.js +0 -1
  423. package/stores/chains/ChainOrderStore.js +25 -1
  424. package/stores/header/useHeaderStore.d.ts +1 -1
  425. package/stores/header/useHeaderStore.js +2 -2
  426. package/stores/routes/createRouteExecutionStore.js +6 -60
  427. package/stores/routes/index.d.ts +0 -1
  428. package/stores/routes/index.js +0 -1
  429. package/stores/routes/types.d.ts +2 -2
  430. package/stores/routes/utils.d.ts +8 -8
  431. package/stores/routes/utils.js +5 -3
  432. package/stores/settings/useSettingsStore.js +2 -4
  433. package/stores/settings/useSplitSubvariantStore.d.ts +1 -1
  434. package/stores/settings/useSplitSubvariantStore.js +2 -2
  435. package/tsconfig.cjs.tsbuildinfo +1 -1
  436. package/types/events.d.ts +6 -5
  437. package/types/events.js +1 -1
  438. package/types/widget.d.ts +7 -14
  439. package/utils/colors.d.ts +3 -0
  440. package/utils/colors.js +10 -1
  441. package/utils/converters.d.ts +3 -0
  442. package/utils/converters.js +168 -0
  443. package/utils/format.d.ts +1 -1
  444. package/utils/format.js +5 -12
  445. package/utils/index.d.ts +1 -0
  446. package/utils/index.js +1 -0
  447. package/utils/navigationRoutes.d.ts +1 -0
  448. package/utils/navigationRoutes.js +3 -1
  449. package/utils/svm.d.ts +1 -0
  450. package/utils/svm.js +10 -0
  451. package/cjs/components/LiFiLogo.d.ts +0 -5
  452. package/cjs/components/LiFiLogo.js +0 -10
  453. package/cjs/fonts/Inter-Black.woff +0 -0
  454. package/cjs/fonts/Inter-Black.woff2 +0 -0
  455. package/cjs/fonts/Inter-BlackItalic.woff +0 -0
  456. package/cjs/fonts/Inter-BlackItalic.woff2 +0 -0
  457. package/cjs/fonts/Inter-Bold.woff +0 -0
  458. package/cjs/fonts/Inter-Bold.woff2 +0 -0
  459. package/cjs/fonts/Inter-BoldItalic.woff +0 -0
  460. package/cjs/fonts/Inter-BoldItalic.woff2 +0 -0
  461. package/cjs/fonts/Inter-ExtraBold.woff +0 -0
  462. package/cjs/fonts/Inter-ExtraBold.woff2 +0 -0
  463. package/cjs/fonts/Inter-ExtraBoldItalic.woff +0 -0
  464. package/cjs/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
  465. package/cjs/fonts/Inter-ExtraLight.woff +0 -0
  466. package/cjs/fonts/Inter-ExtraLight.woff2 +0 -0
  467. package/cjs/fonts/Inter-ExtraLightItalic.woff +0 -0
  468. package/cjs/fonts/Inter-ExtraLightItalic.woff2 +0 -0
  469. package/cjs/fonts/Inter-Italic.woff +0 -0
  470. package/cjs/fonts/Inter-Italic.woff2 +0 -0
  471. package/cjs/fonts/Inter-Light.woff +0 -0
  472. package/cjs/fonts/Inter-Light.woff2 +0 -0
  473. package/cjs/fonts/Inter-LightItalic.woff +0 -0
  474. package/cjs/fonts/Inter-LightItalic.woff2 +0 -0
  475. package/cjs/fonts/Inter-Medium.woff +0 -0
  476. package/cjs/fonts/Inter-Medium.woff2 +0 -0
  477. package/cjs/fonts/Inter-MediumItalic.woff +0 -0
  478. package/cjs/fonts/Inter-MediumItalic.woff2 +0 -0
  479. package/cjs/fonts/Inter-Regular.woff +0 -0
  480. package/cjs/fonts/Inter-Regular.woff2 +0 -0
  481. package/cjs/fonts/Inter-SemiBold.woff +0 -0
  482. package/cjs/fonts/Inter-SemiBold.woff2 +0 -0
  483. package/cjs/fonts/Inter-SemiBoldItalic.woff +0 -0
  484. package/cjs/fonts/Inter-SemiBoldItalic.woff2 +0 -0
  485. package/cjs/fonts/Inter-Thin.woff +0 -0
  486. package/cjs/fonts/Inter-Thin.woff2 +0 -0
  487. package/cjs/fonts/Inter-ThinItalic.woff +0 -0
  488. package/cjs/fonts/Inter-ThinItalic.woff2 +0 -0
  489. package/cjs/fonts/Inter-italic.var.woff2 +0 -0
  490. package/cjs/fonts/Inter-roman.var.woff2 +0 -0
  491. package/cjs/fonts/Inter.var.woff2 +0 -0
  492. package/cjs/fonts/inter.css +0 -217
  493. package/cjs/hooks/useGetTokenBalancesWithRetry.d.ts +0 -3
  494. package/cjs/hooks/useGetTokenBalancesWithRetry.js +0 -33
  495. package/cjs/icons/LiFiFullLogo.d.ts +0 -2
  496. package/cjs/icons/LiFiFullLogo.js +0 -6
  497. package/cjs/icons/LiFiLogo.d.ts +0 -2
  498. package/cjs/icons/LiFiLogo.js +0 -6
  499. package/cjs/icons/LiFiToolLogo.d.ts +0 -2
  500. package/cjs/icons/LiFiToolLogo.js +0 -6
  501. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +0 -8
  502. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +0 -2
  503. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +0 -27
  504. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +0 -4
  505. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.js +0 -19
  506. package/cjs/pages/SettingsPage/EnabledToolsButton.js +0 -25
  507. package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +0 -5
  508. package/cjs/pages/SettingsPage/EnabledToolsButton.style.js +0 -17
  509. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  510. package/cjs/pages/SettingsPage/GasPriceSelect.js +0 -17
  511. package/cjs/pages/SettingsPage/LanguageSelect.d.ts +0 -2
  512. package/cjs/pages/SettingsPage/LanguageSelect.js +0 -37
  513. package/cjs/pages/SettingsPage/RoutePrioritySelect.d.ts +0 -2
  514. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +0 -23
  515. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
  516. package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
  517. package/cjs/pages/SettingsPage/SlippageInput.js +0 -30
  518. package/cjs/providers/SDKProvider/SDKProvider.d.ts +0 -4
  519. package/cjs/providers/SDKProvider/SDKProvider.js +0 -41
  520. package/cjs/providers/SDKProvider/index.d.ts +0 -1
  521. package/cjs/providers/WalletProvider/types.d.ts +0 -17
  522. package/cjs/stores/routes/useTransactionHistory.d.ts +0 -2
  523. package/cjs/stores/routes/useTransactionHistory.js +0 -15
  524. package/components/Header/NavigationTabs.style.js +0 -58
  525. package/components/LiFiLogo.d.ts +0 -5
  526. package/components/LiFiLogo.js +0 -6
  527. package/fonts/Inter-Black.woff +0 -0
  528. package/fonts/Inter-Black.woff2 +0 -0
  529. package/fonts/Inter-BlackItalic.woff +0 -0
  530. package/fonts/Inter-BlackItalic.woff2 +0 -0
  531. package/fonts/Inter-Bold.woff +0 -0
  532. package/fonts/Inter-Bold.woff2 +0 -0
  533. package/fonts/Inter-BoldItalic.woff +0 -0
  534. package/fonts/Inter-BoldItalic.woff2 +0 -0
  535. package/fonts/Inter-ExtraBold.woff +0 -0
  536. package/fonts/Inter-ExtraBold.woff2 +0 -0
  537. package/fonts/Inter-ExtraBoldItalic.woff +0 -0
  538. package/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
  539. package/fonts/Inter-ExtraLight.woff +0 -0
  540. package/fonts/Inter-ExtraLight.woff2 +0 -0
  541. package/fonts/Inter-ExtraLightItalic.woff +0 -0
  542. package/fonts/Inter-ExtraLightItalic.woff2 +0 -0
  543. package/fonts/Inter-Italic.woff +0 -0
  544. package/fonts/Inter-Italic.woff2 +0 -0
  545. package/fonts/Inter-Light.woff +0 -0
  546. package/fonts/Inter-Light.woff2 +0 -0
  547. package/fonts/Inter-LightItalic.woff +0 -0
  548. package/fonts/Inter-LightItalic.woff2 +0 -0
  549. package/fonts/Inter-Medium.woff +0 -0
  550. package/fonts/Inter-Medium.woff2 +0 -0
  551. package/fonts/Inter-MediumItalic.woff +0 -0
  552. package/fonts/Inter-MediumItalic.woff2 +0 -0
  553. package/fonts/Inter-Regular.woff +0 -0
  554. package/fonts/Inter-Regular.woff2 +0 -0
  555. package/fonts/Inter-SemiBold.woff +0 -0
  556. package/fonts/Inter-SemiBold.woff2 +0 -0
  557. package/fonts/Inter-SemiBoldItalic.woff +0 -0
  558. package/fonts/Inter-SemiBoldItalic.woff2 +0 -0
  559. package/fonts/Inter-Thin.woff +0 -0
  560. package/fonts/Inter-Thin.woff2 +0 -0
  561. package/fonts/Inter-ThinItalic.woff +0 -0
  562. package/fonts/Inter-ThinItalic.woff2 +0 -0
  563. package/fonts/Inter-italic.var.woff2 +0 -0
  564. package/fonts/Inter-roman.var.woff2 +0 -0
  565. package/fonts/Inter.var.woff2 +0 -0
  566. package/fonts/inter.css +0 -217
  567. package/hooks/useGetTokenBalancesWithRetry.d.ts +0 -3
  568. package/hooks/useGetTokenBalancesWithRetry.js +0 -29
  569. package/icons/LiFiFullLogo.d.ts +0 -2
  570. package/icons/LiFiFullLogo.js +0 -2
  571. package/icons/LiFiLogo.d.ts +0 -2
  572. package/icons/LiFiLogo.js +0 -2
  573. package/icons/LiFiToolLogo.d.ts +0 -2
  574. package/icons/LiFiToolLogo.js +0 -2
  575. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +0 -5
  576. package/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +0 -2
  577. package/pages/SettingsPage/ColorSchemeButtonGroup.js +0 -23
  578. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +0 -4
  579. package/pages/SettingsPage/ColorSchemeButtonGroup.style.js +0 -16
  580. package/pages/SettingsPage/EnabledToolsButton.js +0 -21
  581. package/pages/SettingsPage/EnabledToolsButton.style.d.ts +0 -5
  582. package/pages/SettingsPage/EnabledToolsButton.style.js +0 -14
  583. package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  584. package/pages/SettingsPage/GasPriceSelect.js +0 -13
  585. package/pages/SettingsPage/LanguageSelect.d.ts +0 -2
  586. package/pages/SettingsPage/LanguageSelect.js +0 -33
  587. package/pages/SettingsPage/RoutePrioritySelect.d.ts +0 -2
  588. package/pages/SettingsPage/RoutePrioritySelect.js +0 -19
  589. package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
  590. package/pages/SettingsPage/SlippageInput.d.ts +0 -1
  591. package/pages/SettingsPage/SlippageInput.js +0 -26
  592. package/providers/SDKProvider/SDKProvider.d.ts +0 -4
  593. package/providers/SDKProvider/SDKProvider.js +0 -36
  594. package/providers/SDKProvider/index.d.ts +0 -1
  595. package/providers/SDKProvider/index.js +0 -1
  596. package/providers/WalletProvider/types.d.ts +0 -17
  597. package/stores/routes/useTransactionHistory.d.ts +0 -2
  598. package/stores/routes/useTransactionHistory.js +0 -11
  599. /package/cjs/{providers/WalletProvider → pages/SettingsPage/SettingsCard}/types.js +0 -0
  600. /package/{providers/WalletProvider → pages/SettingsPage/SettingsCard}/types.js +0 -0
@@ -0,0 +1,50 @@
1
+ import { Box, ButtonBase, Badge as MuiBadge, Typography } from '@mui/material';
2
+ import { badgeClasses } from '@mui/material/Badge';
3
+ import { styled } from '@mui/material/styles';
4
+ export const SettingsList = styled(Box)(({ theme }) => ({
5
+ display: 'flex',
6
+ flexDirection: 'column',
7
+ gap: theme.spacing(1),
8
+ padding: theme.spacing(1, 3, 2),
9
+ }));
10
+ export const SummaryTitleContainer = styled(Box)(({ theme }) => ({
11
+ display: 'flex',
12
+ alignItems: 'center',
13
+ gap: theme.spacing(1.5),
14
+ }));
15
+ export const SummaryRowContainer = styled(Box)({
16
+ display: 'flex',
17
+ width: '100%',
18
+ justifyContent: 'space-between',
19
+ alignItems: 'center',
20
+ });
21
+ export const SummaryRowButton = styled(ButtonBase)({
22
+ background: 'none',
23
+ color: 'inherit',
24
+ border: 'none',
25
+ padding: 0,
26
+ font: 'inherit',
27
+ cursor: 'pointer',
28
+ outline: 'inherit',
29
+ display: 'flex',
30
+ width: '100%',
31
+ justifyContent: 'space-between',
32
+ alignItems: 'center',
33
+ });
34
+ export const SummaryValue = styled(Typography)({
35
+ lineHeight: '1.25',
36
+ fontWeight: 500,
37
+ });
38
+ export const Badge = styled(MuiBadge)(({ theme }) => ({
39
+ display: 'flex',
40
+ alignItems: 'center',
41
+ gap: theme.spacing(1.25),
42
+ [`.${badgeClasses.badge}`]: {
43
+ width: 10,
44
+ height: 10,
45
+ // the following removes MUI styling so we can position the badge with flex
46
+ position: 'relative',
47
+ transform: 'translateX(0)',
48
+ borderRadius: '50%',
49
+ },
50
+ }));
@@ -0,0 +1,7 @@
1
+ import type { MouseEventHandler, PropsWithChildren } from 'react';
2
+ import type { SettingCardTitle } from './types';
3
+ interface SettingCardButtonProps extends SettingCardTitle {
4
+ onClick: MouseEventHandler;
5
+ }
6
+ export declare const SettingCardButton: React.FC<PropsWithChildren<SettingCardButtonProps>>;
7
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SettingCard } from './SettingCard';
3
+ import { SummaryRowButton, SummaryValue, SummaryTitleContainer, } from './SettingCard.style';
4
+ export const SettingCardButton = ({ onClick, icon, title, children }) => (_jsx(SettingCard, { children: _jsxs(SummaryRowButton, { onClick: onClick, disableRipple: true, children: [_jsxs(SummaryTitleContainer, { children: [icon, _jsx(SummaryValue, { children: title })] }), children] }) }));
@@ -0,0 +1,7 @@
1
+ import type { PropsWithChildren, ReactNode } from 'react';
2
+ import type { SettingCardTitle } from './types';
3
+ interface SettingCardExpandableProps extends SettingCardTitle {
4
+ value: ReactNode;
5
+ }
6
+ export declare const SettingCardExpandable: React.FC<PropsWithChildren<SettingCardExpandableProps>>;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from 'react';
3
+ import { Collapse } from '@mui/material';
4
+ import { SettingCard } from './SettingCard';
5
+ import { SummaryRowButton, SummaryValue, SummaryTitleContainer, } from './SettingCard.style';
6
+ import { useSettingsCardExpandable } from './SettingsAccordian';
7
+ export const SettingCardExpandable = ({ icon, title, value, children }) => {
8
+ const { expanded, toggleExpanded } = useSettingsCardExpandable();
9
+ const buttonId = useId();
10
+ const collapseId = useId();
11
+ return (_jsxs(SettingCard, { children: [_jsxs(SummaryRowButton, { id: buttonId, "aria-expanded": expanded, "aria-controls": collapseId, onClick: toggleExpanded, disableRipple: true, children: [_jsxs(SummaryTitleContainer, { children: [icon, _jsx(SummaryValue, { children: title })] }), !expanded && value] }), _jsx(Collapse, { id: collapseId, role: "region", "aria-labelledby": buttonId, in: expanded, children: children })] }));
12
+ };
@@ -0,0 +1,6 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ export declare const SettingsCardAccordion: React.FC<PropsWithChildren>;
3
+ export declare const useSettingsCardExpandable: () => {
4
+ expanded: boolean;
5
+ toggleExpanded: () => void;
6
+ };
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useEffect, useId, useState } from 'react';
3
+ const SettingsAccordionContext = createContext({
4
+ setOpenCard: (id) => { },
5
+ openCard: '',
6
+ });
7
+ export const SettingsCardAccordion = ({ children, }) => {
8
+ const [openCard, setOpenCard] = useState('');
9
+ return (_jsx(SettingsAccordionContext.Provider, { value: { openCard, setOpenCard }, children: children }));
10
+ };
11
+ export const useSettingsCardExpandable = () => {
12
+ const settingCardExpandableId = useId();
13
+ const [expanded, setExpanded] = useState(false);
14
+ const { openCard, setOpenCard } = useContext(SettingsAccordionContext);
15
+ const toggleExpanded = () => {
16
+ const newExpanded = !expanded;
17
+ setExpanded(newExpanded);
18
+ if (newExpanded && openCard !== settingCardExpandableId) {
19
+ setOpenCard(settingCardExpandableId);
20
+ }
21
+ };
22
+ useEffect(() => {
23
+ if (openCard !== settingCardExpandableId) {
24
+ setExpanded(false);
25
+ }
26
+ }, [settingCardExpandableId, openCard]);
27
+ return {
28
+ expanded,
29
+ toggleExpanded,
30
+ };
31
+ };
@@ -0,0 +1,6 @@
1
+ export * from './SettingCard';
2
+ export * from './SettingCard.style';
3
+ export * from './SettingCardButton';
4
+ export * from './SettingCardExpandable';
5
+ export * from './BadgedValue';
6
+ export * from './SettingsAccordian';
@@ -0,0 +1,6 @@
1
+ export * from './SettingCard';
2
+ export * from './SettingCard.style';
3
+ export * from './SettingCardButton';
4
+ export * from './SettingCardExpandable';
5
+ export * from './BadgedValue';
6
+ export * from './SettingsAccordian';
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface SettingCardTitle {
3
+ icon: ReactNode;
4
+ title: ReactNode;
5
+ }
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Container } from '@mui/material';
3
- import { ColorSchemeButtonGroup } from './ColorSchemeButtonGroup';
4
- import { EnabledToolsButton } from './EnabledToolsButton';
5
- import { GasPriceSelect } from './GasPriceSelect';
6
- import { LanguageSelect } from './LanguageSelect';
2
+ import { Container } from '@mui/material';
3
+ import { BridgeAndExchangeSettings } from './BridgeAndExchangeSettings';
4
+ import { LanguageSetting } from './LanguageSetting';
7
5
  import { ResetSettingsButton } from './ResetSettingsButton';
8
- import { RoutePrioritySelect } from './RoutePrioritySelect';
9
- import { ShowDestinationWallet } from './ShowDestinationWallet';
10
- import { SlippageInput } from './SlippageInput';
6
+ import { SendToWalletOptionSetting } from './SendToWalletOptionSetting';
7
+ import { GasPriceSettings } from './GasPriceSettings';
8
+ import { RoutePrioritySettings } from './RoutePrioritySettings';
9
+ import { ThemeSettings } from './ThemeSettings';
10
+ import { SlippageSettings } from './SlippageSettings';
11
+ import { SettingsList, SettingsCardAccordion } from './SettingsCard';
11
12
  export const SettingsPage = () => {
12
- return (_jsxs(Container, { disableGutters: true, children: [_jsxs(Box, { px: 3, pt: 1, children: [_jsx(ColorSchemeButtonGroup, {}), _jsx(LanguageSelect, {}), _jsx(RoutePrioritySelect, {}), _jsxs(Box, { sx: { display: 'flex', alignItems: 'center' }, mt: 2, children: [_jsx(Box, { pr: 2, flex: 1, children: _jsx(SlippageInput, {}) }), _jsx(GasPriceSelect, {})] })] }), _jsx(ShowDestinationWallet, {}), _jsxs(Box, { px: 1.5, children: [_jsx(EnabledToolsButton, { type: "Bridges" }), _jsx(EnabledToolsButton, { type: "Exchanges" })] }), _jsx(ResetSettingsButton, {})] }));
13
+ return (_jsxs(Container, { disableGutters: true, children: [_jsx(SettingsList, { children: _jsxs(SettingsCardAccordion, { children: [_jsx(ThemeSettings, {}), _jsx(LanguageSetting, {}), _jsx(RoutePrioritySettings, {}), _jsx(GasPriceSettings, {}), _jsx(SlippageSettings, {}), _jsx(BridgeAndExchangeSettings, { type: "Bridges" }), _jsx(BridgeAndExchangeSettings, { type: "Exchanges" }), _jsx(SendToWalletOptionSetting, {})] }) }), _jsx(ResetSettingsButton, {})] }));
13
14
  };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const SlippageSettings: React.FC;
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useState } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import PercentIcon from '@mui/icons-material/Percent';
5
+ import { useSettings, useSettingsStore } from '../../../stores';
6
+ import { useSettingMonitor } from '../../../hooks';
7
+ import { formatSlippage } from '../../../utils';
8
+ import { SettingsFieldSet, SlippageCustomInput, SlippageDefaultButton, SlippageLimitsWarningContainer, } from './SlippageSettings.style';
9
+ import { Box, Typography } from '@mui/material';
10
+ import { SettingCardExpandable, BadgedValue } from '../SettingsCard';
11
+ import WarningRoundedIcon from '@mui/icons-material/WarningRounded';
12
+ const slippageDefault = '0.5';
13
+ export const SlippageSettings = () => {
14
+ const { t } = useTranslation();
15
+ const { isSlippageOutsideRecommendedLimits, isSlippageChanged } = useSettingMonitor();
16
+ const { slippage } = useSettings(['slippage']);
17
+ const setValue = useSettingsStore((state) => state.setValue);
18
+ const defaultValue = useRef(slippage);
19
+ const [focused, setFocused] = useState();
20
+ const handleDefaultClick = () => {
21
+ setValue('slippage', formatSlippage(slippageDefault, defaultValue.current));
22
+ };
23
+ const handleInputUpdate = (event) => {
24
+ const { value } = event.target;
25
+ setValue('slippage', formatSlippage(value || slippageDefault, defaultValue.current, true));
26
+ };
27
+ const handleInputBlur = (event) => {
28
+ setFocused(undefined);
29
+ const { value } = event.target;
30
+ setValue('slippage', formatSlippage(value || slippageDefault, defaultValue.current));
31
+ };
32
+ const customInputValue = !slippage || slippage === slippageDefault ? '' : slippage;
33
+ const badgeColor = isSlippageOutsideRecommendedLimits
34
+ ? 'warning'
35
+ : isSlippageChanged
36
+ ? 'info'
37
+ : undefined;
38
+ return (_jsx(SettingCardExpandable, { value: _jsx(BadgedValue, { badgeColor: badgeColor, showBadge: !!badgeColor, children: `${slippage}%` }), icon: _jsx(PercentIcon, {}), title: t(`settings.slippage`), children: _jsxs(Box, { mt: 1.5, children: [_jsxs(SettingsFieldSet, { children: [_jsx(SlippageDefaultButton, { selected: slippageDefault === slippage && focused !== 'input', onFocus: () => {
39
+ setFocused('button');
40
+ }, onBlur: () => {
41
+ setFocused(undefined);
42
+ }, onClick: handleDefaultClick, disableRipple: true, children: slippageDefault }), _jsx(SlippageCustomInput, { selected: slippageDefault !== slippage && focused !== 'button', placeholder: focused === 'input' ? '' : t('settings.custom'), inputProps: {
43
+ inputMode: 'decimal',
44
+ }, onChange: handleInputUpdate, onFocus: () => {
45
+ setFocused('input');
46
+ }, onBlur: handleInputBlur, value: customInputValue, autoComplete: "off" })] }), isSlippageOutsideRecommendedLimits && (_jsxs(SlippageLimitsWarningContainer, { children: [_jsx(WarningRoundedIcon, { color: "warning" }), _jsx(Typography, { fontSize: 13, fontWeight: 400, children: t('warning.message.slippageOutsideRecommendedLimits') })] }))] }) }));
47
+ };
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import type { Theme } from '@mui/material';
3
+ export declare const SettingsFieldSet: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
4
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
5
+ }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
6
+ interface SlippageDefaultProps {
7
+ selected?: boolean;
8
+ }
9
+ export declare const SlippageDefaultButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonBaseOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
10
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
11
+ }, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef"> & import("@mui/system").MUIStyledCommonProps<Theme> & SlippageDefaultProps, {}, {}>;
12
+ export declare const SlippageCustomInput: import("@emotion/styled").StyledComponent<import("@mui/material").InputBaseProps & import("@mui/system").MUIStyledCommonProps<Theme> & SlippageDefaultProps, {}, {}>;
13
+ export declare const SlippageLimitsWarningContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
14
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
15
+ }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
16
+ export {};
@@ -0,0 +1,71 @@
1
+ import { alpha, styled } from '@mui/material/styles';
2
+ import { Box, ButtonBase, InputBase } from '@mui/material';
3
+ import { inputBaseClasses } from '@mui/material/InputBase';
4
+ import { getCardFieldsetBackgroundColor } from '../../../utils';
5
+ export const SettingsFieldSet = styled(Box)(({ theme }) => ({
6
+ display: 'flex',
7
+ backgroundColor: getCardFieldsetBackgroundColor(theme),
8
+ borderRadius: Math.max(theme.shape.borderRadius, theme.shape.borderRadiusSecondary),
9
+ padding: theme.spacing(0.5),
10
+ gap: theme.spacing(0.5),
11
+ height: '3.5rem',
12
+ }));
13
+ const slippageControlSelected = (theme) => ({
14
+ backgroundColor: theme.palette.mode === 'dark'
15
+ ? theme.palette.background.default
16
+ : theme.palette.common.white,
17
+ borderRadius: theme.shape.borderRadiusSecondary,
18
+ boxShadow: `0px 2px 4px ${alpha(theme.palette.common.black, 0.04)}`,
19
+ });
20
+ export const SlippageDefaultButton = styled(ButtonBase)(({ theme, selected, }) => {
21
+ const selectedStyle = selected
22
+ ? {
23
+ '&:not(:focus)': {
24
+ ...slippageControlSelected(theme),
25
+ },
26
+ }
27
+ : {};
28
+ return {
29
+ height: '100%',
30
+ width: '100%',
31
+ fontSize: '1rem',
32
+ fontWeight: 700,
33
+ '&:focus': {
34
+ ...slippageControlSelected(theme),
35
+ },
36
+ ...selectedStyle,
37
+ };
38
+ });
39
+ export const SlippageCustomInput = styled(InputBase)(({ theme, selected, }) => {
40
+ const selectedStyle = selected
41
+ ? {
42
+ '&:not(:focus)': {
43
+ ...slippageControlSelected(theme),
44
+ },
45
+ }
46
+ : {};
47
+ return {
48
+ height: '100%',
49
+ width: '100%',
50
+ [`.${inputBaseClasses.input}`]: {
51
+ height: '100%',
52
+ width: '100%',
53
+ padding: 0,
54
+ textAlign: 'center',
55
+ '&::placeholder': {
56
+ fontSize: '1rem',
57
+ fontWeight: 700,
58
+ opacity: 1,
59
+ },
60
+ '&:focus': {
61
+ ...slippageControlSelected(theme),
62
+ },
63
+ ...selectedStyle,
64
+ },
65
+ };
66
+ });
67
+ export const SlippageLimitsWarningContainer = styled(Box)(({ theme }) => ({
68
+ display: 'flex',
69
+ gap: theme.spacing(1.25),
70
+ marginTop: theme.spacing(1.5),
71
+ }));
@@ -0,0 +1 @@
1
+ export * from './SlippageSettings';
@@ -0,0 +1 @@
1
+ export * from './SlippageSettings';
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ThemeSettings: React.FC;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { HiddenUI } from '../../types';
3
+ import { useWidgetConfig } from '../../providers';
4
+ import LightModeIcon from '@mui/icons-material/LightMode';
5
+ import BrightnessAuto from '@mui/icons-material/BrightnessAuto';
6
+ import Nightlight from '@mui/icons-material/Nightlight';
7
+ import { Tooltip } from '@mui/material';
8
+ import { useTranslation } from 'react-i18next';
9
+ import { useAppearance } from '../../stores';
10
+ import { SettingCardExpandable, SummaryValue } from './SettingsCard';
11
+ import { Tab, Tabs } from '../../components/Tabs';
12
+ const themeIcons = {
13
+ light: LightModeIcon,
14
+ dark: Nightlight,
15
+ auto: BrightnessAuto,
16
+ };
17
+ // If the Tab is not the direct child of the Tabs component you can loose the switching
18
+ // The component passes the props to the Tab component so switching isn't lost
19
+ const ThemeTab = ({ title, value, Icon, ...props }) => (_jsx(Tooltip, { title: title, arrow: true, children: _jsx(Tab, { icon: Icon, value: value, ...props, disableRipple: true }) }));
20
+ export const ThemeSettings = () => {
21
+ const { t } = useTranslation();
22
+ const [appearance, setAppearance] = useAppearance();
23
+ const { hiddenUI } = useWidgetConfig();
24
+ if (hiddenUI?.includes(HiddenUI.Appearance)) {
25
+ return null;
26
+ }
27
+ const ThemeIcon = themeIcons[appearance];
28
+ const handleThemeChange = (_, appearance) => {
29
+ setAppearance(appearance);
30
+ };
31
+ return (_jsx(SettingCardExpandable, { value: _jsxs(SummaryValue, { children: [t(`button.${appearance}`), " "] }), icon: _jsx(ThemeIcon, {}), title: t('settings.theme'), children: _jsx(Tabs, { value: appearance, "aria-label": "tabs", indicatorColor: "primary", onChange: handleThemeChange, sx: { mt: 1.5 }, children: Object.entries(themeIcons).map(([theme, Icon]) => {
32
+ const supportedThemeOption = theme;
33
+ return (_jsx(ThemeTab, { title: t(`button.${supportedThemeOption}`), value: supportedThemeOption, Icon: _jsx(Icon, {}) }, supportedThemeOption));
34
+ }) }) }));
35
+ };
@@ -7,14 +7,14 @@ export const ContactSupportButton = ({ supportId, }) => {
7
7
  const { t } = useTranslation();
8
8
  const widgetEvents = useWidgetEvents();
9
9
  const handleClick = () => {
10
- if (!widgetEvents.all.has(WidgetEvent.RouteContactSupport)) {
10
+ if (!widgetEvents.all.has(WidgetEvent.ContactSupport)) {
11
11
  const url = 'https://discord.gg/lifi';
12
12
  const target = '_blank';
13
13
  const rel = 'nofollow noreferrer';
14
14
  window.open(url, target, rel);
15
15
  }
16
16
  else {
17
- widgetEvents.emit(WidgetEvent.RouteContactSupport, { supportId });
17
+ widgetEvents.emit(WidgetEvent.ContactSupport, { supportId });
18
18
  }
19
19
  };
20
20
  return (_jsx(Button, { onClick: handleClick, fullWidth: true, children: t('button.contactSupport') }));
@@ -1,62 +1,67 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import ContentCopyIcon from '@mui/icons-material/ContentCopyRounded';
3
- import DeleteIcon from '@mui/icons-material/DeleteOutline';
4
- import { Box, Button, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton, Typography, } from '@mui/material';
5
- import { useCallback, useEffect, useState } from 'react';
3
+ import { Box, IconButton, Typography } from '@mui/material';
4
+ import { useEffect, useMemo } from 'react';
6
5
  import { useTranslation } from 'react-i18next';
7
6
  import { useLocation } from 'react-router-dom';
8
- import { shallow } from 'zustand/shallow';
9
7
  import { Card, CardTitle } from '../../components/Card';
10
8
  import { ContractComponent } from '../../components/ContractComponent';
11
- import { Dialog } from '../../components/Dialog';
12
9
  import { Insurance } from '../../components/Insurance';
13
10
  import { getStepList } from '../../components/Step';
14
- import { useNavigateBack } from '../../hooks';
11
+ import { useNavigateBack, useTools, useTransactionDetails } from '../../hooks';
15
12
  import { useWidgetConfig } from '../../providers';
16
- import { useHeaderStoreContext, useRouteExecutionStore } from '../../stores';
17
- import { formatTokenAmount } from '../../utils';
13
+ import { getSourceTxHash, useRouteExecutionStore } from '../../stores';
14
+ import { formatTokenAmount, navigationRoutes } from '../../utils';
15
+ import { buildRouteFromTxHistory } from '../../utils/converters';
18
16
  import { ContactSupportButton } from './ContactSupportButton';
19
17
  import { Container } from './TransactionDetailsPage.style';
18
+ import { TransactionDetailsSkeleton } from './TransactionDetailsSkeleton';
20
19
  export const TransactionDetailsPage = () => {
21
20
  const { t, i18n } = useTranslation();
22
- const { navigateBack } = useNavigateBack();
21
+ const { navigate } = useNavigateBack();
23
22
  const { subvariant, contractComponent, contractSecondaryComponent } = useWidgetConfig();
24
23
  const { state } = useLocation();
25
- const [routeExecution, deleteRoute] = useRouteExecutionStore((store) => [store.routes[state?.routeId], store.deleteRoute], shallow);
26
- const headerStoreContext = useHeaderStoreContext();
27
- const [open, setOpen] = useState(false);
28
- const toggleDialog = useCallback(() => {
29
- setOpen((open) => !open);
30
- }, []);
31
- const handleDeleteRoute = () => {
32
- navigateBack();
33
- if (routeExecution) {
34
- deleteRoute(routeExecution.route.id);
24
+ const { tools } = useTools();
25
+ const storedRouteExecution = useRouteExecutionStore((store) => store.routes[state?.routeId]);
26
+ const { transaction, isLoading } = useTransactionDetails(state?.transactionHash);
27
+ const routeExecution = useMemo(() => {
28
+ if (storedRouteExecution) {
29
+ return storedRouteExecution;
35
30
  }
31
+ if (isLoading) {
32
+ return;
33
+ }
34
+ if (transaction) {
35
+ const routeExecution = buildRouteFromTxHistory(transaction, tools);
36
+ return routeExecution;
37
+ }
38
+ }, [isLoading, storedRouteExecution, tools, transaction]);
39
+ useEffect(() => {
40
+ if (!isLoading && !routeExecution) {
41
+ navigate(navigationRoutes.home);
42
+ }
43
+ }, [isLoading, navigate, routeExecution]);
44
+ const copySupportId = async () => {
45
+ await navigator.clipboard.writeText(supportId);
36
46
  };
37
- const sourceTxHash = routeExecution?.route.steps[0].execution?.process
38
- .filter((process) => process.type !== 'TOKEN_ALLOWANCE')
39
- .find((process) => process.txHash)?.txHash;
47
+ const sourceTxHash = getSourceTxHash(routeExecution?.route);
40
48
  const insuranceCoverageId = sourceTxHash ?? routeExecution?.route.fromAddress;
41
49
  let supportId = sourceTxHash ?? routeExecution?.route.id ?? '';
42
50
  if (process.env.NODE_ENV === 'development') {
43
51
  supportId += `_${routeExecution?.route.id}`;
44
52
  }
45
- const copySupportId = async () => {
46
- await navigator.clipboard.writeText(supportId);
47
- };
48
- useEffect(() => {
49
- return headerStoreContext.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteIcon, {}) }));
50
- }, [headerStoreContext, toggleDialog]);
51
- const startedAt = new Date(routeExecution?.route.steps[0].execution?.process[0].startedAt ?? 0);
52
- return (_jsxs(Container, { children: [_jsxs(Box, { sx: {
53
+ const startedAt = new Date((routeExecution?.route.steps[0].execution?.process[0].startedAt ?? 0) *
54
+ (storedRouteExecution ? 1 : 1000));
55
+ return isLoading && !storedRouteExecution ? (_jsx(TransactionDetailsSkeleton, {})) : (_jsxs(Container, { children: [_jsxs(Box, { sx: {
53
56
  display: 'flex',
54
57
  flex: 1,
55
58
  justifyContent: 'space-between',
56
- }, pb: 1, children: [_jsx(Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) }), _jsx(Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, {
59
+ }, pb: 1, children: [_jsx(Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, {
60
+ dateStyle: 'long',
61
+ }).format(startedAt) }), _jsx(Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, {
57
62
  timeStyle: 'short',
58
- }).format(startedAt) })] }), getStepList(routeExecution?.route, subvariant), subvariant === 'nft' ? (_jsx(ContractComponent, { mt: 2, children: contractSecondaryComponent || contractComponent })) : null, routeExecution?.route?.insurance?.state === 'INSURED' ? (_jsx(Insurance, { mt: 2, status: routeExecution.status, feeAmountUsd: routeExecution.route.insurance.feeAmountUsd, insuredAmount: formatTokenAmount(routeExecution.route.toAmountMin, routeExecution.route.toToken.decimals), insuredTokenSymbol: routeExecution.route.toToken.symbol, insurableRouteId: routeExecution.route.id, insuranceCoverageId: insuranceCoverageId })) : null, _jsxs(Card, { mt: 2, children: [_jsxs(Box, { sx: {
63
+ }).format(startedAt) })] }), getStepList(routeExecution?.route, subvariant), subvariant === 'nft' ? (_jsx(ContractComponent, { mt: 2, children: contractSecondaryComponent || contractComponent })) : null, routeExecution?.route?.insurance?.state === 'INSURED' ? (_jsx(Insurance, { mt: 2, status: routeExecution.status, feeAmountUsd: routeExecution.route.insurance.feeAmountUsd, insuredAmount: formatTokenAmount(BigInt(routeExecution.route.toAmountMin), routeExecution.route.toToken.decimals), insuredTokenSymbol: routeExecution.route.toToken.symbol, insurableRouteId: routeExecution.route.id, insuranceCoverageId: insuranceCoverageId })) : null, _jsxs(Card, { mt: 2, children: [_jsxs(Box, { sx: {
59
64
  display: 'flex',
60
65
  flex: 1,
61
- }, children: [_jsx(CardTitle, { flex: 1, children: t('main.supportId') }), _jsx(Box, { mr: 1, mt: 1, children: _jsx(IconButton, { size: "medium", onClick: copySupportId, children: _jsx(ContentCopyIcon, { fontSize: "small" }) }) })] }), _jsx(Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), _jsx(Box, { mt: 2, children: _jsx(ContactSupportButton, { supportId: supportId }) }), _jsxs(Dialog, { open: open, onClose: toggleDialog, children: [_jsx(DialogTitle, { children: t('warning.title.deleteTransaction') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('warning.message.deleteTransactionHistory') }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: toggleDialog, children: t('button.cancel') }), _jsx(Button, { variant: "contained", onClick: handleDeleteRoute, autoFocus: true, children: t('button.delete') })] })] })] }));
66
+ }, children: [_jsx(CardTitle, { flex: 1, children: t('main.supportId') }), _jsx(Box, { mr: 1, mt: 1, children: _jsx(IconButton, { size: "medium", onClick: copySupportId, children: _jsx(ContentCopyIcon, { fontSize: "small" }) }) })] }), _jsx(Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), _jsx(Box, { mt: 2, mb: 2.5, children: _jsx(ContactSupportButton, { supportId: supportId }) })] }));
62
67
  };
@@ -0,0 +1 @@
1
+ export declare const TransactionDetailsSkeleton: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Container, Skeleton } from '@mui/material';
3
+ import { Card } from '../../components/Card';
4
+ const DetailedTextSkeleton = () => {
5
+ return (_jsxs(Box, { display: "flex", ml: 6, children: [_jsx(Skeleton, { width: 64, height: 16, variant: "text" }), _jsx(Skeleton, { width: 96, height: 16, variant: "text", sx: { marginLeft: 0.5 } })] }));
6
+ };
7
+ const TransactionDetailsTokenSkeleton = () => {
8
+ return (_jsxs(Box, { py: 1, children: [_jsxs(Box, { display: "flex", flex: 1, alignItems: "center", children: [_jsx(Skeleton, { variant: "rounded", width: 32, height: 32, sx: {
9
+ borderRadius: '100%',
10
+ } }), _jsx(Box, { display: "flex", flexDirection: "column", flex: 1, ml: 2, children: _jsx(Skeleton, { width: 64, height: 32, variant: "text" }) })] }), _jsx(DetailedTextSkeleton, {})] }));
11
+ };
12
+ export const TransactionDetailsSkeleton = () => {
13
+ return (_jsxs(Container, { children: [_jsxs(Box, { sx: {
14
+ display: 'flex',
15
+ flex: 1,
16
+ justifyContent: 'space-between',
17
+ }, pb: 1, pt: 0.75, children: [_jsx(Skeleton, { width: 96, height: 20, variant: "text" }), _jsx(Skeleton, { width: 40, height: 20, variant: "text" })] }), _jsxs(Card, { mb: 3, variant: "default", sx: { paddingX: 2 }, children: [_jsx(Box, { pt: 2.5, children: _jsx(Skeleton, { width: 64, height: 12, variant: "rounded" }) }), _jsxs(Box, { py: 1, children: [_jsx(TransactionDetailsTokenSkeleton, {}), _jsxs(Box, { py: 1, children: [_jsxs(Box, { display: "flex", flex: 1, alignItems: "center", children: [_jsx(Skeleton, { variant: "rounded", width: 32, height: 32, sx: {
18
+ borderRadius: '100%',
19
+ } }), _jsx(Box, { display: "flex", flexDirection: "column", flex: 1, ml: 2, children: _jsx(Skeleton, { width: 96, height: 32, variant: "text" }) })] }), _jsx(DetailedTextSkeleton, {}), _jsx(DetailedTextSkeleton, {})] }), Array.from({ length: 3 }).map((_, key) => (_jsxs(Box, { sx: {
20
+ display: 'flex',
21
+ alignItems: 'center',
22
+ }, py: 1, children: [_jsx(Skeleton, { variant: "rounded", width: 32, height: 32, sx: {
23
+ borderRadius: '100%',
24
+ } }), _jsx(Skeleton, { sx: {
25
+ ml: 2,
26
+ }, width: 96, height: 32, variant: "text" })] }, key))), _jsx(TransactionDetailsTokenSkeleton, {})] })] })] }));
27
+ };
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
- import type { Route } from '@lifi/sdk';
2
+ import type { StatusResponse } from '@lifi/sdk';
3
3
  export declare const TransactionHistoryItem: React.FC<{
4
- route: Route;
4
+ transaction: StatusResponse;
5
+ size: number;
6
+ start: number;
5
7
  }>;
@@ -5,21 +5,48 @@ import { useNavigate } from 'react-router-dom';
5
5
  import { Card } from '../../components/Card';
6
6
  import { Token, TokenDivider } from '../../components/Token';
7
7
  import { navigationRoutes } from '../../utils';
8
- export const TransactionHistoryItem = ({ route }) => {
8
+ export const TransactionHistoryItem = ({ transaction, size, start }) => {
9
9
  const { i18n } = useTranslation();
10
10
  const navigate = useNavigate();
11
+ const sending = transaction.sending;
12
+ const receiving = transaction.receiving;
11
13
  const handleClick = () => {
12
14
  navigate(navigationRoutes.transactionDetails, {
13
- state: { routeId: route.id },
15
+ state: {
16
+ transactionHash: transaction.sending.txHash,
17
+ },
14
18
  });
15
19
  };
16
- const startedAt = new Date(route.steps[0].execution?.process[0].startedAt ?? 0);
17
- const fromToken = { ...route.fromToken, amount: route.fromAmount };
20
+ const startedAt = new Date((sending.timestamp ?? 0) * 1000);
21
+ if (!sending.token?.chainId || !receiving.token?.chainId) {
22
+ return null;
23
+ }
24
+ const fromToken = {
25
+ ...sending.token,
26
+ amount: BigInt(sending.amount ?? '0'),
27
+ priceUSD: sending.token.priceUSD ?? '0',
28
+ symbol: sending.token?.symbol ?? '',
29
+ decimals: sending.token?.decimals ?? 0,
30
+ name: sending.token?.name ?? '',
31
+ chainId: sending.token?.chainId,
32
+ };
18
33
  const toToken = {
19
- ...(route.steps.at(-1)?.execution?.toToken ?? route.toToken),
20
- amount: route.steps.at(-1)?.execution?.toAmount ?? route.toAmount,
34
+ ...receiving.token,
35
+ amount: BigInt(receiving.amount ?? '0'),
36
+ priceUSD: receiving.token.priceUSD ?? '0',
37
+ symbol: receiving.token?.symbol ?? '',
38
+ decimals: receiving.token?.decimals ?? 0,
39
+ name: receiving.token?.name ?? '',
40
+ chainId: receiving.token?.chainId,
21
41
  };
22
- return (_jsxs(Card, { onClick: handleClick, children: [_jsxs(Box, { sx: {
42
+ return (_jsxs(Card, { onClick: handleClick, style: {
43
+ position: 'absolute',
44
+ top: 0,
45
+ left: 0,
46
+ width: '100%',
47
+ // height: `${size}px`,
48
+ transform: `translateY(${start}px)`,
49
+ }, children: [_jsxs(Box, { sx: {
23
50
  display: 'flex',
24
51
  flex: 1,
25
52
  justifyContent: 'space-between',