@lifi/widget 3.12.6-alpha.0 → 3.13.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 (278) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/esm/AppProvider.js +9 -2
  3. package/dist/esm/AppProvider.js.map +1 -1
  4. package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js +15 -3
  5. package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js.map +1 -1
  6. package/dist/esm/components/ActiveTransactions/ActiveTransactions.js +4 -1
  7. package/dist/esm/components/ActiveTransactions/ActiveTransactions.js.map +1 -1
  8. package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +4 -6
  9. package/dist/esm/components/AlertMessage/AlertMessage.style.js +29 -12
  10. package/dist/esm/components/AlertMessage/AlertMessage.style.js.map +1 -1
  11. package/dist/esm/components/AmountInput/AmountInput.js +7 -1
  12. package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
  13. package/dist/esm/components/AmountInput/AmountInput.style.d.ts +1 -1
  14. package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
  15. package/dist/esm/components/AmountInput/PriceFormHelperText.js +13 -2
  16. package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
  17. package/dist/esm/components/AppContainer.d.ts +1 -1
  18. package/dist/esm/components/AppContainer.js +34 -21
  19. package/dist/esm/components/AppContainer.js.map +1 -1
  20. package/dist/esm/components/Avatar/Avatar.style.d.ts +4 -2
  21. package/dist/esm/components/Avatar/Avatar.style.js +8 -6
  22. package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
  23. package/dist/esm/components/Avatar/SmallAvatar.d.ts +1 -1
  24. package/dist/esm/components/ButtonTertiary.d.ts +1 -1
  25. package/dist/esm/components/Card/Card.js +60 -33
  26. package/dist/esm/components/Card/Card.js.map +1 -1
  27. package/dist/esm/components/Card/CardHeader.d.ts +1 -1
  28. package/dist/esm/components/Card/CardLabel.js +46 -29
  29. package/dist/esm/components/Card/CardLabel.js.map +1 -1
  30. package/dist/esm/components/Card/CardTitle.js +12 -2
  31. package/dist/esm/components/Card/CardTitle.js.map +1 -1
  32. package/dist/esm/components/Card/InputCard.d.ts +1 -1
  33. package/dist/esm/components/ChainSelect/ChainSelect.js +3 -1
  34. package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
  35. package/dist/esm/components/ContractComponent/ItemPrice.js +2 -1
  36. package/dist/esm/components/ContractComponent/ItemPrice.js.map +1 -1
  37. package/dist/esm/components/ContractComponent/NFT/NFT.js +2 -1
  38. package/dist/esm/components/ContractComponent/NFT/NFT.js.map +1 -1
  39. package/dist/esm/components/ContractComponent/NFT/NFT.style.d.ts +1 -1
  40. package/dist/esm/components/ContractComponent/NFT/NFTBase.js +16 -1
  41. package/dist/esm/components/ContractComponent/NFT/NFTBase.js.map +1 -1
  42. package/dist/esm/components/FeeBreakdownTooltip.js +7 -2
  43. package/dist/esm/components/FeeBreakdownTooltip.js.map +1 -1
  44. package/dist/esm/components/GasMessage/FundsSufficiencyMessage.js +4 -1
  45. package/dist/esm/components/GasMessage/FundsSufficiencyMessage.js.map +1 -1
  46. package/dist/esm/components/GasMessage/GasMessage.style.js +8 -6
  47. package/dist/esm/components/GasMessage/GasMessage.style.js.map +1 -1
  48. package/dist/esm/components/GasMessage/GasRefuelMessage.js +11 -1
  49. package/dist/esm/components/GasMessage/GasRefuelMessage.js.map +1 -1
  50. package/dist/esm/components/GasMessage/GasSufficiencyMessage.js +9 -1
  51. package/dist/esm/components/GasMessage/GasSufficiencyMessage.js.map +1 -1
  52. package/dist/esm/components/Header/Header.style.d.ts +2 -2
  53. package/dist/esm/components/Header/NavigationHeader.js +11 -2
  54. package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
  55. package/dist/esm/components/Header/SettingsButton.style.d.ts +1 -1
  56. package/dist/esm/components/Header/WalletMenu.js +12 -3
  57. package/dist/esm/components/Header/WalletMenu.js.map +1 -1
  58. package/dist/esm/components/IconTypography.js +4 -3
  59. package/dist/esm/components/IconTypography.js.map +1 -1
  60. package/dist/esm/components/ListItem/ListItem.d.ts +2 -4
  61. package/dist/esm/components/ListItem/ListItemButton.d.ts +1 -1
  62. package/dist/esm/components/ListItemButton.d.ts +1 -1
  63. package/dist/esm/components/ListItemButton.js +14 -3
  64. package/dist/esm/components/ListItemButton.js.map +1 -1
  65. package/dist/esm/components/NotFound.js +11 -1
  66. package/dist/esm/components/NotFound.js.map +1 -1
  67. package/dist/esm/components/PageContainer.d.ts +1 -1
  68. package/dist/esm/components/PageContainer.js +10 -4
  69. package/dist/esm/components/PageContainer.js.map +1 -1
  70. package/dist/esm/components/PoweredBy/PoweredBy.js +14 -2
  71. package/dist/esm/components/PoweredBy/PoweredBy.js.map +1 -1
  72. package/dist/esm/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  73. package/dist/esm/components/ProgressToNextUpdate.js +8 -6
  74. package/dist/esm/components/ProgressToNextUpdate.js.map +1 -1
  75. package/dist/esm/components/RouteCard/RouteCard.js +9 -3
  76. package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
  77. package/dist/esm/components/RouteCard/RouteCardEssentials.js +28 -2
  78. package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
  79. package/dist/esm/components/RouteCard/RouteCardEssentialsExpanded.js +20 -1
  80. package/dist/esm/components/RouteCard/RouteCardEssentialsExpanded.js.map +1 -1
  81. package/dist/esm/components/RouteCard/RouteCardSkeleton.js +12 -2
  82. package/dist/esm/components/RouteCard/RouteCardSkeleton.js.map +1 -1
  83. package/dist/esm/components/RouteCard/RouteNotFoundCard.js +12 -1
  84. package/dist/esm/components/RouteCard/RouteNotFoundCard.js.map +1 -1
  85. package/dist/esm/components/Routes/Routes.js +12 -3
  86. package/dist/esm/components/Routes/Routes.js.map +1 -1
  87. package/dist/esm/components/Routes/RoutesExpanded.js +14 -4
  88. package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
  89. package/dist/esm/components/Select.js +16 -5
  90. package/dist/esm/components/Select.js.map +1 -1
  91. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
  92. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js +34 -8
  93. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
  94. package/dist/esm/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  95. package/dist/esm/components/SendToWallet/SendToWallet.style.js +28 -7
  96. package/dist/esm/components/SendToWallet/SendToWallet.style.js.map +1 -1
  97. package/dist/esm/components/SendToWallet/SendToWalletButton.js +9 -2
  98. package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
  99. package/dist/esm/components/SettingsListItemButton.d.ts +1 -1
  100. package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +3 -3
  101. package/dist/esm/components/Step/DestinationWalletAddress.js +10 -2
  102. package/dist/esm/components/Step/DestinationWalletAddress.js.map +1 -1
  103. package/dist/esm/components/Step/Step.js +5 -3
  104. package/dist/esm/components/Step/Step.js.map +1 -1
  105. package/dist/esm/components/Step/StepProcess.js +16 -3
  106. package/dist/esm/components/Step/StepProcess.js.map +1 -1
  107. package/dist/esm/components/Step/StepTimer.js +5 -1
  108. package/dist/esm/components/Step/StepTimer.js.map +1 -1
  109. package/dist/esm/components/StepActions/StepActions.js +22 -3
  110. package/dist/esm/components/StepActions/StepActions.js.map +1 -1
  111. package/dist/esm/components/StepActions/StepActions.style.d.ts +1 -1
  112. package/dist/esm/components/StepActions/StepActions.style.js +19 -10
  113. package/dist/esm/components/StepActions/StepActions.style.js.map +1 -1
  114. package/dist/esm/components/StepActions/StepFees.js +9 -1
  115. package/dist/esm/components/StepActions/StepFees.js.map +1 -1
  116. package/dist/esm/components/StepDivider/StepDivider.style.d.ts +1 -1
  117. package/dist/esm/components/Switch.js +12 -7
  118. package/dist/esm/components/Switch.js.map +1 -1
  119. package/dist/esm/components/Tabs/Tabs.style.js +16 -12
  120. package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
  121. package/dist/esm/components/ToAddressRequiredMessage.js +4 -1
  122. package/dist/esm/components/ToAddressRequiredMessage.js.map +1 -1
  123. package/dist/esm/components/Token/Token.js +47 -6
  124. package/dist/esm/components/Token/Token.js.map +1 -1
  125. package/dist/esm/components/Token/Token.style.js +14 -7
  126. package/dist/esm/components/Token/Token.style.js.map +1 -1
  127. package/dist/esm/components/TokenList/TokenList.style.d.ts +3 -5
  128. package/dist/esm/components/TokenList/TokenListItem.js +21 -4
  129. package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
  130. package/dist/esm/components/TokenList/VirtualizedTokenList.js +8 -1
  131. package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
  132. package/dist/esm/components/TransactionDetails.js +52 -6
  133. package/dist/esm/components/TransactionDetails.js.map +1 -1
  134. package/dist/esm/config/version.d.ts +1 -1
  135. package/dist/esm/config/version.js +1 -1
  136. package/dist/esm/config/version.js.map +1 -1
  137. package/dist/esm/hooks/useGasRefuel.js +6 -9
  138. package/dist/esm/hooks/useGasRefuel.js.map +1 -1
  139. package/dist/esm/hooks/useIsContractAddress.js.map +1 -1
  140. package/dist/esm/hooks/useRoutes.js +6 -4
  141. package/dist/esm/hooks/useRoutes.js.map +1 -1
  142. package/dist/esm/i18n/en.json +5 -1
  143. package/dist/esm/index.d.ts +1 -1
  144. package/dist/esm/index.js +1 -1
  145. package/dist/esm/index.js.map +1 -1
  146. package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.js +11 -1
  147. package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.js.map +1 -1
  148. package/dist/esm/pages/MainPage/MainPage.js +6 -1
  149. package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
  150. package/dist/esm/pages/MainPage/MainPage.style.d.ts +1 -1
  151. package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +8 -1
  152. package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
  153. package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js +4 -1
  154. package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
  155. package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +4 -1
  156. package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
  157. package/dist/esm/pages/SendToWallet/EmptyListIndicator.js +5 -1
  158. package/dist/esm/pages/SendToWallet/EmptyListIndicator.js.map +1 -1
  159. package/dist/esm/pages/SendToWallet/SendToWalletPage.js +7 -1
  160. package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
  161. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +4 -4
  162. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js +6 -6
  163. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
  164. package/dist/esm/pages/SettingsPage/ResetSettingsButton.js +9 -2
  165. package/dist/esm/pages/SettingsPage/ResetSettingsButton.js.map +1 -1
  166. package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
  167. package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -1
  168. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +7 -2
  169. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
  170. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +4 -3
  171. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
  172. package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +10 -3
  173. package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
  174. package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +16 -3
  175. package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js.map +1 -1
  176. package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js +6 -1
  177. package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js.map +1 -1
  178. package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryEmpty.js +11 -1
  179. package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryEmpty.js.map +1 -1
  180. package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryItem.js +14 -2
  181. package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryItem.js.map +1 -1
  182. package/dist/esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +10 -2
  183. package/dist/esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.js.map +1 -1
  184. package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js +35 -3
  185. package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
  186. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +12 -2
  187. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
  188. package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +45 -1
  189. package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
  190. package/dist/esm/pages/TransactionPage/TransactionPage.js +4 -1
  191. package/dist/esm/pages/TransactionPage/TransactionPage.js.map +1 -1
  192. package/dist/esm/types/widget.d.ts +2 -1
  193. package/package.json +10 -11
  194. package/src/AppProvider.tsx +16 -2
  195. package/src/components/ActiveTransactions/ActiveTransactionItem.tsx +16 -9
  196. package/src/components/ActiveTransactions/ActiveTransactions.tsx +7 -1
  197. package/src/components/AlertMessage/AlertMessage.style.tsx +30 -14
  198. package/src/components/AmountInput/AmountInput.tsx +9 -1
  199. package/src/components/AmountInput/PriceFormHelperText.tsx +12 -10
  200. package/src/components/AppContainer.tsx +34 -23
  201. package/src/components/Avatar/Avatar.style.tsx +8 -8
  202. package/src/components/Card/Card.tsx +60 -37
  203. package/src/components/Card/CardLabel.tsx +69 -43
  204. package/src/components/Card/CardTitle.tsx +12 -2
  205. package/src/components/ChainSelect/ChainSelect.tsx +7 -1
  206. package/src/components/ContractComponent/ItemPrice.tsx +8 -3
  207. package/src/components/ContractComponent/NFT/NFT.tsx +8 -3
  208. package/src/components/ContractComponent/NFT/NFTBase.tsx +33 -6
  209. package/src/components/FeeBreakdownTooltip.tsx +9 -3
  210. package/src/components/GasMessage/FundsSufficiencyMessage.tsx +7 -1
  211. package/src/components/GasMessage/GasMessage.style.ts +8 -8
  212. package/src/components/GasMessage/GasRefuelMessage.tsx +19 -6
  213. package/src/components/GasMessage/GasSufficiencyMessage.tsx +21 -3
  214. package/src/components/Header/NavigationHeader.tsx +23 -5
  215. package/src/components/Header/WalletMenu.tsx +18 -3
  216. package/src/components/IconTypography.ts +4 -4
  217. package/src/components/ListItemButton.tsx +21 -12
  218. package/src/components/NotFound.tsx +17 -6
  219. package/src/components/PageContainer.ts +19 -15
  220. package/src/components/PoweredBy/PoweredBy.tsx +16 -8
  221. package/src/components/ProgressToNextUpdate.tsx +8 -8
  222. package/src/components/RouteCard/RouteCard.tsx +14 -4
  223. package/src/components/RouteCard/RouteCardEssentials.tsx +38 -16
  224. package/src/components/RouteCard/RouteCardEssentialsExpanded.tsx +30 -11
  225. package/src/components/RouteCard/RouteCardSkeleton.tsx +19 -3
  226. package/src/components/RouteCard/RouteNotFoundCard.tsx +18 -7
  227. package/src/components/Routes/Routes.tsx +20 -6
  228. package/src/components/Routes/RoutesExpanded.tsx +25 -6
  229. package/src/components/Select.tsx +16 -6
  230. package/src/components/SelectTokenButton/SelectTokenButton.style.tsx +34 -8
  231. package/src/components/SendToWallet/SendToWallet.style.tsx +28 -7
  232. package/src/components/SendToWallet/SendToWalletButton.tsx +21 -5
  233. package/src/components/Step/DestinationWalletAddress.tsx +14 -2
  234. package/src/components/Step/Step.tsx +7 -3
  235. package/src/components/Step/StepProcess.tsx +18 -9
  236. package/src/components/Step/StepTimer.tsx +9 -5
  237. package/src/components/StepActions/StepActions.style.tsx +19 -13
  238. package/src/components/StepActions/StepActions.tsx +32 -10
  239. package/src/components/StepActions/StepFees.tsx +9 -4
  240. package/src/components/Switch.tsx +12 -9
  241. package/src/components/Tabs/Tabs.style.tsx +16 -16
  242. package/src/components/ToAddressRequiredMessage.tsx +7 -1
  243. package/src/components/Token/Token.style.tsx +14 -8
  244. package/src/components/Token/Token.tsx +75 -12
  245. package/src/components/TokenList/TokenListItem.tsx +37 -8
  246. package/src/components/TokenList/VirtualizedTokenList.tsx +8 -6
  247. package/src/components/TransactionDetails.tsx +75 -17
  248. package/src/config/version.ts +1 -1
  249. package/src/hooks/useGasRefuel.ts +6 -18
  250. package/src/hooks/useIsContractAddress.ts +1 -0
  251. package/src/hooks/useRoutes.ts +6 -4
  252. package/src/i18n/en.json +5 -1
  253. package/src/i18n/i18next.d.ts +4 -8
  254. package/src/index.ts +1 -1
  255. package/src/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.tsx +17 -6
  256. package/src/pages/MainPage/MainPage.tsx +16 -9
  257. package/src/pages/SelectTokenPage/SelectTokenPage.tsx +17 -3
  258. package/src/pages/SendToWallet/BookmarkAddressSheet.tsx +6 -1
  259. package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +6 -1
  260. package/src/pages/SendToWallet/EmptyListIndicator.tsx +7 -1
  261. package/src/pages/SendToWallet/SendToWalletPage.style.tsx +6 -9
  262. package/src/pages/SendToWallet/SendToWalletPage.tsx +17 -3
  263. package/src/pages/SettingsPage/ResetSettingsButton.style.tsx +0 -1
  264. package/src/pages/SettingsPage/ResetSettingsButton.tsx +18 -3
  265. package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +4 -5
  266. package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +11 -2
  267. package/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +16 -4
  268. package/src/pages/TransactionDetailsPage/TransactionDetailsSkeleton.tsx +29 -9
  269. package/src/pages/TransactionDetailsPage/TransferIdCard.tsx +6 -4
  270. package/src/pages/TransactionHistoryPage/TransactionHistoryEmpty.tsx +17 -6
  271. package/src/pages/TransactionHistoryPage/TransactionHistoryItem.tsx +24 -6
  272. package/src/pages/TransactionHistoryPage/TransactionHistorySkeleton.tsx +14 -4
  273. package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +70 -11
  274. package/src/pages/TransactionPage/StatusBottomSheet.tsx +27 -4
  275. package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +92 -15
  276. package/src/pages/TransactionPage/TransactionPage.tsx +6 -1
  277. package/src/types/widget.ts +2 -1
  278. package/tsconfig.json +4 -2
