@lifi/widget 3.30.0 → 3.30.2

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 (254) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/esm/AppProvider.d.ts +0 -1
  3. package/dist/esm/AppProvider.js +1 -1
  4. package/dist/esm/AppProvider.js.map +1 -1
  5. package/dist/esm/components/AmountInput/AmountInput.d.ts +0 -9
  6. package/dist/esm/components/AmountInput/AmountInput.js +1 -1
  7. package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
  8. package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +0 -1
  9. package/dist/esm/components/AmountInput/AmountInputAdornment.style.js +1 -6
  10. package/dist/esm/components/AmountInput/AmountInputAdornment.style.js.map +1 -1
  11. package/dist/esm/components/AmountInput/PriceFormHelperText.d.ts +0 -6
  12. package/dist/esm/components/AmountInput/PriceFormHelperText.js +1 -1
  13. package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
  14. package/dist/esm/components/Avatar/Avatar.d.ts +0 -4
  15. package/dist/esm/components/Avatar/Avatar.js +1 -1
  16. package/dist/esm/components/Avatar/Avatar.js.map +1 -1
  17. package/dist/esm/components/Avatar/TokenAvatar.d.ts +0 -15
  18. package/dist/esm/components/Avatar/TokenAvatar.js +2 -2
  19. package/dist/esm/components/Avatar/TokenAvatar.js.map +1 -1
  20. package/dist/esm/components/Card/CardButton.style.d.ts +0 -1
  21. package/dist/esm/components/Card/CardButton.style.js +0 -7
  22. package/dist/esm/components/Card/CardButton.style.js.map +1 -1
  23. package/dist/esm/components/FeeBreakdownTooltip.d.ts +2 -3
  24. package/dist/esm/components/FeeBreakdownTooltip.js +1 -1
  25. package/dist/esm/components/FeeBreakdownTooltip.js.map +1 -1
  26. package/dist/esm/components/Header/Header.d.ts +1 -2
  27. package/dist/esm/components/Header/Header.js +1 -1
  28. package/dist/esm/components/Header/Header.js.map +1 -1
  29. package/dist/esm/components/Header/WalletHeader.d.ts +0 -1
  30. package/dist/esm/components/Header/WalletHeader.js +1 -1
  31. package/dist/esm/components/Header/WalletHeader.js.map +1 -1
  32. package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
  33. package/dist/esm/components/StepActions/StepActions.d.ts +1 -10
  34. package/dist/esm/components/StepActions/StepActions.js +6 -6
  35. package/dist/esm/components/StepActions/StepActions.js.map +1 -1
  36. package/dist/esm/components/Tabs/Tabs.style.d.ts +0 -1
  37. package/dist/esm/components/Tabs/Tabs.style.js +1 -1
  38. package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
  39. package/dist/esm/components/Timer/TimerContent.js +1 -2
  40. package/dist/esm/components/Timer/TimerContent.js.map +1 -1
  41. package/dist/esm/components/Token/Token.d.ts +0 -2
  42. package/dist/esm/components/Token/Token.js +2 -2
  43. package/dist/esm/components/Token/Token.js.map +1 -1
  44. package/dist/esm/components/TokenList/TokenListItem.d.ts +1 -4
  45. package/dist/esm/components/TokenList/TokenListItem.js +3 -3
  46. package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
  47. package/dist/esm/components/TokenList/types.d.ts +2 -1
  48. package/dist/esm/components/TokenList/useTokenSelect.d.ts +0 -4
  49. package/dist/esm/components/TokenList/useTokenSelect.js +8 -3
  50. package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
  51. package/dist/esm/components/TokenRate/TokenRate.js +1 -3
  52. package/dist/esm/components/TokenRate/TokenRate.js.map +1 -1
  53. package/dist/esm/components/TransactionDetails.js.map +1 -1
  54. package/dist/esm/config/version.d.ts +1 -1
  55. package/dist/esm/config/version.js +1 -1
  56. package/dist/esm/hooks/timer/time.d.ts +0 -8
  57. package/dist/esm/hooks/timer/time.js.map +1 -1
  58. package/dist/esm/hooks/timer/useTimer.d.ts +3 -2
  59. package/dist/esm/hooks/useAccountsBalancesData.js +1 -1
  60. package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -1
  61. package/dist/esm/hooks/useAvailableChains.d.ts +2 -1
  62. package/dist/esm/hooks/useChain.d.ts +1 -1
  63. package/dist/esm/hooks/useChains.d.ts +1 -1
  64. package/dist/esm/hooks/useExplorer.d.ts +2 -1
  65. package/dist/esm/hooks/useFilteredByTokenBalances.d.ts +2 -1
  66. package/dist/esm/hooks/useFilteredByTokenBalances.js +12 -3
  67. package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -1
  68. package/dist/esm/hooks/useListHeight.d.ts +0 -2
  69. package/dist/esm/hooks/useListHeight.js +2 -2
  70. package/dist/esm/hooks/useListHeight.js.map +1 -1
  71. package/dist/esm/hooks/useRoutes.js +2 -2
  72. package/dist/esm/hooks/useRoutes.js.map +1 -1
  73. package/dist/esm/hooks/useToAddressAutoPopulate.d.ts +2 -1
  74. package/dist/esm/hooks/useToken.js +4 -3
  75. package/dist/esm/hooks/useToken.js.map +1 -1
  76. package/dist/esm/hooks/useTokenAddressBalance.d.ts +3 -2
  77. package/dist/esm/hooks/useTokenAddressBalance.js +1 -1
  78. package/dist/esm/hooks/useTokenAddressBalance.js.map +1 -1
  79. package/dist/esm/hooks/useTokenBalances.js +1 -1
  80. package/dist/esm/hooks/useTokenBalances.js.map +1 -1
  81. package/dist/esm/hooks/useTokenSearch.js +3 -3
  82. package/dist/esm/hooks/useTokenSearch.js.map +1 -1
  83. package/dist/esm/hooks/useTokens.d.ts +1 -1
  84. package/dist/esm/hooks/useTokens.js +27 -6
  85. package/dist/esm/hooks/useTokens.js.map +1 -1
  86. package/dist/esm/i18n/pt.json +4 -4
  87. package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
  88. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +27 -17
  89. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
  90. package/dist/esm/pages/TransactionPage/RouteTracker.d.ts +2 -1
  91. package/dist/esm/pages/TransactionPage/StatusBottomSheet.d.ts +0 -5
  92. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +1 -1
  93. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
  94. package/dist/esm/providers/I18nProvider/types.d.ts +4 -3
  95. package/dist/esm/providers/WalletProvider/EVMProvider.d.ts +0 -1
  96. package/dist/esm/providers/WalletProvider/EVMProvider.js +1 -1
  97. package/dist/esm/providers/WalletProvider/EVMProvider.js.map +1 -1
  98. package/dist/esm/providers/WalletProvider/SVMProvider.d.ts +0 -1
  99. package/dist/esm/providers/WalletProvider/SVMProvider.js +1 -1
  100. package/dist/esm/providers/WalletProvider/SVMProvider.js.map +1 -1
  101. package/dist/esm/providers/WalletProvider/SuiProvider.d.ts +0 -1
  102. package/dist/esm/providers/WalletProvider/SuiProvider.js +1 -1
  103. package/dist/esm/providers/WalletProvider/SuiProvider.js.map +1 -1
  104. package/dist/esm/providers/WalletProvider/UTXOProvider.d.ts +0 -1
  105. package/dist/esm/providers/WalletProvider/UTXOProvider.js +1 -1
  106. package/dist/esm/providers/WalletProvider/UTXOProvider.js.map +1 -1
  107. package/dist/esm/providers/WalletProvider/WalletProvider.d.ts +0 -1
  108. package/dist/esm/providers/WalletProvider/WalletProvider.js +1 -1
  109. package/dist/esm/providers/WalletProvider/WalletProvider.js.map +1 -1
  110. package/dist/esm/stores/bookmarks/BookmarkStore.d.ts +1 -2
  111. package/dist/esm/stores/bookmarks/BookmarkStore.js +1 -1
  112. package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
  113. package/dist/esm/stores/chains/ChainOrderStore.d.ts +0 -5
  114. package/dist/esm/stores/chains/ChainOrderStore.js +2 -2
  115. package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
  116. package/dist/esm/stores/chains/types.d.ts +2 -1
  117. package/dist/esm/stores/header/types.d.ts +2 -1
  118. package/dist/esm/stores/header/useHeaderStore.d.ts +1 -4
  119. package/dist/esm/stores/header/useHeaderStore.js +3 -3
  120. package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
  121. package/dist/esm/stores/inputMode/useInputModeStore.d.ts +1 -1
  122. package/dist/esm/stores/routes/RouteExecutionStore.d.ts +2 -2
  123. package/dist/esm/stores/routes/RouteExecutionStore.js +1 -1
  124. package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
  125. package/dist/esm/stores/settings/types.d.ts +3 -3
  126. package/dist/esm/stores/settings/types.js.map +1 -1
  127. package/dist/esm/stores/settings/useSettingsStore.d.ts +1 -2
  128. package/dist/esm/stores/settings/useSettingsStore.js +1 -1
  129. package/dist/esm/stores/settings/useSettingsStore.js.map +1 -1
  130. package/dist/esm/stores/settings/useSplitSubvariantStore.d.ts +1 -4
  131. package/dist/esm/stores/settings/useSplitSubvariantStore.js +3 -3
  132. package/dist/esm/stores/settings/useSplitSubvariantStore.js.map +1 -1
  133. package/dist/esm/types/events.d.ts +0 -4
  134. package/dist/esm/types/events.js +0 -4
  135. package/dist/esm/types/events.js.map +1 -1
  136. package/dist/esm/utils/fees.d.ts +1 -4
  137. package/dist/esm/utils/fees.js +3 -3
  138. package/dist/esm/utils/fees.js.map +1 -1
  139. package/dist/esm/utils/format.js +1 -1
  140. package/dist/esm/utils/format.js.map +1 -1
  141. package/dist/esm/utils/navigationRoutes.d.ts +2 -1
  142. package/dist/esm/utils/token.js +2 -2
  143. package/dist/esm/utils/token.js.map +1 -1
  144. package/dist/esm/utils/tokenList.d.ts +0 -4
  145. package/dist/esm/utils/tokenList.js +3 -3
  146. package/dist/esm/utils/tokenList.js.map +1 -1
  147. package/package.json +7 -7
  148. package/package.json.tmp +6 -6
  149. package/src/AppProvider.tsx +1 -1
  150. package/src/components/AmountInput/AmountInput.tsx +1 -1
  151. package/src/components/AmountInput/AmountInputAdornment.style.tsx +1 -7
  152. package/src/components/AmountInput/PriceFormHelperText.tsx +1 -1
  153. package/src/components/Avatar/Avatar.tsx +1 -1
  154. package/src/components/Avatar/TokenAvatar.tsx +2 -2
  155. package/src/components/Card/CardButton.style.tsx +0 -8
  156. package/src/components/FeeBreakdownTooltip.tsx +2 -5
  157. package/src/components/Header/Header.tsx +1 -1
  158. package/src/components/Header/WalletHeader.tsx +1 -1
  159. package/src/components/SendToWallet/SendToWalletButton.tsx +0 -1
  160. package/src/components/StepActions/StepActions.tsx +6 -6
  161. package/src/components/Tabs/Tabs.style.tsx +1 -1
  162. package/src/components/Timer/TimerContent.tsx +1 -2
  163. package/src/components/Token/Token.tsx +2 -2
  164. package/src/components/TokenList/TokenListItem.tsx +17 -19
  165. package/src/components/TokenList/types.ts +1 -1
  166. package/src/components/TokenList/useTokenSelect.ts +10 -8
  167. package/src/components/TokenRate/TokenRate.tsx +0 -1
  168. package/src/components/TransactionDetails.tsx +0 -1
  169. package/src/config/version.ts +1 -1
  170. package/src/hooks/timer/time.ts +0 -10
  171. package/src/hooks/timer/useTimer.ts +2 -2
  172. package/src/hooks/useAccountsBalancesData.ts +1 -1
  173. package/src/hooks/useAvailableChains.ts +1 -1
  174. package/src/hooks/useExplorer.ts +1 -1
  175. package/src/hooks/useFilteredByTokenBalances.ts +32 -3
  176. package/src/hooks/useListHeight.ts +2 -2
  177. package/src/hooks/useRoutes.ts +4 -2
  178. package/src/hooks/useToAddressAutoPopulate.ts +1 -1
  179. package/src/hooks/useToken.ts +10 -4
  180. package/src/hooks/useTokenAddressBalance.ts +2 -1
  181. package/src/hooks/useTokenBalances.ts +1 -1
  182. package/src/hooks/useTokenSearch.ts +4 -7
  183. package/src/hooks/useTokens.ts +44 -6
  184. package/src/i18n/pt.json +4 -4
  185. package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +0 -1
  186. package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +33 -30
  187. package/src/pages/TransactionPage/RouteTracker.tsx +1 -1
  188. package/src/pages/TransactionPage/StatusBottomSheet.tsx +5 -3
  189. package/src/providers/I18nProvider/types.ts +3 -3
  190. package/src/providers/WalletProvider/EVMProvider.tsx +1 -1
  191. package/src/providers/WalletProvider/SVMProvider.tsx +1 -1
  192. package/src/providers/WalletProvider/SuiProvider.tsx +1 -1
  193. package/src/providers/WalletProvider/UTXOProvider.tsx +1 -1
  194. package/src/providers/WalletProvider/WalletProvider.tsx +1 -1
  195. package/src/stores/bookmarks/BookmarkStore.tsx +1 -1
  196. package/src/stores/chains/ChainOrderStore.tsx +3 -7
  197. package/src/stores/chains/types.ts +1 -1
  198. package/src/stores/header/types.ts +1 -1
  199. package/src/stores/header/useHeaderStore.tsx +3 -3
  200. package/src/stores/inputMode/useInputModeStore.ts +1 -1
  201. package/src/stores/routes/RouteExecutionStore.tsx +4 -3
  202. package/src/stores/settings/types.ts +2 -6
  203. package/src/stores/settings/useSettingsStore.ts +1 -1
  204. package/src/stores/settings/useSplitSubvariantStore.tsx +5 -4
  205. package/src/types/events.ts +0 -4
  206. package/src/utils/fees.ts +3 -3
  207. package/src/utils/format.ts +2 -1
  208. package/src/utils/navigationRoutes.ts +1 -1
  209. package/src/utils/token.ts +4 -2
  210. package/src/utils/tokenList.ts +4 -4
  211. package/dist/esm/AppDrawer.style.d.ts +0 -1
  212. package/dist/esm/AppDrawer.style.js +0 -12
  213. package/dist/esm/AppDrawer.style.js.map +0 -1
  214. package/dist/esm/components/Select.d.ts +0 -3
  215. package/dist/esm/components/Select.js +0 -35
  216. package/dist/esm/components/Select.js.map +0 -1
  217. package/dist/esm/components/StepActions/StepFees.d.ts +0 -5
  218. package/dist/esm/components/StepActions/StepFees.js +0 -32
  219. package/dist/esm/components/StepActions/StepFees.js.map +0 -1
  220. package/dist/esm/pages/MainPage/MainPage.style.d.ts +0 -1
  221. package/dist/esm/pages/MainPage/MainPage.style.js +0 -8
  222. package/dist/esm/pages/MainPage/MainPage.style.js.map +0 -1
  223. package/dist/esm/pages/SelectNativeTokenPage.d.ts +0 -2
  224. package/dist/esm/pages/SelectNativeTokenPage.js +0 -23
  225. package/dist/esm/pages/SelectNativeTokenPage.js.map +0 -1
  226. package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.d.ts +0 -1
  227. package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js +0 -6
  228. package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js.map +0 -1
  229. package/dist/esm/pages/SelectTokenPage/types.d.ts +0 -4
  230. package/dist/esm/pages/SelectTokenPage/types.js +0 -6
  231. package/dist/esm/pages/SelectTokenPage/types.js.map +0 -1
  232. package/dist/esm/providers/WidgetProvider/utils.d.ts +0 -5
  233. package/dist/esm/providers/WidgetProvider/utils.js +0 -17
  234. package/dist/esm/providers/WidgetProvider/utils.js.map +0 -1
  235. package/dist/esm/stores/form/useFieldController.d.ts +0 -11
  236. package/dist/esm/stores/form/useFieldController.js +0 -20
  237. package/dist/esm/stores/form/useFieldController.js.map +0 -1
  238. package/dist/esm/stores/form/useValidation.d.ts +0 -2
  239. package/dist/esm/stores/form/useValidation.js +0 -14
  240. package/dist/esm/stores/form/useValidation.js.map +0 -1
  241. package/dist/esm/stores/form/useValidationActions.d.ts +0 -2
  242. package/dist/esm/stores/form/useValidationActions.js +0 -10
  243. package/dist/esm/stores/form/useValidationActions.js.map +0 -1
  244. package/src/AppDrawer.style.tsx +0 -12
  245. package/src/components/Select.tsx +0 -42
  246. package/src/components/StepActions/StepFees.tsx +0 -49
  247. package/src/pages/MainPage/MainPage.style.tsx +0 -8
  248. package/src/pages/SelectNativeTokenPage.tsx +0 -47
  249. package/src/pages/SelectTokenPage/SearchTokenInput.style.tsx +0 -6
  250. package/src/pages/SelectTokenPage/types.ts +0 -4
  251. package/src/providers/WidgetProvider/utils.ts +0 -26
  252. package/src/stores/form/useFieldController.ts +0 -31
  253. package/src/stores/form/useValidation.ts +0 -15
  254. package/src/stores/form/useValidationActions.ts +0 -12
