@polymarket/bindings 0.1.0-beta.9 → 0.2.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.
@@ -6,54 +6,164 @@ import { z } from 'zod';
6
6
  type Tagged<T, Tag extends string> = T & {
7
7
  readonly __tag: Tag;
8
8
  };
9
+ /**
10
+ * @experimental This API may change in a breaking way in any release, including patch releases.
11
+ */
9
12
  type PerpsInstrumentId = Tagged<number, 'PerpsInstrumentId'>;
13
+ /**
14
+ * @experimental This API may change in a breaking way in any release, including patch releases.
15
+ */
10
16
  type PerpsOrderId = Tagged<number, 'PerpsOrderId'>;
17
+ /**
18
+ * @experimental This API may change in a breaking way in any release, including patch releases.
19
+ */
11
20
  type PerpsClientOrderId = Tagged<string, 'PerpsClientOrderId'>;
21
+ /**
22
+ * @experimental This API may change in a breaking way in any release, including patch releases.
23
+ */
12
24
  type PerpsTradeId = Tagged<number, 'PerpsTradeId'>;
25
+ /**
26
+ * @experimental This API may change in a breaking way in any release, including patch releases.
27
+ */
13
28
  type PerpsWithdrawalId = Tagged<number, 'PerpsWithdrawalId'>;
29
+ /**
30
+ * @experimental This API may change in a breaking way in any release, including patch releases.
31
+ */
14
32
  type PerpsInternalTransferId = Tagged<number, 'PerpsInternalTransferId'>;
33
+ /**
34
+ * @experimental This API may change in a breaking way in any release, including patch releases.
35
+ */
36
+ type PerpsEntityId = Tagged<number, 'PerpsEntityId'>;
37
+ /**
38
+ * @experimental This API may change in a breaking way in any release, including patch releases.
39
+ */
15
40
  type PerpsFundingInterval = `${number}h`;
41
+ /**
42
+ * @experimental This API may change in a breaking way in any release, including patch releases.
43
+ */
16
44
  declare const PerpsInstrumentIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
45
+ /**
46
+ * @experimental This API may change in a breaking way in any release, including patch releases.
47
+ */
17
48
  declare const PerpsOrderIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
49
+ /**
50
+ * @experimental This API may change in a breaking way in any release, including patch releases.
51
+ */
18
52
  declare const PerpsClientOrderIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>;
53
+ /**
54
+ * @experimental This API may change in a breaking way in any release, including patch releases.
55
+ */
19
56
  declare const PerpsTradeIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
57
+ /**
58
+ * @experimental This API may change in a breaking way in any release, including patch releases.
59
+ */
20
60
  declare const PerpsWithdrawalIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsWithdrawalId, number>>;
61
+ /**
62
+ * @experimental This API may change in a breaking way in any release, including patch releases.
63
+ */
21
64
  declare const PerpsInternalTransferIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInternalTransferId, number>>;
65
+ /**
66
+ * @experimental This API may change in a breaking way in any release, including patch releases.
67
+ */
68
+ declare const PerpsEntityIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsEntityId, number>>;
69
+ /**
70
+ * @experimental This API may change in a breaking way in any release, including patch releases.
71
+ */
22
72
  declare const PerpsFundingIntervalSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`${number}h`, string>>;
73
+ /**
74
+ * @experimental This API may change in a breaking way in any release, including patch releases.
75
+ */
23
76
  declare const PerpsDecimalInputSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
77
+ /**
78
+ * @experimental This API may change in a breaking way in any release, including patch releases.
79
+ */
24
80
  type PerpsDecimalInput = z.input<typeof PerpsDecimalInputSchema>;
81
+ /**
82
+ * @experimental This API may change in a breaking way in any release, including patch releases.
83
+ */
25
84
  declare enum PerpsInstrumentType {
26
85
  Perpetual = "perpetual"
27
86
  }
87
+ /**
88
+ * @experimental This API may change in a breaking way in any release, including patch releases.
89
+ */
28
90
  declare enum PerpsInstrumentCategory {
29
91
  Equity = "equity",
30
92
  Commodity = "commodity",
31
93
  Index = "index",
32
94
  Crypto = "crypto"
33
95
  }
96
+ /**
97
+ * @experimental This API may change in a breaking way in any release, including patch releases.
98
+ */
34
99
  declare enum PerpsSide {
35
100
  Long = "long",
36
101
  Short = "short"
37
102
  }
103
+ /**
104
+ * @experimental This API may change in a breaking way in any release, including patch releases.
105
+ */
38
106
  declare enum PerpsTimeInForce {
39
107
  GTC = "gtc",
40
108
  IOC = "ioc",
41
109
  FOK = "fok"
42
110
  }
