@rango-dev/widget-embedded 0.17.1-next.9 → 0.19.0
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/CHANGELOG.md +4 -0
- package/dist/QueueManager.d.ts +1 -2
- package/dist/QueueManager.d.ts.map +1 -1
- package/dist/Wallets.d.ts +0 -1
- package/dist/Wallets.d.ts.map +1 -1
- package/dist/Widget.d.ts +1 -1
- package/dist/Widget.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +2 -0
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +6 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +3 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +3 -1
- 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 +4 -1
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
- package/dist/components/NoRoutes/NoRoutes.d.ts +4 -0
- package/dist/components/NoRoutes/NoRoutes.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts +3 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -0
- package/dist/components/{NoResult/NoResult.styles.d.ts → NoRoutes/NoRoutes.styles.d.ts} +1 -1
- package/dist/components/{NoResult/NoResult.styles.d.ts.map → NoRoutes/NoRoutes.styles.d.ts.map} +1 -1
- package/dist/components/{NoResult/NoResult.types.d.ts → NoRoutes/NoRoutes.types.d.ts} +3 -3
- package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +1 -0
- package/dist/components/NoRoutes/index.d.ts +2 -0
- package/dist/components/NoRoutes/index.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
- package/dist/components/{QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts → RouteErrors/RouteErrors.styles.d.ts} +1 -1
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts +24 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +1 -0
- package/dist/components/RouteErrors/index.d.ts +2 -0
- package/dist/components/RouteErrors/index.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/UpdateUrl.d.ts +6 -1
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/constants/errors.d.ts +4 -4
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/messages.d.ts +1 -1
- package/dist/constants/searchParams.d.ts +1 -2
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/constants/warnings.d.ts +2 -2
- package/dist/constants/warnings.d.ts.map +1 -1
- package/dist/hooks/{useConfirmSwap/useConfirmSwap.types.d.ts → useConfirmSwap.d.ts} +7 -5
- package/dist/hooks/useConfirmSwap.d.ts.map +1 -0
- package/dist/hooks/{useFetchQuote.d.ts → useFetchBestRoute.d.ts} +3 -3
- package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +2 -2
- package/dist/hooks/useSwapInput.d.ts +2 -4
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts +2 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts +6 -1
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts +2 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts +6 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts +8 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/app.d.ts +23 -5
- package/dist/store/app.d.ts.map +1 -1
- package/dist/store/{quote.d.ts → bestRoute.d.ts} +27 -39
- package/dist/store/bestRoute.d.ts.map +1 -0
- package/dist/store/meta.d.ts +23 -0
- package/dist/store/meta.d.ts.map +1 -0
- package/dist/store/settings.d.ts +2 -3
- package/dist/store/settings.d.ts.map +1 -1
- package/dist/store/slices/config.d.ts +2 -3
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +0 -3
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +4 -5
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +5 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/routing.d.ts +65 -0
- package/dist/types/routing.d.ts.map +1 -0
- package/dist/utils/numbers.d.ts +1 -1
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/utils/{quote.d.ts → routing.d.ts} +12 -16
- package/dist/utils/routing.d.ts.map +1 -0
- package/dist/utils/settings.d.ts +2 -3
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +22 -25
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +2 -2
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/QueueManager.tsx +14 -14
- package/src/Wallets.tsx +15 -35
- package/src/Widget.tsx +24 -11
- package/src/components/AppRouter.tsx +5 -6
- package/src/components/AppRoutes.tsx +39 -6
- package/src/components/BlockchainList/BlockchainList.tsx +4 -4
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +7 -7
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +64 -2
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +40 -28
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +3 -1
- package/src/components/ConfirmWalletsModal/WalletList.tsx +5 -6
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +4 -1
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +3 -3
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +6 -6
- package/src/components/{NoResult/NoResult.helpers.ts → NoRoutes/NoRoutes.helper.ts} +9 -16
- package/src/components/{NoResult/NoResult.styles.ts → NoRoutes/NoRoutes.styles.ts} +0 -2
- package/src/components/{NoResult/NoResult.tsx → NoRoutes/NoRoutes.tsx} +12 -10
- package/src/components/{NoResult/NoResult.types.ts → NoRoutes/NoRoutes.types.ts} +2 -3
- package/src/components/NoRoutes/index.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.tsx +2 -3
- package/src/components/RouteErrors/RouteErrors.tsx +79 -0
- package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
- package/src/components/RouteErrors/RouteErrorsModal.tsx +129 -0
- package/src/components/{QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx → RouteErrors/RouteErrorsModalItem.tsx} +3 -3
- package/src/components/RouteErrors/index.ts +1 -0
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.tsx +22 -18
- package/src/components/SwitchFromAndTo.tsx +2 -2
- package/src/components/TokenList/TokenList.tsx +6 -5
- package/src/components/UpdateUrl.tsx +26 -36
- package/src/components/WidgetEvents.tsx +2 -4
- package/src/constants/errors.ts +10 -8
- package/src/constants/messages.ts +1 -1
- package/src/constants/searchParams.ts +0 -1
- package/src/constants/warnings.ts +7 -7
- package/src/hooks/useConfirmSwap.ts +303 -0
- package/src/hooks/{useFetchQuote.ts → useFetchBestRoute.ts} +3 -3
- package/src/hooks/useNavigateBack.ts +3 -3
- package/src/hooks/useSwapInput.ts +23 -58
- package/src/hooks/useSyncStoresWithConfig.ts +19 -22
- package/src/hooks/useWalletList.ts +5 -3
- package/src/pages/ConfirmSwapPage.tsx +235 -58
- package/src/pages/HistoryPage.tsx +1 -1
- package/src/pages/Home.tsx +247 -58
- package/src/pages/LanguagePage.tsx +1 -1
- package/src/pages/LiquiditySourcePage.tsx +32 -23
- package/src/pages/SelectBlockchainPage.tsx +7 -6
- package/src/pages/SelectSwapItemsPage.tsx +5 -5
- package/src/pages/SettingsPage.tsx +13 -9
- package/src/pages/SwapDetailsPage.tsx +3 -3
- package/src/pages/ThemePage.tsx +1 -1
- package/src/pages/WalletsPage.tsx +12 -5
- package/src/store/app.ts +6 -18
- package/src/store/{quote.ts → bestRoute.ts} +60 -68
- package/src/store/meta.ts +39 -0
- package/src/store/settings.ts +4 -7
- package/src/store/slices/config.ts +15 -25
- package/src/store/slices/data.ts +29 -64
- package/src/store/wallets.ts +8 -11
- package/src/types/config.ts +5 -5
- package/src/types/index.ts +1 -1
- package/src/types/routing.ts +77 -0
- package/src/utils/numbers.ts +1 -1
- package/src/utils/routing.ts +321 -0
- package/src/utils/settings.ts +7 -8
- package/src/utils/swap.ts +85 -113
- package/src/utils/wallets.ts +17 -29
- package/dist/components/NoResult/NoResult.d.ts +0 -4
- package/dist/components/NoResult/NoResult.d.ts.map +0 -1
- package/dist/components/NoResult/NoResult.helpers.d.ts +0 -4
- package/dist/components/NoResult/NoResult.helpers.d.ts.map +0 -1
- package/dist/components/NoResult/NoResult.types.d.ts.map +0 -1
- package/dist/components/NoResult/index.d.ts +0 -2
- package/dist/components/NoResult/index.d.ts.map +0 -1
- package/dist/components/Quote/Quote.d.ts +0 -4
- package/dist/components/Quote/Quote.d.ts.map +0 -1
- package/dist/components/Quote/Quote.styles.d.ts +0 -1429
- package/dist/components/Quote/Quote.styles.d.ts.map +0 -1
- package/dist/components/Quote/Quote.types.d.ts +0 -22
- package/dist/components/Quote/Quote.types.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSkeleton.d.ts +0 -4
- package/dist/components/Quote/QuoteSkeleton.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSkeleton.styles.d.ts +0 -319
- package/dist/components/Quote/QuoteSkeleton.styles.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSkeleton.types.d.ts +0 -6
- package/dist/components/Quote/QuoteSkeleton.types.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSummary.d.ts +0 -11
- package/dist/components/Quote/QuoteSummary.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +0 -158
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +0 -1
- package/dist/components/Quote/index.d.ts +0 -4
- package/dist/components/Quote/index.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts +0 -11
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts +0 -4
- package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts +0 -4
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts +0 -9
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +0 -22
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts +0 -11
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts +0 -11
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/index.d.ts +0 -2
- package/dist/components/QuoteWarningsAndErrors/index.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts +0 -4
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +0 -472
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +0 -17
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/index.d.ts +0 -2
- package/dist/containers/QuoteInfo/index.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/index.d.ts +0 -2
- package/dist/hooks/useConfirmSwap/index.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts +0 -3
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +0 -16
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +0 -1
- package/dist/hooks/useFetchQuote.d.ts.map +0 -1
- package/dist/hooks/useForceAutoConnect.d.ts +0 -2
- package/dist/hooks/useForceAutoConnect.d.ts.map +0 -1
- package/dist/store/AppStore.d.ts +0 -11
- package/dist/store/AppStore.d.ts.map +0 -1
- package/dist/store/quote.d.ts.map +0 -1
- package/dist/types/quote.d.ts +0 -82
- package/dist/types/quote.d.ts.map +0 -1
- package/dist/utils/quote.d.ts.map +0 -1
- package/src/components/NoResult/index.ts +0 -1
- package/src/components/Quote/Quote.styles.ts +0 -212
- package/src/components/Quote/Quote.tsx +0 -345
- package/src/components/Quote/Quote.types.ts +0 -16
- package/src/components/Quote/QuoteSkeleton.styles.ts +0 -110
- package/src/components/Quote/QuoteSkeleton.tsx +0 -108
- package/src/components/Quote/QuoteSkeleton.types.ts +0 -5
- package/src/components/Quote/QuoteSummary.styles.ts +0 -15
- package/src/components/Quote/QuoteSummary.tsx +0 -46
- package/src/components/Quote/index.ts +0 -3
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +0 -107
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +0 -67
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +0 -103
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +0 -24
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +0 -77
- package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +0 -38
- package/src/components/QuoteWarningsAndErrors/index.ts +0 -1
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +0 -15
- package/src/containers/QuoteInfo/QuoteInfo.tsx +0 -97
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +0 -17
- package/src/containers/QuoteInfo/index.ts +0 -1
- package/src/hooks/useConfirmSwap/index.ts +0 -1
- package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +0 -168
- package/src/hooks/useConfirmSwap/useConfirmSwap.ts +0 -136
- package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +0 -19
- package/src/hooks/useForceAutoConnect.ts +0 -27
- package/src/store/AppStore.tsx +0 -35
- package/src/types/quote.ts +0 -107
- package/src/utils/quote.ts +0 -338
- /package/src/components/{QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts → RouteErrors/RouteErrors.styles.ts} +0 -0
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import type { WidgetConfig } from '../types';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
+
type PropTypes = {
|
|
4
|
+
config?: WidgetConfig;
|
|
5
|
+
};
|
|
6
|
+
export declare function ConfirmSwapPage(props: PropTypes): React.JSX.Element;
|
|
7
|
+
export {};
|
|
3
8
|
//# sourceMappingURL=ConfirmSwapPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAoB7C,OAAO,KAA8B,MAAM,OAAO,CAAC;AA6EnD,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,qBAoa/C"}
|
package/dist/pages/Home.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA+E3D,wBAAgB,IAAI,sBA0YnB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface PropTypes {
|
|
3
|
+
supportedSwappers?: string[];
|
|
3
4
|
sourceType: 'Exchanges' | 'Bridges';
|
|
4
5
|
}
|
|
5
|
-
export declare function LiquiditySourcePage({ sourceType }: PropTypes): React.JSX.Element;
|
|
6
|
+
export declare function LiquiditySourcePage({ supportedSwappers, sourceType, }: PropTypes): React.JSX.Element;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=LiquiditySourcePage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiquiditySourcePage.d.ts","sourceRoot":"","sources":["../../src/pages/LiquiditySourcePage.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LiquiditySourcePage.d.ts","sourceRoot":"","sources":["../../src/pages/LiquiditySourcePage.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAqBxC,UAAU,SAAS;IACjB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,EAAE,WAAW,GAAG,SAAS,CAAC;CACrC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,iBAAiB,EACjB,UAAU,GACX,EAAE,SAAS,qBAwHX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectBlockchainPage.d.ts","sourceRoot":"","sources":["../../src/pages/SelectBlockchainPage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectBlockchainPage.d.ts","sourceRoot":"","sources":["../../src/pages/SelectBlockchainPage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAWxC,UAAU,SAAS;IACjB,IAAI,EAAE,QAAQ,GAAG,aAAa,CAAC;CAChC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,qBA0DpD"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
interface PropTypes {
|
|
3
|
+
supportedSwappers?: string[];
|
|
4
|
+
singleTheme?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function SettingsPage({ supportedSwappers, singleTheme }: PropTypes): React.JSX.Element;
|
|
7
|
+
export {};
|
|
3
8
|
//# sourceMappingURL=SettingsPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../../src/pages/SettingsPage.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,wBAAgB,YAAY,
|
|
1
|
+
{"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../../src/pages/SettingsPage.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,UAAU,SAAS;IACjB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,EAAE,iBAAiB,EAAE,WAAW,EAAE,EAAE,SAAS,qBAgKzE"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import type { WidgetConfig } from '../types';
|
|
1
2
|
import React from 'react';
|
|
3
|
+
interface PropTypes {
|
|
4
|
+
supportedWallets: WidgetConfig['wallets'];
|
|
5
|
+
multiWallets: boolean;
|
|
6
|
+
config?: WidgetConfig;
|
|
7
|
+
}
|
|
2
8
|
export declare const TIME_TO_CLOSE_MODAL = 3000;
|
|
3
9
|
export declare const TIME_TO_IGNORE_MODAL = 300;
|
|
4
|
-
export declare function WalletsPage(): React.JSX.Element;
|
|
10
|
+
export declare function WalletsPage({ config }: PropTypes): React.JSX.Element;
|
|
11
|
+
export {};
|
|
5
12
|
//# sourceMappingURL=WalletsPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../../src/pages/WalletsPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../../src/pages/WalletsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAK7C,OAAO,KAA6B,MAAM,OAAO,CAAC;AAUlD,UAAU,SAAS;IACjB,gBAAgB,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1C,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAeD,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AACzC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE,SAAS,qBAqEhD"}
|
package/dist/store/app.d.ts
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import type { ConfigSlice } from './slices/config';
|
|
2
2
|
import type { DataSlice } from './slices/data';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export declare const useAppStore: {
|
|
4
|
+
(): DataSlice & ConfigSlice;
|
|
5
|
+
<U>(selector: (state: DataSlice & ConfigSlice) => U, equals?: ((a: U, b: U) => boolean) | undefined): U;
|
|
6
|
+
} & import("zustand").StoreApi<DataSlice & ConfigSlice> & {
|
|
7
|
+
use: {
|
|
8
|
+
_blockchains: () => import("rango-sdk").BlockchainMeta[];
|
|
9
|
+
_tokens: () => import("rango-sdk").Token[];
|
|
10
|
+
_popularTokens: () => import("rango-sdk").Token[];
|
|
11
|
+
_swappers: () => import("rango-sdk").SwapperMeta[];
|
|
12
|
+
blockchains: () => (options?: {
|
|
13
|
+
type?: "destination" | "source" | undefined;
|
|
14
|
+
} | undefined) => import("rango-sdk").BlockchainMeta[];
|
|
15
|
+
tokens: () => (options?: {
|
|
16
|
+
type?: "destination" | "source" | undefined;
|
|
17
|
+
blockchain?: string | undefined;
|
|
18
|
+
searchFor?: string | undefined;
|
|
19
|
+
} | undefined) => import("rango-sdk").Token[];
|
|
20
|
+
isTokenPinned: () => (token: import("rango-sdk").Token) => boolean;
|
|
21
|
+
fetch: () => () => Promise<void>;
|
|
22
|
+
config: () => import("..").WidgetConfig;
|
|
23
|
+
updateConfig: () => (config: import("..").WidgetConfig) => void;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
8
26
|
//# sourceMappingURL=app.d.ts.map
|
package/dist/store/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/store/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/store/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAa/C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAAyB,CAAC"}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import type { TokenWithBalance } from '../components/TokenList';
|
|
2
2
|
import type { Wallet } from '../types';
|
|
3
3
|
import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset/dist/shared';
|
|
4
|
-
import type { BestRouteResponse, BlockchainMeta,
|
|
4
|
+
import type { BestRouteResponse, BlockchainMeta, Token } from 'rango-sdk';
|
|
5
5
|
import BigNumber from 'bignumber.js';
|
|
6
|
-
export
|
|
7
|
-
export type Meta = Pick<MetaResponse, 'blockchains' | 'tokens'>;
|
|
8
|
-
export type SetTokenParams = {
|
|
9
|
-
token: Token;
|
|
10
|
-
meta: Meta;
|
|
11
|
-
} | {
|
|
12
|
-
token: null;
|
|
13
|
-
};
|
|
14
|
-
export interface QuoteState {
|
|
6
|
+
export interface RouteState {
|
|
15
7
|
fromBlockchain: BlockchainMeta | null;
|
|
16
8
|
toBlockchain: BlockchainMeta | null;
|
|
17
9
|
inputAmount: string;
|
|
@@ -20,35 +12,33 @@ export interface QuoteState {
|
|
|
20
12
|
outputUsdValue: BigNumber | null;
|
|
21
13
|
fromToken: TokenWithBalance | null;
|
|
22
14
|
toToken: TokenWithBalance | null;
|
|
23
|
-
|
|
15
|
+
routeWalletsConfirmed: boolean;
|
|
24
16
|
selectedWallets: Wallet[];
|
|
25
|
-
|
|
26
|
-
resetQuote: () => void;
|
|
17
|
+
resetRoute: () => void;
|
|
27
18
|
resetToBlockchain: () => void;
|
|
28
19
|
resetFromBlockchain: () => void;
|
|
29
20
|
setFromBlockchain: (chain: BlockchainMeta | null) => void;
|
|
30
21
|
setToBlockchain: (chian: BlockchainMeta | null) => void;
|
|
31
|
-
setFromToken: (
|
|
32
|
-
setToToken: (
|
|
22
|
+
setFromToken: (token: Token | null) => void;
|
|
23
|
+
setToToken: (token: Token | null) => void;
|
|
33
24
|
setInputAmount: (amount: string) => void;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
retry: (pendingSwap: PendingSwap
|
|
25
|
+
bestRoute: BestRouteResponse | null;
|
|
26
|
+
setRoute: (bestRoute: BestRouteResponse | null) => void;
|
|
27
|
+
retry: (pendingSwap: PendingSwap) => void;
|
|
37
28
|
switchFromAndTo: () => void;
|
|
38
|
-
|
|
29
|
+
setRouteWalletConfirmed: (flag: boolean) => void;
|
|
39
30
|
setSelectedWallets: (wallets: Wallet[]) => void;
|
|
40
31
|
customDestination: string;
|
|
41
32
|
setCustomDestination: (address: string) => void;
|
|
42
|
-
|
|
43
|
-
setQuoteWarningsConfirmed: (flag: boolean) => void;
|
|
33
|
+
resetRouteWallets: () => void;
|
|
44
34
|
}
|
|
45
|
-
export declare const
|
|
46
|
-
():
|
|
47
|
-
<U>(selector: (state:
|
|
48
|
-
} & Omit<import("zustand").StoreApi<
|
|
35
|
+
export declare const useBestRouteStore: {
|
|
36
|
+
(): RouteState;
|
|
37
|
+
<U>(selector: (state: RouteState) => U, equals?: ((a: U, b: U) => boolean) | undefined): U;
|
|
38
|
+
} & Omit<import("zustand").StoreApi<RouteState>, "subscribe"> & {
|
|
49
39
|
subscribe: {
|
|
50
|
-
(listener: (selectedState:
|
|
51
|
-
<U_1>(selector: (state:
|
|
40
|
+
(listener: (selectedState: RouteState, previousSelectedState: RouteState) => void): () => void;
|
|
41
|
+
<U_1>(selector: (state: RouteState) => U_1, listener: (selectedState: U_1, previousSelectedState: U_1) => void, options?: {
|
|
52
42
|
equalityFn?: ((a: U_1, b: U_1) => boolean) | undefined;
|
|
53
43
|
fireImmediately?: boolean | undefined;
|
|
54
44
|
} | undefined): () => void;
|
|
@@ -63,27 +53,25 @@ export declare const useQuoteStore: {
|
|
|
63
53
|
outputUsdValue: () => BigNumber | null;
|
|
64
54
|
fromToken: () => TokenWithBalance | null;
|
|
65
55
|
toToken: () => TokenWithBalance | null;
|
|
66
|
-
|
|
56
|
+
routeWalletsConfirmed: () => boolean;
|
|
67
57
|
selectedWallets: () => Wallet[];
|
|
68
|
-
|
|
69
|
-
resetQuote: () => () => void;
|
|
58
|
+
resetRoute: () => () => void;
|
|
70
59
|
resetToBlockchain: () => () => void;
|
|
71
60
|
resetFromBlockchain: () => () => void;
|
|
72
61
|
setFromBlockchain: () => (chain: BlockchainMeta | null) => void;
|
|
73
62
|
setToBlockchain: () => (chian: BlockchainMeta | null) => void;
|
|
74
|
-
setFromToken: () => (
|
|
75
|
-
setToToken: () => (
|
|
63
|
+
setFromToken: () => (token: Token | null) => void;
|
|
64
|
+
setToToken: () => (token: Token | null) => void;
|
|
76
65
|
setInputAmount: () => (amount: string) => void;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
retry: () => (pendingSwap: PendingSwap
|
|
66
|
+
bestRoute: () => BestRouteResponse | null;
|
|
67
|
+
setRoute: () => (bestRoute: BestRouteResponse | null) => void;
|
|
68
|
+
retry: () => (pendingSwap: PendingSwap) => void;
|
|
80
69
|
switchFromAndTo: () => () => void;
|
|
81
|
-
|
|
70
|
+
setRouteWalletConfirmed: () => (flag: boolean) => void;
|
|
82
71
|
setSelectedWallets: () => (wallets: Wallet[]) => void;
|
|
83
72
|
customDestination: () => string;
|
|
84
73
|
setCustomDestination: () => (address: string) => void;
|
|
85
|
-
|
|
86
|
-
setQuoteWarningsConfirmed: () => (flag: boolean) => void;
|
|
74
|
+
resetRouteWallets: () => () => void;
|
|
87
75
|
};
|
|
88
76
|
};
|
|
89
|
-
//# sourceMappingURL=
|
|
77
|
+
//# sourceMappingURL=bestRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bestRoute.d.ts","sourceRoot":"","sources":["../../src/store/bestRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE1E,OAAO,SAAS,MAAM,cAAc,CAAC;AAoBrC,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,SAAS,GAAG,IAAI,CAAC;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;;;;;;;;;;;;;;;;;;;;;;gCApBV,IAAI;uCACG,IAAI;yCACF,IAAI;yCACJ,cAAc,GAAG,IAAI,KAAK,IAAI;uCAChC,cAAc,GAAG,IAAI,KAAK,IAAI;oCAEjC,KAAK,GAAG,IAAI,KAAK,IAAI;kCACvB,KAAK,GAAG,IAAI,KAAK,IAAI;uCAChB,MAAM,KAAK,IAAI;;oCAElB,iBAAiB,GAAG,IAAI,KAAK,IAAI;mCAClC,WAAW,KAAK,IAAI;qCAClB,IAAI;8CACK,OAAO,KAAK,IAAI;4CAClB,MAAM,EAAE,KAAK,IAAI;;8CAEf,MAAM,KAAK,IAAI;uCACtB,IAAI;;CA4L9B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TokenWithBalance } from '../components/TokenList';
|
|
2
|
+
import type { MetaResponse } from 'rango-sdk';
|
|
3
|
+
export type LoadingStatus = 'loading' | 'success' | 'failed';
|
|
4
|
+
export interface MetaState {
|
|
5
|
+
meta: MetaResponse & {
|
|
6
|
+
tokens: TokenWithBalance[];
|
|
7
|
+
};
|
|
8
|
+
loadingStatus: LoadingStatus;
|
|
9
|
+
fetchMeta: () => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const useMetaStore: {
|
|
12
|
+
(): MetaState;
|
|
13
|
+
<U>(selector: (state: MetaState) => U, equals?: ((a: U, b: U) => boolean) | undefined): U;
|
|
14
|
+
} & import("zustand").StoreApi<MetaState> & {
|
|
15
|
+
use: {
|
|
16
|
+
meta: () => MetaResponse & {
|
|
17
|
+
tokens: TokenWithBalance[];
|
|
18
|
+
};
|
|
19
|
+
loadingStatus: () => LoadingStatus;
|
|
20
|
+
fetchMeta: () => () => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/store/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAO9C,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE7D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,YAAY,GAAG;QAAE,MAAM,EAAE,gBAAgB,EAAE,CAAA;KAAE,CAAC;IACpD,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,YAAY;;;;;;oBALQ,gBAAgB,EAAE;;;+BAEhC,QAAQ,IAAI,CAAC;;CAyB/B,CAAC"}
|
package/dist/store/settings.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { SwapperMeta } from 'rango-sdk';
|
|
2
1
|
import { type Language } from '@rango-dev/ui';
|
|
3
2
|
export type ThemeMode = 'auto' | 'dark' | 'light';
|
|
4
3
|
export interface SettingsState {
|
|
@@ -21,7 +20,7 @@ export interface SettingsState {
|
|
|
21
20
|
toggleLiquiditySource: (name: string) => void;
|
|
22
21
|
setTheme: (theme: ThemeMode) => void;
|
|
23
22
|
setLanguage: (language: Language) => void;
|
|
24
|
-
toggleAllLiquiditySources: (
|
|
23
|
+
toggleAllLiquiditySources: (shouldReset?: boolean) => void;
|
|
25
24
|
setAffiliateRef: (affiliateRef: string | null) => void;
|
|
26
25
|
setAffiliatePercent: (affiliatePercent: number | null) => void;
|
|
27
26
|
setAffiliateWallets: (affiliateWallets: {
|
|
@@ -70,7 +69,7 @@ export declare const useSettingsStore: {
|
|
|
70
69
|
toggleLiquiditySource: () => (name: string) => void;
|
|
71
70
|
setTheme: () => (theme: ThemeMode) => void;
|
|
72
71
|
setLanguage: () => (language: Language) => void;
|
|
73
|
-
toggleAllLiquiditySources: () => (
|
|
72
|
+
toggleAllLiquiditySources: () => (shouldReset?: boolean) => void;
|
|
74
73
|
setAffiliateRef: () => (affiliateRef: string | null) => void;
|
|
75
74
|
setAffiliatePercent: () => (affiliatePercent: number | null) => void;
|
|
76
75
|
setAffiliateWallets: () => (affiliateWallets: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/store/settings.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/store/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAY9C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAEnD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iBAAiB,EAAE,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,qBAAqB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,yBAAyB,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3D,eAAe,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,mBAAmB,EAAE,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,mBAAmB,EAAE,CACnB,gBAAgB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,KAC/C,IAAI,CAAC;IACV,sBAAsB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAfH,MAAM,KAAK,IAAI;kDACH,MAAM,GAAG,IAAI,KAAK,IAAI;2CAC7B,IAAI;4CACH,MAAM,KAAK,IAAI;gCAC3B,SAAS,KAAK,IAAI;sCACZ,QAAQ,KAAK,IAAI;wDACC,OAAO,KAAK,IAAI;8CAC1B,MAAM,GAAG,IAAI,KAAK,IAAI;sDACd,MAAM,GAAG,IAAI,KAAK,IAAI;;;qBAGzD,IAAI;mDAC4B,MAAM,KAAK,IAAI;;CAsHrD,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { WidgetConfig } from '../../types';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const DEFAULT_CONFIG: WidgetConfig;
|
|
2
|
+
import type { StateCreator } from 'zustand';
|
|
4
3
|
export type ConfigSlice = {
|
|
5
4
|
config: WidgetConfig;
|
|
6
5
|
updateConfig: (config: WidgetConfig) => void;
|
|
7
6
|
};
|
|
8
|
-
export declare const createConfigSlice:
|
|
7
|
+
export declare const createConfigSlice: StateCreator<ConfigSlice>;
|
|
9
8
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/store/slices/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/store/slices/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,YAAY,CAAC;IAErB,YAAY,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CActD,CAAC"}
|
|
@@ -9,16 +9,13 @@ type TokenOptions = {
|
|
|
9
9
|
blockchain?: string;
|
|
10
10
|
searchFor?: string;
|
|
11
11
|
};
|
|
12
|
-
export type FetchStatus = 'loading' | 'success' | 'failed';
|
|
13
12
|
export interface DataSlice {
|
|
14
13
|
_blockchains: BlockchainMeta[];
|
|
15
14
|
_tokens: Token[];
|
|
16
15
|
_popularTokens: Token[];
|
|
17
16
|
_swappers: SwapperMeta[];
|
|
18
|
-
fetchStatus: FetchStatus;
|
|
19
17
|
blockchains: (options?: BlockchainOptions) => BlockchainMeta[];
|
|
20
18
|
tokens: (options?: TokenOptions) => Token[];
|
|
21
|
-
swappers: () => SwapperMeta[];
|
|
22
19
|
isTokenPinned: (token: Token) => boolean;
|
|
23
20
|
fetch: () => Promise<void>;
|
|
24
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/store/slices/data.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO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1,5 @@
|
|
|
1
1
|
import type { Wallet } from '../types';
|
|
2
2
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
-
import type { Token } from 'rango-sdk';
|
|
4
3
|
export type TokenBalance = {
|
|
5
4
|
chain: string;
|
|
6
5
|
symbol: string;
|
|
@@ -23,14 +22,14 @@ interface WalletsStore {
|
|
|
23
22
|
connectedWallets: ConnectedWallet[];
|
|
24
23
|
customDestination: string;
|
|
25
24
|
loading: boolean;
|
|
26
|
-
connectWallet: (accounts: Wallet[]
|
|
25
|
+
connectWallet: (accounts: Wallet[]) => void;
|
|
27
26
|
disconnectWallet: (walletType: WalletType) => void;
|
|
28
27
|
selectWallets: (wallets: {
|
|
29
28
|
walletType: string;
|
|
30
29
|
chain: string;
|
|
31
30
|
}[]) => void;
|
|
32
31
|
clearConnectedWallet: () => void;
|
|
33
|
-
getWalletsDetails: (accounts: Wallet[],
|
|
32
|
+
getWalletsDetails: (accounts: Wallet[], shouldRetry?: boolean) => void;
|
|
34
33
|
}
|
|
35
34
|
export declare const useWalletsStore: {
|
|
36
35
|
(): WalletsStore;
|
|
@@ -48,14 +47,14 @@ export declare const useWalletsStore: {
|
|
|
48
47
|
connectedWallets: () => ConnectedWallet[];
|
|
49
48
|
customDestination: () => string;
|
|
50
49
|
loading: () => boolean;
|
|
51
|
-
connectWallet: () => (accounts: Wallet[]
|
|
50
|
+
connectWallet: () => (accounts: Wallet[]) => void;
|
|
52
51
|
disconnectWallet: () => (walletType: WalletType) => void;
|
|
53
52
|
selectWallets: () => (wallets: {
|
|
54
53
|
walletType: string;
|
|
55
54
|
chain: string;
|
|
56
55
|
}[]) => void;
|
|
57
56
|
clearConnectedWallet: () => () => void;
|
|
58
|
-
getWalletsDetails: () => (accounts: Wallet[],
|
|
57
|
+
getWalletsDetails: () => (accounts: Wallet[], shouldRetry?: boolean) => void;
|
|
59
58
|
};
|
|
60
59
|
};
|
|
61
60
|
export declare const fetchingBalanceSelector: (state: WalletsStore) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/store/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/store/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAe5D,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC7C,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,UAAU,YAAY;IACpB,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,gBAAgB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IACnD,aAAa,EAAE,CAAC,OAAO,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,KAAK,IAAI,CAAC;IAC1E,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACxE;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;wCAPA,MAAM,EAAE,KAAK,IAAI;6CACZ,UAAU,KAAK,IAAI;uCACzB;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,KAAK,IAAI;0CAC7C,IAAI;4CACF,MAAM,EAAE,gBAAgB,OAAO,KAAK,IAAI;;CAoKvE,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAAW,YAAY,YACA,CAAC"}
|
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 WidgeAffiliate = {
|
|
65
65
|
ref?: string;
|
|
66
66
|
percent?: number;
|
|
67
67
|
wallets?: {
|
|
@@ -91,7 +91,7 @@ export type BlockchainAndTokenConfig = {
|
|
|
91
91
|
* and theme.
|
|
92
92
|
*
|
|
93
93
|
* @property {string} apiKey - The API key used to communicate with Rango API
|
|
94
|
-
* @property {
|
|
94
|
+
* @property {WidgeAffiliate} affiliate - If you want to charge users fee per transaction, you should
|
|
95
95
|
* pass `WidgetAffiliate` including affiliateRef, affiliatePercent, and affiliateWallets.
|
|
96
96
|
* @property {number} amount - The default input amount.
|
|
97
97
|
* @property {BlockchainAndTokenConfig} from - The `from` property is an optional property of type
|
|
@@ -121,13 +121,13 @@ export type BlockchainAndTokenConfig = {
|
|
|
121
121
|
* If `externalWallets` is `true`, you should add `WidgetWallets` to your app.
|
|
122
122
|
* @property {Asset} pinnedTokens - The `pinnedTokens` property is an optional array of `Asset` objects that
|
|
123
123
|
* you could use to pin tokens of your choice to the top of the token list.
|
|
124
|
-
* @property {boolean}
|
|
124
|
+
* @property {boolean} includeNewLiquiditySources - The `includeNewLiquiditySources` property is a boolean value that when you
|
|
125
125
|
* set it to true, whenever a new liquidity source is added, it will be added to your list as well.
|
|
126
126
|
*/
|
|
127
127
|
export type WidgetConfig = {
|
|
128
128
|
apiKey: string;
|
|
129
129
|
walletConnectProjectId?: string;
|
|
130
|
-
affiliate?:
|
|
130
|
+
affiliate?: WidgeAffiliate;
|
|
131
131
|
amount?: number;
|
|
132
132
|
from?: BlockchainAndTokenConfig;
|
|
133
133
|
to?: BlockchainAndTokenConfig;
|
|
@@ -139,6 +139,6 @@ export type WidgetConfig = {
|
|
|
139
139
|
theme?: WidgetTheme;
|
|
140
140
|
externalWallets?: boolean;
|
|
141
141
|
pinnedTokens?: Asset[];
|
|
142
|
-
|
|
142
|
+
includeNewLiquiditySources?: boolean;
|
|
143
143
|
};
|
|
144
144
|
//# 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,EAA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AC;IAChB,IAAI,CAAC,EAAE,wBAAwB,CAAC;IAChC,EAAE,CAAC,EAAE,wBAAwB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,UAAU,GAAG,iBAAiB,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,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { RouteState } from '../store/bestRoute';
|
|
2
|
+
import type { SettingsState } from '../store/settings';
|
|
3
|
+
interface BestRouteStoreParams {
|
|
4
|
+
fromBlockchain?: RouteState['fromBlockchain'];
|
|
5
|
+
toBlockchain?: RouteState['toBlockchain'];
|
|
6
|
+
fromToken?: RouteState['fromToken'];
|
|
7
|
+
toToken?: RouteState['toToken'];
|
|
8
|
+
inputAmount?: RouteState['inputAmount'];
|
|
9
|
+
}
|
|
10
|
+
interface SettingsStoreParams {
|
|
11
|
+
slippage?: SettingsState['slippage'];
|
|
12
|
+
customSlippage?: SettingsState['customSlippage'];
|
|
13
|
+
disabledLiquiditySources?: SettingsState['disabledLiquiditySources'];
|
|
14
|
+
infiniteApprove?: SettingsState['infiniteApprove'];
|
|
15
|
+
}
|
|
16
|
+
export type BestRouteEqualityParams = {
|
|
17
|
+
store: 'bestRoute';
|
|
18
|
+
prevState: BestRouteStoreParams;
|
|
19
|
+
currentState: BestRouteStoreParams;
|
|
20
|
+
} | {
|
|
21
|
+
store: 'settings';
|
|
22
|
+
prevState: SettingsStoreParams;
|
|
23
|
+
currentState: SettingsStoreParams;
|
|
24
|
+
};
|
|
25
|
+
export declare enum ConfirmSwapErrorTypes {
|
|
26
|
+
NO_ROUTE = 0,
|
|
27
|
+
ROUTE_UPDATED_WITH_HIGH_VALUE_LOSS = 1,
|
|
28
|
+
REQUEST_FAILED = 2,
|
|
29
|
+
REQUEST_CANCELED = 3
|
|
30
|
+
}
|
|
31
|
+
export type ConfirmSwapError = {
|
|
32
|
+
type: ConfirmSwapErrorTypes.NO_ROUTE;
|
|
33
|
+
diagnosisMessage?: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: Exclude<ConfirmSwapErrorTypes, ConfirmSwapErrorTypes.NO_ROUTE>;
|
|
36
|
+
};
|
|
37
|
+
export declare enum RouteWarningType {
|
|
38
|
+
ROUTE_UPDATED = 0,
|
|
39
|
+
ROUTE_SWAPPERS_UPDATED = 1,
|
|
40
|
+
ROUTE_COINS_UPDATED = 2,
|
|
41
|
+
ROUTE_AND_OUTPUT_AMOUNT_UPDATED = 3
|
|
42
|
+
}
|
|
43
|
+
export type RouteWarning = {
|
|
44
|
+
type: RouteWarningType.ROUTE_AND_OUTPUT_AMOUNT_UPDATED;
|
|
45
|
+
newOutputAmount: string;
|
|
46
|
+
percentageChange: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: Exclude<RouteWarningType, RouteWarningType.ROUTE_AND_OUTPUT_AMOUNT_UPDATED>;
|
|
49
|
+
};
|
|
50
|
+
export declare enum SlippageWarningType {
|
|
51
|
+
INSUFFICIENT_SLIPPAGE = 0,
|
|
52
|
+
HIGH_SLIPPAGE = 1
|
|
53
|
+
}
|
|
54
|
+
export type ConfirmSwapWarnings = {
|
|
55
|
+
route: RouteWarning | null;
|
|
56
|
+
balance: {
|
|
57
|
+
messages: string[];
|
|
58
|
+
} | null;
|
|
59
|
+
slippage: {
|
|
60
|
+
type: SlippageWarningType;
|
|
61
|
+
slippage: string | null;
|
|
62
|
+
} | null;
|
|
63
|
+
};
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=routing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/types/routing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,UAAU,oBAAoB;IAC5B,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC,WAAW,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;CACzC;AAED,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACrC,cAAc,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACjD,wBAAwB,CAAC,EAAE,aAAa,CAAC,0BAA0B,CAAC,CAAC;IACrE,eAAe,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;CACpD;AAED,MAAM,MAAM,uBAAuB,GAC/B;IACE,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,oBAAoB,CAAC;IAChC,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rango-sdk';
|
|
|
2
2
|
import { BigNumber } from 'bignumber.js';
|
|
3
3
|
export declare const percentToString: (p: number, fractions?: number) => string;
|
|
4
4
|
export declare const secondsToString: (s: number) => string;
|
|
5
|
-
export declare const numberToString: (number: BigNumber | string |
|
|
5
|
+
export declare const numberToString: (number: BigNumber | string | null | undefined, minDecimals?: number | null, maxDecimals?: number | null) => string;
|
|
6
6
|
export declare const convertBigNumberToHex: (value: BigNumber, decimals: number) => string;
|
|
7
7
|
export declare const uint8ArrayToHex: (buffer: Uint8Array) => string;
|
|
8
8
|
export declare function dollarToConciseString(num: number | undefined): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src/utils/numbers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,MAAO,MAAM,yBAAkB,MAC7B,CAAC;AAE/B,eAAO,MAAM,eAAe,MAAO,MAAM,KAAG,MAM3C,CAAC;AAEF,eAAO,MAAM,cAAc,WACjB,SAAS,GAAG,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src/utils/numbers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,MAAO,MAAM,yBAAkB,MAC7B,CAAC;AAE/B,eAAO,MAAM,eAAe,MAAO,MAAM,KAAG,MAM3C,CAAC;AAEF,eAAO,MAAM,cAAc,WACjB,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,gBAChC,MAAM,GAAG,IAAI,gBACb,MAAM,GAAG,IAAI,KACzB,MA2EF,CAAC;AAEF,eAAO,MAAM,qBAAqB,UACzB,SAAS,YACN,MAAM,KACf,MAEF,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,UAAU,KAAG,MAKpD,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAoBrE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAa5E;AAED,eAAO,MAAM,gBAAgB,SACrB;IAAE,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAAE,GAAG,SAAS,WACS,CAAC;AAEzE,eAAO,MAAM,OAAO,SAAU,iBAAiB,KAAG,MAOnC,CAAC;AAEhB,eAAO,MAAM,YAAY,SAAU,MAAM,cAAc,MAAM,YACF,CAAC;AAE5D,eAAO,MAAM,gBAAgB,UAAW,MAAM,YACd,CAAC;AAGjC,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,EACpB,gBAAgB,SAAI,GACnB,MAAM,CASR"}
|
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BestRouteEqualityParams, Wallet } from '../types';
|
|
2
2
|
import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
3
3
|
import type { PriceImpactWarningLevel } from '@rango-dev/ui';
|
|
4
4
|
import type { SimulationAssetAndAmount, SimulationValidationStatus } from '@rango-dev/ui/dist/widget/ui/src/types/swaps';
|
|
5
5
|
import type { Asset, BestRouteResponse, BlockchainMeta, Token } from 'rango-sdk';
|
|
6
6
|
import BigNumber from 'bignumber.js';
|
|
7
7
|
export declare function searchParamsToToken(tokens: Token[], searchParams: string | null, chain: BlockchainMeta | null): Token | null;
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function isNumberOfSwapsChanged(
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function
|
|
8
|
+
export declare function getBestRouteToTokenUsdPrice(bestRoute: BestRouteResponse | null): number | null | undefined;
|
|
9
|
+
export declare function isNumberOfSwapsChanged(route1: BestRouteResponse, route2: BestRouteResponse): boolean;
|
|
10
|
+
export declare function isRouteSwappersUpdated(route1: BestRouteResponse, route2: BestRouteResponse): boolean;
|
|
11
|
+
export declare function isRouteInternalCoinsUpdated(route1: BestRouteResponse, route2: BestRouteResponse): boolean;
|
|
12
|
+
export declare function isRouteChanged(route1: BestRouteResponse, route2: BestRouteResponse): boolean;
|
|
13
13
|
export declare function outToRatioHasWarning(fromUsdValue: BigNumber | null, outToInRatio: BigNumber | 0): boolean;
|
|
14
14
|
export declare function getRequiredBalanceOfWallet(selectedWallet: Wallet, fee: SimulationValidationStatus[] | null): SimulationAssetAndAmount[] | null;
|
|
15
|
+
export declare function isRouteParametersChanged(params: BestRouteEqualityParams): boolean | undefined;
|
|
16
|
+
export declare function getFormattedBestRoute(bestRoute: BestRouteResponse | null): BestRouteResponse | null;
|
|
17
|
+
export declare function getFormattedPendingSwap(pendingSwap: PendingSwap): PendingSwap;
|
|
18
|
+
export declare const getBestRouteStatus: (loading: boolean, error: boolean) => "loading" | "success" | "failed";
|
|
15
19
|
export declare function getPriceImpactLevel(priceImpact: number): PriceImpactWarningLevel;
|
|
16
20
|
export declare function findCommonTokens<T extends Asset[], R extends Asset[]>(listA: T, listB: R): R;
|
|
17
|
-
export declare function
|
|
21
|
+
export declare function createRetryRoute(pendingSwap: PendingSwap, blockchains: BlockchainMeta[], tokens: Token[]): {
|
|
18
22
|
fromBlockchain: BlockchainMeta | null;
|
|
19
23
|
fromToken: Token | null;
|
|
20
24
|
toBlockchain: BlockchainMeta | null;
|
|
21
25
|
toToken: Token | null;
|
|
22
26
|
inputAmount: string;
|
|
23
27
|
};
|
|
24
|
-
|
|
25
|
-
fromToken: Token;
|
|
26
|
-
toToken: Token;
|
|
27
|
-
tokens: Token[];
|
|
28
|
-
userSlippage: number;
|
|
29
|
-
}): QuoteWarning | null;
|
|
30
|
-
export declare function generateQuoteErrors(quote: BestRouteResponse): QuoteError | null;
|
|
31
|
-
export declare function getPriceImpact(inputUsdValue: BigNumber | string | null, outputUsdValue: BigNumber | string | null): number | null;
|
|
32
|
-
//# sourceMappingURL=quote.d.ts.map
|
|
28
|
+
//# sourceMappingURL=routing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/utils/routing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,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,EACN,MAAM,WAAW,CAAC;AAGnB,OAAO,SAAS,MAAM,cAAc,CAAC;AAerC,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,KAAK,EAAE,EACf,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,KAAK,EAAE,cAAc,GAAG,IAAI,GAC3B,KAAK,GAAG,IAAI,CAqBd;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,iBAAiB,GAAG,IAAI,GAClC,MAAM,GAAG,IAAI,GAAG,SAAS,CAG3B;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,WAK1B;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,WAO1B;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,WAO1B;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,iBAAiB,GACxB,OAAO,C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