@lifi/widget 1.20.3 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/App.d.ts +2 -2
  2. package/App.js +5 -3
  3. package/AppDrawer.d.ts +3 -8
  4. package/AppDrawer.style.d.ts +1 -1
  5. package/AppProvider.d.ts +2 -5
  6. package/AppProvider.js +2 -2
  7. package/AppRoutes.js +5 -0
  8. package/cjs/App.d.ts +2 -2
  9. package/cjs/App.js +5 -4
  10. package/cjs/AppDrawer.d.ts +3 -8
  11. package/cjs/AppDrawer.style.d.ts +1 -1
  12. package/cjs/AppProvider.d.ts +2 -5
  13. package/cjs/AppProvider.js +1 -1
  14. package/cjs/AppRoutes.js +5 -0
  15. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
  16. package/cjs/components/BottomSheet/BottomSheet.d.ts +1 -1
  17. package/cjs/components/ChainSelect/ChainSelect.d.ts +0 -1
  18. package/cjs/components/ChainSelect/ChainSelect.js +1 -3
  19. package/cjs/components/ChainSelect/useChainSelect.d.ts +1 -1
  20. package/cjs/components/Header/Header.style.d.ts +34 -1
  21. package/cjs/components/Header/Header.style.js +19 -1
  22. package/cjs/components/Header/NavigationHeader.js +4 -1
  23. package/cjs/components/Header/WalletHeader.js +34 -9
  24. package/cjs/components/Menu.d.ts +1 -0
  25. package/cjs/components/Menu.js +24 -0
  26. package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  27. package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
  28. package/cjs/components/SelectChainAndToken.js +6 -1
  29. package/cjs/components/SelectTokenButton/SelectTokenButton.js +8 -6
  30. package/cjs/components/SelectTokenButton/SelectTokenButton.style.js +2 -1
  31. package/cjs/components/SendToWallet/SendToWallet.js +5 -0
  32. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  33. package/cjs/components/SendToWallet/SendToWalletButton.js +5 -1
  34. package/cjs/components/Step/CircularProgress.d.ts +0 -1
  35. package/cjs/components/Step/StepProcess.style.d.ts +2 -2
  36. package/cjs/components/Step/StepTimer.js +1 -1
  37. package/cjs/components/StepActions/StepActions.js +6 -1
  38. package/cjs/components/SwapInput/FormPriceHelperText.js +4 -4
  39. package/cjs/components/SwapInput/SwapInput.js +5 -2
  40. package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
  41. package/cjs/components/SwapInput/SwapInputAdornment.d.ts +0 -1
  42. package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  43. package/cjs/components/SwapRouteCard/SwapRouteCard.js +5 -3
  44. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
  45. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +3 -1
  46. package/cjs/components/SwapRoutes/SwapRoutes.js +8 -3
  47. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
  48. package/cjs/components/Token/Token.js +6 -5
  49. package/cjs/components/TokenAvatar/TokenAvatar.d.ts +6 -1
  50. package/cjs/components/TokenAvatar/TokenAvatar.js +10 -3
  51. package/cjs/components/TokenList/TokenList.js +2 -23
  52. package/cjs/components/TokenList/TokenListItem.d.ts +2 -1
  53. package/cjs/components/TokenList/TokenListItem.js +12 -6
  54. package/cjs/components/TokenList/index.d.ts +1 -0
  55. package/cjs/components/TokenList/index.js +1 -0
  56. package/cjs/components/TokenList/types.d.ts +6 -0
  57. package/cjs/components/TokenList/useTokenSelect.d.ts +2 -0
  58. package/cjs/components/TokenList/useTokenSelect.js +33 -0
  59. package/cjs/config/version.d.ts +1 -1
  60. package/cjs/config/version.js +1 -1
  61. package/cjs/hooks/useChain.d.ts +2 -2
  62. package/cjs/hooks/useChains.d.ts +2 -2
  63. package/cjs/hooks/useExpandableVariant.js +3 -5
  64. package/cjs/hooks/useProcessMessage.d.ts +2 -2
  65. package/cjs/hooks/useSwapRoutes.js +11 -7
  66. package/cjs/i18n/de.json +199 -0
  67. package/cjs/i18n/{en/translation.json → en.json} +157 -150
  68. package/cjs/i18n/es.json +199 -0
  69. package/cjs/i18n/fr.json +199 -0
  70. package/cjs/i18n/index.d.ts +8 -199
  71. package/cjs/i18n/index.js +16 -22
  72. package/cjs/i18n/it.json +199 -0
  73. package/cjs/i18n/uk.json +200 -0
  74. package/cjs/i18n/zh.json +199 -0
  75. package/cjs/index.d.ts +6 -3
  76. package/cjs/index.js +3 -2
  77. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  78. package/cjs/pages/SelectChainPage/SelectChainPage.d.ts +1 -1
  79. package/cjs/pages/SelectChainPage/SelectChainPage.js +2 -5
  80. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +3 -0
  81. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +21 -0
  82. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.d.ts +21 -0
  83. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +20 -0
  84. package/cjs/pages/SelectNativeTokenPage/index.d.ts +1 -0
  85. package/cjs/pages/SelectNativeTokenPage/index.js +17 -0
  86. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
  87. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
  88. package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
  89. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  90. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  91. package/cjs/pages/SettingsPage/LanguageSelect.d.ts +2 -0
  92. package/cjs/pages/SettingsPage/LanguageSelect.js +38 -0
  93. package/cjs/pages/SettingsPage/SettingsPage.d.ts +0 -1
  94. package/cjs/pages/SettingsPage/SettingsPage.js +2 -1
  95. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -2
  96. package/cjs/pages/SettingsPage/ShowDestinationWallet.js +6 -0
  97. package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
  98. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +4 -2
  99. package/cjs/pages/SwapHistoryPage/SwapHistoryItem.js +4 -2
  100. package/cjs/pages/SwapPage/StatusBottomSheet.js +3 -3
  101. package/cjs/pages/SwapPage/TokenValueBottomSheet.js +1 -1
  102. package/cjs/providers/I18nProvider/I18nProvider.d.ts +2 -0
  103. package/cjs/providers/I18nProvider/I18nProvider.js +62 -0
  104. package/cjs/providers/I18nProvider/index.d.ts +2 -0
  105. package/cjs/providers/I18nProvider/index.js +18 -0
  106. package/cjs/providers/I18nProvider/types.d.ts +16 -0
  107. package/cjs/providers/I18nProvider/types.js +2 -0
  108. package/cjs/providers/WidgetProvider/utils.d.ts +1 -1
  109. package/cjs/providers/WidgetProvider/utils.js +4 -4
  110. package/cjs/providers/index.d.ts +1 -0
  111. package/cjs/providers/index.js +1 -0
  112. package/cjs/stores/settings/types.d.ts +1 -0
  113. package/cjs/stores/settings/useSettingsStore.d.ts +2 -0
  114. package/cjs/types/widget.d.ts +30 -8
  115. package/cjs/types/widget.js +8 -0
  116. package/cjs/utils/deepMerge.d.ts +1 -0
  117. package/cjs/utils/deepMerge.js +18 -0
  118. package/cjs/utils/index.d.ts +1 -0
  119. package/cjs/utils/index.js +1 -0
  120. package/cjs/utils/navigationRoutes.d.ts +8 -7
  121. package/cjs/utils/navigationRoutes.js +10 -7
  122. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
  123. package/components/BottomSheet/BottomSheet.d.ts +1 -1
  124. package/components/ChainSelect/ChainSelect.d.ts +0 -1
  125. package/components/ChainSelect/ChainSelect.js +1 -3
  126. package/components/ChainSelect/useChainSelect.d.ts +1 -1
  127. package/components/Header/Header.style.d.ts +34 -1
  128. package/components/Header/Header.style.js +19 -1
  129. package/components/Header/NavigationHeader.js +4 -1
  130. package/components/Header/WalletHeader.js +37 -12
  131. package/components/Menu.d.ts +1 -0
  132. package/components/Menu.js +21 -0
  133. package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  134. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
  135. package/components/SelectChainAndToken.js +7 -2
  136. package/components/SelectTokenButton/SelectTokenButton.js +9 -7
  137. package/components/SelectTokenButton/SelectTokenButton.style.js +2 -1
  138. package/components/SendToWallet/SendToWallet.js +6 -1
  139. package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  140. package/components/SendToWallet/SendToWalletButton.js +6 -2
  141. package/components/Step/CircularProgress.d.ts +0 -1
  142. package/components/Step/StepProcess.style.d.ts +2 -2
  143. package/components/Step/StepTimer.js +1 -1
  144. package/components/StepActions/StepActions.js +6 -1
  145. package/components/SwapInput/FormPriceHelperText.js +4 -4
  146. package/components/SwapInput/SwapInput.js +6 -3
  147. package/components/SwapInput/SwapInput.style.d.ts +1 -1
  148. package/components/SwapInput/SwapInputAdornment.d.ts +0 -1
  149. package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  150. package/components/SwapRouteCard/SwapRouteCard.js +5 -3
  151. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
  152. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +3 -1
  153. package/components/SwapRoutes/SwapRoutes.js +8 -3
  154. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
  155. package/components/Token/Token.js +7 -6
  156. package/components/TokenAvatar/TokenAvatar.d.ts +6 -1
  157. package/components/TokenAvatar/TokenAvatar.js +8 -2
  158. package/components/TokenList/TokenList.js +4 -25
  159. package/components/TokenList/TokenListItem.d.ts +2 -1
  160. package/components/TokenList/TokenListItem.js +10 -5
  161. package/components/TokenList/index.d.ts +1 -0
  162. package/components/TokenList/index.js +1 -0
  163. package/components/TokenList/types.d.ts +6 -0
  164. package/components/TokenList/useTokenSelect.d.ts +2 -0
  165. package/components/TokenList/useTokenSelect.js +29 -0
  166. package/config/version.d.ts +1 -1
  167. package/config/version.js +1 -1
  168. package/hooks/useChain.d.ts +2 -2
  169. package/hooks/useChains.d.ts +2 -2
  170. package/hooks/useExpandableVariant.js +3 -5
  171. package/hooks/useProcessMessage.d.ts +2 -2
  172. package/hooks/useSwapRoutes.js +12 -8
  173. package/i18n/de.json +199 -0
  174. package/i18n/{en/translation.json → en.json} +157 -150
  175. package/i18n/es.json +199 -0
  176. package/i18n/fr.json +199 -0
  177. package/i18n/index.d.ts +8 -199
  178. package/i18n/index.js +9 -20
  179. package/i18n/it.json +199 -0
  180. package/i18n/uk.json +200 -0
  181. package/i18n/zh.json +199 -0
  182. package/index.d.ts +6 -3
  183. package/index.js +3 -2
  184. package/package.json +18 -17
  185. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  186. package/pages/SelectChainPage/SelectChainPage.d.ts +1 -1
  187. package/pages/SelectChainPage/SelectChainPage.js +2 -5
  188. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +3 -0
  189. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +17 -0
  190. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.d.ts +21 -0
  191. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +17 -0
  192. package/pages/SelectNativeTokenPage/index.d.ts +1 -0
  193. package/pages/SelectNativeTokenPage/index.js +1 -0
  194. package/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
  195. package/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
  196. package/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
  197. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  198. package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  199. package/pages/SettingsPage/LanguageSelect.d.ts +2 -0
  200. package/pages/SettingsPage/LanguageSelect.js +34 -0
  201. package/pages/SettingsPage/SettingsPage.d.ts +0 -1
  202. package/pages/SettingsPage/SettingsPage.js +2 -1
  203. package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -2
  204. package/pages/SettingsPage/ShowDestinationWallet.js +6 -0
  205. package/pages/SettingsPage/SlippageInput.d.ts +0 -1
  206. package/pages/SwapDetailsPage/SwapDetailsPage.js +4 -2
  207. package/pages/SwapHistoryPage/SwapHistoryItem.js +4 -2
  208. package/pages/SwapPage/StatusBottomSheet.js +3 -3
  209. package/pages/SwapPage/TokenValueBottomSheet.js +1 -1
  210. package/providers/I18nProvider/I18nProvider.d.ts +2 -0
  211. package/providers/I18nProvider/I18nProvider.js +58 -0
  212. package/providers/I18nProvider/index.d.ts +2 -0
  213. package/providers/I18nProvider/index.js +2 -0
  214. package/providers/I18nProvider/types.d.ts +16 -0
  215. package/providers/I18nProvider/types.js +1 -0
  216. package/providers/WidgetProvider/utils.d.ts +1 -1
  217. package/providers/WidgetProvider/utils.js +4 -4
  218. package/providers/index.d.ts +1 -0
  219. package/providers/index.js +1 -0
  220. package/stores/settings/types.d.ts +1 -0
  221. package/stores/settings/useSettingsStore.d.ts +2 -0
  222. package/tsconfig.cjs.tsbuildinfo +1 -1
  223. package/types/widget.d.ts +30 -8
  224. package/types/widget.js +7 -1
  225. package/utils/deepMerge.d.ts +1 -0
  226. package/utils/deepMerge.js +14 -0
  227. package/utils/index.d.ts +1 -0
  228. package/utils/index.js +1 -0
  229. package/utils/navigationRoutes.d.ts +8 -7
  230. package/utils/navigationRoutes.js +10 -7
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LanguageSelect = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const icons_material_1 = require("@mui/icons-material");
6
+ const material_1 = require("@mui/material");
7
+ const react_i18next_1 = require("react-i18next");
8
+ const Card_1 = require("../../components/Card");
9
+ const Select_1 = require("../../components/Select");
10
+ const providers_1 = require("../../providers");
11
+ const stores_1 = require("../../stores");
12
+ const LanguageSelect = () => {
13
+ var _a;
14
+ const { t } = (0, react_i18next_1.useTranslation)();
15
+ const { languages, disableI18n } = (0, providers_1.useWidgetConfig)();
16
+ const { i18n } = (0, react_i18next_1.useTranslation)();
17
+ const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
18
+ const { language } = (0, stores_1.useSettings)(['language']);
19
+ if (disableI18n) {
20
+ return null;
21
+ }
22
+ const handleChangeLanguage = (event) => {
23
+ const language = event.target.value;
24
+ setValue('language', language);
25
+ i18n.changeLanguage(language);
26
+ };
27
+ const filteredLanguages = Object.keys(i18n.store.data).sort();
28
+ if (filteredLanguages.length <= 1) {
29
+ return null;
30
+ }
31
+ const value = filteredLanguages.includes(language || i18n.resolvedLanguage)
32
+ ? language || i18n.resolvedLanguage
33
+ : (languages === null || languages === void 0 ? void 0 : languages.default) || ((_a = languages === null || languages === void 0 ? void 0 : languages.allow) === null || _a === void 0 ? void 0 : _a[0]);
34
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ mb: 2 }, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`language.title`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(Select_1.Select, Object.assign({ MenuProps: { elevation: 2 }, value: value, onChange: handleChangeLanguage, IconComponent: icons_material_1.KeyboardArrowDown, dense: true }, { children: filteredLanguages.map((lng) => {
35
+ return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: lng }, { children: t('language.name', { lng }) }), lng));
36
+ }) })) }))] })));
37
+ };
38
+ exports.LanguageSelect = LanguageSelect;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const SettingsPage: () => JSX.Element;
@@ -6,10 +6,11 @@ const material_1 = require("@mui/material");
6
6
  const AdvancedPreferences_1 = require("./AdvancedPreferences");
