@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GasSufficiencyMessage = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const EvStation_1 = require("@mui/icons-material/EvStation");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_i18next_1 = require("react-i18next");
|
|
8
|
+
const GasMessage_style_1 = require("./GasMessage.style");
|
|
9
|
+
const GasSufficiencyMessage = ({ insufficientGas, }) => {
|
|
10
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(GasMessage_style_1.WarningMessageCard, { children: [(0, jsx_runtime_1.jsxs)(GasMessage_style_1.WarningMessageCardTitle, { display: "flex", alignItems: "center", px: 2, pt: 2, children: [(0, jsx_runtime_1.jsx)(EvStation_1.default, { sx: {
|
|
12
|
+
marginRight: 1,
|
|
13
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", fontWeight: 700, children: t(`swap.warning.title.insufficientGas`) })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", px: 2, pt: 1, children: t(`swap.warning.message.insufficientGas`) }), insufficientGas?.map((item, index) => ((0, jsx_runtime_1.jsx)(material_1.Typography
|
|
14
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
15
|
+
, { variant: "body2", px: 2, pb: insufficientGas?.length - 1 === index ? 2 : 0, pt: 0.5, children: t(`swap.tokenOnChainAmount`, {
|
|
16
|
+
amount: item.insufficientAmount?.toString(),
|
|
17
|
+
tokenSymbol: item.token.symbol,
|
|
18
|
+
chainName: item.chain?.name,
|
|
19
|
+
}) }, index)))] }));
|
|
20
|
+
};
|
|
21
|
+
exports.GasSufficiencyMessage = GasSufficiencyMessage;
|
|
@@ -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("./GasMessage"), exports);
|
|
18
|
+
__exportStar(require("./GasRefuelMessage"), exports);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const HeaderAppBar: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").PaperProps
|
|
2
|
+
export declare const HeaderAppBar: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").PaperProps, "classes" | "color" | "position"> & {
|
|
3
3
|
classes?: Partial<import("@mui/material").AppBarClasses> | undefined;
|
|
4
|
-
color?: "
|
|
4
|
+
color?: import("@mui/types").OverridableStringUnion<"transparent" | import("@mui/material").PropTypes.Color, import("@mui/material").AppBarPropsColorOverrides> | undefined;
|
|
5
5
|
enableColorOnDark?: boolean | undefined;
|
|
6
6
|
position?: "fixed" | "absolute" | "relative" | "static" | "sticky" | undefined;
|
|
7
7
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
8
8
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
9
9
|
ref?: ((instance: HTMLElement | null) => void) | import("react").RefObject<HTMLElement> | null | undefined;
|
|
10
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "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" | "ref" | "key" | "position" | "variant" | "square" | "elevation" | "enableColorOnDark"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
10
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "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" | "ref" | "key" | "position" | "variant" | "square" | "elevation" | "enableColorOnDark"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
11
11
|
export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
12
12
|
children?: import("react").ReactNode;
|
|
13
13
|
component?: import("react").ElementType<any> | undefined;
|
|
@@ -21,17 +21,17 @@ export declare const Container: import("@emotion/styled").StyledComponent<import
|
|
|
21
21
|
export declare const WalletButton: import("@emotion/styled").StyledComponent<{
|
|
22
22
|
children?: import("react").ReactNode;
|
|
23
23
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
24
|
-
color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
24
|
+
color?: import("@mui/types").OverridableStringUnion<"inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").ButtonPropsColorOverrides> | undefined;
|
|
25
25
|
disabled?: boolean | undefined;
|
|
26
26
|
disableElevation?: boolean | undefined;
|
|
27
27
|
disableFocusRipple?: boolean | undefined;
|
|
28
28
|
endIcon?: import("react").ReactNode;
|
|
29
29
|
fullWidth?: boolean | undefined;
|
|
30
30
|
href?: string | undefined;
|
|
31
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
31
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").ButtonPropsSizeOverrides> | undefined;
|
|
32
32
|
startIcon?: import("react").ReactNode;
|
|
33
33
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
34
|
-
variant?: "text" | "outlined" | "contained" | undefined;
|
|
34
|
+
variant?: import("@mui/types").OverridableStringUnion<"text" | "outlined" | "contained", import("@mui/material").ButtonPropsVariantOverrides> | undefined;
|
|
35
35
|
} & Omit<{
|
|
36
36
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
37
37
|
centerRipple?: boolean | undefined;
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NavigationHeader = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const ArrowBack_1 = require("@mui/icons-material/ArrowBack");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const ReceiptLong_1 = require("@mui/icons-material/ReceiptLong");
|
|
7
|
+
const Settings_1 = require("@mui/icons-material/Settings");
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
9
|
const react_i18next_1 = require("react-i18next");
|
|
10
10
|
const react_router_dom_1 = require("react-router-dom");
|
|
@@ -65,8 +65,8 @@ const NavigationHeader = () => {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
return ((0, jsx_runtime_1.jsxs)(Header_style_1.HeaderAppBar, { elevation: 0, children: [utils_1.backButtonRoutes.includes(path) ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: (0, jsx_runtime_1.jsx)(ArrowBack_1.default, {}) })) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: handleHeaderTitle() }), (0, jsx_runtime_1.jsxs)(react_router_dom_1.Routes, { children: [(0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: utils_1.navigationRoutes.home, element: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [account.isActive ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`header.swapHistory`), enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "start", onClick: () => navigate(utils_1.navigationRoutes.swapHistory), children: (0, jsx_runtime_1.jsx)(
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(Header_style_1.HeaderAppBar, { elevation: 0, children: [utils_1.backButtonRoutes.includes(path) ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: (0, jsx_runtime_1.jsx)(ArrowBack_1.default, {}) })) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: handleHeaderTitle() }), (0, jsx_runtime_1.jsxs)(react_router_dom_1.Routes, { children: [(0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: utils_1.navigationRoutes.home, element: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [account.isActive ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`header.swapHistory`), enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "start", onClick: () => navigate(utils_1.navigationRoutes.swapHistory), children: (0, jsx_runtime_1.jsx)(ReceiptLong_1.default, {}) }) })) : null, (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`header.settings`), enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", onClick: () => navigate(utils_1.navigationRoutes.settings), sx: {
|
|
69
69
|
marginRight: -1.25,
|
|
70
|
-
}, children: (0, jsx_runtime_1.jsx)(
|
|
70
|
+
}, children: (0, jsx_runtime_1.jsx)(Settings_1.default, {}) }) })] }) }), (0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: "*", element: element || (0, jsx_runtime_1.jsx)(material_1.Box, { width: 28, height: 40 }) })] })] }));
|
|
71
71
|
};
|
|
72
72
|
exports.NavigationHeader = NavigationHeader;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WalletHeader = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const ContentCopyRounded_1 = require("@mui/icons-material/ContentCopyRounded");
|
|
6
6
|
const ExpandMore_1 = require("@mui/icons-material/ExpandMore");
|
|
7
|
-
const
|
|
7
|
+
const OpenInNewRounded_1 = require("@mui/icons-material/OpenInNewRounded");
|
|
8
8
|
const PowerSettingsNewRounded_1 = require("@mui/icons-material/PowerSettingsNewRounded");
|
|
9
|
-
const
|
|
9
|
+
const Wallet_1 = require("@mui/icons-material/Wallet");
|
|
10
10
|
const material_1 = require("@mui/material");
|
|
11
11
|
const react_1 = require("react");
|
|
12
12
|
const react_i18next_1 = require("react-i18next");
|
|
@@ -34,7 +34,7 @@ const ConnectButton = () => {
|
|
|
34
34
|
}
|
|
35
35
|
navigate(utils_1.navigationRoutes.selectWallet);
|
|
36
36
|
};
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)(Header_style_1.WalletButton, { endIcon: (0, jsx_runtime_1.jsx)(
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(Header_style_1.WalletButton, { endIcon: (0, jsx_runtime_1.jsx)(Wallet_1.default, {}), onClick: !pathname.includes(utils_1.navigationRoutes.selectWallet) ? connect : undefined, sx: {
|
|
38
38
|
marginRight: -1.25,
|
|
39
39
|
}, children: t(`button.connectWallet`) }));
|
|
40
40
|
};
|
|
@@ -60,7 +60,7 @@ const ConnectedButton = () => {
|
|
|
60
60
|
};
|
|
61
61
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_style_1.WalletButton, { endIcon: (0, jsx_runtime_1.jsx)(ExpandMore_1.default, {}), startIcon: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: chain?.logoURI, alt: chain?.key, sx: { width: 24, height: 24 }, children: chain?.name[0] }), sx: {
|
|
62
62
|
marginRight: -1.25,
|
|
63
|
-
}, onClick: handleClick, children: walletAddress }), (0, jsx_runtime_1.jsxs)(WalletMenu_1.WalletMenu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClick: handleCopyAddress, children: [(0, jsx_runtime_1.jsx)(
|
|
63
|
+
}, onClick: handleClick, children: walletAddress }), (0, jsx_runtime_1.jsxs)(WalletMenu_1.WalletMenu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClick: handleCopyAddress, children: [(0, jsx_runtime_1.jsx)(ContentCopyRounded_1.default, {}), t(`button.copyAddress`)] }), (0, jsx_runtime_1.jsxs)(material_1.MenuItem, { component: "a", onClick: handleClose, href: `${chain?.metamask.blockExplorerUrls[0]}address/${account.address}`, target: "_blank", children: [(0, jsx_runtime_1.jsx)(OpenInNewRounded_1.default, {}), t(`button.viewOnExplorer`)] }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleDisconnect, fullWidth: true, startIcon: (0, jsx_runtime_1.jsx)(PowerSettingsNewRounded_1.default, {}), sx: {
|
|
64
64
|
marginTop: 1,
|
|
65
65
|
}, children: t(`button.disconnect`) })] })] }));
|
|
66
66
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Insurance = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const stores_1 = require("../../stores");
|
|
6
|
+
const InsuranceCard_1 = require("./InsuranceCard");
|
|
7
|
+
const InsuranceCollapsed_1 = require("./InsuranceCollapsed");
|
|
8
|
+
const Insurance = ({ status, insurableRouteId, feeAmountUsd, onChange, ...props }) => {
|
|
9
|
+
return status === stores_1.RouteExecutionStatus.Idle ? ((0, jsx_runtime_1.jsx)(InsuranceCollapsed_1.InsuranceCollapsed, { insurableRouteId: insurableRouteId, feeAmountUsd: feeAmountUsd, status: status, onChange: onChange, ...props })) : ((0, jsx_runtime_1.jsx)(InsuranceCard_1.InsuranceCard, { feeAmountUsd: feeAmountUsd, status: status, ...props }));
|
|
10
|
+
};
|
|
11
|
+
exports.Insurance = Insurance;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InsuranceCard = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const VerifiedUser_1 = require("@mui/icons-material/VerifiedUser");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_i18next_1 = require("react-i18next");
|
|
8
|
+
const icons_1 = require("../../icons");
|
|
9
|
+
const stores_1 = require("../../stores");
|
|
10
|
+
const Card_1 = require("../Card");
|
|
11
|
+
const Switch_1 = require("../Switch");
|
|
12
|
+
const InsuranceCard = ({ status, feeAmountUsd, onChange, ...props }) => {
|
|
13
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { selectionColor: "secondary", indented: true, ...props, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [(0, jsx_runtime_1.jsxs)(Card_1.CardLabel, { type: 'insurance', children: [(0, jsx_runtime_1.jsx)(VerifiedUser_1.default, { fontSize: "inherit" }), (0, jsx_runtime_1.jsx)(Card_1.CardLabelTypography, { type: "icon", children: status === stores_1.RouteExecutionStatus.Idle
|
|
15
|
+
? t(`swap.tags.insurance`)
|
|
16
|
+
: t(`swap.tags.insured`) })] }), (0, jsx_runtime_1.jsx)(icons_1.InsuraceLogo, {})] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 24, fontWeight: 700, lineHeight: 1, children: t('format.currency', {
|
|
17
|
+
value: feeAmountUsd,
|
|
18
|
+
}) }), status === stores_1.RouteExecutionStatus.Idle ? ((0, jsx_runtime_1.jsx)(Switch_1.Switch, { onChange: onChange })) : null] }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", children: (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, children: "Get 100% coverage for lost tokens." }) })] }));
|
|
19
|
+
};
|
|
20
|
+
exports.InsuranceCard = InsuranceCard;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InsuranceCollapsed = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const hooks_1 = require("../../hooks");
|
|
8
|
+
const stores_1 = require("../../stores");
|
|
9
|
+
const InsuranceCard_1 = require("./InsuranceCard");
|
|
10
|
+
const InsuranceCollapsed = ({ status, insurableRouteId, feeAmountUsd, onChange, children, ...props }) => {
|
|
11
|
+
const [insuredRoute, setInsuredRoute] = (0, react_1.useState)();
|
|
12
|
+
const setExecutableRoute = (0, stores_1.useSetExecutableRoute)();
|
|
13
|
+
const routeExecution = (0, stores_1.useRouteExecutionStore)((state) => state.routes[insurableRouteId]);
|
|
14
|
+
(0, hooks_1.useSwapRoutes)({
|
|
15
|
+
insurableRoute: routeExecution?.route,
|
|
16
|
+
onSettled(data) {
|
|
17
|
+
if (data?.routes?.[0]) {
|
|
18
|
+
setInsuredRoute(data.routes[0]);
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
const toggleInsurance = (_, checked) => {
|
|
23
|
+
if (insuredRoute) {
|
|
24
|
+
if (checked) {
|
|
25
|
+
setExecutableRoute(insuredRoute, insurableRouteId);
|
|
26
|
+
}
|
|
27
|
+
onChange?.(checked ? insuredRoute.id : insurableRouteId);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: insuredRoute?.insurance?.state === 'INSURED', unmountOnExit: true, mountOnEnter: true, appear: status === stores_1.RouteExecutionStatus.Idle, children: (0, jsx_runtime_1.jsx)(InsuranceCard_1.InsuranceCard, { feeAmountUsd: feeAmountUsd, status: status, onChange: toggleInsurance, ...props }) }));
|
|
31
|
+
};
|
|
32
|
+
exports.InsuranceCollapsed = InsuranceCollapsed;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Insurance';
|
|
@@ -14,4 +14,4 @@ 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("./
|
|
17
|
+
__exportStar(require("./Insurance"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { BoxProps } from '@mui/material';
|
|
3
|
+
import type { RouteExecutionStatus } from '../../stores';
|
|
4
|
+
export interface InsuranceProps extends Omit<BoxProps, 'onChange'> {
|
|
5
|
+
insurableRouteId: string;
|
|
6
|
+
feeAmountUsd?: string;
|
|
7
|
+
status?: RouteExecutionStatus;
|
|
8
|
+
onChange?: (routeId: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface InsuranceCardProps {
|
|
11
|
+
feeAmountUsd?: string;
|
|
12
|
+
status?: RouteExecutionStatus;
|
|
13
|
+
onChange?: (_: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
14
|
+
}
|
|
@@ -17,4 +17,4 @@ export declare const ListItemButton: import("@emotion/styled").StyledComponent<i
|
|
|
17
17
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
18
18
|
}, "classes"> & 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
|
-
}, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "
|
|
20
|
+
}, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -10,7 +10,7 @@ export declare const PreviewAvatar: import("@emotion/styled").StyledComponent<{
|
|
|
10
10
|
src?: string | undefined;
|
|
11
11
|
srcSet?: string | undefined;
|
|
12
12
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
13
|
-
variant?: "square" | "circular" | "rounded" | undefined;
|
|
13
|
+
variant?: import("@mui/types").OverridableStringUnion<"square" | "circular" | "rounded", import("@mui/material").AvatarPropsVariantOverrides> | undefined;
|
|
14
14
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
15
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
16
16
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
classes?: Partial<import("@mui/material").LinkClasses> | undefined;
|
|
5
|
-
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>);
|
|
6
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
|
-
TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material").ClassNameMap<never>>) | undefined;
|
|
8
|
-
underline?: "none" | "always" | "hover" | undefined;
|
|
9
|
-
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
|
|
10
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
11
|
-
ref?: ((instance: HTMLAnchorElement | null) => void) | import("react").RefObject<HTMLAnchorElement> | null | undefined;
|
|
12
|
-
}, 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"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
1
|
+
import type { StyledComponent } from '@emotion/styled';
|
|
2
|
+
import type { LinkProps } from '@mui/material';
|
|
3
|
+
export declare const Link: StyledComponent<LinkProps>;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
export declare const IconButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "default" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
5
|
+
color?: import("@mui/types").OverridableStringUnion<"inherit" | "default" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").IconButtonPropsColorOverrides> | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
edge?: false | "end" | "start" | undefined;
|
|
9
|
-
size?: "small" | "medium" | "large" | undefined;
|
|
9
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").IconButtonPropsSizeOverrides> | undefined;
|
|
10
10
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
11
11
|
} & Omit<{
|
|
12
12
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
@@ -14,14 +14,36 @@ const Card_1 = require("../Card");
|
|
|
14
14
|
const SendToWallet_style_1 = require("./SendToWallet.style");
|
|
15
15
|
exports.SendToWallet = (0, react_1.forwardRef)((props, ref) => {
|
|
16
16
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
17
|
-
const {
|
|
17
|
+
const { trigger, getValues, clearErrors } = (0, react_hook_form_1.useFormContext)();
|
|
18
18
|
const { account, provider } = (0, providers_1.useWallet)();
|
|
19
19
|
const { disabledUI, hiddenUI, requiredUI, toAddress } = (0, providers_1.useWidgetConfig)();
|
|
20
20
|
const { showSendToWallet, showSendToWalletDirty, setSendToWallet } = (0, stores_1.useSendToWalletStore)();
|
|
21
21
|
const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
|
|
22
22
|
const hiddenToAddress = hiddenUI?.includes(types_1.HiddenUI.ToAddress);
|
|
23
23
|
const disabledToAddress = disabledUI?.includes(types_1.DisabledUI.ToAddress);
|
|
24
|
-
const requiredToAddress = requiredUI?.includes(types_1.
|
|
24
|
+
const requiredToAddress = requiredUI?.includes(types_1.RequiredUI.ToAddress);
|
|
25
|
+
const requiredToAddressRef = (0, react_1.useRef)(requiredToAddress);
|
|
26
|
+
const { field: { onChange, onBlur, name, value }, } = (0, react_hook_form_1.useController)({
|
|
27
|
+
name: providers_1.SwapFormKey.ToAddress,
|
|
28
|
+
rules: {
|
|
29
|
+
required: requiredToAddress &&
|
|
30
|
+
t('swap.error.title.walletAddressRequired'),
|
|
31
|
+
validate: async (value) => {
|
|
32
|
+
try {
|
|
33
|
+
if (!value) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
const address = await provider?.resolveName(value);
|
|
37
|
+
return ((0, address_1.isAddress)(address || value) ||
|
|
38
|
+
t('swap.error.title.walletAddressInvalid'));
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return t('swap.error.title.walletEnsAddressInvalid');
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
onBlur: () => trigger(providers_1.SwapFormKey.ToAddress),
|
|
45
|
+
},
|
|
46
|
+
});
|
|
25
47
|
// We want to show toAddress field if it is set via widget configuration and not hidden
|
|
26
48
|
const showInstantly = Boolean(!showSendToWalletDirty &&
|
|
27
49
|
showDestinationWallet &&
|
|
@@ -36,33 +58,17 @@ exports.SendToWallet = (0, react_1.forwardRef)((props, ref) => {
|
|
|
36
58
|
const value = getValues(providers_1.SwapFormKey.ToAddress);
|
|
37
59
|
if (value) {
|
|
38
60
|
trigger(providers_1.SwapFormKey.ToAddress);
|
|
61
|
+
// Trigger validation if we change requiredToAddress in the runtime
|
|
39
62
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
63
|
+
else if (requiredToAddressRef.current !== requiredToAddress) {
|
|
64
|
+
requiredToAddressRef.current = requiredToAddress;
|
|
65
|
+
trigger(providers_1.SwapFormKey.ToAddress).then(() => clearErrors(providers_1.SwapFormKey.ToAddress));
|
|
66
|
+
}
|
|
67
|
+
}, [account.chainId, clearErrors, getValues, requiredToAddress, trigger]);
|
|
44
68
|
if (hiddenToAddress) {
|
|
45
69
|
return null;
|
|
46
70
|
}
|
|
47
|
-
|
|
48
|
-
required: requiredToAddress &&
|
|
49
|
-
t('swap.error.title.walletAddressRequired'),
|
|
50
|
-
validate: async (value) => {
|
|
51
|
-
try {
|
|
52
|
-
if (!value) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
const address = await provider?.resolveName(value);
|
|
56
|
-
return ((0, address_1.isAddress)(address || value) ||
|
|
57
|
-
t('swap.error.title.walletAddressInvalid'));
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
return t('swap.error.title.walletEnsAddressInvalid');
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
onBlur: () => trigger(providers_1.SwapFormKey.ToAddress),
|
|
64
|
-
});
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: showInstantly ? 0 : 225, in: showSendToWallet || showInstantly, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { ...props, ref: ref, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { required: requiredToAddress, children: t('swap.sendToWallet') }), (0, jsx_runtime_1.jsxs)(SendToWallet_style_1.FormControl, { fullWidth: true, sx: { paddingTop: '6px', paddingBottom: '5px' }, children: [(0, jsx_runtime_1.jsx)(SendToWallet_style_1.Input, { ref: inputRef, size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: onChange, onBlur: onBlur, name: name, placeholder: t('swap.walletAddressOrEns'), disabled: Boolean(toAddress && disabledToAddress) }), (0, jsx_runtime_1.jsx)(exports.SendToWalletFormHelperText, {})] })] }) }));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: showInstantly ? 0 : 225, in: showSendToWallet || showInstantly, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { ...props, ref: ref, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { required: requiredToAddress, children: t('swap.sendToWallet') }), (0, jsx_runtime_1.jsxs)(SendToWallet_style_1.FormControl, { fullWidth: true, sx: { paddingTop: '6px', paddingBottom: '5px' }, children: [(0, jsx_runtime_1.jsx)(SendToWallet_style_1.Input, { size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: onChange, onBlur: onBlur, name: name, value: value, placeholder: t('swap.walletAddressOrEns'), disabled: Boolean(toAddress && disabledToAddress) }), (0, jsx_runtime_1.jsx)(exports.SendToWalletFormHelperText, {})] })] }) }));
|
|
66
72
|
});
|
|
67
73
|
const SendToWalletFormHelperText = () => {
|
|
68
74
|
const { errors } = (0, react_hook_form_1.useFormState)();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const FormControl: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").FormControlClasses> | undefined;
|
|
5
|
-
color?: "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
|
|
5
|
+
color?: import("@mui/types").OverridableStringUnion<"success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").FormControlPropsColorOverrides> | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
error?: boolean | undefined;
|
|
8
8
|
fullWidth?: boolean | undefined;
|
|
@@ -10,7 +10,7 @@ export declare const FormControl: import("@emotion/styled").StyledComponent<{
|
|
|
10
10
|
hiddenLabel?: boolean | undefined;
|
|
11
11
|
margin?: "normal" | "none" | "dense" | undefined;
|
|
12
12
|
required?: boolean | undefined;
|
|
13
|
-
size?: "small" | "medium" | undefined;
|
|
13
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium", import("@mui/material").FormControlPropsSizeOverrides> | undefined;
|
|
14
14
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
15
15
|
variant?: "outlined" | "filled" | "standard" | undefined;
|
|
16
16
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SendToWalletButton = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const Wallet_1 = require("@mui/icons-material/Wallet");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const react_hook_form_1 = require("react-hook-form");
|
|
8
8
|
const react_i18next_1 = require("react-i18next");
|
|
@@ -19,7 +19,7 @@ const SendToWalletButton = () => {
|
|
|
19
19
|
if (!showDestinationWallet ||
|
|
20
20
|
!account.isActive ||
|
|
21
21
|
hiddenUI?.includes(types_1.HiddenUI.ToAddress) ||
|
|
22
|
-
requiredUI?.includes(types_1.
|
|
22
|
+
requiredUI?.includes(types_1.RequiredUI.ToAddress)) {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
25
|
const handleClick = () => {
|
|
@@ -31,6 +31,6 @@ const SendToWalletButton = () => {
|
|
|
31
31
|
return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t('swap.sendToWallet'), placement: "bottom-end", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: showSendToWallet ? 'contained' : 'text', onClick: handleClick, sx: {
|
|
32
32
|
minWidth: 48,
|
|
33
33
|
marginLeft: 1,
|
|
34
|
-
}, children: (0, jsx_runtime_1.jsx)(
|
|
34
|
+
}, children: (0, jsx_runtime_1.jsx)(Wallet_1.default, {}) }) }));
|
|
35
35
|
};
|
|
36
36
|
exports.SendToWalletButton = SendToWalletButton;
|
|
@@ -10,7 +10,7 @@ export declare const SmallAvatar: import("@emotion/styled").StyledComponent<{
|
|
|
10
10
|
src?: string | undefined;
|
|
11
11
|
srcSet?: string | undefined;
|
|
12
12
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
13
|
-
variant?: "square" | "circular" | "rounded" | undefined;
|
|
13
|
+
variant?: import("@mui/types").OverridableStringUnion<"square" | "circular" | "rounded", import("@mui/material").AvatarPropsVariantOverrides> | undefined;
|
|
14
14
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
15
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
16
16
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -20,7 +20,7 @@ export declare const SmallAvatarSkeletonBase: import("@emotion/styled").StyledCo
|
|
|
20
20
|
classes?: Partial<import("@mui/material").SkeletonClasses> | undefined;
|
|
21
21
|
height?: string | number | undefined;
|
|
22
22
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
23
|
-
variant?: "text" | "circular" | "rounded" | "rectangular" | undefined;
|
|
23
|
+
variant?: import("@mui/types").OverridableStringUnion<"text" | "circular" | "rounded" | "rectangular", import("@mui/material").SkeletonPropsVariantOverrides> | undefined;
|
|
24
24
|
width?: string | number | undefined;
|
|
25
25
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
26
26
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Status, Substatus } from '@lifi/sdk';
|
|
3
|
-
import { Theme } from '@mui/material';
|
|
3
|
+
import type { Theme } from '@mui/material';
|
|
4
4
|
export declare const CircularIcon: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<Theme> & {
|
|
5
5
|
children?: import("react").ReactNode;
|
|
6
6
|
component?: import("react").ElementType<any> | undefined;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DestinationWalletAddress = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const LinkRounded_1 = require("@mui/icons-material/LinkRounded");
|
|
6
|
-
const
|
|
6
|
+
const Wallet_1 = require("@mui/icons-material/Wallet");
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const react_i18next_1 = require("react-i18next");
|
|
9
9
|
const CircularProgress_style_1 = require("./CircularProgress.style");
|
|
@@ -14,19 +14,15 @@ const DestinationWalletAddress = ({ step, toAddress, toAddressLink }) => {
|
|
|
14
14
|
return ((0, jsx_runtime_1.jsx)(material_1.Box, { px: 2, py: 1, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
15
15
|
display: 'flex',
|
|
16
16
|
alignItems: 'center',
|
|
17
|
-
}, children: [(0, jsx_runtime_1.jsx)(CircularProgress_style_1.CircularIcon, { status: isDone ? 'DONE' : 'NOT_STARTED', children: (0, jsx_runtime_1.jsx)(
|
|
17
|
+
}, children: [(0, jsx_runtime_1.jsx)(CircularProgress_style_1.CircularIcon, { status: isDone ? 'DONE' : 'NOT_STARTED', children: (0, jsx_runtime_1.jsx)(Wallet_1.default, { color: isDone ? 'success' : 'inherit', sx: {
|
|
18
18
|
position: 'absolute',
|
|
19
19
|
fontSize: '1rem',
|
|
20
|
-
} }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, {
|
|
20
|
+
} }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { mx: 2, flex: 1, fontSize: 14, fontWeight: 400, children: isDone
|
|
21
21
|
? t('swap.sentToAddress', {
|
|
22
22
|
address: toAddress,
|
|
23
23
|
})
|
|
24
24
|
: t('swap.sendToAddress', {
|
|
25
25
|
address: toAddress,
|
|
26
|
-
}) }), (0, jsx_runtime_1.jsx)(
|
|
27
|
-
display: 'flex',
|
|
28
|
-
flex: 1,
|
|
29
|
-
justifyContent: 'flex-end',
|
|
30
|
-
}, children: (0, jsx_runtime_1.jsx)(StepProcess_style_1.LinkButton, { size: "small", edge: "end", LinkComponent: material_1.Link, href: toAddressLink, target: "_blank", rel: "nofollow noreferrer", children: (0, jsx_runtime_1.jsx)(LinkRounded_1.default, {}) }) })] }) }));
|
|
26
|
+
}) }), (0, jsx_runtime_1.jsx)(StepProcess_style_1.LinkButton, { size: "small", edge: "end", LinkComponent: material_1.Link, href: toAddressLink, target: "_blank", rel: "nofollow noreferrer", children: (0, jsx_runtime_1.jsx)(LinkRounded_1.default, {}) })] }) }));
|
|
31
27
|
};
|
|
32
28
|
exports.DestinationWalletAddress = DestinationWalletAddress;
|