package/package.json.tmp CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "3.30.0",
3
+ "version": "3.30.2",
4
4
  "description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -53,24 +53,24 @@
53
53
  "@bigmi/core": "^0.5.2",
54
54
  "@emotion/react": "^11.14.0",
55
55
  "@emotion/styled": "^11.14.1",
56
- "@lifi/sdk": "^3.12.0",
56
+ "@lifi/sdk": "^3.12.2",
57
57
  "@lifi/wallet-management": "workspace:^",
58
58
  "@mui/icons-material": "^7.3.2",
59
59
  "@mui/material": "^7.3.2",
60
60
  "@mui/system": "^7.3.2",
61
- "@mysten/sui": "^1.37.4",
61
+ "@mysten/sui": "^1.37.6",
62
62
  "@solana/wallet-adapter-base": "^0.9.27",
63
63
  "@solana/wallet-adapter-coinbase": "^0.1.23",
64
64
  "@solana/web3.js": "^1.98.4",
65
65
  "@tanstack/react-virtual": "^3.13.12",
66
- "i18next": "^25.4.2",
66
+ "i18next": "^25.5.2",
67
67
  "microdiff": "^1.5.0",
68
68
  "mitt": "^3.0.1",
69
69
  "react-i18next": "^15.7.3",
70
70
  "react-intersection-observer": "^9.16.0",
