@polymarket/bindings 0.1.0-beta.8 → 0.1.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.
@@ -1,59 +1,153 @@
1
1
  import * as _polymarket_types from '@polymarket/types';
2
2
  import { EvmAddress, PrivateKey, TxHash } from '@polymarket/types';
3
- import { DecimalString, BaseUnits, EpochMilliseconds } from './index.js';
3
+ import { DecimalString, BaseUnits, EpochMilliseconds, OrderSide } from './index.js';
4
4
  import { z } from 'zod';
5
5
 
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
  }
133
+ /**
134
+ * @experimental This API may change in a breaking way in any release, including patch releases.
135
+ */
48
136
  declare enum PerpsWithdrawalStatus {
49
137
  Pending = "pending",
50
138
  Confirmed = "confirmed",
51
139
  Removed = "removed"
52
140
  }
141
+ /**
142
+ * @experimental This API may change in a breaking way in any release, including patch releases.
143
+ */
53
144
  declare enum PerpsInternalTransferDirection {
54
145
  In = "in",
55
146
  Out = "out"
56
147
  }
148
+ /**
149
+ * @experimental This API may change in a breaking way in any release, including patch releases.
150
+ */
57
151
  declare enum PerpsKlineInterval {
58
152
  OneSecond = "1s",
59
153
  OneMinute = "1m",
@@ -64,41 +158,115 @@ declare enum PerpsKlineInterval {
64
158
  OneDay = "1d",
65
159
  OneWeek = "1w"
66
160
  }
161
+ /**
162
+ * @experimental This API may change in a breaking way in any release, including patch releases.
163
+ */
67
164
  declare enum PerpsPnlInterval {
68
165
  OneHour = "1h",
69
166
  FourHours = "4h",
70
167
  OneDay = "1d",
71
168
  OneWeek = "1w"
72
169
  }
170
+ /**
171
+ * @experimental This API may change in a breaking way in any release, including patch releases.
172
+ */
73
173
  declare const PerpsInstrumentTypeSchema: z.ZodEnum<typeof PerpsInstrumentType>;
174
+ /**
175
+ * @experimental This API may change in a breaking way in any release, including patch releases.
176
+ */
74
177
  declare const PerpsInstrumentCategorySchema: z.ZodEnum<typeof PerpsInstrumentCategory>;
178
+ /**
179
+ * @experimental This API may change in a breaking way in any release, including patch releases.
180
+ */
75
181
  declare const PerpsSideSchema: z.ZodEnum<typeof PerpsSide>;
182
+ /**
183
+ * @experimental This API may change in a breaking way in any release, including patch releases.
184
+ */
76
185
  declare const PerpsTimeInForceSchema: z.ZodEnum<typeof PerpsTimeInForce>;
186
+ /**
187
+ * @experimental This API may change in a breaking way in any release, including patch releases.
188
+ */
189
+ declare const PerpsTpSlKindSchema: z.ZodEnum<typeof PerpsTpSlKind>;
190
+ /**
191
+ * @experimental This API may change in a breaking way in any release, including patch releases.
192
+ */
193
+ declare const PerpsTpSlScopeSchema: z.ZodEnum<typeof PerpsTpSlScope>;
194
+ /**
195
+ * @experimental This API may change in a breaking way in any release, including patch releases.
196
+ */
77
197
  declare const PerpsDepositStatusSchema: z.ZodEnum<typeof PerpsDepositStatus>;
198
+ /**
199
+ * @experimental This API may change in a breaking way in any release, including patch releases.
200
+ */
78
201
  declare const PerpsWithdrawalStatusSchema: z.ZodEnum<typeof PerpsWithdrawalStatus>;
202
+ /**
203
+ * @experimental This API may change in a breaking way in any release, including patch releases.
204
+ */
79
205
  declare const PerpsInternalTransferDirectionSchema: z.ZodEnum<typeof PerpsInternalTransferDirection>;
206
+ /**
207
+ * @experimental This API may change in a breaking way in any release, including patch releases.
208
+ */
80
209
  declare const PerpsKlineIntervalSchema: z.ZodEnum<typeof PerpsKlineInterval>;
210
+ /**
211
+ * @experimental This API may change in a breaking way in any release, including patch releases.
212
+ */
81
213
  declare const PerpsPnlIntervalSchema: z.ZodEnum<typeof PerpsPnlInterval>;
214
+ /**
215
+ * @experimental This API may change in a breaking way in any release, including patch releases.
216
+ */
82
217
  declare const PerpsAssetSchema: z.ZodString;
218
+ /**
219
+ * @experimental This API may change in a breaking way in any release, including patch releases.
220
+ */
83
221
  declare const PerpsTxHashSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<TxHash, string>>>>;
222
+ /**
223
+ * @experimental This API may change in a breaking way in any release, including patch releases.
224
+ */
84
225
  declare const PerpsDataResponseSchema: <T extends z.ZodType>(itemSchema: T) => z.ZodObject<{
85
226
  data: z.ZodArray<T>;
86
227
  more: z.ZodBoolean;
87
228
  }, z.core.$strip>;
229
+ /**
230
+ * @experimental This API may change in a breaking way in any release, including patch releases.
231
+ */
88
232
  type PerpsCredentials = {
89
233
  proxy: EvmAddress;
90
234
  privateKey: PrivateKey;
91
235
  secret: string;
92
236
  expiresAt: number;
93
237
  };
238
+ /**
239
+ * @experimental This API may change in a breaking way in any release, including patch releases.
240
+ */
94
241
  type PerpsDepositAmount = BaseUnits;
242
+ /**
243
+ * @experimental This API may change in a breaking way in any release, including patch releases.
244
+ */
95
245
  type PerpsWithdrawalAmount = BaseUnits;
246
+ /**
247
+ * @experimental This API may change in a breaking way in any release, including patch releases.
248
+ */
96
249
  type PerpsTxHash = TxHash;
250
+ /**
251
+ * @experimental This API may change in a breaking way in any release, including patch releases.
252
+ */
97
253
  type PerpsDecimal = DecimalString;
254
+ /**
255
+ * @experimental This API may change in a breaking way in any release, including patch releases.
256
+ */
98
257
  declare function perpsDecimal(value: string | number): DecimalString;
258
+ /**
259
+ * @experimental This API may change in a breaking way in any release, including patch releases.
260
+ */
99
261
  declare function perpsBaseUnits(value: string): BaseUnits;
262
+ /**
263
+ * @experimental This API may change in a breaking way in any release, including patch releases.
264
+ */
100
265
  declare function decimalString(value: string): DecimalString;
101
266
 
267
+ /**
268
+ * @experimental This API may change in a breaking way in any release, including patch releases.
269
+ */
102
270
  declare enum PerpsOrderStatus {
103
271
  Accepted = "accepted",
104
272
  Open = "open",
@@ -126,18 +294,62 @@ declare enum PerpsOrderStatus {
126
294
  ReduceOnlyInvalidAtTrigger = "reduce_only_invalid_at_trigger",
127
295
  Expired = "expired"
128
296
  }
297
+ /**
298
+ * @experimental This API may change in a breaking way in any release, including patch releases.
299
+ */
300
+ declare const PerpsTpSlOrderFieldsSchema: z.ZodPipe<z.ZodObject<{
301
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
302
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
303
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
304
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
305
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
306
+ slip_bps: z.ZodOptional<z.ZodNumber>;
307
+ }, z.core.$strip>, z.ZodTransform<{
308
+ kind: PerpsTpSlKind;
309
+ scope: PerpsTpSlScope;
310
+ triggerPrice: DecimalString;
311
+ parentOrderId: PerpsOrderId | undefined;
312
+ armedQuantity: DecimalString | undefined;
313
+ slippageBps: number | undefined;
314
+ }, {
315
+ kind: PerpsTpSlKind;
316
+ scope: PerpsTpSlScope;
317
+ trp: DecimalString;
318
+ parent_oid?: PerpsOrderId | undefined;
319
+ armed_qty?: DecimalString | undefined;
320
+ slip_bps?: number | undefined;
321
+ }>>;
322
+ /**
323
+ * @experimental This API may change in a breaking way in any release, including patch releases.
324
+ */
325
+ type PerpsTpSlOrderFields = z.infer<typeof PerpsTpSlOrderFieldsSchema>;
326
+ /**
327
+ * @experimental This API may change in a breaking way in any release, including patch releases.
328
+ */
129
329
  declare const PerpsOrderStatusSchema: z.ZodEnum<typeof PerpsOrderStatus>;
330
+ /**
331
+ * @experimental This API may change in a breaking way in any release, including patch releases.
332
+ */
130
333
  declare const PerpsCommandStatusSchema: z.ZodEnum<{
131
334
  ok: "ok";
132
335
  err: "err";
133
336
  }>;
337
+ /**
338
+ * @experimental This API may change in a breaking way in any release, including patch releases.
339
+ */
134
340
  declare const PerpsCommandAckSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
135
341
  status: z.ZodLiteral<"ok">;
136
342
  }, z.core.$strip>, z.ZodObject<{
137
343
  status: z.ZodLiteral<"err">;
138
344
  error: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string, string | undefined>>;
139
345
  }, z.core.$strip>], "status">;
