@rango-dev/widget-embedded 0.12.1-next.0 → 0.12.1-next.10
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/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 +297 -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 +151 -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 +149 -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 +2522 -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 +445 -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 +875 -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 +449 -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 +150 -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/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 +445 -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 +593 -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 +593 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts +22 -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 +149 -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 +445 -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 +741 -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 +593 -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 +15 -0
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +1037 -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 +149 -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 +149 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +45 -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 +593 -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 +1334 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.types.d.ts +40 -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 +593 -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 +3 -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/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 -26
- 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 +8 -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/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 +5 -5
- 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 +28 -13
- 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 +21 -25
- package/src/components/AppRoutes.tsx +54 -19
- package/src/components/BlockchainList/BlockchainList.helpers.ts +37 -0
- package/src/components/BlockchainList/BlockchainList.styles.ts +18 -0
- package/src/components/BlockchainList/BlockchainList.tsx +76 -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 +64 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +169 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +451 -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 +21 -0
- package/src/components/HeaderButtons/WalletButton.tsx +20 -0
- package/src/components/HeaderButtons/index.ts +4 -0
- package/src/components/Layout/Layout.styles.ts +51 -0
- package/src/components/Layout/Layout.tsx +89 -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/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 +112 -0
- package/src/components/NotificationContent/NotificationNotFound.tsx +17 -0
- package/src/components/NotificationContent/index.ts +1 -0
- package/src/components/RouteErrors/RouteErrors.styles.ts +27 -0
- package/src/components/RouteErrors/RouteErrors.tsx +68 -0
- package/src/components/RouteErrors/RouteErrors.types.ts +27 -0
- package/src/components/RouteErrors/RouteErrorsModal.tsx +101 -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 +43 -0
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +102 -0
- package/src/components/SwapDetails/SwapDetails.styles.ts +76 -0
- package/src/components/SwapDetails/SwapDetails.tsx +387 -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 +35 -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 +42 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +53 -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 +24 -8
- package/src/components/TokenList/LoadingTokenList.tsx +34 -0
- package/src/components/TokenList/TokenList.helpers.ts +13 -0
- package/src/components/TokenList/TokenList.styles.ts +115 -0
- package/src/components/TokenList/TokenList.tsx +269 -0
- package/src/components/TokenList/TokenList.types.ts +47 -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 +30 -4
- 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 +2 -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/hooks/useConfirmSwap.ts +251 -220
- package/src/hooks/useFetchBestRoute.ts +38 -0
- package/src/hooks/useNavigateBack.ts +15 -9
- package/src/hooks/useSwapInput.ts +102 -0
- package/src/hooks/useTheme.ts +59 -60
- package/src/hooks/useWalletList.ts +125 -0
- package/src/pages/ConfirmSwapPage.tsx +470 -228
- package/src/pages/HistoryPage.tsx +104 -15
- package/src/pages/Home.tsx +345 -111
- 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 +153 -0
- package/src/pages/SettingsPage.tsx +144 -72
- package/src/pages/SwapDetailsPage.tsx +35 -143
- 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 +21 -13
- package/src/store/ui.ts +1 -5
- package/src/store/wallets.ts +92 -76
- package/src/types/config.ts +9 -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/date.ts +15 -18
- package/src/utils/meta.ts +9 -0
- package/src/utils/numbers.ts +63 -18
- package/src/utils/routing.ts +30 -14
- package/src/utils/settings.ts +57 -0
- package/src/utils/swap.ts +166 -95
- package/src/utils/wallets.ts +159 -110
- 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,18 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const List = styled('ul', {
|
|
4
|
+
padding: 0,
|
|
5
|
+
margin: 0,
|
|
6
|
+
listStyle: 'none',
|
|
7
|
+
height: 355,
|
|
8
|
+
overflowY: 'auto',
|
|
9
|
+
paddingRight: '$5',
|
|
10
|
+
'.image-container': {
|
|
11
|
+
borderRadius: '$xm',
|
|
12
|
+
overflow: 'hidden',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const Content = styled('div', {
|
|
17
|
+
minHeight: 325,
|
|
18
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { PropTypes } from './BlockchainList.types';
|
|
2
|
+
import type { BlockchainMeta } from 'rango-sdk';
|
|
3
|
+
|
|
4
|
+
import { i18n } from '@lingui/core';
|
|
5
|
+
import {
|
|
6
|
+
Divider,
|
|
7
|
+
Image,
|
|
8
|
+
ListItemButton,
|
|
9
|
+
NotFound,
|
|
10
|
+
Typography,
|
|
11
|
+
} from '@rango-dev/ui';
|
|
12
|
+
import React, { useEffect, useState } from 'react';
|
|
13
|
+
|
|
14
|
+
import { useMetaStore } from '../../store/meta';
|
|
15
|
+
|
|
16
|
+
import { filterBlockchains } from './BlockchainList.helpers';
|
|
17
|
+
import { Content, List } from './BlockchainList.styles';
|
|
18
|
+
import { LoadingBlockchainList } from './LoadingBlockchainList';
|
|
19
|
+
|
|
20
|
+
export function BlockchainList(props: PropTypes) {
|
|
21
|
+
const { list, searchedFor, onChange, blockchainCategory } = props;
|
|
22
|
+
const [blockchains, setBlockchains] = useState<BlockchainMeta[]>(list);
|
|
23
|
+
const loadingStatus = useMetaStore.use.loadingStatus();
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setBlockchains([
|
|
27
|
+
...filterBlockchains(list, searchedFor, blockchainCategory),
|
|
28
|
+
]);
|
|
29
|
+
}, [list, searchedFor, blockchainCategory]);
|
|
30
|
+
|
|
31
|
+
const renderList = () => {
|
|
32
|
+
if (!blockchains.length && !!searchedFor) {
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<Divider size={32} />
|
|
36
|
+
<NotFound
|
|
37
|
+
title={i18n.t('No results found')}
|
|
38
|
+
description={i18n.t('Try using different keywords')}
|
|
39
|
+
/>
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return (
|
|
44
|
+
<List>
|
|
45
|
+
{blockchains.map((item) => (
|
|
46
|
+
<ListItemButton
|
|
47
|
+
key={`${item.name}-${item.chainId}`}
|
|
48
|
+
hasDivider
|
|
49
|
+
onClick={() => onChange(item)}
|
|
50
|
+
start={<Image src={item.logo} size={30} />}
|
|
51
|
+
title={
|
|
52
|
+
<Typography variant="title" size="medium">
|
|
53
|
+
{item.displayName}
|
|
54
|
+
</Typography>
|
|
55
|
+
}
|
|
56
|
+
id={item.chainId as string}
|
|
57
|
+
/>
|
|
58
|
+
))}
|
|
59
|
+
</List>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div>
|
|
65
|
+
<Typography variant="label" size="large">
|
|
66
|
+
{i18n.t('Select Blockchain')}
|
|
67
|
+
</Typography>
|
|
68
|
+
<Divider size={4} />
|
|
69
|
+
|
|
70
|
+
<Content>
|
|
71
|
+
{loadingStatus === 'loading' && <LoadingBlockchainList />}
|
|
72
|
+
{loadingStatus === 'success' && renderList()}
|
|
73
|
+
</Content>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ListItem, Skeleton } from '@rango-dev/ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { List } from './BlockchainList.styles';
|
|
5
|
+
|
|
6
|
+
const ITEM_SKELETON_COUNT = 20;
|
|
7
|
+
export function LoadingBlockchainList() {
|
|
8
|
+
return (
|
|
9
|
+
<List>
|
|
10
|
+
{Array.from(Array(ITEM_SKELETON_COUNT), (e) => (
|
|
11
|
+
<ListItem
|
|
12
|
+
key={e}
|
|
13
|
+
hasDivider
|
|
14
|
+
start={<Skeleton variant="circular" width={35} height={35} />}
|
|
15
|
+
title={<Skeleton variant="text" size="large" width={90} />}
|
|
16
|
+
/>
|
|
17
|
+
))}
|
|
18
|
+
</List>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BlockchainList } from './BlockchainList';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const Chip = styled('button', {
|
|
4
|
+
padding: '$10',
|
|
5
|
+
borderRadius: '$sm',
|
|
6
|
+
backgroundColor: '$neutral100',
|
|
7
|
+
display: 'flex',
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
cursor: 'pointer',
|
|
12
|
+
border: 0,
|
|
13
|
+
'.image-container': {
|
|
14
|
+
borderRadius: '$xm',
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
},
|
|
17
|
+
'&:hover': {
|
|
18
|
+
backgroundColor: '$neutral400',
|
|
19
|
+
},
|
|
20
|
+
'&:focus-visible': {
|
|
21
|
+
outline: 0,
|
|
22
|
+
backgroundColor: '$neutral500',
|
|
23
|
+
},
|
|
24
|
+
variants: {
|
|
25
|
+
selected: {
|
|
26
|
+
true: { outline: '1px solid $secondary500' },
|
|
27
|
+
false: { outline: 0 },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PropTypes } from './BlockchainsChip.types';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { Chip } from './BlockchainsChip.styles';
|
|
7
|
+
|
|
8
|
+
export function BlockchainsChip(props: PropsWithChildren<PropTypes>) {
|
|
9
|
+
const { children, selected, onClick } = props;
|
|
10
|
+
return (
|
|
11
|
+
<Chip selected={selected} onClick={onClick}>
|
|
12
|
+
{children}
|
|
13
|
+
</Chip>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BlockchainsChip } from './BlockchainsChip';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BlockchainMeta } from 'rango-sdk';
|
|
2
|
+
|
|
3
|
+
export const sortBlockchains = (blockchains: BlockchainMeta[]) => {
|
|
4
|
+
const importantBlockchains: BlockchainMeta[] = [];
|
|
5
|
+
const otherBlockchains: BlockchainMeta[] = [];
|
|
6
|
+
|
|
7
|
+
for (const blockchain of blockchains) {
|
|
8
|
+
if (
|
|
9
|
+
blockchain.name === 'ETH' ||
|
|
10
|
+
blockchain.name === 'COSMOS' ||
|
|
11
|
+
blockchain.name === 'OSMOSIS'
|
|
12
|
+
) {
|
|
13
|
+
importantBlockchains.push(blockchain);
|
|
14
|
+
} else {
|
|
15
|
+
otherBlockchains.push(blockchain);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return importantBlockchains.concat(otherBlockchains);
|
|
20
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
import type { PropTypes } from './BlockchainsSection.types';
|
|
3
|
+
|
|
4
|
+
import { i18n } from '@lingui/core';
|
|
5
|
+
import { Divider, Image, Skeleton, Typography } from '@rango-dev/ui';
|
|
6
|
+
import { type BlockchainMeta } from 'rango-sdk';
|
|
7
|
+
import React, { useEffect, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import { useBestRouteStore } from '../../store/bestRoute';
|
|
10
|
+
import { useMetaStore } from '../../store/meta';
|
|
11
|
+
import { BlockchainsChip } from '../BlockchainsChip';
|
|
12
|
+
|
|
13
|
+
import { sortBlockchains } from './BlockchainSection.helpers';
|
|
14
|
+
import { Container } from './BlockchainsSection.styles';
|
|
15
|
+
|
|
16
|
+
const MIN = 9;
|
|
17
|
+
const MAX = 10;
|
|
18
|
+
const NUMBER_OF_LOADING = 12;
|
|
19
|
+
export function BlockchainsSection(props: PropTypes) {
|
|
20
|
+
const { blockchains, type, blockchain, onChange, onMoreClick } = props;
|
|
21
|
+
const sortedBlockchains = sortBlockchains(blockchains);
|
|
22
|
+
const [selectFromMoreBlockchain, setSelectFromMoreBlockchain] =
|
|
23
|
+
useState<BlockchainMeta | null>(null);
|
|
24
|
+
const loadingStatus = useMetaStore.use.loadingStatus();
|
|
25
|
+
const resetToBlockchain = useBestRouteStore.use.resetToBlockchain();
|
|
26
|
+
const resetFromBlockchain = useBestRouteStore.use.resetFromBlockchain();
|
|
27
|
+
const COUNT_BLOCKCHAINS = !!selectFromMoreBlockchain ? MIN : MAX;
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const selectBlockchainFromMore = sortedBlockchains
|
|
31
|
+
.slice(MAX, sortedBlockchains.length)
|
|
32
|
+
.find(
|
|
33
|
+
(item) =>
|
|
34
|
+
item.chainId === blockchain?.chainId && item.name === blockchain?.name
|
|
35
|
+
);
|
|
36
|
+
if (!!selectBlockchainFromMore) {
|
|
37
|
+
setSelectFromMoreBlockchain(selectBlockchainFromMore);
|
|
38
|
+
}
|
|
39
|
+
}, [blockchain]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div>
|
|
43
|
+
<Divider size={12} />
|
|
44
|
+
<Typography variant="label" size="large">
|
|
45
|
+
{i18n.t('Select Blockchain')}
|
|
46
|
+
</Typography>
|
|
47
|
+
<Divider size={12} />
|
|
48
|
+
<Container>
|
|
49
|
+
{loadingStatus === 'loading' &&
|
|
50
|
+
Array.from(Array(NUMBER_OF_LOADING), (e) => (
|
|
51
|
+
<Skeleton key={e} variant="rounded" height={50} />
|
|
52
|
+
))}
|
|
53
|
+
{loadingStatus === 'success' && (
|
|
54
|
+
<>
|
|
55
|
+
<BlockchainsChip
|
|
56
|
+
selected={!blockchain}
|
|
57
|
+
onClick={() => {
|
|
58
|
+
if (type === 'from') {
|
|
59
|
+
resetFromBlockchain();
|
|
60
|
+
} else {
|
|
61
|
+
resetToBlockchain();
|
|
62
|
+
}
|
|
63
|
+
}}>
|
|
64
|
+
<Typography variant="body" size="xsmall" color="secondary500">
|
|
65
|
+
{i18n.t('All')}
|
|
66
|
+
</Typography>
|
|
67
|
+
</BlockchainsChip>
|
|
68
|
+
{!!selectFromMoreBlockchain && (
|
|
69
|
+
<BlockchainsChip
|
|
70
|
+
selected={
|
|
71
|
+
!!selectFromMoreBlockchain &&
|
|
72
|
+
selectFromMoreBlockchain.chainId === blockchain?.chainId
|
|
73
|
+
}
|
|
74
|
+
key={selectFromMoreBlockchain.chainId}
|
|
75
|
+
onClick={() => onChange(selectFromMoreBlockchain)}>
|
|
76
|
+
<Image src={selectFromMoreBlockchain.logo} size={30} />
|
|
77
|
+
</BlockchainsChip>
|
|
78
|
+
)}
|
|
79
|
+
{sortedBlockchains.slice(0, COUNT_BLOCKCHAINS).map((item) => (
|
|
80
|
+
<BlockchainsChip
|
|
81
|
+
key={item.chainId}
|
|
82
|
+
selected={!!blockchain && blockchain.chainId === item.chainId}
|
|
83
|
+
onClick={() => onChange(item)}>
|
|
84
|
+
<Image src={item.logo} size={30} />
|
|
85
|
+
</BlockchainsChip>
|
|
86
|
+
))}
|
|
87
|
+
|
|
88
|
+
<BlockchainsChip onClick={onMoreClick}>
|
|
89
|
+
<Typography variant="body" size="xsmall" color="secondary500">
|
|
90
|
+
{i18n._('More +{count}', {
|
|
91
|
+
count: sortedBlockchains.length - MAX,
|
|
92
|
+
})}
|
|
93
|
+
</Typography>
|
|
94
|
+
</BlockchainsChip>
|
|
95
|
+
</>
|
|
96
|
+
)}
|
|
97
|
+
</Container>
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BlockchainsSection } from './BlockchainsSection';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
import type { Step } from '@rango-dev/ui/dist/widget/ui/src/components/BestRoute/BestRoute.types';
|
|
3
|
+
import type { BestRouteResponse, BlockchainMeta } from 'rango-sdk';
|
|
4
|
+
|
|
5
|
+
import { numberToString } from '../../utils/numbers';
|
|
6
|
+
|
|
7
|
+
export function formatBestRoute(
|
|
8
|
+
bestRoute: BestRouteResponse
|
|
9
|
+
): Step[] | undefined {
|
|
10
|
+
return bestRoute.result?.swaps.map((swap) => {
|
|
11
|
+
return {
|
|
12
|
+
swapper: { displayName: swap.swapperId, image: swap.swapperLogo },
|
|
13
|
+
from: {
|
|
14
|
+
token: { displayName: swap.from.symbol, image: swap.from.logo },
|
|
15
|
+
chain: {
|
|
16
|
+
displayName: swap.from.blockchain,
|
|
17
|
+
image: swap.from.blockchainLogo,
|
|
18
|
+
},
|
|
19
|
+
price: {
|
|
20
|
+
value: numberToString(swap.fromAmount, 6, 6),
|
|
21
|
+
usdValue: numberToString(swap.from.usdPrice?.toString(), 6, 6),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
to: {
|
|
25
|
+
token: { displayName: swap.to.symbol, image: swap.to.logo },
|
|
26
|
+
chain: {
|
|
27
|
+
displayName: swap.to.blockchain,
|
|
28
|
+
image: swap.to.blockchainLogo,
|
|
29
|
+
},
|
|
30
|
+
price: {
|
|
31
|
+
value: numberToString(swap.toAmount, 6, 6),
|
|
32
|
+
usdValue: numberToString(swap.to.usdPrice?.toString(), 6, 6),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getRequiredWallets(route: BestRouteResponse | null): string[] {
|
|
40
|
+
const wallets: string[] = [];
|
|
41
|
+
|
|
42
|
+
route?.result?.swaps.forEach((swap) => {
|
|
43
|
+
const currentStepFromBlockchain = swap.from.blockchain;
|
|
44
|
+
const currentStepToBlockchain = swap.to.blockchain;
|
|
45
|
+
let lastAddedWallet = wallets[wallets.length - 1];
|
|
46
|
+
if (currentStepFromBlockchain != lastAddedWallet) {
|
|
47
|
+
wallets.push(currentStepFromBlockchain);
|
|
48
|
+
}
|
|
49
|
+
lastAddedWallet = wallets[wallets.length - 1];
|
|
50
|
+
if (currentStepToBlockchain != lastAddedWallet) {
|
|
51
|
+
wallets.push(currentStepToBlockchain);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return wallets;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function isValidAddress(
|
|
58
|
+
chain: BlockchainMeta,
|
|
59
|
+
address: string
|
|
60
|
+
): boolean {
|
|
61
|
+
const regex = chain.addressPatterns;
|
|
62
|
+
const valid = regex.filter((r) => new RegExp(r).test(address)).length > 0;
|
|
63
|
+
return valid;
|
|
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%' });
|