111
+ /**
112
+ * @experimental This API may change in a breaking way in any release, including patch releases.
113
+ */
114
+ declare enum PerpsTpSlKind {
115
+ TakeProfit = "tp",
116
+ StopLoss = "sl"
117
+ }
118
+ /**
119
+ * @experimental This API may change in a breaking way in any release, including patch releases.
120
+ */
121
+ declare enum PerpsTpSlScope {
122
+ Order = "order",
123
+ Position = "position"
124
+ }
125
+ /**
126
+ * @experimental This API may change in a breaking way in any release, including patch releases.
127
+ */
43
128
  declare enum PerpsDepositStatus {
44
129
  Pending = "pending",
45
130
  Confirmed = "confirmed",
46
131
  Removed = "removed"
47
132
  }
48
- declare enum PerpsWithdrawalStatus {
133
+ /**
134
+ * Known withdrawal statuses.
135
+ *
136
+ * The service evolves this set independently of released clients, so
137
+ * withdrawal parsing accepts unknown statuses as plain strings; see
138
+ * {@link PerpsWithdrawalStatus}.
139
+ *
140
+ * @experimental This API may change in a breaking way in any release, including patch releases.
141
+ */
142
+ declare enum PerpsKnownWithdrawalStatus {
49
143
  Pending = "pending",
50
144
  Confirmed = "confirmed",
51
- Removed = "removed"
145
+ Removed = "removed",
146
+ Failed = "failed"
52
147
  }
148
+ /**
149
+ * A withdrawal status. Known statuses are enumerated in
150
+ * {@link PerpsKnownWithdrawalStatus}; newly introduced statuses flow through
151
+ * as plain strings so they can be handled before a client release that
152
+ * enumerates them.
153
+ *
154
+ * @experimental This API may change in a breaking way in any release, including patch releases.
155
+ */
156
+ type PerpsWithdrawalStatus = PerpsKnownWithdrawalStatus | (string & {});
157
+ /**
158
+ * @experimental This API may change in a breaking way in any release, including patch releases.
159
+ */
53
160
  declare enum PerpsInternalTransferDirection {
54
161
  In = "in",
55
162
  Out = "out"
56
163
  }
164
+ /**
165
+ * @experimental This API may change in a breaking way in any release, including patch releases.
166
+ */
57
167
  declare enum PerpsKlineInterval {
58
168
  OneSecond = "1s",
59
169
  OneMinute = "1m",
@@ -64,41 +174,115 @@ declare enum PerpsKlineInterval {
64
174
  OneDay = "1d",
65
175
  OneWeek = "1w"
66
176
  }
177
+ /**
178
+ * @experimental This API may change in a breaking way in any release, including patch releases.
179
+ */
67
180
  declare enum PerpsPnlInterval {
68
181
  OneHour = "1h",
69
182
  FourHours = "4h",
70
183
  OneDay = "1d",
71
184
  OneWeek = "1w"
72
185
  }
186
+ /**
187
+ * @experimental This API may change in a breaking way in any release, including patch releases.
188
+ */
73
189
  declare const PerpsInstrumentTypeSchema: z.ZodEnum<typeof PerpsInstrumentType>;
190
+ /**
191
+ * @experimental This API may change in a breaking way in any release, including patch releases.
192
+ */
74
193
  declare const PerpsInstrumentCategorySchema: z.ZodEnum<typeof PerpsInstrumentCategory>;
194
+ /**
195
+ * @experimental This API may change in a breaking way in any release, including patch releases.
196
+ */
75
197
  declare const PerpsSideSchema: z.ZodEnum<typeof PerpsSide>;
198
+ /**
199
+ * @experimental This API may change in a breaking way in any release, including patch releases.
200
+ */
76
201
  declare const PerpsTimeInForceSchema: z.ZodEnum<typeof PerpsTimeInForce>;
202
+ /**
203
+ * @experimental This API may change in a breaking way in any release, including patch releases.
204
+ */
205
+ declare const PerpsTpSlKindSchema: z.ZodEnum<typeof PerpsTpSlKind>;
206
+ /**
207
+ * @experimental This API may change in a breaking way in any release, including patch releases.
208
+ */
209
+ declare const PerpsTpSlScopeSchema: z.ZodEnum<typeof PerpsTpSlScope>;
210
+ /**
211
+ * @experimental This API may change in a breaking way in any release, including patch releases.
212
+ */
77
213
  declare const PerpsDepositStatusSchema: z.ZodEnum<typeof PerpsDepositStatus>;
78
- declare const PerpsWithdrawalStatusSchema: z.ZodEnum<typeof PerpsWithdrawalStatus>;
214
+ /**
215
+ * @experimental This API may change in a breaking way in any release, including patch releases.
216
+ */
217
+ declare const PerpsWithdrawalStatusSchema: z.ZodPipe<z.ZodString, z.ZodTransform<PerpsKnownWithdrawalStatus | (string & {}), string>>;
218
+ /**
219
+ * @experimental This API may change in a breaking way in any release, including patch releases.
220
+ */
79
221
  declare const PerpsInternalTransferDirectionSchema: z.ZodEnum<typeof PerpsInternalTransferDirection>;
222
+ /**
223
+ * @experimental This API may change in a breaking way in any release, including patch releases.
224
+ */
80
225
  declare const PerpsKlineIntervalSchema: z.ZodEnum<typeof PerpsKlineInterval>;
226
+ /**
227
+ * @experimental This API may change in a breaking way in any release, including patch releases.
228
+ */
81
229
  declare const PerpsPnlIntervalSchema: z.ZodEnum<typeof PerpsPnlInterval>;
230
+ /**
231
+ * @experimental This API may change in a breaking way in any release, including patch releases.
232
+ */
82
233
  declare const PerpsAssetSchema: z.ZodString;
234
+ /**
235
+ * @experimental This API may change in a breaking way in any release, including patch releases.
236
+ */
83
237
  declare const PerpsTxHashSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<TxHash, string>>>>;
238
+ /**
239
+ * @experimental This API may change in a breaking way in any release, including patch releases.
240
+ */
84
241
  declare const PerpsDataResponseSchema: <T extends z.ZodType>(itemSchema: T) => z.ZodObject<{
85
242
  data: z.ZodArray<T>;
86
243
  more: z.ZodBoolean;
87
244
  }, z.core.$strip>;
245
+ /**
246
+ * @experimental This API may change in a breaking way in any release, including patch releases.
247
+ */
88
248
  type PerpsCredentials = {
89
249
  proxy: EvmAddress;
90
250
  privateKey: PrivateKey;
91
251
  secret: string;
92
252
  expiresAt: number;
93
253
  };
254
+ /**
255
+ * @experimental This API may change in a breaking way in any release, including patch releases.
256
+ */
94
257
  type PerpsDepositAmount = BaseUnits;
258
+ /**
259
+ * @experimental This API may change in a breaking way in any release, including patch releases.
260
+ */
95
261
  type PerpsWithdrawalAmount = BaseUnits;
262
+ /**
263
+ * @experimental This API may change in a breaking way in any release, including patch releases.
264
+ */
96
265
  type PerpsTxHash = TxHash;
266
+ /**
267
+ * @experimental This API may change in a breaking way in any release, including patch releases.
268
+ */
97
269
  type PerpsDecimal = DecimalString;
270
+ /**
271
+ * @experimental This API may change in a breaking way in any release, including patch releases.
272
+ */
98
273
  declare function perpsDecimal(value: string | number): DecimalString;
274
+ /**
275
+ * @experimental This API may change in a breaking way in any release, including patch releases.
276
+ */
99
277
  declare function perpsBaseUnits(value: string): BaseUnits;
278
+ /**
279
+ * @experimental This API may change in a breaking way in any release, including patch releases.
280
+ */
100
281
  declare function decimalString(value: string): DecimalString;
101
282
 
283
+ /**
284
+ * @experimental This API may change in a breaking way in any release, including patch releases.
285
+ */
102
286
  declare enum PerpsOrderStatus {
103
287
  Accepted = "accepted",
104
288
  Open = "open",
@@ -126,18 +310,62 @@ declare enum PerpsOrderStatus {
126
310
  ReduceOnlyInvalidAtTrigger = "reduce_only_invalid_at_trigger",
127
311
  Expired = "expired"
128
312
  }
313
+ /**
314
+ * @experimental This API may change in a breaking way in any release, including patch releases.
315
+ */
316
+ declare const PerpsTpSlOrderFieldsSchema: z.ZodPipe<z.ZodObject<{
317
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
318
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
319
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
320
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
321
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
322
+ slip_bps: z.ZodOptional<z.ZodNumber>;
323
+ }, z.core.$strip>, z.ZodTransform<{
324
+ kind: PerpsTpSlKind;
325
+ scope: PerpsTpSlScope;
326
+ triggerPrice: DecimalString;
327
+ parentOrderId: PerpsOrderId | undefined;
328
+ armedQuantity: DecimalString | undefined;
329
+ slippageBps: number | undefined;
330
+ }, {
331
+ kind: PerpsTpSlKind;
332
+ scope: PerpsTpSlScope;
333
+ trp: DecimalString;
334
+ parent_oid?: PerpsOrderId | undefined;
335
+ armed_qty?: DecimalString | undefined;
336
+ slip_bps?: number | undefined;
337
+ }>>;
338
+ /**
339
+ * @experimental This API may change in a breaking way in any release, including patch releases.
340
+ */
341
+ type PerpsTpSlOrderFields = z.infer<typeof PerpsTpSlOrderFieldsSchema>;
342
+ /**
343
+ * @experimental This API may change in a breaking way in any release, including patch releases.
344
+ */
129
345
  declare const PerpsOrderStatusSchema: z.ZodEnum<typeof PerpsOrderStatus>;
346
+ /**
347
+ * @experimental This API may change in a breaking way in any release, including patch releases.
348
+ */
130
349
  declare const PerpsCommandStatusSchema: z.ZodEnum<{
131
350
  ok: "ok";
132
351
  err: "err";
133
352
  }>;
353
+ /**
354
+ * @experimental This API may change in a breaking way in any release, including patch releases.
355
+ */
134
356
  declare const PerpsCommandAckSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
135
357
  status: z.ZodLiteral<"ok">;
136
358
  }, z.core.$strip>, z.ZodObject<{
137
359
  status: z.ZodLiteral<"err">;
138
360
  error: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string, string | undefined>>;
139
361
  }, z.core.$strip>], "status">;
362
+ /**
363
+ * @experimental This API may change in a breaking way in any release, including patch releases.
364
+ */
140
365
  type PerpsCommandAck = z.infer<typeof PerpsCommandAckSchema>;
366
+ /**
367
+ * @experimental This API may change in a breaking way in any release, including patch releases.
368
+ */
141
369
  declare const PerpsPostOrderAckSchema: z.ZodPipe<z.ZodObject<{
142
370
  status: z.ZodEnum<{
143
371
  ok: "ok";
@@ -162,7 +390,13 @@ declare const PerpsPostOrderAckSchema: z.ZodPipe<z.ZodObject<{
162
390
  coid?: PerpsClientOrderId | undefined;
163
391
  error?: string | undefined;
164
392
  }>>;
393
+ /**
394
+ * @experimental This API may change in a breaking way in any release, including patch releases.
395
+ */
165
396
  type PerpsPostOrderAck = z.infer<typeof PerpsPostOrderAckSchema>;
397
+ /**
398
+ * @experimental This API may change in a breaking way in any release, including patch releases.
399
+ */
166
400
  declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodObject<{
167
401
  status: z.ZodEnum<{
168
402
  ok: "ok";
@@ -187,7 +421,23 @@ declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodObject<{
187
421
  coid?: PerpsClientOrderId | undefined;
188
422
  error?: string | undefined;
189
423
  }>>;
424
+ /**
425
+ * @experimental This API may change in a breaking way in any release, including patch releases.
426
+ */
190
427
  type PerpsCancelOrderResult = z.infer<typeof PerpsCancelOrderResultSchema>;
428
+ /**
429
+ * @experimental This API may change in a breaking way in any release, including patch releases.
430
+ */
431
+ declare const PerpsCancelAllOrdersResponseSchema: z.ZodObject<{
432
+ status: z.ZodLiteral<"ok">;
433
+ }, z.core.$strip>;
434
+ /**
435
+ * @experimental This API may change in a breaking way in any release, including patch releases.
436
+ */
437
+ type PerpsCancelAllOrdersResponse = z.infer<typeof PerpsCancelAllOrdersResponseSchema>;
438
+ /**
439
+ * @experimental This API may change in a breaking way in any release, including patch releases.
440
+ */
191
441
  declare const PerpsUpdateLeverageResultSchema: z.ZodPipe<z.ZodObject<{
192
442
  status: z.ZodLiteral<"ok">;
193
443
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -204,7 +454,13 @@ declare const PerpsUpdateLeverageResultSchema: z.ZodPipe<z.ZodObject<{
204
454
  leverage: number;
205
455
  cross: boolean;
206
456
  }>>;
457
+ /**
458
+ * @experimental This API may change in a breaking way in any release, including patch releases.
459
+ */
207
460
  type PerpsUpdateLeverageResult = z.infer<typeof PerpsUpdateLeverageResultSchema>;
461
+ /**
462
+ * @experimental This API may change in a breaking way in any release, including patch releases.
463
+ */
208
464
  declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
209
465
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
210
466
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -213,12 +469,35 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
213
469
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
214
470
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
215
471
  post_only: z.ZodBoolean;
472
+ ro: z.ZodBoolean;
216
473
  status: z.ZodEnum<typeof PerpsOrderStatus>;
217
474
  resting_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
218
475
  filled_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
219
476
  created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
220
477
  updated_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
221
478
  client_order_id: z.ZodOptional<z.ZodString>;
479
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
480
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
481
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
482
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
483
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
484
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
485
+ slip_bps: z.ZodOptional<z.ZodNumber>;
486
+ }, z.core.$strip>, z.ZodTransform<{
487
+ kind: PerpsTpSlKind;
488
+ scope: PerpsTpSlScope;
489
+ triggerPrice: DecimalString;
490
+ parentOrderId: PerpsOrderId | undefined;
491
+ armedQuantity: DecimalString | undefined;
492
+ slippageBps: number | undefined;
493
+ }, {
494
+ kind: PerpsTpSlKind;
495
+ scope: PerpsTpSlScope;
496
+ trp: DecimalString;
497
+ parent_oid?: PerpsOrderId | undefined;
498
+ armed_qty?: DecimalString | undefined;
499
+ slip_bps?: number | undefined;
500
+ }>>>>;
222
501
  }, z.core.$strip>, z.ZodTransform<{
223
502
  id: PerpsOrderId;
224
503
  instrumentId: PerpsInstrumentId;
@@ -227,12 +506,21 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
227
506
  quantity: DecimalString;
228
507
  timeInForce: PerpsTimeInForce;
229
508
  postOnly: boolean;
509
+ reduceOnly: boolean;
230
510
  status: PerpsOrderStatus;
231
511
  restingQuantity: DecimalString;
232
512
  filledQuantity: DecimalString;
233
513
  createdTimestamp: EpochMilliseconds;
234
514
  updatedTimestamp: EpochMilliseconds;
235
515
  clientOrderId: string | undefined;
516
+ tpSl: {
517
+ kind: PerpsTpSlKind;
518
+ scope: PerpsTpSlScope;
519
+ triggerPrice: DecimalString;
520
+ parentOrderId: PerpsOrderId | undefined;
521
+ armedQuantity: DecimalString | undefined;
522
+ slippageBps: number | undefined;
523
+ } | undefined;
236
524
  }, {
237
525
  order_id: PerpsOrderId;
238
526
  instrument_id: PerpsInstrumentId;
@@ -241,14 +529,29 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
241
529
  quantity: DecimalString;
242
530
  tif: PerpsTimeInForce;
243
531
  post_only: boolean;
532
+ ro: boolean;
244
533
  status: PerpsOrderStatus;
245
534
  resting_quantity: DecimalString;
246
535
  filled_quantity: DecimalString;
247
536
  created_timestamp: EpochMilliseconds;
248
537
  updated_timestamp: EpochMilliseconds;
249
538
  client_order_id?: string | undefined;
539
+ tpsl?: {
540
+ kind: PerpsTpSlKind;
541
+ scope: PerpsTpSlScope;
542
+ triggerPrice: DecimalString;
543
+ parentOrderId: PerpsOrderId | undefined;
544
+ armedQuantity: DecimalString | undefined;
545
+ slippageBps: number | undefined;
546
+ } | null | undefined;
250
547
  }>>;
548
+ /**
549
+ * @experimental This API may change in a breaking way in any release, including patch releases.
550
+ */
251
551
  type PerpsOrder = z.infer<typeof PerpsOrderSchema>;
552
+ /**
553
+ * @experimental This API may change in a breaking way in any release, including patch releases.
554
+ */
252
555
  declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
253
556
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
254
557
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -257,12 +560,35 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
257
560
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
258
561
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
259
562
  post_only: z.ZodBoolean;
563
+ ro: z.ZodBoolean;
260
564
  status: z.ZodEnum<typeof PerpsOrderStatus>;
261
565
  resting_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
262
566
  filled_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
263
567
  created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
264
568
  updated_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
265
569
  client_order_id: z.ZodOptional<z.ZodString>;
570
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
571
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
572
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
573
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
574
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
575
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
576
+ slip_bps: z.ZodOptional<z.ZodNumber>;
577
+ }, z.core.$strip>, z.ZodTransform<{
578
+ kind: PerpsTpSlKind;
579
+ scope: PerpsTpSlScope;
580
+ triggerPrice: DecimalString;
581
+ parentOrderId: PerpsOrderId | undefined;
582
+ armedQuantity: DecimalString | undefined;
583
+ slippageBps: number | undefined;
584
+ }, {
585
+ kind: PerpsTpSlKind;
586
+ scope: PerpsTpSlScope;
587
+ trp: DecimalString;
588
+ parent_oid?: PerpsOrderId | undefined;
589
+ armed_qty?: DecimalString | undefined;
590
+ slip_bps?: number | undefined;
591
+ }>>>>;
266
592
  }, z.core.$strip>, z.ZodTransform<{
267
593
  id: PerpsOrderId;
268
594
  instrumentId: PerpsInstrumentId;
@@ -271,12 +597,21 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
271
597
  quantity: DecimalString;
272
598
  timeInForce: PerpsTimeInForce;
273
599
  postOnly: boolean;
600
+ reduceOnly: boolean;
274
601
  status: PerpsOrderStatus;
275
602
  restingQuantity: DecimalString;
276
603
  filledQuantity: DecimalString;
277
604
  createdTimestamp: EpochMilliseconds;
278
605
  updatedTimestamp: EpochMilliseconds;
279
606
  clientOrderId: string | undefined;
607
+ tpSl: {
608
+ kind: PerpsTpSlKind;
609
+ scope: PerpsTpSlScope;
610
+ triggerPrice: DecimalString;
611
+ parentOrderId: PerpsOrderId | undefined;
612
+ armedQuantity: DecimalString | undefined;
613
+ slippageBps: number | undefined;
614
+ } | undefined;
280
615
  }, {
281
616
  order_id: PerpsOrderId;
282
617
  instrument_id: PerpsInstrumentId;
@@ -285,13 +620,25 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
285
620
  quantity: DecimalString;
286
621
  tif: PerpsTimeInForce;
287
622
  post_only: boolean;
623
+ ro: boolean;
288
624
  status: PerpsOrderStatus;
289
625
  resting_quantity: DecimalString;
290
626
  filled_quantity: DecimalString;
291
627
  created_timestamp: EpochMilliseconds;
292
628
  updated_timestamp: EpochMilliseconds;
293
629
  client_order_id?: string | undefined;
630
+ tpsl?: {
631
+ kind: PerpsTpSlKind;
632
+ scope: PerpsTpSlScope;
633
+ triggerPrice: DecimalString;
634
+ parentOrderId: PerpsOrderId | undefined;
635
+ armedQuantity: DecimalString | undefined;
636
+ slippageBps: number | undefined;
637
+ } | null | undefined;
294
638
  }>>>;
639
+ /**
640
+ * @experimental This API may change in a breaking way in any release, including patch releases.
641
+ */
295
642
  declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
296
643
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
297
644
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -300,12 +647,35 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
300
647
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
301
648
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
302
649
  post_only: z.ZodBoolean;
650
+ ro: z.ZodBoolean;
303
651
  status: z.ZodEnum<typeof PerpsOrderStatus>;
304
652
  resting_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
305
653
  filled_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
306
654
  created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
307
655
  updated_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
308
656
  client_order_id: z.ZodOptional<z.ZodString>;
657
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
658
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
659
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
660
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
661
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
662
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
663
+ slip_bps: z.ZodOptional<z.ZodNumber>;
664
+ }, z.core.$strip>, z.ZodTransform<{
665
+ kind: PerpsTpSlKind;
666
+ scope: PerpsTpSlScope;
667
+ triggerPrice: DecimalString;
668
+ parentOrderId: PerpsOrderId | undefined;
669
+ armedQuantity: DecimalString | undefined;
670
+ slippageBps: number | undefined;
671
+ }, {
672
+ kind: PerpsTpSlKind;
673
+ scope: PerpsTpSlScope;
674
+ trp: DecimalString;
675
+ parent_oid?: PerpsOrderId | undefined;
676
+ armed_qty?: DecimalString | undefined;
677
+ slip_bps?: number | undefined;
678
+ }>>>>;
309
679
  }, z.core.$strip>, z.ZodTransform<{
310
680
  id: PerpsOrderId;
311
681
  instrumentId: PerpsInstrumentId;
@@ -314,12 +684,21 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
314
684
  quantity: DecimalString;
315
685
  timeInForce: PerpsTimeInForce;
316
686
  postOnly: boolean;
687
+ reduceOnly: boolean;
317
688
  status: PerpsOrderStatus;
318
689
  restingQuantity: DecimalString;
319
690
  filledQuantity: DecimalString;
320
691
  createdTimestamp: EpochMilliseconds;
321
692
  updatedTimestamp: EpochMilliseconds;
322
693
  clientOrderId: string | undefined;
694
+ tpSl: {
695
+ kind: PerpsTpSlKind;
696
+ scope: PerpsTpSlScope;
697
+ triggerPrice: DecimalString;
698
+ parentOrderId: PerpsOrderId | undefined;
699
+ armedQuantity: DecimalString | undefined;
700
+ slippageBps: number | undefined;
701
+ } | undefined;
323
702
  }, {
324
703
  order_id: PerpsOrderId;
325
704
  instrument_id: PerpsInstrumentId;
@@ -328,13 +707,25 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
328
707
  quantity: DecimalString;
329
708
  tif: PerpsTimeInForce;
330
709
  post_only: boolean;
710
+ ro: boolean;
331
711
  status: PerpsOrderStatus;
332
712
  resting_quantity: DecimalString;
333
713
  filled_quantity: DecimalString;
334
714
  created_timestamp: EpochMilliseconds;
335
715
  updated_timestamp: EpochMilliseconds;
336
716
  client_order_id?: string | undefined;
717
+ tpsl?: {
718
+ kind: PerpsTpSlKind;
719
+ scope: PerpsTpSlScope;
720
+ triggerPrice: DecimalString;
721
+ parentOrderId: PerpsOrderId | undefined;
722
+ armedQuantity: DecimalString | undefined;
723
+ slippageBps: number | undefined;
724
+ } | null | undefined;
337
725
  }>>>;
