@pear-protocol/types 1.2.0 → 1.4.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.
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { CursorResponse } from '../common';
3
+ import { Ladder } from './entities';
4
+
5
+ const CreateLadderResponse = z.object({ ladder: Ladder });
6
+ const LadderResponse = z.object({ ladder: Ladder });
7
+ const LadderListResponse = CursorResponse.extend({ ladders: z.array(Ladder) });
8
+ const CancelLadderResponse = z.object({ id: z.uuid() });
9
+
10
+ export { CancelLadderResponse, CreateLadderResponse, LadderListResponse, LadderResponse };
@@ -30,6 +30,7 @@ export declare const ScheduleCancelledReason: z.ZodEnum<{
30
30
  POSITION_CLOSED: "POSITION_CLOSED";
31
31
  SYSTEM: "SYSTEM";
32
32
  POSITION_NETTED: "POSITION_NETTED";
33
+ POSITION_REVERSED: "POSITION_REVERSED";
33
34
  }>;
34
35
  export type ScheduleCancelledReason = z.infer<typeof ScheduleCancelledReason>;
35
36
  declare const TWAPSliceOpenLeg: z.ZodObject<{
@@ -84,6 +85,7 @@ declare const BaseSchedule: z.ZodObject<{
84
85
  POSITION_CLOSED: "POSITION_CLOSED";
85
86
  SYSTEM: "SYSTEM";
86
87
  POSITION_NETTED: "POSITION_NETTED";
88
+ POSITION_REVERSED: "POSITION_REVERSED";
87
89
  }>>;
88
90
  createdAt: z.ZodString;
89
91
  updatedAt: z.ZodString;
@@ -152,6 +154,7 @@ export declare const TWAPOpen: z.ZodObject<{
152
154
  POSITION_CLOSED: "POSITION_CLOSED";
153
155
  SYSTEM: "SYSTEM";
154
156
  POSITION_NETTED: "POSITION_NETTED";
157
+ POSITION_REVERSED: "POSITION_REVERSED";
155
158
  }>>;
156
159
  createdAt: z.ZodString;
157
160
  updatedAt: z.ZodString;
@@ -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_REVERSED: "POSITION_REVERSED";
240
244
  }>>;
241
245
  createdAt: z.ZodString;
242
246
  updatedAt: z.ZodString;
@@ -314,6 +318,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
314
318
  POSITION_CLOSED: "POSITION_CLOSED";
315
319
  SYSTEM: "SYSTEM";
316
320
  POSITION_NETTED: "POSITION_NETTED";
321
+ POSITION_REVERSED: "POSITION_REVERSED";
317
322
  }>>;
318
323
  createdAt: z.ZodString;
319
324
  updatedAt: z.ZodString;
@@ -398,6 +403,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
398
403
  POSITION_CLOSED: "POSITION_CLOSED";
399
404
  SYSTEM: "SYSTEM";
400
405
  POSITION_NETTED: "POSITION_NETTED";
406
+ POSITION_REVERSED: "POSITION_REVERSED";
401
407
  }>>;
402
408
  createdAt: z.ZodString;
403
409
  updatedAt: z.ZodString;
@@ -9,7 +9,13 @@ const ScheduleStatus = z.enum(["ACTIVE", "COMPLETED", "FAILED", "CANCELLED"]);
9
9
  const ScheduleIntent = z.enum(["OPEN", "CLOSE"]);
10
10
  const ScheduleExecutionType = z.enum(["MARKET"]);
11
11
  const ScheduleSliceMode = z.enum(["QUANTITY", "USD"]);
