@lifi/widget 2.0.0-beta.0 → 2.0.0-beta.10

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 (289) hide show
  1. package/App.d.ts +4 -3
  2. package/AppDrawer.d.ts +1 -1
  3. package/AppDrawer.js +2 -1
  4. package/AppProvider.js +1 -1
  5. package/README.md +11 -12
  6. package/cjs/App.d.ts +4 -3
  7. package/cjs/AppDrawer.d.ts +1 -1
  8. package/cjs/AppDrawer.js +2 -1
  9. package/cjs/AppProvider.js +1 -1
  10. package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -1
  11. package/cjs/components/ChainSelect/ChainSelect.style.js +1 -1
  12. package/cjs/components/ChainSelect/useChainSelect.js +6 -0
  13. package/cjs/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -1
  14. package/cjs/components/GasMessage/GasMessage.js +1 -6
  15. package/cjs/components/Header/Header.js +2 -2
  16. package/cjs/components/Header/Header.style.d.ts +10 -3
  17. package/cjs/components/Header/Header.style.js +3 -0
  18. package/cjs/components/Header/NavigationHeader.js +23 -7
  19. package/cjs/components/Header/NavigationTabs.d.ts +1 -0
  20. package/cjs/components/Header/NavigationTabs.js +26 -0
  21. package/cjs/components/Header/NavigationTabs.style.d.ts +34 -0
  22. package/cjs/components/Header/NavigationTabs.style.js +61 -0
  23. package/cjs/components/Header/WalletHeader.d.ts +1 -0
  24. package/cjs/components/Header/WalletHeader.js +16 -9
  25. package/cjs/components/Header/useHeaderActionStore.js +0 -1
  26. package/cjs/components/Insurance/Insurance.js +2 -2
  27. package/cjs/components/Insurance/InsuranceCard.js +34 -12
  28. package/cjs/components/Insurance/InsuranceCollapsed.js +9 -11
  29. package/cjs/components/Insurance/index.d.ts +1 -0
  30. package/cjs/components/Insurance/index.js +1 -0
  31. package/cjs/components/Insurance/types.d.ts +12 -9
  32. package/cjs/components/NFT/NFT.js +2 -2
  33. package/cjs/components/NFT/types.d.ts +1 -1
  34. package/cjs/components/PoweredBy/PoweredBy.js +2 -3
  35. package/cjs/components/SelectChainAndToken.js +8 -7
  36. package/cjs/components/SelectTokenButton/SelectTokenButton.js +6 -3
  37. package/cjs/components/SendToWallet/SendToWallet.js +2 -2
  38. package/cjs/components/SmallAvatar.d.ts +1 -1
  39. package/cjs/components/Step/CircularProgress.d.ts +1 -1
  40. package/cjs/components/Step/Step.js +15 -5
  41. package/cjs/components/Step/StepList.d.ts +1 -1
  42. package/cjs/components/StepActions/StepActions.js +4 -20
  43. package/cjs/components/SwapButton/SwapButton.js +16 -4
  44. package/cjs/components/SwapInput/FormPriceHelperText.js +1 -1
  45. package/cjs/components/SwapInput/SwapInput.js +2 -2
  46. package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +1 -1
  47. package/cjs/components/SwapInput/SwapInputEndAdornment.js +2 -2
  48. package/cjs/components/SwapRouteCard/SwapRouteCard.js +19 -3
  49. package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.js +1 -1
  50. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +1 -1
  51. package/cjs/components/SwapRoutes/SwapRoutes.js +1 -1
  52. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -2
  53. package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +2 -2
  54. package/cjs/components/SwapRoutes/SwapRoutesExpanded.style.js +1 -0
  55. package/cjs/components/Token/Token.js +1 -1
  56. package/cjs/components/TokenAvatar/TokenAvatar.d.ts +4 -4
  57. package/cjs/components/TokenList/TokenList.js +9 -4
  58. package/cjs/components/TokenList/TokenList.style.d.ts +5 -2
  59. package/cjs/components/TokenList/TokenList.style.js +20 -1
  60. package/cjs/components/TokenList/TokenListItem.d.ts +1 -1
  61. package/cjs/components/TokenList/TokenListItem.js +28 -5
  62. package/cjs/components/TokenList/VirtualizedTokenList.js +3 -3
  63. package/cjs/components/TokenList/types.d.ts +6 -3
  64. package/cjs/config/theme.js +15 -3
  65. package/cjs/config/version.d.ts +1 -1
  66. package/cjs/config/version.js +1 -1
  67. package/cjs/hooks/index.d.ts +2 -1
  68. package/cjs/hooks/index.js +2 -1
  69. package/cjs/hooks/useContentHeight.js +3 -5
  70. package/cjs/hooks/useFeaturedTokens.d.ts +1 -1
  71. package/cjs/hooks/useFundsSufficiency.js +2 -2
  72. package/cjs/hooks/useGasRefuel.d.ts +1 -1
  73. package/cjs/hooks/useGasRefuel.js +5 -15
  74. package/cjs/hooks/useGasSufficiency.js +12 -3
  75. package/cjs/hooks/useInitializer.js +0 -1
  76. package/cjs/hooks/useProcessMessage.d.ts +2 -1
  77. package/cjs/hooks/useProcessMessage.js +27 -9
  78. package/cjs/hooks/useRouteExecution.js +6 -5
  79. package/cjs/hooks/useSwapOnly.d.ts +1 -0
  80. package/cjs/hooks/useSwapOnly.js +9 -0
  81. package/cjs/hooks/useSwapRoutes.d.ts +1 -2
  82. package/cjs/hooks/useSwapRoutes.js +32 -18
  83. package/cjs/hooks/useToken.d.ts +1 -1
  84. package/cjs/hooks/useTokenAddressBalance.d.ts +2 -2
  85. package/cjs/hooks/useTokenBalance.js +6 -7
  86. package/cjs/hooks/useTokenBalances.d.ts +5 -5
  87. package/cjs/hooks/useTokenBalances.js +4 -19
  88. package/cjs/hooks/useTokenSearch.d.ts +2 -2
  89. package/cjs/hooks/useTokens.d.ts +2 -2
  90. package/cjs/i18n/bn.json +8 -0
  91. package/cjs/i18n/en.json +30 -5
  92. package/cjs/i18n/fr.json +8 -0
  93. package/cjs/i18n/id.json +22 -7
  94. package/cjs/i18n/ko.json +22 -7
  95. package/cjs/i18n/pt.json +40 -12
  96. package/cjs/i18n/th.json +21 -6
  97. package/cjs/i18n/uk.json +45 -20
  98. package/cjs/i18n/zh.json +23 -8
  99. package/cjs/icons/InsuraceLogo.d.ts +1 -1
  100. package/cjs/icons/LiFiFullLogo.d.ts +1 -1
  101. package/cjs/icons/LiFiLogo.d.ts +1 -1
  102. package/cjs/icons/LiFiToolLogo.d.ts +1 -1
  103. package/cjs/index.d.ts +1 -1
  104. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -1
  105. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -1
  106. package/cjs/pages/SelectTokenPage/SelectTokenPage.js +3 -1
  107. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -1
  108. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +5 -5
  109. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -1
  110. package/cjs/pages/SettingsPage/LanguageSelect.js +1 -1
  111. package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -1
  112. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -1
  113. package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -1
  114. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +6 -2
  115. package/cjs/pages/SwapPage/ExchangeRateBottomSheet.js +1 -1
  116. package/cjs/pages/SwapPage/StatusBottomSheet.js +15 -9
  117. package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +1 -1
  118. package/cjs/pages/SwapPage/StatusBottomSheet.style.js +2 -2
  119. package/cjs/pages/SwapPage/SwapPage.js +31 -10
  120. package/cjs/pages/SwapPage/TokenValueBottomSheet.js +7 -12
  121. package/cjs/pages/SwapPage/utils.d.ts +2 -0
  122. package/cjs/pages/SwapPage/utils.js +10 -0
  123. package/cjs/providers/I18nProvider/I18nProvider.js +3 -3
  124. package/cjs/providers/SDKProvider/SDKProvider.js +2 -0
  125. package/cjs/providers/SwapFormProvider/FormUpdater.js +3 -0
  126. package/cjs/providers/WalletProvider/WalletProvider.js +107 -35
  127. package/cjs/providers/WalletProvider/index.d.ts +1 -1
  128. package/cjs/providers/WalletProvider/index.js +1 -1
  129. package/cjs/providers/WalletProvider/types.d.ts +4 -6
  130. package/cjs/providers/WidgetProvider/WidgetProvider.js +1 -1
  131. package/cjs/stores/StoreProvider.d.ts +2 -2
  132. package/cjs/stores/StoreProvider.js +3 -2
  133. package/cjs/stores/routes/RouteExecutionStore.d.ts +1 -1
  134. package/cjs/stores/routes/RouteExecutionStore.js +0 -1
  135. package/cjs/stores/settings/index.d.ts +1 -0
  136. package/cjs/stores/settings/index.js +1 -0
  137. package/cjs/stores/settings/types.d.ts +11 -0
  138. package/cjs/stores/settings/useSplitSubvariantStore.d.ts +7 -0
  139. package/cjs/stores/settings/useSplitSubvariantStore.js +44 -0
  140. package/cjs/types/events.d.ts +9 -1
  141. package/cjs/types/events.js +1 -0
  142. package/cjs/types/token.d.ts +2 -2
  143. package/cjs/types/widget.d.ts +13 -8
  144. package/cjs/types/widget.js +4 -2
  145. package/cjs/utils/format.d.ts +1 -1
  146. package/cjs/utils/format.js +7 -12
  147. package/cjs/utils/wallet.d.ts +1 -1
  148. package/cjs/utils/wallet.js +3 -3
  149. package/components/ChainSelect/ChainSelect.d.ts +1 -1
  150. package/components/ChainSelect/ChainSelect.style.js +1 -1
  151. package/components/ChainSelect/useChainSelect.js +7 -1
  152. package/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -1
  153. package/components/GasMessage/GasMessage.js +2 -7
  154. package/components/Header/Header.js +3 -3
  155. package/components/Header/Header.style.d.ts +10 -3
  156. package/components/Header/Header.style.js +3 -0
  157. package/components/Header/NavigationHeader.js +23 -7
  158. package/components/Header/NavigationTabs.d.ts +1 -0
  159. package/components/Header/NavigationTabs.js +22 -0
  160. package/components/Header/NavigationTabs.style.d.ts +34 -0
  161. package/components/Header/NavigationTabs.style.js +58 -0
  162. package/components/Header/WalletHeader.d.ts +1 -0
  163. package/components/Header/WalletHeader.js +14 -8
  164. package/components/Header/useHeaderActionStore.js +0 -1
  165. package/components/Insurance/Insurance.js +2 -2
  166. package/components/Insurance/InsuranceCard.js +37 -15
  167. package/components/Insurance/InsuranceCollapsed.js +9 -11
  168. package/components/Insurance/index.d.ts +1 -0
  169. package/components/Insurance/index.js +1 -0
  170. package/components/Insurance/types.d.ts +12 -9
  171. package/components/NFT/NFT.js +2 -2
  172. package/components/NFT/types.d.ts +1 -1
  173. package/components/PoweredBy/PoweredBy.js +2 -3
  174. package/components/SelectChainAndToken.js +9 -8
  175. package/components/SelectTokenButton/SelectTokenButton.js +7 -4
  176. package/components/SendToWallet/SendToWallet.js +2 -2
  177. package/components/SmallAvatar.d.ts +1 -1
  178. package/components/Step/CircularProgress.d.ts +1 -1
  179. package/components/Step/Step.js +16 -6
  180. package/components/Step/StepList.d.ts +1 -1
  181. package/components/StepActions/StepActions.js +4 -20
  182. package/components/SwapButton/SwapButton.js +16 -4
  183. package/components/SwapInput/FormPriceHelperText.js +2 -2
  184. package/components/SwapInput/SwapInput.js +3 -3
  185. package/components/SwapInput/SwapInputEndAdornment.d.ts +1 -1
  186. package/components/SwapInput/SwapInputEndAdornment.js +2 -2
  187. package/components/SwapRouteCard/SwapRouteCard.js +21 -5
  188. package/components/SwapRouteCard/SwapRouteCardEssentials.js +1 -1
  189. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +1 -1
  190. package/components/SwapRoutes/SwapRoutes.js +1 -1
  191. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -2
  192. package/components/SwapRoutes/SwapRoutesExpanded.js +2 -2
  193. package/components/SwapRoutes/SwapRoutesExpanded.style.js +1 -0
  194. package/components/Token/Token.js +1 -1
  195. package/components/TokenAvatar/TokenAvatar.d.ts +4 -4
  196. package/components/TokenList/TokenList.js +10 -5
  197. package/components/TokenList/TokenList.style.d.ts +5 -2
  198. package/components/TokenList/TokenList.style.js +21 -2
  199. package/components/TokenList/TokenListItem.d.ts +1 -1
  200. package/components/TokenList/TokenListItem.js +32 -9
  201. package/components/TokenList/VirtualizedTokenList.js +3 -3
  202. package/components/TokenList/types.d.ts +6 -3
  203. package/config/theme.js +15 -3
  204. package/config/version.d.ts +1 -1
  205. package/config/version.js +1 -1
  206. package/hooks/index.d.ts +2 -1
  207. package/hooks/index.js +2 -1
  208. package/hooks/useContentHeight.js +4 -6
  209. package/hooks/useFeaturedTokens.d.ts +1 -1
  210. package/hooks/useFundsSufficiency.js +2 -2
  211. package/hooks/useGasRefuel.d.ts +1 -1
  212. package/hooks/useGasRefuel.js +5 -15
  213. package/hooks/useGasSufficiency.js +13 -4
  214. package/hooks/useInitializer.js +0 -1
  215. package/hooks/useProcessMessage.d.ts +2 -1
  216. package/hooks/useProcessMessage.js +27 -9
  217. package/hooks/useRouteExecution.js +6 -5
  218. package/hooks/useSwapOnly.d.ts +1 -0
  219. package/hooks/useSwapOnly.js +5 -0
  220. package/hooks/useSwapRoutes.d.ts +1 -2
  221. package/hooks/useSwapRoutes.js +32 -18
  222. package/hooks/useToken.d.ts +1 -1
  223. package/hooks/useTokenAddressBalance.d.ts +2 -2
  224. package/hooks/useTokenBalance.js +6 -7
  225. package/hooks/useTokenBalances.d.ts +5 -5
  226. package/hooks/useTokenBalances.js +4 -19
  227. package/hooks/useTokenSearch.d.ts +2 -2
  228. package/hooks/useTokens.d.ts +2 -2
  229. package/i18n/bn.json +8 -0
  230. package/i18n/en.json +30 -5
  231. package/i18n/fr.json +8 -0
  232. package/i18n/id.json +22 -7
  233. package/i18n/ko.json +22 -7
  234. package/i18n/pt.json +40 -12
  235. package/i18n/th.json +21 -6
  236. package/i18n/uk.json +45 -20
  237. package/i18n/zh.json +23 -8
  238. package/icons/InsuraceLogo.d.ts +1 -1
  239. package/icons/LiFiFullLogo.d.ts +1 -1
  240. package/icons/LiFiLogo.d.ts +1 -1
  241. package/icons/LiFiToolLogo.d.ts +1 -1
  242. package/index.d.ts +1 -1
  243. package/package.json +13 -13
  244. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -1
  245. package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -1
  246. package/pages/SelectTokenPage/SelectTokenPage.js +4 -2
  247. package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -1
  248. package/pages/SelectWalletPage/SelectWalletPage.js +5 -5
  249. package/pages/SettingsPage/GasPriceSelect.d.ts +1 -1
  250. package/pages/SettingsPage/LanguageSelect.js +1 -1
  251. package/pages/SettingsPage/SettingsPage.d.ts +1 -1
  252. package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -1
  253. package/pages/SettingsPage/SlippageInput.d.ts +1 -1
  254. package/pages/SwapDetailsPage/SwapDetailsPage.js +6 -2
  255. package/pages/SwapPage/ExchangeRateBottomSheet.js +2 -2
  256. package/pages/SwapPage/StatusBottomSheet.js +18 -12
  257. package/pages/SwapPage/StatusBottomSheet.style.d.ts +1 -1
  258. package/pages/SwapPage/StatusBottomSheet.style.js +1 -1
  259. package/pages/SwapPage/SwapPage.js +33 -12
  260. package/pages/SwapPage/TokenValueBottomSheet.js +8 -13
  261. package/pages/SwapPage/utils.d.ts +2 -0
  262. package/pages/SwapPage/utils.js +6 -0
  263. package/providers/I18nProvider/I18nProvider.js +3 -3
  264. package/providers/SDKProvider/SDKProvider.js +2 -0
  265. package/providers/SwapFormProvider/FormUpdater.js +3 -0
  266. package/providers/WalletProvider/WalletProvider.js +108 -36
  267. package/providers/WalletProvider/index.d.ts +1 -1
  268. package/providers/WalletProvider/index.js +1 -1
  269. package/providers/WalletProvider/types.d.ts +4 -6
  270. package/providers/WidgetProvider/WidgetProvider.js +2 -2
  271. package/stores/StoreProvider.d.ts +2 -2
  272. package/stores/StoreProvider.js +3 -2
  273. package/stores/routes/RouteExecutionStore.d.ts +1 -1
  274. package/stores/routes/RouteExecutionStore.js +0 -1
  275. package/stores/settings/index.d.ts +1 -0
  276. package/stores/settings/index.js +1 -0
  277. package/stores/settings/types.d.ts +11 -0
  278. package/stores/settings/useSplitSubvariantStore.d.ts +7 -0
  279. package/stores/settings/useSplitSubvariantStore.js +37 -0
  280. package/tsconfig.cjs.tsbuildinfo +1 -1
  281. package/types/events.d.ts +9 -1
  282. package/types/events.js +1 -0
  283. package/types/token.d.ts +2 -2
  284. package/types/widget.d.ts +13 -8
  285. package/types/widget.js +4 -2
  286. package/utils/format.d.ts +1 -1
  287. package/utils/format.js +5 -10
  288. package/utils/wallet.d.ts +1 -1
  289. package/utils/wallet.js +1 -1