71
71
  "react-router-dom": "^6.30.0",
72
72
  "react-transition-group": "^4.4.5",
73
- "viem": "^2.37.1",
73
+ "viem": "^2.37.4",
74
74
  "zustand": "^5.0.8"
75
75
  },
76
76
  "devDependencies": {
@@ -86,7 +86,7 @@
86
86
  "@bigmi/react": ">=0.5.0",
87
87
  "@mysten/dapp-kit": ">=0.17.0",
88
88
  "@solana/wallet-adapter-react": ">=0.15.35",
89
- "@tanstack/react-query": ">=5.68.0",
89
+ "@tanstack/react-query": ">=5.87.0",
90
90
  "react": ">=18",
91
91
  "react-dom": ">=18",
92
92
  "wagmi": ">=2.14.0"
@@ -47,7 +47,7 @@ const memoryRouterProps: MemoryRouterProps = {
47
47
  },
48
48
  }
49
49
 
50
- export const AppRouter: React.FC<PropsWithChildren> = ({ children }) => {
50
+ const AppRouter: React.FC<PropsWithChildren> = ({ children }) => {
51
51
  const { buildUrl } = useWidgetConfig()
52
52
  const inRouterContext = useInRouterContext()
53
53
  const Router = inRouterContext ? Fragment : MemoryRouter
@@ -60,7 +60,7 @@ export const AmountInput: React.FC<FormTypeProps & CardProps> = ({
60
60
  )
61
61
  }
62
62
 
63
- export const AmountInputBase: React.FC<
63
+ const AmountInputBase: React.FC<
64
64
  FormTypeProps &
65
65
  CardProps & {
66
66
  token?: Token
@@ -1,4 +1,4 @@
1
- import { Box, Skeleton, styled } from '@mui/material'
1
+ import { Box, styled } from '@mui/material'
2
2
  import { cardClasses } from '@mui/material/Card'
3
3
  import { ButtonTertiary } from '../ButtonTertiary.js'
4
4
 
@@ -67,9 +67,3 @@ export const MaxButton = styled(ButtonTertiary)(({ theme }) => ({
67
67
  },
68
68
  },
69
69
  }))
70
-
71
- export const MaxButtonSkeleton = styled(Skeleton)(({ theme }) => ({
72
- width: 46,
73
- height: 24,
74
- borderRadius: theme.vars.shape.borderRadiusSecondary,
75
- }))
@@ -28,7 +28,7 @@ export const PriceFormHelperText = memo<FormTypeProps>(({ formType }) => {
28
28
  )
29
29
  })
