@pancakeswap/v3-sdk 1.0.0 → 3.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.
Files changed (102) hide show
  1. package/LICENSE +674 -0
  2. package/dist/abi/MasterChefV3.d.ts +1222 -0
  3. package/dist/abi/MasterChefV3.d.ts.map +1 -0
  4. package/dist/abi/NonfungiblePositionManager.d.ts +962 -0
  5. package/dist/abi/NonfungiblePositionManager.d.ts.map +1 -0
  6. package/dist/abi/PeripheryPaymentsWithFee.d.ts +88 -0
  7. package/dist/abi/PeripheryPaymentsWithFee.d.ts.map +1 -0
  8. package/dist/abi/Quoter.d.ts +162 -0
  9. package/dist/abi/Quoter.d.ts.map +1 -0
  10. package/dist/abi/QuoterV2.d.ts +220 -0
  11. package/dist/abi/QuoterV2.d.ts.map +1 -0
  12. package/dist/abi/SelfPermit.d.ts +122 -0
  13. package/dist/abi/SelfPermit.d.ts.map +1 -0
  14. package/dist/abi/SwapRouter.d.ts +453 -0
  15. package/dist/abi/SwapRouter.d.ts.map +1 -0
  16. package/dist/abi/V3Staker.d.ts +547 -0
  17. package/dist/abi/V3Staker.d.ts.map +1 -0
  18. package/dist/constants.d.ts +26 -0
  19. package/dist/constants.d.ts.map +1 -0
  20. package/dist/entities/index.d.ts +8 -0
  21. package/dist/entities/index.d.ts.map +1 -0
  22. package/dist/entities/pool.d.ts +83 -0
  23. package/dist/entities/pool.d.ts.map +1 -0
  24. package/dist/entities/position.d.ts +131 -0
  25. package/dist/entities/position.d.ts.map +1 -0
  26. package/dist/entities/route.d.ts +27 -0
  27. package/dist/entities/route.d.ts.map +1 -0
  28. package/dist/entities/tick.d.ts +13 -0
  29. package/dist/entities/tick.d.ts.map +1 -0
  30. package/dist/entities/tickDataProvider.d.ts +32 -0
  31. package/dist/entities/tickDataProvider.d.ts.map +1 -0
  32. package/dist/entities/tickListDataProvider.d.ts +16 -0
  33. package/dist/entities/tickListDataProvider.d.ts.map +1 -0
  34. package/dist/entities/trade.d.ts +221 -0
  35. package/dist/entities/trade.d.ts.map +1 -0
  36. package/dist/index.d.ts +20 -1223
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +1167 -1092
  39. package/dist/index.mjs +1158 -1093
  40. package/dist/internalConstants.d.ts +11 -0
  41. package/dist/internalConstants.d.ts.map +1 -0
  42. package/dist/masterchefV3.d.ts +1258 -0
  43. package/dist/masterchefV3.d.ts.map +1 -0
  44. package/dist/multicall.d.ts +23 -0
  45. package/dist/multicall.d.ts.map +1 -0
  46. package/dist/nonfungiblePositionManager.d.ts +1115 -0
  47. package/dist/nonfungiblePositionManager.d.ts.map +1 -0
  48. package/dist/payments.d.ts +113 -0
  49. package/dist/payments.d.ts.map +1 -0
  50. package/dist/quoter.d.ts +419 -0
  51. package/dist/quoter.d.ts.map +1 -0
  52. package/dist/selfPermit.d.ts +146 -0
  53. package/dist/selfPermit.d.ts.map +1 -0
  54. package/dist/staker.d.ts +648 -0
  55. package/dist/staker.d.ts.map +1 -0
  56. package/dist/swapRouter.d.ts +502 -0
  57. package/dist/swapRouter.d.ts.map +1 -0
  58. package/dist/utils/calldata.d.ts +22 -0
  59. package/dist/utils/calldata.d.ts.map +1 -0
  60. package/dist/utils/computePoolAddress.d.ts +20 -0
  61. package/dist/utils/computePoolAddress.d.ts.map +1 -0
  62. package/dist/utils/encodeRouteToPath.d.ts +10 -0
  63. package/dist/utils/encodeRouteToPath.d.ts.map +1 -0
  64. package/dist/utils/encodeSqrtRatioX96.d.ts +9 -0
  65. package/dist/utils/encodeSqrtRatioX96.d.ts.map +1 -0
  66. package/dist/utils/feeCalculator.d.ts +65 -0
  67. package/dist/utils/feeCalculator.d.ts.map +1 -0
  68. package/dist/utils/fullMath.d.ts +8 -0
  69. package/dist/utils/fullMath.d.ts.map +1 -0
  70. package/dist/utils/index.d.ts +22 -0
  71. package/dist/utils/index.d.ts.map +1 -0
  72. package/dist/utils/isSorted.d.ts +8 -0
  73. package/dist/utils/isSorted.d.ts.map +1 -0
  74. package/dist/utils/liquidityMath.d.ts +8 -0
  75. package/dist/utils/liquidityMath.d.ts.map +1 -0
  76. package/dist/utils/maxLiquidityForAmounts.d.ts +14 -0
  77. package/dist/utils/maxLiquidityForAmounts.d.ts.map +1 -0
  78. package/dist/utils/mostSignificantBit.d.ts +2 -0
  79. package/dist/utils/mostSignificantBit.d.ts.map +1 -0
  80. package/dist/utils/nearestUsableTick.d.ts +7 -0
  81. package/dist/utils/nearestUsableTick.d.ts.map +1 -0
  82. package/dist/utils/parseProtocolFees.d.ts +3 -0
  83. package/dist/utils/parseProtocolFees.d.ts.map +1 -0
  84. package/dist/utils/position.d.ts +8 -0
  85. package/dist/utils/position.d.ts.map +1 -0
  86. package/dist/utils/positionMath.d.ts +8 -0
  87. package/dist/utils/positionMath.d.ts.map +1 -0
  88. package/dist/utils/priceTickConversions.d.ts +16 -0
  89. package/dist/utils/priceTickConversions.d.ts.map +1 -0
  90. package/dist/utils/sqrtPriceMath.d.ts +13 -0
  91. package/dist/utils/sqrtPriceMath.d.ts.map +1 -0
  92. package/dist/utils/sqrtRatioX96ToPrice.d.ts +3 -0
  93. package/dist/utils/sqrtRatioX96ToPrice.d.ts.map +1 -0
  94. package/dist/utils/swapMath.d.ts +9 -0
  95. package/dist/utils/swapMath.d.ts.map +1 -0
  96. package/dist/utils/tickLibrary.d.ts +14 -0
  97. package/dist/utils/tickLibrary.d.ts.map +1 -0
  98. package/dist/utils/tickList.d.ts +25 -0
  99. package/dist/utils/tickList.d.ts.map +1 -0
  100. package/dist/utils/tickMath.d.ts +34 -0
  101. package/dist/utils/tickMath.d.ts.map +1 -0
  102. package/package.json +17 -23
