@rango-dev/widget-embedded 0.17.1-next.3 → 0.17.1-next.30
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 +56 -56
- 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/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 +159 -0
- 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/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/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.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.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.tsx +4 -4
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +4 -4
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +16 -19
- 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/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 +28 -1
- package/src/components/Quote/Quote.tsx +100 -34
- package/src/components/Quote/Quote.types.ts +0 -1
- package/src/components/Quote/QuoteSkeleton.tsx +1 -1
- 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 +0 -4
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.tsx +19 -39
- 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 +8 -1
- package/src/components/SwapsGroup/SwapsGroup.tsx +0 -2
- package/src/components/TokenList/TokenList.helpers.ts +2 -2
- package/src/components/TokenList/TokenList.styles.ts +14 -2
- package/src/components/TokenList/TokenList.tsx +16 -19
- 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 +39 -24
- 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
package/dist/types/config.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export type WidgetTheme = {
|
|
|
61
61
|
* @property {{ [key: string]: string }} wallets - If you want to change the default affiliate wallet
|
|
62
62
|
* addresses, you can provide new values here. (Map of route blockchains to affiliate address)
|
|
63
63
|
*/
|
|
64
|
-
export type
|
|
64
|
+
export type WidgetAffiliate = {
|
|
65
65
|
ref?: string;
|
|
66
66
|
percent?: number;
|
|
67
67
|
wallets?: {
|
|
@@ -85,13 +85,36 @@ export type BlockchainAndTokenConfig = {
|
|
|
85
85
|
blockchains?: string[];
|
|
86
86
|
tokens?: Asset[];
|
|
87
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* `Features`
|
|
90
|
+
*
|
|
91
|
+
* @property {'visible' | 'hidden'} [theme]
|
|
92
|
+
* - The visibility state for the theme feature. Optional property.
|
|
93
|
+
*
|
|
94
|
+
* @property {'visible' | 'hidden'} [language]
|
|
95
|
+
* - The visibility state for the language feature. Optional property.
|
|
96
|
+
*
|
|
97
|
+
* @property {'disabled' | 'enabled'} [experimentalRoute]
|
|
98
|
+
* - The enablement state for the experimental route feature. Optional property.
|
|
99
|
+
*
|
|
100
|
+
* @property {'visible' | 'hidden'} [connectWalletButton]
|
|
101
|
+
* - The visibility state for the connect wallet button feature. Optional property.
|
|
102
|
+
*
|
|
103
|
+
* @property {'visible' | 'hidden'} [notification]
|
|
104
|
+
* - The visibility state for the notification feature. Optional property.
|
|
105
|
+
*
|
|
106
|
+
* @property {'visible' | 'hidden'} [liquiditySource]
|
|
107
|
+
* - The visibility state for the liquiditySource feature. Optional property.
|
|
108
|
+
*/
|
|
109
|
+
export type Features = Partial<Record<'theme' | 'language' | 'connectWalletButton' | 'notification' | 'liquiditySource', 'visible' | 'hidden'>> & Partial<Record<'experimentalRoute', 'disabled' | 'enabled'>>;
|
|
88
110
|
/**
|
|
89
111
|
* The type WidgetConfig defines the configuration options for a widget, including API key, affiliate
|
|
90
112
|
* reference, amount, blockchain and token configurations, liquidity sources, wallet types, language,
|
|
91
113
|
* and theme.
|
|
92
114
|
*
|
|
93
115
|
* @property {string} apiKey - The API key used to communicate with Rango API
|
|
94
|
-
* @property {
|
|
116
|
+
* @property {string} apiUrl - The API url used to set custom API url
|
|
117
|
+
* @property {WidgetAffiliate} affiliate - If you want to charge users fee per transaction, you should
|
|
95
118
|
* pass `WidgetAffiliate` including affiliateRef, affiliatePercent, and affiliateWallets.
|
|
96
119
|
* @property {number} amount - The default input amount.
|
|
97
120
|
* @property {BlockchainAndTokenConfig} from - The `from` property is an optional property of type
|
|
@@ -121,13 +144,22 @@ export type BlockchainAndTokenConfig = {
|
|
|
121
144
|
* If `externalWallets` is `true`, you should add `WidgetWallets` to your app.
|
|
122
145
|
* @property {Asset} pinnedTokens - The `pinnedTokens` property is an optional array of `Asset` objects that
|
|
123
146
|
* you could use to pin tokens of your choice to the top of the token list.
|
|
124
|
-
* @property {boolean}
|
|
147
|
+
* @property {boolean} enableNewLiquiditySources - The `enableNewLiquiditySources` property is a boolean value that when you
|
|
125
148
|
* set it to true, whenever a new liquidity source is added, it will be added to your list as well.
|
|
149
|
+
* @property {Features} features - An optional object for configuring the visibility or enablement of various features.
|
|
150
|
+
* Keys include:
|
|
151
|
+
* - 'notification': Visibility state for the notification icon.
|
|
152
|
+
* - 'theme': Visibility state for the theme.
|
|
153
|
+
* - 'liquiditySource': Visibility state for liquidity source.
|
|
154
|
+
* - 'connectWalletButton': Visibility state for the wallet connect icon.
|
|
155
|
+
* - 'language': Visibility state for the language.
|
|
156
|
+
* - 'experimentalRoute': Enablement state for the experimental route.
|
|
126
157
|
*/
|
|
127
158
|
export type WidgetConfig = {
|
|
128
159
|
apiKey: string;
|
|
160
|
+
apiUrl?: string;
|
|
129
161
|
walletConnectProjectId?: string;
|
|
130
|
-
affiliate?:
|
|
162
|
+
affiliate?: WidgetAffiliate;
|
|
131
163
|
amount?: number;
|
|
132
164
|
from?: BlockchainAndTokenConfig;
|
|
133
165
|
to?: BlockchainAndTokenConfig;
|
|
@@ -139,6 +171,7 @@ export type WidgetConfig = {
|
|
|
139
171
|
theme?: WidgetTheme;
|
|
140
172
|
externalWallets?: boolean;
|
|
141
173
|
pinnedTokens?: Asset[];
|
|
142
|
-
|
|
174
|
+
enableNewLiquiditySources?: boolean;
|
|
175
|
+
features?: Features;
|
|
143
176
|
};
|
|
144
177
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,YAAY,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,YAAY,CAAC;QAAC,IAAI,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;IACvD,YAAY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AAiB,CAAC,EAAE,CAAC;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;IACvB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC"}
|
package/dist/types/swap.d.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import type { SwapSavedSettings } from 'rango-types
|
|
1
|
+
import type { SwapSavedSettings } from 'rango-types';
|
|
2
2
|
export type PendingSwapSettings = Omit<SwapSavedSettings, 'disabledSwappersIds'>;
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
SWAP = "swap",
|
|
6
|
-
NEEDTOCONFIRM = "needToConfirm",
|
|
7
|
-
WARNING = "warning"
|
|
8
|
-
}
|
|
9
|
-
export type SwapButtonState = ({
|
|
10
|
-
disabled: true;
|
|
11
|
-
} | {
|
|
12
|
-
disabled: false;
|
|
13
|
-
hasWarning?: boolean;
|
|
14
|
-
}) & {
|
|
3
|
+
export type SwapButtonState = {
|
|
4
|
+
disabled: boolean;
|
|
15
5
|
title: string;
|
|
16
|
-
|
|
6
|
+
action: 'connect-wallet' | 'confirm-warning' | 'confirm-swap';
|
|
17
7
|
};
|
|
18
8
|
export type ConvertedToken = {
|
|
19
9
|
symbol: string;
|
package/dist/types/swap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/types/swap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/types/swap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,iBAAiB,EACjB,qBAAqB,CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,cAAc,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,GAAG,IAAI,CAAC"}
|
package/dist/types/wallets.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import { WalletType } from '@rango-dev/wallets-shared';
|
|
1
|
+
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
2
2
|
export interface Wallet {
|
|
3
3
|
chain: string;
|
|
4
4
|
address: string;
|
|
5
5
|
walletType: WalletType;
|
|
6
6
|
}
|
|
7
|
+
export type Balance = {
|
|
8
|
+
amount: string;
|
|
9
|
+
decimals: number;
|
|
10
|
+
usdValue: string;
|
|
11
|
+
};
|
|
12
|
+
type Blockchain = string;
|
|
13
|
+
type TokenSymbol = string;
|
|
14
|
+
type Address = string;
|
|
15
|
+
/** `blockchain-symbol-Address` */
|
|
16
|
+
export type TokenHash = `${Blockchain}-${TokenSymbol}-${Address}`;
|
|
17
|
+
export type TokensBalance = {
|
|
18
|
+
[key: TokenHash]: Balance;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
7
21
|
//# sourceMappingURL=wallets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/types/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/types/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,WAAW,GAAG,MAAM,CAAC;AAC1B,KAAK,OAAO,GAAG,MAAM,CAAC;AAEtB,kCAAkC;AAClC,MAAM,MAAM,SAAS,GAAG,GAAG,UAAU,IAAI,WAAW,IAAI,OAAO,EAAE,CAAC;AAElE,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC;CAC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,UAAU,CAAC;AAE/D,eAAO,MAAM,UAAU,QAAS,MAAM,OAAO,MAAM,WAyBlD,CAAC;AAEF,eAAO,MAAM,mBAAmB,SAAU,MAAM,SAAS,MAAM;;
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/utils/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,UAAU,CAAC;AAE/D,eAAO,MAAM,UAAU,QAAS,MAAM,OAAO,MAAM,WAyBlD,CAAC;AAEF,eAAO,MAAM,mBAAmB,SAAU,MAAM,SAAS,MAAM;;CAmC9D,CAAC;AACF,eAAO,MAAM,cAAc;;wBAEJ,OAAO,WACnB,YAAY;;CAyCtB,CAAC"}
|
package/dist/utils/configs.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/utils/configs.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/utils/configs.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,UAE5C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,GAAG,OAIxD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,OAAO,WAS9C;AAED,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,uBAAuB,iBAAiB,CAAC"}
|
package/dist/utils/meta.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Asset, BlockchainMeta, Token } from 'rango-sdk';
|
|
1
|
+
import type { Asset, BlockchainMeta, SwapperMeta, Token } from 'rango-sdk';
|
|
2
2
|
export declare function getBlockchainDisplayNameFor(blockchainName: string, blockchains: BlockchainMeta[]): string | undefined;
|
|
3
3
|
export declare function getBlockchainShortNameFor(blockchainName: string, blockchains: BlockchainMeta[]): string | undefined;
|
|
4
|
+
export declare function getSwapperDisplayName(swapperId: string, swappers: SwapperMeta[]): string | undefined;
|
|
4
5
|
export declare function findToken(t: Asset, tokens: Token[]): Token | null;
|
|
5
6
|
export declare function findBlockchain(name: string, blockchains: BlockchainMeta[]): BlockchainMeta | null;
|
|
6
7
|
//# sourceMappingURL=meta.d.ts.map
|
package/dist/utils/meta.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/utils/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/utils/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAI3E,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,cAAc,EAAE,GAC5B,MAAM,GAAG,SAAS,CAGpB;AACD,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,cAAc,EAAE,GAC5B,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,WAAW,EAAE,sBAGxB;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAElD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,yBAEzE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { WidgetConfig } from '../types';
|
|
2
|
+
import type { ProviderInterface } from '@rango-dev/wallets-react';
|
|
3
3
|
export interface ProvidersOptions {
|
|
4
4
|
walletConnectProjectId?: WidgetConfig['walletConnectProjectId'];
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB,CAAC,EAAE,YAAY,CAAC,wBAAwB,CAAC,CAAC;CACjE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,EAClC,OAAO,CAAC,EAAE,gBAAgB,GACzB,iBAAiB,EAAE,CAoCrB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,EAC/B,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,EAAE,CAMV"}
|
package/dist/utils/queue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Manager } from '@rango-dev/queue-manager-core';
|
|
2
|
-
import { PendingSwapWithQueueID } from '@rango-dev/queue-manager-rango-preset';
|
|
1
|
+
import type { Manager } from '@rango-dev/queue-manager-core';
|
|
2
|
+
import type { PendingSwapWithQueueID } from '@rango-dev/queue-manager-rango-preset';
|
|
3
3
|
export declare const getPendingSwaps: (manager: Manager | undefined) => PendingSwapWithQueueID[];
|
|
4
4
|
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,uCAAuC,CAAC;AAE/C,eAAO,MAAM,eAAe,YAAa,OAAO,GAAG,SAAS,6BAiB3D,CAAC"}
|
package/dist/utils/quote.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { QuoteError, QuoteWarning, Wallet } from '../types';
|
|
2
|
-
import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
3
2
|
import type { PriceImpactWarningLevel } from '@rango-dev/ui';
|
|
4
3
|
import type { SimulationAssetAndAmount, SimulationValidationStatus } from '@rango-dev/ui/dist/widget/ui/src/types/swaps';
|
|
5
4
|
import type { Asset, BestRouteResponse, BlockchainMeta, Token } from 'rango-sdk';
|
|
5
|
+
import type { PendingSwap } from 'rango-types';
|
|
6
6
|
import BigNumber from 'bignumber.js';
|
|
7
7
|
export declare function searchParamsToToken(tokens: Token[], searchParams: string | null, chain: BlockchainMeta | null): Token | null;
|
|
8
8
|
export declare function getQuoteToTokenUsdPrice(quote: BestRouteResponse | null): number | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/utils/quote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/utils/quote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,EAC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MAAM,EAAE,KAAK,EAAE,GACd;IACD,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,SAAS,EAAE,KAAK,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,OAAO,EAAE,KAAK,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CA4CA;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;IACN,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,YAAY,GAAG,IAAI,CAiDrB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,GACvB,UAAU,GAAG,IAAI,CA+BnB;AAED,wBAAgB,cAAc,CAC5B,aAAa,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,EACxC,cAAc,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,GACxC,MAAM,GAAG,IAAI,CAcf"}
|
package/dist/utils/settings.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Features } from '../types';
|
|
2
|
+
import type { SwapperMeta } from 'rango-sdk';
|
|
1
3
|
export type LiquiditySourceType = 'BRIDGE' | 'AGGREGATOR' | 'DEX';
|
|
2
4
|
export type UniqueSwappersGroupType = {
|
|
3
5
|
id: string;
|
|
@@ -6,6 +8,8 @@ export type UniqueSwappersGroupType = {
|
|
|
6
8
|
type: LiquiditySourceType;
|
|
7
9
|
selected: boolean;
|
|
8
10
|
};
|
|
9
|
-
export declare function getUniqueSwappersGroups(
|
|
10
|
-
export declare function sortLiquiditySourcesByGroupTitle(a:
|
|
11
|
+
export declare function getUniqueSwappersGroups(swappers: SwapperMeta[], disabledLiquiditySources: string[]): UniqueSwappersGroupType[];
|
|
12
|
+
export declare function sortLiquiditySourcesByGroupTitle(a: SwapperMeta, b: SwapperMeta): 1 | -1 | 0;
|
|
13
|
+
export declare function isFeatureHidden(feature: keyof Features, features?: Features): boolean;
|
|
14
|
+
export declare function isFeatureEnabled(feature: keyof Features, features?: Features): boolean;
|
|
11
15
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/utils/settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/utils/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAI7C,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC;AAElE,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,WAAW,EAAE,EACvB,wBAAwB,EAAE,MAAM,EAAE,GACjC,uBAAuB,EAAE,CAqC3B;AAED,wBAAgB,gCAAgC,CAC9C,CAAC,EAAE,WAAW,EACd,CAAC,EAAE,WAAW,cAWf;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,QAAQ,EAAE,QAAQ,CAAC,EAAE,QAAQ,WAE3E;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,QAAQ,EAAE,QAAQ,CAAC,EAAE,QAAQ,WAE5E"}
|
package/dist/utils/swap.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { ConvertedToken, RecommendedSlippages, SwapButtonState, Wallet } from '../types';
|
|
4
|
-
import type { PendingSwap, PendingSwapStep } from '@rango-dev/queue-manager-rango-preset';
|
|
1
|
+
import type { FetchStatus } from '../store/slices/data';
|
|
2
|
+
import type { ConvertedToken, QuoteError, QuoteWarning, RecommendedSlippages, SwapButtonState, Wallet } from '../types';
|
|
5
3
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
6
4
|
import type { BestRouteRequest, BestRouteResponse, BlockchainMeta, RecommendedSlippage, SwapResult, Token } from 'rango-sdk';
|
|
5
|
+
import type { PendingSwap, PendingSwapStep } from 'rango-types';
|
|
7
6
|
import BigNumber from 'bignumber.js';
|
|
8
7
|
export declare function getOutputRatio(inputUsdValue: BigNumber | null, outputUsdValue: BigNumber | null): number;
|
|
9
8
|
export declare function hasHighValueLoss(inputUsdValue: BigNumber | null, priceImpact: number): boolean;
|
|
@@ -13,7 +12,16 @@ export declare function getLimitErrorMessage(quote: BestRouteResponse): {
|
|
|
13
12
|
fromAmountRangeError: string;
|
|
14
13
|
recommendation: string;
|
|
15
14
|
};
|
|
16
|
-
export declare function getSwapButtonState(
|
|
15
|
+
export declare function getSwapButtonState(params: {
|
|
16
|
+
fetchMetaStatus: FetchStatus;
|
|
17
|
+
anyWalletConnected: boolean;
|
|
18
|
+
fetchingQuote: boolean;
|
|
19
|
+
inputAmount: string;
|
|
20
|
+
quote: BestRouteResponse | null;
|
|
21
|
+
warning: QuoteWarning | null;
|
|
22
|
+
error: QuoteError | null;
|
|
23
|
+
needsToWarnEthOnPath: boolean;
|
|
24
|
+
}): SwapButtonState;
|
|
17
25
|
export declare function canComputePriceImpact(quote: BestRouteResponse | null, inputAmount: string, usdValue: BigNumber | null): boolean;
|
|
18
26
|
export declare function requiredWallets(quote: BestRouteResponse | null): string[];
|
|
19
27
|
export declare const getUsdPrice: (blockchain: string, symbol: string, address: string | null, allTokens: Token[]) => number | null;
|
|
@@ -33,6 +41,8 @@ export declare function createQuoteRequestBody(params: {
|
|
|
33
41
|
inputAmount: string;
|
|
34
42
|
wallets?: Wallet[];
|
|
35
43
|
selectedWallets?: Wallet[];
|
|
44
|
+
liquiditySources?: string[];
|
|
45
|
+
excludeLiquiditySources?: boolean;
|
|
36
46
|
disabledLiquiditySources: string[];
|
|
37
47
|
slippage: number;
|
|
38
48
|
affiliateRef: string | null;
|
|
@@ -52,7 +62,7 @@ export declare function getWalletsForNewSwap(selectedWallets: Wallet[]): {
|
|
|
52
62
|
export declare function getQuoteOutputAmount(quote: BestRouteResponse): string | null;
|
|
53
63
|
export declare function getPercentageChange(input: string, output: string): number;
|
|
54
64
|
export declare function isOutputAmountChangedALot(oldQuote: BestRouteResponse, newQuote: BestRouteResponse): boolean;
|
|
55
|
-
export declare function
|
|
65
|
+
export declare function generateBalanceWarnings(quote: BestRouteResponse, selectedWallets: Wallet[], blockchains: BlockchainMeta[]): string[];
|
|
56
66
|
export declare function calcOutputUsdValue(outputAmount?: string, tokenPrice?: number | null): BigNumber;
|
|
57
67
|
export declare function isNetworkStatusInWarningState(pendingSwapStep: PendingSwapStep | null): boolean;
|
|
58
68
|
export declare function getSwapMessages(pendingSwap: PendingSwap, currentStep: PendingSwapStep | null): {
|
|
@@ -64,7 +74,6 @@ export declare function getSwapMessages(pendingSwap: PendingSwap, currentStep: P
|
|
|
64
74
|
};
|
|
65
75
|
export declare function getLastConvertedTokenInFailedSwap(pendingSwap: PendingSwap): ConvertedToken;
|
|
66
76
|
export declare function shouldRetrySwap(pendingSwap: PendingSwap): boolean;
|
|
67
|
-
export declare function isValidCustomDestination(blockchain: string, address: string): boolean;
|
|
68
77
|
export declare function confirmSwapDisabled(fetching: boolean, showCustomDestination: boolean, customDestination: string, quote: BestRouteResponse | null, selectedWallets: {
|
|
69
78
|
walletType: string;
|
|
70
79
|
chain: string;
|
package/dist/utils/swap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/utils/swap.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E,cAAc,EAAE,YAqD9B;AAED,wBAAgB,kBAAkB,CAChC,YAAY,CAAC,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,aAK3B;AAED,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,GAAG,IAAI,GACtC,OAAO,CAMT;AAED,wBAAgB,eAAe,CAC7B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,eAAe,GAAG,IAAI,GAClC;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;CACrD,CAyCA;AAED,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,WAAW,GACvB,cAAc,CAkBhB;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,WAMvD;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,EACjB,qBAAqB,EAAE,OAAO,EAC9B,iBAAiB,EAAE,MAAM,EACzB,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAC/B,eAAe,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EACxD,oBAAoB,CAAC,EAAE,cAAc,uBActC"}
|
package/dist/utils/time.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PendingSwap } from '
|
|
1
|
+
import type { PendingSwap } from 'rango-types';
|
|
2
2
|
export declare function timeSince(millisecond: number): string;
|
|
3
3
|
export declare function getSwapDate(pendingSwap: PendingSwap): string;
|
|
4
4
|
//# sourceMappingURL=time.d.ts.map
|
package/dist/utils/time.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAW/C,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAqDrD;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,UAUnD"}
|
package/dist/utils/wallets.d.ts
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import type { TokenWithBalance } from '../components/TokenList';
|
|
2
1
|
import type { ConnectedWallet, TokenBalance } from '../store/wallets';
|
|
3
|
-
import type { Wallet } from '../types';
|
|
2
|
+
import type { Balance, TokenHash, TokensBalance, Wallet } from '../types';
|
|
4
3
|
import type { WalletInfo as ModalWalletInfo } from '@rango-dev/ui';
|
|
5
|
-
import type { Network, WalletInfo, WalletState, WalletType } from '@rango-dev/wallets-shared';
|
|
4
|
+
import type { Asset, Network, WalletInfo, WalletState, WalletType } from '@rango-dev/wallets-shared';
|
|
6
5
|
import type { BestRouteResponse, BlockchainMeta, Token, WalletDetail } from 'rango-sdk';
|
|
7
6
|
import { WalletState as WalletStatus } from '@rango-dev/ui';
|
|
8
7
|
export declare function mapStatusToWalletState(state: WalletState): WalletStatus;
|
|
9
8
|
export declare function mapWalletTypesToWalletInfo(getState: (type: WalletType) => WalletState, getWalletInfo: (type: WalletType) => WalletInfo, list: WalletType[], chain?: string): ModalWalletInfo[];
|
|
10
9
|
export declare function walletAndSupportedChainsNames(supportedBlockchains: BlockchainMeta[]): Network[] | null;
|
|
11
|
-
export declare function prepareAccountsForWalletStore(wallet: WalletType, accounts: string[], evmBasedChains: string[], supportedChainNames: Network[] | null): Wallet[];
|
|
10
|
+
export declare function prepareAccountsForWalletStore(wallet: WalletType, accounts: string[], evmBasedChains: string[], supportedChainNames: Network[] | null, isContractWallet: boolean): Wallet[];
|
|
12
11
|
export declare function getRequiredChains(quote: BestRouteResponse | null): string[];
|
|
13
|
-
export declare function getBalanceFromWallet(connectedWallets: ConnectedWallet[], chain: string, symbol: string, address: string | null): TokenBalance | null;
|
|
14
12
|
export declare function isAccountAndWalletMatched(account: Wallet, connectedWallet: ConnectedWallet): boolean;
|
|
15
13
|
export declare function makeBalanceFor(retrievedBalance: WalletDetail, tokens: Token[]): TokenBalance[];
|
|
16
14
|
export declare function resetConnectedWalletState(connectedWallet: ConnectedWallet): ConnectedWallet;
|
|
17
15
|
export declare const calculateWalletUsdValue: (connectedWallet: ConnectedWallet[]) => string;
|
|
18
|
-
export declare const sortTokens: (tokens: TokenWithBalance[]) => TokenWithBalance[];
|
|
19
16
|
export declare const getUsdPrice: (blockchain: string, symbol: string, address: string | null, allTokens: Token[]) => number | null;
|
|
20
17
|
export declare const isExperimentalChain: (blockchains: BlockchainMeta[], wallet: string) => boolean;
|
|
21
18
|
export declare const getKeplrCompatibleConnectedWallets: (selectableWallets: Wallet[]) => WalletType[];
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function getSortedTokens(chain: BlockchainMeta | null, tokens: Token[], connectedWallets: ConnectedWallet[], otherChainTokens: TokenWithBalance[]): TokenWithBalance[];
|
|
19
|
+
export declare function formatBalance(balance: Balance | null): Balance | null;
|
|
20
|
+
export declare function sortTokensByBalance(tokens: Token[], getBalanceFor: (token: Token) => Balance | null): Token[];
|
|
25
21
|
export declare function tokensAreEqual(tokenA: Pick<Token, 'blockchain' | 'symbol' | 'address'> | null, tokenB: Pick<Token, 'blockchain' | 'symbol' | 'address'> | null): boolean;
|
|
26
22
|
export declare function sortWalletsBasedOnConnectionState(wallets: ModalWalletInfo[]): ModalWalletInfo[];
|
|
27
23
|
export declare function getConciseAddress(address: string, maxChars?: number, ellipsisLength?: number): string;
|
|
@@ -30,4 +26,6 @@ export declare function getAddress({ chain, connectedWallets, walletType, }: {
|
|
|
30
26
|
walletType: string;
|
|
31
27
|
chain: string;
|
|
32
28
|
}): string | undefined;
|
|
29
|
+
export declare function createTokenHash(token: Asset): TokenHash;
|
|
30
|
+
export declare function makeTokensBalance(connectedWallets: ConnectedWallet[]): TokensBalance;
|
|
33
31
|
//# sourceMappingURL=wallets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EAEX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,YAAY,EACb,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAuB5D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAWvE;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,WAAW,EAC3C,aAAa,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,EAC/C,IAAI,EAAE,UAAU,EAAE,EAClB,KAAK,CAAC,EAAE,MAAM,GACb,eAAe,EAAE,CA6BnB;AAED,wBAAgB,6BAA6B,CAC3C,oBAAoB,EAAE,cAAc,EAAE,GACrC,OAAO,EAAE,GAAG,IAAI,CAUlB;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,UAAU,EAClB,QAAQ,EA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,OAAO,EAAE,eAAe,EAAE,GACzB,eAAe,EAAE,CAcnB;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EAEf,QAAQ,SAAI,EAEZ,cAAc,SAAI,GACjB,MAAM,CAOR;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,gBAAgB,EAChB,UAAU,GACX,EAAE;IACD,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,GAAG,SAAS,CAMrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAEvD;AAED,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,EAAE,iBAmCpE"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.17.1-next.
|
|
3
|
+
"version": "0.17.1-next.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"source": "./src/index.ts",
|
|
6
7
|
"main": "dist/index.js",
|
|
7
8
|
"typings": "dist/index.d.ts",
|
|
8
9
|
"files": [
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
"browserslist": "> 0.5%, last 2 versions, not dead",
|
|
13
14
|
"scripts": {
|
|
14
15
|
"build": "node ../../scripts/build/command.mjs --path widget/embedded",
|
|
16
|
+
"ts-check": "tsc --declaration --emitDeclarationOnly -p ./tsconfig.json",
|
|
15
17
|
"clean": "rimraf dist",
|
|
16
18
|
"format": "prettier --write '{.,src}/**/*.{ts,tsx}'",
|
|
17
19
|
"lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore"
|
|
@@ -19,20 +21,20 @@
|
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"@lingui/core": "4.2.1",
|
|
21
23
|
"@lingui/react": "4.2.1",
|
|
22
|
-
"@rango-dev/provider-all": "^0.22.1-next.
|
|
23
|
-
"@rango-dev/queue-manager-core": "^0.22.1-next.
|
|
24
|
-
"@rango-dev/queue-manager-rango-preset": "^0.22.1-next.
|
|
25
|
-
"@rango-dev/queue-manager-react": "^0.22.1-next.
|
|
26
|
-
"@rango-dev/ui": "^0.22.1-next.
|
|
27
|
-
"@rango-dev/wallets-react": "^0.8.1-next.
|
|
28
|
-
"@rango-dev/wallets-shared": "^0.21.1-next.
|
|
24
|
+
"@rango-dev/provider-all": "^0.22.1-next.9",
|
|
25
|
+
"@rango-dev/queue-manager-core": "^0.22.1-next.3",
|
|
26
|
+
"@rango-dev/queue-manager-rango-preset": "^0.22.1-next.12",
|
|
27
|
+
"@rango-dev/queue-manager-react": "^0.22.1-next.3",
|
|
28
|
+
"@rango-dev/ui": "^0.22.1-next.17",
|
|
29
|
+
"@rango-dev/wallets-react": "^0.8.1-next.6",
|
|
30
|
+
"@rango-dev/wallets-shared": "^0.21.1-next.6",
|
|
29
31
|
"bignumber.js": "^9.1.1",
|
|
30
32
|
"copy-to-clipboard": "^3.3.3",
|
|
31
33
|
"dayjs": "^1.11.7",
|
|
32
34
|
"immer": "^9.0.19",
|
|
33
35
|
"mitt": "^3.0.0",
|
|
34
|
-
"rango-sdk": "^0.1.
|
|
35
|
-
"rango-types": "^0.1.
|
|
36
|
+
"rango-sdk": "^0.1.44",
|
|
37
|
+
"rango-types": "^0.1.57",
|
|
36
38
|
"react-i18next": "^12.2.0",
|
|
37
39
|
"react-router-dom": "^6.8.0",
|
|
38
40
|
"values.js": "2.1.1",
|
package/src/QueueManager.tsx
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import type { SwapQueueContext } from '@rango-dev/queue-manager-rango-preset';
|
|
2
|
+
import type { Network, WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
+
import type { PropsWithChildren } from 'react';
|
|
4
|
+
|
|
3
5
|
import {
|
|
4
|
-
makeQueueDefinition,
|
|
5
|
-
SwapQueueContext,
|
|
6
6
|
checkWaitingForNetworkChange,
|
|
7
|
+
makeQueueDefinition,
|
|
7
8
|
} from '@rango-dev/queue-manager-rango-preset';
|
|
9
|
+
import { Provider as ManagerProvider } from '@rango-dev/queue-manager-react';
|
|
8
10
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from '
|
|
14
|
-
import { useMetaStore } from './store/meta';
|
|
11
|
+
import { convertEvmBlockchainMetaToEvmChainInfo } from '@rango-dev/wallets-shared';
|
|
12
|
+
import { isEvmBlockchain } from 'rango-types';
|
|
13
|
+
import React, { useMemo } from 'react';
|
|
14
|
+
|
|
15
|
+
import { useAppStore } from './store/AppStore';
|
|
15
16
|
import { useWalletsStore } from './store/wallets';
|
|
16
|
-
import { walletAndSupportedChainsNames } from './utils/wallets';
|
|
17
17
|
import { getConfig } from './utils/configs';
|
|
18
|
-
import {
|
|
18
|
+
import { walletAndSupportedChainsNames } from './utils/wallets';
|
|
19
19
|
|
|
20
|
-
function QueueManager(props: PropsWithChildren) {
|
|
20
|
+
function QueueManager(props: PropsWithChildren<{ apiKey?: string }>) {
|
|
21
21
|
const {
|
|
22
22
|
providers,
|
|
23
23
|
getSigners,
|
|
@@ -29,11 +29,12 @@ function QueueManager(props: PropsWithChildren) {
|
|
|
29
29
|
|
|
30
30
|
const swapQueueDef = useMemo(() => {
|
|
31
31
|
return makeQueueDefinition({
|
|
32
|
-
API_KEY: getConfig('API_KEY'),
|
|
32
|
+
API_KEY: props.apiKey || getConfig('API_KEY'),
|
|
33
|
+
BASE_URL: getConfig('BASE_URL'),
|
|
33
34
|
});
|
|
34
|
-
}, []);
|
|
35
|
+
}, [props.apiKey]);
|
|
35
36
|
|
|
36
|
-
const
|
|
37
|
+
const blockchains = useAppStore().blockchains();
|
|
37
38
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
38
39
|
|
|
39
40
|
const wallets = {
|
|
@@ -43,7 +44,7 @@ function QueueManager(props: PropsWithChildren) {
|
|
|
43
44
|
})),
|
|
44
45
|
};
|
|
45
46
|
|
|
46
|
-
const switchNetwork = (wallet: WalletType, network: Network) => {
|
|
47
|
+
const switchNetwork = async (wallet: WalletType, network: Network) => {
|
|
47
48
|
if (!canSwitchNetworkTo(wallet, network)) {
|
|
48
49
|
return undefined;
|
|
49
50
|
}
|
|
@@ -1,42 +1,17 @@
|
|
|
1
|
-
import type { WidgetConfig } from '../types';
|
|
2
1
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
3
2
|
import type { PropsWithChildren } from 'react';
|
|
4
3
|
|
|
5
4
|
import { useQueueManager } from '@rango-dev/queue-manager-rango-preset';
|
|
6
5
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
7
6
|
import { isEvmBlockchain } from 'rango-types';
|
|
8
|
-
import React, {
|
|
7
|
+
import React, { Fragment } from 'react';
|
|
9
8
|
import { MemoryRouter, useInRouterContext } from 'react-router';
|
|
10
|
-
import { useLocation, useNavigate } from 'react-router-dom';
|
|
11
9
|
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { useMetaStore } from '../store/meta';
|
|
10
|
+
import { useForceAutoConnect } from '../hooks/useForceAutoConnect';
|
|
11
|
+
import { useAppStore } from '../store/AppStore';
|
|
15
12
|
|
|
16
13
|
import { UpdateUrl } from './UpdateUrl';
|
|
17
14
|
|
|
18
|
-
function Route(props: PropsWithChildren) {
|
|
19
|
-
const location = useLocation();
|
|
20
|
-
const navigate = useNavigate();
|
|
21
|
-
const firstRender = useRef(true);
|
|
22
|
-
const paths = location.pathname.split('/');
|
|
23
|
-
const pathMatched = paths[paths.length - 1] === navigationRoutes.confirmSwap;
|
|
24
|
-
const shouldRedirectToMainPage = pathMatched && firstRender.current;
|
|
25
|
-
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (shouldRedirectToMainPage) {
|
|
28
|
-
navigate('.');
|
|
29
|
-
}
|
|
30
|
-
firstRender.current = false;
|
|
31
|
-
}, []);
|
|
32
|
-
|
|
33
|
-
if (shouldRedirectToMainPage) {
|
|
34
|
-
return <Home />;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return <> {props.children}</>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
15
|
export function AppRouter({
|
|
41
16
|
children,
|
|
42
17
|
...props
|
|
@@ -44,13 +19,14 @@ export function AppRouter({
|
|
|
44
19
|
lastConnectedWallet: string;
|
|
45
20
|
disconnectedWallet: WalletType | undefined;
|
|
46
21
|
clearDisconnectedWallet: () => void;
|
|
47
|
-
config: WidgetConfig | undefined;
|
|
48
22
|
}) {
|
|
49
23
|
const isRouterInContext = useInRouterContext();
|
|
50
|
-
const Router = isRouterInContext ?
|
|
51
|
-
const
|
|
24
|
+
const Router = isRouterInContext ? Fragment : MemoryRouter;
|
|
25
|
+
const blockchains = useAppStore().blockchains();
|
|
52
26
|
const { canSwitchNetworkTo } = useWallets();
|
|
53
27
|
|
|
28
|
+
useForceAutoConnect();
|
|
29
|
+
|
|
54
30
|
const evmChains = blockchains.filter(isEvmBlockchain);
|
|
55
31
|
|
|
56
32
|
useQueueManager({
|
|
@@ -64,7 +40,7 @@ export function AppRouter({
|
|
|
64
40
|
return (
|
|
65
41
|
<>
|
|
66
42
|
<Router>{children}</Router>
|
|
67
|
-
{isRouterInContext && <UpdateUrl
|
|
43
|
+
{isRouterInContext && <UpdateUrl />}
|
|
68
44
|
</>
|
|
69
45
|
);
|
|
70
46
|
}
|