@lifi/widget 3.24.3 → 3.25.0-beta.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/dist/esm/AppDefault.js +3 -3
- package/dist/esm/AppDefault.js.map +1 -1
- package/dist/esm/AppDrawer.style.d.ts +1 -1
- package/dist/esm/AppProvider.js +2 -2
- package/dist/esm/AppProvider.js.map +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
- package/dist/esm/components/AppContainer.js +6 -13
- package/dist/esm/components/AppContainer.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
- package/dist/esm/components/ButtonTertiary.d.ts +1 -1
- package/dist/esm/components/Card/CardButton.style.js +1 -1
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.js +1 -1
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/CardIconButton.d.ts +1 -1
- package/dist/esm/components/Card/CardLabel.js +1 -1
- package/dist/esm/components/Card/CardLabel.js.map +1 -1
- package/dist/esm/components/Card/CardTitle.js +1 -1
- package/dist/esm/components/Card/CardTitle.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/dist/esm/components/ChainSelect/useChainSelect.js +13 -2
- package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.d.ts +13 -0
- package/dist/esm/components/Chains/ChainList.js +17 -0
- package/dist/esm/components/Chains/ChainList.js.map +1 -0
- package/dist/esm/components/Chains/ChainList.style.d.ts +14 -0
- package/dist/esm/components/Chains/ChainList.style.js +38 -0
- package/dist/esm/components/Chains/ChainList.style.js.map +1 -0
- package/dist/esm/components/Chains/ChainListItem.d.ts +11 -0
- package/dist/esm/components/Chains/ChainListItem.js +11 -0
- package/dist/esm/components/Chains/ChainListItem.js.map +1 -0
- package/dist/esm/components/Chains/ChainSearchInput.d.ts +10 -0
- package/dist/esm/components/Chains/ChainSearchInput.js +19 -0
- package/dist/esm/components/Chains/ChainSearchInput.js.map +1 -0
- package/dist/esm/components/Chains/ChainsExpanded.d.ts +7 -0
- package/dist/esm/components/Chains/ChainsExpanded.js +11 -0
- package/dist/esm/components/Chains/ChainsExpanded.js.map +1 -0
- package/dist/esm/components/Chains/ChainsExpanded.style.d.ts +6 -0
- package/dist/esm/components/Chains/ChainsExpanded.style.js +16 -0
- package/dist/esm/components/Chains/ChainsExpanded.style.js.map +1 -0
- package/dist/esm/components/Chains/SelectChainContent.d.ts +9 -0
- package/dist/esm/components/Chains/SelectChainContent.js +60 -0
- package/dist/esm/components/Chains/SelectChainContent.js.map +1 -0
- package/dist/esm/components/Chains/VirtualizedChainList.d.ts +11 -0
- package/dist/esm/components/Chains/VirtualizedChainList.js +40 -0
- package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -0
- package/dist/esm/components/Expansion/Expansion.d.ts +1 -0
- package/dist/esm/components/Expansion/Expansion.js +41 -0
- package/dist/esm/components/Expansion/Expansion.js.map +1 -0
- package/dist/esm/components/Expansion/ExpansionTransition.d.ts +9 -0
- package/dist/esm/components/Expansion/ExpansionTransition.js +45 -0
- package/dist/esm/components/Expansion/ExpansionTransition.js.map +1 -0
- 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 +1 -1
- package/dist/esm/components/Header/Header.style.js +0 -1
- package/dist/esm/components/Header/Header.style.js.map +1 -1
- package/dist/esm/components/Header/NavigationHeader.js +2 -2
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.style.d.ts +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
- package/dist/esm/components/ListItem/ListItem.js +1 -1
- package/dist/esm/components/ListItem/ListItem.js.map +1 -1
- package/dist/esm/components/ListItemButton.js +13 -1
- package/dist/esm/components/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemText.js +1 -1
- package/dist/esm/components/ListItemText.js.map +1 -1
- package/dist/esm/components/ProgressToNextUpdate.js +1 -1
- package/dist/esm/components/ProgressToNextUpdate.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCard.js +4 -4
- package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js +5 -5
- package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js +1 -0
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js.map +1 -1
- package/dist/esm/components/RouteCard/getMatchingLabels.js +5 -3
- package/dist/esm/components/RouteCard/getMatchingLabels.js.map +1 -1
- package/dist/esm/components/Routes/Routes.js +1 -1
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesContent.d.ts +14 -0
- package/dist/esm/components/Routes/RoutesContent.js +55 -0
- package/dist/esm/components/Routes/RoutesContent.js.map +1 -0
- package/dist/esm/components/Routes/RoutesExpanded.d.ts +7 -2
- package/dist/esm/components/Routes/RoutesExpanded.js +12 -70
- package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.style.d.ts +1 -3
- package/dist/esm/components/Routes/RoutesExpanded.style.js +4 -16
- package/dist/esm/components/Routes/RoutesExpanded.style.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.d.ts +5 -2
- package/dist/esm/components/Search/SearchInput.js +7 -3
- package/dist/esm/components/Search/SearchInput.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.style.d.ts +4 -1
- package/dist/esm/components/Search/SearchInput.style.js +25 -3
- package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
- package/dist/esm/components/Search/SearchNotFound.style.js +2 -1
- package/dist/esm/components/Search/SearchNotFound.style.js.map +1 -1
- package/dist/esm/components/Select.js +1 -1
- package/dist/esm/components/Select.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +2 -7
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +2 -2
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js +0 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
- package/dist/esm/components/Step/CircularProgress.style.js +1 -1
- package/dist/esm/components/Step/CircularProgress.style.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.js +3 -3
- package/dist/esm/components/StepActions/StepActions.style.js +1 -1
- package/dist/esm/components/StepActions/StepActions.style.js.map +1 -1
- package/dist/esm/components/TextFitter/TextFitter.js +1 -1
- package/dist/esm/components/TextFitter/TextFitter.js.map +1 -1
- package/dist/esm/components/Token/Token.js +2 -2
- package/dist/esm/components/Token/Token.js.map +1 -1
- package/dist/esm/components/Token/Token.style.js +1 -1
- package/dist/esm/components/Token/Token.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.js +3 -3
- package/dist/esm/components/TokenList/TokenList.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.d.ts +2 -1
- package/dist/esm/components/TokenList/TokenList.style.js +6 -1
- package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js +16 -7
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js +13 -7
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +3 -0
- 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.js +1 -1
- package/dist/esm/components/TokenRate/TokenRate.style.js.map +1 -1
- package/dist/esm/components/TransactionDetails.js +7 -9
- 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/timer/time.js +1 -1
- package/dist/esm/hooks/timer/time.js.map +1 -1
- package/dist/esm/hooks/timer/useTimer.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.js +3 -2
- package/dist/esm/hooks/useAvailableChains.js.map +1 -1
- package/dist/esm/hooks/useChains.js +4 -4
- package/dist/esm/hooks/useChains.js.map +1 -1
- package/dist/esm/hooks/useExpansionRoutes.d.ts +2 -0
- package/dist/esm/hooks/useExpansionRoutes.js +26 -0
- package/dist/esm/hooks/useExpansionRoutes.js.map +1 -0
- package/dist/esm/hooks/useHasChainExpansion.d.ts +2 -0
- package/dist/esm/hooks/useHasChainExpansion.js +16 -0
- package/dist/esm/hooks/useHasChainExpansion.js.map +1 -0
- package/dist/esm/hooks/useIsBatchingSupported.js +4 -1
- package/dist/esm/hooks/useIsBatchingSupported.js.map +1 -1
- package/dist/esm/hooks/useListHeight.js +1 -1
- package/dist/esm/hooks/useListHeight.js.map +1 -1
- package/dist/esm/hooks/useRouteExecution.js +3 -3
- package/dist/esm/hooks/useRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +6 -3
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressReset.js +10 -2
- package/dist/esm/hooks/useToAddressReset.js.map +1 -1
- package/dist/esm/hooks/useTokenBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js +1 -0
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +6 -4
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +5 -3
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTools.js +5 -3
- package/dist/esm/hooks/useTools.js.map +1 -1
- package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
- package/dist/esm/hooks/useWidgetEvents.js.map +1 -1
- package/dist/esm/i18n/bn.json +2 -1
- package/dist/esm/i18n/de.json +2 -1
- package/dist/esm/i18n/en.json +2 -1
- package/dist/esm/i18n/es.json +2 -1
- package/dist/esm/i18n/fr.json +2 -1
- package/dist/esm/i18n/hi.json +1 -0
- package/dist/esm/i18n/id.json +2 -1
- package/dist/esm/i18n/it.json +2 -1
- package/dist/esm/i18n/ja.json +2 -1
- package/dist/esm/i18n/ko.json +2 -1
- package/dist/esm/i18n/pl.json +350 -0
- package/dist/esm/i18n/pt.json +2 -1
- package/dist/esm/i18n/th.json +2 -1
- package/dist/esm/i18n/tr.json +2 -1
- package/dist/esm/i18n/uk.json +14 -13
- package/dist/esm/i18n/vi.json +2 -1
- package/dist/esm/i18n/zh.json +2 -1
- package/dist/esm/index.d.ts +8 -8
- package/dist/esm/index.js +8 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js +7 -33
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js +1 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +20 -11
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +2 -2
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +1 -3
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js +8 -5
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.js +2 -2
- package/dist/esm/pages/TransactionPage/RouteTracker.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +4 -4
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +8 -4
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/QueryClientProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SDKProviders.js +1 -1
- package/dist/esm/providers/WalletProvider/SDKProviders.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SuiBaseProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/SuiBaseProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +5 -3
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/form/FormStore.js +1 -1
- package/dist/esm/stores/form/FormStore.js.map +1 -1
- package/dist/esm/stores/form/FormUpdater.js +21 -5
- package/dist/esm/stores/form/FormUpdater.js.map +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
- package/dist/esm/stores/form/useFormRef.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsStore.js.map +1 -1
- package/dist/esm/types/widget.d.ts +25 -6
- package/dist/esm/types/widget.js +6 -0
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/deepEqual.js +2 -2
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/item.d.ts +5 -15
- package/dist/esm/utils/item.js +23 -19
- package/dist/esm/utils/item.js.map +1 -1
- package/dist/esm/utils/widgetSize.d.ts +3 -0
- package/dist/esm/utils/widgetSize.js +11 -0
- package/dist/esm/utils/widgetSize.js.map +1 -0
- package/package.json +7 -6
- package/package.json.tmp +12 -6
- package/src/AppDefault.tsx +3 -3
- package/src/AppProvider.tsx +2 -2
- package/src/components/ActiveTransactions/ActiveTransactions.style.ts +1 -1
- package/src/components/AmountInput/AmountInput.style.tsx +1 -1
- package/src/components/AppContainer.tsx +6 -14
- package/src/components/Avatar/Avatar.style.tsx +2 -2
- package/src/components/Card/CardButton.style.tsx +1 -1
- package/src/components/Card/CardHeader.tsx +1 -1
- package/src/components/Card/CardLabel.tsx +1 -1
- package/src/components/Card/CardTitle.tsx +1 -1
- package/src/components/ChainSelect/ChainSelect.tsx +1 -1
- package/src/components/ChainSelect/useChainSelect.ts +37 -23
- package/src/components/Chains/ChainList.style.tsx +59 -0
- package/src/components/Chains/ChainList.tsx +86 -0
- package/src/components/Chains/ChainListItem.tsx +52 -0
- package/src/components/Chains/ChainSearchInput.tsx +52 -0
- package/src/components/Chains/ChainsExpanded.style.tsx +21 -0
- package/src/components/Chains/ChainsExpanded.tsx +28 -0
- package/src/components/Chains/SelectChainContent.tsx +116 -0
- package/src/components/Chains/VirtualizedChainList.tsx +84 -0
- package/src/components/Expansion/Expansion.tsx +62 -0
- package/src/components/Expansion/ExpansionTransition.tsx +76 -0
- package/src/components/Header/Header.style.ts +0 -1
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/NavigationHeader.tsx +2 -2
- package/src/components/Header/SettingsButton.style.tsx +1 -1
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/ListItemButton.tsx +17 -1
- package/src/components/ListItemText.tsx +1 -1
- package/src/components/ProgressToNextUpdate.tsx +1 -1
- package/src/components/RouteCard/RouteCard.tsx +4 -4
- package/src/components/RouteCard/RouteCardEssentials.tsx +5 -5
- package/src/components/RouteCard/RouteNotFoundCard.tsx +1 -0
- package/src/components/RouteCard/getMatchingLabels.ts +11 -3
- package/src/components/Routes/Routes.tsx +1 -1
- package/src/components/Routes/RoutesContent.tsx +137 -0
- package/src/components/Routes/RoutesExpanded.style.ts +4 -18
- package/src/components/Routes/RoutesExpanded.tsx +33 -158
- package/src/components/Search/SearchInput.style.tsx +36 -3
- package/src/components/Search/SearchInput.tsx +31 -5
- package/src/components/Search/SearchNotFound.style.tsx +2 -1
- package/src/components/Select.tsx +1 -1
- package/src/components/SelectTokenButton/SelectTokenButton.style.tsx +1 -1
- package/src/components/SendToWallet/SendToWalletButton.tsx +2 -3
- package/src/components/Skeleton/WidgetSkeleton.style.tsx +0 -1
- package/src/components/Step/CircularProgress.style.tsx +1 -1
- package/src/components/StepActions/StepActions.style.tsx +1 -1
- package/src/components/StepActions/StepActions.tsx +3 -3
- package/src/components/TextFitter/TextFitter.tsx +1 -1
- package/src/components/Token/Token.style.tsx +1 -1
- package/src/components/Token/Token.tsx +2 -2
- package/src/components/TokenList/TokenDetailsSheet.tsx +1 -0
- package/src/components/TokenList/TokenDetailsSheetContent.style.tsx +1 -1
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +1 -1
- package/src/components/TokenList/TokenList.style.tsx +11 -1
- package/src/components/TokenList/TokenList.tsx +6 -2
- package/src/components/TokenList/TokenListItem.tsx +53 -37
- package/src/components/TokenList/VirtualizedTokenList.tsx +17 -5
- package/src/components/TokenList/types.ts +3 -0
- package/src/components/TokenRate/TokenRate.style.ts +1 -1
- package/src/components/TokenRate/TokenRate.tsx +1 -1
- package/src/components/TransactionDetails.tsx +9 -9
- package/src/config/version.ts +1 -1
- package/src/hooks/timer/time.ts +1 -1
- package/src/hooks/timer/useTimer.ts +1 -1
- package/src/hooks/useAvailableChains.ts +8 -2
- package/src/hooks/useChains.ts +10 -4
- package/src/hooks/useExpansionRoutes.ts +29 -0
- package/src/hooks/useHasChainExpansion.ts +19 -0
- package/src/hooks/useIsBatchingSupported.ts +5 -2
- package/src/hooks/useListHeight.ts +1 -1
- package/src/hooks/useRouteExecution.ts +3 -3
- package/src/hooks/useRoutes.ts +8 -2
- package/src/hooks/useToAddressReset.ts +32 -21
- package/src/hooks/useTokenBalance.ts +1 -1
- package/src/hooks/useTokenBalances.ts +1 -0
- package/src/hooks/useTokenSearch.ts +23 -6
- package/src/hooks/useTokens.ts +16 -6
- package/src/hooks/useTools.ts +12 -4
- package/src/hooks/useTransactionDetails.ts +1 -1
- package/src/hooks/useWidgetEvents.ts +1 -0
- package/src/i18n/bn.json +2 -1
- package/src/i18n/de.json +2 -1
- package/src/i18n/en.json +2 -1
- package/src/i18n/es.json +2 -1
- package/src/i18n/fr.json +2 -1
- package/src/i18n/hi.json +1 -0
- package/src/i18n/id.json +2 -1
- package/src/i18n/it.json +2 -1
- package/src/i18n/ja.json +2 -1
- package/src/i18n/ko.json +2 -1
- package/src/i18n/pl.json +350 -0
- package/src/i18n/pt.json +2 -1
- package/src/i18n/th.json +2 -1
- package/src/i18n/tr.json +2 -1
- package/src/i18n/uk.json +14 -13
- package/src/i18n/vi.json +2 -1
- package/src/i18n/zh.json +2 -1
- package/src/index.ts +8 -8
- package/src/pages/RoutesPage/RoutesPage.tsx +1 -1
- package/src/pages/SelectChainPage/SelectChainPage.tsx +18 -71
- package/src/pages/SelectEnabledToolsPage.tsx +1 -1
- package/src/pages/SelectTokenPage/SearchTokenInput.tsx +2 -0
- package/src/pages/SelectTokenPage/SelectTokenPage.tsx +44 -22
- package/src/pages/SendToWallet/BookmarksPage.tsx +1 -1
- package/src/pages/SendToWallet/SendToWalletPage.style.tsx +3 -3
- package/src/pages/SettingsPage/SettingsCard/SettingCard.style.tsx +1 -1
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +1 -1
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +1 -1
- package/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +12 -7
- package/src/pages/TransactionPage/RouteTracker.tsx +2 -2
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +4 -4
- package/src/providers/I18nProvider/I18nProvider.tsx +10 -4
- package/src/providers/QueryClientProvider.tsx +1 -1
- package/src/providers/WalletProvider/SDKProviders.tsx +1 -1
- package/src/providers/WalletProvider/SuiBaseProvider.tsx +1 -1
- package/src/providers/WalletProvider/WalletProvider.tsx +1 -1
- package/src/providers/WalletProvider/useExternalWalletProvider.ts +1 -1
- package/src/stores/chains/ChainOrderStore.tsx +8 -3
- package/src/stores/form/FormStore.tsx +1 -1
- package/src/stores/form/FormUpdater.tsx +40 -6
- package/src/stores/form/URLSearchParamsBuilder.tsx +1 -1
- package/src/stores/form/useFormRef.ts +50 -54
- package/src/stores/routes/createRouteExecutionStore.ts +1 -1
- package/src/stores/settings/useSettingsStore.ts +1 -0
- package/src/types/widget.ts +29 -6
- package/src/utils/deepEqual.ts +2 -2
- package/src/utils/item.ts +46 -40
- package/src/utils/widgetSize.ts +17 -0
|
@@ -111,13 +111,12 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
|
|
|
111
111
|
const collapseTransitionTime = useRef(0)
|
|
112
112
|
|
|
113
113
|
// Timeout is needed here to push the collapseTransitionTime update to the back of the event loop so that it doesn't fired too quickly
|
|
114
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies:
|
|
115
114
|
useEffect(() => {
|
|
116
115
|
const timeout = setTimeout(() => {
|
|
117
116
|
collapseTransitionTime.current = 225
|
|
118
117
|
}, 0)
|
|
119
118
|
return () => clearTimeout(timeout)
|
|
120
|
-
}, [
|
|
119
|
+
}, [])
|
|
121
120
|
|
|
122
121
|
const isOpenCollapse =
|
|
123
122
|
!hiddenToAddress && (requiredToAddress || showSendToWallet)
|
|
@@ -134,8 +133,8 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
|
|
|
134
133
|
mountOnEnter
|
|
135
134
|
unmountOnExit
|
|
136
135
|
>
|
|
136
|
+
{/** biome-ignore lint/a11y/useSemanticElements: allowed in react */}
|
|
137
137
|
<Card
|
|
138
|
-
// biome-ignore lint/a11y/useSemanticElements:
|
|
139
138
|
role="button"
|
|
140
139
|
onClick={disabledForChanges ? undefined : handleOnClick}
|
|
141
140
|
sx={{ width: '100%', ...props.sx }}
|
|
@@ -2,9 +2,9 @@ import type { ProcessStatus, Substatus } from '@lifi/sdk'
|
|
|
2
2
|
import type { Theme } from '@mui/material'
|
|
3
3
|
import {
|
|
4
4
|
Box,
|
|
5
|
-
CircularProgress as MuiCircularProgress,
|
|
6
5
|
circularProgressClasses,
|
|
7
6
|
keyframes,
|
|
7
|
+
CircularProgress as MuiCircularProgress,
|
|
8
8
|
styled,
|
|
9
9
|
} from '@mui/material'
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LiFiStep, StepExtended } from '@lifi/sdk'
|
|
2
|
-
import {
|
|
2
|
+
import { isRelayerStep } from '@lifi/sdk'
|
|
3
3
|
import ArrowForward from '@mui/icons-material/ArrowForward'
|
|
4
4
|
import ExpandLess from '@mui/icons-material/ExpandLess'
|
|
5
5
|
import ExpandMore from '@mui/icons-material/ExpandMore'
|
|
@@ -162,7 +162,7 @@ export const IncludedSteps: React.FC<IncludedStepsProps> = ({ step }) => {
|
|
|
162
162
|
) : null
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
const
|
|
165
|
+
const hasRelayerSupport = isRelayerStep(step)
|
|
166
166
|
|
|
167
167
|
return (
|
|
168
168
|
<Box
|
|
@@ -194,7 +194,7 @@ export const IncludedSteps: React.FC<IncludedStepsProps> = ({ step }) => {
|
|
|
194
194
|
<ProtocolStepDetailsLabel
|
|
195
195
|
step={step}
|
|
196
196
|
feeConfig={feeConfig}
|
|
197
|
-
relayerSupport={
|
|
197
|
+
relayerSupport={hasRelayerSupport}
|
|
198
198
|
/>
|
|
199
199
|
) : (
|
|
200
200
|
<SwapStepDetailsLabel step={step} />
|
|
@@ -50,7 +50,7 @@ export const TextFitter: React.FC<PropsWithChildren<TextFitterProps>> = ({
|
|
|
50
50
|
onFit?.()
|
|
51
51
|
}, [cropBottom, cropTop, onFit])
|
|
52
52
|
|
|
53
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies:
|
|
53
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: run only when children changes
|
|
54
54
|
useLayoutEffect(() => {
|
|
55
55
|
calculateBox()
|
|
56
56
|
}, [calculateBox, children])
|
|
@@ -80,8 +80,8 @@ export const TokenBase: FC<TokenProps & BoxProps> = ({
|
|
|
80
80
|
token.decimals
|
|
81
81
|
)
|
|
82
82
|
|
|
83
|
-
let priceImpact: number | undefined
|
|
84
|
-
let priceImpactPercent: number | undefined
|
|
83
|
+
let priceImpact: number | undefined
|
|
84
|
+
let priceImpactPercent: number | undefined
|
|
85
85
|
if (impactToken) {
|
|
86
86
|
priceImpact = getPriceImpact({
|
|
87
87
|
fromToken: impactToken,
|
|
@@ -3,6 +3,7 @@ import { BottomSheet } from '../BottomSheet/BottomSheet.js'
|
|
|
3
3
|
import type { BottomSheetBase } from '../BottomSheet/types.js'
|
|
4
4
|
import { TokenDetailsSheetContent } from './TokenDetailsSheetContent.js'
|
|
5
5
|
import type { TokenDetailsSheetBase } from './types.js'
|
|
6
|
+
|
|
6
7
|
interface TokenDetailsSheetProps {
|
|
7
8
|
chainId: number | undefined
|
|
8
9
|
}
|
|
@@ -2,7 +2,7 @@ import Close from '@mui/icons-material/Close'
|
|
|
2
2
|
import ContentCopyRounded from '@mui/icons-material/ContentCopyRounded'
|
|
3
3
|
import OpenInNewRounded from '@mui/icons-material/OpenInNewRounded'
|
|
4
4
|
import { Box, IconButton, Link, Skeleton, Typography } from '@mui/material'
|
|
5
|
-
import { type PropsWithChildren,
|
|
5
|
+
import { forwardRef, type PropsWithChildren, useMemo } from 'react'
|
|
6
6
|
import { useTranslation } from 'react-i18next'
|
|
7
7
|
import { useAvailableChains } from '../../hooks/useAvailableChains.js'
|
|
8
8
|
import { useExplorer } from '../../hooks/useExplorer.js'
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { IconButtonProps, LinkProps } from '@mui/material'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IconButton as MuiIconButton,
|
|
4
|
+
List as MuiList,
|
|
5
|
+
styled,
|
|
6
|
+
} from '@mui/material'
|
|
3
7
|
import { ListItem as ListItemBase } from '../ListItem/ListItem.js'
|
|
4
8
|
|
|
5
9
|
export const ListItem = styled(ListItemBase)(() => ({
|
|
@@ -8,6 +12,12 @@ export const ListItem = styled(ListItemBase)(() => ({
|
|
|
8
12
|
left: 0,
|
|
9
13
|
}))
|
|
10
14
|
|
|
15
|
+
export const List = styled(MuiList)(({ theme }) => ({
|
|
16
|
+
cursor: 'pointer',
|
|
17
|
+
marginLeft: theme.spacing(1.5),
|
|
18
|
+
marginRight: theme.spacing(1.5),
|
|
19
|
+
}))
|
|
20
|
+
|
|
11
21
|
export const IconButton = styled(MuiIconButton)<IconButtonProps & LinkProps>(
|
|
12
22
|
({ theme }) => ({
|
|
13
23
|
lineHeight: 1,
|
|
@@ -11,10 +11,10 @@ import { useFieldValues } from '../../stores/form/useFieldValues.js'
|
|
|
11
11
|
import { WidgetEvent } from '../../types/events.js'
|
|
12
12
|
import type { TokenAmount } from '../../types/token.js'
|
|
13
13
|
import { TokenNotFound } from './TokenNotFound.js'
|
|
14
|
-
import { VirtualizedTokenList } from './VirtualizedTokenList.js'
|
|
15
14
|
import type { TokenListProps } from './types.js'
|
|
16
15
|
import { useTokenSelect } from './useTokenSelect.js'
|
|
17
16
|
import { filteredTokensComparator } from './utils.js'
|
|
17
|
+
import { VirtualizedTokenList } from './VirtualizedTokenList.js'
|
|
18
18
|
|
|
19
19
|
export const TokenList: FC<TokenListProps> = ({
|
|
20
20
|
formType,
|
|
@@ -23,7 +23,10 @@ export const TokenList: FC<TokenListProps> = ({
|
|
|
23
23
|
onClick,
|
|
24
24
|
}) => {
|
|
25
25
|
const emitter = useWidgetEvents()
|
|
26
|
-
const [selectedChainId] = useFieldValues(
|
|
26
|
+
const [selectedChainId, selectedTokenAddress] = useFieldValues(
|
|
27
|
+
FormKeyHelper.getChainKey(formType),
|
|
28
|
+
FormKeyHelper.getTokenKey(formType)
|
|
29
|
+
)
|
|
27
30
|
const [tokenSearchFilter]: string[] = useDebouncedWatch(
|
|
28
31
|
320,
|
|
29
32
|
'tokenSearchFilter'
|
|
@@ -118,6 +121,7 @@ export const TokenList: FC<TokenListProps> = ({
|
|
|
118
121
|
isBalanceLoading={isBalanceLoading}
|
|
119
122
|
showCategories={showCategories}
|
|
120
123
|
onClick={handleTokenClick}
|
|
124
|
+
selectedTokenAddress={selectedTokenAddress}
|
|
121
125
|
/>
|
|
122
126
|
</Box>
|
|
123
127
|
)
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Typography,
|
|
11
11
|
} from '@mui/material'
|
|
12
12
|
import type { MouseEventHandler } from 'react'
|
|
13
|
-
import { useRef, useState } from 'react'
|
|
13
|
+
import { memo, useRef, useState } from 'react'
|
|
14
14
|
import { useTranslation } from 'react-i18next'
|
|
15
15
|
import { formatTokenAmount, formatTokenPrice } from '../../utils/format.js'
|
|
16
16
|
import { shortenAddress } from '../../utils/wallet.js'
|
|
@@ -22,42 +22,47 @@ import type {
|
|
|
22
22
|
TokenListItemProps,
|
|
23
23
|
} from './types.js'
|
|
24
24
|
|
|
25
|
-
export const TokenListItem: React.FC<TokenListItemProps> = (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
export const TokenListItem: React.FC<TokenListItemProps> = memo(
|
|
26
|
+
({
|
|
27
|
+
onClick,
|
|
28
|
+
size,
|
|
29
|
+
start,
|
|
30
|
+
token,
|
|
31
|
+
chain,
|
|
32
|
+
accountAddress,
|
|
33
|
+
isBalanceLoading,
|
|
34
|
+
startAdornment,
|
|
35
|
+
endAdornment,
|
|
36
|
+
selected,
|
|
37
|
+
onShowTokenDetails,
|
|
38
|
+
}) => {
|
|
39
|
+
const handleClick: MouseEventHandler<HTMLDivElement> = (e) => {
|
|
40
|
+
e.stopPropagation()
|
|
41
|
+
onClick?.(token.address, chain?.id)
|
|
42
|
+
}
|
|
43
|
+
return (
|
|
44
|
+
<ListItem
|
|
45
|
+
style={{
|
|
46
|
+
height: `${size}px`,
|
|
47
|
+
transform: `translateY(${start}px)`,
|
|
48
|
+
padding: 0,
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{startAdornment}
|
|
52
|
+
<TokenListItemButton
|
|
53
|
+
token={token}
|
|
54
|
+
chain={chain}
|
|
55
|
+
accountAddress={accountAddress}
|
|
56
|
+
isBalanceLoading={isBalanceLoading}
|
|
57
|
+
onClick={handleClick}
|
|
58
|
+
selected={selected}
|
|
59
|
+
onShowTokenDetails={onShowTokenDetails}
|
|
60
|
+
/>
|
|
61
|
+
{endAdornment}
|
|
62
|
+
</ListItem>
|
|
63
|
+
)
|
|
40
64
|
}
|
|
41
|
-
|
|
42
|
-
<ListItem
|
|
43
|
-
style={{
|
|
44
|
-
height: `${size}px`,
|
|
45
|
-
transform: `translateY(${start}px)`,
|
|
46
|
-
}}
|
|
47
|
-
>
|
|
48
|
-
{startAdornment}
|
|
49
|
-
<TokenListItemButton
|
|
50
|
-
token={token}
|
|
51
|
-
chain={chain}
|
|
52
|
-
accountAddress={accountAddress}
|
|
53
|
-
isBalanceLoading={isBalanceLoading}
|
|
54
|
-
onClick={handleClick}
|
|
55
|
-
onShowTokenDetails={onShowTokenDetails}
|
|
56
|
-
/>
|
|
57
|
-
{endAdornment}
|
|
58
|
-
</ListItem>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
65
|
+
)
|
|
61
66
|
|
|
62
67
|
export const TokenListItemAvatar: React.FC<TokenListItemAvatarProps> = ({
|
|
63
68
|
token,
|
|
@@ -110,6 +115,7 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
|
|
|
110
115
|
chain,
|
|
111
116
|
accountAddress,
|
|
112
117
|
isBalanceLoading,
|
|
118
|
+
selected,
|
|
113
119
|
onShowTokenDetails,
|
|
114
120
|
}) => {
|
|
115
121
|
const { t } = useTranslation()
|
|
@@ -147,6 +153,11 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
|
|
|
147
153
|
onMouseEnter={onMouseEnter}
|
|
148
154
|
onMouseLeave={onMouseLeave}
|
|
149
155
|
dense
|
|
156
|
+
selected={selected}
|
|
157
|
+
sx={{
|
|
158
|
+
height: 60,
|
|
159
|
+
marginBottom: '4px',
|
|
160
|
+
}}
|
|
150
161
|
>
|
|
151
162
|
<ListItemAvatar>
|
|
152
163
|
<TokenListItemAvatar token={token} />
|
|
@@ -307,7 +318,12 @@ export const TokenListItemSkeleton = () => {
|
|
|
307
318
|
<ListItem
|
|
308
319
|
secondaryAction={<TokenAmountSkeleton />}
|
|
309
320
|
disablePadding
|
|
310
|
-
sx={{
|
|
321
|
+
sx={{
|
|
322
|
+
position: 'relative',
|
|
323
|
+
flexDirection: 'row',
|
|
324
|
+
alignItems: 'center',
|
|
325
|
+
padding: 0,
|
|
326
|
+
}}
|
|
311
327
|
>
|
|
312
328
|
<ListItemAvatar>
|
|
313
329
|
<Skeleton
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Typography } from '@mui/material'
|
|
2
2
|
import { useVirtualizer } from '@tanstack/react-virtual'
|
|
3
3
|
import type { FC } from 'react'
|
|
4
4
|
import { useCallback, useEffect, useRef } from 'react'
|
|
5
5
|
import { useTranslation } from 'react-i18next'
|
|
6
6
|
import type { TokenAmount } from '../../types/token.js'
|
|
7
7
|
import { TokenDetailsSheet } from './TokenDetailsSheet.js'
|
|
8
|
+
import { List } from './TokenList.style.js'
|
|
8
9
|
import { TokenListItem, TokenListItemSkeleton } from './TokenListItem.js'
|
|
9
10
|
import type {
|
|
10
11
|
TokenDetailsSheetBase,
|
|
@@ -17,6 +18,7 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
|
|
|
17
18
|
scrollElementRef,
|
|
18
19
|
chainId,
|
|
19
20
|
chain,
|
|
21
|
+
selectedTokenAddress,
|
|
20
22
|
isLoading,
|
|
21
23
|
isBalanceLoading,
|
|
22
24
|
showCategories,
|
|
@@ -33,9 +35,16 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
|
|
|
33
35
|
[]
|
|
34
36
|
)
|
|
35
37
|
|
|
38
|
+
const getItemKey = useCallback(
|
|
39
|
+
(index: number) => {
|
|
40
|
+
return `${tokens[index].address}-${index}`
|
|
41
|
+
},
|
|
42
|
+
[tokens]
|
|
43
|
+
)
|
|
44
|
+
|
|
36
45
|
const { getVirtualItems, getTotalSize, scrollToIndex } = useVirtualizer({
|
|
37
46
|
count: tokens.length,
|
|
38
|
-
overscan:
|
|
47
|
+
overscan: 5,
|
|
39
48
|
paddingEnd: 12,
|
|
40
49
|
getScrollElement: () => scrollElementRef.current,
|
|
41
50
|
estimateSize: (index) => {
|
|
@@ -66,15 +75,17 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
|
|
|
66
75
|
|
|
67
76
|
return size
|
|
68
77
|
},
|
|
69
|
-
getItemKey
|
|
78
|
+
getItemKey,
|
|
70
79
|
})
|
|
71
80
|
|
|
72
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies:
|
|
81
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: run only when chainId changes
|
|
73
82
|
useEffect(() => {
|
|
74
83
|
// Scroll to the top of the list when switching the chains
|
|
75
84
|
if (getVirtualItems().length) {
|
|
76
85
|
scrollToIndex(0, { align: 'start' })
|
|
77
86
|
}
|
|
87
|
+
// Close the token details sheet when switching the chains
|
|
88
|
+
tokenDetailsSheetRef.current?.close()
|
|
78
89
|
}, [scrollToIndex, chainId, getVirtualItems])
|
|
79
90
|
|
|
80
91
|
if (isLoading) {
|
|
@@ -144,6 +155,8 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
|
|
|
144
155
|
start={item.start}
|
|
145
156
|
token={currentToken}
|
|
146
157
|
chain={chain}
|
|
158
|
+
selected={currentToken.address === selectedTokenAddress}
|
|
159
|
+
onShowTokenDetails={onShowTokenDetails}
|
|
147
160
|
isBalanceLoading={isBalanceLoading}
|
|
148
161
|
accountAddress={account.address}
|
|
149
162
|
startAdornment={
|
|
@@ -162,7 +175,6 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
|
|
|
162
175
|
</Typography>
|
|
163
176
|
) : null
|
|
164
177
|
}
|
|
165
|
-
onShowTokenDetails={onShowTokenDetails}
|
|
166
178
|
/>
|
|
167
179
|
)
|
|
168
180
|
})}
|
|
@@ -21,6 +21,7 @@ export interface VirtualizedTokenListProps {
|
|
|
21
21
|
chain?: ExtendedChain
|
|
22
22
|
showCategories?: boolean
|
|
23
23
|
onClick(tokenAddress: string, chainId?: number): void
|
|
24
|
+
selectedTokenAddress?: string
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export interface TokenListItemBaseProps {
|
|
@@ -37,6 +38,7 @@ export interface TokenListItemProps extends TokenListItemBaseProps {
|
|
|
37
38
|
isBalanceLoading?: boolean
|
|
38
39
|
startAdornment?: React.ReactNode
|
|
39
40
|
endAdornment?: React.ReactNode
|
|
41
|
+
selected?: boolean
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
export interface TokenListItemButtonProps {
|
|
@@ -46,6 +48,7 @@ export interface TokenListItemButtonProps {
|
|
|
46
48
|
token: TokenAmount
|
|
47
49
|
chain?: ExtendedChain
|
|
48
50
|
isBalanceLoading?: boolean
|
|
51
|
+
selected?: boolean
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
export interface TokenListItemAvatarProps {
|
|
@@ -56,7 +56,7 @@ export const TokenRate: React.FC<TokenRateProps> = ({ route }) => {
|
|
|
56
56
|
: `1 ${toToken.symbol} ≈ ${t('format.tokenAmount', { value: toFromRate })} ${fromToken.symbol}`
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
|
-
// biome-ignore lint/a11y/useSemanticElements:
|
|
59
|
+
// biome-ignore lint/a11y/useSemanticElements: allowed in react
|
|
60
60
|
<TokenRateTypography onClick={toggleRate} role="button">
|
|
61
61
|
{rateText}
|
|
62
62
|
</TokenRateTypography>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RouteExtended } from '@lifi/sdk'
|
|
2
|
-
import {
|
|
2
|
+
import { isRelayerStep } from '@lifi/sdk'
|
|
3
3
|
import ExpandLess from '@mui/icons-material/ExpandLess'
|
|
4
4
|
import ExpandMore from '@mui/icons-material/ExpandMore'
|
|
5
5
|
import LocalGasStationRounded from '@mui/icons-material/LocalGasStationRounded'
|
|
@@ -71,10 +71,10 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
|
|
|
71
71
|
) ?? 0
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
const
|
|
74
|
+
const hasRelayerSupport = route.steps.every(isRelayerStep)
|
|
75
75
|
|
|
76
76
|
const showIntegratorFeeCollectionDetails =
|
|
77
|
-
(feeAmountUSD || Number.isFinite(feeConfig?.fee)) && !
|
|
77
|
+
(feeAmountUSD || Number.isFinite(feeConfig?.fee)) && !hasRelayerSupport
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
80
|
<Card selectionColor="secondary" {...props}>
|
|
@@ -100,11 +100,11 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
|
|
|
100
100
|
<FeeBreakdownTooltip
|
|
101
101
|
gasCosts={gasCosts}
|
|
102
102
|
feeCosts={feeCosts}
|
|
103
|
-
relayerSupport={
|
|
103
|
+
relayerSupport={hasRelayerSupport}
|
|
104
104
|
>
|
|
105
|
+
{/** biome-ignore lint/a11y/useSemanticElements: allowed in react */}
|
|
105
106
|
<Box
|
|
106
107
|
onClick={toggleCard}
|
|
107
|
-
// biome-ignore lint/a11y/useSemanticElements:
|
|
108
108
|
role="button"
|
|
109
109
|
sx={{
|
|
110
110
|
display: 'flex',
|
|
@@ -117,7 +117,7 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
|
|
|
117
117
|
<LocalGasStationRounded fontSize="inherit" />
|
|
118
118
|
</IconTypography>
|
|
119
119
|
<Typography
|
|
120
|
-
data-value={
|
|
120
|
+
data-value={hasRelayerSupport ? 0 : combinedFeesUSD}
|
|
121
121
|
sx={{
|
|
122
122
|
fontSize: 14,
|
|
123
123
|
color: 'text.primary',
|
|
@@ -125,7 +125,7 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
|
|
|
125
125
|
lineHeight: 1.429,
|
|
126
126
|
}}
|
|
127
127
|
>
|
|
128
|
-
{
|
|
128
|
+
{hasRelayerSupport
|
|
129
129
|
? t('main.fees.free')
|
|
130
130
|
: t('format.currency', { value: combinedFeesUSD })}
|
|
131
131
|
</Typography>
|
|
@@ -157,13 +157,13 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
|
|
|
157
157
|
<Typography variant="body2">{t('main.fees.network')}</Typography>
|
|
158
158
|
<FeeBreakdownTooltip
|
|
159
159
|
gasCosts={gasCosts}
|
|
160
|
-
relayerSupport={
|
|
160
|
+
relayerSupport={hasRelayerSupport}
|
|
161
161
|
>
|
|
162
162
|
<Typography
|
|
163
163
|
variant="body2"
|
|
164
164
|
sx={{ fontWeight: 600, cursor: 'help' }}
|
|
165
165
|
>
|
|
166
|
-
{
|
|
166
|
+
{hasRelayerSupport
|
|
167
167
|
? t('main.fees.free')
|
|
168
168
|
: t('format.currency', {
|
|
169
169
|
value: gasCostUSD,
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget'
|
|
2
|
-
export const version = '3.
|
|
2
|
+
export const version = '3.25.0-beta.1'
|
package/src/hooks/timer/time.ts
CHANGED
|
@@ -43,7 +43,7 @@ export function getTimeFromMilliseconds(
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export function getMillisecondsFromExpiry(expiry: Date): number {
|
|
46
|
-
const now =
|
|
46
|
+
const now = Date.now()
|
|
47
47
|
const milliSecondsDistance = expiry?.getTime() - now
|
|
48
48
|
return milliSecondsDistance > 0 ? milliSecondsDistance : 0
|
|
49
49
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react'
|
|
2
2
|
import {
|
|
3
|
-
type TimeFromMillisecondsType,
|
|
4
3
|
getMillisecondsFromExpiry,
|
|
5
4
|
getTimeFromMilliseconds,
|
|
5
|
+
type TimeFromMillisecondsType,
|
|
6
6
|
} from './time.js'
|
|
7
7
|
import { useInterval } from './useInterval.js'
|
|
8
8
|
import { validateExpiryTimestamp, validateOnExpire } from './validate.js'
|
|
@@ -3,7 +3,7 @@ import { ChainType, config, getChains } from '@lifi/sdk'
|
|
|
3
3
|
import { useQuery } from '@tanstack/react-query'
|
|
4
4
|
import { useCallback } from 'react'
|
|
5
5
|
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
|
|
6
|
-
import {
|
|
6
|
+
import { getConfigItemSets, isItemAllowedForSets } from '../utils/item.js'
|
|
7
7
|
import { getQueryKey } from '../utils/queries.js'
|
|
8
8
|
|
|
9
9
|
export type GetChainById = (
|
|
@@ -33,9 +33,15 @@ export const useAvailableChains = (chainTypes?: ChainType[]) => {
|
|
|
33
33
|
chains?.to,
|
|
34
34
|
] as const,
|
|
35
35
|
queryFn: async ({ queryKey: [, chainTypesConfig] }) => {
|
|
36
|
+
const chainsConfigSets = getConfigItemSets(
|
|
37
|
+
chainTypesConfig,
|
|
38
|
+
(chains) => new Set(chains)
|
|
39
|
+
)
|
|
36
40
|
const chainTypesRequest = supportedChainTypes
|
|
37
41
|
// providers.length > 0 ? providers : supportedChainTypes
|
|
38
|
-
.filter((chainType) =>
|
|
42
|
+
.filter((chainType) =>
|
|
43
|
+
isItemAllowedForSets(chainType, chainsConfigSets)
|
|
44
|
+
)
|
|
39
45
|
|
|
40
46
|
const availableChains = await getChains({
|
|
41
47
|
chainTypes: chainTypes || chainTypesRequest,
|
package/src/hooks/useChains.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ChainType } from '@lifi/sdk'
|
|
|
2
2
|
import { useMemo } from 'react'
|
|
3
3
|
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
|
|
4
4
|
import type { FormType } from '../stores/form/types.js'
|
|
5
|
-
import {
|
|
5
|
+
import { getConfigItemSets, isFormItemAllowed } from '../utils/item.js'
|
|
6
6
|
import { useAvailableChains } from './useAvailableChains.js'
|
|
7
7
|
|
|
8
8
|
export const useChains = (type?: FormType, chainTypes?: ChainType[]) => {
|
|
@@ -14,15 +14,21 @@ export const useChains = (type?: FormType, chainTypes?: ChainType[]) => {
|
|
|
14
14
|
} = useAvailableChains()
|
|
15
15
|
|
|
16
16
|
const filteredChains = useMemo(() => {
|
|
17
|
+
const chainsConfigSets = getConfigItemSets(
|
|
18
|
+
chains,
|
|
19
|
+
(chains) => new Set(chains),
|
|
20
|
+
type
|
|
21
|
+
)
|
|
17
22
|
const filteredChains = type
|
|
18
23
|
? availableChains?.filter(
|
|
19
24
|
(chain) =>
|
|
20
|
-
|
|
21
|
-
isItemAllowed(chain.id, chains?.[type]) &&
|
|
25
|
+
isFormItemAllowed(chain.id, chainsConfigSets, type) &&
|
|
22
26
|
// Check against chain types if they are provided
|
|
23
27
|
(chainTypes?.includes(chain.chainType) ?? true)
|
|
24
28
|
)
|
|
25
|
-
: availableChains?.filter((chain) =>
|
|
29
|
+
: availableChains?.filter((chain) =>
|
|
30
|
+
isFormItemAllowed(chain.id, chainsConfigSets)
|
|
31
|
+
)
|
|
26
32
|
return filteredChains
|
|
27
33
|
}, [availableChains, chainTypes, chains, type])
|
|
28
34
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react'
|
|
2
|
+
import type { RouteObject } from 'react-router-dom'
|
|
3
|
+
import { useRoutes as useDOMRoutes } from 'react-router-dom'
|
|
4
|
+
import { ExpansionType } from '../types/widget'
|
|
5
|
+
import { navigationRoutes } from '../utils/navigationRoutes'
|
|
6
|
+
|
|
7
|
+
const routes: RouteObject[] = [
|
|
8
|
+
{
|
|
9
|
+
path: '/',
|
|
10
|
+
element: ExpansionType.Routes,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
path: navigationRoutes.fromToken,
|
|
14
|
+
element: ExpansionType.FromChain,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path: navigationRoutes.toToken,
|
|
18
|
+
element: ExpansionType.ToChain,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: '*',
|
|
22
|
+
element: null,
|
|
23
|
+
},
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
export const useExpansionRoutes = () => {
|
|
27
|
+
const element = useDOMRoutes(routes)
|
|
28
|
+
return (element?.props as PropsWithChildren)?.children as ExpansionType
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider'
|
|
2
|
+
import { ExpansionType, HiddenUI } from '../types/widget'
|
|
3
|
+
import { useExpansionRoutes } from './useExpansionRoutes'
|
|
4
|
+
import { useSwapOnly } from './useSwapOnly'
|
|
5
|
+
|
|
6
|
+
export const useHasChainExpansion = () => {
|
|
7
|
+
const { hiddenUI, subvariantOptions } = useWidgetConfig()
|
|
8
|
+
const swapOnly = useSwapOnly()
|
|
9
|
+
const expansionType = useExpansionRoutes()
|
|
10
|
+
|
|
11
|
+
const withChainExpansion =
|
|
12
|
+
(expansionType === ExpansionType.FromChain ||
|
|
13
|
+
expansionType === ExpansionType.ToChain) &&
|
|
14
|
+
!(swapOnly && expansionType === ExpansionType.ToChain) &&
|
|
15
|
+
!hiddenUI?.includes(HiddenUI.ChainSelect) &&
|
|
16
|
+
(subvariantOptions?.wide?.enableChainSidebar ?? true)
|
|
17
|
+
|
|
18
|
+
return [withChainExpansion, expansionType] as const
|
|
19
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChainType, isBatchingSupported } from '@lifi/sdk'
|
|
2
1
|
import type { ExtendedChain } from '@lifi/sdk'
|
|
2
|
+
import { ChainType, isBatchingSupported } from '@lifi/sdk'
|
|
3
3
|
import { useQuery } from '@tanstack/react-query'
|
|
4
4
|
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
|
|
5
5
|
import { getQueryKey } from '../utils/queries.js'
|
|
@@ -20,7 +20,10 @@ export function useIsBatchingSupported(
|
|
|
20
20
|
address,
|
|
21
21
|
],
|
|
22
22
|
queryFn: () => {
|
|
23
|
-
return isBatchingSupported({
|
|
23
|
+
return isBatchingSupported({
|
|
24
|
+
chainId: chain!.id,
|
|
25
|
+
skipReady: true,
|
|
26
|
+
})
|
|
24
27
|
},
|
|
25
28
|
enabled,
|
|
26
29
|
staleTime: 3_600_000,
|