@uniswap/router-sdk 2.0.0 → 2.0.2

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 (176) hide show
  1. package/dist/{cjs/src/approveAndCall.d.ts → approveAndCall.d.ts} +33 -33
  2. package/dist/{types/src/constants.d.ts → constants.d.ts} +13 -13
  3. package/dist/{types/src/entities → entities}/mixedRoute/route.d.ts +29 -29
  4. package/dist/{esm/src/entities → entities}/mixedRoute/trade.d.ts +183 -183
  5. package/dist/{cjs/src/entities → entities}/protocol.d.ts +6 -6
  6. package/dist/{esm/src/entities → entities}/route.d.ts +40 -40
  7. package/dist/{esm/src/entities → entities}/trade.d.ts +127 -127
  8. package/dist/{cjs/src/index.d.ts → index.d.ts} +14 -14
  9. package/dist/index.js +8 -0
  10. package/dist/{cjs/src/multicallExtended.d.ts → multicallExtended.d.ts} +11 -11
  11. package/dist/{types/src/paymentsExtended.d.ts → paymentsExtended.d.ts} +15 -15
  12. package/dist/router-sdk.cjs.development.js +2460 -0
  13. package/dist/router-sdk.cjs.development.js.map +1 -0
  14. package/dist/router-sdk.cjs.production.min.js +2 -0
  15. package/dist/router-sdk.cjs.production.min.js.map +1 -0
  16. package/dist/router-sdk.esm.js +2427 -0
  17. package/dist/router-sdk.esm.js.map +1 -0
  18. package/dist/{cjs/src/swapRouter.d.ts → swapRouter.d.ts} +95 -95
  19. package/dist/{cjs/src/utils → utils}/TPool.d.ts +4 -4
  20. package/dist/{cjs/src/utils → utils}/encodeMixedRouteToPath.d.ts +9 -9
  21. package/dist/{types/src/utils → utils}/index.d.ts +16 -16
  22. package/dist/{cjs/src/utils → utils}/pathCurrency.d.ts +4 -4
  23. package/package.json +18 -33
  24. package/dist/cjs/src/approveAndCall.js +0 -111
  25. package/dist/cjs/src/approveAndCall.js.map +0 -1
  26. package/dist/cjs/src/constants.d.ts +0 -13
  27. package/dist/cjs/src/constants.js +0 -22
  28. package/dist/cjs/src/constants.js.map +0 -1
  29. package/dist/cjs/src/entities/mixedRoute/route.d.ts +0 -29
  30. package/dist/cjs/src/entities/mixedRoute/route.js +0 -119
  31. package/dist/cjs/src/entities/mixedRoute/route.js.map +0 -1
  32. package/dist/cjs/src/entities/mixedRoute/route.test.d.ts +0 -1
  33. package/dist/cjs/src/entities/mixedRoute/route.test.js +0 -469
  34. package/dist/cjs/src/entities/mixedRoute/route.test.js.map +0 -1
  35. package/dist/cjs/src/entities/mixedRoute/trade.d.ts +0 -183
  36. package/dist/cjs/src/entities/mixedRoute/trade.js +0 -357
  37. package/dist/cjs/src/entities/mixedRoute/trade.js.map +0 -1
  38. package/dist/cjs/src/entities/mixedRoute/trade.test.d.ts +0 -1
  39. package/dist/cjs/src/entities/mixedRoute/trade.test.js +0 -1010
  40. package/dist/cjs/src/entities/mixedRoute/trade.test.js.map +0 -1
  41. package/dist/cjs/src/entities/protocol.js +0 -11
  42. package/dist/cjs/src/entities/protocol.js.map +0 -1
  43. package/dist/cjs/src/entities/route.d.ts +0 -40
  44. package/dist/cjs/src/entities/route.js +0 -63
  45. package/dist/cjs/src/entities/route.js.map +0 -1
  46. package/dist/cjs/src/entities/route.test.d.ts +0 -1
  47. package/dist/cjs/src/entities/route.test.js +0 -192
  48. package/dist/cjs/src/entities/route.test.js.map +0 -1
  49. package/dist/cjs/src/entities/trade.d.ts +0 -127
  50. package/dist/cjs/src/entities/trade.js +0 -366
  51. package/dist/cjs/src/entities/trade.js.map +0 -1
  52. package/dist/cjs/src/entities/trade.test.d.ts +0 -1
  53. package/dist/cjs/src/entities/trade.test.js +0 -1267
  54. package/dist/cjs/src/entities/trade.test.js.map +0 -1
  55. package/dist/cjs/src/index.js +0 -18
  56. package/dist/cjs/src/index.js.map +0 -1
  57. package/dist/cjs/src/multicallExtended.js +0 -43
  58. package/dist/cjs/src/multicallExtended.js.map +0 -1
  59. package/dist/cjs/src/multicallExtended.test.d.ts +0 -1
  60. package/dist/cjs/src/multicallExtended.test.js +0 -22
  61. package/dist/cjs/src/multicallExtended.test.js.map +0 -1
  62. package/dist/cjs/src/paymentsExtended.d.ts +0 -15
  63. package/dist/cjs/src/paymentsExtended.js +0 -65
  64. package/dist/cjs/src/paymentsExtended.js.map +0 -1
  65. package/dist/cjs/src/paymentsExtended.test.d.ts +0 -1
  66. package/dist/cjs/src/paymentsExtended.test.js +0 -60
  67. package/dist/cjs/src/paymentsExtended.test.js.map +0 -1
  68. package/dist/cjs/src/swapRouter.js +0 -439
  69. package/dist/cjs/src/swapRouter.js.map +0 -1
  70. package/dist/cjs/src/swapRouter.test.d.ts +0 -1
  71. package/dist/cjs/src/swapRouter.test.js +0 -1161
  72. package/dist/cjs/src/swapRouter.test.js.map +0 -1
  73. package/dist/cjs/src/utils/TPool.js +0 -3
  74. package/dist/cjs/src/utils/TPool.js.map +0 -1
  75. package/dist/cjs/src/utils/encodeMixedRouteToPath.js +0 -90
  76. package/dist/cjs/src/utils/encodeMixedRouteToPath.js.map +0 -1
  77. package/dist/cjs/src/utils/encodeMixedRouteToPath.test.d.ts +0 -1
  78. package/dist/cjs/src/utils/encodeMixedRouteToPath.test.js +0 -136
  79. package/dist/cjs/src/utils/encodeMixedRouteToPath.test.js.map +0 -1
  80. package/dist/cjs/src/utils/index.d.ts +0 -16
  81. package/dist/cjs/src/utils/index.js +0 -51
  82. package/dist/cjs/src/utils/index.js.map +0 -1
  83. package/dist/cjs/src/utils/pathCurrency.js +0 -35
  84. package/dist/cjs/src/utils/pathCurrency.js.map +0 -1
  85. package/dist/cjs/src/utils/pathCurrency.test.d.ts +0 -1
  86. package/dist/cjs/src/utils/pathCurrency.test.js +0 -17
  87. package/dist/cjs/src/utils/pathCurrency.test.js.map +0 -1
  88. package/dist/esm/src/approveAndCall.d.ts +0 -33
  89. package/dist/esm/src/approveAndCall.js +0 -105
  90. package/dist/esm/src/approveAndCall.js.map +0 -1
  91. package/dist/esm/src/constants.d.ts +0 -13
  92. package/dist/esm/src/constants.js +0 -18
  93. package/dist/esm/src/constants.js.map +0 -1
  94. package/dist/esm/src/entities/mixedRoute/route.d.ts +0 -29
  95. package/dist/esm/src/entities/mixedRoute/route.js +0 -114
  96. package/dist/esm/src/entities/mixedRoute/route.js.map +0 -1
  97. package/dist/esm/src/entities/mixedRoute/route.test.d.ts +0 -1
  98. package/dist/esm/src/entities/mixedRoute/route.test.js +0 -467
  99. package/dist/esm/src/entities/mixedRoute/route.test.js.map +0 -1
  100. package/dist/esm/src/entities/mixedRoute/trade.js +0 -352
  101. package/dist/esm/src/entities/mixedRoute/trade.js.map +0 -1
  102. package/dist/esm/src/entities/mixedRoute/trade.test.d.ts +0 -1
  103. package/dist/esm/src/entities/mixedRoute/trade.test.js +0 -1008
  104. package/dist/esm/src/entities/mixedRoute/trade.test.js.map +0 -1
  105. package/dist/esm/src/entities/protocol.d.ts +0 -6
  106. package/dist/esm/src/entities/protocol.js +0 -8
  107. package/dist/esm/src/entities/protocol.js.map +0 -1
  108. package/dist/esm/src/entities/route.js +0 -55
  109. package/dist/esm/src/entities/route.js.map +0 -1
  110. package/dist/esm/src/entities/route.test.d.ts +0 -1
  111. package/dist/esm/src/entities/route.test.js +0 -190
  112. package/dist/esm/src/entities/route.test.js.map +0 -1
  113. package/dist/esm/src/entities/trade.js +0 -362
  114. package/dist/esm/src/entities/trade.js.map +0 -1
  115. package/dist/esm/src/entities/trade.test.d.ts +0 -1
  116. package/dist/esm/src/entities/trade.test.js +0 -1265
  117. package/dist/esm/src/entities/trade.test.js.map +0 -1
  118. package/dist/esm/src/index.d.ts +0 -14
  119. package/dist/esm/src/index.js +0 -15
  120. package/dist/esm/src/index.js.map +0 -1
  121. package/dist/esm/src/multicallExtended.d.ts +0 -11
  122. package/dist/esm/src/multicallExtended.js +0 -39
  123. package/dist/esm/src/multicallExtended.js.map +0 -1
  124. package/dist/esm/src/multicallExtended.test.d.ts +0 -1
  125. package/dist/esm/src/multicallExtended.test.js +0 -20
  126. package/dist/esm/src/multicallExtended.test.js.map +0 -1
  127. package/dist/esm/src/paymentsExtended.d.ts +0 -15
  128. package/dist/esm/src/paymentsExtended.js +0 -61
  129. package/dist/esm/src/paymentsExtended.js.map +0 -1
  130. package/dist/esm/src/paymentsExtended.test.d.ts +0 -1
  131. package/dist/esm/src/paymentsExtended.test.js +0 -57
  132. package/dist/esm/src/paymentsExtended.test.js.map +0 -1
  133. package/dist/esm/src/swapRouter.d.ts +0 -95
  134. package/dist/esm/src/swapRouter.js +0 -434
  135. package/dist/esm/src/swapRouter.js.map +0 -1
  136. package/dist/esm/src/swapRouter.test.d.ts +0 -1
  137. package/dist/esm/src/swapRouter.test.js +0 -1159
  138. package/dist/esm/src/swapRouter.test.js.map +0 -1
  139. package/dist/esm/src/utils/TPool.d.ts +0 -4
  140. package/dist/esm/src/utils/TPool.js +0 -2
  141. package/dist/esm/src/utils/TPool.js.map +0 -1
  142. package/dist/esm/src/utils/encodeMixedRouteToPath.d.ts +0 -9
  143. package/dist/esm/src/utils/encodeMixedRouteToPath.js +0 -86
  144. package/dist/esm/src/utils/encodeMixedRouteToPath.js.map +0 -1
  145. package/dist/esm/src/utils/encodeMixedRouteToPath.test.d.ts +0 -1
  146. package/dist/esm/src/utils/encodeMixedRouteToPath.test.js +0 -134
  147. package/dist/esm/src/utils/encodeMixedRouteToPath.test.js.map +0 -1
  148. package/dist/esm/src/utils/index.d.ts +0 -16
  149. package/dist/esm/src/utils/index.js +0 -46
  150. package/dist/esm/src/utils/index.js.map +0 -1
  151. package/dist/esm/src/utils/pathCurrency.d.ts +0 -4
  152. package/dist/esm/src/utils/pathCurrency.js +0 -30
  153. package/dist/esm/src/utils/pathCurrency.js.map +0 -1
  154. package/dist/esm/src/utils/pathCurrency.test.d.ts +0 -1
  155. package/dist/esm/src/utils/pathCurrency.test.js +0 -15
  156. package/dist/esm/src/utils/pathCurrency.test.js.map +0 -1
  157. package/dist/types/src/approveAndCall.d.ts +0 -33
  158. package/dist/types/src/entities/mixedRoute/route.test.d.ts +0 -1
  159. package/dist/types/src/entities/mixedRoute/trade.d.ts +0 -183
  160. package/dist/types/src/entities/mixedRoute/trade.test.d.ts +0 -1
  161. package/dist/types/src/entities/protocol.d.ts +0 -6
  162. package/dist/types/src/entities/route.d.ts +0 -40
  163. package/dist/types/src/entities/route.test.d.ts +0 -1
  164. package/dist/types/src/entities/trade.d.ts +0 -127
  165. package/dist/types/src/entities/trade.test.d.ts +0 -1
  166. package/dist/types/src/index.d.ts +0 -14
  167. package/dist/types/src/multicallExtended.d.ts +0 -11
  168. package/dist/types/src/multicallExtended.test.d.ts +0 -1
  169. package/dist/types/src/paymentsExtended.test.d.ts +0 -1
  170. package/dist/types/src/swapRouter.d.ts +0 -95
  171. package/dist/types/src/swapRouter.test.d.ts +0 -1
  172. package/dist/types/src/utils/TPool.d.ts +0 -4
  173. package/dist/types/src/utils/encodeMixedRouteToPath.d.ts +0 -9
  174. package/dist/types/src/utils/encodeMixedRouteToPath.test.d.ts +0 -1
  175. package/dist/types/src/utils/pathCurrency.d.ts +0 -4
  176. package/dist/types/src/utils/pathCurrency.test.d.ts +0 -1
