@lifi/widget 2.0.0-beta.9 → 2.0.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/App.js +2 -2
- package/AppDrawer.d.ts +3 -2
- package/AppDrawer.js +7 -3
- package/AppDrawer.style.d.ts +2 -2
- package/AppDrawer.style.js +5 -0
- package/AppProvider.js +4 -4
- package/AppRoutes.js +16 -16
- package/cjs/App.js +2 -2
- package/cjs/AppDrawer.d.ts +3 -2
- package/cjs/AppDrawer.js +7 -3
- package/cjs/AppDrawer.style.d.ts +2 -2
- package/cjs/AppDrawer.style.js +5 -0
- package/cjs/AppProvider.js +3 -3
- package/cjs/AppRoutes.js +16 -16
- package/cjs/components/{ActiveSwaps/ActiveSwapItem.d.ts → ActiveTransactions/ActiveTransactionItem.d.ts} +1 -1
- package/cjs/components/{ActiveSwaps/ActiveSwapItem.js → ActiveTransactions/ActiveTransactionItem.js} +6 -6
- package/cjs/{pages/SwapRoutesPage/SwapRoutesPage.d.ts → components/ActiveTransactions/ActiveTransactions.d.ts} +1 -1
- package/cjs/components/{ActiveSwaps/ActiveSwaps.js → ActiveTransactions/ActiveTransactions.js} +7 -7
- package/cjs/components/{ActiveSwaps/ActiveSwaps.style.d.ts → ActiveTransactions/ActiveTransactions.style.d.ts} +4 -4
- package/cjs/components/ActiveTransactions/index.d.ts +2 -0
- package/cjs/components/{ActiveSwaps → ActiveTransactions}/index.js +2 -2
- package/cjs/components/AmountInput/AmountInput.d.ts +12 -0
- package/cjs/components/AmountInput/AmountInput.js +57 -0
- package/{components/SwapInput/SwapInput.style.d.ts → cjs/components/AmountInput/AmountInput.style.d.ts} +1 -1
- package/{components/SwapInput/SwapInputAdornment.style.d.ts → cjs/components/AmountInput/AmountInputAdornment.style.d.ts} +2 -2
- package/cjs/components/AmountInput/AmountInputEndAdornment.d.ts +2 -0
- package/cjs/components/{SwapInput/SwapInputEndAdornment.js → AmountInput/AmountInputEndAdornment.js} +9 -9
- package/cjs/components/AmountInput/AmountInputStartAdornment.d.ts +3 -0
- package/cjs/components/{SwapInput/SwapInputStartAdornment.js → AmountInput/AmountInputStartAdornment.js} +5 -5
- package/cjs/components/AmountInput/FormPriceHelperText.d.ts +9 -0
- package/cjs/components/{SwapInput → AmountInput}/FormPriceHelperText.js +15 -9
- package/cjs/components/AmountInput/index.d.ts +1 -0
- package/cjs/{pages/SwapPage → components/AmountInput}/index.js +1 -1
- package/cjs/components/Card/CardIconButton.d.ts +2 -2
- package/cjs/components/Card/CardLabel.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.d.ts +2 -2
- package/cjs/components/ChainSelect/ChainSelect.js +1 -1
- package/cjs/components/ChainSelect/useChainSelect.d.ts +2 -2
- package/cjs/components/ChainSelect/useChainSelect.js +5 -5
- package/cjs/components/ContractComponent/ContractComponent.d.ts +2 -2
- package/cjs/components/ContractComponent/ContractComponent.js +3 -5
- package/cjs/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +3 -0
- package/cjs/components/DefaultTransactionButton/DefaultTransactionButton.js +36 -0
- package/cjs/components/DefaultTransactionButton/index.d.ts +2 -0
- package/cjs/components/{SwapButton → DefaultTransactionButton}/index.js +3 -3
- package/cjs/components/{SwapButton → DefaultTransactionButton}/types.d.ts +1 -2
- package/cjs/components/GasMessage/FundsSufficiencyMessage.js +1 -1
- package/cjs/components/GasMessage/GasRefuelMessage.js +1 -1
- package/cjs/components/GasMessage/GasSufficiencyMessage.js +2 -2
- package/cjs/components/Header/Header.style.d.ts +2 -2
- package/cjs/components/Header/NavigationHeader.js +19 -19
- package/cjs/components/Header/NavigationTabs.js +3 -3
- package/cjs/components/Header/NavigationTabs.style.js +3 -3
- package/cjs/components/Header/index.d.ts +1 -1
- package/cjs/components/Header/index.js +1 -1
- package/cjs/components/Header/types.d.ts +5 -2
- package/cjs/components/Header/useHeaderStore.d.ts +2 -0
- package/cjs/components/Header/{useHeaderActionStore.js → useHeaderStore.js} +13 -2
- package/cjs/components/Insurance/Insurance.js +2 -2
- package/cjs/components/Insurance/InsuranceCard.js +10 -7
- package/cjs/components/Insurance/InsuranceCollapsed.js +7 -3
- package/cjs/components/Insurance/index.d.ts +1 -0
- package/cjs/components/Insurance/index.js +1 -0
- package/cjs/components/Insurance/types.d.ts +11 -7
- package/cjs/components/ListItemButton.d.ts +1 -1
- package/cjs/components/NFT/NFT.d.ts +1 -2
- package/cjs/components/NFT/NFT.js +15 -13
- package/cjs/components/NFT/NFT.style.d.ts +1 -1
- package/cjs/components/NFT/NFTBase.d.ts +3 -0
- package/cjs/components/NFT/NFTBase.js +13 -0
- package/cjs/components/NFT/index.d.ts +1 -0
- package/cjs/components/NFT/index.js +1 -0
- package/cjs/components/NFT/types.d.ts +3 -1
- package/cjs/components/ProgressToNextUpdate/ProgressToNextUpdate.js +3 -3
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +9 -9
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
- package/cjs/components/RouteCard/RouteCard.d.ts +4 -0
- package/cjs/components/{SwapRouteCard/SwapRouteCard.js → RouteCard/RouteCard.js} +16 -12
- package/cjs/components/RouteCard/RouteCardEssentials.d.ts +3 -0
- package/cjs/components/{SwapRouteCard/SwapRouteCardEssentials.js → RouteCard/RouteCardEssentials.js} +7 -7
- package/cjs/components/RouteCard/RouteCardSkeleton.d.ts +4 -0
- package/cjs/components/{SwapRouteCard/SwapRouteCardSkeleton.js → RouteCard/RouteCardSkeleton.js} +6 -6
- package/cjs/components/RouteCard/RouteNotFoundCard.d.ts +2 -0
- package/cjs/components/{SwapRouteCard/SwapRouteNotFoundCard.js → RouteCard/RouteNotFoundCard.js} +4 -4
- package/cjs/components/RouteCard/index.d.ts +3 -0
- package/cjs/components/{SwapRoutes → RouteCard}/index.js +3 -2
- package/cjs/components/{SwapRouteCard → RouteCard}/types.d.ts +3 -3
- package/cjs/components/{SwapRoutes/SwapRoutes.d.ts → Routes/Routes.d.ts} +1 -1
- package/cjs/components/Routes/Routes.js +37 -0
- package/cjs/components/Routes/RoutesExpanded.d.ts +2 -0
- package/cjs/components/Routes/RoutesExpanded.js +44 -0
- package/cjs/components/Routes/index.d.ts +2 -0
- package/cjs/components/Routes/index.js +18 -0
- package/cjs/components/SelectChainAndToken.js +7 -7
- package/cjs/components/SelectTokenButton/SelectTokenButton.d.ts +2 -2
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +11 -11
- package/cjs/components/SendToWallet/SendToWallet.js +9 -10
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWalletButton.js +2 -2
- package/cjs/components/SmallAvatar.d.ts +1 -1
- package/cjs/components/Step/DestinationWalletAddress.js +2 -2
- package/cjs/components/Step/GasStepProcess.js +1 -1
- package/cjs/components/Step/Step.js +13 -13
- package/cjs/components/Step/StepList.d.ts +2 -1
- package/cjs/components/Step/StepList.js +4 -2
- package/cjs/components/Step/StepTimer.js +2 -2
- package/cjs/components/StepActions/StepActions.d.ts +3 -3
- package/cjs/components/StepActions/StepActions.js +31 -18
- package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
- package/cjs/components/StepActions/types.d.ts +2 -2
- package/cjs/components/Token/Token.js +1 -1
- package/cjs/components/TokenList/TokenList.js +2 -2
- package/cjs/components/TokenList/TokenList.style.d.ts +4 -4
- package/cjs/components/TokenList/TokenList.style.js +11 -8
- package/cjs/components/TokenList/TokenListItem.js +5 -9
- package/cjs/components/TokenList/TokenNotFound.d.ts +2 -2
- package/cjs/components/TokenList/TokenNotFound.js +2 -2
- package/cjs/components/TokenList/VirtualizedTokenList.js +2 -2
- package/cjs/components/TokenList/types.d.ts +2 -2
- package/cjs/components/TokenList/useTokenSelect.d.ts +2 -2
- package/cjs/components/TokenList/useTokenSelect.js +11 -9
- package/cjs/config/theme.js +1 -2
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +1 -1
- package/cjs/hooks/index.js +1 -1
- package/cjs/hooks/useChains.js +4 -4
- package/cjs/hooks/useFundsSufficiency.js +1 -5
- package/cjs/hooks/useGasRecommendation.d.ts +1 -1
- package/cjs/hooks/useGasRecommendation.js +5 -0
- package/cjs/hooks/useGasRefuel.js +4 -4
- package/cjs/hooks/useProcessMessage.d.ts +2 -2
- package/cjs/hooks/useProcessMessage.js +46 -46
- package/cjs/hooks/useRouteExecution.js +3 -4
- package/cjs/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
- package/cjs/hooks/{useSwapRoutes.js → useRoutes.js} +22 -24
- package/cjs/hooks/useTokenBalance.js +4 -5
- package/cjs/hooks/useTokenBalances.js +1 -5
- package/cjs/hooks/useTokens.js +21 -9
- package/cjs/i18n/bn.json +80 -80
- package/cjs/i18n/de.json +74 -74
- package/cjs/i18n/en.json +132 -131
- package/cjs/i18n/es.json +72 -72
- package/cjs/i18n/fr.json +102 -85
- package/cjs/i18n/id.json +145 -127
- package/cjs/i18n/it.json +154 -125
- package/cjs/i18n/ko.json +102 -85
- package/cjs/i18n/pt.json +133 -130
- package/cjs/i18n/th.json +102 -85
- package/cjs/i18n/tr.json +72 -72
- package/cjs/i18n/uk.json +131 -128
- package/cjs/i18n/vi.json +104 -79
- package/cjs/i18n/zh.json +104 -87
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +5 -1
- package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.d.ts +2 -0
- package/cjs/pages/{ActiveSwapsPage/ActiveSwapsEmpty.js → ActiveTransactionsPage/ActiveTransactionsEmpty.js} +4 -4
- package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.d.ts +1 -0
- package/cjs/pages/{ActiveSwapsPage/ActiveSwapsPage.js → ActiveTransactionsPage/ActiveTransactionsPage.js} +8 -8
- package/cjs/pages/ActiveTransactionsPage/index.d.ts +1 -0
- package/cjs/pages/{ActiveSwapsPage → ActiveTransactionsPage}/index.js +1 -1
- package/cjs/pages/MainPage/MainGasMessage.js +1 -1
- package/cjs/pages/MainPage/MainPage.js +7 -7
- package/cjs/pages/MainPage/ReviewButton.d.ts +2 -0
- package/cjs/pages/MainPage/ReviewButton.js +62 -0
- package/{components/SwapRoutes/SwapRoutes.d.ts → cjs/pages/RoutesPage/RoutesPage.d.ts} +1 -1
- package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.js → RoutesPage/RoutesPage.js} +11 -11
- package/cjs/pages/RoutesPage/index.d.ts +1 -0
- package/cjs/{components/SwapInput → pages/RoutesPage}/index.js +1 -1
- package/cjs/pages/SelectChainPage/types.d.ts +2 -2
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +1 -1
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +2 -2
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
- package/cjs/pages/SelectTokenPage/SearchTokenInput.js +3 -3
- package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -2
- package/cjs/pages/SelectTokenPage/types.js +1 -1
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
- package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/LanguageSelect.js +1 -1
- package/cjs/pages/SettingsPage/ResetSettingsButton.js +1 -1
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +1 -1
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsPage.d.ts +2 -0
- package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.js → TransactionDetailsPage/TransactionDetailsPage.js} +10 -9
- package/cjs/pages/TransactionDetailsPage/index.d.ts +1 -0
- package/cjs/pages/{SwapDetailsPage → TransactionDetailsPage}/index.js +1 -1
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryEmpty.d.ts +2 -0
- package/cjs/pages/{SwapHistoryPage/SwapHistoryEmpty.js → TransactionHistoryPage/TransactionHistoryEmpty.js} +4 -4
- package/cjs/pages/{SwapHistoryPage/SwapHistoryItem.d.ts → TransactionHistoryPage/TransactionHistoryItem.d.ts} +1 -1
- package/cjs/pages/{SwapHistoryPage/SwapHistoryItem.js → TransactionHistoryPage/TransactionHistoryItem.js} +4 -4
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +2 -0
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js +35 -0
- package/cjs/pages/TransactionHistoryPage/index.d.ts +1 -0
- package/cjs/pages/TransactionHistoryPage/index.js +17 -0
- package/cjs/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.js +5 -4
- package/cjs/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
- package/cjs/pages/TransactionPage/StartTransactionButton.js +21 -0
- package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +27 -24
- package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.js +5 -1
- package/cjs/pages/TransactionPage/TokenValueBottomSheet.js +38 -0
- package/cjs/pages/TransactionPage/TransactionPage.d.ts +2 -0
- package/cjs/pages/TransactionPage/TransactionPage.js +129 -0
- package/cjs/pages/TransactionPage/index.d.ts +1 -0
- package/cjs/pages/{SwapHistoryPage → TransactionPage}/index.js +1 -1
- package/cjs/pages/TransactionPage/types.d.ts +6 -0
- package/cjs/pages/TransactionPage/utils.d.ts +2 -0
- package/cjs/pages/TransactionPage/utils.js +10 -0
- package/cjs/providers/{SwapFormProvider/SwapFormProvider.d.ts → FormProvider/FormProvider.d.ts} +1 -1
- package/cjs/providers/{SwapFormProvider/SwapFormProvider.js → FormProvider/FormProvider.js} +11 -11
- package/cjs/providers/FormProvider/FormUpdater.d.ts +5 -0
- package/cjs/providers/{SwapFormProvider → FormProvider}/FormUpdater.js +14 -14
- package/cjs/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.js +6 -6
- package/cjs/providers/{SwapFormProvider → FormProvider}/index.d.ts +1 -1
- package/cjs/providers/{SwapFormProvider → FormProvider}/index.js +1 -1
- package/cjs/providers/FormProvider/types.d.ts +37 -0
- package/cjs/providers/FormProvider/types.js +23 -0
- package/cjs/providers/WalletProvider/WalletProvider.js +5 -3
- package/cjs/providers/WalletProvider/types.d.ts +1 -1
- package/cjs/providers/WidgetProvider/WidgetProvider.js +1 -1
- package/cjs/providers/index.d.ts +1 -1
- package/cjs/providers/index.js +1 -1
- package/cjs/stores/routes/createRouteExecutionStore.js +1 -1
- package/cjs/stores/routes/index.d.ts +1 -1
- package/cjs/stores/routes/index.js +1 -1
- package/cjs/stores/routes/types.js +1 -1
- package/cjs/stores/routes/useTransactionHistory.d.ts +2 -0
- package/cjs/stores/routes/{useSwapHistory.js → useTransactionHistory.js} +3 -3
- package/cjs/stores/routes/utils.d.ts +1 -0
- package/cjs/stores/routes/utils.js +5 -1
- package/cjs/types/events.d.ts +9 -1
- package/cjs/types/events.js +2 -1
- package/cjs/types/widget.d.ts +6 -4
- package/cjs/types/widget.js +3 -3
- package/cjs/utils/elements.js +1 -1
- package/cjs/utils/format.d.ts +1 -1
- package/cjs/utils/format.js +13 -15
- package/cjs/utils/navigationRoutes.d.ts +5 -5
- package/cjs/utils/navigationRoutes.js +15 -15
- package/components/{ActiveSwaps/ActiveSwapItem.d.ts → ActiveTransactions/ActiveTransactionItem.d.ts} +1 -1
- package/components/{ActiveSwaps/ActiveSwapItem.js → ActiveTransactions/ActiveTransactionItem.js} +3 -3
- package/components/ActiveTransactions/ActiveTransactions.d.ts +3 -0
- package/components/{ActiveSwaps/ActiveSwaps.js → ActiveTransactions/ActiveTransactions.js} +5 -5
- package/components/{ActiveSwaps/ActiveSwaps.style.d.ts → ActiveTransactions/ActiveTransactions.style.d.ts} +4 -4
- package/components/ActiveTransactions/index.d.ts +2 -0
- package/components/ActiveTransactions/index.js +2 -0
- package/components/AmountInput/AmountInput.d.ts +12 -0
- package/components/AmountInput/AmountInput.js +52 -0
- package/{cjs/components/SwapInput/SwapInput.style.d.ts → components/AmountInput/AmountInput.style.d.ts} +1 -1
- package/{cjs/components/SwapInput/SwapInputAdornment.style.d.ts → components/AmountInput/AmountInputAdornment.style.d.ts} +2 -2
- package/components/AmountInput/AmountInputEndAdornment.d.ts +2 -0
- package/components/{SwapInput/SwapInputEndAdornment.js → AmountInput/AmountInputEndAdornment.js} +7 -7
- package/components/AmountInput/AmountInputStartAdornment.d.ts +3 -0
- package/components/{SwapInput/SwapInputStartAdornment.js → AmountInput/AmountInputStartAdornment.js} +4 -4
- package/components/AmountInput/FormPriceHelperText.d.ts +9 -0
- package/components/{SwapInput → AmountInput}/FormPriceHelperText.js +14 -9
- package/components/AmountInput/index.d.ts +1 -0
- package/components/AmountInput/index.js +1 -0
- package/components/Card/CardIconButton.d.ts +2 -2
- package/components/Card/CardLabel.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.d.ts +2 -2
- package/components/ChainSelect/ChainSelect.js +2 -2
- package/components/ChainSelect/useChainSelect.d.ts +2 -2
- package/components/ChainSelect/useChainSelect.js +6 -6
- package/components/ContractComponent/ContractComponent.d.ts +2 -2
- package/components/ContractComponent/ContractComponent.js +3 -5
- package/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +3 -0
- package/components/DefaultTransactionButton/DefaultTransactionButton.js +32 -0
- package/components/DefaultTransactionButton/index.d.ts +2 -0
- package/components/DefaultTransactionButton/index.js +2 -0
- package/components/{SwapButton → DefaultTransactionButton}/types.d.ts +1 -2
- package/components/GasMessage/FundsSufficiencyMessage.js +1 -1
- package/components/GasMessage/GasRefuelMessage.js +1 -1
- package/components/GasMessage/GasSufficiencyMessage.js +2 -2
- package/components/Header/Header.style.d.ts +2 -2
- package/components/Header/NavigationHeader.js +19 -19
- package/components/Header/NavigationTabs.js +4 -4
- package/components/Header/NavigationTabs.style.js +3 -3
- package/components/Header/index.d.ts +1 -1
- package/components/Header/index.js +1 -1
- package/components/Header/types.d.ts +5 -2
- package/components/Header/useHeaderStore.d.ts +2 -0
- package/components/Header/useHeaderStore.js +25 -0
- package/components/Insurance/Insurance.js +2 -2
- package/components/Insurance/InsuranceCard.js +11 -8
- package/components/Insurance/InsuranceCollapsed.js +8 -4
- package/components/Insurance/index.d.ts +1 -0
- package/components/Insurance/index.js +1 -0
- package/components/Insurance/types.d.ts +11 -7
- package/components/ListItemButton.d.ts +1 -1
- package/components/NFT/NFT.d.ts +1 -2
- package/components/NFT/NFT.js +17 -15
- package/components/NFT/NFT.style.d.ts +1 -1
- package/components/NFT/NFTBase.d.ts +3 -0
- package/components/NFT/NFTBase.js +9 -0
- package/components/NFT/index.d.ts +1 -0
- package/components/NFT/index.js +1 -0
- package/components/NFT/types.d.ts +3 -1
- package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +4 -4
- package/components/ReverseTokensButton/ReverseTokensButton.js +10 -10
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
- package/components/RouteCard/RouteCard.d.ts +4 -0
- package/components/{SwapRouteCard/SwapRouteCard.js → RouteCard/RouteCard.js} +15 -11
- package/components/RouteCard/RouteCardEssentials.d.ts +3 -0
- package/components/{SwapRouteCard/SwapRouteCardEssentials.js → RouteCard/RouteCardEssentials.js} +3 -3
- package/components/RouteCard/RouteCardSkeleton.d.ts +4 -0
- package/components/{SwapRouteCard/SwapRouteCardSkeleton.js → RouteCard/RouteCardSkeleton.js} +4 -4
- package/components/RouteCard/RouteNotFoundCard.d.ts +2 -0
- package/components/{SwapRouteCard/SwapRouteNotFoundCard.js → RouteCard/RouteNotFoundCard.js} +2 -2
- package/components/RouteCard/index.d.ts +3 -0
- package/components/RouteCard/index.js +3 -0
- package/components/{SwapRouteCard → RouteCard}/types.d.ts +3 -3
- package/{cjs/components/ActiveSwaps/ActiveSwaps.d.ts → components/Routes/Routes.d.ts} +1 -1
- package/components/Routes/Routes.js +33 -0
- package/components/Routes/RoutesExpanded.d.ts +2 -0
- package/components/{SwapRoutes/SwapRoutesExpanded.js → Routes/RoutesExpanded.js} +12 -10
- package/components/Routes/index.d.ts +2 -0
- package/components/Routes/index.js +2 -0
- package/components/SelectChainAndToken.js +8 -8
- package/components/SelectTokenButton/SelectTokenButton.d.ts +2 -2
- package/components/SelectTokenButton/SelectTokenButton.js +12 -12
- package/components/SendToWallet/SendToWallet.js +10 -11
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SendToWallet/SendToWalletButton.js +3 -3
- package/components/SmallAvatar.d.ts +1 -1
- package/components/Step/DestinationWalletAddress.js +2 -2
- package/components/Step/GasStepProcess.js +1 -1
- package/components/Step/Step.js +13 -13
- package/components/Step/StepList.d.ts +2 -1
- package/components/Step/StepList.js +4 -2
- package/components/Step/StepTimer.js +2 -2
- package/components/StepActions/StepActions.d.ts +3 -3
- package/components/StepActions/StepActions.js +31 -18
- package/components/StepActions/StepActions.style.d.ts +1 -1
- package/components/StepActions/types.d.ts +2 -2
- package/components/Token/Token.js +1 -1
- package/components/TokenList/TokenList.js +3 -3
- package/components/TokenList/TokenList.style.d.ts +4 -4
- package/components/TokenList/TokenList.style.js +11 -8
- package/components/TokenList/TokenListItem.js +7 -11
- package/components/TokenList/TokenNotFound.d.ts +2 -2
- package/components/TokenList/TokenNotFound.js +3 -3
- package/components/TokenList/VirtualizedTokenList.js +2 -2
- package/components/TokenList/types.d.ts +2 -2
- package/components/TokenList/useTokenSelect.d.ts +2 -2
- package/components/TokenList/useTokenSelect.js +12 -10
- package/config/theme.js +1 -2
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +1 -1
- package/hooks/index.js +1 -1
- package/hooks/useChains.js +5 -5
- package/hooks/useFundsSufficiency.js +2 -6
- package/hooks/useGasRecommendation.d.ts +1 -1
- package/hooks/useGasRecommendation.js +5 -0
- package/hooks/useGasRefuel.js +5 -5
- package/hooks/useProcessMessage.d.ts +2 -2
- package/hooks/useProcessMessage.js +46 -46
- package/hooks/useRouteExecution.js +3 -4
- package/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
- package/hooks/{useSwapRoutes.js → useRoutes.js} +21 -23
- package/hooks/useTokenBalance.js +4 -5
- package/hooks/useTokenBalances.js +1 -5
- package/hooks/useTokens.js +21 -9
- package/i18n/bn.json +80 -80
- package/i18n/de.json +74 -74
- package/i18n/en.json +132 -131
- package/i18n/es.json +72 -72
- package/i18n/fr.json +102 -85
- package/i18n/id.json +145 -127
- package/i18n/it.json +154 -125
- package/i18n/ko.json +102 -85
- package/i18n/pt.json +133 -130
- package/i18n/th.json +102 -85
- package/i18n/tr.json +72 -72
- package/i18n/uk.json +131 -128
- package/i18n/vi.json +104 -79
- package/i18n/zh.json +104 -87
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +13 -13
- package/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.d.ts +2 -0
- package/pages/{ActiveSwapsPage/ActiveSwapsEmpty.js → ActiveTransactionsPage/ActiveTransactionsEmpty.js} +2 -2
- package/pages/ActiveTransactionsPage/ActiveTransactionsPage.d.ts +1 -0
- package/pages/{ActiveSwapsPage/ActiveSwapsPage.js → ActiveTransactionsPage/ActiveTransactionsPage.js} +7 -7
- package/pages/ActiveTransactionsPage/index.d.ts +1 -0
- package/pages/ActiveTransactionsPage/index.js +1 -0
- package/pages/MainPage/MainGasMessage.js +2 -2
- package/pages/MainPage/MainPage.js +7 -7
- package/pages/MainPage/ReviewButton.d.ts +2 -0
- package/pages/MainPage/ReviewButton.js +58 -0
- package/{components/ActiveSwaps/ActiveSwaps.d.ts → pages/RoutesPage/RoutesPage.d.ts} +1 -1
- package/pages/{SwapRoutesPage/SwapRoutesPage.js → RoutesPage/RoutesPage.js} +11 -11
- package/pages/RoutesPage/index.d.ts +1 -0
- package/pages/RoutesPage/index.js +1 -0
- package/pages/SelectChainPage/types.d.ts +2 -2
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +2 -2
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +2 -2
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
- package/pages/SelectTokenPage/SearchTokenInput.js +4 -4
- package/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
- package/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
- package/pages/SettingsPage/LanguageSelect.js +1 -1
- package/pages/SettingsPage/ResetSettingsButton.js +1 -1
- package/pages/SettingsPage/RoutePrioritySelect.js +1 -1
- package/pages/TransactionDetailsPage/TransactionDetailsPage.d.ts +2 -0
- package/pages/{SwapDetailsPage/SwapDetailsPage.js → TransactionDetailsPage/TransactionDetailsPage.js} +8 -7
- package/pages/TransactionDetailsPage/index.d.ts +1 -0
- package/pages/TransactionDetailsPage/index.js +1 -0
- package/pages/TransactionHistoryPage/TransactionHistoryEmpty.d.ts +2 -0
- package/pages/{SwapHistoryPage/SwapHistoryEmpty.js → TransactionHistoryPage/TransactionHistoryEmpty.js} +2 -2
- package/pages/{SwapHistoryPage/SwapHistoryItem.d.ts → TransactionHistoryPage/TransactionHistoryItem.d.ts} +1 -1
- package/pages/{SwapHistoryPage/SwapHistoryItem.js → TransactionHistoryPage/TransactionHistoryItem.js} +2 -2
- package/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +2 -0
- package/pages/TransactionHistoryPage/TransactionHistoryPage.js +31 -0
- package/pages/TransactionHistoryPage/index.d.ts +1 -0
- package/pages/TransactionHistoryPage/index.js +1 -0
- package/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.js +5 -4
- package/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
- package/pages/TransactionPage/StartTransactionButton.js +16 -0
- package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +28 -25
- package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.js +5 -1
- package/pages/TransactionPage/TokenValueBottomSheet.js +34 -0
- package/pages/TransactionPage/TransactionPage.d.ts +2 -0
- package/pages/TransactionPage/TransactionPage.js +125 -0
- package/pages/TransactionPage/index.d.ts +1 -0
- package/pages/TransactionPage/index.js +1 -0
- package/pages/TransactionPage/types.d.ts +6 -0
- package/pages/TransactionPage/utils.d.ts +2 -0
- package/pages/TransactionPage/utils.js +6 -0
- package/providers/{SwapFormProvider/SwapFormProvider.d.ts → FormProvider/FormProvider.d.ts} +1 -1
- package/providers/{SwapFormProvider/SwapFormProvider.js → FormProvider/FormProvider.js} +12 -12
- package/providers/FormProvider/FormUpdater.d.ts +5 -0
- package/providers/{SwapFormProvider → FormProvider}/FormUpdater.js +14 -14
- package/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.js +7 -7
- package/providers/{SwapFormProvider → FormProvider}/index.d.ts +1 -1
- package/providers/{SwapFormProvider → FormProvider}/index.js +1 -1
- package/providers/FormProvider/types.d.ts +37 -0
- package/providers/FormProvider/types.js +20 -0
- package/providers/WalletProvider/WalletProvider.js +5 -3
- package/providers/WalletProvider/types.d.ts +1 -1
- package/providers/WidgetProvider/WidgetProvider.js +2 -2
- package/providers/index.d.ts +1 -1
- package/providers/index.js +1 -1
- package/stores/routes/createRouteExecutionStore.js +1 -1
- package/stores/routes/index.d.ts +1 -1
- package/stores/routes/index.js +1 -1
- package/stores/routes/useTransactionHistory.d.ts +2 -0
- package/stores/routes/{useSwapHistory.js → useTransactionHistory.js} +1 -1
- package/stores/routes/utils.d.ts +1 -0
- package/stores/routes/utils.js +3 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/events.d.ts +9 -1
- package/types/events.js +1 -0
- package/types/widget.d.ts +6 -4
- package/utils/format.d.ts +1 -1
- package/utils/format.js +11 -13
- package/utils/navigationRoutes.d.ts +5 -5
- package/utils/navigationRoutes.js +15 -15
- package/cjs/components/ActiveSwaps/index.d.ts +0 -2
- package/cjs/components/Header/useHeaderActionStore.d.ts +0 -2
- package/cjs/components/SwapButton/SwapButton.d.ts +0 -3
- package/cjs/components/SwapButton/SwapButton.js +0 -56
- package/cjs/components/SwapButton/index.d.ts +0 -2
- package/cjs/components/SwapInput/FitInputText.d.ts +0 -3
- package/cjs/components/SwapInput/FitInputText.js +0 -19
- package/cjs/components/SwapInput/FormPriceHelperText.d.ts +0 -3
- package/cjs/components/SwapInput/SwapInput.d.ts +0 -4
- package/cjs/components/SwapInput/SwapInput.js +0 -41
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -2
- package/cjs/components/SwapInput/SwapInputStartAdornment.d.ts +0 -3
- package/cjs/components/SwapInput/index.d.ts +0 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +0 -4
- package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +0 -3
- package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.d.ts +0 -4
- package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +0 -2
- package/cjs/components/SwapRouteCard/index.d.ts +0 -3
- package/cjs/components/SwapRouteCard/index.js +0 -19
- package/cjs/components/SwapRoutes/SwapRoutes.js +0 -37
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -2
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +0 -42
- package/cjs/components/SwapRoutes/index.d.ts +0 -2
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +0 -2
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/cjs/pages/ActiveSwapsPage/index.d.ts +0 -1
- package/cjs/pages/MainPage/MainSwapButton.d.ts +0 -2
- package/cjs/pages/MainPage/MainSwapButton.js +0 -27
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.d.ts +0 -2
- package/cjs/pages/SwapDetailsPage/index.d.ts +0 -1
- package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.d.ts +0 -2
- package/cjs/pages/SwapHistoryPage/SwapHistoryPage.d.ts +0 -2
- package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +0 -35
- package/cjs/pages/SwapHistoryPage/index.d.ts +0 -1
- package/cjs/pages/SwapPage/StartSwapButton.d.ts +0 -4
- package/cjs/pages/SwapPage/StartSwapButton.js +0 -21
- package/cjs/pages/SwapPage/SwapPage.d.ts +0 -2
- package/cjs/pages/SwapPage/SwapPage.js +0 -99
- package/cjs/pages/SwapPage/TokenValueBottomSheet.js +0 -43
- package/cjs/pages/SwapPage/index.d.ts +0 -1
- package/cjs/pages/SwapPage/types.d.ts +0 -9
- package/cjs/pages/SwapRoutesPage/index.d.ts +0 -1
- package/cjs/pages/SwapRoutesPage/index.js +0 -17
- package/cjs/providers/SwapFormProvider/FormUpdater.d.ts +0 -5
- package/cjs/providers/SwapFormProvider/types.d.ts +0 -37
- package/cjs/providers/SwapFormProvider/types.js +0 -23
- package/cjs/stores/routes/useSwapHistory.d.ts +0 -2
- package/components/ActiveSwaps/index.d.ts +0 -2
- package/components/ActiveSwaps/index.js +0 -2
- package/components/Header/useHeaderActionStore.d.ts +0 -2
- package/components/Header/useHeaderActionStore.js +0 -14
- package/components/SwapButton/SwapButton.d.ts +0 -3
- package/components/SwapButton/SwapButton.js +0 -52
- package/components/SwapButton/index.d.ts +0 -2
- package/components/SwapButton/index.js +0 -2
- package/components/SwapInput/FitInputText.d.ts +0 -3
- package/components/SwapInput/FitInputText.js +0 -16
- package/components/SwapInput/FormPriceHelperText.d.ts +0 -3
- package/components/SwapInput/SwapInput.d.ts +0 -4
- package/components/SwapInput/SwapInput.js +0 -37
- package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -2
- package/components/SwapInput/SwapInputStartAdornment.d.ts +0 -3
- package/components/SwapInput/index.d.ts +0 -1
- package/components/SwapInput/index.js +0 -1
- package/components/SwapRouteCard/SwapRouteCard.d.ts +0 -4
- package/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +0 -3
- package/components/SwapRouteCard/SwapRouteCardSkeleton.d.ts +0 -4
- package/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +0 -2
- package/components/SwapRouteCard/index.d.ts +0 -3
- package/components/SwapRouteCard/index.js +0 -3
- package/components/SwapRoutes/SwapRoutes.js +0 -33
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -2
- package/components/SwapRoutes/index.d.ts +0 -2
- package/components/SwapRoutes/index.js +0 -2
- package/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +0 -2
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/pages/ActiveSwapsPage/index.d.ts +0 -1
- package/pages/ActiveSwapsPage/index.js +0 -1
- package/pages/MainPage/MainSwapButton.d.ts +0 -2
- package/pages/MainPage/MainSwapButton.js +0 -23
- package/pages/SwapDetailsPage/SwapDetailsPage.d.ts +0 -2
- package/pages/SwapDetailsPage/index.d.ts +0 -1
- package/pages/SwapDetailsPage/index.js +0 -1
- package/pages/SwapHistoryPage/SwapHistoryEmpty.d.ts +0 -2
- package/pages/SwapHistoryPage/SwapHistoryPage.d.ts +0 -2
- package/pages/SwapHistoryPage/SwapHistoryPage.js +0 -31
- package/pages/SwapHistoryPage/index.d.ts +0 -1
- package/pages/SwapHistoryPage/index.js +0 -1
- package/pages/SwapPage/StartSwapButton.d.ts +0 -4
- package/pages/SwapPage/StartSwapButton.js +0 -16
- package/pages/SwapPage/SwapPage.d.ts +0 -2
- package/pages/SwapPage/SwapPage.js +0 -95
- package/pages/SwapPage/TokenValueBottomSheet.js +0 -39
- package/pages/SwapPage/index.d.ts +0 -1
- package/pages/SwapPage/index.js +0 -1
- package/pages/SwapPage/types.d.ts +0 -9
- package/pages/SwapRoutesPage/SwapRoutesPage.d.ts +0 -3
- package/pages/SwapRoutesPage/index.d.ts +0 -1
- package/pages/SwapRoutesPage/index.js +0 -1
- package/providers/SwapFormProvider/FormUpdater.d.ts +0 -5
- package/providers/SwapFormProvider/types.d.ts +0 -37
- package/providers/SwapFormProvider/types.js +0 -20
- package/stores/routes/useSwapHistory.d.ts +0 -2
- /package/cjs/components/{ActiveSwaps/ActiveSwaps.style.js → ActiveTransactions/ActiveTransactions.style.js} +0 -0
- /package/cjs/components/{SwapInput/SwapInput.style.js → AmountInput/AmountInput.style.js} +0 -0
- /package/cjs/components/{SwapInput/SwapInputAdornment.style.js → AmountInput/AmountInputAdornment.style.js} +0 -0
- /package/cjs/components/{SwapButton → DefaultTransactionButton}/types.js +0 -0
- /package/cjs/components/{SwapRouteCard/SwapRouteCard.style.d.ts → RouteCard/RouteCard.style.d.ts} +0 -0
- /package/cjs/components/{SwapRouteCard/SwapRouteCard.style.js → RouteCard/RouteCard.style.js} +0 -0
- /package/cjs/components/{SwapRouteCard → RouteCard}/types.js +0 -0
- /package/cjs/components/{SwapRouteCard → RouteCard}/utils.d.ts +0 -0
- /package/cjs/components/{SwapRouteCard → RouteCard}/utils.js +0 -0
- /package/cjs/components/{SwapRoutes/SwapRoutesExpanded.style.d.ts → Routes/RoutesExpanded.style.d.ts} +0 -0
- /package/cjs/components/{SwapRoutes/SwapRoutesExpanded.style.js → Routes/RoutesExpanded.style.js} +0 -0
- /package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.style.d.ts → RoutesPage/RoutesPage.style.d.ts} +0 -0
- /package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.style.js → RoutesPage/RoutesPage.style.js} +0 -0
- /package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.style.d.ts → TransactionDetailsPage/TransactionDetailsPage.style.d.ts} +0 -0
- /package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.style.js → TransactionDetailsPage/TransactionDetailsPage.style.js} +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.d.ts +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.d.ts +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.d.ts +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.d.ts +0 -0
- /package/cjs/pages/{SwapPage/SwapPage.style.d.ts → TransactionPage/TransactionPage.style.d.ts} +0 -0
- /package/cjs/pages/{SwapPage/SwapPage.style.js → TransactionPage/TransactionPage.style.js} +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/types.js +0 -0
- /package/cjs/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.d.ts +0 -0
- /package/components/{ActiveSwaps/ActiveSwaps.style.js → ActiveTransactions/ActiveTransactions.style.js} +0 -0
- /package/components/{SwapInput/SwapInput.style.js → AmountInput/AmountInput.style.js} +0 -0
- /package/components/{SwapInput/SwapInputAdornment.style.js → AmountInput/AmountInputAdornment.style.js} +0 -0
- /package/components/{SwapButton → DefaultTransactionButton}/types.js +0 -0
- /package/components/{SwapRouteCard/SwapRouteCard.style.d.ts → RouteCard/RouteCard.style.d.ts} +0 -0
- /package/components/{SwapRouteCard/SwapRouteCard.style.js → RouteCard/RouteCard.style.js} +0 -0
- /package/components/{SwapRouteCard → RouteCard}/types.js +0 -0
- /package/components/{SwapRouteCard → RouteCard}/utils.d.ts +0 -0
- /package/components/{SwapRouteCard → RouteCard}/utils.js +0 -0
- /package/components/{SwapRoutes/SwapRoutesExpanded.style.d.ts → Routes/RoutesExpanded.style.d.ts} +0 -0
- /package/components/{SwapRoutes/SwapRoutesExpanded.style.js → Routes/RoutesExpanded.style.js} +0 -0
- /package/pages/{SwapRoutesPage/SwapRoutesPage.style.d.ts → RoutesPage/RoutesPage.style.d.ts} +0 -0
- /package/pages/{SwapRoutesPage/SwapRoutesPage.style.js → RoutesPage/RoutesPage.style.js} +0 -0
- /package/pages/{SwapDetailsPage/SwapDetailsPage.style.d.ts → TransactionDetailsPage/TransactionDetailsPage.style.d.ts} +0 -0
- /package/pages/{SwapDetailsPage/SwapDetailsPage.style.js → TransactionDetailsPage/TransactionDetailsPage.style.js} +0 -0
- /package/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.d.ts +0 -0
- /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.d.ts +0 -0
- /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.d.ts +0 -0
- /package/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.d.ts +0 -0
- /package/pages/{SwapPage/SwapPage.style.d.ts → TransactionPage/TransactionPage.style.d.ts} +0 -0
- /package/pages/{SwapPage/SwapPage.style.js → TransactionPage/TransactionPage.style.js} +0 -0
- /package/pages/{SwapPage → TransactionPage}/types.js +0 -0
- /package/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.IconButton = exports.ListItem = exports.ListItemButton = void 0;
|
|
4
4
|
const material_1 = require("@mui/material");
|
|
5
5
|
const ListItemSecondaryAction_1 = require("@mui/material/ListItemSecondaryAction");
|
|
6
6
|
const ListItemText_1 = require("@mui/material/ListItemText");
|
|
@@ -23,28 +23,31 @@ exports.ListItem = (0, styles_1.styled)(material_1.ListItem)(({ theme }) => ({
|
|
|
23
23
|
[`.${ListItemSecondaryAction_1.listItemSecondaryActionClasses.root}`]: {
|
|
24
24
|
right: theme.spacing(3),
|
|
25
25
|
},
|
|
26
|
+
[`& .${ListItemText_1.listItemTextClasses.primary}`]: {
|
|
27
|
+
height: 22,
|
|
28
|
+
},
|
|
26
29
|
[`& .${ListItemText_1.listItemTextClasses.primary}, & .${ListItemText_1.listItemTextClasses.secondary}`]: {
|
|
27
30
|
textOverflow: 'ellipsis',
|
|
28
31
|
overflow: 'hidden',
|
|
29
32
|
whiteSpace: 'nowrap',
|
|
30
33
|
},
|
|
31
34
|
}));
|
|
32
|
-
exports.
|
|
35
|
+
exports.IconButton = (0, styles_1.styled)(material_1.IconButton)(({ theme }) => ({
|
|
33
36
|
lineHeight: 1,
|
|
34
37
|
fontSize: '0.75rem',
|
|
35
38
|
fontWeight: 400,
|
|
36
|
-
padding: theme.spacing(0.375, 0.
|
|
39
|
+
padding: theme.spacing(0.375, 0.375),
|
|
40
|
+
marginLeft: theme.spacing(0.25),
|
|
37
41
|
color: 'inherit',
|
|
38
42
|
backgroundColor: 'unset',
|
|
43
|
+
minWidth: 'unset',
|
|
44
|
+
borderRadius: '50%',
|
|
39
45
|
'&:hover': {
|
|
40
46
|
backgroundColor: theme.palette.mode === 'light'
|
|
41
47
|
? (0, styles_1.alpha)(theme.palette.common.black, 0.04)
|
|
42
48
|
: (0, styles_1.alpha)(theme.palette.common.white, 0.08),
|
|
43
49
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
[`.${material_1.buttonClasses.endIcon} > *:nth-of-type(1)`]: {
|
|
48
|
-
fontSize: '0.75rem',
|
|
50
|
+
svg: {
|
|
51
|
+
fontSize: '0.875rem',
|
|
49
52
|
},
|
|
50
53
|
}));
|
|
@@ -30,18 +30,14 @@ const TokenListItemButton = ({ onClick, token, chain, showBalance, isBalanceLoad
|
|
|
30
30
|
setShowAddress(false);
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, dense: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondaryTypographyProps: {
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, dense: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol?.[0] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondaryTypographyProps: {
|
|
34
34
|
component: 'div',
|
|
35
|
-
|
|
36
|
-
overflow: 'auto',
|
|
37
|
-
marginLeft: -0.75,
|
|
38
|
-
},
|
|
39
|
-
}, secondary: (0, jsx_runtime_1.jsxs)(material_1.Box, { position: "relative", height: 18, ref: container, children: [(0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "down", in: !showAddress, container: container.current, style: {
|
|
35
|
+
}, secondary: (0, jsx_runtime_1.jsxs)(material_1.Box, { position: "relative", height: 20, ref: container, children: [(0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "down", in: !showAddress, container: container.current, style: {
|
|
40
36
|
position: 'absolute',
|
|
41
|
-
}, appear: false, children: (0, jsx_runtime_1.jsx)(material_1.Box, {
|
|
37
|
+
}, appear: false, children: (0, jsx_runtime_1.jsx)(material_1.Box, { pt: 0.25, children: token.name }) }), (0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "up", in: showAddress, container: container.current, style: {
|
|
42
38
|
position: 'absolute',
|
|
43
|
-
}, appear: false, mountOnEnter: true, children: (0, jsx_runtime_1.jsx)(TokenList_style_1.
|
|
44
|
-
value: token.amount,
|
|
39
|
+
}, appear: false, mountOnEnter: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", alignItems: "center", pt: 0.125, children: (0, utils_1.shortenAddress)(token.address) }), (0, jsx_runtime_1.jsx)(TokenList_style_1.IconButton, { size: "small", LinkComponent: material_1.Link, href: `${chain?.metamask.blockExplorerUrls[0]}address/${token.address}`, target: "_blank", rel: "nofollow noreferrer", onClick: (e) => e.stopPropagation(), children: (0, jsx_runtime_1.jsx)(OpenInNewRounded_1.default, {}) })] }) })] }) }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", noWrap: true, children: t('format.number', {
|
|
40
|
+
value: (0, utils_1.formatTokenAmount)(token.amount),
|
|
45
41
|
}) })) : null, tokenPrice ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD, children: t(`format.currency`, {
|
|
46
42
|
value: tokenPrice,
|
|
47
43
|
}) })) : null] }))) : null] }));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
3
|
-
export declare const TokenNotFound: React.FC<
|
|
2
|
+
import type { FormTypeProps } from '../../providers';
|
|
3
|
+
export declare const TokenNotFound: React.FC<FormTypeProps>;
|
|
@@ -11,7 +11,7 @@ const providers_1 = require("../../providers");
|
|
|
11
11
|
const TokenNotFound = ({ formType }) => {
|
|
12
12
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
13
13
|
const [selectedChainId] = (0, react_hook_form_1.useWatch)({
|
|
14
|
-
name: [providers_1.
|
|
14
|
+
name: [providers_1.FormKeyHelper.getChainKey(formType)],
|
|
15
15
|
});
|
|
16
16
|
const { getChainById } = (0, hooks_1.useChains)();
|
|
17
17
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
@@ -21,7 +21,7 @@ const TokenNotFound = ({ formType }) => {
|
|
|
21
21
|
flexDirection: 'column',
|
|
22
22
|
flex: 1,
|
|
23
23
|
padding: 3,
|
|
24
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, lineHeight: 1, children: (0, jsx_runtime_1.jsx)(SearchOff_1.default, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, px: 2, children: t('
|
|
24
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, lineHeight: 1, children: (0, jsx_runtime_1.jsx)(SearchOff_1.default, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, px: 2, children: t('info.message.emptyTokenList', {
|
|
25
25
|
chainName: getChainById(selectedChainId)?.name,
|
|
26
26
|
}) })] }));
|
|
27
27
|
};
|
|
@@ -49,10 +49,10 @@ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef,
|
|
|
49
49
|
}
|
|
50
50
|
return ((0, jsx_runtime_1.jsx)(material_1.List, { style: { height: getTotalSize() }, disablePadding: true, children: getVirtualItems().map((item) => {
|
|
51
51
|
const token = tokens[item.index];
|
|
52
|
-
return ((0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, chain: chain, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('
|
|
52
|
+
return ((0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, chain: chain, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('main.featuredTokens') })) : null, endAdornment: hasFeaturedTokens &&
|
|
53
53
|
token.featured &&
|
|
54
54
|
item.index === featuredTokensLastIndex &&
|
|
55
|
-
item.index !== tokensLastIndex ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, py: 1.25, children: t('
|
|
55
|
+
item.index !== tokensLastIndex ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, py: 1.25, children: t('main.otherTokens') })) : null }, item.key));
|
|
56
56
|
}) }));
|
|
57
57
|
};
|
|
58
58
|
exports.VirtualizedTokenList = VirtualizedTokenList;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ExtendedChain } from '@lifi/sdk';
|
|
2
2
|
import type { MutableRefObject } from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { FormType } from '../../providers';
|
|
4
4
|
import type { TokenAmount } from '../../types';
|
|
5
5
|
export interface TokenListProps {
|
|
6
|
-
formType:
|
|
6
|
+
formType: FormType;
|
|
7
7
|
height: number;
|
|
8
8
|
onClick?(): void;
|
|
9
9
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const useTokenSelect: (formType:
|
|
1
|
+
import type { FormType } from '../../providers';
|
|
2
|
+
export declare const useTokenSelect: (formType: FormType, onClick?: () => void) => (tokenAddress: string, chainId?: number) => void;
|
|
@@ -5,32 +5,34 @@ const react_1 = require("react");
|
|
|
5
5
|
const react_hook_form_1 = require("react-hook-form");
|
|
6
6
|
const providers_1 = require("../../providers");
|
|
7
7
|
const useTokenSelect = (formType, onClick) => {
|
|
8
|
-
const tokenKey = providers_1.
|
|
8
|
+
const tokenKey = providers_1.FormKeyHelper.getTokenKey(formType);
|
|
9
9
|
const { field: { onChange, onBlur }, } = (0, react_hook_form_1.useController)({ name: tokenKey });
|
|
10
10
|
const { setValue, getValues } = (0, react_hook_form_1.useFormContext)();
|
|
11
|
+
const { subvariant } = (0, providers_1.useWidgetConfig)();
|
|
11
12
|
return (0, react_1.useCallback)((tokenAddress, chainId) => {
|
|
12
13
|
onChange(tokenAddress);
|
|
13
14
|
onBlur();
|
|
14
|
-
const selectedChainId = chainId ?? getValues(providers_1.
|
|
15
|
+
const selectedChainId = chainId ?? getValues(providers_1.FormKeyHelper.getChainKey(formType));
|
|
15
16
|
// Set chain again to trigger URL builder update
|
|
16
|
-
setValue(providers_1.
|
|
17
|
+
setValue(providers_1.FormKeyHelper.getChainKey(formType), selectedChainId, {
|
|
17
18
|
shouldDirty: true,
|
|
18
19
|
shouldTouch: true,
|
|
19
20
|
});
|
|
20
|
-
setValue(providers_1.
|
|
21
|
+
setValue(providers_1.FormKeyHelper.getAmountKey(formType), '');
|
|
21
22
|
const oppositeFormType = formType === 'from' ? 'to' : 'from';
|
|
22
23
|
const [selectedOppositeToken, selectedOppositeChainId] = getValues([
|
|
23
|
-
providers_1.
|
|
24
|
-
providers_1.
|
|
24
|
+
providers_1.FormKeyHelper.getTokenKey(oppositeFormType),
|
|
25
|
+
providers_1.FormKeyHelper.getChainKey(oppositeFormType),
|
|
25
26
|
]);
|
|
26
27
|
if (selectedOppositeToken === tokenAddress &&
|
|
27
|
-
selectedOppositeChainId === selectedChainId
|
|
28
|
-
|
|
28
|
+
selectedOppositeChainId === selectedChainId &&
|
|
29
|
+
subvariant !== 'nft') {
|
|
30
|
+
setValue(providers_1.FormKeyHelper.getTokenKey(oppositeFormType), '', {
|
|
29
31
|
shouldDirty: true,
|
|
30
32
|
shouldTouch: true,
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
35
|
onClick?.();
|
|
34
|
-
}, [formType, getValues, onBlur, onChange, onClick, setValue]);
|
|
36
|
+
}, [formType, getValues, onBlur, onChange, onClick, setValue, subvariant]);
|
|
35
37
|
};
|
|
36
38
|
exports.useTokenSelect = useTokenSelect;
|
package/cjs/config/theme.js
CHANGED
|
@@ -6,7 +6,6 @@ const ButtonBase_1 = require("@mui/material/ButtonBase");
|
|
|
6
6
|
const DialogActions_1 = require("@mui/material/DialogActions");
|
|
7
7
|
const colors_1 = require("@mui/material/colors");
|
|
8
8
|
const styles_1 = require("@mui/material/styles");
|
|
9
|
-
const system_1 = require("@mui/system");
|
|
10
9
|
const palette = {
|
|
11
10
|
primary: {
|
|
12
11
|
main: '#3F49E1',
|
|
@@ -46,7 +45,7 @@ const shape = {
|
|
|
46
45
|
borderRadius: 12,
|
|
47
46
|
borderRadiusSecondary: 8,
|
|
48
47
|
};
|
|
49
|
-
const enterKeyframe = (0,
|
|
48
|
+
const enterKeyframe = (0, styles_1.keyframes) `
|
|
50
49
|
0% {
|
|
51
50
|
transform: scale(0);
|
|
52
51
|
opacity: 0.05;
|
package/cjs/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "2.0.
|
|
2
|
+
export declare const version = "2.0.1";
|
package/cjs/config/version.js
CHANGED
package/cjs/hooks/index.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export * from './useInitializer';
|
|
|
14
14
|
export * from './useNavigateBack';
|
|
15
15
|
export * from './useProcessMessage';
|
|
16
16
|
export * from './useRouteExecution';
|
|
17
|
+
export * from './useRoutes';
|
|
17
18
|
export * from './useScrollableContainer';
|
|
18
19
|
export * from './useSwapOnly';
|
|
19
|
-
export * from './useSwapRoutes';
|
|
20
20
|
export * from './useToken';
|
|
21
21
|
export * from './useTokenAddressBalance';
|
|
22
22
|
export * from './useTokenBalance';
|
package/cjs/hooks/index.js
CHANGED
|
@@ -30,9 +30,9 @@ __exportStar(require("./useInitializer"), exports);
|
|
|
30
30
|
__exportStar(require("./useNavigateBack"), exports);
|
|
31
31
|
__exportStar(require("./useProcessMessage"), exports);
|
|
32
32
|
__exportStar(require("./useRouteExecution"), exports);
|
|
33
|
+
__exportStar(require("./useRoutes"), exports);
|
|
33
34
|
__exportStar(require("./useScrollableContainer"), exports);
|
|
34
35
|
__exportStar(require("./useSwapOnly"), exports);
|
|
35
|
-
__exportStar(require("./useSwapRoutes"), exports);
|
|
36
36
|
__exportStar(require("./useToken"), exports);
|
|
37
37
|
__exportStar(require("./useTokenAddressBalance"), exports);
|
|
38
38
|
__exportStar(require("./useTokenBalance"), exports);
|
package/cjs/hooks/useChains.js
CHANGED
|
@@ -16,14 +16,14 @@ const useChains = () => {
|
|
|
16
16
|
const filteredChains = availableChains.filter((chain) => (0, providers_1.isItemAllowed)(chain.id, chains));
|
|
17
17
|
const chainOrder = initializeChains(filteredChains.map((chain) => chain.id));
|
|
18
18
|
const [fromChainValue, toChainValue] = getValues([
|
|
19
|
-
providers_1.
|
|
20
|
-
providers_1.
|
|
19
|
+
providers_1.FormKey.FromChain,
|
|
20
|
+
providers_1.FormKey.ToChain,
|
|
21
21
|
]);
|
|
22
22
|
if (!fromChainValue) {
|
|
23
|
-
setValue(providers_1.
|
|
23
|
+
setValue(providers_1.FormKey.FromChain, chainOrder[0]);
|
|
24
24
|
}
|
|
25
25
|
if (!toChainValue) {
|
|
26
|
-
setValue(providers_1.
|
|
26
|
+
setValue(providers_1.FormKey.ToChain, chainOrder[0]);
|
|
27
27
|
}
|
|
28
28
|
return { availableChains, filteredChains };
|
|
29
29
|
}, {
|
|
@@ -13,11 +13,7 @@ const useFundsSufficiency = (route) => {
|
|
|
13
13
|
const { account } = (0, providers_1.useWallet)();
|
|
14
14
|
const getTokenBalancesWithRetry = (0, useGetTokenBalancesWithRetry_1.useGetTokenBalancesWithRetry)(account.signer?.provider);
|
|
15
15
|
const [fromChainId, fromTokenAddress, fromAmount] = (0, react_hook_form_1.useWatch)({
|
|
16
|
-
name: [
|
|
17
|
-
providers_1.SwapFormKey.FromChain,
|
|
18
|
-
providers_1.SwapFormKey.FromToken,
|
|
19
|
-
providers_1.SwapFormKey.FromAmount,
|
|
20
|
-
],
|
|
16
|
+
name: [providers_1.FormKey.FromChain, providers_1.FormKey.FromToken, providers_1.FormKey.FromAmount],
|
|
21
17
|
});
|
|
22
18
|
let chainId = fromChainId;
|
|
23
19
|
let tokenAddress = fromTokenAddress;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ChainId } from '@lifi/sdk';
|
|
2
|
-
export declare const useGasRecommendation: (chainId: ChainId, fromChain?: ChainId, fromToken?: string) => import("@tanstack/react-query").UseQueryResult<import("@lifi/sdk").GasRecommendationResponse, unknown>;
|
|
2
|
+
export declare const useGasRecommendation: (chainId: ChainId, fromChain?: ChainId, fromToken?: string) => import("@tanstack/react-query").UseQueryResult<import("@lifi/sdk").GasRecommendationResponse | null, unknown>;
|
|
@@ -3,10 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useGasRecommendation = void 0;
|
|
4
4
|
const react_query_1 = require("@tanstack/react-query");
|
|
5
5
|
const providers_1 = require("../providers");
|
|
6
|
+
const useChains_1 = require("./useChains");
|
|
6
7
|
const refetchInterval = 60000;
|
|
7
8
|
const useGasRecommendation = (chainId, fromChain, fromToken) => {
|
|
8
9
|
const lifi = (0, providers_1.useLiFi)();
|
|
10
|
+
const { chains } = (0, useChains_1.useChains)();
|
|
9
11
|
return (0, react_query_1.useQuery)(['gas-recommendation', chainId, fromChain, fromToken], async ({ queryKey: [_, chainId, fromChain, fromToken] }) => {
|
|
12
|
+
if (!chains?.some((chain) => chain.id === chainId)) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
10
15
|
const gasRecommendation = await lifi.getGasRecommendation({
|
|
11
16
|
chainId: chainId,
|
|
12
17
|
fromChain: fromChain,
|
|
@@ -12,10 +12,10 @@ const useGasRefuel = () => {
|
|
|
12
12
|
const { getChainById } = (0, _1.useChains)();
|
|
13
13
|
const [fromChainId, fromTokenAddress, toChainId, toAddress] = (0, react_hook_form_1.useWatch)({
|
|
14
14
|
name: [
|
|
15
|
-
providers_1.
|
|
16
|
-
providers_1.
|
|
17
|
-
providers_1.
|
|
18
|
-
providers_1.
|
|
15
|
+
providers_1.FormKey.FromChain,
|
|
16
|
+
providers_1.FormKey.FromToken,
|
|
17
|
+
providers_1.FormKey.ToChain,
|
|
18
|
+
providers_1.FormKey.ToAddress,
|
|
19
19
|
],
|
|
20
20
|
});
|
|
21
21
|
const toChain = getChainById(toChainId);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { EVMChain, LifiStep, Process } from '@lifi/sdk';
|
|
2
2
|
import type { TFunction } from 'i18next';
|
|
3
|
-
import type {
|
|
3
|
+
import type { WidgetSubvariant } from '../types';
|
|
4
4
|
export declare const useProcessMessage: (step?: LifiStep, process?: Process) => {
|
|
5
5
|
title?: string | undefined;
|
|
6
6
|
message?: string | undefined;
|
|
7
7
|
};
|
|
8
|
-
export declare function getProcessMessage(t: TFunction, getChainById: (chainId: number) => EVMChain | undefined, step: LifiStep, process: Process,
|
|
8
|
+
export declare function getProcessMessage(t: TFunction, getChainById: (chainId: number) => EVMChain | undefined, step: LifiStep, process: Process, subvariant?: WidgetSubvariant): {
|
|
9
9
|
title?: string;
|
|
10
10
|
message?: string;
|
|
11
11
|
};
|
|
@@ -7,45 +7,45 @@ const providers_1 = require("../providers");
|
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
const useChains_1 = require("./useChains");
|
|
9
9
|
const useProcessMessage = (step, process) => {
|
|
10
|
-
const {
|
|
10
|
+
const { subvariant } = (0, providers_1.useWidgetConfig)();
|
|
11
11
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
12
12
|
const { getChainById } = (0, useChains_1.useChains)();
|
|
13
13
|
if (!step || !process) {
|
|
14
14
|
return {};
|
|
15
15
|
}
|
|
16
|
-
return getProcessMessage(t, getChainById, step, process,
|
|
16
|
+
return getProcessMessage(t, getChainById, step, process, subvariant);
|
|
17
17
|
};
|
|
18
18
|
exports.useProcessMessage = useProcessMessage;
|
|
19
19
|
const processStatusMessages = {
|
|
20
20
|
TOKEN_ALLOWANCE: {
|
|
21
|
-
STARTED: (t) => t(`
|
|
22
|
-
ACTION_REQUIRED: (t) => t(`
|
|
23
|
-
PENDING: (t) => t(`
|
|
24
|
-
DONE: (t) => t(`
|
|
21
|
+
STARTED: (t) => t(`main.process.tokenAllowance.started`),
|
|
22
|
+
ACTION_REQUIRED: (t) => t(`main.process.tokenAllowance.pending`),
|
|
23
|
+
PENDING: (t) => t(`main.process.tokenAllowance.pending`),
|
|
24
|
+
DONE: (t) => t(`main.process.tokenAllowance.done`),
|
|
25
25
|
},
|
|
26
26
|
SWITCH_CHAIN: {
|
|
27
|
-
ACTION_REQUIRED: (t) => t(`
|
|
28
|
-
DONE: (t) => t(`
|
|
27
|
+
ACTION_REQUIRED: (t) => t(`main.process.switchChain.actionRequired`),
|
|
28
|
+
DONE: (t) => t(`main.process.switchChain.done`),
|
|
29
29
|
},
|
|
30
30
|
SWAP: {
|
|
31
|
-
STARTED: (t) => t(`
|
|
32
|
-
ACTION_REQUIRED: (t) => t(`
|
|
33
|
-
PENDING: (t) => t(`
|
|
34
|
-
DONE: (t,
|
|
35
|
-
? t(`
|
|
36
|
-
: t(`
|
|
31
|
+
STARTED: (t) => t(`main.process.swap.started`),
|
|
32
|
+
ACTION_REQUIRED: (t) => t(`main.process.swap.actionRequired`),
|
|
33
|
+
PENDING: (t) => t(`main.process.swap.pending`),
|
|
34
|
+
DONE: (t, subvariant) => subvariant === 'nft'
|
|
35
|
+
? t(`main.process.nft.done`)
|
|
36
|
+
: t(`main.process.swap.done`),
|
|
37
37
|
},
|
|
38
38
|
CROSS_CHAIN: {
|
|
39
|
-
STARTED: (t) => t(`
|
|
40
|
-
ACTION_REQUIRED: (t) => t(`
|
|
41
|
-
PENDING: (t) => t(`
|
|
42
|
-
DONE: (t) => t(`
|
|
39
|
+
STARTED: (t) => t(`main.process.crossChain.started`),
|
|
40
|
+
ACTION_REQUIRED: (t) => t(`main.process.crossChain.actionRequired`),
|
|
41
|
+
PENDING: (t) => t(`main.process.crossChain.pending`),
|
|
42
|
+
DONE: (t) => t(`main.process.crossChain.done`),
|
|
43
43
|
},
|
|
44
44
|
RECEIVING_CHAIN: {
|
|
45
|
-
PENDING: (t) => t(`
|
|
46
|
-
DONE: (t,
|
|
47
|
-
? t(`
|
|
48
|
-
: t(`
|
|
45
|
+
PENDING: (t) => t(`main.process.receivingChain.pending`),
|
|
46
|
+
DONE: (t, subvariant) => subvariant === 'nft'
|
|
47
|
+
? t(`main.process.nft.done`)
|
|
48
|
+
: t(`main.process.receivingChain.done`),
|
|
49
49
|
},
|
|
50
50
|
TRANSACTION: {},
|
|
51
51
|
};
|
|
@@ -62,8 +62,8 @@ const processSubstatusMessages = {
|
|
|
62
62
|
},
|
|
63
63
|
DONE: {
|
|
64
64
|
// COMPLETED: 'The transfer is complete.',
|
|
65
|
-
PARTIAL: (t) => t(`
|
|
66
|
-
REFUNDED: (t) => t(`
|
|
65
|
+
PARTIAL: (t) => t(`main.process.receivingChain.partial`),
|
|
66
|
+
REFUNDED: (t) => t(`main.process.receivingChain.partial`),
|
|
67
67
|
},
|
|
68
68
|
FAILED: {
|
|
69
69
|
// TODO: should be moved to failed status
|
|
@@ -75,9 +75,9 @@ const processSubstatusMessages = {
|
|
|
75
75
|
INVALID: {},
|
|
76
76
|
NOT_FOUND: {},
|
|
77
77
|
};
|
|
78
|
-
function getProcessMessage(t, getChainById, step, process,
|
|
78
|
+
function getProcessMessage(t, getChainById, step, process, subvariant) {
|
|
79
79
|
if (process.error && process.status === 'FAILED') {
|
|
80
|
-
const getTransactionNotSentMessage = () => t(`
|
|
80
|
+
const getTransactionNotSentMessage = () => t(`error.message.transactionNotSent`, {
|
|
81
81
|
amount: (0, utils_1.formatTokenAmount)(step.action.fromAmount, step.action.fromToken.decimals),
|
|
82
82
|
tokenSymbol: step.action.fromToken.symbol,
|
|
83
83
|
chainName: getChainById(step.action.fromChainId)?.name ?? '',
|
|
@@ -86,50 +86,50 @@ function getProcessMessage(t, getChainById, step, process, variant) {
|
|
|
86
86
|
let message = '';
|
|
87
87
|
switch (process.error.code) {
|
|
88
88
|
case sdk_1.LifiErrorCode.AllowanceRequired:
|
|
89
|
-
title = t(`
|
|
90
|
-
message = t(`
|
|
89
|
+
title = t(`error.title.allowanceRequired`);
|
|
90
|
+
message = t(`error.message.allowanceRequired`, {
|
|
91
91
|
tokenSymbol: step.action.fromToken.symbol,
|
|
92
92
|
});
|
|
93
93
|
break;
|
|
94
94
|
case sdk_1.LifiErrorCode.BalanceError:
|
|
95
|
-
title = t(`
|
|
95
|
+
title = t(`error.title.balanceIsTooLow`);
|
|
96
96
|
message = getTransactionNotSentMessage();
|
|
97
97
|
break;
|
|
98
98
|
case sdk_1.LifiErrorCode.ChainSwitchError:
|
|
99
|
-
title = t(`
|
|
99
|
+
title = t(`error.title.chainSwitch`);
|
|
100
100
|
message = getTransactionNotSentMessage();
|
|
101
101
|
break;
|
|
102
102
|
case sdk_1.LifiErrorCode.GasLimitError:
|
|
103
|
-
title = t(`
|
|
103
|
+
title = t(`error.title.gasLimitIsTooLow`);
|
|
104
104
|
message = getTransactionNotSentMessage();
|
|
105
105
|
break;
|
|
106
106
|
case sdk_1.LifiErrorCode.InsufficientFunds:
|
|
107
|
-
title = t(`
|
|
108
|
-
message = `${t(`
|
|
107
|
+
title = t(`error.title.insufficientFunds`);
|
|
108
|
+
message = `${t(`error.message.insufficientFunds`)} ${getTransactionNotSentMessage()}`;
|
|
109
109
|
break;
|
|
110
110
|
case sdk_1.LifiErrorCode.SlippageError:
|
|
111
|
-
title = t(`
|
|
112
|
-
message = t(`
|
|
111
|
+
title = t(`error.title.slippageNotMet`);
|
|
112
|
+
message = t(`error.message.slippageThreshold`);
|
|
113
113
|
break;
|
|
114
114
|
case sdk_1.LifiErrorCode.TransactionFailed:
|
|
115
|
-
title = t(`
|
|
116
|
-
message = t(`
|
|
115
|
+
title = t(`error.title.transactionFailed`);
|
|
116
|
+
message = t(`error.message.transactionFailed`);
|
|
117
117
|
break;
|
|
118
118
|
case sdk_1.LifiErrorCode.TransactionUnderpriced:
|
|
119
|
-
title = t(`
|
|
119
|
+
title = t(`error.title.transactionUnderpriced`);
|
|
120
120
|
message = getTransactionNotSentMessage();
|
|
121
121
|
break;
|
|
122
122
|
case sdk_1.LifiErrorCode.TransactionUnprepared:
|
|
123
|
-
title = t(`
|
|
123
|
+
title = t(`error.title.transactionUnprepared`);
|
|
124
124
|
message = getTransactionNotSentMessage();
|
|
125
125
|
break;
|
|
126
126
|
case sdk_1.LifiErrorCode.TransactionCanceled:
|
|
127
|
-
title = t(`
|
|
127
|
+
title = t(`error.title.transactionCanceled`);
|
|
128
128
|
message = getTransactionNotSentMessage();
|
|
129
129
|
break;
|
|
130
130
|
case sdk_1.LifiErrorCode.TransactionRejected:
|
|
131
|
-
title = t(`
|
|
132
|
-
message = t(`
|
|
131
|
+
title = t(`error.title.transactionRejected`);
|
|
132
|
+
message = t(`error.message.transactionRejected`, {
|
|
133
133
|
amount: (0, utils_1.formatTokenAmount)(step.action.fromAmount, step.action.fromToken.decimals),
|
|
134
134
|
tokenSymbol: step.action.fromToken.symbol,
|
|
135
135
|
chainName: getChainById(step.action.fromChainId)?.name ?? '',
|
|
@@ -137,19 +137,19 @@ function getProcessMessage(t, getChainById, step, process, variant) {
|
|
|
137
137
|
break;
|
|
138
138
|
case sdk_1.LifiErrorCode.ProviderUnavailable:
|
|
139
139
|
default:
|
|
140
|
-
title = t(`
|
|
140
|
+
title = t(`error.title.unknown`);
|
|
141
141
|
if (process.txLink) {
|
|
142
|
-
message = t(`
|
|
142
|
+
message = t(`error.message.transactionFailed`);
|
|
143
143
|
}
|
|
144
144
|
else {
|
|
145
|
-
message = t(`
|
|
145
|
+
message = t(`error.message.unknown`);
|
|
146
146
|
}
|
|
147
147
|
break;
|
|
148
148
|
}
|
|
149
149
|
return { title, message };
|
|
150
150
|
}
|
|
151
151
|
const title = processSubstatusMessages[process.status]?.[process.substatus]?.(t) ??
|
|
152
|
-
processStatusMessages[process.type]?.[process.status]?.(t,
|
|
152
|
+
processStatusMessages[process.type]?.[process.status]?.(t, subvariant);
|
|
153
153
|
return { title };
|
|
154
154
|
}
|
|
155
155
|
exports.getProcessMessage = getProcessMessage;
|
|
@@ -48,10 +48,11 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
|
|
|
48
48
|
}
|
|
49
49
|
const currentChainId = await account.signer.getChainId();
|
|
50
50
|
if (currentChainId !== requiredChainId) {
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
51
|
+
const signer = await switchChain(requiredChainId);
|
|
52
|
+
if (!signer) {
|
|
53
53
|
throw new Error('Chain was not switched.');
|
|
54
54
|
}
|
|
55
|
+
return signer;
|
|
55
56
|
}
|
|
56
57
|
return account.signer;
|
|
57
58
|
};
|
|
@@ -108,11 +109,9 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
|
|
|
108
109
|
executeRouteMutation.mutateAsync(undefined, {
|
|
109
110
|
onError: (error) => {
|
|
110
111
|
console.warn('Execution failed!', routeId, error);
|
|
111
|
-
// Notification.showNotification(NotificationType.SwapExecution_ERROR);
|
|
112
112
|
},
|
|
113
113
|
onSuccess: (route) => {
|
|
114
114
|
console.log('Executed successfully!', route);
|
|
115
|
-
// Notification.showNotification(NotificationType.TRANSACTION_SUCCESSFULL);
|
|
116
115
|
},
|
|
117
116
|
});
|
|
118
117
|
}, [executeRouteMutation, routeId]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Route, RoutesResponse } from '@lifi/sdk';
|
|
2
|
-
interface
|
|
2
|
+
interface RoutesProps {
|
|
3
3
|
insurableRoute?: Route;
|
|
4
4
|
}
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const useRoutes: ({ insurableRoute }?: RoutesProps) => {
|
|
6
6
|
routes: Route[] | undefined;
|
|
7
7
|
isLoading: boolean;
|
|
8
8
|
isFetching: boolean;
|