726
+ /**
727
+ * @experimental This API may change in a breaking way in any release, including patch releases.
728
+ */
338
729
  declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
339
730
  oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
340
731
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -343,12 +734,35 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
343
734
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
344
735
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
345
736
  po: z.ZodBoolean;
737
+ ro: z.ZodBoolean;
346
738
  status: z.ZodEnum<typeof PerpsOrderStatus>;
347
739
  rest: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
348
740
  fill: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
349
741
  cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
350
742
  uts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
351
743
  coid: z.ZodOptional<z.ZodString>;
744
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
745
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
746
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
747
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
748
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
749
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
750
+ slip_bps: z.ZodOptional<z.ZodNumber>;
751
+ }, z.core.$strip>, z.ZodTransform<{
752
+ kind: PerpsTpSlKind;
753
+ scope: PerpsTpSlScope;
754
+ triggerPrice: DecimalString;
755
+ parentOrderId: PerpsOrderId | undefined;
756
+ armedQuantity: DecimalString | undefined;
757
+ slippageBps: number | undefined;
758
+ }, {
759
+ kind: PerpsTpSlKind;
760
+ scope: PerpsTpSlScope;
761
+ trp: DecimalString;
762
+ parent_oid?: PerpsOrderId | undefined;
763
+ armed_qty?: DecimalString | undefined;
764
+ slip_bps?: number | undefined;
765
+ }>>>>;
352
766
  }, z.core.$strip>, z.ZodTransform<{
353
767
  id: PerpsOrderId;
354
768
  instrumentId: PerpsInstrumentId;
@@ -357,12 +771,21 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
357
771
  quantity: DecimalString;
358
772
  timeInForce: PerpsTimeInForce;
359
773
  postOnly: boolean;
774
+ reduceOnly: boolean;
360
775
  status: PerpsOrderStatus;
361
776
  restingQuantity: DecimalString;
362
777
  filledQuantity: DecimalString;
363
778
  createdTimestamp: EpochMilliseconds;
364
779
  updatedTimestamp: EpochMilliseconds;
365
780
  clientOrderId: string | undefined;
781
+ tpSl: {
782
+ kind: PerpsTpSlKind;
783
+ scope: PerpsTpSlScope;
784
+ triggerPrice: DecimalString;
785
+ parentOrderId: PerpsOrderId | undefined;
786
+ armedQuantity: DecimalString | undefined;
787
+ slippageBps: number | undefined;
788
+ } | undefined;
366
789
  }, {
367
790
  oid: PerpsOrderId;
368
791
  iid: PerpsInstrumentId;
@@ -371,13 +794,25 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
371
794
  qty: DecimalString;
372
795
  tif: PerpsTimeInForce;
373
796
  po: boolean;
797
+ ro: boolean;
374
798
  status: PerpsOrderStatus;
375
799
  rest: DecimalString;
376
800
  fill: DecimalString;
377
801
  cts: EpochMilliseconds;
378
802
  uts: EpochMilliseconds;
379
803
  coid?: string | undefined;
804
+ tpsl?: {
805
+ kind: PerpsTpSlKind;
806
+ scope: PerpsTpSlScope;
807
+ triggerPrice: DecimalString;
808
+ parentOrderId: PerpsOrderId | undefined;
809
+ armedQuantity: DecimalString | undefined;
810
+ slippageBps: number | undefined;
811
+ } | null | undefined;
380
812
  }>>;