@@ -1,127 +1,127 @@
1
- import { Currency, CurrencyAmount, Percent, Price, TradeType } from '@uniswap/sdk-core';
2
- import { Pair, Route as V2RouteSDK } from '@uniswap/v2-sdk';
3
- import { Pool as V3Pool, Route as V3RouteSDK } from '@uniswap/v3-sdk';
4
- import { Pool as V4Pool, Route as V4RouteSDK } from '@uniswap/v4-sdk';
5
- import { MixedRouteSDK } from './mixedRoute/route';
6
- import { IRoute } from './route';
7
- export declare class Trade<TInput extends Currency, TOutput extends Currency, TTradeType extends TradeType> {
8
- readonly routes: IRoute<TInput, TOutput, Pair | V3Pool | V4Pool>[];
9
- readonly tradeType: TTradeType;
10
- private _outputAmount;
11
- private _inputAmount;
12
- private _nativeInputRoutes;
13
- private _wethInputRoutes;
14
- /**
15
- * The swaps of the trade, i.e. which routes and how much is swapped in each that
16
- * make up the trade. May consist of swaps in v2 or v3.
17
- */
18
- readonly swaps: {
19
- route: IRoute<TInput, TOutput, Pair | V3Pool | V4Pool>;
20
- inputAmount: CurrencyAmount<TInput>;
21
- outputAmount: CurrencyAmount<TOutput>;
22
- }[];
23
- constructor({ v2Routes, v3Routes, v4Routes, mixedRoutes, tradeType, }: {
24
- v2Routes?: {
25
- routev2: V2RouteSDK<TInput, TOutput>;
26
- inputAmount: CurrencyAmount<TInput>;
27
- outputAmount: CurrencyAmount<TOutput>;
28
- }[];
29
- v3Routes?: {
30
- routev3: V3RouteSDK<TInput, TOutput>;
31
- inputAmount: CurrencyAmount<TInput>;
32
- outputAmount: CurrencyAmount<TOutput>;
33
- }[];
34
- v4Routes?: {
35
- routev4: V4RouteSDK<TInput, TOutput>;
36
- inputAmount: CurrencyAmount<TInput>;
37
- outputAmount: CurrencyAmount<TOutput>;
38
- }[];
39
- mixedRoutes?: {
40
- mixedRoute: MixedRouteSDK<TInput, TOutput>;
41
- inputAmount: CurrencyAmount<TInput>;
42
- outputAmount: CurrencyAmount<TOutput>;
43
- }[];
44
- tradeType: TTradeType;
45
- });
46
- get inputAmount(): CurrencyAmount<TInput>;
47
- get outputAmount(): CurrencyAmount<TOutput>;
48
- /**
49
- * Returns the sum of all swaps within the trade
50
- * @returns
51
- * inputAmount: total input amount
52
- * inputAmountNative: total amount of native currency required for ETH input paths
53
- * - 0 if inputAmount is native but no native input paths
54
- * - undefined if inputAmount is not native
55
- * outputAmount: total output amount
56
- * outputAmountNative: total amount of native currency returned from ETH output paths
57
- * - 0 if outputAmount is native but no native output paths
58
- * - undefined if outputAmount is not native
59
- */
60
- get amounts(): {
61
- inputAmount: CurrencyAmount<TInput>;
62
- inputAmountNative: CurrencyAmount<TInput> | undefined;
63
- outputAmount: CurrencyAmount<TOutput>;
64
- outputAmountNative: CurrencyAmount<TOutput> | undefined;
65
- };
66
- get numberOfInputWraps(): number;
67
- get numberOfInputUnwraps(): number;
68
- get nativeInputRoutes(): IRoute<TInput, TOutput, Pair | V3Pool | V4Pool>[];
69
- get wethInputRoutes(): IRoute<TInput, TOutput, Pair | V3Pool | V4Pool>[];
70
- private _executionPrice;
71
- /**
72
- * The price expressed in terms of output amount/input amount.
73
- */
74
- get executionPrice(): Price<TInput, TOutput>;
75
- /**
76
- * Returns the sell tax of the input token
77
- */
78
- get inputTax(): Percent;
79
- /**
80
- * Returns the buy tax of the output token
81
- */
82
- get outputTax(): Percent;
83
- private isWrappedNative;
84
- /**
85
- * The cached result of the price impact computation
86
- * @private
87
- */
88
- private _priceImpact;
89
- /**
90
- * Returns the percent difference between the route's mid price and the expected execution price
91
- * In order to exclude token taxes from the price impact calculation, the spot price is calculated
92
- * using a ratio of values that go into the pools, which are the post-tax input amount and pre-tax output amount.
93
- */
94
- get priceImpact(): Percent;
95
- /**
96
- * Get the minimum amount that must be received from this trade for the given slippage tolerance
97
- * @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade
98
- * @returns The amount out
99
- */
100
- minimumAmountOut(slippageTolerance: Percent, amountOut?: CurrencyAmount<TOutput>): CurrencyAmount<TOutput>;
101
- /**
102
- * Get the maximum amount in that can be spent via this trade for the given slippage tolerance
103
- * @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade
104
- * @returns The amount in
105
- */
106
- maximumAmountIn(slippageTolerance: Percent, amountIn?: CurrencyAmount<TInput>): CurrencyAmount<TInput>;
107
- /**
108
- * Return the execution price after accounting for slippage tolerance
109
- * @param slippageTolerance the allowed tolerated slippage
110
- * @returns The execution price
111
- */
112
- worstExecutionPrice(slippageTolerance: Percent): Price<TInput, TOutput>;
113
- static fromRoutes<TInput extends Currency, TOutput extends Currency, TTradeType extends TradeType>(v2Routes: {
114
- routev2: V2RouteSDK<TInput, TOutput>;
115
- amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>;
116
- }[], v3Routes: {
117
- routev3: V3RouteSDK<TInput, TOutput>;
118
- amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>;
119
- }[], tradeType: TTradeType, mixedRoutes?: {
120
- mixedRoute: MixedRouteSDK<TInput, TOutput>;
121
- amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>;
122
- }[], v4Routes?: {
123
- routev4: V4RouteSDK<TInput, TOutput>;
124
- amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>;
125
- }[]): Promise<Trade<TInput, TOutput, TTradeType>>;
126
- static fromRoute<TInput extends Currency, TOutput extends Currency, TTradeType extends TradeType>(route: V2RouteSDK<TInput, TOutput> | V3RouteSDK<TInput, TOutput> | V4RouteSDK<TInput, TOutput> | MixedRouteSDK<TInput, TOutput>, amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>, tradeType: TTradeType): Promise<Trade<TInput, TOutput, TTradeType>>;
127
- }
1
+ import { Currency, CurrencyAmount, Percent, Price, TradeType } from '@uniswap/sdk-core';
2
+ import { Pair, Route as V2RouteSDK } from '@uniswap/v2-sdk';
3
+ import { Pool as V3Pool, Route as V3RouteSDK } from '@uniswap/v3-sdk';
4
+ import { Pool as V4Pool, Route as V4RouteSDK } from '@uniswap/v4-sdk';
5
+ import { MixedRouteSDK } from './mixedRoute/route';
6
+ import { IRoute } from './route';
7
+ export declare class Trade<TInput extends Currency, TOutput extends Currency, TTradeType extends TradeType> {
8
+ readonly routes: IRoute<TInput, TOutput, Pair | V3Pool | V4Pool>[];
9
+ readonly tradeType: TTradeType;
10
+ private _outputAmount;
11
+ private _inputAmount;
12
+ private _nativeInputRoutes;
13
+ private _wethInputRoutes;
14
+ /**
15
+ * The swaps of the trade, i.e. which routes and how much is swapped in each that
16
+ * make up the trade. May consist of swaps in v2 or v3.
17
+ */
18
+ readonly swaps: {
19
+ route: IRoute<TInput, TOutput, Pair | V3Pool | V4Pool>;
20
+ inputAmount: CurrencyAmount<TInput>;
21
+ outputAmount: CurrencyAmount<TOutput>;
22
+ }[];
23
+ constructor({ v2Routes, v3Routes, v4Routes, mixedRoutes, tradeType, }: {
24
+ v2Routes?: {
25
+ routev2: V2RouteSDK<TInput, TOutput>;
26
+ inputAmount: CurrencyAmount<TInput>;
27
+ outputAmount: CurrencyAmount<TOutput>;
28
+ }[];
29
+ v3Routes?: {
30
+ routev3: V3RouteSDK<TInput, TOutput>;
31
+ inputAmount: CurrencyAmount<TInput>;
32
+ outputAmount: CurrencyAmount<TOutput>;
33
+ }[];
34
+ v4Routes?: {
35
+ routev4: V4RouteSDK<TInput, TOutput>;
36
+ inputAmount: CurrencyAmount<TInput>;
37
+ outputAmount: CurrencyAmount<TOutput>;
38
+ }[];
39
+ mixedRoutes?: {
40
+ mixedRoute: MixedRouteSDK<TInput, TOutput>;
41
+ inputAmount: CurrencyAmount<TInput>;
42
+ outputAmount: CurrencyAmount<TOutput>;
43
+ }[];
44
+ tradeType: TTradeType;
45
+ });
46
+ get inputAmount(): CurrencyAmount<TInput>;
47
+ get outputAmount(): CurrencyAmount<TOutput>;
48
+ /**
49
+ * Returns the sum of all swaps within the trade
50
+ * @returns
51
+ * inputAmount: total input amount
52
+ * inputAmountNative: total amount of native currency required for ETH input paths
53
+ * - 0 if inputAmount is native but no native input paths
54
+ * - undefined if inputAmount is not native
55
+ * outputAmount: total output amount
56
+ * outputAmountNative: total amount of native currency returned from ETH output paths
57
+ * - 0 if outputAmount is native but no native output paths
58
+ * - undefined if outputAmount is not native
59
+ */
60
+ get amounts(): {
61
+ inputAmount: CurrencyAmount<TInput>;
62
+ inputAmountNative: CurrencyAmount<TInput> | undefined;
63
+ outputAmount: CurrencyAmount<TOutput>;
64
+ outputAmountNative: CurrencyAmount<TOutput> | undefined;
65
+ };
66
+ get numberOfInputWraps(): number;
67
+ get numberOfInputUnwraps(): number;
68
+ get nativeInputRoutes(): IRoute<TInput, TOutput, Pair | V3Pool | V4Pool>[];
69
+ get wethInputRoutes(): IRoute<TInput, TOutput, Pair | V3Pool | V4Pool>[];
70
+ private _executionPrice;
71
+ /**
72
+ * The price expressed in terms of output amount/input amount.
73
+ */
74
+ get executionPrice(): Price<TInput, TOutput>;
75
+ /**
76
+ * Returns the sell tax of the input token
77
+ */
78
+ get inputTax(): Percent;
79
+ /**
80
+ * Returns the buy tax of the output token
81
+ */
82
+ get outputTax(): Percent;
83
+ private isWrappedNative;
84
+ /**
85
+ * The cached result of the price impact computation
86
+ * @private
87
+ */
88
+ private _priceImpact;
89
+ /**
90
+ * Returns the percent difference between the route's mid price and the expected execution price
91
+ * In order to exclude token taxes from the price impact calculation, the spot price is calculated
92
+ * using a ratio of values that go into the pools, which are the post-tax input amount and pre-tax output amount.
93
+ */
94
+ get priceImpact(): Percent;
95
+ /**
96
+ * Get the minimum amount that must be received from this trade for the given slippage tolerance
97
+ * @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade
98
+ * @returns The amount out
99
+ */
100
+ minimumAmountOut(slippageTolerance: Percent, amountOut?: CurrencyAmount<TOutput>): CurrencyAmount<TOutput>;
101
+ /**
102
+ * Get the maximum amount in that can be spent via this trade for the given slippage tolerance
103
+ * @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade
104
+ * @returns The amount in
105
+ */
106
+ maximumAmountIn(slippageTolerance: Percent, amountIn?: CurrencyAmount<TInput>): CurrencyAmount<TInput>;
107
+ /**
108
+ * Return the execution price after accounting for slippage tolerance
109
+ * @param slippageTolerance the allowed tolerated slippage
110
+ * @returns The execution price
111
+ */
112
+ worstExecutionPrice(slippageTolerance: Percent): Price<TInput, TOutput>;
113
+ static fromRoutes<TInput extends Currency, TOutput extends Currency, TTradeType extends TradeType>(v2Routes: {
114
+ routev2: V2RouteSDK<TInput, TOutput>;
115
+ amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>;
116
+ }[], v3Routes: {
117
+ routev3: V3RouteSDK<TInput, TOutput>;
118
+ amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>;
119
+ }[], tradeType: TTradeType, mixedRoutes?: {
120
+ mixedRoute: MixedRouteSDK<TInput, TOutput>;
121
+ amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>;
122
+ }[], v4Routes?: {
123
+ routev4: V4RouteSDK<TInput, TOutput>;
124
+ amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>;
125
+ }[]): Promise<Trade<TInput, TOutput, TTradeType>>;
126
+ static fromRoute<TInput extends Currency, TOutput extends Currency, TTradeType extends TradeType>(route: V2RouteSDK<TInput, TOutput> | V3RouteSDK<TInput, TOutput> | V4RouteSDK<TInput, TOutput> | MixedRouteSDK<TInput, TOutput>, amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>, tradeType: TTradeType): Promise<Trade<TInput, TOutput, TTradeType>>;
127
+ }
@@ -1,14 +1,14 @@
1
- export * from './constants';
2
- export * from './approveAndCall';
3
- export * from './multicallExtended';
4
- export * from './paymentsExtended';
5
- export * from './swapRouter';
6
- export * from './entities/trade';
7
- export * from './entities/protocol';
8
- export * from './entities/route';
9
- export * from './entities/mixedRoute/route';
10
- export * from './entities/mixedRoute/trade';
11
- export * from './utils/encodeMixedRouteToPath';
12
- export * from './utils/TPool';
13
- export * from './utils/pathCurrency';
14
- export * from './utils';
1
+ export * from './constants';
2
+ export * from './approveAndCall';
3
+ export * from './multicallExtended';
4
+ export * from './paymentsExtended';
5
+ export * from './swapRouter';
6
+ export * from './entities/trade';
7
+ export * from './entities/protocol';
8
+ export * from './entities/route';
9
+ export * from './entities/mixedRoute/route';
10
+ export * from './entities/mixedRoute/trade';
11
+ export * from './utils/encodeMixedRouteToPath';
12
+ export * from './utils/TPool';
13
+ export * from './utils/pathCurrency';
14
+ export * from './utils';
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./router-sdk.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./router-sdk.cjs.development.js')
8
+ }
@@ -1,11 +1,11 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { BigintIsh } from '@uniswap/sdk-core';
3
- export type Validation = BigintIsh | string;
4
- export declare abstract class MulticallExtended {
5
- static INTERFACE: Interface;
6
- /**
7
- * Cannot be constructed.
8
- */
9
- private constructor();
10
- static encodeMulticall(calldatas: string | string[], validation?: Validation): string;
11
- }
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { BigintIsh } from '@uniswap/sdk-core';
3
+ export declare type Validation = BigintIsh | string;
4
+ export declare abstract class MulticallExtended {
5
+ static INTERFACE: Interface;
6
+ /**
7
+ * Cannot be constructed.
8
+ */
9
+ private constructor();
10
+ static encodeMulticall(calldatas: string | string[], validation?: Validation): string;
11
+ }
@@ -1,15 +1,15 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { Token } from '@uniswap/sdk-core';
3
- import { FeeOptions } from '@uniswap/v3-sdk';
4
- import JSBI from 'jsbi';
5
- export declare abstract class PaymentsExtended {
6
- static INTERFACE: Interface;
7
- /**
8
- * Cannot be constructed.
9
- */
10
- private constructor();
11
- static encodeUnwrapWETH9(amountMinimum: JSBI, recipient?: string, feeOptions?: FeeOptions): string;
12
- static encodeSweepToken(token: Token, amountMinimum: JSBI, recipient?: string, feeOptions?: FeeOptions): string;
13
- static encodePull(token: Token, amount: JSBI): string;
14
- static encodeWrapETH(amount: JSBI): string;
15
- }
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { Token } from '@uniswap/sdk-core';
3
+ import { FeeOptions } from '@uniswap/v3-sdk';
4
+ import JSBI from 'jsbi';
5
+ export declare abstract class PaymentsExtended {
6
+ static INTERFACE: Interface;
7
+ /**
8
+ * Cannot be constructed.
9
+ */
10
+ private constructor();
11
+ static encodeUnwrapWETH9(amountMinimum: JSBI, recipient?: string, feeOptions?: FeeOptions): string;
12
+ static encodeSweepToken(token: Token, amountMinimum: JSBI, recipient?: string, feeOptions?: FeeOptions): string;
13
+ static encodePull(token: Token, amount: JSBI): string;
14
+ static encodeWrapETH(amount: JSBI): string;
15
+ }