@polymarket/bindings 0.11.0 → 0.13.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,7 +1,7 @@
1
1
  import { DecimalString, BaseUnits, EpochMilliseconds, OrderSide } from './index.js';
2
- import { z } from 'zod';
3
2
  import * as _polymarket_types from '@polymarket/types';
4
3
  import { EvmAddress, PrivateKey, TxHash } from '@polymarket/types';
4
+ import { z } from 'zod';
5
5
 
6
6
  type Tagged<T, Tag extends string> = T & {
7
7
  readonly __tag: Tag;
@@ -22,6 +22,11 @@ type PerpsClientOrderId = Tagged<string, 'PerpsClientOrderId'>;
22
22
  * @experimental This API may change in a breaking way in any release, including patch releases.
23
23
  */
24
24
  type PerpsNotificationId = Tagged<string, 'PerpsNotificationId'>;
25
+ /**
26
+ * Opaque receipt identity, unique within the authenticated builder account.
27
+ * @experimental This API may change in a breaking way in any release, including patch releases.
28
+ */
29
+ type PerpsBuilderEarningId = Tagged<string, 'PerpsBuilderEarningId'>;
25
30
  /**
26
31
  * @experimental This API may change in a breaking way in any release, including patch releases.
27
32
  */
@@ -62,6 +67,10 @@ declare const PerpsClientOrderIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<Pe
62
67
  * @experimental This API may change in a breaking way in any release, including patch releases.
63
68
  */
64
69
  declare const PerpsNotificationIdSchema: z.ZodPipe<z.ZodUUID, z.ZodTransform<PerpsNotificationId, string>>;
70
+ /**
71
+ * @experimental This API may change in a breaking way in any release, including patch releases.
72
+ */
73
+ declare const PerpsBuilderEarningIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<PerpsBuilderEarningId, string>>;
65
74
  /**
66
75
  * @experimental This API may change in a breaking way in any release, including patch releases.
67
76
  */
@@ -121,6 +130,7 @@ declare enum PerpsSide {
121
130
  */
122
131
  declare enum PerpsTimeInForce {
123
132
  GTC = "gtc",
133
+ GTD = "gtd",
124
134
  IOC = "ioc",
125
135
  FOK = "fok"
126
136
  }
@@ -170,6 +180,28 @@ declare enum PerpsKnownWithdrawalStatus {
170
180
  * @experimental This API may change in a breaking way in any release, including patch releases.
171
181
  */
172
182
  type PerpsWithdrawalStatus = PerpsKnownWithdrawalStatus | (string & {});
183
+ /**
184
+ * Known internal-transfer classifications.
185
+ *
186
+ * The service evolves this set independently of released clients, so
187
+ * transfer parsing accepts unknown classifications as plain strings; see
188
+ * {@link PerpsInternalTransferType}.
189
+ *
190
+ * @experimental This API may change in a breaking way in any release, including patch releases.
191
+ */
192
+ declare enum PerpsKnownInternalTransferType {
193
+ Transfer = "transfer",
194
+ ReferralPayout = "referral_payout"
195
+ }
196
+ /**
197
+ * An internal-transfer classification. Known values are enumerated in
198
+ * {@link PerpsKnownInternalTransferType}; newly introduced values flow through
199
+ * as plain strings so they can be handled before a client release that
200
+ * enumerates them.
201
+ *
202
+ * @experimental This API may change in a breaking way in any release, including patch releases.
203
+ */
204
+ type PerpsInternalTransferType = PerpsKnownInternalTransferType | (string & {});
173
205
  /**
174
206
  * @experimental This API may change in a breaking way in any release, including patch releases.
175
207
  */
@@ -238,6 +270,10 @@ declare const PerpsDepositStatusSchema: z.ZodEnum<typeof PerpsDepositStatus>;
238
270
  * @experimental This API may change in a breaking way in any release, including patch releases.
239
271
  */
240
272
  declare const PerpsWithdrawalStatusSchema: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownWithdrawalStatus, string>>;
273
+ /**
274
+ * @experimental This API may change in a breaking way in any release, including patch releases.
275
+ */
276
+ declare const PerpsInternalTransferTypeSchema: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownInternalTransferType, string>>;
241
277
  /**
242
278
  * @experimental This API may change in a breaking way in any release, including patch releases.
243
279
  */
@@ -307,6 +343,534 @@ declare function perpsBaseUnits(value: string): BaseUnits;
307
343
  */
308
344
  declare function decimalString(value: string): DecimalString;
309
345
 
346
+ /**
347
+ * Saved attribution and the decimal fraction charged on executed notional.
348
+ * @experimental This API may change in a breaking way in any release, including patch releases.
349
+ */
350
+ declare const PerpsBuilderTermsSchema: z.ZodPipe<z.ZodObject<{
351
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
352
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
353
+ }, z.core.$strip>, z.ZodTransform<{
354
+ address: _polymarket_types.EvmAddress;
355
+ feeRate: DecimalString;
356
+ }, {
357
+ address: _polymarket_types.EvmAddress;
358
+ fee_rate: DecimalString;
359
+ }>>;
360
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
361
+ type PerpsBuilderTerms = z.infer<typeof PerpsBuilderTermsSchema>;
362
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
363
+ declare const PerpsBuilderStatusSchema: z.ZodPipe<z.ZodObject<{
364
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
365
+ registered: z.ZodBoolean;
366
+ enabled: z.ZodBoolean;
367
+ admission_enabled: z.ZodBoolean;
368
+ max_fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
369
+ }, z.core.$strip>, z.ZodTransform<{
370
+ address: _polymarket_types.EvmAddress;
371
+ registered: boolean;
372
+ enabled: boolean;
373
+ admissionEnabled: boolean;
374
+ maxFeeRate: DecimalString;
375
+ }, {
376
+ address: _polymarket_types.EvmAddress;
377
+ registered: boolean;
378
+ enabled: boolean;
379
+ admission_enabled: boolean;
380
+ max_fee_rate: DecimalString;
381
+ }>>;
382
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
383
+ type PerpsBuilderStatus = z.infer<typeof PerpsBuilderStatusSchema>;
384
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
385
+ declare const PerpsBuilderApprovalSchema: z.ZodPipe<z.ZodObject<{
386
+ trader: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
387
+ builder: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
388
+ max_fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
389
+ approval_version: z.ZodNumber;
390
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
391
+ sequence: z.ZodNumber;
392
+ }, z.core.$strip>, z.ZodTransform<{
393
+ trader: _polymarket_types.EvmAddress;
394
+ builder: _polymarket_types.EvmAddress;
395
+ maxFeeRate: DecimalString;
396
+ approvalVersion: number;
397
+ timestamp: EpochMilliseconds;
398
+ sequence: number;
399
+ }, {
400
+ trader: _polymarket_types.EvmAddress;
401
+ builder: _polymarket_types.EvmAddress;
402
+ max_fee_rate: DecimalString;
403
+ approval_version: number;
404
+ timestamp: EpochMilliseconds;
405
+ sequence: number;
406
+ }>>;
407
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
408
+ type PerpsBuilderApproval = z.infer<typeof PerpsBuilderApprovalSchema>;
409
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
410
+ declare const FetchPerpsBuilderApprovalsResponseSchema: z.ZodObject<{
411
+ data: z.ZodArray<z.ZodPipe<z.ZodObject<{
412
+ trader: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
413
+ builder: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
414
+ max_fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
415
+ approval_version: z.ZodNumber;
416
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
417
+ sequence: z.ZodNumber;
418
+ }, z.core.$strip>, z.ZodTransform<{
419
+ trader: _polymarket_types.EvmAddress;
420
+ builder: _polymarket_types.EvmAddress;
421
+ maxFeeRate: DecimalString;
422
+ approvalVersion: number;
423
+ timestamp: EpochMilliseconds;
424
+ sequence: number;
425
+ }, {
426
+ trader: _polymarket_types.EvmAddress;
427
+ builder: _polymarket_types.EvmAddress;
428
+ max_fee_rate: DecimalString;
429
+ approval_version: number;
430
+ timestamp: EpochMilliseconds;
431
+ sequence: number;
432
+ }>>>;
433
+ }, z.core.$strip>;
434
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
435
+ declare enum PerpsLiquidityRole {
436
+ Maker = "maker",
437
+ Taker = "taker"
438
+ }
439
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
440
+ declare const PerpsBuilderEarningSchema: z.ZodPipe<z.ZodObject<{
441
+ earning_id: z.ZodPipe<z.ZodString, z.ZodTransform<PerpsBuilderEarningId, string>>;
442
+ trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
443
+ order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
444
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
445
+ trader: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
446
+ buy: z.ZodBoolean;
447
+ price: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
448
+ quantity: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
449
+ client_order_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
450
+ side: z.ZodEnum<typeof PerpsLiquidityRole>;
451
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
452
+ sequence: z.ZodNumber;
453
+ notional: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
454
+ fee_asset: z.ZodString;
455
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
456
+ builder_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
457
+ total_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
458
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
459
+ }, z.core.$strip>, z.ZodTransform<{
460
+ liquidityRole: PerpsLiquidityRole;
461
+ timestamp: EpochMilliseconds;
462
+ sequence: number;
463
+ notional: DecimalString;
464
+ feeAsset: string;
465
+ /** Exchange fee for the fill, excluding the builder fee. */
466
+ fee: DecimalString;
467
+ /** Builder fee charged in addition to `fee` and credited to this builder. */
468
+ builderFee: DecimalString;
469
+ /** Sum of `fee` and `builderFee`. */
470
+ totalFee: DecimalString;
471
+ /** Builder fee rate for the fill, as a decimal fraction of `notional`. */
472
+ feeRate: DecimalString;
473
+ clientOrderId?: PerpsClientOrderId | undefined;
474
+ earningId: PerpsBuilderEarningId;
475
+ tradeId: PerpsTradeId;
476
+ orderId: PerpsOrderId;
477
+ instrumentId: PerpsInstrumentId;
478
+ trader: _polymarket_types.EvmAddress;
479
+ side: OrderSide;
480
+ price: DecimalString;
481
+ quantity: DecimalString;
482
+ }, {
483
+ earning_id: PerpsBuilderEarningId;
484
+ trade_id: PerpsTradeId;
485
+ order_id: PerpsOrderId;
486
+ instrument_id: PerpsInstrumentId;
487
+ trader: _polymarket_types.EvmAddress;
488
+ buy: boolean;
489
+ price: DecimalString;
490
+ quantity: DecimalString;
491
+ side: PerpsLiquidityRole;
492
+ timestamp: EpochMilliseconds;
493
+ sequence: number;
494
+ notional: DecimalString;
495
+ fee_asset: string;
496
+ fee: DecimalString;
497
+ builder_fee: DecimalString;
498
+ total_fee: DecimalString;
499
+ fee_rate: DecimalString;
500
+ client_order_id?: PerpsClientOrderId | undefined;
501
+ }>>;
502
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
503
+ type PerpsBuilderEarning = z.infer<typeof PerpsBuilderEarningSchema>;
504
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
505
+ declare const PerpsBuilderEarningsSnapshotSchema: z.ZodPipe<z.ZodObject<{
506
+ start_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
507
+ end_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
508
+ as_of_sequence: z.ZodNumber;
509
+ }, z.core.$strip>, z.ZodTransform<{
510
+ start: EpochMilliseconds;
511
+ end: EpochMilliseconds;
512
+ asOfSequence: number;
513
+ }, {
514
+ start_timestamp: EpochMilliseconds;
515
+ end_timestamp: EpochMilliseconds;
516
+ as_of_sequence: number;
517
+ }>>;
518
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
519
+ type PerpsBuilderEarningsSnapshot = z.infer<typeof PerpsBuilderEarningsSnapshotSchema>;
520
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
521
+ declare const ListPerpsBuilderEarningsResponseSchema: z.ZodPipe<z.ZodObject<{
522
+ start_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
523
+ end_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
524
+ as_of_sequence: z.ZodNumber;
525
+ data: z.ZodArray<z.ZodPipe<z.ZodObject<{
526
+ earning_id: z.ZodPipe<z.ZodString, z.ZodTransform<PerpsBuilderEarningId, string>>;
527
+ trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
528
+ order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
529
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
530
+ trader: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
531
+ buy: z.ZodBoolean;
532
+ price: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
533
+ quantity: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
534
+ client_order_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
535
+ side: z.ZodEnum<typeof PerpsLiquidityRole>;
536
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
537
+ sequence: z.ZodNumber;
538
+ notional: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
539
+ fee_asset: z.ZodString;
540
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
541
+ builder_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
542
+ total_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
543
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
544
+ }, z.core.$strip>, z.ZodTransform<{
545
+ liquidityRole: PerpsLiquidityRole;
546
+ timestamp: EpochMilliseconds;
547
+ sequence: number;
548
+ notional: DecimalString;
549
+ feeAsset: string;
550
+ /** Exchange fee for the fill, excluding the builder fee. */
551
+ fee: DecimalString;
552
+ /** Builder fee charged in addition to `fee` and credited to this builder. */
553
+ builderFee: DecimalString;
554
+ /** Sum of `fee` and `builderFee`. */
555
+ totalFee: DecimalString;
556
+ /** Builder fee rate for the fill, as a decimal fraction of `notional`. */
557
+ feeRate: DecimalString;
558
+ clientOrderId?: PerpsClientOrderId | undefined;
559
+ earningId: PerpsBuilderEarningId;
560
+ tradeId: PerpsTradeId;
561
+ orderId: PerpsOrderId;
562
+ instrumentId: PerpsInstrumentId;
563
+ trader: _polymarket_types.EvmAddress;
564
+ side: OrderSide;
565
+ price: DecimalString;
566
+ quantity: DecimalString;
567
+ }, {
568
+ earning_id: PerpsBuilderEarningId;
569
+ trade_id: PerpsTradeId;
570
+ order_id: PerpsOrderId;
571
+ instrument_id: PerpsInstrumentId;
572
+ trader: _polymarket_types.EvmAddress;
573
+ buy: boolean;
574
+ price: DecimalString;
575
+ quantity: DecimalString;
576
+ side: PerpsLiquidityRole;
577
+ timestamp: EpochMilliseconds;
578
+ sequence: number;
579
+ notional: DecimalString;
580
+ fee_asset: string;
581
+ fee: DecimalString;
582
+ builder_fee: DecimalString;
583
+ total_fee: DecimalString;
584
+ fee_rate: DecimalString;
585
+ client_order_id?: PerpsClientOrderId | undefined;
586
+ }>>>;
587
+ more: z.ZodBoolean;
588
+ cursor: z.ZodOptional<z.ZodString>;
589
+ }, z.core.$strip>, z.ZodTransform<{
590
+ snapshot: {
591
+ start: EpochMilliseconds;
592
+ end: EpochMilliseconds;
593
+ asOfSequence: number;
594
+ };
595
+ cursor?: string | undefined;
596
+ data: {
597
+ liquidityRole: PerpsLiquidityRole;
598
+ timestamp: EpochMilliseconds;
599
+ sequence: number;
600
+ notional: DecimalString;
601
+ feeAsset: string;
602
+ /** Exchange fee for the fill, excluding the builder fee. */
603
+ fee: DecimalString;
604
+ /** Builder fee charged in addition to `fee` and credited to this builder. */
605
+ builderFee: DecimalString;
606
+ /** Sum of `fee` and `builderFee`. */
607
+ totalFee: DecimalString;
608
+ /** Builder fee rate for the fill, as a decimal fraction of `notional`. */
609
+ feeRate: DecimalString;
610
+ clientOrderId?: PerpsClientOrderId | undefined;
611
+ earningId: PerpsBuilderEarningId;
612
+ tradeId: PerpsTradeId;
613
+ orderId: PerpsOrderId;
614
+ instrumentId: PerpsInstrumentId;
615
+ trader: _polymarket_types.EvmAddress;
616
+ side: OrderSide;
617
+ price: DecimalString;
618
+ quantity: DecimalString;
619
+ }[];
620
+ more: boolean;
621
+ }, {
622
+ start_timestamp: EpochMilliseconds;
623
+ end_timestamp: EpochMilliseconds;
624
+ as_of_sequence: number;
625
+ data: {
626
+ liquidityRole: PerpsLiquidityRole;
627
+ timestamp: EpochMilliseconds;
628
+ sequence: number;
629
+ notional: DecimalString;
630
+ feeAsset: string;
631
+ /** Exchange fee for the fill, excluding the builder fee. */
632
+ fee: DecimalString;
633
+ /** Builder fee charged in addition to `fee` and credited to this builder. */
634
+ builderFee: DecimalString;
635
+ /** Sum of `fee` and `builderFee`. */
636
+ totalFee: DecimalString;
637
+ /** Builder fee rate for the fill, as a decimal fraction of `notional`. */
638
+ feeRate: DecimalString;
639
+ clientOrderId?: PerpsClientOrderId | undefined;
640
+ earningId: PerpsBuilderEarningId;
641
+ tradeId: PerpsTradeId;
642
+ orderId: PerpsOrderId;
643
+ instrumentId: PerpsInstrumentId;
644
+ trader: _polymarket_types.EvmAddress;
645
+ side: OrderSide;
646
+ price: DecimalString;
647
+ quantity: DecimalString;
648
+ }[];
649
+ more: boolean;
650
+ cursor?: string | undefined;
651
+ }>>;
652
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
653
+ declare const PerpsBuilderEarningsAssetSchema: z.ZodPipe<z.ZodObject<{
654
+ fee_asset: z.ZodString;
655
+ fill_count: z.ZodNumber;
656
+ notional: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
657
+ builder_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
658
+ }, z.core.$strip>, z.ZodTransform<{
659
+ feeAsset: string;
660
+ fillCount: number;
661
+ notional: DecimalString;
662
+ builderFee: DecimalString;
663
+ }, {
664
+ fee_asset: string;
665
+ fill_count: number;
666
+ notional: DecimalString;
667
+ builder_fee: DecimalString;
668
+ }>>;
669
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
670
+ type PerpsBuilderEarningsAsset = z.infer<typeof PerpsBuilderEarningsAssetSchema>;
671
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
672
+ declare const PerpsBuilderEarningsSummarySchema: z.ZodPipe<z.ZodObject<{
673
+ start_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
674
+ end_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
675
+ as_of_sequence: z.ZodNumber;
676
+ data: z.ZodArray<z.ZodPipe<z.ZodObject<{
677
+ fee_asset: z.ZodString;
678
+ fill_count: z.ZodNumber;
679
+ notional: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
680
+ builder_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
681
+ }, z.core.$strip>, z.ZodTransform<{
682
+ feeAsset: string;
683
+ fillCount: number;
684
+ notional: DecimalString;
685
+ builderFee: DecimalString;
686
+ }, {
687
+ fee_asset: string;
688
+ fill_count: number;
689
+ notional: DecimalString;
690
+ builder_fee: DecimalString;
691
+ }>>>;
692
+ trader_count: z.ZodNumber;
693
+ active_approval_count: z.ZodNumber;
694
+ }, z.core.$strip>, z.ZodTransform<{
695
+ assets: {
696
+ feeAsset: string;
697
+ fillCount: number;
698
+ notional: DecimalString;
699
+ builderFee: DecimalString;
700
+ }[];
701
+ traderCount: number;
702
+ activeApprovalCount: number;
703
+ snapshot: {
704
+ start: EpochMilliseconds;
705
+ end: EpochMilliseconds;
706
+ asOfSequence: number;
707
+ };
708
+ }, {
709
+ start_timestamp: EpochMilliseconds;
710
+ end_timestamp: EpochMilliseconds;
711
+ as_of_sequence: number;
712
+ data: {
713
+ feeAsset: string;
714
+ fillCount: number;
715
+ notional: DecimalString;
716
+ builderFee: DecimalString;
717
+ }[];
718
+ trader_count: number;
719
+ active_approval_count: number;
720
+ }>>;
721
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
722
+ type PerpsBuilderEarningsSummary = z.infer<typeof PerpsBuilderEarningsSummarySchema>;
723
+
724
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
725
+ type PerpsChaseId = number & {
726
+ readonly __tag: 'PerpsChaseId';
727
+ };
728
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
729
+ declare const PerpsChaseIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>;
730
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
731
+ declare const PerpsChaseSchema: z.ZodPipe<z.ZodObject<{
732
+ chid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>;
733
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
734
+ buy: z.ZodBoolean;
735
+ qty: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
736
+ fill: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
737
+ lim: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
738
+ max_dist: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
739
+ max_dist_bps: z.ZodNumber;
740
+ po: z.ZodBoolean;
741
+ ro: z.ZodBoolean;
742
+ reference_price: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
743
+ reprices: z.ZodNumber;
744
+ post_only_rejections: z.ZodNumber;
745
+ cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
746
+ coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
747
+ oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
748
+ }, z.core.$strip>, z.ZodTransform<{
749
+ orderId?: PerpsOrderId | undefined;
750
+ clientOrderId?: PerpsClientOrderId | undefined;
751
+ chaseId: PerpsChaseId;
752
+ instrumentId: PerpsInstrumentId;
753
+ side: OrderSide;
754
+ quantity: DecimalString;
755
+ filledQuantity: DecimalString;
756
+ limitPrice: DecimalString;
757
+ maxDistance: DecimalString;
758
+ maxDistanceBps: number;
759
+ postOnly: boolean;
760
+ reduceOnly: boolean;
761
+ referencePrice: DecimalString;
762
+ reprices: number;
763
+ postOnlyRejections: number;
764
+ createdAt: EpochMilliseconds;
765
+ }, {
766
+ chid: PerpsChaseId;
767
+ iid: PerpsInstrumentId;
768
+ buy: boolean;
769
+ qty: DecimalString;
770
+ fill: DecimalString;
771
+ lim: DecimalString;
772
+ max_dist: DecimalString;
773
+ max_dist_bps: number;
774
+ po: boolean;
775
+ ro: boolean;
776
+ reference_price: DecimalString;
777
+ reprices: number;
778
+ post_only_rejections: number;
779
+ cts: EpochMilliseconds;
780
+ coid?: PerpsClientOrderId | undefined;
781
+ oid?: PerpsOrderId | undefined;
782
+ }>>;
783
+ /** A running chase. Zero bounds are unset; reference price is zero until a child first rests or fills.
784
+ * @experimental This API may change in a breaking way in any release, including patch releases.
785
+ */
786
+ type PerpsChase = z.infer<typeof PerpsChaseSchema>;
787
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
788
+ declare const PerpsChaseAcceptedSchema: z.ZodPipe<z.ZodObject<{
789
+ status: z.ZodLiteral<"ok">;
790
+ chid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>;
791
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
792
+ }, z.core.$strip>, z.ZodTransform<{
793
+ chaseId: PerpsChaseId;
794
+ timestamp: EpochMilliseconds;
795
+ }, {
796
+ status: "ok";
797
+ chid: PerpsChaseId;
798
+ ts: EpochMilliseconds;
799
+ }>>;
800
+ /** Acceptance does not guarantee a child has rested or any quantity will fill.
801
+ * @experimental This API may change in a breaking way in any release, including patch releases.
802
+ */
803
+ type PerpsChaseAccepted = z.infer<typeof PerpsChaseAcceptedSchema>;
804
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
805
+ declare const FetchPerpsChasesResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
806
+ chid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>;
807
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
808
+ buy: z.ZodBoolean;
809
+ qty: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
810
+ fill: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
811
+ lim: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
812
+ max_dist: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
813
+ max_dist_bps: z.ZodNumber;
814
+ po: z.ZodBoolean;
815
+ ro: z.ZodBoolean;
816
+ reference_price: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
817
+ reprices: z.ZodNumber;
818
+ post_only_rejections: z.ZodNumber;
819
+ cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
820
+ coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
821
+ oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
822
+ }, z.core.$strip>, z.ZodTransform<{
823
+ orderId?: PerpsOrderId | undefined;
824
+ clientOrderId?: PerpsClientOrderId | undefined;
825
+ chaseId: PerpsChaseId;
826
+ instrumentId: PerpsInstrumentId;
827
+ side: OrderSide;
828
+ quantity: DecimalString;
829
+ filledQuantity: DecimalString;
830
+ limitPrice: DecimalString;
831
+ maxDistance: DecimalString;
832
+ maxDistanceBps: number;
833
+ postOnly: boolean;
834
+ reduceOnly: boolean;
835
+ referencePrice: DecimalString;
836
+ reprices: number;
837
+ postOnlyRejections: number;
838
+ createdAt: EpochMilliseconds;
839
+ }, {
840
+ chid: PerpsChaseId;
841
+ iid: PerpsInstrumentId;
842
+ buy: boolean;
843
+ qty: DecimalString;
844
+ fill: DecimalString;
845
+ lim: DecimalString;
846
+ max_dist: DecimalString;
847
+ max_dist_bps: number;
848
+ po: boolean;
849
+ ro: boolean;
850
+ reference_price: DecimalString;
851
+ reprices: number;
852
+ post_only_rejections: number;
853
+ cts: EpochMilliseconds;
854
+ coid?: PerpsClientOrderId | undefined;
855
+ oid?: PerpsOrderId | undefined;
856
+ }>>>;
857
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
858
+ declare const CreatePerpsChaseResponseSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
859
+ status: z.ZodLiteral<"ok">;
860
+ chid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>;
861
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
862
+ }, z.core.$strip>, z.ZodTransform<{
863
+ chaseId: PerpsChaseId;
864
+ timestamp: EpochMilliseconds;
865
+ }, {
866
+ status: "ok";
867
+ chid: PerpsChaseId;
868
+ ts: EpochMilliseconds;
869
+ }>>, z.ZodObject<{
870
+ status: z.ZodLiteral<"err">;
871
+ error: z.ZodString;
872
+ }, z.core.$strip>]>;
873
+
310
874
  /**
311
875
  * @experimental This API may change in a breaking way in any release, including patch releases.
312
876
  */