813
+ /**
814
+ * @experimental This API may change in a breaking way in any release, including patch releases.
815
+ */
381
816
  declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
382
817
  trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
383
818
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
@@ -427,7 +862,13 @@ declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
427
862
  timestamp: EpochMilliseconds;
428
863
  hash?: _polymarket_types.TxHash | undefined;
429
864
  }>>;
865
+ /**
866
+ * @experimental This API may change in a breaking way in any release, including patch releases.
867
+ */
430
868
  type PerpsAccountFill = z.infer<typeof PerpsAccountFillSchema>;
869
+ /**
870
+ * @experimental This API may change in a breaking way in any release, including patch releases.
871
+ */
431
872
  declare const ListPerpsFillsResponseSchema: z.ZodObject<{
432
873
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
433
874
  trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
@@ -480,6 +921,9 @@ declare const ListPerpsFillsResponseSchema: z.ZodObject<{
480
921
  }>>>;
481
922
  more: z.ZodBoolean;
482
923
  }, z.core.$strip>;
924
+ /**
925
+ * @experimental This API may change in a breaking way in any release, including patch releases.
926
+ */
483
927
  declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
484
928
  tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
485
929
  oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
@@ -530,4 +974,4 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
530
974
  coid?: string | undefined;
531
975
  }>>;
