@lifi/widget 3.0.0-alpha.10 → 3.0.0-alpha.12
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/AppProvider.tsx +4 -8
- package/_cjs/AppProvider.js +2 -2
- package/_cjs/AppProvider.js.map +1 -1
- package/_cjs/components/AmountInput/AmountInput.d.ts +1 -1
- package/_cjs/components/AmountInput/AmountInput.js +9 -16
- package/_cjs/components/AmountInput/AmountInput.js.map +1 -1
- package/_cjs/components/AmountInput/AmountInput.style.d.ts +3 -0
- package/_cjs/components/AmountInput/AmountInput.style.js +9 -4
- package/_cjs/components/AmountInput/AmountInput.style.js.map +1 -1
- package/_cjs/components/AmountInput/AmountInputAdornment.style.d.ts +4 -1
- package/_cjs/components/AmountInput/AmountInputAdornment.style.js +7 -2
- package/_cjs/components/AmountInput/AmountInputAdornment.style.js.map +1 -1
- package/_cjs/components/AmountInput/AmountInputEndAdornment.d.ts +1 -1
- package/_cjs/components/AmountInput/AmountInputEndAdornment.js +6 -12
- package/_cjs/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/_cjs/components/AmountInput/AmountInputStartAdornment.d.ts +1 -1
- package/_cjs/components/AmountInput/AmountInputStartAdornment.js +3 -9
- package/_cjs/components/AmountInput/AmountInputStartAdornment.js.map +1 -1
- package/_cjs/components/AmountInput/PriceFormHelperText.d.ts +9 -0
- package/_cjs/components/AmountInput/PriceFormHelperText.js +36 -0
- package/_cjs/components/AmountInput/PriceFormHelperText.js.map +1 -0
- package/_cjs/components/Card/CardHeader.js +6 -5
- package/_cjs/components/Card/CardHeader.js.map +1 -1
- package/_cjs/components/Card/CardTitle.js +3 -4
- package/_cjs/components/Card/CardTitle.js.map +1 -1
- package/_cjs/components/ChainSelect/ChainSelect.d.ts +1 -1
- package/_cjs/components/ChainSelect/ChainSelect.js +1 -5
- package/_cjs/components/ChainSelect/ChainSelect.js.map +1 -1
- package/_cjs/components/ChainSelect/useChainSelect.d.ts +1 -1
- package/_cjs/components/ChainSelect/useChainSelect.js +10 -14
- package/_cjs/components/ChainSelect/useChainSelect.js.map +1 -1
- package/_cjs/components/Header/NavigationTabs.js +4 -6
- package/_cjs/components/Header/NavigationTabs.js.map +1 -1
- package/_cjs/components/Header/WalletHeader.js +4 -2
- package/_cjs/components/Header/WalletHeader.js.map +1 -1
- package/_cjs/components/Header/WalletMenu.js +3 -3
- package/_cjs/components/Header/WalletMenu.js.map +1 -1
- package/_cjs/components/Insurance/InsuranceCard.js +1 -8
- package/_cjs/components/Insurance/InsuranceCard.js.map +1 -1
- package/_cjs/components/ListItemText.d.ts +1 -1
- package/_cjs/components/NFT/NFT.js +13 -14
- package/_cjs/components/NFT/NFT.js.map +1 -1
- package/_cjs/components/PageContainer.d.ts +9 -0
- package/_cjs/components/PageContainer.js +13 -0
- package/_cjs/components/PageContainer.js.map +1 -0
- package/_cjs/components/ReverseTokensButton/ReverseTokensButton.js +11 -17
- package/_cjs/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/_cjs/components/ReverseTokensButton/ReverseTokensButton.style.js +3 -0
- package/_cjs/components/ReverseTokensButton/ReverseTokensButton.style.js.map +1 -1
- package/_cjs/components/RouteCard/RouteCard.js +6 -6
- package/_cjs/components/RouteCard/RouteCard.js.map +1 -1
- package/_cjs/components/RouteCard/RouteCard.style.d.ts +3 -0
- package/_cjs/components/RouteCard/RouteCard.style.js +7 -2
- package/_cjs/components/RouteCard/RouteCard.style.js.map +1 -1
- package/_cjs/components/RouteCard/RouteCardEssentials.js +12 -10
- package/_cjs/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/_cjs/components/RouteCard/RouteCardEssentialsExpanded.d.ts +3 -0
- package/_cjs/components/RouteCard/RouteCardEssentialsExpanded.js +32 -0
- package/_cjs/components/RouteCard/RouteCardEssentialsExpanded.js.map +1 -0
- package/_cjs/components/RouteCard/RouteCardSkeleton.js +2 -1
- package/_cjs/components/RouteCard/RouteCardSkeleton.js.map +1 -1
- package/_cjs/components/RouteCard/types.d.ts +6 -2
- package/_cjs/components/Routes/Routes.js +2 -2
- package/_cjs/components/Routes/Routes.js.map +1 -1
- package/_cjs/components/Routes/RoutesExpanded.js +3 -3
- package/_cjs/components/Routes/RoutesExpanded.js.map +1 -1
- package/_cjs/components/SelectChainAndToken.js +6 -13
- package/_cjs/components/SelectChainAndToken.js.map +1 -1
- package/_cjs/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
- package/_cjs/components/SelectTokenButton/SelectTokenButton.js +4 -6
- package/_cjs/components/SelectTokenButton/SelectTokenButton.js.map +1 -1
- package/_cjs/components/SelectTokenButton/SelectTokenButton.style.js +2 -3
- package/_cjs/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/_cjs/components/SendToWallet/SendToWallet.js +43 -32
- package/_cjs/components/SendToWallet/SendToWallet.js.map +1 -1
- package/_cjs/components/SendToWallet/SendToWalletButton.js +2 -3
- package/_cjs/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/_cjs/components/SmallAvatar.js +4 -4
- package/_cjs/components/Step/CircularProgress.js +5 -5
- package/_cjs/components/Step/CircularProgress.js.map +1 -1
- package/_cjs/components/Step/CircularProgress.style.js +3 -4
- package/_cjs/components/Step/CircularProgress.style.js.map +1 -1
- package/_cjs/components/Step/DestinationWalletAddress.js +2 -2
- package/_cjs/components/Step/DestinationWalletAddress.js.map +1 -1
- package/_cjs/components/Step/Step.js +1 -2
- package/_cjs/components/Step/Step.js.map +1 -1
- package/_cjs/components/Step/StepProcess.js +1 -1
- package/_cjs/components/Step/StepProcess.js.map +1 -1
- package/_cjs/components/Step/StepProcess.style.d.ts +2 -2
- package/_cjs/components/Step/StepTimer.js +9 -8
- package/_cjs/components/Step/StepTimer.js.map +1 -1
- package/_cjs/components/StepActions/StepActions.js +15 -18
- package/_cjs/components/StepActions/StepActions.js.map +1 -1
- package/_cjs/components/StepActions/StepActions.style.d.ts +8 -1
- package/_cjs/components/StepActions/StepActions.style.js +27 -17
- package/_cjs/components/StepActions/StepActions.style.js.map +1 -1
- package/_cjs/components/{Step/GasStepProcess.d.ts → StepActions/StepFeeBreakdown.d.ts} +1 -1
- package/_cjs/components/StepActions/StepFeeBreakdown.js +45 -0
- package/_cjs/components/StepActions/StepFeeBreakdown.js.map +1 -0
- package/_cjs/components/StepActions/StepFees.d.ts +6 -0
- package/_cjs/components/StepActions/StepFees.js +28 -0
- package/_cjs/components/StepActions/StepFees.js.map +1 -0
- package/_cjs/components/Tabs/Tabs.style.d.ts +1 -1
- package/_cjs/components/Token/Token.d.ts +6 -5
- package/_cjs/components/Token/Token.js +31 -15
- package/_cjs/components/Token/Token.js.map +1 -1
- package/_cjs/components/Token/Token.style.d.ts +1 -4
- package/_cjs/components/Token/Token.style.js +6 -21
- package/_cjs/components/Token/Token.style.js.map +1 -1
- package/_cjs/components/TokenAvatar/TokenAvatar.d.ts +3 -0
- package/_cjs/components/TokenAvatar/TokenAvatar.js +7 -3
- package/_cjs/components/TokenAvatar/TokenAvatar.js.map +1 -1
- package/_cjs/components/TokenAvatar/TokenAvatar.style.js +23 -13
- package/_cjs/components/TokenAvatar/TokenAvatar.style.js.map +1 -1
- package/_cjs/components/TokenList/TokenList.js +3 -6
- package/_cjs/components/TokenList/TokenList.js.map +1 -1
- package/_cjs/components/TokenList/TokenList.style.d.ts +2 -2
- package/_cjs/components/TokenList/TokenList.style.js +7 -5
- package/_cjs/components/TokenList/TokenList.style.js.map +1 -1
- package/_cjs/components/TokenList/TokenListItem.js +7 -4
- package/_cjs/components/TokenList/TokenListItem.js.map +1 -1
- package/_cjs/components/TokenList/TokenNotFound.d.ts +1 -1
- package/_cjs/components/TokenList/TokenNotFound.js +2 -5
- package/_cjs/components/TokenList/TokenNotFound.js.map +1 -1
- package/_cjs/components/TokenList/types.d.ts +3 -3
- package/_cjs/components/TokenList/useTokenSelect.d.ts +1 -1
- package/_cjs/components/TokenList/useTokenSelect.js +15 -18
- package/_cjs/components/TokenList/useTokenSelect.js.map +1 -1
- package/_cjs/config/theme.js +2 -9
- package/_cjs/config/theme.js.map +1 -1
- package/_cjs/config/version.d.ts +1 -1
- package/_cjs/config/version.js +1 -1
- package/_cjs/hooks/useDebouncedWatch.d.ts +2 -1
- package/_cjs/hooks/useDebouncedWatch.js +3 -7
- package/_cjs/hooks/useDebouncedWatch.js.map +1 -1
- package/_cjs/hooks/useFromTokenSufficiency.js +1 -5
- package/_cjs/hooks/useFromTokenSufficiency.js.map +1 -1
- package/_cjs/hooks/useGasRefuel.js +2 -10
- package/_cjs/hooks/useGasRefuel.js.map +1 -1
- package/_cjs/hooks/useRequiredToAddress.js +2 -4
- package/_cjs/hooks/useRequiredToAddress.js.map +1 -1
- package/_cjs/hooks/useRoutes.d.ts +1 -1
- package/_cjs/hooks/useRoutes.js +2 -15
- package/_cjs/hooks/useRoutes.js.map +1 -1
- package/_cjs/hooks/useTokenAddressBalance.d.ts +1 -1
- package/_cjs/hooks/useTokenBalance.d.ts +1 -1
- package/_cjs/hooks/useTokenBalances.d.ts +1 -1
- package/_cjs/hooks/useTransactionHistory.d.ts +1 -1
- package/_cjs/i18n/en.json +8 -5
- package/_cjs/index.d.ts +2 -2
- package/_cjs/index.js +5 -5
- package/_cjs/index.js.map +1 -1
- package/_cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +2 -1
- package/_cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
- package/_cjs/pages/LanguagesPage/LanguagesPage.js +2 -1
- package/_cjs/pages/LanguagesPage/LanguagesPage.js.map +1 -1
- package/_cjs/pages/MainPage/MainPage.js +2 -2
- package/_cjs/pages/MainPage/MainPage.js.map +1 -1
- package/_cjs/pages/MainPage/ReviewButton.js +1 -2
- package/_cjs/pages/MainPage/ReviewButton.js.map +1 -1
- package/_cjs/pages/RoutesPage/RoutesPage.js +1 -1
- package/_cjs/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/_cjs/pages/SelectChainPage/SelectChainPage.js +2 -1
- package/_cjs/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/_cjs/pages/SelectChainPage/types.d.ts +1 -1
- package/_cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +2 -1
- package/_cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js.map +1 -1
- package/_cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +1 -1
- package/_cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +2 -1
- package/_cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js.map +1 -1
- package/_cjs/pages/SelectTokenPage/SearchTokenInput.js +12 -7
- package/_cjs/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/_cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +1 -1
- package/_cjs/pages/SelectTokenPage/SelectTokenPage.js +2 -1
- package/_cjs/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/_cjs/pages/SelectWalletPage/SelectWalletPage.js +2 -1
- package/_cjs/pages/SelectWalletPage/SelectWalletPage.js.map +1 -1
- package/_cjs/pages/SettingsPage/ResetSettingsButton.js +1 -1
- package/_cjs/pages/SettingsPage/ResetSettingsButton.js.map +1 -1
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCard.style.js +1 -1
- package/_cjs/pages/SettingsPage/SettingsPage.js +6 -6
- package/_cjs/pages/SettingsPage/SettingsPage.js.map +1 -1
- package/_cjs/pages/TransactionDetailsPage/TransactionDetailsPage.js +2 -2
- package/_cjs/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/_cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +6 -14
- package/_cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js.map +1 -1
- package/_cjs/pages/TransactionHistoryPage/TransactionHistoryItem.js +1 -1
- package/_cjs/pages/TransactionHistoryPage/TransactionHistoryItem.js.map +1 -1
- package/_cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js +3 -2
- package/_cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +1 -1
- package/_cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -1
- package/_cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +4 -9
- package/_cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.js.map +1 -1
- package/_cjs/pages/TransactionPage/StatusBottomSheet.js +10 -11
- package/_cjs/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/_cjs/pages/TransactionPage/TransactionPage.js +6 -7
- package/_cjs/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/_cjs/providers/WalletProvider/SDKProviders.js +2 -2
- package/_cjs/providers/WalletProvider/SDKProviders.js.map +1 -1
- package/_cjs/providers/index.d.ts +0 -1
- package/_cjs/providers/index.js +0 -1
- package/_cjs/providers/index.js.map +1 -1
- package/_cjs/stores/StoreProvider.js +4 -3
- package/_cjs/stores/StoreProvider.js.map +1 -1
- package/_cjs/stores/chains/ChainOrderStore.js +6 -10
- package/_cjs/stores/chains/ChainOrderStore.js.map +1 -1
- package/_cjs/stores/form/FormStore.d.ts +6 -0
- package/_cjs/stores/form/FormStore.js +39 -0
- package/_cjs/stores/form/FormStore.js.map +1 -0
- package/_cjs/stores/form/FormUpdater.d.ts +5 -0
- package/_cjs/stores/form/FormUpdater.js +61 -0
- package/_cjs/stores/form/FormUpdater.js.map +1 -0
- package/_cjs/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.js +9 -12
- package/_cjs/stores/form/URLSearchParamsBuilder.js.map +1 -0
- package/_cjs/stores/form/createFormStore.d.ts +3 -0
- package/_cjs/stores/form/createFormStore.js +183 -0
- package/_cjs/stores/form/createFormStore.js.map +1 -0
- package/_cjs/stores/form/index.d.ts +10 -0
- package/_cjs/{providers/FormProvider → stores/form}/index.js +9 -2
- package/_cjs/stores/form/index.js.map +1 -0
- package/_cjs/stores/form/types.d.ts +94 -0
- package/_cjs/stores/form/types.js +9 -0
- package/_cjs/stores/form/types.js.map +1 -0
- package/_cjs/stores/form/useFieldActions.d.ts +2 -0
- package/_cjs/stores/form/useFieldActions.js +19 -0
- package/_cjs/stores/form/useFieldActions.js.map +1 -0
- package/_cjs/stores/form/useFieldController.d.ts +11 -0
- package/_cjs/stores/form/useFieldController.js +24 -0
- package/_cjs/stores/form/useFieldController.js.map +1 -0
- package/_cjs/stores/form/useFieldValues.d.ts +2 -0
- package/_cjs/stores/form/useFieldValues.js +11 -0
- package/_cjs/stores/form/useFieldValues.js.map +1 -0
- package/_cjs/stores/form/useTouchedFields.d.ts +1 -0
- package/_cjs/stores/form/useTouchedFields.js +11 -0
- package/_cjs/stores/form/useTouchedFields.js.map +1 -0
- package/_cjs/stores/form/useValidation.d.ts +2 -0
- package/_cjs/stores/form/useValidation.js +15 -0
- package/_cjs/stores/form/useValidation.js.map +1 -0
- package/_cjs/stores/form/useValidationActions.d.ts +2 -0
- package/_cjs/stores/form/useValidationActions.js +19 -0
- package/_cjs/stores/form/useValidationActions.js.map +1 -0
- package/_cjs/stores/index.d.ts +1 -0
- package/_cjs/stores/index.js +1 -0
- package/_cjs/stores/index.js.map +1 -1
- package/_cjs/utils/converters.js +12 -6
- package/_cjs/utils/converters.js.map +1 -1
- package/_cjs/utils/fees.d.ts +9 -0
- package/_cjs/{components/RouteCard/utils.js → utils/fees.js} +15 -8
- package/_cjs/utils/fees.js.map +1 -0
- package/_cjs/utils/index.d.ts +1 -0
- package/_cjs/utils/index.js +1 -0
- package/_cjs/utils/index.js.map +1 -1
- package/_esm/AppProvider.js +3 -3
- package/_esm/AppProvider.js.map +1 -1
- package/_esm/components/AmountInput/AmountInput.d.ts +1 -1
- package/_esm/components/AmountInput/AmountInput.js +11 -18
- package/_esm/components/AmountInput/AmountInput.js.map +1 -1
- package/_esm/components/AmountInput/AmountInput.style.d.ts +3 -0
- package/_esm/components/AmountInput/AmountInput.style.js +9 -4
- package/_esm/components/AmountInput/AmountInput.style.js.map +1 -1
- package/_esm/components/AmountInput/AmountInputAdornment.style.d.ts +4 -1
- package/_esm/components/AmountInput/AmountInputAdornment.style.js +7 -2
- package/_esm/components/AmountInput/AmountInputAdornment.style.js.map +1 -1
- package/_esm/components/AmountInput/AmountInputEndAdornment.d.ts +1 -1
- package/_esm/components/AmountInput/AmountInputEndAdornment.js +8 -14
- package/_esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/_esm/components/AmountInput/AmountInputStartAdornment.d.ts +1 -1
- package/_esm/components/AmountInput/AmountInputStartAdornment.js +3 -9
- package/_esm/components/AmountInput/AmountInputStartAdornment.js.map +1 -1
- package/_esm/components/AmountInput/PriceFormHelperText.d.ts +9 -0
- package/_esm/components/AmountInput/PriceFormHelperText.js +31 -0
- package/_esm/components/AmountInput/PriceFormHelperText.js.map +1 -0
- package/_esm/components/Card/CardHeader.js +6 -5
- package/_esm/components/Card/CardHeader.js.map +1 -1
- package/_esm/components/Card/CardTitle.js +3 -4
- package/_esm/components/Card/CardTitle.js.map +1 -1
- package/_esm/components/ChainSelect/ChainSelect.d.ts +1 -1
- package/_esm/components/ChainSelect/ChainSelect.js +2 -6
- package/_esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/_esm/components/ChainSelect/useChainSelect.d.ts +1 -1
- package/_esm/components/ChainSelect/useChainSelect.js +11 -15
- package/_esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/_esm/components/Header/NavigationTabs.js +5 -7
- package/_esm/components/Header/NavigationTabs.js.map +1 -1
- package/_esm/components/Header/WalletHeader.js +4 -2
- package/_esm/components/Header/WalletHeader.js.map +1 -1
- package/_esm/components/Header/WalletMenu.js +3 -3
- package/_esm/components/Header/WalletMenu.js.map +1 -1
- package/_esm/components/Insurance/InsuranceCard.js +2 -9
- package/_esm/components/Insurance/InsuranceCard.js.map +1 -1
- package/_esm/components/ListItemText.d.ts +1 -1
- package/_esm/components/NFT/NFT.js +13 -14
- package/_esm/components/NFT/NFT.js.map +1 -1
- package/_esm/components/PageContainer.d.ts +9 -0
- package/_esm/components/PageContainer.js +10 -0
- package/_esm/components/PageContainer.js.map +1 -0
- package/_esm/components/ReverseTokensButton/ReverseTokensButton.js +11 -17
- package/_esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/_esm/components/ReverseTokensButton/ReverseTokensButton.style.js +3 -0
- package/_esm/components/ReverseTokensButton/ReverseTokensButton.style.js.map +1 -1
- package/_esm/components/RouteCard/RouteCard.js +6 -6
- package/_esm/components/RouteCard/RouteCard.js.map +1 -1
- package/_esm/components/RouteCard/RouteCard.style.d.ts +3 -0
- package/_esm/components/RouteCard/RouteCard.style.js +7 -2
- package/_esm/components/RouteCard/RouteCard.style.js.map +1 -1
- package/_esm/components/RouteCard/RouteCardEssentials.js +12 -10
- package/_esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/_esm/components/RouteCard/RouteCardEssentialsExpanded.d.ts +3 -0
- package/_esm/components/RouteCard/RouteCardEssentialsExpanded.js +28 -0
- package/_esm/components/RouteCard/RouteCardEssentialsExpanded.js.map +1 -0
- package/_esm/components/RouteCard/RouteCardSkeleton.js +2 -1
- package/_esm/components/RouteCard/RouteCardSkeleton.js.map +1 -1
- package/_esm/components/RouteCard/types.d.ts +6 -2
- package/_esm/components/Routes/Routes.js +2 -2
- package/_esm/components/Routes/Routes.js.map +1 -1
- package/_esm/components/Routes/RoutesExpanded.js +4 -4
- package/_esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/_esm/components/SelectChainAndToken.js +7 -14
- package/_esm/components/SelectChainAndToken.js.map +1 -1
- package/_esm/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
- package/_esm/components/SelectTokenButton/SelectTokenButton.js +5 -7
- package/_esm/components/SelectTokenButton/SelectTokenButton.js.map +1 -1
- package/_esm/components/SelectTokenButton/SelectTokenButton.style.js +2 -3
- package/_esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWallet.js +45 -34
- package/_esm/components/SendToWallet/SendToWallet.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWalletButton.js +4 -5
- package/_esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/_esm/components/SmallAvatar.js +4 -4
- package/_esm/components/Step/CircularProgress.js +5 -5
- package/_esm/components/Step/CircularProgress.js.map +1 -1
- package/_esm/components/Step/CircularProgress.style.js +3 -4
- package/_esm/components/Step/CircularProgress.style.js.map +1 -1
- package/_esm/components/Step/DestinationWalletAddress.js +2 -2
- package/_esm/components/Step/DestinationWalletAddress.js.map +1 -1
- package/_esm/components/Step/Step.js +1 -2
- package/_esm/components/Step/Step.js.map +1 -1
- package/_esm/components/Step/StepProcess.js +1 -1
- package/_esm/components/Step/StepProcess.js.map +1 -1
- package/_esm/components/Step/StepProcess.style.d.ts +2 -2
- package/_esm/components/Step/StepTimer.js +9 -8
- package/_esm/components/Step/StepTimer.js.map +1 -1
- package/_esm/components/StepActions/StepActions.js +16 -19
- package/_esm/components/StepActions/StepActions.js.map +1 -1
- package/_esm/components/StepActions/StepActions.style.d.ts +8 -1
- package/_esm/components/StepActions/StepActions.style.js +27 -17
- package/_esm/components/StepActions/StepActions.style.js.map +1 -1
- package/_esm/components/{Step/GasStepProcess.d.ts → StepActions/StepFeeBreakdown.d.ts} +1 -1
- package/_esm/components/StepActions/StepFeeBreakdown.js +41 -0
- package/_esm/components/StepActions/StepFeeBreakdown.js.map +1 -0
- package/_esm/components/StepActions/StepFees.d.ts +6 -0
- package/_esm/components/StepActions/StepFees.js +24 -0
- package/_esm/components/StepActions/StepFees.js.map +1 -0
- package/_esm/components/Tabs/Tabs.style.d.ts +1 -1
- package/_esm/components/Token/Token.d.ts +6 -5
- package/_esm/components/Token/Token.js +31 -16
- package/_esm/components/Token/Token.js.map +1 -1
- package/_esm/components/Token/Token.style.d.ts +1 -4
- package/_esm/components/Token/Token.style.js +6 -21
- package/_esm/components/Token/Token.style.js.map +1 -1
- package/_esm/components/TokenAvatar/TokenAvatar.d.ts +3 -0
- package/_esm/components/TokenAvatar/TokenAvatar.js +5 -2
- package/_esm/components/TokenAvatar/TokenAvatar.js.map +1 -1
- package/_esm/components/TokenAvatar/TokenAvatar.style.js +23 -13
- package/_esm/components/TokenAvatar/TokenAvatar.style.js.map +1 -1
- package/_esm/components/TokenList/TokenList.js +3 -6
- package/_esm/components/TokenList/TokenList.js.map +1 -1
- package/_esm/components/TokenList/TokenList.style.d.ts +2 -2
- package/_esm/components/TokenList/TokenList.style.js +7 -5
- package/_esm/components/TokenList/TokenList.style.js.map +1 -1
- package/_esm/components/TokenList/TokenListItem.js +7 -4
- package/_esm/components/TokenList/TokenListItem.js.map +1 -1
- package/_esm/components/TokenList/TokenNotFound.d.ts +1 -1
- package/_esm/components/TokenList/TokenNotFound.js +2 -5
- package/_esm/components/TokenList/TokenNotFound.js.map +1 -1
- package/_esm/components/TokenList/types.d.ts +3 -3
- package/_esm/components/TokenList/useTokenSelect.d.ts +1 -1
- package/_esm/components/TokenList/useTokenSelect.js +15 -18
- package/_esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/_esm/config/theme.js +2 -9
- package/_esm/config/theme.js.map +1 -1
- package/_esm/config/version.d.ts +1 -1
- package/_esm/config/version.js +1 -1
- package/_esm/hooks/useDebouncedWatch.d.ts +2 -1
- package/_esm/hooks/useDebouncedWatch.js +3 -7
- package/_esm/hooks/useDebouncedWatch.js.map +1 -1
- package/_esm/hooks/useFromTokenSufficiency.js +2 -6
- package/_esm/hooks/useFromTokenSufficiency.js.map +1 -1
- package/_esm/hooks/useGasRefuel.js +2 -10
- package/_esm/hooks/useGasRefuel.js.map +1 -1
- package/_esm/hooks/useRequiredToAddress.js +3 -5
- package/_esm/hooks/useRequiredToAddress.js.map +1 -1
- package/_esm/hooks/useRoutes.d.ts +1 -1
- package/_esm/hooks/useRoutes.js +4 -17
- package/_esm/hooks/useRoutes.js.map +1 -1
- package/_esm/hooks/useTokenAddressBalance.d.ts +1 -1
- package/_esm/hooks/useTokenBalance.d.ts +1 -1
- package/_esm/hooks/useTokenBalances.d.ts +1 -1
- package/_esm/hooks/useTransactionHistory.d.ts +1 -1
- package/_esm/i18n/en.json +8 -5
- package/_esm/index.d.ts +2 -2
- package/_esm/index.js +2 -2
- package/_esm/index.js.map +1 -1
- package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +3 -2
- package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
- package/_esm/pages/LanguagesPage/LanguagesPage.js +3 -2
- package/_esm/pages/LanguagesPage/LanguagesPage.js.map +1 -1
- package/_esm/pages/MainPage/MainPage.js +2 -2
- package/_esm/pages/MainPage/MainPage.js.map +1 -1
- package/_esm/pages/MainPage/ReviewButton.js +2 -3
- package/_esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/_esm/pages/RoutesPage/RoutesPage.js +1 -1
- package/_esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/_esm/pages/SelectChainPage/SelectChainPage.js +3 -2
- package/_esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/_esm/pages/SelectChainPage/types.d.ts +1 -1
- package/_esm/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +3 -2
- package/_esm/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js.map +1 -1
- package/_esm/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +1 -1
- package/_esm/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +3 -2
- package/_esm/pages/SelectNativeTokenPage/SelectNativeTokenPage.js.map +1 -1
- package/_esm/pages/SelectTokenPage/SearchTokenInput.js +12 -7
- package/_esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/_esm/pages/SelectTokenPage/SelectTokenPage.d.ts +1 -1
- package/_esm/pages/SelectTokenPage/SelectTokenPage.js +3 -2
- package/_esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/_esm/pages/SelectWalletPage/SelectWalletPage.js +3 -2
- package/_esm/pages/SelectWalletPage/SelectWalletPage.js.map +1 -1
- package/_esm/pages/SettingsPage/ResetSettingsButton.js +1 -1
- package/_esm/pages/SettingsPage/ResetSettingsButton.js.map +1 -1
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.js +1 -1
- package/_esm/pages/SettingsPage/SettingsPage.js +6 -6
- package/_esm/pages/SettingsPage/SettingsPage.js.map +1 -1
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +2 -2
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +7 -15
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js.map +1 -1
- package/_esm/pages/TransactionHistoryPage/TransactionHistoryItem.js +1 -1
- package/_esm/pages/TransactionHistoryPage/TransactionHistoryItem.js.map +1 -1
- package/_esm/pages/TransactionHistoryPage/TransactionHistoryPage.js +5 -4
- package/_esm/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +1 -1
- package/_esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -1
- package/_esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +3 -8
- package/_esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.js.map +1 -1
- package/_esm/pages/TransactionPage/StatusBottomSheet.js +12 -13
- package/_esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/_esm/pages/TransactionPage/TransactionPage.js +8 -9
- package/_esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/_esm/providers/WalletProvider/SDKProviders.js +2 -2
- package/_esm/providers/WalletProvider/SDKProviders.js.map +1 -1
- package/_esm/providers/index.d.ts +0 -1
- package/_esm/providers/index.js +0 -1
- package/_esm/providers/index.js.map +1 -1
- package/_esm/stores/StoreProvider.js +4 -3
- package/_esm/stores/StoreProvider.js.map +1 -1
- package/_esm/stores/chains/ChainOrderStore.js +6 -10
- package/_esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/_esm/stores/form/FormStore.d.ts +6 -0
- package/_esm/stores/form/FormStore.js +34 -0
- package/_esm/stores/form/FormStore.js.map +1 -0
- package/_esm/stores/form/FormUpdater.d.ts +5 -0
- package/_esm/stores/form/FormUpdater.js +57 -0
- package/_esm/stores/form/FormUpdater.js.map +1 -0
- package/_esm/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.js +9 -12
- package/_esm/stores/form/URLSearchParamsBuilder.js.map +1 -0
- package/_esm/stores/form/createFormStore.d.ts +3 -0
- package/_esm/stores/form/createFormStore.js +179 -0
- package/_esm/stores/form/createFormStore.js.map +1 -0
- package/_esm/stores/form/index.d.ts +10 -0
- package/_esm/stores/form/index.js +11 -0
- package/_esm/stores/form/index.js.map +1 -0
- package/_esm/stores/form/types.d.ts +94 -0
- package/_esm/stores/form/types.js +6 -0
- package/_esm/stores/form/types.js.map +1 -0
- package/_esm/stores/form/useFieldActions.d.ts +2 -0
- package/_esm/stores/form/useFieldActions.js +15 -0
- package/_esm/stores/form/useFieldActions.js.map +1 -0
- package/_esm/stores/form/useFieldController.d.ts +11 -0
- package/_esm/stores/form/useFieldController.js +20 -0
- package/_esm/stores/form/useFieldController.js.map +1 -0
- package/_esm/stores/form/useFieldValues.d.ts +2 -0
- package/_esm/stores/form/useFieldValues.js +7 -0
- package/_esm/stores/form/useFieldValues.js.map +1 -0
- package/_esm/stores/form/useTouchedFields.d.ts +1 -0
- package/_esm/stores/form/useTouchedFields.js +7 -0
- package/_esm/stores/form/useTouchedFields.js.map +1 -0
- package/_esm/stores/form/useValidation.d.ts +2 -0
- package/_esm/stores/form/useValidation.js +11 -0
- package/_esm/stores/form/useValidation.js.map +1 -0
- package/_esm/stores/form/useValidationActions.d.ts +2 -0
- package/_esm/stores/form/useValidationActions.js +15 -0
- package/_esm/stores/form/useValidationActions.js.map +1 -0
- package/_esm/stores/index.d.ts +1 -0
- package/_esm/stores/index.js +1 -0
- package/_esm/stores/index.js.map +1 -1
- package/_esm/utils/converters.js +12 -6
- package/_esm/utils/converters.js.map +1 -1
- package/_esm/utils/fees.d.ts +9 -0
- package/_esm/{components/RouteCard/utils.js → utils/fees.js} +13 -7
- package/_esm/utils/fees.js.map +1 -0
- package/_esm/utils/index.d.ts +1 -0
- package/_esm/utils/index.js +1 -0
- package/_esm/utils/index.js.map +1 -1
- package/components/AmountInput/AmountInput.style.tsx +10 -4
- package/components/AmountInput/AmountInput.tsx +41 -38
- package/components/AmountInput/AmountInputAdornment.style.tsx +8 -2
- package/components/AmountInput/AmountInputEndAdornment.tsx +14 -21
- package/components/AmountInput/AmountInputStartAdornment.tsx +8 -11
- package/components/AmountInput/{FormPriceHelperText.tsx → PriceFormHelperText.tsx} +20 -26
- package/components/Card/CardHeader.tsx +6 -5
- package/components/Card/CardTitle.tsx +3 -4
- package/components/ChainSelect/ChainSelect.tsx +4 -7
- package/components/ChainSelect/useChainSelect.ts +18 -18
- package/components/Header/NavigationTabs.tsx +6 -7
- package/components/Header/WalletHeader.tsx +11 -2
- package/components/Header/WalletMenu.tsx +5 -3
- package/components/Insurance/InsuranceCard.tsx +4 -22
- package/components/NFT/NFT.tsx +14 -14
- package/components/PageContainer.ts +18 -0
- package/components/ReverseTokensButton/ReverseTokensButton.style.tsx +3 -0
- package/components/ReverseTokensButton/ReverseTokensButton.tsx +22 -18
- package/components/RouteCard/RouteCard.style.ts +8 -2
- package/components/RouteCard/RouteCard.tsx +34 -29
- package/components/RouteCard/RouteCardEssentials.tsx +37 -88
- package/components/RouteCard/RouteCardEssentialsExpanded.tsx +127 -0
- package/components/RouteCard/RouteCardSkeleton.tsx +3 -20
- package/components/RouteCard/types.ts +7 -2
- package/components/Routes/Routes.tsx +2 -2
- package/components/Routes/RoutesExpanded.tsx +24 -28
- package/components/SelectChainAndToken.tsx +13 -14
- package/components/SelectTokenButton/SelectTokenButton.style.tsx +2 -3
- package/components/SelectTokenButton/SelectTokenButton.tsx +14 -9
- package/components/SendToWallet/SendToWallet.tsx +58 -38
- package/components/SendToWallet/SendToWalletButton.tsx +8 -5
- package/components/SmallAvatar.tsx +4 -4
- package/components/Step/CircularProgress.style.tsx +3 -4
- package/components/Step/CircularProgress.tsx +5 -5
- package/components/Step/DestinationWalletAddress.tsx +2 -3
- package/components/Step/Step.tsx +0 -2
- package/components/Step/StepProcess.tsx +2 -3
- package/components/Step/StepTimer.tsx +9 -14
- package/components/StepActions/StepActions.style.tsx +31 -20
- package/components/StepActions/StepActions.tsx +52 -43
- package/components/StepActions/StepFeeBreakdown.tsx +107 -0
- package/components/StepActions/StepFees.tsx +44 -0
- package/components/Token/Token.style.tsx +6 -22
- package/components/Token/Token.tsx +136 -66
- package/components/TokenAvatar/TokenAvatar.style.tsx +26 -15
- package/components/TokenAvatar/TokenAvatar.tsx +25 -12
- package/components/TokenList/TokenList.style.tsx +7 -5
- package/components/TokenList/TokenList.tsx +3 -6
- package/components/TokenList/TokenListItem.tsx +11 -8
- package/components/TokenList/TokenNotFound.tsx +3 -6
- package/components/TokenList/types.ts +3 -3
- package/components/TokenList/useTokenSelect.ts +21 -19
- package/config/theme.ts +2 -9
- package/config/version.ts +1 -1
- package/hooks/useDebouncedWatch.ts +7 -8
- package/hooks/useFromTokenSufficiency.ts +6 -6
- package/hooks/useGasRefuel.ts +7 -10
- package/hooks/useRequiredToAddress.ts +3 -5
- package/hooks/useRoutes.ts +14 -17
- package/i18n/en.json +8 -5
- package/index.ts +2 -2
- package/package.json +13 -14
- package/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +3 -3
- package/pages/LanguagesPage/LanguagesPage.tsx +4 -3
- package/pages/MainPage/MainPage.tsx +12 -12
- package/pages/MainPage/ReviewButton.tsx +6 -3
- package/pages/RoutesPage/RoutesPage.tsx +1 -1
- package/pages/SelectChainPage/SelectChainPage.tsx +4 -3
- package/pages/SelectChainPage/types.ts +1 -1
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.tsx +3 -3
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx +5 -4
- package/pages/SelectTokenPage/SearchTokenInput.tsx +11 -7
- package/pages/SelectTokenPage/SelectTokenPage.tsx +5 -4
- package/pages/SelectWalletPage/SelectWalletPage.tsx +3 -3
- package/pages/SettingsPage/ResetSettingsButton.tsx +1 -1
- package/pages/SettingsPage/SettingsCard/SettingCard.style.tsx +1 -1
- package/pages/SettingsPage/SettingsPage.tsx +7 -7
- package/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +3 -3
- package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.tsx +15 -58
- package/pages/TransactionHistoryPage/TransactionHistoryItem.tsx +6 -4
- package/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +8 -7
- package/pages/TransactionHistoryPage/TransactionHistorySkeleton.tsx +7 -47
- package/pages/TransactionPage/StatusBottomSheet.tsx +18 -15
- package/pages/TransactionPage/TransactionPage.tsx +13 -10
- package/providers/WalletProvider/SDKProviders.tsx +2 -2
- package/providers/index.ts +0 -1
- package/stores/StoreProvider.tsx +18 -15
- package/stores/chains/ChainOrderStore.tsx +9 -10
- package/stores/form/FormStore.tsx +59 -0
- package/stores/form/FormUpdater.tsx +67 -0
- package/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.tsx +11 -14
- package/stores/form/createFormStore.ts +230 -0
- package/stores/form/index.ts +10 -0
- package/stores/form/types.ts +123 -0
- package/stores/form/useFieldActions.ts +28 -0
- package/stores/form/useFieldController.ts +31 -0
- package/stores/form/useFieldValues.ts +12 -0
- package/stores/form/useTouchedFields.ts +8 -0
- package/stores/form/useValidation.ts +15 -0
- package/stores/form/useValidationActions.ts +24 -0
- package/stores/index.ts +1 -0
- package/utils/converters.ts +12 -6
- package/{components/RouteCard/utils.ts → utils/fees.ts} +43 -37
- package/utils/index.ts +1 -0
- package/_cjs/components/AmountInput/FormPriceHelperText.d.ts +0 -9
- package/_cjs/components/AmountInput/FormPriceHelperText.js +0 -38
- package/_cjs/components/AmountInput/FormPriceHelperText.js.map +0 -1
- package/_cjs/components/RouteCard/utils.d.ts +0 -11
- package/_cjs/components/RouteCard/utils.js.map +0 -1
- package/_cjs/components/Step/GasStepProcess.js +0 -25
- package/_cjs/components/Step/GasStepProcess.js.map +0 -1
- package/_cjs/pages/TransactionDetailsPage/TransactionDetailsPage.style.d.ts +0 -4
- package/_cjs/pages/TransactionDetailsPage/TransactionDetailsPage.style.js +0 -9
- package/_cjs/pages/TransactionDetailsPage/TransactionDetailsPage.style.js.map +0 -1
- package/_cjs/pages/TransactionPage/TransactionPage.style.d.ts +0 -4
- package/_cjs/pages/TransactionPage/TransactionPage.style.js +0 -9
- package/_cjs/pages/TransactionPage/TransactionPage.style.js.map +0 -1
- package/_cjs/providers/FormProvider/FormProvider.d.ts +0 -12
- package/_cjs/providers/FormProvider/FormProvider.js +0 -40
- package/_cjs/providers/FormProvider/FormProvider.js.map +0 -1
- package/_cjs/providers/FormProvider/FormUpdater.d.ts +0 -5
- package/_cjs/providers/FormProvider/FormUpdater.js +0 -72
- package/_cjs/providers/FormProvider/FormUpdater.js.map +0 -1
- package/_cjs/providers/FormProvider/URLSearchParamsBuilder.js.map +0 -1
- package/_cjs/providers/FormProvider/index.d.ts +0 -3
- package/_cjs/providers/FormProvider/index.js.map +0 -1
- package/_cjs/providers/FormProvider/types.d.ts +0 -37
- package/_cjs/providers/FormProvider/types.js +0 -24
- package/_cjs/providers/FormProvider/types.js.map +0 -1
- package/_esm/components/AmountInput/FormPriceHelperText.d.ts +0 -9
- package/_esm/components/AmountInput/FormPriceHelperText.js +0 -33
- package/_esm/components/AmountInput/FormPriceHelperText.js.map +0 -1
- package/_esm/components/RouteCard/utils.d.ts +0 -11
- package/_esm/components/RouteCard/utils.js.map +0 -1
- package/_esm/components/Step/GasStepProcess.js +0 -21
- package/_esm/components/Step/GasStepProcess.js.map +0 -1
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.style.d.ts +0 -4
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.style.js +0 -6
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.style.js.map +0 -1
- package/_esm/pages/TransactionPage/TransactionPage.style.d.ts +0 -4
- package/_esm/pages/TransactionPage/TransactionPage.style.js +0 -6
- package/_esm/pages/TransactionPage/TransactionPage.style.js.map +0 -1
- package/_esm/providers/FormProvider/FormProvider.d.ts +0 -12
- package/_esm/providers/FormProvider/FormProvider.js +0 -36
- package/_esm/providers/FormProvider/FormProvider.js.map +0 -1
- package/_esm/providers/FormProvider/FormUpdater.d.ts +0 -5
- package/_esm/providers/FormProvider/FormUpdater.js +0 -68
- package/_esm/providers/FormProvider/FormUpdater.js.map +0 -1
- package/_esm/providers/FormProvider/URLSearchParamsBuilder.js.map +0 -1
- package/_esm/providers/FormProvider/index.d.ts +0 -3
- package/_esm/providers/FormProvider/index.js +0 -4
- package/_esm/providers/FormProvider/index.js.map +0 -1
- package/_esm/providers/FormProvider/types.d.ts +0 -37
- package/_esm/providers/FormProvider/types.js +0 -21
- package/_esm/providers/FormProvider/types.js.map +0 -1
- package/components/Step/GasStepProcess.tsx +0 -45
- package/pages/TransactionDetailsPage/TransactionDetailsPage.style.tsx +0 -6
- package/pages/TransactionPage/TransactionPage.style.tsx +0 -6
- package/providers/FormProvider/FormProvider.tsx +0 -55
- package/providers/FormProvider/FormUpdater.tsx +0 -86
- package/providers/FormProvider/index.ts +0 -3
- package/providers/FormProvider/types.ts +0 -44
- /package/_cjs/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.d.ts +0 -0
- /package/_esm/{providers/FormProvider → stores/form}/URLSearchParamsBuilder.d.ts +0 -0
|
@@ -13,14 +13,14 @@ export function CircularProgress({ process }: { process: Process }) {
|
|
|
13
13
|
return (
|
|
14
14
|
<CircularIcon status={process.status} substatus={process.substatus}>
|
|
15
15
|
{process.status === 'STARTED' || process.status === 'PENDING' ? (
|
|
16
|
-
<CircularProgressPending size={
|
|
16
|
+
<CircularProgressPending size={40} />
|
|
17
17
|
) : null}
|
|
18
18
|
{process.status === 'ACTION_REQUIRED' ? (
|
|
19
19
|
<InfoRoundedIcon
|
|
20
20
|
color="info"
|
|
21
21
|
sx={{
|
|
22
22
|
position: 'absolute',
|
|
23
|
-
fontSize: '
|
|
23
|
+
fontSize: '1.5rem',
|
|
24
24
|
}}
|
|
25
25
|
/>
|
|
26
26
|
) : null}
|
|
@@ -29,7 +29,7 @@ export function CircularProgress({ process }: { process: Process }) {
|
|
|
29
29
|
<WarningRoundedIcon
|
|
30
30
|
sx={(theme) => ({
|
|
31
31
|
position: 'absolute',
|
|
32
|
-
fontSize: '
|
|
32
|
+
fontSize: '1.5rem',
|
|
33
33
|
color: darken(theme.palette.warning.main, 0.32),
|
|
34
34
|
})}
|
|
35
35
|
/>
|
|
@@ -38,7 +38,7 @@ export function CircularProgress({ process }: { process: Process }) {
|
|
|
38
38
|
color="success"
|
|
39
39
|
sx={{
|
|
40
40
|
position: 'absolute',
|
|
41
|
-
fontSize: '
|
|
41
|
+
fontSize: '1.5rem',
|
|
42
42
|
}}
|
|
43
43
|
/>
|
|
44
44
|
) : null}
|
|
@@ -47,7 +47,7 @@ export function CircularProgress({ process }: { process: Process }) {
|
|
|
47
47
|
color="error"
|
|
48
48
|
sx={{
|
|
49
49
|
position: 'absolute',
|
|
50
|
-
fontSize: '
|
|
50
|
+
fontSize: '1.5rem',
|
|
51
51
|
}}
|
|
52
52
|
/>
|
|
53
53
|
) : null}
|
|
@@ -26,7 +26,7 @@ export const DestinationWalletAddress: React.FC<{
|
|
|
26
26
|
color={isDone ? 'success' : 'inherit'}
|
|
27
27
|
sx={{
|
|
28
28
|
position: 'absolute',
|
|
29
|
-
fontSize: '
|
|
29
|
+
fontSize: '1.25rem',
|
|
30
30
|
}}
|
|
31
31
|
/>
|
|
32
32
|
</CircularIcon>
|
|
@@ -40,8 +40,7 @@ export const DestinationWalletAddress: React.FC<{
|
|
|
40
40
|
})}
|
|
41
41
|
</Typography>
|
|
42
42
|
<LinkButton
|
|
43
|
-
size="
|
|
44
|
-
edge="end"
|
|
43
|
+
size="medium"
|
|
45
44
|
LinkComponent={Link}
|
|
46
45
|
href={toAddressLink}
|
|
47
46
|
target="_blank"
|
package/components/Step/Step.tsx
CHANGED
|
@@ -9,7 +9,6 @@ import { useAvailableChains } from '../../hooks';
|
|
|
9
9
|
import { useWidgetConfig } from '../../providers';
|
|
10
10
|
import { shortenAddress } from '../../utils';
|
|
11
11
|
import { DestinationWalletAddress } from './DestinationWalletAddress';
|
|
12
|
-
import { GasStepProcess } from './GasStepProcess';
|
|
13
12
|
import { StepProcess } from './StepProcess';
|
|
14
13
|
import { StepTimer } from './StepTimer';
|
|
15
14
|
|
|
@@ -81,7 +80,6 @@ export const Step: React.FC<{
|
|
|
81
80
|
{step.execution?.process.map((process, index) => (
|
|
82
81
|
<StepProcess key={index} step={step} process={process} />
|
|
83
82
|
))}
|
|
84
|
-
<GasStepProcess step={step} />
|
|
85
83
|
{formattedToAddress && toAddressLink ? (
|
|
86
84
|
<DestinationWalletAddress
|
|
87
85
|
step={step}
|
|
@@ -29,8 +29,7 @@ export const StepProcess: React.FC<{
|
|
|
29
29
|
</Typography>
|
|
30
30
|
{process.txLink ? (
|
|
31
31
|
<LinkButton
|
|
32
|
-
size="
|
|
33
|
-
edge="end"
|
|
32
|
+
size="medium"
|
|
34
33
|
LinkComponent={Link}
|
|
35
34
|
href={process.txLink}
|
|
36
35
|
target="_blank"
|
|
@@ -42,7 +41,7 @@ export const StepProcess: React.FC<{
|
|
|
42
41
|
</Box>
|
|
43
42
|
{message ? (
|
|
44
43
|
<Typography
|
|
45
|
-
ml={
|
|
44
|
+
ml={7}
|
|
46
45
|
fontSize={14}
|
|
47
46
|
fontWeight={500}
|
|
48
47
|
color="text.secondary"
|
|
@@ -13,7 +13,7 @@ export const StepTimer: React.FC<{
|
|
|
13
13
|
step: LiFiStepExtended;
|
|
14
14
|
hideInProgress?: boolean;
|
|
15
15
|
}> = ({ step, hideInProgress }) => {
|
|
16
|
-
const { t } = useTranslation();
|
|
16
|
+
const { t, i18n } = useTranslation();
|
|
17
17
|
const [isExpired, setExpired] = useState(false);
|
|
18
18
|
const [isExecutionStarted, setExecutionStarted] = useState(!!step.execution);
|
|
19
19
|
const [expiryTimestamp] = useState(() => getExpiryTimestamp(step));
|
|
@@ -52,13 +52,11 @@ export const StepTimer: React.FC<{
|
|
|
52
52
|
]);
|
|
53
53
|
|
|
54
54
|
if (!isExecutionStarted) {
|
|
55
|
-
return (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</>
|
|
61
|
-
);
|
|
55
|
+
return new Intl.NumberFormat(i18n.language, {
|
|
56
|
+
style: 'unit',
|
|
57
|
+
unit: 'minute',
|
|
58
|
+
unitDisplay: 'narrow',
|
|
59
|
+
}).format(Math.ceil(step.estimate.executionDuration / 60));
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
const isTimerExpired = isExpired || (!minutes && !seconds);
|
|
@@ -71,10 +69,7 @@ export const StepTimer: React.FC<{
|
|
|
71
69
|
return null;
|
|
72
70
|
}
|
|
73
71
|
|
|
74
|
-
return isTimerExpired
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
78
|
-
<>{`${minutes}:${seconds < 10 ? `0${seconds}` : seconds}`}</>
|
|
79
|
-
);
|
|
72
|
+
return isTimerExpired
|
|
73
|
+
? t('main.inProgress')
|
|
74
|
+
: `${minutes}:${seconds < 10 ? `0${seconds}` : seconds}`;
|
|
80
75
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Avatar,
|
|
3
|
+
Box,
|
|
3
4
|
StepConnector as MuiStepConnector,
|
|
4
|
-
StepContent as MuiStepContent,
|
|
5
5
|
StepLabel as MuiStepLabel,
|
|
6
|
+
Typography,
|
|
6
7
|
} from '@mui/material';
|
|
7
8
|
import { stepConnectorClasses } from '@mui/material/StepConnector';
|
|
8
|
-
import { stepContentClasses } from '@mui/material/StepContent';
|
|
9
9
|
import { stepLabelClasses } from '@mui/material/StepLabel';
|
|
10
10
|
import { styled } from '@mui/material/styles';
|
|
11
11
|
|
|
@@ -27,7 +27,7 @@ export const StepConnector = styled(MuiStepConnector, {
|
|
|
27
27
|
shouldForwardProp: (prop) =>
|
|
28
28
|
!['active', 'completed', 'error'].includes(prop as string),
|
|
29
29
|
})(({ theme }) => ({
|
|
30
|
-
marginLeft: theme.spacing(
|
|
30
|
+
marginLeft: theme.spacing(2.375),
|
|
31
31
|
[`.${stepConnectorClasses.line}`]: {
|
|
32
32
|
minHeight: 8,
|
|
33
33
|
borderLeftWidth: 2,
|
|
@@ -43,30 +43,41 @@ export const StepLabel = styled(MuiStepLabel, {
|
|
|
43
43
|
!['active', 'completed', 'error', 'disabled'].includes(prop as string),
|
|
44
44
|
})(({ theme }) => ({
|
|
45
45
|
padding: 0,
|
|
46
|
+
alignItems: 'flex-start',
|
|
46
47
|
[`.${stepLabelClasses.iconContainer}`]: {
|
|
47
|
-
paddingLeft: theme.spacing(
|
|
48
|
-
paddingRight: theme.spacing(
|
|
48
|
+
paddingLeft: theme.spacing(1),
|
|
49
|
+
paddingRight: theme.spacing(3),
|
|
50
|
+
},
|
|
51
|
+
[`.${stepLabelClasses.labelContainer}`]: {
|
|
52
|
+
minHeight: 24,
|
|
53
|
+
display: 'flex',
|
|
54
|
+
alignItems: 'center',
|
|
49
55
|
},
|
|
50
56
|
[`&.${stepLabelClasses.disabled}`]: {
|
|
51
57
|
cursor: 'inherit',
|
|
52
58
|
},
|
|
53
59
|
}));
|
|
54
60
|
|
|
55
|
-
export const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
export const StepLabelTypography = styled(Typography)(({ theme }) => ({
|
|
62
|
+
fontSize: 12,
|
|
63
|
+
fontWeight: 500,
|
|
64
|
+
lineHeight: 1.325,
|
|
65
|
+
color: theme.palette.text.secondary,
|
|
66
|
+
padding: theme.spacing(0.5, 0),
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
export const StepContent = styled(Box, {
|
|
70
|
+
shouldForwardProp: (prop) => !['last'].includes(prop as string),
|
|
71
|
+
})<{ last: boolean }>(({ theme, last }) => ({
|
|
72
|
+
borderLeft: last
|
|
73
|
+
? 'none'
|
|
74
|
+
: `2px solid ${
|
|
75
|
+
theme.palette.mode === 'light'
|
|
76
|
+
? theme.palette.grey[300]
|
|
77
|
+
: theme.palette.grey[800]
|
|
78
|
+
}`,
|
|
79
|
+
margin: theme.spacing(0, 0, 0, 2.375),
|
|
80
|
+
paddingLeft: last ? theme.spacing(4.625) : theme.spacing(4.375),
|
|
70
81
|
}));
|
|
71
82
|
|
|
72
83
|
export const StepAvatar = styled(Avatar)(({ theme, variant }) => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LiFiStep,
|
|
1
|
+
import type { LiFiStep, StepExtended } from '@lifi/sdk';
|
|
2
2
|
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
|
|
3
3
|
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
|
|
4
4
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
@@ -27,7 +27,10 @@ import {
|
|
|
27
27
|
StepConnector,
|
|
28
28
|
StepContent,
|
|
29
29
|
StepLabel,
|
|
30
|
+
StepLabelTypography,
|
|
30
31
|
} from './StepActions.style';
|
|
32
|
+
import { StepFeeBreakdown } from './StepFeeBreakdown';
|
|
33
|
+
import { StepFees } from './StepFees';
|
|
31
34
|
import type { StepActionsProps, StepDetailsLabelProps } from './types';
|
|
32
35
|
|
|
33
36
|
export const StepActions: React.FC<StepActionsProps> = ({
|
|
@@ -44,8 +47,6 @@ export const StepActions: React.FC<StepActionsProps> = ({
|
|
|
44
47
|
setCardExpanded((expanded) => !expanded);
|
|
45
48
|
};
|
|
46
49
|
|
|
47
|
-
const hasCollapsedSteps = dense && step.includedSteps?.length > 1;
|
|
48
|
-
|
|
49
50
|
// FIXME: step transaction request overrides step tool details, but not included step tool details
|
|
50
51
|
const toolDetails =
|
|
51
52
|
subvariant === 'nft'
|
|
@@ -70,20 +71,31 @@ export const StepActions: React.FC<StepActionsProps> = ({
|
|
|
70
71
|
{toolDetails.name[0]}
|
|
71
72
|
</StepAvatar>
|
|
72
73
|
</Badge>
|
|
73
|
-
<
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
<Box flex={1}>
|
|
75
|
+
<Typography fontSize={18} fontWeight="500" lineHeight={1.3334} ml={2}>
|
|
76
|
+
{t(`main.stepDetails`, {
|
|
77
|
+
tool: toolDetails.name,
|
|
78
|
+
})}
|
|
79
|
+
</Typography>
|
|
80
|
+
<Collapse
|
|
81
|
+
timeout={225}
|
|
82
|
+
in={dense && !cardExpanded}
|
|
83
|
+
mountOnEnter
|
|
84
|
+
unmountOnExit
|
|
85
|
+
>
|
|
86
|
+
<StepFees ml={2} step={step} />
|
|
87
|
+
</Collapse>
|
|
88
|
+
</Box>
|
|
89
|
+
{dense ? (
|
|
79
90
|
<CardIconButton onClick={handleExpand} size="small">
|
|
80
91
|
{cardExpanded ? <ExpandLessIcon /> : <ExpandMoreIcon />}
|
|
81
92
|
</CardIconButton>
|
|
82
93
|
) : null}
|
|
83
94
|
</Box>
|
|
84
|
-
{
|
|
95
|
+
{dense ? (
|
|
85
96
|
<Collapse timeout={225} in={cardExpanded} mountOnEnter unmountOnExit>
|
|
86
97
|
<IncludedSteps step={step} subvariant={subvariant} />
|
|
98
|
+
<StepFeeBreakdown step={step} />
|
|
87
99
|
</Collapse>
|
|
88
100
|
) : (
|
|
89
101
|
<IncludedSteps step={step} subvariant={subvariant} />
|
|
@@ -99,7 +111,6 @@ export const IncludedSteps: React.FC<{
|
|
|
99
111
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
100
112
|
const StepIconComponent = ({ icon }: StepIconProps) => {
|
|
101
113
|
const tool = step.includedSteps?.[Number(icon) - 1];
|
|
102
|
-
|
|
103
114
|
return tool ? (
|
|
104
115
|
<SmallAvatar
|
|
105
116
|
src={tool.toolDetails.logoURI}
|
|
@@ -112,21 +123,14 @@ export const IncludedSteps: React.FC<{
|
|
|
112
123
|
</SmallAvatar>
|
|
113
124
|
) : null;
|
|
114
125
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
? CustomStepDetailsLabel
|
|
118
|
-
: step.type === 'lifi' &&
|
|
119
|
-
step.includedSteps.some((step) => step.type === 'cross')
|
|
120
|
-
? CrossStepDetailsLabel
|
|
121
|
-
: SwapStepDetailsLabel;
|
|
122
|
-
return step.includedSteps.length > 1 ? (
|
|
123
|
-
<Box mt={1.5}>
|
|
126
|
+
return (
|
|
127
|
+
<Box mt={1}>
|
|
124
128
|
<Stepper
|
|
125
129
|
orientation="vertical"
|
|
126
130
|
connector={<StepConnector />}
|
|
127
131
|
activeStep={-1}
|
|
128
132
|
>
|
|
129
|
-
{step.includedSteps.map((step, i) => (
|
|
133
|
+
{step.includedSteps.map((step, i, includedSteps) => (
|
|
130
134
|
<MuiStep key={step.id} expanded>
|
|
131
135
|
<StepLabel StepIconComponent={StepIconComponent}>
|
|
132
136
|
{step.type === 'custom' && subvariant === 'nft' ? (
|
|
@@ -139,24 +143,13 @@ export const IncludedSteps: React.FC<{
|
|
|
139
143
|
<SwapStepDetailsLabel step={step} />
|
|
140
144
|
)}
|
|
141
145
|
</StepLabel>
|
|
142
|
-
<StepContent>
|
|
146
|
+
<StepContent last={i === includedSteps.length - 1}>
|
|
143
147
|
<StepDetailsContent step={step} subvariant={subvariant} />
|
|
144
148
|
</StepContent>
|
|
145
149
|
</MuiStep>
|
|
146
150
|
))}
|
|
147
151
|
</Stepper>
|
|
148
152
|
</Box>
|
|
149
|
-
) : (
|
|
150
|
-
<Box ml={6}>
|
|
151
|
-
<StepDetailsLabel
|
|
152
|
-
step={step as unknown as Step}
|
|
153
|
-
subvariant={subvariant === 'nft' ? subvariant : undefined}
|
|
154
|
-
/>
|
|
155
|
-
<StepDetailsContent
|
|
156
|
-
step={step as unknown as Step}
|
|
157
|
-
subvariant={subvariant}
|
|
158
|
-
/>
|
|
159
|
-
</Box>
|
|
160
153
|
);
|
|
161
154
|
};
|
|
162
155
|
|
|
@@ -195,18 +188,29 @@ export const StepDetailsContent: React.FC<{
|
|
|
195
188
|
return (
|
|
196
189
|
<Typography
|
|
197
190
|
fontSize={12}
|
|
191
|
+
lineHeight={1}
|
|
198
192
|
fontWeight="500"
|
|
199
193
|
color="text.secondary"
|
|
200
194
|
alignItems="center"
|
|
201
195
|
display="flex"
|
|
202
196
|
>
|
|
197
|
+
{!showToAmount ? (
|
|
198
|
+
<>
|
|
199
|
+
{formatUnits(
|
|
200
|
+
BigInt(step.estimate.fromAmount),
|
|
201
|
+
step.action.fromToken.decimals,
|
|
202
|
+
)}{' '}
|
|
203
|
+
{step.action.fromToken.symbol}
|
|
204
|
+
{' - '}
|
|
205
|
+
</>
|
|
206
|
+
) : null}
|
|
203
207
|
{t('format.number', {
|
|
204
208
|
value: fromAmount,
|
|
205
209
|
})}{' '}
|
|
206
210
|
{step.action.fromToken.symbol}
|
|
207
211
|
{showToAmount ? (
|
|
208
212
|
<>
|
|
209
|
-
<ArrowForwardIcon sx={{ fontSize: 18, paddingX: 0.5 }} />
|
|
213
|
+
<ArrowForwardIcon sx={{ fontSize: 18, paddingX: 0.5, height: 12 }} />
|
|
210
214
|
{t('format.number', {
|
|
211
215
|
value: formatTokenAmount(
|
|
212
216
|
BigInt(step.execution?.toAmount ?? step.estimate.toAmount),
|
|
@@ -215,7 +219,12 @@ export const StepDetailsContent: React.FC<{
|
|
|
215
219
|
})}{' '}
|
|
216
220
|
{step.execution?.toToken?.symbol ?? step.action.toToken.symbol}
|
|
217
221
|
</>
|
|
218
|
-
) :
|
|
222
|
+
) : (
|
|
223
|
+
` (${t('format.currency', {
|
|
224
|
+
value:
|
|
225
|
+
parseFloat(fromAmount) * parseFloat(step.action.fromToken.priceUSD),
|
|
226
|
+
})})`
|
|
227
|
+
)}
|
|
219
228
|
</Typography>
|
|
220
229
|
);
|
|
221
230
|
};
|
|
@@ -240,11 +249,11 @@ export const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps> = ({
|
|
|
240
249
|
: step.toolDetails;
|
|
241
250
|
|
|
242
251
|
return (
|
|
243
|
-
<
|
|
252
|
+
<StepLabelTypography>
|
|
244
253
|
{t(`main.${subvariant}StepDetails`, {
|
|
245
254
|
tool: toolDetails.name,
|
|
246
255
|
})}
|
|
247
|
-
</
|
|
256
|
+
</StepLabelTypography>
|
|
248
257
|
);
|
|
249
258
|
};
|
|
250
259
|
|
|
@@ -254,13 +263,13 @@ export const CrossStepDetailsLabel: React.FC<
|
|
|
254
263
|
const { t } = useTranslation();
|
|
255
264
|
const { getChainById } = useAvailableChains();
|
|
256
265
|
return (
|
|
257
|
-
<
|
|
266
|
+
<StepLabelTypography>
|
|
258
267
|
{t('main.crossStepDetails', {
|
|
259
268
|
from: getChainById(step.action.fromChainId)?.name,
|
|
260
269
|
to: getChainById(step.action.toChainId)?.name,
|
|
261
270
|
tool: step.toolDetails.name,
|
|
262
271
|
})}
|
|
263
|
-
</
|
|
272
|
+
</StepLabelTypography>
|
|
264
273
|
);
|
|
265
274
|
};
|
|
266
275
|
|
|
@@ -270,12 +279,12 @@ export const SwapStepDetailsLabel: React.FC<
|
|
|
270
279
|
const { t } = useTranslation();
|
|
271
280
|
const { getChainById } = useAvailableChains();
|
|
272
281
|
return (
|
|
273
|
-
<
|
|
282
|
+
<StepLabelTypography>
|
|
274
283
|
{t('main.swapStepDetails', {
|
|
275
284
|
chain: getChainById(step.action.fromChainId)?.name,
|
|
276
285
|
tool: step.toolDetails.name,
|
|
277
286
|
})}
|
|
278
|
-
</
|
|
287
|
+
</StepLabelTypography>
|
|
279
288
|
);
|
|
280
289
|
};
|
|
281
290
|
|
|
@@ -284,12 +293,12 @@ export const ProtocolStepDetailsLabel: React.FC<
|
|
|
284
293
|
> = ({ step }) => {
|
|
285
294
|
const { t } = useTranslation();
|
|
286
295
|
return (
|
|
287
|
-
<
|
|
296
|
+
<StepLabelTypography>
|
|
288
297
|
{step.toolDetails.key === 'lifuelProtocol'
|
|
289
298
|
? t('main.refuelStepDetails', {
|
|
290
299
|
tool: step.toolDetails.name,
|
|
291
300
|
})
|
|
292
301
|
: step.toolDetails.name}
|
|
293
|
-
</
|
|
302
|
+
</StepLabelTypography>
|
|
294
303
|
);
|
|
295
304
|
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { LiFiStepExtended } from '@lifi/sdk';
|
|
2
|
+
import MonetizationOnIcon from '@mui/icons-material/MonetizationOn';
|
|
3
|
+
import { Box, Typography } from '@mui/material';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { formatUnits } from 'viem';
|
|
7
|
+
import { getStepFeeCostsBreakdown } from '../../utils';
|
|
8
|
+
|
|
9
|
+
export const StepFeeBreakdown: React.FC<{
|
|
10
|
+
step: LiFiStepExtended;
|
|
11
|
+
}> = ({ step }) => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
|
|
14
|
+
let fees = 0;
|
|
15
|
+
const feeComponents: ReactNode[] = [];
|
|
16
|
+
const isDone = step.execution?.status === 'DONE';
|
|
17
|
+
|
|
18
|
+
const gasCosts = step.execution?.gasCosts ?? step.estimate.gasCosts;
|
|
19
|
+
const feeCosts = step.execution?.feeCosts ?? step.estimate.feeCosts;
|
|
20
|
+
|
|
21
|
+
if (gasCosts) {
|
|
22
|
+
const { token, amount, amountUSD } = getStepFeeCostsBreakdown(gasCosts);
|
|
23
|
+
const formattedGasAmount = token
|
|
24
|
+
? parseFloat(formatUnits(amount, token.decimals))?.toFixed(9)
|
|
25
|
+
: 0;
|
|
26
|
+
fees += amountUSD;
|
|
27
|
+
feeComponents.push(
|
|
28
|
+
<Box mt={0.5} ml={7} key="network">
|
|
29
|
+
<Typography
|
|
30
|
+
fontSize={12}
|
|
31
|
+
lineHeight={2}
|
|
32
|
+
color="text.secondary"
|
|
33
|
+
fontWeight="500"
|
|
34
|
+
>
|
|
35
|
+
{isDone
|
|
36
|
+
? t('main.fees.networkPaid')
|
|
37
|
+
: t('main.fees.networkEstimated')}
|
|
38
|
+
</Typography>
|
|
39
|
+
<Typography
|
|
40
|
+
fontSize={12}
|
|
41
|
+
lineHeight={1}
|
|
42
|
+
fontWeight="500"
|
|
43
|
+
color="text.secondary"
|
|
44
|
+
>
|
|
45
|
+
{t(`format.currency`, { value: amountUSD })} ({formattedGasAmount}{' '}
|
|
46
|
+
{token.symbol})
|
|
47
|
+
</Typography>
|
|
48
|
+
</Box>,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (feeCosts) {
|
|
53
|
+
const filteredfeeCosts = feeCosts?.filter((fee) => !fee.included);
|
|
54
|
+
if (filteredfeeCosts?.length) {
|
|
55
|
+
const { token, amount, amountUSD } =
|
|
56
|
+
getStepFeeCostsBreakdown(filteredfeeCosts);
|
|
57
|
+
const formattedFeeAmount = token
|
|
58
|
+
? parseFloat(formatUnits(amount, token.decimals))?.toFixed(9)
|
|
59
|
+
: 0;
|
|
60
|
+
fees += amountUSD;
|
|
61
|
+
feeComponents.push(
|
|
62
|
+
<Box mt={0.5} ml={7} key="bridge">
|
|
63
|
+
<Typography
|
|
64
|
+
fontSize={12}
|
|
65
|
+
lineHeight={2}
|
|
66
|
+
color="text.secondary"
|
|
67
|
+
fontWeight="500"
|
|
68
|
+
>
|
|
69
|
+
{isDone
|
|
70
|
+
? t('main.fees.providerPaid')
|
|
71
|
+
: t('main.fees.providerEstimated')}
|
|
72
|
+
</Typography>
|
|
73
|
+
<Typography
|
|
74
|
+
fontSize={12}
|
|
75
|
+
lineHeight={1}
|
|
76
|
+
fontWeight="500"
|
|
77
|
+
color="text.secondary"
|
|
78
|
+
>
|
|
79
|
+
{t(`format.currency`, { value: amountUSD })} ({formattedFeeAmount}{' '}
|
|
80
|
+
{token.symbol})
|
|
81
|
+
</Typography>
|
|
82
|
+
</Box>,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Box mt={1.5}>
|
|
89
|
+
<Box display="flex" alignItems="center">
|
|
90
|
+
<Typography ml={1} mr={3} height={24} color="text.secondary">
|
|
91
|
+
<MonetizationOnIcon />
|
|
92
|
+
</Typography>
|
|
93
|
+
<Typography
|
|
94
|
+
fontSize={16}
|
|
95
|
+
color="text.primary"
|
|
96
|
+
fontWeight="600"
|
|
97
|
+
lineHeight={1.125}
|
|
98
|
+
>
|
|
99
|
+
{t(`format.currency`, {
|
|
100
|
+
value: fees,
|
|
101
|
+
})}
|
|
102
|
+
</Typography>
|
|
103
|
+
</Box>
|
|
104
|
+
{feeComponents}
|
|
105
|
+
</Box>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { LiFiStepExtended } from '@lifi/sdk';
|
|
2
|
+
import type { TypographyProps } from '@mui/material';
|
|
3
|
+
import { Typography } from '@mui/material';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { getStepFeeCostsBreakdown } from '../../utils';
|
|
6
|
+
|
|
7
|
+
export const StepFees: React.FC<
|
|
8
|
+
TypographyProps & {
|
|
9
|
+
step: LiFiStepExtended;
|
|
10
|
+
}
|
|
11
|
+
> = ({ step, ...other }) => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
|
|
14
|
+
const isDone = step.execution?.status === 'DONE';
|
|
15
|
+
const gasCosts = step.execution?.gasCosts ?? step.estimate.gasCosts;
|
|
16
|
+
const feeCosts = step.execution?.feeCosts ?? step.estimate.feeCosts;
|
|
17
|
+
let fees = 0;
|
|
18
|
+
|
|
19
|
+
if (gasCosts) {
|
|
20
|
+
const { amountUSD } = getStepFeeCostsBreakdown(gasCosts);
|
|
21
|
+
fees += amountUSD;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (feeCosts) {
|
|
25
|
+
const filteredfeeCosts = feeCosts?.filter((fee) => !fee.included);
|
|
26
|
+
if (filteredfeeCosts?.length) {
|
|
27
|
+
const { amountUSD } = getStepFeeCostsBreakdown(filteredfeeCosts);
|
|
28
|
+
fees += amountUSD;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Typography
|
|
34
|
+
fontSize={12}
|
|
35
|
+
fontWeight="500"
|
|
36
|
+
color="text.secondary"
|
|
37
|
+
lineHeight={1.3334}
|
|
38
|
+
{...other}
|
|
39
|
+
>
|
|
40
|
+
{t(`format.currency`, { value: fees })}{' '}
|
|
41
|
+
{isDone ? t('main.fees.paid') : t('main.fees.estimated')}
|
|
42
|
+
</Typography>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
@@ -1,46 +1,30 @@
|
|
|
1
1
|
import { Box, Typography } from '@mui/material';
|
|
2
2
|
import { alpha, styled } from '@mui/material/styles';
|
|
3
3
|
|
|
4
|
-
export const TextSecondaryContainer = styled(Box
|
|
5
|
-
shouldForwardProp: (prop) => prop !== 'connected',
|
|
6
|
-
})<{ connected?: boolean }>(({ theme, connected }) => ({
|
|
7
|
-
borderLeftWidth: connected ? 2 : 0,
|
|
8
|
-
borderLeftStyle: 'solid',
|
|
9
|
-
borderColor:
|
|
10
|
-
theme.palette.mode === 'light'
|
|
11
|
-
? theme.palette.grey[300]
|
|
12
|
-
: theme.palette.grey[800],
|
|
13
|
-
margin: connected
|
|
14
|
-
? theme.spacing(0.5, 0, 0, 1.875)
|
|
15
|
-
: theme.spacing(0, 0, 0, 6),
|
|
16
|
-
padding: connected
|
|
17
|
-
? theme.spacing(0, 0, 0, 3.875)
|
|
18
|
-
: theme.spacing(0, 0, 0, 0),
|
|
4
|
+
export const TextSecondaryContainer = styled(Box)(() => ({
|
|
19
5
|
display: 'flex',
|
|
20
|
-
alignItems: '
|
|
6
|
+
alignItems: 'center',
|
|
21
7
|
flexWrap: 'wrap',
|
|
8
|
+
flex: 1,
|
|
22
9
|
}));
|
|
23
10
|
|
|
24
11
|
export const TextSecondary = styled(Typography, {
|
|
25
|
-
shouldForwardProp: (prop: string) => !['
|
|
26
|
-
})<{
|
|
12
|
+
shouldForwardProp: (prop: string) => !['dot'].includes(prop),
|
|
13
|
+
})<{ dot?: boolean }>(({ theme, dot }) => ({
|
|
27
14
|
fontSize: 12,
|
|
28
15
|
lineHeight: 1,
|
|
29
16
|
fontWeight: 500,
|
|
30
17
|
color: dot
|
|
31
18
|
? alpha(theme.palette.text.secondary, 0.56)
|
|
32
19
|
: theme.palette.text.secondary,
|
|
33
|
-
marginTop: connected ? 0 : theme.spacing(0.5),
|
|
34
20
|
}));
|
|
35
21
|
|
|
36
22
|
export const TokenDivider = styled(Box)(({ theme }) => ({
|
|
37
|
-
height:
|
|
23
|
+
height: 16,
|
|
38
24
|
borderLeftWidth: 2,
|
|
39
25
|
borderLeftStyle: 'solid',
|
|
40
26
|
borderColor:
|
|
41
27
|
theme.palette.mode === 'light'
|
|
42
28
|
? theme.palette.grey[300]
|
|
43
29
|
: theme.palette.grey[800],
|
|
44
|
-
margin: theme.spacing(0, 0, 0, 3.875),
|
|
45
|
-
padding: theme.spacing(0, 0, 0, 3.875),
|
|
46
30
|
}));
|