@@ -317,7 +881,9 @@ declare enum PerpsNotificationType {
317
881
  PositionClosed = "position_closed",
318
882
  LimitOrderCanceled = "limit_order_canceled",
319
883
  LiquidationWarning = "liquidation_warning",
320
- PositionLiquidated = "position_liquidated"
884
+ PositionLiquidated = "position_liquidated",
885
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
886
+ PositionDeleveraged = "position_deleveraged"
321
887
  }
322
888
  /**
323
889
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -540,6 +1106,45 @@ declare const PerpsPositionLiquidatedNotificationSchema: z.ZodPipe<z.ZodObject<{
540
1106
  * @experimental This API may change in a breaking way in any release, including patch releases.
541
1107
  */
542
1108
  type PerpsPositionLiquidatedNotification = z.infer<typeof PerpsPositionLiquidatedNotificationSchema>;
1109
+ /**
1110
+ * A profitable position was reduced or closed by auto-deleveraging.
1111
+ *
1112
+ * @experimental This API may change in a breaking way in any release, including patch releases.
1113
+ */
1114
+ declare const PerpsPositionDeleveragedNotificationSchema: z.ZodPipe<z.ZodObject<{
1115
+ id: z.ZodPipe<z.ZodUUID, z.ZodTransform<PerpsNotificationId, string>>;
1116
+ type: z.ZodLiteral<PerpsNotificationType.PositionDeleveraged>;
1117
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1118
+ side: z.ZodEnum<typeof PerpsSide>;
1119
+ size_closed: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1120
+ price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1121
+ pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1122
+ margin_type: z.ZodEnum<typeof PerpsMarginType>;
1123
+ }, z.core.$strip>, z.ZodTransform<{
1124
+ id: PerpsNotificationId;
1125
+ type: PerpsNotificationType.PositionDeleveraged;
1126
+ instrumentId: PerpsInstrumentId;
1127
+ side: PerpsSide;
1128
+ sizeClosed: DecimalString;
1129
+ price: DecimalString;
1130
+ pnl: DecimalString;
1131
+ marginType: PerpsMarginType;
1132
+ }, {
1133
+ id: PerpsNotificationId;
1134
+ type: PerpsNotificationType.PositionDeleveraged;
1135
+ instrument_id: PerpsInstrumentId;
1136
+ side: PerpsSide;
1137
+ size_closed: DecimalString;
1138
+ price: DecimalString;
1139
+ pnl: DecimalString;
1140
+ margin_type: PerpsMarginType;
1141
+ }>>;
1142
+ /**
1143
+ * A profitable position was reduced or closed by auto-deleveraging.
1144
+ *
1145
+ * @experimental This API may change in a breaking way in any release, including patch releases.
1146
+ */
1147
+ type PerpsPositionDeleveragedNotification = z.infer<typeof PerpsPositionDeleveragedNotificationSchema>;
543
1148
  /**
544
1149
  * @experimental This API may change in a breaking way in any release, including patch releases.
545
1150
  */