346
+ /**
347
+ * @experimental This API may change in a breaking way in any release, including patch releases.
348
+ */
140
349
  type PerpsCommandAck = z.infer<typeof PerpsCommandAckSchema>;
350
+ /**
351
+ * @experimental This API may change in a breaking way in any release, including patch releases.
352
+ */
141
353
  declare const PerpsPostOrderAckSchema: z.ZodPipe<z.ZodObject<{
142
354
  status: z.ZodEnum<{
143
355
  ok: "ok";
@@ -162,7 +374,13 @@ declare const PerpsPostOrderAckSchema: z.ZodPipe<z.ZodObject<{
162
374
  coid?: PerpsClientOrderId | undefined;
163
375
  error?: string | undefined;
164
376
  }>>;
377
+ /**
378
+ * @experimental This API may change in a breaking way in any release, including patch releases.
379
+ */
165
380
  type PerpsPostOrderAck = z.infer<typeof PerpsPostOrderAckSchema>;
381
+ /**
382
+ * @experimental This API may change in a breaking way in any release, including patch releases.
383
+ */
166
384
  declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodObject<{
167
385
  status: z.ZodEnum<{
168
386
  ok: "ok";
@@ -187,7 +405,46 @@ declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodObject<{
187
405
  coid?: PerpsClientOrderId | undefined;
188
406
  error?: string | undefined;
189
407
  }>>;
408
+ /**
409
+ * @experimental This API may change in a breaking way in any release, including patch releases.
410
+ */
190
411
  type PerpsCancelOrderResult = z.infer<typeof PerpsCancelOrderResultSchema>;
412
+ /**
413
+ * @experimental This API may change in a breaking way in any release, including patch releases.
414
+ */
415
+ declare const PerpsCancelAllOrdersResponseSchema: z.ZodObject<{
416
+ status: z.ZodLiteral<"ok">;
417
+ }, z.core.$strip>;
418
+ /**
419
+ * @experimental This API may change in a breaking way in any release, including patch releases.
420
+ */
421
+ type PerpsCancelAllOrdersResponse = z.infer<typeof PerpsCancelAllOrdersResponseSchema>;
422
+ /**
423
+ * @experimental This API may change in a breaking way in any release, including patch releases.
424
+ */
425
+ declare const PerpsUpdateLeverageResultSchema: z.ZodPipe<z.ZodObject<{
426
+ status: z.ZodLiteral<"ok">;
427
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
428
+ leverage: z.ZodNumber;
429
+ cross: z.ZodBoolean;
430
+ }, z.core.$strip>, z.ZodTransform<{
431
+ status: "ok";
432
+ instrumentId: PerpsInstrumentId;
433
+ leverage: number;
434
+ crossMargin: boolean;
435
+ }, {
436
+ status: "ok";
437
+ instrument_id: PerpsInstrumentId;
438
+ leverage: number;
439
+ cross: boolean;
440
+ }>>;
441
+ /**
442
+ * @experimental This API may change in a breaking way in any release, including patch releases.
443
+ */
444
+ type PerpsUpdateLeverageResult = z.infer<typeof PerpsUpdateLeverageResultSchema>;
445
+ /**
446
+ * @experimental This API may change in a breaking way in any release, including patch releases.
447
+ */
191
448
  declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
192
449
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
193
450
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -196,26 +453,58 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
196
453
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
197
454
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
198
455
  post_only: z.ZodBoolean;
456
+ ro: z.ZodBoolean;
199
457
  status: z.ZodEnum<typeof PerpsOrderStatus>;
200
458
  resting_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
201
459
  filled_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
202
460
  created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
203
461
  updated_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
204
462
  client_order_id: z.ZodOptional<z.ZodString>;
463
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
464
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
465
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
466
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
467
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
468
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
469
+ slip_bps: z.ZodOptional<z.ZodNumber>;
470
+ }, z.core.$strip>, z.ZodTransform<{
471
+ kind: PerpsTpSlKind;
472
+ scope: PerpsTpSlScope;
473
+ triggerPrice: DecimalString;
474
+ parentOrderId: PerpsOrderId | undefined;
475
+ armedQuantity: DecimalString | undefined;
476
+ slippageBps: number | undefined;
477
+ }, {
478
+ kind: PerpsTpSlKind;
479
+ scope: PerpsTpSlScope;
480
+ trp: DecimalString;
481
+ parent_oid?: PerpsOrderId | undefined;
482
+ armed_qty?: DecimalString | undefined;
483
+ slip_bps?: number | undefined;
484
+ }>>>>;
205
485
  }, z.core.$strip>, z.ZodTransform<{
206
486
  id: PerpsOrderId;
207
487
  instrumentId: PerpsInstrumentId;
208
- buy: boolean;
488
+ side: OrderSide;
209
489
  price: DecimalString;
210
490
  quantity: DecimalString;
211
491
  timeInForce: PerpsTimeInForce;
212
492
  postOnly: boolean;
493
+ reduceOnly: boolean;
213
494
  status: PerpsOrderStatus;
214
495
  restingQuantity: DecimalString;
215
496
  filledQuantity: DecimalString;
216
497
  createdTimestamp: EpochMilliseconds;
217
498
  updatedTimestamp: EpochMilliseconds;
218
499
  clientOrderId: string | undefined;
500
+ tpSl: {
501
+ kind: PerpsTpSlKind;
502
+ scope: PerpsTpSlScope;
503
+ triggerPrice: DecimalString;
504
+ parentOrderId: PerpsOrderId | undefined;
505
+ armedQuantity: DecimalString | undefined;
506
+ slippageBps: number | undefined;
507
+ } | undefined;
219
508
  }, {
220
509
  order_id: PerpsOrderId;
221
510
  instrument_id: PerpsInstrumentId;
@@ -224,14 +513,29 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
224
513
  quantity: DecimalString;
225
514
  tif: PerpsTimeInForce;
226
515
  post_only: boolean;
516
+ ro: boolean;
227
517
  status: PerpsOrderStatus;
228
518
  resting_quantity: DecimalString;
229
519
  filled_quantity: DecimalString;
230
520
  created_timestamp: EpochMilliseconds;
231
521
  updated_timestamp: EpochMilliseconds;
232
522
  client_order_id?: string | undefined;
523
+ tpsl?: {
524
+ kind: PerpsTpSlKind;
525
+ scope: PerpsTpSlScope;
526
+ triggerPrice: DecimalString;
527
+ parentOrderId: PerpsOrderId | undefined;
528
+ armedQuantity: DecimalString | undefined;
529
+ slippageBps: number | undefined;
530
+ } | null | undefined;
233
531
  }>>;
532
+ /**
533
+ * @experimental This API may change in a breaking way in any release, including patch releases.
534
+ */
234
535
  type PerpsOrder = z.infer<typeof PerpsOrderSchema>;
536
+ /**
537
+ * @experimental This API may change in a breaking way in any release, including patch releases.
538
+ */
235
539
  declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
236
540
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
237
541
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -240,26 +544,58 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
240
544
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
241
545
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
242
546
  post_only: z.ZodBoolean;
547
+ ro: z.ZodBoolean;
243
548
  status: z.ZodEnum<typeof PerpsOrderStatus>;
244
549
  resting_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
245
550
  filled_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
246
551
  created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
247
552
  updated_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
248
553
  client_order_id: z.ZodOptional<z.ZodString>;
554
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
555
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
556
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
557
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
558
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
559
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
560
+ slip_bps: z.ZodOptional<z.ZodNumber>;
561
+ }, z.core.$strip>, z.ZodTransform<{
562
+ kind: PerpsTpSlKind;
563
+ scope: PerpsTpSlScope;
564
+ triggerPrice: DecimalString;
565
+ parentOrderId: PerpsOrderId | undefined;
566
+ armedQuantity: DecimalString | undefined;
567
+ slippageBps: number | undefined;
568
+ }, {
569
+ kind: PerpsTpSlKind;
570
+ scope: PerpsTpSlScope;
571
+ trp: DecimalString;
572
+ parent_oid?: PerpsOrderId | undefined;
573
+ armed_qty?: DecimalString | undefined;
574
+ slip_bps?: number | undefined;
575
+ }>>>>;
249
576
  }, z.core.$strip>, z.ZodTransform<{
250
577
  id: PerpsOrderId;
251
578
  instrumentId: PerpsInstrumentId;
252
- buy: boolean;
579
+ side: OrderSide;
253
580
  price: DecimalString;
254
581
  quantity: DecimalString;
255
582
  timeInForce: PerpsTimeInForce;
256
583
  postOnly: boolean;
584
+ reduceOnly: boolean;
257
585
  status: PerpsOrderStatus;
258
586
  restingQuantity: DecimalString;
259
587
  filledQuantity: DecimalString;
260
588
  createdTimestamp: EpochMilliseconds;
261
589
  updatedTimestamp: EpochMilliseconds;
262
590
  clientOrderId: string | undefined;
591
+ tpSl: {
592
+ kind: PerpsTpSlKind;
593
+ scope: PerpsTpSlScope;
594
+ triggerPrice: DecimalString;
595
+ parentOrderId: PerpsOrderId | undefined;
596
+ armedQuantity: DecimalString | undefined;
597
+ slippageBps: number | undefined;
598
+ } | undefined;
263
599
  }, {
264
600
  order_id: PerpsOrderId;
265
601
  instrument_id: PerpsInstrumentId;
@@ -268,13 +604,25 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
268
604
  quantity: DecimalString;
269
605
  tif: PerpsTimeInForce;
270
606
  post_only: boolean;
607
+ ro: boolean;
271
608
  status: PerpsOrderStatus;
272
609
  resting_quantity: DecimalString;
273
610
  filled_quantity: DecimalString;
274
611
  created_timestamp: EpochMilliseconds;
275
612
  updated_timestamp: EpochMilliseconds;
276
613
  client_order_id?: string | undefined;
614
+ tpsl?: {
615
+ kind: PerpsTpSlKind;
616
+ scope: PerpsTpSlScope;
617
+ triggerPrice: DecimalString;
618
+ parentOrderId: PerpsOrderId | undefined;
619
+ armedQuantity: DecimalString | undefined;
620
+ slippageBps: number | undefined;
621
+ } | null | undefined;
277
622
  }>>>;