7
7
  const ColorSchemeButtonGroup_1 = require("./ColorSchemeButtonGroup");
8
8
  const GasPriceSelect_1 = require("./GasPriceSelect");
9
+ const LanguageSelect_1 = require("./LanguageSelect");
9
10
  const RoutePrioritySelect_1 = require("./RoutePrioritySelect");
10
11
  const ShowDestinationWallet_1 = require("./ShowDestinationWallet");
11
12
  const SlippageInput_1 = require("./SlippageInput");
12
13
  const SettingsPage = () => {
13
- return ((0, jsx_runtime_1.jsxs)(material_1.Container, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ px: 3, pt: 1 }, { children: [(0, jsx_runtime_1.jsx)(ColorSchemeButtonGroup_1.ColorSchemeButtonGroup, {}), (0, jsx_runtime_1.jsx)(RoutePrioritySelect_1.RoutePrioritySelect, {}), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ pr: 2, flex: 1 }, { children: (0, jsx_runtime_1.jsx)(SlippageInput_1.SlippageInput, {}) })), (0, jsx_runtime_1.jsx)(GasPriceSelect_1.GasPriceSelect, {})] }))] })), (0, jsx_runtime_1.jsx)(ShowDestinationWallet_1.ShowDestinationWallet, {}), (0, jsx_runtime_1.jsx)(AdvancedPreferences_1.AdvancedPreferences, {})] })));
14
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ px: 3, pt: 1 }, { children: [(0, jsx_runtime_1.jsx)(ColorSchemeButtonGroup_1.ColorSchemeButtonGroup, {}), (0, jsx_runtime_1.jsx)(LanguageSelect_1.LanguageSelect, {}), (0, jsx_runtime_1.jsx)(RoutePrioritySelect_1.RoutePrioritySelect, {}), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ pr: 2, flex: 1 }, { children: (0, jsx_runtime_1.jsx)(SlippageInput_1.SlippageInput, {}) })), (0, jsx_runtime_1.jsx)(GasPriceSelect_1.GasPriceSelect, {})] }))] })), (0, jsx_runtime_1.jsx)(ShowDestinationWallet_1.ShowDestinationWallet, {}), (0, jsx_runtime_1.jsx)(AdvancedPreferences_1.AdvancedPreferences, {})] })));
14
15
  };