@@ -2,25 +2,47 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InsuranceCard = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ExpandLess_1 = require("@mui/icons-material/ExpandLess");
6
+ const ExpandMore_1 = require("@mui/icons-material/ExpandMore");
5
7
  const VerifiedUser_1 = require("@mui/icons-material/VerifiedUser");
6
8
  const material_1 = require("@mui/material");
9
+ const react_1 = require("react");
7
10
  const react_i18next_1 = require("react-i18next");
8
11
  const icons_1 = require("../../icons");
9
12
  const stores_1 = require("../../stores");
10
13
  const Card_1 = require("../Card");
11
14
  const Switch_1 = require("../Switch");
12
- const InsuranceCard = ({ status, feeAmountUsd, insuranceCoverageId, onChange, ...props }) => {
15
+ const InsuranceCard = ({ status, feeAmountUsd, insuredAmount, insuredTokenSymbol, insuranceCoverageId, onChange, ...props }) => {
13
16
  const { t } = (0, react_i18next_1.useTranslation)();
14
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { selectionColor: "secondary", indented: true, ...props, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [(0, jsx_runtime_1.jsxs)(Card_1.CardLabel, { type: 'insurance', children: [(0, jsx_runtime_1.jsx)(VerifiedUser_1.default, { fontSize: "inherit" }), (0, jsx_runtime_1.jsx)(Card_1.CardLabelTypography, { type: "icon", children: status === stores_1.RouteExecutionStatus.Idle
15
- ? t(`swap.tags.insurance`)
16
- : t(`swap.tags.insured`) })] }), (0, jsx_runtime_1.jsx)(icons_1.InsuraceLogo, {})] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 24, fontWeight: 700, lineHeight: 1, children: t('format.currency', {
17
- value: feeAmountUsd,
18
- }) }), status === stores_1.RouteExecutionStatus.Idle ? ((0, jsx_runtime_1.jsx)(Switch_1.Switch, { onChange: onChange })) : null] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, children: status === stores_1.RouteExecutionStatus.Idle
19
- ? 'Get 100% coverage for lost tokens.'
20
- : '100% coverage for lost tokens.' }), (0, jsx_runtime_1.jsx)(material_1.Link, { href: status === stores_1.RouteExecutionStatus.Idle
21
- ? 'https://docs.insurace.io/landing-page/documentation/cover-products/bridge-cover/li.fi'
22
- : `https://app.insurace.io/bridge-cover?search=${insuranceCoverageId}`, target: "_blank", underline: "none", color: "text.primary", children: (0, jsx_runtime_1.jsx)(material_1.Typography, { px: 0.5, color: "primary", fontSize: 12, fontWeight: 600, children: status === stores_1.RouteExecutionStatus.Idle
23
- ? 'Learn more'
24
- : 'View coverage' }) })] })] }));
17
+ const [enabled, setEnabled] = (0, react_1.useState)(false);
18
+ const [cardExpanded, setCardExpanded] = (0, react_1.useState)(status === stores_1.RouteExecutionStatus.Idle);
19
+ const handleExpand = (e) => {
20
+ e.stopPropagation();
21
+ setCardExpanded((expanded) => !expanded);
22
+ };
23
+ const handleSwitch = (_, checked) => {
24
+ setEnabled(checked);
25
+ onChange?.(checked);
26
+ };
27
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { selectionColor: "secondary", indented: true, ...props, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsxs)(Card_1.CardLabel, { type: 'insurance', children: [(0, jsx_runtime_1.jsx)(VerifiedUser_1.default, { fontSize: "inherit" }), (0, jsx_runtime_1.jsx)(Card_1.CardLabelTypography, { type: "icon", children: status === stores_1.RouteExecutionStatus.Idle
28
+ ? t('swap.tags.insurance')
29
+ : t('swap.tags.insured') })] }), status === stores_1.RouteExecutionStatus.Idle ? ((0, jsx_runtime_1.jsx)(Switch_1.Switch, { onChange: handleSwitch, value: enabled })) : ((0, jsx_runtime_1.jsx)(material_1.Box, { my: -0.5, children: (0, jsx_runtime_1.jsx)(Card_1.CardIconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? (0, jsx_runtime_1.jsx)(ExpandLess_1.default, {}) : (0, jsx_runtime_1.jsx)(ExpandMore_1.default, {}) }) }))] }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 24, fontWeight: 700, lineHeight: 1, children: t('format.currency', {
30
+ value: feeAmountUsd,
31
+ }) }), (0, jsx_runtime_1.jsx)(icons_1.InsuraceLogo, {})] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, children: (0, jsx_runtime_1.jsx)(react_i18next_1.Trans, { children: status === stores_1.RouteExecutionStatus.Idle
32
+ ? t('swap.insurance.insure', {
33
+ amount: insuredAmount,
34
+ tokenSymbol: insuredTokenSymbol,
35
+ })
36
+ : t('swap.insurance.insured', {
37
+ amount: insuredAmount,
38
+ tokenSymbol: insuredTokenSymbol,
39
+ }) }) }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: enabled || status !== stores_1.RouteExecutionStatus.Idle, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
40
+ listStyleType: 'disc',
41
+ pl: 2,
42
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, display: "list-item", children: t('swap.insurance.bridgeExploits') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, display: "list-item", children: t('swap.insurance.slippageError') })] }) }), (0, jsx_runtime_1.jsx)(material_1.Link, { href: status === stores_1.RouteExecutionStatus.Idle
43
+ ? 'https://docs.insurace.io/landing-page/documentation/cover-products/bridge-cover/li.fi'
44
+ : `https://app.insurace.io/bridge-cover?search=${insuranceCoverageId}`, target: "_blank", underline: "none", color: "text.primary", children: (0, jsx_runtime_1.jsx)(material_1.Typography, { pt: 0.5, color: "primary", fontSize: 14, fontWeight: 600, children: status === stores_1.RouteExecutionStatus.Idle
45
+ ? t('button.learnMore')
46
+ : t('button.viewCoverage') }) })] })] }) })] }));
25
47
  };
