@dhedge/v2-sdk 2.1.8 → 2.2.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 (91) hide show
  1. package/README.md +400 -53
  2. package/dist/config.d.ts +13 -2
  3. package/dist/entities/pool.d.ts +25 -86
  4. package/dist/entities/utils.d.ts +15 -0
  5. package/dist/services/hyperliquid/index.d.ts +22 -0
  6. package/dist/services/kyberSwap/index.d.ts +1 -1
  7. package/dist/services/oneInch/index.d.ts +1 -1
  8. package/dist/services/toros/easySwapper.d.ts +14 -0
  9. package/dist/services/toros/swapData.d.ts +5 -5
  10. package/dist/services/uniswap/V3Liquidity.d.ts +2 -2
  11. package/dist/services/velodrome/liquidity.d.ts +3 -0
  12. package/dist/test/constants.d.ts +48 -3
  13. package/dist/test/utils/testingHelper.d.ts +4 -0
  14. package/dist/types.d.ts +19 -4
  15. package/dist/utils/contract.d.ts +20 -0
  16. package/dist/v2-sdk.cjs.development.js +4996 -6742
  17. package/dist/v2-sdk.cjs.development.js.map +1 -1
  18. package/dist/v2-sdk.cjs.production.min.js +1 -1
  19. package/dist/v2-sdk.cjs.production.min.js.map +1 -1
  20. package/dist/v2-sdk.esm.js +5001 -6742
  21. package/dist/v2-sdk.esm.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/abi/PoolFactory.json +414 -204
  24. package/src/abi/PoolLogic.json +160 -134
  25. package/src/config.ts +13 -8
  26. package/src/entities/pool.ts +46 -253
  27. package/src/entities/utils.ts +15 -0
  28. package/src/services/hyperliquid/index.ts +22 -0
  29. package/src/services/kyberSwap/index.ts +5 -3
  30. package/src/services/oneInch/index.ts +5 -4
  31. package/src/services/toros/completeWithdrawal.ts +57 -40
  32. package/src/services/toros/easySwapper.ts +15 -1
  33. package/src/services/toros/initWithdrawal.ts +39 -31
  34. package/src/services/toros/swapData.ts +45 -131
  35. package/src/services/uniswap/V3Liquidity.ts +3 -24
  36. package/src/services/velodrome/liquidity.ts +3 -0
  37. package/src/test/aave.test.ts +99 -70
  38. package/src/test/aerodrome.test.ts +53 -24
  39. package/src/test/aerodromeCL.test.ts +64 -30
  40. package/src/test/arrakis.test.ts +23 -35
  41. package/src/test/balancer.test.ts +114 -106
  42. package/src/test/compoundV3.test.ts +45 -29
  43. package/src/test/constants.ts +56 -11
  44. package/src/test/cowswap.test.ts +33 -35
  45. package/src/test/dhedge.test.ts +45 -12
  46. package/src/test/flatmoney.test.ts +25 -39
  47. package/src/test/fluid.test.ts +33 -24
  48. package/src/test/hyperliquid.onchain.test.ts +131 -0
  49. package/src/test/kyberSwap.test.ts +37 -16
  50. package/src/test/lyra.test.ts +159 -150
  51. package/src/test/odos.test.ts +2 -2
  52. package/src/test/oneInch.test.ts +36 -22
  53. package/src/test/pancakeCL.test.ts +72 -31
  54. package/src/test/pendle.test.ts +94 -54
  55. package/src/test/{pendleMint.test.ts → pendleMint.onchain.test.ts} +22 -8
  56. package/src/test/pool.test.ts +152 -95
  57. package/src/test/toros.onchain.test.ts +92 -0
  58. package/src/test/toros.test.ts +74 -20
  59. package/src/test/torosLimitOrder.test.ts +87 -42
  60. package/src/test/uniswap.test.ts +77 -128
  61. package/src/test/utils/testingHelper.ts +120 -0
  62. package/src/test/velodrome.test.ts +126 -92
  63. package/src/test/velodromeCL.test.ts +43 -31
  64. package/src/test/velodromeV2.test.ts +153 -95
  65. package/src/types.ts +20 -5
  66. package/src/utils/contract.ts +20 -0
  67. package/dist/services/futures/constants.d.ts +0 -1
  68. package/dist/services/futures/index.d.ts +0 -2
  69. package/dist/services/futures/margin.d.ts +0 -2
  70. package/dist/services/futures/trade.d.ts +0 -3
  71. package/dist/services/ramses/vesting.d.ts +0 -4
  72. package/dist/services/uniswap/V3Trade.d.ts +0 -3
  73. package/dist/test/utils/futures.d.ts +0 -2
  74. package/src/abi/IRamsesNonfungiblePositionManager.json +0 -486
  75. package/src/abi/ISynthetiXFuturesMarketV2.json +0 -531
  76. package/src/abi/ISynthetix.json +0 -139
  77. package/src/abi/IUniswapV3Quoter.json +0 -195
  78. package/src/abi/IUniswapV3Router.json +0 -221
  79. package/src/abi/IXRam.json +0 -99
  80. package/src/services/futures/constants.ts +0 -1
  81. package/src/services/futures/index.ts +0 -2
  82. package/src/services/futures/margin.ts +0 -10
  83. package/src/services/futures/trade.ts +0 -32
  84. package/src/services/ramses/vesting.ts +0 -24
  85. package/src/services/uniswap/V3Trade.ts +0 -46
  86. package/src/test/futures.test.ts +0 -51
  87. package/src/test/hyperliquid.test.ts +0 -107
  88. package/src/test/ramses.test.ts +0 -190
  89. package/src/test/ramsesCL.test.ts +0 -155
  90. package/src/test/synthetix.test.ts +0 -36
  91. package/src/test/utils/futures.ts +0 -14
