@rango-dev/widget-embedded 0.1.10-next.80 → 0.1.10-next.81

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.
Files changed (105) hide show
  1. package/dist/components/AppRouter.d.ts.map +1 -1
  2. package/dist/components/AppRoutes.d.ts.map +1 -1
  3. package/dist/components/ChangeSlippageButton.d.ts +2 -0
  4. package/dist/components/ChangeSlippageButton.d.ts.map +1 -0
  5. package/dist/components/ConfirmSwapErrors.d.ts +3 -0
  6. package/dist/components/ConfirmSwapErrors.d.ts.map +1 -0
  7. package/dist/components/ConfirmSwapWarnings.d.ts +3 -0
  8. package/dist/components/ConfirmSwapWarnings.d.ts.map +1 -0
  9. package/dist/components/Layout.d.ts.map +1 -1
  10. package/dist/components/UpdateUrl.d.ts.map +1 -1
  11. package/dist/components/warnings/BalanceWarnings.d.ts +6 -0
  12. package/dist/components/warnings/BalanceWarnings.d.ts.map +1 -0
  13. package/dist/components/warnings/ConfirmSwapExtraMessages.d.ts +6 -0
  14. package/dist/components/warnings/ConfirmSwapExtraMessages.d.ts.map +1 -0
  15. package/dist/components/warnings/HighSlippageWarning.d.ts +6 -0
  16. package/dist/components/warnings/HighSlippageWarning.d.ts.map +1 -0
  17. package/dist/components/warnings/MinRequiredSlippage.d.ts +6 -0
  18. package/dist/components/warnings/MinRequiredSlippage.d.ts.map +1 -0
  19. package/dist/constants/swapSettings.d.ts +6 -0
  20. package/dist/constants/swapSettings.d.ts.map +1 -0
  21. package/dist/hooks/useNavigateBack.d.ts +4 -0
  22. package/dist/hooks/useNavigateBack.d.ts.map +1 -0
  23. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  24. package/dist/pages/ConfirmWalletsPage.d.ts +0 -5
  25. package/dist/pages/ConfirmWalletsPage.d.ts.map +1 -1
  26. package/dist/pages/HistoryPage.d.ts.map +1 -1
  27. package/dist/pages/Home.d.ts.map +1 -1
  28. package/dist/pages/LiquiditySourcesPage.d.ts.map +1 -1
  29. package/dist/pages/SelectChainPage.d.ts.map +1 -1
  30. package/dist/pages/SelectTokenPage.d.ts.map +1 -1
  31. package/dist/pages/SettingsPage.d.ts.map +1 -1
  32. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  33. package/dist/pages/WalletsPage.d.ts.map +1 -1
  34. package/dist/store/bestRoute.d.ts +1 -0
  35. package/dist/store/bestRoute.d.ts.map +1 -1
  36. package/dist/store/confirmSwap.d.ts +35 -0
  37. package/dist/store/confirmSwap.d.ts.map +1 -0
  38. package/dist/store/settings.d.ts.map +1 -1
  39. package/dist/store/ui.d.ts +2 -0
  40. package/dist/store/ui.d.ts.map +1 -0
  41. package/dist/store/wallets.d.ts.map +1 -1
  42. package/dist/types/index.d.ts +2 -0
  43. package/dist/types/index.d.ts.map +1 -0
  44. package/dist/types/swap.d.ts +11 -0
  45. package/dist/types/swap.d.ts.map +1 -0
  46. package/dist/utils/common.d.ts +1 -0
  47. package/dist/utils/common.d.ts.map +1 -1
  48. package/dist/utils/numbers.d.ts +5 -0
  49. package/dist/utils/numbers.d.ts.map +1 -1
  50. package/dist/utils/routing.d.ts +5 -7
  51. package/dist/utils/routing.d.ts.map +1 -1
  52. package/dist/utils/swap.d.ts +31 -3
  53. package/dist/utils/swap.d.ts.map +1 -1
  54. package/dist/utils/wallets.d.ts +2 -3
  55. package/dist/utils/wallets.d.ts.map +1 -1
  56. package/dist/widget-embedded.cjs.development.js +1809 -1326
  57. package/dist/widget-embedded.cjs.development.js.map +1 -1
  58. package/dist/widget-embedded.cjs.production.min.js +1809 -1326
  59. package/dist/widget-embedded.cjs.production.min.js.map +1 -1
  60. package/dist/widget-embedded.esm.js +1813 -1330
  61. package/dist/widget-embedded.esm.js.map +1 -1
  62. package/package.json +1 -1
  63. package/src/components/AppRouter.tsx +38 -3
  64. package/src/components/AppRoutes.tsx +8 -2
  65. package/src/components/ChangeSlippageButton.tsx +23 -0
  66. package/src/components/ConfirmSwapErrors.tsx +38 -0
  67. package/src/components/ConfirmSwapWarnings.tsx +38 -0
  68. package/src/components/Layout.tsx +22 -6
  69. package/src/components/UpdateUrl.tsx +100 -18
  70. package/src/components/warnings/BalanceWarnings.tsx +16 -0
  71. package/src/components/warnings/ConfirmSwapExtraMessages.tsx +14 -0
  72. package/src/components/warnings/HighSlippageWarning.tsx +21 -0
  73. package/src/components/warnings/MinRequiredSlippage.tsx +18 -0
  74. package/src/constants/navigationRoutes.ts +2 -2
  75. package/src/constants/swapSettings.ts +9 -0
  76. package/src/hooks/useNavigateBack.ts +37 -0
  77. package/src/pages/ConfirmSwapPage.tsx +30 -8
  78. package/src/pages/ConfirmWalletsPage.tsx +30 -17
  79. package/src/pages/HistoryPage.tsx +4 -4
  80. package/src/pages/Home.tsx +79 -36
  81. package/src/pages/LiquiditySourcesPage.tsx +11 -8
  82. package/src/pages/SelectChainPage.tsx +9 -28
  83. package/src/pages/SelectTokenPage.tsx +38 -27
  84. package/src/pages/SettingsPage.tsx +17 -6
  85. package/src/pages/SwapDetailsPage.tsx +9 -3
  86. package/src/pages/WalletsPage.tsx +37 -22
  87. package/src/store/bestRoute.ts +147 -28
  88. package/src/store/confirmSwap.ts +327 -0
  89. package/src/store/settings.ts +40 -28
  90. package/src/store/ui.ts +15 -0
  91. package/src/store/wallets.ts +93 -80
  92. package/src/swapBox.tsx +5 -5
  93. package/src/types/index.ts +1 -0
  94. package/src/types/swap.ts +13 -0
  95. package/src/utils/common.ts +4 -0
  96. package/src/utils/numbers.ts +17 -0
  97. package/src/utils/routing.ts +28 -77
  98. package/src/utils/swap.ts +445 -67
  99. package/src/utils/wallets.ts +4 -19
  100. package/dist/hooks/useBestRoute.d.ts +0 -8
  101. package/dist/hooks/useBestRoute.d.ts.map +0 -1
  102. package/dist/hooks/useConfirmSwap.d.ts +0 -2
  103. package/dist/hooks/useConfirmSwap.d.ts.map +0 -1
  104. package/src/hooks/useBestRoute.ts +0 -70
  105. package/src/hooks/useConfirmSwap.ts +0 -268
