@pear-protocol/types 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +1 -0
- package/dist/bundle.js +1 -0
- package/dist/connector/index.d.ts +2 -0
- package/dist/connector/index.js +2 -1
- package/dist/execution/entities.d.ts +26 -0
- package/dist/execution/queries.d.ts +1 -0
- package/dist/execution/responses.d.ts +16 -0
- package/dist/fee/entities.d.ts +1 -0
- package/dist/fee/queries.d.ts +1 -0
- package/dist/fill/entities.d.ts +1 -0
- package/dist/fill/queries.d.ts +1 -0
- package/dist/fill/responses.d.ts +2 -0
- package/dist/funding/queries.d.ts +1 -0
- package/dist/instrument/entities.d.ts +1 -0
- package/dist/instrument/queries.d.ts +1 -0
- package/dist/instrument/responses.d.ts +1 -0
- package/dist/ladder/entities.d.ts +16 -0
- package/dist/ladder/queries.d.ts +1 -0
- package/dist/ladder/responses.d.ts +48 -0
- package/dist/market/entities.d.ts +2 -0
- package/dist/market/payloads.d.ts +1 -0
- package/dist/market/queries.d.ts +2 -0
- package/dist/market/responses.d.ts +2 -0
- package/dist/notification/entities.d.ts +24 -0
- package/dist/notification/responses.d.ts +12 -0
- package/dist/order/entities.d.ts +2 -0
- package/dist/position/entities.d.ts +123 -0
- package/dist/position/entities.js +38 -1
- package/dist/position/queries.d.ts +29 -0
- package/dist/position/queries.js +12 -1
- package/dist/position/responses.d.ts +96 -0
- package/dist/position/responses.js +11 -2
- package/dist/price/queries.d.ts +1 -0
- package/dist/schedule/entities.d.ts +10 -0
- package/dist/schedule/queries.d.ts +1 -0
- package/dist/schedule/responses.d.ts +8 -0
- package/dist/statistics/entities.d.ts +1 -0
- package/dist/statistics/queries.d.ts +5 -1
- package/dist/statistics/responses.d.ts +1 -0
- package/dist/sync/payloads.d.ts +13 -0
- package/dist/tca/responses.d.ts +10 -0
- package/dist/trade/entities.d.ts +3 -0
- package/dist/trade/responses.d.ts +42 -0
- package/dist/trade-accounts/entities.d.ts +1 -0
- package/dist/trade-accounts/payloads.d.ts +21 -0
- package/dist/trade-accounts/payloads.js +10 -2
- package/dist/trade-accounts/response.d.ts +42 -0
- package/dist/trade-accounts/response.js +5 -1
- package/dist/trigger/entities/conditions.d.ts +4 -0
- package/dist/trigger/entities/index.d.ts +47 -0
- package/dist/trigger/payloads/conditions.d.ts +1 -0
- package/dist/trigger/payloads/index.d.ts +6 -0
- package/dist/trigger/queries.d.ts +1 -0
- package/dist/trigger/responses.d.ts +30 -0
- package/package.json +1 -1
|
@@ -60,6 +60,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
60
60
|
bybit: "bybit";
|
|
61
61
|
okx: "okx";
|
|
62
62
|
lighter: "lighter";
|
|
63
|
+
lighter_rhc: "lighter_rhc";
|
|
63
64
|
}>;
|
|
64
65
|
}, z.core.$strip>, z.ZodObject<{
|
|
65
66
|
legs: z.ZodArray<z.ZodObject<{
|
|
@@ -102,6 +103,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
102
103
|
bybit: "bybit";
|
|
103
104
|
okx: "okx";
|
|
104
105
|
lighter: "lighter";
|
|
106
|
+
lighter_rhc: "lighter_rhc";
|
|
105
107
|
}>;
|
|
106
108
|
}, z.core.$strip>, z.ZodObject<{
|
|
107
109
|
legs: z.ZodArray<z.ZodObject<{
|
|
@@ -140,6 +142,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
140
142
|
bybit: "bybit";
|
|
141
143
|
okx: "okx";
|
|
142
144
|
lighter: "lighter";
|
|
145
|
+
lighter_rhc: "lighter_rhc";
|
|
143
146
|
}>;
|
|
144
147
|
}, z.core.$strip>, z.ZodObject<{
|
|
145
148
|
legs: z.ZodArray<z.ZodObject<{
|
|
@@ -177,6 +180,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
177
180
|
bybit: "bybit";
|
|
178
181
|
okx: "okx";
|
|
179
182
|
lighter: "lighter";
|
|
183
|
+
lighter_rhc: "lighter_rhc";
|
|
180
184
|
}>;
|
|
181
185
|
}, z.core.$strip>, z.ZodObject<{
|
|
182
186
|
legs: z.ZodArray<z.ZodObject<{
|
|
@@ -196,6 +200,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
196
200
|
bybit: "bybit";
|
|
197
201
|
okx: "okx";
|
|
198
202
|
lighter: "lighter";
|
|
203
|
+
lighter_rhc: "lighter_rhc";
|
|
199
204
|
}>;
|
|
200
205
|
discarded: z.ZodArray<z.ZodObject<{
|
|
201
206
|
bracketType: z.ZodEnum<{
|
|
@@ -248,6 +253,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
248
253
|
bybit: "bybit";
|
|
249
254
|
okx: "okx";
|
|
250
255
|
lighter: "lighter";
|
|
256
|
+
lighter_rhc: "lighter_rhc";
|
|
251
257
|
}>;
|
|
252
258
|
weightSource: z.ZodEnum<{
|
|
253
259
|
INITIAL_WEIGHT: "INITIAL_WEIGHT";
|
|
@@ -276,6 +282,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
276
282
|
bybit: "bybit";
|
|
277
283
|
okx: "okx";
|
|
278
284
|
lighter: "lighter";
|
|
285
|
+
lighter_rhc: "lighter_rhc";
|
|
279
286
|
}>;
|
|
280
287
|
weightSource: z.ZodEnum<{
|
|
281
288
|
INITIAL_WEIGHT: "INITIAL_WEIGHT";
|
|
@@ -305,6 +312,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
305
312
|
bybit: "bybit";
|
|
306
313
|
okx: "okx";
|
|
307
314
|
lighter: "lighter";
|
|
315
|
+
lighter_rhc: "lighter_rhc";
|
|
308
316
|
}>;
|
|
309
317
|
weightSource: z.ZodEnum<{
|
|
310
318
|
INITIAL_WEIGHT: "INITIAL_WEIGHT";
|
|
@@ -328,6 +336,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
328
336
|
bybit: "bybit";
|
|
329
337
|
okx: "okx";
|
|
330
338
|
lighter: "lighter";
|
|
339
|
+
lighter_rhc: "lighter_rhc";
|
|
331
340
|
}>;
|
|
332
341
|
type: z.ZodLiteral<"trigger_twap_started">;
|
|
333
342
|
scheduleId: z.ZodUUID;
|
|
@@ -348,6 +357,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
348
357
|
bybit: "bybit";
|
|
349
358
|
okx: "okx";
|
|
350
359
|
lighter: "lighter";
|
|
360
|
+
lighter_rhc: "lighter_rhc";
|
|
351
361
|
}>;
|
|
352
362
|
type: z.ZodLiteral<"trigger_twap_skipped">;
|
|
353
363
|
reason: z.ZodString;
|
|
@@ -368,6 +378,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
368
378
|
bybit: "bybit";
|
|
369
379
|
okx: "okx";
|
|
370
380
|
lighter: "lighter";
|
|
381
|
+
lighter_rhc: "lighter_rhc";
|
|
371
382
|
}>;
|
|
372
383
|
type: z.ZodLiteral<"trigger_twap_failed">;
|
|
373
384
|
scheduleId: z.ZodOptional<z.ZodUUID>;
|
|
@@ -389,6 +400,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
389
400
|
bybit: "bybit";
|
|
390
401
|
okx: "okx";
|
|
391
402
|
lighter: "lighter";
|
|
403
|
+
lighter_rhc: "lighter_rhc";
|
|
392
404
|
}>;
|
|
393
405
|
type: z.ZodLiteral<"trigger_twap_position_changed">;
|
|
394
406
|
scheduleId: z.ZodUUID;
|
package/dist/order/entities.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const MarketOrder: z.ZodObject<{
|
|
|
15
15
|
bybit: "bybit";
|
|
16
16
|
okx: "okx";
|
|
17
17
|
lighter: "lighter";
|
|
18
|
+
lighter_rhc: "lighter_rhc";
|
|
18
19
|
}>;
|
|
19
20
|
status: z.ZodEnum<{
|
|
20
21
|
PENDING: "PENDING";
|
|
@@ -47,6 +48,7 @@ export declare const Order: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
47
48
|
bybit: "bybit";
|
|
48
49
|
okx: "okx";
|
|
49
50
|
lighter: "lighter";
|
|
51
|
+
lighter_rhc: "lighter_rhc";
|
|
50
52
|
}>;
|
|
51
53
|
status: z.ZodEnum<{
|
|
52
54
|
PENDING: "PENDING";
|
|
@@ -67,6 +67,7 @@ export declare const Position: z.ZodObject<{
|
|
|
67
67
|
bybit: "bybit";
|
|
68
68
|
okx: "okx";
|
|
69
69
|
lighter: "lighter";
|
|
70
|
+
lighter_rhc: "lighter_rhc";
|
|
70
71
|
}>;
|
|
71
72
|
status: z.ZodEnum<{
|
|
72
73
|
OPEN: "OPEN";
|
|
@@ -233,6 +234,7 @@ export declare const ClosedPosition: z.ZodObject<{
|
|
|
233
234
|
bybit: "bybit";
|
|
234
235
|
okx: "okx";
|
|
235
236
|
lighter: "lighter";
|
|
237
|
+
lighter_rhc: "lighter_rhc";
|
|
236
238
|
}>;
|
|
237
239
|
status: z.ZodLiteral<"CLOSED">;
|
|
238
240
|
openedAt: z.ZodString;
|
|
@@ -370,6 +372,7 @@ export declare const OpenPosition: z.ZodObject<{
|
|
|
370
372
|
bybit: "bybit";
|
|
371
373
|
okx: "okx";
|
|
372
374
|
lighter: "lighter";
|
|
375
|
+
lighter_rhc: "lighter_rhc";
|
|
373
376
|
}>;
|
|
374
377
|
status: z.ZodLiteral<"OPEN">;
|
|
375
378
|
openedAt: z.ZodString;
|
|
@@ -453,3 +456,123 @@ export declare const OpenPosition: z.ZodObject<{
|
|
|
453
456
|
}, z.core.$strip>>>;
|
|
454
457
|
}, z.core.$strip>;
|
|
455
458
|
export type OpenPosition = z.output<typeof OpenPosition>;
|
|
459
|
+
/**
|
|
460
|
+
* The public, vault-scoped view of one open leg: what it has booked and what it still
|
|
461
|
+
* holds, with fees and funding withheld. Built by allowlist so a field added to
|
|
462
|
+
* `OpenPositionLeg` never reaches the public wire without a deliberate decision.
|
|
463
|
+
*/
|
|
464
|
+
export declare const VaultOpenPositionLeg: z.ZodObject<{
|
|
465
|
+
side: z.ZodEnum<{
|
|
466
|
+
LONG: "LONG";
|
|
467
|
+
SHORT: "SHORT";
|
|
468
|
+
}>;
|
|
469
|
+
asset: z.ZodString;
|
|
470
|
+
realized: z.ZodObject<{
|
|
471
|
+
quantity: z.ZodString;
|
|
472
|
+
unpricedQuantity: z.ZodString;
|
|
473
|
+
exitVwap: z.ZodOptional<z.ZodString>;
|
|
474
|
+
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
475
|
+
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
476
|
+
}, z.core.$strip>;
|
|
477
|
+
remaining: z.ZodObject<{
|
|
478
|
+
quantity: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
479
|
+
entryVwap: z.ZodOptional<z.ZodString>;
|
|
480
|
+
}, z.core.$strip>;
|
|
481
|
+
}, z.core.$strip>;
|
|
482
|
+
export type VaultOpenPositionLeg = z.output<typeof VaultOpenPositionLeg>;
|
|
483
|
+
/**
|
|
484
|
+
* The public, vault-scoped view of one open position: position-level economics plus the
|
|
485
|
+
* reduced legs. No fee splits, no funding, no exposure sizing, no data-quality flags, no
|
|
486
|
+
* steps. Funding is withheld because attributing it replays the account's funding history
|
|
487
|
+
* since the position opened — a cost the anonymous route must not carry. Same allowlist
|
|
488
|
+
* rule as the leg — see `VaultOpenPositionLeg`.
|
|
489
|
+
*/
|
|
490
|
+
export declare const VaultOpenPosition: z.ZodObject<{
|
|
491
|
+
status: z.ZodLiteral<"OPEN">;
|
|
492
|
+
connector: z.ZodEnum<{
|
|
493
|
+
hyperliquid: "hyperliquid";
|
|
494
|
+
binance: "binance";
|
|
495
|
+
bybit: "bybit";
|
|
496
|
+
okx: "okx";
|
|
497
|
+
lighter: "lighter";
|
|
498
|
+
lighter_rhc: "lighter_rhc";
|
|
499
|
+
}>;
|
|
500
|
+
updatedAt: z.ZodString;
|
|
501
|
+
positionId: z.ZodUUID;
|
|
502
|
+
openedAt: z.ZodString;
|
|
503
|
+
realizedGrossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
504
|
+
netCashflow: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
505
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
506
|
+
side: z.ZodEnum<{
|
|
507
|
+
LONG: "LONG";
|
|
508
|
+
SHORT: "SHORT";
|
|
509
|
+
}>;
|
|
510
|
+
asset: z.ZodString;
|
|
511
|
+
realized: z.ZodObject<{
|
|
512
|
+
quantity: z.ZodString;
|
|
513
|
+
unpricedQuantity: z.ZodString;
|
|
514
|
+
exitVwap: z.ZodOptional<z.ZodString>;
|
|
515
|
+
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
516
|
+
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
517
|
+
}, z.core.$strip>;
|
|
518
|
+
remaining: z.ZodObject<{
|
|
519
|
+
quantity: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
520
|
+
entryVwap: z.ZodOptional<z.ZodString>;
|
|
521
|
+
}, z.core.$strip>;
|
|
522
|
+
}, z.core.$strip>>;
|
|
523
|
+
}, z.core.$strip>;
|
|
524
|
+
export type VaultOpenPosition = z.output<typeof VaultOpenPosition>;
|
|
525
|
+
/**
|
|
526
|
+
* The public, vault-scoped view of one closed leg: entry, exit and PnL, with fees, funding
|
|
527
|
+
* and committed-cash figures withheld. Same allowlist rule as `VaultOpenPositionLeg`.
|
|
528
|
+
*/
|
|
529
|
+
export declare const VaultClosedPositionLeg: z.ZodObject<{
|
|
530
|
+
side: z.ZodEnum<{
|
|
531
|
+
LONG: "LONG";
|
|
532
|
+
SHORT: "SHORT";
|
|
533
|
+
}>;
|
|
534
|
+
asset: z.ZodString;
|
|
535
|
+
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
536
|
+
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
537
|
+
entryVwap: z.ZodOptional<z.ZodString>;
|
|
538
|
+
exitVwap: z.ZodOptional<z.ZodString>;
|
|
539
|
+
}, z.core.$strip>;
|
|
540
|
+
export type VaultClosedPositionLeg = z.output<typeof VaultClosedPositionLeg>;
|
|
541
|
+
/**
|
|
542
|
+
* The public, vault-scoped view of one closed position: lifecycle, position-level PnL and
|
|
543
|
+
* the reduced legs. Funding is withheld for the same reason as on `VaultOpenPosition`;
|
|
544
|
+
* `netPnl` never folds it in, so the published figures stay exact without it.
|
|
545
|
+
*/
|
|
546
|
+
export declare const VaultClosedPosition: z.ZodObject<{
|
|
547
|
+
status: z.ZodLiteral<"CLOSED">;
|
|
548
|
+
connector: z.ZodEnum<{
|
|
549
|
+
hyperliquid: "hyperliquid";
|
|
550
|
+
binance: "binance";
|
|
551
|
+
bybit: "bybit";
|
|
552
|
+
okx: "okx";
|
|
553
|
+
lighter: "lighter";
|
|
554
|
+
lighter_rhc: "lighter_rhc";
|
|
555
|
+
}>;
|
|
556
|
+
closedReason: z.ZodOptional<z.ZodEnum<{
|
|
557
|
+
NETTED: "NETTED";
|
|
558
|
+
USER: "USER";
|
|
559
|
+
LIQUIDATED: "LIQUIDATED";
|
|
560
|
+
}>>;
|
|
561
|
+
closedAt: z.ZodString;
|
|
562
|
+
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
563
|
+
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
564
|
+
positionId: z.ZodUUID;
|
|
565
|
+
openedAt: z.ZodString;
|
|
566
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
567
|
+
side: z.ZodEnum<{
|
|
568
|
+
LONG: "LONG";
|
|
569
|
+
SHORT: "SHORT";
|
|
570
|
+
}>;
|
|
571
|
+
asset: z.ZodString;
|
|
572
|
+
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
573
|
+
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
574
|
+
entryVwap: z.ZodOptional<z.ZodString>;
|
|
575
|
+
exitVwap: z.ZodOptional<z.ZodString>;
|
|
576
|
+
}, z.core.$strip>>;
|
|
577
|
+
}, z.core.$strip>;
|
|
578
|
+
export type VaultClosedPosition = z.output<typeof VaultClosedPosition>;
|
|
@@ -372,5 +372,42 @@ const OpenPosition = z.object({
|
|
|
372
372
|
*/
|
|
373
373
|
steps: z.array(PositionStep).optional()
|
|
374
374
|
});
|
|
375
|
+
const VaultOpenPositionLeg = OpenPositionLeg.pick({
|
|
376
|
+
asset: true,
|
|
377
|
+
side: true,
|
|
378
|
+
realized: true,
|
|
379
|
+
remaining: true
|
|
380
|
+
});
|
|
381
|
+
const VaultOpenPosition = OpenPosition.pick({
|
|
382
|
+
positionId: true,
|
|
383
|
+
status: true,
|
|
384
|
+
connector: true,
|
|
385
|
+
openedAt: true,
|
|
386
|
+
updatedAt: true,
|
|
387
|
+
realizedGrossPnl: true,
|
|
388
|
+
netCashflow: true
|
|
389
|
+
}).extend({
|
|
390
|
+
legs: z.array(VaultOpenPositionLeg)
|
|
391
|
+
});
|
|
392
|
+
const VaultClosedPositionLeg = ClosedPositionLeg.pick({
|
|
393
|
+
asset: true,
|
|
394
|
+
side: true,
|
|
395
|
+
entryVwap: true,
|
|
396
|
+
exitVwap: true,
|
|
397
|
+
grossPnl: true,
|
|
398
|
+
netPnl: true
|
|
399
|
+
});
|
|
400
|
+
const VaultClosedPosition = ClosedPosition.pick({
|
|
401
|
+
positionId: true,
|
|
402
|
+
status: true,
|
|
403
|
+
connector: true,
|
|
404
|
+
openedAt: true,
|
|
405
|
+
closedAt: true,
|
|
406
|
+
closedReason: true,
|
|
407
|
+
grossPnl: true,
|
|
408
|
+
netPnl: true
|
|
409
|
+
}).extend({
|
|
410
|
+
legs: z.array(VaultClosedPositionLeg)
|
|
411
|
+
});
|
|
375
412
|
|
|
376
|
-
export { ClosedPosition, ClosedPositionLeg, ClosedPositionLegSide, OpenPosition, OpenPositionLeg, Position, PositionClosedReason, PositionEntryPrices, PositionExposure, PositionInitialExposureUSD, PositionOrigin, PositionStatus, PositionStep, PositionStepLeg, PositionTotalFundingPayment };
|
|
413
|
+
export { ClosedPosition, ClosedPositionLeg, ClosedPositionLegSide, OpenPosition, OpenPositionLeg, Position, PositionClosedReason, PositionEntryPrices, PositionExposure, PositionInitialExposureUSD, PositionOrigin, PositionStatus, PositionStep, PositionStepLeg, PositionTotalFundingPayment, VaultClosedPosition, VaultClosedPositionLeg, VaultOpenPosition, VaultOpenPositionLeg };
|
|
@@ -8,6 +8,7 @@ export declare const PositionListParams: z.ZodObject<{
|
|
|
8
8
|
bybit: "bybit";
|
|
9
9
|
okx: "okx";
|
|
10
10
|
lighter: "lighter";
|
|
11
|
+
lighter_rhc: "lighter_rhc";
|
|
11
12
|
}>>;
|
|
12
13
|
status: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[] | (("OPEN" | "CLOSED")[] & any[]) | undefined, ("OPEN" | "CLOSED")[]>, z.ZodArray<z.ZodEnum<{
|
|
13
14
|
OPEN: "OPEN";
|
|
@@ -49,3 +50,31 @@ export declare const OpenPositionListParams: z.ZodObject<{
|
|
|
49
50
|
}, z.core.$strip>;
|
|
50
51
|
export type OpenPositionListParamsInput = z.input<typeof OpenPositionListParams>;
|
|
51
52
|
export type OpenPositionListParams = z.output<typeof OpenPositionListParams>;
|
|
53
|
+
/**
|
|
54
|
+
* Public vault open-position page.
|
|
55
|
+
*
|
|
56
|
+
* The vault is named by the path, never by an account id, and the page cannot be
|
|
57
|
+
* narrowed to one position or asked for steps: the public surface is a bounded
|
|
58
|
+
* history read only. Strict so an attempt to pass a private-route filter is refused
|
|
59
|
+
* rather than silently ignored.
|
|
60
|
+
*/
|
|
61
|
+
export declare const VaultOpenPositionListParams: z.ZodObject<{
|
|
62
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
63
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<number>>>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
export type VaultOpenPositionListParamsInput = z.input<typeof VaultOpenPositionListParams>;
|
|
66
|
+
export type VaultOpenPositionListParams = z.output<typeof VaultOpenPositionListParams>;
|
|
67
|
+
/**
|
|
68
|
+
* Public vault closed-position page.
|
|
69
|
+
*
|
|
70
|
+
* Keeps the private route's close-time bounds and cap; drops `positionId` and
|
|
71
|
+
* `includeSteps` for the same reason as the open sibling.
|
|
72
|
+
*/
|
|
73
|
+
export declare const VaultClosedPositionListParams: z.ZodObject<{
|
|
74
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
75
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<number>>>;
|
|
76
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
77
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export type VaultClosedPositionListParamsInput = z.input<typeof VaultClosedPositionListParams>;
|
|
80
|
+
export type VaultClosedPositionListParams = z.output<typeof VaultClosedPositionListParams>;
|
package/dist/position/queries.js
CHANGED
|
@@ -94,5 +94,16 @@ const OpenPositionListParams = CursorFindParams.extend({
|
|
|
94
94
|
],
|
|
95
95
|
message: "includeSteps requires positionId"
|
|
96
96
|
});
|
|
97
|
+
const VaultOpenPositionListParams = CursorFindParams.extend({
|
|
98
|
+
/** Same cap as the private open history: every row drags its fills along. */
|
|
99
|
+
limit: z.coerce.number().int().positive().max(200).optional().default(20)
|
|
100
|
+
}).strict();
|
|
101
|
+
const VaultClosedPositionListParams = CursorFindParams.extend({
|
|
102
|
+
/** Same cap as the private closed history: every row drags its fills along. */
|
|
103
|
+
limit: z.coerce.number().int().positive().max(200).optional().default(20),
|
|
104
|
+
/** Inclusive bounds on the close time, exactly as `ClosedPositionListParams` defines them. */
|
|
105
|
+
startDate: z.string().optional(),
|
|
106
|
+
endDate: z.string().optional()
|
|
107
|
+
}).strict();
|
|
97
108
|
|
|
98
|
-
export { ClosedPositionListParams, OpenPositionListParams, PositionListParams };
|
|
109
|
+
export { ClosedPositionListParams, OpenPositionListParams, PositionListParams, VaultClosedPositionListParams, VaultOpenPositionListParams };
|
|
@@ -11,6 +11,7 @@ export declare const PositionListResponse: z.ZodObject<{
|
|
|
11
11
|
bybit: "bybit";
|
|
12
12
|
okx: "okx";
|
|
13
13
|
lighter: "lighter";
|
|
14
|
+
lighter_rhc: "lighter_rhc";
|
|
14
15
|
}>;
|
|
15
16
|
status: z.ZodEnum<{
|
|
16
17
|
OPEN: "OPEN";
|
|
@@ -54,6 +55,7 @@ export declare const OpenPositionLite: z.ZodObject<{
|
|
|
54
55
|
bybit: "bybit";
|
|
55
56
|
okx: "okx";
|
|
56
57
|
lighter: "lighter";
|
|
58
|
+
lighter_rhc: "lighter_rhc";
|
|
57
59
|
}>;
|
|
58
60
|
}, z.core.$strip>;
|
|
59
61
|
export declare const OpenPositionLiteListResponse: z.ZodObject<{
|
|
@@ -74,6 +76,7 @@ export declare const OpenPositionLiteListResponse: z.ZodObject<{
|
|
|
74
76
|
bybit: "bybit";
|
|
75
77
|
okx: "okx";
|
|
76
78
|
lighter: "lighter";
|
|
79
|
+
lighter_rhc: "lighter_rhc";
|
|
77
80
|
}>;
|
|
78
81
|
}, z.core.$strip>>;
|
|
79
82
|
}, z.core.$strip>;
|
|
@@ -98,6 +101,7 @@ export declare const ClosedPositionListResponse: z.ZodObject<{
|
|
|
98
101
|
bybit: "bybit";
|
|
99
102
|
okx: "okx";
|
|
100
103
|
lighter: "lighter";
|
|
104
|
+
lighter_rhc: "lighter_rhc";
|
|
101
105
|
}>;
|
|
102
106
|
status: z.ZodLiteral<"CLOSED">;
|
|
103
107
|
openedAt: z.ZodString;
|
|
@@ -205,6 +209,7 @@ export declare const OpenPositionListResponse: z.ZodObject<{
|
|
|
205
209
|
bybit: "bybit";
|
|
206
210
|
okx: "okx";
|
|
207
211
|
lighter: "lighter";
|
|
212
|
+
lighter_rhc: "lighter_rhc";
|
|
208
213
|
}>;
|
|
209
214
|
status: z.ZodLiteral<"OPEN">;
|
|
210
215
|
openedAt: z.ZodString;
|
|
@@ -289,3 +294,94 @@ export declare const OpenPositionListResponse: z.ZodObject<{
|
|
|
289
294
|
}, z.core.$strip>>;
|
|
290
295
|
}, z.core.$strip>;
|
|
291
296
|
export type OpenPositionListResponse = z.output<typeof OpenPositionListResponse>;
|
|
297
|
+
/**
|
|
298
|
+
* A public page of one vault's open positions, newest opened first.
|
|
299
|
+
*
|
|
300
|
+
* `vaultAddress` echoes the resolved (lowercased) vault so a client paging several
|
|
301
|
+
* vaults can tell the pages apart. Same paging rule as the private history: page until
|
|
302
|
+
* `nextCursor` is absent, never until a page comes back short.
|
|
303
|
+
*/
|
|
304
|
+
export declare const VaultOpenPositionListResponse: z.ZodObject<{
|
|
305
|
+
limit: z.ZodNumber;
|
|
306
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
307
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
308
|
+
positions: z.ZodArray<z.ZodObject<{
|
|
309
|
+
status: z.ZodLiteral<"OPEN">;
|
|
310
|
+
connector: z.ZodEnum<{
|
|
311
|
+
hyperliquid: "hyperliquid";
|
|
312
|
+
binance: "binance";
|
|
313
|
+
bybit: "bybit";
|
|
314
|
+
okx: "okx";
|
|
315
|
+
lighter: "lighter";
|
|
316
|
+
lighter_rhc: "lighter_rhc";
|
|
317
|
+
}>;
|
|
318
|
+
updatedAt: z.ZodString;
|
|
319
|
+
positionId: z.ZodUUID;
|
|
320
|
+
openedAt: z.ZodString;
|
|
321
|
+
realizedGrossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
322
|
+
netCashflow: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
323
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
324
|
+
side: z.ZodEnum<{
|
|
325
|
+
LONG: "LONG";
|
|
326
|
+
SHORT: "SHORT";
|
|
327
|
+
}>;
|
|
328
|
+
asset: z.ZodString;
|
|
329
|
+
realized: z.ZodObject<{
|
|
330
|
+
quantity: z.ZodString;
|
|
331
|
+
unpricedQuantity: z.ZodString;
|
|
332
|
+
exitVwap: z.ZodOptional<z.ZodString>;
|
|
333
|
+
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
334
|
+
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
335
|
+
}, z.core.$strip>;
|
|
336
|
+
remaining: z.ZodObject<{
|
|
337
|
+
quantity: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
338
|
+
entryVwap: z.ZodOptional<z.ZodString>;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
}, z.core.$strip>>;
|
|
341
|
+
}, z.core.$strip>>;
|
|
342
|
+
}, z.core.$strip>;
|
|
343
|
+
export type VaultOpenPositionListResponse = z.output<typeof VaultOpenPositionListResponse>;
|
|
344
|
+
/**
|
|
345
|
+
* A public page of one vault's closed positions, newest close first.
|
|
346
|
+
*
|
|
347
|
+
* A page may hold fewer than `limit` positions and still return a `nextCursor`, for the
|
|
348
|
+
* same reason as `ClosedPositionListResponse`. Page until `nextCursor` is absent.
|
|
349
|
+
*/
|
|
350
|
+
export declare const VaultClosedPositionListResponse: z.ZodObject<{
|
|
351
|
+
limit: z.ZodNumber;
|
|
352
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
353
|
+
vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
354
|
+
positions: z.ZodArray<z.ZodObject<{
|
|
355
|
+
status: z.ZodLiteral<"CLOSED">;
|
|
356
|
+
connector: z.ZodEnum<{
|
|
357
|
+
hyperliquid: "hyperliquid";
|
|
358
|
+
binance: "binance";
|
|
359
|
+
bybit: "bybit";
|
|
360
|
+
okx: "okx";
|
|
361
|
+
lighter: "lighter";
|
|
362
|
+
lighter_rhc: "lighter_rhc";
|
|
363
|
+
}>;
|
|
364
|
+
closedReason: z.ZodOptional<z.ZodEnum<{
|
|
365
|
+
NETTED: "NETTED";
|
|
366
|
+
USER: "USER";
|
|
367
|
+
LIQUIDATED: "LIQUIDATED";
|
|
368
|
+
}>>;
|
|
369
|
+
closedAt: z.ZodString;
|
|
370
|
+
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
371
|
+
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
372
|
+
positionId: z.ZodUUID;
|
|
373
|
+
openedAt: z.ZodString;
|
|
374
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
375
|
+
side: z.ZodEnum<{
|
|
376
|
+
LONG: "LONG";
|
|
377
|
+
SHORT: "SHORT";
|
|
378
|
+
}>;
|
|
379
|
+
asset: z.ZodString;
|
|
380
|
+
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
381
|
+
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
382
|
+
entryVwap: z.ZodOptional<z.ZodString>;
|
|
383
|
+
exitVwap: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, z.core.$strip>>;
|
|
385
|
+
}, z.core.$strip>>;
|
|
386
|
+
}, z.core.$strip>;
|
|
387
|
+
export type VaultClosedPositionListResponse = z.output<typeof VaultClosedPositionListResponse>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { CursorResponse } from '../common';
|
|
3
|
+
import { EthereumAddress } from '../common/address';
|
|
3
4
|
import { SignedDecimalString } from '../common/schema';
|
|
4
5
|
import { Connector } from '../connector';
|
|
5
6
|
import { InstrumentId } from '../instrument';
|
|
6
|
-
import { Position, PositionOrigin, ClosedPosition, OpenPosition } from './entities';
|
|
7
|
+
import { Position, PositionOrigin, ClosedPosition, OpenPosition, VaultOpenPosition, VaultClosedPosition } from './entities';
|
|
7
8
|
|
|
8
9
|
const PositionListResponse = CursorResponse.extend({
|
|
9
10
|
positions: z.array(Position)
|
|
@@ -26,5 +27,13 @@ const ClosedPositionListResponse = CursorResponse.extend({
|
|
|
26
27
|
const OpenPositionListResponse = CursorResponse.extend({
|
|
27
28
|
positions: z.array(OpenPosition)
|
|
28
29
|
});
|
|
30
|
+
const VaultOpenPositionListResponse = CursorResponse.extend({
|
|
31
|
+
vaultAddress: EthereumAddress,
|
|
32
|
+
positions: z.array(VaultOpenPosition)
|
|
33
|
+
});
|
|
34
|
+
const VaultClosedPositionListResponse = CursorResponse.extend({
|
|
35
|
+
vaultAddress: EthereumAddress,
|
|
36
|
+
positions: z.array(VaultClosedPosition)
|
|
37
|
+
});
|
|
29
38
|
|
|
30
|
-
export { ClosedPositionListResponse, OpenPositionListResponse, OpenPositionLite, OpenPositionLiteListResponse, PositionListResponse };
|
|
39
|
+
export { ClosedPositionListResponse, OpenPositionListResponse, OpenPositionLite, OpenPositionLiteListResponse, PositionListResponse, VaultClosedPositionListResponse, VaultOpenPositionListResponse };
|
package/dist/price/queries.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ declare const BaseSchedule: z.ZodObject<{
|
|
|
45
45
|
bybit: "bybit";
|
|
46
46
|
okx: "okx";
|
|
47
47
|
lighter: "lighter";
|
|
48
|
+
lighter_rhc: "lighter_rhc";
|
|
48
49
|
}>;
|
|
49
50
|
strategy: z.ZodEnum<{
|
|
50
51
|
TWAP: "TWAP";
|
|
@@ -95,6 +96,7 @@ declare const BaseSchedule: z.ZodObject<{
|
|
|
95
96
|
bybit: "bybit";
|
|
96
97
|
okx: "okx";
|
|
97
98
|
lighter: "lighter";
|
|
99
|
+
lighter_rhc: "lighter_rhc";
|
|
98
100
|
}>;
|
|
99
101
|
side: z.ZodEnum<{
|
|
100
102
|
BUY: "BUY";
|
|
@@ -123,6 +125,7 @@ export declare const TWAPOpen: z.ZodObject<{
|
|
|
123
125
|
bybit: "bybit";
|
|
124
126
|
okx: "okx";
|
|
125
127
|
lighter: "lighter";
|
|
128
|
+
lighter_rhc: "lighter_rhc";
|
|
126
129
|
}>;
|
|
127
130
|
status: z.ZodEnum<{
|
|
128
131
|
CANCELLED: "CANCELLED";
|
|
@@ -165,6 +168,7 @@ export declare const TWAPOpen: z.ZodObject<{
|
|
|
165
168
|
bybit: "bybit";
|
|
166
169
|
okx: "okx";
|
|
167
170
|
lighter: "lighter";
|
|
171
|
+
lighter_rhc: "lighter_rhc";
|
|
168
172
|
}>;
|
|
169
173
|
side: z.ZodEnum<{
|
|
170
174
|
BUY: "BUY";
|
|
@@ -212,6 +216,7 @@ export declare const TWAPClose: z.ZodObject<{
|
|
|
212
216
|
bybit: "bybit";
|
|
213
217
|
okx: "okx";
|
|
214
218
|
lighter: "lighter";
|
|
219
|
+
lighter_rhc: "lighter_rhc";
|
|
215
220
|
}>;
|
|
216
221
|
status: z.ZodEnum<{
|
|
217
222
|
CANCELLED: "CANCELLED";
|
|
@@ -254,6 +259,7 @@ export declare const TWAPClose: z.ZodObject<{
|
|
|
254
259
|
bybit: "bybit";
|
|
255
260
|
okx: "okx";
|
|
256
261
|
lighter: "lighter";
|
|
262
|
+
lighter_rhc: "lighter_rhc";
|
|
257
263
|
}>;
|
|
258
264
|
side: z.ZodEnum<{
|
|
259
265
|
BUY: "BUY";
|
|
@@ -292,6 +298,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
292
298
|
bybit: "bybit";
|
|
293
299
|
okx: "okx";
|
|
294
300
|
lighter: "lighter";
|
|
301
|
+
lighter_rhc: "lighter_rhc";
|
|
295
302
|
}>;
|
|
296
303
|
status: z.ZodEnum<{
|
|
297
304
|
CANCELLED: "CANCELLED";
|
|
@@ -334,6 +341,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
334
341
|
bybit: "bybit";
|
|
335
342
|
okx: "okx";
|
|
336
343
|
lighter: "lighter";
|
|
344
|
+
lighter_rhc: "lighter_rhc";
|
|
337
345
|
}>;
|
|
338
346
|
side: z.ZodEnum<{
|
|
339
347
|
BUY: "BUY";
|
|
@@ -380,6 +388,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
380
388
|
bybit: "bybit";
|
|
381
389
|
okx: "okx";
|
|
382
390
|
lighter: "lighter";
|
|
391
|
+
lighter_rhc: "lighter_rhc";
|
|
383
392
|
}>;
|
|
384
393
|
status: z.ZodEnum<{
|
|
385
394
|
CANCELLED: "CANCELLED";
|
|
@@ -422,6 +431,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
422
431
|
bybit: "bybit";
|
|
423
432
|
okx: "okx";
|
|
424
433
|
lighter: "lighter";
|
|
434
|
+
lighter_rhc: "lighter_rhc";
|
|
425
435
|
}>;
|
|
426
436
|
side: z.ZodEnum<{
|
|
427
437
|
BUY: "BUY";
|
|
@@ -8,6 +8,7 @@ export declare const ScheduleListParams: z.ZodObject<{
|
|
|
8
8
|
bybit: "bybit";
|
|
9
9
|
okx: "okx";
|
|
10
10
|
lighter: "lighter";
|
|
11
|
+
lighter_rhc: "lighter_rhc";
|
|
11
12
|
}>>;
|
|
12
13
|
status: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[] | (("CANCELLED" | "ACTIVE" | "COMPLETED")[] & any[]) | undefined, ("CANCELLED" | "ACTIVE" | "COMPLETED")[]>, z.ZodArray<z.ZodEnum<{
|
|
13
14
|
CANCELLED: "CANCELLED";
|
|
@@ -10,6 +10,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
10
10
|
bybit: "bybit";
|
|
11
11
|
okx: "okx";
|
|
12
12
|
lighter: "lighter";
|
|
13
|
+
lighter_rhc: "lighter_rhc";
|
|
13
14
|
}>;
|
|
14
15
|
status: z.ZodEnum<{
|
|
15
16
|
CANCELLED: "CANCELLED";
|
|
@@ -52,6 +53,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
52
53
|
bybit: "bybit";
|
|
53
54
|
okx: "okx";
|
|
54
55
|
lighter: "lighter";
|
|
56
|
+
lighter_rhc: "lighter_rhc";
|
|
55
57
|
}>;
|
|
56
58
|
side: z.ZodEnum<{
|
|
57
59
|
BUY: "BUY";
|
|
@@ -98,6 +100,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
98
100
|
bybit: "bybit";
|
|
99
101
|
okx: "okx";
|
|
100
102
|
lighter: "lighter";
|
|
103
|
+
lighter_rhc: "lighter_rhc";
|
|
101
104
|
}>;
|
|
102
105
|
status: z.ZodEnum<{
|
|
103
106
|
CANCELLED: "CANCELLED";
|
|
@@ -140,6 +143,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
140
143
|
bybit: "bybit";
|
|
141
144
|
okx: "okx";
|
|
142
145
|
lighter: "lighter";
|
|
146
|
+
lighter_rhc: "lighter_rhc";
|
|
143
147
|
}>;
|
|
144
148
|
side: z.ZodEnum<{
|
|
145
149
|
BUY: "BUY";
|
|
@@ -181,6 +185,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
181
185
|
bybit: "bybit";
|
|
182
186
|
okx: "okx";
|
|
183
187
|
lighter: "lighter";
|
|
188
|
+
lighter_rhc: "lighter_rhc";
|
|
184
189
|
}>;
|
|
185
190
|
status: z.ZodEnum<{
|
|
186
191
|
CANCELLED: "CANCELLED";
|
|
@@ -223,6 +228,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
223
228
|
bybit: "bybit";
|
|
224
229
|
okx: "okx";
|
|
225
230
|
lighter: "lighter";
|
|
231
|
+
lighter_rhc: "lighter_rhc";
|
|
226
232
|
}>;
|
|
227
233
|
side: z.ZodEnum<{
|
|
228
234
|
BUY: "BUY";
|
|
@@ -269,6 +275,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
269
275
|
bybit: "bybit";
|
|
270
276
|
okx: "okx";
|
|
271
277
|
lighter: "lighter";
|
|
278
|
+
lighter_rhc: "lighter_rhc";
|
|
272
279
|
}>;
|
|
273
280
|
status: z.ZodEnum<{
|
|
274
281
|
CANCELLED: "CANCELLED";
|
|
@@ -311,6 +318,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
311
318
|
bybit: "bybit";
|
|
312
319
|
okx: "okx";
|
|
313
320
|
lighter: "lighter";
|
|
321
|
+
lighter_rhc: "lighter_rhc";
|
|
314
322
|
}>;
|
|
315
323
|
side: z.ZodEnum<{
|
|
316
324
|
BUY: "BUY";
|