623
+ /**
624
+ * @experimental This API may change in a breaking way in any release, including patch releases.
625
+ */
278
626
  declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
279
627
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
280
628
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -283,26 +631,58 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
283
631
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
284
632
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
285
633
  post_only: z.ZodBoolean;
634
+ ro: z.ZodBoolean;
286
635
  status: z.ZodEnum<typeof PerpsOrderStatus>;
287
636
  resting_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
288
637
  filled_quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
289
638
  created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
290
639
  updated_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
291
640
  client_order_id: z.ZodOptional<z.ZodString>;
641
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
642
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
643
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
644
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
645
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
646
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
647
+ slip_bps: z.ZodOptional<z.ZodNumber>;
648
+ }, z.core.$strip>, z.ZodTransform<{
649
+ kind: PerpsTpSlKind;
650
+ scope: PerpsTpSlScope;
651
+ triggerPrice: DecimalString;
652
+ parentOrderId: PerpsOrderId | undefined;
653
+ armedQuantity: DecimalString | undefined;
654
+ slippageBps: number | undefined;
655
+ }, {
656
+ kind: PerpsTpSlKind;
657
+ scope: PerpsTpSlScope;
658
+ trp: DecimalString;
659
+ parent_oid?: PerpsOrderId | undefined;
660
+ armed_qty?: DecimalString | undefined;
661
+ slip_bps?: number | undefined;
662
+ }>>>>;
292
663
  }, z.core.$strip>, z.ZodTransform<{
293
664
  id: PerpsOrderId;
294
665
  instrumentId: PerpsInstrumentId;
295
- buy: boolean;
666
+ side: OrderSide;
296
667
  price: DecimalString;
297
668
  quantity: DecimalString;
298
669
  timeInForce: PerpsTimeInForce;
299
670
  postOnly: boolean;
671
+ reduceOnly: boolean;
300
672
  status: PerpsOrderStatus;
301
673
  restingQuantity: DecimalString;
302
674
  filledQuantity: DecimalString;
303
675
  createdTimestamp: EpochMilliseconds;
304
676
  updatedTimestamp: EpochMilliseconds;
305
677
  clientOrderId: string | undefined;
678
+ tpSl: {
679
+ kind: PerpsTpSlKind;
680
+ scope: PerpsTpSlScope;
681
+ triggerPrice: DecimalString;
682
+ parentOrderId: PerpsOrderId | undefined;
683
+ armedQuantity: DecimalString | undefined;
684
+ slippageBps: number | undefined;
685
+ } | undefined;
306
686
  }, {
307
687
  order_id: PerpsOrderId;
308
688
  instrument_id: PerpsInstrumentId;
@@ -311,13 +691,25 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
311
691
  quantity: DecimalString;
312
692
  tif: PerpsTimeInForce;
313
693
  post_only: boolean;
694
+ ro: boolean;
314
695
  status: PerpsOrderStatus;
315
696
  resting_quantity: DecimalString;
316
697
  filled_quantity: DecimalString;
317
698
  created_timestamp: EpochMilliseconds;
318
699
  updated_timestamp: EpochMilliseconds;
319
700
  client_order_id?: string | undefined;
701
+ tpsl?: {
702
+ kind: PerpsTpSlKind;
703
+ scope: PerpsTpSlScope;
704
+ triggerPrice: DecimalString;
705
+ parentOrderId: PerpsOrderId | undefined;
706
+ armedQuantity: DecimalString | undefined;
707
+ slippageBps: number | undefined;
708
+ } | null | undefined;
320
709
  }>>>;