12
- const ScheduleCancelledReason = z.enum(["POSITION_CLOSED", "USER", "SYSTEM", "POSITION_NETTED"]);
12
+ const ScheduleCancelledReason = z.enum([
13
+ "POSITION_CLOSED",
14
+ "USER",
15
+ "SYSTEM",
16
+ "POSITION_NETTED",
17
+ "POSITION_REVERSED"
18
+ ]);
13
19
  const TWAPSliceOpenLeg = z.object({
14
20
  /**
15
21
  * Instrument ID
@@ -30,6 +30,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
30
30
  POSITION_CLOSED: "POSITION_CLOSED";
31
31
  SYSTEM: "SYSTEM";
32
32
  POSITION_NETTED: "POSITION_NETTED";
33
+ POSITION_REVERSED: "POSITION_REVERSED";
33
34
  }>>;
34
35
  createdAt: z.ZodString;
35
36
  updatedAt: z.ZodString;
@@ -114,6 +115,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
114
115
  POSITION_CLOSED: "POSITION_CLOSED";
115
116
  SYSTEM: "SYSTEM";
116
117
  POSITION_NETTED: "POSITION_NETTED";
118
+ POSITION_REVERSED: "POSITION_REVERSED";
117
119
  }>>;
118
120
  createdAt: z.ZodString;
119
121
  updatedAt: z.ZodString;
@@ -194,6 +196,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
194
196
  POSITION_CLOSED: "POSITION_CLOSED";
195
197
  SYSTEM: "SYSTEM";
196
198
  POSITION_NETTED: "POSITION_NETTED";
199
+ POSITION_REVERSED: "POSITION_REVERSED";
197
200
  }>>;
198
201
  createdAt: z.ZodString;
199
202
  updatedAt: z.ZodString;
@@ -278,6 +281,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
278
281
  POSITION_CLOSED: "POSITION_CLOSED";
279
282
  SYSTEM: "SYSTEM";
280
283
  POSITION_NETTED: "POSITION_NETTED";
284
+ POSITION_REVERSED: "POSITION_REVERSED";
281
285
  }>>;
282
286
  createdAt: z.ZodString;
283
287
  updatedAt: z.ZodString;
@@ -117,6 +117,7 @@ export declare const TcaExecutionSummaryContextResponse: z.ZodObject<{
117
117
  OPEN: "OPEN";
118
118
  CLOSE: "CLOSE";
119
119
  ADJUST: "ADJUST";
120
+ REVERSE: "REVERSE";
120
121
  }>;
121
122
  orderType: z.ZodEnum<{
122
123
  MARKET: "MARKET";
@@ -157,6 +158,7 @@ export declare const TcaExecutionSummaryResponse: z.ZodObject<{
157
158
  OPEN: "OPEN";
158
159
  CLOSE: "CLOSE";
159
160
  ADJUST: "ADJUST";
161
+ REVERSE: "REVERSE";
160
162
  }>;
161
163
  orderType: z.ZodEnum<{
162
164
  MARKET: "MARKET";
@@ -210,6 +212,7 @@ export declare const TcaExecutionResponse: z.ZodObject<{
210
212
  OPEN: "OPEN";
211
213
  CLOSE: "CLOSE";
212
214
  ADJUST: "ADJUST";
215
+ REVERSE: "REVERSE";
213
216
  }>;
214
217
  orderType: z.ZodEnum<{
215
218
  MARKET: "MARKET";
@@ -427,6 +430,7 @@ export declare const TcaSummaryResponse: z.ZodObject<{
427
430
  OPEN: "OPEN";
428
431
  CLOSE: "CLOSE";
429
432
  ADJUST: "ADJUST";
433
+ REVERSE: "REVERSE";
430
434
  }>;
431
435
  orderType: z.ZodEnum<{
432
436
  MARKET: "MARKET";
@@ -131,6 +131,10 @@ export declare const CreateMarketClose: z.ZodObject<{
131
131
  type: z.ZodLiteral<"MARKET">;
132
132
  clientId: z.ZodOptional<z.ZodString>;
133
133
  }, z.core.$strip>;
134
+ export declare const CreateMarketReverse: z.ZodObject<{
135
+ type: z.ZodLiteral<"MARKET">;
136
+ clientId: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strip>;
134
138
  export declare const CreateMarketCloseAll: z.ZodObject<{
135
139
  type: z.ZodLiteral<"MARKET">;
136
140
  clientId: z.ZodOptional<z.ZodString>;
@@ -267,6 +271,10 @@ export declare const CreateTradeClose: z.ZodDiscriminatedUnion<[z.ZodObject<{
267
271
  type: z.ZodLiteral<"MARKET">;
268
272
  clientId: z.ZodOptional<z.ZodString>;
269
273
  }, z.core.$strip>], "type">;
274
+ export declare const CreateTradeReverse: z.ZodDiscriminatedUnion<[z.ZodObject<{
275
+ type: z.ZodLiteral<"MARKET">;
276
+ clientId: z.ZodOptional<z.ZodString>;
277
+ }, z.core.$strip>], "type">;
270
278
  export declare const CreateTradeCloseAll: z.ZodDiscriminatedUnion<[z.ZodObject<{
271
279
  type: z.ZodLiteral<"MARKET">;
272
280
  clientId: z.ZodOptional<z.ZodString>;
@@ -274,8 +282,10 @@ export declare const CreateTradeCloseAll: z.ZodDiscriminatedUnion<[z.ZodObject<{
274
282
  export type CreateMarketOpen = z.output<typeof CreateMarketOpen>;
275
283
  export type CreateMarketAdjust = z.output<typeof CreateMarketAdjust>;
276
284
  export type CreateMarketClose = z.output<typeof CreateMarketClose>;
285
+ export type CreateMarketReverse = z.output<typeof CreateMarketReverse>;
277
286
  export type CreateMarketCloseAll = z.output<typeof CreateMarketCloseAll>;
278
287
  export type CreateTradeOpen = z.output<typeof CreateTradeOpen>;
279
288
  export type CreateTradeAdjust = z.output<typeof CreateTradeAdjust>;
280
289
  export type CreateTradeClose = z.output<typeof CreateTradeClose>;
290
+ export type CreateTradeReverse = z.output<typeof CreateTradeReverse>;
281
291
  export type CreateTradeCloseAll = z.output<typeof CreateTradeCloseAll>;
@@ -37,6 +37,13 @@ const CreateMarketClose = z.object({
37
37
  */
38
38
  clientId: ClientIdCode
39
39
  });
