@pear-protocol/types 2.14.0 → 2.16.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.
@@ -4,6 +4,12 @@ export declare const PublicTraderParams: z.ZodObject<{
4
4
  tradeAccountId: z.ZodUUID;
5
5
  }, z.core.$strip>;
6
6
  export type PublicTraderParams = z.output<typeof PublicTraderParams>;
7
+ /** Follower context requires authentication and an owned account selected by the standard header. */
8
+ export declare const PublicTraderQuery: z.ZodObject<{
9
+ includeCopyState: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>>;
10
+ }, z.core.$strip>;
11
+ export type PublicTraderQueryInput = z.input<typeof PublicTraderQuery>;
12
+ export type PublicTraderQuery = z.output<typeof PublicTraderQuery>;
7
13
  /** Public closed-history filters; refuse steps and every unsupported private option. */
8
14
  export declare const PublicTraderClosedPositionsParams: z.ZodObject<{
9
15
  limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<number>>>;
@@ -14,6 +20,15 @@ export declare const PublicTraderClosedPositionsParams: z.ZodObject<{
14
20
  }, z.core.$strict>;
15
21
  export type PublicTraderClosedPositionsParamsInput = z.input<typeof PublicTraderClosedPositionsParams>;
16
22
  export type PublicTraderClosedPositionsParams = z.output<typeof PublicTraderClosedPositionsParams>;
23
+ /** A selected follower's result for one leader position. */
24
+ export declare const ViewerCopyStatus: z.ZodEnum<{
25
+ PENDING: "PENDING";
26
+ COPIED: "COPIED";
27
+ PARTIAL: "PARTIAL";
28
+ NOT_COPIED: "NOT_COPIED";
29
+ UNKNOWN: "UNKNOWN";
30
+ }>;
31
+ export type ViewerCopyStatus = z.output<typeof ViewerCopyStatus>;
17
32
  export declare const PublicOpenPosition: z.ZodObject<{
18
33
  status: z.ZodLiteral<"OPEN">;
19
34
  connector: z.ZodEnum<{
@@ -26,9 +41,18 @@ export declare const PublicOpenPosition: z.ZodObject<{
26
41
  }>;
27
42
  updatedAt: z.ZodString;
28
43
  positionId: z.ZodUUID;
44
+ copySubscriptionId: z.ZodOptional<z.ZodUUID>;
29
45
  openedAt: z.ZodString;
30
46
  realizedGrossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
31
47
  netCashflow: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
48
+ copyStatus: z.ZodOptional<z.ZodEnum<{
49
+ PENDING: "PENDING";
50
+ COPIED: "COPIED";
51
+ PARTIAL: "PARTIAL";
52
+ NOT_COPIED: "NOT_COPIED";
53
+ UNKNOWN: "UNKNOWN";
54
+ }>>;
55
+ copyReason: z.ZodOptional<z.ZodString>;
32
56
  legs: z.ZodArray<z.ZodObject<{
33
57
  side: z.ZodEnum<{
34
58
  LONG: "LONG";
@@ -60,6 +84,7 @@ export declare const PublicClosedPosition: z.ZodObject<{
60
84
  lighter: "lighter";
61
85
  lighter_rhc: "lighter_rhc";
62
86
  }>;
87
+ netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
63
88
  positionId: z.ZodUUID;
64
89
  closedReason: z.ZodOptional<z.ZodEnum<{
65
90
  NETTED: "NETTED";
@@ -68,7 +93,6 @@ export declare const PublicClosedPosition: z.ZodObject<{
68
93
  }>>;
69
94
  closedAt: z.ZodString;
70
95
  grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
71
- netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
72
96
  openedAt: z.ZodString;
73
97
  hasProvisionalFills: z.ZodBoolean;
74
98
  legs: z.ZodArray<z.ZodObject<{
@@ -76,9 +100,9 @@ export declare const PublicClosedPosition: z.ZodObject<{
76
100
  LONG: "LONG";
77
101
  SHORT: "SHORT";
78
102
  }>;
103
+ netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
79
104
  asset: z.ZodString;
80
105
  grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
81
- netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
82
106
  entryNotional: z.ZodString;
83
107
  entryVwap: z.ZodOptional<z.ZodString>;
84
108
  exitVwap: z.ZodOptional<z.ZodString>;
@@ -99,6 +123,7 @@ export declare const PublicTraderClosedPositionsResponse: z.ZodObject<{
99
123
  lighter: "lighter";
100
124
  lighter_rhc: "lighter_rhc";
101
125
  }>;
126
+ netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
102
127
  positionId: z.ZodUUID;
103
128
  closedReason: z.ZodOptional<z.ZodEnum<{
104
129
  NETTED: "NETTED";
@@ -107,7 +132,6 @@ export declare const PublicTraderClosedPositionsResponse: z.ZodObject<{
107
132
  }>>;
108
133
  closedAt: z.ZodString;
109
134
  grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
110
- netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
111
135
  openedAt: z.ZodString;
112
136
  hasProvisionalFills: z.ZodBoolean;
113
137
  legs: z.ZodArray<z.ZodObject<{
@@ -115,9 +139,9 @@ export declare const PublicTraderClosedPositionsResponse: z.ZodObject<{
115
139
  LONG: "LONG";
116
140
  SHORT: "SHORT";
117
141
  }>;
142
+ netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
118
143
  asset: z.ZodString;
119
144
  grossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
120
- netPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
121
145
  entryNotional: z.ZodString;
122
146
  entryVwap: z.ZodOptional<z.ZodString>;
123
147
  exitVwap: z.ZodOptional<z.ZodString>;
@@ -1249,8 +1273,8 @@ export declare const PublicSchedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
1249
1273
  id: z.ZodUUID;
1250
1274
  createdAt: z.ZodString;
1251
1275
  status: z.ZodEnum<{
1252
- ACTIVE: "ACTIVE";
1253
1276
  FAILED: "FAILED";
1277
+ ACTIVE: "ACTIVE";
1254
1278
  CANCELLED: "CANCELLED";
1255
1279
  COMPLETED: "COMPLETED";
1256
1280
  }>;
@@ -1302,8 +1326,8 @@ export declare const PublicSchedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
1302
1326
  id: z.ZodUUID;
1303
1327
  createdAt: z.ZodString;
1304
1328
  status: z.ZodEnum<{
1305
- ACTIVE: "ACTIVE";
1306
1329
  FAILED: "FAILED";
1330
+ ACTIVE: "ACTIVE";
1307
1331
  CANCELLED: "CANCELLED";
1308
1332
  COMPLETED: "COMPLETED";
1309
1333
  }>;
@@ -2598,9 +2622,18 @@ export declare const PublicTraderResponse: z.ZodObject<{
2598
2622
  }>;
2599
2623
  updatedAt: z.ZodString;
2600
2624
  positionId: z.ZodUUID;
2625
+ copySubscriptionId: z.ZodOptional<z.ZodUUID>;
2601
2626
  openedAt: z.ZodString;
2602
2627
  realizedGrossPnl: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
2603
2628
  netCashflow: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
2629
+ copyStatus: z.ZodOptional<z.ZodEnum<{
2630
+ PENDING: "PENDING";
2631
+ COPIED: "COPIED";
2632
+ PARTIAL: "PARTIAL";
2633
+ NOT_COPIED: "NOT_COPIED";
2634
+ UNKNOWN: "UNKNOWN";
2635
+ }>>;
2636
+ copyReason: z.ZodOptional<z.ZodString>;
2604
2637
  legs: z.ZodArray<z.ZodObject<{
2605
2638
  side: z.ZodEnum<{
2606
2639
  LONG: "LONG";
@@ -3743,8 +3776,8 @@ export declare const PublicTraderResponse: z.ZodObject<{
3743
3776
  id: z.ZodUUID;
3744
3777
  createdAt: z.ZodString;
3745
3778
  status: z.ZodEnum<{
3746
- ACTIVE: "ACTIVE";
3747
3779
  FAILED: "FAILED";
3780
+ ACTIVE: "ACTIVE";
3748
3781
  CANCELLED: "CANCELLED";
3749
3782
  COMPLETED: "COMPLETED";
3750
3783
  }>;
@@ -3796,8 +3829,8 @@ export declare const PublicTraderResponse: z.ZodObject<{
3796
3829
  id: z.ZodUUID;
3797
3830
  createdAt: z.ZodString;
3798
3831
  status: z.ZodEnum<{
3799
- ACTIVE: "ACTIVE";
3800
3832
  FAILED: "FAILED";
3833
+ ACTIVE: "ACTIVE";
3801
3834
  CANCELLED: "CANCELLED";
3802
3835
  COMPLETED: "COMPLETED";
3803
3836
  }>;
@@ -11,6 +11,21 @@ import { TriggerMarketOpen, TriggerMarketAdjust, TriggerMarketClose, TriggerTWAP
11
11
  const PublicTraderParams = z.object({
12
12
  tradeAccountId: z.uuid()
13
13
  });
14
+ const PublicTraderQuery = z.object({
15
+ /** Accept exact HTTP boolean strings without treating the string "false" as true. */
16
+ includeCopyState: z.union([
17
+ z.boolean(),
18
+ z.stringbool({
19
+ truthy: [
20
+ "true"
21
+ ],
22
+ falsy: [
23
+ "false"
24
+ ],
25
+ case: "sensitive"
26
+ })
27
+ ]).optional().default(false)
28
+ });
14
29
  const PublicTraderClosedPositionsParams = z.object({
15
30
  limit: ClosedPositionListParams.shape.limit,
16
31
  cursor: ClosedPositionListParams.shape.cursor,
@@ -18,15 +33,27 @@ const PublicTraderClosedPositionsParams = z.object({
18
33
  endDate: ClosedPositionListParams.shape.endDate,
19
34
  positionId: ClosedPositionListParams.shape.positionId
20
35
  }).strict();
36
+ const ViewerCopyStatus = z.enum([
37
+ "COPIED",
38
+ "PARTIAL",
39
+ "NOT_COPIED",
40
+ "PENDING",
41
+ "UNKNOWN"
42
+ ]);
21
43
  const PublicOpenPosition = OpenPosition.pick({
22
44
  positionId: true,
23
45
  status: true,
24
46
  connector: true,
25
47
  openedAt: true,
26
48
  updatedAt: true,
49
+ copySubscriptionId: true,
27
50
  realizedGrossPnl: true,
28
51
  netCashflow: true
29
52
  }).extend({
53
+ /** The selected follower's result for this leader position; absent without viewer context. */
54
+ copyStatus: ViewerCopyStatus.optional(),
55
+ /** The recorded attempt, exclusion, or lifecycle reason for this follower's result. */
56
+ copyReason: z.string().optional(),
30
57
  legs: z.array(OpenPositionLeg.pick({
31
58
  asset: true,
32
59
  side: true,
@@ -163,4 +190,4 @@ const PublicTraderResponse = z.object({
163
190
  ladders: z.array(PublicLadder)
164
191
  });
165
192
 
166
- export { PublicClosedPosition, PublicLadder, PublicOpenPosition, PublicSchedule, PublicTraderClosedPositionsParams, PublicTraderClosedPositionsResponse, PublicTraderParams, PublicTraderResponse, PublicTrigger };
193
+ export { PublicClosedPosition, PublicLadder, PublicOpenPosition, PublicSchedule, PublicTraderClosedPositionsParams, PublicTraderClosedPositionsResponse, PublicTraderParams, PublicTraderQuery, PublicTraderResponse, PublicTrigger, ViewerCopyStatus };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "2.14.0",
3
+ "version": "2.16.0",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",