@@ -1 +1 @@
1
- {"version":3,"file":"AppRouter.d.ts","sourceRoot":"","sources":["../src/components/AppRouter.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAY,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI3D,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,eAUxD"}
1
+ {"version":3,"file":"AppRouter.d.ts","sourceRoot":"","sources":["../src/components/AppRouter.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAC;AAuCpE,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,eAUxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../src/components/AppRoutes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,eAAO,MAAM,SAAS,+IAiBlB,CAAC"}
1
+ {"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../src/components/AppRoutes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,eAAO,MAAM,SAAS,+IAuBlB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function ChangeSlippageButton(): JSX.Element;
2
+ //# sourceMappingURL=ChangeSlippageButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeSlippageButton.d.ts","sourceRoot":"","sources":["../src/components/ChangeSlippageButton.tsx"],"names":[],"mappings":"AASA,wBAAgB,oBAAoB,gBAanC"}
@@ -0,0 +1,3 @@
1
+ import { ConfirmSwapError } from '../store/confirmSwap';
2
+ export declare function ConfirmSwapErrors(errors: ConfirmSwapError[]): any[];
3
+ //# sourceMappingURL=ConfirmSwapErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmSwapErrors.d.ts","sourceRoot":"","sources":["../src/components/ConfirmSwapErrors.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,sBAAsB,CAAC;AAG/E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,SAgC3D"}
@@ -0,0 +1,3 @@
1
+ import { ConfirmSwapWarnings } from '../store/confirmSwap';
2
+ export declare function ConfirmSwapWarnings(warnings: ConfirmSwapWarnings[]): any[];
3
+ //# sourceMappingURL=ConfirmSwapWarnings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmSwapWarnings.d.ts","sourceRoot":"","sources":["../src/components/ConfirmSwapWarnings.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EAEpB,MAAM,sBAAsB,CAAC;AAG9B,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,SA6BlE"}
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/components/Layout.tsx"],"names":[],"mappings":"AAuBA,wBAAgB,MAAM,gBA+BrB"}
1
+ {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/components/Layout.tsx"],"names":[],"mappings":"AA4BA,wBAAgB,MAAM,gBA0CrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateUrl.d.ts","sourceRoot":"","sources":["../src/components/UpdateUrl.tsx"],"names":[],"mappings":"AAkBA,wBAAgB,SAAS,QAkExB"}
1
+ {"version":3,"file":"UpdateUrl.d.ts","sourceRoot":"","sources":["../src/components/UpdateUrl.tsx"],"names":[],"mappings":"AA6BA,wBAAgB,SAAS,QAyIxB"}
@@ -0,0 +1,6 @@
1
+ interface PropTypes {
2
+ messages: string[];
3
+ }
4
+ export declare function BalanceWarnings({ messages }: PropTypes): JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=BalanceWarnings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BalanceWarnings.d.ts","sourceRoot":"","sources":["../../src/components/warnings/BalanceWarnings.tsx"],"names":[],"mappings":"AAGA,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE,SAAS,eAQtD"}
@@ -0,0 +1,6 @@
1
+ interface PropTypes {
2
+ selectedSlippage: number;
3
+ }
4
+ export declare function ConfirmSwapExtraMessages(props: PropTypes): JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=ConfirmSwapExtraMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmSwapExtraMessages.d.ts","sourceRoot":"","sources":["../../src/components/warnings/ConfirmSwapExtraMessages.tsx"],"names":[],"mappings":"AAIA,UAAU,SAAS;IACjB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,eAKxD"}
@@ -0,0 +1,6 @@
1
+ interface PropTypes {
2
+ selectedSlippage: number;
3
+ }
4
+ export declare function HighSlippageWarning(props: PropTypes): JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=HighSlippageWarning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HighSlippageWarning.d.ts","sourceRoot":"","sources":["../../src/components/warnings/HighSlippageWarning.tsx"],"names":[],"mappings":"AAIA,UAAU,SAAS;IACjB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,eAYnD"}
@@ -0,0 +1,6 @@
1
+ interface PropTypes {
2
+ minRequiredSlippage: number | null;
3
+ }
4
+ export declare function MinRequiredSlippage({ minRequiredSlippage }: PropTypes): JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=MinRequiredSlippage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MinRequiredSlippage.d.ts","sourceRoot":"","sources":["../../src/components/warnings/MinRequiredSlippage.tsx"],"names":[],"mappings":"AAIA,UAAU,SAAS;IACjB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,EAAE,SAAS,eASrE"}
@@ -0,0 +1,6 @@
1
+ export declare const SLIPPAGES: number[];
2
+ export declare const DEFAULT_SLIPPAGE = 1;
3
+ export declare const HIGH_SLIPPAGE = 5;
4
+ export declare const MAX_SLIPPAGE = 100;
5
+ export declare const MIN_SLIPPGAE = 0;
6
+ //# sourceMappingURL=swapSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swapSettings.d.ts","sourceRoot":"","sources":["../src/constants/swapSettings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,UAA4B,CAAC;AAEnD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,eAAO,MAAM,YAAY,IAAI,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare function useNavigateBack(): {
2
+ navigateBackFrom: (currentRoute: string) => void;
3
+ };
4
+ //# sourceMappingURL=useNavigateBack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNavigateBack.d.ts","sourceRoot":"","sources":["../src/hooks/useNavigateBack.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe;qCAMW,MAAM;EA2B/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,gBAiB9B"}
1
+ {"version":3,"file":"ConfirmSwapPage.d.ts","sourceRoot":"","sources":["../src/pages/ConfirmSwapPage.tsx"],"names":[],"mappings":"AAWA,wBAAgB,eAAe,gBAkC9B"}
@@ -1,7 +1,2 @@
1
- import { SelectedWallet } from '../utils/wallets';
2
- export interface SelectableWallet extends SelectedWallet {
3
- image: string;
4
- selected: boolean;
5
- }
6
1
  export declare function ConfirmWalletsPage(): JSX.Element;
7
2
  //# sourceMappingURL=ConfirmWalletsPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmWalletsPage.d.ts","sourceRoot":"","sources":["../src/pages/ConfirmWalletsPage.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAoG,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKpJ,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,kBAAkB,gBA+CjC"}
1
+ {"version":3,"file":"ConfirmWalletsPage.d.ts","sourceRoot":"","sources":["../src/pages/ConfirmWalletsPage.tsx"],"names":[],"mappings":"AAmBA,wBAAgB,kBAAkB,gBA0DjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"HistoryPage.d.ts","sourceRoot":"","sources":["../src/pages/HistoryPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAM1E,eAAO,MAAM,WAAW,EAAE,WAAW,EA+yBpC,CAAC;AAEF,wBAAgB,WAAW,gBAW1B"}
1
+ {"version":3,"file":"HistoryPage.d.ts","sourceRoot":"","sources":["../src/pages/HistoryPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAO1E,eAAO,MAAM,WAAW,EAAE,WAAW,EA+yBpC,CAAC;AAEF,wBAAgB,WAAW,gBAU1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../src/pages/Home.tsx"],"names":[],"mappings":"AA8CA,wBAAgB,IAAI,gBAiInB"}
1
+ {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../src/pages/Home.tsx"],"names":[],"mappings":"AA6DA,wBAAgB,IAAI,gBA6JnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"LiquiditySourcesPage.d.ts","sourceRoot":"","sources":["../src/pages/LiquiditySourcesPage.tsx"],"names":[],"mappings":"AAOA,wBAAgB,mBAAmB,gBAyClC"}
1
+ {"version":3,"file":"LiquiditySourcesPage.d.ts","sourceRoot":"","sources":["../src/pages/LiquiditySourcesPage.tsx"],"names":[],"mappings":"AAQA,wBAAgB,mBAAmB,gBA2ClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectChainPage.d.ts","sourceRoot":"","sources":["../src/pages/SelectChainPage.tsx"],"names":[],"mappings":"AASA,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,eAgD/C"}
1
+ {"version":3,"file":"SelectChainPage.d.ts","sourceRoot":"","sources":["../src/pages/SelectChainPage.tsx"],"names":[],"mappings":"AAOA,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,eA+B/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectTokenPage.d.ts","sourceRoot":"","sources":["../src/pages/SelectTokenPage.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAQlC,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,gBAAiB,SAAQ,KAAK;IAC7C,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,eA2D/C"}
1
+ {"version":3,"file":"SelectTokenPage.d.ts","sourceRoot":"","sources":["../src/pages/SelectTokenPage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAUlC,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,gBAAiB,SAAQ,KAAK;IAC7C,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,eAqE/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../src/pages/SettingsPage.tsx"],"names":[],"mappings":"AAQA,wBAAgB,YAAY,gBAmD3B"}
1
+ {"version":3,"file":"SettingsPage.d.ts","sourceRoot":"","sources":["../src/pages/SettingsPage.tsx"],"names":[],"mappings":"AAcA,wBAAgB,YAAY,gBAwD3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"SwapDetailsPage.d.ts","sourceRoot":"","sources":["../src/pages/SwapDetailsPage.tsx"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,gBAG9B"}
1
+ {"version":3,"file":"SwapDetailsPage.d.ts","sourceRoot":"","sources":["../src/pages/SwapDetailsPage.tsx"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,gBAQ9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../src/pages/WalletsPage.tsx"],"names":[],"mappings":"AAmBA,wBAAgB,WAAW,gBA8C1B"}
1
+ {"version":3,"file":"WalletsPage.d.ts","sourceRoot":"","sources":["../src/pages/WalletsPage.tsx"],"names":[],"mappings":"AA2BA,wBAAgB,WAAW,gBAqD1B"}
@@ -1,2 +1,3 @@
1
1
  export declare const useBestRouteStore: any;
2
+ export declare const fetchBestRoute: () => void;
2
3
  //# sourceMappingURL=bestRoute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bestRoute.d.ts","sourceRoot":"","sources":["../src/store/bestRoute.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,iBAAiB,KAmD7B,CAAC"}
1
+ {"version":3,"file":"bestRoute.d.ts","sourceRoot":"","sources":["../src/store/bestRoute.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,iBAAiB,KAgE7B,CAAC;AAkGF,eAAO,MAAQ,cAAc,YAG5B,CAAC"}
@@ -0,0 +1,35 @@
1
+ export declare const useConfirmSwapStore: any;
2
+ export declare enum ConfirmSwapErrorTypes {
3
+ NO_ROUTE = 0,
4
+ ROUTE_UPDATED_WITH_HIGH_VALUE_LOSS = 1,
5
+ REQUEST_FAILED = 2,
6
+ INSUFFICIENT_SLIPPAGE = 3
7
+ }
8
+ export declare type ConfirmSwapError = {
9
+ type: ConfirmSwapErrorTypes.REQUEST_FAILED;
10
+ status?: number;
11
+ } | {
12
+ type: ConfirmSwapErrorTypes.INSUFFICIENT_SLIPPAGE;
13
+ minRequiredSlippage: number;
14
+ } | {
15
+ type: Exclude<ConfirmSwapErrorTypes, ConfirmSwapErrorTypes.REQUEST_FAILED | ConfirmSwapErrorTypes.INSUFFICIENT_SLIPPAGE>;
16
+ };
17
+ export declare type ConfirmSwapWarnings = {
18
+ type: ConfirmSwapWarningTypes.ROUTE_AND_OUTPUT_AMOUNT_UPDATED;
19
+ newOutputAmount: string;
20
+ percentageChange: string;
21
+ } | {
22
+ type: ConfirmSwapWarningTypes.INSUFFICIENT_BALANCE;
23
+ messages: string[];
24
+ } | {
25
+ type: Exclude<ConfirmSwapWarningTypes, ConfirmSwapWarningTypes.ROUTE_AND_OUTPUT_AMOUNT_UPDATED | ConfirmSwapWarningTypes.INSUFFICIENT_BALANCE>;
26
+ };
27
+ export declare enum ConfirmSwapWarningTypes {
28
+ ROUTE_UPDATED = 0,
29
+ ROUTE_SWAPPERS_UPDATED = 1,
30
+ ROUTE_COINS_UPDATED = 2,
31
+ ROUTE_AND_OUTPUT_AMOUNT_UPDATED = 3,
32
+ INSUFFICIENT_BALANCE = 4
33
+ }
34
+ export declare const confirmSwap: () => any;
35
+ //# sourceMappingURL=confirmSwap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirmSwap.d.ts","sourceRoot":"","sources":["../src/store/confirmSwap.ts"],"names":[],"mappings":"AAuCA,eAAO,MAAM,mBAAmB,KAS/B,CAAC;AAEF,oBAAY,qBAAqB;IAC/B,QAAQ,IAAA;IACR,kCAAkC,IAAA;IAClC,cAAc,IAAA;IACd,qBAAqB,IAAA;CACtB;AAED,oBAAY,gBAAgB,GACxB;IACE,IAAI,EAAE,qBAAqB,CAAC,cAAc,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,qBAAqB,CAAC,qBAAqB,CAAC;IAClD,mBAAmB,EAAE,MAAM,CAAC;CAC7B,GACD;IACE,IAAI,EAAE,OAAO,CACX,qBAAqB,EACnB,qBAAqB,CAAC,cAAc,GACpC,qBAAqB,CAAC,qBAAqB,CAC9C,CAAC;CACH,CAAC;AAEN,oBAAY,mBAAmB,GAC3B;IACE,IAAI,EAAE,uBAAuB,CAAC,+BAA+B,CAAC;IAC9D,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IAAE,IAAI,EAAE,uBAAuB,CAAC,oBAAoB,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GAC1E;IACE,IAAI,EAAE,OAAO,CACX,uBAAuB,EACrB,uBAAuB,CAAC,+BAA+B,GACvD,uBAAuB,CAAC,oBAAoB,CAC/C,CAAC;CACH,CAAC;AAEN,oBAAY,uBAAuB;IACjC,aAAa,IAAA;IACb,sBAAsB,IAAA;IACtB,mBAAmB,IAAA;IACnB,+BAA+B,IAAA;IAC/B,oBAAoB,IAAA;CACrB;AAED,eAAO,MAAM,WAAW,WAqOvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/store/settings.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,gBAAgB,KAiD5B,CAAC"}
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/store/settings.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,gBAAgB,KA4D5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const useUiStore: any;
2
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/store/ui.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,KAMtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/store/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAevD,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,oBAAY,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,OAAO;IACtB,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAYD,eAAO,MAAM,eAAe,KAyF3B,CAAC"}
1
+ {"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/store/wallets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAevD,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,oBAAY,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,OAAO;IACtB,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAYD,eAAO,MAAM,eAAe,KAqG3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './swap';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { SwapSavedSettings } from '@rango-dev/ui/dist/types/swaps';
2
+ export declare type PendingSwapSettings = Omit<SwapSavedSettings, 'disabledSwappersIds'>;
3
+ export declare type SwapButtonState = ({
4
+ disabled: true;
5
+ } | {
6
+ disabled: false;
7
+ hasWarning?: boolean;
8
+ }) & {
9
+ title: string;
10
+ };
11
+ //# sourceMappingURL=swap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../src/types/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,oBAAY,mBAAmB,GAAG,IAAI,CACpC,iBAAiB,EACjB,qBAAqB,CACtB,CAAC;AAEF,oBAAY,eAAe,GAAG,CAC1B;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,GAClB;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAC5C,GAAG;IACF,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export declare function removeDuplicateFrom<T>(array: T[]): T[];
2
+ export declare function areEqual(array1: (number | string)[], array2: (number | string)[]): boolean;
2
3
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/utils/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtD"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/utils/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtD;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAEhF"}
@@ -1,4 +1,5 @@
1
1
  import { BigNumber } from 'bignumber.js';
2
+ import { BestRouteResponse } from 'rango-sdk';
2
3
  export declare const percentToString: (p: number, fractions?: number) => string;
3
4
  export declare const secondsToString: (s: number) => string;
4
5
  export declare const numberToString: (number: BigNumber | string | null, minDecimals?: number | null, maxDecimals?: number | null) => string;
@@ -6,4 +7,8 @@ export declare const convertBigNumberToHex: (value: BigNumber, decimals: number)
6
7
  export declare const uint8ArrayToHex: (buffer: Uint8Array) => string;
7
8
  export declare function dollarToConciseString(num: number | undefined): string;
8
9
  export declare function removeExtraDecimals(num: string, maxDecimals: number): string;
10
+ export declare const totalArrivalTime: (data: BestRouteResponse | null) => number;
11
+ export declare const rawFees: (data: BestRouteResponse) => string;
12
+ export declare const decimalNumber: (number: string, toFixed: number) => string;
13
+ export declare const containsText: (text: string, searchText: string) => boolean;
9
14
  //# sourceMappingURL=numbers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../src/utils/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,MAAO,MAAM,yBAAkB,MAAsC,CAAC;AAClG,eAAO,MAAM,eAAe,MAAO,MAAM,KAAG,MAM3C,CAAC;AAEF,eAAO,MAAM,cAAc,WACjB,SAAS,GAAG,MAAM,GAAG,IAAI,gBACpB,MAAM,GAAG,IAAI,gBACb,MAAM,GAAG,IAAI,KACzB,MA8CF,CAAC;AAEF,eAAO,MAAM,qBAAqB,UAAW,SAAS,YAAY,MAAM,KAAG,MAE1E,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,UAAU,KAAG,MAGpD,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQrE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAW5E"}
1
+ {"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../src/utils/numbers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,eAAO,MAAM,eAAe,MAAO,MAAM,yBAAkB,MAAsC,CAAC;AAClG,eAAO,MAAM,eAAe,MAAO,MAAM,KAAG,MAM3C,CAAC;AAEF,eAAO,MAAM,cAAc,WACjB,SAAS,GAAG,MAAM,GAAG,IAAI,gBACpB,MAAM,GAAG,IAAI,gBACb,MAAM,GAAG,IAAI,KACzB,MA8CF,CAAC;AAEF,eAAO,MAAM,qBAAqB,UAAW,SAAS,YAAY,MAAM,KAAG,MAE1E,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,UAAU,KAAG,MAGpD,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQrE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAW5E;AAED,eAAO,MAAM,gBAAgB,SAAU,iBAAiB,GAAG,IAAI,WACc,CAAC;AAE9E,eAAO,MAAM,OAAO,SAAU,iBAAiB,KAAG,MAMnC,CAAC;AAEhB,eAAO,MAAM,aAAa,4BAA2B,MAAM,WAAwC,CAAC;AAEpG,eAAO,MAAM,YAAY,SAAU,MAAM,cAAc,MAAM,YACF,CAAC"}
@@ -3,12 +3,10 @@ import BigNumber from 'bignumber.js';
3
3
  import { BestRouteResponse } from 'rango-sdk';
4
4
  import { SelectedWallet } from './wallets';
5
5
  export declare const getBestRouteToTokenUsdPrice: (bestRoute: BestRouteResponse | null) => number | null | undefined;
6
- export declare type RouteChangeStatus = {
7
- isChanged: boolean;
8
- warningMessage?: string;
9
- };
10
- export declare const compareRoutes: (route1: BestRouteResponse, route2: BestRouteResponse, inputAmount: string, fromTokenUsdPrice: number | null, toTokenUsdPrice: number | null) => RouteChangeStatus;
11
- export declare const getOutToInRatio: (fromUsdValue: BigNumber | null, toUsdValue: BigNumber | null) => BigNumber | 0;
6
+ export declare function isNumberOfSwapsChanged(route1: BestRouteResponse, route2: BestRouteResponse): boolean;
7
+ export declare function isRouteSwappersUpdated(route1: BestRouteResponse, route2: BestRouteResponse): boolean;
8
+ export declare function isRouteInternalCoinsUpdated(route1: BestRouteResponse, route2: BestRouteResponse): boolean;
9
+ export declare const isRouteChanged: (route1: BestRouteResponse, route2: BestRouteResponse) => boolean;
12
10
  export declare const outToRatioHasWarning: (fromUsdValue: BigNumber | null, outToInRatio: BigNumber | 0) => boolean;
13
- export declare const getRequiredBalanceOfWallet: (wallet: SelectedWallet, fee: SimulationValidationStatus[] | null) => SimulationAssetAndAmount[] | null;
11
+ export declare const getRequiredBalanceOfWallet: (selectedWallet: SelectedWallet, fee: SimulationValidationStatus[] | null) => SimulationAssetAndAmount[] | null;
14
12
  //# sourceMappingURL=routing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../src/utils/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,eAAO,MAAM,2BAA2B,cAC3B,iBAAiB,GAAG,IAAI,KAClC,MAAM,GAAG,IAAI,GAAG,SACwD,CAAC;AAE5E,oBAAY,iBAAiB,GAAG;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,aAAa,WAChB,iBAAiB,UACjB,iBAAiB,eACZ,MAAM,qBACA,MAAM,GAAG,IAAI,mBACf,MAAM,GAAG,IAAI,KAC7B,iBAwDF,CAAC;AAEF,eAAO,MAAM,eAAe,iBAAkB,SAAS,GAAG,IAAI,cAAc,SAAS,GAAG,IAAI,kBAK/B,CAAC;AAE9D,eAAO,MAAM,oBAAoB,iBAAkB,SAAS,GAAG,IAAI,gBAAgB,SAAS,GAAG,CAAC,YAI3B,CAAC;AAEtE,eAAO,MAAM,0BAA0B,WAC7B,cAAc,OACjB,0BAA0B,EAAE,GAAG,IAAI,KACvC,wBAAwB,EAAE,GAAG,IAO/B,CAAC"}
1
+ {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../src/utils/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,eAAO,MAAM,2BAA2B,cAC3B,iBAAiB,GAAG,IAAI,KAClC,MAAM,GAAG,IAAI,GAAG,SACwD,CAAC;AAE5E,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,WAI1F;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,WAI1F;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,WAI/F;AAED,eAAO,MAAM,cAAc,WAAY,iBAAiB,UAAU,iBAAiB,KAAG,OAMrF,CAAC;AAEF,eAAO,MAAM,oBAAoB,iBAAkB,SAAS,GAAG,IAAI,gBAAgB,SAAS,GAAG,CAAC,YAI3B,CAAC;AAEtE,eAAO,MAAM,0BAA0B,mBACrB,cAAc,OACzB,0BAA0B,EAAE,GAAG,IAAI,KACvC,wBAAwB,EAAE,GAAG,IAS/B,CAAC"}
@@ -1,15 +1,43 @@
1
1
  import { PendingSwap } from '@rango-dev/ui/dist/containers/History/types';
2
2
  import { WalletTypeAndAddress, SwapSavedSettings } from '@rango-dev/ui/dist/types/swaps';
3
3
  import BigNumber from 'bignumber.js';
4
- import { BestRouteResponse } from 'rango-sdk';
4
+ import { BestRouteRequest, BestRouteResponse, RecommendedSlippage, SwapResult, MetaResponse, Token } from 'rango-sdk';
5
5
  import { Account } from '../store/wallets';
6
+ import { WalletType } from '@rango-dev/wallets-shared';
7
+ import { SelectedWallet } from './wallets';
8
+ import { SwapButtonState } from '../types';
9
+ import { LoadingStatus } from '../store/meta';
6
10
  export declare function getOutputRatio(inputUsdValue: BigNumber, outputUsdValue: BigNumber): BigNumber | 0;
7
11
  export declare function outputRatioHasWarning(inputUsdValue: BigNumber, outputRatio: BigNumber | 0): boolean;
8
12
  export declare function hasLimitError(bestRoute: BestRouteResponse | null): boolean;
9
- export declare function getSwapButtonTitle(accounts: Account[], loading: boolean, hasLimitError: boolean, highValueLoss: boolean, priceImpactCanNotBeComputed: boolean, needsToWarnEthOnPath: boolean): string;
13
+ export declare function LimitErrorMessage(bestRoute: BestRouteResponse | null): {
14
+ swap: SwapResult | null;
15
+ fromAmountRangeError: string;
16
+ recommendation: string;
17
+ };
18
+ export declare function getSwapButtonState(loadingMetaStatus: LoadingStatus, accounts: Account[], loading: boolean, bestRoute: BestRouteResponse | null, hasLimitError: boolean, highValueLoss: boolean, priceImpactCanNotBeComputed: boolean, needsToWarnEthOnPath: boolean): SwapButtonState;
10
19
  export declare function canComputePriceImpact(bestRoute: BestRouteResponse | null, inputAmount: string, inputUsdValue: BigNumber, outputUsdValue: BigNumber): boolean;
11
20
  export declare function calculatePendingSwap(inputAmount: string, bestRoute: BestRouteResponse, wallets: {
12
21
  [p: string]: WalletTypeAndAddress;
13
- }, settings: SwapSavedSettings, validateBalanceOrFee: boolean): PendingSwap;
22
+ }, settings: Omit<SwapSavedSettings, 'disabledSwappersIds'>, validateBalanceOrFee: boolean, meta: MetaResponse): PendingSwap;
14
23
  export declare function requiredWallets(route: BestRouteResponse | null): string[];
24
+ export declare const getUsdPrice: (blockchain: string, symbol: string, address: string | null, allTokens: Token[]) => number | null;
25
+ export declare function getTotalFeeInUsd(bestRoute: BestRouteResponse | null, allTokens: Token[]): BigNumber | null;
26
+ export declare function hasHighFee(totalFeeInUsd: BigNumber | null): boolean;
27
+ export declare function hasSlippageError(slippages: (RecommendedSlippage | null)[] | undefined): boolean;
28
+ export declare function getMinRequiredSlippage(route: BestRouteResponse): number;
29
+ export declare function hasProperSlippage(userSlippage: string, minRequiredSlippage: number | null): boolean;
30
+ export declare function hasEnoughBalance(route: BestRouteResponse, selectedWallets: SelectedWallet[]): boolean;
31
+ export declare function hasEnoughBalanceAndProperSlippage(route: BestRouteResponse, selectedWallets: SelectedWallet[], userSlippage: string, minRequiredSlippage: number | null): boolean;
32
+ export declare function createBestRouteRequestBody(fromToken: Token, toToken: Token, inputAmount: string, wallets: Account[], selectedWallets: SelectedWallet[], disabledLiquiditySources: string[], slippage: number, checkPrerequisites: boolean): BestRouteRequest;
33
+ export declare function getWalletsForNewSwap(selectedWallets: SelectedWallet[]): {
34
+ [p: string]: {
35
+ address: string;
36
+ walletType: WalletType;
37
+ };
38
+ };
39
+ export declare function getRouteOutputAmount(route: BestRouteResponse): string;
40
+ export declare function getPercentageChange(oldValue: string | number, newValue: string | number): BigNumber;
41
+ export declare function isOutputAmountChangedALot(oldRoute: BestRouteResponse, newRoute: BestRouteResponse): boolean;
42
+ export declare function getBalanceWarnings(route: BestRouteResponse, selectedWallets: SelectedWallet[]): string[];
15
43
  //# sourceMappingURL=swap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../src/utils/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,wBAAgB,cAAc,CAAC,aAAa,EAAE,SAAS,EAAE,cAA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;;iBAItC,MAAM;oBAAc,UAAU;;EAc7D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,UAE5D;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,QAAQ,EAAE,MAAM,GAAG,MAAM,aAM1B;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,iBAAiB,WAW5B;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,iBAAiB,EACxB,eAAe,EAAE,cAAc,EAAE,YAkClC"}
@@ -1,7 +1,6 @@
1
1
  import { Network, WalletInfo, WalletState, WalletType } from '@rango-dev/wallets-shared';
2
- import { WalletInfo as ModalWalletInfo, WalletState as WalletStatus } from '@rango-dev/ui';
2
+ import { WalletInfo as ModalWalletInfo, WalletState as WalletStatus, SelectableWallet } from '@rango-dev/ui';
3
3
  import { BestRouteResponse, BlockchainMeta, Token, WalletDetail } from 'rango-sdk';
4
- import { SelectableWallet } from '../pages/ConfirmWalletsPage';
5
4
  import { Account, Balance, TokenBalance } from '../store/wallets';
6
5
  import { TokenWithBalance } from '../pages/SelectTokenPage';
7
6
  export declare function getStateWallet(state: WalletState): WalletStatus;
@@ -12,7 +11,7 @@ export declare function prepareAccountsForWalletStore(wallet: WalletType, accoun
12
11
  export declare function getRequiredChains(route: BestRouteResponse | null): string[];
13
12
  export interface SelectedWallet extends Account {
14
13
  }
15
- export declare function getSelectableWallets(accounts: Account[], selectedWallets: SelectedWallet[], getWalletInfo: (type: WalletType) => WalletInfo, requiredChains?: string[]): SelectableWallet[];
14
+ export declare function getSelectableWallets(accounts: Account[], selectedWallets: SelectedWallet[], getWalletInfo: (type: WalletType) => WalletInfo): SelectableWallet[];
16
15
  export declare function getBalanceFromWallet(balances: Balance[], chain: string, symbol: string, address: string | null): TokenBalance | null;
17
16
  export declare function isAccountAndBalanceMatched(account: Account, balance: Balance): boolean;
18
17
  export declare function makeBalanceFor(account: Account, retrivedBalance: WalletDetail, tokens: Token[]): Balance;
@@ -1 +1 @@
1
- {"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EAEX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,UAAU,IAAI,eAAe,EAC7B,WAAW,IAAI,YAAY,EAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,YAAY,EACb,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAW/D;AAED,eAAO,MAAM,eAAe,cAI3B,CAAC;AAEF,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,WAAW,EAC3C,aAAa,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,EAC/C,IAAI,EAAE,UAAU,EAAE,GACjB,eAAe,EAAE,CAoBnB;AAED,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,cAAc,EAAE,GAChC,OAAO,EAAE,GAAG,IAAI,CAQlB;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,EAAE,EAClB,cAAc,EAAE,MAAM,EAAE,EACxB,mBAAmB,EAAE,OAAO,EAAE,GAAG,IAAI,GACpC,OAAO,EAAE,CAyDX;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,YAchE;AAED,MAAM,WAAW,cAAe,SAAQ,OAAO;CAAG;A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