@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
package/types/widget.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type { Components, PaletteMode, PaletteOptions, Shape, Theme } from '@mui
|
|
|
4
4
|
import type { TypographyOptions } from '@mui/material/styles/createTypography';
|
|
5
5
|
import type { CSSProperties, ReactNode, RefObject } from 'react';
|
|
6
6
|
import type { LanguageKey, LanguageResources } from '../providers';
|
|
7
|
-
export type WidgetVariant = 'default' | 'expandable' | 'drawer'
|
|
8
|
-
export type WidgetSubvariant = 'default' | 'split';
|
|
7
|
+
export type WidgetVariant = 'default' | 'expandable' | 'drawer';
|
|
8
|
+
export type WidgetSubvariant = 'default' | 'split' | 'nft' | 'refuel';
|
|
9
9
|
export declare enum DisabledUI {
|
|
10
10
|
FromAmount = "fromAmount",
|
|
11
11
|
FromToken = "fromToken",
|
|
@@ -68,6 +68,7 @@ export interface WidgetConfig {
|
|
|
68
68
|
toAmount?: number | string;
|
|
69
69
|
contract?: WidgetContract;
|
|
70
70
|
contractComponent?: ReactNode;
|
|
71
|
+
contractSecondaryComponent?: ReactNode;
|
|
71
72
|
contractCompactComponent?: ReactNode;
|
|
72
73
|
contractTool?: WidgetContractTool;
|
|
73
74
|
fee?: number;
|
|
@@ -87,7 +88,7 @@ export interface WidgetConfig {
|
|
|
87
88
|
useRecommendedRoute?: boolean;
|
|
88
89
|
walletManagement?: WidgetWalletManagement;
|
|
89
90
|
sdkConfig?: SDKConfig;
|
|
90
|
-
|
|
91
|
+
buildUrl?: boolean;
|
|
91
92
|
localStorageKeyPrefix?: string;
|
|
92
93
|
bridges?: {
|
|
93
94
|
allow?: string[];
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const navigationRoutes: {
|
|
2
2
|
home: string;
|
|
3
|
-
|
|
3
|
+
activeTransactions: string;
|
|
4
4
|
bridges: string;
|
|
5
5
|
exchanges: string;
|
|
6
6
|
fromChain: string;
|
|
7
7
|
fromToken: string;
|
|
8
|
+
routes: string;
|
|
8
9
|
selectWallet: string;
|
|
9
10
|
settings: string;
|
|
10
|
-
swapDetails: string;
|
|
11
|
-
swapExecution: string;
|
|
12
|
-
swapHistory: string;
|
|
13
|
-
swapRoutes: string;
|
|
14
11
|
toChain: string;
|
|
15
12
|
toToken: string;
|
|
16
13
|
toTokenNative: string;
|
|
14
|
+
transactionDetails: string;
|
|
15
|
+
transactionExecution: string;
|
|
16
|
+
transactionHistory: string;
|
|
17
17
|
};
|
|
18
18
|
export declare const navigationRoutesValues: string[];
|
|
19
19
|
export declare const stickyHeaderRoutes: string[];
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
export const navigationRoutes = {
|
|
2
2
|
home: '/',
|
|
3
|
-
|
|
3
|
+
activeTransactions: 'active-transactions',
|
|
4
4
|
bridges: 'bridges',
|
|
5
5
|
exchanges: 'exchanges',
|
|
6
6
|
fromChain: 'from-chain',
|
|
7
7
|
fromToken: 'from-token',
|
|
8
|
+
routes: 'routes',
|
|
8
9
|
selectWallet: 'wallet',
|
|
9
10
|
settings: 'settings',
|
|
10
|
-
swapDetails: 'swap-details',
|
|
11
|
-
swapExecution: 'swap-execution',
|
|
12
|
-
swapHistory: 'swap-history',
|
|
13
|
-
swapRoutes: 'swap-routes',
|
|
14
11
|
toChain: 'to-chain',
|
|
15
12
|
toToken: 'to-token',
|
|
16
13
|
toTokenNative: 'to-token-native',
|
|
14
|
+
transactionDetails: 'transaction-details',
|
|
15
|
+
transactionExecution: 'transaction-execution',
|
|
16
|
+
transactionHistory: 'transaction-history',
|
|
17
17
|
};
|
|
18
18
|
export const navigationRoutesValues = Object.values(navigationRoutes);
|
|
19
19
|
export const stickyHeaderRoutes = [
|
|
20
|
-
navigationRoutes.
|
|
20
|
+
navigationRoutes.activeTransactions,
|
|
21
21
|
navigationRoutes.bridges,
|
|
22
22
|
navigationRoutes.exchanges,
|
|
23
23
|
navigationRoutes.fromChain,
|
|
24
24
|
navigationRoutes.home,
|
|
25
|
+
navigationRoutes.routes,
|
|
25
26
|
navigationRoutes.selectWallet,
|
|
26
27
|
navigationRoutes.settings,
|
|
27
|
-
navigationRoutes.swapDetails,
|
|
28
|
-
navigationRoutes.swapExecution,
|
|
29
|
-
navigationRoutes.swapHistory,
|
|
30
|
-
navigationRoutes.swapRoutes,
|
|
31
28
|
navigationRoutes.toChain,
|
|
32
29
|
navigationRoutes.toTokenNative,
|
|
30
|
+
navigationRoutes.transactionDetails,
|
|
31
|
+
navigationRoutes.transactionExecution,
|
|
32
|
+
navigationRoutes.transactionHistory,
|
|
33
33
|
];
|
|
34
34
|
export const backButtonRoutes = [
|
|
35
|
-
navigationRoutes.
|
|
35
|
+
navigationRoutes.activeTransactions,
|
|
36
36
|
navigationRoutes.bridges,
|
|
37
37
|
navigationRoutes.exchanges,
|
|
38
38
|
navigationRoutes.fromChain,
|
|
39
39
|
navigationRoutes.fromToken,
|
|
40
|
+
navigationRoutes.routes,
|
|
40
41
|
navigationRoutes.selectWallet,
|
|
41
42
|
navigationRoutes.settings,
|
|
42
|
-
navigationRoutes.swapDetails,
|
|
43
|
-
navigationRoutes.swapExecution,
|
|
44
|
-
navigationRoutes.swapHistory,
|
|
45
|
-
navigationRoutes.swapRoutes,
|
|
46
43
|
navigationRoutes.toChain,
|
|
47
44
|
navigationRoutes.toToken,
|
|
48
45
|
navigationRoutes.toTokenNative,
|
|
46
|
+
navigationRoutes.transactionDetails,
|
|
47
|
+
navigationRoutes.transactionExecution,
|
|
48
|
+
navigationRoutes.transactionHistory,
|
|
49
49
|
];
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwapButton = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const lab_1 = require("@mui/lab");
|
|
6
|
-
const react_i18next_1 = require("react-i18next");
|
|
7
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
8
|
-
const providers_1 = require("../../providers");
|
|
9
|
-
const utils_1 = require("../../utils");
|
|
10
|
-
const SwapButton = ({ onClick, hasRoute, text, disabled, loading, }) => {
|
|
11
|
-
const { t } = (0, react_i18next_1.useTranslation)();
|
|
12
|
-
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
13
|
-
const { variant, walletManagement } = (0, providers_1.useWidgetConfig)();
|
|
14
|
-
const { account, connect } = (0, providers_1.useWallet)();
|
|
15
|
-
const handleSwapButtonClick = async () => {
|
|
16
|
-
if (!account.isActive) {
|
|
17
|
-
if (walletManagement) {
|
|
18
|
-
await connect();
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
navigate(utils_1.navigationRoutes.selectWallet);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
onClick?.();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const getButtonText = () => {
|
|
29
|
-
if (account.isActive) {
|
|
30
|
-
if (!hasRoute) {
|
|
31
|
-
switch (variant) {
|
|
32
|
-
case 'nft':
|
|
33
|
-
return t(`button.buy`);
|
|
34
|
-
case 'refuel':
|
|
35
|
-
return t(`button.getGas`);
|
|
36
|
-
default:
|
|
37
|
-
return t(`button.swap`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (text) {
|
|
41
|
-
return text;
|
|
42
|
-
}
|
|
43
|
-
switch (variant) {
|
|
44
|
-
case 'nft':
|
|
45
|
-
return t(`button.reviewPurchase`);
|
|
46
|
-
case 'refuel':
|
|
47
|
-
return t(`button.reviewGasSwap`);
|
|
48
|
-
default:
|
|
49
|
-
return t(`button.reviewSwap`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return t(`button.connectWallet`);
|
|
53
|
-
};
|
|
54
|
-
return ((0, jsx_runtime_1.jsx)(lab_1.LoadingButton, { variant: "contained", color: "primary", onClick: handleSwapButtonClick, disabled: disabled, loading: loading, loadingPosition: "center", fullWidth: true, children: getButtonText() }));
|
|
55
|
-
};
|
|
56
|
-
exports.SwapButton = SwapButton;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { TokenAmount } from '@lifi/sdk';
|
|
3
|
-
import type { SwapFormTypeProps } from '../../providers';
|
|
4
|
-
export declare const FormPriceHelperText: React.FC<SwapFormTypeProps>;
|
|
5
|
-
export declare const FormPriceHelperTextBase: React.FC<SwapFormTypeProps & {
|
|
6
|
-
isLoading?: boolean;
|
|
7
|
-
tokenAddress?: string;
|
|
8
|
-
token?: TokenAmount;
|
|
9
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SwapInput';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./SwapRouteCard"), exports);
|
|
18
|
-
__exportStar(require("./SwapRouteCardSkeleton"), exports);
|
|
19
|
-
__exportStar(require("./SwapRouteNotFoundCard"), exports);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwapRoutes = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const material_1 = require("@mui/material");
|
|
6
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
7
|
-
const react_i18next_1 = require("react-i18next");
|
|
8
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
9
|
-
const Card_1 = require("../../components/Card");
|
|
10
|
-
const ProgressToNextUpdate_1 = require("../../components/ProgressToNextUpdate");
|
|
11
|
-
const SwapRouteCard_1 = require("../../components/SwapRouteCard");
|
|
12
|
-
const hooks_1 = require("../../hooks");
|
|
13
|
-
const providers_1 = require("../../providers");
|
|
14
|
-
const utils_1 = require("../../utils");
|
|
15
|
-
const SwapRoutes = (props) => {
|
|
16
|
-
const { t } = (0, react_i18next_1.useTranslation)();
|
|
17
|
-
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
18
|
-
const { variant, useRecommendedRoute } = (0, providers_1.useWidgetConfig)();
|
|
19
|
-
const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
|
|
20
|
-
const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = (0, hooks_1.useSwapRoutes)();
|
|
21
|
-
const currentRoute = routes?.[0];
|
|
22
|
-
if (!currentRoute && !isLoading && !isFetching && !isFetched) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
const handleCardClick = () => {
|
|
26
|
-
navigate(utils_1.navigationRoutes.swapRoutes);
|
|
27
|
-
};
|
|
28
|
-
const routeNotFound = !currentRoute && !isLoading && !isFetching;
|
|
29
|
-
const onlyRecommendedRoute = variant === 'refuel' || useRecommendedRoute;
|
|
30
|
-
const showAll = !onlyRecommendedRoute && !routeNotFound && (routes?.length ?? 0) > 1;
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { ...props, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: variant === 'nft' ? t('swap.fromAmount') : t('header.routes') }), (0, jsx_runtime_1.jsx)(ProgressToNextUpdate_1.ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: {
|
|
32
|
-
position: 'absolute',
|
|
33
|
-
top: 8,
|
|
34
|
-
right: 8,
|
|
35
|
-
} }), (0, jsx_runtime_1.jsxs)(material_1.Box, { p: 2, children: [isLoading ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { variant: "cardless" })) : !currentRoute ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, {})) : ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { route: currentRoute, variant: "cardless", active: true })), (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: showAll, unmountOnExit: true, mountOnEnter: true, appear: true, children: (0, jsx_runtime_1.jsx)(material_1.Box, { mt: 2, children: (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleCardClick, disabled: isValidating || !isValid, fullWidth: true, children: t('button.showAll') }) }) })] })] }));
|
|
36
|
-
};
|
|
37
|
-
exports.SwapRoutes = SwapRoutes;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwapRoutesExpandedElement = exports.SwapRoutesExpanded = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const material_1 = require("@mui/material");
|
|
6
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
7
|
-
const react_i18next_1 = require("react-i18next");
|
|
8
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
9
|
-
const hooks_1 = require("../../hooks");
|
|
10
|
-
const providers_1 = require("../../providers");
|
|
11
|
-
const stores_1 = require("../../stores");
|
|
12
|
-
const utils_1 = require("../../utils");
|
|
13
|
-
const ProgressToNextUpdate_1 = require("../ProgressToNextUpdate");
|
|
14
|
-
const SwapRouteCard_1 = require("../SwapRouteCard");
|
|
15
|
-
const SwapRoutesExpanded_style_1 = require("./SwapRoutesExpanded.style");
|
|
16
|
-
const timeout = { enter: 225, exit: 225, appear: 0 };
|
|
17
|
-
const SwapRoutesExpanded = () => {
|
|
18
|
-
const element = (0, react_router_dom_1.useMatch)('/');
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(SwapRoutesExpanded_style_1.CollapseContainer, { children: (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: timeout, in: !!element, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(material_1.Grow, { timeout: timeout, in: !!element, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(exports.SwapRoutesExpandedElement, {}) }) }) }) }));
|
|
20
|
-
};
|
|
21
|
-
exports.SwapRoutesExpanded = SwapRoutesExpanded;
|
|
22
|
-
const SwapRoutesExpandedElement = () => {
|
|
23
|
-
const { t } = (0, react_i18next_1.useTranslation)();
|
|
24
|
-
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
25
|
-
const setExecutableRoute = (0, stores_1.useSetExecutableRoute)();
|
|
26
|
-
const { variant, containerStyle } = (0, providers_1.useWidgetConfig)();
|
|
27
|
-
const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
|
|
28
|
-
const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = (0, hooks_1.useSwapRoutes)();
|
|
29
|
-
const currentRoute = routes?.[0];
|
|
30
|
-
const handleRouteClick = (route) => {
|
|
31
|
-
if (isValid && !isValidating) {
|
|
32
|
-
setExecutableRoute(route);
|
|
33
|
-
navigate(utils_1.navigationRoutes.swapExecution, {
|
|
34
|
-
state: { routeId: route.id },
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const expanded = Boolean(currentRoute || isLoading || isFetching || isFetched);
|
|
39
|
-
const routeNotFound = !currentRoute && !isLoading && !isFetching && expanded;
|
|
40
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: timeout.enter, in: expanded, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(material_1.Grow, { timeout: timeout.enter, in: expanded, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)(SwapRoutesExpanded_style_1.Container, { sx: containerStyle, enableColorScheme: true, children: (0, jsx_runtime_1.jsxs)(SwapRoutesExpanded_style_1.ScrollableContainer, { children: [(0, jsx_runtime_1.jsxs)(SwapRoutesExpanded_style_1.Header, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 18, fontWeight: "700", flex: 1, noWrap: true, children: variant === 'nft' ? t('swap.fromAmount') : t('header.routes') }), (0, jsx_runtime_1.jsx)(ProgressToNextUpdate_1.ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: { marginRight: -1 } })] }), (0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "column", spacing: 2, flex: 1, paddingX: 3, paddingBottom: 3, children: routeNotFound ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, {})) : isLoading || (isFetching && !routes?.length) ? (Array.from({ length: 3 }).map((_, index) => ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, {}, index)))) : (routes?.map((route, index) => ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { route: route, onClick: () => handleRouteClick(route), active: index === 0, expanded: routes?.length <= 2 }, route.id)))) })] }) }) }) }));
|
|
41
|
-
};
|
|
42
|
-
exports.SwapRoutesExpandedElement = SwapRoutesExpandedElement;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ActiveSwapsPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ActiveSwapsPage';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MainSwapButton = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
6
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
7
|
-
const SwapButton_1 = require("../../components/SwapButton");
|
|
8
|
-
const hooks_1 = require("../../hooks");
|
|
9
|
-
const stores_1 = require("../../stores");
|
|
10
|
-
const utils_1 = require("../../utils");
|
|
11
|
-
const MainSwapButton = () => {
|
|
12
|
-
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
13
|
-
const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
|
|
14
|
-
const setExecutableRoute = (0, stores_1.useSetExecutableRoute)();
|
|
15
|
-
const { routes: swapRoutes, isLoading, isFetching } = (0, hooks_1.useSwapRoutes)();
|
|
16
|
-
const currentRoute = swapRoutes?.[0];
|
|
17
|
-
const handleClick = async () => {
|
|
18
|
-
if (currentRoute) {
|
|
19
|
-
setExecutableRoute(currentRoute);
|
|
20
|
-
navigate(utils_1.navigationRoutes.swapExecution, {
|
|
21
|
-
state: { routeId: currentRoute.id },
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
return ((0, jsx_runtime_1.jsx)(SwapButton_1.SwapButton, { onClick: handleClick, hasRoute: Boolean(currentRoute), disabled: currentRoute && (isLoading || isFetching || isValidating || !isValid) }));
|
|
26
|
-
};
|
|
27
|
-
exports.MainSwapButton = MainSwapButton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SwapDetailsPage';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwapHistoryPage = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const DeleteOutline_1 = require("@mui/icons-material/DeleteOutline");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const react_i18next_1 = require("react-i18next");
|
|
9
|
-
const Dialog_1 = require("../../components/Dialog");
|
|
10
|
-
const Header_1 = require("../../components/Header");
|
|
11
|
-
const providers_1 = require("../../providers");
|
|
12
|
-
const stores_1 = require("../../stores");
|
|
13
|
-
const routes_1 = require("../../stores/routes");
|
|
14
|
-
const SwapHistoryEmpty_1 = require("./SwapHistoryEmpty");
|
|
15
|
-
const SwapHistoryItem_1 = require("./SwapHistoryItem");
|
|
16
|
-
const SwapHistoryPage = () => {
|
|
17
|
-
const { t } = (0, react_i18next_1.useTranslation)();
|
|
18
|
-
const { account } = (0, providers_1.useWallet)();
|
|
19
|
-
const swaps = (0, routes_1.useSwapHistory)(account.address);
|
|
20
|
-
const deleteRoutes = (0, stores_1.useRouteExecutionStore)((store) => store.deleteRoutes);
|
|
21
|
-
const [open, setOpen] = (0, react_1.useState)(false);
|
|
22
|
-
const toggleDialog = (0, react_1.useCallback)(() => {
|
|
23
|
-
setOpen((open) => !open);
|
|
24
|
-
}, []);
|
|
25
|
-
(0, react_1.useEffect)(() => {
|
|
26
|
-
if (swaps.length) {
|
|
27
|
-
return Header_1.useHeaderActionStore.getState().setAction((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: (0, jsx_runtime_1.jsx)(DeleteOutline_1.default, {}) }));
|
|
28
|
-
}
|
|
29
|
-
}, [swaps.length, toggleDialog]);
|
|
30
|
-
if (!swaps.length) {
|
|
31
|
-
return (0, jsx_runtime_1.jsx)(SwapHistoryEmpty_1.SwapHistoryEmpty, {});
|
|
32
|
-
}
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Container, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, { spacing: 2, mt: 1, children: swaps.length ? (swaps.map(({ route }) => ((0, jsx_runtime_1.jsx)(SwapHistoryItem_1.SwapHistoryItem, { route: route }, route.id)))) : ((0, jsx_runtime_1.jsx)(SwapHistoryEmpty_1.SwapHistoryEmpty, {})) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('swap.warning.title.deleteSwapHistory') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.deleteSwapHistory') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => deleteRoutes('completed'), autoFocus: true, children: t('button.delete') })] })] })] }));
|
|
34
|
-
};
|
|
35
|
-
exports.SwapHistoryPage = SwapHistoryPage;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SwapHistoryPage';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StartIdleSwapButton = exports.StartSwapButton = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const SwapButton_1 = require("../../components/SwapButton");
|
|
6
|
-
const hooks_1 = require("../../hooks");
|
|
7
|
-
const stores_1 = require("../../stores");
|
|
8
|
-
const StartSwapButton = ({ onClick, route, text, loading, }) => {
|
|
9
|
-
const { insufficientGas, isInitialLoading: isGasSufficiencyLoading } = (0, hooks_1.useGasSufficiency)(route);
|
|
10
|
-
const { insufficientFunds, isInitialLoading: isFundsSufficiencyLoading } = (0, hooks_1.useFundsSufficiency)(route);
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(SwapButton_1.SwapButton, { onClick: onClick, text: text, hasRoute: Boolean(route), disabled: insufficientFunds || !!insufficientGas?.length, loading: isFundsSufficiencyLoading || isGasSufficiencyLoading || loading }));
|
|
12
|
-
};
|
|
13
|
-
exports.StartSwapButton = StartSwapButton;
|
|
14
|
-
const StartIdleSwapButton = ({ onClick, route, text, loading, disabled, insurableRouteId, }) => {
|
|
15
|
-
const routeExecution = (0, stores_1.useRouteExecutionStore)((state) => state.routes[insurableRouteId]);
|
|
16
|
-
const { isFetching } = (0, hooks_1.useSwapRoutes)({
|
|
17
|
-
insurableRoute: routeExecution?.route,
|
|
18
|
-
});
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(exports.StartSwapButton, { onClick: onClick, text: text, route: route, disabled: disabled, loading: loading || isFetching, insurableRouteId: insurableRouteId }));
|
|
20
|
-
};
|
|
21
|
-
exports.StartIdleSwapButton = StartIdleSwapButton;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SwapPage = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const Delete_1 = require("@mui/icons-material/Delete");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
9
|
-
const react_i18next_1 = require("react-i18next");
|
|
10
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
11
|
-
const ContractComponent_1 = require("../../components/ContractComponent");
|
|
12
|
-
const GasMessage_1 = require("../../components/GasMessage");
|
|
13
|
-
const Insurance_1 = require("../../components/Insurance");
|
|
14
|
-
const Step_1 = require("../../components/Step");
|
|
15
|
-
const hooks_1 = require("../../hooks");
|
|
16
|
-
const providers_1 = require("../../providers");
|
|
17
|
-
const stores_1 = require("../../stores");
|
|
18
|
-
const events_1 = require("../../types/events");
|
|
19
|
-
const utils_1 = require("../../utils");
|
|
20
|
-
const ExchangeRateBottomSheet_1 = require("./ExchangeRateBottomSheet");
|
|
21
|
-
const StartSwapButton_1 = require("./StartSwapButton");
|
|
22
|
-
const StatusBottomSheet_1 = require("./StatusBottomSheet");
|
|
23
|
-
const SwapPage_style_1 = require("./SwapPage.style");
|
|
24
|
-
const TokenValueBottomSheet_1 = require("./TokenValueBottomSheet");
|
|
25
|
-
const utils_2 = require("./utils");
|
|
26
|
-
const SwapPage = () => {
|
|
27
|
-
const { t } = (0, react_i18next_1.useTranslation)();
|
|
28
|
-
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
29
|
-
const emitter = (0, hooks_1.useWidgetEvents)();
|
|
30
|
-
const { navigateBack } = (0, hooks_1.useNavigateBack)();
|
|
31
|
-
const { variant, insurance } = (0, providers_1.useWidgetConfig)();
|
|
32
|
-
const { state } = (0, react_router_dom_1.useLocation)();
|
|
33
|
-
const stateRouteId = state?.routeId;
|
|
34
|
-
const [routeId, setRouteId] = (0, react_1.useState)(stateRouteId);
|
|
35
|
-
const tokenValueBottomSheetRef = (0, react_1.useRef)(null);
|
|
36
|
-
const exchangeRateBottomSheetRef = (0, react_1.useRef)(null);
|
|
37
|
-
const onAcceptExchangeRateUpdate = (resolver, data) => {
|
|
38
|
-
exchangeRateBottomSheetRef.current?.open(resolver, data);
|
|
39
|
-
};
|
|
40
|
-
const { route, status, executeRoute, restartRoute, deleteRoute } = (0, hooks_1.useRouteExecution)({
|
|
41
|
-
routeId: routeId,
|
|
42
|
-
onAcceptExchangeRateUpdate,
|
|
43
|
-
});
|
|
44
|
-
const tokenValueLossThresholdExceeded = (0, TokenValueBottomSheet_1.getTokenValueLossThreshold)(route);
|
|
45
|
-
const handleExecuteRoute = () => {
|
|
46
|
-
if (tokenValueBottomSheetRef.current?.isOpen()) {
|
|
47
|
-
if (route) {
|
|
48
|
-
emitter.emit(events_1.WidgetEvent.RouteHighValueLoss, {
|
|
49
|
-
fromAmountUsd: route.fromAmountUSD,
|
|
50
|
-
gasCostUSD: route.gasCostUSD,
|
|
51
|
-
toAmountUSD: route.toAmountUSD,
|
|
52
|
-
valueLoss: (0, utils_2.calcValueLoss)(route),
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
tokenValueBottomSheetRef.current?.close();
|
|
56
|
-
}
|
|
57
|
-
executeRoute();
|
|
58
|
-
setValue(providers_1.SwapFormKey.FromAmount, '');
|
|
59
|
-
};
|
|
60
|
-
const handleSwapClick = async () => {
|
|
61
|
-
if (status === stores_1.RouteExecutionStatus.Idle) {
|
|
62
|
-
if (tokenValueLossThresholdExceeded && variant !== 'nft') {
|
|
63
|
-
tokenValueBottomSheetRef.current?.open();
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
handleExecuteRoute();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (status === stores_1.RouteExecutionStatus.Failed) {
|
|
70
|
-
restartRoute();
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
const handleRemoveRoute = () => {
|
|
74
|
-
navigateBack();
|
|
75
|
-
deleteRoute();
|
|
76
|
-
};
|
|
77
|
-
const getSwapButtonText = () => {
|
|
78
|
-
switch (status) {
|
|
79
|
-
case stores_1.RouteExecutionStatus.Idle:
|
|
80
|
-
switch (variant) {
|
|
81
|
-
case 'nft':
|
|
82
|
-
return t('button.buyNow');
|
|
83
|
-
case 'refuel':
|
|
84
|
-
return t('button.startGasSwap');
|
|
85
|
-
default:
|
|
86
|
-
return t('button.startSwap');
|
|
87
|
-
}
|
|
88
|
-
case stores_1.RouteExecutionStatus.Failed:
|
|
89
|
-
return t('button.tryAgain');
|
|
90
|
-
default:
|
|
91
|
-
return '';
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const SwapButton = insurance && status === stores_1.RouteExecutionStatus.Idle
|
|
95
|
-
? StartSwapButton_1.StartIdleSwapButton
|
|
96
|
-
: StartSwapButton_1.StartSwapButton;
|
|
97
|
-
const insuranceAvailable = insurance &&
|
|
98
|
-
variant !== 'refuel' &&
|
|
99
|
-
(route?.insurance?.state === 'INSURED' ||
|
|
100
|
-
(status === stores_1.RouteExecutionStatus.Idle &&
|
|
101
|
-
route?.insurance?.state === 'INSURABLE'));
|
|
102
|
-
const insuranceCoverageId = route?.steps[0].execution?.process
|
|
103
|
-
.filter((process) => process.type !== 'TOKEN_ALLOWANCE')
|
|
104
|
-
.find((process) => process.txHash)?.txHash ?? route?.fromAddress;
|
|
105
|
-
return ((0, jsx_runtime_1.jsxs)(SwapPage_style_1.Container, { children: [(0, Step_1.getStepList)(route), variant === 'nft' ? (0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mt: 2 }) : null, route && insuranceAvailable ? ((0, jsx_runtime_1.jsx)(Insurance_1.Insurance, { mt: 2, status: status, insurableRouteId: stateRouteId, feeAmountUsd: route.insurance.feeAmountUsd, insuredAmount: (0, utils_1.formatTokenAmount)(route.toAmountMin, route.toToken.decimals), insuredTokenSymbol: route.toToken.symbol, insuranceCoverageId: insuranceCoverageId, onChange: setRouteId })) : null, status === stores_1.RouteExecutionStatus.Idle ||
|
|
106
|
-
status === stores_1.RouteExecutionStatus.Failed ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(GasMessage_1.GasMessage, { mt: 2, route: route }), (0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, display: "flex", children: [(0, jsx_runtime_1.jsx)(SwapButton, { text: getSwapButtonText(), onClick: handleSwapClick, route: route, insurableRouteId: stateRouteId }), status === stores_1.RouteExecutionStatus.Failed ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t('button.removeSwap'), placement: "bottom-end", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleRemoveRoute, sx: {
|
|
107
|
-
minWidth: 48,
|
|
108
|
-
marginLeft: 1,
|
|
109
|
-
}, children: (0, jsx_runtime_1.jsx)(Delete_1.default, {}) }) })) : null] })] })) : null, route && status ? ((0, jsx_runtime_1.jsx)(StatusBottomSheet_1.StatusBottomSheet, { status: status, route: route })) : null, route && tokenValueLossThresholdExceeded && variant !== 'nft' ? ((0, jsx_runtime_1.jsx)(TokenValueBottomSheet_1.TokenValueBottomSheet, { route: route, ref: tokenValueBottomSheetRef, onContinue: handleExecuteRoute })) : null, route ? ((0, jsx_runtime_1.jsx)(ExchangeRateBottomSheet_1.ExchangeRateBottomSheet, { ref: exchangeRateBottomSheetRef })) : null] }));
|
|
110
|
-
};
|
|
111
|
-
exports.SwapPage = SwapPage;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SwapPage';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SwapRoutesPage';
|