26
48
  exports.InsuranceCard = InsuranceCard;
@@ -3,23 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InsuranceCollapsed = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
- const react_1 = require("react");
7
6
  const hooks_1 = require("../../hooks");
8
7
  const stores_1 = require("../../stores");
8
+ const utils_1 = require("../../utils");
9
9
  const InsuranceCard_1 = require("./InsuranceCard");
10
- const InsuranceCollapsed = ({ status, insurableRouteId, insuranceCoverageId, feeAmountUsd, onChange, ...props }) => {
11
- const [insuredRoute, setInsuredRoute] = (0, react_1.useState)();
10
+ const InsuranceCollapsed = ({ status, insurableRouteId, onChange, ...props }) => {
12
11
  const setExecutableRoute = (0, stores_1.useSetExecutableRoute)();
13
12
  const routeExecution = (0, stores_1.useRouteExecutionStore)((state) => state.routes[insurableRouteId]);
14
- (0, hooks_1.useSwapRoutes)({
13
+ const { routes } = (0, hooks_1.useSwapRoutes)({
15
14
  insurableRoute: routeExecution?.route,
16
- onSettled(data) {
17
- if (data?.routes?.[0]) {
18
- setInsuredRoute(data.routes[0]);
19
- }
20
- },
21
15
  });
22
- const toggleInsurance = (_, checked) => {
16
+ const insuredRoute = routes?.[0];
17
+ const toggleInsurance = (checked) => {
23
18
  if (insuredRoute) {
24
19
  if (checked) {
25
20
  setExecutableRoute(insuredRoute, insurableRouteId);
@@ -27,6 +22,9 @@ const InsuranceCollapsed = ({ status, insurableRouteId, insuranceCoverageId, fee
27
22
  onChange?.(checked ? insuredRoute.id : insurableRouteId);
28
23
  }
29
24
  };
30
- return ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: insuredRoute?.insurance?.state === 'INSURED', unmountOnExit: true, mountOnEnter: true, appear: status === stores_1.RouteExecutionStatus.Idle, children: (0, jsx_runtime_1.jsx)(InsuranceCard_1.InsuranceCard, { feeAmountUsd: feeAmountUsd, status: status, insuranceCoverageId: insuranceCoverageId, onChange: toggleInsurance, ...props }) }));
25
+ if (!insuredRoute) {
26
+ return null;
27
+ }
28
+ return ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: insuredRoute.insurance.state === 'INSURED', unmountOnExit: true, mountOnEnter: true, appear: status === stores_1.RouteExecutionStatus.Idle, children: (0, jsx_runtime_1.jsx)(InsuranceCard_1.InsuranceCard, { ...props, status: status, insuredAmount: (0, utils_1.formatTokenAmount)(insuredRoute.toAmountMin, insuredRoute.toToken.decimals), insuredTokenSymbol: insuredRoute.toToken.symbol, onChange: toggleInsurance }) }));
31
29
  };
32
30
  exports.InsuranceCollapsed = InsuranceCollapsed;
@@ -1 +1,2 @@
1
1
  export * from './Insurance';
2
+ export * from './types';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Insurance"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -1,16 +1,19 @@
1
- /// <reference types="react" />
2
1
  import type { BoxProps } from '@mui/material';
3
2
  import type { RouteExecutionStatus } from '../../stores';
4
- export interface InsuranceProps extends Omit<BoxProps, 'onChange'> {
5
- insurableRouteId: string;
6
- feeAmountUsd?: string;
3
+ export interface InsuredAmount {
4
+ insuredAmount: string;
5
+ insuredTokenSymbol: string;
6
+ }
7
+ interface Insurance extends InsuredAmount {
8
+ feeAmountUsd: string;
7
9
  insuranceCoverageId?: string;
8
10
  status?: RouteExecutionStatus;
11
+ }
12
+ export interface InsuranceProps extends Insurance, Omit<BoxProps, 'onChange'> {
13
+ insurableRouteId: string;
9
14
  onChange?: (routeId: string) => void;
10
15
  }
11
- export interface InsuranceCardProps {
12
- feeAmountUsd?: string;
13
- status?: RouteExecutionStatus;
14
- insuranceCoverageId?: string;
15
- onChange?: (_: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
16
+ export interface InsuranceCardProps extends Insurance, Omit<BoxProps, 'onChange'> {
17
+ onChange?: (checked: boolean) => void;
16
18
  }
19
+ export {};
@@ -9,7 +9,7 @@ const react_i18next_1 = require("react-i18next");
9
9
  const providers_1 = require("../../providers");
10
10
  const Token_1 = require("../Token");
11
11
  const NFT_style_1 = require("./NFT.style");
12
- const NFT = ({ imageUrl, isLoading, collectonName, assetName, owner, token, contract, ...props }) => {
12
+ const NFT = ({ imageUrl, isLoading, collectionName, assetName, owner, token, contract, ...props }) => {
13
13
  const { t } = (0, react_i18next_1.useTranslation)();
14
14
  const { setValue } = (0, react_hook_form_1.useFormContext)();
15
15
  (0, react_1.useEffect)(() => {
@@ -24,6 +24,6 @@ const NFT = ({ imageUrl, isLoading, collectonName, assetName, owner, token, cont
24
24
  setValue(providers_1.SwapFormKey.ToContractGasLimit, contract.gasLimit);
25
25
  }
26
26
  }, [contract, setValue, token]);
27
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { p: 2, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", children: [isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 96, height: 96, variant: "rectangular", sx: { borderRadius: 1 } })) : ((0, jsx_runtime_1.jsx)(NFT_style_1.PreviewAvatar, { src: imageUrl })), (0, jsx_runtime_1.jsxs)(material_1.Box, { ml: 2, children: [isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 144, height: 21, variant: "text" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", children: collectonName })), isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 112, height: 27, variant: "text" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 18, fontWeight: 600, children: assetName })), isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 128, height: 21, variant: "text" })) : owner ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 14, color: "text.secondary", children: [t('swap.ownedBy'), ' ', (0, jsx_runtime_1.jsx)(material_1.Link, { href: owner.url, target: "_blank", underline: "none", color: "primary", children: owner.name })] })) : null] })] }), (0, jsx_runtime_1.jsx)(Token_1.Token, { token: token, isLoading: isLoading, mt: 2 })] }));
27
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { p: 2, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", children: [isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 96, height: 96, variant: "rectangular", sx: { borderRadius: 1 } })) : ((0, jsx_runtime_1.jsx)(NFT_style_1.PreviewAvatar, { src: imageUrl })), (0, jsx_runtime_1.jsxs)(material_1.Box, { ml: 2, children: [isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 144, height: 21, variant: "text" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", children: collectionName })), isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 112, height: 27, variant: "text" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 18, fontWeight: 600, children: assetName })), isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 128, height: 21, variant: "text" })) : owner ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 14, color: "text.secondary", children: [t('swap.ownedBy'), ' ', (0, jsx_runtime_1.jsx)(material_1.Link, { href: owner.url, target: "_blank", underline: "none", color: "primary", children: owner.name })] })) : null] })] }), (0, jsx_runtime_1.jsx)(Token_1.Token, { token: token, isLoading: isLoading, mt: 2 })] }));
28
28
  };
