@rango-dev/widget-embedded 0.17.1-next.3 → 0.17.1-next.31
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/QueueManager.d.ts +5 -2
- package/dist/QueueManager.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +0 -2
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +1 -6
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +370 -56
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +0 -2
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +1 -4
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +2 -2
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +1727 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts +633 -3
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +0 -1
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +157 -0
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +628 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +157 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
- package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +942 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.types.d.ts +3 -9
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
- package/dist/components/TokenList/index.d.ts +0 -1
- package/dist/components/TokenList/index.d.ts.map +1 -1
- package/dist/components/UpdateUrl.d.ts +1 -6
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/navigationRoutes.d.ts +1 -2
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/searchParams.d.ts +2 -1
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/containers/App/App.d.ts +3 -0
- package/dist/containers/App/App.d.ts.map +1 -0
- package/dist/containers/App/App.styles.d.ts +158 -0
- package/dist/containers/App/App.styles.d.ts.map +1 -0
- package/dist/containers/App/index.d.ts +2 -0
- package/dist/containers/App/index.d.ts.map +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +316 -0
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +3 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Wallets/Wallets.d.ts +6 -0
- package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
- package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
- package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
- package/dist/containers/Wallets/index.d.ts +2 -0
- package/dist/containers/Wallets/index.d.ts.map +1 -0
- package/dist/containers/Widget/Widget.d.ts +5 -0
- package/dist/containers/Widget/Widget.d.ts.map +1 -0
- package/dist/containers/Widget/Widget.types.d.ts +5 -0
- package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
- package/dist/containers/Widget/index.d.ts +3 -0
- package/dist/containers/Widget/index.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +20 -0
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +21 -0
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/index.d.ts +2 -0
- package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/index.d.ts +2 -0
- package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +6 -3
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
- package/dist/hooks/useForceAutoConnect.d.ts +2 -0
- package/dist/hooks/useForceAutoConnect.d.ts.map +1 -0
- package/dist/hooks/useLanguage.d.ts +1 -1
- package/dist/hooks/useLanguage.d.ts.map +1 -1
- package/dist/hooks/useNavigateBack.d.ts +1 -3
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +3 -5
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts +1 -2
- package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.d.ts +20 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts +1 -6
- 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.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts +1 -2
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts +1 -6
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts +1 -8
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/AppStore.d.ts +47 -0
- package/dist/store/AppStore.d.ts.map +1 -0
- package/dist/store/app.d.ts +41 -22
- package/dist/store/app.d.ts.map +1 -1
- package/dist/store/notification.d.ts +4 -3
- package/dist/store/notification.d.ts.map +1 -1
- package/dist/store/quote.d.ts +23 -16
- package/dist/store/quote.d.ts.map +1 -1
- package/dist/store/slices/config.d.ts +3 -2
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +3 -0
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/slices/settings.d.ts +39 -0
- package/dist/store/slices/settings.d.ts.map +1 -0
- package/dist/store/ui.d.ts +2 -1
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +14 -9
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +38 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/swap.d.ts +4 -14
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +15 -1
- package/dist/types/wallets.d.ts.map +1 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +1 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +2 -1
- package/dist/utils/meta.d.ts.map +1 -1
- package/dist/utils/providers.d.ts +2 -2
- package/dist/utils/providers.d.ts.map +1 -1
- package/dist/utils/queue.d.ts +2 -2
- package/dist/utils/queue.d.ts.map +1 -1
- package/dist/utils/quote.d.ts +1 -1
- package/dist/utils/quote.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +6 -2
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +16 -7
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/time.d.ts +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +7 -9
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/QueueManager.tsx +18 -17
- package/src/components/AppRouter.tsx +8 -32
- package/src/components/AppRoutes.tsx +57 -69
- package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
- package/src/components/BlockchainList/BlockchainList.tsx +4 -4
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +4 -4
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +12 -6
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +20 -21
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +0 -2
- package/src/components/ConfirmWalletsModal/WalletList.tsx +6 -5
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -4
- package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
- package/src/components/Layout/Layout.tsx +20 -7
- package/src/components/Layout/Layout.types.ts +2 -2
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +14 -7
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +63 -60
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +17 -8
- package/src/components/NoResult/NoResult.helpers.ts +12 -12
- package/src/components/NoResult/NoResult.tsx +6 -6
- package/src/components/NotificationContent/NotificationContent.tsx +5 -3
- package/src/components/Quote/Quote.styles.ts +42 -12
- package/src/components/Quote/Quote.tsx +106 -37
- package/src/components/Quote/Quote.types.ts +0 -1
- package/src/components/Quote/QuoteSkeleton.tsx +1 -1
- package/src/components/Quote/QuoteSummary.styles.ts +9 -8
- package/src/components/Quote/QuoteSummary.tsx +2 -2
- package/src/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx +1 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +11 -4
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +8 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +13 -13
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -3
- package/src/components/Slippage/Slippage.tsx +3 -5
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -7
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.styles.ts +37 -33
- package/src/components/SwapDetails/SwapDetails.tsx +33 -45
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +10 -1
- package/src/components/SwapsGroup/SwapsGroup.tsx +3 -5
- package/src/components/TokenList/TokenList.helpers.ts +2 -2
- package/src/components/TokenList/TokenList.styles.ts +58 -37
- package/src/components/TokenList/TokenList.tsx +28 -23
- package/src/components/TokenList/TokenList.types.ts +3 -10
- package/src/components/TokenList/index.ts +0 -1
- package/src/components/UpdateUrl.tsx +23 -18
- package/src/components/WidgetEvents.tsx +4 -2
- package/src/constants/errors.ts +9 -5
- package/src/constants/index.ts +1 -0
- package/src/constants/navigationRoutes.ts +7 -8
- package/src/constants/searchParams.ts +1 -0
- package/src/containers/App/App.styles.ts +18 -0
- package/src/containers/App/App.tsx +52 -0
- package/src/containers/App/index.ts +1 -0
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +17 -1
- package/src/containers/QuoteInfo/QuoteInfo.tsx +44 -43
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +3 -0
- package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +48 -34
- package/src/containers/Wallets/Wallets.types.ts +12 -0
- package/src/containers/Wallets/index.ts +1 -0
- package/src/containers/Widget/Widget.tsx +19 -0
- package/src/containers/Widget/Widget.types.ts +5 -0
- package/src/containers/Widget/index.ts +2 -0
- package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +64 -0
- package/src/containers/WidgetInfo/WidgetInfo.tsx +62 -0
- package/src/containers/WidgetInfo/WidgetInfo.types.ts +21 -0
- package/src/containers/WidgetInfo/index.ts +1 -0
- package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
- package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
- package/src/containers/WidgetProvider/index.ts +1 -0
- package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +15 -11
- package/src/hooks/useConfirmSwap/useConfirmSwap.ts +25 -24
- package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
- package/src/hooks/useForceAutoConnect.ts +27 -0
- package/src/hooks/useLanguage.ts +4 -5
- package/src/hooks/useNavigateBack.ts +3 -52
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +15 -6
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
- package/src/hooks/useSwapInput.ts +89 -30
- package/src/hooks/useSyncStoresWithConfig.ts +38 -22
- package/src/hooks/useTheme.ts +4 -5
- package/src/hooks/useWalletList.ts +3 -5
- package/src/index.ts +53 -5
- package/src/pages/ConfirmSwapPage.tsx +61 -41
- package/src/pages/HistoryPage.tsx +2 -7
- package/src/pages/Home.tsx +58 -88
- package/src/pages/LanguagePage.tsx +0 -5
- package/src/pages/LiquiditySourcePage.tsx +24 -37
- package/src/pages/SelectBlockchainPage.tsx +28 -21
- package/src/pages/SelectSwapItemsPage.tsx +10 -27
- package/src/pages/SettingsPage.tsx +28 -24
- package/src/pages/SwapDetailsPage.tsx +6 -7
- package/src/pages/ThemePage.tsx +2 -7
- package/src/pages/WalletsPage.tsx +4 -15
- package/src/services/httpService.ts +1 -1
- package/src/store/AppStore.tsx +41 -0
- package/src/store/app.ts +44 -6
- package/src/store/quote.ts +29 -26
- package/src/store/slices/config.ts +25 -15
- package/src/store/slices/data.ts +64 -29
- package/src/store/slices/settings.ts +168 -0
- package/src/store/wallets.ts +68 -37
- package/src/types/config.ts +50 -5
- package/src/types/swap.ts +4 -13
- package/src/types/wallets.ts +18 -1
- package/src/utils/colors.ts +2 -1
- package/src/utils/configs.ts +2 -1
- package/src/utils/date.ts +1 -1
- package/src/utils/meta.ts +8 -1
- package/src/utils/providers.ts +8 -5
- package/src/utils/queue.ts +2 -2
- package/src/utils/quote.ts +7 -7
- package/src/utils/settings.ts +17 -10
- package/src/utils/swap.ts +59 -55
- package/src/utils/time.ts +1 -1
- package/src/utils/wallets.ts +107 -149
- package/dist/Wallets.d.ts +0 -17
- package/dist/Wallets.d.ts.map +0 -1
- package/dist/Widget.d.ts +0 -9
- package/dist/Widget.d.ts.map +0 -1
- package/dist/store/meta.d.ts +0 -23
- package/dist/store/meta.d.ts.map +0 -1
- package/dist/store/settings.d.ts +0 -81
- package/dist/store/settings.d.ts.map +0 -1
- package/src/Widget.tsx +0 -119
- package/src/store/meta.ts +0 -39
- package/src/store/settings.ts +0 -158
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { css, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
position: 'relative',
|
|
5
5
|
display: 'flex',
|
|
6
6
|
flexDirection: 'column',
|
|
7
7
|
width: '100%',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const separatorStyles = css({
|
|
11
|
+
height: '14px',
|
|
12
|
+
marginLeft: '14px',
|
|
13
|
+
position: 'absolute',
|
|
14
|
+
borderLeft: '1px solid $foreground',
|
|
15
|
+
top: '42%',
|
|
15
16
|
});
|
|
@@ -3,7 +3,7 @@ import type { PriceImpactWarningLevel, Step } from '@rango-dev/ui';
|
|
|
3
3
|
import { TokenAmount } from '@rango-dev/ui';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
-
import { Container } from './QuoteSummary.styles';
|
|
6
|
+
import { Container, separatorStyles } from './QuoteSummary.styles';
|
|
7
7
|
|
|
8
8
|
type PropTypes = {
|
|
9
9
|
from: Step['from'];
|
|
@@ -27,7 +27,7 @@ export function QuoteSummary(props: PropTypes) {
|
|
|
27
27
|
}}
|
|
28
28
|
chain={{ image: from.chain.image }}
|
|
29
29
|
/>
|
|
30
|
-
<div className=
|
|
30
|
+
<div className={separatorStyles()} />
|
|
31
31
|
<TokenAmount
|
|
32
32
|
direction="horizontal"
|
|
33
33
|
label="Estimated output"
|
|
@@ -10,7 +10,7 @@ export function QuoteErrorsModalItem(props: ModalContentData) {
|
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
12
|
<Item>
|
|
13
|
-
<Typography size="medium" variant="label"
|
|
13
|
+
<Typography size="medium" variant="label" className="_title">
|
|
14
14
|
{title}
|
|
15
15
|
</Typography>
|
|
16
16
|
<Typography
|
|
@@ -31,6 +31,7 @@ export function makeAlerts(
|
|
|
31
31
|
if (warningLevel === 'high') {
|
|
32
32
|
alertInfo.alertType = 'error';
|
|
33
33
|
}
|
|
34
|
+
alertInfo.action = null;
|
|
34
35
|
alertInfo.title = errorMessages().highValueLossError.title;
|
|
35
36
|
}
|
|
36
37
|
if (warning.type === QuoteWarningType.UNKNOWN_PRICE) {
|
|
@@ -38,14 +39,15 @@ export function makeAlerts(
|
|
|
38
39
|
}
|
|
39
40
|
if (warning.type === QuoteWarningType.INSUFFICIENT_SLIPPAGE) {
|
|
40
41
|
alertInfo.title = i18n.t({
|
|
41
|
-
id: '
|
|
42
|
+
id: 'We recommend you to increase slippage to at least {minRequiredSlippage} for this route.',
|
|
42
43
|
values: {
|
|
43
44
|
minRequiredSlippage: warning.minRequiredSlippage,
|
|
44
45
|
},
|
|
45
46
|
});
|
|
47
|
+
alertInfo.action = 'change-settings';
|
|
46
48
|
}
|
|
47
49
|
if (warning.type === QuoteWarningType.HIGH_SLIPPAGE) {
|
|
48
|
-
alertInfo.title = i18n.t('Caution, your slippage is high');
|
|
50
|
+
alertInfo.title = i18n.t('Caution, your slippage is high.');
|
|
49
51
|
}
|
|
50
52
|
return alertInfo;
|
|
51
53
|
}
|
|
@@ -53,11 +55,16 @@ export function makeAlerts(
|
|
|
53
55
|
alertInfo.alertType = 'error';
|
|
54
56
|
if (error.type === QuoteErrorType.BRIDGE_LIMIT) {
|
|
55
57
|
alertInfo.title = error.recommendation;
|
|
56
|
-
alertInfo.action =
|
|
58
|
+
alertInfo.action = 'show-info';
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
if (error.type === QuoteErrorType.INSUFFICIENT_SLIPPAGE) {
|
|
60
|
-
alertInfo.title =
|
|
62
|
+
alertInfo.title = i18n.t({
|
|
63
|
+
id: 'You need to increase slippage to at least {minRequiredSlippage} for this route.',
|
|
64
|
+
values: {
|
|
65
|
+
minRequiredSlippage: error.minRequiredSlippage,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
61
68
|
alertInfo.action = 'change-settings';
|
|
62
69
|
}
|
|
63
70
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { darkTheme, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Alerts = styled('div', {
|
|
4
4
|
width: '100%',
|
|
@@ -19,6 +19,13 @@ export const Item = styled('div', {
|
|
|
19
19
|
justifyContent: 'space-between',
|
|
20
20
|
alignItems: 'center',
|
|
21
21
|
width: '100%',
|
|
22
|
+
'._title': {
|
|
23
|
+
$$color: '$colors$neutral600',
|
|
24
|
+
[`.${darkTheme} &`]: {
|
|
25
|
+
$$color: '$colors$neutral700',
|
|
26
|
+
},
|
|
27
|
+
color: '$$color',
|
|
28
|
+
},
|
|
22
29
|
});
|
|
23
30
|
|
|
24
31
|
export const Action = styled('div', {
|
|
@@ -3,9 +3,7 @@ import type { PropTypes } from './QuoteWarningsAndErrors.types';
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
4
|
import { Alert, Button, InfoIcon } from '@rango-dev/ui';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { useNavigate } from 'react-router-dom';
|
|
7
6
|
|
|
8
|
-
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
9
7
|
import { QuoteErrorType, QuoteWarningType } from '../../types';
|
|
10
8
|
import { NoResult } from '../NoResult';
|
|
11
9
|
|
|
@@ -24,10 +22,9 @@ export function QuoteWarningsAndErrors(props: PropTypes) {
|
|
|
24
22
|
onOpenWarningModal,
|
|
25
23
|
onCloseWarningModal,
|
|
26
24
|
onConfirmWarningModal,
|
|
25
|
+
onChangeSettings,
|
|
27
26
|
} = props;
|
|
28
27
|
|
|
29
|
-
const navigate = useNavigate();
|
|
30
|
-
|
|
31
28
|
const warningModalHandlers = {
|
|
32
29
|
open: showWarningModal,
|
|
33
30
|
onClose: onCloseWarningModal,
|
|
@@ -58,20 +55,23 @@ export function QuoteWarningsAndErrors(props: PropTypes) {
|
|
|
58
55
|
title={alertInfo.title}
|
|
59
56
|
type={alertInfo.alertType}
|
|
60
57
|
variant="alarm"
|
|
61
|
-
action
|
|
62
|
-
|
|
58
|
+
{...(alertInfo.action === 'show-info' && {
|
|
59
|
+
action: (
|
|
63
60
|
<Action onClick={onOpenWarningModal}>
|
|
64
61
|
<InfoIcon size={12} color="gray" />
|
|
65
62
|
</Action>
|
|
66
|
-
)
|
|
63
|
+
),
|
|
64
|
+
})}
|
|
65
|
+
{...(alertInfo.action === 'change-settings' && {
|
|
66
|
+
action: (
|
|
67
67
|
<Button
|
|
68
|
-
size="
|
|
69
|
-
type={
|
|
70
|
-
onClick={
|
|
71
|
-
{i18n.t('Change
|
|
68
|
+
size="xxsmall"
|
|
69
|
+
type={alertInfo.alertType}
|
|
70
|
+
onClick={onChangeSettings}>
|
|
71
|
+
{i18n.t('Change')}
|
|
72
72
|
</Button>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
73
|
+
),
|
|
74
|
+
})}
|
|
75
75
|
/>
|
|
76
76
|
</Alerts>
|
|
77
77
|
)}
|
|
@@ -9,7 +9,7 @@ import React from 'react';
|
|
|
9
9
|
import { useNavigate } from 'react-router-dom';
|
|
10
10
|
|
|
11
11
|
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
12
|
-
import {
|
|
12
|
+
import { useAppStore } from '../../store/AppStore';
|
|
13
13
|
import { QuoteWarningType } from '../../types';
|
|
14
14
|
import { getContainer } from '../../utils/common';
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ type PropsTypes = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export function SlippageWarningModal(props: PropsTypes) {
|
|
24
|
-
const { customSlippage, slippage } =
|
|
24
|
+
const { customSlippage, slippage } = useAppStore();
|
|
25
25
|
const { open, onClose, onConfirm, warning } = props;
|
|
26
26
|
const navigate = useNavigate();
|
|
27
27
|
const userSlippage = customSlippage ?? slippage;
|
|
@@ -33,7 +33,7 @@ export function SlippageWarningModal(props: PropsTypes) {
|
|
|
33
33
|
<Button
|
|
34
34
|
size="small"
|
|
35
35
|
variant="ghost"
|
|
36
|
-
onClick={() => navigate('
|
|
36
|
+
onClick={() => navigate('../' + navigationRoutes.settings)}>
|
|
37
37
|
<Typography variant="label" size="medium" color="$neutral900">
|
|
38
38
|
{i18n.t('Change settings')}
|
|
39
39
|
</Typography>
|
|
@@ -14,17 +14,15 @@ import {
|
|
|
14
14
|
MIN_SLIPPGAE,
|
|
15
15
|
SLIPPAGES,
|
|
16
16
|
} from '../../constants/swapSettings';
|
|
17
|
-
import {
|
|
17
|
+
import { useAppStore } from '../../store/AppStore';
|
|
18
18
|
import { getContainer } from '../../utils/common';
|
|
19
19
|
|
|
20
20
|
import { BaseContainer, Head, SlippageChipsContainer } from './Slippage.styles';
|
|
21
21
|
import { SlippageTooltipContent } from './SlippageTooltipContent';
|
|
22
22
|
|
|
23
23
|
export function Slippage() {
|
|
24
|
-
const slippage =
|
|
25
|
-
|
|
26
|
-
const customSlippage = useSettingsStore.use.customSlippage();
|
|
27
|
-
const setCustomSlippage = useSettingsStore.use.setCustomSlippage();
|
|
24
|
+
const { slippage, setSlippage, customSlippage, setCustomSlippage } =
|
|
25
|
+
useAppStore();
|
|
28
26
|
|
|
29
27
|
return (
|
|
30
28
|
<BaseContainer>
|
|
@@ -10,8 +10,6 @@ import {
|
|
|
10
10
|
} from '@rango-dev/ui';
|
|
11
11
|
import React from 'react';
|
|
12
12
|
|
|
13
|
-
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
14
|
-
import { useNavigateBack } from '../../hooks/useNavigateBack';
|
|
15
13
|
import { SuffixContainer } from '../HeaderButtons/HeaderButtons.styles';
|
|
16
14
|
import { Layout } from '../Layout';
|
|
17
15
|
import { LoadingSwapDetails } from '../LoadingSwapDetails';
|
|
@@ -20,28 +18,28 @@ import {
|
|
|
20
18
|
Container,
|
|
21
19
|
HeaderDetails,
|
|
22
20
|
PlaceholderContainer,
|
|
21
|
+
requestIdStyles,
|
|
22
|
+
rowStyles,
|
|
23
23
|
} from './SwapDetails.styles';
|
|
24
24
|
|
|
25
25
|
export function SwapDetailsPlaceholder(props: SwapDetailsPlaceholderPropTypes) {
|
|
26
26
|
const { requestId, showSkeleton } = props;
|
|
27
|
-
const { navigateBackFrom } = useNavigateBack();
|
|
28
27
|
|
|
29
28
|
return (
|
|
30
29
|
<Layout
|
|
31
30
|
noPadding
|
|
32
31
|
header={{
|
|
33
32
|
title: i18n.t('Swap and Bridge'),
|
|
34
|
-
onBack: () => navigateBackFrom(navigationRoutes.swapDetails),
|
|
35
33
|
suffix: <SuffixContainer />,
|
|
36
34
|
}}>
|
|
37
35
|
{showSkeleton && (
|
|
38
36
|
<Container>
|
|
39
37
|
<HeaderDetails>
|
|
40
|
-
<div className=
|
|
38
|
+
<div className={rowStyles()}>
|
|
41
39
|
<Typography variant="label" size="large" color="neutral700">
|
|
42
40
|
{`${i18n.t('Request ID')}:`}
|
|
43
41
|
</Typography>
|
|
44
|
-
<div className=
|
|
42
|
+
<div className={requestIdStyles()}>
|
|
45
43
|
<Typography variant="label" size="small" color="neutral700">
|
|
46
44
|
<Skeleton width={60} height={10} variant="rounded" />
|
|
47
45
|
</Typography>
|
|
@@ -50,7 +48,7 @@ export function SwapDetailsPlaceholder(props: SwapDetailsPlaceholderPropTypes) {
|
|
|
50
48
|
</IconButton>
|
|
51
49
|
</div>
|
|
52
50
|
</div>
|
|
53
|
-
<div className=
|
|
51
|
+
<div className={rowStyles()}>
|
|
54
52
|
<Typography variant="label" size="large" color="neutral700">
|
|
55
53
|
{`${i18n.t('Created at')}:`}
|
|
56
54
|
</Typography>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GetStep } from '../SwapDetailsAlerts';
|
|
2
|
-
import type { PendingSwapStep } from '@rango-dev/queue-manager-rango-preset';
|
|
3
2
|
import type { Step, StepDetailsProps } from '@rango-dev/ui';
|
|
3
|
+
import type { PendingSwapStep } from 'rango-types';
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { darkTheme, styled } from '@rango-dev/ui';
|
|
1
|
+
import { css, darkTheme, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
display: 'flex',
|
|
@@ -7,38 +7,6 @@ export const Container = styled('div', {
|
|
|
7
7
|
alignItems: 'center',
|
|
8
8
|
height: '0',
|
|
9
9
|
flexGrow: 1,
|
|
10
|
-
'& .row': {
|
|
11
|
-
display: 'flex',
|
|
12
|
-
width: '100%',
|
|
13
|
-
justifyContent: 'space-between',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
padding: '$10 $20',
|
|
16
|
-
borderBottom: '1px solid',
|
|
17
|
-
$$color: '$colors$neutral300',
|
|
18
|
-
[`.${darkTheme} &`]: {
|
|
19
|
-
$$color: '$colors$neutral400',
|
|
20
|
-
},
|
|
21
|
-
borderColor: '$$color',
|
|
22
|
-
color: '$neutral500',
|
|
23
|
-
},
|
|
24
|
-
'& .request-id': {
|
|
25
|
-
display: 'flex',
|
|
26
|
-
justifyContent: 'center',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
height: '$24',
|
|
29
|
-
},
|
|
30
|
-
'& .output': {
|
|
31
|
-
display: 'flex',
|
|
32
|
-
width: '100%',
|
|
33
|
-
padding: '$15 $20 $20',
|
|
34
|
-
flexDirection: 'column',
|
|
35
|
-
alignItems: 'start',
|
|
36
|
-
},
|
|
37
|
-
'& .title-steps': {
|
|
38
|
-
textAlign: 'left',
|
|
39
|
-
width: '100%',
|
|
40
|
-
padding: '0 $20 $10',
|
|
41
|
-
},
|
|
42
10
|
});
|
|
43
11
|
|
|
44
12
|
export const HeaderDetails = styled('div', {
|
|
@@ -70,3 +38,39 @@ export const LoaderContainer = styled('div', {
|
|
|
70
38
|
paddingTop: '33%',
|
|
71
39
|
flex: 1,
|
|
72
40
|
});
|
|
41
|
+
|
|
42
|
+
export const rowStyles = css({
|
|
43
|
+
display: 'flex',
|
|
44
|
+
width: '100%',
|
|
45
|
+
justifyContent: 'space-between',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
padding: '$10 $20',
|
|
48
|
+
borderBottom: '1px solid',
|
|
49
|
+
$$color: '$colors$neutral300',
|
|
50
|
+
[`.${darkTheme} &`]: {
|
|
51
|
+
$$color: '$colors$neutral400',
|
|
52
|
+
},
|
|
53
|
+
borderColor: '$$color',
|
|
54
|
+
color: '$neutral500',
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const requestIdStyles = css({
|
|
58
|
+
display: 'flex',
|
|
59
|
+
justifyContent: 'center',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
height: '$24',
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const outputStyles = css({
|
|
65
|
+
display: 'flex',
|
|
66
|
+
width: '100%',
|
|
67
|
+
padding: '$15 $20 $20',
|
|
68
|
+
flexDirection: 'column',
|
|
69
|
+
alignItems: 'start',
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export const titleStepsStyles = css({
|
|
73
|
+
textAlign: 'left',
|
|
74
|
+
width: '100%',
|
|
75
|
+
padding: '0 $20 $10',
|
|
76
|
+
});
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
getCurrentBlockchainOfOrNull,
|
|
7
7
|
getCurrentStep,
|
|
8
8
|
getRelatedWalletOrNull,
|
|
9
|
-
PendingSwapNetworkStatus,
|
|
10
9
|
} from '@rango-dev/queue-manager-rango-preset';
|
|
11
10
|
import {
|
|
12
11
|
Button,
|
|
@@ -19,10 +18,10 @@ import {
|
|
|
19
18
|
useCopyToClipboard,
|
|
20
19
|
} from '@rango-dev/ui';
|
|
21
20
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
21
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
22
22
|
import React, { useEffect, useRef, useState } from 'react';
|
|
23
23
|
import { useNavigate } from 'react-router-dom';
|
|
24
24
|
|
|
25
|
-
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
26
25
|
import {
|
|
27
26
|
GAS_FEE_MAX_DECIMALS,
|
|
28
27
|
GAS_FEE_MIN_DECIMALS,
|
|
@@ -33,8 +32,7 @@ import {
|
|
|
33
32
|
USD_VALUE_MAX_DECIMALS,
|
|
34
33
|
USD_VALUE_MIN_DECIMALS,
|
|
35
34
|
} from '../../constants/routing';
|
|
36
|
-
import {
|
|
37
|
-
import { useMetaStore } from '../../store/meta';
|
|
35
|
+
import { useAppStore } from '../../store/AppStore';
|
|
38
36
|
import { useNotificationStore } from '../../store/notification';
|
|
39
37
|
import { useQuoteStore } from '../../store/quote';
|
|
40
38
|
import {
|
|
@@ -49,7 +47,7 @@ import {
|
|
|
49
47
|
shouldRetrySwap,
|
|
50
48
|
} from '../../utils/swap';
|
|
51
49
|
import { getSwapDate } from '../../utils/time';
|
|
52
|
-
import { getConciseAddress
|
|
50
|
+
import { getConciseAddress } from '../../utils/wallets';
|
|
53
51
|
import { SuffixContainer } from '../HeaderButtons/HeaderButtons.styles';
|
|
54
52
|
import { Layout } from '../Layout';
|
|
55
53
|
import { QuoteSummary } from '../Quote';
|
|
@@ -59,23 +57,29 @@ import {
|
|
|
59
57
|
} from '../SwapDetailsModal';
|
|
60
58
|
|
|
61
59
|
import { getSteps, getStepState, RESET_INTERVAL } from './SwapDetails.helpers';
|
|
62
|
-
import {
|
|
60
|
+
import {
|
|
61
|
+
Container,
|
|
62
|
+
HeaderDetails,
|
|
63
|
+
outputStyles,
|
|
64
|
+
requestIdStyles,
|
|
65
|
+
rowStyles,
|
|
66
|
+
StepsList,
|
|
67
|
+
titleStepsStyles,
|
|
68
|
+
} from './SwapDetails.styles';
|
|
63
69
|
|
|
64
70
|
export function SwapDetails(props: SwapDetailsProps) {
|
|
65
71
|
const { swap, requestId, onDelete, onCancel: onCancelProps } = props;
|
|
66
72
|
const { canSwitchNetworkTo, connect, getWalletInfo } = useWallets();
|
|
73
|
+
const blockchains = useAppStore().blockchains();
|
|
74
|
+
const tokens = useAppStore().tokens();
|
|
67
75
|
const retry = useQuoteStore.use.retry();
|
|
68
76
|
const navigate = useNavigate();
|
|
69
|
-
const { navigateBackFrom } = useNavigateBack();
|
|
70
77
|
const [_, handleCopy] = useCopyToClipboard(RESET_INTERVAL);
|
|
71
78
|
const listRef = useRef<HTMLDivElement | null>(null);
|
|
72
79
|
const [modalState, setModalState] = useState<ModalState>(null);
|
|
73
80
|
const [showCompletedModal, setShowCompletedModal] = useState<
|
|
74
81
|
'success' | 'failed' | null
|
|
75
82
|
>(null);
|
|
76
|
-
const {
|
|
77
|
-
meta: { tokens, blockchains },
|
|
78
|
-
} = useMetaStore();
|
|
79
83
|
|
|
80
84
|
const onCancel = () => {
|
|
81
85
|
onCancelProps();
|
|
@@ -150,7 +154,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
150
154
|
showNetworkModal: currentStepNetworkStatus,
|
|
151
155
|
setNetworkModal: setModalState,
|
|
152
156
|
message: stepMessage,
|
|
153
|
-
blockchains,
|
|
157
|
+
blockchains: blockchains,
|
|
154
158
|
});
|
|
155
159
|
const numberOfSteps = steps.length;
|
|
156
160
|
const [firstStep, lastStep] = [swap.steps[0], swap.steps[numberOfSteps - 1]];
|
|
@@ -167,35 +171,19 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
167
171
|
)?.diagnosisUrl;
|
|
168
172
|
|
|
169
173
|
const outputUsdValue = numberToString(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
) *
|
|
178
|
-
(getUsdPrice(
|
|
179
|
-
lastStep.toBlockchain,
|
|
180
|
-
lastStep.toSymbol,
|
|
181
|
-
lastStep.toSymbolAddress,
|
|
182
|
-
tokens
|
|
183
|
-
) || 0)
|
|
184
|
-
),
|
|
174
|
+
parseFloat(
|
|
175
|
+
numberToString(
|
|
176
|
+
outputAmount,
|
|
177
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
178
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
179
|
+
)
|
|
180
|
+
) * (lastStep.toUsdPrice || 0),
|
|
185
181
|
USD_VALUE_MIN_DECIMALS,
|
|
186
182
|
USD_VALUE_MAX_DECIMALS
|
|
187
183
|
);
|
|
188
184
|
|
|
189
185
|
const inputUsdValue = numberToString(
|
|
190
|
-
|
|
191
|
-
parseFloat(swap.inputAmount) *
|
|
192
|
-
(getUsdPrice(
|
|
193
|
-
firstStep.fromBlockchain,
|
|
194
|
-
firstStep.fromSymbol,
|
|
195
|
-
firstStep.fromSymbolAddress,
|
|
196
|
-
tokens
|
|
197
|
-
) || 0)
|
|
198
|
-
),
|
|
186
|
+
parseFloat(swap.inputAmount) * (firstStep.fromUsdPrice || 0),
|
|
199
187
|
USD_VALUE_MIN_DECIMALS,
|
|
200
188
|
USD_VALUE_MAX_DECIMALS
|
|
201
189
|
);
|
|
@@ -238,7 +226,6 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
238
226
|
noPadding
|
|
239
227
|
header={{
|
|
240
228
|
title: i18n.t('Swap and Bridge'),
|
|
241
|
-
onBack: () => navigateBackFrom(navigationRoutes.swapDetails),
|
|
242
229
|
onCancel:
|
|
243
230
|
swap.status === 'running' ? () => setModalState('cancel') : undefined,
|
|
244
231
|
suffix: swap.status !== 'running' && (
|
|
@@ -264,9 +251,10 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
264
251
|
type="primary"
|
|
265
252
|
size="large"
|
|
266
253
|
onClick={() => {
|
|
267
|
-
retry(swap);
|
|
254
|
+
retry(swap, { blockchains: blockchains, tokens: tokens });
|
|
268
255
|
setTimeout(() => {
|
|
269
|
-
|
|
256
|
+
const home = '../../';
|
|
257
|
+
navigate(home);
|
|
270
258
|
}, 0);
|
|
271
259
|
}}>
|
|
272
260
|
{i18n.t('Try again')}
|
|
@@ -275,11 +263,11 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
275
263
|
}>
|
|
276
264
|
<Container>
|
|
277
265
|
<HeaderDetails>
|
|
278
|
-
<div className=
|
|
266
|
+
<div className={rowStyles()}>
|
|
279
267
|
<Typography variant="label" size="large" color="neutral700">
|
|
280
268
|
{`${i18n.t('Request ID')}:`}
|
|
281
269
|
</Typography>
|
|
282
|
-
<div className=
|
|
270
|
+
<div className={requestIdStyles()}>
|
|
283
271
|
<Typography variant="label" size="small" color="neutral700">
|
|
284
272
|
{requestId}
|
|
285
273
|
</Typography>
|
|
@@ -290,7 +278,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
290
278
|
</IconButton>
|
|
291
279
|
</div>
|
|
292
280
|
</div>
|
|
293
|
-
<div className=
|
|
281
|
+
<div className={rowStyles()}>
|
|
294
282
|
<Typography variant="label" size="large" color="neutral700">
|
|
295
283
|
{`${i18n.t('Created at')}:`}
|
|
296
284
|
</Typography>
|
|
@@ -300,7 +288,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
300
288
|
</div>
|
|
301
289
|
</HeaderDetails>
|
|
302
290
|
|
|
303
|
-
<div className=
|
|
291
|
+
<div className={outputStyles()}>
|
|
304
292
|
<QuoteCost
|
|
305
293
|
fee={numberToString(
|
|
306
294
|
String(totalFee),
|
|
@@ -348,14 +336,14 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
348
336
|
},
|
|
349
337
|
}}
|
|
350
338
|
percentageChange={numberToString(
|
|
351
|
-
|
|
339
|
+
percentageChange,
|
|
352
340
|
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
353
341
|
PERCENTAGE_CHANGE_MAX_DECIMALS
|
|
354
342
|
)}
|
|
355
343
|
warningLevel={getPriceImpactLevel(percentageChange ?? 0)}
|
|
356
344
|
/>
|
|
357
345
|
</div>
|
|
358
|
-
<div className=
|
|
346
|
+
<div className={titleStepsStyles()}>
|
|
359
347
|
<Typography variant="title" size="small">
|
|
360
348
|
{i18n.t('Swaps steps')}
|
|
361
349
|
</Typography>
|
|
@@ -406,7 +394,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
406
394
|
)}
|
|
407
395
|
usdValue={outputUsdValue}
|
|
408
396
|
percentageChange={numberToString(
|
|
409
|
-
|
|
397
|
+
percentageChange,
|
|
410
398
|
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
411
399
|
PERCENTAGE_CHANGE_MAX_DECIMALS
|
|
412
400
|
)}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { WaningAlertsProps } from './SwapDetailsAlerts.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
5
4
|
import { Alert, Button } from '@rango-dev/ui';
|
|
5
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
export function WarningAlert(props: WaningAlertsProps) {
|
|
@@ -12,8 +12,6 @@ import {
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { useNavigate } from 'react-router-dom';
|
|
14
14
|
|
|
15
|
-
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
16
|
-
|
|
17
15
|
export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
|
|
18
16
|
const {
|
|
19
17
|
open,
|
|
@@ -70,7 +68,10 @@ export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
|
|
|
70
68
|
variant="contained"
|
|
71
69
|
type="primary"
|
|
72
70
|
size="large"
|
|
73
|
-
onClick={() =>
|
|
71
|
+
onClick={() => {
|
|
72
|
+
const home = '../../';
|
|
73
|
+
navigate(home);
|
|
74
|
+
}}>
|
|
74
75
|
<Typography variant="title" size="medium" color="neutral100">
|
|
75
76
|
{i18n.t('Done')}
|
|
76
77
|
</Typography>
|
|
@@ -10,8 +10,8 @@ export const CancelContent = ({ onCancel, onClose }: CancelContentProps) => {
|
|
|
10
10
|
<Divider size={20} />
|
|
11
11
|
<MessageBox
|
|
12
12
|
type="error"
|
|
13
|
-
title={i18n.t('
|
|
14
|
-
description={i18n.t('Are you sure you want to
|
|
13
|
+
title={i18n.t('Cancel Swap')}
|
|
14
|
+
description={i18n.t('Are you sure you want to cancel this swap?')}
|
|
15
15
|
/>
|
|
16
16
|
<Divider size={32} />
|
|
17
17
|
<Button
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModalNetworkValueTypes } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { PendingSwapNetworkStatus } from '
|
|
4
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
5
5
|
|
|
6
6
|
export const modalNetworkValues: Record<
|
|
7
7
|
Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModalPropTypes } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
|
-
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
4
3
|
import { Modal } from '@rango-dev/ui';
|
|
4
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { CancelContent } from './SwapDetailsModal.Cancel';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
2
1
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
2
|
+
import type { PendingSwapNetworkStatus } from 'rango-types';
|
|
3
3
|
|
|
4
4
|
export type ModalState =
|
|
5
5
|
| Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>
|