@pear-protocol/types 2.11.0 → 2.12.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/auth/payloads.d.ts +3 -3
- package/dist/auth/payloads.js +1 -1
- package/dist/baskets/saved/entities.js +1 -1
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.js +2 -0
- package/dist/common/refinement.d.ts +3 -3
- package/dist/common/trade-legs.js +1 -1
- package/dist/copy/entities.d.ts +186 -0
- package/dist/copy/entities.js +113 -0
- package/dist/copy/index.d.ts +4 -0
- package/dist/copy/index.js +4 -0
- package/dist/copy/payloads.d.ts +14 -0
- package/dist/copy/payloads.js +8 -0
- package/dist/copy/queries.d.ts +13 -0
- package/dist/copy/queries.js +16 -0
- package/dist/copy/responses.d.ts +332 -0
- package/dist/copy/responses.js +91 -0
- package/dist/execution/entities.d.ts +71 -71
- package/dist/execution/entities.js +1 -1
- package/dist/execution/queries.d.ts +2 -2
- package/dist/execution/responses.d.ts +40 -40
- package/dist/ladder/entities.d.ts +22 -17
- package/dist/ladder/queries.d.ts +5 -0
- package/dist/ladder/queries.js +6 -2
- package/dist/ladder/responses.d.ts +63 -48
- package/dist/misc/payloads.d.ts +26 -0
- package/dist/misc/payloads.js +27 -1
- package/dist/misc/responses.d.ts +8 -0
- package/dist/misc/responses.js +7 -1
- package/dist/notification/entities.d.ts +120 -0
- package/dist/notification/entities.js +59 -3
- package/dist/notification/responses.d.ts +60 -0
- package/dist/order/entities.d.ts +3 -3
- package/dist/position/entities.d.ts +1 -1
- package/dist/position/responses.d.ts +3 -1
- package/dist/position/responses.js +2 -0
- package/dist/schedule/entities.d.ts +18 -12
- package/dist/schedule/entities.js +2 -1
- package/dist/schedule/queries.d.ts +2 -2
- package/dist/schedule/responses.d.ts +12 -8
- package/dist/schedule/twap-config.js +1 -1
- package/dist/statistics/entities.d.ts +10 -0
- package/dist/statistics/entities.js +4 -0
- package/dist/statistics/responses.d.ts +10 -0
- package/dist/sync/payloads.d.ts +12 -0
- package/dist/sync/payloads.js +31 -3
- package/dist/tca/responses.d.ts +12 -12
- package/dist/trade/responses.d.ts +100 -100
- package/dist/trade-accounts/entities.d.ts +136 -12
- package/dist/trade-accounts/entities.js +41 -9
- package/dist/trade-accounts/payloads.d.ts +12 -0
- package/dist/trade-accounts/payloads.js +7 -1
- package/dist/trade-accounts/response.d.ts +963 -223
- package/dist/traders/index.d.ts +1 -0
- package/dist/traders/index.js +1 -0
- package/dist/traders/public.d.ts +4967 -0
- package/dist/traders/public.js +128 -0
- package/dist/trigger/common/index.d.ts +3 -2
- package/dist/trigger/common/index.js +1 -0
- package/dist/trigger/entities/index.d.ts +64 -48
- package/dist/trigger/entities/index.js +3 -3
- package/dist/trigger/queries.d.ts +2 -2
- package/dist/trigger/responses.d.ts +40 -30
- package/dist/vaults/entities.d.ts +1 -1
- package/dist/vaults/responses.d.ts +2 -2
- package/package.json +2 -2
|
@@ -26,6 +26,11 @@ export declare const NotificationCategory: z.ZodEnum<{
|
|
|
26
26
|
TRIGGER_TWAP_FAILED: "TRIGGER_TWAP_FAILED";
|
|
27
27
|
TRIGGER_TWAP_POSITION_CHANGED: "TRIGGER_TWAP_POSITION_CHANGED";
|
|
28
28
|
TRIGGER_CANCELLED_MIS_SCALED: "TRIGGER_CANCELLED_MIS_SCALED";
|
|
29
|
+
COPY_PLACED: "COPY_PLACED";
|
|
30
|
+
COPY_FAILED: "COPY_FAILED";
|
|
31
|
+
COPY_SUBSCRIPTION_STOPPED: "COPY_SUBSCRIPTION_STOPPED";
|
|
32
|
+
COPY_LEVERAGE_NOT_APPLIED: "COPY_LEVERAGE_NOT_APPLIED";
|
|
33
|
+
POSITION_LIQUIDATION: "POSITION_LIQUIDATION";
|
|
29
34
|
}>;
|
|
30
35
|
export type NotificationCategory = z.infer<typeof NotificationCategory>;
|
|
31
36
|
export declare const NotificationMetric: z.ZodEnum<{
|
|
@@ -47,6 +52,34 @@ export declare const NotificationMetric: z.ZodEnum<{
|
|
|
47
52
|
}>;
|
|
48
53
|
export type NotificationMetric = z.infer<typeof NotificationMetric>;
|
|
49
54
|
export declare const NotificationParameters: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"position_liquidation">;
|
|
56
|
+
positionId: z.ZodUUID;
|
|
57
|
+
tradeAccountId: z.ZodUUID;
|
|
58
|
+
connector: z.ZodEnum<{
|
|
59
|
+
hyperliquid: "hyperliquid";
|
|
60
|
+
binance: "binance";
|
|
61
|
+
bybit: "bybit";
|
|
62
|
+
okx: "okx";
|
|
63
|
+
lighter: "lighter";
|
|
64
|
+
lighter_rhc: "lighter_rhc";
|
|
65
|
+
}>;
|
|
66
|
+
exchangeFillId: z.ZodString;
|
|
67
|
+
occurredAt: z.ZodNumber;
|
|
68
|
+
leg: z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
symbol: z.ZodString;
|
|
71
|
+
side: z.ZodEnum<{
|
|
72
|
+
BUY: "BUY";
|
|
73
|
+
SELL: "SELL";
|
|
74
|
+
}>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
quantity: z.ZodString;
|
|
77
|
+
price: z.ZodString;
|
|
78
|
+
outcome: z.ZodEnum<{
|
|
79
|
+
CLOSED: "CLOSED";
|
|
80
|
+
REDUCED: "REDUCED";
|
|
81
|
+
}>;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
83
|
legs: z.ZodArray<z.ZodObject<{
|
|
51
84
|
id: z.ZodString;
|
|
52
85
|
symbol: z.ZodString;
|
|
@@ -438,6 +471,33 @@ export declare const NotificationParameters: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
438
471
|
positionKey: z.ZodString;
|
|
439
472
|
storedBps: z.ZodNumber;
|
|
440
473
|
readingMarginPct: z.ZodNumber;
|
|
474
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
475
|
+
type: z.ZodLiteral<"copy_placed">;
|
|
476
|
+
subscriptionId: z.ZodUUID;
|
|
477
|
+
activityId: z.ZodUUID;
|
|
478
|
+
resource: z.ZodObject<{
|
|
479
|
+
kind: z.ZodLiteral<"POSITION">;
|
|
480
|
+
id: z.ZodUUID;
|
|
481
|
+
}, z.core.$strip>;
|
|
482
|
+
leaderTradeAccountId: z.ZodUUID;
|
|
483
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
484
|
+
type: z.ZodLiteral<"copy_failed">;
|
|
485
|
+
subscriptionId: z.ZodUUID;
|
|
486
|
+
activityId: z.ZodUUID;
|
|
487
|
+
reason: z.ZodString;
|
|
488
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
489
|
+
type: z.ZodLiteral<"copy_subscription_stopped">;
|
|
490
|
+
subscriptionId: z.ZodUUID;
|
|
491
|
+
reason: z.ZodEnum<{
|
|
492
|
+
REPEATED_FAILURES: "REPEATED_FAILURES";
|
|
493
|
+
MANUAL_TRADE: "MANUAL_TRADE";
|
|
494
|
+
EXTERNAL_POSITION_DETECTED: "EXTERNAL_POSITION_DETECTED";
|
|
495
|
+
LEADER_EXTERNAL_ACTIVITY: "LEADER_EXTERNAL_ACTIVITY";
|
|
496
|
+
}>;
|
|
497
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
498
|
+
type: z.ZodLiteral<"copy_leverage_not_applied">;
|
|
499
|
+
subscriptionId: z.ZodUUID;
|
|
500
|
+
activityId: z.ZodUUID;
|
|
441
501
|
}, z.core.$strip>], "type">;
|
|
442
502
|
export type NotificationParameters = z.output<typeof NotificationParameters>;
|
|
443
503
|
export declare const Notification: z.ZodObject<{
|
|
@@ -458,8 +518,41 @@ export declare const Notification: z.ZodObject<{
|
|
|
458
518
|
TRIGGER_TWAP_FAILED: "TRIGGER_TWAP_FAILED";
|
|
459
519
|
TRIGGER_TWAP_POSITION_CHANGED: "TRIGGER_TWAP_POSITION_CHANGED";
|
|
460
520
|
TRIGGER_CANCELLED_MIS_SCALED: "TRIGGER_CANCELLED_MIS_SCALED";
|
|
521
|
+
COPY_PLACED: "COPY_PLACED";
|
|
522
|
+
COPY_FAILED: "COPY_FAILED";
|
|
523
|
+
COPY_SUBSCRIPTION_STOPPED: "COPY_SUBSCRIPTION_STOPPED";
|
|
524
|
+
COPY_LEVERAGE_NOT_APPLIED: "COPY_LEVERAGE_NOT_APPLIED";
|
|
525
|
+
POSITION_LIQUIDATION: "POSITION_LIQUIDATION";
|
|
461
526
|
}>;
|
|
462
527
|
parameters: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
528
|
+
type: z.ZodLiteral<"position_liquidation">;
|
|
529
|
+
positionId: z.ZodUUID;
|
|
530
|
+
tradeAccountId: z.ZodUUID;
|
|
531
|
+
connector: z.ZodEnum<{
|
|
532
|
+
hyperliquid: "hyperliquid";
|
|
533
|
+
binance: "binance";
|
|
534
|
+
bybit: "bybit";
|
|
535
|
+
okx: "okx";
|
|
536
|
+
lighter: "lighter";
|
|
537
|
+
lighter_rhc: "lighter_rhc";
|
|
538
|
+
}>;
|
|
539
|
+
exchangeFillId: z.ZodString;
|
|
540
|
+
occurredAt: z.ZodNumber;
|
|
541
|
+
leg: z.ZodObject<{
|
|
542
|
+
id: z.ZodString;
|
|
543
|
+
symbol: z.ZodString;
|
|
544
|
+
side: z.ZodEnum<{
|
|
545
|
+
BUY: "BUY";
|
|
546
|
+
SELL: "SELL";
|
|
547
|
+
}>;
|
|
548
|
+
}, z.core.$strip>;
|
|
549
|
+
quantity: z.ZodString;
|
|
550
|
+
price: z.ZodString;
|
|
551
|
+
outcome: z.ZodEnum<{
|
|
552
|
+
CLOSED: "CLOSED";
|
|
553
|
+
REDUCED: "REDUCED";
|
|
554
|
+
}>;
|
|
555
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
463
556
|
legs: z.ZodArray<z.ZodObject<{
|
|
464
557
|
id: z.ZodString;
|
|
465
558
|
symbol: z.ZodString;
|
|
@@ -851,6 +944,33 @@ export declare const Notification: z.ZodObject<{
|
|
|
851
944
|
positionKey: z.ZodString;
|
|
852
945
|
storedBps: z.ZodNumber;
|
|
853
946
|
readingMarginPct: z.ZodNumber;
|
|
947
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
948
|
+
type: z.ZodLiteral<"copy_placed">;
|
|
949
|
+
subscriptionId: z.ZodUUID;
|
|
950
|
+
activityId: z.ZodUUID;
|
|
951
|
+
resource: z.ZodObject<{
|
|
952
|
+
kind: z.ZodLiteral<"POSITION">;
|
|
953
|
+
id: z.ZodUUID;
|
|
954
|
+
}, z.core.$strip>;
|
|
955
|
+
leaderTradeAccountId: z.ZodUUID;
|
|
956
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
957
|
+
type: z.ZodLiteral<"copy_failed">;
|
|
958
|
+
subscriptionId: z.ZodUUID;
|
|
959
|
+
activityId: z.ZodUUID;
|
|
960
|
+
reason: z.ZodString;
|
|
961
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
962
|
+
type: z.ZodLiteral<"copy_subscription_stopped">;
|
|
963
|
+
subscriptionId: z.ZodUUID;
|
|
964
|
+
reason: z.ZodEnum<{
|
|
965
|
+
REPEATED_FAILURES: "REPEATED_FAILURES";
|
|
966
|
+
MANUAL_TRADE: "MANUAL_TRADE";
|
|
967
|
+
EXTERNAL_POSITION_DETECTED: "EXTERNAL_POSITION_DETECTED";
|
|
968
|
+
LEADER_EXTERNAL_ACTIVITY: "LEADER_EXTERNAL_ACTIVITY";
|
|
969
|
+
}>;
|
|
970
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
971
|
+
type: z.ZodLiteral<"copy_leverage_not_applied">;
|
|
972
|
+
subscriptionId: z.ZodUUID;
|
|
973
|
+
activityId: z.ZodUUID;
|
|
854
974
|
}, z.core.$strip>], "type">;
|
|
855
975
|
isRead: z.ZodBoolean;
|
|
856
976
|
createdAt: z.ZodString;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Side } from '../common/schema';
|
|
2
|
+
import { Side, UnsignedDecimalString } from '../common/schema';
|
|
3
3
|
import { Connector } from '../connector';
|
|
4
4
|
import { TpSlBracketType } from '../trigger/common';
|
|
5
5
|
|
|
@@ -18,7 +18,12 @@ const NotificationCategory = z.enum([
|
|
|
18
18
|
"TRIGGER_TWAP_SKIPPED",
|
|
19
19
|
"TRIGGER_TWAP_FAILED",
|
|
20
20
|
"TRIGGER_TWAP_POSITION_CHANGED",
|
|
21
|
-
"TRIGGER_CANCELLED_MIS_SCALED"
|
|
21
|
+
"TRIGGER_CANCELLED_MIS_SCALED",
|
|
22
|
+
"COPY_PLACED",
|
|
23
|
+
"COPY_FAILED",
|
|
24
|
+
"COPY_SUBSCRIPTION_STOPPED",
|
|
25
|
+
"COPY_LEVERAGE_NOT_APPLIED",
|
|
26
|
+
"POSITION_LIQUIDATION"
|
|
22
27
|
]);
|
|
23
28
|
const NotificationMetric = z.enum([
|
|
24
29
|
"ratio",
|
|
@@ -173,7 +178,54 @@ const TriggerTWAPPositionChangedNotificationParameters = TriggerTWAPNotification
|
|
|
173
178
|
scheduleId: z.uuid(),
|
|
174
179
|
reason: z.string().min(1).max(255)
|
|
175
180
|
});
|
|
181
|
+
const CopyPlacedNotificationParameters = z.object({
|
|
182
|
+
type: z.literal("copy_placed"),
|
|
183
|
+
subscriptionId: z.uuid(),
|
|
184
|
+
activityId: z.uuid(),
|
|
185
|
+
resource: z.object({
|
|
186
|
+
kind: z.literal("POSITION"),
|
|
187
|
+
id: z.uuid()
|
|
188
|
+
}),
|
|
189
|
+
leaderTradeAccountId: z.uuid()
|
|
190
|
+
});
|
|
191
|
+
const CopyFailedNotificationParameters = z.object({
|
|
192
|
+
type: z.literal("copy_failed"),
|
|
193
|
+
subscriptionId: z.uuid(),
|
|
194
|
+
activityId: z.uuid(),
|
|
195
|
+
reason: z.string().max(255)
|
|
196
|
+
});
|
|
197
|
+
const CopySubscriptionStoppedNotificationParameters = z.object({
|
|
198
|
+
type: z.literal("copy_subscription_stopped"),
|
|
199
|
+
subscriptionId: z.uuid(),
|
|
200
|
+
reason: z.enum([
|
|
201
|
+
"REPEATED_FAILURES",
|
|
202
|
+
"MANUAL_TRADE",
|
|
203
|
+
"EXTERNAL_POSITION_DETECTED",
|
|
204
|
+
"LEADER_EXTERNAL_ACTIVITY"
|
|
205
|
+
])
|
|
206
|
+
});
|
|
207
|
+
const CopyLeverageNotAppliedNotificationParameters = z.object({
|
|
208
|
+
type: z.literal("copy_leverage_not_applied"),
|
|
209
|
+
subscriptionId: z.uuid(),
|
|
210
|
+
activityId: z.uuid()
|
|
211
|
+
});
|
|
212
|
+
const PositionLiquidationNotificationParameters = z.object({
|
|
213
|
+
type: z.literal("position_liquidation"),
|
|
214
|
+
positionId: z.uuid(),
|
|
215
|
+
tradeAccountId: z.uuid(),
|
|
216
|
+
connector: Connector,
|
|
217
|
+
exchangeFillId: z.string().min(1),
|
|
218
|
+
occurredAt: z.number().int().nonnegative(),
|
|
219
|
+
leg: TriggerNotificationLeg,
|
|
220
|
+
quantity: UnsignedDecimalString,
|
|
221
|
+
price: UnsignedDecimalString,
|
|
222
|
+
outcome: z.enum([
|
|
223
|
+
"CLOSED",
|
|
224
|
+
"REDUCED"
|
|
225
|
+
])
|
|
226
|
+
});
|
|
176
227
|
const NotificationParameters = z.discriminatedUnion("type", [
|
|
228
|
+
PositionLiquidationNotificationParameters,
|
|
177
229
|
TakeProfitNotificationParameters,
|
|
178
230
|
StopLossNotificationParameters,
|
|
179
231
|
TriggerOrderNotificationParameters,
|
|
@@ -186,7 +238,11 @@ const NotificationParameters = z.discriminatedUnion("type", [
|
|
|
186
238
|
TriggerTWAPSkippedNotificationParameters,
|
|
187
239
|
TriggerTWAPFailedNotificationParameters,
|
|
188
240
|
TriggerTWAPPositionChangedNotificationParameters,
|
|
189
|
-
TriggerCancelledMisScaledNotificationParameters
|
|
241
|
+
TriggerCancelledMisScaledNotificationParameters,
|
|
242
|
+
CopyPlacedNotificationParameters,
|
|
243
|
+
CopyFailedNotificationParameters,
|
|
244
|
+
CopySubscriptionStoppedNotificationParameters,
|
|
245
|
+
CopyLeverageNotAppliedNotificationParameters
|
|
190
246
|
]);
|
|
191
247
|
const Notification = z.object({
|
|
192
248
|
/**
|
|
@@ -18,8 +18,41 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
18
18
|
TRIGGER_TWAP_FAILED: "TRIGGER_TWAP_FAILED";
|
|
19
19
|
TRIGGER_TWAP_POSITION_CHANGED: "TRIGGER_TWAP_POSITION_CHANGED";
|
|
20
20
|
TRIGGER_CANCELLED_MIS_SCALED: "TRIGGER_CANCELLED_MIS_SCALED";
|
|
21
|
+
COPY_PLACED: "COPY_PLACED";
|
|
22
|
+
COPY_FAILED: "COPY_FAILED";
|
|
23
|
+
COPY_SUBSCRIPTION_STOPPED: "COPY_SUBSCRIPTION_STOPPED";
|
|
24
|
+
COPY_LEVERAGE_NOT_APPLIED: "COPY_LEVERAGE_NOT_APPLIED";
|
|
25
|
+
POSITION_LIQUIDATION: "POSITION_LIQUIDATION";
|
|
21
26
|
}>;
|
|
22
27
|
parameters: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"position_liquidation">;
|
|
29
|
+
positionId: z.ZodUUID;
|
|
30
|
+
tradeAccountId: z.ZodUUID;
|
|
31
|
+
connector: z.ZodEnum<{
|
|
32
|
+
hyperliquid: "hyperliquid";
|
|
33
|
+
binance: "binance";
|
|
34
|
+
bybit: "bybit";
|
|
35
|
+
okx: "okx";
|
|
36
|
+
lighter: "lighter";
|
|
37
|
+
lighter_rhc: "lighter_rhc";
|
|
38
|
+
}>;
|
|
39
|
+
exchangeFillId: z.ZodString;
|
|
40
|
+
occurredAt: z.ZodNumber;
|
|
41
|
+
leg: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
symbol: z.ZodString;
|
|
44
|
+
side: z.ZodEnum<{
|
|
45
|
+
BUY: "BUY";
|
|
46
|
+
SELL: "SELL";
|
|
47
|
+
}>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
quantity: z.ZodString;
|
|
50
|
+
price: z.ZodString;
|
|
51
|
+
outcome: z.ZodEnum<{
|
|
52
|
+
CLOSED: "CLOSED";
|
|
53
|
+
REDUCED: "REDUCED";
|
|
54
|
+
}>;
|
|
55
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
56
|
legs: z.ZodArray<z.ZodObject<{
|
|
24
57
|
id: z.ZodString;
|
|
25
58
|
symbol: z.ZodString;
|
|
@@ -411,6 +444,33 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
411
444
|
positionKey: z.ZodString;
|
|
412
445
|
storedBps: z.ZodNumber;
|
|
413
446
|
readingMarginPct: z.ZodNumber;
|
|
447
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
448
|
+
type: z.ZodLiteral<"copy_placed">;
|
|
449
|
+
subscriptionId: z.ZodUUID;
|
|
450
|
+
activityId: z.ZodUUID;
|
|
451
|
+
resource: z.ZodObject<{
|
|
452
|
+
kind: z.ZodLiteral<"POSITION">;
|
|
453
|
+
id: z.ZodUUID;
|
|
454
|
+
}, z.core.$strip>;
|
|
455
|
+
leaderTradeAccountId: z.ZodUUID;
|
|
456
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
457
|
+
type: z.ZodLiteral<"copy_failed">;
|
|
458
|
+
subscriptionId: z.ZodUUID;
|
|
459
|
+
activityId: z.ZodUUID;
|
|
460
|
+
reason: z.ZodString;
|
|
461
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
462
|
+
type: z.ZodLiteral<"copy_subscription_stopped">;
|
|
463
|
+
subscriptionId: z.ZodUUID;
|
|
464
|
+
reason: z.ZodEnum<{
|
|
465
|
+
REPEATED_FAILURES: "REPEATED_FAILURES";
|
|
466
|
+
MANUAL_TRADE: "MANUAL_TRADE";
|
|
467
|
+
EXTERNAL_POSITION_DETECTED: "EXTERNAL_POSITION_DETECTED";
|
|
468
|
+
LEADER_EXTERNAL_ACTIVITY: "LEADER_EXTERNAL_ACTIVITY";
|
|
469
|
+
}>;
|
|
470
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
471
|
+
type: z.ZodLiteral<"copy_leverage_not_applied">;
|
|
472
|
+
subscriptionId: z.ZodUUID;
|
|
473
|
+
activityId: z.ZodUUID;
|
|
414
474
|
}, z.core.$strip>], "type">;
|
|
415
475
|
isRead: z.ZodBoolean;
|
|
416
476
|
createdAt: z.ZodString;
|
package/dist/order/entities.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const OrderStatus: z.ZodEnum<{
|
|
3
|
-
PENDING: "PENDING";
|
|
4
3
|
PARTIAL: "PARTIAL";
|
|
4
|
+
PENDING: "PENDING";
|
|
5
5
|
FILLED: "FILLED";
|
|
6
6
|
CANCELLED: "CANCELLED";
|
|
7
7
|
REJECTED: "REJECTED";
|
|
@@ -18,8 +18,8 @@ export declare const MarketOrder: z.ZodObject<{
|
|
|
18
18
|
lighter_rhc: "lighter_rhc";
|
|
19
19
|
}>;
|
|
20
20
|
status: z.ZodEnum<{
|
|
21
|
-
PENDING: "PENDING";
|
|
22
21
|
PARTIAL: "PARTIAL";
|
|
22
|
+
PENDING: "PENDING";
|
|
23
23
|
FILLED: "FILLED";
|
|
24
24
|
CANCELLED: "CANCELLED";
|
|
25
25
|
REJECTED: "REJECTED";
|
|
@@ -51,8 +51,8 @@ export declare const Order: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
51
51
|
lighter_rhc: "lighter_rhc";
|
|
52
52
|
}>;
|
|
53
53
|
status: z.ZodEnum<{
|
|
54
|
-
PENDING: "PENDING";
|
|
55
54
|
PARTIAL: "PARTIAL";
|
|
55
|
+
PENDING: "PENDING";
|
|
56
56
|
FILLED: "FILLED";
|
|
57
57
|
CANCELLED: "CANCELLED";
|
|
58
58
|
REJECTED: "REJECTED";
|
|
@@ -561,6 +561,7 @@ export declare const VaultClosedPosition: z.ZodObject<{
|
|
|
561
561
|
lighter: "lighter";
|
|
562
562
|
lighter_rhc: "lighter_rhc";
|
|
563
563
|
}>;
|
|
564
|
+
positionId: z.ZodUUID;
|
|
564
565
|
closedReason: z.ZodOptional<z.ZodEnum<{
|
|
565
566
|
NETTED: "NETTED";
|
|
566
567
|
USER: "USER";
|
|
@@ -569,7 +570,6 @@ export declare const VaultClosedPosition: z.ZodObject<{
|
|
|
569
570
|
closedAt: z.ZodString;
|
|
570
571
|
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
571
572
|
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
572
|
-
positionId: z.ZodUUID;
|
|
573
573
|
openedAt: z.ZodString;
|
|
574
574
|
hasProvisionalFills: z.ZodBoolean;
|
|
575
575
|
legs: z.ZodArray<z.ZodObject<{
|
|
@@ -41,6 +41,7 @@ export declare const PositionListResponse: z.ZodObject<{
|
|
|
41
41
|
export type PositionListResponse = z.output<typeof PositionListResponse>;
|
|
42
42
|
export declare const OpenPositionLite: z.ZodObject<{
|
|
43
43
|
id: z.ZodUUID;
|
|
44
|
+
copySubscriptionId: z.ZodOptional<z.ZodUUID>;
|
|
44
45
|
positionKey: z.ZodString;
|
|
45
46
|
createdAt: z.ZodISODateTime;
|
|
46
47
|
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
@@ -62,6 +63,7 @@ export declare const OpenPositionLite: z.ZodObject<{
|
|
|
62
63
|
export declare const OpenPositionLiteListResponse: z.ZodObject<{
|
|
63
64
|
positions: z.ZodArray<z.ZodObject<{
|
|
64
65
|
id: z.ZodUUID;
|
|
66
|
+
copySubscriptionId: z.ZodOptional<z.ZodUUID>;
|
|
65
67
|
positionKey: z.ZodString;
|
|
66
68
|
createdAt: z.ZodISODateTime;
|
|
67
69
|
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
@@ -363,6 +365,7 @@ export declare const VaultClosedPositionListResponse: z.ZodObject<{
|
|
|
363
365
|
lighter: "lighter";
|
|
364
366
|
lighter_rhc: "lighter_rhc";
|
|
365
367
|
}>;
|
|
368
|
+
positionId: z.ZodUUID;
|
|
366
369
|
closedReason: z.ZodOptional<z.ZodEnum<{
|
|
367
370
|
NETTED: "NETTED";
|
|
368
371
|
USER: "USER";
|
|
@@ -371,7 +374,6 @@ export declare const VaultClosedPositionListResponse: z.ZodObject<{
|
|
|
371
374
|
closedAt: z.ZodString;
|
|
372
375
|
grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
373
376
|
netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
374
|
-
positionId: z.ZodUUID;
|
|
375
377
|
openedAt: z.ZodString;
|
|
376
378
|
hasProvisionalFills: z.ZodBoolean;
|
|
377
379
|
legs: z.ZodArray<z.ZodObject<{
|
|
@@ -11,6 +11,8 @@ const PositionListResponse = CursorResponse.extend({
|
|
|
11
11
|
});
|
|
12
12
|
const OpenPositionLite = z.object({
|
|
13
13
|
id: z.uuid(),
|
|
14
|
+
/** The subscription that opened the position is identified only in this authenticated read. */
|
|
15
|
+
copySubscriptionId: z.uuid().optional(),
|
|
14
16
|
positionKey: z.string().trim().min(1, "positionKey must be non-empty"),
|
|
15
17
|
createdAt: z.iso.datetime(),
|
|
16
18
|
exposure: z.record(InstrumentId, SignedDecimalString),
|
|
@@ -5,10 +5,10 @@ export declare const ScheduleStrategy: z.ZodEnum<{
|
|
|
5
5
|
}>;
|
|
6
6
|
export type ScheduleStrategy = z.infer<typeof ScheduleStrategy>;
|
|
7
7
|
export declare const ScheduleStatus: z.ZodEnum<{
|
|
8
|
-
CANCELLED: "CANCELLED";
|
|
9
8
|
ACTIVE: "ACTIVE";
|
|
10
|
-
COMPLETED: "COMPLETED";
|
|
11
9
|
FAILED: "FAILED";
|
|
10
|
+
CANCELLED: "CANCELLED";
|
|
11
|
+
COMPLETED: "COMPLETED";
|
|
12
12
|
}>;
|
|
13
13
|
export type ScheduleStatus = z.infer<typeof ScheduleStatus>;
|
|
14
14
|
export declare const ScheduleIntent: z.ZodEnum<{
|
|
@@ -25,6 +25,7 @@ export declare const ScheduleCancelledReason: z.ZodEnum<{
|
|
|
25
25
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
26
26
|
SYSTEM: "SYSTEM";
|
|
27
27
|
POSITION_NETTED: "POSITION_NETTED";
|
|
28
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
28
29
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
29
30
|
}>;
|
|
30
31
|
export type ScheduleCancelledReason = z.infer<typeof ScheduleCancelledReason>;
|
|
@@ -52,10 +53,10 @@ declare const BaseSchedule: z.ZodObject<{
|
|
|
52
53
|
VWAP: "VWAP";
|
|
53
54
|
}>;
|
|
54
55
|
status: z.ZodEnum<{
|
|
55
|
-
CANCELLED: "CANCELLED";
|
|
56
56
|
ACTIVE: "ACTIVE";
|
|
57
|
-
COMPLETED: "COMPLETED";
|
|
58
57
|
FAILED: "FAILED";
|
|
58
|
+
CANCELLED: "CANCELLED";
|
|
59
|
+
COMPLETED: "COMPLETED";
|
|
59
60
|
}>;
|
|
60
61
|
intent: z.ZodEnum<{
|
|
61
62
|
OPEN: "OPEN";
|
|
@@ -74,6 +75,7 @@ declare const BaseSchedule: z.ZodObject<{
|
|
|
74
75
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
75
76
|
SYSTEM: "SYSTEM";
|
|
76
77
|
POSITION_NETTED: "POSITION_NETTED";
|
|
78
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
77
79
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
78
80
|
}>>;
|
|
79
81
|
createdAt: z.ZodString;
|
|
@@ -128,10 +130,10 @@ export declare const TWAPOpen: z.ZodObject<{
|
|
|
128
130
|
lighter_rhc: "lighter_rhc";
|
|
129
131
|
}>;
|
|
130
132
|
status: z.ZodEnum<{
|
|
131
|
-
CANCELLED: "CANCELLED";
|
|
132
133
|
ACTIVE: "ACTIVE";
|
|
133
|
-
COMPLETED: "COMPLETED";
|
|
134
134
|
FAILED: "FAILED";
|
|
135
|
+
CANCELLED: "CANCELLED";
|
|
136
|
+
COMPLETED: "COMPLETED";
|
|
135
137
|
}>;
|
|
136
138
|
positionKey: z.ZodString;
|
|
137
139
|
executionType: z.ZodEnum<{
|
|
@@ -146,6 +148,7 @@ export declare const TWAPOpen: z.ZodObject<{
|
|
|
146
148
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
147
149
|
SYSTEM: "SYSTEM";
|
|
148
150
|
POSITION_NETTED: "POSITION_NETTED";
|
|
151
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
149
152
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
150
153
|
}>>;
|
|
151
154
|
createdAt: z.ZodString;
|
|
@@ -219,10 +222,10 @@ export declare const TWAPClose: z.ZodObject<{
|
|
|
219
222
|
lighter_rhc: "lighter_rhc";
|
|
220
223
|
}>;
|
|
221
224
|
status: z.ZodEnum<{
|
|
222
|
-
CANCELLED: "CANCELLED";
|
|
223
225
|
ACTIVE: "ACTIVE";
|
|
224
|
-
COMPLETED: "COMPLETED";
|
|
225
226
|
FAILED: "FAILED";
|
|
227
|
+
CANCELLED: "CANCELLED";
|
|
228
|
+
COMPLETED: "COMPLETED";
|
|
226
229
|
}>;
|
|
227
230
|
positionKey: z.ZodString;
|
|
228
231
|
executionType: z.ZodEnum<{
|
|
@@ -237,6 +240,7 @@ export declare const TWAPClose: z.ZodObject<{
|
|
|
237
240
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
238
241
|
SYSTEM: "SYSTEM";
|
|
239
242
|
POSITION_NETTED: "POSITION_NETTED";
|
|
243
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
240
244
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
241
245
|
}>>;
|
|
242
246
|
createdAt: z.ZodString;
|
|
@@ -301,10 +305,10 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
301
305
|
lighter_rhc: "lighter_rhc";
|
|
302
306
|
}>;
|
|
303
307
|
status: z.ZodEnum<{
|
|
304
|
-
CANCELLED: "CANCELLED";
|
|
305
308
|
ACTIVE: "ACTIVE";
|
|
306
|
-
COMPLETED: "COMPLETED";
|
|
307
309
|
FAILED: "FAILED";
|
|
310
|
+
CANCELLED: "CANCELLED";
|
|
311
|
+
COMPLETED: "COMPLETED";
|
|
308
312
|
}>;
|
|
309
313
|
positionKey: z.ZodString;
|
|
310
314
|
executionType: z.ZodEnum<{
|
|
@@ -319,6 +323,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
319
323
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
320
324
|
SYSTEM: "SYSTEM";
|
|
321
325
|
POSITION_NETTED: "POSITION_NETTED";
|
|
326
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
322
327
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
323
328
|
}>>;
|
|
324
329
|
createdAt: z.ZodString;
|
|
@@ -391,10 +396,10 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
391
396
|
lighter_rhc: "lighter_rhc";
|
|
392
397
|
}>;
|
|
393
398
|
status: z.ZodEnum<{
|
|
394
|
-
CANCELLED: "CANCELLED";
|
|
395
399
|
ACTIVE: "ACTIVE";
|
|
396
|
-
COMPLETED: "COMPLETED";
|
|
397
400
|
FAILED: "FAILED";
|
|
401
|
+
CANCELLED: "CANCELLED";
|
|
402
|
+
COMPLETED: "COMPLETED";
|
|
398
403
|
}>;
|
|
399
404
|
positionKey: z.ZodString;
|
|
400
405
|
executionType: z.ZodEnum<{
|
|
@@ -409,6 +414,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
409
414
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
410
415
|
SYSTEM: "SYSTEM";
|
|
411
416
|
POSITION_NETTED: "POSITION_NETTED";
|
|
417
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
412
418
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
413
419
|
}>>;
|
|
414
420
|
createdAt: z.ZodString;
|
|
@@ -27,10 +27,11 @@ const ScheduleCancelledReason = z.enum([
|
|
|
27
27
|
"USER",
|
|
28
28
|
"SYSTEM",
|
|
29
29
|
"POSITION_NETTED",
|
|
30
|
+
"POSITION_LIQUIDATED",
|
|
30
31
|
"POSITION_REVERSED"
|
|
31
32
|
]);
|
|
32
33
|
const TWAPOpenLeg = z.object({
|
|
33
|
-
/**
|
|
34
|
+
/** SYMBOL-MIGRATION switch-to-id: mirrors `symbol` today; becomes required once requests always carry `id`. */
|
|
34
35
|
id: InstrumentId.optional(),
|
|
35
36
|
/**
|
|
36
37
|
* Instrument ID
|
|
@@ -10,9 +10,9 @@ export declare const ScheduleListParams: z.ZodObject<{
|
|
|
10
10
|
lighter: "lighter";
|
|
11
11
|
lighter_rhc: "lighter_rhc";
|
|
12
12
|
}>>;
|
|
13
|
-
status: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[] | (("
|
|
14
|
-
CANCELLED: "CANCELLED";
|
|
13
|
+
status: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[] | (("ACTIVE" | "CANCELLED" | "COMPLETED")[] & any[]) | undefined, ("ACTIVE" | "CANCELLED" | "COMPLETED")[]>, z.ZodArray<z.ZodEnum<{
|
|
15
14
|
ACTIVE: "ACTIVE";
|
|
15
|
+
CANCELLED: "CANCELLED";
|
|
16
16
|
COMPLETED: "COMPLETED";
|
|
17
17
|
}>>>>;
|
|
18
18
|
}, z.core.$strip>;
|
|
@@ -13,10 +13,10 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
13
13
|
lighter_rhc: "lighter_rhc";
|
|
14
14
|
}>;
|
|
15
15
|
status: z.ZodEnum<{
|
|
16
|
-
CANCELLED: "CANCELLED";
|
|
17
16
|
ACTIVE: "ACTIVE";
|
|
18
|
-
COMPLETED: "COMPLETED";
|
|
19
17
|
FAILED: "FAILED";
|
|
18
|
+
CANCELLED: "CANCELLED";
|
|
19
|
+
COMPLETED: "COMPLETED";
|
|
20
20
|
}>;
|
|
21
21
|
positionKey: z.ZodString;
|
|
22
22
|
executionType: z.ZodEnum<{
|
|
@@ -31,6 +31,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
31
31
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
32
32
|
SYSTEM: "SYSTEM";
|
|
33
33
|
POSITION_NETTED: "POSITION_NETTED";
|
|
34
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
34
35
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
35
36
|
}>>;
|
|
36
37
|
createdAt: z.ZodString;
|
|
@@ -103,10 +104,10 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
103
104
|
lighter_rhc: "lighter_rhc";
|
|
104
105
|
}>;
|
|
105
106
|
status: z.ZodEnum<{
|
|
106
|
-
CANCELLED: "CANCELLED";
|
|
107
107
|
ACTIVE: "ACTIVE";
|
|
108
|
-
COMPLETED: "COMPLETED";
|
|
109
108
|
FAILED: "FAILED";
|
|
109
|
+
CANCELLED: "CANCELLED";
|
|
110
|
+
COMPLETED: "COMPLETED";
|
|
110
111
|
}>;
|
|
111
112
|
positionKey: z.ZodString;
|
|
112
113
|
executionType: z.ZodEnum<{
|
|
@@ -121,6 +122,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
121
122
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
122
123
|
SYSTEM: "SYSTEM";
|
|
123
124
|
POSITION_NETTED: "POSITION_NETTED";
|
|
125
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
124
126
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
125
127
|
}>>;
|
|
126
128
|
createdAt: z.ZodString;
|
|
@@ -188,10 +190,10 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
188
190
|
lighter_rhc: "lighter_rhc";
|
|
189
191
|
}>;
|
|
190
192
|
status: z.ZodEnum<{
|
|
191
|
-
CANCELLED: "CANCELLED";
|
|
192
193
|
ACTIVE: "ACTIVE";
|
|
193
|
-
COMPLETED: "COMPLETED";
|
|
194
194
|
FAILED: "FAILED";
|
|
195
|
+
CANCELLED: "CANCELLED";
|
|
196
|
+
COMPLETED: "COMPLETED";
|
|
195
197
|
}>;
|
|
196
198
|
positionKey: z.ZodString;
|
|
197
199
|
executionType: z.ZodEnum<{
|
|
@@ -206,6 +208,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
206
208
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
207
209
|
SYSTEM: "SYSTEM";
|
|
208
210
|
POSITION_NETTED: "POSITION_NETTED";
|
|
211
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
209
212
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
210
213
|
}>>;
|
|
211
214
|
createdAt: z.ZodString;
|
|
@@ -278,10 +281,10 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
278
281
|
lighter_rhc: "lighter_rhc";
|
|
279
282
|
}>;
|
|
280
283
|
status: z.ZodEnum<{
|
|
281
|
-
CANCELLED: "CANCELLED";
|
|
282
284
|
ACTIVE: "ACTIVE";
|
|
283
|
-
COMPLETED: "COMPLETED";
|
|
284
285
|
FAILED: "FAILED";
|
|
286
|
+
CANCELLED: "CANCELLED";
|
|
287
|
+
COMPLETED: "COMPLETED";
|
|
285
288
|
}>;
|
|
286
289
|
positionKey: z.ZodString;
|
|
287
290
|
executionType: z.ZodEnum<{
|
|
@@ -296,6 +299,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
296
299
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
297
300
|
SYSTEM: "SYSTEM";
|
|
298
301
|
POSITION_NETTED: "POSITION_NETTED";
|
|
302
|
+
POSITION_LIQUIDATED: "POSITION_LIQUIDATED";
|
|
299
303
|
POSITION_REVERSED: "POSITION_REVERSED";
|
|
300
304
|
}>>;
|
|
301
305
|
createdAt: z.ZodString;
|
|
@@ -11,7 +11,7 @@ const TWAPTargetNotional = UnsignedDecimalString.refine((value) => /[1-9]/.test(
|
|
|
11
11
|
message: "Target notional must be greater than zero"
|
|
12
12
|
});
|
|
13
13
|
const TWAPOpenLeg = z.object({
|
|
14
|
-
/**
|
|
14
|
+
/** SYMBOL-MIGRATION switch-to-id: mirrors `symbol` today; becomes required once requests always carry `id`. */
|
|
15
15
|
id: InstrumentId.optional(),
|
|
16
16
|
/** Instrument ID. */
|
|
17
17
|
symbol: InstrumentId,
|
|
@@ -10,6 +10,16 @@ export declare const LeaderboardRow: z.ZodObject<{
|
|
|
10
10
|
lighter: "lighter";
|
|
11
11
|
lighter_rhc: "lighter_rhc";
|
|
12
12
|
}>;
|
|
13
|
+
followers: z.ZodArray<z.ZodObject<{
|
|
14
|
+
tradeAccountId: z.ZodUUID;
|
|
15
|
+
status: z.ZodLiteral<"ACTIVE">;
|
|
16
|
+
followedAt: z.ZodString;
|
|
17
|
+
xUserId: z.ZodOptional<z.ZodString>;
|
|
18
|
+
xHandle: z.ZodOptional<z.ZodString>;
|
|
19
|
+
xName: z.ZodOptional<z.ZodString>;
|
|
20
|
+
xAvatarUrl: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
followerCount: z.ZodNumber;
|
|
13
23
|
volume: z.ZodString;
|
|
14
24
|
grossRealizedPnl: z.ZodString;
|
|
15
25
|
grossUpnl: z.ZodString;
|