29
29
  exports.NFT = NFT;
@@ -2,7 +2,7 @@ import type { TokenAmount } from '@lifi/sdk';
2
2
  import type { WidgetContract } from '../../types';
3
3
  export interface NFTProps {
4
4
  imageUrl?: string;
5
- collectonName?: string;
5
+ collectionName?: string;
6
6
  assetName?: string;
7
7
  isLoading?: boolean;
8
8
  owner?: NFTOwner;
@@ -8,7 +8,6 @@ const version_1 = require("../../config/version");
8
8
  const providers_1 = require("../../providers");
9
9
  const types_1 = require("../../types");
10
10
  const utils_1 = require("../../utils");
11
- const LiFiLogo_1 = require("../LiFiLogo");
12
11
  const PoweredBy_style_1 = require("./PoweredBy.style");
13
12
  const PoweredBy = () => {
14
13
  const { hiddenUI } = (0, providers_1.useWidgetConfig)();
@@ -17,10 +16,10 @@ const PoweredBy = () => {
17
16
  pathname.includes(utils_1.navigationRoutes.toToken)) {
18
17
  return null;
19
18
  }
20
- return ((0, jsx_runtime_1.jsx)(material_1.Box, { px: 3, py: hiddenUI?.includes(types_1.HiddenUI.PoweredBy) ? 1 : 2, sx: {
19
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, { px: 3, pt: 1, pb: hiddenUI?.includes(types_1.HiddenUI.PoweredBy) ? 1 : 2, sx: {
21
20
  display: 'flex',
22
21
  alignItems: 'flex-end',
23
22
  justifyContent: 'flex-end',
24
- }, children: !hiddenUI?.includes(types_1.HiddenUI.PoweredBy) ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: `v${version_1.version}`, placement: "top", enterDelay: 3000, arrow: true, children: (0, jsx_runtime_1.jsxs)(PoweredBy_style_1.Link, { href: "https://li.fi", target: "_blank", underline: "none", color: "text.primary", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { color: "text.secondary", fontSize: 12, px: 0.5, children: "Powered by" }), (0, jsx_runtime_1.jsx)(LiFiLogo_1.LiFiLogo, { variant: "full", style: { height: 16, width: 42 } })] }) })) : null }));
23
+ }, children: !hiddenUI?.includes(types_1.HiddenUI.PoweredBy) ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: `v${version_1.version}`, placement: "top", enterDelay: 1000, arrow: true, children: (0, jsx_runtime_1.jsxs)(PoweredBy_style_1.Link, { href: "https://li.fi", target: "_blank", underline: "none", color: "text.primary", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { color: "text.secondary", fontSize: 12, fontWeight: 500, px: 0.5, children: "Powered by" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { color: "text.primary", fontSize: 12, fontWeight: 500, children: "LI.FI" })] }) })) : null }));
25
24
  };