@@ -690,6 +1295,33 @@ declare const PerpsNotificationSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodO
690
1295
  pnl: DecimalString | null;
691
1296
  margin_type: PerpsMarginType;
692
1297
  via_backstop: boolean;
1298
+ }>>, z.ZodPipe<z.ZodObject<{
1299
+ id: z.ZodPipe<z.ZodUUID, z.ZodTransform<PerpsNotificationId, string>>;
1300
+ type: z.ZodLiteral<PerpsNotificationType.PositionDeleveraged>;
1301
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1302
+ side: z.ZodEnum<typeof PerpsSide>;
1303
+ size_closed: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1304
+ price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1305
+ pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1306
+ margin_type: z.ZodEnum<typeof PerpsMarginType>;
1307
+ }, z.core.$strip>, z.ZodTransform<{
1308
+ id: PerpsNotificationId;
1309
+ type: PerpsNotificationType.PositionDeleveraged;
1310
+ instrumentId: PerpsInstrumentId;
1311
+ side: PerpsSide;
1312
+ sizeClosed: DecimalString;
1313
+ price: DecimalString;
1314
+ pnl: DecimalString;
1315
+ marginType: PerpsMarginType;
1316
+ }, {
1317
+ id: PerpsNotificationId;
1318
+ type: PerpsNotificationType.PositionDeleveraged;
1319
+ instrument_id: PerpsInstrumentId;
1320
+ side: PerpsSide;
1321
+ size_closed: DecimalString;
1322
+ price: DecimalString;
1323
+ pnl: DecimalString;
1324
+ margin_type: PerpsMarginType;
693
1325
  }>>], "type">;