@@ -0,0 +1,502 @@
1
+ import { BigintIsh, Currency, Percent, TradeType } from '@pancakeswap/sdk';
2
+ import { Trade } from './entities/trade';
3
+ import { PermitOptions } from './selfPermit';
4
+ import { MethodParameters } from './utils/calldata';
5
+ import { FeeOptions } from './payments';
6
+ /**
7
+ * Options for producing the arguments to send calls to the router.
8
+ */
9
+ export interface SwapOptions {
10
+ /**
11
+ * How much the execution price is allowed to move unfavorably from the trade execution price.
12
+ */
13
+ slippageTolerance: Percent;
14
+ /**
15
+ * The account that should receive the output.
16
+ */
17
+ recipient: string;
18
+ /**
19
+ * When the transaction expires, in epoch seconds.
20
+ */
21
+ deadline: BigintIsh;
22
+ /**
23
+ * The optional permit parameters for spending the input.
24
+ */
25
+ inputTokenPermit?: PermitOptions;
26
+ /**
27
+ * The optional price limit for the trade.
28
+ */
29
+ sqrtPriceLimitX96?: BigintIsh;
30
+ /**
31
+ * Optional information for taking a fee on output.
32
+ */
33
+ fee?: FeeOptions;
34
+ }
35
+ /**
36
+ * Represents the Pancake V3 SwapRouter, and has static methods for helping execute trades.
37
+ */
38
+ export declare abstract class SwapRouter {
39
+ static ABI: readonly [{
40
+ readonly inputs: readonly [{
41
+ readonly internalType: "address";
42
+ readonly name: "_deployer";
43
+ readonly type: "address";
44
+ }, {
45
+ readonly internalType: "address";
46
+ readonly name: "_factory";
47
+ readonly type: "address";
48
+ }, {
49
+ readonly internalType: "address";
50
+ readonly name: "_WETH9";
51
+ readonly type: "address";
52
+ }];
53
+ readonly stateMutability: "nonpayable";
54
+ readonly type: "constructor";
55
+ }, {
56
+ readonly inputs: readonly [];
57
+ readonly name: "WETH9";
58
+ readonly outputs: readonly [{
59
+ readonly internalType: "address";
60
+ readonly name: "";
61
+ readonly type: "address";
62
+ }];
63
+ readonly stateMutability: "view";
64
+ readonly type: "function";
65
+ }, {
66
+ readonly inputs: readonly [];
67
+ readonly name: "deployer";
68
+ readonly outputs: readonly [{
69
+ readonly internalType: "address";
70
+ readonly name: "";
71
+ readonly type: "address";
72
+ }];
73
+ readonly stateMutability: "view";
74
+ readonly type: "function";
75
+ }, {
76
+ readonly inputs: readonly [{
77
+ readonly components: readonly [{
78
+ readonly internalType: "bytes";
79
+ readonly name: "path";
80
+ readonly type: "bytes";
81
+ }, {
82
+ readonly internalType: "address";
83
+ readonly name: "recipient";
84
+ readonly type: "address";
85
+ }, {
86
+ readonly internalType: "uint256";
87
+ readonly name: "deadline";
88
+ readonly type: "uint256";
89
+ }, {
90
+ readonly internalType: "uint256";
91
+ readonly name: "amountIn";
92
+ readonly type: "uint256";
93
+ }, {
94
+ readonly internalType: "uint256";
95
+ readonly name: "amountOutMinimum";
96
+ readonly type: "uint256";
97
+ }];
98
+ readonly internalType: "struct ISwapRouter.ExactInputParams";
99
+ readonly name: "params";
100
+ readonly type: "tuple";
101
+ }];
102
+ readonly name: "exactInput";
103
+ readonly outputs: readonly [{
104
+ readonly internalType: "uint256";
105
+ readonly name: "amountOut";
106
+ readonly type: "uint256";
107
+ }];
108
+ readonly stateMutability: "payable";
109
+ readonly type: "function";
110
+ }, {
111
+ readonly inputs: readonly [{
112
+ readonly components: readonly [{
113
+ readonly internalType: "address";
114
+ readonly name: "tokenIn";
115
+ readonly type: "address";
116
+ }, {
117
+ readonly internalType: "address";
118
+ readonly name: "tokenOut";
119
+ readonly type: "address";
120
+ }, {
121
+ readonly internalType: "uint24";
122
+ readonly name: "fee";
123
+ readonly type: "uint24";
124
+ }, {
125
+ readonly internalType: "address";
126
+ readonly name: "recipient";
127
+ readonly type: "address";
128
+ }, {
129
+ readonly internalType: "uint256";
130
+ readonly name: "deadline";
131
+ readonly type: "uint256";
132
+ }, {
133
+ readonly internalType: "uint256";
134
+ readonly name: "amountIn";
135
+ readonly type: "uint256";
136
+ }, {
137
+ readonly internalType: "uint256";
138
+ readonly name: "amountOutMinimum";
139
+ readonly type: "uint256";
140
+ }, {
141
+ readonly internalType: "uint160";
142
+ readonly name: "sqrtPriceLimitX96";
143
+ readonly type: "uint160";
144
+ }];
145
+ readonly internalType: "struct ISwapRouter.ExactInputSingleParams";
146
+ readonly name: "params";
147
+ readonly type: "tuple";
148
+ }];
149
+ readonly name: "exactInputSingle";
150
+ readonly outputs: readonly [{
151
+ readonly internalType: "uint256";
152
+ readonly name: "amountOut";
153
+ readonly type: "uint256";
154
+ }];
155
+ readonly stateMutability: "payable";
156
+ readonly type: "function";
157
+ }, {
158
+ readonly inputs: readonly [{
159
+ readonly components: readonly [{
160
+ readonly internalType: "bytes";
161
+ readonly name: "path";
162
+ readonly type: "bytes";
163
+ }, {
164
+ readonly internalType: "address";
165
+ readonly name: "recipient";
166
+ readonly type: "address";
167
+ }, {
168
+ readonly internalType: "uint256";
169
+ readonly name: "deadline";
170
+ readonly type: "uint256";
171
+ }, {
172
+ readonly internalType: "uint256";
173
+ readonly name: "amountOut";
174
+ readonly type: "uint256";
175
+ }, {
176
+ readonly internalType: "uint256";
177
+ readonly name: "amountInMaximum";
178
+ readonly type: "uint256";
179
+ }];
180
+ readonly internalType: "struct ISwapRouter.ExactOutputParams";
181
+ readonly name: "params";
182
+ readonly type: "tuple";
183
+ }];
184
+ readonly name: "exactOutput";
185
+ readonly outputs: readonly [{
186
+ readonly internalType: "uint256";
187
+ readonly name: "amountIn";
188
+ readonly type: "uint256";
189
+ }];
190
+ readonly stateMutability: "payable";
191
+ readonly type: "function";
192
+ }, {
193
+ readonly inputs: readonly [{
194
+ readonly components: readonly [{
195
+ readonly internalType: "address";
196
+ readonly name: "tokenIn";
197
+ readonly type: "address";
198
+ }, {
199
+ readonly internalType: "address";
200
+ readonly name: "tokenOut";
201
+ readonly type: "address";
202
+ }, {
203
+ readonly internalType: "uint24";
204
+ readonly name: "fee";
205
+ readonly type: "uint24";
206
+ }, {
207
+ readonly internalType: "address";
208
+ readonly name: "recipient";
209
+ readonly type: "address";
210
+ }, {
211
+ readonly internalType: "uint256";
212
+ readonly name: "deadline";
213
+ readonly type: "uint256";
214
+ }, {
215
+ readonly internalType: "uint256";
216
+ readonly name: "amountOut";
217
+ readonly type: "uint256";
218
+ }, {
219
+ readonly internalType: "uint256";
220
+ readonly name: "amountInMaximum";
221
+ readonly type: "uint256";
222
+ }, {
223
+ readonly internalType: "uint160";
224
+ readonly name: "sqrtPriceLimitX96";
225
+ readonly type: "uint160";
226
+ }];
227
+ readonly internalType: "struct ISwapRouter.ExactOutputSingleParams";
228
+ readonly name: "params";
229
+ readonly type: "tuple";
230
+ }];
231
+ readonly name: "exactOutputSingle";
232
+ readonly outputs: readonly [{
233
+ readonly internalType: "uint256";
234
+ readonly name: "amountIn";
235
+ readonly type: "uint256";
236
+ }];
237
+ readonly stateMutability: "payable";
238
+ readonly type: "function";
239
+ }, {
240
+ readonly inputs: readonly [];
241
+ readonly name: "factory";
242
+ readonly outputs: readonly [{
243
+ readonly internalType: "address";
244
+ readonly name: "";
245
+ readonly type: "address";
246
+ }];
247
+ readonly stateMutability: "view";
248
+ readonly type: "function";
249
+ }, {
250
+ readonly inputs: readonly [{
251
+ readonly internalType: "bytes[]";
252
+ readonly name: "data";
253
+ readonly type: "bytes[]";
254
+ }];
255
+ readonly name: "multicall";
256
+ readonly outputs: readonly [{
257
+ readonly internalType: "bytes[]";
258
+ readonly name: "results";
259
+ readonly type: "bytes[]";
260
+ }];
261
+ readonly stateMutability: "payable";
262
+ readonly type: "function";
263
+ }, {
264
+ readonly inputs: readonly [{
265
+ readonly internalType: "int256";
266
+ readonly name: "amount0Delta";
267
+ readonly type: "int256";
268
+ }, {
269
+ readonly internalType: "int256";
270
+ readonly name: "amount1Delta";
271
+ readonly type: "int256";
272
+ }, {
273
+ readonly internalType: "bytes";
274
+ readonly name: "_data";
275
+ readonly type: "bytes";
276
+ }];
277
+ readonly name: "pancakeV3SwapCallback";
278
+ readonly outputs: readonly [];
279
+ readonly stateMutability: "nonpayable";
280
+ readonly type: "function";
281
+ }, {
282
+ readonly inputs: readonly [];
283
+ readonly name: "refundETH";
284
+ readonly outputs: readonly [];
285
+ readonly stateMutability: "payable";
286
+ readonly type: "function";
287
+ }, {
288
+ readonly inputs: readonly [{
289
+ readonly internalType: "address";
290
+ readonly name: "token";
291
+ readonly type: "address";
292
+ }, {
293
+ readonly internalType: "uint256";
294
+ readonly name: "value";
295
+ readonly type: "uint256";
296
+ }, {
297
+ readonly internalType: "uint256";
298
+ readonly name: "deadline";
299
+ readonly type: "uint256";
300
+ }, {
301
+ readonly internalType: "uint8";
302
+ readonly name: "v";
303
+ readonly type: "uint8";
304
+ }, {
305
+ readonly internalType: "bytes32";
306
+ readonly name: "r";
307
+ readonly type: "bytes32";
308
+ }, {
309
+ readonly internalType: "bytes32";
310
+ readonly name: "s";
311
+ readonly type: "bytes32";
312
+ }];
313
+ readonly name: "selfPermit";
314
+ readonly outputs: readonly [];
315
+ readonly stateMutability: "payable";
316
+ readonly type: "function";
317
+ }, {
318
+ readonly inputs: readonly [{
319
+ readonly internalType: "address";
320
+ readonly name: "token";
321
+ readonly type: "address";
322
+ }, {
323
+ readonly internalType: "uint256";
324
+ readonly name: "nonce";
325
+ readonly type: "uint256";
326
+ }, {
327
+ readonly internalType: "uint256";
328
+ readonly name: "expiry";
329
+ readonly type: "uint256";
330
+ }, {
331
+ readonly internalType: "uint8";
332
+ readonly name: "v";
333
+ readonly type: "uint8";
334
+ }, {
335
+ readonly internalType: "bytes32";
336
+ readonly name: "r";
337
+ readonly type: "bytes32";
338
+ }, {
339
+ readonly internalType: "bytes32";
340
+ readonly name: "s";
341
+ readonly type: "bytes32";
342
+ }];
343
+ readonly name: "selfPermitAllowed";
344
+ readonly outputs: readonly [];
345
+ readonly stateMutability: "payable";
346
+ readonly type: "function";
347
+ }, {
348
+ readonly inputs: readonly [{
349
+ readonly internalType: "address";
350
+ readonly name: "token";
351
+ readonly type: "address";
352
+ }, {
353
+ readonly internalType: "uint256";
354
+ readonly name: "nonce";
355
+ readonly type: "uint256";
356
+ }, {
357
+ readonly internalType: "uint256";
358
+ readonly name: "expiry";
359
+ readonly type: "uint256";
360
+ }, {
361
+ readonly internalType: "uint8";
362
+ readonly name: "v";
363
+ readonly type: "uint8";
364
+ }, {
365
+ readonly internalType: "bytes32";
366
+ readonly name: "r";
367
+ readonly type: "bytes32";
368
+ }, {
369
+ readonly internalType: "bytes32";
370
+ readonly name: "s";
371
+ readonly type: "bytes32";
372
+ }];
373
+ readonly name: "selfPermitAllowedIfNecessary";
374
+ readonly outputs: readonly [];
375
+ readonly stateMutability: "payable";
376
+ readonly type: "function";
377
+ }, {
378
+ readonly inputs: readonly [{
379
+ readonly internalType: "address";
380
+ readonly name: "token";
381
+ readonly type: "address";
382
+ }, {
383
+ readonly internalType: "uint256";
384
+ readonly name: "value";
385
+ readonly type: "uint256";
386
+ }, {
387
+ readonly internalType: "uint256";
388
+ readonly name: "deadline";
389
+ readonly type: "uint256";
390
+ }, {
391
+ readonly internalType: "uint8";
392
+ readonly name: "v";
393
+ readonly type: "uint8";
394
+ }, {
395
+ readonly internalType: "bytes32";
396
+ readonly name: "r";
397
+ readonly type: "bytes32";
398
+ }, {
399
+ readonly internalType: "bytes32";
400
+ readonly name: "s";
401
+ readonly type: "bytes32";
402
+ }];
403
+ readonly name: "selfPermitIfNecessary";
404
+ readonly outputs: readonly [];
405
+ readonly stateMutability: "payable";
406
+ readonly type: "function";
407
+ }, {
408
+ readonly inputs: readonly [{
409
+ readonly internalType: "address";
410
+ readonly name: "token";
411
+ readonly type: "address";
412
+ }, {
413
+ readonly internalType: "uint256";
414
+ readonly name: "amountMinimum";
415
+ readonly type: "uint256";
416
+ }, {
417
+ readonly internalType: "address";
418
+ readonly name: "recipient";
419
+ readonly type: "address";
420
+ }];
421
+ readonly name: "sweepToken";
422
+ readonly outputs: readonly [];
423
+ readonly stateMutability: "payable";
424
+ readonly type: "function";
425
+ }, {
426
+ readonly inputs: readonly [{
427
+ readonly internalType: "address";
428
+ readonly name: "token";
429
+ readonly type: "address";
430
+ }, {
431
+ readonly internalType: "uint256";
432
+ readonly name: "amountMinimum";
433
+ readonly type: "uint256";
434
+ }, {
435
+ readonly internalType: "address";
436
+ readonly name: "recipient";
437
+ readonly type: "address";
438
+ }, {
439
+ readonly internalType: "uint256";
440
+ readonly name: "feeBips";
441
+ readonly type: "uint256";
442
+ }, {
443
+ readonly internalType: "address";
444
+ readonly name: "feeRecipient";
445
+ readonly type: "address";
446
+ }];
447
+ readonly name: "sweepTokenWithFee";
448
+ readonly outputs: readonly [];
449
+ readonly stateMutability: "payable";
450
+ readonly type: "function";
451
+ }, {
452
+ readonly inputs: readonly [{
453
+ readonly internalType: "uint256";
454
+ readonly name: "amountMinimum";
455
+ readonly type: "uint256";
456
+ }, {
457
+ readonly internalType: "address";
458
+ readonly name: "recipient";
459
+ readonly type: "address";
460
+ }];
461
+ readonly name: "unwrapWETH9";
462
+ readonly outputs: readonly [];
463
+ readonly stateMutability: "payable";
464
+ readonly type: "function";
465
+ }, {
466
+ readonly inputs: readonly [{
467
+ readonly internalType: "uint256";
468
+ readonly name: "amountMinimum";
469
+ readonly type: "uint256";
470
+ }, {
471
+ readonly internalType: "address";
472
+ readonly name: "recipient";
473
+ readonly type: "address";
474
+ }, {
475
+ readonly internalType: "uint256";
476
+ readonly name: "feeBips";
477
+ readonly type: "uint256";
478
+ }, {
479
+ readonly internalType: "address";
480
+ readonly name: "feeRecipient";
481
+ readonly type: "address";
482
+ }];
483
+ readonly name: "unwrapWETH9WithFee";
484
+ readonly outputs: readonly [];
485
+ readonly stateMutability: "payable";
486
+ readonly type: "function";
487
+ }, {
488
+ readonly stateMutability: "payable";
489
+ readonly type: "receive";
490
+ }];
491
+ /**
492
+ * Cannot be constructed.
493
+ */
494
+ private constructor();
495
+ /**
496
+ * Produces the on-chain method name to call and the hex encoded parameters to pass as arguments for a given trade.
497
+ * @param trade to produce call parameters for
498
+ * @param options options for the call parameters
499
+ */
500
+ static swapCallParameters(trades: Trade<Currency, Currency, TradeType> | Trade<Currency, Currency, TradeType>[], options: SwapOptions): MethodParameters;
501
+ }
502
+ //# sourceMappingURL=swapRouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swapRouter.d.ts","sourceRoot":"","sources":["../src/swapRouter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,OAAO,EAAE,SAAS,EAA2B,MAAM,kBAAkB,CAAA;AAInH,OAAO,EAAE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AAC,GAAG,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,EACrF,OAAO,EAAE,WAAW,GACnB,gBAAgB;CAgKpB"}
@@ -0,0 +1,22 @@
1
+ import { BigintIsh } from '@pancakeswap/sdk';
2
+ import { Hex } from 'viem';
3
+ /**
4
+ * Generated method parameters for executing a call.
5
+ */
6
+ export interface MethodParameters {
7
+ /**
8
+ * The hex encoded calldata to perform the given operation
9
+ */
10
+ calldata: Hex;
11
+ /**
12
+ * The amount of ether (wei) to send in hex.
13
+ */
14
+ value: Hex;
15
+ }
16
+ /**
17
+ * Converts a big int to a hex string
18
+ * @param bigintIsh
19
+ * @returns The hex encoded calldata
20
+ */
21
+ export declare function toHex(bigintIsh: BigintIsh): Hex;
22
+ //# sourceMappingURL=calldata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calldata.d.ts","sourceRoot":"","sources":["../../src/utils/calldata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAE1B;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAA;IACb;;OAEG;IACH,KAAK,EAAE,GAAG,CAAA;CACX;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,CAO/C"}
@@ -0,0 +1,20 @@
1
+ import { Address, Hash } from 'viem';
2
+ import { Token } from '@pancakeswap/sdk';
3
+ import { FeeAmount } from '../constants';
4
+ /**
5
+ * Computes a pool address
6
+ * @param deployerAddress The Pancake V3 deployer address
7
+ * @param tokenA The first token of the pair, irrespective of sort order
8
+ * @param tokenB The second token of the pair, irrespective of sort order
9
+ * @param fee The fee tier of the pool
10
+ * @param initCodeHashManualOverride Override the init code hash used to compute the pool address if necessary
11
+ * @returns The pool address
12
+ */
13
+ export declare function computePoolAddress({ deployerAddress, tokenA, tokenB, fee, initCodeHashManualOverride, }: {
14
+ deployerAddress: Address;
15
+ tokenA: Token;
16
+ tokenB: Token;
17
+ fee: FeeAmount;
18
+ initCodeHashManualOverride?: Hash;
19
+ }): Address;
20
+ //# sourceMappingURL=computePoolAddress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computePoolAddress.d.ts","sourceRoot":"","sources":["../../src/utils/computePoolAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EAGP,IAAI,EAUL,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAA;AAe7D;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,MAAM,EACN,MAAM,EACN,GAAG,EACH,0BAA0B,GAC3B,EAAE;IACD,eAAe,EAAE,OAAO,CAAA;IACxB,MAAM,EAAE,KAAK,CAAA;IACb,MAAM,EAAE,KAAK,CAAA;IACb,GAAG,EAAE,SAAS,CAAA;IACd,0BAA0B,CAAC,EAAE,IAAI,CAAA;CAClC,GAAG,OAAO,CAUV"}
@@ -0,0 +1,10 @@
1
+ import { Hash } from 'viem';
2
+ import { Currency } from '@pancakeswap/swap-sdk-core';
3
+ import { Route } from '../entities/route';
4
+ /**
5
+ * Converts a route to a hex encoded path
6
+ * @param route the v3 path to convert to an encoded path
7
+ * @param exactOutput whether the route should be encoded in reverse, for making exact output swaps
8
+ */
9
+ export declare function encodeRouteToPath(route: Route<Currency, Currency>, exactOutput: boolean): Hash;
10
+ //# sourceMappingURL=encodeRouteToPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodeRouteToPath.d.ts","sourceRoot":"","sources":["../../src/utils/encodeRouteToPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAS,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,CA2B9F"}
@@ -0,0 +1,9 @@
1
+ import { BigintIsh } from '@pancakeswap/swap-sdk-core';
2
+ /**
3
+ * Returns the sqrt ratio as a Q64.96 corresponding to a given ratio of amount1 and amount0
4
+ * @param amount1 The numerator amount i.e., the amount of token1
5
+ * @param amount0 The denominator amount i.e., the amount of token0
6
+ * @returns The sqrt ratio
7
+ */
8
+ export declare function encodeSqrtRatioX96(amount1: BigintIsh, amount0: BigintIsh): bigint;
9
+ //# sourceMappingURL=encodeSqrtRatioX96.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodeSqrtRatioX96.d.ts","sourceRoot":"","sources":["../../src/utils/encodeSqrtRatioX96.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,MAAM,4BAA4B,CAAA;AAE5D;;;;;GAKG;AAEH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,GAAG,MAAM,CAKjF"}
@@ -0,0 +1,65 @@
1
+ import { Currency, CurrencyAmount, Percent, Fraction } from '@pancakeswap/swap-sdk-core';
2
+ import { Tick } from '../entities';
3
+ export declare const FeeCalculator: {
4
+ getEstimatedLPFee: typeof getEstimatedLPFee;
5
+ getEstimatedLPFeeByAmounts: typeof getEstimatedLPFeeByAmounts;
6
+ getLiquidityFromTick: typeof getLiquidityFromTick;
7
+ getLiquidityFromSqrtRatioX96: typeof getLiquidityFromSqrtRatioX96;
8
+ getAverageLiquidity: typeof getAverageLiquidity;
9
+ getLiquidityBySingleAmount: typeof getLiquidityBySingleAmount;
10
+ getDependentAmount: typeof getDependentAmount;
11
+ getLiquidityByAmountsAndPrice: typeof getLiquidityByAmountsAndPrice;
12
+ getAmountsByLiquidityAndPrice: typeof getAmountsByLiquidityAndPrice;
13
+ getAmountsAtNewPrice: typeof getAmountsAtNewPrice;
14
+ };
15
+ interface EstimateFeeOptions {
16
+ amount: CurrencyAmount<Currency>;
17
+ currency: Currency;
18
+ tickLower: number;
19
+ tickUpper: number;
20
+ volume24H: number;
21
+ sqrtRatioX96: bigint;
22
+ mostActiveLiquidity: bigint;
23
+ fee: number;
24
+ insidePercentage?: Percent;
25
+ protocolFee?: Percent;
26
+ }
27
+ export declare function getEstimatedLPFeeWithProtocolFee({ amount, currency, ...rest }: EstimateFeeOptions): Fraction;
28
+ export declare function getEstimatedLPFee({ amount, currency, ...rest }: EstimateFeeOptions): Fraction;
29
+ interface EstimateFeeByAmountsOptions extends Omit<EstimateFeeOptions, 'amount' | 'currency'> {
30
+ amountA: CurrencyAmount<Currency>;
31
+ amountB: CurrencyAmount<Currency>;
32
+ }
33
+ export declare function getEstimatedLPFeeByAmountsWithProtocolFee(options: EstimateFeeByAmountsOptions): Fraction;
34
+ export declare function getEstimatedLPFeeByAmounts({ protocolFee, ...rest }: EstimateFeeByAmountsOptions): Fraction;
35
+ interface GetAmountOptions {
36
+ amount: CurrencyAmount<Currency>;
37
+ currency: Currency;
38
+ tickLower: number;
39
+ tickUpper: number;
40
+ sqrtRatioX96: bigint;
41
+ }
42
+ export declare function getDependentAmount(options: GetAmountOptions): CurrencyAmount<Currency>;
43
+ export declare function getLiquidityBySingleAmount({ amount, currency, ...rest }: GetAmountOptions): bigint;
44
+ interface GetLiquidityOptions extends Omit<GetAmountOptions, 'amount' | 'currency'> {
45
+ amountA: CurrencyAmount<Currency>;
46
+ amountB: CurrencyAmount<Currency>;
47
+ }
48
+ export declare function getLiquidityByAmountsAndPrice({ amountA, amountB, tickUpper, tickLower, sqrtRatioX96, }: GetLiquidityOptions): bigint;
49
+ interface GetAmountsOptions extends Omit<GetAmountOptions, 'amount' | 'currency'> {
50
+ currencyA: Currency;
51
+ currencyB: Currency;
52
+ liquidity: bigint;
53
+ }
54
+ export declare function getAmountsByLiquidityAndPrice(options: GetAmountsOptions): CurrencyAmount<Currency>[];
55
+ interface GetAmountsAtNewPriceOptions extends Omit<GetAmountOptions, 'amount' | 'currency'> {
56
+ amountA: CurrencyAmount<Currency>;
57
+ amountB: CurrencyAmount<Currency>;
58
+ newSqrtRatioX96: bigint;
59
+ }
60
+ export declare function getAmountsAtNewPrice({ newSqrtRatioX96, ...rest }: GetAmountsAtNewPriceOptions): CurrencyAmount<Currency>[];
61
+ export declare function getAverageLiquidity(ticks: Tick[], tickSpacing: number, tickLower: number, tickUpper: number): bigint;
62
+ export declare function getLiquidityFromSqrtRatioX96(ticks: Tick[], sqrtRatioX96: bigint): bigint;
63
+ export declare function getLiquidityFromTick(ticks: Tick[], tick: number): bigint;
64
+ export {};
65
+ //# sourceMappingURL=feeCalculator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feeCalculator.d.ts","sourceRoot":"","sources":["../../src/utils/feeCalculator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAc,OAAO,EAAE,QAAQ,EAAQ,MAAM,4BAA4B,CAAA;AAQ1G,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAGlC,eAAO,MAAM,aAAa;;;;;;;;;;;CAWzB,CAAA;AAED,UAAU,kBAAkB;IAE1B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IAEhC,QAAQ,EAAE,QAAQ,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,SAAS,EAAE,MAAM,CAAA;IAIjB,YAAY,EAAE,MAAM,CAAA;IAEpB,mBAAmB,EAAE,MAAM,CAAA;IAE3B,GAAG,EAAE,MAAM,CAAA;IAGX,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAG1B,WAAW,CAAC,EAAE,OAAO,CAAA;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gBAAgB,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC/E,SAAS,EAAE,QAAQ,CAAA;IACnB,SAAS,EAAE,QAAQ,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,iBAAiB,8BAUvE;AAED,UAAU,2BAA4B,SAAQ,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,UAAU,CAAC;IACzF,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IACjC,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IACjC,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,EAAE,2BAA2B,8BAW7F;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CA+BpH;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAGxF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAsBxE"}
@@ -0,0 +1,8 @@
1
+ export declare abstract class FullMath {
2
+ /**
3
+ * Cannot be constructed.
4
+ */
5
+ private constructor();
6
+ static mulDivRoundingUp(a: bigint, b: bigint, denominator: bigint): bigint;
7
+ }
8
+ //# sourceMappingURL=fullMath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fullMath.d.ts","sourceRoot":"","sources":["../../src/utils/fullMath.ts"],"names":[],"mappings":"AAEA,8BAAsB,QAAQ;IAC5B;;OAEG;IACH,OAAO;WAEO,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM;CAOlF"}