26
25
  exports.PoweredBy = PoweredBy;
@@ -10,7 +10,7 @@ const providers_1 = require("../providers");
10
10
  const types_1 = require("../types");
11
11
  const SelectChainAndToken = (props) => {
12
12
  const prefersNarrowView = (0, material_1.useMediaQuery)((theme) => theme.breakpoints.down('sm'));
13
- const { disabledUI, variant } = (0, providers_1.useWidgetConfig)();
13
+ const { disabledUI, hiddenUI, variant } = (0, providers_1.useWidgetConfig)();
14
14
  const [fromChain, toChain, fromToken, toToken] = (0, react_hook_form_1.useWatch)({
15
15
  name: [
16
16
  providers_1.SwapFormKey.FromChain,
@@ -19,20 +19,21 @@ const SelectChainAndToken = (props) => {
19
19
  providers_1.SwapFormKey.ToToken,
20
20
  ],
21
21
  });
22
- const disabledReverse = variant === 'refuel' ||
22
+ const hiddenReverse = variant === 'refuel' ||
23
23
  disabledUI?.includes(types_1.DisabledUI.FromToken) ||
24
- disabledUI?.includes(types_1.DisabledUI.ToToken);
25
- const nftVariant = variant === 'nft';
24
+ disabledUI?.includes(types_1.DisabledUI.ToToken) ||
25
+ hiddenUI?.includes(types_1.HiddenUI.ToToken);
26
+ const hiddenToToken = variant === 'nft' || hiddenUI?.includes(types_1.HiddenUI.ToToken);
26
27
  const isCompact = fromChain &&
27
28
  toChain &&
28
29
  fromToken &&
29
30
  toToken &&
30
31
  !prefersNarrowView &&
31
- !nftVariant;
32
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' }, ...props, children: [(0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "from", compact: isCompact }), !nftVariant ? ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
32
+ !hiddenToToken;
33
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' }, ...props, children: [(0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "from", compact: isCompact }), !hiddenToToken ? ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
33
34
  display: 'flex',
34
35
  justifyContent: 'center',
35
36
  alignItems: 'center',
36
- }, m: !disabledReverse ? -1.125 : 1, children: !disabledReverse ? ((0, jsx_runtime_1.jsx)(ReverseTokensButton_1.ReverseTokensButton, { vertical: !isCompact })) : null })) : null, !nftVariant ? ((0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "to", compact: isCompact })) : null] }));
37
+ }, m: !hiddenReverse ? -1.125 : 1, children: !hiddenReverse ? ((0, jsx_runtime_1.jsx)(ReverseTokensButton_1.ReverseTokensButton, { vertical: !isCompact })) : null })) : null, !hiddenToToken ? ((0, jsx_runtime_1.jsx)(SelectTokenButton_1.SelectTokenButton, { formType: "to", compact: isCompact })) : null] }));
37
38
  };
38
39
  exports.SelectChainAndToken = SelectChainAndToken;
@@ -16,6 +16,7 @@ const SelectTokenButton = ({ formType, compact }) => {
16
16
  const { t } = (0, react_i18next_1.useTranslation)();
17
17
  const navigate = (0, react_router_dom_1.useNavigate)();
18
18
  const { disabledUI, variant } = (0, providers_1.useWidgetConfig)();
19
+ const swapOnly = (0, hooks_1.useSwapOnly)();
19
20
  const tokenKey = providers_1.SwapFormKeyHelper.getTokenKey(formType);
20
21
  const [chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
21
22
  name: [providers_1.SwapFormKeyHelper.getChainKey(formType), tokenKey],
@@ -32,10 +33,12 @@ const SelectTokenButton = ({ formType, compact }) => {
32
33
  const isSelected = !!(chain && token);
33
34
  const onClick = !disabledUI?.includes(tokenKey) ? handleClick : undefined;
34
35
  const defaultPlaceholder = formType === 'to' && variant === 'refuel'
35
- ? t(`header.selectChain`)
36
- : t(`swap.selectChainAndToken`);
36
+ ? t('swap.selectChain')
37
+ : formType === 'to' && swapOnly
38
+ ? t('swap.selectToken')
39
+ : t('swap.selectChainAndToken');
37
40
  const cardTitle = formType === 'from' && variant === 'nft'
38
- ? t(`swap.payWith`)
41
+ ? t(`header.payWith`)
39
42
  : t(`swap.${formType}`);
40
43
  return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { flex: 1, onClick: onClick, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: cardTitle }), chainId && tokenAddress && (isChainLoading || isTokenLoading) ? ((0, jsx_runtime_1.jsx)(SelectTokenButton_style_1.SelectTokenCardHeader, { avatar: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32 }), title: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 64, height: 24 }), subheader: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 64, height: 16 }), compact: compact })) : ((0, jsx_runtime_1.jsx)(SelectTokenButton_style_1.SelectTokenCardHeader, { avatar: isSelected ? ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: token, chain: chain })) : ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatarDefault, {})), title: isSelected ? token.symbol : defaultPlaceholder, subheader: isSelected ? t(`swap.onChain`, { chainName: chain.name }) : null, selected: isSelected, compact: compact }))] }));
