@lifi/widget 3.25.0-beta.0 → 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 +1 -1
- package/dist/esm/components/RouteCard/RouteCard.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.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 +1 -3
- 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/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/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 +1 -1
- 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/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 +1 -1
- 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/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
package/src/i18n/vi.json
CHANGED
|
@@ -309,8 +309,9 @@
|
|
|
309
309
|
"to": "Đến",
|
|
310
310
|
"tokenOnChain": "{{tokenSymbol}} tại {{chainName}}",
|
|
311
311
|
"tokenOnChainAmount": "",
|
|
312
|
-
"tokenSearch": "
|
|
312
|
+
"tokenSearch": "",
|
|
313
313
|
"valueLoss": "Bạn sẽ mất",
|
|
314
|
+
"searchChain": "",
|
|
314
315
|
"searchChains": "",
|
|
315
316
|
"searchBridges": "",
|
|
316
317
|
"searchExchanges": ""
|
package/src/i18n/zh.json
CHANGED
|
@@ -309,8 +309,9 @@
|
|
|
309
309
|
"to": "到",
|
|
310
310
|
"tokenOnChain": "{{chainName}}链上的{{tokenSymbol}}",
|
|
311
311
|
"tokenOnChainAmount": "",
|
|
312
|
-
"tokenSearch": "
|
|
312
|
+
"tokenSearch": "",
|
|
313
313
|
"valueLoss": "资金损失",
|
|
314
|
+
"searchChain": "",
|
|
314
315
|
"searchChains": "搜索链",
|
|
315
316
|
"searchBridges": "搜索跨链桥",
|
|
316
317
|
"searchExchanges": "搜索交易所"
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type * from '@lifi/sdk'
|
|
2
|
-
export {
|
|
2
|
+
export { ChainId, ChainType, CoinKey } from '@lifi/sdk'
|
|
3
3
|
export { App as LiFiWidget } from './App.js'
|
|
4
4
|
export type { WidgetDrawer } from './AppDrawer.js'
|
|
5
5
|
export * from './components/ContractComponent/ItemPrice.js'
|
|
@@ -11,23 +11,23 @@ export { defaultMaxHeight } from './config/constants.js'
|
|
|
11
11
|
export * from './config/version.js'
|
|
12
12
|
export { useAvailableChains } from './hooks/useAvailableChains.js'
|
|
13
13
|
export { useWidgetEvents, widgetEvents } from './hooks/useWidgetEvents.js'
|
|
14
|
+
export * from './stores/bookmarks/types.js'
|
|
14
15
|
export * from './stores/form/types.js'
|
|
15
16
|
export { useFieldActions } from './stores/form/useFieldActions.js'
|
|
16
17
|
export { useFieldValues } from './stores/form/useFieldValues.js'
|
|
17
|
-
export * from './stores/bookmarks/types.js'
|
|
18
18
|
export { azureLightTheme } from './themes/azureLight.js'
|
|
19
|
+
export { createTheme } from './themes/createTheme.js'
|
|
19
20
|
export { jumperTheme } from './themes/jumper.js'
|
|
20
|
-
export { watermelonLightTheme } from './themes/watermelonLight.js'
|
|
21
|
-
export { windows95Theme } from './themes/windows95.js'
|
|
22
21
|
export * from './themes/palettes.js'
|
|
23
22
|
export * from './themes/types.js'
|
|
24
|
-
export {
|
|
23
|
+
export { watermelonLightTheme } from './themes/watermelonLight.js'
|
|
24
|
+
export { windows95Theme } from './themes/windows95.js'
|
|
25
25
|
export * from './types/events.js'
|
|
26
26
|
export type { TokenAmount } from './types/token.js'
|
|
27
27
|
export * from './types/widget.js'
|
|
28
|
-
export { getPriceImpact } from './utils/getPriceImpact.js'
|
|
29
|
-
export * from './utils/format.js'
|
|
30
|
-
export { percentFormatter } from './utils/percentFormatter.js'
|
|
31
28
|
export { compactNumberFormatter } from './utils/compactNumberFormatter.js'
|
|
32
29
|
export { currencyExtendedFormatter } from './utils/currencyExtendedFormatter.js'
|
|
30
|
+
export * from './utils/format.js'
|
|
31
|
+
export { getPriceImpact } from './utils/getPriceImpact.js'
|
|
33
32
|
export { navigationRoutes } from './utils/navigationRoutes.js'
|
|
33
|
+
export { percentFormatter } from './utils/percentFormatter.js'
|
|
@@ -38,7 +38,7 @@ export const RoutesPage: React.FC<BoxProps> = () => {
|
|
|
38
38
|
const headerAction = useMemo(
|
|
39
39
|
() => (
|
|
40
40
|
<ProgressToNextUpdate
|
|
41
|
-
updatedAt={dataUpdatedAt ||
|
|
41
|
+
updatedAt={dataUpdatedAt || Date.now()}
|
|
42
42
|
timeToUpdate={refetchTime}
|
|
43
43
|
isLoading={isFetching}
|
|
44
44
|
onClick={() => refetch()}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import type { ExtendedChain } from '@lifi/sdk'
|
|
2
|
-
import {
|
|
3
|
-
import { type FormEventHandler, useState } from 'react'
|
|
2
|
+
import { useCallback } from 'react'
|
|
4
3
|
import { useTranslation } from 'react-i18next'
|
|
5
4
|
import { useChainSelect } from '../../components/ChainSelect/useChainSelect.js'
|
|
6
|
-
import {
|
|
7
|
-
import { ListItemButton } from '../../components/ListItemButton.js'
|
|
8
|
-
import { ListItemText } from '../../components/ListItemText.js'
|
|
9
|
-
import { StickySearchInput } from '../../components/Search/SearchInput.js'
|
|
10
|
-
import { SearchList } from '../../components/Search/SearchInput.style.js'
|
|
11
|
-
import { SearchNotFound } from '../../components/Search/SearchNotFound.js'
|
|
5
|
+
import { SelectChainContent } from '../../components/Chains/SelectChainContent.js'
|
|
12
6
|
import { useTokenSelect } from '../../components/TokenList/useTokenSelect.js'
|
|
13
|
-
import { useDefaultElementId } from '../../hooks/useDefaultElementId.js'
|
|
14
7
|
import { useHeader } from '../../hooks/useHeader.js'
|
|
15
8
|
import { useNavigateBack } from '../../hooks/useNavigateBack.js'
|
|
16
|
-
import { useScrollableContainer } from '../../hooks/useScrollableContainer.js'
|
|
17
9
|
import type { SelectChainPageProps } from './types.js'
|
|
18
10
|
|
|
19
11
|
export const SelectChainPage: React.FC<SelectChainPageProps> = ({
|
|
@@ -21,75 +13,30 @@ export const SelectChainPage: React.FC<SelectChainPageProps> = ({
|
|
|
21
13
|
selectNativeToken,
|
|
22
14
|
}) => {
|
|
23
15
|
const { navigateBack } = useNavigateBack()
|
|
24
|
-
const {
|
|
16
|
+
const { setCurrentChain } = useChainSelect(formType)
|
|
25
17
|
const selectToken = useTokenSelect(formType, navigateBack)
|
|
26
|
-
const elementId = useDefaultElementId()
|
|
27
|
-
const scrollableContainer = useScrollableContainer(elementId)
|
|
28
18
|
|
|
29
19
|
const { t } = useTranslation()
|
|
30
20
|
|
|
31
21
|
useHeader(t('header.selectChain'))
|
|
32
22
|
|
|
33
|
-
const handleClick =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
chains ?? []
|
|
23
|
+
const handleClick = useCallback(
|
|
24
|
+
async (chain: ExtendedChain) => {
|
|
25
|
+
if (selectNativeToken) {
|
|
26
|
+
selectToken(chain.nativeToken.address, chain.id)
|
|
27
|
+
} else {
|
|
28
|
+
setCurrentChain(chain.id)
|
|
29
|
+
navigateBack()
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
[navigateBack, selectNativeToken, selectToken, setCurrentChain]
|
|
44
33
|
)
|
|
45
34
|
|
|
46
|
-
const handleSearchInputChange: FormEventHandler<HTMLInputElement> = (e) => {
|
|
47
|
-
const value = (e.target as HTMLInputElement).value
|
|
48
|
-
|
|
49
|
-
if (!value) {
|
|
50
|
-
setFilteredChains(chains ?? [])
|
|
51
|
-
} else {
|
|
52
|
-
setFilteredChains(
|
|
53
|
-
chains
|
|
54
|
-
? chains.filter((chain) =>
|
|
55
|
-
chain.name.toLowerCase().includes(value.toLowerCase())
|
|
56
|
-
)
|
|
57
|
-
: []
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (scrollableContainer) {
|
|
62
|
-
scrollableContainer.scrollTop = 0
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const debouncedSearchInputChange = debounce(handleSearchInputChange, 250)
|
|
67
|
-
|
|
68
35
|
return (
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{filteredChains.length ? (
|
|
75
|
-
<SearchList className="long-list">
|
|
76
|
-
{filteredChains.map((chain) => (
|
|
77
|
-
<ListItemButton key={chain.id} onClick={() => handleClick(chain)}>
|
|
78
|
-
<ListItemAvatar>
|
|
79
|
-
<Avatar src={chain.logoURI} alt={chain.name}>
|
|
80
|
-
{chain.name[0]}
|
|
81
|
-
</Avatar>
|
|
82
|
-
</ListItemAvatar>
|
|
83
|
-
<ListItemText primary={chain.name} />
|
|
84
|
-
</ListItemButton>
|
|
85
|
-
))}
|
|
86
|
-
</SearchList>
|
|
87
|
-
) : (
|
|
88
|
-
<SearchNotFound
|
|
89
|
-
message={t('info.message.emptyChainList')}
|
|
90
|
-
adjustForStickySearchInput
|
|
91
|
-
/>
|
|
92
|
-
)}
|
|
93
|
-
</FullPageContainer>
|
|
36
|
+
<SelectChainContent
|
|
37
|
+
inExpansion={false}
|
|
38
|
+
formType={formType}
|
|
39
|
+
onSelect={handleClick}
|
|
40
|
+
/>
|
|
94
41
|
)
|
|
95
42
|
}
|
|
@@ -5,10 +5,10 @@ import CheckBoxOutlined from '@mui/icons-material/CheckBoxOutlined'
|
|
|
5
5
|
import IndeterminateCheckBoxOutlined from '@mui/icons-material/IndeterminateCheckBoxOutlined'
|
|
6
6
|
import {
|
|
7
7
|
Avatar,
|
|
8
|
+
debounce,
|
|
8
9
|
IconButton,
|
|
9
10
|
ListItemAvatar,
|
|
10
11
|
Tooltip,
|
|
11
|
-
debounce,
|
|
12
12
|
useTheme,
|
|
13
13
|
} from '@mui/material'
|
|
14
14
|
import type { MouseEventHandler } from 'react'
|
|
@@ -24,7 +24,9 @@ export const SearchTokenInput = () => {
|
|
|
24
24
|
placeholder={t('main.tokenSearch')}
|
|
25
25
|
onChange={(e) => onChange((e.target as HTMLInputElement).value)}
|
|
26
26
|
onBlur={onBlur}
|
|
27
|
+
onClear={() => setFieldValue('tokenSearchFilter', '')}
|
|
27
28
|
value={value as string | undefined}
|
|
29
|
+
autoFocus
|
|
28
30
|
/>
|
|
29
31
|
)
|
|
30
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box } from '@mui/material'
|
|
2
|
-
import type { FC } from 'react'
|
|
2
|
+
import type { FC, RefObject } from 'react'
|
|
3
3
|
import { useRef } from 'react'
|
|
4
4
|
import { useTranslation } from 'react-i18next'
|
|
5
5
|
import { ChainSelect } from '../../components/ChainSelect/ChainSelect.js'
|
|
@@ -10,24 +10,22 @@ import { useListHeight } from '../../hooks/useListHeight.js'
|
|
|
10
10
|
import { useNavigateBack } from '../../hooks/useNavigateBack.js'
|
|
11
11
|
import { useScrollableOverflowHidden } from '../../hooks/useScrollableContainer.js'
|
|
12
12
|
import { useSwapOnly } from '../../hooks/useSwapOnly.js'
|
|
13
|
+
import { useWideVariant } from '../../hooks/useWideVariant.js'
|
|
13
14
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
|
|
14
|
-
import type { FormTypeProps } from '../../stores/form/types.js'
|
|
15
|
+
import type { FormType, FormTypeProps } from '../../stores/form/types.js'
|
|
15
16
|
import { HiddenUI } from '../../types/widget.js'
|
|
16
17
|
import { SearchTokenInput } from './SearchTokenInput.js'
|
|
17
18
|
|
|
18
19
|
export const SelectTokenPage: FC<FormTypeProps> = ({ formType }) => {
|
|
19
20
|
useScrollableOverflowHidden()
|
|
20
|
-
|
|
21
|
+
|
|
21
22
|
const headerRef = useRef<HTMLElement>(null)
|
|
22
|
-
const listParentRef = useRef<HTMLUListElement | null>(null)
|
|
23
|
-
const { listHeight, minListHeight } = useListHeight({
|
|
24
|
-
listParentRef,
|
|
25
|
-
headerRef,
|
|
26
|
-
})
|
|
27
23
|
|
|
28
24
|
const swapOnly = useSwapOnly()
|
|
29
25
|
|
|
30
|
-
const { subvariant, hiddenUI } = useWidgetConfig()
|
|
26
|
+
const { subvariant, hiddenUI, subvariantOptions } = useWidgetConfig()
|
|
27
|
+
const wideVariant = useWideVariant()
|
|
28
|
+
|
|
31
29
|
const { t } = useTranslation()
|
|
32
30
|
const title =
|
|
33
31
|
formType === 'from'
|
|
@@ -39,7 +37,9 @@ export const SelectTokenPage: FC<FormTypeProps> = ({ formType }) => {
|
|
|
39
37
|
useHeader(title)
|
|
40
38
|
|
|
41
39
|
const hideChainSelect =
|
|
42
|
-
(
|
|
40
|
+
(wideVariant && (subvariantOptions?.wide?.enableChainSidebar ?? true)) ||
|
|
41
|
+
(swapOnly && formType === 'to') ||
|
|
42
|
+
hiddenUI?.includes(HiddenUI.ChainSelect)
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<FullPageContainer disableGutters>
|
|
@@ -59,18 +59,40 @@ export const SelectTokenPage: FC<FormTypeProps> = ({ formType }) => {
|
|
|
59
59
|
<SearchTokenInput />
|
|
60
60
|
</Box>
|
|
61
61
|
</Box>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
parentRef={listParentRef}
|
|
69
|
-
height={listHeight}
|
|
70
|
-
onClick={navigateBack}
|
|
71
|
-
formType={formType}
|
|
72
|
-
/>
|
|
73
|
-
</Box>
|
|
62
|
+
<WrappedTokenList
|
|
63
|
+
// Rerender component if variant changes (since chains tiles change height)
|
|
64
|
+
key={hideChainSelect ? 'without-offset' : 'with-offset'}
|
|
65
|
+
headerRef={headerRef}
|
|
66
|
+
formType={formType}
|
|
67
|
+
/>
|
|
74
68
|
</FullPageContainer>
|
|
75
69
|
)
|
|
76
70
|
}
|
|
71
|
+
|
|
72
|
+
type WrappedTokenListProps = {
|
|
73
|
+
headerRef: RefObject<HTMLElement | null>
|
|
74
|
+
formType: FormType
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const WrappedTokenList = ({ headerRef, formType }: WrappedTokenListProps) => {
|
|
78
|
+
const { navigateBack } = useNavigateBack()
|
|
79
|
+
const listParentRef = useRef<HTMLUListElement | null>(null)
|
|
80
|
+
const { listHeight, minListHeight } = useListHeight({
|
|
81
|
+
listParentRef,
|
|
82
|
+
headerRef,
|
|
83
|
+
})
|
|
84
|
+
return (
|
|
85
|
+
<Box
|
|
86
|
+
sx={{
|
|
87
|
+
height: minListHeight,
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
<TokenList
|
|
91
|
+
parentRef={listParentRef}
|
|
92
|
+
height={listHeight}
|
|
93
|
+
onClick={navigateBack}
|
|
94
|
+
formType={formType}
|
|
95
|
+
/>
|
|
96
|
+
</Box>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
@@ -9,8 +9,8 @@ import { useTranslation } from 'react-i18next'
|
|
|
9
9
|
import { useNavigate } from 'react-router-dom'
|
|
10
10
|
import { AccountAvatar } from '../../components/Avatar/AccountAvatar.js'
|
|
11
11
|
import type { BottomSheetBase } from '../../components/BottomSheet/types.js'
|
|
12
|
-
import { ListItemButton } from '../../components/ListItem//ListItemButton.js'
|
|
13
12
|
import { ListItem } from '../../components/ListItem/ListItem.js'
|
|
13
|
+
import { ListItemButton } from '../../components/ListItem//ListItemButton.js'
|
|
14
14
|
import { Menu } from '../../components/Menu.js'
|
|
15
15
|
import { useExplorer } from '../../hooks/useExplorer.js'
|
|
16
16
|
import { useHeader } from '../../hooks/useHeader.js'
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Alert,
|
|
3
|
+
alertClasses,
|
|
3
4
|
Box,
|
|
4
5
|
IconButton,
|
|
5
|
-
List,
|
|
6
|
-
Typography,
|
|
7
|
-
alertClasses,
|
|
8
6
|
inputBaseClasses,
|
|
7
|
+
List,
|
|
9
8
|
styled,
|
|
9
|
+
Typography,
|
|
10
10
|
} from '@mui/material'
|
|
11
11
|
import { ButtonTertiary } from '../../components/ButtonTertiary.js'
|
|
12
12
|
import { InputCard } from '../../components/Card/InputCard.js'
|
|
@@ -37,9 +37,9 @@ export const SettingCardExpandable: React.FC<
|
|
|
37
37
|
</CardTitleContainer>
|
|
38
38
|
{!expanded && value}
|
|
39
39
|
</CardRowButton>
|
|
40
|
+
{/** biome-ignore lint/a11y/useSemanticElements: allowed in react */}
|
|
40
41
|
<Collapse
|
|
41
42
|
id={collapseId}
|
|
42
|
-
// biome-ignore lint/a11y/useSemanticElements:
|
|
43
43
|
role="region"
|
|
44
44
|
aria-labelledby={buttonId}
|
|
45
45
|
in={expanded}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Percent from '@mui/icons-material/Percent'
|
|
2
2
|
import WarningRounded from '@mui/icons-material/WarningRounded'
|
|
3
|
-
import { Box,
|
|
3
|
+
import { Box, debounce, Typography } from '@mui/material'
|
|
4
4
|
import type { ChangeEventHandler, FocusEventHandler } from 'react'
|
|
5
5
|
import { useCallback, useMemo, useRef, useState } from 'react'
|
|
6
6
|
import { useTranslation } from 'react-i18next'
|
|
@@ -2,17 +2,16 @@ import type { FullStatusData } from '@lifi/sdk'
|
|
|
2
2
|
import { Box, List } from '@mui/material'
|
|
3
3
|
import { useVirtualizer } from '@tanstack/react-virtual'
|
|
4
4
|
import type React from 'react'
|
|
5
|
-
import { useRef } from 'react'
|
|
5
|
+
import { useCallback, useRef } from 'react'
|
|
6
6
|
import { useTranslation } from 'react-i18next'
|
|
7
7
|
import { PageContainer } from '../../components/PageContainer.js'
|
|
8
8
|
import { useHeader } from '../../hooks/useHeader.js'
|
|
9
|
-
import { useTransactionHistory } from '../../hooks/useTransactionHistory.js'
|
|
10
|
-
|
|
11
9
|
import { useListHeight } from '../../hooks/useListHeight.js'
|
|
10
|
+
import { useTransactionHistory } from '../../hooks/useTransactionHistory.js'
|
|
11
|
+
import { minTransactionListHeight } from './constants.js'
|
|
12
12
|
import { TransactionHistoryEmpty } from './TransactionHistoryEmpty.js'
|
|
13
13
|
import { TransactionHistoryItem } from './TransactionHistoryItem.js'
|
|
14
14
|
import { TransactionHistoryItemSkeleton } from './TransactionHistorySkeleton.js'
|
|
15
|
-
import { minTransactionListHeight } from './constants.js'
|
|
16
15
|
|
|
17
16
|
export const TransactionHistoryPage: React.FC = () => {
|
|
18
17
|
// Parent ref and useVirtualizer should be in one file to avoid blank page (0 virtual items) issue
|
|
@@ -26,14 +25,20 @@ export const TransactionHistoryPage: React.FC = () => {
|
|
|
26
25
|
listParentRef: parentRef,
|
|
27
26
|
})
|
|
28
27
|
|
|
28
|
+
const getItemKey = useCallback(
|
|
29
|
+
(index: number) => {
|
|
30
|
+
return `${(transactions[index] as FullStatusData).transactionId}-${index}`
|
|
31
|
+
},
|
|
32
|
+
[transactions]
|
|
33
|
+
)
|
|
34
|
+
|
|
29
35
|
const { getVirtualItems, getTotalSize } = useVirtualizer({
|
|
30
36
|
count: transactions.length,
|
|
31
|
-
overscan:
|
|
37
|
+
overscan: 3,
|
|
32
38
|
paddingEnd: 12,
|
|
33
39
|
getScrollElement: () => parentRef.current,
|
|
34
40
|
estimateSize: () => 186,
|
|
35
|
-
getItemKey
|
|
36
|
-
`${(transactions[index] as FullStatusData).transactionId}-${index}`,
|
|
41
|
+
getItemKey,
|
|
37
42
|
})
|
|
38
43
|
|
|
39
44
|
if (!transactions.length && !isLoading) {
|
|
@@ -33,7 +33,7 @@ export const RouteTracker = ({
|
|
|
33
33
|
* This allows us to query the route using the same tool each time we refresh.
|
|
34
34
|
* The observable and reviewable routes can be the same when we first enter the review page.
|
|
35
35
|
*/
|
|
36
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies:
|
|
36
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: run only when currentRoute changes
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
if (
|
|
39
39
|
observableRouteIdRef.current &&
|
|
@@ -57,7 +57,7 @@ export const RouteTracker = ({
|
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<ProgressToNextUpdate
|
|
60
|
-
updatedAt={dataUpdatedAt ||
|
|
60
|
+
updatedAt={dataUpdatedAt || Date.now()}
|
|
61
61
|
timeToUpdate={refetchTime}
|
|
62
62
|
isLoading={isFetching}
|
|
63
63
|
onClick={handleRefetch}
|
|
@@ -7,7 +7,7 @@ import { useSettings } from '../../stores/settings/useSettings.js'
|
|
|
7
7
|
import { compactNumberFormatter } from '../../utils/compactNumberFormatter.js'
|
|
8
8
|
import { currencyExtendedFormatter } from '../../utils/currencyExtendedFormatter.js'
|
|
9
9
|
import { deepMerge } from '../../utils/deepMerge.js'
|
|
10
|
-
import {
|
|
10
|
+
import { getConfigItemSets, isItemAllowedForSets } from '../../utils/item.js'
|
|
11
11
|
import { percentFormatter } from '../../utils/percentFormatter.js'
|
|
12
12
|
import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
|
|
13
13
|
import type { LanguageKey, LanguageTranslationResources } from './types.js'
|
|
@@ -19,16 +19,22 @@ export const I18nProvider: React.FC<React.PropsWithChildren> = ({
|
|
|
19
19
|
const { language } = useSettings(['language'])
|
|
20
20
|
|
|
21
21
|
const i18n = useMemo(() => {
|
|
22
|
+
const languagesConfigSets = getConfigItemSets(
|
|
23
|
+
languages,
|
|
24
|
+
(languages) => new Set(languages)
|
|
25
|
+
)
|
|
22
26
|
let resources = (Object.keys(supportedLanguages) as LanguageKey[])
|
|
23
|
-
.filter((lng) =>
|
|
27
|
+
.filter((lng) => isItemAllowedForSets(lng, languagesConfigSets))
|
|
24
28
|
.reduce((resources, lng) => {
|
|
25
29
|
resources[lng] = {
|
|
26
30
|
translation: languageResources?.[lng]
|
|
27
31
|
? (deepMerge(
|
|
32
|
+
// biome-ignore lint/performance/noDynamicNamespaceImportAccess: TODO: make it dynamic
|
|
28
33
|
supportedLanguages[lng],
|
|
29
34
|
languageResources[lng]
|
|
30
|
-
) as
|
|
31
|
-
:
|
|
35
|
+
) as LanguageTranslationResources)
|
|
36
|
+
: // biome-ignore lint/performance/noDynamicNamespaceImportAccess: TODO: make it dynamic
|
|
37
|
+
supportedLanguages[lng],
|
|
32
38
|
}
|
|
33
39
|
return resources
|
|
34
40
|
}, {} as LanguageTranslationResources)
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
QueryClientContext as TanstackQueryClientContext,
|
|
3
3
|
QueryClientProvider as TanstackQueryClientProvider,
|
|
4
4
|
} from '@tanstack/react-query'
|
|
5
|
-
import { useContext } from 'react'
|
|
6
5
|
import type { PropsWithChildren } from 'react'
|
|
6
|
+
import { useContext } from 'react'
|
|
7
7
|
import { queryClient } from '../config/queryClient'
|
|
8
8
|
|
|
9
9
|
export const QueryClientProvider: React.FC<PropsWithChildren> = ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getConnectorClient as getBigmiConnectorClient } from '@bigmi/client'
|
|
2
2
|
import { useConfig as useBigmiConfig } from '@bigmi/react'
|
|
3
3
|
import type { SDKProvider } from '@lifi/sdk'
|
|
4
|
-
import { ChainType, EVM, Solana, Sui, UTXO
|
|
4
|
+
import { ChainType, config, EVM, Solana, Sui, UTXO } from '@lifi/sdk'
|
|
5
5
|
import { useCurrentWallet } from '@mysten/dapp-kit'
|
|
6
6
|
import type { SignerWalletAdapter } from '@solana/wallet-adapter-base'
|
|
7
7
|
import { useWallet } from '@solana/wallet-adapter-react'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChainId } from '@lifi/sdk'
|
|
2
2
|
import {
|
|
3
|
+
createNetworkConfig,
|
|
3
4
|
SuiClientProvider,
|
|
4
5
|
WalletProvider,
|
|
5
|
-
createNetworkConfig,
|
|
6
6
|
} from '@mysten/dapp-kit'
|
|
7
7
|
import { getFullnodeUrl } from '@mysten/sui/client'
|
|
8
8
|
import { type FC, type PropsWithChildren, useMemo } from 'react'
|
|
@@ -5,8 +5,8 @@ import { useTranslation } from 'react-i18next'
|
|
|
5
5
|
import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
|
|
6
6
|
import { EVMProvider } from './EVMProvider.js'
|
|
7
7
|
import { SDKProviders } from './SDKProviders.js'
|
|
8
|
-
import { SVMProvider } from './SVMProvider.js'
|
|
9
8
|
import { SuiProvider } from './SuiProvider.js'
|
|
9
|
+
import { SVMProvider } from './SVMProvider.js'
|
|
10
10
|
import { UTXOProvider } from './UTXOProvider.js'
|
|
11
11
|
import { useExternalWalletProvider } from './useExternalWalletProvider.js'
|
|
12
12
|
|
|
@@ -2,8 +2,8 @@ import { ChainType } from '@lifi/sdk'
|
|
|
2
2
|
import { useContext, useMemo } from 'react'
|
|
3
3
|
import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
|
|
4
4
|
import { EVMExternalContext } from './EVMExternalContext.js'
|
|
5
|
-
import { SVMExternalContext } from './SVMExternalContext.js'
|
|
6
5
|
import { SuiExternalContext } from './SuiExternalContext.js'
|
|
6
|
+
import { SVMExternalContext } from './SVMExternalContext.js'
|
|
7
7
|
import { UTXOExternalContext } from './UTXOExternalContext.js'
|
|
8
8
|
|
|
9
9
|
interface ExternalWalletProvider {
|
|
@@ -4,7 +4,7 @@ import type { UseBoundStoreWithEqualityFn } from 'zustand/traditional'
|
|
|
4
4
|
import { useChains } from '../../hooks/useChains.js'
|
|
5
5
|
import { useExternalWalletProvider } from '../../providers/WalletProvider/useExternalWalletProvider.js'
|
|
6
6
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
|
|
7
|
-
import {
|
|
7
|
+
import { getConfigItemSets, isItemAllowedForSets } from '../../utils/item.js'
|
|
8
8
|
import type { FormType } from '../form/types.js'
|
|
9
9
|
import { useFieldActions } from '../form/useFieldActions.js'
|
|
10
10
|
import type { PersistStoreProviderProps } from '../types.js'
|
|
@@ -40,9 +40,14 @@ export function ChainOrderStoreProvider({
|
|
|
40
40
|
const configChainIds = chainsConfig?.[key]
|
|
41
41
|
const isFromKey = key === 'from'
|
|
42
42
|
|
|
43
|
+
// Convert configChainIds to Sets for O(1) lookup
|
|
44
|
+
const configChainIdsSet = getConfigItemSets(
|
|
45
|
+
configChainIds,
|
|
46
|
+
(chainIds) => new Set(chainIds)
|
|
47
|
+
)
|
|
43
48
|
const filteredChains = chains.filter((chain) => {
|
|
44
|
-
const passesChainsConfigFilter =
|
|
45
|
-
?
|
|
49
|
+
const passesChainsConfigFilter = configChainIdsSet
|
|
50
|
+
? isItemAllowedForSets(chain.id, configChainIdsSet)
|
|
46
51
|
: true
|
|
47
52
|
// If the integrator uses external wallet management and has not opted in for partial wallet management,
|
|
48
53
|
// restrict the displayed chains to those compatible with external wallet management.
|
|
@@ -2,9 +2,9 @@ import type { PropsWithChildren } from 'react'
|
|
|
2
2
|
import { useMemo, useRef } from 'react'
|
|
3
3
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'
|
|
4
4
|
import type { FormRef, ToAddress } from '../../types/widget.js'
|
|
5
|
+
import { createFormStore, formDefaultValues } from './createFormStore.js'
|
|
5
6
|
import { FormStoreContext } from './FormStoreContext.js'
|
|
6
7
|
import { FormUpdater } from './FormUpdater.js'
|
|
7
|
-
import { createFormStore, formDefaultValues } from './createFormStore.js'
|
|
8
8
|
import type { DefaultValues, FormStoreStore } from './types.js'
|
|
9
9
|
import { useFormRef } from './useFormRef.js'
|
|
10
10
|
|
|
@@ -5,13 +5,19 @@ import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.j
|
|
|
5
5
|
import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js'
|
|
6
6
|
import { formDefaultValues } from '../../stores/form/createFormStore.js'
|
|
7
7
|
import { useSendToWalletActions } from '../../stores/settings/useSendToWalletStore.js'
|
|
8
|
+
import { isItemAllowed } from '../../utils/item.js'
|
|
8
9
|
import type { DefaultValues } from './types.js'
|
|
9
10
|
import { useFieldActions } from './useFieldActions.js'
|
|
10
11
|
|
|
11
12
|
export const FormUpdater: React.FC<{
|
|
12
13
|
reactiveFormValues: Partial<DefaultValues>
|
|
13
14
|
}> = ({ reactiveFormValues }) => {
|
|
14
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
fromChain,
|
|
17
|
+
toChain,
|
|
18
|
+
toAddress,
|
|
19
|
+
chains: configChains,
|
|
20
|
+
} = useWidgetConfig()
|
|
15
21
|
const { account } = useAccount()
|
|
16
22
|
const { chains } = useChains()
|
|
17
23
|
const { setSendToWallet } = useSendToWalletActions()
|
|
@@ -21,21 +27,47 @@ export const FormUpdater: React.FC<{
|
|
|
21
27
|
|
|
22
28
|
// Set wallet chain as default if no chains are provided by config and if they were not changed during widget usage
|
|
23
29
|
useEffect(() => {
|
|
24
|
-
const
|
|
25
|
-
account.chainId &&
|
|
30
|
+
const fromChainAllowed =
|
|
31
|
+
account.chainId &&
|
|
32
|
+
chains?.some(
|
|
33
|
+
(chain) =>
|
|
34
|
+
chain.id === account.chainId &&
|
|
35
|
+
isItemAllowed(chain.id, configChains?.from)
|
|
36
|
+
)
|
|
37
|
+
const toChainAllowed =
|
|
38
|
+
account.chainId &&
|
|
39
|
+
chains?.some(
|
|
40
|
+
(chain) =>
|
|
41
|
+
chain.id === account.chainId &&
|
|
42
|
+
isItemAllowed(chain.id, configChains?.to)
|
|
43
|
+
)
|
|
26
44
|
|
|
27
|
-
if (
|
|
45
|
+
if (
|
|
46
|
+
!account.isConnected ||
|
|
47
|
+
!account.chainId ||
|
|
48
|
+
(!fromChainAllowed && !toChainAllowed)
|
|
49
|
+
) {
|
|
28
50
|
return
|
|
29
51
|
}
|
|
30
52
|
|
|
31
|
-
if (
|
|
53
|
+
if (
|
|
54
|
+
!fromChain &&
|
|
55
|
+
!isTouched('fromChain') &&
|
|
56
|
+
!isTouched('fromToken') &&
|
|
57
|
+
fromChainAllowed
|
|
58
|
+
) {
|
|
32
59
|
resetField('fromChain', { defaultValue: account.chainId })
|
|
33
60
|
setFieldValue('fromToken', '')
|
|
34
61
|
if (isTouched('fromAmount')) {
|
|
35
62
|
setFieldValue('fromAmount', '')
|
|
36
63
|
}
|
|
37
64
|
}
|
|
38
|
-
if (
|
|
65
|
+
if (
|
|
66
|
+
!toChain &&
|
|
67
|
+
!isTouched('toChain') &&
|
|
68
|
+
!isTouched('toToken') &&
|
|
69
|
+
toChainAllowed
|
|
70
|
+
) {
|
|
39
71
|
resetField('toChain', { defaultValue: account.chainId })
|
|
40
72
|
setFieldValue('toToken', '')
|
|
41
73
|
}
|
|
@@ -48,6 +80,8 @@ export const FormUpdater: React.FC<{
|
|
|
48
80
|
isTouched,
|
|
49
81
|
resetField,
|
|
50
82
|
setFieldValue,
|
|
83
|
+
configChains?.from,
|
|
84
|
+
configChains?.to,
|
|
51
85
|
])
|
|
52
86
|
|
|
53
87
|
// Makes widget config options reactive to changes
|