@@ -98,15 +98,36 @@ export const TokenBase: FC<TokenProps & BoxProps> = ({
98
98
  ) : null
99
99
 
100
100
  return (
101
- <Box flex={1} display="flex" alignItems="center" {...other}>
101
+ <Box
102
+ {...other}
103
+ sx={[
104
+ {
105
+ flex: 1,
106
+ display: 'flex',
107
+ alignItems: 'center',
108
+ },
109
+ ...(Array.isArray(other.sx) ? other.sx : [other.sx]),
110
+ ]}
111
+ >
102
112
  <TokenAvatar
103
113
  token={token}
104
114
  chain={chain}
105
115
  isLoading={isLoading}
106
116
  sx={{ marginRight: 2 }}
107
117
  />
108
- <Box flex={1}>
109
- <Box mb={0.5} height={24} display="flex" alignItems="center">
118
+ <Box
119
+ sx={{
120
+ flex: 1,
121
+ }}
122
+ >
123
+ <Box
124
+ sx={{
125
+ mb: 0.5,
126
+ height: 24,
127
+ display: 'flex',
128
+ alignItems: 'center',
129
+ }}
130
+ >
110
131
  <TextFitter
111
132
  height={30}
112
133
  textStyle={{
@@ -118,7 +139,7 @@ export const TokenBase: FC<TokenProps & BoxProps> = ({
118
139
  })}
119
140
  </TextFitter>
120
141
  </Box>
121
- <TextSecondaryContainer component="span">
142
+ <TextSecondaryContainer as="span">
122
143
  <TextSecondary>
123
144
  {t('format.currency', {
124
145
  value: tokenPrice,
@@ -175,7 +196,14 @@ const TokenStep: FC<PropsWithChildren<Partial<TokenProps>>> = ({
175
196
  children,
176
197
  }) => {
177
198
  return (
178
- <Box flex={1} position="relative" overflow="hidden" height={16}>
199
+ <Box
200
+ sx={{
201
+ flex: 1,
202
+ position: 'relative',
203
+ overflow: 'hidden',
204
+ height: 16,
205
+ }}
206
+ >
179
207
  <Grow
180
208
  in={!stepVisible && !disableDescription}
181
209
  style={{
@@ -184,7 +212,13 @@ const TokenStep: FC<PropsWithChildren<Partial<TokenProps>>> = ({
184
212
  appear={false}
185
213
  timeout={225}
186
214
  >
187
- <Box display="flex" alignItems="center" height={16}>
215
+ <Box
216
+ sx={{
217
+ display: 'flex',
218
+ alignItems: 'center',
219
+ height: 16,
220
+ }}
221
+ >
188
222
  {children as ReactElement}
189
223
  </Box>
190
224
  </Grow>
@@ -196,8 +230,19 @@ const TokenStep: FC<PropsWithChildren<Partial<TokenProps>>> = ({
196
230
  appear={false}
197
231
  timeout={225}
198
232
  >
199
- <Box display="flex" alignItems="center" height={16}>
200
- <Box mr={0.75} height={16}>
233
+ <Box
234
+ sx={{
235
+ display: 'flex',
236
+ alignItems: 'center',
237
+ height: 16,
238
+ }}
239
+ >
240
+ <Box
241
+ sx={{
242
+ mr: 0.75,
243
+ height: 16,
244
+ }}
245
+ >
201
246
  <SmallAvatar
202
247
  src={step?.toolDetails.logoURI}
203
248
  alt={step?.toolDetails.name}
@@ -218,12 +263,30 @@ export const TokenSkeleton: FC<Partial<TokenProps> & BoxProps> = ({
218
263
  ...other
219
264
  }) => {
220
265
  return (
221
- <Box flex={1} {...other}>
222
- <Box display="flex" flex={1} alignItems="center">
266
+ <Box
267
+ {...other}
268
+ sx={[
269
+ {
270
+ flex: 1,
271
+ },
272
+ ...(Array.isArray(other.sx) ? other.sx : [other.sx]),
273
+ ]}
274
+ >
275
+ <Box
276
+ sx={{
277
+ display: 'flex',
278
+ flex: 1,
279
+ alignItems: 'center',
280
+ }}
281
+ >
223
282
  <AvatarBadgedSkeleton sx={{ marginRight: 2 }} />
224
- <Box flex={1}>
283
+ <Box
284
+ sx={{
285
+ flex: 1,
286
+ }}
287
+ >
225
288
  <Skeleton width={112} height={24} variant="text" />
226
- <TextSecondaryContainer component="span">
289
+ <TextSecondaryContainer as="span">
227
290
  <Skeleton
228
291
  width={48}
229
292
  height={12}
@@ -112,7 +112,13 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
112
112
  component: 'div',
113
113
  }}
114
114
  secondary={
115
- <Box position="relative" height={20} ref={container}>
115
+ <Box
116
+ ref={container}
117
+ sx={{
118
+ position: 'relative',
119
+ height: 20,
120
+ }}
121
+ >
116
122
  <Slide
117
123
  direction="down"
118
124
  in={!showAddress}
@@ -122,7 +128,13 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
122
128
  }}
123
129
  appear={false}
124
130
  >
125
- <Box pt={0.25}>{token.name}</Box>
131
+ <Box
132
+ sx={{
133
+ pt: 0.25,
134
+ }}
135
+ >
136
+ {token.name}
137
+ </Box>
126
138
  </Slide>
127
139
  <Slide
128
140
  direction="up"
@@ -134,8 +146,18 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
134
146
  appear={false}
135
147
  mountOnEnter
136
148
  >
137
- <Box display="flex">
138
- <Box display="flex" alignItems="center" pt={0.125}>
149
+ <Box
150
+ sx={{
151
+ display: 'flex',
152
+ }}
153
+ >
154
+ <Box
155
+ sx={{
156
+ display: 'flex',
157
+ alignItems: 'center',
158
+ pt: 0.125,
159
+ }}
160
+ >
139
161
  {shortenAddress(tokenAddress)}
140
162
  </Box>
141
163
  <IconButton
@@ -159,7 +181,12 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
159
181
  ) : (
160
182
  <Box sx={{ textAlign: 'right' }}>
161
183
  {token.amount ? (
162
- <Typography fontWeight={600} noWrap>
184
+ <Typography
185
+ noWrap
186
+ sx={{
187
+ fontWeight: 600,
188
+ }}
189
+ >
163
190
  {t('format.number', {
164
191
  value: formatTokenAmount(token.amount, token.decimals),
165
192
  })}
@@ -167,10 +194,12 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
167
194
  ) : null}
168
195
  {tokenPrice ? (
169
196
  <Typography
170
- fontWeight={500}
171
- fontSize={12}
172
- color="text.secondary"
173
197
  data-price={token.priceUSD}
198
+ sx={{
199
+ fontWeight: 500,
200
+ fontSize: 12,
201
+ color: 'text.secondary',
202
+ }}
174
203
  >
175
204
  {t('format.currency', {
176
205
  value: tokenPrice,
@@ -131,12 +131,14 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
131
131
  startAdornment={
132
132
  startAdornmentLabel ? (
133
133
  <Typography
134
- fontSize={14}
135
- fontWeight={600}
136
- lineHeight="16px"
137
- px={1.5}
138
- pt={isFirstFeaturedToken ? 0 : 1}
139
- pb={1}
134
+ sx={{
135
+ fontSize: 14,
136
+ fontWeight: 600,
137
+ lineHeight: '16px',
138
+ px: 1.5,
139
+ pt: isFirstFeaturedToken ? 0 : 1,
140
+ pb: 1,
141
+ }}
140
142
  >
141
143
  {startAdornmentLabel}
142
144
  </Typography>
@@ -71,30 +71,48 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
71
71
 
72
72
  return (
73
73
  <Card selectionColor="secondary" {...props}>
74
- <Box display="flex" alignItems="center" px={2} py={1.75}>
75
- <Box display="flex" flex={1} alignItems="center" justifyContent="left">
74
+ <Box
75
+ sx={{
76
+ display: 'flex',
77
+ alignItems: 'center',
78
+ px: 2,
79
+ py: 1.75,
80
+ }}
81
+ >
82
+ <Box
83
+ sx={{
84
+ display: 'flex',
85
+ flex: 1,
86
+ alignItems: 'center',
87
+ justifyContent: 'left',
88
+ }}
89
+ >
76
90
  <TokenRate route={route} />
77
91
  </Box>
78
92
  <Collapse timeout={100} in={!cardExpanded} mountOnEnter>
79
93
  <FeeBreakdownTooltip gasCosts={gasCosts} feeCosts={feeCosts}>
80
94
  <Box
81
- display="flex"
82
- alignItems="center"
83
95
  onClick={toggleCard}
84
96
  // biome-ignore lint/a11y/useSemanticElements:
85
97
  role="button"
86
- sx={{ cursor: 'pointer' }}
87
- px={1}
98
+ sx={{
99
+ display: 'flex',
100
+ alignItems: 'center',
101
+ px: 1,
102
+ cursor: 'pointer',
103
+ }}
88
104
  >
89
105
  <IconTypography mr={0.5} fontSize={16}>
90
106
  <LocalGasStationRounded fontSize="inherit" />
91
107
  </IconTypography>
92
108
  <Typography
93
- fontSize={14}
94
- color="text.primary"
95
- fontWeight="600"
96
- lineHeight={1.429}
97
109
  data-value={combinedFeesUSD}
110
+ sx={{
111
+ fontSize: 14,
112
+ color: 'text.primary',
113
+ fontWeight: '600',
114
+ lineHeight: 1.429,
115
+ }}
98
116
  >
99
117
  {t('format.currency', { value: combinedFeesUSD })}
100
118
  </Typography>
@@ -110,8 +128,19 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
110
128
  </CardIconButton>
111
129
  </Box>
112
130
  <Collapse timeout={225} in={cardExpanded} mountOnEnter>
113
- <Box px={2} pb={2}>
114
- <Box display="flex" justifyContent="space-between" mb={0.5}>
131
+ <Box
132
+ sx={{
133
+ px: 2,
134
+ pb: 2,
135
+ }}
136
+ >
137
+ <Box
138
+ sx={{
139
+ display: 'flex',
140
+ justifyContent: 'space-between',
141
+ mb: 0.5,
142
+ }}
143
+ >
115
144
  <Typography variant="body2">{t('main.fees.network')}</Typography>
116
145
  <FeeBreakdownTooltip gasCosts={gasCosts}>
117
146
  <Typography variant="body2">
@@ -122,7 +151,13 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
122
151
  </FeeBreakdownTooltip>
123
152
  </Box>
124
153
  {feeCosts.length ? (
125
- <Box display="flex" justifyContent="space-between" mb={0.5}>
154
+ <Box
155
+ sx={{
156
+ display: 'flex',
157
+ justifyContent: 'space-between',
158
+ mb: 0.5,
159
+ }}
160
+ >
126
161
  <Typography variant="body2">{t('main.fees.provider')}</Typography>
127
162
  <FeeBreakdownTooltip feeCosts={feeCosts}>
128
163
  <Typography variant="body2">
@@ -134,7 +169,13 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
134
169
  </Box>
135
170
  ) : null}
136
171
  {showIntegratorFeeCollectionDetails ? (
137
- <Box display="flex" justifyContent="space-between" mb={0.5}>
172
+ <Box
173
+ sx={{
174
+ display: 'flex',
175
+ justifyContent: 'space-between',
176
+ mb: 0.5,
177
+ }}
178
+ >
138
179
  <Typography variant="body2">
139
180
  {feeConfig?.name
140
181
  ? t('main.fees.integrator', { tool: feeConfig.name })
@@ -160,7 +201,13 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
160
201
  )}
161
202
  </Box>
162
203
  ) : null}
163
- <Box display="flex" justifyContent="space-between" mb={0.5}>
204
+ <Box
205
+ sx={{
206
+ display: 'flex',
207
+ justifyContent: 'space-between',
208
+ mb: 0.5,
209
+ }}
210
+ >
164
211
  <Typography variant="body2">{t('main.priceImpact')}</Typography>
165
212
  <Tooltip title={t('tooltip.priceImpact')} sx={{ cursor: 'help' }}>
166
213
  <Typography variant="body2">
@@ -170,7 +217,13 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
170
217
  </Box>
171
218
  {!isRouteDone(route) ? (
172
219
  <>
173
- <Box display="flex" justifyContent="space-between" mb={0.5}>
220
+ <Box
221
+ sx={{
222
+ display: 'flex',
223
+ justifyContent: 'space-between',
224
+ mb: 0.5,
225
+ }}
226
+ >
174
227
  <Typography variant="body2">{t('main.maxSlippage')}</Typography>
175
228
  <Tooltip title={t('tooltip.slippage')} sx={{ cursor: 'help' }}>
176
229
  <Typography variant="body2">
@@ -180,7 +233,12 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
180
233
  </Typography>
181
234
  </Tooltip>
182
235
  </Box>
183
- <Box display="flex" justifyContent="space-between">
236
+ <Box
237
+ sx={{
238
+ display: 'flex',
239
+ justifyContent: 'space-between',
240
+ }}
241
+ >
184
242
  <Typography variant="body2">{t('main.minReceived')}</Typography>
185
243
  <Tooltip
186
244
  title={t('tooltip.minReceived')}
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget'
2
- export const version = '3.12.6-alpha.0'
2
+ export const version = '3.13.0'
@@ -19,29 +19,18 @@ export const useGasRefuel = () => {
19
19
  const toChain = getChainById(toChainId)
20
20
  const fromChain = getChainById(fromChainId)
21
21
 
22
- const { accounts } = useAccount()
22
+ const { account: toAccount } = useAccount({ chainType: toChain?.chainType })
23
23
 
24
- const fromAccount = accounts.find(
25
- (account) => account.chainType === fromChain?.chainType
26
- )
27
-
28
- const toAccount = accounts.find(
29
- (account) => account.chainType === toChain?.chainType
30
- )
24
+ const effectiveToAddress = toAddress || toAccount?.address
31
25
 
32
- const isFromContractAddress = useIsContractAddress(
33
- fromAccount?.address,
34
- fromChainId,
35
- fromAccount?.chainType
36
- )
37
26
  const isToContractAddress = useIsContractAddress(
38
- toAddress,
27
+ effectiveToAddress,
39
28
  toChainId,
40
29
  toChain?.chainType
41
30
  )
42
31
 
43
32
  const { token: destinationNativeToken } = useTokenBalance(
44
- toAddress || toAccount?.address,
33
+ effectiveToAddress,
45
34
  toChainId ? toChain?.nativeToken : undefined
46
35
  )
47
36
 
@@ -55,9 +44,8 @@ export const useGasRefuel = () => {
55
44
  const isChainTypeSatisfied =
56
45
  fromChain?.chainType !== toChain?.chainType ? Boolean(toAddress) : true
57
46
 
58
- const isToAddressSatisfied = isFromContractAddress
59
- ? toAddress && toAddress !== fromAccount?.address && !isToContractAddress
60
- : true
47
+ // We should not refuel to the contract address
48
+ const isToAddressSatisfied = effectiveToAddress && !isToContractAddress
61
49
 
62
50
  const enabled = useMemo(() => {
63
51
  if (
@@ -16,6 +16,7 @@ export const useIsContractAddress = (
16
16
  enabled: Boolean(chainType === ChainType.EVM && chainId),
17
17
  },
18
18
  })
19
+
19
20
  const isContractAddress = !!contractCode
20
21
  return isContractAddress
21
22
  }
@@ -177,6 +177,7 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
177
177
  signal,
178
178
  }) => {
179
179
  const fromAmount = parseUnits(fromTokenAmount, fromToken!.decimals)
180
+ const toAmount = parseUnits(toTokenAmount, toToken!.decimals)
180
181
  const formattedSlippage = Number.parseFloat(slippage) / 100
181
182
 
182
183
  const allowBridges = swapOnly
@@ -210,17 +211,18 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
210
211
  fromAddress,
211
212
  toAddress,
212
213
  fromAmount,
214
+ toAmount,
213
215
  slippage: formattedSlippage,
214
216
  })
215
217
 
216
- if (subvariant === 'custom' && contractCalls && toTokenAmount) {
218
+ if (subvariant === 'custom' && contractCalls && toAmount) {
217
219
  const contractCallQuote = await getContractCallsQuote(
218
220
  {
219
221
  // Contract calls are enabled only when fromAddress is set
220
222
  fromAddress: fromAddress as string,
221
223
  fromChain: fromChainId,
222
224
  fromToken: fromTokenAddress,
223
- toAmount: toTokenAmount,
225
+ toAmount: toAmount.toString(),
224
226
  toChain: toChainId,
225
227
  toToken: toTokenAddress,
226
228
  contractCalls,
@@ -265,8 +267,8 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
265
267
  fromAddress: contractCallQuote.action.fromAddress,
266
268
  toChainId: contractCallQuote.action.toChainId,
267
269
  toAmountUSD: contractCallQuote.estimate.toAmountUSD || '',
268
- toAmount: toTokenAmount,
269
- toAmountMin: toTokenAmount,
270
+ toAmount: contractCallQuote.estimate.toAmount,
271
+ toAmountMin: contractCallQuote.estimate.toAmountMin,
270
272
  toToken: toToken!,
271
273
  toAddress:
272
274
  contractCallQuote.action.toAddress ||
package/src/i18n/en.json CHANGED
@@ -52,12 +52,14 @@
52
52
  },
53
53
  "header": {
54
54
  "activeTransactions": "Active transactions",
55
+ "amount": "Amount",
55
56
  "bookmarkedWallets": "Bookmarked wallets",
56
57
  "bridge": "Bridge",
57
58
  "checkout": "Checkout",
58
59
  "checkoutDetails": "Checkout details",
59
60
  "deposit": "Deposit",
60
61
  "depositDetails": "Deposit details",
62
+ "depositTo": "Deposit to",
61
63
  "exchange": "Exchange",
62
64
  "from": "Exchange from",
63
65
  "gas": "Gas",
@@ -265,13 +267,15 @@
265
267
  "stepBridge": "Bridge",
266
268
  "stepBridgeAndBuy": "Bridge and buy",
267
269
  "stepBridgeAndDeposit": "Bridge and deposit",
270
+ "stepBuy": "Buy",
271
+ "stepDeposit": "Deposit",
268
272
  "stepDetails": "{{tool}} via LI.FI",
269
273
  "stepSwap": "Swap",
270
274
  "stepSwapAndBridge": "Swap and bridge",
271
275
  "stepSwapAndBuy": "Swap and buy",
272
276
  "stepSwapAndDeposit": "Swap and deposit",
273
- "transferId": "Transfer ID",
274
277
  "swapStepDetails": "Swap on {{chain}} via {{tool}}",
278
+ "transferId": "Transfer ID",
275
279
  "tags": {
276
280
  "cheapest": "Best Return",
277
281
  "fastest": "Fastest"
@@ -2,13 +2,9 @@ import en from './en.json' with { type: 'json' }
2
2
 
3
3
  const defaultResource = { translation: en }
4
4
 
5
- declare global {
6
- namespace GeneralTranslation {
7
- declare module 'i18next' {
8
- interface CustomTypeOptions {
9
- defaultNS: 'translation'
10
- resources: typeof defaultResource
11
- }
12
- }
5
+ declare module 'i18next' {
6
+ interface CustomTypeOptions {
7
+ defaultNS: 'translation'
8
+ resources: typeof defaultResource
13
9
  }
14
10
  }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type * from '@lifi/sdk'
2
- export { ChainType, ChainId } from '@lifi/sdk'
2
+ export { ChainType, ChainId, CoinKey } from '@lifi/sdk'
3
3
  export { App as LiFiWidget } from './App.js'
4
4
  export type { WidgetDrawer } from './AppDrawer.js'
5
5
  export * from './components/ContractComponent/ItemPrice.js'
@@ -15,17 +15,28 @@ export const ActiveTransactionsEmpty: React.FC = () => {
15
15
  paddingY: 12,
16
16
  }}
17
17
  >
18
- <Typography fontSize={48}>
18
+ <Typography
19
+ sx={{
20
+ fontSize: 48,
21
+ }}
22
+ >
19
23
  <SwapHoriz fontSize="inherit" />
20
24
  </Typography>
21
- <Typography fontSize={18} fontWeight={700}>
25
+ <Typography
26
+ sx={{
27
+ fontSize: 18,
28
+ fontWeight: 700,
29
+ }}
30
+ >
22
31
  {t('info.title.emptyActiveTransactions')}
23
32
  </Typography>
24
33
  <Typography
25
- fontSize={14}
26
- color="text.secondary"
27
- textAlign="center"
28
- mt={2}
34
+ sx={{
35
+ fontSize: 14,
36
+ color: 'text.secondary',
37
+ textAlign: 'center',
38
+ mt: 2,
39
+ }}
29
40
  >
30
41
  {t('info.message.emptyActiveTransactions')}
31
42
  </Typography>
@@ -31,25 +31,32 @@ export const MainPage: React.FC = () => {
31
31
  : subvariant === 'refuel'
32
32
  ? t('header.gas')
33
33
  : t('header.exchange')
34
+
34
35
  useHeader(title)
35
36
 
37
+ const marginSx = { marginBottom: 2 }
38
+
36
39
  return (
37
40
  <PageContainer>
38
- <ActiveTransactions sx={{ marginBottom: 2 }} />
41
+ <ActiveTransactions sx={marginSx} />
39
42
  {custom ? (
40
- <ContractComponent sx={{ marginBottom: 2 }}>
41
- {contractComponent}
42
- </ContractComponent>
43
+ <ContractComponent sx={marginSx}>{contractComponent}</ContractComponent>
43
44
  ) : null}
44
45
  <SelectChainAndToken mb={2} />
45
- {!custom ? (
46
- <AmountInput formType="from" sx={{ marginBottom: 2 }} />
46
+ {!custom || subvariantOptions?.custom === 'deposit' ? (
47
+ <AmountInput formType="from" sx={marginSx} />
47
48
  ) : null}
48
- {!wideVariant ? <Routes sx={{ marginBottom: 2 }} /> : null}
49
- <SendToWalletButton sx={{ marginBottom: 2 }} />
49
+ {!wideVariant ? <Routes sx={marginSx} /> : null}
50
+ <SendToWalletButton sx={marginSx} />
50
51
  <GasRefuelMessage mb={2} />
51
52
  <MainMessages mb={2} />
52
- <Box display="flex" mb={showPoweredBy ? 1 : 3} gap={1.5}>
53
+ <Box
54
+ sx={{
55
+ display: 'flex',
56
+ mb: showPoweredBy ? 1 : 3,
57
+ gap: 1.5,
58
+ }}
59
+ >
53
60
  <ReviewButton />
54
61
  <SendToWalletExpandButton />
55
62
  </Box>
@@ -41,13 +41,27 @@ export const SelectTokenPage: FC<FormTypeProps> = ({ formType }) => {
41
41
 
42
42
  return (
43
43
  <FullPageContainer disableGutters>
44
- <Box pb={2} px={3} ref={headerRef}>
44
+ <Box
45
+ ref={headerRef}
46
+ sx={{
47
+ pb: 2,
48
+ px: 3,
49
+ }}
50
+ >
45
51
  {!hideChainSelect ? <ChainSelect formType={formType} /> : null}
46
- <Box mt={!hideChainSelect ? 2 : 0}>
52
+ <Box
53
+ sx={{
54
+ mt: !hideChainSelect ? 2 : 0,
55
+ }}
56
+ >
47
57
  <SearchTokenInput />
48
58
  </Box>
49
59
  </Box>
50
- <Box height={minListHeight}>
60
+ <Box
61
+ sx={{
62
+ height: minListHeight,
63
+ }}
64
+ >
51
65
  <TokenList
52
66
  parentRef={listParentRef}
53
67
  height={tokenListHeight}
@@ -148,7 +148,12 @@ export const BookmarkAddressSheet = forwardRef<
148
148
  {validatedWallet ? (
149
149
  <SheetAddressContainer>
150
150
  {validatedWallet?.name ? (
151
- <Typography fontWeight={600} mb={0.5}>
151
+ <Typography
152
+ sx={{
153
+ fontWeight: 600,
154
+ mb: 0.5,
155
+ }}
156
+ >
152
157
  {validatedWallet?.name}
153
158
  </Typography>
154
159
  ) : null}