41
44
  };
@@ -15,7 +15,7 @@ const SendToWallet_style_1 = require("./SendToWallet.style");
15
15
  exports.SendToWallet = (0, react_1.forwardRef)((props, ref) => {
16
16
  const { t } = (0, react_i18next_1.useTranslation)();
17
17
  const { trigger, getValues, clearErrors } = (0, react_hook_form_1.useFormContext)();
18
- const { account, provider } = (0, providers_1.useWallet)();
18
+ const { account } = (0, providers_1.useWallet)();
19
19
  const { disabledUI, hiddenUI, requiredUI, toAddress } = (0, providers_1.useWidgetConfig)();
20
20
  const { showSendToWallet, showSendToWalletDirty, setSendToWallet } = (0, stores_1.useSendToWalletStore)();
21
21
  const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
@@ -33,7 +33,7 @@ exports.SendToWallet = (0, react_1.forwardRef)((props, ref) => {
33
33
  if (!value) {
34
34
  return true;
35
35
  }
36
- const address = await provider?.resolveName(value);
36
+ const address = await account.signer?.provider?.resolveName(value);
37
37
  return ((0, address_1.isAddress)(address || value) ||
38
38
  t('swap.error.title.walletAddressInvalid'));
39
39
  }
@@ -33,4 +33,4 @@ export declare const SmallAvatarSkeletonContainer: import("@emotion/styled").Sty
33
33
  } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
34
34
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
35
35
  }, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
36
- export declare const SmallAvatarSkeleton: () => JSX.Element;
36
+ export declare const SmallAvatarSkeleton: () => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import type { Process } from '@lifi/sdk';
2
2
  export declare function CircularProgress({ process }: {
3
3
  process: Process;
4
- }): JSX.Element;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,7 @@ const Card_1 = require("../../components/Card");
8
8
  const StepActions_1 = require("../../components/StepActions");
9
9
  const Token_1 = require("../../components/Token");
10
10
  const hooks_1 = require("../../hooks");
11
+ const providers_1 = require("../../providers");
11
12
  const utils_1 = require("../../utils");
12
13
  const DestinationWalletAddress_1 = require("./DestinationWalletAddress");
13
14
  const GasStepProcess_1 = require("./GasStepProcess");
@@ -16,6 +17,7 @@ const StepTimer_1 = require("./StepTimer");
16
17
  const Step = ({ step, fromToken, toToken, toAddress }) => {
17
18
  const { t } = (0, react_i18next_1.useTranslation)();
18
19
  const { getChainById } = (0, hooks_1.useChains)();
20
+ const { variant } = (0, providers_1.useWidgetConfig)();
19
21
  const stepHasError = step.execution?.process.some((process) => process.status === 'FAILED');
20
22
  const getCardTitle = () => {
21
23
  switch (step.type) {
@@ -23,17 +25,25 @@ const Step = ({ step, fromToken, toToken, toAddress }) => {
23
25
  const hasCrossStep = step.includedSteps.some((step) => step.type === 'cross');
24
26
  const hasSwapStep = step.includedSteps.some((step) => step.type === 'swap');
25
27
  if (hasCrossStep && hasSwapStep) {
26
- return t('swap.stepSwapAndBridge');
28
+ return variant === 'nft'
29
+ ? t('swap.stepBridgeAndBuy')
30
+ : t('swap.stepSwapAndBridge');
27
31
  }
28
32
  if (hasCrossStep) {
29
- return t('swap.stepBridge');
33
+ return variant === 'nft'
34
+ ? t('swap.stepBridgeAndBuy')
35
+ : t('swap.stepBridge');
30
36
  }
31
- return t('swap.stepSwap');
37
+ return variant === 'nft'
38
+ ? t('swap.stepSwapAndBuy')
39
+ : t('swap.stepSwap');
32
40
  default:
33
- return t('swap.stepSwap');
41
+ return variant === 'nft'
42
+ ? t('swap.stepSwapAndBuy')
43
+ : t('swap.stepSwap');
34
44
  }
35
45
  };
36
- const formattedToAddress = (0, utils_1.shortenWalletAddress)(toAddress);
46
+ const formattedToAddress = (0, utils_1.shortenAddress)(toAddress);
37
47
  const toAddressLink = toAddress
38
48
  ? `${getChainById(step.action.toChainId)?.metamask.blockExplorerUrls[0]}address/${toAddress}`
39
49
  : undefined;
@@ -1,2 +1,2 @@
1
1
  import type { Route } from '@lifi/sdk';
2
- export declare const getStepList: (route?: Route) => JSX.Element[] | undefined;
2
+ export declare const getStepList: (route?: Route) => import("react/jsx-runtime").JSX.Element[] | undefined;
@@ -18,27 +18,13 @@ const SmallAvatar_1 = require("../SmallAvatar");
18
18
  const StepActions_style_1 = require("./StepActions.style");
19
19
  const StepActions = ({ step, dense, ...other }) => {
20
20
  const { t } = (0, react_i18next_1.useTranslation)();
21
- const { variant, contractTool } = (0, providers_1.useWidgetConfig)();
21
+ const { variant } = (0, providers_1.useWidgetConfig)();
22
22
  const [cardExpanded, setCardExpanded] = (0, react_1.useState)(false);
23
23
  const handleExpand = (e) => {
24
24
  e.stopPropagation();
25
25
  setCardExpanded((expanded) => !expanded);
26
26
  };
27
- const customStep = variant === 'nft'
28
- ? step.includedSteps?.find((step) => step.type === 'custom')
29
- : undefined;
30
27
  const hasCollapsedSteps = dense && step.includedSteps?.length > 1;
31
- if (customStep && contractTool) {
32
- const toolDetails = {
33
- key: contractTool.name,
34
- name: contractTool.name,
35
- logoURI: contractTool.logoURI,
36
- };
37
- customStep.toolDetails = toolDetails;
38
- if (dense) {
39
- step.toolDetails = toolDetails;
40
- }
41
- }
42
28
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ...other, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: (0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, { children: (0, jsx_runtime_1.jsx)(icons_1.LiFiToolLogo, {}) }), children: (0, jsx_runtime_1.jsx)(StepActions_style_1.StepAvatar, { variant: "circular", src: step.toolDetails.logoURI, alt: step.toolDetails.name, children: step.toolDetails.name[0] }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { ml: 2, fontSize: 18, fontWeight: "500", flex: 1, children: t(`swap.stepDetails`, {
43
29
  tool: step.toolDetails.name,
44
30
  }) }), hasCollapsedSteps ? ((0, jsx_runtime_1.jsx)(Card_1.CardIconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? (0, jsx_runtime_1.jsx)(ExpandLess_1.default, {}) : (0, jsx_runtime_1.jsx)(ExpandMore_1.default, {}) })) : null] }), hasCollapsedSteps ? ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)(exports.IncludedSteps, { step: step, variant: variant }) })) : ((0, jsx_runtime_1.jsx)(exports.IncludedSteps, { step: step, variant: variant }))] }));
