@pear-protocol/core-sdk 0.0.14 → 0.0.16

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.
@@ -0,0 +1,1859 @@
1
+ import { HttpTypes } from '@pear-protocol/types';
2
+ import { HttpClient } from '../http.js';
3
+ import { ClientHeaders } from '../types.js';
4
+
5
+ declare class Core {
6
+ private client;
7
+ constructor(client: HttpClient);
8
+ accounts: {
9
+ list: (query?: HttpTypes.TradeAccountListParamsInput, headers?: ClientHeaders) => Promise<{
10
+ accounts: {
11
+ id: string;
12
+ alias: string;
13
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
14
+ exchangeIdentifier: string;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ metadata?: {
18
+ agentWalletAddress: string;
19
+ isSubaccount: boolean;
20
+ } | undefined;
21
+ deletedAt?: string | undefined;
22
+ }[];
23
+ }>;
24
+ create: (body: HttpTypes.CreateTradeAccountInput, headers?: ClientHeaders) => Promise<{
25
+ account: {
26
+ id: string;
27
+ alias: string;
28
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
29
+ exchangeIdentifier: string;
30
+ createdAt: string;
31
+ updatedAt: string;
32
+ metadata?: {
33
+ agentWalletAddress: string;
34
+ isSubaccount: boolean;
35
+ } | undefined;
36
+ deletedAt?: string | undefined;
37
+ };
38
+ }>;
39
+ update: (id: string, body: HttpTypes.UpdateTradeAccountInput, headers?: ClientHeaders) => Promise<{
40
+ account: {
41
+ id: string;
42
+ alias: string;
43
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
44
+ exchangeIdentifier: string;
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ metadata?: {
48
+ agentWalletAddress: string;
49
+ isSubaccount: boolean;
50
+ } | undefined;
51
+ deletedAt?: string | undefined;
52
+ };
53
+ }>;
54
+ delete: (id: string, headers?: ClientHeaders) => Promise<void>;
55
+ credentials: (id: string, headers?: ClientHeaders) => Promise<{
56
+ connector: "hyperliquid";
57
+ credentials: {
58
+ signer_key: string;
59
+ };
60
+ } | {
61
+ connector: "binance";
62
+ credentials: {
63
+ read: {
64
+ api_key: string;
65
+ api_secret: string;
66
+ };
67
+ write: {
68
+ api_key: string;
69
+ api_secret: string;
70
+ };
71
+ };
72
+ } | {
73
+ connector: "bybit";
74
+ credentials: {
75
+ api_key: string;
76
+ api_secret: string;
77
+ };
78
+ } | {
79
+ connector: "okx";
80
+ credentials: {
81
+ api_key: string;
82
+ api_secret: string;
83
+ api_pass: string;
84
+ };
85
+ }>;
86
+ restore: (id: string, headers?: ClientHeaders) => Promise<void>;
87
+ };
88
+ executions: {
89
+ list: (query: HttpTypes.ExecutionListParamsInput, headers?: ClientHeaders) => Promise<{
90
+ limit: number;
91
+ nextCursor: string | undefined;
92
+ executions: ({
93
+ id: string;
94
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
95
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
96
+ createdAt: string;
97
+ updatedAt: string;
98
+ intent: "OPEN";
99
+ orderType: "MARKET";
100
+ legs: [{
101
+ symbol: string;
102
+ side: "BUY" | "SELL";
103
+ mode: "QUANTITY" | "USD";
104
+ amount: string;
105
+ reduceOnly: boolean;
106
+ }, ...{
107
+ symbol: string;
108
+ side: "BUY" | "SELL";
109
+ mode: "QUANTITY" | "USD";
110
+ amount: string;
111
+ reduceOnly: boolean;
112
+ }[]];
113
+ error?: string | undefined;
114
+ orders?: {
115
+ id: string;
116
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
117
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
118
+ createdAt: string;
119
+ updatedAt: string;
120
+ type: "MARKET";
121
+ symbol: string;
122
+ side: "BUY" | "SELL";
123
+ reduceOnly: boolean;
124
+ leverage: number;
125
+ quantity: string;
126
+ price: string;
127
+ filledQuantity: string;
128
+ error?: string | undefined;
129
+ filledPrice?: string | undefined;
130
+ }[] | undefined;
131
+ } | {
132
+ id: string;
133
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
134
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
135
+ createdAt: string;
136
+ updatedAt: string;
137
+ intent: "ADJUST";
138
+ orderType: "MARKET";
139
+ position: {
140
+ id: string;
141
+ exposure: Record<string, string>;
142
+ };
143
+ legs: [{
144
+ symbol: string;
145
+ side: "BUY" | "SELL";
146
+ mode: "QUANTITY" | "USD";
147
+ amount: string;
148
+ reduceOnly: boolean;
149
+ }, ...{
150
+ symbol: string;
151
+ side: "BUY" | "SELL";
152
+ mode: "QUANTITY" | "USD";
153
+ amount: string;
154
+ reduceOnly: boolean;
155
+ }[]];
156
+ error?: string | undefined;
157
+ orders?: {
158
+ id: string;
159
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
160
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
161
+ createdAt: string;
162
+ updatedAt: string;
163
+ type: "MARKET";
164
+ symbol: string;
165
+ side: "BUY" | "SELL";
166
+ reduceOnly: boolean;
167
+ leverage: number;
168
+ quantity: string;
169
+ price: string;
170
+ filledQuantity: string;
171
+ error?: string | undefined;
172
+ filledPrice?: string | undefined;
173
+ }[] | undefined;
174
+ } | {
175
+ id: string;
176
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
177
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
178
+ createdAt: string;
179
+ updatedAt: string;
180
+ intent: "CLOSE";
181
+ orderType: "MARKET";
182
+ position: {
183
+ id: string;
184
+ exposure: Record<string, string>;
185
+ };
186
+ error?: string | undefined;
187
+ orders?: {
188
+ id: string;
189
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
190
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
191
+ createdAt: string;
192
+ updatedAt: string;
193
+ type: "MARKET";
194
+ symbol: string;
195
+ side: "BUY" | "SELL";
196
+ reduceOnly: boolean;
197
+ leverage: number;
198
+ quantity: string;
199
+ price: string;
200
+ filledQuantity: string;
201
+ error?: string | undefined;
202
+ filledPrice?: string | undefined;
203
+ }[] | undefined;
204
+ })[];
205
+ }>;
206
+ };
207
+ fills: {
208
+ details: (positionId: string, headers?: ClientHeaders) => Promise<{
209
+ fills: {
210
+ id: string;
211
+ tradeAccountId: string;
212
+ symbol: string;
213
+ positionId: string;
214
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
215
+ side: "BUY" | "SELL";
216
+ reduceOnly: boolean;
217
+ quantity: string;
218
+ price: string;
219
+ usd: string;
220
+ timestamp: string;
221
+ cloid?: string | undefined;
222
+ fee?: string | undefined;
223
+ }[];
224
+ }>;
225
+ list: (query: HttpTypes.FillListParams, headers?: ClientHeaders) => Promise<{
226
+ limit: number;
227
+ nextCursor: string | undefined;
228
+ fills: {
229
+ id: string;
230
+ tradeAccountId: string;
231
+ symbol: string;
232
+ positionId: string;
233
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
234
+ side: "BUY" | "SELL";
235
+ reduceOnly: boolean;
236
+ quantity: string;
237
+ price: string;
238
+ usd: string;
239
+ timestamp: string;
240
+ cloid?: string | undefined;
241
+ fee?: string | undefined;
242
+ }[];
243
+ }>;
244
+ };
245
+ funding: {
246
+ list: (query: HttpTypes.FundingQueryParams, headers?: ClientHeaders) => Promise<{
247
+ funding: Record<string, {
248
+ r: string;
249
+ nft: number;
250
+ }>;
251
+ }>;
252
+ };
253
+ instruments: {
254
+ list: (query: HttpTypes.InstrumentListParams, headers?: ClientHeaders) => Promise<{
255
+ instruments: {
256
+ id: string;
257
+ base: string;
258
+ quote: string;
259
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
260
+ type: "spot" | "perp" | "hip3";
261
+ leverage: number;
262
+ precision: {
263
+ quantity: {
264
+ decimals: number;
265
+ step: number;
266
+ contractSize: number;
267
+ };
268
+ price: {
269
+ decimals: number;
270
+ tick?: number | null | undefined;
271
+ sigFigs?: number | null | undefined;
272
+ };
273
+ notional?: {
274
+ min?: number | null | undefined;
275
+ max?: number | null | undefined;
276
+ } | undefined;
277
+ };
278
+ }[];
279
+ }>;
280
+ };
281
+ positions: {
282
+ list: (query: HttpTypes.PositionListParamsInput, headers?: ClientHeaders) => Promise<{
283
+ positions: {
284
+ id: string;
285
+ tradeAccountId: string;
286
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
287
+ status: "OPEN" | "CLOSED";
288
+ exposure: Record<string, string>;
289
+ initialExposureUSD: Record<string, string>;
290
+ createdAt: string;
291
+ updatedAt: string;
292
+ closedReason?: "NETTED" | "USER" | "LIQUIDATED" | null | undefined;
293
+ closedAt?: string | null | undefined;
294
+ }[];
295
+ }>;
296
+ };
297
+ prices: {
298
+ list: (query: HttpTypes.PricesQueryParams, headers?: ClientHeaders) => Promise<{
299
+ mid: Record<string, string>;
300
+ mark: Record<string, string>;
301
+ }>;
302
+ };
303
+ schedules: {
304
+ list: (query: HttpTypes.ScheduleListParamsInput, headers?: ClientHeaders) => Promise<{
305
+ limit: number;
306
+ nextCursor: string | undefined;
307
+ schedules: ({
308
+ id: string;
309
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
310
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
311
+ positionKey: string;
312
+ executionType: "MARKET";
313
+ startAt: string;
314
+ endAt: string;
315
+ createdAt: string;
316
+ updatedAt: string;
317
+ strategy: "TWAP";
318
+ intent: "OPEN";
319
+ sliceIntervalMs: number;
320
+ sliceLegs: {
321
+ symbol: string;
322
+ side: "BUY" | "SELL";
323
+ mode: "QUANTITY" | "USD";
324
+ stepAmount: string;
325
+ }[];
326
+ targetNotional: string;
327
+ remainingNotional: string;
328
+ lastSliceAt?: string | undefined;
329
+ cancelledAt?: string | undefined;
330
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
331
+ fills?: {
332
+ id: string;
333
+ tradeAccountId: string;
334
+ symbol: string;
335
+ positionId: string;
336
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
337
+ side: "BUY" | "SELL";
338
+ reduceOnly: boolean;
339
+ quantity: string;
340
+ price: string;
341
+ usd: string;
342
+ timestamp: string;
343
+ cloid?: string | undefined;
344
+ fee?: string | undefined;
345
+ }[] | undefined;
346
+ } | {
347
+ id: string;
348
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
349
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
350
+ positionKey: string;
351
+ executionType: "MARKET";
352
+ startAt: string;
353
+ endAt: string;
354
+ createdAt: string;
355
+ updatedAt: string;
356
+ strategy: "TWAP";
357
+ intent: "CLOSE";
358
+ sliceIntervalMs: number;
359
+ positionId: string;
360
+ sliceLegs: {
361
+ symbol: string;
362
+ stepAmount: string;
363
+ }[];
364
+ initialExposure: Record<string, string>;
365
+ lastSliceAt?: string | undefined;
366
+ cancelledAt?: string | undefined;
367
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
368
+ fills?: {
369
+ id: string;
370
+ tradeAccountId: string;
371
+ symbol: string;
372
+ positionId: string;
373
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
374
+ side: "BUY" | "SELL";
375
+ reduceOnly: boolean;
376
+ quantity: string;
377
+ price: string;
378
+ usd: string;
379
+ timestamp: string;
380
+ cloid?: string | undefined;
381
+ fee?: string | undefined;
382
+ }[] | undefined;
383
+ })[];
384
+ }>;
385
+ create: (body: HttpTypes.CreateSchedule, headers?: ClientHeaders) => Promise<{
386
+ schedule: {
387
+ id: string;
388
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
389
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
390
+ positionKey: string;
391
+ executionType: "MARKET";
392
+ startAt: string;
393
+ endAt: string;
394
+ createdAt: string;
395
+ updatedAt: string;
396
+ strategy: "TWAP";
397
+ intent: "OPEN";
398
+ sliceIntervalMs: number;
399
+ sliceLegs: {
400
+ symbol: string;
401
+ side: "BUY" | "SELL";
402
+ mode: "QUANTITY" | "USD";
403
+ stepAmount: string;
404
+ }[];
405
+ targetNotional: string;
406
+ remainingNotional: string;
407
+ lastSliceAt?: string | undefined;
408
+ cancelledAt?: string | undefined;
409
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
410
+ fills?: {
411
+ id: string;
412
+ tradeAccountId: string;
413
+ symbol: string;
414
+ positionId: string;
415
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
416
+ side: "BUY" | "SELL";
417
+ reduceOnly: boolean;
418
+ quantity: string;
419
+ price: string;
420
+ usd: string;
421
+ timestamp: string;
422
+ cloid?: string | undefined;
423
+ fee?: string | undefined;
424
+ }[] | undefined;
425
+ } | {
426
+ id: string;
427
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
428
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
429
+ positionKey: string;
430
+ executionType: "MARKET";
431
+ startAt: string;
432
+ endAt: string;
433
+ createdAt: string;
434
+ updatedAt: string;
435
+ strategy: "TWAP";
436
+ intent: "CLOSE";
437
+ sliceIntervalMs: number;
438
+ positionId: string;
439
+ sliceLegs: {
440
+ symbol: string;
441
+ stepAmount: string;
442
+ }[];
443
+ initialExposure: Record<string, string>;
444
+ lastSliceAt?: string | undefined;
445
+ cancelledAt?: string | undefined;
446
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
447
+ fills?: {
448
+ id: string;
449
+ tradeAccountId: string;
450
+ symbol: string;
451
+ positionId: string;
452
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
453
+ side: "BUY" | "SELL";
454
+ reduceOnly: boolean;
455
+ quantity: string;
456
+ price: string;
457
+ usd: string;
458
+ timestamp: string;
459
+ cloid?: string | undefined;
460
+ fee?: string | undefined;
461
+ }[] | undefined;
462
+ };
463
+ }>;
464
+ cancel: (scheduleId: string, headers?: ClientHeaders) => Promise<{
465
+ id: string;
466
+ }>;
467
+ cancelAll: (headers?: ClientHeaders) => Promise<{
468
+ ids: string[];
469
+ }>;
470
+ };
471
+ trade: {
472
+ open: (body: HttpTypes.CreateTradeOpen, headers?: ClientHeaders) => Promise<{
473
+ execution: {
474
+ id: string;
475
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
476
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
477
+ createdAt: string;
478
+ updatedAt: string;
479
+ intent: "OPEN";
480
+ orderType: "MARKET";
481
+ legs: [{
482
+ symbol: string;
483
+ side: "BUY" | "SELL";
484
+ mode: "QUANTITY" | "USD";
485
+ amount: string;
486
+ reduceOnly: boolean;
487
+ }, ...{
488
+ symbol: string;
489
+ side: "BUY" | "SELL";
490
+ mode: "QUANTITY" | "USD";
491
+ amount: string;
492
+ reduceOnly: boolean;
493
+ }[]];
494
+ error?: string | undefined;
495
+ orders?: {
496
+ id: string;
497
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
498
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
499
+ createdAt: string;
500
+ updatedAt: string;
501
+ type: "MARKET";
502
+ symbol: string;
503
+ side: "BUY" | "SELL";
504
+ reduceOnly: boolean;
505
+ leverage: number;
506
+ quantity: string;
507
+ price: string;
508
+ filledQuantity: string;
509
+ error?: string | undefined;
510
+ filledPrice?: string | undefined;
511
+ }[] | undefined;
512
+ } | {
513
+ id: string;
514
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
515
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
516
+ createdAt: string;
517
+ updatedAt: string;
518
+ intent: "ADJUST";
519
+ orderType: "MARKET";
520
+ position: {
521
+ id: string;
522
+ exposure: Record<string, string>;
523
+ };
524
+ legs: [{
525
+ symbol: string;
526
+ side: "BUY" | "SELL";
527
+ mode: "QUANTITY" | "USD";
528
+ amount: string;
529
+ reduceOnly: boolean;
530
+ }, ...{
531
+ symbol: string;
532
+ side: "BUY" | "SELL";
533
+ mode: "QUANTITY" | "USD";
534
+ amount: string;
535
+ reduceOnly: boolean;
536
+ }[]];
537
+ error?: string | undefined;
538
+ orders?: {
539
+ id: string;
540
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
541
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
542
+ createdAt: string;
543
+ updatedAt: string;
544
+ type: "MARKET";
545
+ symbol: string;
546
+ side: "BUY" | "SELL";
547
+ reduceOnly: boolean;
548
+ leverage: number;
549
+ quantity: string;
550
+ price: string;
551
+ filledQuantity: string;
552
+ error?: string | undefined;
553
+ filledPrice?: string | undefined;
554
+ }[] | undefined;
555
+ } | {
556
+ id: string;
557
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
558
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
559
+ createdAt: string;
560
+ updatedAt: string;
561
+ intent: "CLOSE";
562
+ orderType: "MARKET";
563
+ position: {
564
+ id: string;
565
+ exposure: Record<string, string>;
566
+ };
567
+ error?: string | undefined;
568
+ orders?: {
569
+ id: string;
570
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
571
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
572
+ createdAt: string;
573
+ updatedAt: string;
574
+ type: "MARKET";
575
+ symbol: string;
576
+ side: "BUY" | "SELL";
577
+ reduceOnly: boolean;
578
+ leverage: number;
579
+ quantity: string;
580
+ price: string;
581
+ filledQuantity: string;
582
+ error?: string | undefined;
583
+ filledPrice?: string | undefined;
584
+ }[] | undefined;
585
+ };
586
+ }>;
587
+ adjust: (positionId: string, body: HttpTypes.CreateTradeAdjust, headers?: ClientHeaders) => Promise<{
588
+ execution: {
589
+ id: string;
590
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
591
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
592
+ createdAt: string;
593
+ updatedAt: string;
594
+ intent: "OPEN";
595
+ orderType: "MARKET";
596
+ legs: [{
597
+ symbol: string;
598
+ side: "BUY" | "SELL";
599
+ mode: "QUANTITY" | "USD";
600
+ amount: string;
601
+ reduceOnly: boolean;
602
+ }, ...{
603
+ symbol: string;
604
+ side: "BUY" | "SELL";
605
+ mode: "QUANTITY" | "USD";
606
+ amount: string;
607
+ reduceOnly: boolean;
608
+ }[]];
609
+ error?: string | undefined;
610
+ orders?: {
611
+ id: string;
612
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
613
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
614
+ createdAt: string;
615
+ updatedAt: string;
616
+ type: "MARKET";
617
+ symbol: string;
618
+ side: "BUY" | "SELL";
619
+ reduceOnly: boolean;
620
+ leverage: number;
621
+ quantity: string;
622
+ price: string;
623
+ filledQuantity: string;
624
+ error?: string | undefined;
625
+ filledPrice?: string | undefined;
626
+ }[] | undefined;
627
+ } | {
628
+ id: string;
629
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
630
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
631
+ createdAt: string;
632
+ updatedAt: string;
633
+ intent: "ADJUST";
634
+ orderType: "MARKET";
635
+ position: {
636
+ id: string;
637
+ exposure: Record<string, string>;
638
+ };
639
+ legs: [{
640
+ symbol: string;
641
+ side: "BUY" | "SELL";
642
+ mode: "QUANTITY" | "USD";
643
+ amount: string;
644
+ reduceOnly: boolean;
645
+ }, ...{
646
+ symbol: string;
647
+ side: "BUY" | "SELL";
648
+ mode: "QUANTITY" | "USD";
649
+ amount: string;
650
+ reduceOnly: boolean;
651
+ }[]];
652
+ error?: string | undefined;
653
+ orders?: {
654
+ id: string;
655
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
656
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
657
+ createdAt: string;
658
+ updatedAt: string;
659
+ type: "MARKET";
660
+ symbol: string;
661
+ side: "BUY" | "SELL";
662
+ reduceOnly: boolean;
663
+ leverage: number;
664
+ quantity: string;
665
+ price: string;
666
+ filledQuantity: string;
667
+ error?: string | undefined;
668
+ filledPrice?: string | undefined;
669
+ }[] | undefined;
670
+ } | {
671
+ id: string;
672
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
673
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
674
+ createdAt: string;
675
+ updatedAt: string;
676
+ intent: "CLOSE";
677
+ orderType: "MARKET";
678
+ position: {
679
+ id: string;
680
+ exposure: Record<string, string>;
681
+ };
682
+ error?: string | undefined;
683
+ orders?: {
684
+ id: string;
685
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
686
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
687
+ createdAt: string;
688
+ updatedAt: string;
689
+ type: "MARKET";
690
+ symbol: string;
691
+ side: "BUY" | "SELL";
692
+ reduceOnly: boolean;
693
+ leverage: number;
694
+ quantity: string;
695
+ price: string;
696
+ filledQuantity: string;
697
+ error?: string | undefined;
698
+ filledPrice?: string | undefined;
699
+ }[] | undefined;
700
+ };
701
+ }>;
702
+ close: (positionId: string, body: HttpTypes.CreateTradeClose, headers?: ClientHeaders) => Promise<{
703
+ execution: {
704
+ id: string;
705
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
706
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
707
+ createdAt: string;
708
+ updatedAt: string;
709
+ intent: "OPEN";
710
+ orderType: "MARKET";
711
+ legs: [{
712
+ symbol: string;
713
+ side: "BUY" | "SELL";
714
+ mode: "QUANTITY" | "USD";
715
+ amount: string;
716
+ reduceOnly: boolean;
717
+ }, ...{
718
+ symbol: string;
719
+ side: "BUY" | "SELL";
720
+ mode: "QUANTITY" | "USD";
721
+ amount: string;
722
+ reduceOnly: boolean;
723
+ }[]];
724
+ error?: string | undefined;
725
+ orders?: {
726
+ id: string;
727
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
728
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
729
+ createdAt: string;
730
+ updatedAt: string;
731
+ type: "MARKET";
732
+ symbol: string;
733
+ side: "BUY" | "SELL";
734
+ reduceOnly: boolean;
735
+ leverage: number;
736
+ quantity: string;
737
+ price: string;
738
+ filledQuantity: string;
739
+ error?: string | undefined;
740
+ filledPrice?: string | undefined;
741
+ }[] | undefined;
742
+ } | {
743
+ id: string;
744
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
745
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
746
+ createdAt: string;
747
+ updatedAt: string;
748
+ intent: "ADJUST";
749
+ orderType: "MARKET";
750
+ position: {
751
+ id: string;
752
+ exposure: Record<string, string>;
753
+ };
754
+ legs: [{
755
+ symbol: string;
756
+ side: "BUY" | "SELL";
757
+ mode: "QUANTITY" | "USD";
758
+ amount: string;
759
+ reduceOnly: boolean;
760
+ }, ...{
761
+ symbol: string;
762
+ side: "BUY" | "SELL";
763
+ mode: "QUANTITY" | "USD";
764
+ amount: string;
765
+ reduceOnly: boolean;
766
+ }[]];
767
+ error?: string | undefined;
768
+ orders?: {
769
+ id: string;
770
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
771
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
772
+ createdAt: string;
773
+ updatedAt: string;
774
+ type: "MARKET";
775
+ symbol: string;
776
+ side: "BUY" | "SELL";
777
+ reduceOnly: boolean;
778
+ leverage: number;
779
+ quantity: string;
780
+ price: string;
781
+ filledQuantity: string;
782
+ error?: string | undefined;
783
+ filledPrice?: string | undefined;
784
+ }[] | undefined;
785
+ } | {
786
+ id: string;
787
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
788
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
789
+ createdAt: string;
790
+ updatedAt: string;
791
+ intent: "CLOSE";
792
+ orderType: "MARKET";
793
+ position: {
794
+ id: string;
795
+ exposure: Record<string, string>;
796
+ };
797
+ error?: string | undefined;
798
+ orders?: {
799
+ id: string;
800
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
801
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
802
+ createdAt: string;
803
+ updatedAt: string;
804
+ type: "MARKET";
805
+ symbol: string;
806
+ side: "BUY" | "SELL";
807
+ reduceOnly: boolean;
808
+ leverage: number;
809
+ quantity: string;
810
+ price: string;
811
+ filledQuantity: string;
812
+ error?: string | undefined;
813
+ filledPrice?: string | undefined;
814
+ }[] | undefined;
815
+ };
816
+ }>;
817
+ closeAll: (body: HttpTypes.CreateTradeCloseAll, headers?: ClientHeaders) => Promise<{
818
+ executions: ({
819
+ id: string;
820
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
821
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
822
+ createdAt: string;
823
+ updatedAt: string;
824
+ intent: "OPEN";
825
+ orderType: "MARKET";
826
+ legs: [{
827
+ symbol: string;
828
+ side: "BUY" | "SELL";
829
+ mode: "QUANTITY" | "USD";
830
+ amount: string;
831
+ reduceOnly: boolean;
832
+ }, ...{
833
+ symbol: string;
834
+ side: "BUY" | "SELL";
835
+ mode: "QUANTITY" | "USD";
836
+ amount: string;
837
+ reduceOnly: boolean;
838
+ }[]];
839
+ error?: string | undefined;
840
+ orders?: {
841
+ id: string;
842
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
843
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
844
+ createdAt: string;
845
+ updatedAt: string;
846
+ type: "MARKET";
847
+ symbol: string;
848
+ side: "BUY" | "SELL";
849
+ reduceOnly: boolean;
850
+ leverage: number;
851
+ quantity: string;
852
+ price: string;
853
+ filledQuantity: string;
854
+ error?: string | undefined;
855
+ filledPrice?: string | undefined;
856
+ }[] | undefined;
857
+ } | {
858
+ id: string;
859
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
860
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
861
+ createdAt: string;
862
+ updatedAt: string;
863
+ intent: "ADJUST";
864
+ orderType: "MARKET";
865
+ position: {
866
+ id: string;
867
+ exposure: Record<string, string>;
868
+ };
869
+ legs: [{
870
+ symbol: string;
871
+ side: "BUY" | "SELL";
872
+ mode: "QUANTITY" | "USD";
873
+ amount: string;
874
+ reduceOnly: boolean;
875
+ }, ...{
876
+ symbol: string;
877
+ side: "BUY" | "SELL";
878
+ mode: "QUANTITY" | "USD";
879
+ amount: string;
880
+ reduceOnly: boolean;
881
+ }[]];
882
+ error?: string | undefined;
883
+ orders?: {
884
+ id: string;
885
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
886
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
887
+ createdAt: string;
888
+ updatedAt: string;
889
+ type: "MARKET";
890
+ symbol: string;
891
+ side: "BUY" | "SELL";
892
+ reduceOnly: boolean;
893
+ leverage: number;
894
+ quantity: string;
895
+ price: string;
896
+ filledQuantity: string;
897
+ error?: string | undefined;
898
+ filledPrice?: string | undefined;
899
+ }[] | undefined;
900
+ } | {
901
+ id: string;
902
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
903
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
904
+ createdAt: string;
905
+ updatedAt: string;
906
+ intent: "CLOSE";
907
+ orderType: "MARKET";
908
+ position: {
909
+ id: string;
910
+ exposure: Record<string, string>;
911
+ };
912
+ error?: string | undefined;
913
+ orders?: {
914
+ id: string;
915
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
916
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
917
+ createdAt: string;
918
+ updatedAt: string;
919
+ type: "MARKET";
920
+ symbol: string;
921
+ side: "BUY" | "SELL";
922
+ reduceOnly: boolean;
923
+ leverage: number;
924
+ quantity: string;
925
+ price: string;
926
+ filledQuantity: string;
927
+ error?: string | undefined;
928
+ filledPrice?: string | undefined;
929
+ }[] | undefined;
930
+ })[];
931
+ }>;
932
+ setLeverage: (body: HttpTypes.SetLeverage, headers?: ClientHeaders) => Promise<Record<string, never>>;
933
+ };
934
+ triggers: {
935
+ list: (query: HttpTypes.TriggerListParamsInput, headers?: ClientHeaders) => Promise<{
936
+ limit: number;
937
+ nextCursor: string | undefined;
938
+ triggers: ({
939
+ id: string;
940
+ tradeAccountId: string;
941
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
942
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
943
+ createdAt: string;
944
+ updatedAt: string;
945
+ intent: "OPEN";
946
+ type: "MARKET";
947
+ condition: {
948
+ type: "ratio_v1";
949
+ data: {
950
+ priceSource: "mid" | "mark";
951
+ symbol_a: string;
952
+ symbol_b: string;
953
+ direction: "ABOVE" | "BELOW";
954
+ threshold: number;
955
+ };
956
+ } | {
957
+ type: "price_v1";
958
+ data: {
959
+ priceSource: "mid" | "mark";
960
+ symbol: string;
961
+ direction: "ABOVE" | "BELOW";
962
+ threshold: number;
963
+ };
964
+ } | {
965
+ type: "index_v1";
966
+ data: {
967
+ priceSource: "mid" | "mark";
968
+ basket: {
969
+ symbol: string;
970
+ weight: number;
971
+ }[];
972
+ direction: "ABOVE" | "BELOW";
973
+ threshold: number;
974
+ };
975
+ } | {
976
+ type: "weighted_ratio_v1";
977
+ data: {
978
+ priceSource: "mid" | "mark";
979
+ basket: {
980
+ symbol: string;
981
+ side: "BUY" | "SELL";
982
+ weight: number;
983
+ }[];
984
+ direction: "ABOVE" | "BELOW";
985
+ threshold: number;
986
+ };
987
+ };
988
+ context: {
989
+ type: "MARKET";
990
+ legs: [{
991
+ symbol: string;
992
+ side: "BUY" | "SELL";
993
+ mode: "QUANTITY" | "USD";
994
+ amount: string;
995
+ }, ...{
996
+ symbol: string;
997
+ side: "BUY" | "SELL";
998
+ mode: "QUANTITY" | "USD";
999
+ amount: string;
1000
+ }[]];
1001
+ };
1002
+ triggeredAt?: string | undefined;
1003
+ cancelledAt?: string | undefined;
1004
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
1005
+ fills?: {
1006
+ id: string;
1007
+ tradeAccountId: string;
1008
+ symbol: string;
1009
+ positionId: string;
1010
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1011
+ side: "BUY" | "SELL";
1012
+ reduceOnly: boolean;
1013
+ quantity: string;
1014
+ price: string;
1015
+ usd: string;
1016
+ timestamp: string;
1017
+ cloid?: string | undefined;
1018
+ fee?: string | undefined;
1019
+ }[] | undefined;
1020
+ bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
1021
+ } | {
1022
+ id: string;
1023
+ tradeAccountId: string;
1024
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1025
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1026
+ createdAt: string;
1027
+ updatedAt: string;
1028
+ intent: "ADJUST";
1029
+ type: "MARKET";
1030
+ condition: {
1031
+ type: "ratio_v1";
1032
+ data: {
1033
+ priceSource: "mid" | "mark";
1034
+ symbol_a: string;
1035
+ symbol_b: string;
1036
+ direction: "ABOVE" | "BELOW";
1037
+ threshold: number;
1038
+ };
1039
+ } | {
1040
+ type: "price_v1";
1041
+ data: {
1042
+ priceSource: "mid" | "mark";
1043
+ symbol: string;
1044
+ direction: "ABOVE" | "BELOW";
1045
+ threshold: number;
1046
+ };
1047
+ } | {
1048
+ type: "index_v1";
1049
+ data: {
1050
+ priceSource: "mid" | "mark";
1051
+ basket: {
1052
+ symbol: string;
1053
+ weight: number;
1054
+ }[];
1055
+ direction: "ABOVE" | "BELOW";
1056
+ threshold: number;
1057
+ };
1058
+ } | {
1059
+ type: "weighted_ratio_v1";
1060
+ data: {
1061
+ priceSource: "mid" | "mark";
1062
+ basket: {
1063
+ symbol: string;
1064
+ side: "BUY" | "SELL";
1065
+ weight: number;
1066
+ }[];
1067
+ direction: "ABOVE" | "BELOW";
1068
+ threshold: number;
1069
+ };
1070
+ } | {
1071
+ type: "position_value_v1";
1072
+ data: {
1073
+ priceSource: "mid" | "mark";
1074
+ direction: "ABOVE" | "BELOW";
1075
+ threshold: number;
1076
+ };
1077
+ } | {
1078
+ type: "position_upnl_value_v1";
1079
+ data: {
1080
+ priceSource: "mid" | "mark";
1081
+ direction: "ABOVE" | "BELOW";
1082
+ threshold: number;
1083
+ };
1084
+ } | {
1085
+ type: "position_upnl_percentage_v1";
1086
+ data: {
1087
+ priceSource: "mid" | "mark";
1088
+ direction: "ABOVE" | "BELOW";
1089
+ threshold_bps: number;
1090
+ };
1091
+ };
1092
+ context: {
1093
+ type: "MARKET";
1094
+ position: {
1095
+ id: string;
1096
+ initialExposure: Record<string, string>;
1097
+ };
1098
+ legs: [{
1099
+ symbol: string;
1100
+ side: "BUY" | "SELL";
1101
+ mode: "QUANTITY" | "USD";
1102
+ amount: string;
1103
+ reduceOnly: boolean;
1104
+ }, ...{
1105
+ symbol: string;
1106
+ side: "BUY" | "SELL";
1107
+ mode: "QUANTITY" | "USD";
1108
+ amount: string;
1109
+ reduceOnly: boolean;
1110
+ }[]];
1111
+ };
1112
+ triggeredAt?: string | undefined;
1113
+ cancelledAt?: string | undefined;
1114
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
1115
+ fills?: {
1116
+ id: string;
1117
+ tradeAccountId: string;
1118
+ symbol: string;
1119
+ positionId: string;
1120
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1121
+ side: "BUY" | "SELL";
1122
+ reduceOnly: boolean;
1123
+ quantity: string;
1124
+ price: string;
1125
+ usd: string;
1126
+ timestamp: string;
1127
+ cloid?: string | undefined;
1128
+ fee?: string | undefined;
1129
+ }[] | undefined;
1130
+ bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
1131
+ } | {
1132
+ id: string;
1133
+ tradeAccountId: string;
1134
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1135
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1136
+ createdAt: string;
1137
+ updatedAt: string;
1138
+ intent: "CLOSE";
1139
+ type: "MARKET";
1140
+ condition: {
1141
+ type: "ratio_v1";
1142
+ data: {
1143
+ priceSource: "mid" | "mark";
1144
+ symbol_a: string;
1145
+ symbol_b: string;
1146
+ direction: "ABOVE" | "BELOW";
1147
+ threshold: number;
1148
+ };
1149
+ } | {
1150
+ type: "price_v1";
1151
+ data: {
1152
+ priceSource: "mid" | "mark";
1153
+ symbol: string;
1154
+ direction: "ABOVE" | "BELOW";
1155
+ threshold: number;
1156
+ };
1157
+ } | {
1158
+ type: "index_v1";
1159
+ data: {
1160
+ priceSource: "mid" | "mark";
1161
+ basket: {
1162
+ symbol: string;
1163
+ weight: number;
1164
+ }[];
1165
+ direction: "ABOVE" | "BELOW";
1166
+ threshold: number;
1167
+ };
1168
+ } | {
1169
+ type: "weighted_ratio_v1";
1170
+ data: {
1171
+ priceSource: "mid" | "mark";
1172
+ basket: {
1173
+ symbol: string;
1174
+ side: "BUY" | "SELL";
1175
+ weight: number;
1176
+ }[];
1177
+ direction: "ABOVE" | "BELOW";
1178
+ threshold: number;
1179
+ };
1180
+ } | {
1181
+ type: "position_value_v1";
1182
+ data: {
1183
+ priceSource: "mid" | "mark";
1184
+ direction: "ABOVE" | "BELOW";
1185
+ threshold: number;
1186
+ };
1187
+ } | {
1188
+ type: "position_upnl_value_v1";
1189
+ data: {
1190
+ priceSource: "mid" | "mark";
1191
+ direction: "ABOVE" | "BELOW";
1192
+ threshold: number;
1193
+ };
1194
+ } | {
1195
+ type: "position_upnl_percentage_v1";
1196
+ data: {
1197
+ priceSource: "mid" | "mark";
1198
+ direction: "ABOVE" | "BELOW";
1199
+ threshold_bps: number;
1200
+ };
1201
+ };
1202
+ context: {
1203
+ type: "MARKET";
1204
+ position: {
1205
+ id: string;
1206
+ initialExposure: Record<string, string>;
1207
+ };
1208
+ };
1209
+ triggeredAt?: string | undefined;
1210
+ cancelledAt?: string | undefined;
1211
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
1212
+ fills?: {
1213
+ id: string;
1214
+ tradeAccountId: string;
1215
+ symbol: string;
1216
+ positionId: string;
1217
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1218
+ side: "BUY" | "SELL";
1219
+ reduceOnly: boolean;
1220
+ quantity: string;
1221
+ price: string;
1222
+ usd: string;
1223
+ timestamp: string;
1224
+ cloid?: string | undefined;
1225
+ fee?: string | undefined;
1226
+ }[] | undefined;
1227
+ bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
1228
+ })[];
1229
+ }>;
1230
+ open: (body: HttpTypes.CreateTriggerOpen, headers?: ClientHeaders) => Promise<{
1231
+ trigger: {
1232
+ id: string;
1233
+ tradeAccountId: string;
1234
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1235
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1236
+ createdAt: string;
1237
+ updatedAt: string;
1238
+ intent: "OPEN";
1239
+ type: "MARKET";
1240
+ condition: {
1241
+ type: "ratio_v1";
1242
+ data: {
1243
+ priceSource: "mid" | "mark";
1244
+ symbol_a: string;
1245
+ symbol_b: string;
1246
+ direction: "ABOVE" | "BELOW";
1247
+ threshold: number;
1248
+ };
1249
+ } | {
1250
+ type: "price_v1";
1251
+ data: {
1252
+ priceSource: "mid" | "mark";
1253
+ symbol: string;
1254
+ direction: "ABOVE" | "BELOW";
1255
+ threshold: number;
1256
+ };
1257
+ } | {
1258
+ type: "index_v1";
1259
+ data: {
1260
+ priceSource: "mid" | "mark";
1261
+ basket: {
1262
+ symbol: string;
1263
+ weight: number;
1264
+ }[];
1265
+ direction: "ABOVE" | "BELOW";
1266
+ threshold: number;
1267
+ };
1268
+ } | {
1269
+ type: "weighted_ratio_v1";
1270
+ data: {
1271
+ priceSource: "mid" | "mark";
1272
+ basket: {
1273
+ symbol: string;
1274
+ side: "BUY" | "SELL";
1275
+ weight: number;
1276
+ }[];
1277
+ direction: "ABOVE" | "BELOW";
1278
+ threshold: number;
1279
+ };
1280
+ };
1281
+ context: {
1282
+ type: "MARKET";
1283
+ legs: [{
1284
+ symbol: string;
1285
+ side: "BUY" | "SELL";
1286
+ mode: "QUANTITY" | "USD";
1287
+ amount: string;
1288
+ }, ...{
1289
+ symbol: string;
1290
+ side: "BUY" | "SELL";
1291
+ mode: "QUANTITY" | "USD";
1292
+ amount: string;
1293
+ }[]];
1294
+ };
1295
+ triggeredAt?: string | undefined;
1296
+ cancelledAt?: string | undefined;
1297
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
1298
+ fills?: {
1299
+ id: string;
1300
+ tradeAccountId: string;
1301
+ symbol: string;
1302
+ positionId: string;
1303
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1304
+ side: "BUY" | "SELL";
1305
+ reduceOnly: boolean;
1306
+ quantity: string;
1307
+ price: string;
1308
+ usd: string;
1309
+ timestamp: string;
1310
+ cloid?: string | undefined;
1311
+ fee?: string | undefined;
1312
+ }[] | undefined;
1313
+ bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
1314
+ } | {
1315
+ id: string;
1316
+ tradeAccountId: string;
1317
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1318
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1319
+ createdAt: string;
1320
+ updatedAt: string;
1321
+ intent: "ADJUST";
1322
+ type: "MARKET";
1323
+ condition: {
1324
+ type: "ratio_v1";
1325
+ data: {
1326
+ priceSource: "mid" | "mark";
1327
+ symbol_a: string;
1328
+ symbol_b: string;
1329
+ direction: "ABOVE" | "BELOW";
1330
+ threshold: number;
1331
+ };
1332
+ } | {
1333
+ type: "price_v1";
1334
+ data: {
1335
+ priceSource: "mid" | "mark";
1336
+ symbol: string;
1337
+ direction: "ABOVE" | "BELOW";
1338
+ threshold: number;
1339
+ };
1340
+ } | {
1341
+ type: "index_v1";
1342
+ data: {
1343
+ priceSource: "mid" | "mark";
1344
+ basket: {
1345
+ symbol: string;
1346
+ weight: number;
1347
+ }[];
1348
+ direction: "ABOVE" | "BELOW";
1349
+ threshold: number;
1350
+ };
1351
+ } | {
1352
+ type: "weighted_ratio_v1";
1353
+ data: {
1354
+ priceSource: "mid" | "mark";
1355
+ basket: {
1356
+ symbol: string;
1357
+ side: "BUY" | "SELL";
1358
+ weight: number;
1359
+ }[];
1360
+ direction: "ABOVE" | "BELOW";
1361
+ threshold: number;
1362
+ };
1363
+ } | {
1364
+ type: "position_value_v1";
1365
+ data: {
1366
+ priceSource: "mid" | "mark";
1367
+ direction: "ABOVE" | "BELOW";
1368
+ threshold: number;
1369
+ };
1370
+ } | {
1371
+ type: "position_upnl_value_v1";
1372
+ data: {
1373
+ priceSource: "mid" | "mark";
1374
+ direction: "ABOVE" | "BELOW";
1375
+ threshold: number;
1376
+ };
1377
+ } | {
1378
+ type: "position_upnl_percentage_v1";
1379
+ data: {
1380
+ priceSource: "mid" | "mark";
1381
+ direction: "ABOVE" | "BELOW";
1382
+ threshold_bps: number;
1383
+ };
1384
+ };
1385
+ context: {
1386
+ type: "MARKET";
1387
+ position: {
1388
+ id: string;
1389
+ initialExposure: Record<string, string>;
1390
+ };
1391
+ legs: [{
1392
+ symbol: string;
1393
+ side: "BUY" | "SELL";
1394
+ mode: "QUANTITY" | "USD";
1395
+ amount: string;
1396
+ reduceOnly: boolean;
1397
+ }, ...{
1398
+ symbol: string;
1399
+ side: "BUY" | "SELL";
1400
+ mode: "QUANTITY" | "USD";
1401
+ amount: string;
1402
+ reduceOnly: boolean;
1403
+ }[]];
1404
+ };
1405
+ triggeredAt?: string | undefined;
1406
+ cancelledAt?: string | undefined;
1407
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
1408
+ fills?: {
1409
+ id: string;
1410
+ tradeAccountId: string;
1411
+ symbol: string;
1412
+ positionId: string;
1413
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1414
+ side: "BUY" | "SELL";
1415
+ reduceOnly: boolean;
1416
+ quantity: string;
1417
+ price: string;
1418
+ usd: string;
1419
+ timestamp: string;
1420
+ cloid?: string | undefined;
1421
+ fee?: string | undefined;
1422
+ }[] | undefined;
1423
+ bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
1424
+ } | {
1425
+ id: string;
1426
+ tradeAccountId: string;
1427
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1428
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1429
+ createdAt: string;
1430
+ updatedAt: string;
1431
+ intent: "CLOSE";
1432
+ type: "MARKET";
1433
+ condition: {
1434
+ type: "ratio_v1";
1435
+ data: {
1436
+ priceSource: "mid" | "mark";
1437
+ symbol_a: string;
1438
+ symbol_b: string;
1439
+ direction: "ABOVE" | "BELOW";
1440
+ threshold: number;
1441
+ };
1442
+ } | {
1443
+ type: "price_v1";
1444
+ data: {
1445
+ priceSource: "mid" | "mark";
1446
+ symbol: string;
1447
+ direction: "ABOVE" | "BELOW";
1448
+ threshold: number;
1449
+ };
1450
+ } | {
1451
+ type: "index_v1";
1452
+ data: {
1453
+ priceSource: "mid" | "mark";
1454
+ basket: {
1455
+ symbol: string;
1456
+ weight: number;
1457
+ }[];
1458
+ direction: "ABOVE" | "BELOW";
1459
+ threshold: number;
1460
+ };
1461
+ } | {
1462
+ type: "weighted_ratio_v1";
1463
+ data: {
1464
+ priceSource: "mid" | "mark";
1465
+ basket: {
1466
+ symbol: string;
1467
+ side: "BUY" | "SELL";
1468
+ weight: number;
1469
+ }[];
1470
+ direction: "ABOVE" | "BELOW";
1471
+ threshold: number;
1472
+ };
1473
+ } | {
1474
+ type: "position_value_v1";
1475
+ data: {
1476
+ priceSource: "mid" | "mark";
1477
+ direction: "ABOVE" | "BELOW";
1478
+ threshold: number;
1479
+ };
1480
+ } | {
1481
+ type: "position_upnl_value_v1";
1482
+ data: {
1483
+ priceSource: "mid" | "mark";
1484
+ direction: "ABOVE" | "BELOW";
1485
+ threshold: number;
1486
+ };
1487
+ } | {
1488
+ type: "position_upnl_percentage_v1";
1489
+ data: {
1490
+ priceSource: "mid" | "mark";
1491
+ direction: "ABOVE" | "BELOW";
1492
+ threshold_bps: number;
1493
+ };
1494
+ };
1495
+ context: {
1496
+ type: "MARKET";
1497
+ position: {
1498
+ id: string;
1499
+ initialExposure: Record<string, string>;
1500
+ };
1501
+ };
1502
+ triggeredAt?: string | undefined;
1503
+ cancelledAt?: string | undefined;
1504
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
1505
+ fills?: {
1506
+ id: string;
1507
+ tradeAccountId: string;
1508
+ symbol: string;
1509
+ positionId: string;
1510
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1511
+ side: "BUY" | "SELL";
1512
+ reduceOnly: boolean;
1513
+ quantity: string;
1514
+ price: string;
1515
+ usd: string;
1516
+ timestamp: string;
1517
+ cloid?: string | undefined;
1518
+ fee?: string | undefined;
1519
+ }[] | undefined;
1520
+ bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
1521
+ };
1522
+ }>;
1523
+ close: (body: HttpTypes.CreateTriggerClose, headers?: ClientHeaders) => Promise<{
1524
+ trigger: {
1525
+ id: string;
1526
+ tradeAccountId: string;
1527
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1528
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1529
+ createdAt: string;
1530
+ updatedAt: string;
1531
+ intent: "OPEN";
1532
+ type: "MARKET";
1533
+ condition: {
1534
+ type: "ratio_v1";
1535
+ data: {
1536
+ priceSource: "mid" | "mark";
1537
+ symbol_a: string;
1538
+ symbol_b: string;
1539
+ direction: "ABOVE" | "BELOW";
1540
+ threshold: number;
1541
+ };
1542
+ } | {
1543
+ type: "price_v1";
1544
+ data: {
1545
+ priceSource: "mid" | "mark";
1546
+ symbol: string;
1547
+ direction: "ABOVE" | "BELOW";
1548
+ threshold: number;
1549
+ };
1550
+ } | {
1551
+ type: "index_v1";
1552
+ data: {
1553
+ priceSource: "mid" | "mark";
1554
+ basket: {
1555
+ symbol: string;
1556
+ weight: number;
1557
+ }[];
1558
+ direction: "ABOVE" | "BELOW";
1559
+ threshold: number;
1560
+ };
1561
+ } | {
1562
+ type: "weighted_ratio_v1";
1563
+ data: {
1564
+ priceSource: "mid" | "mark";
1565
+ basket: {
1566
+ symbol: string;
1567
+ side: "BUY" | "SELL";
1568
+ weight: number;
1569
+ }[];
1570
+ direction: "ABOVE" | "BELOW";
1571
+ threshold: number;
1572
+ };
1573
+ };
1574
+ context: {
1575
+ type: "MARKET";
1576
+ legs: [{
1577
+ symbol: string;
1578
+ side: "BUY" | "SELL";
1579
+ mode: "QUANTITY" | "USD";
1580
+ amount: string;
1581
+ }, ...{
1582
+ symbol: string;
1583
+ side: "BUY" | "SELL";
1584
+ mode: "QUANTITY" | "USD";
1585
+ amount: string;
1586
+ }[]];
1587
+ };
1588
+ triggeredAt?: string | undefined;
1589
+ cancelledAt?: string | undefined;
1590
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
1591
+ fills?: {
1592
+ id: string;
1593
+ tradeAccountId: string;
1594
+ symbol: string;
1595
+ positionId: string;
1596
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1597
+ side: "BUY" | "SELL";
1598
+ reduceOnly: boolean;
1599
+ quantity: string;
1600
+ price: string;
1601
+ usd: string;
1602
+ timestamp: string;
1603
+ cloid?: string | undefined;
1604
+ fee?: string | undefined;
1605
+ }[] | undefined;
1606
+ bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
1607
+ } | {
1608
+ id: string;
1609
+ tradeAccountId: string;
1610
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1611
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1612
+ createdAt: string;
1613
+ updatedAt: string;
1614
+ intent: "ADJUST";
1615
+ type: "MARKET";
1616
+ condition: {
1617
+ type: "ratio_v1";
1618
+ data: {
1619
+ priceSource: "mid" | "mark";
1620
+ symbol_a: string;
1621
+ symbol_b: string;
1622
+ direction: "ABOVE" | "BELOW";
1623
+ threshold: number;
1624
+ };
1625
+ } | {
1626
+ type: "price_v1";
1627
+ data: {
1628
+ priceSource: "mid" | "mark";
1629
+ symbol: string;
1630
+ direction: "ABOVE" | "BELOW";
1631
+ threshold: number;
1632
+ };
1633
+ } | {
1634
+ type: "index_v1";
1635
+ data: {
1636
+ priceSource: "mid" | "mark";
1637
+ basket: {
1638
+ symbol: string;
1639
+ weight: number;
1640
+ }[];
1641
+ direction: "ABOVE" | "BELOW";
1642
+ threshold: number;
1643
+ };
1644
+ } | {
1645
+ type: "weighted_ratio_v1";
1646
+ data: {
1647
+ priceSource: "mid" | "mark";
1648
+ basket: {
1649
+ symbol: string;
1650
+ side: "BUY" | "SELL";
1651
+ weight: number;
1652
+ }[];
1653
+ direction: "ABOVE" | "BELOW";
1654
+ threshold: number;
1655
+ };
1656
+ } | {
1657
+ type: "position_value_v1";
1658
+ data: {
1659
+ priceSource: "mid" | "mark";
1660
+ direction: "ABOVE" | "BELOW";
1661
+ threshold: number;
1662
+ };
1663
+ } | {
1664
+ type: "position_upnl_value_v1";
1665
+ data: {
1666
+ priceSource: "mid" | "mark";
1667
+ direction: "ABOVE" | "BELOW";
1668
+ threshold: number;
1669
+ };
1670
+ } | {
1671
+ type: "position_upnl_percentage_v1";
1672
+ data: {
1673
+ priceSource: "mid" | "mark";
1674
+ direction: "ABOVE" | "BELOW";
1675
+ threshold_bps: number;
1676
+ };
1677
+ };
1678
+ context: {
1679
+ type: "MARKET";
1680
+ position: {
1681
+ id: string;
1682
+ initialExposure: Record<string, string>;
1683
+ };
1684
+ legs: [{
1685
+ symbol: string;
1686
+ side: "BUY" | "SELL";
1687
+ mode: "QUANTITY" | "USD";
1688
+ amount: string;
1689
+ reduceOnly: boolean;
1690
+ }, ...{
1691
+ symbol: string;
1692
+ side: "BUY" | "SELL";
1693
+ mode: "QUANTITY" | "USD";
1694
+ amount: string;
1695
+ reduceOnly: boolean;
1696
+ }[]];
1697
+ };
1698
+ triggeredAt?: string | undefined;
1699
+ cancelledAt?: string | undefined;
1700
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
1701
+ fills?: {
1702
+ id: string;
1703
+ tradeAccountId: string;
1704
+ symbol: string;
1705
+ positionId: string;
1706
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1707
+ side: "BUY" | "SELL";
1708
+ reduceOnly: boolean;
1709
+ quantity: string;
1710
+ price: string;
1711
+ usd: string;
1712
+ timestamp: string;
1713
+ cloid?: string | undefined;
1714
+ fee?: string | undefined;
1715
+ }[] | undefined;
1716
+ bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
1717
+ } | {
1718
+ id: string;
1719
+ tradeAccountId: string;
1720
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1721
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1722
+ createdAt: string;
1723
+ updatedAt: string;
1724
+ intent: "CLOSE";
1725
+ type: "MARKET";
1726
+ condition: {
1727
+ type: "ratio_v1";
1728
+ data: {
1729
+ priceSource: "mid" | "mark";
1730
+ symbol_a: string;
1731
+ symbol_b: string;
1732
+ direction: "ABOVE" | "BELOW";
1733
+ threshold: number;
1734
+ };
1735
+ } | {
1736
+ type: "price_v1";
1737
+ data: {
1738
+ priceSource: "mid" | "mark";
1739
+ symbol: string;
1740
+ direction: "ABOVE" | "BELOW";
1741
+ threshold: number;
1742
+ };
1743
+ } | {
1744
+ type: "index_v1";
1745
+ data: {
1746
+ priceSource: "mid" | "mark";
1747
+ basket: {
1748
+ symbol: string;
1749
+ weight: number;
1750
+ }[];
1751
+ direction: "ABOVE" | "BELOW";
1752
+ threshold: number;
1753
+ };
1754
+ } | {
1755
+ type: "weighted_ratio_v1";
1756
+ data: {
1757
+ priceSource: "mid" | "mark";
1758
+ basket: {
1759
+ symbol: string;
1760
+ side: "BUY" | "SELL";
1761
+ weight: number;
1762
+ }[];
1763
+ direction: "ABOVE" | "BELOW";
1764
+ threshold: number;
1765
+ };
1766
+ } | {
1767
+ type: "position_value_v1";
1768
+ data: {
1769
+ priceSource: "mid" | "mark";
1770
+ direction: "ABOVE" | "BELOW";
1771
+ threshold: number;
1772
+ };
1773
+ } | {
1774
+ type: "position_upnl_value_v1";
1775
+ data: {
1776
+ priceSource: "mid" | "mark";
1777
+ direction: "ABOVE" | "BELOW";
1778
+ threshold: number;
1779
+ };
1780
+ } | {
1781
+ type: "position_upnl_percentage_v1";
1782
+ data: {
1783
+ priceSource: "mid" | "mark";
1784
+ direction: "ABOVE" | "BELOW";
1785
+ threshold_bps: number;
1786
+ };
1787
+ };
1788
+ context: {
1789
+ type: "MARKET";
1790
+ position: {
1791
+ id: string;
1792
+ initialExposure: Record<string, string>;
1793
+ };
1794
+ };
1795
+ triggeredAt?: string | undefined;
1796
+ cancelledAt?: string | undefined;
1797
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
1798
+ fills?: {
1799
+ id: string;
1800
+ tradeAccountId: string;
1801
+ symbol: string;
1802
+ positionId: string;
1803
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1804
+ side: "BUY" | "SELL";
1805
+ reduceOnly: boolean;
1806
+ quantity: string;
1807
+ price: string;
1808
+ usd: string;
1809
+ timestamp: string;
1810
+ cloid?: string | undefined;
1811
+ fee?: string | undefined;
1812
+ }[] | undefined;
1813
+ bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
1814
+ };
1815
+ }>;
1816
+ cancel: (triggerId: string, headers?: ClientHeaders) => Promise<{
1817
+ id: string;
1818
+ }>;
1819
+ cancelAll: (headers?: ClientHeaders) => Promise<{
1820
+ ids: string[];
1821
+ }>;
1822
+ };
1823
+ users: {
1824
+ profile: (headers?: ClientHeaders) => Promise<{
1825
+ profile: {
1826
+ id: string;
1827
+ displayName: string;
1828
+ role: "basic" | "pro";
1829
+ address: string | null;
1830
+ email: string | null;
1831
+ emailVerified: boolean;
1832
+ };
1833
+ preferences: {
1834
+ slippageToleranceBps: number;
1835
+ };
1836
+ }>;
1837
+ updateDisplayName: (body: HttpTypes.UpdateUserDisplayName, headers?: ClientHeaders) => Promise<{
1838
+ displayName: string;
1839
+ }>;
1840
+ updatePreferences: (body: HttpTypes.UpdateUserPreferences, headers?: ClientHeaders) => Promise<{
1841
+ preferences: {
1842
+ slippageToleranceBps: number;
1843
+ };
1844
+ }>;
1845
+ };
1846
+ statistics: {
1847
+ daily: (query: HttpTypes.DailyStatisticsQueryParamsInput, headers?: ClientHeaders) => Promise<{
1848
+ data: {
1849
+ date: string;
1850
+ volume: number;
1851
+ fees: number;
1852
+ users: number;
1853
+ newUsers: number;
1854
+ }[];
1855
+ }>;
1856
+ };
1857
+ }
1858
+
1859
+ export { Core };