694
1326
  /**
695
1327
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -843,9 +1475,36 @@ declare const PerpsNotificationEntrySchema: z.ZodPipe<z.ZodObject<{
843
1475
  instrument_id: PerpsInstrumentId;
844
1476
  side: PerpsSide;
845
1477
  size_closed: DecimalString;
846
- pnl: DecimalString | null;
1478
+ pnl: DecimalString | null;
1479
+ margin_type: PerpsMarginType;
1480
+ via_backstop: boolean;
1481
+ }>>, z.ZodPipe<z.ZodObject<{
1482
+ id: z.ZodPipe<z.ZodUUID, z.ZodTransform<PerpsNotificationId, string>>;
1483
+ type: z.ZodLiteral<PerpsNotificationType.PositionDeleveraged>;
1484
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1485
+ side: z.ZodEnum<typeof PerpsSide>;
1486
+ size_closed: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1487
+ price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1488
+ pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1489
+ margin_type: z.ZodEnum<typeof PerpsMarginType>;
1490
+ }, z.core.$strip>, z.ZodTransform<{
1491
+ id: PerpsNotificationId;
1492
+ type: PerpsNotificationType.PositionDeleveraged;
1493
+ instrumentId: PerpsInstrumentId;
1494
+ side: PerpsSide;
1495
+ sizeClosed: DecimalString;
1496
+ price: DecimalString;
1497
+ pnl: DecimalString;
1498
+ marginType: PerpsMarginType;
1499
+ }, {
1500
+ id: PerpsNotificationId;
1501
+ type: PerpsNotificationType.PositionDeleveraged;
1502
+ instrument_id: PerpsInstrumentId;
1503
+ side: PerpsSide;
1504
+ size_closed: DecimalString;
1505
+ price: DecimalString;
1506
+ pnl: DecimalString;
847
1507
  margin_type: PerpsMarginType;
848
- via_backstop: boolean;
849
1508
  }>>], "type">;
850
1509
  read_at: z.ZodNullable<z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>>;
851
1510
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
@@ -897,6 +1556,15 @@ declare const PerpsNotificationEntrySchema: z.ZodPipe<z.ZodObject<{
897
1556
  pnl: DecimalString | null;
898
1557
  marginType: PerpsMarginType;
899
1558
  viaBackstop: boolean;
1559
+ } | {
1560
+ id: PerpsNotificationId;
1561
+ type: PerpsNotificationType.PositionDeleveraged;
1562
+ instrumentId: PerpsInstrumentId;
1563
+ side: PerpsSide;
1564
+ sizeClosed: DecimalString;
1565
+ price: DecimalString;
1566
+ pnl: DecimalString;
1567
+ marginType: PerpsMarginType;
900
1568
  };
901
1569
  readAt: EpochMilliseconds | null;
902
1570
  timestamp: EpochMilliseconds;
@@ -948,6 +1616,15 @@ declare const PerpsNotificationEntrySchema: z.ZodPipe<z.ZodObject<{
948
1616
  pnl: DecimalString | null;
949
1617
  marginType: PerpsMarginType;
950
1618
  viaBackstop: boolean;
1619
+ } | {
1620
+ id: PerpsNotificationId;
1621
+ type: PerpsNotificationType.PositionDeleveraged;
1622
+ instrumentId: PerpsInstrumentId;
1623
+ side: PerpsSide;
1624
+ sizeClosed: DecimalString;
1625
+ price: DecimalString;
1626
+ pnl: DecimalString;
1627
+ marginType: PerpsMarginType;
951
1628
  };
952
1629
  read_at: EpochMilliseconds | null;
953
1630
  ts: EpochMilliseconds;
@@ -1012,6 +1689,15 @@ declare const ListPerpsNotificationsResponseSchema: z.ZodObject<{
1012
1689
  pnl: DecimalString | null;
1013
1690
  marginType: PerpsMarginType;
1014
1691
  viaBackstop: boolean;
1692
+ } | {
1693
+ id: PerpsNotificationId;
1694
+ type: PerpsNotificationType.PositionDeleveraged;
1695
+ instrumentId: PerpsInstrumentId;
1696
+ side: PerpsSide;
1697
+ sizeClosed: DecimalString;
1698
+ price: DecimalString;
1699
+ pnl: DecimalString;
1700
+ marginType: PerpsMarginType;
1015
1701
  };
1016
1702
  readAt: EpochMilliseconds | null;
1017
1703
  timestamp: EpochMilliseconds;
@@ -1060,9 +1746,18 @@ declare enum PerpsOrderStatus {
1060
1746
  ZeroQuantity = "zero_quantity",
1061
1747
  DuplicateOrder = "duplicate_order",
1062
1748
  OrderNotFound = "order_not_found",
1749
+ OrderAlreadyTerminal = "order_already_terminal",
1063
1750
  ReduceOnlyInvalid = "reduce_only_invalid",
1064
1751
  ReduceOnlyExpired = "reduce_only_expired",
1065
1752
  OrderExpired = "order_expired",
1753
+ SweepCapExceeded = "sweep_cap_exceeded",
1754
+ RestingOrderLimitExceeded = "resting_order_limit_exceeded",
1755
+ BelowMinNotional = "below_min_notional",
1756
+ InstrumentDisabled = "instrument_disabled",
1757
+ InstrumentCloseOnly = "instrument_close_only",
1758
+ InstrumentSettled = "instrument_settled",
1759
+ InsufficientMarginAtFill = "insufficient_margin_at_fill",
1760
+ MarkPriceUnavailable = "mark_price_unavailable",
1066
1761
  Untriggered = "untriggered",
1067
1762
  Armed = "armed",
1068
1763
  Triggered = "triggered",
@@ -1082,6 +1777,10 @@ declare const PerpsTpSlOrderFieldsSchema: z.ZodPipe<z.ZodObject<{
1082
1777
  parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1083
1778
  armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1084
1779
  slip_bps: z.ZodOptional<z.ZodNumber>;
1780
+ trail_bps: z.ZodOptional<z.ZodNumber>;
1781
+ act: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1782
+ trail_anchor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1783
+ trail_active: z.ZodOptional<z.ZodBoolean>;
1085
1784
  }, z.core.$strip>, z.ZodTransform<{
1086
1785
  kind: PerpsTpSlKind;
1087
1786
  scope: PerpsTpSlScope;
@@ -1089,6 +1788,10 @@ declare const PerpsTpSlOrderFieldsSchema: z.ZodPipe<z.ZodObject<{
1089
1788
  parentOrderId: PerpsOrderId | undefined;
1090
1789
  armedQuantity: DecimalString | undefined;
1091
1790
  slippageBps: number | undefined;
1791
+ trailingBps: number | undefined;
1792
+ activationPrice: DecimalString | undefined;
1793
+ trailingAnchor: DecimalString | undefined;
1794
+ trailingActive: boolean | undefined;
1092
1795
  }, {
1093
1796
  kind: PerpsTpSlKind;
1094
1797
  scope: PerpsTpSlScope;
@@ -1096,6 +1799,10 @@ declare const PerpsTpSlOrderFieldsSchema: z.ZodPipe<z.ZodObject<{
1096
1799
  parent_oid?: PerpsOrderId | undefined;
1097
1800
  armed_qty?: DecimalString | undefined;
1098
1801
  slip_bps?: number | undefined;
1802
+ trail_bps?: number | undefined;
1803
+ act?: DecimalString | undefined;
1804
+ trail_anchor?: DecimalString | undefined;
1805
+ trail_active?: boolean | undefined;
1099
1806
  }>>;
1100
1807
  /**
1101
1808
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1112,6 +1819,35 @@ declare const PerpsCommandStatusSchema: z.ZodEnum<{
1112
1819
  ok: "ok";
1113
1820
  err: "err";
1114
1821
  }>;
1822
+ /**
1823
+ * Known rejection identifiers returned when a Perps order cancellation fails.
1824
+ *
1825
+ * The service evolves this set independently of released clients, so
1826
+ * cancellation parsing accepts unknown identifiers as plain strings; see
1827
+ * {@link PerpsCancelOrderErrorCode}.
1828
+ *
1829
+ * @experimental This API may change in a breaking way in any release, including patch releases.
1830
+ */
1831
+ declare enum PerpsKnownCancelOrderErrorCode {
1832
+ OrderUnknown = "order_unknown",
1833
+ OrderNotInOrderbook = "order_not_in_orderbook",
1834
+ OrderInFlight = "order_in_flight",
1835
+ OrderNotPendingEngine = "order_not_pending_engine",
1836
+ OrderNotFound = "order_not_found"
1837
+ }
1838
+ /**
1839
+ * A Perps order cancellation rejection identifier. Known identifiers are
1840
+ * enumerated in {@link PerpsKnownCancelOrderErrorCode}; newly introduced
1841
+ * identifiers flow through as plain strings so they can be handled before a
1842
+ * client release that enumerates them.
1843
+ *
1844
+ * @experimental This API may change in a breaking way in any release, including patch releases.
1845
+ */
1846
+ type PerpsCancelOrderErrorCode = PerpsKnownCancelOrderErrorCode | (string & {});
1847
+ /**
1848
+ * @experimental This API may change in a breaking way in any release, including patch releases.
1849
+ */
1850
+ declare const PerpsCancelOrderErrorCodeSchema: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownCancelOrderErrorCode, string>>;
1115
1851
  /**
1116
1852
  * @experimental This API may change in a breaking way in any release, including patch releases.
1117
1853
  */
@@ -1136,12 +1872,25 @@ declare const PerpsPostOrderAckSchema: z.ZodPipe<z.ZodObject<{
1136
1872
  oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1137
1873
  coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
1138
1874
  error: z.ZodOptional<z.ZodString>;
1875
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
1876
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
1877
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1878
+ }, z.core.$strip>, z.ZodTransform<{
1879
+ address: _polymarket_types.EvmAddress;
1880
+ feeRate: DecimalString;
1881
+ }, {
1882
+ address: _polymarket_types.EvmAddress;
1883
+ fee_rate: DecimalString;
1884
+ }>>>;
1139
1885
  }, z.core.$strip>, z.ZodTransform<{
1140
1886
  status: "err";
1141
1887
  error: string;
1142
1888
  clientOrderId: PerpsClientOrderId | undefined;
1143
- orderId?: undefined;
1144
1889
  } | {
1890
+ builder?: {
1891
+ address: _polymarket_types.EvmAddress;
1892
+ feeRate: DecimalString;
1893
+ } | undefined;
1145
1894
  status: "ok";
1146
1895
  orderId: PerpsOrderId;
1147
1896
  clientOrderId: PerpsClientOrderId | undefined;
@@ -1151,6 +1900,10 @@ declare const PerpsPostOrderAckSchema: z.ZodPipe<z.ZodObject<{
1151
1900
  oid?: PerpsOrderId | undefined;
1152
1901
  coid?: PerpsClientOrderId | undefined;
1153
1902
  error?: string | undefined;
1903
+ builder?: {
1904
+ address: _polymarket_types.EvmAddress;
1905
+ feeRate: DecimalString;
1906
+ } | undefined;
1154
1907
  }>>;
1155
1908
  /**
1156
1909
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1159,17 +1912,18 @@ type PerpsPostOrderAck = z.infer<typeof PerpsPostOrderAckSchema>;
1159
1912
  /**
1160
1913
  * @experimental This API may change in a breaking way in any release, including patch releases.
1161
1914
  */
1162
- declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodObject<{
1163
- status: z.ZodEnum<{
1164
- ok: "ok";
1165
- err: "err";
1166
- }>;
1915
+ declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
1916
+ status: z.ZodLiteral<"ok">;
1167
1917
  oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1168
1918
  coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
1169
- error: z.ZodOptional<z.ZodString>;
1170
- }, z.core.$strip>, z.ZodTransform<{
1919
+ }, z.core.$strip>, z.ZodObject<{
1920
+ status: z.ZodLiteral<"err">;
1921
+ error: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownCancelOrderErrorCode, string>>;
1922
+ oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1923
+ coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
1924
+ }, z.core.$strip>], "status">, z.ZodTransform<{
1171
1925
  status: "err";
1172
- error: string;
1926
+ error: (string & {}) | PerpsKnownCancelOrderErrorCode;
1173
1927
  orderId: PerpsOrderId | undefined;
1174
1928
  clientOrderId: PerpsClientOrderId | undefined;
1175
1929
  } | {
@@ -1178,10 +1932,14 @@ declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodObject<{
1178
1932
  clientOrderId: PerpsClientOrderId | undefined;
1179
1933
  error?: undefined;
1180
1934
  }, {
1181
- status: "ok" | "err";
1935
+ status: "ok";
1936
+ oid?: PerpsOrderId | undefined;
1937
+ coid?: PerpsClientOrderId | undefined;
1938
+ } | {
1939
+ status: "err";
1940
+ error: (string & {}) | PerpsKnownCancelOrderErrorCode;
1182
1941
  oid?: PerpsOrderId | undefined;
1183
1942
  coid?: PerpsClientOrderId | undefined;
1184
- error?: string | undefined;
1185
1943
  }>>;
1186
1944
  /**
1187
1945
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1220,6 +1978,69 @@ declare const PerpsUpdateLeverageResultSchema: z.ZodPipe<z.ZodObject<{
1220
1978
  * @experimental This API may change in a breaking way in any release, including patch releases.
1221
1979
  */
1222
1980
  type PerpsUpdateLeverageResult = z.infer<typeof PerpsUpdateLeverageResultSchema>;
1981
+ /**
1982
+ * A rejected item in a batch Perps leverage update.
1983
+ *
1984
+ * @experimental This API may change in a breaking way in any release, including patch releases.
1985
+ */
1986
+ declare const PerpsUpdateLeverageRejectionSchema: z.ZodPipe<z.ZodObject<{
1987
+ status: z.ZodLiteral<"err">;
1988
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1989
+ error: z.ZodOptional<z.ZodString>;
1990
+ }, z.core.$strip>, z.ZodTransform<{
1991
+ status: "err";
1992
+ instrumentId: PerpsInstrumentId;
1993
+ error: string;
1994
+ }, {
1995
+ status: "err";
1996
+ instrument_id: PerpsInstrumentId;
1997
+ error?: string | undefined;
1998
+ }>>;
1999
+ /**
2000
+ * A rejected item in a batch Perps leverage update.
2001
+ *
2002
+ * @experimental This API may change in a breaking way in any release, including patch releases.
2003
+ */
2004
+ type PerpsUpdateLeverageRejection = z.infer<typeof PerpsUpdateLeverageRejectionSchema>;
2005
+ /**
2006
+ * The result for one item in a batch Perps leverage update.
2007
+ *
2008
+ * @experimental This API may change in a breaking way in any release, including patch releases.
2009
+ */
2010
+ declare const PerpsUpdateLeverageBatchResultSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
2011
+ status: z.ZodLiteral<"ok">;
2012
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2013
+ leverage: z.ZodNumber;
2014
+ cross: z.ZodBoolean;
2015
+ }, z.core.$strip>, z.ZodTransform<{
2016
+ status: "ok";
2017
+ instrumentId: PerpsInstrumentId;
2018
+ leverage: number;
2019
+ crossMargin: boolean;
2020
+ }, {
2021
+ status: "ok";
2022
+ instrument_id: PerpsInstrumentId;
2023
+ leverage: number;
2024
+ cross: boolean;
2025
+ }>>, z.ZodPipe<z.ZodObject<{
2026
+ status: z.ZodLiteral<"err">;
2027
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2028
+ error: z.ZodOptional<z.ZodString>;
2029
+ }, z.core.$strip>, z.ZodTransform<{
2030
+ status: "err";
2031
+ instrumentId: PerpsInstrumentId;
2032
+ error: string;
2033
+ }, {
2034
+ status: "err";
2035
+ instrument_id: PerpsInstrumentId;
2036
+ error?: string | undefined;
2037
+ }>>]>;
2038
+ /**
2039
+ * The result for one item in a batch Perps leverage update.
2040
+ *
2041
+ * @experimental This API may change in a breaking way in any release, including patch releases.
2042
+ */
2043
+ type PerpsUpdateLeverageBatchResult = z.infer<typeof PerpsUpdateLeverageBatchResultSchema>;
1223
2044
  /**
1224
2045
  * @experimental This API may change in a breaking way in any release, including patch releases.
1225
2046
  */
