@lifi/widget 2.9.3 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AppProvider.js +2 -2
- package/AppRoutes.js +75 -67
- package/cjs/AppProvider.js +1 -1
- package/cjs/AppRoutes.js +74 -66
- package/cjs/components/ActiveTransactions/ActiveTransactionItem.js +1 -5
- package/cjs/components/ActiveTransactions/ActiveTransactions.js +2 -2
- package/cjs/components/AmountInput/AmountInputEndAdornment.js +9 -10
- package/cjs/components/AmountInput/FormPriceHelperText.js +1 -1
- package/cjs/components/BaseTransactionButton/BaseTransactionButton.js +5 -4
- package/cjs/components/Card/CardLabel.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.js +8 -5
- package/cjs/components/ChainSelect/useChainSelect.js +21 -2
- package/cjs/components/GasMessage/GasMessage.style.js +3 -6
- package/cjs/components/GasMessage/GasSufficiencyMessage.js +2 -1
- package/cjs/components/Header/Header.style.d.ts +8 -0
- package/cjs/components/Header/Header.style.js +16 -1
- package/cjs/components/Header/NavigationHeader.d.ts +1 -0
- package/cjs/components/Header/NavigationHeader.js +15 -8
- package/cjs/components/Header/NavigationTabs.js +2 -2
- package/cjs/components/Header/SettingsButton.d.ts +1 -0
- package/cjs/components/Header/SettingsButton.js +25 -0
- package/cjs/components/Header/SettingsButton.style.d.ts +11 -0
- package/cjs/components/Header/SettingsButton.style.js +43 -0
- package/cjs/components/Header/WalletHeader.js +11 -24
- package/cjs/components/Header/WalletMenu.d.ts +3 -1
- package/cjs/components/Header/WalletMenu.js +58 -24
- package/cjs/components/Header/WalletMenu.style.d.ts +1 -0
- package/cjs/components/Header/WalletMenu.style.js +27 -0
- package/cjs/components/Insurance/InsuranceCollapsed.js +1 -1
- package/cjs/components/NFT/NFT.js +3 -1
- package/cjs/components/NFT/types.d.ts +1 -1
- package/cjs/components/PoweredBy/PoweredBy.js +2 -1
- package/cjs/components/RouteCard/RouteCard.js +3 -3
- package/cjs/components/RouteCard/RouteCardEssentials.js +2 -1
- package/cjs/components/RouteCard/utils.d.ts +2 -3
- package/cjs/components/RouteCard/utils.js +4 -9
- package/cjs/components/SendToWallet/SendToWallet.js +24 -21
- package/cjs/components/SendToWallet/SendToWalletButton.js +3 -2
- package/{pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts → cjs/components/SettingsListItemButton.d.ts} +1 -1
- package/cjs/components/SettingsListItemButton.js +8 -0
- package/cjs/components/Step/DestinationWalletAddress.d.ts +2 -2
- package/cjs/components/Step/GasStepProcess.d.ts +2 -2
- package/cjs/components/Step/Step.d.ts +2 -2
- package/cjs/components/Step/Step.js +1 -1
- package/cjs/components/Step/StepList.d.ts +2 -2
- package/cjs/components/Step/StepList.js +4 -4
- package/cjs/components/Step/StepProcess.d.ts +2 -2
- package/cjs/components/Step/StepTimer.d.ts +2 -2
- package/cjs/components/StepActions/StepActions.d.ts +3 -3
- package/cjs/components/StepActions/StepActions.js +11 -14
- package/cjs/components/StepActions/types.d.ts +2 -2
- package/cjs/components/{Header/NavigationTabs.style.d.ts → Tabs/Tabs.style.d.ts} +2 -2
- package/cjs/components/{Header/NavigationTabs.style.js → Tabs/Tabs.style.js} +9 -31
- package/cjs/components/Tabs/index.d.ts +1 -0
- package/cjs/{providers/SDKProvider → components/Tabs}/index.js +1 -1
- package/cjs/components/Token/Token.d.ts +3 -3
- package/cjs/components/Token/Token.js +5 -5
- package/cjs/components/TokenList/TokenList.js +2 -2
- package/cjs/components/TokenList/TokenListItem.js +9 -5
- package/cjs/components/TokenList/TokenNotFound.js +1 -1
- package/cjs/components/TokenList/VirtualizedTokenList.js +2 -1
- package/cjs/config/queryClient.js +0 -4
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +7 -1
- package/cjs/hooks/index.js +7 -1
- package/cjs/hooks/useAccount.d.ts +31 -0
- package/cjs/hooks/useAccount.js +53 -0
- package/cjs/hooks/useAvailableChains.d.ts +6 -0
- package/cjs/hooks/useAvailableChains.js +36 -0
- package/cjs/hooks/useChain.js +3 -6
- package/cjs/hooks/useChains.d.ts +1 -1
- package/cjs/hooks/useChains.js +7 -38
- package/cjs/hooks/useFromTokenSufficiency.d.ts +3 -3
- package/cjs/hooks/useFromTokenSufficiency.js +39 -41
- package/cjs/hooks/useGasRecommendation.d.ts +2 -2
- package/cjs/hooks/useGasRecommendation.js +23 -18
- package/cjs/hooks/useGasRefuel.js +18 -11
- package/cjs/hooks/useGasSufficiency.d.ts +6 -7
- package/cjs/hooks/useGasSufficiency.js +68 -71
- package/cjs/hooks/useLanguages.d.ts +6 -0
- package/cjs/hooks/useLanguages.js +28 -0
- package/cjs/hooks/useProcessMessage.d.ts +3 -3
- package/cjs/hooks/useProcessMessage.js +32 -28
- package/cjs/hooks/useRequiredToAddress.d.ts +1 -0
- package/cjs/hooks/useRequiredToAddress.js +19 -0
- package/cjs/hooks/useRouteExecution.d.ts +2 -2
- package/cjs/hooks/useRouteExecution.js +44 -58
- package/cjs/hooks/useRoutes.d.ts +1 -1
- package/cjs/hooks/useRoutes.js +128 -113
- package/cjs/hooks/useSettingMonitor.d.ts +11 -0
- package/cjs/hooks/useSettingMonitor.js +57 -0
- package/cjs/hooks/useTokenAddressBalance.d.ts +1 -1
- package/cjs/hooks/useTokenBalance.d.ts +5 -3
- package/cjs/hooks/useTokenBalance.js +77 -47
- package/cjs/hooks/useTokenBalances.d.ts +3 -3
- package/cjs/hooks/useTokenBalances.js +34 -24
- package/cjs/hooks/useTokenSearch.js +18 -17
- package/cjs/hooks/useTokens.d.ts +2 -1
- package/cjs/hooks/useTokens.js +18 -15
- package/cjs/hooks/useTools.d.ts +1 -1
- package/cjs/hooks/useTools.js +12 -11
- package/cjs/hooks/useTransactionDetails.d.ts +4 -0
- package/cjs/hooks/useTransactionDetails.js +56 -0
- package/cjs/hooks/useTransactionHistory.d.ts +5 -0
- package/cjs/hooks/useTransactionHistory.js +39 -0
- package/cjs/i18n/en.json +18 -9
- package/cjs/i18n/fr.json +7 -4
- package/cjs/i18n/pt.json +7 -4
- package/cjs/i18n/tr.json +7 -4
- package/cjs/i18n/uk.json +7 -4
- package/cjs/i18n/zh.json +7 -4
- package/cjs/icons/index.d.ts +1 -3
- package/cjs/icons/index.js +1 -3
- package/cjs/icons/lifi.d.ts +1 -0
- package/cjs/icons/lifi.js +4 -0
- package/cjs/index.d.ts +2 -3
- package/cjs/index.js +4 -4
- package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +2 -2
- package/cjs/pages/LanguagesPage/LanguagesPage.d.ts +2 -0
- package/cjs/pages/LanguagesPage/LanguagesPage.js +22 -0
- package/cjs/pages/LanguagesPage/index.d.ts +1 -0
- package/cjs/pages/LanguagesPage/index.js +17 -0
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +15 -5
- package/cjs/pages/SelectWalletPage/EVMListItemButton.d.ts +8 -0
- package/cjs/pages/SelectWalletPage/EVMListItemButton.js +40 -0
- package/cjs/pages/SelectWalletPage/SVMListItemButton.d.ts +6 -0
- package/cjs/pages/SelectWalletPage/SVMListItemButton.js +34 -0
- package/cjs/pages/SelectWalletPage/SelectWalletPage.js +31 -32
- package/cjs/pages/SelectWalletPage/utils.d.ts +3 -0
- package/cjs/pages/SelectWalletPage/utils.js +21 -0
- package/{pages/SettingsPage/EnabledToolsButton.d.ts → cjs/pages/SettingsPage/BridgeAndExchangeSettings.d.ts} +1 -1
- package/cjs/pages/SettingsPage/BridgeAndExchangeSettings.js +36 -0
- package/cjs/pages/SettingsPage/GasPriceSettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/GasPriceSettings.js +21 -0
- package/cjs/pages/SettingsPage/LanguageSetting.d.ts +2 -0
- package/cjs/pages/SettingsPage/LanguageSetting.js +26 -0
- package/cjs/pages/SettingsPage/ResetSettingsButton.js +3 -30
- package/cjs/pages/SettingsPage/RoutePrioritySettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/RoutePrioritySettings.js +25 -0
- package/cjs/pages/SettingsPage/SendToWalletOptionSetting.d.ts +1 -0
- package/cjs/pages/SettingsPage/{ShowDestinationWallet.js → SendToWalletOptionSetting.js} +6 -9
- package/cjs/pages/SettingsPage/SettingsCard/BadgedValue.d.ts +8 -0
- package/cjs/pages/SettingsPage/SettingsCard/BadgedValue.js +7 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.d.ts +2 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.js +11 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +19 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.style.js +53 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardButton.d.ts +7 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardButton.js +8 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +7 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +16 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +6 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingsAccordian.js +36 -0
- package/cjs/pages/SettingsPage/SettingsCard/index.d.ts +6 -0
- package/cjs/pages/SettingsPage/SettingsCard/index.js +22 -0
- package/cjs/pages/SettingsPage/SettingsCard/types.d.ts +5 -0
- package/cjs/pages/SettingsPage/SettingsPage.js +9 -8
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.js +51 -0
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +16 -0
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +74 -0
- package/cjs/pages/SettingsPage/SlippageSettings/index.d.ts +1 -0
- package/cjs/pages/SettingsPage/SlippageSettings/index.js +17 -0
- package/cjs/pages/SettingsPage/ThemeSettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/ThemeSettings.js +39 -0
- package/cjs/pages/TransactionDetailsPage/ContactSupportButton.js +2 -2
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsPage.js +33 -28
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.d.ts +1 -0
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +31 -0
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts +4 -2
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryItem.js +34 -7
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js +21 -22
- package/cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -0
- package/cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +26 -0
- package/cjs/pages/TransactionHistoryPage/constants.d.ts +1 -0
- package/cjs/pages/TransactionHistoryPage/constants.js +4 -0
- package/cjs/pages/TransactionPage/ExchangeRateBottomSheet.js +11 -10
- package/cjs/pages/TransactionPage/StartTransactionButton.js +2 -2
- package/cjs/pages/TransactionPage/StatusBottomSheet.js +12 -8
- package/cjs/pages/TransactionPage/TransactionPage.js +1 -1
- package/cjs/providers/FormProvider/FormUpdater.js +4 -4
- package/cjs/providers/I18nProvider/I18nProvider.js +3 -7
- package/cjs/providers/I18nProvider/types.d.ts +4 -3
- package/cjs/providers/WalletProvider/EVMProvider.d.ts +3 -0
- package/cjs/providers/WalletProvider/EVMProvider.js +79 -0
- package/cjs/providers/WalletProvider/SDKProviders.d.ts +1 -0
- package/cjs/providers/WalletProvider/SDKProviders.js +31 -0
- package/cjs/providers/WalletProvider/SolanaProvider.d.ts +3 -0
- package/cjs/providers/WalletProvider/SolanaProvider.js +35 -0
- package/cjs/providers/WalletProvider/WalletProvider.d.ts +1 -15
- package/cjs/providers/WalletProvider/WalletProvider.js +5 -183
- package/cjs/providers/WalletProvider/index.d.ts +1 -1
- package/cjs/providers/WalletProvider/index.js +1 -1
- package/cjs/providers/WalletProvider/utils.d.ts +3 -0
- package/cjs/providers/WalletProvider/utils.js +25 -0
- package/cjs/providers/WidgetProvider/WidgetProvider.js +51 -35
- package/cjs/providers/index.d.ts +0 -1
- package/cjs/providers/index.js +0 -1
- package/cjs/stores/chains/ChainOrderStore.js +24 -0
- package/cjs/stores/header/useHeaderStore.d.ts +1 -1
- package/cjs/stores/header/useHeaderStore.js +2 -2
- package/cjs/stores/routes/createRouteExecutionStore.js +6 -60
- package/cjs/stores/routes/index.d.ts +0 -1
- package/cjs/stores/routes/index.js +0 -1
- package/cjs/stores/routes/types.d.ts +2 -2
- package/cjs/stores/routes/utils.d.ts +8 -8
- package/cjs/stores/routes/utils.js +7 -5
- package/cjs/stores/settings/useSettingsStore.js +2 -4
- package/cjs/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/cjs/stores/settings/useSplitSubvariantStore.js +2 -2
- package/cjs/types/events.d.ts +6 -5
- package/cjs/types/events.js +1 -1
- package/cjs/types/widget.d.ts +7 -14
- package/cjs/utils/colors.d.ts +3 -0
- package/cjs/utils/colors.js +13 -1
- package/cjs/utils/converters.d.ts +3 -0
- package/cjs/utils/converters.js +172 -0
- package/cjs/utils/format.d.ts +1 -1
- package/cjs/utils/format.js +5 -12
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.js +1 -0
- package/cjs/utils/navigationRoutes.d.ts +1 -0
- package/cjs/utils/navigationRoutes.js +3 -1
- package/cjs/utils/svm.d.ts +1 -0
- package/cjs/utils/svm.js +14 -0
- package/components/ActiveTransactions/ActiveTransactionItem.js +1 -5
- package/components/ActiveTransactions/ActiveTransactions.js +2 -2
- package/components/AmountInput/AmountInputEndAdornment.js +10 -11
- package/components/AmountInput/FormPriceHelperText.js +1 -1
- package/components/BaseTransactionButton/BaseTransactionButton.js +6 -5
- package/components/Card/CardLabel.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.js +8 -5
- package/components/ChainSelect/useChainSelect.js +22 -3
- package/components/GasMessage/GasMessage.style.js +3 -6
- package/components/GasMessage/GasSufficiencyMessage.js +2 -1
- package/components/Header/Header.style.d.ts +8 -0
- package/components/Header/Header.style.js +16 -1
- package/components/Header/NavigationHeader.d.ts +1 -0
- package/components/Header/NavigationHeader.js +16 -10
- package/components/Header/NavigationTabs.js +3 -3
- package/components/Header/SettingsButton.d.ts +1 -0
- package/components/Header/SettingsButton.js +21 -0
- package/components/Header/SettingsButton.style.d.ts +11 -0
- package/components/Header/SettingsButton.style.js +40 -0
- package/components/Header/WalletHeader.js +15 -28
- package/components/Header/WalletMenu.d.ts +3 -1
- package/components/Header/WalletMenu.js +58 -25
- package/components/Header/WalletMenu.style.d.ts +1 -0
- package/components/Header/WalletMenu.style.js +24 -0
- package/components/Insurance/InsuranceCollapsed.js +1 -1
- package/components/NFT/NFT.js +3 -1
- package/components/NFT/types.d.ts +1 -1
- package/components/PoweredBy/PoweredBy.js +2 -1
- package/components/RouteCard/RouteCard.js +3 -3
- package/components/RouteCard/RouteCardEssentials.js +2 -1
- package/components/RouteCard/utils.d.ts +2 -3
- package/components/RouteCard/utils.js +4 -9
- package/components/SendToWallet/SendToWallet.js +26 -23
- package/components/SendToWallet/SendToWalletButton.js +5 -4
- package/{cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts → components/SettingsListItemButton.d.ts} +1 -1
- package/components/SettingsListItemButton.js +5 -0
- package/components/Step/DestinationWalletAddress.d.ts +2 -2
- package/components/Step/GasStepProcess.d.ts +2 -2
- package/components/Step/Step.d.ts +2 -2
- package/components/Step/Step.js +2 -2
- package/components/Step/StepList.d.ts +2 -2
- package/components/Step/StepList.js +4 -4
- package/components/Step/StepProcess.d.ts +2 -2
- package/components/Step/StepTimer.d.ts +2 -2
- package/components/StepActions/StepActions.d.ts +3 -3
- package/components/StepActions/StepActions.js +12 -15
- package/components/StepActions/types.d.ts +2 -2
- package/components/{Header/NavigationTabs.style.d.ts → Tabs/Tabs.style.d.ts} +2 -2
- package/components/Tabs/Tabs.style.js +36 -0
- package/components/Tabs/index.d.ts +1 -0
- package/components/Tabs/index.js +1 -0
- package/components/Token/Token.d.ts +3 -3
- package/components/Token/Token.js +5 -5
- package/components/TokenList/TokenList.js +4 -4
- package/components/TokenList/TokenListItem.js +9 -6
- package/components/TokenList/TokenNotFound.js +2 -2
- package/components/TokenList/VirtualizedTokenList.js +2 -1
- package/config/queryClient.js +0 -4
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +7 -1
- package/hooks/index.js +7 -1
- package/hooks/useAccount.d.ts +31 -0
- package/hooks/useAccount.js +48 -0
- package/hooks/useAvailableChains.d.ts +6 -0
- package/hooks/useAvailableChains.js +32 -0
- package/hooks/useChain.js +3 -6
- package/hooks/useChains.d.ts +1 -1
- package/hooks/useChains.js +9 -40
- package/hooks/useFromTokenSufficiency.d.ts +3 -3
- package/hooks/useFromTokenSufficiency.js +41 -43
- package/hooks/useGasRecommendation.d.ts +2 -2
- package/hooks/useGasRecommendation.js +23 -18
- package/hooks/useGasRefuel.js +19 -12
- package/hooks/useGasSufficiency.d.ts +6 -7
- package/hooks/useGasSufficiency.js +69 -72
- package/hooks/useLanguages.d.ts +6 -0
- package/hooks/useLanguages.js +24 -0
- package/hooks/useProcessMessage.d.ts +3 -3
- package/hooks/useProcessMessage.js +33 -29
- package/hooks/useRequiredToAddress.d.ts +1 -0
- package/hooks/useRequiredToAddress.js +15 -0
- package/hooks/useRouteExecution.d.ts +2 -2
- package/hooks/useRouteExecution.js +44 -58
- package/hooks/useRoutes.d.ts +1 -1
- package/hooks/useRoutes.js +131 -116
- package/hooks/useSettingMonitor.d.ts +11 -0
- package/hooks/useSettingMonitor.js +53 -0
- package/hooks/useTokenAddressBalance.d.ts +1 -1
- package/hooks/useTokenBalance.d.ts +5 -3
- package/hooks/useTokenBalance.js +74 -45
- package/hooks/useTokenBalances.d.ts +3 -3
- package/hooks/useTokenBalances.js +34 -24
- package/hooks/useTokenSearch.js +18 -17
- package/hooks/useTokens.d.ts +2 -1
- package/hooks/useTokens.js +19 -16
- package/hooks/useTools.d.ts +1 -1
- package/hooks/useTools.js +13 -12
- package/hooks/useTransactionDetails.d.ts +4 -0
- package/hooks/useTransactionDetails.js +52 -0
- package/hooks/useTransactionHistory.d.ts +5 -0
- package/hooks/useTransactionHistory.js +35 -0
- package/i18n/en.json +18 -9
- package/i18n/fr.json +7 -4
- package/i18n/pt.json +7 -4
- package/i18n/tr.json +7 -4
- package/i18n/uk.json +7 -4
- package/i18n/zh.json +7 -4
- package/icons/index.d.ts +1 -3
- package/icons/index.js +1 -3
- package/icons/lifi.d.ts +1 -0
- package/icons/lifi.js +1 -0
- package/index.d.ts +2 -3
- package/index.js +2 -4
- package/package.json +19 -19
- package/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +2 -2
- package/pages/LanguagesPage/LanguagesPage.d.ts +2 -0
- package/pages/LanguagesPage/LanguagesPage.js +18 -0
- package/pages/LanguagesPage/index.d.ts +1 -0
- package/pages/LanguagesPage/index.js +1 -0
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +16 -6
- package/pages/SelectWalletPage/EVMListItemButton.d.ts +8 -0
- package/pages/SelectWalletPage/EVMListItemButton.js +36 -0
- package/pages/SelectWalletPage/SVMListItemButton.d.ts +6 -0
- package/pages/SelectWalletPage/SVMListItemButton.js +30 -0
- package/pages/SelectWalletPage/SelectWalletPage.js +34 -35
- package/pages/SelectWalletPage/utils.d.ts +3 -0
- package/pages/SelectWalletPage/utils.js +17 -0
- package/{cjs/pages/SettingsPage/EnabledToolsButton.d.ts → pages/SettingsPage/BridgeAndExchangeSettings.d.ts} +1 -1
- package/pages/SettingsPage/BridgeAndExchangeSettings.js +32 -0
- package/pages/SettingsPage/GasPriceSettings.d.ts +2 -0
- package/pages/SettingsPage/GasPriceSettings.js +17 -0
- package/pages/SettingsPage/LanguageSetting.d.ts +2 -0
- package/pages/SettingsPage/LanguageSetting.js +22 -0
- package/pages/SettingsPage/ResetSettingsButton.js +4 -31
- package/pages/SettingsPage/RoutePrioritySettings.d.ts +2 -0
- package/pages/SettingsPage/RoutePrioritySettings.js +21 -0
- package/pages/SettingsPage/SendToWalletOptionSetting.d.ts +1 -0
- package/pages/SettingsPage/{ShowDestinationWallet.js → SendToWalletOptionSetting.js} +4 -7
- package/pages/SettingsPage/SettingsCard/BadgedValue.d.ts +8 -0
- package/pages/SettingsPage/SettingsCard/BadgedValue.js +3 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.d.ts +2 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.js +7 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +19 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.style.js +50 -0
- package/pages/SettingsPage/SettingsCard/SettingCardButton.d.ts +7 -0
- package/pages/SettingsPage/SettingsCard/SettingCardButton.js +4 -0
- package/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +7 -0
- package/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +12 -0
- package/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +6 -0
- package/pages/SettingsPage/SettingsCard/SettingsAccordian.js +31 -0
- package/pages/SettingsPage/SettingsCard/index.d.ts +6 -0
- package/pages/SettingsPage/SettingsCard/index.js +6 -0
- package/pages/SettingsPage/SettingsCard/types.d.ts +5 -0
- package/pages/SettingsPage/SettingsPage.js +10 -9
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.d.ts +2 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.js +47 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +16 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +71 -0
- package/pages/SettingsPage/SlippageSettings/index.d.ts +1 -0
- package/pages/SettingsPage/SlippageSettings/index.js +1 -0
- package/pages/SettingsPage/ThemeSettings.d.ts +2 -0
- package/pages/SettingsPage/ThemeSettings.js +35 -0
- package/pages/TransactionDetailsPage/ContactSupportButton.js +2 -2
- package/pages/TransactionDetailsPage/TransactionDetailsPage.js +38 -33
- package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.d.ts +1 -0
- package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +27 -0
- package/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts +4 -2
- package/pages/TransactionHistoryPage/TransactionHistoryItem.js +34 -7
- package/pages/TransactionHistoryPage/TransactionHistoryPage.js +24 -25
- package/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -0
- package/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +22 -0
- package/pages/TransactionHistoryPage/constants.d.ts +1 -0
- package/pages/TransactionHistoryPage/constants.js +1 -0
- package/pages/TransactionPage/ExchangeRateBottomSheet.js +11 -10
- package/pages/TransactionPage/StartTransactionButton.js +2 -2
- package/pages/TransactionPage/StatusBottomSheet.js +14 -10
- package/pages/TransactionPage/TransactionPage.js +1 -1
- package/providers/FormProvider/FormUpdater.js +4 -4
- package/providers/I18nProvider/I18nProvider.js +4 -8
- package/providers/I18nProvider/types.d.ts +4 -3
- package/providers/WalletProvider/EVMProvider.d.ts +3 -0
- package/providers/WalletProvider/EVMProvider.js +74 -0
- package/providers/WalletProvider/SDKProviders.d.ts +1 -0
- package/providers/WalletProvider/SDKProviders.js +27 -0
- package/providers/WalletProvider/SolanaProvider.d.ts +3 -0
- package/providers/WalletProvider/SolanaProvider.js +30 -0
- package/providers/WalletProvider/WalletProvider.d.ts +1 -15
- package/providers/WalletProvider/WalletProvider.js +5 -181
- package/providers/WalletProvider/index.d.ts +1 -1
- package/providers/WalletProvider/index.js +1 -1
- package/providers/WalletProvider/utils.d.ts +3 -0
- package/providers/WalletProvider/utils.js +21 -0
- package/providers/WidgetProvider/WidgetProvider.js +52 -36
- package/providers/index.d.ts +0 -1
- package/providers/index.js +0 -1
- package/stores/chains/ChainOrderStore.js +25 -1
- package/stores/header/useHeaderStore.d.ts +1 -1
- package/stores/header/useHeaderStore.js +2 -2
- package/stores/routes/createRouteExecutionStore.js +6 -60
- package/stores/routes/index.d.ts +0 -1
- package/stores/routes/index.js +0 -1
- package/stores/routes/types.d.ts +2 -2
- package/stores/routes/utils.d.ts +8 -8
- package/stores/routes/utils.js +5 -3
- package/stores/settings/useSettingsStore.js +2 -4
- package/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/stores/settings/useSplitSubvariantStore.js +2 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/events.d.ts +6 -5
- package/types/events.js +1 -1
- package/types/widget.d.ts +7 -14
- package/utils/colors.d.ts +3 -0
- package/utils/colors.js +10 -1
- package/utils/converters.d.ts +3 -0
- package/utils/converters.js +168 -0
- package/utils/format.d.ts +1 -1
- package/utils/format.js +5 -12
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/navigationRoutes.d.ts +1 -0
- package/utils/navigationRoutes.js +3 -1
- package/utils/svm.d.ts +1 -0
- package/utils/svm.js +10 -0
- package/cjs/components/LiFiLogo.d.ts +0 -5
- package/cjs/components/LiFiLogo.js +0 -10
- package/cjs/fonts/Inter-Black.woff +0 -0
- package/cjs/fonts/Inter-Black.woff2 +0 -0
- package/cjs/fonts/Inter-BlackItalic.woff +0 -0
- package/cjs/fonts/Inter-BlackItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Bold.woff +0 -0
- package/cjs/fonts/Inter-Bold.woff2 +0 -0
- package/cjs/fonts/Inter-BoldItalic.woff +0 -0
- package/cjs/fonts/Inter-BoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraBold.woff +0 -0
- package/cjs/fonts/Inter-ExtraBold.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraBoldItalic.woff +0 -0
- package/cjs/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraLight.woff +0 -0
- package/cjs/fonts/Inter-ExtraLight.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraLightItalic.woff +0 -0
- package/cjs/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Italic.woff +0 -0
- package/cjs/fonts/Inter-Italic.woff2 +0 -0
- package/cjs/fonts/Inter-Light.woff +0 -0
- package/cjs/fonts/Inter-Light.woff2 +0 -0
- package/cjs/fonts/Inter-LightItalic.woff +0 -0
- package/cjs/fonts/Inter-LightItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Medium.woff +0 -0
- package/cjs/fonts/Inter-Medium.woff2 +0 -0
- package/cjs/fonts/Inter-MediumItalic.woff +0 -0
- package/cjs/fonts/Inter-MediumItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Regular.woff +0 -0
- package/cjs/fonts/Inter-Regular.woff2 +0 -0
- package/cjs/fonts/Inter-SemiBold.woff +0 -0
- package/cjs/fonts/Inter-SemiBold.woff2 +0 -0
- package/cjs/fonts/Inter-SemiBoldItalic.woff +0 -0
- package/cjs/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Thin.woff +0 -0
- package/cjs/fonts/Inter-Thin.woff2 +0 -0
- package/cjs/fonts/Inter-ThinItalic.woff +0 -0
- package/cjs/fonts/Inter-ThinItalic.woff2 +0 -0
- package/cjs/fonts/Inter-italic.var.woff2 +0 -0
- package/cjs/fonts/Inter-roman.var.woff2 +0 -0
- package/cjs/fonts/Inter.var.woff2 +0 -0
- package/cjs/fonts/inter.css +0 -217
- package/cjs/hooks/useGetTokenBalancesWithRetry.d.ts +0 -3
- package/cjs/hooks/useGetTokenBalancesWithRetry.js +0 -33
- package/cjs/icons/LiFiFullLogo.d.ts +0 -2
- package/cjs/icons/LiFiFullLogo.js +0 -6
- package/cjs/icons/LiFiLogo.d.ts +0 -2
- package/cjs/icons/LiFiLogo.js +0 -6
- package/cjs/icons/LiFiToolLogo.d.ts +0 -2
- package/cjs/icons/LiFiToolLogo.js +0 -6
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +0 -8
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +0 -2
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +0 -27
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +0 -4
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.js +0 -19
- package/cjs/pages/SettingsPage/EnabledToolsButton.js +0 -25
- package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +0 -5
- package/cjs/pages/SettingsPage/EnabledToolsButton.style.js +0 -17
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.js +0 -17
- package/cjs/pages/SettingsPage/LanguageSelect.d.ts +0 -2
- package/cjs/pages/SettingsPage/LanguageSelect.js +0 -37
- package/cjs/pages/SettingsPage/RoutePrioritySelect.d.ts +0 -2
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +0 -23
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.js +0 -30
- package/cjs/providers/SDKProvider/SDKProvider.d.ts +0 -4
- package/cjs/providers/SDKProvider/SDKProvider.js +0 -41
- package/cjs/providers/SDKProvider/index.d.ts +0 -1
- package/cjs/providers/WalletProvider/types.d.ts +0 -17
- package/cjs/stores/routes/useTransactionHistory.d.ts +0 -2
- package/cjs/stores/routes/useTransactionHistory.js +0 -15
- package/components/Header/NavigationTabs.style.js +0 -58
- package/components/LiFiLogo.d.ts +0 -5
- package/components/LiFiLogo.js +0 -6
- package/fonts/Inter-Black.woff +0 -0
- package/fonts/Inter-Black.woff2 +0 -0
- package/fonts/Inter-BlackItalic.woff +0 -0
- package/fonts/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter-Bold.woff +0 -0
- package/fonts/Inter-Bold.woff2 +0 -0
- package/fonts/Inter-BoldItalic.woff +0 -0
- package/fonts/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraBold.woff +0 -0
- package/fonts/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraLight.woff +0 -0
- package/fonts/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter-ExtraLightItalic.woff +0 -0
- package/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter-Italic.woff +0 -0
- package/fonts/Inter-Italic.woff2 +0 -0
- package/fonts/Inter-Light.woff +0 -0
- package/fonts/Inter-Light.woff2 +0 -0
- package/fonts/Inter-LightItalic.woff +0 -0
- package/fonts/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter-Medium.woff +0 -0
- package/fonts/Inter-Medium.woff2 +0 -0
- package/fonts/Inter-MediumItalic.woff +0 -0
- package/fonts/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter-Regular.woff +0 -0
- package/fonts/Inter-Regular.woff2 +0 -0
- package/fonts/Inter-SemiBold.woff +0 -0
- package/fonts/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter-SemiBoldItalic.woff +0 -0
- package/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter-Thin.woff +0 -0
- package/fonts/Inter-Thin.woff2 +0 -0
- package/fonts/Inter-ThinItalic.woff +0 -0
- package/fonts/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter-italic.var.woff2 +0 -0
- package/fonts/Inter-roman.var.woff2 +0 -0
- package/fonts/Inter.var.woff2 +0 -0
- package/fonts/inter.css +0 -217
- package/hooks/useGetTokenBalancesWithRetry.d.ts +0 -3
- package/hooks/useGetTokenBalancesWithRetry.js +0 -29
- package/icons/LiFiFullLogo.d.ts +0 -2
- package/icons/LiFiFullLogo.js +0 -2
- package/icons/LiFiLogo.d.ts +0 -2
- package/icons/LiFiLogo.js +0 -2
- package/icons/LiFiToolLogo.d.ts +0 -2
- package/icons/LiFiToolLogo.js +0 -2
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +0 -5
- package/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +0 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +0 -23
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +0 -4
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.js +0 -16
- package/pages/SettingsPage/EnabledToolsButton.js +0 -21
- package/pages/SettingsPage/EnabledToolsButton.style.d.ts +0 -5
- package/pages/SettingsPage/EnabledToolsButton.style.js +0 -14
- package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/pages/SettingsPage/GasPriceSelect.js +0 -13
- package/pages/SettingsPage/LanguageSelect.d.ts +0 -2
- package/pages/SettingsPage/LanguageSelect.js +0 -33
- package/pages/SettingsPage/RoutePrioritySelect.d.ts +0 -2
- package/pages/SettingsPage/RoutePrioritySelect.js +0 -19
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.js +0 -26
- package/providers/SDKProvider/SDKProvider.d.ts +0 -4
- package/providers/SDKProvider/SDKProvider.js +0 -36
- package/providers/SDKProvider/index.d.ts +0 -1
- package/providers/SDKProvider/index.js +0 -1
- package/providers/WalletProvider/types.d.ts +0 -17
- package/stores/routes/useTransactionHistory.d.ts +0 -2
- package/stores/routes/useTransactionHistory.js +0 -11
- /package/cjs/{providers/WalletProvider → pages/SettingsPage/SettingsCard}/types.js +0 -0
- /package/{providers/WalletProvider → pages/SettingsPage/SettingsCard}/types.js +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionDetailsSkeleton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const Card_1 = require("../../components/Card");
|
|
7
|
+
const DetailedTextSkeleton = () => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", ml: 6, children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 64, height: 16, variant: "text" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 96, height: 16, variant: "text", sx: { marginLeft: 0.5 } })] }));
|
|
9
|
+
};
|
|
10
|
+
const TransactionDetailsTokenSkeleton = () => {
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { py: 1, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", flex: 1, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rounded", width: 32, height: 32, sx: {
|
|
12
|
+
borderRadius: '100%',
|
|
13
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", flexDirection: "column", flex: 1, ml: 2, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 64, height: 32, variant: "text" }) })] }), (0, jsx_runtime_1.jsx)(DetailedTextSkeleton, {})] }));
|
|
14
|
+
};
|
|
15
|
+
const TransactionDetailsSkeleton = () => {
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Container, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flex: 1,
|
|
19
|
+
justifyContent: 'space-between',
|
|
20
|
+
}, pb: 1, pt: 0.75, children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 96, height: 20, variant: "text" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 40, height: 20, variant: "text" })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card, { mb: 3, variant: "default", sx: { paddingX: 2 }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { pt: 2.5, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 64, height: 12, variant: "rounded" }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { py: 1, children: [(0, jsx_runtime_1.jsx)(TransactionDetailsTokenSkeleton, {}), (0, jsx_runtime_1.jsxs)(material_1.Box, { py: 1, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", flex: 1, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rounded", width: 32, height: 32, sx: {
|
|
21
|
+
borderRadius: '100%',
|
|
22
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", flexDirection: "column", flex: 1, ml: 2, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 96, height: 32, variant: "text" }) })] }), (0, jsx_runtime_1.jsx)(DetailedTextSkeleton, {}), (0, jsx_runtime_1.jsx)(DetailedTextSkeleton, {})] }), Array.from({ length: 3 }).map((_, key) => ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
}, py: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rounded", width: 32, height: 32, sx: {
|
|
26
|
+
borderRadius: '100%',
|
|
27
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { sx: {
|
|
28
|
+
ml: 2,
|
|
29
|
+
}, width: 96, height: 32, variant: "text" })] }, key))), (0, jsx_runtime_1.jsx)(TransactionDetailsTokenSkeleton, {})] })] })] }));
|
|
30
|
+
};
|
|
31
|
+
exports.TransactionDetailsSkeleton = TransactionDetailsSkeleton;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { StatusResponse } from '@lifi/sdk';
|
|
3
3
|
export declare const TransactionHistoryItem: React.FC<{
|
|
4
|
-
|
|
4
|
+
transaction: StatusResponse;
|
|
5
|
+
size: number;
|
|
6
|
+
start: number;
|
|
5
7
|
}>;
|
|
@@ -8,21 +8,48 @@ const react_router_dom_1 = require("react-router-dom");
|
|
|
8
8
|
const Card_1 = require("../../components/Card");
|
|
9
9
|
const Token_1 = require("../../components/Token");
|
|
10
10
|
const utils_1 = require("../../utils");
|
|
11
|
-
const TransactionHistoryItem = ({
|
|
11
|
+
const TransactionHistoryItem = ({ transaction, size, start }) => {
|
|
12
12
|
const { i18n } = (0, react_i18next_1.useTranslation)();
|
|
13
13
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
14
|
+
const sending = transaction.sending;
|
|
15
|
+
const receiving = transaction.receiving;
|
|
14
16
|
const handleClick = () => {
|
|
15
17
|
navigate(utils_1.navigationRoutes.transactionDetails, {
|
|
16
|
-
state: {
|
|
18
|
+
state: {
|
|
19
|
+
transactionHash: transaction.sending.txHash,
|
|
20
|
+
},
|
|
17
21
|
});
|
|
18
22
|
};
|
|
19
|
-
const startedAt = new Date(
|
|
20
|
-
|
|
23
|
+
const startedAt = new Date((sending.timestamp ?? 0) * 1000);
|
|
24
|
+
if (!sending.token?.chainId || !receiving.token?.chainId) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const fromToken = {
|
|
28
|
+
...sending.token,
|
|
29
|
+
amount: BigInt(sending.amount ?? '0'),
|
|
30
|
+
priceUSD: sending.token.priceUSD ?? '0',
|
|
31
|
+
symbol: sending.token?.symbol ?? '',
|
|
32
|
+
decimals: sending.token?.decimals ?? 0,
|
|
33
|
+
name: sending.token?.name ?? '',
|
|
34
|
+
chainId: sending.token?.chainId,
|
|
35
|
+
};
|
|
21
36
|
const toToken = {
|
|
22
|
-
...
|
|
23
|
-
amount:
|
|
37
|
+
...receiving.token,
|
|
38
|
+
amount: BigInt(receiving.amount ?? '0'),
|
|
39
|
+
priceUSD: receiving.token.priceUSD ?? '0',
|
|
40
|
+
symbol: receiving.token?.symbol ?? '',
|
|
41
|
+
decimals: receiving.token?.decimals ?? 0,
|
|
42
|
+
name: receiving.token?.name ?? '',
|
|
43
|
+
chainId: receiving.token?.chainId,
|
|
24
44
|
};
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { onClick: handleClick,
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { onClick: handleClick, style: {
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
top: 0,
|
|
48
|
+
left: 0,
|
|
49
|
+
width: '100%',
|
|
50
|
+
// height: `${size}px`,
|
|
51
|
+
transform: `translateY(${start}px)`,
|
|
52
|
+
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
26
53
|
display: 'flex',
|
|
27
54
|
flex: 1,
|
|
28
55
|
justifyContent: 'space-between',
|
|
@@ -2,34 +2,33 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TransactionHistoryPage = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const DeleteOutline_1 = require("@mui/icons-material/DeleteOutline");
|
|
6
5
|
const material_1 = require("@mui/material");
|
|
6
|
+
const react_virtual_1 = require("@tanstack/react-virtual");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const
|
|
9
|
-
const Dialog_1 = require("../../components/Dialog");
|
|
10
|
-
const providers_1 = require("../../providers");
|
|
11
|
-
const stores_1 = require("../../stores");
|
|
12
|
-
const routes_1 = require("../../stores/routes");
|
|
8
|
+
const useTransactionHistory_1 = require("../../hooks/useTransactionHistory");
|
|
13
9
|
const TransactionHistoryEmpty_1 = require("./TransactionHistoryEmpty");
|
|
14
10
|
const TransactionHistoryItem_1 = require("./TransactionHistoryItem");
|
|
11
|
+
const TransactionHistorySkeleton_1 = require("./TransactionHistorySkeleton");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
15
13
|
const TransactionHistoryPage = () => {
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const transactions = (0,
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, [transactions.length, toggleDialog, headerStoreContext]);
|
|
30
|
-
if (!transactions.length) {
|
|
14
|
+
// Parent ref and useVirtualizer should be in one file to avoid blank page (0 virtual items) issue
|
|
15
|
+
const parentRef = (0, react_1.useRef)(null);
|
|
16
|
+
const { data: transactions, isLoading } = (0, useTransactionHistory_1.useTransactionHistory)();
|
|
17
|
+
const { getVirtualItems, getTotalSize } = (0, react_virtual_1.useVirtualizer)({
|
|
18
|
+
count: transactions.length,
|
|
19
|
+
overscan: 10,
|
|
20
|
+
paddingStart: 8,
|
|
21
|
+
paddingEnd: 12,
|
|
22
|
+
getScrollElement: () => parentRef.current,
|
|
23
|
+
estimateSize: () => 194,
|
|
24
|
+
getItemKey: (index) => `${transactions[index].transactionId}-${index}`,
|
|
25
|
+
});
|
|
26
|
+
if (!transactions.length && !isLoading) {
|
|
31
27
|
return (0, jsx_runtime_1.jsx)(TransactionHistoryEmpty_1.TransactionHistoryEmpty, {});
|
|
32
28
|
}
|
|
33
|
-
return ((0, jsx_runtime_1.
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Container, { ref: parentRef, style: { height: constants_1.minTransactionListHeight, overflow: 'auto' }, children: (0, jsx_runtime_1.jsx)(material_1.List, { style: { height: getTotalSize(), width: '100%', position: 'relative' }, disablePadding: true, children: isLoading ? ((0, jsx_runtime_1.jsx)(material_1.List, { disablePadding: true, sx: { paddingTop: 1 }, children: Array.from({ length: 3 }).map((_, index) => ((0, jsx_runtime_1.jsx)(TransactionHistorySkeleton_1.TransactionHistorySkeleton, {}, index))) })) : (getVirtualItems().map((item) => {
|
|
30
|
+
const transaction = transactions[item.index];
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(TransactionHistoryItem_1.TransactionHistoryItem, { size: item.size, start: item.start, transaction: transaction }, item.key));
|
|
32
|
+
})) }) }));
|
|
34
33
|
};
|
|
35
34
|
exports.TransactionHistoryPage = TransactionHistoryPage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TransactionHistorySkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionHistorySkeleton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const Card_1 = require("../../components/Card");
|
|
7
|
+
const Token_1 = require("../../components/Token");
|
|
8
|
+
const TokenSkeleton = ({ showDivider }) => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, px: 2, pt: showDivider ? 1 : 0.5, pb: showDivider ? 0 : 1, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", flex: 1, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rounded", width: 32, height: 32, sx: {
|
|
10
|
+
borderRadius: '100%',
|
|
11
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", flexDirection: "column", flex: 1, ml: 2, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 40, height: 30, variant: "text" }) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", marginLeft: "-16px", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", flexDirection: 'column', marginTop: 0.5, visibility: showDivider ? 'visible' : 'hidden', children: (0, jsx_runtime_1.jsx)(Token_1.TokenDivider, {}) }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 64, height: 12, sx: { marginTop: 0.5 }, variant: "rounded" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 96, height: 12, variant: "rounded", sx: { marginTop: 0.5, marginLeft: 0.5 } })] })] }));
|
|
12
|
+
};
|
|
13
|
+
const TransactionHistorySkeleton = () => {
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { style: {
|
|
15
|
+
marginBottom: '16px',
|
|
16
|
+
}, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flex: 1,
|
|
19
|
+
justifyContent: 'space-between',
|
|
20
|
+
}, pt: 2, px: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 96, height: 16, sx: (theme) => ({
|
|
21
|
+
borderRadius: `${theme.shape.borderRadius}px`,
|
|
22
|
+
}) }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 64, height: 16, sx: (theme) => ({
|
|
23
|
+
borderRadius: `${theme.shape.borderRadius}px`,
|
|
24
|
+
}) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { py: 1, children: [(0, jsx_runtime_1.jsx)(TokenSkeleton, { showDivider: true }), (0, jsx_runtime_1.jsx)(Token_1.TokenDivider, {}), (0, jsx_runtime_1.jsx)(TokenSkeleton, {})] })] }));
|
|
25
|
+
};
|
|
26
|
+
exports.TransactionHistorySkeleton = TransactionHistorySkeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const minTransactionListHeight = 544;
|
|
@@ -4,7 +4,6 @@ exports.ExchangeRateBottomSheet = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const WarningRounded_1 = require("@mui/icons-material/WarningRounded");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
|
-
const big_js_1 = require("big.js");
|
|
8
7
|
const react_1 = require("react");
|
|
9
8
|
const react_i18next_1 = require("react-i18next");
|
|
10
9
|
const BottomSheet_1 = require("../../components/BottomSheet");
|
|
@@ -47,15 +46,17 @@ const ExchangeRateBottomSheetContent = ({ data, onCancel, onContinue }) => {
|
|
|
47
46
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
48
47
|
const ref = (0, react_1.useRef)();
|
|
49
48
|
(0, hooks_1.useSetContentHeight)(ref);
|
|
50
|
-
|
|
49
|
+
if (!data) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const oldAmount = BigInt(data.oldToAmount || 1);
|
|
53
|
+
const rateChange = ((Number((BigInt(data.newToAmount || 0) * 1000000n) / oldAmount) /
|
|
54
|
+
1000000) *
|
|
55
|
+
100 -
|
|
56
|
+
100).toFixed(2);
|
|
51
57
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { p: 3, ref: ref, children: [(0, jsx_runtime_1.jsxs)(StatusBottomSheet_style_1.CenterContainer, { children: [(0, jsx_runtime_1.jsx)(StatusBottomSheet_style_1.IconCircle, { status: "warning", mb: 1, children: (0, jsx_runtime_1.jsx)(WarningRounded_1.default, { color: "warning" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('warning.title.rateChanged') })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { py: 1, children: t('warning.message.rateChanged') }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.quotedAmount') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [t('format.number', {
|
|
52
|
-
value: (0, utils_1.formatTokenAmount)(data
|
|
58
|
+
value: (0, utils_1.formatTokenAmount)(BigInt(data.oldToAmount), data.toToken.decimals, 5),
|
|
53
59
|
}), ' ', data?.toToken.symbol] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.currentAmount') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [t('format.number', {
|
|
54
|
-
value: (0, utils_1.formatTokenAmount)(data?.newToAmount, data?.toToken.decimals, 5),
|
|
55
|
-
}), ' ', data?.toToken.symbol] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.rateChange') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [(0,
|
|
56
|
-
.div(oldAmount.eq(0) ? (0, big_js_1.default)(1) : oldAmount)
|
|
57
|
-
.minus(1)
|
|
58
|
-
.mul(100)
|
|
59
|
-
.round(2, big_js_1.default.roundUp)
|
|
60
|
-
.toString(), "%"] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", mt: 3, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "text", onClick: onCancel, fullWidth: true, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", p: 1 }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: onContinue, fullWidth: true, children: t('button.continue') })] })] }));
|
|
60
|
+
value: (0, utils_1.formatTokenAmount)(BigInt(data?.newToAmount), data?.toToken.decimals, 5),
|
|
61
|
+
}), ' ', data?.toToken.symbol] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('main.rateChange') }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { fontWeight: 600, children: [rateChange, "%"] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", mt: 3, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "text", onClick: onCancel, fullWidth: true, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", p: 1 }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: onContinue, fullWidth: true, children: t('button.continue') })] })] }));
|
|
61
62
|
};
|
|
@@ -6,8 +6,8 @@ const BaseTransactionButton_1 = require("../../components/BaseTransactionButton"
|
|
|
6
6
|
const hooks_1 = require("../../hooks");
|
|
7
7
|
const stores_1 = require("../../stores");
|
|
8
8
|
const StartTransactionButton = ({ onClick, route, text, loading, }) => {
|
|
9
|
-
const { insufficientGas,
|
|
10
|
-
const { insufficientFromToken,
|
|
9
|
+
const { insufficientGas, isLoading: isGasSufficiencyLoading } = (0, hooks_1.useGasSufficiency)(route);
|
|
10
|
+
const { insufficientFromToken, isLoading: isFromTokenSufficiencyLoading } = (0, hooks_1.useFromTokenSufficiency)(route);
|
|
11
11
|
const shouldDisableButton = insufficientFromToken || !!insufficientGas?.length;
|
|
12
12
|
return ((0, jsx_runtime_1.jsx)(BaseTransactionButton_1.BaseTransactionButton, { onClick: onClick, text: text, disabled: shouldDisableButton, loading: isFromTokenSufficiencyLoading || isGasSufficiencyLoading || loading }));
|
|
13
13
|
};
|
|
@@ -21,16 +21,16 @@ const StatusBottomSheet = ({ status, route, }) => {
|
|
|
21
21
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
22
22
|
const { navigateBack, navigate } = (0, hooks_1.useNavigateBack)();
|
|
23
23
|
const ref = (0, react_1.useRef)(null);
|
|
24
|
-
const { getChainById } = (0, hooks_1.
|
|
24
|
+
const { getChainById } = (0, hooks_1.useAvailableChains)();
|
|
25
25
|
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
26
26
|
const { subvariant, contractComponent, contractSecondaryComponent, contractCompactComponent, } = (0, providers_1.useWidgetConfig)();
|
|
27
27
|
const toToken = {
|
|
28
28
|
...(route.steps.at(-1)?.execution?.toToken ?? route.toToken),
|
|
29
|
-
amount: route.steps.at(-1)?.execution?.toAmount ??
|
|
29
|
+
amount: BigInt(route.steps.at(-1)?.execution?.toAmount ??
|
|
30
30
|
route.steps.at(-1)?.estimate.toAmount ??
|
|
31
|
-
route.toAmount,
|
|
31
|
+
route.toAmount),
|
|
32
32
|
};
|
|
33
|
-
const { token, refetch, refetchNewBalance, refetchAllBalances } = (0, hooks_1.useTokenBalance)(
|
|
33
|
+
const { token, refetch, refetchNewBalance, refetchAllBalances } = (0, hooks_1.useTokenBalance)(route.toAddress, toToken);
|
|
34
34
|
const clearFromAmount = () => {
|
|
35
35
|
refetchAllBalances();
|
|
36
36
|
setValue(providers_1.FormKey.FromAmount, '');
|
|
@@ -62,8 +62,12 @@ const StatusBottomSheet = ({ status, route, }) => {
|
|
|
62
62
|
};
|
|
63
63
|
const handleSeeDetails = () => {
|
|
64
64
|
handleClose();
|
|
65
|
+
const transactionHash = (0, stores_1.getSourceTxHash)(route);
|
|
65
66
|
navigate(utils_1.navigationRoutes.transactionDetails, {
|
|
66
|
-
state: {
|
|
67
|
+
state: {
|
|
68
|
+
routeId: route.id,
|
|
69
|
+
transactionHash,
|
|
70
|
+
},
|
|
67
71
|
replace: true,
|
|
68
72
|
});
|
|
69
73
|
};
|
|
@@ -80,7 +84,7 @@ const StatusBottomSheet = ({ status, route, }) => {
|
|
|
80
84
|
: t(`success.title.${transactionType}Successful`);
|
|
81
85
|
if (token) {
|
|
82
86
|
primaryMessage = t('success.message.exchangeSuccessful', {
|
|
83
|
-
amount: (0, utils_1.formatTokenAmount)(token.amount),
|
|
87
|
+
amount: (0, utils_1.formatTokenAmount)(token.amount, token.decimals),
|
|
84
88
|
tokenSymbol: token.symbol,
|
|
85
89
|
chainName: getChainById(token.chainId)?.name,
|
|
86
90
|
walletAddress: (0, utils_1.shortenAddress)(route.toAddress),
|
|
@@ -97,7 +101,7 @@ const StatusBottomSheet = ({ status, route, }) => {
|
|
|
97
101
|
});
|
|
98
102
|
if (token) {
|
|
99
103
|
secondaryMessage = t('success.message.exchangeSuccessful', {
|
|
100
|
-
amount: (0, utils_1.formatTokenAmount)(token.amount),
|
|
104
|
+
amount: (0, utils_1.formatTokenAmount)(token.amount, token.decimals),
|
|
101
105
|
tokenSymbol: token.symbol,
|
|
102
106
|
chainName: getChainById(token.chainId)?.name,
|
|
103
107
|
walletAddress: (0, utils_1.shortenAddress)(route.toAddress),
|
|
@@ -114,7 +118,7 @@ const StatusBottomSheet = ({ status, route, }) => {
|
|
|
114
118
|
});
|
|
115
119
|
if (token) {
|
|
116
120
|
secondaryMessage = t('success.message.exchangeSuccessful', {
|
|
117
|
-
amount: (0, utils_1.formatTokenAmount)(token.amount),
|
|
121
|
+
amount: (0, utils_1.formatTokenAmount)(token.amount, token.decimals),
|
|
118
122
|
tokenSymbol: token.symbol,
|
|
119
123
|
chainName: getChainById(token.chainId)?.name,
|
|
120
124
|
walletAddress: (0, utils_1.shortenAddress)(route.toAddress),
|
|
@@ -127,7 +127,7 @@ const TransactionPage = () => {
|
|
|
127
127
|
const getInsuranceCoverageId = () => route.steps[0].execution?.process
|
|
128
128
|
.filter((process) => process.type !== 'TOKEN_ALLOWANCE')
|
|
129
129
|
.find((process) => process.txHash)?.txHash ?? route.fromAddress;
|
|
130
|
-
return ((0, jsx_runtime_1.jsxs)(TransactionPage_style_1.Container, { children: [(0, Step_1.getStepList)(route, subvariant), subvariant === 'nft' ? ((0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mt: 2, children: contractSecondaryComponent || contractComponent })) : null, insuranceAvailable ? ((0, jsx_runtime_1.jsx)(Insurance_1.Insurance, { mt: 2, status: status, insurableRouteId: stateRouteId, feeAmountUsd: route.insurance.feeAmountUsd, insuredAmount: (0, utils_1.formatTokenAmount)(route.toAmountMin, route.toToken.decimals), insuredTokenSymbol: route.toToken.symbol, insuranceCoverageId: getInsuranceCoverageId(), onChange: setRouteId })) : null, status === stores_1.RouteExecutionStatus.Idle ||
|
|
130
|
+
return ((0, jsx_runtime_1.jsxs)(TransactionPage_style_1.Container, { children: [(0, Step_1.getStepList)(route, subvariant), subvariant === 'nft' ? ((0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mt: 2, children: contractSecondaryComponent || contractComponent })) : null, insuranceAvailable ? ((0, jsx_runtime_1.jsx)(Insurance_1.Insurance, { mt: 2, status: status, insurableRouteId: stateRouteId, feeAmountUsd: route.insurance.feeAmountUsd, insuredAmount: (0, utils_1.formatTokenAmount)(BigInt(route.toAmountMin), route.toToken.decimals), insuredTokenSymbol: route.toToken.symbol, insuranceCoverageId: getInsuranceCoverageId(), onChange: setRouteId })) : null, status === stores_1.RouteExecutionStatus.Idle ||
|
|
131
131
|
status === stores_1.RouteExecutionStatus.Failed ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(GasMessage_1.GasMessage, { mt: 2, route: route }), (0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, display: "flex", children: [(0, jsx_runtime_1.jsx)(StartButton, { text: getButtonText(), onClick: handleStartClick, route: route, insurableRouteId: stateRouteId }), status === stores_1.RouteExecutionStatus.Failed ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t('button.removeTransaction'), placement: "bottom-end", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleRemoveRoute, sx: {
|
|
132
132
|
minWidth: 48,
|
|
133
133
|
marginLeft: 1,
|
|
@@ -5,11 +5,11 @@ exports.FormUpdater = void 0;
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_hook_form_1 = require("react-hook-form");
|
|
7
7
|
const _1 = require(".");
|
|
8
|
-
const
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
9
|
const WidgetProvider_1 = require("../WidgetProvider");
|
|
10
10
|
const FormUpdater = ({ defaultValues }) => {
|
|
11
11
|
const { fromChain, toChain, chains } = (0, WidgetProvider_1.useWidgetConfig)();
|
|
12
|
-
const { account } = (0,
|
|
12
|
+
const { account } = (0, hooks_1.useAccount)();
|
|
13
13
|
const { setValue, getValues, getFieldState, resetField,
|
|
14
14
|
// Subscription to touchedFields is required by getFieldState to work
|
|
15
15
|
formState: { touchedFields }, } = (0, react_hook_form_1.useFormContext)();
|
|
@@ -17,7 +17,7 @@ const FormUpdater = ({ defaultValues }) => {
|
|
|
17
17
|
// Set wallet chain as default if no chains are provided by config and if they were not changed during widget usage
|
|
18
18
|
(0, react_1.useEffect)(() => {
|
|
19
19
|
const chainAllowed = account.chainId && (0, WidgetProvider_1.isItemAllowed)(account.chainId, chains);
|
|
20
|
-
if (!account.
|
|
20
|
+
if (!account.isConnected || !account.chainId || !chainAllowed) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
const { isTouched: isFromChainTouched } = getFieldState(_1.FormKey.FromChain);
|
|
@@ -40,7 +40,7 @@ const FormUpdater = ({ defaultValues }) => {
|
|
|
40
40
|
}
|
|
41
41
|
}, [
|
|
42
42
|
account.chainId,
|
|
43
|
-
account.
|
|
43
|
+
account.isConnected,
|
|
44
44
|
chains,
|
|
45
45
|
fromChain,
|
|
46
46
|
getFieldState,
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.I18nProvider = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const i18next_1 = require("i18next");
|
|
6
|
-
const i18next_browser_languagedetector_1 = require("i18next-browser-languagedetector");
|
|
7
6
|
const react_1 = require("react");
|
|
8
7
|
const react_i18next_1 = require("react-i18next");
|
|
9
8
|
const supportedLanguages = require("../../i18n");
|
|
@@ -11,7 +10,7 @@ const stores_1 = require("../../stores");
|
|
|
11
10
|
const utils_1 = require("../../utils");
|
|
12
11
|
const WidgetProvider_1 = require("../WidgetProvider");
|
|
13
12
|
const I18nProvider = ({ children, }) => {
|
|
14
|
-
const { languageResources, languages
|
|
13
|
+
const { languageResources, languages } = (0, WidgetProvider_1.useWidgetConfig)();
|
|
15
14
|
const { language } = (0, stores_1.useSettings)(['language']);
|
|
16
15
|
const i18n = (0, react_1.useMemo)(() => {
|
|
17
16
|
let resources = Object.keys(supportedLanguages)
|
|
@@ -34,7 +33,7 @@ const I18nProvider = ({ children, }) => {
|
|
|
34
33
|
return resources;
|
|
35
34
|
}, resources);
|
|
36
35
|
}
|
|
37
|
-
let i18n = i18next_1.
|
|
36
|
+
let i18n = (0, i18next_1.createInstance)({
|
|
38
37
|
lng: languages?.default || language,
|
|
39
38
|
fallbackLng: resources.en
|
|
40
39
|
? 'en'
|
|
@@ -50,12 +49,9 @@ const I18nProvider = ({ children, }) => {
|
|
|
50
49
|
caches: [],
|
|
51
50
|
},
|
|
52
51
|
});
|
|
53
|
-
if (!language && !languages?.default && !disableLanguageDetector) {
|
|
54
|
-
i18n = i18n.use(i18next_browser_languagedetector_1.default);
|
|
55
|
-
}
|
|
56
52
|
i18n.use(react_i18next_1.initReactI18next).init();
|
|
57
53
|
return i18n;
|
|
58
|
-
}, [
|
|
54
|
+
}, [language, languageResources, languages]);
|
|
59
55
|
return (0, jsx_runtime_1.jsx)(react_i18next_1.I18nextProvider, { i18n: i18n, children: children });
|
|
60
56
|
};
|
|
61
57
|
exports.I18nProvider = I18nProvider;
|
|
@@ -3,13 +3,14 @@ export type PartialResource<T> = T extends object ? {
|
|
|
3
3
|
[P in keyof T]?: PartialResource<T[P]>;
|
|
4
4
|
} : T;
|
|
5
5
|
export type LanguageKey = keyof typeof languages;
|
|
6
|
+
export type LanguageResource = typeof languages.en;
|
|
6
7
|
export type LanguageResources = {
|
|
7
|
-
[language in LanguageKey]?: PartialResource<
|
|
8
|
+
[language in LanguageKey]?: PartialResource<LanguageResource>;
|
|
8
9
|
} | {
|
|
9
|
-
[language: string]: PartialResource<
|
|
10
|
+
[language: string]: PartialResource<LanguageResource>;
|
|
10
11
|
};
|
|
11
12
|
export type LanguageTranslationResource = {
|
|
12
|
-
[namespace in 'translation']: PartialResource<
|
|
13
|
+
[namespace in 'translation']: PartialResource<LanguageResource>;
|
|
13
14
|
};
|
|
14
15
|
export type LanguageTranslationResources = {
|
|
15
16
|
[language: string]: LanguageTranslationResource;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EVMBaseProvider = exports.EVMProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const wallet_management_1 = require("@lifi/wallet-management");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const viem_1 = require("viem");
|
|
8
|
+
const wagmi_1 = require("wagmi");
|
|
9
|
+
const chains_1 = require("wagmi/chains");
|
|
10
|
+
const hooks_1 = require("../../hooks");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
12
|
+
const connectors = [
|
|
13
|
+
wallet_management_1.walletConnect,
|
|
14
|
+
wallet_management_1.coinbase,
|
|
15
|
+
wallet_management_1.bitget,
|
|
16
|
+
wallet_management_1.gate,
|
|
17
|
+
wallet_management_1.exodus,
|
|
18
|
+
wallet_management_1.taho,
|
|
19
|
+
wallet_management_1.binance,
|
|
20
|
+
wallet_management_1.frontier,
|
|
21
|
+
wallet_management_1.okx,
|
|
22
|
+
wallet_management_1.trust,
|
|
23
|
+
wallet_management_1.status,
|
|
24
|
+
wallet_management_1.alpha,
|
|
25
|
+
wallet_management_1.block,
|
|
26
|
+
wallet_management_1.bitpie,
|
|
27
|
+
wallet_management_1.brave,
|
|
28
|
+
wallet_management_1.dcent,
|
|
29
|
+
wallet_management_1.frame,
|
|
30
|
+
wallet_management_1.hyperpay,
|
|
31
|
+
wallet_management_1.imtoken,
|
|
32
|
+
wallet_management_1.liquality,
|
|
33
|
+
wallet_management_1.ownbit,
|
|
34
|
+
wallet_management_1.tokenpocket,
|
|
35
|
+
wallet_management_1.xdefi,
|
|
36
|
+
wallet_management_1.oneinch,
|
|
37
|
+
wallet_management_1.tokenary,
|
|
38
|
+
wallet_management_1.safepal,
|
|
39
|
+
wallet_management_1.rabby,
|
|
40
|
+
];
|
|
41
|
+
const EVMProvider = ({ children }) => {
|
|
42
|
+
const inWagmiContext = useInWagmiContext();
|
|
43
|
+
return inWagmiContext ? (children) : ((0, jsx_runtime_1.jsx)(exports.EVMBaseProvider, { children: children }));
|
|
44
|
+
};
|
|
45
|
+
exports.EVMProvider = EVMProvider;
|
|
46
|
+
const EVMBaseProvider = ({ children }) => {
|
|
47
|
+
const { chains } = (0, hooks_1.useAvailableChains)();
|
|
48
|
+
const wagmiConfig = (0, react_1.useMemo)(() => {
|
|
49
|
+
const _chains = chains?.length
|
|
50
|
+
? chains.map(utils_1.formatChain)
|
|
51
|
+
: [chains_1.mainnet];
|
|
52
|
+
// Add ENS contracts
|
|
53
|
+
const _mainnet = _chains.find((chain) => chain.id === chains_1.mainnet.id);
|
|
54
|
+
if (_mainnet) {
|
|
55
|
+
_mainnet.contracts = chains_1.mainnet.contracts;
|
|
56
|
+
}
|
|
57
|
+
const wagmiConfig = (0, wagmi_1.createConfig)({
|
|
58
|
+
chains: _chains,
|
|
59
|
+
connectors: connectors,
|
|
60
|
+
client({ chain }) {
|
|
61
|
+
return (0, viem_1.createClient)({ chain, transport: (0, wagmi_1.http)() });
|
|
62
|
+
},
|
|
63
|
+
// transports: _chains.reduce(
|
|
64
|
+
// (transports, chain) => {
|
|
65
|
+
// transports[chain.id] = http();
|
|
66
|
+
// return transports;
|
|
67
|
+
// },
|
|
68
|
+
// {} as Record<number, Transport>,
|
|
69
|
+
// ),
|
|
70
|
+
});
|
|
71
|
+
return wagmiConfig;
|
|
72
|
+
}, [chains]);
|
|
73
|
+
return ((0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: wagmiConfig, reconnectOnMount: Boolean(chains?.length), children: children }));
|
|
74
|
+
};
|
|
75
|
+
exports.EVMBaseProvider = EVMBaseProvider;
|
|
76
|
+
function useInWagmiContext() {
|
|
77
|
+
const context = (0, react_1.useContext)(wagmi_1.WagmiContext);
|
|
78
|
+
return Boolean(context);
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDKProviders: () => null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SDKProviders = void 0;
|
|
4
|
+
const sdk_1 = require("@lifi/sdk");
|
|
5
|
+
const wallet_adapter_react_1 = require("@solana/wallet-adapter-react");
|
|
6
|
+
const core_1 = require("@wagmi/core");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const wagmi_1 = require("wagmi");
|
|
9
|
+
const SDKProviders = () => {
|
|
10
|
+
const { wallet } = (0, wallet_adapter_react_1.useWallet)();
|
|
11
|
+
const wagmiConfig = (0, wagmi_1.useConfig)();
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
|
+
// Configure SDK Providers
|
|
14
|
+
sdk_1.config.setProviders([
|
|
15
|
+
(0, sdk_1.EVM)({
|
|
16
|
+
getWalletClient: () => (0, core_1.getWalletClient)(wagmiConfig),
|
|
17
|
+
switchChain: async (chainId) => {
|
|
18
|
+
await (0, core_1.switchChain)(wagmiConfig, { chainId });
|
|
19
|
+
return (0, core_1.getWalletClient)(wagmiConfig);
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
(0, sdk_1.Solana)({
|
|
23
|
+
async getWalletAdapter() {
|
|
24
|
+
return wallet?.adapter;
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
]);
|
|
28
|
+
}, [wagmiConfig, wallet?.adapter]);
|
|
29
|
+
return null;
|
|
30
|
+
};
|
|
31
|
+
exports.SDKProviders = SDKProviders;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolanaBaseProvider = exports.SolanaProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const wallet_adapter_base_1 = require("@solana/wallet-adapter-base");
|
|
6
|
+
const wallet_adapter_react_1 = require("@solana/wallet-adapter-react");
|
|
7
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const endpoint = (0, web3_js_1.clusterApiUrl)(wallet_adapter_base_1.WalletAdapterNetwork.Mainnet);
|
|
10
|
+
/**
|
|
11
|
+
* Wallets that implement either of these standards will be available automatically.
|
|
12
|
+
*
|
|
13
|
+
* - Solana Mobile Stack Mobile Wallet Adapter Protocol
|
|
14
|
+
* (https://github.com/solana-mobile/mobile-wallet-adapter)
|
|
15
|
+
* - Solana Wallet Standard
|
|
16
|
+
* (https://github.com/solana-labs/wallet-standard)
|
|
17
|
+
*
|
|
18
|
+
* If you wish to support a wallet that supports neither of those standards,
|
|
19
|
+
* instantiate its legacy wallet adapter here. Common legacy adapters can be found
|
|
20
|
+
* in the npm package `@solana/wallet-adapter-wallets`.
|
|
21
|
+
*/
|
|
22
|
+
const wallets = [];
|
|
23
|
+
const SolanaProvider = ({ children }) => {
|
|
24
|
+
const inSolanaContext = useInSolanaContext();
|
|
25
|
+
return inSolanaContext ? (children) : ((0, jsx_runtime_1.jsx)(exports.SolanaBaseProvider, { children: children }));
|
|
26
|
+
};
|
|
27
|
+
exports.SolanaProvider = SolanaProvider;
|
|
28
|
+
const SolanaBaseProvider = ({ children }) => {
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(wallet_adapter_react_1.ConnectionProvider, { endpoint: endpoint, children: (0, jsx_runtime_1.jsx)(wallet_adapter_react_1.WalletProvider, { wallets: wallets, autoConnect: true, children: children }) }));
|
|
30
|
+
};
|
|
31
|
+
exports.SolanaBaseProvider = SolanaBaseProvider;
|
|
32
|
+
function useInSolanaContext() {
|
|
33
|
+
const context = (0, react_1.useContext)(wallet_adapter_react_1.ConnectionContext);
|
|
34
|
+
return Boolean(context?.connection);
|
|
35
|
+
}
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { FC, PropsWithChildren } from 'react';
|
|
3
|
-
import type { WalletContextProps } from './types';
|
|
4
|
-
export declare const useWallet: () => WalletContextProps;
|
|
1
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
5
2
|
export declare const WalletProvider: FC<PropsWithChildren>;
|
|
6
|
-
export declare const extractAccountFromSigner: (signer?: Signer) => Promise<{
|
|
7
|
-
address: string | undefined;
|
|
8
|
-
isActive: boolean;
|
|
9
|
-
signer: Signer | undefined;
|
|
10
|
-
chainId: number | undefined;
|
|
11
|
-
} | {
|
|
12
|
-
address?: undefined;
|
|
13
|
-
isActive?: undefined;
|
|
14
|
-
signer?: undefined;
|
|
15
|
-
chainId?: undefined;
|
|
16
|
-
}>;
|