710
+ /**
711
+ * @experimental This API may change in a breaking way in any release, including patch releases.
712
+ */
321
713
  declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
322
714
  oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
323
715
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
@@ -326,26 +718,58 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
326
718
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
327
719
  tif: z.ZodEnum<typeof PerpsTimeInForce>;
328
720
  po: z.ZodBoolean;
721
+ ro: z.ZodBoolean;
329
722
  status: z.ZodEnum<typeof PerpsOrderStatus>;
330
723
  rest: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
331
724
  fill: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
332
725
  cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
333
726
  uts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
334
727
  coid: z.ZodOptional<z.ZodString>;
728
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
729
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
730
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
731
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
732
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
733
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
734
+ slip_bps: z.ZodOptional<z.ZodNumber>;
735
+ }, z.core.$strip>, z.ZodTransform<{
736
+ kind: PerpsTpSlKind;
737
+ scope: PerpsTpSlScope;
738
+ triggerPrice: DecimalString;
739
+ parentOrderId: PerpsOrderId | undefined;
740
+ armedQuantity: DecimalString | undefined;
741
+ slippageBps: number | undefined;
742
+ }, {
743
+ kind: PerpsTpSlKind;
744
+ scope: PerpsTpSlScope;
745
+ trp: DecimalString;
746
+ parent_oid?: PerpsOrderId | undefined;
747
+ armed_qty?: DecimalString | undefined;
748
+ slip_bps?: number | undefined;
749
+ }>>>>;
335
750
  }, z.core.$strip>, z.ZodTransform<{
336
751
  id: PerpsOrderId;
337
752
  instrumentId: PerpsInstrumentId;
338
- buy: boolean;
753
+ side: OrderSide;
339
754
  price: DecimalString;
340
755
  quantity: DecimalString;
341
756
  timeInForce: PerpsTimeInForce;
342
757
  postOnly: boolean;
758
+ reduceOnly: boolean;
343
759
  status: PerpsOrderStatus;
344
760
  restingQuantity: DecimalString;
345
761
  filledQuantity: DecimalString;
346
762
  createdTimestamp: EpochMilliseconds;
347
763
  updatedTimestamp: EpochMilliseconds;
348
764
  clientOrderId: string | undefined;
765
+ tpSl: {
766
+ kind: PerpsTpSlKind;
767
+ scope: PerpsTpSlScope;
768
+ triggerPrice: DecimalString;
769
+ parentOrderId: PerpsOrderId | undefined;
770
+ armedQuantity: DecimalString | undefined;
771
+ slippageBps: number | undefined;
772
+ } | undefined;
349
773
  }, {
350
774
  oid: PerpsOrderId;
351
775
  iid: PerpsInstrumentId;
@@ -354,13 +778,25 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
354
778
  qty: DecimalString;
355
779
  tif: PerpsTimeInForce;
356
780
  po: boolean;
781
+ ro: boolean;
357
782
  status: PerpsOrderStatus;
358
783
  rest: DecimalString;
359
784
  fill: DecimalString;
360
785
  cts: EpochMilliseconds;
361
786
  uts: EpochMilliseconds;
362
787
  coid?: string | undefined;
788
+ tpsl?: {
789
+ kind: PerpsTpSlKind;
790
+ scope: PerpsTpSlScope;
791
+ triggerPrice: DecimalString;
792
+ parentOrderId: PerpsOrderId | undefined;
793
+ armedQuantity: DecimalString | undefined;
794
+ slippageBps: number | undefined;
795
+ } | null | undefined;
363
796
  }>>;