@@ -1238,6 +2059,7 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
1238
2059
  created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1239
2060
  updated_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1240
2061
  client_order_id: z.ZodOptional<z.ZodString>;
2062
+ chid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>>;
1241
2063
  tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
1242
2064
  kind: z.ZodEnum<typeof PerpsTpSlKind>;
1243
2065
  scope: z.ZodEnum<typeof PerpsTpSlScope>;
@@ -1245,6 +2067,10 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
1245
2067
  parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1246
2068
  armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1247
2069
  slip_bps: z.ZodOptional<z.ZodNumber>;
2070
+ trail_bps: z.ZodOptional<z.ZodNumber>;
2071
+ act: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2072
+ trail_anchor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2073
+ trail_active: z.ZodOptional<z.ZodBoolean>;
1248
2074
  }, z.core.$strip>, z.ZodTransform<{
1249
2075
  kind: PerpsTpSlKind;
1250
2076
  scope: PerpsTpSlScope;
@@ -1252,6 +2078,10 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
1252
2078
  parentOrderId: PerpsOrderId | undefined;
1253
2079
  armedQuantity: DecimalString | undefined;
1254
2080
  slippageBps: number | undefined;
2081
+ trailingBps: number | undefined;
2082
+ activationPrice: DecimalString | undefined;
2083
+ trailingAnchor: DecimalString | undefined;
2084
+ trailingActive: boolean | undefined;
1255
2085
  }, {
1256
2086
  kind: PerpsTpSlKind;
1257
2087
  scope: PerpsTpSlScope;
@@ -1259,8 +2089,39 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
1259
2089
  parent_oid?: PerpsOrderId | undefined;
1260
2090
  armed_qty?: DecimalString | undefined;
1261
2091
  slip_bps?: number | undefined;
2092
+ trail_bps?: number | undefined;
2093
+ act?: DecimalString | undefined;
2094
+ trail_anchor?: DecimalString | undefined;
2095
+ trail_active?: boolean | undefined;
1262
2096
  }>>>>;
2097
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2098
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2099
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2100
+ }, z.core.$strip>, z.ZodTransform<{
2101
+ address: _polymarket_types.EvmAddress;
2102
+ feeRate: DecimalString;
2103
+ }, {
2104
+ address: _polymarket_types.EvmAddress;
2105
+ fee_rate: DecimalString;
2106
+ }>>>;
1263
2107
  }, z.core.$strip>, z.ZodTransform<{
2108
+ builder?: {
2109
+ address: _polymarket_types.EvmAddress;
2110
+ feeRate: DecimalString;
2111
+ } | undefined;
2112
+ tpSl: {
2113
+ kind: PerpsTpSlKind;
2114
+ scope: PerpsTpSlScope;
2115
+ triggerPrice: DecimalString;
2116
+ parentOrderId: PerpsOrderId | undefined;
2117
+ armedQuantity: DecimalString | undefined;
2118
+ slippageBps: number | undefined;
2119
+ trailingBps: number | undefined;
2120
+ activationPrice: DecimalString | undefined;
2121
+ trailingAnchor: DecimalString | undefined;
2122
+ trailingActive: boolean | undefined;
2123
+ } | undefined;
2124
+ chaseId?: PerpsChaseId | undefined;
1264
2125
  id: PerpsOrderId;
1265
2126
  instrumentId: PerpsInstrumentId;
1266
2127
  side: OrderSide;
@@ -1275,14 +2136,6 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
1275
2136
  createdTimestamp: EpochMilliseconds;
1276
2137
  updatedTimestamp: EpochMilliseconds;
1277
2138
  clientOrderId: string | undefined;
1278
- tpSl: {
1279
- kind: PerpsTpSlKind;
1280
- scope: PerpsTpSlScope;
1281
- triggerPrice: DecimalString;
1282
- parentOrderId: PerpsOrderId | undefined;
1283
- armedQuantity: DecimalString | undefined;
1284
- slippageBps: number | undefined;
1285
- } | undefined;
1286
2139
  }, {
1287
2140
  order_id: PerpsOrderId;
1288
2141
  instrument_id: PerpsInstrumentId;
@@ -1298,6 +2151,7 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
1298
2151
  created_timestamp: EpochMilliseconds;
1299
2152
  updated_timestamp: EpochMilliseconds;
1300
2153
  client_order_id?: string | undefined;
2154
+ chid?: PerpsChaseId | undefined;
1301
2155
  tpsl?: {
1302
2156
  kind: PerpsTpSlKind;
1303
2157
  scope: PerpsTpSlScope;
@@ -1305,7 +2159,15 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
1305
2159
  parentOrderId: PerpsOrderId | undefined;
1306
2160
  armedQuantity: DecimalString | undefined;
1307
2161
  slippageBps: number | undefined;
2162
+ trailingBps: number | undefined;
2163
+ activationPrice: DecimalString | undefined;
2164
+ trailingAnchor: DecimalString | undefined;
2165
+ trailingActive: boolean | undefined;
1308
2166
  } | null | undefined;
2167
+ builder?: {
2168
+ address: _polymarket_types.EvmAddress;
2169
+ feeRate: DecimalString;
2170
+ } | undefined;
1309
2171
  }>>;
