@uniswap/router-sdk 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cjs/src/approveAndCall.d.ts → approveAndCall.d.ts} +33 -33
- package/dist/{types/src/constants.d.ts → constants.d.ts} +13 -13
- package/dist/{types/src/entities → entities}/mixedRoute/route.d.ts +29 -29
- package/dist/{esm/src/entities → entities}/mixedRoute/trade.d.ts +183 -183
- package/dist/{cjs/src/entities → entities}/protocol.d.ts +6 -6
- package/dist/{esm/src/entities → entities}/route.d.ts +40 -40
- package/dist/{esm/src/entities → entities}/trade.d.ts +127 -127
- package/dist/{cjs/src/index.d.ts → index.d.ts} +14 -14
- package/dist/index.js +8 -0
- package/dist/{cjs/src/multicallExtended.d.ts → multicallExtended.d.ts} +11 -11
- package/dist/{types/src/paymentsExtended.d.ts → paymentsExtended.d.ts} +15 -15
- package/dist/router-sdk.cjs.development.js +2460 -0
- package/dist/router-sdk.cjs.development.js.map +1 -0
- package/dist/router-sdk.cjs.production.min.js +2 -0
- package/dist/router-sdk.cjs.production.min.js.map +1 -0
- package/dist/router-sdk.esm.js +2427 -0
- package/dist/router-sdk.esm.js.map +1 -0
- package/dist/{cjs/src/swapRouter.d.ts → swapRouter.d.ts} +95 -95
- package/dist/{cjs/src/utils → utils}/TPool.d.ts +4 -4
- package/dist/{cjs/src/utils → utils}/encodeMixedRouteToPath.d.ts +9 -9
- package/dist/{types/src/utils → utils}/index.d.ts +16 -16
- package/dist/{cjs/src/utils → utils}/pathCurrency.d.ts +4 -4
- package/package.json +18 -33
- package/dist/cjs/src/approveAndCall.js +0 -111
- package/dist/cjs/src/approveAndCall.js.map +0 -1
- package/dist/cjs/src/constants.d.ts +0 -13
- package/dist/cjs/src/constants.js +0 -22
- package/dist/cjs/src/constants.js.map +0 -1
- package/dist/cjs/src/entities/mixedRoute/route.d.ts +0 -29
- package/dist/cjs/src/entities/mixedRoute/route.js +0 -119
- package/dist/cjs/src/entities/mixedRoute/route.js.map +0 -1
- package/dist/cjs/src/entities/mixedRoute/route.test.d.ts +0 -1
- package/dist/cjs/src/entities/mixedRoute/route.test.js +0 -469
- package/dist/cjs/src/entities/mixedRoute/route.test.js.map +0 -1
- package/dist/cjs/src/entities/mixedRoute/trade.d.ts +0 -183
- package/dist/cjs/src/entities/mixedRoute/trade.js +0 -357
- package/dist/cjs/src/entities/mixedRoute/trade.js.map +0 -1
- package/dist/cjs/src/entities/mixedRoute/trade.test.d.ts +0 -1
- package/dist/cjs/src/entities/mixedRoute/trade.test.js +0 -1010
- package/dist/cjs/src/entities/mixedRoute/trade.test.js.map +0 -1
- package/dist/cjs/src/entities/protocol.js +0 -11
- package/dist/cjs/src/entities/protocol.js.map +0 -1
- package/dist/cjs/src/entities/route.d.ts +0 -40
- package/dist/cjs/src/entities/route.js +0 -63
- package/dist/cjs/src/entities/route.js.map +0 -1
- package/dist/cjs/src/entities/route.test.d.ts +0 -1
- package/dist/cjs/src/entities/route.test.js +0 -192
- package/dist/cjs/src/entities/route.test.js.map +0 -1
- package/dist/cjs/src/entities/trade.d.ts +0 -127
- package/dist/cjs/src/entities/trade.js +0 -366
- package/dist/cjs/src/entities/trade.js.map +0 -1
- package/dist/cjs/src/entities/trade.test.d.ts +0 -1
- package/dist/cjs/src/entities/trade.test.js +0 -1267
- package/dist/cjs/src/entities/trade.test.js.map +0 -1
- package/dist/cjs/src/index.js +0 -18
- package/dist/cjs/src/index.js.map +0 -1
- package/dist/cjs/src/multicallExtended.js +0 -43
- package/dist/cjs/src/multicallExtended.js.map +0 -1
- package/dist/cjs/src/multicallExtended.test.d.ts +0 -1
- package/dist/cjs/src/multicallExtended.test.js +0 -22
- package/dist/cjs/src/multicallExtended.test.js.map +0 -1
- package/dist/cjs/src/paymentsExtended.d.ts +0 -15
- package/dist/cjs/src/paymentsExtended.js +0 -65
- package/dist/cjs/src/paymentsExtended.js.map +0 -1
- package/dist/cjs/src/paymentsExtended.test.d.ts +0 -1
- package/dist/cjs/src/paymentsExtended.test.js +0 -60
- package/dist/cjs/src/paymentsExtended.test.js.map +0 -1
- package/dist/cjs/src/swapRouter.js +0 -439
- package/dist/cjs/src/swapRouter.js.map +0 -1
- package/dist/cjs/src/swapRouter.test.d.ts +0 -1
- package/dist/cjs/src/swapRouter.test.js +0 -1161
- package/dist/cjs/src/swapRouter.test.js.map +0 -1
- package/dist/cjs/src/utils/TPool.js +0 -3
- package/dist/cjs/src/utils/TPool.js.map +0 -1
- package/dist/cjs/src/utils/encodeMixedRouteToPath.js +0 -90
- package/dist/cjs/src/utils/encodeMixedRouteToPath.js.map +0 -1
- package/dist/cjs/src/utils/encodeMixedRouteToPath.test.d.ts +0 -1
- package/dist/cjs/src/utils/encodeMixedRouteToPath.test.js +0 -136
- package/dist/cjs/src/utils/encodeMixedRouteToPath.test.js.map +0 -1
- package/dist/cjs/src/utils/index.d.ts +0 -16
- package/dist/cjs/src/utils/index.js +0 -51
- package/dist/cjs/src/utils/index.js.map +0 -1
- package/dist/cjs/src/utils/pathCurrency.js +0 -35
- package/dist/cjs/src/utils/pathCurrency.js.map +0 -1
- package/dist/cjs/src/utils/pathCurrency.test.d.ts +0 -1
- package/dist/cjs/src/utils/pathCurrency.test.js +0 -17
- package/dist/cjs/src/utils/pathCurrency.test.js.map +0 -1
- package/dist/esm/src/approveAndCall.d.ts +0 -33
- package/dist/esm/src/approveAndCall.js +0 -105
- package/dist/esm/src/approveAndCall.js.map +0 -1
- package/dist/esm/src/constants.d.ts +0 -13
- package/dist/esm/src/constants.js +0 -18
- package/dist/esm/src/constants.js.map +0 -1
- package/dist/esm/src/entities/mixedRoute/route.d.ts +0 -29
- package/dist/esm/src/entities/mixedRoute/route.js +0 -114
- package/dist/esm/src/entities/mixedRoute/route.js.map +0 -1
- package/dist/esm/src/entities/mixedRoute/route.test.d.ts +0 -1
- package/dist/esm/src/entities/mixedRoute/route.test.js +0 -467
- package/dist/esm/src/entities/mixedRoute/route.test.js.map +0 -1
- package/dist/esm/src/entities/mixedRoute/trade.js +0 -352
- package/dist/esm/src/entities/mixedRoute/trade.js.map +0 -1
- package/dist/esm/src/entities/mixedRoute/trade.test.d.ts +0 -1
- package/dist/esm/src/entities/mixedRoute/trade.test.js +0 -1008
- package/dist/esm/src/entities/mixedRoute/trade.test.js.map +0 -1
- package/dist/esm/src/entities/protocol.d.ts +0 -6
- package/dist/esm/src/entities/protocol.js +0 -8
- package/dist/esm/src/entities/protocol.js.map +0 -1
- package/dist/esm/src/entities/route.js +0 -55
- package/dist/esm/src/entities/route.js.map +0 -1
- package/dist/esm/src/entities/route.test.d.ts +0 -1
- package/dist/esm/src/entities/route.test.js +0 -190
- package/dist/esm/src/entities/route.test.js.map +0 -1
- package/dist/esm/src/entities/trade.js +0 -362
- package/dist/esm/src/entities/trade.js.map +0 -1
- package/dist/esm/src/entities/trade.test.d.ts +0 -1
- package/dist/esm/src/entities/trade.test.js +0 -1265
- package/dist/esm/src/entities/trade.test.js.map +0 -1
- package/dist/esm/src/index.d.ts +0 -14
- package/dist/esm/src/index.js +0 -15
- package/dist/esm/src/index.js.map +0 -1
- package/dist/esm/src/multicallExtended.d.ts +0 -11
- package/dist/esm/src/multicallExtended.js +0 -39
- package/dist/esm/src/multicallExtended.js.map +0 -1
- package/dist/esm/src/multicallExtended.test.d.ts +0 -1
- package/dist/esm/src/multicallExtended.test.js +0 -20
- package/dist/esm/src/multicallExtended.test.js.map +0 -1
- package/dist/esm/src/paymentsExtended.d.ts +0 -15
- package/dist/esm/src/paymentsExtended.js +0 -61
- package/dist/esm/src/paymentsExtended.js.map +0 -1
- package/dist/esm/src/paymentsExtended.test.d.ts +0 -1
- package/dist/esm/src/paymentsExtended.test.js +0 -57
- package/dist/esm/src/paymentsExtended.test.js.map +0 -1
- package/dist/esm/src/swapRouter.d.ts +0 -95
- package/dist/esm/src/swapRouter.js +0 -434
- package/dist/esm/src/swapRouter.js.map +0 -1
- package/dist/esm/src/swapRouter.test.d.ts +0 -1
- package/dist/esm/src/swapRouter.test.js +0 -1159
- package/dist/esm/src/swapRouter.test.js.map +0 -1
- package/dist/esm/src/utils/TPool.d.ts +0 -4
- package/dist/esm/src/utils/TPool.js +0 -2
- package/dist/esm/src/utils/TPool.js.map +0 -1
- package/dist/esm/src/utils/encodeMixedRouteToPath.d.ts +0 -9
- package/dist/esm/src/utils/encodeMixedRouteToPath.js +0 -86
- package/dist/esm/src/utils/encodeMixedRouteToPath.js.map +0 -1
- package/dist/esm/src/utils/encodeMixedRouteToPath.test.d.ts +0 -1
- package/dist/esm/src/utils/encodeMixedRouteToPath.test.js +0 -134
- package/dist/esm/src/utils/encodeMixedRouteToPath.test.js.map +0 -1
- package/dist/esm/src/utils/index.d.ts +0 -16
- package/dist/esm/src/utils/index.js +0 -46
- package/dist/esm/src/utils/index.js.map +0 -1
- package/dist/esm/src/utils/pathCurrency.d.ts +0 -4
- package/dist/esm/src/utils/pathCurrency.js +0 -30
- package/dist/esm/src/utils/pathCurrency.js.map +0 -1
- package/dist/esm/src/utils/pathCurrency.test.d.ts +0 -1
- package/dist/esm/src/utils/pathCurrency.test.js +0 -15
- package/dist/esm/src/utils/pathCurrency.test.js.map +0 -1
- package/dist/types/src/approveAndCall.d.ts +0 -33
- package/dist/types/src/entities/mixedRoute/route.test.d.ts +0 -1
- package/dist/types/src/entities/mixedRoute/trade.d.ts +0 -183
- package/dist/types/src/entities/mixedRoute/trade.test.d.ts +0 -1
- package/dist/types/src/entities/protocol.d.ts +0 -6
- package/dist/types/src/entities/route.d.ts +0 -40
- package/dist/types/src/entities/route.test.d.ts +0 -1
- package/dist/types/src/entities/trade.d.ts +0 -127
- package/dist/types/src/entities/trade.test.d.ts +0 -1
- package/dist/types/src/index.d.ts +0 -14
- package/dist/types/src/multicallExtended.d.ts +0 -11
- package/dist/types/src/multicallExtended.test.d.ts +0 -1
- package/dist/types/src/paymentsExtended.test.d.ts +0 -1
- package/dist/types/src/swapRouter.d.ts +0 -95
- package/dist/types/src/swapRouter.test.d.ts +0 -1
- package/dist/types/src/utils/TPool.d.ts +0 -4
- package/dist/types/src/utils/encodeMixedRouteToPath.d.ts +0 -9
- package/dist/types/src/utils/encodeMixedRouteToPath.test.d.ts +0 -1
- package/dist/types/src/utils/pathCurrency.d.ts +0 -4
- 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
|
@@ -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
|
+
}
|