@lifi/widget 2.0.0-beta.13 → 2.0.0-beta.15
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/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/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/{SwapInput/SwapInput.d.ts → AmountInput/AmountInput.d.ts} +3 -3
- package/cjs/components/{SwapInput/SwapInput.js → AmountInput/AmountInput.js} +14 -14
- 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} +8 -8
- 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 +4 -4
- 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 +2 -2
- 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/InsuranceCard.js +9 -12
- package/cjs/components/Insurance/InsuranceCollapsed.js +1 -1
- 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} +14 -14
- 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/StepTimer.js +2 -2
- package/cjs/components/StepActions/StepActions.d.ts +3 -3
- package/cjs/components/StepActions/StepActions.js +20 -16
- 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 +3 -7
- 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/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/useGasRefuel.js +4 -4
- package/cjs/hooks/useProcessMessage.d.ts +2 -2
- package/cjs/hooks/useProcessMessage.js +46 -46
- package/cjs/hooks/useRouteExecution.js +0 -2
- package/cjs/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
- package/cjs/hooks/{useSwapRoutes.js → useRoutes.js} +24 -24
- 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 +86 -86
- package/cjs/i18n/it.json +86 -86
- package/cjs/i18n/ko.json +102 -85
- package/cjs/i18n/pt.json +86 -86
- package/cjs/i18n/th.json +102 -85
- package/cjs/i18n/tr.json +72 -72
- package/cjs/i18n/uk.json +97 -97
- package/cjs/i18n/vi.json +86 -86
- package/cjs/i18n/zh.json +86 -86
- 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/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} +9 -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/{pages/SwapHistoryPage/SwapHistoryItem.d.ts → cjs/pages/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 +3 -3
- package/cjs/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
- package/cjs/pages/TransactionPage/StartTransactionButton.js +21 -0
- package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +24 -21
- package/cjs/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.js +1 -1
- package/cjs/pages/TransactionPage/TransactionPage.d.ts +2 -0
- package/cjs/pages/TransactionPage/TransactionPage.js +125 -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/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/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/types/events.js +1 -1
- package/cjs/types/widget.d.ts +4 -3
- package/cjs/types/widget.js +3 -3
- package/cjs/utils/elements.js +1 -1
- 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/{SwapInput/SwapInput.d.ts → AmountInput/AmountInput.d.ts} +3 -3
- package/components/{SwapInput/SwapInput.js → AmountInput/AmountInput.js} +11 -11
- 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} +6 -6
- 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 +5 -5
- 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 +2 -2
- 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/InsuranceCard.js +9 -12
- package/components/Insurance/InsuranceCollapsed.js +2 -2
- 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} +13 -13
- 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/StepTimer.js +2 -2
- package/components/StepActions/StepActions.d.ts +3 -3
- package/components/StepActions/StepActions.js +20 -16
- 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 +4 -8
- 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/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/useGasRefuel.js +5 -5
- package/hooks/useProcessMessage.d.ts +2 -2
- package/hooks/useProcessMessage.js +46 -46
- package/hooks/useRouteExecution.js +0 -2
- package/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
- package/hooks/{useSwapRoutes.js → useRoutes.js} +23 -23
- 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 +86 -86
- package/i18n/it.json +86 -86
- package/i18n/ko.json +102 -85
- package/i18n/pt.json +86 -86
- package/i18n/th.json +102 -85
- package/i18n/tr.json +72 -72
- package/i18n/uk.json +97 -97
- package/i18n/vi.json +86 -86
- package/i18n/zh.json +86 -86
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +30 -16
- 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/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} +7 -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/{cjs/pages/SwapHistoryPage/SwapHistoryItem.d.ts → pages/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 +3 -3
- package/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
- package/pages/TransactionPage/StartTransactionButton.js +16 -0
- package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +25 -22
- package/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.js +1 -1
- package/pages/TransactionPage/TransactionPage.d.ts +2 -0
- package/pages/TransactionPage/TransactionPage.js +121 -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/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/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/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +4 -3
- 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/FormPriceHelperText.d.ts +0 -9
- 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 -111
- 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/FormPriceHelperText.d.ts +0 -9
- 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 -107
- 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}/StatusBottomSheet.style.js +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/pages/{SwapPage → TransactionPage}/utils.d.ts +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/utils.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}/StatusBottomSheet.style.js +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/pages/{SwapPage → TransactionPage}/utils.d.ts +0 -0
- /package/pages/{SwapPage → TransactionPage}/utils.js +0 -0
- /package/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.d.ts +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const SelectTokenPage: FC<
|
|
2
|
+
import type { FormTypeProps } from '../../providers';
|
|
3
|
+
export declare const SelectTokenPage: FC<FormTypeProps>;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
export declare const ToggleButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").ToggleButtonClasses> | undefined;
|
|
5
|
-
color?: import("@mui/types").OverridableStringUnion<"
|
|
5
|
+
color?: import("@mui/types").OverridableStringUnion<"primary" | "secondary" | "error" | "warning" | "info" | "success" | "standard", import("@mui/material").ToggleButtonPropsColorOverrides> | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
fullWidth?: boolean | undefined;
|
|
9
9
|
onChange?: ((event: import("react").MouseEvent<HTMLElement, MouseEvent>, value: any) => void) | undefined;
|
|
10
10
|
onClick?: ((event: import("react").MouseEvent<HTMLElement, MouseEvent>, value: any) => void) | undefined;
|
|
11
11
|
selected?: boolean | undefined;
|
|
12
|
-
size?: import("@mui/types").OverridableStringUnion<"small" | "
|
|
12
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "large" | "medium", import("@mui/material").ToggleButtonPropsSizeOverrides> | undefined;
|
|
13
13
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
14
14
|
value: {};
|
|
15
15
|
} & Omit<{
|
|
@@ -17,5 +17,5 @@ export declare const ListItemButton: import("@emotion/styled").StyledComponent<i
|
|
|
17
17
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
18
18
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
19
19
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
20
|
-
}, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "
|
|
20
|
+
}, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "divider" | "dense" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
21
21
|
export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -21,5 +21,5 @@ export const ResetSettingsButton = () => {
|
|
|
21
21
|
}
|
|
22
22
|
toggleDialog();
|
|
23
23
|
};
|
|
24
|
-
return (_jsxs(Box, { px: 3, mt: 1.5, children: [_jsx(Button, { onClick: toggleDialog, fullWidth: true, children: t('button.resetSettings') }), _jsxs(Dialog, { open: open, onClose: toggleDialog, children: [_jsx(DialogTitle, { children: t('
|
|
24
|
+
return (_jsxs(Box, { px: 3, mt: 1.5, mb: 1, children: [_jsx(Button, { onClick: toggleDialog, fullWidth: true, children: t('button.resetSettings') }), _jsxs(Dialog, { open: open, onClose: toggleDialog, children: [_jsx(DialogTitle, { children: t('warning.title.resetSettings') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('warning.message.resetSettings') }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: toggleDialog, children: t('button.cancel') }), _jsx(Button, { variant: "contained", onClick: handleReset, autoFocus: true, children: t('button.reset') })] })] })] }));
|
|
25
25
|
};
|
|
@@ -12,7 +12,7 @@ export const RoutePrioritySelect = () => {
|
|
|
12
12
|
const { routePriority } = useSettings(['routePriority']);
|
|
13
13
|
const value = routePriority ?? '';
|
|
14
14
|
return (_jsxs(Card, { children: [_jsx(CardTitle, { children: t(`settings.routePriority`) }), _jsx(FormControl, { fullWidth: true, children: _jsx(Select, { MenuProps: { elevation: 2 }, value: value, onChange: (event) => setValue('routePriority', event.target.value), IconComponent: KeyboardArrowDownIcon, dense: true, children: Orders.map((order) => {
|
|
15
|
-
const tag = t(`
|
|
15
|
+
const tag = t(`main.tags.${order.toLowerCase()}`);
|
|
16
16
|
const tagName = `${tag[0]}${tag.slice(1).toLowerCase()}`;
|
|
17
17
|
return (_jsx(MenuItem, { value: order, children: tagName }, order));
|
|
18
18
|
}) }) })] }));
|
|
@@ -9,18 +9,18 @@ import { shallow } from 'zustand/shallow';
|
|
|
9
9
|
import { Card, CardTitle } from '../../components/Card';
|
|
10
10
|
import { ContractComponent } from '../../components/ContractComponent';
|
|
11
11
|
import { Dialog } from '../../components/Dialog';
|
|
12
|
-
import {
|
|
12
|
+
import { useHeaderStore } from '../../components/Header';
|
|
13
13
|
import { Insurance } from '../../components/Insurance';
|
|
14
14
|
import { getStepList } from '../../components/Step';
|
|
15
15
|
import { useNavigateBack } from '../../hooks';
|
|
16
16
|
import { useWidgetConfig } from '../../providers';
|
|
17
17
|
import { useRouteExecutionStore } from '../../stores';
|
|
18
18
|
import { formatTokenAmount } from '../../utils';
|
|
19
|
-
import { Container } from './
|
|
20
|
-
export const
|
|
19
|
+
import { Container } from './TransactionDetailsPage.style';
|
|
20
|
+
export const TransactionDetailsPage = () => {
|
|
21
21
|
const { t, i18n } = useTranslation();
|
|
22
22
|
const { navigateBack } = useNavigateBack();
|
|
23
|
-
const {
|
|
23
|
+
const { subvariant, contractComponent, contractSecondaryComponent } = useWidgetConfig();
|
|
24
24
|
const { state } = useLocation();
|
|
25
25
|
const [routeExecution, deleteRoute] = useRouteExecutionStore((store) => [store.routes[state?.routeId], store.deleteRoute], shallow);
|
|
26
26
|
const [open, setOpen] = useState(false);
|
|
@@ -45,7 +45,7 @@ export const SwapDetailsPage = () => {
|
|
|
45
45
|
await navigator.clipboard.writeText(supportId);
|
|
46
46
|
};
|
|
47
47
|
useEffect(() => {
|
|
48
|
-
return
|
|
48
|
+
return useHeaderStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteIcon, {}) }));
|
|
49
49
|
}, [toggleDialog]);
|
|
50
50
|
const startedAt = new Date(routeExecution?.route.steps[0].execution?.process[0].startedAt ?? 0);
|
|
51
51
|
return (_jsxs(Container, { children: [_jsxs(Box, { sx: {
|
|
@@ -54,8 +54,8 @@ export const SwapDetailsPage = () => {
|
|
|
54
54
|
justifyContent: 'space-between',
|
|
55
55
|
}, pb: 1, children: [_jsx(Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) }), _jsx(Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, {
|
|
56
56
|
timeStyle: 'short',
|
|
57
|
-
}).format(startedAt) })] }), getStepList(routeExecution?.route),
|
|
57
|
+
}).format(startedAt) })] }), getStepList(routeExecution?.route), subvariant === 'nft' ? (_jsx(ContractComponent, { mt: 2, children: contractSecondaryComponent || contractComponent })) : null, routeExecution?.route?.insurance?.state === 'INSURED' ? (_jsx(Insurance, { mt: 2, status: routeExecution.status, feeAmountUsd: routeExecution.route.insurance.feeAmountUsd, insuredAmount: formatTokenAmount(routeExecution.route.toAmountMin, routeExecution.route.toToken.decimals), insuredTokenSymbol: routeExecution.route.toToken.symbol, insurableRouteId: routeExecution.route.id, insuranceCoverageId: insuranceCoverageId })) : null, _jsxs(Card, { mt: 2, children: [_jsxs(Box, { sx: {
|
|
58
58
|
display: 'flex',
|
|
59
59
|
flex: 1,
|
|
60
|
-
}, children: [_jsx(CardTitle, { flex: 1, children: t('
|
|
60
|
+
}, children: [_jsx(CardTitle, { flex: 1, children: t('main.supportId') }), _jsx(Box, { mr: 1, mt: 1, children: _jsx(IconButton, { size: "medium", onClick: copySupportId, children: _jsx(ContentCopyIcon, { fontSize: "small" }) }) })] }), _jsx(Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), _jsx(Box, { mt: 2, children: _jsx(Button, { href: "https://discord.gg/lifi", target: "_blank", rel: "nofollow noreferrer", fullWidth: true, children: t('button.contactSupport') }) }), _jsxs(Dialog, { open: open, onClose: toggleDialog, children: [_jsx(DialogTitle, { children: t('warning.title.deleteTransaction') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('warning.message.deleteTransactionHistory') }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: toggleDialog, children: t('button.cancel') }), _jsx(Button, { variant: "contained", onClick: handleDeleteRoute, autoFocus: true, children: t('button.delete') })] })] })] }));
|
|
61
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TransactionDetailsPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TransactionDetailsPage';
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import ReceiptLongRoundedIcon from '@mui/icons-material/ReceiptLongRounded';
|
|
3
3
|
import { Container, Typography } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
export const
|
|
5
|
+
export const TransactionHistoryEmpty = () => {
|
|
6
6
|
const { t } = useTranslation();
|
|
7
7
|
return (_jsxs(Container, { sx: {
|
|
8
8
|
display: 'flex',
|
|
@@ -11,5 +11,5 @@ export const SwapHistoryEmpty = () => {
|
|
|
11
11
|
alignItems: 'center',
|
|
12
12
|
justifyContent: 'center',
|
|
13
13
|
paddingY: 12,
|
|
14
|
-
}, children: [_jsx(Typography, { fontSize: 48, children: _jsx(ReceiptLongRoundedIcon, { fontSize: "inherit" }) }), _jsx(Typography, { fontSize: 18, fontWeight: 700, children: t('
|
|
14
|
+
}, children: [_jsx(Typography, { fontSize: 48, children: _jsx(ReceiptLongRoundedIcon, { fontSize: "inherit" }) }), _jsx(Typography, { fontSize: 18, fontWeight: 700, children: t('info.title.emptyTransactionHistory') }), _jsx(Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, children: t('info.message.emptyTransactionHistory') })] }));
|
|
15
15
|
};
|
|
@@ -5,11 +5,11 @@ import { useNavigate } from 'react-router-dom';
|
|
|
5
5
|
import { Card } from '../../components/Card';
|
|
6
6
|
import { Token, TokenDivider } from '../../components/Token';
|
|
7
7
|
import { navigationRoutes } from '../../utils';
|
|
8
|
-
export const
|
|
8
|
+
export const TransactionHistoryItem = ({ route }) => {
|
|
9
9
|
const { i18n } = useTranslation();
|
|
10
10
|
const navigate = useNavigate();
|
|
11
11
|
const handleClick = () => {
|
|
12
|
-
navigate(navigationRoutes.
|
|
12
|
+
navigate(navigationRoutes.transactionDetails, {
|
|
13
13
|
state: { routeId: route.id },
|
|
14
14
|
});
|
|
15
15
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import DeleteIcon from '@mui/icons-material/DeleteOutline';
|
|
3
|
+
import { Button, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton, Stack, } from '@mui/material';
|
|
4
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { Dialog } from '../../components/Dialog';
|
|
7
|
+
import { useHeaderStore } from '../../components/Header';
|
|
8
|
+
import { useWallet } from '../../providers';
|
|
9
|
+
import { useRouteExecutionStore } from '../../stores';
|
|
10
|
+
import { useTransactionHistory } from '../../stores/routes';
|
|
11
|
+
import { TransactionHistoryEmpty } from './TransactionHistoryEmpty';
|
|
12
|
+
import { TransactionHistoryItem } from './TransactionHistoryItem';
|
|
13
|
+
export const TransactionHistoryPage = () => {
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
const { account } = useWallet();
|
|
16
|
+
const transactions = useTransactionHistory(account.address);
|
|
17
|
+
const deleteRoutes = useRouteExecutionStore((store) => store.deleteRoutes);
|
|
18
|
+
const [open, setOpen] = useState(false);
|
|
19
|
+
const toggleDialog = useCallback(() => {
|
|
20
|
+
setOpen((open) => !open);
|
|
21
|
+
}, []);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (transactions.length) {
|
|
24
|
+
return useHeaderStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteIcon, {}) }));
|
|
25
|
+
}
|
|
26
|
+
}, [transactions.length, toggleDialog]);
|
|
27
|
+
if (!transactions.length) {
|
|
28
|
+
return _jsx(TransactionHistoryEmpty, {});
|
|
29
|
+
}
|
|
30
|
+
return (_jsxs(Container, { children: [_jsx(Stack, { spacing: 2, mt: 1, children: transactions.length ? (transactions.map(({ route }) => (_jsx(TransactionHistoryItem, { route: route }, route.id)))) : (_jsx(TransactionHistoryEmpty, {})) }), _jsxs(Dialog, { open: open, onClose: toggleDialog, children: [_jsx(DialogTitle, { children: t('warning.title.deleteTransactionHistory') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('warning.message.deleteTransactionHistory') }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: toggleDialog, children: t('button.cancel') }), _jsx(Button, { variant: "contained", onClick: () => deleteRoutes('completed'), autoFocus: true, children: t('button.delete') })] })] })] }));
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TransactionHistoryPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TransactionHistoryPage';
|
|
@@ -44,11 +44,11 @@ const ExchangeRateBottomSheetContent = ({ data, onCancel, onContinue }) => {
|
|
|
44
44
|
const { t } = useTranslation();
|
|
45
45
|
const ref = useRef();
|
|
46
46
|
useSetContentHeight(ref);
|
|
47
|
-
return (_jsxs(Box, { p: 3, ref: ref, children: [_jsxs(CenterContainer, { children: [_jsx(IconCircle, { status: "warning", mb: 1, children: _jsx(WarningRoundedIcon, { color: "warning" }) }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('
|
|
47
|
+
return (_jsxs(Box, { p: 3, ref: ref, children: [_jsxs(CenterContainer, { children: [_jsx(IconCircle, { status: "warning", mb: 1, children: _jsx(WarningRoundedIcon, { color: "warning" }) }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('warning.title.rateChanged') })] }), _jsx(Typography, { py: 1, children: t('warning.message.rateChanged') }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [_jsx(Typography, { children: t('main.quotedAmount') }), _jsxs(Typography, { fontWeight: 600, children: [t('format.number', {
|
|
48
48
|
value: formatTokenAmount(data?.oldToAmount, data?.toToken.decimals, 5),
|
|
49
|
-
}), ' ', data?.toToken.symbol] })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('
|
|
49
|
+
}), ' ', data?.toToken.symbol] })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('main.currentAmount') }), _jsxs(Typography, { fontWeight: 600, children: [t('format.number', {
|
|
50
50
|
value: formatTokenAmount(data?.newToAmount, data?.toToken.decimals, 5),
|
|
51
|
-
}), ' ', data?.toToken.symbol] })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('
|
|
51
|
+
}), ' ', data?.toToken.symbol] })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('main.rateChange') }), _jsxs(Typography, { fontWeight: 600, children: [Big(data?.newToAmount || 0)
|
|
52
52
|
.div(Big(data?.oldToAmount || 0))
|
|
53
53
|
.minus(1)
|
|
54
54
|
.mul(100)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StartTransactionButtonProps } from './types';
|
|
3
|
+
export declare const StartTransactionButton: React.FC<StartTransactionButtonProps>;
|
|
4
|
+
export declare const StartInsurableTransactionButton: React.FC<StartTransactionButtonProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DefaultTransactionButton } from '../../components/DefaultTransactionButton';
|
|
3
|
+
import { useFundsSufficiency, useGasSufficiency, useRoutes } from '../../hooks';
|
|
4
|
+
import { useRouteExecutionStore } from '../../stores';
|
|
5
|
+
export const StartTransactionButton = ({ onClick, route, text, loading, }) => {
|
|
6
|
+
const { insufficientGas, isInitialLoading: isGasSufficiencyLoading } = useGasSufficiency(route);
|
|
7
|
+
const { insufficientFunds, isInitialLoading: isFundsSufficiencyLoading } = useFundsSufficiency(route);
|
|
8
|
+
return (_jsx(DefaultTransactionButton, { onClick: onClick, text: text, disabled: insufficientFunds || !!insufficientGas?.length, loading: isFundsSufficiencyLoading || isGasSufficiencyLoading || loading }));
|
|
9
|
+
};
|
|
10
|
+
export const StartInsurableTransactionButton = ({ onClick, text, route, loading, disabled, insurableRouteId }) => {
|
|
11
|
+
const routeExecution = useRouteExecutionStore((state) => state.routes[insurableRouteId]);
|
|
12
|
+
const { isFetching } = useRoutes({
|
|
13
|
+
insurableRoute: routeExecution?.route,
|
|
14
|
+
});
|
|
15
|
+
return (_jsx(StartTransactionButton, { onClick: onClick, text: text, route: route, disabled: disabled, loading: loading || isFetching, insurableRouteId: insurableRouteId }));
|
|
16
|
+
};
|
|
@@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
10
10
|
import { BottomSheet } from '../../components/BottomSheet';
|
|
11
11
|
import { Token } from '../../components/Token';
|
|
12
12
|
import { getProcessMessage, useChains, useNavigateBack, useTokenBalance, } from '../../hooks';
|
|
13
|
-
import {
|
|
13
|
+
import { FormKey, useWidgetConfig } from '../../providers';
|
|
14
14
|
import { RouteExecutionStatus } from '../../stores';
|
|
15
15
|
import { formatTokenAmount, hasEnumFlag, navigationRoutes, shortenAddress, } from '../../utils';
|
|
16
16
|
import { CenterContainer, IconCircle } from './StatusBottomSheet.style';
|
|
@@ -20,7 +20,7 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
20
20
|
const ref = useRef(null);
|
|
21
21
|
const { getChainById } = useChains();
|
|
22
22
|
const { setValue } = useFormContext();
|
|
23
|
-
const {
|
|
23
|
+
const { subvariant, contractComponent, contractSecondaryComponent, contractCompactComponent, } = useWidgetConfig();
|
|
24
24
|
const toToken = {
|
|
25
25
|
...(route.steps.at(-1)?.execution?.toToken ?? route.toToken),
|
|
26
26
|
amount: route.steps.at(-1)?.execution?.toAmount ??
|
|
@@ -30,8 +30,8 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
30
30
|
const { token, refetch, refetchNewBalance, refetchAllBalances } = useTokenBalance(toToken, route.toAddress);
|
|
31
31
|
const clearFromAmount = () => {
|
|
32
32
|
refetchAllBalances();
|
|
33
|
-
setValue(
|
|
34
|
-
setValue(
|
|
33
|
+
setValue(FormKey.FromAmount, '');
|
|
34
|
+
setValue(FormKey.ToAmount, '');
|
|
35
35
|
};
|
|
36
36
|
const handleDone = () => {
|
|
37
37
|
clearFromAmount();
|
|
@@ -41,13 +41,13 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
41
41
|
clearFromAmount();
|
|
42
42
|
if (toToken.chainId !== route.toToken.chainId &&
|
|
43
43
|
toToken.address !== route.toToken.address) {
|
|
44
|
-
setValue(
|
|
45
|
-
setValue(
|
|
46
|
-
setValue(
|
|
47
|
-
setValue(
|
|
44
|
+
setValue(FormKey.FromAmount, formatTokenAmount(toToken.amount, toToken.decimals), { shouldTouch: true });
|
|
45
|
+
setValue(FormKey.FromChain, toToken.chainId, { shouldTouch: true });
|
|
46
|
+
setValue(FormKey.FromToken, toToken.address, { shouldTouch: true });
|
|
47
|
+
setValue(FormKey.ToChain, route.toToken.chainId, {
|
|
48
48
|
shouldTouch: true,
|
|
49
49
|
});
|
|
50
|
-
setValue(
|
|
50
|
+
setValue(FormKey.ToToken, route.toToken.address, {
|
|
51
51
|
shouldTouch: true,
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -59,11 +59,12 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
59
59
|
};
|
|
60
60
|
const handleSeeDetails = () => {
|
|
61
61
|
handleClose();
|
|
62
|
-
navigate(navigationRoutes.
|
|
62
|
+
navigate(navigationRoutes.transactionDetails, {
|
|
63
63
|
state: { routeId: route.id },
|
|
64
64
|
replace: true,
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
+
const transactionType = route.fromChainId === route.toChainId ? 'swap' : 'bridge';
|
|
67
68
|
let title;
|
|
68
69
|
let primaryMessage;
|
|
69
70
|
let secondaryMessage;
|
|
@@ -71,11 +72,11 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
71
72
|
switch (status) {
|
|
72
73
|
case RouteExecutionStatus.Done: {
|
|
73
74
|
title =
|
|
74
|
-
|
|
75
|
-
? t('
|
|
76
|
-
: t(
|
|
75
|
+
subvariant === 'nft'
|
|
76
|
+
? t('success.title.purchaseSuccessful')
|
|
77
|
+
: t(`success.title.${transactionType}Successful`);
|
|
77
78
|
if (token) {
|
|
78
|
-
primaryMessage = t('
|
|
79
|
+
primaryMessage = t('success.message.exchangeSuccessful', {
|
|
79
80
|
amount: formatTokenAmount(token.amount),
|
|
80
81
|
tokenSymbol: token.symbol,
|
|
81
82
|
chainName: getChainById(token.chainId)?.name,
|
|
@@ -86,13 +87,13 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
86
87
|
break;
|
|
87
88
|
}
|
|
88
89
|
case RouteExecutionStatus.Done | RouteExecutionStatus.Partial: {
|
|
89
|
-
title = t(
|
|
90
|
-
primaryMessage = t('
|
|
90
|
+
title = t(`success.title.${transactionType}PartiallySuccessful`);
|
|
91
|
+
primaryMessage = t('success.message.exchangePartiallySuccessful', {
|
|
91
92
|
tool: route.steps.at(-1)?.toolDetails.name,
|
|
92
93
|
tokenSymbol: route.steps.at(-1)?.action.toToken.symbol,
|
|
93
94
|
});
|
|
94
95
|
if (token) {
|
|
95
|
-
secondaryMessage = t('
|
|
96
|
+
secondaryMessage = t('success.message.exchangeSuccessful', {
|
|
96
97
|
amount: formatTokenAmount(token.amount),
|
|
97
98
|
tokenSymbol: token.symbol,
|
|
98
99
|
chainName: getChainById(token.chainId)?.name,
|
|
@@ -103,13 +104,13 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
103
104
|
break;
|
|
104
105
|
}
|
|
105
106
|
case RouteExecutionStatus.Done | RouteExecutionStatus.Refunded: {
|
|
106
|
-
title = t('
|
|
107
|
-
primaryMessage = t('
|
|
107
|
+
title = t('success.title.refundIssued');
|
|
108
|
+
primaryMessage = t('success.message.exchangePartiallySuccessful', {
|
|
108
109
|
tool: route.steps.at(-1)?.toolDetails.name,
|
|
109
110
|
tokenSymbol: route.steps.at(-1)?.action.toToken.symbol,
|
|
110
111
|
});
|
|
111
112
|
if (token) {
|
|
112
|
-
secondaryMessage = t('
|
|
113
|
+
secondaryMessage = t('success.message.exchangeSuccessful', {
|
|
113
114
|
amount: formatTokenAmount(token.amount),
|
|
114
115
|
tokenSymbol: token.symbol,
|
|
115
116
|
chainName: getChainById(token.chainId)?.name,
|
|
@@ -144,9 +145,11 @@ export const StatusBottomSheet = ({ status, route, }) => {
|
|
|
144
145
|
ref.current?.open();
|
|
145
146
|
}
|
|
146
147
|
}, [refetch, refetchNewBalance, status]);
|
|
147
|
-
const showContractComponent =
|
|
148
|
+
const showContractComponent = subvariant === 'nft' && hasEnumFlag(status, RouteExecutionStatus.Done);
|
|
148
149
|
return (_jsx(BottomSheet, { ref: ref, children: _jsxs(Box, { p: 3, children: [!showContractComponent ? (_jsx(CenterContainer, { children: _jsxs(IconCircle, { status: status, mb: 1, children: [status === RouteExecutionStatus.Idle ? (_jsx(InfoRoundedIcon, { color: "primary" })) : null, status === RouteExecutionStatus.Done ? (_jsx(DoneIcon, { color: "success" })) : null, hasEnumFlag(status, RouteExecutionStatus.Partial) ||
|
|
149
|
-
hasEnumFlag(status, RouteExecutionStatus.Refunded) ? (_jsx(WarningRoundedIcon, { color: "warning" })) : null, hasEnumFlag(status, RouteExecutionStatus.Failed) ? (_jsx(ErrorRoundedIcon, { color: "error" })) : null] }) })) : null, _jsx(CenterContainer, { children: _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: title }) }), showContractComponent ? (contractCompactComponent ||
|
|
150
|
+
hasEnumFlag(status, RouteExecutionStatus.Refunded) ? (_jsx(WarningRoundedIcon, { color: "warning" })) : null, hasEnumFlag(status, RouteExecutionStatus.Failed) ? (_jsx(ErrorRoundedIcon, { color: "error" })) : null] }) })) : null, _jsx(CenterContainer, { children: _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: title }) }), showContractComponent ? (contractCompactComponent ||
|
|
151
|
+
contractSecondaryComponent ||
|
|
152
|
+
contractComponent) : (_jsx(CenterContainer, { children: hasEnumFlag(status, RouteExecutionStatus.Done) ? (_jsx(Token, { token: toToken, py: 1, disableDescription: true })) : null })), !showContractComponent ? (_jsx(Typography, { py: 1, children: primaryMessage })) : null, secondaryMessage ? (_jsx(Typography, { py: 1, children: secondaryMessage })) : null, _jsx(Box, { mt: 2, children: _jsxs(Button, { variant: "contained", fullWidth: true, onClick: handlePrimaryButton, children: [status === RouteExecutionStatus.Idle ? t('button.ok') : null, hasEnumFlag(status, RouteExecutionStatus.Done)
|
|
150
153
|
? t('button.done')
|
|
151
154
|
: null, status === RouteExecutionStatus.Failed
|
|
152
155
|
? t('button.seeDetails')
|
|
@@ -18,7 +18,7 @@ const TokenValueBottomSheetContent = ({ route, onCancel, onContinue, }) => {
|
|
|
18
18
|
const { t } = useTranslation();
|
|
19
19
|
const ref = useRef();
|
|
20
20
|
useSetContentHeight(ref);
|
|
21
|
-
return (_jsxs(Box, { p: 3, ref: ref, children: [_jsxs(CenterContainer, { children: [_jsx(IconCircle, { status: "warning", mb: 1, children: _jsx(WarningRoundedIcon, { color: "warning" }) }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('
|
|
21
|
+
return (_jsxs(Box, { p: 3, ref: ref, children: [_jsxs(CenterContainer, { children: [_jsx(IconCircle, { status: "warning", mb: 1, children: _jsx(WarningRoundedIcon, { color: "warning" }) }), _jsx(Typography, { py: 1, fontSize: 18, fontWeight: 700, children: t('warning.title.highValueLoss') })] }), _jsx(Typography, { py: 1, children: t('warning.message.highValueLoss') }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 1, children: [_jsx(Typography, { children: t('main.sending') }), _jsx(Typography, { fontWeight: 600, children: t('format.currency', { value: route.fromAmountUSD }) })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('main.gasCost') }), _jsx(Typography, { fontWeight: 600, children: t('format.currency', { value: route.gasCostUSD }) })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('main.receiving') }), _jsx(Typography, { fontWeight: 600, children: t('format.currency', { value: route.toAmountUSD }) })] }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 0.25, children: [_jsx(Typography, { children: t('main.valueLoss') }), _jsx(Typography, { fontWeight: 600, children: calcValueLoss(route) })] }), _jsxs(Box, { display: "flex", mt: 3, children: [_jsx(Button, { variant: "text", onClick: onCancel, fullWidth: true, children: t('button.cancel') }), _jsx(Box, { display: "flex", p: 1 }), _jsx(Button, { variant: "contained", onClick: onContinue, fullWidth: true, children: t('button.continue') })] })] }));
|
|
22
22
|
};
|
|
23
23
|
export const getTokenValueLossThreshold = (route) => {
|
|
24
24
|
if (!route) {
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
3
|
+
import { Box, Button, Tooltip } from '@mui/material';
|
|
4
|
+
import { useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { useFormContext } from 'react-hook-form';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { useLocation } from 'react-router-dom';
|
|
8
|
+
import { ContractComponent } from '../../components/ContractComponent';
|
|
9
|
+
import { GasMessage } from '../../components/GasMessage';
|
|
10
|
+
import { useHeaderStore } from '../../components/Header';
|
|
11
|
+
import { Insurance } from '../../components/Insurance';
|
|
12
|
+
import { getStepList } from '../../components/Step';
|
|
13
|
+
import { useNavigateBack, useRouteExecution, useWidgetEvents, } from '../../hooks';
|
|
14
|
+
import { FormKey, useWidgetConfig } from '../../providers';
|
|
15
|
+
import { RouteExecutionStatus } from '../../stores';
|
|
16
|
+
import { WidgetEvent } from '../../types/events';
|
|
17
|
+
import { formatTokenAmount } from '../../utils';
|
|
18
|
+
import { ExchangeRateBottomSheet } from './ExchangeRateBottomSheet';
|
|
19
|
+
import { StartInsurableTransactionButton, StartTransactionButton, } from './StartTransactionButton';
|
|
20
|
+
import { StatusBottomSheet } from './StatusBottomSheet';
|
|
21
|
+
import { TokenValueBottomSheet, getTokenValueLossThreshold, } from './TokenValueBottomSheet';
|
|
22
|
+
import { Container } from './TransactionPage.style';
|
|
23
|
+
import { calcValueLoss } from './utils';
|
|
24
|
+
export const TransactionPage = () => {
|
|
25
|
+
const { t } = useTranslation();
|
|
26
|
+
const { setValue } = useFormContext();
|
|
27
|
+
const emitter = useWidgetEvents();
|
|
28
|
+
const { navigateBack } = useNavigateBack();
|
|
29
|
+
const { subvariant, insurance, contractComponent, contractSecondaryComponent, } = useWidgetConfig();
|
|
30
|
+
const { state } = useLocation();
|
|
31
|
+
const stateRouteId = state?.routeId;
|
|
32
|
+
const [routeId, setRouteId] = useState(stateRouteId);
|
|
33
|
+
const tokenValueBottomSheetRef = useRef(null);
|
|
34
|
+
const exchangeRateBottomSheetRef = useRef(null);
|
|
35
|
+
const onAcceptExchangeRateUpdate = (resolver, data) => {
|
|
36
|
+
exchangeRateBottomSheetRef.current?.open(resolver, data);
|
|
37
|
+
};
|
|
38
|
+
const { route, status, executeRoute, restartRoute, deleteRoute } = useRouteExecution({
|
|
39
|
+
routeId: routeId,
|
|
40
|
+
onAcceptExchangeRateUpdate,
|
|
41
|
+
});
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (route && subvariant !== 'nft') {
|
|
44
|
+
const transactionType = route.fromChainId === route.toChainId ? 'Swap' : 'Bridge';
|
|
45
|
+
return useHeaderStore
|
|
46
|
+
.getState()
|
|
47
|
+
.setTitle(status === RouteExecutionStatus.Idle
|
|
48
|
+
? t(`button.review${transactionType}`)
|
|
49
|
+
: t(`header.${transactionType.toLowerCase()}`));
|
|
50
|
+
}
|
|
51
|
+
}, [route, status, subvariant, t]);
|
|
52
|
+
if (!route) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const tokenValueLossThresholdExceeded = getTokenValueLossThreshold(route);
|
|
56
|
+
const handleExecuteRoute = () => {
|
|
57
|
+
if (tokenValueBottomSheetRef.current?.isOpen()) {
|
|
58
|
+
emitter.emit(WidgetEvent.RouteHighValueLoss, {
|
|
59
|
+
fromAmountUsd: route.fromAmountUSD,
|
|
60
|
+
gasCostUSD: route.gasCostUSD,
|
|
61
|
+
toAmountUSD: route.toAmountUSD,
|
|
62
|
+
valueLoss: calcValueLoss(route),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
tokenValueBottomSheetRef.current?.close();
|
|
66
|
+
executeRoute();
|
|
67
|
+
setValue(FormKey.FromAmount, '');
|
|
68
|
+
};
|
|
69
|
+
const handleStartClick = async () => {
|
|
70
|
+
if (status === RouteExecutionStatus.Idle) {
|
|
71
|
+
if (tokenValueLossThresholdExceeded && subvariant !== 'nft') {
|
|
72
|
+
tokenValueBottomSheetRef.current?.open();
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
handleExecuteRoute();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (status === RouteExecutionStatus.Failed) {
|
|
79
|
+
restartRoute();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const handleRemoveRoute = () => {
|
|
83
|
+
navigateBack();
|
|
84
|
+
deleteRoute();
|
|
85
|
+
};
|
|
86
|
+
const getButtonText = () => {
|
|
87
|
+
switch (status) {
|
|
88
|
+
case RouteExecutionStatus.Idle:
|
|
89
|
+
switch (subvariant) {
|
|
90
|
+
case 'nft':
|
|
91
|
+
return t('button.buyNow');
|
|
92
|
+
case 'refuel':
|
|
93
|
+
return t('button.startBridging');
|
|
94
|
+
default:
|
|
95
|
+
const transactionType = route.fromChainId === route.toChainId ? 'Swapping' : 'Bridging';
|
|
96
|
+
return t(`button.start${transactionType}`);
|
|
97
|
+
}
|
|
98
|
+
case RouteExecutionStatus.Failed:
|
|
99
|
+
return t('button.tryAgain');
|
|
100
|
+
default:
|
|
101
|
+
return '';
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const insuredRoute = route.insurance?.state === 'INSURED';
|
|
105
|
+
const insurableRoute = insurance &&
|
|
106
|
+
subvariant !== 'refuel' &&
|
|
107
|
+
status === RouteExecutionStatus.Idle &&
|
|
108
|
+
route.insurance?.state === 'INSURABLE';
|
|
109
|
+
const insuranceAvailable = insuredRoute || insurableRoute;
|
|
110
|
+
const StartButton = insurableRoute
|
|
111
|
+
? StartInsurableTransactionButton
|
|
112
|
+
: StartTransactionButton;
|
|
113
|
+
const getInsuranceCoverageId = () => route.steps[0].execution?.process
|
|
114
|
+
.filter((process) => process.type !== 'TOKEN_ALLOWANCE')
|
|
115
|
+
.find((process) => process.txHash)?.txHash ?? route.fromAddress;
|
|
116
|
+
return (_jsxs(Container, { children: [getStepList(route), subvariant === 'nft' ? (_jsx(ContractComponent, { mt: 2, children: contractSecondaryComponent || contractComponent })) : null, insuranceAvailable ? (_jsx(Insurance, { mt: 2, status: status, insurableRouteId: stateRouteId, feeAmountUsd: route.insurance.feeAmountUsd, insuredAmount: formatTokenAmount(route.toAmountMin, route.toToken.decimals), insuredTokenSymbol: route.toToken.symbol, insuranceCoverageId: getInsuranceCoverageId(), onChange: setRouteId })) : null, status === RouteExecutionStatus.Idle ||
|
|
117
|
+
status === RouteExecutionStatus.Failed ? (_jsxs(_Fragment, { children: [_jsx(GasMessage, { mt: 2, route: route }), _jsxs(Box, { mt: 2, display: "flex", children: [_jsx(StartButton, { text: getButtonText(), onClick: handleStartClick, route: route, insurableRouteId: stateRouteId }), status === RouteExecutionStatus.Failed ? (_jsx(Tooltip, { title: t('button.removeTransaction'), placement: "bottom-end", enterDelay: 400, arrow: true, children: _jsx(Button, { onClick: handleRemoveRoute, sx: {
|
|
118
|
+
minWidth: 48,
|
|
119
|
+
marginLeft: 1,
|
|
120
|
+
}, children: _jsx(DeleteIcon, {}) }) })) : null] })] })) : null, status ? _jsx(StatusBottomSheet, { status: status, route: route }) : null, tokenValueLossThresholdExceeded && subvariant !== 'nft' ? (_jsx(TokenValueBottomSheet, { route: route, ref: tokenValueBottomSheetRef, onContinue: handleExecuteRoute })) : null, _jsx(ExchangeRateBottomSheet, { ref: exchangeRateBottomSheetRef })] }));
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TransactionPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TransactionPage';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Route } from '@lifi/sdk';
|
|
2
|
+
import type { DefaultTransactionButtonProps } from '../../components/DefaultTransactionButton';
|
|
3
|
+
export interface StartTransactionButtonProps extends DefaultTransactionButtonProps {
|
|
4
|
+
route?: Route;
|
|
5
|
+
insurableRouteId: string;
|
|
6
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { FormProvider, useForm } from 'react-hook-form';
|
|
3
|
+
import { FormProvider as ReactHookFormProvider, useForm, } from 'react-hook-form';
|
|
4
4
|
import { useWidgetConfig } from '../WidgetProvider';
|
|
5
5
|
import { FormUpdater } from './FormUpdater';
|
|
6
|
-
import {
|
|
6
|
+
import { FormKey } from './types';
|
|
7
7
|
export const formDefaultValues = {
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
8
|
+
[FormKey.FromAmount]: '',
|
|
9
|
+
[FormKey.ToAddress]: '',
|
|
10
|
+
[FormKey.TokenSearchFilter]: '',
|
|
11
|
+
[FormKey.ContractOutputsToken]: '',
|
|
12
|
+
[FormKey.ToContractAddress]: '',
|
|
13
|
+
[FormKey.ToContractCallData]: '',
|
|
14
|
+
[FormKey.ToContractGasLimit]: '',
|
|
15
|
+
[FormKey.ToAmount]: '',
|
|
16
16
|
};
|
|
17
|
-
export const
|
|
17
|
+
export const FormProvider = ({ children, }) => {
|
|
18
18
|
const { fromChain, fromToken, fromAmount, toChain, toToken, toAddress } = useWidgetConfig();
|
|
19
19
|
const defaultValues = useMemo(() => ({
|
|
20
20
|
...formDefaultValues,
|
|
@@ -31,5 +31,5 @@ export const SwapFormProvider = ({ children, }) => {
|
|
|
31
31
|
// values,
|
|
32
32
|
defaultValues,
|
|
33
33
|
});
|
|
34
|
-
return (_jsxs(
|
|
34
|
+
return (_jsxs(ReactHookFormProvider, { ...methods, children: [_jsx(FormUpdater, { defaultValues: defaultValues }), children] }));
|
|
35
35
|
};
|