15
16
  exports.SettingsPage = SettingsPage;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
- export declare const ShowDestinationWallet: () => JSX.Element;
1
+ export declare const ShowDestinationWallet: () => JSX.Element | null;
@@ -5,11 +5,17 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const react_i18next_1 = require("react-i18next");
7
7
  const Switch_1 = require("../../components/Switch");
8
+ const providers_1 = require("../../providers");
8
9
  const stores_1 = require("../../stores");
10
+ const types_1 = require("../../types");
9
11
  const ShowDestinationWallet = () => {
10
12
  const { t } = (0, react_i18next_1.useTranslation)();
13
+ const { disabledUI } = (0, providers_1.useWidgetConfig)();
11
14
  const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
12
15
  const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
16
+ if (disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.ToAddress)) {
17
+ return null;
18
+ }
13
19
  const onChange = (_, checked) => {
14
20
  setValue('showDestinationWallet', checked);
15
21
  };
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const SlippageInput: () => JSX.Element;
@@ -27,7 +27,7 @@ const stores_1 = require("../../stores");
27
27
  const SwapDetailsPage_style_1 = require("./SwapDetailsPage.style");
28
28
  const SwapDetailsPage = () => {
29
29
  var _a, _b;
30
- const { t } = (0, react_i18next_1.useTranslation)();
30
+ const { t, i18n } = (0, react_i18next_1.useTranslation)();
31
31
  const { navigateBack } = (0, hooks_1.useNavigateBack)();
32
32
  const { state } = (0, react_router_dom_1.useLocation)();
33
33
  const [routeExecution, deleteRoute] = (0, stores_1.useRouteExecutionStore)((store) => [store.routes[state === null || state === void 0 ? void 0 : state.routeId], store.deleteRoute], shallow_1.default);
@@ -53,7 +53,9 @@ const SwapDetailsPage = () => {
53
53
  display: 'flex',
54
54
  flex: 1,
55
55
  justifyContent: 'space-between',
56
- }, pb: 1 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(undefined, { dateStyle: 'long' }).format(startedAt) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(undefined, { timeStyle: 'short' }).format(startedAt) }))] })), routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.steps.map((step, index, steps) => {
56
+ }, pb: 1 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, {
57
+ timeStyle: 'short',
58
+ }).format(startedAt) }))] })), routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.steps.map((step, index, steps) => {
57
59
  var _a, _b;
58
60
  return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Step_1.Step, { step: step, fromToken: index === 0
59
61
  ? Object.assign(Object.assign({}, step.action.fromToken), { amount: step.action.fromAmount }) : undefined, toToken: index === steps.length - 1
@@ -10,7 +10,7 @@ const Token_1 = require("../../components/Token");
10
10
  const utils_1 = require("../../utils");
11
11
  const SwapHistoryItem = ({ route }) => {
12
12
  var _a, _b, _c, _d, _e;
13
- const { t } = (0, react_i18next_1.useTranslation)();
13
+ const { i18n } = (0, react_i18next_1.useTranslation)();
14
14
  const navigate = (0, react_router_dom_1.useNavigate)();
15
15
  const handleClick = () => {
16
16
  navigate(utils_1.navigationRoutes.swapDetails, {
@@ -22,6 +22,8 @@ const SwapHistoryItem = ({ route }) => {
22
22
  display: 'flex',
23
23
  flex: 1,
24
24
  justifyContent: 'space-between',
25
- }, pt: 1.75, px: 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(undefined, { dateStyle: 'long' }).format(startedAt) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(undefined, { timeStyle: 'short' }).format(startedAt) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ py: 1 }, { children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: Object.assign(Object.assign({}, route.fromToken), { amount: route.fromAmount }), px: 2, pt: 1, connected: true }), (0, jsx_runtime_1.jsx)(Token_1.TokenDivider, {}), (0, jsx_runtime_1.jsx)(Token_1.Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: (_e = (_d = (_c = route.steps.at(-1)) === null || _c === void 0 ? void 0 : _c.execution) === null || _d === void 0 ? void 0 : _d.toAmount) !== null && _e !== void 0 ? _e : route.toAmount }), px: 2, pt: 0.5, pb: 1 })] }))] })));
25
+ }, pt: 1.75, px: 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, {
26
+ timeStyle: 'short',
27
+ }).format(startedAt) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ py: 1 }, { children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: Object.assign(Object.assign({}, route.fromToken), { amount: route.fromAmount }), px: 2, pt: 1, connected: true }), (0, jsx_runtime_1.jsx)(Token_1.TokenDivider, {}), (0, jsx_runtime_1.jsx)(Token_1.Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: (_e = (_d = (_c = route.steps.at(-1)) === null || _c === void 0 ? void 0 : _c.execution) === null || _d === void 0 ? void 0 : _d.toAmount) !== null && _e !== void 0 ? _e : route.toAmount }), px: 2, pt: 0.5, pb: 1 })] }))] })));
26
28
  };