797
+ /**
798
+ * @experimental This API may change in a breaking way in any release, including patch releases.
799
+ */
364
800
  declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
365
801
  trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
366
802
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
@@ -410,7 +846,13 @@ declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
410
846
  timestamp: EpochMilliseconds;
411
847
  hash?: _polymarket_types.TxHash | undefined;
412
848
  }>>;
849
+ /**
850
+ * @experimental This API may change in a breaking way in any release, including patch releases.
851
+ */
413
852
  type PerpsAccountFill = z.infer<typeof PerpsAccountFillSchema>;
853
+ /**
854
+ * @experimental This API may change in a breaking way in any release, including patch releases.
855
+ */
414
856
  declare const ListPerpsFillsResponseSchema: z.ZodObject<{
415
857
  data: z.ZodArray<z.ZodPipe<z.ZodObject<{
416
858
  trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
@@ -463,6 +905,9 @@ declare const ListPerpsFillsResponseSchema: z.ZodObject<{
463
905
  }>>>;
464
906
  more: z.ZodBoolean;
465
907
  }, z.core.$strip>;
908
+ /**
909
+ * @experimental This API may change in a breaking way in any release, including patch releases.
910
+ */
466
911
  declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
467
912
  tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
468
913
  oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
@@ -513,4 +958,4 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
513
958
  coid?: string | undefined;
514
959
  }>>;
515
960
 
516
- 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 PerpsWithdrawalAmount as a3, PerpsWithdrawalIdSchema as a4, PerpsWithdrawalStatusSchema as a5, decimalString as a6, perpsBaseUnits as a7, perpsDecimal as a8, 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 };
961
+ 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, PerpsWithdrawalStatusSchema as ah, decimalString as ai, perpsBaseUnits as aj, perpsDecimal as ak, PerpsDepositStatus as b, type PerpsWithdrawalId as c, PerpsWithdrawalStatus 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 };