30
30
 
31
- export const PriceFormHelperTextBase: React.FC<
31
+ const PriceFormHelperTextBase: React.FC<
32
32
  FormTypeProps & {
33
33
  isLoading?: boolean
34
34
  tokenAddress?: string
@@ -39,7 +39,7 @@ export const AvatarBadgedSkeleton: React.FC<{
39
39
  )
40
40
  }
41
41
 
42
- export const AvatarSkeleton: React.FC<{
42
+ const AvatarSkeleton: React.FC<{
43
43
  avatarSize: number
44
44
  badgeSize: number
45
45
  }> = ({ avatarSize, badgeSize }) => {
@@ -45,7 +45,7 @@ export const TokenAvatar: React.FC<{
45
45
  )
46
46
  }
47
47
 
48
- export const TokenAvatarFallback: React.FC<{
48
+ const TokenAvatarFallback: React.FC<{
49
49
  token?: StaticToken
50
50
  isLoading?: boolean
51
51
  sx?: SxProps<Theme>
@@ -69,7 +69,7 @@ export const TokenAvatarFallback: React.FC<{
69
69
  )
70
70
  }
71
71
 
72
- export const TokenAvatarBase: React.FC<{
72
+ const TokenAvatarBase: React.FC<{
73
73
  token?: StaticToken
74
74
  chain?: Chain
75
75
  isLoading?: boolean
@@ -15,14 +15,6 @@ export const CardRowButton = styled(ButtonBase)(({ theme }) => ({
15
15
  borderRadius: theme.vars.shape.borderRadius,
16
16
  }))
17
17
 
18
- export const CardRowContainer = styled(Box)(({ theme }) => ({
19
- display: 'flex',
20
- width: '100%',
21
- justifyContent: 'space-between',
22
- alignItems: 'center',
23
- padding: theme.spacing(2),
24
- }))
25
-
26
18
  export const CardValue = styled(Typography)({
27
19
  lineHeight: '1.25',
28
20
  fontWeight: 500,
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
5
5
  import type { FeesBreakdown } from '../utils/fees.js'
6
6
  import { formatTokenAmount } from '../utils/format.js'
7
7
 
8
- export interface FeeBreakdownTooltipProps {
8
+ interface FeeBreakdownTooltipProps {
9
9
  gasCosts?: FeesBreakdown[]
10
10
  feeCosts?: FeesBreakdown[]
11
11
  relayerSupport?: boolean
@@ -49,10 +49,7 @@ export const FeeBreakdownTooltip: React.FC<FeeBreakdownTooltipProps> = ({
49
49
  )
50
50
  }
51
51
 
52
- export const getFeeBreakdownTypography = (
53
- fees: FeesBreakdown[],
54
- t: TFunction
55
- ) =>
52
+ const getFeeBreakdownTypography = (fees: FeesBreakdown[], t: TFunction) =>
56
53
  fees.map((fee, index) => (
57
54
  <Typography
58
55
  color="inherit"
@@ -9,7 +9,7 @@ import { Container } from './Header.style.js'
9
9
  import { NavigationHeader } from './NavigationHeader.js'
10
10
  import { WalletHeader } from './WalletHeader.js'
11
11
 
12
- export const HeaderContainer: FC<PropsWithChildren> = ({ children }) => {
12
+ const HeaderContainer: FC<PropsWithChildren> = ({ children }) => {
13
13
  const { pathname } = useLocation()
14
14
  const elementId = useDefaultElementId()
15
15
  const headerRef = useRef<HTMLDivElement>(null)
@@ -50,7 +50,7 @@ export const WalletHeader: React.FC = () => {
50
50
  ) : null
51
51
  }
52
52
 
53
- export const WalletMenuButton: React.FC = () => {
53
+ const WalletMenuButton: React.FC = () => {
54
54
  const { variant, hiddenUI } = useWidgetConfig()
55
55
  const { account, accounts } = useAccount()
56
56
 
@@ -133,7 +133,6 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
133
133
  mountOnEnter
134
134
  unmountOnExit
135
135
  >
136
- {/** biome-ignore lint/a11y/useSemanticElements: allowed in react */}
137
136
  <Card
138
137
  role="button"
139
138
  onClick={disabledForChanges ? undefined : handleOnClick}
@@ -120,7 +120,7 @@ export const StepActions: React.FC<StepActionsProps> = ({
120
120
  )
121
121
  }
122
122
 
123
- export const IncludedSteps: React.FC<IncludedStepsProps> = ({ step }) => {
123
+ const IncludedSteps: React.FC<IncludedStepsProps> = ({ step }) => {
124
124
  const { subvariant, subvariantOptions, feeConfig, hiddenUI } =
125
125
  useWidgetConfig()
126
126
 
@@ -211,7 +211,7 @@ export const IncludedSteps: React.FC<IncludedStepsProps> = ({ step }) => {
211
211
  )
212
212
  }
213
213
 
214
- export const StepDetailsContent: React.FC<{
214
+ const StepDetailsContent: React.FC<{
215
215
  step: StepExtended
216
216
  }> = ({ step }) => {
217
217
  const { t } = useTranslation()
@@ -293,7 +293,7 @@ export const StepDetailsContent: React.FC<{
293
293
  )
294
294
  }
295
295
 
296
- export const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps> = ({
296
+ const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps> = ({
297
297
  step,
298
298
  subvariant,
299
299
  subvariantOptions,
@@ -325,7 +325,7 @@ export const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps> = ({
325
325
  )
326
326
  }
327
327
 
328
- export const BridgeStepDetailsLabel: React.FC<
328
+ const BridgeStepDetailsLabel: React.FC<
329
329
  Omit<StepDetailsLabelProps, 'variant'>
330
330
  > = ({ step }) => {
331
331
  const { t } = useTranslation()
@@ -341,7 +341,7 @@ export const BridgeStepDetailsLabel: React.FC<
341
341
  )
342
342
  }
343
343
 
344
- export const SwapStepDetailsLabel: React.FC<
344
+ const SwapStepDetailsLabel: React.FC<
345
345
  Omit<StepDetailsLabelProps, 'variant'>
346
346
  > = ({ step }) => {
347
347
  const { t } = useTranslation()
@@ -356,7 +356,7 @@ export const SwapStepDetailsLabel: React.FC<
356
356
  )
357
357
  }
358
358
 
359
- export const ProtocolStepDetailsLabel: React.FC<
359
+ const ProtocolStepDetailsLabel: React.FC<
360
360
  Omit<StepDetailsLabelProps, 'variant'>
361
361
  > = ({ step, feeConfig, relayerSupport }) => {
362
362
  const { t } = useTranslation()
@@ -7,7 +7,7 @@ import {
7
7
  tabsClasses,
8
8
  } from '@mui/material'
9
9
 
10
- export const Tabs = styled(MuiTabs)(({ theme }) => ({
10
+ const Tabs = styled(MuiTabs)(({ theme }) => ({
11
11
  flex: 1,
12
12
  [`.${tabsClasses.indicator}`]: {
13
13
  top: theme.spacing(0.5),
@@ -1,6 +1,5 @@
1
1
  import AccessTimeFilled from '@mui/icons-material/AccessTimeFilled'
2
- import { Tooltip } from '@mui/material'
3
- import { Box } from '@mui/system'
2
+ import { Box, Tooltip } from '@mui/material'
4
3
  import type { FC, PropsWithChildren } from 'react'
5
4
  import { useTranslation } from 'react-i18next'
6
5
  import { IconTypography } from '../IconTypography.js'
@@ -30,7 +30,7 @@ export const Token: FC<TokenProps & BoxProps> = ({ token, ...other }) => {
30
30
  return <TokenBase token={token} {...other} />
31
31
  }
32
32
 
33
- export const TokenFallback: FC<TokenProps & BoxProps> = ({
33
+ const TokenFallback: FC<TokenProps & BoxProps> = ({
34
34
  token,
35
35
  isLoading,
36
36
  ...other
@@ -49,7 +49,7 @@ export const TokenFallback: FC<TokenProps & BoxProps> = ({
49
49
  )
50
50
  }
51
51
 
52
- export const TokenBase: FC<TokenProps & BoxProps> = ({
52
+ const TokenBase: FC<TokenProps & BoxProps> = ({
53
53
  token,
54
54
  impactToken,
55
55
  enableImpactTokenTooltip,
@@ -62,24 +62,22 @@ export const TokenListItem: React.FC<TokenListItemProps> = memo(
62
62
  }
63
63
  )
64
64
 
65
- export const TokenListItemAvatar = memo(
66
- ({ token }: TokenListItemAvatarProps) => {
67
- const [isImageLoading, setIsImageLoading] = useState(true)
65
+ const TokenListItemAvatar = memo(({ token }: TokenListItemAvatarProps) => {
66
+ const [isImageLoading, setIsImageLoading] = useState(true)
68
67
 
69
- return (
70
- <Avatar
71
- src={token.logoURI}
72
- alt={token.symbol}
73
- sx={(theme) =>
74
- isImageLoading ? { bgcolor: theme.vars.palette.grey[300] } : null
75
- }
76
- onLoad={() => setIsImageLoading(false)}
77
- >
78
- {token.symbol?.[0]}
79
- </Avatar>
80
- )
81
- }
82
- )
68
+ return (
69
+ <Avatar
70
+ src={token.logoURI}
71
+ alt={token.symbol}
72
+ sx={(theme) =>
73
+ isImageLoading ? { bgcolor: theme.vars.palette.grey[300] } : null
74
+ }
75
+ onLoad={() => setIsImageLoading(false)}
76
+ >
77
+ {token.symbol?.[0]}
78
+ </Avatar>
79
+ )
80
+ })
83
81
 
84
82
  interface OpenTokenDetailsButtonProps {
85
83
  tokenAddress: string | undefined
@@ -115,7 +113,7 @@ const OpenTokenDetailsButton = ({
115
113
  )
116
114
  }
117
115
 
118
- export const TokenListItemButton: React.FC<TokenListItemButtonProps> = memo(
116
+ const TokenListItemButton: React.FC<TokenListItemButtonProps> = memo(
119
117
  ({
120
118
  onClick,
121
119
  token,
@@ -373,7 +371,7 @@ export const TokenListItemSkeleton = () => {
373
371
  )
374
372
  }
375
373
 
376
- export const TokenAmountSkeleton: React.FC = () => {
374
+ const TokenAmountSkeleton: React.FC = () => {
377
375
  return (
378
376
  <Box
379
377
  sx={{
@@ -22,7 +22,7 @@ export interface VirtualizedTokenListProps {
22
22
  isAllNetworks: boolean
23
23
  }
24
24
 
25
- export interface TokenListItemBaseProps {
25
+ interface TokenListItemBaseProps {
26
26
  onClick?(tokenAddress: string, chainId?: number): void
27
27
  size: number
28
28
  start: number
@@ -9,14 +9,10 @@ import { useFieldActions } from '../../stores/form/useFieldActions.js'
9
9
  import { useSplitSubvariantStore } from '../../stores/settings/useSplitSubvariantStore.js'
10
10
  import { WidgetEvent } from '../../types/events.js'
11
11
  import type { DisabledUI } from '../../types/widget.js'
12
-
13
- export type UseTokenSelectArgs = {
14
- formType: FormType
15
- onClick?: () => void
16
- }
12
+ import { isItemAllowed } from '../../utils/item.js'
17
13
 
18
14
  export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
19
- const { subvariant, disabledUI } = useWidgetConfig()
15
+ const { subvariant, disabledUI, chains: chainsConfig } = useWidgetConfig()
20
16
  const splitSubvariant = useSplitSubvariantStore((store) => store.state)
21
17
  const emitter = useWidgetEvents()
22
18
  const { setFieldValue, getFieldValues } = useFieldActions()
@@ -70,8 +66,13 @@ export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
70
66
  })
71
67
  }
72
68
 
73
- // If no opposite token is selected, synchronize the opposite chain to match the currently selected chain
74
- if (!selectedOppositeTokenAddress && selectedChainId) {
69
+ // If no opposite token is selected, synchronize the opposite chain
70
+ // to match the currently selected chain (if allowed)
71
+ if (
72
+ !selectedOppositeTokenAddress &&
73
+ selectedChainId &&
74
+ isItemAllowed(selectedChainId, chainsConfig?.[oppositeFormType])
75
+ ) {
75
76
  setFieldValue(
76
77
  FormKeyHelper.getChainKey(oppositeFormType),
77
78
  selectedChainId,
@@ -118,6 +119,7 @@ export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
118
119
  subvariant,
119
120
  splitSubvariant,
120
121
  tokenKey,
122
+ chainsConfig,
121
123
  ]
122
124
  )
123
125
  }
@@ -56,7 +56,6 @@ export const TokenRate: React.FC<TokenRateProps> = ({ route }) => {
56
56
  : `1 ${toToken.symbol} ≈ ${t('format.tokenAmount', { value: toFromRate })} ${fromToken.symbol}`
57
57
 
58
58
  return (
59
- // biome-ignore lint/a11y/useSemanticElements: allowed in react
60
59
  <TokenRateTypography onClick={toggleRate} role="button">
61
60
  {rateText}
62
61
  </TokenRateTypography>
@@ -102,7 +102,6 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
102
102
  feeCosts={feeCosts}
103
103
  relayerSupport={hasRelayerSupport}
104
104
  >
105
- {/** biome-ignore lint/a11y/useSemanticElements: allowed in react */}
106
105
  <Box
107
106
  onClick={toggleCard}
108
107
  role="button"
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget'
2
- export const version = '3.30.0'
2
+ export const version = '3.30.2'
@@ -8,16 +8,6 @@ export type TimeFromMillisecondsType = {
8
8
  days: number
9
9
  }
10
10
 
11
- export type AMPMType = '' | 'pm' | 'am'
12
-
13
- export type FormattedTimeFromMillisecondsType = {
14
- milliseconds: number
15
- seconds: number
16
- minutes: number
17
- hours: number
18
- ampm?: AMPMType
19
- }
20
-
21
11
  export function getTimeFromMilliseconds(
22
12
  millisecs: number,
23
13
  isCountDown = true
@@ -9,14 +9,14 @@ import { validateExpiryTimestamp, validateOnExpire } from './validate.js'
9
9
 
10
10
  const SECOND_INTERVAL = 1000
11
11
 
12
- export type useTimerSettingsType = {
12
+ type useTimerSettingsType = {
13
13
  expiryTimestamp: Date
14
14
  onExpire?: () => void
15
15
  autoStart?: boolean
16
16
  interval?: number
17
17
  }
18
18
 
19
- export type useTimerResultType = TimeFromMillisecondsType & {
19
+ type useTimerResultType = TimeFromMillisecondsType & {
20
20
  start: () => void
21
21
  pause: () => void
22
22
  resume: () => void
@@ -16,7 +16,7 @@ export const useAccountsBalancesData = (
16
16
 
17
17
  // Filter out EVM tokens that do not have balances
18
18
  const { data: filteredTokens, isLoading: isCachedBalancesLoading } =
19
- useFilteredTokensByBalance(accountsWithTokens)
19
+ useFilteredTokensByBalance(accountsWithTokens, formType)
20
20
 
21
21
  return {
22
22
  data: filteredTokens,
@@ -6,7 +6,7 @@ import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
6
6
  import { getConfigItemSets, isItemAllowedForSets } from '../utils/item.js'
7
7
  import { getQueryKey } from '../utils/queries.js'
8
8
 
9
- export type GetChainById = (
9
+ type GetChainById = (
10
10
  chainId?: number,
11
11
  chains?: ExtendedChain[]
12
12
  ) => ExtendedChain | undefined
@@ -7,7 +7,7 @@ import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
7
7
 
8
8
  const sanitiseBaseUrl = (baseUrl: string) => baseUrl.trim().replace(/\/+$/, '')
9
9
 
10
- export type TransactionLinkProps = { chain?: Chain | number } & (
10
+ type TransactionLinkProps = { chain?: Chain | number } & (
11
11
  | {
12
12
  txHash: string
13
13
  txLink?: never
@@ -1,4 +1,5 @@
1
1
  import {
2
+ type BaseToken,
2
3
  ChainType,
3
4
  getWalletBalances,
4
5
  type TokenExtended,
@@ -6,14 +7,20 @@ import {
6
7
  } from '@lifi/sdk'
7
8
  import { useQuery } from '@tanstack/react-query'
8
9
  import { useMemo } from 'react'
10
+ import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
11
+ import type { FormType } from '../stores/form/types.js'
12
+ import { getConfigItemSets, isFormItemAllowed } from '../utils/item.js'
9
13
  import { isSupportedToken } from '../utils/tokenList.js'
10
14
 
11
15
  export const useFilteredTokensByBalance = (
12
16
  accountsWithTokens?: Record<
13
17
  string,
14
18
  { chainType: ChainType; tokens: Record<number, TokenExtended[]> }
15
- >
19
+ >,
20
+ formType?: FormType
16
21
  ) => {
22
+ const { tokens: configTokens } = useWidgetConfig()
23
+
17
24
  const evmAddress = useMemo(() => {
18
25
  const evmAccount = Object.entries(accountsWithTokens ?? {}).find(
19
26
  ([_, { chainType }]) => chainType === ChainType.EVM
@@ -75,10 +82,32 @@ export const useFilteredTokensByBalance = (
75
82
  const chainTokenSet = new Set(
76
83
  chainTokens.map((token) => token.address.toLowerCase())
77
84
  )
85
+
86
+ // Get allowed addresses from config tokens
87
+ const allowedAddressesConfig = getConfigItemSets(
88
+ configTokens,
89
+ (tokens: BaseToken[]) =>
90
+ new Set(
91
+ tokens
92
+ .filter((t) => Number(t.chainId) === chainId)
93
+ .map((t) => t.address.toLowerCase())
94
+ ),
95
+ formType
96
+ )
97
+
78
98
  const additionalTokens = balances.filter(
79
99
  (balance: WalletTokenExtended) => {
80
100
  const balanceKey = balance.address.toLowerCase()
81
- return !chainTokenSet.has(balanceKey) && isSupportedToken(balance)
101
+ return (
102
+ !chainTokenSet.has(balanceKey) &&
103
+ isSupportedToken(balance) &&
104
+ isFormItemAllowed(
105
+ balance,
106
+ allowedAddressesConfig,
107
+ formType,
108
+ (t) => t.address.toLowerCase()
109
+ )
110
+ )
82
111
  }
83
112
  ) as TokenExtended[]
84
113
 
@@ -95,7 +124,7 @@ export const useFilteredTokensByBalance = (
95
124
  }
96
125
 
97
126
  return result
98
- }, [accountsWithTokens, existingBalances])
127
+ }, [accountsWithTokens, existingBalances, configTokens, formType])
99
128
 
100
129
  return { data: accountsWithFilteredTokens, isLoading }
101
130
  }
@@ -51,8 +51,8 @@ interface UseContentHeightProps {
51
51
  headerRef?: RefObject<HTMLElement | null>
52
52
  }
53
53
 
54
- export const defaultMinListHeight = 360
55
- export const minMobileListHeight = 160
54
+ const defaultMinListHeight = 360
55
+ const minMobileListHeight = 160
56
56
 
57
57
  // NOTE: this hook is implicitly tied to the widget height functionality in the
58
58
  // AppExpandedContainer, RelativeContainer and CssBaselineContainer components as defined in AppContainer.ts
@@ -5,6 +5,7 @@ import {
5
5
  getContractCallsQuote,
6
6
  getRelayerQuote,
7
7
  getRoutes,
8
+ isGaslessStep,
8
9
  isRelayerStep,
9
10
  LiFiErrorCode,
10
11
  } from '@lifi/sdk'
@@ -331,8 +332,9 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
331
332
  return
332
333
  }
333
334
 
334
- const isObservableRelayerRoute =
335
- observableRoute?.steps?.some(isRelayerStep)
335
+ const isObservableRelayerRoute = observableRoute?.steps?.some(
336
+ (step) => isRelayerStep(step) && isGaslessStep(step, fromChain)
337
+ )
336
338
 
337
339
  const shouldUseMainRoutes =
338
340
  !observableRoute || !isObservableRelayerRoute
@@ -7,7 +7,7 @@ import { useSendToWalletActions } from '../stores/settings/useSendToWalletStore.
7
7
  import { getChainTypeFromAddress } from '../utils/chainType.js'
8
8
  import { useAvailableChains } from './useAvailableChains.js'
9
9
 
10
- export type UpdateToAddressArgs = {
10
+ type UpdateToAddressArgs = {
11
11
  formType: FormType
12
12
  selectedToAddress?: string
13
13
  selectedChainId?: number
@@ -1,3 +1,4 @@
1
+ import { useMemo } from 'react'
1
2
  import { useTokenSearch } from './useTokenSearch.js'
2
3
  import { useTokens } from './useTokens.js'
3
4
 
@@ -8,10 +9,15 @@ export const useToken = (
8
9
  ) => {
9
10
  const { allTokens, isLoading: isTokensLoading } = useTokens()
10
11
 
11
- const token =
12
- chainId && tokenAddress
13
- ? allTokens?.[chainId]?.find((t) => t.address === tokenAddress)
14
- : undefined
12
+ const token = useMemo(
13
+ () =>
14
+ chainId && tokenAddress
15
+ ? allTokens?.[chainId]?.find(
16
+ (t) => t.address.toLowerCase() === tokenAddress.toLowerCase()
17
+ )
18
+ : undefined,
19
+ [allTokens, chainId, tokenAddress]
20
+ )
15
21
 
16
22
  const tokenSearchEnabled =
17
23
  !!chainId && !!tokenAddress && (latest || (!isTokensLoading && !token))
@@ -1,3 +1,4 @@
1
+ import type { TokenAmount } from '@lifi/sdk'
1
2
  import { useAccount } from '@lifi/wallet-management'
2
3
  import { useChain } from './useChain.js'
3
4
  import { useToken } from './useToken.js'
@@ -18,7 +19,7 @@ export const useTokenAddressBalance = (
18
19
  } = useTokenBalance(account?.address, token)
19
20
 
20
21
  return {
21
- token: tokenBalance,
22
+ token: tokenBalance ?? (token as TokenAmount),
22
23
  chain,
23
24
  isLoading: isBalanceLoading || isChainLoading || isTokenLoading,
24
25
  refetch,
@@ -16,7 +16,7 @@ export const useTokenBalances = (
16
16
  allTokens,
17
17
  isLoading: isTokensLoading,
18
18
  isSearchLoading,
19
- } = useTokens(formType, search)
19
+ } = useTokens(formType, search, isAllNetworks ? undefined : selectedChainId)
20
20
 
21
21
  const { data: accountsWithAllTokens, isLoading: isAccountsLoading } =
22
22
  useAccountsBalancesData(selectedChainId, formType, isAllNetworks, allTokens)