@rango-dev/widget-embedded 0.12.1-next.2 → 0.12.1-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Wallets.d.ts +4 -3
- package/dist/Wallets.d.ts.map +1 -1
- package/dist/Widget.d.ts +3 -2
- package/dist/Widget.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +3 -2
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +1 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.d.ts +4 -0
- package/dist/components/BlockchainList/BlockchainList.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.helpers.d.ts +4 -0
- package/dist/components/BlockchainList/BlockchainList.helpers.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +307 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.types.d.ts +8 -0
- package/dist/components/BlockchainList/BlockchainList.types.d.ts.map +1 -0
- package/dist/components/BlockchainList/LoadingBlockchainList.d.ts +3 -0
- package/dist/components/BlockchainList/LoadingBlockchainList.d.ts.map +1 -0
- package/dist/components/BlockchainList/index.d.ts +2 -0
- package/dist/components/BlockchainList/index.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.d.ts +5 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts +156 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts +6 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/index.d.ts +2 -0
- package/dist/components/BlockchainsChip/index.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts +3 -0
- package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts +4 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +154 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts +9 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/index.d.ts +2 -0
- package/dist/components/BlockchainsSection/index.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +6 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +2597 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts +4 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +11 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts +4 -0
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +460 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +12 -0
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -0
- package/dist/components/HeaderButtons/BackButton.d.ts +5 -0
- package/dist/components/HeaderButtons/BackButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/CancelButton.d.ts +5 -0
- package/dist/components/HeaderButtons/CancelButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +895 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +12 -0
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HomeButtons.d.ts +4 -0
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -0
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts +3 -0
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -0
- package/dist/components/HeaderButtons/WalletButton.d.ts +5 -0
- package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/index.d.ts +5 -0
- package/dist/components/HeaderButtons/index.d.ts.map +1 -0
- package/dist/components/Layout/Layout.d.ts +7 -0
- package/dist/components/Layout/Layout.d.ts.map +1 -0
- package/dist/components/Layout/Layout.styles.d.ts +464 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -0
- package/dist/components/Layout/Layout.types.d.ts +17 -0
- package/dist/components/Layout/Layout.types.d.ts.map +1 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Layout/index.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts +3 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +155 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/index.d.ts +2 -0
- package/dist/components/LoadingLiquiditySourceList/index.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts +3 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +460 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/index.d.ts +2 -0
- package/dist/components/LoadingSwapDetails/index.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.d.ts +4 -0
- package/dist/components/NoRoutes/NoRoutes.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts +3 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts +460 -0
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.types.d.ts +20 -0
- package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +1 -0
- package/dist/components/NoRoutes/index.d.ts +2 -0
- package/dist/components/NoRoutes/index.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts +3 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +613 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationNotFound.d.ts +3 -0
- package/dist/components/NotificationContent/NotificationNotFound.d.ts.map +1 -0
- package/dist/components/NotificationContent/index.d.ts +2 -0
- package/dist/components/NotificationContent/index.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts +613 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts +24 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +1 -0
- package/dist/components/RouteErrors/index.d.ts +2 -0
- package/dist/components/RouteErrors/index.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.d.ts +4 -0
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts +154 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts +10 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts.map +1 -0
- package/dist/components/SearchInput/index.d.ts +2 -0
- package/dist/components/SearchInput/index.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts +4 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +4 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +460 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts +12 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/index.d.ts +2 -0
- package/dist/components/SelectableCategoryList/index.d.ts.map +1 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +766 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -0
- package/dist/components/SettingsContainer/index.d.ts +2 -0
- package/dist/components/SettingsContainer/index.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.d.ts +3 -0
- package/dist/components/Slippage/Slippage.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.styles.d.ts +613 -0
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -0
- package/dist/components/Slippage/SlippageTooltipContent.d.ts +3 -0
- package/dist/components/Slippage/SlippageTooltipContent.d.ts.map +1 -0
- package/dist/components/Slippage/index.d.ts +2 -0
- package/dist/components/Slippage/index.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts +4 -0
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.d.ts +4 -0
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +8 -0
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +919 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.types.d.ts +12 -0
- package/dist/components/SwapDetails/SwapDetails.types.d.ts.map +1 -0
- package/dist/components/SwapDetails/index.d.ts +2 -0
- package/dist/components/SwapDetails/index.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +154 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +20 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/index.d.ts +3 -0
- package/dist/components/SwapDetailsAlerts/index.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +154 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +46 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/index.d.ts +4 -0
- package/dist/components/SwapDetailsModal/index.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.d.ts +4 -0
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +613 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.types.d.ts +12 -0
- package/dist/components/SwapsGroup/SwapsGroup.types.d.ts.map +1 -0
- package/dist/components/SwapsGroup/index.d.ts +2 -0
- package/dist/components/SwapsGroup/index.d.ts.map +1 -0
- package/dist/components/SwitchFromAndTo.d.ts +1 -1
- package/dist/components/SwitchFromAndTo.d.ts.map +1 -1
- package/dist/components/TokenList/LoadingTokenList.d.ts +4 -0
- package/dist/components/TokenList/LoadingTokenList.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.d.ts +4 -0
- package/dist/components/TokenList/TokenList.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.helpers.d.ts +3 -0
- package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.styles.d.ts +1532 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.types.d.ts +41 -0
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -0
- package/dist/components/TokenList/index.d.ts +3 -0
- package/dist/components/TokenList/index.d.ts.map +1 -0
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModal.d.ts +4 -0
- package/dist/components/WalletModal/WalletModal.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts +10 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts +4 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +613 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -0
- package/dist/components/WalletModal/index.d.ts +2 -0
- package/dist/components/WalletModal/index.d.ts.map +1 -0
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/constants/errors.d.ts +29 -0
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/messages.d.ts +7 -0
- package/dist/constants/messages.d.ts.map +1 -0
- package/dist/constants/navigationRoutes.d.ts +8 -4
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/routing.d.ts +13 -0
- package/dist/constants/routing.d.ts.map +1 -0
- package/dist/constants/searchParams.d.ts +2 -2
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/constants/swapSettings.d.ts.map +1 -1
- package/dist/constants/wallets.d.ts +3 -0
- package/dist/constants/wallets.d.ts.map +1 -0
- package/dist/constants/warnings.d.ts +3 -0
- package/dist/constants/warnings.d.ts.map +1 -0
- package/dist/globalStyles.d.ts +1 -1
- package/dist/globalStyles.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap.d.ts +14 -6
- package/dist/hooks/useConfirmSwap.d.ts.map +1 -1
- package/dist/hooks/useFetchBestRoute.d.ts +9 -0
- package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts +12 -0
- package/dist/hooks/useSwapInput.d.ts.map +1 -0
- package/dist/hooks/useTheme.d.ts +3 -29
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts +20 -0
- package/dist/hooks/useWalletList.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts +6 -3
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts +3 -0
- package/dist/pages/LanguagePage.d.ts.map +1 -0
- package/dist/pages/LiquiditySourcePage.d.ts +8 -0
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -0
- package/dist/pages/SelectBlockchainPage.d.ts +8 -0
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -0
- package/dist/pages/SelectSwapItemsPage.d.ts +11 -0
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -0
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts +3 -0
- package/dist/pages/ThemePage.d.ts.map +1 -0
- package/dist/pages/WalletsPage.d.ts +4 -2
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/bestRoute.d.ts +32 -19
- package/dist/store/bestRoute.d.ts.map +1 -1
- package/dist/store/meta.d.ts +10 -3
- package/dist/store/meta.d.ts.map +1 -1
- package/dist/store/notification.d.ts +38 -0
- package/dist/store/notification.d.ts.map +1 -0
- package/dist/store/settings.d.ts +2 -2
- package/dist/store/settings.d.ts.map +1 -1
- package/dist/store/ui.d.ts +0 -2
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +14 -12
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +11 -6
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/notification.d.ts +22 -0
- package/dist/types/notification.d.ts.map +1 -0
- package/dist/types/routing.d.ts +30 -23
- package/dist/types/routing.d.ts.map +1 -1
- package/dist/types/swap.d.ts +8 -1
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/utils/common.d.ts +5 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +2 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +3 -0
- package/dist/utils/meta.d.ts.map +1 -0
- package/dist/utils/numbers.d.ts +2 -1
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/utils/routing.d.ts +10 -7
- package/dist/utils/routing.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +10 -0
- package/dist/utils/settings.d.ts.map +1 -0
- package/dist/utils/swap.d.ts +29 -14
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +20 -14
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/Wallets.tsx +23 -17
- package/src/Widget.tsx +88 -28
- package/src/components/AppRouter.tsx +36 -6
- package/src/components/AppRoutes.tsx +54 -19
- package/src/components/BlockchainList/BlockchainList.helpers.ts +37 -0
- package/src/components/BlockchainList/BlockchainList.styles.ts +19 -0
- package/src/components/BlockchainList/BlockchainList.tsx +73 -0
- package/src/components/BlockchainList/BlockchainList.types.ts +8 -0
- package/src/components/BlockchainList/LoadingBlockchainList.tsx +20 -0
- package/src/components/BlockchainList/index.ts +1 -0
- package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +30 -0
- package/src/components/BlockchainsChip/BlockchainsChip.tsx +15 -0
- package/src/components/BlockchainsChip/BlockchainsChip.types.ts +4 -0
- package/src/components/BlockchainsChip/index.ts +1 -0
- package/src/components/BlockchainsSection/BlockchainSection.helpers.ts +20 -0
- package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +7 -0
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +100 -0
- package/src/components/BlockchainsSection/BlockchainsSection.types.ts +9 -0
- package/src/components/BlockchainsSection/index.ts +1 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +86 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +169 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +460 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +11 -0
- package/src/components/ConfirmWalletsModal/WalletList.styles.ts +34 -0
- package/src/components/ConfirmWalletsModal/WalletList.tsx +250 -0
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +12 -0
- package/src/components/HeaderButtons/BackButton.tsx +16 -0
- package/src/components/HeaderButtons/CancelButton.tsx +21 -0
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +40 -0
- package/src/components/HeaderButtons/HeaderButtons.types.ts +11 -0
- package/src/components/HeaderButtons/HomeButtons.tsx +68 -0
- package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +20 -0
- package/src/components/HeaderButtons/WalletButton.tsx +20 -0
- package/src/components/HeaderButtons/index.ts +4 -0
- package/src/components/Layout/Layout.styles.ts +50 -0
- package/src/components/Layout/Layout.tsx +72 -0
- package/src/components/Layout/Layout.types.ts +20 -0
- package/src/components/Layout/index.ts +1 -0
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +5 -0
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +23 -0
- package/src/components/LoadingLiquiditySourceList/index.ts +1 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +41 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +78 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +53 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +3 -0
- package/src/components/LoadingSwapDetails/index.ts +1 -0
- package/src/components/NoRoutes/NoRoutes.helper.ts +50 -0
- package/src/components/NoRoutes/NoRoutes.styles.ts +15 -0
- package/src/components/NoRoutes/NoRoutes.tsx +81 -0
- package/src/components/NoRoutes/NoRoutes.types.ts +21 -0
- package/src/components/NoRoutes/index.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.styles.ts +34 -0
- package/src/components/NotificationContent/NotificationContent.tsx +107 -0
- package/src/components/NotificationContent/NotificationNotFound.tsx +17 -0
- package/src/components/NotificationContent/index.ts +1 -0
- package/src/components/RouteErrors/RouteErrors.styles.ts +28 -0
- package/src/components/RouteErrors/RouteErrors.tsx +79 -0
- package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
- package/src/components/RouteErrors/RouteErrorsModal.tsx +128 -0
- package/src/components/RouteErrors/RouteErrorsModalItem.tsx +24 -0
- package/src/components/RouteErrors/index.ts +1 -0
- package/src/components/SearchInput/SearchInput.styles.ts +9 -0
- package/src/components/SearchInput/SearchInput.tsx +51 -0
- package/src/components/SearchInput/SearchInput.types.ts +10 -0
- package/src/components/SearchInput/index.ts +1 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +20 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.styles.ts +21 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +79 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.types.ts +12 -0
- package/src/components/SelectableCategoryList/index.ts +1 -0
- package/src/components/SettingsContainer/SettingsContainer.style.ts +33 -0
- package/src/components/SettingsContainer/index.ts +7 -0
- package/src/components/Slippage/Slippage.styles.ts +24 -0
- package/src/components/Slippage/Slippage.tsx +90 -0
- package/src/components/Slippage/SlippageTooltipContent.tsx +23 -0
- package/src/components/Slippage/index.ts +1 -0
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +79 -0
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +85 -0
- package/src/components/SwapDetails/SwapDetails.styles.ts +68 -0
- package/src/components/SwapDetails/SwapDetails.tsx +419 -0
- package/src/components/SwapDetails/SwapDetails.types.ts +12 -0
- package/src/components/SwapDetails/index.ts +1 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +36 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +55 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.ts +7 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +74 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +28 -0
- package/src/components/SwapDetailsAlerts/index.ts +2 -0
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +101 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +34 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.Delete.tsx +34 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +31 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +22 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.styles.ts +6 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +45 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +54 -0
- package/src/components/SwapDetailsModal/index.ts +3 -0
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +26 -0
- package/src/components/SwapsGroup/SwapsGroup.tsx +125 -0
- package/src/components/SwapsGroup/SwapsGroup.types.ts +13 -0
- package/src/components/SwapsGroup/index.ts +1 -0
- package/src/components/SwitchFromAndTo.tsx +23 -41
- package/src/components/TokenList/LoadingTokenList.tsx +34 -0
- package/src/components/TokenList/TokenList.helpers.ts +13 -0
- package/src/components/TokenList/TokenList.styles.ts +121 -0
- package/src/components/TokenList/TokenList.tsx +271 -0
- package/src/components/TokenList/TokenList.types.ts +48 -0
- package/src/components/TokenList/index.ts +2 -0
- package/src/components/UpdateUrl.tsx +40 -22
- package/src/components/WalletModal/WalletModal.tsx +20 -0
- package/src/components/WalletModal/WalletModal.types.ts +11 -0
- package/src/components/WalletModal/WalletModalContent.styles.ts +44 -0
- package/src/components/WalletModal/WalletModalContent.tsx +54 -0
- package/src/components/WalletModal/index.ts +1 -0
- package/src/components/WidgetEvents.tsx +37 -5
- package/src/constants/errors.ts +56 -1
- package/src/constants/messages.ts +8 -0
- package/src/constants/navigationRoutes.ts +8 -4
- package/src/constants/routing.ts +17 -0
- package/src/constants/searchParams.ts +2 -2
- package/src/constants/swapSettings.ts +5 -1
- package/src/constants/wallets.ts +3 -0
- package/src/constants/warnings.ts +26 -0
- package/src/globalStyles.ts +1 -4
- package/src/hooks/useConfirmSwap.ts +251 -220
- package/src/hooks/useFetchBestRoute.ts +38 -0
- package/src/hooks/useNavigateBack.ts +25 -9
- package/src/hooks/useSwapInput.ts +116 -0
- package/src/hooks/useTheme.ts +35 -74
- package/src/hooks/useWalletList.ts +125 -0
- package/src/pages/ConfirmSwapPage.tsx +492 -228
- package/src/pages/HistoryPage.tsx +104 -15
- package/src/pages/Home.tsx +392 -110
- package/src/pages/LanguagePage.tsx +83 -0
- package/src/pages/LiquiditySourcePage.tsx +160 -0
- package/src/pages/SelectBlockchainPage.tsx +77 -0
- package/src/pages/SelectSwapItemsPage.tsx +169 -0
- package/src/pages/SettingsPage.tsx +144 -72
- package/src/pages/SwapDetailsPage.tsx +40 -141
- package/src/pages/ThemePage.tsx +96 -0
- package/src/pages/WalletsPage.tsx +73 -124
- package/src/store/bestRoute.ts +85 -180
- package/src/store/meta.ts +23 -3
- package/src/store/notification.ts +77 -0
- package/src/store/settings.ts +20 -13
- package/src/store/ui.ts +1 -5
- package/src/store/wallets.ts +92 -76
- package/src/types/config.ts +12 -7
- package/src/types/notification.ts +33 -0
- package/src/types/routing.ts +29 -28
- package/src/types/swap.ts +9 -1
- package/src/utils/common.ts +53 -3
- package/src/utils/configs.ts +3 -0
- package/src/utils/date.ts +15 -18
- package/src/utils/meta.ts +9 -0
- package/src/utils/numbers.ts +63 -18
- package/src/utils/routing.ts +105 -27
- package/src/utils/settings.ts +57 -0
- package/src/utils/swap.ts +200 -113
- package/src/utils/wallets.ts +165 -116
- package/dist/components/ConfirmSwapErrors.d.ts +0 -4
- package/dist/components/ConfirmSwapErrors.d.ts.map +0 -1
- package/dist/components/ConfirmSwapWarnings.d.ts +0 -3
- package/dist/components/ConfirmSwapWarnings.d.ts.map +0 -1
- package/dist/components/Layout.d.ts +0 -7
- package/dist/components/Layout.d.ts.map +0 -1
- package/dist/pages/LiquiditySourcesPage.d.ts +0 -7
- package/dist/pages/LiquiditySourcesPage.d.ts.map +0 -1
- package/dist/pages/SelectChainPage.d.ts +0 -8
- package/dist/pages/SelectChainPage.d.ts.map +0 -1
- package/dist/pages/SelectTokenPage.d.ts +0 -15
- package/dist/pages/SelectTokenPage.d.ts.map +0 -1
- package/src/components/ConfirmSwapErrors.tsx +0 -34
- package/src/components/ConfirmSwapWarnings.tsx +0 -22
- package/src/components/Layout.tsx +0 -105
- package/src/pages/LiquiditySourcesPage.tsx +0 -63
- package/src/pages/SelectChainPage.tsx +0 -42
- package/src/pages/SelectTokenPage.tsx +0 -64
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
IconButton,
|
|
5
|
+
keyframes,
|
|
6
|
+
styled,
|
|
7
|
+
TextField,
|
|
8
|
+
} from '@rango-dev/ui';
|
|
9
|
+
|
|
10
|
+
const slideDown = keyframes({
|
|
11
|
+
from: {
|
|
12
|
+
height: 0,
|
|
13
|
+
},
|
|
14
|
+
to: {
|
|
15
|
+
height: 'var(--radix-collapsible-content-height)',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const slideUp = keyframes({
|
|
20
|
+
from: {
|
|
21
|
+
height: 'var(--radix-collapsible-content-height)',
|
|
22
|
+
},
|
|
23
|
+
to: {
|
|
24
|
+
height: 0,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const Title = styled('div', {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
flexDirection: 'column',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const ListContainer = styled('div', {
|
|
36
|
+
display: 'grid',
|
|
37
|
+
gap: '$10',
|
|
38
|
+
gridTemplateColumns: ' repeat(3, minmax(0, 1fr))',
|
|
39
|
+
alignContent: 'baseline',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const WalletButton = styled('button', {
|
|
43
|
+
borderRadius: '$xm',
|
|
44
|
+
padding: '$10',
|
|
45
|
+
border: '0',
|
|
46
|
+
display: 'flex',
|
|
47
|
+
justifyContent: 'center',
|
|
48
|
+
backgroundColor: '$neutral100',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
cursor: 'pointer',
|
|
51
|
+
width: 110,
|
|
52
|
+
position: 'relative',
|
|
53
|
+
'&:hover': {
|
|
54
|
+
backgroundColor: '$surface600',
|
|
55
|
+
opacity: '0.8',
|
|
56
|
+
},
|
|
57
|
+
variants: {
|
|
58
|
+
selected: {
|
|
59
|
+
true: {
|
|
60
|
+
outlineWidth: 1,
|
|
61
|
+
outlineColor: '$secondary',
|
|
62
|
+
outlineStyle: 'solid',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
export const Trigger = styled(Collapsible.Trigger, {
|
|
68
|
+
padding: '$0',
|
|
69
|
+
border: 'none',
|
|
70
|
+
outline: 'none',
|
|
71
|
+
width: '100%',
|
|
72
|
+
backgroundColor: 'transparent',
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const ShowMoreHeader = styled('div', {
|
|
76
|
+
padding: '$20',
|
|
77
|
+
display: 'flex',
|
|
78
|
+
justifyContent: 'center',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
backgroundColor: '$neutral200',
|
|
81
|
+
position: 'relative',
|
|
82
|
+
width: '100%',
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const NavigateBack = styled(IconButton, {
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
left: '$20',
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export const WalletsContainer = styled('div', {
|
|
91
|
+
paddingTop: '$20',
|
|
92
|
+
'& .wallets-list': {
|
|
93
|
+
display: 'grid',
|
|
94
|
+
gap: '$10',
|
|
95
|
+
gridTemplateColumns: ' repeat(3, minmax(0, 1fr))',
|
|
96
|
+
alignContent: 'baseline',
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export const CollapsibleRoot = styled(Collapsible.Root, {
|
|
101
|
+
backgroundColor: '$neutral200',
|
|
102
|
+
borderRadius: '$sm',
|
|
103
|
+
variants: {
|
|
104
|
+
selected: {
|
|
105
|
+
true: {
|
|
106
|
+
outlineWidth: 1,
|
|
107
|
+
outlineColor: '$secondary500',
|
|
108
|
+
outlineStyle: 'solid',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export const CustomDestinationButton = styled(Button, {
|
|
115
|
+
width: '100%',
|
|
116
|
+
borderRadius: '$sm !important',
|
|
117
|
+
padding: '$15 !important',
|
|
118
|
+
justifyContent: 'space-between',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
backgroundColor: '$neutral100 !important',
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export const CustomDestination = styled('div', {
|
|
124
|
+
padding: '$10 $0',
|
|
125
|
+
'& .button__content': {
|
|
126
|
+
display: 'flex',
|
|
127
|
+
justifyContent: 'center',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
},
|
|
130
|
+
'& .alarms': { paddingTop: '5px' },
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
export const ExpandedIcon = styled('div', {
|
|
134
|
+
transition: 'all 300ms ease',
|
|
135
|
+
variants: {
|
|
136
|
+
orientation: {
|
|
137
|
+
down: {
|
|
138
|
+
transform: 'rotate(0)',
|
|
139
|
+
},
|
|
140
|
+
up: {
|
|
141
|
+
transform: 'rotate(180deg)',
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
export const ConfirmButton = styled('div', {
|
|
148
|
+
display: 'flex',
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
export const StyledTextField = styled(TextField, {
|
|
152
|
+
padding: '$0 $15 $15 $15',
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
export const CollapsibleContent = styled(Collapsible.Content, {
|
|
156
|
+
overflow: 'hidden',
|
|
157
|
+
variants: {
|
|
158
|
+
open: {
|
|
159
|
+
true: {
|
|
160
|
+
animation: `${slideDown} 300ms ease-out`,
|
|
161
|
+
},
|
|
162
|
+
false: {
|
|
163
|
+
animation: `${slideUp} 300ms ease-out`,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
export const Wallets = styled('div', { overflow: 'visible', width: '100%' });
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import type { PropTypes } from './ConfirmWalletsModal.types';
|
|
2
|
+
import type { ConnectedWallet } from '../../store/wallets';
|
|
3
|
+
import type { ConfirmSwapWarnings, Wallet } from '../../types';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Alert,
|
|
7
|
+
BalanceErrors,
|
|
8
|
+
Button,
|
|
9
|
+
ChevronDownIcon,
|
|
10
|
+
ChevronLeftIcon,
|
|
11
|
+
Divider,
|
|
12
|
+
MessageBox,
|
|
13
|
+
Modal,
|
|
14
|
+
Typography,
|
|
15
|
+
WalletIcon,
|
|
16
|
+
} from '@rango-dev/ui';
|
|
17
|
+
import React, { useEffect, useState } from 'react';
|
|
18
|
+
import { useNavigate } from 'react-router-dom';
|
|
19
|
+
|
|
20
|
+
import { getConfirmSwapErrorMessage } from '../../constants/errors';
|
|
21
|
+
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
22
|
+
import { getRouteWarningMessage } from '../../constants/warnings';
|
|
23
|
+
import { useBestRouteStore } from '../../store/bestRoute';
|
|
24
|
+
import { useMetaStore } from '../../store/meta';
|
|
25
|
+
import { useWalletsStore } from '../../store/wallets';
|
|
26
|
+
import { confirmSwapDisabled } from '../../utils/swap';
|
|
27
|
+
|
|
28
|
+
import { getRequiredWallets, isValidAddress } from './ConfirmWallets.helpers';
|
|
29
|
+
import {
|
|
30
|
+
CollapsibleContent,
|
|
31
|
+
CollapsibleRoot,
|
|
32
|
+
ConfirmButton,
|
|
33
|
+
CustomDestination,
|
|
34
|
+
CustomDestinationButton,
|
|
35
|
+
ExpandedIcon,
|
|
36
|
+
ListContainer,
|
|
37
|
+
NavigateBack,
|
|
38
|
+
ShowMoreHeader,
|
|
39
|
+
StyledTextField,
|
|
40
|
+
Title,
|
|
41
|
+
Trigger,
|
|
42
|
+
Wallets,
|
|
43
|
+
WalletsContainer,
|
|
44
|
+
} from './ConfirmWallets.styles';
|
|
45
|
+
import { WalletList } from './WalletList';
|
|
46
|
+
|
|
47
|
+
const NUMBER_OF_WALLETS_TO_DISPLAY = 2;
|
|
48
|
+
|
|
49
|
+
export function ConfirmWalletsModal(props: PropTypes) {
|
|
50
|
+
//TODO: move component's logics to a custom hook
|
|
51
|
+
const { open, onClose, onCancel, onCheckBalance, config, loading } = props;
|
|
52
|
+
const { blockchains } = useMetaStore.use.meta();
|
|
53
|
+
const {
|
|
54
|
+
bestRoute,
|
|
55
|
+
setSelectedWallets: selectRouteWallets,
|
|
56
|
+
routeWalletsConfirmed,
|
|
57
|
+
setRouteWalletConfirmed,
|
|
58
|
+
customDestination,
|
|
59
|
+
setCustomDestination,
|
|
60
|
+
} = useBestRouteStore();
|
|
61
|
+
const { connectedWallets, selectWallets } = useWalletsStore();
|
|
62
|
+
|
|
63
|
+
const [showMoreWalletFor, setShowMoreWalletFor] = useState('');
|
|
64
|
+
const [balanceWarnings, setBalanceWarnings] = useState<string[]>([]);
|
|
65
|
+
const [error, setError] = useState('');
|
|
66
|
+
const [routeWarning, setRouteWarning] = useState<
|
|
67
|
+
ConfirmSwapWarnings['route'] | null
|
|
68
|
+
>(null);
|
|
69
|
+
const [destination, setDestination] = useState(customDestination);
|
|
70
|
+
const [showCustomDestination, setShowCustomDestination] = useState(
|
|
71
|
+
!!customDestination
|
|
72
|
+
);
|
|
73
|
+
const requiredWallets = getRequiredWallets(bestRoute);
|
|
74
|
+
const customDestinationEnabled =
|
|
75
|
+
typeof config?.customDestination === 'undefined'
|
|
76
|
+
? true
|
|
77
|
+
: config.customDestination;
|
|
78
|
+
|
|
79
|
+
const lastStepToBlockchain = blockchains.find(
|
|
80
|
+
(blockchain) =>
|
|
81
|
+
blockchain.name ===
|
|
82
|
+
bestRoute?.result?.swaps[bestRoute?.result?.swaps.length - 1].to
|
|
83
|
+
.blockchain
|
|
84
|
+
);
|
|
85
|
+
const isWalletRequiredFor = (blockchain: string) =>
|
|
86
|
+
!!bestRoute?.result?.swaps.find(
|
|
87
|
+
(swap) => swap.from.blockchain === blockchain
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const [selectableWallets, setSelectableWallets] = useState<ConnectedWallet[]>(
|
|
91
|
+
connectedWallets.filter((connectedWallet) => {
|
|
92
|
+
return (
|
|
93
|
+
connectedWallet.selected &&
|
|
94
|
+
requiredWallets.includes(connectedWallet.chain)
|
|
95
|
+
);
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
const lastStepToBlockchainMeta = blockchains.find(
|
|
99
|
+
(chain) => chain.name === lastStepToBlockchain?.name
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const isSelected = (walletType: string, chain: string) =>
|
|
103
|
+
!!selectableWallets.find(
|
|
104
|
+
(selectableWallet) =>
|
|
105
|
+
selectableWallet.walletType === walletType &&
|
|
106
|
+
selectableWallet.chain === chain &&
|
|
107
|
+
selectableWallet.selected &&
|
|
108
|
+
(isWalletRequiredFor(chain) ||
|
|
109
|
+
(!isWalletRequiredFor(chain) && !destination))
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const isAddressMatched =
|
|
113
|
+
!!destination &&
|
|
114
|
+
showCustomDestination &&
|
|
115
|
+
lastStepToBlockchainMeta &&
|
|
116
|
+
!isValidAddress(lastStepToBlockchainMeta, destination);
|
|
117
|
+
|
|
118
|
+
const resetCustomDestination = () => {
|
|
119
|
+
setShowCustomDestination(false);
|
|
120
|
+
setDestination('');
|
|
121
|
+
setSelectableWallets((selectableWallets) => {
|
|
122
|
+
let anyWalletSelected = false;
|
|
123
|
+
return selectableWallets.map((selectableWallet) => {
|
|
124
|
+
if (
|
|
125
|
+
!anyWalletSelected &&
|
|
126
|
+
selectableWallet.chain === lastStepToBlockchain?.name
|
|
127
|
+
) {
|
|
128
|
+
anyWalletSelected = true;
|
|
129
|
+
return {
|
|
130
|
+
...selectableWallet,
|
|
131
|
+
selected: true,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return selectableWallet;
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const onChange = (wallet: Wallet) => {
|
|
140
|
+
if (showMoreWalletFor) {
|
|
141
|
+
setShowMoreWalletFor('');
|
|
142
|
+
}
|
|
143
|
+
const selected = isSelected(wallet.walletType, wallet.chain);
|
|
144
|
+
if (selected) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const connectedWallet = connectedWallets.find(
|
|
148
|
+
(connectedWallet) =>
|
|
149
|
+
connectedWallet.walletType === wallet.walletType &&
|
|
150
|
+
connectedWallet.chain === wallet.chain
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
if (!connectedWallet) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
onCancel();
|
|
158
|
+
if (wallet.chain === lastStepToBlockchain?.name && showCustomDestination) {
|
|
159
|
+
setShowCustomDestination(false);
|
|
160
|
+
setDestination('');
|
|
161
|
+
}
|
|
162
|
+
setSelectableWallets((selectableWallets) =>
|
|
163
|
+
selectableWallets
|
|
164
|
+
.filter((selectableWallet) => selectableWallet.chain !== wallet.chain)
|
|
165
|
+
.concat({ ...connectedWallet, selected: true })
|
|
166
|
+
);
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const onConfirmBalance = () => {
|
|
170
|
+
const lastSelectedWallets = selectableWallets.filter(
|
|
171
|
+
(wallet) => wallet.selected
|
|
172
|
+
);
|
|
173
|
+
selectWallets(lastSelectedWallets);
|
|
174
|
+
selectRouteWallets(lastSelectedWallets);
|
|
175
|
+
setCustomDestination(destination);
|
|
176
|
+
setRouteWalletConfirmed(true);
|
|
177
|
+
onClose();
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const onConfirmWallets = async () => {
|
|
181
|
+
setBalanceWarnings([]);
|
|
182
|
+
setError('');
|
|
183
|
+
setRouteWarning(null);
|
|
184
|
+
const selectedWallets = connectedWallets.filter((connectedWallet) =>
|
|
185
|
+
selectableWallets.find(
|
|
186
|
+
(selectableWallet) =>
|
|
187
|
+
selectableWallet.chain === connectedWallet.chain &&
|
|
188
|
+
selectableWallet.walletType === connectedWallet.walletType
|
|
189
|
+
)
|
|
190
|
+
);
|
|
191
|
+
const result = await onCheckBalance?.({
|
|
192
|
+
selectedWallets,
|
|
193
|
+
customDestination: destination,
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const warnings = result.warnings;
|
|
197
|
+
if (warnings?.balance?.messages) {
|
|
198
|
+
setBalanceWarnings(warnings.balance.messages);
|
|
199
|
+
}
|
|
200
|
+
if (warnings?.route) {
|
|
201
|
+
setRouteWarning(warnings.route);
|
|
202
|
+
}
|
|
203
|
+
if (result.error) {
|
|
204
|
+
setError(getConfirmSwapErrorMessage(result.error));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (!result.error && (!warnings?.balance?.messages.length || 0 > 0)) {
|
|
208
|
+
onConfirmBalance();
|
|
209
|
+
} else {
|
|
210
|
+
setBalanceWarnings(warnings?.balance?.messages ?? []);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
useEffect(() => {
|
|
215
|
+
setSelectableWallets((selectableWallets) =>
|
|
216
|
+
selectableWallets.concat(
|
|
217
|
+
connectedWallets.filter((connectedWallet) => {
|
|
218
|
+
const anyWalletSelected = !!selectableWallets.find(
|
|
219
|
+
(selectableWallet) =>
|
|
220
|
+
selectableWallet.chain === connectedWallet.chain
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
return (
|
|
224
|
+
!anyWalletSelected &&
|
|
225
|
+
connectedWallet.selected &&
|
|
226
|
+
requiredWallets.includes(connectedWallet.chain)
|
|
227
|
+
);
|
|
228
|
+
})
|
|
229
|
+
)
|
|
230
|
+
);
|
|
231
|
+
}, [connectedWallets.length]);
|
|
232
|
+
|
|
233
|
+
const modalContainer = document.querySelector('#swap-box') as HTMLDivElement;
|
|
234
|
+
|
|
235
|
+
const navigate = useNavigate();
|
|
236
|
+
return (
|
|
237
|
+
<Modal
|
|
238
|
+
open={open}
|
|
239
|
+
onClose={() => {
|
|
240
|
+
if (!routeWalletsConfirmed) {
|
|
241
|
+
navigate(navigationRoutes.home, { replace: true });
|
|
242
|
+
}
|
|
243
|
+
onClose();
|
|
244
|
+
}}
|
|
245
|
+
dismissible={!showMoreWalletFor}
|
|
246
|
+
container={modalContainer}
|
|
247
|
+
{...(!showMoreWalletFor && {
|
|
248
|
+
footer: (
|
|
249
|
+
<ConfirmButton>
|
|
250
|
+
<Button
|
|
251
|
+
loading={loading}
|
|
252
|
+
disabled={confirmSwapDisabled(
|
|
253
|
+
loading,
|
|
254
|
+
showCustomDestination,
|
|
255
|
+
destination,
|
|
256
|
+
bestRoute,
|
|
257
|
+
selectableWallets,
|
|
258
|
+
lastStepToBlockchain
|
|
259
|
+
)}
|
|
260
|
+
onClick={onConfirmWallets}
|
|
261
|
+
variant="contained"
|
|
262
|
+
type="primary"
|
|
263
|
+
fullWidth
|
|
264
|
+
size="large">
|
|
265
|
+
Confirm
|
|
266
|
+
</Button>
|
|
267
|
+
</ConfirmButton>
|
|
268
|
+
),
|
|
269
|
+
})}
|
|
270
|
+
{...(showMoreWalletFor && {
|
|
271
|
+
containerStyle: { padding: '$0' },
|
|
272
|
+
header: (
|
|
273
|
+
<ShowMoreHeader>
|
|
274
|
+
<NavigateBack
|
|
275
|
+
variant="ghost"
|
|
276
|
+
onClick={setShowMoreWalletFor.bind(null, '')}>
|
|
277
|
+
<ChevronLeftIcon size={16} />
|
|
278
|
+
</NavigateBack>
|
|
279
|
+
<Typography
|
|
280
|
+
variant="headline"
|
|
281
|
+
size="small">{`Your ${showMoreWalletFor} wallets`}</Typography>
|
|
282
|
+
</ShowMoreHeader>
|
|
283
|
+
),
|
|
284
|
+
})}
|
|
285
|
+
anchor="center">
|
|
286
|
+
<Modal
|
|
287
|
+
open={balanceWarnings.length > 0}
|
|
288
|
+
onClose={setBalanceWarnings.bind(null, [])}
|
|
289
|
+
container={modalContainer}>
|
|
290
|
+
<MessageBox
|
|
291
|
+
title="Insufficient account balance"
|
|
292
|
+
type="error"
|
|
293
|
+
description={<BalanceErrors messages={balanceWarnings ?? []} />}>
|
|
294
|
+
<Button
|
|
295
|
+
variant="outlined"
|
|
296
|
+
size="large"
|
|
297
|
+
type="primary"
|
|
298
|
+
fullWidth
|
|
299
|
+
onClick={onConfirmBalance}>
|
|
300
|
+
Proceed anyway
|
|
301
|
+
</Button>
|
|
302
|
+
</MessageBox>
|
|
303
|
+
</Modal>
|
|
304
|
+
{showMoreWalletFor && (
|
|
305
|
+
<WalletsContainer>
|
|
306
|
+
<div className="wallets-list">
|
|
307
|
+
<WalletList
|
|
308
|
+
chain={showMoreWalletFor}
|
|
309
|
+
isSelected={isSelected}
|
|
310
|
+
selectWallet={onChange}
|
|
311
|
+
multiWallets={config?.multiWallets ?? true}
|
|
312
|
+
supportedWallets={config?.wallets ?? []}
|
|
313
|
+
config={config}
|
|
314
|
+
onShowMore={setShowMoreWalletFor.bind(null, showMoreWalletFor)}
|
|
315
|
+
/>
|
|
316
|
+
</div>
|
|
317
|
+
</WalletsContainer>
|
|
318
|
+
)}
|
|
319
|
+
{!showMoreWalletFor && (
|
|
320
|
+
<>
|
|
321
|
+
{error && (
|
|
322
|
+
<>
|
|
323
|
+
<Alert variant="alarm" type="error" title={error} />
|
|
324
|
+
<Divider size={12} />
|
|
325
|
+
</>
|
|
326
|
+
)}
|
|
327
|
+
{routeWarning && (
|
|
328
|
+
<>
|
|
329
|
+
<Alert
|
|
330
|
+
variant="alarm"
|
|
331
|
+
type="warning"
|
|
332
|
+
title={getRouteWarningMessage(routeWarning)}
|
|
333
|
+
/>
|
|
334
|
+
<Divider size={12} />
|
|
335
|
+
</>
|
|
336
|
+
)}
|
|
337
|
+
<Wallets>
|
|
338
|
+
{requiredWallets.map((requiredWallet, index) => {
|
|
339
|
+
const blockchain = blockchains.find(
|
|
340
|
+
(blockchain) => blockchain.name === requiredWallet
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
const key = `wallet-${index}`;
|
|
344
|
+
const isLastWallet = index === requiredWallets.length - 1;
|
|
345
|
+
|
|
346
|
+
return (
|
|
347
|
+
<div key={key}>
|
|
348
|
+
<Title>
|
|
349
|
+
<Typography
|
|
350
|
+
variant="title"
|
|
351
|
+
size="xmedium">{`Your ${blockchain?.displayName} wallets`}</Typography>
|
|
352
|
+
<Typography
|
|
353
|
+
variant="label"
|
|
354
|
+
color="$neutral900"
|
|
355
|
+
size="medium">{`You need to connect a ${blockchain?.displayName} wallet.`}</Typography>
|
|
356
|
+
</Title>
|
|
357
|
+
<Divider size={24} />
|
|
358
|
+
<ListContainer>
|
|
359
|
+
<WalletList
|
|
360
|
+
chain={requiredWallet}
|
|
361
|
+
isSelected={isSelected}
|
|
362
|
+
selectWallet={onChange}
|
|
363
|
+
multiWallets={config?.multiWallets ?? true}
|
|
364
|
+
supportedWallets={config?.wallets ?? []}
|
|
365
|
+
config={config}
|
|
366
|
+
limit={NUMBER_OF_WALLETS_TO_DISPLAY}
|
|
367
|
+
onShowMore={() =>
|
|
368
|
+
setShowMoreWalletFor(blockchain?.name ?? '')
|
|
369
|
+
}
|
|
370
|
+
/>
|
|
371
|
+
</ListContainer>
|
|
372
|
+
{!isLastWallet && <Divider size={32} />}
|
|
373
|
+
{isLastWallet && customDestinationEnabled && (
|
|
374
|
+
<CustomDestination>
|
|
375
|
+
<CollapsibleRoot
|
|
376
|
+
selected={showCustomDestination}
|
|
377
|
+
open={showCustomDestination}
|
|
378
|
+
onOpenChange={(checked) => {
|
|
379
|
+
if (!checked) {
|
|
380
|
+
resetCustomDestination();
|
|
381
|
+
} else {
|
|
382
|
+
if (
|
|
383
|
+
!isWalletRequiredFor(
|
|
384
|
+
lastStepToBlockchain?.name ?? ''
|
|
385
|
+
)
|
|
386
|
+
) {
|
|
387
|
+
setSelectableWallets((selectableWallets) =>
|
|
388
|
+
selectableWallets.map((selectableWallet) => {
|
|
389
|
+
if (
|
|
390
|
+
selectableWallet.chain ===
|
|
391
|
+
lastStepToBlockchain?.name
|
|
392
|
+
) {
|
|
393
|
+
return {
|
|
394
|
+
...selectableWallet,
|
|
395
|
+
selected: false,
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
return selectableWallet;
|
|
399
|
+
})
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}}>
|
|
404
|
+
<Trigger
|
|
405
|
+
onClick={() =>
|
|
406
|
+
setShowCustomDestination((prevState) => !prevState)
|
|
407
|
+
}>
|
|
408
|
+
<CustomDestinationButton
|
|
409
|
+
fullWidth
|
|
410
|
+
suffix={
|
|
411
|
+
<ExpandedIcon
|
|
412
|
+
orientation={
|
|
413
|
+
showCustomDestination ? 'up' : 'down'
|
|
414
|
+
}>
|
|
415
|
+
<ChevronDownIcon size={10} color="gray" />
|
|
416
|
+
</ExpandedIcon>
|
|
417
|
+
}>
|
|
418
|
+
<div className="button__content">
|
|
419
|
+
<WalletIcon size={18} color="info" />
|
|
420
|
+
<Divider size={4} direction="horizontal" />
|
|
421
|
+
<Typography variant="label" size="medium">
|
|
422
|
+
Send to a different address
|
|
423
|
+
</Typography>
|
|
424
|
+
</div>
|
|
425
|
+
</CustomDestinationButton>
|
|
426
|
+
</Trigger>
|
|
427
|
+
<CollapsibleContent open={showCustomDestination}>
|
|
428
|
+
<>
|
|
429
|
+
<Divider size={4} />
|
|
430
|
+
<StyledTextField
|
|
431
|
+
autoFocus
|
|
432
|
+
placeholder="Your destination address"
|
|
433
|
+
value={destination}
|
|
434
|
+
onChange={(e) => {
|
|
435
|
+
setDestination(e.target.value);
|
|
436
|
+
}}
|
|
437
|
+
/>
|
|
438
|
+
</>
|
|
439
|
+
</CollapsibleContent>
|
|
440
|
+
</CollapsibleRoot>
|
|
441
|
+
{isAddressMatched && (
|
|
442
|
+
<div className="alarms">
|
|
443
|
+
<Alert
|
|
444
|
+
variant="alarm"
|
|
445
|
+
type="error"
|
|
446
|
+
title={`Address '${destination}' doesn't match the blockchain address pattern.`}
|
|
447
|
+
/>
|
|
448
|
+
</div>
|
|
449
|
+
)}
|
|
450
|
+
</CustomDestination>
|
|
451
|
+
)}
|
|
452
|
+
</div>
|
|
453
|
+
);
|
|
454
|
+
})}
|
|
455
|
+
</Wallets>
|
|
456
|
+
</>
|
|
457
|
+
)}
|
|
458
|
+
</Modal>
|
|
459
|
+
);
|
|
460
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WidgetConfig } from '../..';
|
|
2
|
+
import type { ConfirmSwap } from '../../hooks/useConfirmSwap';
|
|
3
|
+
|
|
4
|
+
export type PropTypes = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
onCheckBalance: ConfirmSwap['fetch'];
|
|
9
|
+
config?: WidgetConfig;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { keyframes, styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const LogoContainer = styled('div', {
|
|
4
|
+
position: 'relative',
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const SpinAnimation = keyframes({
|
|
8
|
+
'0%': {
|
|
9
|
+
transform: 'rotate(0deg)',
|
|
10
|
+
},
|
|
11
|
+
'100%': {
|
|
12
|
+
transform: 'rotate(360deg)',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const Spinner = styled('div', {
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
border: '2px solid rgba(0, 0, 0, 0.1)',
|
|
19
|
+
borderTop: '2px solid $info500',
|
|
20
|
+
borderRadius: '$lg',
|
|
21
|
+
width: '$45',
|
|
22
|
+
height: '$45',
|
|
23
|
+
animation: `${SpinAnimation} 1s linear infinite`,
|
|
24
|
+
top: 0,
|
|
25
|
+
bottom: 0,
|
|
26
|
+
right: 0,
|
|
27
|
+
left: 0,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const WalletImageContainer = styled('div', {
|
|
31
|
+
'& img': {
|
|
32
|
+
borderRadius: '50%',
|
|
33
|
+
},
|
|
34
|
+
});
|