1310
2172
  /**
1311
2173
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1329,6 +2191,7 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
1329
2191
  created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1330
2192
  updated_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1331
2193
  client_order_id: z.ZodOptional<z.ZodString>;
2194
+ chid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>>;
1332
2195
  tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
1333
2196
  kind: z.ZodEnum<typeof PerpsTpSlKind>;
1334
2197
  scope: z.ZodEnum<typeof PerpsTpSlScope>;
@@ -1336,6 +2199,10 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
1336
2199
  parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1337
2200
  armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1338
2201
  slip_bps: z.ZodOptional<z.ZodNumber>;
2202
+ trail_bps: z.ZodOptional<z.ZodNumber>;
2203
+ act: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2204
+ trail_anchor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2205
+ trail_active: z.ZodOptional<z.ZodBoolean>;
1339
2206
  }, z.core.$strip>, z.ZodTransform<{
1340
2207
  kind: PerpsTpSlKind;
1341
2208
  scope: PerpsTpSlScope;
@@ -1343,6 +2210,10 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
1343
2210
  parentOrderId: PerpsOrderId | undefined;
1344
2211
  armedQuantity: DecimalString | undefined;
1345
2212
  slippageBps: number | undefined;
2213
+ trailingBps: number | undefined;
2214
+ activationPrice: DecimalString | undefined;
2215
+ trailingAnchor: DecimalString | undefined;
2216
+ trailingActive: boolean | undefined;
1346
2217
  }, {
1347
2218
  kind: PerpsTpSlKind;
1348
2219
  scope: PerpsTpSlScope;
@@ -1350,8 +2221,39 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
1350
2221
  parent_oid?: PerpsOrderId | undefined;
1351
2222
  armed_qty?: DecimalString | undefined;
1352
2223
  slip_bps?: number | undefined;
2224
+ trail_bps?: number | undefined;
2225
+ act?: DecimalString | undefined;
2226
+ trail_anchor?: DecimalString | undefined;
2227
+ trail_active?: boolean | undefined;
1353
2228
  }>>>>;
2229
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2230
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2231
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2232
+ }, z.core.$strip>, z.ZodTransform<{
2233
+ address: _polymarket_types.EvmAddress;
2234
+ feeRate: DecimalString;
2235
+ }, {
2236
+ address: _polymarket_types.EvmAddress;
2237
+ fee_rate: DecimalString;
2238
+ }>>>;
1354
2239
  }, z.core.$strip>, z.ZodTransform<{
2240
+ builder?: {
2241
+ address: _polymarket_types.EvmAddress;
2242
+ feeRate: DecimalString;
2243
+ } | undefined;
2244
+ tpSl: {
2245
+ kind: PerpsTpSlKind;
2246
+ scope: PerpsTpSlScope;
2247
+ triggerPrice: DecimalString;
2248
+ parentOrderId: PerpsOrderId | undefined;
2249
+ armedQuantity: DecimalString | undefined;
2250
+ slippageBps: number | undefined;
2251
+ trailingBps: number | undefined;
2252
+ activationPrice: DecimalString | undefined;
2253
+ trailingAnchor: DecimalString | undefined;
2254
+ trailingActive: boolean | undefined;
2255
+ } | undefined;
2256
+ chaseId?: PerpsChaseId | undefined;
1355
2257
  id: PerpsOrderId;
1356
2258
  instrumentId: PerpsInstrumentId;
1357
2259
  side: OrderSide;
@@ -1366,14 +2268,6 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
1366
2268
  createdTimestamp: EpochMilliseconds;
1367
2269
  updatedTimestamp: EpochMilliseconds;
1368
2270
  clientOrderId: string | undefined;
1369
- tpSl: {
1370
- kind: PerpsTpSlKind;
1371
- scope: PerpsTpSlScope;
1372
- triggerPrice: DecimalString;
1373
- parentOrderId: PerpsOrderId | undefined;
1374
- armedQuantity: DecimalString | undefined;
1375
- slippageBps: number | undefined;
1376
- } | undefined;
1377
2271
  }, {
1378
2272
  order_id: PerpsOrderId;
1379
2273
  instrument_id: PerpsInstrumentId;
@@ -1389,6 +2283,7 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
1389
2283
  created_timestamp: EpochMilliseconds;
1390
2284
  updated_timestamp: EpochMilliseconds;
1391
2285
  client_order_id?: string | undefined;
2286
+ chid?: PerpsChaseId | undefined;
1392
2287
  tpsl?: {
1393
2288
  kind: PerpsTpSlKind;
1394
2289
  scope: PerpsTpSlScope;
@@ -1396,7 +2291,15 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
1396
2291
  parentOrderId: PerpsOrderId | undefined;
1397
2292
  armedQuantity: DecimalString | undefined;
1398
2293
  slippageBps: number | undefined;
2294
+ trailingBps: number | undefined;
2295
+ activationPrice: DecimalString | undefined;
2296
+ trailingAnchor: DecimalString | undefined;
2297
+ trailingActive: boolean | undefined;
1399
2298
  } | null | undefined;
2299
+ builder?: {
2300
+ address: _polymarket_types.EvmAddress;
2301
+ feeRate: DecimalString;
2302
+ } | undefined;
1400
2303
  }>>>;
1401
2304
  /**
1402
2305
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1416,6 +2319,7 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
1416
2319
  created_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1417
2320
  updated_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1418
2321
  client_order_id: z.ZodOptional<z.ZodString>;
2322
+ chid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>>;
1419
2323
  tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
1420
2324
  kind: z.ZodEnum<typeof PerpsTpSlKind>;
1421
2325
  scope: z.ZodEnum<typeof PerpsTpSlScope>;
@@ -1423,6 +2327,10 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
1423
2327
  parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1424
2328
  armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1425
2329
  slip_bps: z.ZodOptional<z.ZodNumber>;
2330
+ trail_bps: z.ZodOptional<z.ZodNumber>;
2331
+ act: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2332
+ trail_anchor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2333
+ trail_active: z.ZodOptional<z.ZodBoolean>;
1426
2334
  }, z.core.$strip>, z.ZodTransform<{
1427
2335
  kind: PerpsTpSlKind;
1428
2336
  scope: PerpsTpSlScope;
@@ -1430,6 +2338,10 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
1430
2338
  parentOrderId: PerpsOrderId | undefined;
1431
2339
  armedQuantity: DecimalString | undefined;
1432
2340
  slippageBps: number | undefined;
2341
+ trailingBps: number | undefined;
2342
+ activationPrice: DecimalString | undefined;
2343
+ trailingAnchor: DecimalString | undefined;
2344
+ trailingActive: boolean | undefined;
1433
2345
  }, {
1434
2346
  kind: PerpsTpSlKind;
1435
2347
  scope: PerpsTpSlScope;
@@ -1437,8 +2349,39 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
1437
2349
  parent_oid?: PerpsOrderId | undefined;
1438
2350
  armed_qty?: DecimalString | undefined;
1439
2351
  slip_bps?: number | undefined;
2352
+ trail_bps?: number | undefined;
2353
+ act?: DecimalString | undefined;
2354
+ trail_anchor?: DecimalString | undefined;
2355
+ trail_active?: boolean | undefined;
1440
2356
  }>>>>;
2357
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2358
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2359
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2360
+ }, z.core.$strip>, z.ZodTransform<{
2361
+ address: _polymarket_types.EvmAddress;
2362
+ feeRate: DecimalString;
2363
+ }, {
2364
+ address: _polymarket_types.EvmAddress;
2365
+ fee_rate: DecimalString;
2366
+ }>>>;
1441
2367
  }, z.core.$strip>, z.ZodTransform<{
2368
+ builder?: {
2369
+ address: _polymarket_types.EvmAddress;
2370
+ feeRate: DecimalString;
2371
+ } | undefined;
2372
+ tpSl: {
2373
+ kind: PerpsTpSlKind;
2374
+ scope: PerpsTpSlScope;
2375
+ triggerPrice: DecimalString;
2376
+ parentOrderId: PerpsOrderId | undefined;
2377
+ armedQuantity: DecimalString | undefined;
2378
+ slippageBps: number | undefined;
2379
+ trailingBps: number | undefined;
2380
+ activationPrice: DecimalString | undefined;
2381
+ trailingAnchor: DecimalString | undefined;
2382
+ trailingActive: boolean | undefined;
2383
+ } | undefined;
2384
+ chaseId?: PerpsChaseId | undefined;
1442
2385
  id: PerpsOrderId;
1443
2386
  instrumentId: PerpsInstrumentId;
1444
2387
  side: OrderSide;
@@ -1453,14 +2396,6 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
1453
2396
  createdTimestamp: EpochMilliseconds;
1454
2397
  updatedTimestamp: EpochMilliseconds;
1455
2398
  clientOrderId: string | undefined;
1456
- tpSl: {
1457
- kind: PerpsTpSlKind;
1458
- scope: PerpsTpSlScope;
1459
- triggerPrice: DecimalString;
1460
- parentOrderId: PerpsOrderId | undefined;
1461
- armedQuantity: DecimalString | undefined;
1462
- slippageBps: number | undefined;
1463
- } | undefined;
1464
2399
  }, {
1465
2400
  order_id: PerpsOrderId;
1466
2401
  instrument_id: PerpsInstrumentId;
@@ -1476,6 +2411,7 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
1476
2411
  created_timestamp: EpochMilliseconds;
1477
2412
  updated_timestamp: EpochMilliseconds;
1478
2413
  client_order_id?: string | undefined;
2414
+ chid?: PerpsChaseId | undefined;
1479
2415
  tpsl?: {
1480
2416
  kind: PerpsTpSlKind;
1481
2417
  scope: PerpsTpSlScope;
@@ -1483,7 +2419,15 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
1483
2419
  parentOrderId: PerpsOrderId | undefined;
1484
2420
  armedQuantity: DecimalString | undefined;
1485
2421
  slippageBps: number | undefined;
2422
+ trailingBps: number | undefined;
2423
+ activationPrice: DecimalString | undefined;
2424
+ trailingAnchor: DecimalString | undefined;
2425
+ trailingActive: boolean | undefined;
1486
2426
  } | null | undefined;
2427
+ builder?: {
2428
+ address: _polymarket_types.EvmAddress;
2429
+ feeRate: DecimalString;
2430
+ } | undefined;
1487
2431
  }>>>;
1488
2432
  /**
1489
2433
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1503,6 +2447,7 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
1503
2447
  cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1504
2448
  uts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1505
2449
  coid: z.ZodOptional<z.ZodString>;
2450
+ chid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsChaseId, number>>>;
1506
2451
  tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
1507
2452
  kind: z.ZodEnum<typeof PerpsTpSlKind>;
1508
2453
  scope: z.ZodEnum<typeof PerpsTpSlScope>;
@@ -1510,6 +2455,10 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
1510
2455
  parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1511
2456
  armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1512
2457
  slip_bps: z.ZodOptional<z.ZodNumber>;
2458
+ trail_bps: z.ZodOptional<z.ZodNumber>;
2459
+ act: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2460
+ trail_anchor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2461
+ trail_active: z.ZodOptional<z.ZodBoolean>;
1513
2462
  }, z.core.$strip>, z.ZodTransform<{
1514
2463
  kind: PerpsTpSlKind;
1515
2464
  scope: PerpsTpSlScope;
@@ -1517,6 +2466,10 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
1517
2466
  parentOrderId: PerpsOrderId | undefined;
1518
2467
  armedQuantity: DecimalString | undefined;
1519
2468
  slippageBps: number | undefined;
2469
+ trailingBps: number | undefined;
2470
+ activationPrice: DecimalString | undefined;
2471
+ trailingAnchor: DecimalString | undefined;
2472
+ trailingActive: boolean | undefined;
1520
2473
  }, {
1521
2474
  kind: PerpsTpSlKind;
1522
2475
  scope: PerpsTpSlScope;
@@ -1524,8 +2477,39 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
1524
2477
  parent_oid?: PerpsOrderId | undefined;
1525
2478
  armed_qty?: DecimalString | undefined;
1526
2479
  slip_bps?: number | undefined;
2480
+ trail_bps?: number | undefined;
2481
+ act?: DecimalString | undefined;
2482
+ trail_anchor?: DecimalString | undefined;
2483
+ trail_active?: boolean | undefined;
1527
2484
  }>>>>;
2485
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2486
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2487
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2488
+ }, z.core.$strip>, z.ZodTransform<{
2489
+ address: _polymarket_types.EvmAddress;
2490
+ feeRate: DecimalString;
2491
+ }, {
2492
+ address: _polymarket_types.EvmAddress;
2493
+ fee_rate: DecimalString;
2494
+ }>>>;
1528
2495
  }, z.core.$strip>, z.ZodTransform<{
2496
+ builder?: {
2497
+ address: _polymarket_types.EvmAddress;
2498
+ feeRate: DecimalString;
2499
+ } | undefined;
2500
+ tpSl: {
2501
+ kind: PerpsTpSlKind;
2502
+ scope: PerpsTpSlScope;
2503
+ triggerPrice: DecimalString;
2504
+ parentOrderId: PerpsOrderId | undefined;
2505
+ armedQuantity: DecimalString | undefined;
2506
+ slippageBps: number | undefined;
2507
+ trailingBps: number | undefined;
2508
+ activationPrice: DecimalString | undefined;
2509
+ trailingAnchor: DecimalString | undefined;
2510
+ trailingActive: boolean | undefined;
2511
+ } | undefined;
2512
+ chaseId?: PerpsChaseId | undefined;
1529
2513
  id: PerpsOrderId;
1530
2514
  instrumentId: PerpsInstrumentId;
1531
2515
  side: OrderSide;
@@ -1540,14 +2524,6 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
1540
2524
  createdTimestamp: EpochMilliseconds;
1541
2525
  updatedTimestamp: EpochMilliseconds;
1542
2526
  clientOrderId: string | undefined;
1543
- tpSl: {
1544
- kind: PerpsTpSlKind;
1545
- scope: PerpsTpSlScope;
1546
- triggerPrice: DecimalString;
1547
- parentOrderId: PerpsOrderId | undefined;
1548
- armedQuantity: DecimalString | undefined;
1549
- slippageBps: number | undefined;
1550
- } | undefined;
1551
2527
  }, {
1552
2528
  oid: PerpsOrderId;
1553
2529
  iid: PerpsInstrumentId;
@@ -1563,6 +2539,7 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
1563
2539
  cts: EpochMilliseconds;
1564
2540
  uts: EpochMilliseconds;
1565
2541
  coid?: string | undefined;
2542
+ chid?: PerpsChaseId | undefined;
1566
2543
  tpsl?: {
1567
2544
  kind: PerpsTpSlKind;
1568
2545
  scope: PerpsTpSlScope;
@@ -1570,7 +2547,15 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
1570
2547
  parentOrderId: PerpsOrderId | undefined;
1571
2548
  armedQuantity: DecimalString | undefined;
1572
2549
  slippageBps: number | undefined;
2550
+ trailingBps: number | undefined;
2551
+ activationPrice: DecimalString | undefined;
2552
+ trailingAnchor: DecimalString | undefined;
2553
+ trailingActive: boolean | undefined;
1573
2554
  } | null | undefined;
2555
+ builder?: {
2556
+ address: _polymarket_types.EvmAddress;
2557
+ feeRate: DecimalString;
2558
+ } | undefined;
1574
2559
  }>>;
1575
2560
  /**
1576
2561
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1580,10 +2565,23 @@ declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
1580
2565
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
1581
2566
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1582
2567
  side: z.ZodEnum<typeof PerpsSide>;
2568
+ settlement: z.ZodDefault<z.ZodBoolean>;
1583
2569
  price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1584
2570
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1585
2571
  taker: z.ZodBoolean;
1586
- fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2572
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2573
+ builder_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2574
+ total_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2575
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2576
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2577
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2578
+ }, z.core.$strip>, z.ZodTransform<{
2579
+ address: _polymarket_types.EvmAddress;
2580
+ feeRate: DecimalString;
2581
+ }, {
2582
+ address: _polymarket_types.EvmAddress;
2583
+ fee_rate: DecimalString;
2584
+ }>>>;
1587
2585
  fee_asset: z.ZodString;
1588
2586
  previous_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1589
2587
  previous_entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -1592,26 +2590,38 @@ declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
1592
2590
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1593
2591
  hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
1594
2592
  }, z.core.$strip>, z.ZodTransform<{
2593
+ feeAsset: string;
2594
+ previousSize: DecimalString;
2595
+ previousEntryPrice: DecimalString;
2596
+ pnl: DecimalString;
2597
+ liquidation: boolean;
2598
+ timestamp: EpochMilliseconds;
2599
+ hash: _polymarket_types.TxHash | undefined;
2600
+ builder?: {
2601
+ address: _polymarket_types.EvmAddress;
2602
+ feeRate: DecimalString;
2603
+ } | undefined;
1595
2604
  tradeId: PerpsTradeId;
1596
2605
  orderId: PerpsOrderId;
1597
2606
  instrumentId: PerpsInstrumentId;
1598
2607
  side: PerpsSide;
2608
+ /** True for a position close at instrument settlement; false on older responses. */
2609
+ settlement: boolean;
1599
2610
  price: DecimalString;