27
29
  exports.SwapHistoryItem = SwapHistoryItem;
@@ -46,8 +46,8 @@ const StatusBottomSheet = ({ status, route, }) => {
46
46
  let message;
47
47
  switch (status) {
48
48
  case 'success':
49
- title = t('swap.success.title.fundsReceived');
50
- message = t('swap.success.message.fundsReceived', {
49
+ title = t('swap.success.title.swapSuccessful');
50
+ message = t('swap.success.message.swapSuccessful', {
51
51
  amount: token === null || token === void 0 ? void 0 : token.amount,
52
52
  tokenSymbol: token === null || token === void 0 ? void 0 : token.symbol,
53
53
  chainName: (_a = getChainById(route.toChainId)) === null || _a === void 0 ? void 0 : _a.name,
@@ -79,6 +79,6 @@ const StatusBottomSheet = ({ status, route, }) => {
79
79
  (_b = ref.current) === null || _b === void 0 ? void 0 : _b.open();
80
80
  }
81
81
  }, [refetch, refetchNewBalance, status]);
82
- return ((0, jsx_runtime_1.jsx)(BottomSheet_1.BottomSheet, Object.assign({ ref: ref }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ p: 3 }, { children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.IconContainer, { children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.IconCircle, Object.assign({ status: status, mb: 1 }, { children: [status === 'idle' ? (0, jsx_runtime_1.jsx)(icons_material_1.Info, { color: "primary" }) : null, status === 'success' ? (0, jsx_runtime_1.jsx)(icons_material_1.Done, { color: "success" }) : null, status === 'error' ? (0, jsx_runtime_1.jsx)(icons_material_1.Warning, { color: "error" }) : null] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ py: 1, fontSize: 18, fontWeight: 700 }, { children: title })), status === 'success' ? ((0, jsx_runtime_1.jsx)(Token_1.Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: (_g = (_e = (_d = (_c = route.steps.at(-1)) === null || _c === void 0 ? void 0 : _c.execution) === null || _d === void 0 ? void 0 : _d.toAmount) !== null && _e !== void 0 ? _e : (_f = route.steps.at(-1)) === null || _f === void 0 ? void 0 : _f.estimate.toAmount) !== null && _g !== void 0 ? _g : route.toAmount }), py: 1 })) : null] }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ py: 1 }, { children: message })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Button, Object.assign({ variant: "contained", fullWidth: true, onClick: status === 'success' ? handleDone : handleClose }, { children: [status === 'idle' ? t('button.okay') : null, status === 'success' ? t('button.done') : null, status === 'error' ? t('button.seeDetails') : null] })) })), status === 'success' ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", fullWidth: true, onClick: handleSeeDetails }, { children: t('button.seeDetails') })) }))) : null] })) })));
82
+ return ((0, jsx_runtime_1.jsx)(BottomSheet_1.BottomSheet, Object.assign({ ref: ref }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ p: 3 }, { children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.IconContainer, { children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.IconCircle, Object.assign({ status: status, mb: 1 }, { children: [status === 'idle' ? (0, jsx_runtime_1.jsx)(icons_material_1.Info, { color: "primary" }) : null, status === 'success' ? (0, jsx_runtime_1.jsx)(icons_material_1.Done, { color: "success" }) : null, status === 'error' ? (0, jsx_runtime_1.jsx)(icons_material_1.Warning, { color: "error" }) : null] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ py: 1, fontSize: 18, fontWeight: 700 }, { children: title })), status === 'success' ? ((0, jsx_runtime_1.jsx)(Token_1.Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: (_g = (_e = (_d = (_c = route.steps.at(-1)) === null || _c === void 0 ? void 0 : _c.execution) === null || _d === void 0 ? void 0 : _d.toAmount) !== null && _e !== void 0 ? _e : (_f = route.steps.at(-1)) === null || _f === void 0 ? void 0 : _f.estimate.toAmount) !== null && _g !== void 0 ? _g : route.toAmount }), py: 1 })) : null] }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ py: 1 }, { children: message })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Button, Object.assign({ variant: "contained", fullWidth: true, onClick: status === 'success' ? handleDone : handleClose }, { children: [status === 'idle' ? t('button.ok') : null, status === 'success' ? t('button.done') : null, status === 'error' ? t('button.seeDetails') : null] })) })), status === 'success' ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", fullWidth: true, onClick: handleSeeDetails }, { children: t('button.seeDetails') })) }))) : null] })) })));
83
83
  };