532
976
 
533
- export { PerpsTimeInForceSchema as $, type PerpsDepositAmount as A, PerpsDepositStatusSchema as B, type PerpsFundingInterval as C, PerpsFundingIntervalSchema as D, PerpsInstrumentCategorySchema as E, FetchPerpsOpenOrdersResponseSchema as F, PerpsInstrumentIdSchema as G, PerpsInstrumentTypeSchema as H, PerpsInternalTransferDirectionSchema as I, PerpsInternalTransferIdSchema as J, PerpsKlineInterval as K, ListPerpsFillsResponseSchema as L, PerpsKlineIntervalSchema as M, type PerpsOrder as N, type PerpsOrderId as O, type PerpsInstrumentId as P, PerpsOrderIdSchema as Q, PerpsOrderSchema as R, PerpsOrderStatus as S, PerpsOrderStatusSchema as T, PerpsOrderUpdateSchema as U, PerpsPnlInterval as V, PerpsPnlIntervalSchema as W, type PerpsPostOrderAck as X, PerpsPostOrderAckSchema as Y, PerpsSideSchema as Z, PerpsTimeInForce as _, PerpsDepositStatus as a, PerpsTradeIdSchema as a0, type PerpsTxHash as a1, PerpsTxHashSchema as a2, type PerpsUpdateLeverageResult as a3, PerpsUpdateLeverageResultSchema as a4, type PerpsWithdrawalAmount as a5, PerpsWithdrawalIdSchema as a6, PerpsWithdrawalStatusSchema as a7, decimalString as a8, perpsBaseUnits as a9, perpsDecimal as aa, type PerpsWithdrawalId as b, PerpsWithdrawalStatus as c, type PerpsInternalTransferId as d, PerpsInternalTransferDirection as e, PerpsInstrumentType as f, PerpsInstrumentCategory as g, type PerpsTradeId as h, PerpsSide as i, FetchPerpsOrdersResponseSchema as j, type PerpsAccountFill as k, PerpsAccountFillSchema as l, PerpsAccountFillUpdateSchema as m, PerpsAssetSchema as n, type PerpsCancelOrderResult as o, PerpsCancelOrderResultSchema as p, type PerpsClientOrderId as q, PerpsClientOrderIdSchema as r, type PerpsCommandAck as s, PerpsCommandAckSchema as t, PerpsCommandStatusSchema as u, type PerpsCredentials as v, PerpsDataResponseSchema as w, type PerpsDecimal as x, type PerpsDecimalInput as y, PerpsDecimalInputSchema as z };
977
+ export { type PerpsPostOrderAck as $, type PerpsDecimal as A, type PerpsDecimalInput as B, PerpsDecimalInputSchema as C, type PerpsDepositAmount as D, PerpsDepositStatusSchema as E, FetchPerpsOpenOrdersResponseSchema as F, PerpsEntityIdSchema as G, type PerpsFundingInterval as H, PerpsFundingIntervalSchema as I, PerpsInstrumentCategorySchema as J, PerpsInstrumentIdSchema as K, ListPerpsFillsResponseSchema as L, PerpsInstrumentTypeSchema as M, PerpsInternalTransferDirectionSchema as N, PerpsInternalTransferIdSchema as O, type PerpsInstrumentId as P, PerpsKlineInterval as Q, PerpsKlineIntervalSchema as R, type PerpsOrder as S, type PerpsOrderId as T, PerpsOrderIdSchema as U, PerpsOrderSchema as V, PerpsOrderStatus as W, PerpsOrderStatusSchema as X, PerpsOrderUpdateSchema as Y, PerpsPnlInterval as Z, PerpsPnlIntervalSchema as _, type PerpsEntityId as a, PerpsPostOrderAckSchema as a0, PerpsSideSchema as a1, PerpsTimeInForce as a2, PerpsTimeInForceSchema as a3, PerpsTpSlKind as a4, PerpsTpSlKindSchema as a5, type PerpsTpSlOrderFields as a6, PerpsTpSlOrderFieldsSchema as a7, PerpsTpSlScope as a8, PerpsTpSlScopeSchema as a9, PerpsTradeIdSchema as aa, type PerpsTxHash as ab, PerpsTxHashSchema as ac, type PerpsUpdateLeverageResult as ad, PerpsUpdateLeverageResultSchema as ae, type PerpsWithdrawalAmount as af, PerpsWithdrawalIdSchema as ag, type PerpsWithdrawalStatus as ah, PerpsWithdrawalStatusSchema as ai, decimalString as aj, perpsBaseUnits as ak, perpsDecimal as al, PerpsDepositStatus as b, type PerpsWithdrawalId as c, PerpsKnownWithdrawalStatus as d, type PerpsInternalTransferId as e, PerpsInternalTransferDirection as f, PerpsInstrumentType as g, PerpsInstrumentCategory as h, type PerpsTradeId as i, PerpsSide as j, FetchPerpsOrdersResponseSchema as k, type PerpsAccountFill as l, PerpsAccountFillSchema as m, PerpsAccountFillUpdateSchema as n, PerpsAssetSchema as o, type PerpsCancelAllOrdersResponse as p, PerpsCancelAllOrdersResponseSchema as q, type PerpsCancelOrderResult as r, PerpsCancelOrderResultSchema as s, type PerpsClientOrderId as t, PerpsClientOrderIdSchema as u, type PerpsCommandAck as v, PerpsCommandAckSchema as w, PerpsCommandStatusSchema as x, type PerpsCredentials as y, PerpsDataResponseSchema as z };