@lifi/widget 3.40.8 → 4.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/CHANGELOG.md +0 -50
- package/dist/esm/AppDefault.d.ts +8 -0
- package/dist/esm/AppDefault.js +231 -14
- package/dist/esm/AppDefault.js.map +1 -1
- package/dist/esm/AppLayout.d.ts +1 -0
- package/dist/esm/AppLayout.js +19 -0
- package/dist/esm/AppLayout.js.map +1 -0
- package/dist/esm/AppProvider.js +7 -20
- package/dist/esm/AppProvider.js.map +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js +9 -6
- package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js.map +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.js +2 -2
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.js.map +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +2 -2
- package/dist/esm/components/AmountInput/AmountInput.js +5 -7
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.d.ts +2 -2
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.d.ts +1 -1
- package/dist/esm/components/AppContainer.d.ts +1 -1
- package/dist/esm/components/Avatar/AccountAvatar.d.ts +1 -1
- package/dist/esm/components/Avatar/AccountAvatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.style.d.ts +1 -1
- package/dist/esm/components/Avatar/SmallAvatar.d.ts +1 -1
- package/dist/esm/components/ButtonTertiary.d.ts +1 -1
- package/dist/esm/components/Card/Card.d.ts +1 -1
- package/dist/esm/components/Card/CardButton.style.d.ts +2 -2
- package/dist/esm/components/Card/CardHeader.d.ts +1 -1
- package/dist/esm/components/Card/CardIconButton.d.ts +3 -3
- package/dist/esm/components/Card/CardLabel.d.ts +1 -1
- package/dist/esm/components/Card/CardTitle.d.ts +1 -1
- package/dist/esm/components/Card/InputCard.d.ts +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js +8 -3
- package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.style.d.ts +3 -3
- package/dist/esm/components/Chains/ChainList.style.d.ts +4 -4
- package/dist/esm/components/Chains/VirtualizedChainList.d.ts +1 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js +7 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -1
- package/dist/esm/components/ContractComponent/ItemPrice.d.ts +1 -1
- package/dist/esm/components/ContractComponent/ItemPrice.js +1 -1
- package/dist/esm/components/ContractComponent/ItemPrice.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.js +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.style.d.ts +1 -1
- package/dist/esm/components/Header/BackButton.d.ts +1 -2
- package/dist/esm/components/Header/BackButton.js +16 -2
- package/dist/esm/components/Header/BackButton.js.map +1 -1
- package/dist/esm/components/Header/DisconnectIconButton.d.ts +1 -1
- package/dist/esm/components/Header/DisconnectIconButton.js.map +1 -1
- package/dist/esm/components/Header/Header.js +1 -1
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/Header.style.d.ts +3 -3
- package/dist/esm/components/Header/NavigationHeader.js +7 -13
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.js +3 -3
- package/dist/esm/components/Header/SettingsButton.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.style.d.ts +2 -2
- package/dist/esm/components/Header/TransactionHistoryButton.js +3 -3
- package/dist/esm/components/Header/TransactionHistoryButton.js.map +1 -1
- package/dist/esm/components/Header/WalletHeader.js.map +1 -1
- package/dist/esm/components/ListItem/ListItem.d.ts +1 -1
- package/dist/esm/components/ListItem/ListItemButton.d.ts +1 -1
- package/dist/esm/components/ListItemButton.d.ts +1 -1
- package/dist/esm/components/Messages/GasSufficiencyMessage.js +1 -1
- package/dist/esm/components/Messages/GasSufficiencyMessage.js.map +1 -1
- package/dist/esm/components/PageContainer.d.ts +1 -1
- package/dist/esm/components/PageEntered.js +1 -1
- package/dist/esm/components/PageEntered.js.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js +0 -9
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/dist/esm/components/RouteCard/RouteCard.js +1 -3
- package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
- package/dist/esm/components/Routes/Routes.js +3 -4
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesContent.js +1 -2
- package/dist/esm/components/Routes/RoutesContent.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.js +4 -3
- package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.style.d.ts +1 -1
- package/dist/esm/components/Search/SearchInput.style.d.ts +1 -1
- package/dist/esm/components/Search/SearchNotFound.style.d.ts +2 -2
- package/dist/esm/components/SelectChainAndToken.js +2 -3
- package/dist/esm/components/SelectChainAndToken.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.js +10 -10
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.d.ts +3 -3
- package/dist/esm/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +10 -8
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/SettingsListItemButton.d.ts +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +4 -4
- package/dist/esm/components/Step/CircularProgress.d.ts +3 -3
- package/dist/esm/components/Step/CircularProgress.js +8 -8
- package/dist/esm/components/Step/CircularProgress.js.map +1 -1
- package/dist/esm/components/Step/CircularProgress.style.d.ts +2 -2
- package/dist/esm/components/Step/CircularProgress.style.js.map +1 -1
- package/dist/esm/components/Step/Step.js +8 -11
- package/dist/esm/components/Step/Step.js.map +1 -1
- package/dist/esm/components/Step/StepAction.d.ts +5 -0
- package/dist/esm/components/Step/{StepProcess.js → StepAction.js} +16 -12
- package/dist/esm/components/Step/StepAction.js.map +1 -0
- package/dist/esm/components/StepActions/StepActions.js +3 -2
- package/dist/esm/components/StepActions/StepActions.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.style.d.ts +2 -2
- package/dist/esm/components/StepDivider/StepDivider.style.d.ts +1 -1
- package/dist/esm/components/Tabs/NavigationTabs.d.ts +4 -4
- package/dist/esm/components/Tabs/Tabs.style.d.ts +3 -3
- package/dist/esm/components/Timer/StepTimer.js +26 -74
- package/dist/esm/components/Timer/StepTimer.js.map +1 -1
- package/dist/esm/components/Token/Token.style.d.ts +1 -1
- package/dist/esm/components/TokenList/PinTokenButton.d.ts +6 -0
- package/dist/esm/components/TokenList/PinTokenButton.js +29 -0
- package/dist/esm/components/TokenList/PinTokenButton.js.map +1 -0
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.d.ts +2 -2
- package/dist/esm/components/TokenList/TokenList.js +13 -5
- package/dist/esm/components/TokenList/TokenList.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.d.ts +6 -6
- package/dist/esm/components/TokenList/TokenListItem.js +5 -4
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js +63 -38
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +2 -3
- package/dist/esm/components/TokenList/useTokenSelect.js +2 -3
- package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.d.ts +1 -1
- package/dist/esm/components/TokenRate/TokenRate.js +1 -1
- package/dist/esm/components/TokenRate/TokenRate.js.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.style.d.ts +1 -1
- package/dist/esm/components/TransactionDetails.js +3 -2
- package/dist/esm/components/TransactionDetails.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/useActionMessage.d.ts +5 -0
- package/dist/esm/hooks/useActionMessage.js +18 -0
- package/dist/esm/hooks/useActionMessage.js.map +1 -0
- package/dist/esm/hooks/useAddressActivity.js +18 -9
- package/dist/esm/hooks/useAddressActivity.js.map +1 -1
- package/dist/esm/hooks/useAddressValidation.js +5 -2
- package/dist/esm/hooks/useAddressValidation.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.d.ts +2 -1
- package/dist/esm/hooks/useAvailableChains.js +32 -11
- package/dist/esm/hooks/useAvailableChains.js.map +1 -1
- package/dist/esm/hooks/useExplorer.js +1 -2
- package/dist/esm/hooks/useExplorer.js.map +1 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js +3 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useFromTokenSufficiency.d.ts +1 -1
- package/dist/esm/hooks/useFromTokenSufficiency.js +4 -4
- package/dist/esm/hooks/useFromTokenSufficiency.js.map +1 -1
- package/dist/esm/hooks/useGasRecommendation.js +3 -1
- package/dist/esm/hooks/useGasRecommendation.js.map +1 -1
- package/dist/esm/hooks/useGasSufficiency.js +21 -15
- package/dist/esm/hooks/useGasSufficiency.js.map +1 -1
- package/dist/esm/hooks/useHasChainExpansion.d.ts +1 -1
- package/dist/esm/hooks/useHasChainExpansion.js +11 -3
- package/dist/esm/hooks/useHasChainExpansion.js.map +1 -1
- package/dist/esm/hooks/useInitializeSDKProviders.d.ts +1 -0
- package/dist/esm/hooks/useInitializeSDKProviders.js +11 -0
- package/dist/esm/hooks/useInitializeSDKProviders.js.map +1 -0
- package/dist/esm/hooks/useIsBatchingSupported.js +7 -3
- package/dist/esm/hooks/useIsBatchingSupported.js.map +1 -1
- package/dist/esm/hooks/useIsContractAddress.js +12 -9
- package/dist/esm/hooks/useIsContractAddress.js.map +1 -1
- package/dist/esm/hooks/useNavigateBack.d.ts +1 -4
- package/dist/esm/hooks/useNavigateBack.js +9 -23
- package/dist/esm/hooks/useNavigateBack.js.map +1 -1
- package/dist/esm/hooks/useRouteExecution.js +12 -13
- package/dist/esm/hooks/useRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +23 -60
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressAutoPopulate.js +3 -1
- package/dist/esm/hooks/useToAddressAutoPopulate.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.js +3 -2
- package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
- package/dist/esm/hooks/useTokenBalance.d.ts +3 -3
- package/dist/esm/hooks/useTokenBalance.js +8 -6
- package/dist/esm/hooks/useTokenBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.d.ts +1 -0
- package/dist/esm/hooks/useTokenBalances.js +70 -5
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenBalancesQueries.js +4 -2
- package/dist/esm/hooks/useTokenBalancesQueries.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +3 -1
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +11 -5
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTools.js +3 -1
- package/dist/esm/hooks/useTools.js.map +1 -1
- package/dist/esm/hooks/useTransactionDetails.js +3 -1
- package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
- package/dist/esm/hooks/useTransactionHistory.js +3 -1
- package/dist/esm/hooks/useTransactionHistory.js.map +1 -1
- package/dist/esm/hooks/useWidgetChains.d.ts +6 -0
- package/dist/esm/hooks/useWidgetChains.js +5 -0
- package/dist/esm/hooks/useWidgetChains.js.map +1 -0
- package/dist/esm/i18n/bn.json +4 -1
- package/dist/esm/i18n/de.json +4 -1
- package/dist/esm/i18n/en.json +3 -14
- package/dist/esm/i18n/es.json +4 -1
- package/dist/esm/i18n/fr.json +4 -1
- package/dist/esm/i18n/hi.json +4 -1
- package/dist/esm/i18n/id.json +4 -1
- package/dist/esm/i18n/it.json +4 -1
- package/dist/esm/i18n/ja.json +4 -1
- package/dist/esm/i18n/ko.json +4 -1
- package/dist/esm/i18n/pl.json +4 -1
- package/dist/esm/i18n/pt.json +4 -1
- package/dist/esm/i18n/th.json +4 -1
- package/dist/esm/i18n/tr.json +4 -1
- package/dist/esm/i18n/uk.json +4 -1
- package/dist/esm/i18n/vi.json +4 -1
- package/dist/esm/i18n/zh.json +4 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pages/LanguagesPage.js +7 -6
- package/dist/esm/pages/LanguagesPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainPage.js +1 -3
- package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
- package/dist/esm/pages/MainPage/ReviewButton.js +5 -5
- package/dist/esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.d.ts +1 -2
- package/dist/esm/pages/RoutesPage/RoutesPage.js +5 -4
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +2 -13
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js +3 -5
- package/dist/esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +1 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConnectedWalletsPage.js +4 -3
- package/dist/esm/pages/SendToWallet/ConnectedWalletsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/RecentWalletsPage.js +4 -7
- package/dist/esm/pages/SendToWallet/RecentWalletsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js +1 -1
- package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.d.ts +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js +5 -5
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +8 -8
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +4 -2
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/LanguageSetting.js +2 -2
- package/dist/esm/pages/SettingsPage/LanguageSetting.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +12 -2
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +10 -4
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js +2 -2
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsPage.js +5 -1
- package/dist/esm/pages/SettingsPage/SettingsPage.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +3 -3
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +3 -3
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +9 -9
- package/dist/esm/pages/SettingsPage/SmallBalanceFilterSettings.d.ts +1 -0
- package/dist/esm/pages/SettingsPage/SmallBalanceFilterSettings.js +58 -0
- package/dist/esm/pages/SettingsPage/SmallBalanceFilterSettings.js.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +7 -8
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryItem.js +4 -3
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryItem.js.map +1 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +1 -2
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +13 -12
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionPage.d.ts +1 -1
- package/dist/esm/pages/TransactionPage/TransactionPage.js +13 -6
- package/dist/esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +1 -0
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/SDKClientProvider.d.ts +4 -0
- package/dist/esm/providers/SDKClientProvider.js +29 -0
- package/dist/esm/providers/SDKClientProvider.js.map +1 -0
- package/dist/esm/providers/WalletProvider/WalletProvider.d.ts +7 -2
- package/dist/esm/providers/WalletProvider/WalletProvider.js +27 -11
- package/dist/esm/providers/WalletProvider/WalletProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js +15 -18
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js.map +1 -1
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js +0 -27
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js.map +1 -1
- package/dist/esm/stores/StoreProvider.js +2 -1
- package/dist/esm/stores/StoreProvider.js.map +1 -1
- package/dist/esm/stores/bookmarks/types.d.ts +2 -3
- package/dist/esm/stores/chains/ChainOrderStore.js +17 -12
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/createChainOrderStore.d.ts +0 -8
- package/dist/esm/stores/chains/createChainOrderStore.js +1 -5
- package/dist/esm/stores/chains/createChainOrderStore.js.map +1 -1
- package/dist/esm/stores/form/FormStore.js +18 -8
- package/dist/esm/stores/form/FormStore.js.map +1 -1
- package/dist/esm/stores/form/FormUpdater.js +5 -50
- package/dist/esm/stores/form/FormUpdater.js.map +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js +11 -31
- package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.d.ts +7 -0
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js +32 -0
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js.map +1 -0
- package/dist/esm/stores/form/types.d.ts +2 -3
- package/dist/esm/stores/form/types.js.map +1 -1
- package/dist/esm/stores/header/types.d.ts +5 -3
- package/dist/esm/stores/header/useHeaderStore.js +14 -0
- package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.d.ts +4 -0
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js +20 -0
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js.map +1 -0
- package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.d.ts +19 -0
- package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.js +61 -0
- package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.js.map +1 -0
- package/dist/esm/stores/pinnedTokens/types.d.ts +17 -0
- package/dist/esm/stores/pinnedTokens/types.js +2 -0
- package/dist/esm/stores/pinnedTokens/types.js.map +1 -0
- package/dist/esm/stores/routes/RouteExecutionStore.d.ts +2 -3
- package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js +2 -5
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/useExecutingRoutesIds.js +2 -2
- package/dist/esm/stores/routes/useExecutingRoutesIds.js.map +1 -1
- package/dist/esm/stores/routes/utils.d.ts +2 -2
- package/dist/esm/stores/routes/utils.js +15 -15
- package/dist/esm/stores/routes/utils.js.map +1 -1
- package/dist/esm/stores/settings/SettingsStore.d.ts +2 -3
- package/dist/esm/stores/settings/SettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/createSettingsStore.d.ts +2 -0
- package/dist/esm/stores/settings/createSettingsStore.js +2 -1
- package/dist/esm/stores/settings/createSettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/types.d.ts +3 -3
- package/dist/esm/stores/settings/types.js.map +1 -1
- package/dist/esm/types/events.d.ts +2 -10
- package/dist/esm/types/events.js +0 -1
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/types/token.d.ts +1 -0
- package/dist/esm/types/widget.d.ts +9 -16
- package/dist/esm/types/widget.js +1 -0
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/chainType.d.ts +1 -2
- package/dist/esm/utils/chainType.js +1 -19
- package/dist/esm/utils/chainType.js.map +1 -1
- package/dist/esm/utils/converters.js +11 -18
- package/dist/esm/utils/converters.js.map +1 -1
- package/dist/esm/utils/format.d.ts +1 -0
- package/dist/esm/utils/format.js +2 -1
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/getActionMessage.d.ts +7 -0
- package/dist/esm/utils/getActionMessage.js +111 -0
- package/dist/esm/utils/getActionMessage.js.map +1 -0
- package/dist/esm/utils/getErrorMessage.d.ts +6 -0
- package/dist/esm/utils/getErrorMessage.js +118 -0
- package/dist/esm/utils/getErrorMessage.js.map +1 -0
- package/dist/esm/utils/prepareActions.d.ts +2 -0
- package/dist/esm/utils/prepareActions.js +24 -0
- package/dist/esm/utils/prepareActions.js.map +1 -0
- package/dist/esm/utils/tokenList.d.ts +3 -2
- package/dist/esm/utils/tokenList.js +104 -8
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/package.json +15 -23
- package/package.json.tmp +16 -28
- package/src/AppDefault.tsx +279 -31
- package/src/AppLayout.tsx +36 -0
- package/src/AppProvider.tsx +12 -40
- package/src/components/ActiveTransactions/ActiveTransactionItem.tsx +9 -6
- package/src/components/ActiveTransactions/ActiveTransactions.tsx +2 -2
- package/src/components/AmountInput/AmountInput.tsx +6 -8
- package/src/components/AmountInput/AmountInputEndAdornment.tsx +1 -1
- package/src/components/Avatar/AccountAvatar.tsx +1 -1
- package/src/components/ChainSelect/ChainSelect.tsx +8 -4
- package/src/components/Chains/VirtualizedChainList.tsx +7 -3
- package/src/components/ContractComponent/ItemPrice.tsx +1 -2
- package/src/components/ContractComponent/NFT/NFT.tsx +1 -1
- package/src/components/Header/BackButton.tsx +15 -3
- package/src/components/Header/DisconnectIconButton.tsx +2 -1
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/NavigationHeader.tsx +23 -46
- package/src/components/Header/SettingsButton.tsx +3 -3
- package/src/components/Header/TransactionHistoryButton.tsx +3 -3
- package/src/components/Header/WalletHeader.tsx +1 -1
- package/src/components/Messages/GasSufficiencyMessage.tsx +1 -1
- package/src/components/PageEntered.ts +1 -1
- package/src/components/ReverseTokensButton/ReverseTokensButton.tsx +0 -10
- package/src/components/RouteCard/RouteCard.tsx +1 -3
- package/src/components/Routes/Routes.tsx +3 -4
- package/src/components/Routes/RoutesContent.tsx +1 -2
- package/src/components/Routes/RoutesExpanded.tsx +4 -3
- package/src/components/SelectChainAndToken.tsx +2 -4
- package/src/components/SelectTokenButton/SelectTokenButton.tsx +11 -13
- package/src/components/SendToWallet/SendToWalletButton.tsx +9 -12
- package/src/components/Step/CircularProgress.style.tsx +3 -3
- package/src/components/Step/CircularProgress.tsx +11 -11
- package/src/components/Step/Step.tsx +13 -14
- package/src/components/Step/{StepProcess.tsx → StepAction.tsx} +20 -15
- package/src/components/StepActions/StepActions.tsx +3 -2
- package/src/components/Timer/StepTimer.tsx +43 -105
- package/src/components/TokenList/PinTokenButton.tsx +50 -0
- package/src/components/TokenList/TokenList.tsx +67 -59
- package/src/components/TokenList/TokenListItem.tsx +20 -11
- package/src/components/TokenList/VirtualizedTokenList.tsx +80 -53
- package/src/components/TokenList/types.ts +2 -3
- package/src/components/TokenList/useTokenSelect.ts +2 -8
- package/src/components/TokenRate/TokenRate.tsx +1 -2
- package/src/components/TransactionDetails.tsx +3 -2
- package/src/config/version.ts +1 -1
- package/src/hooks/useActionMessage.ts +33 -0
- package/src/hooks/useAddressActivity.ts +19 -11
- package/src/hooks/useAddressValidation.ts +9 -2
- package/src/hooks/useAvailableChains.ts +42 -14
- package/src/hooks/useExplorer.ts +1 -2
- package/src/hooks/useFilteredByTokenBalances.ts +3 -1
- package/src/hooks/useFromTokenSufficiency.ts +8 -5
- package/src/hooks/useGasRecommendation.ts +3 -0
- package/src/hooks/useGasSufficiency.ts +23 -13
- package/src/hooks/useHasChainExpansion.ts +13 -3
- package/src/hooks/useInitializeSDKProviders.ts +12 -0
- package/src/hooks/useIsBatchingSupported.ts +11 -5
- package/src/hooks/useIsContractAddress.ts +14 -10
- package/src/hooks/useNavigateBack.ts +11 -29
- package/src/hooks/useRouteExecution.ts +12 -16
- package/src/hooks/useRoutes.ts +26 -74
- package/src/hooks/useToAddressAutoPopulate.ts +3 -1
- package/src/hooks/useToAddressRequirements.ts +3 -2
- package/src/hooks/useTokenBalance.ts +18 -3
- package/src/hooks/useTokenBalances.ts +91 -5
- package/src/hooks/useTokenBalancesQueries.ts +4 -2
- package/src/hooks/useTokenSearch.ts +10 -3
- package/src/hooks/useTokens.ts +11 -6
- package/src/hooks/useTools.ts +3 -1
- package/src/hooks/useTransactionDetails.ts +3 -0
- package/src/hooks/useTransactionHistory.ts +3 -0
- package/src/hooks/useWidgetChains.ts +6 -0
- package/src/i18n/bn.json +4 -1
- package/src/i18n/de.json +4 -1
- package/src/i18n/en.json +3 -14
- package/src/i18n/es.json +4 -1
- package/src/i18n/fr.json +4 -1
- package/src/i18n/hi.json +4 -1
- package/src/i18n/id.json +4 -1
- package/src/i18n/it.json +4 -1
- package/src/i18n/ja.json +4 -1
- package/src/i18n/ko.json +4 -1
- package/src/i18n/pl.json +4 -1
- package/src/i18n/pt.json +4 -1
- package/src/i18n/th.json +4 -1
- package/src/i18n/tr.json +4 -1
- package/src/i18n/uk.json +4 -1
- package/src/i18n/vi.json +4 -1
- package/src/i18n/zh.json +4 -1
- package/src/index.ts +2 -8
- package/src/pages/LanguagesPage.tsx +2 -1
- package/src/pages/MainPage/MainPage.tsx +1 -3
- package/src/pages/MainPage/ReviewButton.tsx +5 -5
- package/src/pages/RoutesPage/RoutesPage.tsx +6 -6
- package/src/pages/SelectChainPage/SelectChainPage.tsx +1 -1
- package/src/pages/SelectTokenPage/SelectTokenPage.tsx +4 -28
- package/src/pages/SendToWallet/BookmarksPage.tsx +3 -5
- package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +1 -1
- package/src/pages/SendToWallet/ConnectedWalletsPage.tsx +5 -4
- package/src/pages/SendToWallet/RecentWalletsPage.tsx +4 -7
- package/src/pages/SendToWallet/SendToConfiguredWalletPage.tsx +1 -1
- package/src/pages/SendToWallet/SendToWalletPage.tsx +6 -6
- package/src/pages/SettingsPage/BridgeAndExchangeSettings.tsx +4 -2
- package/src/pages/SettingsPage/LanguageSetting.tsx +2 -2
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +63 -33
- package/src/pages/SettingsPage/SettingsCard/SettingsAccordian.tsx +3 -2
- package/src/pages/SettingsPage/SettingsPage.tsx +7 -0
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +10 -10
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +5 -5
- package/src/pages/SettingsPage/SmallBalanceFilterSettings.tsx +116 -0
- package/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +7 -8
- package/src/pages/TransactionHistoryPage/TransactionHistoryItem.tsx +4 -3
- package/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +1 -2
- package/src/pages/TransactionPage/StatusBottomSheet.tsx +15 -14
- package/src/pages/TransactionPage/TransactionPage.tsx +14 -7
- package/src/providers/I18nProvider/I18nProvider.tsx +1 -0
- package/src/providers/SDKClientProvider.tsx +41 -0
- package/src/providers/WalletProvider/WalletProvider.tsx +61 -20
- package/src/providers/WalletProvider/useExternalWalletProvider.ts +20 -18
- package/src/providers/WidgetProvider/WidgetProvider.tsx +0 -29
- package/src/stores/StoreProvider.tsx +10 -7
- package/src/stores/bookmarks/types.ts +2 -3
- package/src/stores/chains/ChainOrderStore.tsx +29 -16
- package/src/stores/chains/createChainOrderStore.ts +1 -5
- package/src/stores/form/FormStore.tsx +19 -18
- package/src/stores/form/FormUpdater.tsx +5 -73
- package/src/stores/form/URLSearchParamsBuilder.tsx +12 -39
- package/src/stores/form/getDefaultValuesFromQueryString.ts +48 -0
- package/src/stores/form/types.ts +2 -5
- package/src/stores/header/types.ts +5 -3
- package/src/stores/header/useHeaderStore.tsx +14 -0
- package/src/stores/pinnedTokens/PinnedTokensStore.tsx +38 -0
- package/src/stores/pinnedTokens/createPinnedTokensStore.ts +71 -0
- package/src/stores/pinnedTokens/types.ts +20 -0
- package/src/stores/routes/RouteExecutionStore.tsx +2 -5
- package/src/stores/routes/createRouteExecutionStore.ts +4 -5
- package/src/stores/routes/useExecutingRoutesIds.ts +2 -2
- package/src/stores/routes/utils.ts +21 -19
- package/src/stores/settings/SettingsStore.tsx +2 -3
- package/src/stores/settings/createSettingsStore.ts +2 -1
- package/src/stores/settings/types.ts +3 -5
- package/src/types/events.ts +2 -11
- package/src/types/token.ts +1 -0
- package/src/types/widget.ts +18 -26
- package/src/utils/chainType.ts +1 -24
- package/src/utils/converters.ts +14 -20
- package/src/utils/format.ts +3 -1
- package/src/utils/getActionMessage.ts +168 -0
- package/src/utils/getErrorMessage.ts +144 -0
- package/src/utils/prepareActions.ts +27 -0
- package/src/utils/tokenList.ts +117 -11
- package/dist/esm/AppRoutes.d.ts +0 -1
- package/dist/esm/AppRoutes.js +0 -111
- package/dist/esm/AppRoutes.js.map +0 -1
- package/dist/esm/components/Step/StepProcess.d.ts +0 -5
- package/dist/esm/components/Step/StepProcess.js.map +0 -1
- package/dist/esm/config/baseAccount.d.ts +0 -2
- package/dist/esm/config/baseAccount.js +0 -6
- package/dist/esm/config/baseAccount.js.map +0 -1
- package/dist/esm/config/coinbase.d.ts +0 -2
- package/dist/esm/config/coinbase.js +0 -6
- package/dist/esm/config/coinbase.js.map +0 -1
- package/dist/esm/config/metaMask.d.ts +0 -2
- package/dist/esm/config/metaMask.js +0 -11
- package/dist/esm/config/metaMask.js.map +0 -1
- package/dist/esm/config/walletConnect.d.ts +0 -2
- package/dist/esm/config/walletConnect.js +0 -4
- package/dist/esm/config/walletConnect.js.map +0 -1
- package/dist/esm/hooks/useExpansionRoutes.d.ts +0 -2
- package/dist/esm/hooks/useExpansionRoutes.js +0 -26
- package/dist/esm/hooks/useExpansionRoutes.js.map +0 -1
- package/dist/esm/hooks/useInternalWalletProvider.d.ts +0 -1
- package/dist/esm/hooks/useInternalWalletProvider.js +0 -6
- package/dist/esm/hooks/useInternalWalletProvider.js.map +0 -1
- package/dist/esm/hooks/useProcessMessage.d.ts +0 -11
- package/dist/esm/hooks/useProcessMessage.js +0 -199
- package/dist/esm/hooks/useProcessMessage.js.map +0 -1
- package/dist/esm/providers/WalletProvider/EVMBaseProvider.d.ts +0 -2
- package/dist/esm/providers/WalletProvider/EVMBaseProvider.js +0 -31
- package/dist/esm/providers/WalletProvider/EVMBaseProvider.js.map +0 -1
- package/dist/esm/providers/WalletProvider/EVMExternalContext.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/EVMExternalContext.js +0 -3
- package/dist/esm/providers/WalletProvider/EVMExternalContext.js.map +0 -1
- package/dist/esm/providers/WalletProvider/EVMProvider.d.ts +0 -2
- package/dist/esm/providers/WalletProvider/EVMProvider.js +0 -20
- package/dist/esm/providers/WalletProvider/EVMProvider.js.map +0 -1
- package/dist/esm/providers/WalletProvider/SDKProviders.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/SDKProviders.js +0 -62
- package/dist/esm/providers/WalletProvider/SDKProviders.js.map +0 -1
- package/dist/esm/providers/WalletProvider/SVMBaseProvider.d.ts +0 -2
- package/dist/esm/providers/WalletProvider/SVMBaseProvider.js +0 -27
- package/dist/esm/providers/WalletProvider/SVMBaseProvider.js.map +0 -1
- package/dist/esm/providers/WalletProvider/SVMExternalContext.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/SVMExternalContext.js +0 -3
- package/dist/esm/providers/WalletProvider/SVMExternalContext.js.map +0 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.d.ts +0 -2
- package/dist/esm/providers/WalletProvider/SVMProvider.js +0 -20
- package/dist/esm/providers/WalletProvider/SVMProvider.js.map +0 -1
- package/dist/esm/providers/WalletProvider/SuiBaseProvider.d.ts +0 -2
- package/dist/esm/providers/WalletProvider/SuiBaseProvider.js +0 -17
- package/dist/esm/providers/WalletProvider/SuiBaseProvider.js.map +0 -1
- package/dist/esm/providers/WalletProvider/SuiExternalContext.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/SuiExternalContext.js +0 -3
- package/dist/esm/providers/WalletProvider/SuiExternalContext.js.map +0 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.d.ts +0 -2
- package/dist/esm/providers/WalletProvider/SuiProvider.js +0 -20
- package/dist/esm/providers/WalletProvider/SuiProvider.js.map +0 -1
- package/dist/esm/providers/WalletProvider/UTXOBaseProvider.d.ts +0 -2
- package/dist/esm/providers/WalletProvider/UTXOBaseProvider.js +0 -18
- package/dist/esm/providers/WalletProvider/UTXOBaseProvider.js.map +0 -1
- package/dist/esm/providers/WalletProvider/UTXOExternalContext.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/UTXOExternalContext.js +0 -3
- package/dist/esm/providers/WalletProvider/UTXOExternalContext.js.map +0 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.d.ts +0 -2
- package/dist/esm/providers/WalletProvider/UTXOProvider.js +0 -20
- package/dist/esm/providers/WalletProvider/UTXOProvider.js.map +0 -1
- package/src/AppRoutes.tsx +0 -112
- package/src/config/baseAccount.ts +0 -7
- package/src/config/coinbase.ts +0 -7
- package/src/config/metaMask.ts +0 -13
- package/src/config/walletConnect.ts +0 -5
- package/src/hooks/useExpansionRoutes.ts +0 -29
- package/src/hooks/useInternalWalletProvider.ts +0 -6
- package/src/hooks/useProcessMessage.ts +0 -273
- package/src/providers/WalletProvider/EVMBaseProvider.tsx +0 -41
- package/src/providers/WalletProvider/EVMExternalContext.ts +0 -3
- package/src/providers/WalletProvider/EVMProvider.tsx +0 -28
- package/src/providers/WalletProvider/SDKProviders.tsx +0 -86
- package/src/providers/WalletProvider/SVMBaseProvider.tsx +0 -37
- package/src/providers/WalletProvider/SVMExternalContext.ts +0 -3
- package/src/providers/WalletProvider/SVMProvider.tsx +0 -29
- package/src/providers/WalletProvider/SuiBaseProvider.tsx +0 -31
- package/src/providers/WalletProvider/SuiExternalContext.ts +0 -3
- package/src/providers/WalletProvider/SuiProvider.tsx +0 -28
- package/src/providers/WalletProvider/UTXOBaseProvider.tsx +0 -29
- package/src/providers/WalletProvider/UTXOExternalContext.ts +0 -3
- package/src/providers/WalletProvider/UTXOProvider.tsx +0 -28
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { EVMChain } from '@lifi/sdk'
|
|
2
2
|
import { Skeleton, type Theme, Tooltip, useMediaQuery } from '@mui/material'
|
|
3
|
+
import { useNavigate } from '@tanstack/react-router'
|
|
3
4
|
import { memo, useCallback, useEffect, useMemo } from 'react'
|
|
4
5
|
import { useTranslation } from 'react-i18next'
|
|
5
|
-
import { useNavigate } from 'react-router-dom'
|
|
6
6
|
import { useChainOrderStore } from '../../stores/chains/ChainOrderStore.js'
|
|
7
7
|
import {
|
|
8
8
|
maxChainsToOrder,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from '../../stores/chains/createChainOrderStore.js'
|
|
12
12
|
import type { FormTypeProps } from '../../stores/form/types.js'
|
|
13
13
|
import { FormKeyHelper } from '../../stores/form/types.js'
|
|
14
|
+
import { useFieldActions } from '../../stores/form/useFieldActions.js'
|
|
14
15
|
import { useFieldValues } from '../../stores/form/useFieldValues.js'
|
|
15
16
|
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
16
17
|
import { AllChainsAvatar } from '../Chains/AllChainsAvatar.js'
|
|
@@ -29,7 +30,7 @@ export const ChainSelect = memo(({ formType }: FormTypeProps) => {
|
|
|
29
30
|
const isMobile = useMediaQuery((theme: Theme) =>
|
|
30
31
|
theme.breakpoints.down(theme.breakpoints.values.xs)
|
|
31
32
|
)
|
|
32
|
-
|
|
33
|
+
const { setFieldValue } = useFieldActions()
|
|
33
34
|
const {
|
|
34
35
|
chainOrder,
|
|
35
36
|
chains,
|
|
@@ -68,12 +69,15 @@ export const ChainSelect = memo(({ formType }: FormTypeProps) => {
|
|
|
68
69
|
)
|
|
69
70
|
|
|
70
71
|
const showAllChains = useCallback(() => {
|
|
71
|
-
navigate(navigationRoutes[`${formType}Chain`])
|
|
72
|
+
navigate({ to: navigationRoutes[`${formType}Chain`] })
|
|
72
73
|
}, [navigate, formType])
|
|
73
74
|
|
|
74
75
|
const selectAllNetworks = useCallback(() => {
|
|
75
76
|
setIsAllNetworks(true, formType)
|
|
76
|
-
|
|
77
|
+
// Reset the chain and token fields when selecting all networks
|
|
78
|
+
setFieldValue(FormKeyHelper.getChainKey(formType), '', { isTouched: true })
|
|
79
|
+
setFieldValue(FormKeyHelper.getTokenKey(formType), '', { isTouched: true })
|
|
80
|
+
}, [setIsAllNetworks, formType, setFieldValue])
|
|
77
81
|
|
|
78
82
|
const chainsToHide =
|
|
79
83
|
chains?.length === maxChainsToShow
|
|
@@ -4,7 +4,8 @@ import type { RefObject } from 'react'
|
|
|
4
4
|
import { useCallback, useEffect, useMemo, useRef } from 'react'
|
|
5
5
|
import { useTranslation } from 'react-i18next'
|
|
6
6
|
import { useChainOrderStore } from '../../stores/chains/ChainOrderStore.js'
|
|
7
|
-
import type
|
|
7
|
+
import { FormKeyHelper, type FormType } from '../../stores/form/types.js'
|
|
8
|
+
import { useFieldActions } from '../../stores/form/useFieldActions.js'
|
|
8
9
|
import { AllChainsAvatar } from './AllChainsAvatar.js'
|
|
9
10
|
import {
|
|
10
11
|
List,
|
|
@@ -52,7 +53,7 @@ export const VirtualizedChainList = ({
|
|
|
52
53
|
state.setIsAllNetworks,
|
|
53
54
|
state[`${formType}ShowAllNetworks`],
|
|
54
55
|
])
|
|
55
|
-
|
|
56
|
+
const { setFieldValue } = useFieldActions()
|
|
56
57
|
const onPin = useCallback(
|
|
57
58
|
(chainId: number) => {
|
|
58
59
|
setPinnedChain(chainId)
|
|
@@ -161,7 +162,10 @@ export const VirtualizedChainList = ({
|
|
|
161
162
|
|
|
162
163
|
const selectAllNetworks = useCallback(() => {
|
|
163
164
|
setIsAllNetworks(true, formType)
|
|
164
|
-
|
|
165
|
+
// Reset the chain and token fields when selecting all networks
|
|
166
|
+
setFieldValue(FormKeyHelper.getChainKey(formType), '', { isTouched: true })
|
|
167
|
+
setFieldValue(FormKeyHelper.getTokenKey(formType), '', { isTouched: true })
|
|
168
|
+
}, [setIsAllNetworks, formType, setFieldValue])
|
|
165
169
|
|
|
166
170
|
return (
|
|
167
171
|
<List
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ContractCall, formatUnits } from '@lifi/sdk'
|
|
2
2
|
import { useEffect } from 'react'
|
|
3
|
-
import { formatUnits } from 'viem'
|
|
4
3
|
import { useFieldActions } from '../../stores/form/useFieldActions.js'
|
|
5
4
|
import type { TokenAmount } from '../../types/token.js'
|
|
6
5
|
import { Token } from '../Token/Token.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { formatUnits } from '@lifi/sdk'
|
|
1
2
|
import { useEffect } from 'react'
|
|
2
|
-
import { formatUnits } from 'viem'
|
|
3
3
|
import { useFieldActions } from '../../../stores/form/useFieldActions.js'
|
|
4
4
|
import { NFTBase } from './NFTBase.js'
|
|
5
5
|
import type { NFTProps } from './types.js'
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import ArrowBack from '@mui/icons-material/ArrowBack'
|
|
2
|
-
import type { IconButtonProps } from '@mui/material'
|
|
3
2
|
import { IconButton, useTheme } from '@mui/material'
|
|
3
|
+
import { useNavigateBack } from '../../hooks/useNavigateBack.js'
|
|
4
|
+
import { useHeaderStore } from '../../stores/header/useHeaderStore.js'
|
|
4
5
|
|
|
5
|
-
export const BackButton: React.FC
|
|
6
|
+
export const BackButton: React.FC = () => {
|
|
6
7
|
const theme = useTheme()
|
|
8
|
+
const navigateBack = useNavigateBack()
|
|
9
|
+
const [backAction, executeBackAction] = useHeaderStore((state) => [
|
|
10
|
+
state.backAction,
|
|
11
|
+
state.executeBackAction,
|
|
12
|
+
])
|
|
7
13
|
|
|
8
14
|
return (
|
|
9
15
|
<IconButton
|
|
10
16
|
size="medium"
|
|
11
17
|
edge={theme?.navigation?.edge ? 'start' : false}
|
|
12
|
-
onClick={
|
|
18
|
+
onClick={() => {
|
|
19
|
+
if (backAction) {
|
|
20
|
+
executeBackAction()
|
|
21
|
+
} else {
|
|
22
|
+
navigateBack()
|
|
23
|
+
}
|
|
24
|
+
}}
|
|
13
25
|
>
|
|
14
26
|
<ArrowBack />
|
|
15
27
|
</IconButton>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useAccountDisconnect } from '@lifi/wallet-management'
|
|
2
|
+
import type { Account } from '@lifi/widget-provider'
|
|
2
3
|
import PowerSettingsNewRounded from '@mui/icons-material/PowerSettingsNewRounded'
|
|
3
4
|
import { IconButton } from '@mui/material'
|
|
4
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useLocation } from '@tanstack/react-router'
|
|
1
2
|
import type { FC, PropsWithChildren } from 'react'
|
|
2
3
|
import { useLayoutEffect, useRef } from 'react'
|
|
3
|
-
import { useLocation } from 'react-router-dom'
|
|
4
4
|
import { useDefaultElementId } from '../../hooks/useDefaultElementId.js'
|
|
5
5
|
import { useSetHeaderHeight } from '../../stores/header/useHeaderStore.js'
|
|
6
6
|
import { createElementId, ElementId } from '../../utils/elements.js'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useAccount } from '@lifi/wallet-management'
|
|
2
2
|
import { Box, Typography } from '@mui/material'
|
|
3
|
-
import {
|
|
4
|
-
import { useNavigateBack } from '../../hooks/useNavigateBack.js'
|
|
3
|
+
import { useLocation } from '@tanstack/react-router'
|
|
5
4
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
|
|
6
5
|
import { useHeaderStore } from '../../stores/header/useHeaderStore.js'
|
|
7
6
|
import { HiddenUI } from '../../types/widget.js'
|
|
@@ -20,14 +19,12 @@ import { TransactionHistoryButton } from './TransactionHistoryButton.js'
|
|
|
20
19
|
export const NavigationHeader: React.FC = () => {
|
|
21
20
|
const { subvariant, hiddenUI, variant, defaultUI, subvariantOptions } =
|
|
22
21
|
useWidgetConfig()
|
|
23
|
-
const { navigateBack } = useNavigateBack()
|
|
24
22
|
const { account } = useAccount()
|
|
25
23
|
const [element, title] = useHeaderStore((state) => [
|
|
26
24
|
state.element,
|
|
27
25
|
state.title,
|
|
28
26
|
])
|
|
29
27
|
const { pathname } = useLocation()
|
|
30
|
-
|
|
31
28
|
const cleanedPathname = pathname.endsWith('/')
|
|
32
29
|
? pathname.slice(0, -1)
|
|
33
30
|
: pathname
|
|
@@ -43,18 +40,7 @@ export const NavigationHeader: React.FC = () => {
|
|
|
43
40
|
|
|
44
41
|
return (
|
|
45
42
|
<HeaderAppBar elevation={0} sx={{ paddingTop: 1, paddingBottom: 0.5 }}>
|
|
46
|
-
{backButtonRoutes.includes(path) ?
|
|
47
|
-
<BackButton
|
|
48
|
-
onClick={() =>
|
|
49
|
-
navigateBack(
|
|
50
|
-
// From transaction details page, navigate to home page
|
|
51
|
-
path === navigationRoutes.transactionDetails
|
|
52
|
-
? navigationRoutes.home
|
|
53
|
-
: undefined
|
|
54
|
-
)
|
|
55
|
-
}
|
|
56
|
-
/>
|
|
57
|
-
) : null}
|
|
43
|
+
{backButtonRoutes.includes(path) ? <BackButton /> : null}
|
|
58
44
|
{showSplitOptions ? (
|
|
59
45
|
<Box sx={{ flex: 1, marginRight: 1 }}>
|
|
60
46
|
<SplitNavigationTabs />
|
|
@@ -72,36 +58,27 @@ export const NavigationHeader: React.FC = () => {
|
|
|
72
58
|
{title}
|
|
73
59
|
</Typography>
|
|
74
60
|
)}
|
|
75
|
-
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
sx={{
|
|
97
|
-
width: 28,
|
|
98
|
-
height: 40,
|
|
99
|
-
}}
|
|
100
|
-
/>
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
/>
|
|
104
|
-
</Routes>
|
|
61
|
+
{pathname === navigationRoutes.home ? (
|
|
62
|
+
<HeaderControlsContainer>
|
|
63
|
+
{account.isConnected && !hiddenUI?.includes(HiddenUI.History) && (
|
|
64
|
+
<TransactionHistoryButton />
|
|
65
|
+
)}
|
|
66
|
+
<SettingsButton />
|
|
67
|
+
{variant === 'drawer' &&
|
|
68
|
+
!hiddenUI?.includes(HiddenUI.DrawerCloseButton) ? (
|
|
69
|
+
<CloseDrawerButton header="navigation" />
|
|
70
|
+
) : null}
|
|
71
|
+
</HeaderControlsContainer>
|
|
72
|
+
) : (
|
|
73
|
+
element || (
|
|
74
|
+
<Box
|
|
75
|
+
sx={{
|
|
76
|
+
width: 28,
|
|
77
|
+
height: 40,
|
|
78
|
+
}}
|
|
79
|
+
/>
|
|
80
|
+
)
|
|
81
|
+
)}
|
|
105
82
|
</HeaderAppBar>
|
|
106
83
|
)
|
|
107
84
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Settings from '@mui/icons-material/Settings'
|
|
2
2
|
import { Tooltip } from '@mui/material'
|
|
3
|
+
import { useNavigate } from '@tanstack/react-router'
|
|
3
4
|
import { useTranslation } from 'react-i18next'
|
|
4
|
-
import { useNavigateBack } from '../../hooks/useNavigateBack.js'
|
|
5
5
|
import { useSettingMonitor } from '../../hooks/useSettingMonitor.js'
|
|
6
6
|
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
7
7
|
import {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
|
|
12
12
|
export const SettingsButton = () => {
|
|
13
13
|
const { t } = useTranslation()
|
|
14
|
-
const
|
|
14
|
+
const navigate = useNavigate()
|
|
15
15
|
|
|
16
16
|
const { isCustomRouteSettings, isRouteSettingsWithWarnings } =
|
|
17
17
|
useSettingMonitor()
|
|
@@ -30,7 +30,7 @@ export const SettingsButton = () => {
|
|
|
30
30
|
<Tooltip title={tooltipMessage}>
|
|
31
31
|
<SettingsIconButton
|
|
32
32
|
size="medium"
|
|
33
|
-
onClick={() => navigate(navigationRoutes.settings)}
|
|
33
|
+
onClick={() => navigate({ to: navigationRoutes.settings })}
|
|
34
34
|
variant={variant}
|
|
35
35
|
>
|
|
36
36
|
{variant ? (
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import ReceiptLong from '@mui/icons-material/ReceiptLong'
|
|
2
2
|
import { IconButton, Tooltip } from '@mui/material'
|
|
3
|
+
import { useNavigate } from '@tanstack/react-router'
|
|
3
4
|
import { useTranslation } from 'react-i18next'
|
|
4
|
-
import { useNavigateBack } from '../../hooks/useNavigateBack.js'
|
|
5
5
|
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
6
6
|
|
|
7
7
|
export const TransactionHistoryButton = () => {
|
|
8
8
|
const { t } = useTranslation()
|
|
9
|
-
const
|
|
9
|
+
const navigate = useNavigate()
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
12
|
<Tooltip title={t('header.transactionHistory')}>
|
|
13
13
|
<IconButton
|
|
14
14
|
size="medium"
|
|
15
|
-
onClick={() => navigate(navigationRoutes.transactionHistory)}
|
|
15
|
+
onClick={() => navigate({ to: navigationRoutes.transactionHistory })}
|
|
16
16
|
>
|
|
17
17
|
<ReceiptLong />
|
|
18
18
|
</IconButton>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Account } from '@lifi/wallet-management'
|
|
2
1
|
import {
|
|
3
2
|
getConnectorIcon,
|
|
4
3
|
useAccount,
|
|
5
4
|
useWalletMenu,
|
|
6
5
|
} from '@lifi/wallet-management'
|
|
6
|
+
import type { Account } from '@lifi/widget-provider'
|
|
7
7
|
import ExpandMore from '@mui/icons-material/ExpandMore'
|
|
8
8
|
import Wallet from '@mui/icons-material/Wallet'
|
|
9
9
|
import { Avatar, Badge } from '@mui/material'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { formatUnits } from '@lifi/sdk'
|
|
1
2
|
import EvStation from '@mui/icons-material/EvStation'
|
|
2
3
|
import { type BoxProps, Typography } from '@mui/material'
|
|
3
4
|
import { useTranslation } from 'react-i18next'
|
|
4
|
-
import { formatUnits } from 'viem'
|
|
5
5
|
import type { GasSufficiency } from '../../hooks/useGasSufficiency.js'
|
|
6
6
|
import { AlertMessage } from './AlertMessage.js'
|
|
7
7
|
|
|
@@ -3,9 +3,7 @@ import ArrowForward from '@mui/icons-material/ArrowForward'
|
|
|
3
3
|
import { useAvailableChains } from '../../hooks/useAvailableChains.js'
|
|
4
4
|
import { useToAddressAutoPopulate } from '../../hooks/useToAddressAutoPopulate.js'
|
|
5
5
|
import { useToAddressReset } from '../../hooks/useToAddressReset.js'
|
|
6
|
-
import { useWidgetEvents } from '../../hooks/useWidgetEvents.js'
|
|
7
6
|
import { useFieldActions } from '../../stores/form/useFieldActions.js'
|
|
8
|
-
import { WidgetEvent } from '../../types/events.js'
|
|
9
7
|
import { IconCard, ReverseContainer } from './ReverseTokensButton.style.js'
|
|
10
8
|
|
|
11
9
|
export const ReverseTokensButton: React.FC<{ vertical?: boolean }> = ({
|
|
@@ -15,7 +13,6 @@ export const ReverseTokensButton: React.FC<{ vertical?: boolean }> = ({
|
|
|
15
13
|
const { getChainById } = useAvailableChains()
|
|
16
14
|
const { tryResetToAddress } = useToAddressReset()
|
|
17
15
|
const autoPopulateToAddress = useToAddressAutoPopulate()
|
|
18
|
-
const emitter = useWidgetEvents()
|
|
19
16
|
|
|
20
17
|
const handleClick = () => {
|
|
21
18
|
const [fromChainId, fromToken, toChainId, toToken, toAddress] =
|
|
@@ -32,13 +29,6 @@ export const ReverseTokensButton: React.FC<{ vertical?: boolean }> = ({
|
|
|
32
29
|
setFieldValue('toChain', fromChainId, { isTouched: true })
|
|
33
30
|
setFieldValue('toToken', fromToken, { isTouched: true })
|
|
34
31
|
|
|
35
|
-
emitter.emit(WidgetEvent.TokensReversed, {
|
|
36
|
-
fromChainId,
|
|
37
|
-
fromTokenAddress: fromToken,
|
|
38
|
-
toChainId,
|
|
39
|
-
toTokenAddress: toToken,
|
|
40
|
-
})
|
|
41
|
-
|
|
42
32
|
const autoPopulatedToAddress = autoPopulateToAddress({
|
|
43
33
|
formType: 'from',
|
|
44
34
|
selectedToAddress: toAddress,
|
|
@@ -40,9 +40,7 @@ export const RouteCard: React.FC<
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const token: TokenAmount =
|
|
43
|
-
subvariant === 'custom' &&
|
|
44
|
-
subvariantOptions?.custom !== 'deposit' &&
|
|
45
|
-
subvariantOptions?.custom !== 'fund'
|
|
43
|
+
subvariant === 'custom' && subvariantOptions?.custom !== 'deposit'
|
|
46
44
|
? { ...route.fromToken, amount: BigInt(route.fromAmount) }
|
|
47
45
|
: { ...route.toToken, amount: BigInt(route.toAmount) }
|
|
48
46
|
const impactToken: TokenAmount | undefined =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, Collapse } from '@mui/material'
|
|
2
|
+
import { useNavigate } from '@tanstack/react-router'
|
|
2
3
|
import { useTranslation } from 'react-i18next'
|
|
3
|
-
import { useNavigate } from 'react-router-dom'
|
|
4
4
|
import { useRoutes } from '../../hooks/useRoutes.js'
|
|
5
5
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
|
|
6
6
|
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
@@ -35,7 +35,7 @@ export const Routes: React.FC<CardProps> = (props) => {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const handleCardClick = () => {
|
|
38
|
-
navigate(navigationRoutes.routes)
|
|
38
|
+
navigate({ to: navigationRoutes.routes })
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
const routeNotFound = !currentRoute && !isLoading && !isFetching
|
|
@@ -45,8 +45,7 @@ export const Routes: React.FC<CardProps> = (props) => {
|
|
|
45
45
|
|
|
46
46
|
const title =
|
|
47
47
|
subvariant === 'custom'
|
|
48
|
-
? subvariantOptions?.custom === 'deposit'
|
|
49
|
-
subvariantOptions?.custom === 'fund'
|
|
48
|
+
? subvariantOptions?.custom === 'deposit'
|
|
50
49
|
? t('header.receive')
|
|
51
50
|
: t('header.youPay')
|
|
52
51
|
: t('header.receive')
|
|
@@ -51,8 +51,7 @@ export const RoutesContent = memo(function RoutesContent({
|
|
|
51
51
|
|
|
52
52
|
const title =
|
|
53
53
|
subvariant === 'custom'
|
|
54
|
-
? subvariantOptions?.custom === 'deposit'
|
|
55
|
-
subvariantOptions?.custom === 'fund'
|
|
54
|
+
? subvariantOptions?.custom === 'deposit'
|
|
56
55
|
? t('header.deposit')
|
|
57
56
|
: t('header.youPay')
|
|
58
57
|
: t('header.receive')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Route } from '@lifi/sdk'
|
|
2
|
+
import { useNavigate } from '@tanstack/react-router'
|
|
2
3
|
import { memo, useCallback, useEffect, useLayoutEffect, useRef } from 'react'
|
|
3
|
-
import { useNavigate } from 'react-router-dom'
|
|
4
4
|
import { useRoutes } from '../../hooks/useRoutes.js'
|
|
5
5
|
import { useWidgetEvents } from '../../hooks/useWidgetEvents.js'
|
|
6
6
|
import { WidgetEvent } from '../../types/events.js'
|
|
@@ -60,8 +60,9 @@ export const RoutesExpanded = memo(function RoutesExpanded({
|
|
|
60
60
|
const onRouteClick = useCallback(
|
|
61
61
|
(route: Route) => {
|
|
62
62
|
setReviewableRoute(route)
|
|
63
|
-
navigate(
|
|
64
|
-
|
|
63
|
+
navigate({
|
|
64
|
+
to: navigationRoutes.transactionExecution,
|
|
65
|
+
search: { routeId: route.id },
|
|
65
66
|
})
|
|
66
67
|
emitter.emit(WidgetEvent.RouteSelected, { route, routes: routes! })
|
|
67
68
|
},
|
|
@@ -11,8 +11,7 @@ export const SelectChainAndToken: React.FC<BoxProps> = (props) => {
|
|
|
11
11
|
const prefersNarrowView = useMediaQuery((theme: Theme) =>
|
|
12
12
|
theme.breakpoints.down('sm')
|
|
13
13
|
)
|
|
14
|
-
const { disabledUI, hiddenUI, subvariant
|
|
15
|
-
useWidgetConfig()
|
|
14
|
+
const { disabledUI, hiddenUI, subvariant } = useWidgetConfig()
|
|
16
15
|
|
|
17
16
|
const [fromChain, toChain, fromToken, toToken] = useFieldValues(
|
|
18
17
|
'fromChain',
|
|
@@ -31,8 +30,7 @@ export const SelectChainAndToken: React.FC<BoxProps> = (props) => {
|
|
|
31
30
|
|
|
32
31
|
const hiddenFromToken = hiddenUI?.includes(HiddenUI.FromToken)
|
|
33
32
|
const hiddenToToken =
|
|
34
|
-
|
|
35
|
-
hiddenUI?.includes(HiddenUI.ToToken)
|
|
33
|
+
subvariant === 'custom' || hiddenUI?.includes(HiddenUI.ToToken)
|
|
36
34
|
|
|
37
35
|
const isCompact =
|
|
38
36
|
!!fromChain &&
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Skeleton } from '@mui/material'
|
|
2
|
+
import { useNavigate } from '@tanstack/react-router'
|
|
2
3
|
import { useTranslation } from 'react-i18next'
|
|
3
|
-
import { useNavigate } from 'react-router-dom'
|
|
4
4
|
import { useChain } from '../../hooks/useChain.js'
|
|
5
5
|
import { useSwapOnly } from '../../hooks/useSwapOnly.js'
|
|
6
6
|
import { useToken } from '../../hooks/useToken.js'
|
|
@@ -29,8 +29,7 @@ export const SelectTokenButton: React.FC<
|
|
|
29
29
|
> = ({ formType, compact, hiddenReverse }) => {
|
|
30
30
|
const { t } = useTranslation()
|
|
31
31
|
const navigate = useNavigate()
|
|
32
|
-
const { disabledUI, subvariant, hiddenUI
|
|
33
|
-
useWidgetConfig()
|
|
32
|
+
const { disabledUI, subvariant, hiddenUI } = useWidgetConfig()
|
|
34
33
|
const swapOnly = useSwapOnly()
|
|
35
34
|
const tokenKey = FormKeyHelper.getTokenKey(formType)
|
|
36
35
|
const [chainId, tokenAddress] = useFieldValues(
|
|
@@ -45,13 +44,14 @@ export const SelectTokenButton: React.FC<
|
|
|
45
44
|
)
|
|
46
45
|
|
|
47
46
|
const handleClick = () => {
|
|
48
|
-
navigate(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
navigate({
|
|
48
|
+
to:
|
|
49
|
+
formType === 'from'
|
|
50
|
+
? navigationRoutes.fromToken
|
|
51
|
+
: subvariant === 'refuel'
|
|
52
|
+
? navigationRoutes.toTokenNative
|
|
53
|
+
: navigationRoutes.toToken,
|
|
54
|
+
})
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const isSelected = !!(chain && token)
|
|
@@ -64,9 +64,7 @@ export const SelectTokenButton: React.FC<
|
|
|
64
64
|
? t('main.selectToken')
|
|
65
65
|
: t('main.selectChainAndToken')
|
|
66
66
|
const cardTitle: string =
|
|
67
|
-
formType === 'from' &&
|
|
68
|
-
subvariant === 'custom' &&
|
|
69
|
-
subvariantOptions?.custom !== 'fund'
|
|
67
|
+
formType === 'from' && subvariant === 'custom'
|
|
70
68
|
? t('header.payWith')
|
|
71
69
|
: t(`main.${formType}`)
|
|
72
70
|
return (
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useAccount } from '@lifi/wallet-management'
|
|
2
|
+
import { useChainTypeFromAddress } from '@lifi/widget-provider'
|
|
2
3
|
import CloseRounded from '@mui/icons-material/CloseRounded'
|
|
3
4
|
import { Box, Collapse } from '@mui/material'
|
|
5
|
+
import { useNavigate } from '@tanstack/react-router'
|
|
4
6
|
import { type MouseEventHandler, useEffect, useRef } from 'react'
|
|
5
7
|
import { useTranslation } from 'react-i18next'
|
|
6
|
-
import { useNavigate } from 'react-router-dom'
|
|
7
8
|
import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js'
|
|
8
9
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
|
|
9
10
|
import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js'
|
|
@@ -12,10 +13,7 @@ import { useFieldActions } from '../../stores/form/useFieldActions.js'
|
|
|
12
13
|
import { useFieldValues } from '../../stores/form/useFieldValues.js'
|
|
13
14
|
import { useSendToWalletStore } from '../../stores/settings/useSendToWalletStore.js'
|
|
14
15
|
import { DisabledUI, HiddenUI } from '../../types/widget.js'
|
|
15
|
-
import {
|
|
16
|
-
defaultChainIdsByType,
|
|
17
|
-
getChainTypeFromAddress,
|
|
18
|
-
} from '../../utils/chainType.js'
|
|
16
|
+
import { defaultChainIdsByType } from '../../utils/chainType.js'
|
|
19
17
|
import { navigationRoutes } from '../../utils/navigationRoutes.js'
|
|
20
18
|
import { shortenAddress } from '../../utils/wallet.js'
|
|
21
19
|
import { AccountAvatar } from '../Avatar/AccountAvatar.js'
|
|
@@ -47,6 +45,7 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
|
|
|
47
45
|
const { setSelectedBookmark } = useBookmarkActions()
|
|
48
46
|
const { accounts } = useAccount()
|
|
49
47
|
const { requiredToAddress } = useToAddressRequirements()
|
|
48
|
+
const { getChainTypeFromAddress } = useChainTypeFromAddress()
|
|
50
49
|
const disabledToAddress = disabledUI?.includes(DisabledUI.ToAddress)
|
|
51
50
|
const hiddenToAddress = hiddenUI?.includes(HiddenUI.ToAddress)
|
|
52
51
|
|
|
@@ -92,11 +91,11 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
|
|
|
92
91
|
const disabledForChanges = Boolean(toAddressFieldValue) && disabledToAddress
|
|
93
92
|
|
|
94
93
|
const handleOnClick = () => {
|
|
95
|
-
navigate(
|
|
96
|
-
toAddresses?.length
|
|
94
|
+
navigate({
|
|
95
|
+
to: toAddresses?.length
|
|
97
96
|
? navigationRoutes.configuredWallets
|
|
98
|
-
: navigationRoutes.sendToWallet
|
|
99
|
-
)
|
|
97
|
+
: navigationRoutes.sendToWallet,
|
|
98
|
+
})
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
const clearSelectedBookmark: MouseEventHandler<HTMLButtonElement> = (e) => {
|
|
@@ -122,9 +121,7 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
|
|
|
122
121
|
!hiddenToAddress && (requiredToAddress || showSendToWallet)
|
|
123
122
|
|
|
124
123
|
const title =
|
|
125
|
-
subvariant === 'custom' &&
|
|
126
|
-
(subvariantOptions?.custom === 'deposit' ||
|
|
127
|
-
subvariantOptions?.custom === 'fund')
|
|
124
|
+
subvariant === 'custom' && subvariantOptions?.custom === 'deposit'
|
|
128
125
|
? t('header.depositTo')
|
|
129
126
|
: t('header.sendToWallet')
|
|
130
127
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExecutionActionStatus, Substatus } from '@lifi/sdk'
|
|
2
2
|
import type { Theme } from '@mui/material'
|
|
3
3
|
import {
|
|
4
4
|
Box,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
const getStatusColor = (
|
|
12
12
|
theme: Theme,
|
|
13
|
-
status?:
|
|
13
|
+
status?: ExecutionActionStatus,
|
|
14
14
|
substatus?: Substatus
|
|
15
15
|
) => {
|
|
16
16
|
switch (status) {
|
|
@@ -32,7 +32,7 @@ const getStatusColor = (
|
|
|
32
32
|
|
|
33
33
|
export const CircularIcon = styled(Box, {
|
|
34
34
|
shouldForwardProp: (prop: string) => !['status', 'substatus'].includes(prop),
|
|
35
|
-
})<{ status?:
|
|
35
|
+
})<{ status?: ExecutionActionStatus; substatus?: Substatus }>(
|
|
36
36
|
({ theme, status, substatus }) => {
|
|
37
37
|
const statusColor = getStatusColor(theme, status, substatus)
|
|
38
38
|
const isSpecialStatus = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExecutionAction } from '@lifi/sdk'
|
|
2
2
|
import Done from '@mui/icons-material/Done'
|
|
3
3
|
import ErrorRounded from '@mui/icons-material/ErrorRounded'
|
|
4
4
|
import InfoRounded from '@mui/icons-material/InfoRounded'
|
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
CircularProgressPending,
|
|
9
9
|
} from './CircularProgress.style.js'
|
|
10
10
|
|
|
11
|
-
export function CircularProgress({
|
|
11
|
+
export function CircularProgress({ action }: { action: ExecutionAction }) {
|
|
12
12
|
return (
|
|
13
|
-
<CircularIcon status={
|
|
14
|
-
{
|
|
13
|
+
<CircularIcon status={action.status} substatus={action.substatus}>
|
|
14
|
+
{action.status === 'STARTED' || action.status === 'PENDING' ? (
|
|
15
15
|
<CircularProgressPending size={40} />
|
|
16
16
|
) : null}
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
{action.status === 'ACTION_REQUIRED' ||
|
|
18
|
+
action.status === 'MESSAGE_REQUIRED' ||
|
|
19
|
+
action.status === 'RESET_REQUIRED' ? (
|
|
20
20
|
<InfoRounded
|
|
21
21
|
color="info"
|
|
22
22
|
sx={{
|
|
@@ -25,8 +25,8 @@ export function CircularProgress({ process }: { process: Process }) {
|
|
|
25
25
|
}}
|
|
26
26
|
/>
|
|
27
27
|
) : null}
|
|
28
|
-
{
|
|
29
|
-
(
|
|
28
|
+
{action.status === 'DONE' &&
|
|
29
|
+
(action.substatus === 'PARTIAL' || action.substatus === 'REFUNDED') ? (
|
|
30
30
|
<WarningRounded
|
|
31
31
|
sx={(theme) => ({
|
|
32
32
|
position: 'absolute',
|
|
@@ -34,7 +34,7 @@ export function CircularProgress({ process }: { process: Process }) {
|
|
|
34
34
|
color: `color-mix(in srgb, ${theme.vars.palette.warning.main} 68%, black)`,
|
|
35
35
|
})}
|
|
36
36
|
/>
|
|
37
|
-
) :
|
|
37
|
+
) : action.status === 'DONE' ? (
|
|
38
38
|
<Done
|
|
39
39
|
color="success"
|
|
40
40
|
sx={{
|
|
@@ -43,7 +43,7 @@ export function CircularProgress({ process }: { process: Process }) {
|
|
|
43
43
|
}}
|
|
44
44
|
/>
|
|
45
45
|
) : null}
|
|
46
|
-
{
|
|
46
|
+
{action.status === 'FAILED' ? (
|
|
47
47
|
<ErrorRounded
|
|
48
48
|
color="error"
|
|
49
49
|
sx={{
|