@pancakeswap/v3-sdk 1.0.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/dist/index.d.ts +1223 -0
- package/dist/index.js +6015 -0
- package/dist/index.mjs +5952 -0
- package/package.json +67 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1223 @@
|
|
|
1
|
+
import { BigintIsh, Token, Price, CurrencyAmount, Percent, Currency as Currency$1, TradeType, JSBI as JSBI$1, Fraction, NativeCurrency } from '@pancakeswap/sdk';
|
|
2
|
+
import JSBI from 'jsbi';
|
|
3
|
+
import { Currency, Token as Token$1, Price as Price$1 } from '@pancakeswap/swap-sdk-core';
|
|
4
|
+
import { Interface } from '@ethersproject/abi';
|
|
5
|
+
|
|
6
|
+
declare const FACTORY_ADDRESS = "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865";
|
|
7
|
+
declare const DEPLOYER_ADDRESS = "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
8
|
+
declare const DEPLOYER_ADDRESSES: {
|
|
9
|
+
readonly 1: "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
10
|
+
readonly 5: "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
11
|
+
readonly 56: "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
12
|
+
readonly 97: "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9";
|
|
13
|
+
};
|
|
14
|
+
declare const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000";
|
|
15
|
+
declare const POOL_INIT_CODE_HASH = "0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2";
|
|
16
|
+
/**
|
|
17
|
+
* The default factory enabled fee amounts, denominated in hundredths of bips.
|
|
18
|
+
*/
|
|
19
|
+
declare enum FeeAmount {
|
|
20
|
+
LOWEST = 100,
|
|
21
|
+
LOW = 500,
|
|
22
|
+
MEDIUM = 2500,
|
|
23
|
+
HIGH = 10000
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The default factory tick spacings by fee amount.
|
|
27
|
+
*/
|
|
28
|
+
declare const TICK_SPACINGS: {
|
|
29
|
+
[amount in FeeAmount]: number;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
interface TickConstructorArgs {
|
|
33
|
+
index: number;
|
|
34
|
+
liquidityGross: BigintIsh;
|
|
35
|
+
liquidityNet: BigintIsh;
|
|
36
|
+
}
|
|
37
|
+
declare class Tick {
|
|
38
|
+
readonly index: number;
|
|
39
|
+
readonly liquidityGross: JSBI;
|
|
40
|
+
readonly liquidityNet: JSBI;
|
|
41
|
+
constructor({ index, liquidityGross, liquidityNet }: TickConstructorArgs);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Provides information about ticks
|
|
46
|
+
*/
|
|
47
|
+
interface TickDataProvider {
|
|
48
|
+
/**
|
|
49
|
+
* Return information corresponding to a specific tick
|
|
50
|
+
* @param tick the tick to load
|
|
51
|
+
*/
|
|
52
|
+
getTick(tick: number): Promise<{
|
|
53
|
+
liquidityNet: BigintIsh;
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Return the next tick that is initialized within a single word
|
|
57
|
+
* @param tick The current tick
|
|
58
|
+
* @param lte Whether the next tick should be lte the current tick
|
|
59
|
+
* @param tickSpacing The tick spacing of the pool
|
|
60
|
+
*/
|
|
61
|
+
nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* This tick data provider does not know how to fetch any tick data. It throws whenever it is required. Useful if you
|
|
65
|
+
* do not need to load tick data for your use case.
|
|
66
|
+
*/
|
|
67
|
+
declare class NoTickDataProvider implements TickDataProvider {
|
|
68
|
+
private static ERROR_MESSAGE;
|
|
69
|
+
getTick(_tick: number): Promise<{
|
|
70
|
+
liquidityNet: BigintIsh;
|
|
71
|
+
}>;
|
|
72
|
+
nextInitializedTickWithinOneWord(_tick: number, _lte: boolean, _tickSpacing: number): Promise<[number, boolean]>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Represents a V3 pool
|
|
77
|
+
*/
|
|
78
|
+
declare class Pool {
|
|
79
|
+
readonly token0: Token;
|
|
80
|
+
readonly token1: Token;
|
|
81
|
+
readonly fee: FeeAmount;
|
|
82
|
+
readonly sqrtRatioX96: JSBI;
|
|
83
|
+
readonly liquidity: JSBI;
|
|
84
|
+
readonly tickCurrent: number;
|
|
85
|
+
readonly tickDataProvider: TickDataProvider;
|
|
86
|
+
feeProtocol?: number;
|
|
87
|
+
private _token0Price?;
|
|
88
|
+
private _token1Price?;
|
|
89
|
+
static getAddress(tokenA: Token, tokenB: Token, fee: FeeAmount, initCodeHashManualOverride?: string, deployerAddressOverride?: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* Construct a pool
|
|
92
|
+
* @param tokenA One of the tokens in the pool
|
|
93
|
+
* @param tokenB The other token in the pool
|
|
94
|
+
* @param fee The fee in hundredths of a bips of the input amount of every swap that is collected by the pool
|
|
95
|
+
* @param sqrtRatioX96 The sqrt of the current ratio of amounts of token1 to token0
|
|
96
|
+
* @param liquidity The current value of in range liquidity
|
|
97
|
+
* @param tickCurrent The current tick of the pool
|
|
98
|
+
* @param ticks The current state of the pool ticks or a data provider that can return tick data
|
|
99
|
+
*/
|
|
100
|
+
constructor(tokenA: Token, tokenB: Token, fee: FeeAmount, sqrtRatioX96: BigintIsh, liquidity: BigintIsh, tickCurrent: number, ticks?: TickDataProvider | (Tick | TickConstructorArgs)[]);
|
|
101
|
+
/**
|
|
102
|
+
* Returns true if the token is either token0 or token1
|
|
103
|
+
* @param token The token to check
|
|
104
|
+
* @returns True if token is either token0 or token
|
|
105
|
+
*/
|
|
106
|
+
involvesToken(token: Token): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Returns the current mid price of the pool in terms of token0, i.e. the ratio of token1 over token0
|
|
109
|
+
*/
|
|
110
|
+
get token0Price(): Price<Token, Token>;
|
|
111
|
+
/**
|
|
112
|
+
* Returns the current mid price of the pool in terms of token1, i.e. the ratio of token0 over token1
|
|
113
|
+
*/
|
|
114
|
+
get token1Price(): Price<Token, Token>;
|
|
115
|
+
/**
|
|
116
|
+
* Return the price of the given token in terms of the other token in the pool.
|
|
117
|
+
* @param token The token to return price of
|
|
118
|
+
* @returns The price of the given token, in terms of the other.
|
|
119
|
+
*/
|
|
120
|
+
priceOf(token: Token): Price<Token, Token>;
|
|
121
|
+
/**
|
|
122
|
+
* Returns the chain ID of the tokens in the pool.
|
|
123
|
+
*/
|
|
124
|
+
get chainId(): number;
|
|
125
|
+
/**
|
|
126
|
+
* Given an input amount of a token, return the computed output amount, and a pool with state updated after the trade
|
|
127
|
+
* @param inputAmount The input amount for which to quote the output amount
|
|
128
|
+
* @param sqrtPriceLimitX96 The Q64.96 sqrt price limit
|
|
129
|
+
* @returns The output amount and the pool with updated state
|
|
130
|
+
*/
|
|
131
|
+
getOutputAmount(inputAmount: CurrencyAmount<Token>, sqrtPriceLimitX96?: JSBI): Promise<[CurrencyAmount<Token>, Pool]>;
|
|
132
|
+
/**
|
|
133
|
+
* Given a desired output amount of a token, return the computed input amount and a pool with state updated after the trade
|
|
134
|
+
* @param outputAmount the output amount for which to quote the input amount
|
|
135
|
+
* @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
|
|
136
|
+
* @returns The input amount and the pool with updated state
|
|
137
|
+
*/
|
|
138
|
+
getInputAmount(outputAmount: CurrencyAmount<Token>, sqrtPriceLimitX96?: JSBI): Promise<[CurrencyAmount<Token>, Pool]>;
|
|
139
|
+
/**
|
|
140
|
+
* Executes a swap
|
|
141
|
+
* @param zeroForOne Whether the amount in is token0 or token1
|
|
142
|
+
* @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
|
|
143
|
+
* @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
|
|
144
|
+
* @returns amountCalculated
|
|
145
|
+
* @returns sqrtRatioX96
|
|
146
|
+
* @returns liquidity
|
|
147
|
+
* @returns tickCurrent
|
|
148
|
+
*/
|
|
149
|
+
private swap;
|
|
150
|
+
get tickSpacing(): number;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
interface PositionConstructorArgs {
|
|
154
|
+
pool: Pool;
|
|
155
|
+
tickLower: number;
|
|
156
|
+
tickUpper: number;
|
|
157
|
+
liquidity: BigintIsh;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Represents a position on a Pancake V3 Pool
|
|
161
|
+
*/
|
|
162
|
+
declare class Position {
|
|
163
|
+
readonly pool: Pool;
|
|
164
|
+
readonly tickLower: number;
|
|
165
|
+
readonly tickUpper: number;
|
|
166
|
+
readonly liquidity: JSBI;
|
|
167
|
+
private _token0Amount;
|
|
168
|
+
private _token1Amount;
|
|
169
|
+
private _mintAmounts;
|
|
170
|
+
/**
|
|
171
|
+
* Constructs a position for a given pool with the given liquidity
|
|
172
|
+
* @param pool For which pool the liquidity is assigned
|
|
173
|
+
* @param liquidity The amount of liquidity that is in the position
|
|
174
|
+
* @param tickLower The lower tick of the position
|
|
175
|
+
* @param tickUpper The upper tick of the position
|
|
176
|
+
*/
|
|
177
|
+
constructor({ pool, liquidity, tickLower, tickUpper }: PositionConstructorArgs);
|
|
178
|
+
/**
|
|
179
|
+
* Returns the price of token0 at the lower tick
|
|
180
|
+
*/
|
|
181
|
+
get token0PriceLower(): Price<Token, Token>;
|
|
182
|
+
/**
|
|
183
|
+
* Returns the price of token0 at the upper tick
|
|
184
|
+
*/
|
|
185
|
+
get token0PriceUpper(): Price<Token, Token>;
|
|
186
|
+
/**
|
|
187
|
+
* Returns the amount of token0 that this position's liquidity could be burned for at the current pool price
|
|
188
|
+
*/
|
|
189
|
+
get amount0(): CurrencyAmount<Token>;
|
|
190
|
+
/**
|
|
191
|
+
* Returns the amount of token1 that this position's liquidity could be burned for at the current pool price
|
|
192
|
+
*/
|
|
193
|
+
get amount1(): CurrencyAmount<Token>;
|
|
194
|
+
/**
|
|
195
|
+
* Returns the lower and upper sqrt ratios if the price 'slips' up to slippage tolerance percentage
|
|
196
|
+
* @param slippageTolerance The amount by which the price can 'slip' before the transaction will revert
|
|
197
|
+
* @returns The sqrt ratios after slippage
|
|
198
|
+
*/
|
|
199
|
+
private ratiosAfterSlippage;
|
|
200
|
+
/**
|
|
201
|
+
* Returns the minimum amounts that must be sent in order to safely mint the amount of liquidity held by the position
|
|
202
|
+
* with the given slippage tolerance
|
|
203
|
+
* @param slippageTolerance Tolerance of unfavorable slippage from the current price
|
|
204
|
+
* @returns The amounts, with slippage
|
|
205
|
+
*/
|
|
206
|
+
mintAmountsWithSlippage(slippageTolerance: Percent): Readonly<{
|
|
207
|
+
amount0: JSBI;
|
|
208
|
+
amount1: JSBI;
|
|
209
|
+
}>;
|
|
210
|
+
/**
|
|
211
|
+
* Returns the minimum amounts that should be requested in order to safely burn the amount of liquidity held by the
|
|
212
|
+
* position with the given slippage tolerance
|
|
213
|
+
* @param slippageTolerance tolerance of unfavorable slippage from the current price
|
|
214
|
+
* @returns The amounts, with slippage
|
|
215
|
+
*/
|
|
216
|
+
burnAmountsWithSlippage(slippageTolerance: Percent): Readonly<{
|
|
217
|
+
amount0: JSBI;
|
|
218
|
+
amount1: JSBI;
|
|
219
|
+
}>;
|
|
220
|
+
/**
|
|
221
|
+
* Returns the minimum amounts that must be sent in order to mint the amount of liquidity held by the position at
|
|
222
|
+
* the current price for the pool
|
|
223
|
+
*/
|
|
224
|
+
get mintAmounts(): Readonly<{
|
|
225
|
+
amount0: JSBI;
|
|
226
|
+
amount1: JSBI;
|
|
227
|
+
}>;
|
|
228
|
+
/**
|
|
229
|
+
* Computes the maximum amount of liquidity received for a given amount of token0, token1,
|
|
230
|
+
* and the prices at the tick boundaries.
|
|
231
|
+
* @param pool The pool for which the position should be created
|
|
232
|
+
* @param tickLower The lower tick of the position
|
|
233
|
+
* @param tickUpper The upper tick of the position
|
|
234
|
+
* @param amount0 token0 amount
|
|
235
|
+
* @param amount1 token1 amount
|
|
236
|
+
* @param useFullPrecision If false, liquidity will be maximized according to what the router can calculate,
|
|
237
|
+
* not what core can theoretically support
|
|
238
|
+
* @returns The amount of liquidity for the position
|
|
239
|
+
*/
|
|
240
|
+
static fromAmounts({ pool, tickLower, tickUpper, amount0, amount1, useFullPrecision, }: {
|
|
241
|
+
pool: Pool;
|
|
242
|
+
tickLower: number;
|
|
243
|
+
tickUpper: number;
|
|
244
|
+
amount0: BigintIsh;
|
|
245
|
+
amount1: BigintIsh;
|
|
246
|
+
useFullPrecision: boolean;
|
|
247
|
+
}): Position;
|
|
248
|
+
/**
|
|
249
|
+
* Computes a position with the maximum amount of liquidity received for a given amount of token0, assuming an unlimited amount of token1
|
|
250
|
+
* @param pool The pool for which the position is created
|
|
251
|
+
* @param tickLower The lower tick
|
|
252
|
+
* @param tickUpper The upper tick
|
|
253
|
+
* @param amount0 The desired amount of token0
|
|
254
|
+
* @param useFullPrecision If true, liquidity will be maximized according to what the router can calculate,
|
|
255
|
+
* not what core can theoretically support
|
|
256
|
+
* @returns The position
|
|
257
|
+
*/
|
|
258
|
+
static fromAmount0({ pool, tickLower, tickUpper, amount0, useFullPrecision, }: {
|
|
259
|
+
pool: Pool;
|
|
260
|
+
tickLower: number;
|
|
261
|
+
tickUpper: number;
|
|
262
|
+
amount0: BigintIsh;
|
|
263
|
+
useFullPrecision: boolean;
|
|
264
|
+
}): Position;
|
|
265
|
+
/**
|
|
266
|
+
* Computes a position with the maximum amount of liquidity received for a given amount of token1, assuming an unlimited amount of token0
|
|
267
|
+
* @param pool The pool for which the position is created
|
|
268
|
+
* @param tickLower The lower tick
|
|
269
|
+
* @param tickUpper The upper tick
|
|
270
|
+
* @param amount1 The desired amount of token1
|
|
271
|
+
* @returns The position
|
|
272
|
+
*/
|
|
273
|
+
static fromAmount1({ pool, tickLower, tickUpper, amount1, }: {
|
|
274
|
+
pool: Pool;
|
|
275
|
+
tickLower: number;
|
|
276
|
+
tickUpper: number;
|
|
277
|
+
amount1: BigintIsh;
|
|
278
|
+
}): Position;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Represents a list of pools through which a swap can occur
|
|
283
|
+
* @template TInput The input token
|
|
284
|
+
* @template TOutput The output token
|
|
285
|
+
*/
|
|
286
|
+
declare class Route<TInput extends Currency, TOutput extends Currency> {
|
|
287
|
+
readonly pools: Pool[];
|
|
288
|
+
readonly tokenPath: Token$1[];
|
|
289
|
+
readonly input: TInput;
|
|
290
|
+
readonly output: TOutput;
|
|
291
|
+
private _midPrice;
|
|
292
|
+
/**
|
|
293
|
+
* Creates an instance of route.
|
|
294
|
+
* @param pools An array of `Pool` objects, ordered by the route the swap will take
|
|
295
|
+
* @param input The input token
|
|
296
|
+
* @param output The output token
|
|
297
|
+
*/
|
|
298
|
+
constructor(pools: Pool[], input: TInput, output: TOutput);
|
|
299
|
+
get chainId(): number;
|
|
300
|
+
/**
|
|
301
|
+
* Returns the mid price of the route
|
|
302
|
+
*/
|
|
303
|
+
get midPrice(): Price$1<TInput, TOutput>;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Trades comparator, an extension of the input output comparator that also considers other dimensions of the trade in ranking them
|
|
308
|
+
* @template TInput The input token, either Ether or an ERC-20
|
|
309
|
+
* @template TOutput The output token, either Ether or an ERC-20
|
|
310
|
+
* @template TTradeType The trade type, either exact input or exact output
|
|
311
|
+
* @param a The first trade to compare
|
|
312
|
+
* @param b The second trade to compare
|
|
313
|
+
* @returns A sorted ordering for two neighboring elements in a trade array
|
|
314
|
+
*/
|
|
315
|
+
declare function tradeComparator<TInput extends Currency$1, TOutput extends Currency$1, TTradeType extends TradeType>(a: Trade<TInput, TOutput, TTradeType>, b: Trade<TInput, TOutput, TTradeType>): number;
|
|
316
|
+
interface BestTradeOptions {
|
|
317
|
+
maxNumResults?: number;
|
|
318
|
+
maxHops?: number;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Represents a trade executed against a set of routes where some percentage of the input is
|
|
322
|
+
* split across each route.
|
|
323
|
+
*
|
|
324
|
+
* Each route has its own set of pools. Pools can not be re-used across routes.
|
|
325
|
+
*
|
|
326
|
+
* Does not account for slippage, i.e., changes in price environment that can occur between
|
|
327
|
+
* the time the trade is submitted and when it is executed.
|
|
328
|
+
* @template TInput The input token, either Ether or an ERC-20
|
|
329
|
+
* @template TOutput The output token, either Ether or an ERC-20
|
|
330
|
+
* @template TTradeType The trade type, either exact input or exact output
|
|
331
|
+
*/
|
|
332
|
+
declare class Trade<TInput extends Currency$1, TOutput extends Currency$1, TTradeType extends TradeType> {
|
|
333
|
+
/**
|
|
334
|
+
* @deprecated Deprecated in favor of 'swaps' property. If the trade consists of multiple routes
|
|
335
|
+
* this will return an error.
|
|
336
|
+
*
|
|
337
|
+
* When the trade consists of just a single route, this returns the route of the trade,
|
|
338
|
+
* i.e. which pools the trade goes through.
|
|
339
|
+
*/
|
|
340
|
+
get route(): Route<TInput, TOutput>;
|
|
341
|
+
/**
|
|
342
|
+
* The swaps of the trade, i.e. which routes and how much is swapped in each that
|
|
343
|
+
* make up the trade.
|
|
344
|
+
*/
|
|
345
|
+
readonly swaps: {
|
|
346
|
+
route: Route<TInput, TOutput>;
|
|
347
|
+
inputAmount: CurrencyAmount<TInput>;
|
|
348
|
+
outputAmount: CurrencyAmount<TOutput>;
|
|
349
|
+
}[];
|
|
350
|
+
/**
|
|
351
|
+
* The type of the trade, either exact in or exact out.
|
|
352
|
+
*/
|
|
353
|
+
readonly tradeType: TTradeType;
|
|
354
|
+
/**
|
|
355
|
+
* The cached result of the input amount computation
|
|
356
|
+
* @private
|
|
357
|
+
*/
|
|
358
|
+
private _inputAmount;
|
|
359
|
+
/**
|
|
360
|
+
* The input amount for the trade assuming no slippage.
|
|
361
|
+
*/
|
|
362
|
+
get inputAmount(): CurrencyAmount<TInput>;
|
|
363
|
+
/**
|
|
364
|
+
* The cached result of the output amount computation
|
|
365
|
+
* @private
|
|
366
|
+
*/
|
|
367
|
+
private _outputAmount;
|
|
368
|
+
/**
|
|
369
|
+
* The output amount for the trade assuming no slippage.
|
|
370
|
+
*/
|
|
371
|
+
get outputAmount(): CurrencyAmount<TOutput>;
|
|
372
|
+
/**
|
|
373
|
+
* The cached result of the computed execution price
|
|
374
|
+
* @private
|
|
375
|
+
*/
|
|
376
|
+
private _executionPrice;
|
|
377
|
+
/**
|
|
378
|
+
* The price expressed in terms of output amount/input amount.
|
|
379
|
+
*/
|
|
380
|
+
get executionPrice(): Price<TInput, TOutput>;
|
|
381
|
+
/**
|
|
382
|
+
* The cached result of the price impact computation
|
|
383
|
+
* @private
|
|
384
|
+
*/
|
|
385
|
+
private _priceImpact;
|
|
386
|
+
/**
|
|
387
|
+
* Returns the percent difference between the route's mid price and the price impact
|
|
388
|
+
*/
|
|
389
|
+
get priceImpact(): Percent;
|
|
390
|
+
/**
|
|
391
|
+
* Constructs an exact in trade with the given amount in and route
|
|
392
|
+
* @template TInput The input token, either Ether or an ERC-20
|
|
393
|
+
* @template TOutput The output token, either Ether or an ERC-20
|
|
394
|
+
* @param route The route of the exact in trade
|
|
395
|
+
* @param amountIn The amount being passed in
|
|
396
|
+
* @returns The exact in trade
|
|
397
|
+
*/
|
|
398
|
+
static exactIn<TInput extends Currency$1, TOutput extends Currency$1>(route: Route<TInput, TOutput>, amountIn: CurrencyAmount<TInput>): Promise<Trade<TInput, TOutput, TradeType.EXACT_INPUT>>;
|
|
399
|
+
/**
|
|
400
|
+
* Constructs an exact out trade with the given amount out and route
|
|
401
|
+
* @template TInput The input token, either Ether or an ERC-20
|
|
402
|
+
* @template TOutput The output token, either Ether or an ERC-20
|
|
403
|
+
* @param route The route of the exact out trade
|
|
404
|
+
* @param amountOut The amount returned by the trade
|
|
405
|
+
* @returns The exact out trade
|
|
406
|
+
*/
|
|
407
|
+
static exactOut<TInput extends Currency$1, TOutput extends Currency$1>(route: Route<TInput, TOutput>, amountOut: CurrencyAmount<TOutput>): Promise<Trade<TInput, TOutput, TradeType.EXACT_OUTPUT>>;
|
|
408
|
+
/**
|
|
409
|
+
* Constructs a trade by simulating swaps through the given route
|
|
410
|
+
* @template TInput The input token, either Ether or an ERC-20.
|
|
411
|
+
* @template TOutput The output token, either Ether or an ERC-20.
|
|
412
|
+
* @template TTradeType The type of the trade, either exact in or exact out.
|
|
413
|
+
* @param route route to swap through
|
|
414
|
+
* @param amount the amount specified, either input or output, depending on tradeType
|
|
415
|
+
* @param tradeType whether the trade is an exact input or exact output swap
|
|
416
|
+
* @returns The route
|
|
417
|
+
*/
|
|
418
|
+
static fromRoute<TInput extends Currency$1, TOutput extends Currency$1, TTradeType extends TradeType>(route: Route<TInput, TOutput>, amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>, tradeType: TTradeType): Promise<Trade<TInput, TOutput, TTradeType>>;
|
|
419
|
+
/**
|
|
420
|
+
* Constructs a trade from routes by simulating swaps
|
|
421
|
+
*
|
|
422
|
+
* @template TInput The input token, either Ether or an ERC-20.
|
|
423
|
+
* @template TOutput The output token, either Ether or an ERC-20.
|
|
424
|
+
* @template TTradeType The type of the trade, either exact in or exact out.
|
|
425
|
+
* @param routes the routes to swap through and how much of the amount should be routed through each
|
|
426
|
+
* @param tradeType whether the trade is an exact input or exact output swap
|
|
427
|
+
* @returns The trade
|
|
428
|
+
*/
|
|
429
|
+
static fromRoutes<TInput extends Currency$1, TOutput extends Currency$1, TTradeType extends TradeType>(routes: {
|
|
430
|
+
amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount<TInput> : CurrencyAmount<TOutput>;
|
|
431
|
+
route: Route<TInput, TOutput>;
|
|
432
|
+
}[], tradeType: TTradeType): Promise<Trade<TInput, TOutput, TTradeType>>;
|
|
433
|
+
/**
|
|
434
|
+
* Creates a trade without computing the result of swapping through the route. Useful when you have simulated the trade
|
|
435
|
+
* elsewhere and do not have any tick data
|
|
436
|
+
* @template TInput The input token, either Ether or an ERC-20
|
|
437
|
+
* @template TOutput The output token, either Ether or an ERC-20
|
|
438
|
+
* @template TTradeType The type of the trade, either exact in or exact out
|
|
439
|
+
* @param constructorArguments The arguments passed to the trade constructor
|
|
440
|
+
* @returns The unchecked trade
|
|
441
|
+
*/
|
|
442
|
+
static createUncheckedTrade<TInput extends Currency$1, TOutput extends Currency$1, TTradeType extends TradeType>(constructorArguments: {
|
|
443
|
+
route: Route<TInput, TOutput>;
|
|
444
|
+
inputAmount: CurrencyAmount<TInput>;
|
|
445
|
+
outputAmount: CurrencyAmount<TOutput>;
|
|
446
|
+
tradeType: TTradeType;
|
|
447
|
+
}): Trade<TInput, TOutput, TTradeType>;
|
|
448
|
+
/**
|
|
449
|
+
* Creates a trade without computing the result of swapping through the routes. Useful when you have simulated the trade
|
|
450
|
+
* elsewhere and do not have any tick data
|
|
451
|
+
* @template TInput The input token, either Ether or an ERC-20
|
|
452
|
+
* @template TOutput The output token, either Ether or an ERC-20
|
|
453
|
+
* @template TTradeType The type of the trade, either exact in or exact out
|
|
454
|
+
* @param constructorArguments The arguments passed to the trade constructor
|
|
455
|
+
* @returns The unchecked trade
|
|
456
|
+
*/
|
|
457
|
+
static createUncheckedTradeWithMultipleRoutes<TInput extends Currency$1, TOutput extends Currency$1, TTradeType extends TradeType>(constructorArguments: {
|
|
458
|
+
routes: {
|
|
459
|
+
route: Route<TInput, TOutput>;
|
|
460
|
+
inputAmount: CurrencyAmount<TInput>;
|
|
461
|
+
outputAmount: CurrencyAmount<TOutput>;
|
|
462
|
+
}[];
|
|
463
|
+
tradeType: TTradeType;
|
|
464
|
+
}): Trade<TInput, TOutput, TTradeType>;
|
|
465
|
+
/**
|
|
466
|
+
* Construct a trade by passing in the pre-computed property values
|
|
467
|
+
* @param routes The routes through which the trade occurs
|
|
468
|
+
* @param tradeType The type of trade, exact input or exact output
|
|
469
|
+
*/
|
|
470
|
+
private constructor();
|
|
471
|
+
/**
|
|
472
|
+
* Get the minimum amount that must be received from this trade for the given slippage tolerance
|
|
473
|
+
* @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade
|
|
474
|
+
* @returns The amount out
|
|
475
|
+
*/
|
|
476
|
+
minimumAmountOut(slippageTolerance: Percent, amountOut?: CurrencyAmount<TOutput>): CurrencyAmount<TOutput>;
|
|
477
|
+
/**
|
|
478
|
+
* Get the maximum amount in that can be spent via this trade for the given slippage tolerance
|
|
479
|
+
* @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade
|
|
480
|
+
* @returns The amount in
|
|
481
|
+
*/
|
|
482
|
+
maximumAmountIn(slippageTolerance: Percent, amountIn?: CurrencyAmount<TInput>): CurrencyAmount<TInput>;
|
|
483
|
+
/**
|
|
484
|
+
* Return the execution price after accounting for slippage tolerance
|
|
485
|
+
* @param slippageTolerance the allowed tolerated slippage
|
|
486
|
+
* @returns The execution price
|
|
487
|
+
*/
|
|
488
|
+
worstExecutionPrice(slippageTolerance: Percent): Price<TInput, TOutput>;
|
|
489
|
+
/**
|
|
490
|
+
* Given a list of pools, and a fixed amount in, returns the top `maxNumResults` trades that go from an input token
|
|
491
|
+
* amount to an output token, making at most `maxHops` hops.
|
|
492
|
+
* Note this does not consider aggregation, as routes are linear. It's possible a better route exists by splitting
|
|
493
|
+
* the amount in among multiple routes.
|
|
494
|
+
* @param pools the pools to consider in finding the best trade
|
|
495
|
+
* @param nextAmountIn exact amount of input currency to spend
|
|
496
|
+
* @param currencyOut the desired currency out
|
|
497
|
+
* @param maxNumResults maximum number of results to return
|
|
498
|
+
* @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool
|
|
499
|
+
* @param currentPools used in recursion; the current list of pools
|
|
500
|
+
* @param currencyAmountIn used in recursion; the original value of the currencyAmountIn parameter
|
|
501
|
+
* @param bestTrades used in recursion; the current list of best trades
|
|
502
|
+
* @returns The exact in trade
|
|
503
|
+
*/
|
|
504
|
+
static bestTradeExactIn<TInput extends Currency$1, TOutput extends Currency$1>(pools: Pool[], currencyAmountIn: CurrencyAmount<TInput>, currencyOut: TOutput, { maxNumResults, maxHops }?: BestTradeOptions, currentPools?: Pool[], nextAmountIn?: CurrencyAmount<Currency$1>, bestTrades?: Trade<TInput, TOutput, TradeType.EXACT_INPUT>[]): Promise<Trade<TInput, TOutput, TradeType.EXACT_INPUT>[]>;
|
|
505
|
+
/**
|
|
506
|
+
* similar to the above method but instead targets a fixed output amount
|
|
507
|
+
* given a list of pools, and a fixed amount out, returns the top `maxNumResults` trades that go from an input token
|
|
508
|
+
* to an output token amount, making at most `maxHops` hops
|
|
509
|
+
* note this does not consider aggregation, as routes are linear. it's possible a better route exists by splitting
|
|
510
|
+
* the amount in among multiple routes.
|
|
511
|
+
* @param pools the pools to consider in finding the best trade
|
|
512
|
+
* @param currencyIn the currency to spend
|
|
513
|
+
* @param currencyAmountOut the desired currency amount out
|
|
514
|
+
* @param nextAmountOut the exact amount of currency out
|
|
515
|
+
* @param maxNumResults maximum number of results to return
|
|
516
|
+
* @param maxHops maximum number of hops a returned trade can make, e.g. 1 hop goes through a single pool
|
|
517
|
+
* @param currentPools used in recursion; the current list of pools
|
|
518
|
+
* @param bestTrades used in recursion; the current list of best trades
|
|
519
|
+
* @returns The exact out trade
|
|
520
|
+
*/
|
|
521
|
+
static bestTradeExactOut<TInput extends Currency$1, TOutput extends Currency$1>(pools: Pool[], currencyIn: TInput, currencyAmountOut: CurrencyAmount<TOutput>, { maxNumResults, maxHops }?: BestTradeOptions, currentPools?: Pool[], nextAmountOut?: CurrencyAmount<Currency$1>, bestTrades?: Trade<TInput, TOutput, TradeType.EXACT_OUTPUT>[]): Promise<Trade<TInput, TOutput, TradeType.EXACT_OUTPUT>[]>;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* A data provider for ticks that is backed by an in-memory array of ticks.
|
|
526
|
+
*/
|
|
527
|
+
declare class TickListDataProvider implements TickDataProvider {
|
|
528
|
+
private ticks;
|
|
529
|
+
constructor(ticks: (Tick | TickConstructorArgs)[]);
|
|
530
|
+
getTick(tick: number): Promise<{
|
|
531
|
+
liquidityNet: BigintIsh;
|
|
532
|
+
liquidityGross: BigintIsh;
|
|
533
|
+
}>;
|
|
534
|
+
nextInitializedTickWithinOneWord(tick: number, lte: boolean, tickSpacing: number): Promise<[number, boolean]>;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Generated method parameters for executing a call.
|
|
539
|
+
*/
|
|
540
|
+
interface MethodParameters {
|
|
541
|
+
/**
|
|
542
|
+
* The hex encoded calldata to perform the given operation
|
|
543
|
+
*/
|
|
544
|
+
calldata: string;
|
|
545
|
+
/**
|
|
546
|
+
* The amount of ether (wei) to send in hex.
|
|
547
|
+
*/
|
|
548
|
+
value: string;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Converts a big int to a hex string
|
|
552
|
+
* @param bigintIsh
|
|
553
|
+
* @returns The hex encoded calldata
|
|
554
|
+
*/
|
|
555
|
+
declare function toHex(bigintIsh: BigintIsh): string;
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Computes a pool address
|
|
559
|
+
* @param deployerAddress The Pancake V3 deployer address
|
|
560
|
+
* @param tokenA The first token of the pair, irrespective of sort order
|
|
561
|
+
* @param tokenB The second token of the pair, irrespective of sort order
|
|
562
|
+
* @param fee The fee tier of the pool
|
|
563
|
+
* @param initCodeHashManualOverride Override the init code hash used to compute the pool address if necessary
|
|
564
|
+
* @returns The pool address
|
|
565
|
+
*/
|
|
566
|
+
declare function computePoolAddress({ deployerAddress, tokenA, tokenB, fee, initCodeHashManualOverride, }: {
|
|
567
|
+
deployerAddress: string;
|
|
568
|
+
tokenA: Token;
|
|
569
|
+
tokenB: Token;
|
|
570
|
+
fee: FeeAmount;
|
|
571
|
+
initCodeHashManualOverride?: string;
|
|
572
|
+
}): string;
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Converts a route to a hex encoded path
|
|
576
|
+
* @param route the v3 path to convert to an encoded path
|
|
577
|
+
* @param exactOutput whether the route should be encoded in reverse, for making exact output swaps
|
|
578
|
+
*/
|
|
579
|
+
declare function encodeRouteToPath(route: Route<Currency$1, Currency$1>, exactOutput: boolean): string;
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0
|
|
583
|
+
* @param amount1 The numerator amount i.e., the amount of token1
|
|
584
|
+
* @param amount0 The denominator amount i.e., the amount of token0
|
|
585
|
+
* @returns The sqrt ratio
|
|
586
|
+
*/
|
|
587
|
+
declare function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): JSBI;
|
|
588
|
+
|
|
589
|
+
declare abstract class FullMath {
|
|
590
|
+
/**
|
|
591
|
+
* Cannot be constructed.
|
|
592
|
+
*/
|
|
593
|
+
private constructor();
|
|
594
|
+
static mulDivRoundingUp(a: JSBI, b: JSBI, denominator: JSBI): JSBI;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Determines if a tick list is sorted
|
|
599
|
+
* @param list The tick list
|
|
600
|
+
* @param comparator The comparator
|
|
601
|
+
* @returns true if sorted
|
|
602
|
+
*/
|
|
603
|
+
declare function isSorted<T>(list: Array<T>, comparator: (a: T, b: T) => number): boolean;
|
|
604
|
+
|
|
605
|
+
declare abstract class LiquidityMath {
|
|
606
|
+
/**
|
|
607
|
+
* Cannot be constructed.
|
|
608
|
+
*/
|
|
609
|
+
private constructor();
|
|
610
|
+
static addDelta(x: JSBI, y: JSBI): JSBI;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Computes the maximum amount of liquidity received for a given amount of token0, token1,
|
|
615
|
+
* and the prices at the tick boundaries.
|
|
616
|
+
* @param sqrtRatioCurrentX96 the current price
|
|
617
|
+
* @param sqrtRatioAX96 price at lower boundary
|
|
618
|
+
* @param sqrtRatioBX96 price at upper boundary
|
|
619
|
+
* @param amount0 token0 amount
|
|
620
|
+
* @param amount1 token1 amount
|
|
621
|
+
* @param useFullPrecision if false, liquidity will be maximized according to what the router can calculate,
|
|
622
|
+
* not what core can theoretically support
|
|
623
|
+
*/
|
|
624
|
+
declare function maxLiquidityForAmounts(sqrtRatioCurrentX96: JSBI, sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, amount0: BigintIsh, amount1: BigintIsh, useFullPrecision: boolean): JSBI;
|
|
625
|
+
|
|
626
|
+
declare function mostSignificantBit(x: JSBI): number;
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Returns the closest tick that is nearest a given tick and usable for the given tick spacing
|
|
630
|
+
* @param tick the target tick
|
|
631
|
+
* @param tickSpacing the spacing of the pool
|
|
632
|
+
*/
|
|
633
|
+
declare function nearestUsableTick(tick: number, tickSpacing: number): number;
|
|
634
|
+
|
|
635
|
+
declare abstract class PositionLibrary {
|
|
636
|
+
/**
|
|
637
|
+
* Cannot be constructed.
|
|
638
|
+
*/
|
|
639
|
+
private constructor();
|
|
640
|
+
static getTokensOwed(feeGrowthInside0LastX128: JSBI$1, feeGrowthInside1LastX128: JSBI$1, liquidity: JSBI$1, feeGrowthInside0X128: JSBI$1, feeGrowthInside1X128: JSBI$1): JSBI$1[];
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Returns a price object corresponding to the input tick and the base/quote token
|
|
645
|
+
* Inputs must be tokens because the address order is used to interpret the price represented by the tick
|
|
646
|
+
* @param baseToken the base token of the price
|
|
647
|
+
* @param quoteToken the quote token of the price
|
|
648
|
+
* @param tick the tick for which to return the price
|
|
649
|
+
*/
|
|
650
|
+
declare function tickToPrice(baseToken: Token, quoteToken: Token, tick: number): Price<Token, Token>;
|
|
651
|
+
/**
|
|
652
|
+
* Returns the first tick for which the given price is greater than or equal to the tick price
|
|
653
|
+
* @param price for which to return the closest tick that represents a price less than or equal to the input price,
|
|
654
|
+
* i.e. the price of the returned tick is less than or equal to the input price
|
|
655
|
+
*/
|
|
656
|
+
declare function priceToClosestTick(price: Price<Token, Token>): number;
|
|
657
|
+
|
|
658
|
+
declare abstract class SqrtPriceMath {
|
|
659
|
+
/**
|
|
660
|
+
* Cannot be constructed.
|
|
661
|
+
*/
|
|
662
|
+
private constructor();
|
|
663
|
+
static getAmount0Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI;
|
|
664
|
+
static getAmount1Delta(sqrtRatioAX96: JSBI, sqrtRatioBX96: JSBI, liquidity: JSBI, roundUp: boolean): JSBI;
|
|
665
|
+
static getNextSqrtPriceFromInput(sqrtPX96: JSBI, liquidity: JSBI, amountIn: JSBI, zeroForOne: boolean): JSBI;
|
|
666
|
+
static getNextSqrtPriceFromOutput(sqrtPX96: JSBI, liquidity: JSBI, amountOut: JSBI, zeroForOne: boolean): JSBI;
|
|
667
|
+
private static getNextSqrtPriceFromAmount0RoundingUp;
|
|
668
|
+
private static getNextSqrtPriceFromAmount1RoundingDown;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
declare abstract class SwapMath {
|
|
672
|
+
/**
|
|
673
|
+
* Cannot be constructed.
|
|
674
|
+
*/
|
|
675
|
+
private constructor();
|
|
676
|
+
static computeSwapStep(sqrtRatioCurrentX96: JSBI, sqrtRatioTargetX96: JSBI, liquidity: JSBI, amountRemaining: JSBI, feePips: FeeAmount): [JSBI, JSBI, JSBI, JSBI];
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
interface FeeGrowthOutside {
|
|
680
|
+
feeGrowthOutside0X128: JSBI;
|
|
681
|
+
feeGrowthOutside1X128: JSBI;
|
|
682
|
+
}
|
|
683
|
+
declare function subIn256(x: JSBI, y: JSBI): JSBI;
|
|
684
|
+
declare abstract class TickLibrary {
|
|
685
|
+
/**
|
|
686
|
+
* Cannot be constructed.
|
|
687
|
+
*/
|
|
688
|
+
private constructor();
|
|
689
|
+
static getFeeGrowthInside(feeGrowthOutsideLower: FeeGrowthOutside, feeGrowthOutsideUpper: FeeGrowthOutside, tickLower: number, tickUpper: number, tickCurrent: number, feeGrowthGlobal0X128: JSBI, feeGrowthGlobal1X128: JSBI): JSBI[];
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Utility methods for interacting with sorted lists of ticks
|
|
694
|
+
*/
|
|
695
|
+
declare abstract class TickList {
|
|
696
|
+
/**
|
|
697
|
+
* Cannot be constructed
|
|
698
|
+
*/
|
|
699
|
+
private constructor();
|
|
700
|
+
static validateList(ticks: Tick[], tickSpacing: number): void;
|
|
701
|
+
static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean;
|
|
702
|
+
static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean;
|
|
703
|
+
static getTick(ticks: readonly Tick[], index: number): Tick;
|
|
704
|
+
/**
|
|
705
|
+
* Finds the largest tick in the list of ticks that is less than or equal to tick
|
|
706
|
+
* @param ticks list of ticks
|
|
707
|
+
* @param tick tick to find the largest tick that is less than or equal to tick
|
|
708
|
+
* @private
|
|
709
|
+
*/
|
|
710
|
+
private static binarySearch;
|
|
711
|
+
static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick;
|
|
712
|
+
static nextInitializedTickWithinOneWord(ticks: readonly Tick[], tick: number, lte: boolean, tickSpacing: number): [number, boolean];
|
|
713
|
+
static countInitializedTicksCrossed(ticks: readonly Tick[], tickBefore: number, tickAfter: number): number;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
declare abstract class TickMath {
|
|
717
|
+
/**
|
|
718
|
+
* Cannot be constructed.
|
|
719
|
+
*/
|
|
720
|
+
private constructor();
|
|
721
|
+
/**
|
|
722
|
+
* The minimum tick that can be used on any pool.
|
|
723
|
+
*/
|
|
724
|
+
static MIN_TICK: number;
|
|
725
|
+
/**
|
|
726
|
+
* The maximum tick that can be used on any pool.
|
|
727
|
+
*/
|
|
728
|
+
static MAX_TICK: number;
|
|
729
|
+
/**
|
|
730
|
+
* The sqrt ratio corresponding to the minimum tick that could be used on any pool.
|
|
731
|
+
*/
|
|
732
|
+
static MIN_SQRT_RATIO: JSBI$1;
|
|
733
|
+
/**
|
|
734
|
+
* The sqrt ratio corresponding to the maximum tick that could be used on any pool.
|
|
735
|
+
*/
|
|
736
|
+
static MAX_SQRT_RATIO: JSBI$1;
|
|
737
|
+
/**
|
|
738
|
+
* Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick
|
|
739
|
+
* @param tick the tick for which to compute the sqrt ratio
|
|
740
|
+
*/
|
|
741
|
+
static getSqrtRatioAtTick(tick: number): JSBI$1;
|
|
742
|
+
/**
|
|
743
|
+
* Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96
|
|
744
|
+
* and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96
|
|
745
|
+
* @param sqrtRatioX96 the sqrt ratio as a Q64.96 for which to compute the tick
|
|
746
|
+
*/
|
|
747
|
+
static getTickAtSqrtRatio(sqrtRatioX96: JSBI$1): number;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
declare function getToken0Amount(tickCurrent: number, tickLower: number, tickUpper: number, sqrtRatioX96: JSBI$1, liquidity: JSBI$1): JSBI$1;
|
|
751
|
+
declare function getToken1Amount(tickCurrent: number, tickLower: number, tickUpper: number, sqrtRatioX96: JSBI$1, liquidity: JSBI$1): JSBI$1;
|
|
752
|
+
declare const PositionMath: {
|
|
753
|
+
getToken0Amount: typeof getToken0Amount;
|
|
754
|
+
getToken1Amount: typeof getToken1Amount;
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
declare const FeeCalculator: {
|
|
758
|
+
getEstimatedLPFee: typeof getEstimatedLPFee;
|
|
759
|
+
getLiquidityFromTick: typeof getLiquidityFromTick;
|
|
760
|
+
getLiquidityFromSqrtRatioX96: typeof getLiquidityFromSqrtRatioX96;
|
|
761
|
+
getAverageLiquidity: typeof getAverageLiquidity;
|
|
762
|
+
getLiquidityBySingleAmount: typeof getLiquidityBySingleAmount;
|
|
763
|
+
getDependentAmount: typeof getDependentAmount;
|
|
764
|
+
getLiquidityByAmountsAndPrice: typeof getLiquidityByAmountsAndPrice;
|
|
765
|
+
getAmountsByLiquidityAndPrice: typeof getAmountsByLiquidityAndPrice;
|
|
766
|
+
getAmountsAtNewPrice: typeof getAmountsAtNewPrice;
|
|
767
|
+
};
|
|
768
|
+
interface EstimateFeeOptions {
|
|
769
|
+
amount: CurrencyAmount<Currency$1>;
|
|
770
|
+
currency: Currency$1;
|
|
771
|
+
tickLower: number;
|
|
772
|
+
tickUpper: number;
|
|
773
|
+
volume24H: number;
|
|
774
|
+
sqrtRatioX96: JSBI$1;
|
|
775
|
+
mostActiveLiquidity: JSBI$1;
|
|
776
|
+
fee: number;
|
|
777
|
+
insidePercentage?: Percent;
|
|
778
|
+
protocolFee?: Percent;
|
|
779
|
+
}
|
|
780
|
+
declare function getEstimatedLPFeeWithProtocolFee(options: EstimateFeeOptions): Fraction;
|
|
781
|
+
declare function getEstimatedLPFee({ protocolFee, ...rest }: EstimateFeeOptions): Fraction;
|
|
782
|
+
interface GetAmountOptions {
|
|
783
|
+
amount: CurrencyAmount<Currency$1>;
|
|
784
|
+
currency: Currency$1;
|
|
785
|
+
tickLower: number;
|
|
786
|
+
tickUpper: number;
|
|
787
|
+
sqrtRatioX96: JSBI$1;
|
|
788
|
+
}
|
|
789
|
+
declare function getDependentAmount(options: GetAmountOptions): CurrencyAmount<Currency$1>;
|
|
790
|
+
declare function getLiquidityBySingleAmount({ amount, currency, ...rest }: GetAmountOptions): JSBI$1;
|
|
791
|
+
interface GetLiquidityOptions extends Omit<GetAmountOptions, 'amount' | 'currency'> {
|
|
792
|
+
amountA: CurrencyAmount<Currency$1>;
|
|
793
|
+
amountB: CurrencyAmount<Currency$1>;
|
|
794
|
+
}
|
|
795
|
+
declare function getLiquidityByAmountsAndPrice({ amountA, amountB, tickUpper, tickLower, sqrtRatioX96, }: GetLiquidityOptions): JSBI$1;
|
|
796
|
+
interface GetAmountsOptions extends Omit<GetAmountOptions, 'amount' | 'currency'> {
|
|
797
|
+
currencyA: Currency$1;
|
|
798
|
+
currencyB: Currency$1;
|
|
799
|
+
liquidity: JSBI$1;
|
|
800
|
+
}
|
|
801
|
+
declare function getAmountsByLiquidityAndPrice(options: GetAmountsOptions): CurrencyAmount<Currency$1>[];
|
|
802
|
+
interface GetAmountsAtNewPriceOptions extends Omit<GetAmountOptions, 'amount' | 'currency'> {
|
|
803
|
+
amountA: CurrencyAmount<Currency$1>;
|
|
804
|
+
amountB: CurrencyAmount<Currency$1>;
|
|
805
|
+
newSqrtRatioX96: JSBI$1;
|
|
806
|
+
}
|
|
807
|
+
declare function getAmountsAtNewPrice({ newSqrtRatioX96, ...rest }: GetAmountsAtNewPriceOptions): CurrencyAmount<Currency$1>[];
|
|
808
|
+
declare function getAverageLiquidity(ticks: Tick[], tickSpacing: number, tickLower: number, tickUpper: number): JSBI$1;
|
|
809
|
+
declare function getLiquidityFromSqrtRatioX96(ticks: Tick[], sqrtRatioX96: JSBI$1): JSBI$1;
|
|
810
|
+
declare function getLiquidityFromTick(ticks: Tick[], tick: number): JSBI$1;
|
|
811
|
+
|
|
812
|
+
declare function parseProtocolFees(feeProtocol: number | string): Percent[];
|
|
813
|
+
|
|
814
|
+
declare abstract class Multicall {
|
|
815
|
+
static INTERFACE: Interface;
|
|
816
|
+
/**
|
|
817
|
+
* Cannot be constructed.
|
|
818
|
+
*/
|
|
819
|
+
private constructor();
|
|
820
|
+
static encodeMulticall(calldatas: string | string[]): string;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
interface StandardPermitArguments {
|
|
824
|
+
v: 0 | 1 | 27 | 28;
|
|
825
|
+
r: string;
|
|
826
|
+
s: string;
|
|
827
|
+
amount: BigintIsh;
|
|
828
|
+
deadline: BigintIsh;
|
|
829
|
+
}
|
|
830
|
+
interface AllowedPermitArguments {
|
|
831
|
+
v: 0 | 1 | 27 | 28;
|
|
832
|
+
r: string;
|
|
833
|
+
s: string;
|
|
834
|
+
nonce: BigintIsh;
|
|
835
|
+
expiry: BigintIsh;
|
|
836
|
+
}
|
|
837
|
+
type PermitOptions = StandardPermitArguments | AllowedPermitArguments;
|
|
838
|
+
declare abstract class SelfPermit {
|
|
839
|
+
static INTERFACE: Interface;
|
|
840
|
+
/**
|
|
841
|
+
* Cannot be constructed.
|
|
842
|
+
*/
|
|
843
|
+
private constructor();
|
|
844
|
+
static encodePermit(token: Token, options: PermitOptions): string;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
declare const MaxUint128: string;
|
|
848
|
+
interface MintSpecificOptions {
|
|
849
|
+
/**
|
|
850
|
+
* The account that should receive the minted NFT.
|
|
851
|
+
*/
|
|
852
|
+
recipient: string;
|
|
853
|
+
/**
|
|
854
|
+
* Creates pool if not initialized before mint.
|
|
855
|
+
*/
|
|
856
|
+
createPool?: boolean;
|
|
857
|
+
}
|
|
858
|
+
interface IncreaseSpecificOptions {
|
|
859
|
+
/**
|
|
860
|
+
* Indicates the ID of the position to increase liquidity for.
|
|
861
|
+
*/
|
|
862
|
+
tokenId: BigintIsh;
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Options for producing the calldata to add liquidity.
|
|
866
|
+
*/
|
|
867
|
+
interface CommonAddLiquidityOptions {
|
|
868
|
+
/**
|
|
869
|
+
* How much the pool price is allowed to move.
|
|
870
|
+
*/
|
|
871
|
+
slippageTolerance: Percent;
|
|
872
|
+
/**
|
|
873
|
+
* When the transaction expires, in epoch seconds.
|
|
874
|
+
*/
|
|
875
|
+
deadline: BigintIsh;
|
|
876
|
+
/**
|
|
877
|
+
* Whether to spend ether. If true, one of the pool tokens must be WETH, by default false
|
|
878
|
+
*/
|
|
879
|
+
useNative?: NativeCurrency;
|
|
880
|
+
/**
|
|
881
|
+
* The optional permit parameters for spending token0
|
|
882
|
+
*/
|
|
883
|
+
token0Permit?: PermitOptions;
|
|
884
|
+
/**
|
|
885
|
+
* The optional permit parameters for spending token1
|
|
886
|
+
*/
|
|
887
|
+
token1Permit?: PermitOptions;
|
|
888
|
+
}
|
|
889
|
+
type MintOptions = CommonAddLiquidityOptions & MintSpecificOptions;
|
|
890
|
+
type IncreaseOptions = CommonAddLiquidityOptions & IncreaseSpecificOptions;
|
|
891
|
+
type AddLiquidityOptions = MintOptions | IncreaseOptions;
|
|
892
|
+
interface SafeTransferOptions {
|
|
893
|
+
/**
|
|
894
|
+
* The account sending the NFT.
|
|
895
|
+
*/
|
|
896
|
+
sender: string;
|
|
897
|
+
/**
|
|
898
|
+
* The account that should receive the NFT.
|
|
899
|
+
*/
|
|
900
|
+
recipient: string;
|
|
901
|
+
/**
|
|
902
|
+
* The id of the token being sent.
|
|
903
|
+
*/
|
|
904
|
+
tokenId: BigintIsh;
|
|
905
|
+
/**
|
|
906
|
+
* The optional parameter that passes data to the `onERC721Received` call for the staker
|
|
907
|
+
*/
|
|
908
|
+
data?: string;
|
|
909
|
+
}
|
|
910
|
+
declare function isMint(options: AddLiquidityOptions): options is MintOptions;
|
|
911
|
+
interface CollectOptions {
|
|
912
|
+
/**
|
|
913
|
+
* Indicates the ID of the position to collect for.
|
|
914
|
+
*/
|
|
915
|
+
tokenId: BigintIsh;
|
|
916
|
+
/**
|
|
917
|
+
* Expected value of tokensOwed0, including as-of-yet-unaccounted-for fees/liquidity value to be burned
|
|
918
|
+
*/
|
|
919
|
+
expectedCurrencyOwed0: CurrencyAmount<Currency$1>;
|
|
920
|
+
/**
|
|
921
|
+
* Expected value of tokensOwed1, including as-of-yet-unaccounted-for fees/liquidity value to be burned
|
|
922
|
+
*/
|
|
923
|
+
expectedCurrencyOwed1: CurrencyAmount<Currency$1>;
|
|
924
|
+
/**
|
|
925
|
+
* The account that should receive the tokens.
|
|
926
|
+
*/
|
|
927
|
+
recipient: string;
|
|
928
|
+
}
|
|
929
|
+
interface NFTPermitOptions {
|
|
930
|
+
v: 0 | 1 | 27 | 28;
|
|
931
|
+
r: string;
|
|
932
|
+
s: string;
|
|
933
|
+
deadline: BigintIsh;
|
|
934
|
+
spender: string;
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* Options for producing the calldata to exit a position.
|
|
938
|
+
*/
|
|
939
|
+
interface RemoveLiquidityOptions {
|
|
940
|
+
/**
|
|
941
|
+
* The ID of the token to exit
|
|
942
|
+
*/
|
|
943
|
+
tokenId: BigintIsh;
|
|
944
|
+
/**
|
|
945
|
+
* The percentage of position liquidity to exit.
|
|
946
|
+
*/
|
|
947
|
+
liquidityPercentage: Percent;
|
|
948
|
+
/**
|
|
949
|
+
* How much the pool price is allowed to move.
|
|
950
|
+
*/
|
|
951
|
+
slippageTolerance: Percent;
|
|
952
|
+
/**
|
|
953
|
+
* When the transaction expires, in epoch seconds.
|
|
954
|
+
*/
|
|
955
|
+
deadline: BigintIsh;
|
|
956
|
+
/**
|
|
957
|
+
* Whether the NFT should be burned if the entire position is being exited, by default false.
|
|
958
|
+
*/
|
|
959
|
+
burnToken?: boolean;
|
|
960
|
+
/**
|
|
961
|
+
* The optional permit of the token ID being exited, in case the exit transaction is being sent by an account that does not own the NFT
|
|
962
|
+
*/
|
|
963
|
+
permit?: NFTPermitOptions;
|
|
964
|
+
/**
|
|
965
|
+
* Parameters to be passed on to collect
|
|
966
|
+
*/
|
|
967
|
+
collectOptions: Omit<CollectOptions, 'tokenId'>;
|
|
968
|
+
}
|
|
969
|
+
declare abstract class NonfungiblePositionManager {
|
|
970
|
+
static INTERFACE: Interface;
|
|
971
|
+
/**
|
|
972
|
+
* Cannot be constructed.
|
|
973
|
+
*/
|
|
974
|
+
private constructor();
|
|
975
|
+
private static encodeCreate;
|
|
976
|
+
static createCallParameters(pool: Pool): MethodParameters;
|
|
977
|
+
static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters;
|
|
978
|
+
private static encodeCollect;
|
|
979
|
+
static collectCallParameters(options: CollectOptions): MethodParameters;
|
|
980
|
+
/**
|
|
981
|
+
* Produces the calldata for completely or partially exiting a position
|
|
982
|
+
* @param position The position to exit
|
|
983
|
+
* @param options Additional information necessary for generating the calldata
|
|
984
|
+
* @returns The call parameters
|
|
985
|
+
*/
|
|
986
|
+
static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters;
|
|
987
|
+
static safeTransferFromParameters(options: SafeTransferOptions): MethodParameters;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
interface FeeOptions {
|
|
991
|
+
/**
|
|
992
|
+
* The percent of the output that will be taken as a fee.
|
|
993
|
+
*/
|
|
994
|
+
fee: Percent;
|
|
995
|
+
/**
|
|
996
|
+
* The recipient of the fee.
|
|
997
|
+
*/
|
|
998
|
+
recipient: string;
|
|
999
|
+
}
|
|
1000
|
+
declare abstract class Payments {
|
|
1001
|
+
static INTERFACE: Interface;
|
|
1002
|
+
/**
|
|
1003
|
+
* Cannot be constructed.
|
|
1004
|
+
*/
|
|
1005
|
+
private constructor();
|
|
1006
|
+
private static encodeFeeBips;
|
|
1007
|
+
static encodeUnwrapWETH9(amountMinimum: JSBI, recipient: string, feeOptions?: FeeOptions): string;
|
|
1008
|
+
static encodeSweepToken(token: Token, amountMinimum: JSBI, recipient: string, feeOptions?: FeeOptions): string;
|
|
1009
|
+
static encodeRefundETH(): string;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Optional arguments to send to the quoter.
|
|
1014
|
+
*/
|
|
1015
|
+
interface QuoteOptions {
|
|
1016
|
+
/**
|
|
1017
|
+
* The optional price limit for the trade.
|
|
1018
|
+
*/
|
|
1019
|
+
sqrtPriceLimitX96?: BigintIsh;
|
|
1020
|
+
/**
|
|
1021
|
+
* The optional quoter interface to use
|
|
1022
|
+
*/
|
|
1023
|
+
useQuoterV2?: boolean;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Represents the Pancake V3 QuoterV1 contract with a method for returning the formatted
|
|
1027
|
+
* calldata needed to call the quoter contract.
|
|
1028
|
+
*/
|
|
1029
|
+
declare abstract class SwapQuoter {
|
|
1030
|
+
static V1INTERFACE: Interface;
|
|
1031
|
+
static V2INTERFACE: Interface;
|
|
1032
|
+
/**
|
|
1033
|
+
* Produces the on-chain method name of the appropriate function within QuoterV2,
|
|
1034
|
+
* and the relevant hex encoded parameters.
|
|
1035
|
+
* @template TInput The input token, either Ether or an ERC-20
|
|
1036
|
+
* @template TOutput The output token, either Ether or an ERC-20
|
|
1037
|
+
* @param route The swap route, a list of pools through which a swap can occur
|
|
1038
|
+
* @param amount The amount of the quote, either an amount in, or an amount out
|
|
1039
|
+
* @param tradeType The trade type, either exact input or exact output
|
|
1040
|
+
* @param options The optional params including price limit and Quoter contract switch
|
|
1041
|
+
* @returns The formatted calldata
|
|
1042
|
+
*/
|
|
1043
|
+
static quoteCallParameters<TInput extends Currency$1, TOutput extends Currency$1>(route: Route<TInput, TOutput>, amount: CurrencyAmount<TInput | TOutput>, tradeType: TradeType, options?: QuoteOptions): MethodParameters;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
type FullWithdrawOptions = ClaimOptions & WithdrawOptions;
|
|
1047
|
+
/**
|
|
1048
|
+
* Represents a unique staking program.
|
|
1049
|
+
*/
|
|
1050
|
+
interface IncentiveKey {
|
|
1051
|
+
/**
|
|
1052
|
+
* The token rewarded for participating in the staking program.
|
|
1053
|
+
*/
|
|
1054
|
+
rewardToken: Token;
|
|
1055
|
+
/**
|
|
1056
|
+
* The pool that the staked positions must provide in.
|
|
1057
|
+
*/
|
|
1058
|
+
pool: Pool;
|
|
1059
|
+
/**
|
|
1060
|
+
* The time when the incentive program begins.
|
|
1061
|
+
*/
|
|
1062
|
+
startTime: BigintIsh;
|
|
1063
|
+
/**
|
|
1064
|
+
* The time that the incentive program ends.
|
|
1065
|
+
*/
|
|
1066
|
+
endTime: BigintIsh;
|
|
1067
|
+
/**
|
|
1068
|
+
* The address which receives any remaining reward tokens at `endTime`.
|
|
1069
|
+
*/
|
|
1070
|
+
refundee: string;
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Options to specify when claiming rewards.
|
|
1074
|
+
*/
|
|
1075
|
+
interface ClaimOptions {
|
|
1076
|
+
/**
|
|
1077
|
+
* The id of the NFT
|
|
1078
|
+
*/
|
|
1079
|
+
tokenId: BigintIsh;
|
|
1080
|
+
/**
|
|
1081
|
+
* Address to send rewards to.
|
|
1082
|
+
*/
|
|
1083
|
+
recipient: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* The amount of `rewardToken` to claim. 0 claims all.
|
|
1086
|
+
*/
|
|
1087
|
+
amount?: BigintIsh;
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Options to specify when withdrawing a position.
|
|
1091
|
+
*/
|
|
1092
|
+
interface WithdrawOptions {
|
|
1093
|
+
/**
|
|
1094
|
+
* Set when withdrawing. The position will be sent to `owner` on withdraw.
|
|
1095
|
+
*/
|
|
1096
|
+
owner: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* Set when withdrawing. `data` is passed to `safeTransferFrom` when transferring the position from contract back to owner.
|
|
1099
|
+
*/
|
|
1100
|
+
data?: string;
|
|
1101
|
+
}
|
|
1102
|
+
declare abstract class Staker {
|
|
1103
|
+
static INTERFACE: Interface;
|
|
1104
|
+
protected constructor();
|
|
1105
|
+
private static INCENTIVE_KEY_ABI;
|
|
1106
|
+
/**
|
|
1107
|
+
* To claim rewards, must unstake and then claim.
|
|
1108
|
+
* @param incentiveKey The unique identifier of a staking program.
|
|
1109
|
+
* @param options Options for producing the calldata to claim. Can't claim unless you unstake.
|
|
1110
|
+
* @returns The calldatas for 'unstakeToken' and 'claimReward'.
|
|
1111
|
+
*/
|
|
1112
|
+
private static encodeClaim;
|
|
1113
|
+
/**
|
|
1114
|
+
*
|
|
1115
|
+
* Note: A `tokenId` can be staked in many programs but to claim rewards and continue the program you must unstake, claim, and then restake.
|
|
1116
|
+
* @param incentiveKeys An IncentiveKey or array of IncentiveKeys that `tokenId` is staked in.
|
|
1117
|
+
* Input an array of IncentiveKeys to claim rewards for each program.
|
|
1118
|
+
* @param options ClaimOptions to specify tokenId, recipient, and amount wanting to collect.
|
|
1119
|
+
* Note that you can only specify one amount and one recipient across the various programs if you are collecting from multiple programs at once.
|
|
1120
|
+
* @returns
|
|
1121
|
+
*/
|
|
1122
|
+
static collectRewards(incentiveKeys: IncentiveKey | IncentiveKey[], options: ClaimOptions): MethodParameters;
|
|
1123
|
+
/**
|
|
1124
|
+
*
|
|
1125
|
+
* @param incentiveKeys A list of incentiveKeys to unstake from. Should include all incentiveKeys (unique staking programs) that `options.tokenId` is staked in.
|
|
1126
|
+
* @param withdrawOptions Options for producing claim calldata and withdraw calldata. Can't withdraw without unstaking all programs for `tokenId`.
|
|
1127
|
+
* @returns Calldata for unstaking, claiming, and withdrawing.
|
|
1128
|
+
*/
|
|
1129
|
+
static withdrawToken(incentiveKeys: IncentiveKey | IncentiveKey[], withdrawOptions: FullWithdrawOptions): MethodParameters;
|
|
1130
|
+
/**
|
|
1131
|
+
*
|
|
1132
|
+
* @param incentiveKeys A single IncentiveKey or array of IncentiveKeys to be encoded and used in the data parameter in `safeTransferFrom`
|
|
1133
|
+
* @returns An IncentiveKey as a string
|
|
1134
|
+
*/
|
|
1135
|
+
static encodeDeposit(incentiveKeys: IncentiveKey | IncentiveKey[]): string;
|
|
1136
|
+
/**
|
|
1137
|
+
*
|
|
1138
|
+
* @param incentiveKey An `IncentiveKey` which represents a unique staking program.
|
|
1139
|
+
* @returns An encoded IncentiveKey to be read by ethers
|
|
1140
|
+
*/
|
|
1141
|
+
private static _encodeIncentiveKey;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* Options for producing the arguments to send calls to the router.
|
|
1146
|
+
*/
|
|
1147
|
+
interface SwapOptions {
|
|
1148
|
+
/**
|
|
1149
|
+
* How much the execution price is allowed to move unfavorably from the trade execution price.
|
|
1150
|
+
*/
|
|
1151
|
+
slippageTolerance: Percent;
|
|
1152
|
+
/**
|
|
1153
|
+
* The account that should receive the output.
|
|
1154
|
+
*/
|
|
1155
|
+
recipient: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* When the transaction expires, in epoch seconds.
|
|
1158
|
+
*/
|
|
1159
|
+
deadline: BigintIsh;
|
|
1160
|
+
/**
|
|
1161
|
+
* The optional permit parameters for spending the input.
|
|
1162
|
+
*/
|
|
1163
|
+
inputTokenPermit?: PermitOptions;
|
|
1164
|
+
/**
|
|
1165
|
+
* The optional price limit for the trade.
|
|
1166
|
+
*/
|
|
1167
|
+
sqrtPriceLimitX96?: BigintIsh;
|
|
1168
|
+
/**
|
|
1169
|
+
* Optional information for taking a fee on output.
|
|
1170
|
+
*/
|
|
1171
|
+
fee?: FeeOptions;
|
|
1172
|
+
}
|
|
1173
|
+
/**
|
|
1174
|
+
* Represents the Pancake V3 SwapRouter, and has static methods for helping execute trades.
|
|
1175
|
+
*/
|
|
1176
|
+
declare abstract class SwapRouter {
|
|
1177
|
+
static INTERFACE: Interface;
|
|
1178
|
+
/**
|
|
1179
|
+
* Cannot be constructed.
|
|
1180
|
+
*/
|
|
1181
|
+
private constructor();
|
|
1182
|
+
/**
|
|
1183
|
+
* Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.
|
|
1184
|
+
* @param trade to produce call parameters for
|
|
1185
|
+
* @param options options for the call parameters
|
|
1186
|
+
*/
|
|
1187
|
+
static swapCallParameters(trades: Trade<Currency$1, Currency$1, TradeType> | Trade<Currency$1, Currency$1, TradeType>[], options: SwapOptions): MethodParameters;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
interface WidthDrawOptions {
|
|
1191
|
+
tokenId: BigintIsh;
|
|
1192
|
+
to: string;
|
|
1193
|
+
}
|
|
1194
|
+
interface HarvestOptions {
|
|
1195
|
+
tokenId: BigintIsh;
|
|
1196
|
+
to: string;
|
|
1197
|
+
}
|
|
1198
|
+
declare abstract class MasterChefV3 {
|
|
1199
|
+
static INTERFACE: Interface;
|
|
1200
|
+
/**
|
|
1201
|
+
* Cannot be constructed.
|
|
1202
|
+
*/
|
|
1203
|
+
private constructor();
|
|
1204
|
+
static addCallParameters(position: Position, options: AddLiquidityOptions): MethodParameters;
|
|
1205
|
+
private static encodeCollect;
|
|
1206
|
+
static collectCallParameters(options: CollectOptions): MethodParameters;
|
|
1207
|
+
static removeCallParameters(position: Position, options: RemoveLiquidityOptions): MethodParameters;
|
|
1208
|
+
static harvestCallParameters(options: HarvestOptions): {
|
|
1209
|
+
calldata: string;
|
|
1210
|
+
value: string;
|
|
1211
|
+
};
|
|
1212
|
+
static batchHarvestCallParameters(options: HarvestOptions[]): {
|
|
1213
|
+
calldata: string;
|
|
1214
|
+
value: string;
|
|
1215
|
+
};
|
|
1216
|
+
private static encodeHarvest;
|
|
1217
|
+
static withdrawCallParameters(options: WidthDrawOptions): {
|
|
1218
|
+
calldata: string;
|
|
1219
|
+
value: string;
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
export { ADDRESS_ZERO, AddLiquidityOptions, AllowedPermitArguments, BestTradeOptions, ClaimOptions, CollectOptions, CommonAddLiquidityOptions, DEPLOYER_ADDRESS, DEPLOYER_ADDRESSES, FACTORY_ADDRESS, FeeAmount, FeeCalculator, FeeOptions, FullMath, FullWithdrawOptions, IncentiveKey, IncreaseOptions, IncreaseSpecificOptions, LiquidityMath, MasterChefV3, MaxUint128, MethodParameters, MintOptions, MintSpecificOptions, Multicall, NFTPermitOptions, NoTickDataProvider, NonfungiblePositionManager, POOL_INIT_CODE_HASH, Payments, PermitOptions, Pool, Position, PositionLibrary, PositionMath, QuoteOptions, RemoveLiquidityOptions, Route, SafeTransferOptions, SelfPermit, SqrtPriceMath, Staker, StandardPermitArguments, SwapMath, SwapOptions, SwapQuoter, SwapRouter, TICK_SPACINGS, Tick, TickConstructorArgs, TickDataProvider, TickLibrary, TickList, TickListDataProvider, TickMath, Trade, WithdrawOptions, computePoolAddress, encodeRouteToPath, encodeSqrtRatioX96, getAmountsAtNewPrice, getAmountsByLiquidityAndPrice, getAverageLiquidity, getDependentAmount, getEstimatedLPFee, getEstimatedLPFeeWithProtocolFee, getLiquidityByAmountsAndPrice, getLiquidityBySingleAmount, getLiquidityFromSqrtRatioX96, getLiquidityFromTick, isMint, isSorted, maxLiquidityForAmounts, mostSignificantBit, nearestUsableTick, parseProtocolFees, priceToClosestTick, subIn256, tickToPrice, toHex, tradeComparator };
|