1600
2611
  quantity: DecimalString;
1601
2612
  taker: boolean;
2613
+ /** Exchange fee for this fill, excluding any builder fee. */
1602
2614
  fee: DecimalString;
1603
- feeAsset: string;
1604
- previousSize: DecimalString;
1605
- previousEntryPrice: DecimalString;
1606
- pnl: DecimalString;
1607
- liquidation: boolean;
1608
- timestamp: EpochMilliseconds;
1609
- hash: _polymarket_types.TxHash | undefined;
2615
+ /** Builder fee charged in addition to `fee`; zero without one. */
2616
+ builderFee: DecimalString;
2617
+ /** Sum of `fee` and `builderFee`. */
2618
+ totalFee: DecimalString;
1610
2619
  }, {
1611
2620
  trade_id: PerpsTradeId;
1612
2621
  order_id: PerpsOrderId;
1613
2622
  instrument_id: PerpsInstrumentId;
1614
2623
  side: PerpsSide;
2624
+ settlement: boolean;
1615
2625
  price: DecimalString;
1616
2626
  quantity: DecimalString;
1617
2627
  taker: boolean;
@@ -1622,6 +2632,12 @@ declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
1622
2632
  pnl: DecimalString;
1623
2633
  liquidation: boolean;
1624
2634
  timestamp: EpochMilliseconds;
2635
+ builder_fee?: DecimalString | undefined;
2636
+ total_fee?: DecimalString | undefined;
2637
+ builder?: {
2638
+ address: _polymarket_types.EvmAddress;
2639
+ feeRate: DecimalString;
2640
+ } | undefined;
1625
2641
  hash?: _polymarket_types.TxHash | undefined;
1626
2642
  }>>;
1627
2643
  /**
@@ -1637,10 +2653,23 @@ declare const ListPerpsFillsResponseSchema: z.ZodObject<{
1637
2653
  order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
1638
2654
  instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1639
2655
  side: z.ZodEnum<typeof PerpsSide>;
2656
+ settlement: z.ZodDefault<z.ZodBoolean>;
1640
2657
  price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1641
2658
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1642
2659
  taker: z.ZodBoolean;
1643
- fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2660
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2661
+ builder_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2662
+ total_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2663
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2664
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2665
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2666
+ }, z.core.$strip>, z.ZodTransform<{
2667
+ address: _polymarket_types.EvmAddress;
2668
+ feeRate: DecimalString;
2669
+ }, {
2670
+ address: _polymarket_types.EvmAddress;
2671
+ fee_rate: DecimalString;
2672
+ }>>>;
1644
2673
  fee_asset: z.ZodString;
1645
2674
  previous_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1646
2675
  previous_entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -1649,26 +2678,38 @@ declare const ListPerpsFillsResponseSchema: z.ZodObject<{
1649
2678
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1650
2679
  hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
1651
2680
  }, z.core.$strip>, z.ZodTransform<{
2681
+ feeAsset: string;
2682
+ previousSize: DecimalString;
2683
+ previousEntryPrice: DecimalString;
2684
+ pnl: DecimalString;
2685
+ liquidation: boolean;
2686
+ timestamp: EpochMilliseconds;
2687
+ hash: _polymarket_types.TxHash | undefined;
2688
+ builder?: {
2689
+ address: _polymarket_types.EvmAddress;
2690
+ feeRate: DecimalString;
2691
+ } | undefined;
1652
2692
  tradeId: PerpsTradeId;
1653
2693
  orderId: PerpsOrderId;
1654
2694
  instrumentId: PerpsInstrumentId;
1655
2695
  side: PerpsSide;
2696
+ /** True for a position close at instrument settlement; false on older responses. */
2697
+ settlement: boolean;
1656
2698
  price: DecimalString;
1657
2699
  quantity: DecimalString;
1658
2700
  taker: boolean;
2701
+ /** Exchange fee for this fill, excluding any builder fee. */
1659
2702
  fee: DecimalString;
1660
- feeAsset: string;
1661
- previousSize: DecimalString;
1662
- previousEntryPrice: DecimalString;
1663
- pnl: DecimalString;
1664
- liquidation: boolean;
1665
- timestamp: EpochMilliseconds;
1666
- hash: _polymarket_types.TxHash | undefined;
2703
+ /** Builder fee charged in addition to `fee`; zero without one. */
2704
+ builderFee: DecimalString;
2705
+ /** Sum of `fee` and `builderFee`. */
2706
+ totalFee: DecimalString;
1667
2707
  }, {
1668
2708
  trade_id: PerpsTradeId;
1669
2709
  order_id: PerpsOrderId;
1670
2710
  instrument_id: PerpsInstrumentId;
1671
2711
  side: PerpsSide;
2712
+ settlement: boolean;
1672
2713
  price: DecimalString;
1673
2714
  quantity: DecimalString;
1674
2715
  taker: boolean;
@@ -1679,6 +2720,12 @@ declare const ListPerpsFillsResponseSchema: z.ZodObject<{
1679
2720
  pnl: DecimalString;
1680
2721
  liquidation: boolean;
1681
2722
  timestamp: EpochMilliseconds;
2723
+ builder_fee?: DecimalString | undefined;
2724
+ total_fee?: DecimalString | undefined;
2725
+ builder?: {
2726
+ address: _polymarket_types.EvmAddress;
2727
+ feeRate: DecimalString;
2728
+ } | undefined;
1682
2729
  hash?: _polymarket_types.TxHash | undefined;
1683
2730
  }>>>;
1684
2731
  more: z.ZodBoolean;
@@ -1691,10 +2738,23 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
1691
2738
  oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
1692
2739
  iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1693
2740
  side: z.ZodEnum<typeof PerpsSide>;
2741
+ settlement: z.ZodDefault<z.ZodBoolean>;
1694
2742
  p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1695
2743
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1696
2744
  taker: z.ZodBoolean;
1697
- fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2745
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2746
+ builder_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2747
+ total_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2748
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2749
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2750
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2751
+ }, z.core.$strip>, z.ZodTransform<{
2752
+ address: _polymarket_types.EvmAddress;
2753
+ feeRate: DecimalString;
2754
+ }, {
2755
+ address: _polymarket_types.EvmAddress;
2756
+ fee_rate: DecimalString;
2757
+ }>>>;
1698
2758
  fea: z.ZodString;
1699
2759
  psz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1700
2760
  pep: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -1703,26 +2763,38 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
1703
2763
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1704
2764
  coid: z.ZodOptional<z.ZodString>;
1705
2765
  }, z.core.$strip>, z.ZodTransform<{
2766
+ feeAsset: string;
2767
+ previousSize: DecimalString;
2768
+ previousEntryPrice: DecimalString;
2769
+ pnl: DecimalString;
2770
+ liquidation: boolean;
2771
+ timestamp: EpochMilliseconds;
2772
+ clientOrderId: string | undefined;
2773
+ builder?: {
2774
+ address: _polymarket_types.EvmAddress;
2775
+ feeRate: DecimalString;
2776
+ } | undefined;
1706
2777
  tradeId: PerpsTradeId;
1707
2778
  orderId: PerpsOrderId;
1708
2779
  instrumentId: PerpsInstrumentId;
1709
2780
  side: PerpsSide;
2781
+ /** True for a position close at instrument settlement; false on older responses. */
2782
+ settlement: boolean;
1710
2783
  price: DecimalString;
1711
2784
  quantity: DecimalString;
1712
2785
  taker: boolean;
2786
+ /** Exchange fee for this fill, excluding any builder fee. */
1713
2787
  fee: DecimalString;
1714
- feeAsset: string;
1715
- previousSize: DecimalString;
1716
- previousEntryPrice: DecimalString;
1717
- pnl: DecimalString;
1718
- liquidation: boolean;
1719
- timestamp: EpochMilliseconds;
1720
- clientOrderId: string | undefined;
2788
+ /** Builder fee charged in addition to `fee`; zero without one. */
2789
+ builderFee: DecimalString;
2790
+ /** Sum of `fee` and `builderFee`. */
2791
+ totalFee: DecimalString;
1721
2792
  }, {
1722
2793
  tid: PerpsTradeId;
1723
2794
  oid: PerpsOrderId;
1724
2795
  iid: PerpsInstrumentId;
1725
2796
  side: PerpsSide;
2797
+ settlement: boolean;
1726
2798
  p: DecimalString;
1727
2799
  qty: DecimalString;
1728
2800
  taker: boolean;
@@ -1733,7 +2805,13 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
1733
2805
  pnl: DecimalString;
1734
2806
  liq: boolean;
1735
2807
  ts: EpochMilliseconds;
2808
+ builder_fee?: DecimalString | undefined;
2809
+ total_fee?: DecimalString | undefined;
2810
+ builder?: {
2811
+ address: _polymarket_types.EvmAddress;
2812
+ feeRate: DecimalString;
2813
+ } | undefined;
1736
2814
  coid?: string | undefined;
1737
2815
  }>>;
