@luxfi/dex 1.2.1 → 2.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 (74) hide show
  1. package/dist/client/clob.d.ts +52 -0
  2. package/dist/client/clob.d.ts.map +1 -0
  3. package/dist/client/clob.js +196 -0
  4. package/dist/client/index.d.ts +7 -0
  5. package/dist/client/index.d.ts.map +1 -0
  6. package/dist/client/index.js +6 -0
  7. package/dist/client/types.d.ts +126 -0
  8. package/dist/client/types.d.ts.map +1 -0
  9. package/dist/client/types.js +5 -0
  10. package/dist/hooks/index.d.ts +22 -0
  11. package/dist/hooks/index.d.ts.map +1 -0
  12. package/dist/hooks/index.js +25 -0
  13. package/dist/hooks/use-lxbook.d.ts +95 -0
  14. package/dist/hooks/use-lxbook.d.ts.map +1 -0
  15. package/dist/hooks/use-lxbook.js +213 -0
  16. package/dist/hooks/use-lxfeed.d.ts +111 -0
  17. package/dist/hooks/use-lxfeed.d.ts.map +1 -0
  18. package/dist/hooks/use-lxfeed.js +152 -0
  19. package/dist/hooks/use-lxvault.d.ts +137 -0
  20. package/dist/hooks/use-lxvault.d.ts.map +1 -0
  21. package/dist/hooks/use-lxvault.js +227 -0
  22. package/dist/hooks/use-quote.d.ts +18 -0
  23. package/dist/hooks/use-quote.d.ts.map +1 -0
  24. package/dist/hooks/use-quote.js +65 -0
  25. package/dist/hooks/use-swap.d.ts +17 -0
  26. package/dist/hooks/use-swap.d.ts.map +1 -0
  27. package/dist/hooks/use-swap.js +75 -0
  28. package/dist/index.d.ts +50 -115
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +72 -225
  31. package/dist/precompile/abis.d.ts +991 -0
  32. package/dist/precompile/abis.d.ts.map +1 -0
  33. package/dist/precompile/abis.js +743 -0
  34. package/dist/precompile/addresses.d.ts +129 -0
  35. package/dist/precompile/addresses.d.ts.map +1 -0
  36. package/dist/precompile/addresses.js +117 -0
  37. package/dist/precompile/index.d.ts +19 -0
  38. package/dist/precompile/index.d.ts.map +1 -0
  39. package/dist/precompile/index.js +18 -0
  40. package/dist/precompile/types.d.ts +246 -0
  41. package/dist/precompile/types.d.ts.map +1 -0
  42. package/dist/precompile/types.js +84 -0
  43. package/dist/router/index.d.ts +7 -0
  44. package/dist/router/index.d.ts.map +1 -0
  45. package/dist/router/index.js +6 -0
  46. package/dist/router/router.d.ts +58 -0
  47. package/dist/router/router.d.ts.map +1 -0
  48. package/dist/router/router.js +272 -0
  49. package/dist/router/types.d.ts +76 -0
  50. package/dist/router/types.d.ts.map +1 -0
  51. package/dist/router/types.js +1 -0
  52. package/package.json +55 -29
  53. package/src/client/clob.ts +256 -0
  54. package/src/client/index.ts +6 -0
  55. package/src/client/types.ts +148 -0
  56. package/src/hooks/index.ts +29 -0
  57. package/src/hooks/use-lxbook.ts +343 -0
  58. package/src/hooks/use-lxfeed.ts +179 -0
  59. package/src/hooks/use-lxvault.ts +318 -0
  60. package/src/hooks/use-quote.ts +92 -0
  61. package/src/hooks/use-swap.ts +103 -0
  62. package/src/index.ts +142 -309
  63. package/src/precompile/abis.ts +755 -0
  64. package/src/precompile/addresses.ts +153 -0
  65. package/src/precompile/index.ts +18 -0
  66. package/src/precompile/types.ts +295 -0
  67. package/src/router/index.ts +6 -0
  68. package/src/router/router.ts +338 -0
  69. package/src/router/types.ts +87 -0
  70. package/dist/marketData.d.ts +0 -152
  71. package/dist/marketData.d.ts.map +0 -1
  72. package/dist/marketData.js +0 -253
  73. package/src/marketData.ts +0 -351
  74. package/tsconfig.json +0 -19