@@ -69,15 +55,13 @@ const StepDetailsContent = ({ step, variant }) => {
69
55
  if (sameTokenProtocolStep) {
70
56
  fromAmount = (0, big_js_1.default)(step.estimate.fromAmount)
71
57
  .div(10 ** step.action.fromToken.decimals)
72
- .minus((0, big_js_1.default)(step.estimate.toAmount).div(10 ** step.action.toToken.decimals));
58
+ .minus((0, big_js_1.default)(step.estimate.toAmount).div(10 ** step.action.toToken.decimals))
59
+ .toString();
73
60
  }
74
61
  else {
75
62
  fromAmount = (0, utils_1.formatTokenAmount)(step.estimate.fromAmount, step.action.fromToken.decimals);
76
63
  }
77
- const showToAmount = step.type !== 'custom' &&
78
- step.tool !== 'custom' &&
79
- variant !== 'nft' &&
80
- !sameTokenProtocolStep;
64
+ const showToAmount = step.type !== 'custom' && step.tool !== 'custom' && !sameTokenProtocolStep;
81
65
  return ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", alignItems: "center", display: "flex", children: [t('format.number', {
82
66
  value: fromAmount,
83
67
  }), ' ', step.action.fromToken.symbol, showToAmount ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ArrowForward_1.default, { sx: { fontSize: 18, paddingX: 0.5 } }), t('format.number', {
@@ -28,14 +28,26 @@ const SwapButton = ({ onClick, hasRoute, text, disabled, loading, }) => {
28
28
  const getButtonText = () => {
29
29
  if (account.isActive) {
30
30
  if (!hasRoute) {
31
- return variant !== 'refuel' ? t(`button.swap`) : t(`button.getGas`);
31
+ switch (variant) {
32
+ case 'nft':
33
+ return t(`button.buy`);
34
+ case 'refuel':
35
+ return t(`button.getGas`);
36
+ default:
37
+ return t(`button.swap`);
38
+ }
32
39
  }
33
40
  if (text) {
34
41
  return text;
35
42
  }
36
- return variant !== 'refuel'
37
- ? t(`button.reviewSwap`)
38
- : t(`button.reviewGasSwap`);
43
+ switch (variant) {
44
+ case 'nft':
45
+ return t(`button.reviewPurchase`);
46
+ case 'refuel':
47
+ return t(`button.reviewGasSwap`);
48
+ default:
49
+ return t(`button.reviewSwap`);
50
+ }
39
51
  }
40
52
  return t(`button.connectWallet`);
41
53
  };
@@ -25,7 +25,7 @@ const FormPriceHelperText = ({ formType, }) => {
25
25
  }, children: t(`format.currency`, {
26
26
  value: fromAmountTokenPrice,
27
27
  }) }), isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 16, sx: { borderRadius: 0.25 } })) : token?.amount ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", lineHeight: 1.3334, pl: 0.25, children: `/ ${t(`format.number`, {