@@ -1,486 +0,0 @@
1
- [
2
- {
3
- "anonymous": false,
4
- "inputs": [
5
- {
6
- "indexed": true,
7
- "internalType": "uint256",
8
- "name": "tokenId",
9
- "type": "uint256"
10
- },
11
- {
12
- "indexed": false,
13
- "internalType": "address",
14
- "name": "recipient",
15
- "type": "address"
16
- },
17
- {
18
- "indexed": false,
19
- "internalType": "uint256",
20
- "name": "amount0",
21
- "type": "uint256"
22
- },
23
- {
24
- "indexed": false,
25
- "internalType": "uint256",
26
- "name": "amount1",
27
- "type": "uint256"
28
- }
29
- ],
30
- "name": "Collect",
31
- "type": "event"
32
- },
33
- {
34
- "anonymous": false,
35
- "inputs": [
36
- {
37
- "indexed": true,
38
- "internalType": "uint256",
39
- "name": "tokenId",
40
- "type": "uint256"
41
- },
42
- {
43
- "indexed": false,
44
- "internalType": "uint128",
45
- "name": "liquidity",
46
- "type": "uint128"
47
- },
48
- {
49
- "indexed": false,
50
- "internalType": "uint256",
51
- "name": "amount0",
52
- "type": "uint256"
53
- },
54
- {
55
- "indexed": false,
56
- "internalType": "uint256",
57
- "name": "amount1",
58
- "type": "uint256"
59
- }
60
- ],
61
- "name": "DecreaseLiquidity",
62
- "type": "event"
63
- },
64
- {
65
- "anonymous": false,
66
- "inputs": [
67
- {
68
- "indexed": true,
69
- "internalType": "uint256",
70
- "name": "tokenId",
71
- "type": "uint256"
72
- },
73
- {
74
- "indexed": false,
75
- "internalType": "uint128",
76
- "name": "liquidity",
77
- "type": "uint128"
78
- },
79
- {
80
- "indexed": false,
81
- "internalType": "uint256",
82
- "name": "amount0",
83
- "type": "uint256"
84
- },
85
- {
86
- "indexed": false,
87
- "internalType": "uint256",
88
- "name": "amount1",
89
- "type": "uint256"
90
- }
91
- ],
92
- "name": "IncreaseLiquidity",
93
- "type": "event"
94
- },
95
- {
96
- "inputs": [
97
- {
98
- "internalType": "uint256",
99
- "name": "tokenId",
100
- "type": "uint256"
101
- }
102
- ],
103
- "name": "burn",
104
- "outputs": [],
105
- "stateMutability": "payable",
106
- "type": "function"
107
- },
108
- {
109
- "inputs": [
110
- {
111
- "components": [
112
- {
113
- "internalType": "uint256",
114
- "name": "tokenId",
115
- "type": "uint256"
116
- },
117
- {
118
- "internalType": "address",
119
- "name": "recipient",
120
- "type": "address"
121
- },
122
- {
123
- "internalType": "uint128",
124
- "name": "amount0Max",
125
- "type": "uint128"
126
- },
127
- {
128
- "internalType": "uint128",
129
- "name": "amount1Max",
130
- "type": "uint128"
131
- }
132
- ],
133
- "internalType": "struct IRamsesNonfungiblePositionManager.CollectParams",
134
- "name": "params",
135
- "type": "tuple"
136
- }
137
- ],
138
- "name": "collect",
139
- "outputs": [
140
- {
141
- "internalType": "uint256",
142
- "name": "amount0",
143
- "type": "uint256"
144
- },
145
- {
146
- "internalType": "uint256",
147
- "name": "amount1",
148
- "type": "uint256"
149
- }
150
- ],
151
- "stateMutability": "payable",
152
- "type": "function"
153
- },
154
- {
155
- "inputs": [
156
- {
157
- "components": [
158
- {
159
- "internalType": "uint256",
160
- "name": "tokenId",
161
- "type": "uint256"
162
- },
163
- {
164
- "internalType": "uint128",
165
- "name": "liquidity",
166
- "type": "uint128"
167
- },
168
- {
169
- "internalType": "uint256",
170
- "name": "amount0Min",
171
- "type": "uint256"
172
- },
173
- {
174
- "internalType": "uint256",
175
- "name": "amount1Min",
176
- "type": "uint256"
177
- },
178
- {
179
- "internalType": "uint256",
180
- "name": "deadline",
181
- "type": "uint256"
182
- }
183
- ],
184
- "internalType": "struct IRamsesNonfungiblePositionManager.DecreaseLiquidityParams",
185
- "name": "params",
186
- "type": "tuple"
187
- }
188
- ],
189
- "name": "decreaseLiquidity",
190
- "outputs": [
191
- {
192
- "internalType": "uint256",
193
- "name": "amount0",
194
- "type": "uint256"
195
- },
196
- {
197
- "internalType": "uint256",
198
- "name": "amount1",
199
- "type": "uint256"
200
- }
201
- ],
202
- "stateMutability": "payable",
203
- "type": "function"
204
- },
205
- {
206
- "inputs": [],
207
- "name": "factory",
208
- "outputs": [
209
- {
210
- "internalType": "address",
211
- "name": "",
212
- "type": "address"
213
- }
214
- ],
215
- "stateMutability": "view",
216
- "type": "function"
217
- },
218
- {
219
- "inputs": [
220
- {
221
- "internalType": "uint256",
222
- "name": "tokenId",
223
- "type": "uint256"
224
- },
225
- {
226
- "internalType": "address[]",
227
- "name": "tokens",
228
- "type": "address[]"
229
- }
230
- ],
231
- "name": "getReward",
232
- "outputs": [],
233
- "stateMutability": "nonpayable",
234
- "type": "function"
235
- },
236
- {
237
- "inputs": [
238
- {
239
- "components": [
240
- {
241
- "internalType": "uint256",
242
- "name": "tokenId",
243
- "type": "uint256"
244
- },
245
- {
246
- "internalType": "uint256",
247
- "name": "amount0Desired",
248
- "type": "uint256"
249
- },
250
- {
251
- "internalType": "uint256",
252
- "name": "amount1Desired",
253
- "type": "uint256"
254
- },
255
- {
256
- "internalType": "uint256",
257
- "name": "amount0Min",
258
- "type": "uint256"
259
- },
260
- {
261
- "internalType": "uint256",
262
- "name": "amount1Min",
263
- "type": "uint256"
264
- },
265
- {
266
- "internalType": "uint256",
267
- "name": "deadline",
268
- "type": "uint256"
269
- }
270
- ],
271
- "internalType": "struct IRamsesNonfungiblePositionManager.IncreaseLiquidityParams",
272
- "name": "params",
273
- "type": "tuple"
274
- }
275
- ],
276
- "name": "increaseLiquidity",
277
- "outputs": [
278
- {
279
- "internalType": "uint128",
280
- "name": "liquidity",
281
- "type": "uint128"
282
- },
283
- {
284
- "internalType": "uint256",
285
- "name": "amount0",
286
- "type": "uint256"
287
- },
288
- {
289
- "internalType": "uint256",
290
- "name": "amount1",
291
- "type": "uint256"
292
- }
293
- ],
294
- "stateMutability": "payable",
295
- "type": "function"
296
- },
297
- {
298
- "inputs": [
299
- {
300
- "components": [
301
- {
302
- "internalType": "address",
303
- "name": "token0",
304
- "type": "address"
305
- },
306
- {
307
- "internalType": "address",
308
- "name": "token1",
309
- "type": "address"
310
- },
311
- {
312
- "internalType": "uint24",
313
- "name": "fee",
314
- "type": "uint24"
315
- },
316
- {
317
- "internalType": "int24",
318
- "name": "tickLower",
319
- "type": "int24"
320
- },
321
- {
322
- "internalType": "int24",
323
- "name": "tickUpper",
324
- "type": "int24"
325
- },
326
- {
327
- "internalType": "uint256",
328
- "name": "amount0Desired",
329
- "type": "uint256"
330
- },
331
- {
332
- "internalType": "uint256",
333
- "name": "amount1Desired",
334
- "type": "uint256"
335
- },
336
- {
337
- "internalType": "uint256",
338
- "name": "amount0Min",
339
- "type": "uint256"
340
- },
341
- {
342
- "internalType": "uint256",
343
- "name": "amount1Min",
344
- "type": "uint256"
345
- },
346
- {
347
- "internalType": "address",
348
- "name": "recipient",
349
- "type": "address"
350
- },
351
- {
352
- "internalType": "uint256",
353
- "name": "deadline",
354
- "type": "uint256"
355
- },
356
- {
357
- "internalType": "uint256",
358
- "name": "veRamTokenId",
359
- "type": "uint256"
360
- }
361
- ],
362
- "internalType": "struct IRamsesNonfungiblePositionManager.MintParams",
363
- "name": "params",
364
- "type": "tuple"
365
- }
366
- ],
367
- "name": "mint",
368
- "outputs": [
369
- {
370
- "internalType": "uint256",
371
- "name": "tokenId",
372
- "type": "uint256"
373
- },
374
- {
375
- "internalType": "uint128",
376
- "name": "liquidity",
377
- "type": "uint128"
378
- },
379
- {
380
- "internalType": "uint256",
381
- "name": "amount0",
382
- "type": "uint256"
383
- },
384
- {
385
- "internalType": "uint256",
386
- "name": "amount1",
387
- "type": "uint256"
388
- }
389
- ],
390
- "stateMutability": "payable",
391
- "type": "function"
392
- },
393
- {
394
- "inputs": [
395
- {
396
- "internalType": "uint256",
397
- "name": "tokenId",
398
- "type": "uint256"
399
- }
400
- ],
401
- "name": "positions",
402
- "outputs": [
403
- {
404
- "internalType": "uint96",
405
- "name": "nonce",
406
- "type": "uint96"
407
- },
408
- {
409
- "internalType": "address",
410
- "name": "operator",
411
- "type": "address"
412
- },
413
- {
414
- "internalType": "address",
415
- "name": "token0",
416
- "type": "address"
417
- },
418
- {
419
- "internalType": "address",
420
- "name": "token1",
421
- "type": "address"
422
- },
423
- {
424
- "internalType": "uint24",
425
- "name": "fee",
426
- "type": "uint24"
427
- },
428
- {
429
- "internalType": "int24",
430
- "name": "tickLower",
431
- "type": "int24"
432
- },
433
- {
434
- "internalType": "int24",
435
- "name": "tickUpper",
436
- "type": "int24"
437
- },
438
- {
439
- "internalType": "uint128",
440
- "name": "liquidity",
441
- "type": "uint128"
442
- },
443
- {
444
- "internalType": "uint256",
445
- "name": "feeGrowthInside0LastX128",
446
- "type": "uint256"
447
- },
448
- {
449
- "internalType": "uint256",
450
- "name": "feeGrowthInside1LastX128",
451
- "type": "uint256"
452
- },
453
- {
454
- "internalType": "uint128",
455
- "name": "tokensOwed0",
456
- "type": "uint128"
457
- },
458
- {
459
- "internalType": "uint128",
460
- "name": "tokensOwed1",
461
- "type": "uint128"
462
- }
463
- ],
464
- "stateMutability": "view",
465
- "type": "function"
466
- },
467
- {
468
- "inputs": [
469
- {
470
- "internalType": "address",
471
- "name": "owner",
472
- "type": "address"
473
- }
474
- ],
475
- "name": "balanceOf",
476
- "outputs": [
477
- {
478
- "internalType": "uint256",
479
- "name": "",
480
- "type": "uint256"
481
- }
482
- ],
483
- "stateMutability": "view",
484
- "type": "function"
485
- }
486
- ]