40
+ const CreateMarketReverse = z.object({
41
+ type: z.literal("MARKET"),
42
+ /**
43
+ * Attribution route code (client_ids.code)
44
+ */
45
+ clientId: ClientIdCode
46
+ });
40
47
  const CreateMarketCloseAll = z.object({
41
48
  type: z.literal("MARKET"),
42
49
  /**
@@ -47,6 +54,7 @@ const CreateMarketCloseAll = z.object({
47
54
  const CreateTradeOpen = z.discriminatedUnion("type", [CreateMarketOpen]);
48
55
  const CreateTradeAdjust = z.discriminatedUnion("type", [CreateMarketAdjust]);
49
56
  const CreateTradeClose = z.discriminatedUnion("type", [CreateMarketClose]);
57
+ const CreateTradeReverse = z.discriminatedUnion("type", [CreateMarketReverse]);
50
58
  const CreateTradeCloseAll = z.discriminatedUnion("type", [CreateMarketCloseAll]);
51
59
 
52
- export { CreateMarketAdjust, CreateMarketClose, CreateMarketCloseAll, CreateMarketOpen, CreateTradeAdjust, CreateTradeClose, CreateTradeCloseAll, CreateTradeOpen };
60
+ export { CreateMarketAdjust, CreateMarketClose, CreateMarketCloseAll, CreateMarketOpen, CreateMarketReverse, CreateTradeAdjust, CreateTradeClose, CreateTradeCloseAll, CreateTradeOpen, CreateTradeReverse };