28
- value: token?.amount,
28
+ value: (0, utils_1.formatTokenAmount)(token?.amount),
29
29
  })}` })) : null] }));
30
30
  };
31
31
  exports.FormPriceHelperText = FormPriceHelperText;
@@ -24,12 +24,12 @@ const SwapInput = ({ formType, ...props }) => {
24
24
  const ref = (0, react_1.useRef)(null);
25
25
  const handleChange = (event) => {
26
26
  const { value } = event.target;
27
- const formattedAmount = (0, utils_1.formatAmount)(value, true);
27
+ const formattedAmount = (0, utils_1.formatInputAmount)(value, true);
28
28
  onChange(formattedAmount);
29
29
  };
30
30
  const handleBlur = (event) => {
31
31
  const { value } = event.target;
32
- const formattedAmount = (0, utils_1.formatAmount)(value);
32
+ const formattedAmount = (0, utils_1.formatInputAmount)(value);
33
33
  onChange(formattedAmount);
34
34
  onBlur();
35
35
  };
@@ -1,2 +1,2 @@
1
1
  import type { SwapFormTypeProps } from '../../providers';
2
- export declare const SwapInputEndAdornment: ({ formType }: SwapFormTypeProps) => JSX.Element;
2
+ export declare const SwapInputEndAdornment: ({ formType }: SwapFormTypeProps) => import("react/jsx-runtime").JSX.Element;
@@ -24,7 +24,7 @@ const SwapInputEndAdornment = ({ formType }) => {
24
24
  const { token, isLoading } = (0, hooks_1.useTokenAddressBalance)(chainId, tokenAddress);
25
25
  const handleMax = () => {
26
26
  const chain = getChainById(chainId);
27
- let maxAmount;
27
+ let maxAmount = token?.amount;
28
28
  if (chain?.nativeToken.address === tokenAddress &&
29
29
  data?.available &&
30
30
  data?.recommended) {
@@ -36,7 +36,7 @@ const SwapInputEndAdornment = ({ formType }) => {
36
36
  maxAmount = (0, utils_1.formatTokenAmount)(tokenAmount.minus(recommendedAmount).toString());
37
37
  }
38
38
  }
39
- setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), maxAmount || token?.amount || '', {
39
+ setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), maxAmount || '', {
40
40
  shouldTouch: true,
41
41
  });
42
42
  };
@@ -9,6 +9,7 @@ const material_1 = require("@mui/material");
9
9
  const react_1 = require("react");
10
10
  const react_i18next_1 = require("react-i18next");
11
11
  const providers_1 = require("../../providers");
12
+ const utils_1 = require("../../utils");
12
13
  const Card_1 = require("../Card");
13
14
  const StepActions_1 = require("../StepActions");
14
15
  const Token_1 = require("../Token");
@@ -25,9 +26,24 @@ const SwapRouteCard = ({ route, active, variant = 'default', expanded, ...other
25
26
  const token = widgetVariant === 'nft'
26
27
  ? { ...route.fromToken, amount: route.fromAmount }
27
28
  : { ...route.toToken, amount: route.toAmount };
28
- const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, children: [widgetVariant !== 'refuel' && (insurable || route.tags?.length) ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", mb: 2, children: [insurable ? ((0, jsx_runtime_1.jsxs)(Card_1.CardLabel, { type: route.tags?.length && !cardExpanded
29
- ? 'insurance-icon'
30
- : 'insurance', children: [(0, jsx_runtime_1.jsx)(VerifiedUser_1.default, { fontSize: "inherit" }), cardExpanded || !route.tags?.length ? ((0, jsx_runtime_1.jsx)(Card_1.CardLabelTypography, { type: "icon", children: t(`swap.tags.insurable`) })) : null] })) : null, route.tags?.length ? ((0, jsx_runtime_1.jsx)(Card_1.CardLabel, { type: active ? 'active' : undefined, children: (0, jsx_runtime_1.jsx)(Card_1.CardLabelTypography, { children: t(`swap.tags.${route.tags[0].toLowerCase()}`) }) })) : null] })) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", alignItems: "start", children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: token, step: !cardExpanded ? route.steps[0] : undefined }), !expanded ? ((0, jsx_runtime_1.jsx)(Card_1.CardIconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? (0, jsx_runtime_1.jsx)(ExpandLess_1.default, {}) : (0, jsx_runtime_1.jsx)(ExpandMore_1.default, {}) })) : null] }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: route.steps.map((step) => ((0, jsx_runtime_1.jsx)(StepActions_1.StepActions, { step: step, mt: 2 }, step.id))) }), (0, jsx_runtime_1.jsx)(SwapRouteCardEssentials_1.SwapRouteCardEssentials, { route: route })] }));
29
+ const RecommendedTagTooltip = route.tags?.[0] === 'RECOMMENDED' ? RecommendedTooltip : react_1.Fragment;
30
+ const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, children: [widgetVariant !== 'refuel' && (insurable || route.tags?.length) ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", mb: 2, children: [insurable ? ((0, jsx_runtime_1.jsx)(InsuranceTooltip, { insuredAmount: (0, utils_1.formatTokenAmount)(route.toAmountMin, route.toToken.decimals), insuredTokenSymbol: route.toToken.symbol, children: (0, jsx_runtime_1.jsxs)(Card_1.CardLabel, { type: route.tags?.length && !cardExpanded
31
+ ? 'insurance-icon'
32
+ : 'insurance', children: [(0, jsx_runtime_1.jsx)(VerifiedUser_1.default, { fontSize: "inherit" }), cardExpanded || !route.tags?.length ? ((0, jsx_runtime_1.jsx)(Card_1.CardLabelTypography, { type: "icon", children: t(`swap.tags.insurable`) })) : null] }) })) : null, route.tags?.length ? ((0, jsx_runtime_1.jsx)(RecommendedTagTooltip, { children: (0, jsx_runtime_1.jsx)(Card_1.CardLabel, { type: active ? 'active' : undefined, children: (0, jsx_runtime_1.jsx)(Card_1.CardLabelTypography, { children: t(`swap.tags.${route.tags[0].toLowerCase()}`) }) }) })) : null] })) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", alignItems: "start", children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: token, step: !cardExpanded ? route.steps[0] : undefined }), !expanded ? ((0, jsx_runtime_1.jsx)(Card_1.CardIconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? (0, jsx_runtime_1.jsx)(ExpandLess_1.default, {}) : (0, jsx_runtime_1.jsx)(ExpandMore_1.default, {}) })) : null] }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: route.steps.map((step) => ((0, jsx_runtime_1.jsx)(StepActions_1.StepActions, { step: step, mt: 2 }, step.id))) }), (0, jsx_runtime_1.jsx)(SwapRouteCardEssentials_1.SwapRouteCardEssentials, { route: route })] }));
31
33
  return widgetVariant === 'refuel' || variant === 'cardless' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, { variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true, ...other, children: cardContent }));
32
34
  };
33
35
  exports.SwapRouteCard = SwapRouteCard;
36
+ const InsuranceTooltip = ({ insuredAmount, insuredTokenSymbol, children }) => {
37
+ const { t } = (0, react_i18next_1.useTranslation)();
38
+ return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "span", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, fontWeight: "500", children: t('swap.insurance.insure', {
39
+ amount: insuredAmount,
40
+ tokenSymbol: insuredTokenSymbol,
41
+ }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
42
+ listStyleType: 'disc',
43
+ pl: 2,
44
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, fontWeight: "500", display: "list-item", children: t('swap.insurance.bridgeExploits') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, fontWeight: "500", display: "list-item", children: t('swap.insurance.slippageError') })] })] }), placement: "top", enterDelay: 400, arrow: true, children: children }));
45
+ };
46
+ const RecommendedTooltip = ({ children, }) => {
47
+ const { t } = (0, react_i18next_1.useTranslation)();
48
+ return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t('tooltip.recommended'), placement: "top", enterDelay: 400, arrow: true, children: children }));
49
+ };
@@ -18,7 +18,7 @@ const SwapRouteCardEssentials = ({ route, dense }) => {
18
18
  const gasCostUSD = parseFloat(route.gasCostUSD ?? '') || 0.01;
19
19
  const gasCosts = (0, utils_1.getGasCostsBreakdown)(route);
20
20
  const feeCosts = (0, utils_1.getFeeCostsBreakdown)(route, false);
21
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: 'space-between', flex: 1, mt: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "span", children: [t(`tooltip.estimatedNetworkFee`), gasCosts.map((gas, index) => ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 11, children: [gas.amount?.toFixed(9), " ", gas.token.symbol, " (", t(`format.currency`, { value: gas.amountUSD }), ")"] }, `${gas.token.address}${index}`)))] }), placement: "top", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconTypography, { children: (0, jsx_runtime_1.jsx)(EvStation_1.default, { fontSize: "small" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t(`format.currency`, { value: gasCostUSD }) })] }) }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "span", children: [t(`tooltip.additionalProviderFee`), feeCosts.map((fee, index) => ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 11, children: [fee.amount?.toFixed(9), " ", fee.token.symbol, " (", t(`format.currency`, { value: fee.amountUSD }), ")"] }, `${fee.token.address}${index}`)))] }), placement: "top", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconTypography, { children: (0, jsx_runtime_1.jsx)(MonetizationOn_1.default, { fontSize: "small" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t(`format.currency`, {
21
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: 'space-between', flex: 1, mt: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "span", children: [t(`tooltip.estimatedNetworkFee`), gasCosts.map((gas, index) => ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 12, fontWeight: "500", children: [gas.amount?.toFixed(9), " ", gas.token.symbol, " (", t(`format.currency`, { value: gas.amountUSD }), ")"] }, `${gas.token.address}${index}`)))] }), placement: "top", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconTypography, { children: (0, jsx_runtime_1.jsx)(EvStation_1.default, { fontSize: "small" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t(`format.currency`, { value: gasCostUSD }) })] }) }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "span", children: [t(`tooltip.additionalProviderFee`), feeCosts.map((fee, index) => ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 12, fontWeight: "500", children: [fee.amount?.toFixed(9), " ", fee.token.symbol, " (", t(`format.currency`, { value: fee.amountUSD }), ")"] }, `${fee.token.address}${index}`)))] }), placement: "top", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconTypography, { children: (0, jsx_runtime_1.jsx)(MonetizationOn_1.default, { fontSize: "small" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t(`format.currency`, {
22
22
  value: feeCosts.reduce((sum, feeCost) => sum + feeCost.amountUSD, 0),
23
23
  }) })] }) }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`tooltip.estimatedTime`), placement: "top", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconTypography, { children: (0, jsx_runtime_1.jsx)(AccessTimeFilled_1.default, { fontSize: "small" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t('swap.estimatedTime', {
24
24
  value: executionTimeMinutes,
@@ -7,7 +7,7 @@ const providers_1 = require("../../providers");
7
7
  const Card_1 = require("../Card");
8
8
  const SwapRouteCardSkeleton = ({ variant, ...other }) => {
9
9
  const { variant: widgetVariant } = (0, providers_1.useWidgetConfig)();
10
- const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, children: [widgetVariant !== 'refuel' ? ((0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", alignItems: "center", mb: 2, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 112, height: 24, sx: (theme) => ({
10
+ const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, children: [widgetVariant !== 'refuel' && widgetVariant !== 'nft' ? ((0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", alignItems: "center", mb: 2, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 112, height: 24, sx: (theme) => ({
11
11
  borderRadius: `${theme.shape.borderRadius}px`,
12
12
  }) }) })) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { mr: 2, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32 }) }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 96, height: 32 })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { ml: 6, display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 102, height: 16 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 72, height: 16, sx: { marginLeft: 1 } })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, display: "flex", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 64, height: 20 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 64, height: 20 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 20 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 32, height: 20 })] })] }));
13
13
  return widgetVariant === 'refuel' || variant === 'cardless' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, { indented: true, ...other, children: cardContent }));
@@ -28,7 +28,7 @@ const SwapRoutes = (props) => {
28
28
  const routeNotFound = !currentRoute && !isLoading && !isFetching;
29
29
  const onlyRecommendedRoute = variant === 'refuel' || useRecommendedRoute;
30
30
  const showAll = !onlyRecommendedRoute && !routeNotFound && (routes?.length ?? 0) > 1;
31
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { ...props, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.routes') }), (0, jsx_runtime_1.jsx)(ProgressToNextUpdate_1.ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: {
31
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { ...props, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: variant === 'nft' ? t('swap.fromAmount') : t('header.routes') }), (0, jsx_runtime_1.jsx)(ProgressToNextUpdate_1.ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: {
32
32
  position: 'absolute',
33
33
  top: 8,
34
34
  right: 8,
@@ -1,2 +1,2 @@
1
- export declare const SwapRoutesExpanded: () => JSX.Element;
2
- export declare const SwapRoutesExpandedElement: () => JSX.Element;
1
+ export declare const SwapRoutesExpanded: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const SwapRoutesExpandedElement: () => import("react/jsx-runtime").JSX.Element;