1738
2816
 
1739
- export { PerpsMarginType as $, PerpsCommandStatusSchema as A, type PerpsCredentials as B, PerpsDataResponseSchema as C, type PerpsDecimal as D, type PerpsDecimalInput as E, FetchPerpsOpenOrdersResponseSchema as F, PerpsDecimalInputSchema as G, type PerpsDepositAmount as H, PerpsDepositStatusSchema as I, PerpsEntityIdSchema as J, type PerpsFundingInterval as K, ListPerpsFillsResponseSchema as L, MarkPerpsNotificationsReadResponseSchema as M, PerpsFundingIntervalSchema as N, PerpsFundingPaymentIdSchema as O, type PerpsInstrumentId as P, PerpsInstrumentCategorySchema as Q, PerpsInstrumentIdSchema as R, PerpsInstrumentTypeSchema as S, PerpsInternalTransferDirectionSchema as T, PerpsInternalTransferIdSchema as U, PerpsKlineInterval as V, PerpsKlineIntervalSchema as W, type PerpsLimitOrderCanceledNotification as X, PerpsLimitOrderCanceledNotificationSchema as Y, type PerpsLiquidationWarningNotification as Z, PerpsLiquidationWarningNotificationSchema as _, type PerpsEntityId as a, PerpsMarginTypeSchema as a0, type PerpsNotification as a1, type PerpsNotificationEntry as a2, PerpsNotificationEntrySchema as a3, type PerpsNotificationId as a4, PerpsNotificationIdSchema as a5, PerpsNotificationOrderType as a6, PerpsNotificationOrderTypeSchema as a7, PerpsNotificationSchema as a8, PerpsNotificationType as a9, PerpsTpSlOrderFieldsSchema as aA, PerpsTpSlScope as aB, PerpsTpSlScopeSchema as aC, PerpsTradeIdSchema as aD, type PerpsTxHash as aE, PerpsTxHashSchema as aF, type PerpsUpdateLeverageResult as aG, PerpsUpdateLeverageResultSchema as aH, type PerpsWithdrawalAmount as aI, PerpsWithdrawalIdSchema as aJ, type PerpsWithdrawalStatus as aK, PerpsWithdrawalStatusSchema as aL, decimalString as aM, perpsBaseUnits as aN, perpsDecimal as aO, PerpsNotificationTypeSchema as aa, type PerpsOrder as ab, type PerpsOrderId as ac, PerpsOrderIdSchema as ad, PerpsOrderSchema as ae, PerpsOrderStatus as af, PerpsOrderStatusSchema as ag, PerpsOrderUpdateSchema as ah, PerpsPnlInterval as ai, PerpsPnlIntervalSchema as aj, type PerpsPositionChangeNotification as ak, PerpsPositionChangeNotificationSchema as al, type PerpsPositionClosedNotification as am, PerpsPositionClosedNotificationSchema as an, type PerpsPositionLiquidatedNotification as ao, PerpsPositionLiquidatedNotificationSchema as ap, type PerpsPostOrderAck as aq, PerpsPostOrderAckSchema as ar, PerpsSideSchema as as, PerpsSortDirection as at, PerpsSortDirectionSchema as au, PerpsTimeInForce as av, PerpsTimeInForceSchema as aw, PerpsTpSlKind as ax, PerpsTpSlKindSchema as ay, type PerpsTpSlOrderFields as az, type PerpsFundingPaymentId as b, PerpsDepositStatus as c, type PerpsWithdrawalId as d, PerpsKnownWithdrawalStatus as e, type PerpsInternalTransferId as f, PerpsInternalTransferDirection as g, PerpsInstrumentType as h, PerpsInstrumentCategory as i, type PerpsTradeId as j, PerpsSide as k, FetchPerpsOrdersResponseSchema as l, FetchPerpsUnreadNotificationsCountResponseSchema as m, ListPerpsNotificationsResponseSchema as n, type PerpsAccountFill as o, PerpsAccountFillSchema as p, PerpsAccountFillUpdateSchema as q, PerpsAssetSchema as r, type PerpsCancelAllOrdersResponse as s, PerpsCancelAllOrdersResponseSchema as t, type PerpsCancelOrderResult as u, PerpsCancelOrderResultSchema as v, type PerpsClientOrderId as w, PerpsClientOrderIdSchema as x, type PerpsCommandAck as y, PerpsCommandAckSchema as z };
2817
+ export { PerpsBuilderStatusSchema as $, FetchPerpsChasesResponseSchema as A, FetchPerpsOpenOrdersResponseSchema as B, CreatePerpsChaseResponseSchema as C, FetchPerpsOrdersResponseSchema as D, FetchPerpsUnreadNotificationsCountResponseSchema as E, FetchPerpsBuilderApprovalsResponseSchema as F, ListPerpsFillsResponseSchema as G, ListPerpsNotificationsResponseSchema as H, type PerpsAccountFill as I, PerpsAccountFillSchema as J, PerpsAccountFillUpdateSchema as K, ListPerpsBuilderEarningsResponseSchema as L, MarkPerpsNotificationsReadResponseSchema as M, PerpsAssetSchema as N, type PerpsBuilderApproval as O, type PerpsInstrumentId as P, PerpsBuilderApprovalSchema as Q, type PerpsBuilderEarning as R, PerpsBuilderEarningIdSchema as S, PerpsBuilderEarningSchema as T, type PerpsBuilderEarningsAsset as U, PerpsBuilderEarningsAssetSchema as V, type PerpsBuilderEarningsSnapshot as W, PerpsBuilderEarningsSnapshotSchema as X, type PerpsBuilderEarningsSummary as Y, PerpsBuilderEarningsSummarySchema as Z, type PerpsBuilderStatus as _, type PerpsBuilderEarningId as a, PerpsPositionLiquidatedNotificationSchema as a$, type PerpsBuilderTerms as a0, PerpsBuilderTermsSchema as a1, type PerpsCancelAllOrdersResponse as a2, PerpsCancelAllOrdersResponseSchema as a3, type PerpsCancelOrderErrorCode as a4, PerpsCancelOrderErrorCodeSchema as a5, type PerpsCancelOrderResult as a6, PerpsCancelOrderResultSchema as a7, type PerpsChase as a8, type PerpsChaseAccepted as a9, PerpsKnownCancelOrderErrorCode as aA, type PerpsLimitOrderCanceledNotification as aB, PerpsLimitOrderCanceledNotificationSchema as aC, type PerpsLiquidationWarningNotification as aD, PerpsLiquidationWarningNotificationSchema as aE, PerpsMarginTypeSchema as aF, type PerpsNotification as aG, type PerpsNotificationEntry as aH, PerpsNotificationEntrySchema as aI, PerpsNotificationIdSchema as aJ, PerpsNotificationOrderTypeSchema as aK, PerpsNotificationSchema as aL, PerpsNotificationTypeSchema as aM, type PerpsOrder as aN, PerpsOrderIdSchema as aO, PerpsOrderSchema as aP, PerpsOrderStatusSchema as aQ, PerpsOrderUpdateSchema as aR, PerpsPnlInterval as aS, PerpsPnlIntervalSchema as aT, type PerpsPositionChangeNotification as aU, PerpsPositionChangeNotificationSchema as aV, type PerpsPositionClosedNotification as aW, PerpsPositionClosedNotificationSchema as aX, type PerpsPositionDeleveragedNotification as aY, PerpsPositionDeleveragedNotificationSchema as aZ, type PerpsPositionLiquidatedNotification as a_, PerpsChaseAcceptedSchema as aa, PerpsChaseIdSchema as ab, PerpsChaseSchema as ac, PerpsClientOrderIdSchema as ad, type PerpsCommandAck as ae, PerpsCommandAckSchema as af, PerpsCommandStatusSchema as ag, type PerpsCredentials as ah, PerpsDataResponseSchema as ai, type PerpsDecimal as aj, type PerpsDecimalInput as ak, PerpsDecimalInputSchema as al, type PerpsDepositAmount as am, PerpsDepositStatusSchema as an, PerpsEntityIdSchema as ao, type PerpsFundingInterval as ap, PerpsFundingIntervalSchema as aq, PerpsFundingPaymentIdSchema as ar, PerpsInstrumentCategorySchema as as, PerpsInstrumentIdSchema as at, PerpsInstrumentTypeSchema as au, PerpsInternalTransferDirectionSchema as av, PerpsInternalTransferIdSchema as aw, type PerpsInternalTransferType as ax, PerpsInternalTransferTypeSchema as ay, PerpsKlineIntervalSchema as az, type PerpsTradeId as b, type PerpsPostOrderAck as b0, PerpsPostOrderAckSchema as b1, PerpsSideSchema as b2, PerpsSortDirection as b3, PerpsSortDirectionSchema as b4, PerpsTimeInForceSchema as b5, PerpsTpSlKindSchema as b6, type PerpsTpSlOrderFields as b7, PerpsTpSlOrderFieldsSchema as b8, PerpsTpSlScopeSchema as b9, PerpsTradeIdSchema as ba, type PerpsTxHash as bb, PerpsTxHashSchema as bc, type PerpsUpdateLeverageBatchResult as bd, PerpsUpdateLeverageBatchResultSchema as be, type PerpsUpdateLeverageRejection as bf, PerpsUpdateLeverageRejectionSchema as bg, type PerpsUpdateLeverageResult as bh, PerpsUpdateLeverageResultSchema as bi, type PerpsWithdrawalAmount as bj, PerpsWithdrawalIdSchema as bk, type PerpsWithdrawalStatus as bl, PerpsWithdrawalStatusSchema as bm, decimalString as bn, perpsBaseUnits as bo, perpsDecimal as bp, type PerpsOrderId as c, type PerpsClientOrderId as d, PerpsLiquidityRole as e, PerpsKlineInterval as f, PerpsDepositStatus as g, PerpsSide as h, type PerpsFundingPaymentId as i, type PerpsNotificationId as j, PerpsNotificationType as k, PerpsNotificationOrderType as l, PerpsMarginType as m, PerpsTimeInForce as n, PerpsOrderStatus as o, type PerpsChaseId as p, PerpsTpSlKind as q, PerpsTpSlScope as r, type PerpsWithdrawalId as s, PerpsKnownWithdrawalStatus as t, type PerpsEntityId as u, type PerpsInternalTransferId as v, PerpsKnownInternalTransferType as w, PerpsInternalTransferDirection as x, PerpsInstrumentType as y, PerpsInstrumentCategory as z };