84
84
  exports.StatusBottomSheet = StatusBottomSheet;
@@ -22,7 +22,7 @@ const TokenValueBottomSheetContent = ({ route, onCancel, onContinue, }) => {
22
22
  const { t } = (0, react_i18next_1.useTranslation)();
23
23
  const ref = (0, react_1.useRef)();
24
24
  (0, hooks_1.useSetContentHeight)(ref);
25
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ p: 3, ref: ref }, { children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.IconContainer, { children: [(0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.IconCircle, Object.assign({ status: "warning", mb: 1 }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.Warning, { color: "warning" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ py: 1, fontSize: 18, fontWeight: 700 }, { children: t('swap.warning.title.highValueLoss') }))] }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ py: 1 }, { children: t('swap.warning.message.highValueLoss') })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 1 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.swapping') }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 600 }, { children: t('swap.currency', { value: route.fromAmountUSD }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 0.25 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.gasCost') }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 600 }, { children: t('swap.currency', { value: route.gasCostUSD }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 0.25 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.receiving') }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 600 }, { children: t('swap.currency', { value: route.toAmountUSD }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 0.25 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.valueLoss') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ fontWeight: 600 }, { children: [(0, big_js_1.default)(route.toAmountUSD || 0)
25
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ p: 3, ref: ref }, { children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.IconContainer, { children: [(0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.IconCircle, Object.assign({ status: "warning", mb: 1 }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.Warning, { color: "warning" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ py: 1, fontSize: 18, fontWeight: 700 }, { children: t('swap.warning.title.highValueLoss') }))] }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ py: 1 }, { children: t('swap.warning.message.highValueLoss') })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 1 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.swapping') }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 600 }, { children: t('format.currency', { value: route.fromAmountUSD }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 0.25 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.gasCost') }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 600 }, { children: t('format.currency', { value: route.gasCostUSD }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 0.25 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.receiving') }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 600 }, { children: t('format.currency', { value: route.toAmountUSD }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", mt: 0.25 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('swap.valueLoss') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ fontWeight: 600 }, { children: [(0, big_js_1.default)(route.toAmountUSD || 0)
26
26
  .div((0, big_js_1.default)(route.fromAmountUSD || 0).plus((0, big_js_1.default)(route.gasCostUSD || 0)))
27
27
  .minus(1)
28
28
  .mul(100)
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const I18nProvider: React.FC<React.PropsWithChildren>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.I18nProvider = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const i18next_1 = require("i18next");
6
+ const i18next_browser_languagedetector_1 = require("i18next-browser-languagedetector");
7
+ const react_1 = require("react");
8
+ const react_i18next_1 = require("react-i18next");
9
+ const supportedLanguages = require("../../i18n");
10
+ const stores_1 = require("../../stores");
11
+ const utils_1 = require("../../utils");
12
+ const WidgetProvider_1 = require("../WidgetProvider");
13
+ const I18nProvider = ({ children, }) => {
14
+ const { languageResources, languages, disableI18n } = (0, WidgetProvider_1.useWidgetConfig)();
15
+ const { language } = (0, stores_1.useSettings)(['language']);
16
+ const i18n = (0, react_1.useMemo)(() => {
17
+ var _a, _b;
18
+ let resources = Object.keys(supportedLanguages)
19
+ .filter((lng) => (0, WidgetProvider_1.isItemAllowed)(lng, languages))
20
+ .reduce((resources, lng) => {
21
+ resources[lng] = {
22
+ translation: (languageResources === null || languageResources === void 0 ? void 0 : languageResources[lng])
23
+ ? (0, utils_1.deepMerge)(supportedLanguages[lng], languageResources[lng])
24
+ : supportedLanguages[lng],
25
+ };
26
+ return resources;
27
+ }, {});
28
+ if (languageResources) {
29
+ resources = Object.keys(languageResources).reduce((resources, lng) => {
30
+ if (!resources[lng]) {
31
+ resources[lng] = {
32
+ translation: languageResources[lng],
33
+ };
34
+ }
35
+ return resources;
36
+ }, resources);
37
+ }
38
+ let i18n = i18next_1.default.createInstance({
39
+ lng: (languages === null || languages === void 0 ? void 0 : languages.default) || language,
40
+ fallbackLng: resources.en
41
+ ? 'en'
42
+ : (languages === null || languages === void 0 ? void 0 : languages.default) ||
43
+ ((_a = languages === null || languages === void 0 ? void 0 : languages.allow) === null || _a === void 0 ? void 0 : _a[0]) ||
44
+ ((_b = Object.keys(resources)) === null || _b === void 0 ? void 0 : _b[0]),
45
+ lowerCaseLng: true,
46
+ interpolation: {
47
+ escapeValue: false,
48
+ },
49
+ resources,
50
+ detection: {
51
+ caches: [],
52
+ },
53
+ });
54
+ if (!language && !(languages === null || languages === void 0 ? void 0 : languages.default) && !disableI18n) {
55
+ i18n = i18n.use(i18next_browser_languagedetector_1.default);
56
+ }
57
+ i18n.use(react_i18next_1.initReactI18next).init();
58
+ return i18n;
59
+ }, [disableI18n, language, languageResources, languages]);
60
+ return (0, jsx_runtime_1.jsx)(react_i18next_1.I18nextProvider, Object.assign({ i18n: i18n }, { children: children }));
61
+ };
62
+ exports.I18nProvider = I18nProvider;
@@ -0,0 +1,2 @@
1
+ export * from './I18nProvider';
2
+ export * from './types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./I18nProvider"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,16 @@
1
+ import type * as languages from '../../i18n';
2
+ export declare type PartialResource<T> = T extends object ? {
3
+ [P in keyof T]?: PartialResource<T[P]>;
4
+ } : T;
5
+ export declare type LanguageKey = keyof typeof languages;
6
+ export declare type LanguageResources = {
7
+ [language in LanguageKey]?: PartialResource<typeof languages.en>;
8
+ } | {
9
+ [language: string]: PartialResource<typeof languages.en>;
10
+ };
11
+ export declare type LanguageTranslationResource = {
12
+ [namespace in 'translation']: PartialResource<typeof languages.en>;
13
+ };
14
+ export declare type LanguageTranslationResources = {
15
+ [language: string]: LanguageTranslationResource;
16
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- export declare const isItemAllowed: <T>(chainId: T, chains?: {
1
+ export declare const isItemAllowed: <T>(itemId: T, items?: {
2
2
  allow?: T[] | undefined;
3
3
  deny?: T[] | undefined;
4
4
  } | undefined, disabledChains?: T[] | undefined) => boolean;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isItemAllowed = void 0;
4
- const isItemAllowed = (chainId, chains,
4
+ const isItemAllowed = (itemId, items,
5
5
  /** @deprecated Remove in the next major release */
6
6
  disabledChains) => {
7
7
  var _a, _b;
8
- if ((_a = chains === null || chains === void 0 ? void 0 : chains.allow) === null || _a === void 0 ? void 0 : _a.length) {
9
- return chains.allow.includes(chainId);
8
+ if ((_a = items === null || items === void 0 ? void 0 : items.allow) === null || _a === void 0 ? void 0 : _a.length) {
9
+ return items.allow.includes(itemId);
10
10
  }
11
- return !((disabledChains === null || disabledChains === void 0 ? void 0 : disabledChains.includes(chainId)) || ((_b = chains === null || chains === void 0 ? void 0 : chains.deny) === null || _b === void 0 ? void 0 : _b.includes(chainId)));
11
+ return !((disabledChains === null || disabledChains === void 0 ? void 0 : disabledChains.includes(itemId)) || ((_b = items === null || items === void 0 ? void 0 : items.deny) === null || _b === void 0 ? void 0 : _b.includes(itemId)));
12
12
  };
13
13
  exports.isItemAllowed = isItemAllowed;
@@ -1,3 +1,4 @@
1
+ export * from './I18nProvider';
1
2
  export * from './SDKProvider';
2
3
  export * from './SwapFormProvider';
3
4
  export * from './TelemetryProvider';
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./I18nProvider"), exports);
17
18
  __exportStar(require("./SDKProvider"), exports);
18
19
  __exportStar(require("./SwapFormProvider"), exports);
19
20
  __exportStar(require("./TelemetryProvider"), exports);
@@ -8,6 +8,7 @@ export interface SettingsState {
8
8
  advancedPreferences: boolean;
9
9
  appearance: Appearance;
10
10
  gasPrice: string;
11
+ language?: string;
11
12
  routePriority: Order;
12
13
  showDestinationWallet: boolean;
13
14
  slippage: string;
@@ -10,6 +10,7 @@ export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<Omit
10
10
  advancedPreferences: boolean;
11
11
  appearance: import("../..").Appearance;
12
12
  gasPrice: string;
13
+ language?: string | undefined;
13
14
  routePriority: "RECOMMENDED" | "FASTEST" | "CHEAPEST" | "SAFEST";
14
15
  showDestinationWallet: boolean;
15
16
  slippage: string;
@@ -29,6 +30,7 @@ export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<Omit
29
30
  advancedPreferences: boolean;
30
31
  appearance: import("../..").Appearance;
31
32
  gasPrice: string;
33
+ language?: string | undefined;
32
34
  routePriority: "RECOMMENDED" | "FASTEST" | "CHEAPEST" | "SAFEST";
33
35
  showDestinationWallet: boolean;
34
36
  slippage: string;
@@ -2,8 +2,16 @@ import type { ChainKey, ConfigUpdate, Token } from '@lifi/sdk';
2
2
  import type { PaletteMode, PaletteOptions, Shape } from '@mui/material';
3
3
  import type { TypographyOptions } from '@mui/material/styles/createTypography';
4
4
  import type { Signer } from 'ethers';
5
- import type { CSSProperties } from 'react';
6
- export declare type WidgetVariant = 'default' | 'expandable' | 'drawer';
5
+ import type { CSSProperties, RefObject } from 'react';
6
+ import type { LanguageKey, LanguageResources } from '../providers';
7
+ export declare type WidgetVariant = 'default' | 'expandable' | 'drawer' | 'refuel';
8
+ export declare enum DisabledUI {
9
+ FromToken = "fromToken",
10
+ ToToken = "toToken",
11
+ FromAmount = "fromAmount",
12
+ ToAddress = "toAddress"
13
+ }
14
+ export declare type DisabledUIType = `${DisabledUI}`;
7
15
  export declare type Appearance = PaletteMode | 'auto';
8
16
  export declare type ThemeConfig = {
9
17
  palette?: Pick<PaletteOptions, 'primary' | 'secondary'>;
@@ -25,17 +33,15 @@ export interface WidgetConfig {
25
33
  toToken?: string;
26
34
  toAddress?: string;
27
35
  fromAmount?: number | string;
36
+ integrator?: string;
37
+ variant?: WidgetVariant;
28
38
  appearance?: Appearance;
29
39
  theme?: ThemeConfig;
30
40
  containerStyle?: CSSProperties;
31
41
  disableAppearance?: boolean;
32
42
  disableTelemetry?: boolean;
33
- /** @deprecated Use chains.deny instead */
34
- disabledChains?: number[];
35
- /** @deprecated Use tokens.featured instead */
36
- featuredTokens?: Token[];
37
- integrator?: string;
38
- variant?: WidgetVariant;
43
+ disabledUI?: DisabledUIType[];
44
+ useRecommendedRoute?: boolean;
39
45
  walletManagement?: WidgetWalletManagement;
40
46
  sdkConfig?: ConfigUpdate;
41
47
  buildSwapUrl?: boolean;
@@ -56,4 +62,20 @@ export interface WidgetConfig {
56
62
  allow?: Token[];
57
63
  deny?: (Partial<Token> & Pick<Token, 'address' | 'chainId'>)[];
58
64
  };
65
+ languages?: {
66
+ default?: LanguageKey;
67
+ allow?: LanguageKey[];
68
+ deny?: LanguageKey[];
69
+ };
70
+ languageResources?: LanguageResources;
71
+ disableI18n?: boolean;
72
+ /** @deprecated Use chains.deny instead */
73
+ disabledChains?: number[];
74
+ /** @deprecated Use tokens.featured instead */
75
+ featuredTokens?: Token[];
59
76
  }
77
+ export declare type WidgetProps = {
78
+ elementRef?: RefObject<HTMLDivElement>;
79
+ config?: WidgetConfig;
80
+ open?: boolean;
81
+ };
@@ -1,2 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DisabledUI = void 0;
4
+ var DisabledUI;
5
+ (function (DisabledUI) {
6
+ DisabledUI["FromToken"] = "fromToken";
7
+ DisabledUI["ToToken"] = "toToken";
8
+ DisabledUI["FromAmount"] = "fromAmount";
9
+ DisabledUI["ToAddress"] = "toAddress";
10
+ })(DisabledUI = exports.DisabledUI || (exports.DisabledUI = {}));
@@ -0,0 +1 @@
1
+ export declare const deepMerge: (...objects: any[]) => any;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deepMerge = void 0;
4
+ const isObject = (obj) => obj && typeof obj === 'object';
5
+ const deepMerge = (...objects) => {
6
+ return objects.reduce((prev, obj) => {
7
+ for (const key in obj) {
8
+ if (isObject(prev[key]) && isObject(obj[key])) {
9
+ prev[key] = (0, exports.deepMerge)(prev[key], obj[key]);
10
+ }
11
+ else {
12
+ prev[key] = obj[key];
13
+ }
14
+ }
15
+ return prev;
16
+ }, {});
17
+ };
18
+ exports.deepMerge = deepMerge;
@@ -1,5 +1,6 @@
1
1
  export * from './colors';
2
2
  export * from './deepClone';
3
+ export * from './deepMerge';
3
4
  export * from './elements';
4
5
  export * from './format';
5
6
  export * from './input';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./colors"), exports);
18
18
  __exportStar(require("./deepClone"), exports);
19
+ __exportStar(require("./deepMerge"), exports);
19
20
  __exportStar(require("./elements"), exports);
20
21
  __exportStar(require("./format"), exports);
21
22
  __exportStar(require("./input"), exports);
@@ -1,16 +1,17 @@
1
1
  export declare const navigationRoutes: {
2
2
  home: string;
3
+ activeSwaps: string;
4
+ fromChain: string;
5
+ fromToken: string;
3
6
  selectWallet: string;
4
7
  settings: string;
5
- fromToken: string;
6
- toToken: string;
7
- fromChain: string;
8
- toChain: string;
9
- swapRoutes: string;
8
+ swapDetails: string;
10
9
  swapExecution: string;
11
10
  swapHistory: string;
12
- activeSwaps: string;
13
- swapDetails: string;
11
+ swapRoutes: string;
12
+ toChain: string;
13
+ toToken: string;
14
+ toTokenNative: string;
14
15
  };
15
16
  export declare const navigationRoutesValues: string[];
16
17
  export declare const stickyHeaderRoutes: string[];
@@ -3,17 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.backButtonRoutes = exports.stickyHeaderRoutes = exports.navigationRoutesValues = exports.navigationRoutes = void 0;
4
4
  exports.navigationRoutes = {
5
5
  home: '/',
6
+ activeSwaps: 'active-swaps',
7
+ fromChain: 'from-chain',
8
+ fromToken: 'from-token',
6
9
  selectWallet: 'wallet',
7
10
  settings: 'settings',
8
- fromToken: 'from-token',
9
- toToken: 'to-token',
10
- fromChain: 'from-chain',
11
- toChain: 'to-chain',
12
- swapRoutes: 'swap-routes',
11
+ swapDetails: 'swap-details',
13
12
  swapExecution: 'swap-execution',
14
13
  swapHistory: 'swap-history',
15
- activeSwaps: 'active-swaps',
16
- swapDetails: 'swap-details',
14
+ swapRoutes: 'swap-routes',
15
+ toChain: 'to-chain',
16
+ toToken: 'to-token',
17
+ toTokenNative: 'to-token-native',
17
18
  };
18
19
  exports.navigationRoutesValues = Object.values(exports.navigationRoutes);
19
20
  exports.stickyHeaderRoutes = [
@@ -26,6 +27,7 @@ exports.stickyHeaderRoutes = [
26
27
  exports.navigationRoutes.swapHistory,
27
28
  exports.navigationRoutes.swapRoutes,
28
29
  exports.navigationRoutes.toChain,
30
+ exports.navigationRoutes.toTokenNative,
29
31
  ];
30
32
  exports.backButtonRoutes = [
31
33
  exports.navigationRoutes.activeSwaps,
@@ -39,4 +41,5 @@ exports.backButtonRoutes = [
39
41
  exports.navigationRoutes.swapRoutes,
40
42
  exports.navigationRoutes.toChain,
41
43
  exports.navigationRoutes.toToken,
44
+ exports.navigationRoutes.toTokenNative,
42
45
  ];
@@ -33,7 +33,7 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<{
33
33
  export declare const ShowAllButton: import("@emotion/styled").StyledComponent<{
34
34
  children?: import("react").ReactNode;
35
35
  classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
36
- color?: "inherit" | "primary" | "secondary" | "error" | "warning" | "info" | "success" | undefined;
36
+ color?: "inherit" | "error" | "success" | "warning" | "primary" | "secondary" | "info" | undefined;
37
37
  disabled?: boolean | undefined;
38
38
  disableElevation?: boolean | undefined;
39
39
  disableFocusRipple?: boolean | undefined;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { BottomSheetBase, BottomSheetProps } from './types';
3
- export declare const BottomSheet: import("react").ForwardRefExoticComponent<Pick<BottomSheetProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "elementRef" | "components" | "componentsProps" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "container" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "onClose" | "elevation" | "ModalProps" | "PaperProps" | "SlideProps"> & import("react").RefAttributes<BottomSheetBase>>;
3
+ export declare const BottomSheet: import("react").ForwardRefExoticComponent<Pick<BottomSheetProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "components" | "elementRef" | "componentsProps" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "container" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "onClose" | "slotProps" | "slots" | "elevation" | "PaperProps" | "ModalProps" | "SlideProps"> & import("react").RefAttributes<BottomSheetBase>>;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { SwapFormTypeProps } from '../../providers';
3
2
  export declare const ChainSelect: ({ formType }: SwapFormTypeProps) => JSX.Element;
@@ -15,9 +15,7 @@ export const ChainSelect = ({ formType }) => {
15
15
  name: [SwapFormKeyHelper.getChainKey(formType)],
16
16
  });
17
17
  const showAllChains = () => {
18
- navigate(navigationRoutes[`${formType}Chain`], {
19
- state: { formType },
20
- });
18
+ navigate(navigationRoutes[`${formType}Chain`]);
21
19
  };
22
20
  const chainsToHide = ((_a = chains === null || chains === void 0 ? void 0 : chains.length) !== null && _a !== void 0 ? _a : 0) - maxChainToOrder;
23
21
  return (_jsxs(ChainContainer, { children: [isLoading
@@ -1,7 +1,7 @@
1
1
  import type { EVMChain } from '@lifi/sdk';
2
2
  import type { SwapFormType } from '../../providers';
3
3
  export declare const useChainSelect: (formType: SwapFormType) => {
4
- chains: EVMChain[] | undefined;
4
+ chains: import("@lifi/sdk").ExtendedChain[] | undefined;
5
5
  getChains: () => EVMChain[];
6
6
  setCurrentChain: (chainId: number) => void;
7
7
  isLoading: boolean;