@lifi/widget 1.32.8 → 2.0.0-alpha.1
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.
- package/App.js +3 -3
- package/AppDrawer.js +4 -3
- package/AppDrawer.style.d.ts +5 -5
- package/AppProvider.js +4 -3
- package/cjs/App.js +3 -3
- package/cjs/AppDrawer.js +4 -3
- package/cjs/AppDrawer.style.d.ts +5 -5
- package/cjs/AppProvider.js +2 -1
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +5 -5
- package/cjs/components/Card/CardIconButton.d.ts +29 -0
- package/cjs/components/Card/CardIconButton.js +17 -0
- package/cjs/components/Card/CardLabel.d.ts +26 -0
- package/cjs/components/Card/CardLabel.js +45 -0
- package/cjs/components/Card/CardTitle.d.ts +2 -2
- package/cjs/components/Card/index.d.ts +2 -0
- package/cjs/components/Card/index.js +2 -0
- package/cjs/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -0
- package/cjs/components/GasMessage/FundsSufficiencyMessage.js +16 -0
- package/cjs/components/{GasSufficiencyMessage/GasSufficiencyMessage.d.ts → GasMessage/GasMessage.d.ts} +4 -2
- package/cjs/components/GasMessage/GasMessage.js +19 -0
- package/cjs/components/GasMessage/GasMessage.style.d.ts +34 -0
- package/cjs/components/GasMessage/GasMessage.style.js +48 -0
- package/cjs/components/GasMessage/GasRefuelMessage.d.ts +3 -0
- package/cjs/components/GasMessage/GasRefuelMessage.js +26 -0
- package/cjs/components/GasMessage/GasSufficiencyMessage.d.ts +7 -0
- package/cjs/components/GasMessage/GasSufficiencyMessage.js +21 -0
- package/cjs/components/GasMessage/index.d.ts +2 -0
- package/cjs/components/GasMessage/index.js +18 -0
- package/cjs/components/Header/Header.style.d.ts +6 -6
- package/cjs/components/Header/NavigationHeader.js +4 -4
- package/cjs/components/Header/WalletHeader.js +5 -5
- package/cjs/components/Insurance/Insurance.d.ts +3 -0
- package/cjs/components/Insurance/Insurance.js +11 -0
- package/cjs/components/Insurance/InsuranceCard.d.ts +3 -0
- package/cjs/components/Insurance/InsuranceCard.js +20 -0
- package/cjs/components/Insurance/InsuranceCollapsed.d.ts +3 -0
- package/cjs/components/Insurance/InsuranceCollapsed.js +32 -0
- package/cjs/components/Insurance/index.d.ts +1 -0
- package/cjs/components/{GasSufficiencyMessage → Insurance}/index.js +1 -1
- package/cjs/components/Insurance/types.d.ts +14 -0
- package/cjs/components/Insurance/types.js +2 -0
- package/cjs/components/ListItemButton.d.ts +1 -1
- package/cjs/components/NFT/NFT.style.d.ts +1 -1
- package/cjs/components/PoweredBy/PoweredBy.style.d.ts +3 -12
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
- package/cjs/components/SendToWallet/SendToWallet.js +31 -25
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +2 -2
- package/cjs/components/SendToWallet/SendToWalletButton.js +3 -3
- package/cjs/components/SmallAvatar.d.ts +2 -2
- package/cjs/components/Step/CircularProgress.style.d.ts +1 -1
- package/cjs/components/Step/DestinationWalletAddress.d.ts +2 -2
- package/cjs/components/Step/DestinationWalletAddress.js +4 -8
- package/cjs/components/Step/GasStepProcess.d.ts +2 -2
- package/cjs/components/Step/GasStepProcess.js +3 -3
- package/cjs/components/Step/Step.d.ts +2 -2
- package/cjs/components/Step/Step.js +6 -8
- package/cjs/components/Step/StepList.d.ts +1 -1
- package/cjs/components/Step/StepProcess.d.ts +2 -2
- package/cjs/components/Step/StepProcess.js +1 -5
- package/cjs/components/Step/StepProcess.style.d.ts +3 -39
- package/cjs/components/Step/StepTimer.d.ts +2 -2
- package/cjs/components/Step/StepTimer.js +1 -1
- package/cjs/components/StepActions/StepActions.d.ts +6 -1
- package/cjs/components/StepActions/StepActions.js +54 -17
- package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
- package/cjs/components/StepActions/types.d.ts +2 -2
- package/cjs/components/SwapButton/SwapButton.js +2 -2
- package/cjs/components/SwapButton/types.d.ts +1 -2
- package/cjs/components/SwapInput/SwapInput.style.d.ts +2 -2
- package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +3 -3
- package/cjs/components/SwapInput/SwapInputEndAdornment.js +18 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +1 -2
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +10 -26
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +4 -36
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +7 -38
- package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +3 -0
- package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.js +27 -0
- package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +5 -5
- package/cjs/components/SwapRouteCard/types.d.ts +2 -2
- package/cjs/components/SwapRouteCard/utils.d.ts +5 -0
- package/cjs/components/SwapRouteCard/utils.js +32 -2
- package/cjs/components/SwapRoutes/SwapRoutes.js +3 -12
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +4 -11
- package/cjs/components/SwapRoutes/{SwapRoutes.style.d.ts → SwapRoutesExpanded.style.d.ts} +0 -9
- package/cjs/components/SwapRoutes/{SwapRoutes.style.js → SwapRoutesExpanded.style.js} +1 -12
- package/cjs/components/Switch.js +4 -4
- package/cjs/components/Token/Token.d.ts +2 -2
- package/cjs/components/Token/Token.style.d.ts +2 -2
- package/cjs/components/TokenList/TokenList.style.d.ts +2 -2
- package/cjs/config/theme.js +1 -1
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +4 -0
- package/cjs/hooks/index.js +4 -0
- package/cjs/hooks/useChains.js +2 -2
- package/cjs/hooks/useFeaturedTokens.d.ts +1 -1
- package/cjs/hooks/useFeaturedTokens.js +2 -2
- package/cjs/hooks/useFundsSufficiency.d.ts +5 -0
- package/cjs/hooks/useFundsSufficiency.js +73 -0
- package/cjs/hooks/useGasRecommendation.d.ts +2 -0
- package/cjs/hooks/useGasRecommendation.js +23 -0
- package/cjs/hooks/useGasRefuel.d.ts +7 -0
- package/cjs/hooks/useGasRefuel.js +61 -0
- package/cjs/hooks/useGasSufficiency.d.ts +2 -3
- package/cjs/hooks/useGasSufficiency.js +6 -37
- package/cjs/hooks/useGetTokenBalancesWithRetry.d.ts +3 -0
- package/cjs/hooks/useGetTokenBalancesWithRetry.js +33 -0
- package/cjs/hooks/useProcessMessage.d.ts +3 -3
- package/cjs/hooks/useSwapRoutes.d.ts +7 -2
- package/cjs/hooks/useSwapRoutes.js +31 -11
- package/cjs/hooks/useTokenAddressBalance.js +4 -2
- package/cjs/hooks/useTokenBalance.js +4 -22
- package/cjs/hooks/useTokenBalances.d.ts +1 -1
- package/cjs/hooks/useTokenSearch.js +2 -2
- package/cjs/hooks/useTokens.js +2 -3
- package/cjs/i18n/en.json +14 -7
- package/cjs/i18n/it.json +6 -2
- package/cjs/i18n/pt.json +234 -0
- package/cjs/i18n/uk.json +5 -1
- package/cjs/icons/InsuraceLogo.d.ts +2 -0
- package/cjs/icons/InsuraceLogo.js +11 -0
- package/cjs/icons/index.d.ts +1 -0
- package/cjs/icons/index.js +1 -0
- package/cjs/index.d.ts +0 -6
- package/cjs/index.js +1 -6
- package/cjs/pages/MainPage/MainGasMessage.d.ts +3 -0
- package/cjs/pages/MainPage/MainGasMessage.js +12 -0
- package/cjs/pages/MainPage/MainPage.js +3 -2
- package/cjs/pages/MainPage/MainSwapButton.js +1 -1
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +2 -2
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
- package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +1 -1
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +4 -3
- package/cjs/pages/SwapPage/ExchangeRateBottomSheet.d.ts +1 -2
- package/cjs/pages/SwapPage/ExchangeRateBottomSheet.js +1 -14
- package/cjs/pages/SwapPage/StartSwapButton.d.ts +3 -2
- package/cjs/pages/SwapPage/StartSwapButton.js +14 -4
- package/cjs/pages/SwapPage/SwapPage.js +18 -7
- package/cjs/pages/SwapPage/types.d.ts +9 -0
- package/cjs/pages/SwapPage/types.js +2 -0
- package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
- package/cjs/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +2 -1
- package/cjs/providers/SDKProvider/SDKProvider.d.ts +2 -2
- package/cjs/providers/SDKProvider/SDKProvider.js +2 -1
- package/cjs/providers/SwapFormProvider/FormUpdater.js +2 -3
- package/cjs/providers/SwapFormProvider/SwapFormProvider.js +2 -3
- package/cjs/providers/SwapFormProvider/index.d.ts +1 -0
- package/cjs/providers/SwapFormProvider/index.js +1 -0
- package/cjs/providers/WidgetProvider/WidgetProvider.js +17 -4
- package/cjs/providers/WidgetProvider/utils.d.ts +1 -1
- package/cjs/providers/WidgetProvider/utils.js +2 -4
- package/cjs/stores/StoreProvider.js +1 -1
- package/cjs/stores/routes/createRouteExecutionStore.js +3 -2
- package/cjs/stores/routes/index.d.ts +0 -1
- package/cjs/stores/routes/index.js +0 -1
- package/cjs/stores/routes/types.d.ts +1 -5
- package/cjs/stores/routes/useSetExecutableRoute.d.ts +1 -1
- package/cjs/stores/settings/types.d.ts +1 -0
- package/cjs/stores/settings/useSettingsStore.js +1 -0
- package/cjs/types/widget.d.ts +5 -10
- package/cjs/utils/format.js +4 -1
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +5 -5
- package/components/Card/CardIconButton.d.ts +29 -0
- package/components/Card/CardIconButton.js +14 -0
- package/components/Card/CardLabel.d.ts +26 -0
- package/components/Card/CardLabel.js +42 -0
- package/components/Card/CardTitle.d.ts +2 -2
- package/components/Card/index.d.ts +2 -0
- package/components/Card/index.js +2 -0
- package/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -0
- package/components/GasMessage/FundsSufficiencyMessage.js +12 -0
- package/components/{GasSufficiencyMessage/GasSufficiencyMessage.d.ts → GasMessage/GasMessage.d.ts} +4 -2
- package/components/GasMessage/GasMessage.js +15 -0
- package/components/GasMessage/GasMessage.style.d.ts +34 -0
- package/components/GasMessage/GasMessage.style.js +45 -0
- package/components/GasMessage/GasRefuelMessage.d.ts +3 -0
- package/components/GasMessage/GasRefuelMessage.js +22 -0
- package/components/GasMessage/GasSufficiencyMessage.d.ts +7 -0
- package/components/GasMessage/GasSufficiencyMessage.js +17 -0
- package/components/GasMessage/index.d.ts +2 -0
- package/components/GasMessage/index.js +2 -0
- package/components/Header/Header.style.d.ts +6 -6
- package/components/Header/NavigationHeader.js +4 -4
- package/components/Header/WalletHeader.js +6 -6
- package/components/Insurance/Insurance.d.ts +3 -0
- package/components/Insurance/Insurance.js +7 -0
- package/components/Insurance/InsuranceCard.d.ts +3 -0
- package/components/Insurance/InsuranceCard.js +16 -0
- package/components/Insurance/InsuranceCollapsed.d.ts +3 -0
- package/components/Insurance/InsuranceCollapsed.js +28 -0
- package/components/Insurance/index.d.ts +1 -0
- package/components/Insurance/index.js +1 -0
- package/components/Insurance/types.d.ts +14 -0
- package/components/Insurance/types.js +1 -0
- package/components/ListItemButton.d.ts +1 -1
- package/components/NFT/NFT.style.d.ts +1 -1
- package/components/PoweredBy/PoweredBy.style.d.ts +3 -12
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
- package/components/SendToWallet/SendToWallet.js +34 -28
- package/components/SendToWallet/SendToWallet.style.d.ts +2 -2
- package/components/SendToWallet/SendToWalletButton.js +4 -4
- package/components/SmallAvatar.d.ts +2 -2
- package/components/Step/CircularProgress.style.d.ts +1 -1
- package/components/Step/DestinationWalletAddress.d.ts +2 -2
- package/components/Step/DestinationWalletAddress.js +4 -8
- package/components/Step/GasStepProcess.d.ts +2 -2
- package/components/Step/GasStepProcess.js +3 -3
- package/components/Step/Step.d.ts +2 -2
- package/components/Step/Step.js +6 -8
- package/components/Step/StepList.d.ts +1 -1
- package/components/Step/StepProcess.d.ts +2 -2
- package/components/Step/StepProcess.js +1 -5
- package/components/Step/StepProcess.style.d.ts +3 -39
- package/components/Step/StepTimer.d.ts +2 -2
- package/components/Step/StepTimer.js +1 -1
- package/components/StepActions/StepActions.d.ts +6 -1
- package/components/StepActions/StepActions.js +51 -16
- package/components/StepActions/StepActions.style.d.ts +1 -1
- package/components/StepActions/types.d.ts +2 -2
- package/components/SwapButton/SwapButton.js +2 -2
- package/components/SwapButton/types.d.ts +1 -2
- package/components/SwapInput/SwapInput.style.d.ts +2 -2
- package/components/SwapInput/SwapInputAdornment.style.d.ts +3 -3
- package/components/SwapInput/SwapInputEndAdornment.js +19 -2
- package/components/SwapRouteCard/SwapRouteCard.d.ts +1 -2
- package/components/SwapRouteCard/SwapRouteCard.js +11 -26
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +4 -36
- package/components/SwapRouteCard/SwapRouteCard.style.js +7 -38
- package/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +3 -0
- package/components/SwapRouteCard/SwapRouteCardEssentials.js +23 -0
- package/components/SwapRouteCard/SwapRouteCardSkeleton.js +5 -5
- package/components/SwapRouteCard/types.d.ts +2 -2
- package/components/SwapRouteCard/utils.d.ts +5 -0
- package/components/SwapRouteCard/utils.js +30 -1
- package/components/SwapRoutes/SwapRoutes.js +5 -14
- package/components/SwapRoutes/SwapRoutesExpanded.js +4 -11
- package/components/SwapRoutes/{SwapRoutes.style.d.ts → SwapRoutesExpanded.style.d.ts} +0 -9
- package/components/SwapRoutes/{SwapRoutes.style.js → SwapRoutesExpanded.style.js} +1 -12
- package/components/Switch.js +5 -5
- package/components/Token/Token.d.ts +2 -2
- package/components/Token/Token.style.d.ts +2 -2
- package/components/TokenList/TokenList.style.d.ts +2 -2
- package/config/theme.js +1 -1
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +4 -0
- package/hooks/index.js +4 -0
- package/hooks/useChains.js +2 -2
- package/hooks/useFeaturedTokens.d.ts +1 -1
- package/hooks/useFeaturedTokens.js +2 -2
- package/hooks/useFundsSufficiency.d.ts +5 -0
- package/hooks/useFundsSufficiency.js +69 -0
- package/hooks/useGasRecommendation.d.ts +2 -0
- package/hooks/useGasRecommendation.js +19 -0
- package/hooks/useGasRefuel.d.ts +7 -0
- package/hooks/useGasRefuel.js +57 -0
- package/hooks/useGasSufficiency.d.ts +2 -3
- package/hooks/useGasSufficiency.js +7 -38
- package/hooks/useGetTokenBalancesWithRetry.d.ts +3 -0
- package/hooks/useGetTokenBalancesWithRetry.js +29 -0
- package/hooks/useProcessMessage.d.ts +3 -3
- package/hooks/useSwapRoutes.d.ts +7 -2
- package/hooks/useSwapRoutes.js +32 -12
- package/hooks/useTokenAddressBalance.js +4 -2
- package/hooks/useTokenBalance.js +5 -23
- package/hooks/useTokenBalances.d.ts +1 -1
- package/hooks/useTokenSearch.js +2 -2
- package/hooks/useTokens.js +2 -3
- package/i18n/en.json +14 -7
- package/i18n/it.json +6 -2
- package/i18n/pt.json +234 -0
- package/i18n/uk.json +5 -1
- package/icons/InsuraceLogo.d.ts +2 -0
- package/icons/InsuraceLogo.js +7 -0
- package/icons/index.d.ts +1 -0
- package/icons/index.js +1 -0
- package/index.d.ts +0 -6
- package/index.js +0 -5
- package/package.json +12 -12
- package/pages/ActiveSwapsPage/ActiveSwapsPage.js +2 -2
- package/pages/MainPage/MainGasMessage.d.ts +3 -0
- package/pages/MainPage/MainGasMessage.js +8 -0
- package/pages/MainPage/MainPage.js +3 -2
- package/pages/MainPage/MainSwapButton.js +1 -1
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +2 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
- package/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
- package/pages/SettingsPage/RoutePrioritySelect.js +1 -1
- package/pages/SwapDetailsPage/SwapDetailsPage.js +5 -4
- package/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
- package/pages/SwapPage/ExchangeRateBottomSheet.d.ts +1 -2
- package/pages/SwapPage/ExchangeRateBottomSheet.js +0 -12
- package/pages/SwapPage/StartSwapButton.d.ts +3 -2
- package/pages/SwapPage/StartSwapButton.js +13 -4
- package/pages/SwapPage/SwapPage.js +21 -10
- package/pages/SwapPage/types.d.ts +9 -0
- package/pages/SwapPage/types.js +1 -0
- package/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
- package/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +2 -1
- package/providers/SDKProvider/SDKProvider.d.ts +2 -2
- package/providers/SDKProvider/SDKProvider.js +3 -2
- package/providers/SwapFormProvider/FormUpdater.js +2 -3
- package/providers/SwapFormProvider/SwapFormProvider.js +2 -3
- package/providers/SwapFormProvider/index.d.ts +1 -0
- package/providers/SwapFormProvider/index.js +1 -0
- package/providers/WidgetProvider/WidgetProvider.js +17 -4
- package/providers/WidgetProvider/utils.d.ts +1 -1
- package/providers/WidgetProvider/utils.js +2 -4
- package/stores/StoreProvider.js +2 -2
- package/stores/routes/createRouteExecutionStore.js +3 -2
- package/stores/routes/index.d.ts +0 -1
- package/stores/routes/index.js +0 -1
- package/stores/routes/types.d.ts +1 -5
- package/stores/routes/useSetExecutableRoute.d.ts +1 -1
- package/stores/settings/types.d.ts +1 -0
- package/stores/settings/useSettingsStore.js +1 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +5 -10
- package/utils/format.js +4 -1
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +0 -31
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +0 -9
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.js +0 -14
- package/cjs/components/GasSufficiencyMessage/index.d.ts +0 -1
- package/cjs/components/SwapRoutes/useSetRecommendedRoute.d.ts +0 -2
- package/cjs/components/SwapRoutes/useSetRecommendedRoute.js +0 -13
- package/cjs/config/env.d.ts +0 -3
- package/cjs/config/env.js +0 -6
- package/cjs/stores/routes/useRecommendedRouteStore.d.ts +0 -10
- package/cjs/stores/routes/useRecommendedRouteStore.js +0 -39
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +0 -27
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +0 -9
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.js +0 -11
- package/components/GasSufficiencyMessage/index.d.ts +0 -1
- package/components/GasSufficiencyMessage/index.js +0 -1
- package/components/SwapRoutes/useSetRecommendedRoute.d.ts +0 -2
- package/components/SwapRoutes/useSetRecommendedRoute.js +0 -9
- package/config/env.d.ts +0 -3
- package/config/env.js +0 -3
- package/stores/routes/useRecommendedRouteStore.d.ts +0 -10
- package/stores/routes/useRecommendedRouteStore.js +0 -32
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GasStepProcess = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const EvStation_1 = require("@mui/icons-material/EvStation");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const react_i18next_1 = require("react-i18next");
|
|
8
8
|
const CircularProgress_style_1 = require("./CircularProgress.style");
|
|
@@ -12,10 +12,10 @@ const GasStepProcess = ({ step }) => {
|
|
|
12
12
|
return ((0, jsx_runtime_1.jsx)(material_1.Box, { px: 2, py: 1, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
13
13
|
display: 'flex',
|
|
14
14
|
alignItems: 'center',
|
|
15
|
-
}, children: [(0, jsx_runtime_1.jsx)(CircularProgress_style_1.CircularIcon, { status: isDone ? 'DONE' : 'NOT_STARTED', children: (0, jsx_runtime_1.jsx)(
|
|
15
|
+
}, children: [(0, jsx_runtime_1.jsx)(CircularProgress_style_1.CircularIcon, { status: isDone ? 'DONE' : 'NOT_STARTED', children: (0, jsx_runtime_1.jsx)(EvStation_1.default, { color: isDone ? 'success' : 'inherit', sx: {
|
|
16
16
|
position: 'absolute',
|
|
17
17
|
fontSize: '1rem',
|
|
18
|
-
} }) }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { ml: 2, fontSize: 14, fontWeight: 400, children: [t('format.currency', {
|
|
18
|
+
} }) }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { ml: 2, flex: 1, fontSize: 14, fontWeight: 400, children: [t('format.currency', {
|
|
19
19
|
value: (step.execution?.gasAmountUSD ||
|
|
20
20
|
step.estimate.gasCosts?.reduce((amount, gasCost) => amount + parseFloat(gasCost.amountUSD || '0'), 0)) ??
|
|
21
21
|
0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { LifiStep, TokenAmount } from '@lifi/sdk';
|
|
3
3
|
export declare const Step: React.FC<{
|
|
4
|
-
step:
|
|
4
|
+
step: LifiStep;
|
|
5
5
|
fromToken?: TokenAmount;
|
|
6
6
|
toToken?: TokenAmount;
|
|
7
7
|
toAddress?: string;
|
|
@@ -20,17 +20,15 @@ const Step = ({ step, fromToken, toToken, toAddress }) => {
|
|
|
20
20
|
const getCardTitle = () => {
|
|
21
21
|
switch (step.type) {
|
|
22
22
|
case 'lifi':
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const hasCrossStep = step.includedSteps.some((step) => step.type === 'cross');
|
|
24
|
+
const hasSwapStep = step.includedSteps.some((step) => step.type === 'swap');
|
|
25
|
+
if (hasCrossStep && hasSwapStep) {
|
|
26
|
+
return t('swap.stepSwapAndBridge');
|
|
25
27
|
}
|
|
26
|
-
if (
|
|
27
|
-
return t('swap.
|
|
28
|
+
if (hasCrossStep) {
|
|
29
|
+
return t('swap.stepBridge');
|
|
28
30
|
}
|
|
29
|
-
return t('swap.stepSwapAndBridge');
|
|
30
|
-
case 'swap':
|
|
31
31
|
return t('swap.stepSwap');
|
|
32
|
-
case 'cross':
|
|
33
|
-
return t('swap.stepBridge');
|
|
34
32
|
default:
|
|
35
33
|
return t('swap.stepSwap');
|
|
36
34
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Route } from '@lifi/sdk';
|
|
1
|
+
import type { Route } from '@lifi/sdk';
|
|
2
2
|
export declare const getStepList: (route?: Route) => JSX.Element[] | undefined;
|
|
@@ -12,10 +12,6 @@ const StepProcess = ({ step, process }) => {
|
|
|
12
12
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { px: 2, py: 1, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
13
13
|
display: 'flex',
|
|
14
14
|
alignItems: 'center',
|
|
15
|
-
}, children: [(0, jsx_runtime_1.jsx)(CircularProgress_1.CircularProgress, { process: process }), (0, jsx_runtime_1.jsx)(material_1.Typography, {
|
|
16
|
-
display: 'flex',
|
|
17
|
-
flex: 1,
|
|
18
|
-
justifyContent: 'flex-end',
|
|
19
|
-
}, children: (0, jsx_runtime_1.jsx)(StepProcess_style_1.LinkButton, { size: "small", edge: "end", LinkComponent: material_1.Link, href: process.txLink, target: "_blank", rel: "nofollow noreferrer", children: (0, jsx_runtime_1.jsx)(LinkRounded_1.default, {}) }) })) : null] }), message ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { ml: 6, fontSize: 14, fontWeight: 500, color: "text.secondary", children: message })) : null] }));
|
|
15
|
+
}, children: [(0, jsx_runtime_1.jsx)(CircularProgress_1.CircularProgress, { process: process }), (0, jsx_runtime_1.jsx)(material_1.Typography, { mx: 2, flex: 1, fontSize: 14, fontWeight: process.error ? 600 : 400, children: title }), process.txLink ? ((0, jsx_runtime_1.jsx)(StepProcess_style_1.LinkButton, { size: "small", edge: "end", LinkComponent: material_1.Link, href: process.txLink, target: "_blank", rel: "nofollow noreferrer", children: (0, jsx_runtime_1.jsx)(LinkRounded_1.default, {}) })) : null] }), message ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { ml: 6, fontSize: 14, fontWeight: 500, color: "text.secondary", children: message })) : null] }));
|
|
20
16
|
};
|
|
21
17
|
exports.StepProcess = StepProcess;
|
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "default" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
6
|
-
disabled?: boolean | undefined;
|
|
7
|
-
disableFocusRipple?: boolean | undefined;
|
|
8
|
-
edge?: false | "end" | "start" | undefined;
|
|
9
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
10
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
11
|
-
} & Omit<{
|
|
12
|
-
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
13
|
-
centerRipple?: boolean | undefined;
|
|
14
|
-
children?: import("react").ReactNode;
|
|
15
|
-
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
16
|
-
disabled?: boolean | undefined;
|
|
17
|
-
disableRipple?: boolean | undefined;
|
|
18
|
-
disableTouchRipple?: boolean | undefined;
|
|
19
|
-
focusRipple?: boolean | undefined;
|
|
20
|
-
focusVisibleClassName?: string | undefined;
|
|
21
|
-
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
22
|
-
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
23
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
24
|
-
tabIndex?: number | undefined;
|
|
25
|
-
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
26
|
-
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
27
|
-
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
28
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
29
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & Omit<import("@mui/material").LinkBaseProps, "classes"> & {
|
|
30
|
-
children?: import("react").ReactNode;
|
|
31
|
-
classes?: Partial<import("@mui/material").LinkClasses> | undefined;
|
|
32
|
-
color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined>);
|
|
33
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
34
|
-
TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material").ClassNameMap<never>>) | undefined;
|
|
35
|
-
underline?: "none" | "always" | "hover" | undefined;
|
|
36
|
-
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
|
|
37
|
-
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
38
|
-
ref?: ((instance: HTMLAnchorElement | null) => void) | import("react").RefObject<HTMLAnchorElement> | null | undefined;
|
|
39
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "p" | "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" | "onResize" | "onResizeCapture" | "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" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "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" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping" | "underline" | "TypographyClasses">, {}, {}>;
|
|
1
|
+
import type { StyledComponent } from '@emotion/styled';
|
|
2
|
+
import type { IconButtonProps, LinkProps } from '@mui/material';
|
|
3
|
+
export declare const LinkButton: StyledComponent<IconButtonProps & LinkProps>;
|
|
@@ -7,7 +7,7 @@ const react_i18next_1 = require("react-i18next");
|
|
|
7
7
|
const react_timer_hook_1 = require("react-timer-hook");
|
|
8
8
|
const getExpiryTimestamp = (step) => new Date((step.execution?.process[0]?.startedAt ?? Date.now()) +
|
|
9
9
|
step.estimate.executionDuration * 1000);
|
|
10
|
-
const StepTimer = ({ step, hideInProgress
|
|
10
|
+
const StepTimer = ({ step, hideInProgress }) => {
|
|
11
11
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
12
12
|
const [isExpired, setExpired] = (0, react_1.useState)(false);
|
|
13
13
|
const [isExecutionStarted, setExecutionStarted] = (0, react_1.useState)(!!step.execution);
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { Step } from '@lifi/sdk';
|
|
2
|
+
import type { LifiStep, Step } from '@lifi/sdk';
|
|
3
3
|
import type { WidgetVariant } from '../../types';
|
|
4
4
|
import type { StepActionsProps, StepDetailsLabelProps } from './types';
|
|
5
5
|
export declare const StepActions: React.FC<StepActionsProps>;
|
|
6
|
+
export declare const IncludedSteps: React.FC<{
|
|
7
|
+
step: LifiStep;
|
|
8
|
+
variant?: WidgetVariant;
|
|
9
|
+
}>;
|
|
6
10
|
export declare const StepDetailsContent: React.FC<{
|
|
7
11
|
step: Step;
|
|
8
12
|
variant?: WidgetVariant;
|
|
@@ -10,3 +14,4 @@ export declare const StepDetailsContent: React.FC<{
|
|
|
10
14
|
export declare const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps>;
|
|
11
15
|
export declare const CrossStepDetailsLabel: React.FC<Omit<StepDetailsLabelProps, 'variant'>>;
|
|
12
16
|
export declare const SwapStepDetailsLabel: React.FC<Omit<StepDetailsLabelProps, 'variant'>>;
|
|
17
|
+
export declare const ProtocolStepDetailsLabel: React.FC<Omit<StepDetailsLabelProps, 'variant'>>;
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwapStepDetailsLabel = exports.CrossStepDetailsLabel = exports.CustomStepDetailsLabel = exports.StepDetailsContent = exports.StepActions = void 0;
|
|
3
|
+
exports.ProtocolStepDetailsLabel = exports.SwapStepDetailsLabel = exports.CrossStepDetailsLabel = exports.CustomStepDetailsLabel = exports.StepDetailsContent = exports.IncludedSteps = exports.StepActions = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const ArrowForward_1 = require("@mui/icons-material/ArrowForward");
|
|
6
|
+
const ExpandLess_1 = require("@mui/icons-material/ExpandLess");
|
|
7
|
+
const ExpandMore_1 = require("@mui/icons-material/ExpandMore");
|
|
6
8
|
const material_1 = require("@mui/material");
|
|
9
|
+
const big_js_1 = require("big.js");
|
|
10
|
+
const react_1 = require("react");
|
|
7
11
|
const react_i18next_1 = require("react-i18next");
|
|
8
12
|
const hooks_1 = require("../../hooks");
|
|
9
13
|
const icons_1 = require("../../icons");
|
|
10
14
|
const providers_1 = require("../../providers");
|
|
11
15
|
const utils_1 = require("../../utils");
|
|
16
|
+
const Card_1 = require("../Card");
|
|
12
17
|
const SmallAvatar_1 = require("../SmallAvatar");
|
|
13
18
|
const StepActions_style_1 = require("./StepActions.style");
|
|
14
19
|
const StepActions = ({ step, dense, ...other }) => {
|
|
20
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
15
21
|
const { variant, contractTool } = (0, providers_1.useWidgetConfig)();
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
? exports.CrossStepDetailsLabel
|
|
22
|
-
: exports.SwapStepDetailsLabel;
|
|
23
|
-
const isFullView = !dense && step.includedSteps?.length > 1;
|
|
22
|
+
const [cardExpanded, setCardExpanded] = (0, react_1.useState)(false);
|
|
23
|
+
const handleExpand = (e) => {
|
|
24
|
+
e.stopPropagation();
|
|
25
|
+
setCardExpanded((expanded) => !expanded);
|
|
26
|
+
};
|
|
24
27
|
const customStep = variant === 'nft'
|
|
25
28
|
? step.includedSteps?.find((step) => step.type === 'custom')
|
|
26
29
|
: undefined;
|
|
30
|
+
const hasCollapsedSteps = dense && step.includedSteps?.length > 1;
|
|
27
31
|
if (customStep && contractTool) {
|
|
28
32
|
const toolDetails = {
|
|
29
33
|
key: contractTool.name,
|
|
@@ -31,10 +35,16 @@ const StepActions = ({ step, dense, ...other }) => {
|
|
|
31
35
|
logoURI: contractTool.logoURI,
|
|
32
36
|
};
|
|
33
37
|
customStep.toolDetails = toolDetails;
|
|
34
|
-
if (
|
|
38
|
+
if (dense) {
|
|
35
39
|
step.toolDetails = toolDetails;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
42
|
+
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
|
+
tool: step.toolDetails.name,
|
|
44
|
+
}) }), 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 }))] }));
|
|
45
|
+
};
|
|
46
|
+
exports.StepActions = StepActions;
|
|
47
|
+
const IncludedSteps = ({ step, variant }) => {
|
|
38
48
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
39
49
|
const StepIconComponent = ({ icon }) => {
|
|
40
50
|
const tool = step.includedSteps?.[Number(icon) - 1];
|
|
@@ -42,17 +52,35 @@ const StepActions = ({ step, dense, ...other }) => {
|
|
|
42
52
|
boxSizing: 'content-box',
|
|
43
53
|
}, children: tool.toolDetails.name[0] })) : null;
|
|
44
54
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
const StepDetailsLabel = step.tool === 'custom' && variant === 'nft'
|
|
56
|
+
? exports.CustomStepDetailsLabel
|
|
57
|
+
: step.type === 'lifi' &&
|
|
58
|
+
step.includedSteps.some((step) => step.type === 'cross')
|
|
59
|
+
? exports.CrossStepDetailsLabel
|
|
60
|
+
: exports.SwapStepDetailsLabel;
|
|
61
|
+
return step.includedSteps.length > 1 ? ((0, jsx_runtime_1.jsx)(material_1.Box, { mt: 1.5, children: (0, jsx_runtime_1.jsx)(material_1.Stepper, { orientation: "vertical", connector: (0, jsx_runtime_1.jsx)(StepActions_style_1.StepConnector, {}), activeStep: -1, children: step.includedSteps.map((step, i) => ((0, jsx_runtime_1.jsxs)(material_1.Step, { expanded: true, children: [(0, jsx_runtime_1.jsx)(StepActions_style_1.StepLabel, { StepIconComponent: StepIconComponent, children: step.type === 'custom' && variant === 'nft' ? ((0, jsx_runtime_1.jsx)(exports.CustomStepDetailsLabel, { step: step, variant: variant })) : step.type === 'cross' ? ((0, jsx_runtime_1.jsx)(exports.CrossStepDetailsLabel, { step: step })) : step.type === 'protocol' ? ((0, jsx_runtime_1.jsx)(exports.ProtocolStepDetailsLabel, { step: step })) : ((0, jsx_runtime_1.jsx)(exports.SwapStepDetailsLabel, { step: step })) }), (0, jsx_runtime_1.jsx)(StepActions_style_1.StepContent, { children: (0, jsx_runtime_1.jsx)(exports.StepDetailsContent, { step: step, variant: variant }) })] }, step.id))) }) })) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { ml: 6, children: [(0, jsx_runtime_1.jsx)(StepDetailsLabel, { step: step, variant: variant === 'nft' ? variant : undefined }), (0, jsx_runtime_1.jsx)(exports.StepDetailsContent, { step: step, variant: variant })] }));
|
|
48
62
|
};
|
|
49
|
-
exports.
|
|
63
|
+
exports.IncludedSteps = IncludedSteps;
|
|
50
64
|
const StepDetailsContent = ({ step, variant }) => {
|
|
51
65
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
66
|
+
const sameTokenProtocolStep = step.action.fromToken.chainId === step.action.toToken.chainId &&
|
|
67
|
+
step.action.fromToken.address === step.action.toToken.address;
|
|
68
|
+
let fromAmount;
|
|
69
|
+
if (sameTokenProtocolStep) {
|
|
70
|
+
fromAmount = (0, big_js_1.default)(step.estimate.fromAmount)
|
|
71
|
+
.div(10 ** step.action.fromToken.decimals)
|
|
72
|
+
.minus((0, big_js_1.default)(step.estimate.toAmount).div(10 ** step.action.toToken.decimals));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
fromAmount = (0, utils_1.formatTokenAmount)(step.estimate.fromAmount, step.action.fromToken.decimals);
|
|
76
|
+
}
|
|
77
|
+
const showToAmount = step.type !== 'custom' &&
|
|
78
|
+
step.tool !== 'custom' &&
|
|
79
|
+
variant !== 'nft' &&
|
|
80
|
+
!sameTokenProtocolStep;
|
|
52
81
|
return ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", alignItems: "center", display: "flex", children: [t('format.number', {
|
|
53
|
-
value:
|
|
54
|
-
}), ' ', step.action.fromToken.symbol,
|
|
55
|
-
variant === 'nft') ? ((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', {
|
|
82
|
+
value: fromAmount,
|
|
83
|
+
}), ' ', 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', {
|
|
56
84
|
value: (0, utils_1.formatTokenAmount)(step.execution?.toAmount ?? step.estimate.toAmount, step.execution?.toToken?.decimals ?? step.action.toToken.decimals),
|
|
57
85
|
}), ' ', step.execution?.toToken?.symbol ?? step.action.toToken.symbol] })) : null] }));
|
|
58
86
|
};
|
|
@@ -86,3 +114,12 @@ const SwapStepDetailsLabel = ({ step }) => {
|
|
|
86
114
|
}) }));
|
|
87
115
|
};
|
|
88
116
|
exports.SwapStepDetailsLabel = SwapStepDetailsLabel;
|
|
117
|
+
const ProtocolStepDetailsLabel = ({ step }) => {
|
|
118
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
119
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", children: step.toolDetails.key === 'lifuelProtocol'
|
|
120
|
+
? t('swap.refuelStepDetails', {
|
|
121
|
+
tool: step.toolDetails.name,
|
|
122
|
+
})
|
|
123
|
+
: step.toolDetails.name }));
|
|
124
|
+
};
|
|
125
|
+
exports.ProtocolStepDetailsLabel = ProtocolStepDetailsLabel;
|
|
@@ -14,7 +14,7 @@ export declare const StepAvatar: import("@emotion/styled").StyledComponent<{
|
|
|
14
14
|
src?: string | undefined;
|
|
15
15
|
srcSet?: string | undefined;
|
|
16
16
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
17
|
-
variant?: "square" | "circular" | "rounded" | undefined;
|
|
17
|
+
variant?: import("@mui/types").OverridableStringUnion<"square" | "circular" | "rounded", import("@mui/material").AvatarPropsVariantOverrides> | undefined;
|
|
18
18
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
19
19
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
20
20
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Step } from '@lifi/sdk';
|
|
1
|
+
import type { LifiStep, Step } from '@lifi/sdk';
|
|
2
2
|
import type { BoxProps } from '@mui/material';
|
|
3
3
|
import type { WidgetVariant } from '../../types';
|
|
4
4
|
export interface StepActionsProps extends BoxProps {
|
|
5
|
-
step:
|
|
5
|
+
step: LifiStep;
|
|
6
6
|
dense?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export interface StepDetailsLabelProps {
|
|
@@ -7,7 +7,7 @@ const react_i18next_1 = require("react-i18next");
|
|
|
7
7
|
const react_router_dom_1 = require("react-router-dom");
|
|
8
8
|
const providers_1 = require("../../providers");
|
|
9
9
|
const utils_1 = require("../../utils");
|
|
10
|
-
const SwapButton = ({ onClick,
|
|
10
|
+
const SwapButton = ({ onClick, hasRoute, text, disabled, loading, }) => {
|
|
11
11
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
12
12
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
13
13
|
const { variant, walletManagement } = (0, providers_1.useWidgetConfig)();
|
|
@@ -27,7 +27,7 @@ const SwapButton = ({ onClick, currentRoute, text, disabled, loading, }) => {
|
|
|
27
27
|
};
|
|
28
28
|
const getButtonText = () => {
|
|
29
29
|
if (account.isActive) {
|
|
30
|
-
if (!
|
|
30
|
+
if (!hasRoute) {
|
|
31
31
|
return variant !== 'refuel' ? t(`button.swap`) : t(`button.getGas`);
|
|
32
32
|
}
|
|
33
33
|
if (text) {
|
|
@@ -4,7 +4,7 @@ export declare const minInputFontSize = 14;
|
|
|
4
4
|
export declare const FormControl: import("@emotion/styled").StyledComponent<{
|
|
5
5
|
children?: import("react").ReactNode;
|
|
6
6
|
classes?: Partial<import("@mui/material").FormControlClasses> | undefined;
|
|
7
|
-
color?: "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
7
|
+
color?: import("@mui/types").OverridableStringUnion<"success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").FormControlPropsColorOverrides> | undefined;
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
error?: boolean | undefined;
|
|
10
10
|
fullWidth?: boolean | undefined;
|
|
@@ -12,7 +12,7 @@ export declare const FormControl: import("@emotion/styled").StyledComponent<{
|
|
|
12
12
|
hiddenLabel?: boolean | undefined;
|
|
13
13
|
margin?: "normal" | "none" | "dense" | undefined;
|
|
14
14
|
required?: boolean | undefined;
|
|
15
|
-
size?: "small" | "medium" | undefined;
|
|
15
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium", import("@mui/material").FormControlPropsSizeOverrides> | undefined;
|
|
16
16
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
17
17
|
variant?: "outlined" | "filled" | "standard" | undefined;
|
|
18
18
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
export declare const Button: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
5
|
+
color?: import("@mui/types").OverridableStringUnion<"inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").ButtonPropsColorOverrides> | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableElevation?: boolean | undefined;
|
|
8
8
|
disableFocusRipple?: boolean | undefined;
|
|
9
9
|
endIcon?: import("react").ReactNode;
|
|
10
10
|
fullWidth?: boolean | undefined;
|
|
11
11
|
href?: string | undefined;
|
|
12
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
12
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").ButtonPropsSizeOverrides> | undefined;
|
|
13
13
|
startIcon?: import("react").ReactNode;
|
|
14
14
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
15
|
-
variant?: "text" | "outlined" | "contained" | undefined;
|
|
15
|
+
variant?: import("@mui/types").OverridableStringUnion<"text" | "outlined" | "contained", import("@mui/material").ButtonPropsVariantOverrides> | undefined;
|
|
16
16
|
} & Omit<{
|
|
17
17
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
18
18
|
centerRipple?: boolean | undefined;
|
|
@@ -3,23 +3,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SwapInputEndAdornment = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
|
+
const big_js_1 = require("big.js");
|
|
6
7
|
const react_hook_form_1 = require("react-hook-form");
|
|
7
8
|
const react_i18next_1 = require("react-i18next");
|
|
8
9
|
const hooks_1 = require("../../hooks");
|
|
9
10
|
const providers_1 = require("../../providers");
|
|
11
|
+
const utils_1 = require("../../utils");
|
|
10
12
|
const SwapInputAdornment_style_1 = require("./SwapInputAdornment.style");
|
|
11
13
|
const SwapInputEndAdornment = ({ formType }) => {
|
|
12
14
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
13
15
|
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
16
|
+
const { getChainById } = (0, hooks_1.useChains)();
|
|
14
17
|
const [chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
|
|
15
18
|
name: [
|
|
16
19
|
providers_1.SwapFormKeyHelper.getChainKey(formType),
|
|
17
20
|
providers_1.SwapFormKeyHelper.getTokenKey(formType),
|
|
18
21
|
],
|
|
19
22
|
});
|
|
23
|
+
const { data } = (0, hooks_1.useGasRecommendation)(chainId);
|
|
20
24
|
const { token, isLoading } = (0, hooks_1.useTokenAddressBalance)(chainId, tokenAddress);
|
|
21
25
|
const handleMax = () => {
|
|
22
|
-
|
|
26
|
+
const chain = getChainById(chainId);
|
|
27
|
+
let maxAmount;
|
|
28
|
+
if (chain?.nativeToken.address === tokenAddress &&
|
|
29
|
+
data?.available &&
|
|
30
|
+
data?.recommended) {
|
|
31
|
+
const tokenAmount = (0, big_js_1.default)(token?.amount ?? 0);
|
|
32
|
+
const recommendedAmount = (0, big_js_1.default)(data.recommended.amount)
|
|
33
|
+
.div(10 ** data.recommended.token.decimals)
|
|
34
|
+
.div(2);
|
|
35
|
+
if (tokenAmount.gt(recommendedAmount)) {
|
|
36
|
+
maxAmount = (0, utils_1.formatTokenAmount)(tokenAmount.minus(recommendedAmount).toString());
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), maxAmount || token?.amount || '', {
|
|
23
40
|
shouldTouch: true,
|
|
24
41
|
});
|
|
25
42
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CardProps } from '../Card';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SwapRouteCardProps } from './types';
|
|
4
4
|
export declare const SwapRouteCard: React.FC<SwapRouteCardProps & Omit<CardProps, 'variant'>>;
|
|
5
|
-
export declare const SwapRouteCardEssentials: React.FC<SwapRouteCardEssentialsProps>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SwapRouteCard = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const AccessTime_1 = require("@mui/icons-material/AccessTime");
|
|
6
|
-
const EvStationOutlined_1 = require("@mui/icons-material/EvStationOutlined");
|
|
7
5
|
const ExpandLess_1 = require("@mui/icons-material/ExpandLess");
|
|
8
6
|
const ExpandMore_1 = require("@mui/icons-material/ExpandMore");
|
|
9
|
-
const
|
|
7
|
+
const VerifiedUser_1 = require("@mui/icons-material/VerifiedUser");
|
|
10
8
|
const material_1 = require("@mui/material");
|
|
11
9
|
const react_1 = require("react");
|
|
12
10
|
const react_i18next_1 = require("react-i18next");
|
|
@@ -14,16 +12,12 @@ const providers_1 = require("../../providers");
|
|
|
14
12
|
const Card_1 = require("../Card");
|
|
15
13
|
const StepActions_1 = require("../StepActions");
|
|
16
14
|
const Token_1 = require("../Token");
|
|
17
|
-
const
|
|
18
|
-
const utils_1 = require("./utils");
|
|
15
|
+
const SwapRouteCardEssentials_1 = require("./SwapRouteCardEssentials");
|
|
19
16
|
const SwapRouteCard = ({ route, active, variant = 'default', expanded, ...other }) => {
|
|
20
17
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
21
|
-
const { variant: widgetVariant
|
|
22
|
-
const [cardExpanded, setCardExpanded] = (0, react_1.useState)(
|
|
23
|
-
const
|
|
24
|
-
const label = route.tags?.length
|
|
25
|
-
? t(`swap.tags.${route.tags[0]}`)
|
|
26
|
-
: alternativeTag;
|
|
18
|
+
const { variant: widgetVariant } = (0, providers_1.useWidgetConfig)();
|
|
19
|
+
const [cardExpanded, setCardExpanded] = (0, react_1.useState)(expanded);
|
|
20
|
+
const insurable = route.insurance?.state === 'INSURABLE';
|
|
27
21
|
const handleExpand = (e) => {
|
|
28
22
|
e.stopPropagation();
|
|
29
23
|
setCardExpanded((expanded) => !expanded);
|
|
@@ -31,19 +25,9 @@ const SwapRouteCard = ({ route, active, variant = 'default', expanded, ...other
|
|
|
31
25
|
const token = widgetVariant === 'nft'
|
|
32
26
|
? { ...route.fromToken, amount: route.fromAmount }
|
|
33
27
|
: { ...route.toToken, amount: route.toAmount };
|
|
34
|
-
const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, children: [widgetVariant !== 'refuel' &&
|
|
35
|
-
|
|
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 })] }));
|
|
31
|
+
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 }));
|
|
36
32
|
};
|
|
37
33
|
exports.SwapRouteCard = SwapRouteCard;
|
|
38
|
-
const SwapRouteCardEssentials = ({ route, dense }) => {
|
|
39
|
-
const { t } = (0, react_i18next_1.useTranslation)();
|
|
40
|
-
const executionTimeMinutes = Math.ceil(route.steps
|
|
41
|
-
.map((step) => step.estimate.executionDuration)
|
|
42
|
-
.reduce((duration, x) => duration + x, 0) / 60);
|
|
43
|
-
const gasCostUSD = parseFloat(route.gasCostUSD ?? '') || 0.01;
|
|
44
|
-
const gasCosts = (0, utils_1.getGasCostsBreakdown)(route);
|
|
45
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: dense ? 'space-between' : 'flex-end', flex: 1, pl: dense ? 0 : 2, mt: dense ? 2 : 0, 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) => ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 11, children: [gas.amount?.toFixed(6), " ", gas.token.symbol, " (", t(`format.currency`, { value: gas.amountUSD }), ")"] }, `${gas.token.address}${gas.token.symbol}`)))] }), 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)(material_1.Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: (0, jsx_runtime_1.jsx)(EvStationOutlined_1.default, { fontSize: dense ? 'medium' : '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: 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)(material_1.Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: (0, jsx_runtime_1.jsx)(AccessTime_1.default, { fontSize: dense ? 'medium' : 'small' }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t('swap.estimatedTime', {
|
|
46
|
-
value: executionTimeMinutes,
|
|
47
|
-
}) })] }) }), !dense ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`tooltip.numberOfSteps`), placement: "top", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: (0, jsx_runtime_1.jsx)(LayersOutlined_1.default, { fontSize: dense ? 'medium' : 'small' }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: route.steps.length })] }) })) : null] }));
|
|
48
|
-
};
|
|
49
|
-
exports.SwapRouteCardEssentials = SwapRouteCardEssentials;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const IconTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
3
|
align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
|
|
4
4
|
children?: import("react").ReactNode;
|
|
5
5
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
@@ -7,40 +7,8 @@ export declare const Label: import("@emotion/styled").StyledComponent<import("@m
|
|
|
7
7
|
noWrap?: boolean | undefined;
|
|
8
8
|
paragraph?: boolean | undefined;
|
|
9
9
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
10
|
-
variant?: "
|
|
11
|
-
variantMapping?: Partial<Record<"
|
|
10
|
+
variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
|
|
11
|
+
variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
|
|
12
12
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
13
13
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
14
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("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") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme
|
|
15
|
-
active?: boolean | undefined;
|
|
16
|
-
}, {}, {}>;
|
|
17
|
-
export declare const IconButton: import("@emotion/styled").StyledComponent<{
|
|
18
|
-
children?: import("react").ReactNode;
|
|
19
|
-
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
20
|
-
color?: "inherit" | "default" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
21
|
-
disabled?: boolean | undefined;
|
|
22
|
-
disableFocusRipple?: boolean | undefined;
|
|
23
|
-
edge?: false | "end" | "start" | undefined;
|
|
24
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
25
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
26
|
-
} & Omit<{
|
|
27
|
-
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
28
|
-
centerRipple?: boolean | undefined;
|
|
29
|
-
children?: import("react").ReactNode;
|
|
30
|
-
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
31
|
-
disabled?: boolean | undefined;
|
|
32
|
-
disableRipple?: boolean | undefined;
|
|
33
|
-
disableTouchRipple?: boolean | undefined;
|
|
34
|
-
focusRipple?: boolean | undefined;
|
|
35
|
-
focusVisibleClassName?: string | undefined;
|
|
36
|
-
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
37
|
-
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
38
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
39
|
-
tabIndex?: number | undefined;
|
|
40
|
-
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
41
|
-
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
42
|
-
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
43
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
44
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
45
|
-
active?: boolean | undefined;
|
|
46
|
-
}, {}, {}>;
|
|
14
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("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") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|