@@ -0,0 +1,991 @@
1
+ /**
2
+ * DEX Precompile ABIs (LP-Aligned)
3
+ * Native Go implementation at LP-9010 to LP-9040
4
+ * Address format: 0x0000000000000000000000000000000000LPNUM
5
+ */
6
+ /**
7
+ * PoolManager ABI (0x0400)
8
+ * Singleton contract managing all pools
9
+ */
10
+ export declare const POOL_MANAGER_ABI: readonly [{
11
+ readonly type: "function";
12
+ readonly name: "initialize";
13
+ readonly inputs: readonly [{
14
+ readonly name: "key";
15
+ readonly type: "tuple";
16
+ readonly components: readonly [{
17
+ readonly name: "currency0";
18
+ readonly type: "address";
19
+ }, {
20
+ readonly name: "currency1";
21
+ readonly type: "address";
22
+ }, {
23
+ readonly name: "fee";
24
+ readonly type: "uint24";
25
+ }, {
26
+ readonly name: "tickSpacing";
27
+ readonly type: "int24";
28
+ }, {
29
+ readonly name: "hooks";
30
+ readonly type: "address";
31
+ }];
32
+ }, {
33
+ readonly name: "sqrtPriceX96";
34
+ readonly type: "uint160";
35
+ }];
36
+ readonly outputs: readonly [{
37
+ readonly name: "tick";
38
+ readonly type: "int24";
39
+ }];
40
+ readonly stateMutability: "nonpayable";
41
+ }, {
42
+ readonly type: "function";
43
+ readonly name: "swap";
44
+ readonly inputs: readonly [{
45
+ readonly name: "key";
46
+ readonly type: "tuple";
47
+ readonly components: readonly [{
48
+ readonly name: "currency0";
49
+ readonly type: "address";
50
+ }, {
51
+ readonly name: "currency1";
52
+ readonly type: "address";
53
+ }, {
54
+ readonly name: "fee";
55
+ readonly type: "uint24";
56
+ }, {
57
+ readonly name: "tickSpacing";
58
+ readonly type: "int24";
59
+ }, {
60
+ readonly name: "hooks";
61
+ readonly type: "address";
62
+ }];
63
+ }, {
64
+ readonly name: "params";
65
+ readonly type: "tuple";
66
+ readonly components: readonly [{
67
+ readonly name: "zeroForOne";
68
+ readonly type: "bool";
69
+ }, {
70
+ readonly name: "amountSpecified";
71
+ readonly type: "int256";
72
+ }, {
73
+ readonly name: "sqrtPriceLimitX96";
74
+ readonly type: "uint160";
75
+ }];
76
+ }, {
77
+ readonly name: "hookData";
78
+ readonly type: "bytes";
79
+ }];
80
+ readonly outputs: readonly [{
81
+ readonly name: "delta";
82
+ readonly type: "int256";
83
+ }];
84
+ readonly stateMutability: "nonpayable";
85
+ }, {
86
+ readonly type: "function";
87
+ readonly name: "modifyLiquidity";
88
+ readonly inputs: readonly [{
89
+ readonly name: "key";
90
+ readonly type: "tuple";
91
+ readonly components: readonly [{
92
+ readonly name: "currency0";
93
+ readonly type: "address";
94
+ }, {
95
+ readonly name: "currency1";
96
+ readonly type: "address";
97
+ }, {
98
+ readonly name: "fee";
99
+ readonly type: "uint24";
100
+ }, {
101
+ readonly name: "tickSpacing";
102
+ readonly type: "int24";
103
+ }, {
104
+ readonly name: "hooks";
105
+ readonly type: "address";
106
+ }];
107
+ }, {
108
+ readonly name: "params";
109
+ readonly type: "tuple";
110
+ readonly components: readonly [{
111
+ readonly name: "tickLower";
112
+ readonly type: "int24";
113
+ }, {
114
+ readonly name: "tickUpper";
115
+ readonly type: "int24";
116
+ }, {
117
+ readonly name: "liquidityDelta";
118
+ readonly type: "int256";
119
+ }, {
120
+ readonly name: "salt";
121
+ readonly type: "bytes32";
122
+ }];
123
+ }, {
124
+ readonly name: "hookData";
125
+ readonly type: "bytes";
126
+ }];
127
+ readonly outputs: readonly [{
128
+ readonly name: "callerDelta";
129
+ readonly type: "int256";
130
+ }, {
131
+ readonly name: "feesAccrued";
132
+ readonly type: "int256";
133
+ }];
134
+ readonly stateMutability: "nonpayable";
135
+ }, {
136
+ readonly type: "function";
137
+ readonly name: "settle";
138
+ readonly inputs: readonly [{
139
+ readonly name: "currency";
140
+ readonly type: "address";
141
+ }];
142
+ readonly outputs: readonly [{
143
+ readonly name: "amount";
144
+ readonly type: "uint256";
145
+ }];
146
+ readonly stateMutability: "payable";
147
+ }, {
148
+ readonly type: "function";
149
+ readonly name: "take";
150
+ readonly inputs: readonly [{
151
+ readonly name: "currency";
152
+ readonly type: "address";
153
+ }, {
154
+ readonly name: "to";
155
+ readonly type: "address";
156
+ }, {
157
+ readonly name: "amount";
158
+ readonly type: "uint256";
159
+ }];
160
+ readonly outputs: readonly [];
161
+ readonly stateMutability: "nonpayable";
162
+ }, {
163
+ readonly type: "function";
164
+ readonly name: "getSlot0";
165
+ readonly inputs: readonly [{
166
+ readonly name: "key";
167
+ readonly type: "tuple";
168
+ readonly components: readonly [{
169
+ readonly name: "currency0";
170
+ readonly type: "address";
171
+ }, {
172
+ readonly name: "currency1";
173
+ readonly type: "address";
174
+ }, {
175
+ readonly name: "fee";
176
+ readonly type: "uint24";
177
+ }, {
178
+ readonly name: "tickSpacing";
179
+ readonly type: "int24";
180
+ }, {
181
+ readonly name: "hooks";
182
+ readonly type: "address";
183
+ }];
184
+ }];
185
+ readonly outputs: readonly [{
186
+ readonly name: "sqrtPriceX96";
187
+ readonly type: "uint160";
188
+ }, {
189
+ readonly name: "tick";
190
+ readonly type: "int24";
191
+ }, {
192
+ readonly name: "protocolFee";
193
+ readonly type: "uint24";
194
+ }, {
195
+ readonly name: "lpFee";
196
+ readonly type: "uint24";
197
+ }];
198
+ readonly stateMutability: "view";
199
+ }, {
200
+ readonly type: "function";
201
+ readonly name: "getLiquidity";
202
+ readonly inputs: readonly [{
203
+ readonly name: "key";
204
+ readonly type: "tuple";
205
+ readonly components: readonly [{
206
+ readonly name: "currency0";
207
+ readonly type: "address";
208
+ }, {
209
+ readonly name: "currency1";
210
+ readonly type: "address";
211
+ }, {
212
+ readonly name: "fee";
213
+ readonly type: "uint24";
214
+ }, {
215
+ readonly name: "tickSpacing";
216
+ readonly type: "int24";
217
+ }, {
218
+ readonly name: "hooks";
219
+ readonly type: "address";
220
+ }];
221
+ }];
222
+ readonly outputs: readonly [{
223
+ readonly name: "liquidity";
224
+ readonly type: "uint128";
225
+ }];
226
+ readonly stateMutability: "view";
227
+ }];
228
+ /**
229
+ * SwapRouter ABI (0x0401)
230
+ * Optimized swap routing
231
+ */
232
+ export declare const SWAP_ROUTER_ABI: readonly [{
233
+ readonly type: "function";
234
+ readonly name: "exactInputSingle";
235
+ readonly inputs: readonly [{
236
+ readonly name: "params";
237
+ readonly type: "tuple";
238
+ readonly components: readonly [{
239
+ readonly name: "poolKey";
240
+ readonly type: "tuple";
241
+ readonly components: readonly [{
242
+ readonly name: "currency0";
243
+ readonly type: "address";
244
+ }, {
245
+ readonly name: "currency1";
246
+ readonly type: "address";
247
+ }, {
248
+ readonly name: "fee";
249
+ readonly type: "uint24";
250
+ }, {
251
+ readonly name: "tickSpacing";
252
+ readonly type: "int24";
253
+ }, {
254
+ readonly name: "hooks";
255
+ readonly type: "address";
256
+ }];
257
+ }, {
258
+ readonly name: "zeroForOne";
259
+ readonly type: "bool";
260
+ }, {
261
+ readonly name: "amountIn";
262
+ readonly type: "uint256";
263
+ }, {
264
+ readonly name: "amountOutMinimum";
265
+ readonly type: "uint256";
266
+ }, {
267
+ readonly name: "sqrtPriceLimitX96";
268
+ readonly type: "uint160";
269
+ }, {
270
+ readonly name: "hookData";
271
+ readonly type: "bytes";
272
+ }];
273
+ }];
274
+ readonly outputs: readonly [{
275
+ readonly name: "amountOut";
276
+ readonly type: "uint256";
277
+ }];
278
+ readonly stateMutability: "payable";
279
+ }, {
280
+ readonly type: "function";
281
+ readonly name: "exactOutputSingle";
282
+ readonly inputs: readonly [{
283
+ readonly name: "params";
284
+ readonly type: "tuple";
285
+ readonly components: readonly [{
286
+ readonly name: "poolKey";
287
+ readonly type: "tuple";
288
+ readonly components: readonly [{
289
+ readonly name: "currency0";
290
+ readonly type: "address";
291
+ }, {
292
+ readonly name: "currency1";
293
+ readonly type: "address";
294
+ }, {
295
+ readonly name: "fee";
296
+ readonly type: "uint24";
297
+ }, {
298
+ readonly name: "tickSpacing";
299
+ readonly type: "int24";
300
+ }, {
301
+ readonly name: "hooks";
302
+ readonly type: "address";
303
+ }];
304
+ }, {
305
+ readonly name: "zeroForOne";
306
+ readonly type: "bool";
307
+ }, {
308
+ readonly name: "amountOut";
309
+ readonly type: "uint256";
310
+ }, {
311
+ readonly name: "amountInMaximum";
312
+ readonly type: "uint256";
313
+ }, {
314
+ readonly name: "sqrtPriceLimitX96";
315
+ readonly type: "uint160";
316
+ }, {
317
+ readonly name: "hookData";
318
+ readonly type: "bytes";
319
+ }];
320
+ }];
321
+ readonly outputs: readonly [{
322
+ readonly name: "amountIn";
323
+ readonly type: "uint256";
324
+ }];
325
+ readonly stateMutability: "payable";
326
+ }, {
327
+ readonly type: "function";
328
+ readonly name: "exactInput";
329
+ readonly inputs: readonly [{
330
+ readonly name: "params";
331
+ readonly type: "tuple";
332
+ readonly components: readonly [{
333
+ readonly name: "path";
334
+ readonly type: "bytes";
335
+ }, {
336
+ readonly name: "amountIn";
337
+ readonly type: "uint256";
338
+ }, {
339
+ readonly name: "amountOutMinimum";
340
+ readonly type: "uint256";
341
+ }];
342
+ }];
343
+ readonly outputs: readonly [{
344
+ readonly name: "amountOut";
345
+ readonly type: "uint256";
346
+ }];
347
+ readonly stateMutability: "payable";
348
+ }];
349
+ /**
350
+ * HooksRegistry ABI (0x0402)
351
+ * Registry for hook contracts
352
+ */
353
+ export declare const HOOKS_REGISTRY_ABI: readonly [{
354
+ readonly type: "function";
355
+ readonly name: "registerHook";
356
+ readonly inputs: readonly [{
357
+ readonly name: "hook";
358
+ readonly type: "address";
359
+ }, {
360
+ readonly name: "permissions";
361
+ readonly type: "uint256";
362
+ }];
363
+ readonly outputs: readonly [];
364
+ readonly stateMutability: "nonpayable";
365
+ }, {
366
+ readonly type: "function";
367
+ readonly name: "getHookPermissions";
368
+ readonly inputs: readonly [{
369
+ readonly name: "hook";
370
+ readonly type: "address";
371
+ }];
372
+ readonly outputs: readonly [{
373
+ readonly name: "permissions";
374
+ readonly type: "uint256";
375
+ }];
376
+ readonly stateMutability: "view";
377
+ }];
378
+ /**
379
+ * FlashLoan ABI (0x0403)
380
+ * Flash loan facility
381
+ */
382
+ export declare const FLASH_LOAN_ABI: readonly [{
383
+ readonly type: "function";
384
+ readonly name: "flash";
385
+ readonly inputs: readonly [{
386
+ readonly name: "recipient";
387
+ readonly type: "address";
388
+ }, {
389
+ readonly name: "currency";
390
+ readonly type: "address";
391
+ }, {
392
+ readonly name: "amount";
393
+ readonly type: "uint256";
394
+ }, {
395
+ readonly name: "data";
396
+ readonly type: "bytes";
397
+ }];
398
+ readonly outputs: readonly [];
399
+ readonly stateMutability: "nonpayable";
400
+ }];
401
+ /**
402
+ * LXBook ABI (LP-9020)
403
+ * Permissionless orderbooks with Hyperliquid-style execute() endpoint
404
+ */
405
+ export declare const LX_BOOK_ABI: readonly [{
406
+ readonly type: "function";
407
+ readonly name: "execute";
408
+ readonly inputs: readonly [{
409
+ readonly name: "action";
410
+ readonly type: "tuple";
411
+ readonly components: readonly [{
412
+ readonly name: "actionType";
413
+ readonly type: "uint8";
414
+ }, {
415
+ readonly name: "nonce";
416
+ readonly type: "uint64";
417
+ }, {
418
+ readonly name: "expiresAfter";
419
+ readonly type: "uint64";
420
+ }, {
421
+ readonly name: "data";
422
+ readonly type: "bytes";
423
+ }];
424
+ }];
425
+ readonly outputs: readonly [{
426
+ readonly name: "result";
427
+ readonly type: "bytes";
428
+ }];
429
+ readonly stateMutability: "nonpayable";
430
+ }, {
431
+ readonly type: "function";
432
+ readonly name: "executeBatch";
433
+ readonly inputs: readonly [{
434
+ readonly name: "actions";
435
+ readonly type: "tuple[]";
436
+ readonly components: readonly [{
437
+ readonly name: "actionType";
438
+ readonly type: "uint8";
439
+ }, {
440
+ readonly name: "nonce";
441
+ readonly type: "uint64";
442
+ }, {
443
+ readonly name: "expiresAfter";
444
+ readonly type: "uint64";
445
+ }, {
446
+ readonly name: "data";
447
+ readonly type: "bytes";
448
+ }];
449
+ }];
450
+ readonly outputs: readonly [{
451
+ readonly name: "results";
452
+ readonly type: "bytes[]";
453
+ }];
454
+ readonly stateMutability: "nonpayable";
455
+ }, {
456
+ readonly type: "function";
457
+ readonly name: "createMarket";
458
+ readonly inputs: readonly [{
459
+ readonly name: "cfg";
460
+ readonly type: "tuple";
461
+ readonly components: readonly [{
462
+ readonly name: "baseAsset";
463
+ readonly type: "bytes32";
464
+ }, {
465
+ readonly name: "quoteAsset";
466
+ readonly type: "bytes32";
467
+ }, {
468
+ readonly name: "tickSizeX18";
469
+ readonly type: "uint128";
470
+ }, {
471
+ readonly name: "lotSizeX18";
472
+ readonly type: "uint128";
473
+ }, {
474
+ readonly name: "makerFeePpm";
475
+ readonly type: "uint32";
476
+ }, {
477
+ readonly name: "takerFeePpm";
478
+ readonly type: "uint32";
479
+ }, {
480
+ readonly name: "feedId";
481
+ readonly type: "bytes32";
482
+ }, {
483
+ readonly name: "initialStatus";
484
+ readonly type: "uint8";
485
+ }];
486
+ }];
487
+ readonly outputs: readonly [{
488
+ readonly name: "marketId";
489
+ readonly type: "uint32";
490
+ }];
491
+ readonly stateMutability: "nonpayable";
492
+ }, {
493
+ readonly type: "function";
494
+ readonly name: "getL1";
495
+ readonly inputs: readonly [{
496
+ readonly name: "marketId";
497
+ readonly type: "uint32";
498
+ }];
499
+ readonly outputs: readonly [{
500
+ readonly name: "l1";
501
+ readonly type: "tuple";
502
+ readonly components: readonly [{
503
+ readonly name: "bestBidPxX18";
504
+ readonly type: "uint128";
505
+ }, {
506
+ readonly name: "bestBidSzX18";
507
+ readonly type: "uint128";
508
+ }, {
509
+ readonly name: "bestAskPxX18";
510
+ readonly type: "uint128";
511
+ }, {
512
+ readonly name: "bestAskSzX18";
513
+ readonly type: "uint128";
514
+ }, {
515
+ readonly name: "lastTradePxX18";
516
+ readonly type: "uint128";
517
+ }];
518
+ }];
519
+ readonly stateMutability: "view";
520
+ }, {
521
+ readonly type: "function";
522
+ readonly name: "getMarketConfig";
523
+ readonly inputs: readonly [{
524
+ readonly name: "marketId";
525
+ readonly type: "uint32";
526
+ }];
527
+ readonly outputs: readonly [{
528
+ readonly name: "cfg";
529
+ readonly type: "tuple";
530
+ readonly components: readonly [{
531
+ readonly name: "baseAsset";
532
+ readonly type: "bytes32";
533
+ }, {
534
+ readonly name: "quoteAsset";
535
+ readonly type: "bytes32";
536
+ }, {
537
+ readonly name: "tickSizeX18";
538
+ readonly type: "uint128";
539
+ }, {
540
+ readonly name: "lotSizeX18";
541
+ readonly type: "uint128";
542
+ }, {
543
+ readonly name: "makerFeePpm";
544
+ readonly type: "uint32";
545
+ }, {
546
+ readonly name: "takerFeePpm";
547
+ readonly type: "uint32";
548
+ }, {
549
+ readonly name: "feedId";
550
+ readonly type: "bytes32";
551
+ }, {
552
+ readonly name: "initialStatus";
553
+ readonly type: "uint8";
554
+ }];
555
+ }];
556
+ readonly stateMutability: "view";
557
+ }, {
558
+ readonly type: "function";
559
+ readonly name: "getMarketStatus";
560
+ readonly inputs: readonly [{
561
+ readonly name: "marketId";
562
+ readonly type: "uint32";
563
+ }];
564
+ readonly outputs: readonly [{
565
+ readonly name: "status";
566
+ readonly type: "uint8";
567
+ }];
568
+ readonly stateMutability: "view";
569
+ }];
570
+ /**
571
+ * LXVault ABI (LP-9030)
572
+ * Balances, margin, collateral, liquidations
573
+ */
574
+ export declare const LX_VAULT_ABI: readonly [{
575
+ readonly type: "function";
576
+ readonly name: "deposit";
577
+ readonly inputs: readonly [{
578
+ readonly name: "token";
579
+ readonly type: "address";
580
+ }, {
581
+ readonly name: "amount";
582
+ readonly type: "uint128";
583
+ }, {
584
+ readonly name: "subaccountId";
585
+ readonly type: "uint8";
586
+ }];
587
+ readonly outputs: readonly [];
588
+ readonly stateMutability: "nonpayable";
589
+ }, {
590
+ readonly type: "function";
591
+ readonly name: "withdraw";
592
+ readonly inputs: readonly [{
593
+ readonly name: "token";
594
+ readonly type: "address";
595
+ }, {
596
+ readonly name: "amount";
597
+ readonly type: "uint128";
598
+ }, {
599
+ readonly name: "subaccountId";
600
+ readonly type: "uint8";
601
+ }];
602
+ readonly outputs: readonly [];
603
+ readonly stateMutability: "nonpayable";
604
+ }, {
605
+ readonly type: "function";
606
+ readonly name: "transfer";
607
+ readonly inputs: readonly [{
608
+ readonly name: "token";
609
+ readonly type: "address";
610
+ }, {
611
+ readonly name: "amount";
612
+ readonly type: "uint128";
613
+ }, {
614
+ readonly name: "fromSubaccount";
615
+ readonly type: "uint8";
616
+ }, {
617
+ readonly name: "toSubaccount";
618
+ readonly type: "uint8";
619
+ }];
620
+ readonly outputs: readonly [];
621
+ readonly stateMutability: "nonpayable";
622
+ }, {
623
+ readonly type: "function";
624
+ readonly name: "getBalance";
625
+ readonly inputs: readonly [{
626
+ readonly name: "account";
627
+ readonly type: "tuple";
628
+ readonly components: readonly [{
629
+ readonly name: "main";
630
+ readonly type: "address";
631
+ }, {
632
+ readonly name: "subaccountId";
633
+ readonly type: "uint8";
634
+ }];
635
+ }, {
636
+ readonly name: "token";
637
+ readonly type: "address";
638
+ }];
639
+ readonly outputs: readonly [{
640
+ readonly name: "balance";
641
+ readonly type: "uint128";
642
+ }];
643
+ readonly stateMutability: "view";
644
+ }, {
645
+ readonly type: "function";
646
+ readonly name: "getPosition";
647
+ readonly inputs: readonly [{
648
+ readonly name: "account";
649
+ readonly type: "tuple";
650
+ readonly components: readonly [{
651
+ readonly name: "main";
652
+ readonly type: "address";
653
+ }, {
654
+ readonly name: "subaccountId";
655
+ readonly type: "uint8";
656
+ }];
657
+ }, {
658
+ readonly name: "marketId";
659
+ readonly type: "uint32";
660
+ }];
661
+ readonly outputs: readonly [{
662
+ readonly name: "position";
663
+ readonly type: "tuple";
664
+ readonly components: readonly [{
665
+ readonly name: "marketId";
666
+ readonly type: "uint32";
667
+ }, {
668
+ readonly name: "side";
669
+ readonly type: "uint8";
670
+ }, {
671
+ readonly name: "sizeX18";
672
+ readonly type: "uint128";
673
+ }, {
674
+ readonly name: "entryPxX18";
675
+ readonly type: "uint128";
676
+ }, {
677
+ readonly name: "unrealizedPnlX18";
678
+ readonly type: "uint128";
679
+ }, {
680
+ readonly name: "accumulatedFundingX18";
681
+ readonly type: "int128";
682
+ }, {
683
+ readonly name: "lastFundingTime";
684
+ readonly type: "uint64";
685
+ }];
686
+ }];
687
+ readonly stateMutability: "view";
688
+ }, {
689
+ readonly type: "function";
690
+ readonly name: "getMargin";
691
+ readonly inputs: readonly [{
692
+ readonly name: "account";
693
+ readonly type: "tuple";
694
+ readonly components: readonly [{
695
+ readonly name: "main";
696
+ readonly type: "address";
697
+ }, {
698
+ readonly name: "subaccountId";
699
+ readonly type: "uint8";
700
+ }];
701
+ }];
702
+ readonly outputs: readonly [{
703
+ readonly name: "info";
704
+ readonly type: "tuple";
705
+ readonly components: readonly [{
706
+ readonly name: "totalCollateralX18";
707
+ readonly type: "uint128";
708
+ }, {
709
+ readonly name: "usedMarginX18";
710
+ readonly type: "uint128";
711
+ }, {
712
+ readonly name: "freeMarginX18";
713
+ readonly type: "uint128";
714
+ }, {
715
+ readonly name: "marginRatioX18";
716
+ readonly type: "uint128";
717
+ }, {
718
+ readonly name: "maintenanceMarginX18";
719
+ readonly type: "uint128";
720
+ }, {
721
+ readonly name: "liquidatable";
722
+ readonly type: "bool";
723
+ }];
724
+ }];
725
+ readonly stateMutability: "view";
726
+ }, {
727
+ readonly type: "function";
728
+ readonly name: "isLiquidatable";
729
+ readonly inputs: readonly [{
730
+ readonly name: "account";
731
+ readonly type: "tuple";
732
+ readonly components: readonly [{
733
+ readonly name: "main";
734
+ readonly type: "address";
735
+ }, {
736
+ readonly name: "subaccountId";
737
+ readonly type: "uint8";
738
+ }];
739
+ }];
740
+ readonly outputs: readonly [{
741
+ readonly name: "liquidatable";
742
+ readonly type: "bool";
743
+ }, {
744
+ readonly name: "shortfall";
745
+ readonly type: "uint128";
746
+ }];
747
+ readonly stateMutability: "view";
748
+ }, {
749
+ readonly type: "function";
750
+ readonly name: "liquidate";
751
+ readonly inputs: readonly [{
752
+ readonly name: "account";
753
+ readonly type: "tuple";
754
+ readonly components: readonly [{
755
+ readonly name: "main";
756
+ readonly type: "address";
757
+ }, {
758
+ readonly name: "subaccountId";
759
+ readonly type: "uint8";
760
+ }];
761
+ }, {
762
+ readonly name: "marketId";
763
+ readonly type: "uint32";
764
+ }, {
765
+ readonly name: "sizeX18";
766
+ readonly type: "uint128";
767
+ }];
768
+ readonly outputs: readonly [{
769
+ readonly name: "result";
770
+ readonly type: "tuple";
771
+ readonly components: readonly [{
772
+ readonly name: "liquidated";
773
+ readonly type: "tuple";
774
+ readonly components: readonly [{
775
+ readonly name: "main";
776
+ readonly type: "address";
777
+ }, {
778
+ readonly name: "subaccountId";
779
+ readonly type: "uint8";
780
+ }];
781
+ }, {
782
+ readonly name: "liquidator";
783
+ readonly type: "tuple";
784
+ readonly components: readonly [{
785
+ readonly name: "main";
786
+ readonly type: "address";
787
+ }, {
788
+ readonly name: "subaccountId";
789
+ readonly type: "uint8";
790
+ }];
791
+ }, {
792
+ readonly name: "marketId";
793
+ readonly type: "uint32";
794
+ }, {
795
+ readonly name: "sizeX18";
796
+ readonly type: "uint128";
797
+ }, {
798
+ readonly name: "priceX18";
799
+ readonly type: "uint128";
800
+ }, {
801
+ readonly name: "penaltyX18";
802
+ readonly type: "uint128";
803
+ }, {
804
+ readonly name: "adlTriggered";
805
+ readonly type: "bool";
806
+ }];
807
+ }];
808
+ readonly stateMutability: "nonpayable";
809
+ }, {
810
+ readonly type: "function";
811
+ readonly name: "getFundingRate";
812
+ readonly inputs: readonly [{
813
+ readonly name: "marketId";
814
+ readonly type: "uint32";
815
+ }];
816
+ readonly outputs: readonly [{
817
+ readonly name: "rateX18";
818
+ readonly type: "int128";
819
+ }, {
820
+ readonly name: "nextFundingTime";
821
+ readonly type: "uint64";
822
+ }];
823
+ readonly stateMutability: "view";
824
+ }];
825
+ /**
826
+ * LXFeed ABI (LP-9040)
827
+ * Mark price, index price, funding calculations
828
+ */
829
+ export declare const LX_FEED_ABI: readonly [{
830
+ readonly type: "function";
831
+ readonly name: "getMarkPrice";
832
+ readonly inputs: readonly [{
833
+ readonly name: "marketId";
834
+ readonly type: "uint32";
835
+ }];
836
+ readonly outputs: readonly [{
837
+ readonly name: "mark";
838
+ readonly type: "tuple";
839
+ readonly components: readonly [{
840
+ readonly name: "indexPxX18";
841
+ readonly type: "uint128";
842
+ }, {
843
+ readonly name: "markPxX18";
844
+ readonly type: "uint128";
845
+ }, {
846
+ readonly name: "premiumX18";
847
+ readonly type: "int128";
848
+ }, {
849
+ readonly name: "timestamp";
850
+ readonly type: "uint64";
851
+ }];
852
+ }];
853
+ readonly stateMutability: "view";
854
+ }, {
855
+ readonly type: "function";
856
+ readonly name: "getIndexPrice";
857
+ readonly inputs: readonly [{
858
+ readonly name: "marketId";
859
+ readonly type: "uint32";
860
+ }];
861
+ readonly outputs: readonly [{
862
+ readonly name: "priceX18";
863
+ readonly type: "uint128";
864
+ }, {
865
+ readonly name: "timestamp";
866
+ readonly type: "uint64";
867
+ }];
868
+ readonly stateMutability: "view";
869
+ }, {
870
+ readonly type: "function";
871
+ readonly name: "getFundingRate";
872
+ readonly inputs: readonly [{
873
+ readonly name: "marketId";
874
+ readonly type: "uint32";
875
+ }];
876
+ readonly outputs: readonly [{
877
+ readonly name: "rateX18";
878
+ readonly type: "int128";
879
+ }, {
880
+ readonly name: "nextFundingTime";
881
+ readonly type: "uint64";
882
+ }];
883
+ readonly stateMutability: "view";
884
+ }, {
885
+ readonly type: "function";
886
+ readonly name: "getTriggerPrice";
887
+ readonly inputs: readonly [{
888
+ readonly name: "marketId";
889
+ readonly type: "uint32";
890
+ }, {
891
+ readonly name: "isBuy";
892
+ readonly type: "bool";
893
+ }];
894
+ readonly outputs: readonly [{
895
+ readonly name: "priceX18";
896
+ readonly type: "uint128";
897
+ }];
898
+ readonly stateMutability: "view";
899
+ }];
900
+ /**
901
+ * LXOracle ABI (LP-9011)
902
+ * Multi-source price aggregation
903
+ */
904
+ export declare const LX_ORACLE_ABI: readonly [{
905
+ readonly type: "function";
906
+ readonly name: "getPrice";
907
+ readonly inputs: readonly [{
908
+ readonly name: "baseToken";
909
+ readonly type: "address";
910
+ }, {
911
+ readonly name: "quoteToken";
912
+ readonly type: "address";
913
+ }];
914
+ readonly outputs: readonly [{
915
+ readonly name: "price";
916
+ readonly type: "tuple";
917
+ readonly components: readonly [{
918
+ readonly name: "price";
919
+ readonly type: "uint256";
920
+ }, {
921
+ readonly name: "confidence";
922
+ readonly type: "uint256";
923
+ }, {
924
+ readonly name: "timestamp";
925
+ readonly type: "uint256";
926
+ }, {
927
+ readonly name: "source";
928
+ readonly type: "uint8";
929
+ }, {
930
+ readonly name: "expo";
931
+ readonly type: "int32";
932
+ }];
933
+ }];
934
+ readonly stateMutability: "view";
935
+ }, {
936
+ readonly type: "function";
937
+ readonly name: "getAggregatedPrice";
938
+ readonly inputs: readonly [{
939
+ readonly name: "baseToken";
940
+ readonly type: "address";
941
+ }, {
942
+ readonly name: "quoteToken";
943
+ readonly type: "address";
944
+ }, {
945
+ readonly name: "maxStaleness";
946
+ readonly type: "uint256";
947
+ }];
948
+ readonly outputs: readonly [{
949
+ readonly name: "aggregated";
950
+ readonly type: "tuple";
951
+ readonly components: readonly [{
952
+ readonly name: "price";
953
+ readonly type: "uint256";
954
+ }, {
955
+ readonly name: "minPrice";
956
+ readonly type: "uint256";
957
+ }, {
958
+ readonly name: "maxPrice";
959
+ readonly type: "uint256";
960
+ }, {
961
+ readonly name: "deviation";
962
+ readonly type: "uint256";
963
+ }, {
964
+ readonly name: "numSources";
965
+ readonly type: "uint256";
966
+ }, {
967
+ readonly name: "timestamp";
968
+ readonly type: "uint256";
969
+ }];
970
+ }];
971
+ readonly stateMutability: "view";
972
+ }, {
973
+ readonly type: "function";
974
+ readonly name: "isPriceFresh";
975
+ readonly inputs: readonly [{
976
+ readonly name: "baseToken";
977
+ readonly type: "address";
978
+ }, {
979
+ readonly name: "quoteToken";
980
+ readonly type: "address";
981
+ }, {
982
+ readonly name: "maxStaleness";
983
+ readonly type: "uint256";
984
+ }];
985
+ readonly outputs: readonly [{
986
+ readonly name: "fresh";
987
+ readonly type: "bool";
988
+ }];
989
+ readonly stateMutability: "view";
990
+ }];
991
+ //# sourceMappingURL=abis.d.ts.map