@polymarket/bindings 0.10.0 → 0.12.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
  */
@@ -170,6 +179,28 @@ declare enum PerpsKnownWithdrawalStatus {
170
179
  * @experimental This API may change in a breaking way in any release, including patch releases.
171
180
  */
172
181
  type PerpsWithdrawalStatus = PerpsKnownWithdrawalStatus | (string & {});
182
+ /**
183
+ * Known internal-transfer classifications.
184
+ *
185
+ * The service evolves this set independently of released clients, so
186
+ * transfer parsing accepts unknown classifications as plain strings; see
187
+ * {@link PerpsInternalTransferType}.
188
+ *
189
+ * @experimental This API may change in a breaking way in any release, including patch releases.
190
+ */
191
+ declare enum PerpsKnownInternalTransferType {
192
+ Transfer = "transfer",
193
+ ReferralPayout = "referral_payout"
194
+ }
195
+ /**
196
+ * An internal-transfer classification. Known values are enumerated in
197
+ * {@link PerpsKnownInternalTransferType}; newly introduced values flow through
198
+ * as plain strings so they can be handled before a client release that
199
+ * enumerates them.
200
+ *
201
+ * @experimental This API may change in a breaking way in any release, including patch releases.
202
+ */
203
+ type PerpsInternalTransferType = PerpsKnownInternalTransferType | (string & {});
173
204
  /**
174
205
  * @experimental This API may change in a breaking way in any release, including patch releases.
175
206
  */
@@ -238,6 +269,10 @@ declare const PerpsDepositStatusSchema: z.ZodEnum<typeof PerpsDepositStatus>;
238
269
  * @experimental This API may change in a breaking way in any release, including patch releases.
239
270
  */
240
271
  declare const PerpsWithdrawalStatusSchema: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownWithdrawalStatus, string>>;
272
+ /**
273
+ * @experimental This API may change in a breaking way in any release, including patch releases.
274
+ */
275
+ declare const PerpsInternalTransferTypeSchema: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownInternalTransferType, string>>;
241
276
  /**
242
277
  * @experimental This API may change in a breaking way in any release, including patch releases.
243
278
  */
@@ -307,6 +342,384 @@ declare function perpsBaseUnits(value: string): BaseUnits;
307
342
  */
308
343
  declare function decimalString(value: string): DecimalString;
309
344
 
345
+ /**
346
+ * Saved attribution and the decimal fraction charged on executed notional.
347
+ * @experimental This API may change in a breaking way in any release, including patch releases.
348
+ */
349
+ declare const PerpsBuilderTermsSchema: z.ZodPipe<z.ZodObject<{
350
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
351
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
352
+ }, z.core.$strip>, z.ZodTransform<{
353
+ address: _polymarket_types.EvmAddress;
354
+ feeRate: DecimalString;
355
+ }, {
356
+ address: _polymarket_types.EvmAddress;
357
+ fee_rate: DecimalString;
358
+ }>>;
359
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
360
+ type PerpsBuilderTerms = z.infer<typeof PerpsBuilderTermsSchema>;
361
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
362
+ declare const PerpsBuilderStatusSchema: z.ZodPipe<z.ZodObject<{
363
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
364
+ registered: z.ZodBoolean;
365
+ enabled: z.ZodBoolean;
366
+ admission_enabled: z.ZodBoolean;
367
+ max_fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
368
+ }, z.core.$strip>, z.ZodTransform<{
369
+ address: _polymarket_types.EvmAddress;
370
+ registered: boolean;
371
+ enabled: boolean;
372
+ admissionEnabled: boolean;
373
+ maxFeeRate: DecimalString;
374
+ }, {
375
+ address: _polymarket_types.EvmAddress;
376
+ registered: boolean;
377
+ enabled: boolean;
378
+ admission_enabled: boolean;
379
+ max_fee_rate: DecimalString;
380
+ }>>;
381
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
382
+ type PerpsBuilderStatus = z.infer<typeof PerpsBuilderStatusSchema>;
383
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
384
+ declare const PerpsBuilderApprovalSchema: z.ZodPipe<z.ZodObject<{
385
+ trader: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
386
+ builder: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
387
+ max_fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
388
+ approval_version: z.ZodNumber;
389
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
390
+ sequence: z.ZodNumber;
391
+ }, z.core.$strip>, z.ZodTransform<{
392
+ trader: _polymarket_types.EvmAddress;
393
+ builder: _polymarket_types.EvmAddress;
394
+ maxFeeRate: DecimalString;
395
+ approvalVersion: number;
396
+ timestamp: EpochMilliseconds;
397
+ sequence: number;
398
+ }, {
399
+ trader: _polymarket_types.EvmAddress;
400
+ builder: _polymarket_types.EvmAddress;
401
+ max_fee_rate: DecimalString;
402
+ approval_version: number;
403
+ timestamp: EpochMilliseconds;
404
+ sequence: number;
405
+ }>>;
406
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
407
+ type PerpsBuilderApproval = z.infer<typeof PerpsBuilderApprovalSchema>;
408
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
409
+ declare const FetchPerpsBuilderApprovalsResponseSchema: z.ZodObject<{
410
+ data: z.ZodArray<z.ZodPipe<z.ZodObject<{
411
+ trader: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
412
+ builder: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
413
+ max_fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
414
+ approval_version: z.ZodNumber;
415
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
416
+ sequence: z.ZodNumber;
417
+ }, z.core.$strip>, z.ZodTransform<{
418
+ trader: _polymarket_types.EvmAddress;
419
+ builder: _polymarket_types.EvmAddress;
420
+ maxFeeRate: DecimalString;
421
+ approvalVersion: number;
422
+ timestamp: EpochMilliseconds;
423
+ sequence: number;
424
+ }, {
425
+ trader: _polymarket_types.EvmAddress;
426
+ builder: _polymarket_types.EvmAddress;
427
+ max_fee_rate: DecimalString;
428
+ approval_version: number;
429
+ timestamp: EpochMilliseconds;
430
+ sequence: number;
431
+ }>>>;
432
+ }, z.core.$strip>;
433
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
434
+ declare enum PerpsLiquidityRole {
435
+ Maker = "maker",
436
+ Taker = "taker"
437
+ }
438
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
439
+ declare const PerpsBuilderEarningSchema: z.ZodPipe<z.ZodObject<{
440
+ earning_id: z.ZodPipe<z.ZodString, z.ZodTransform<PerpsBuilderEarningId, string>>;
441
+ trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
442
+ order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
443
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
444
+ trader: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
445
+ buy: z.ZodBoolean;
446
+ price: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
447
+ quantity: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
448
+ client_order_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
449
+ side: z.ZodEnum<typeof PerpsLiquidityRole>;
450
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
451
+ sequence: z.ZodNumber;
452
+ notional: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
453
+ fee_asset: z.ZodString;
454
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
455
+ builder_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
456
+ total_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
457
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
458
+ }, z.core.$strip>, z.ZodTransform<{
459
+ liquidityRole: PerpsLiquidityRole;
460
+ timestamp: EpochMilliseconds;
461
+ sequence: number;
462
+ notional: DecimalString;
463
+ feeAsset: string;
464
+ /** Exchange fee for the fill, excluding the builder fee. */
465
+ fee: DecimalString;
466
+ /** Builder fee charged in addition to `fee` and credited to this builder. */
467
+ builderFee: DecimalString;
468
+ /** Sum of `fee` and `builderFee`. */
469
+ totalFee: DecimalString;
470
+ /** Builder fee rate for the fill, as a decimal fraction of `notional`. */
471
+ feeRate: DecimalString;
472
+ clientOrderId?: PerpsClientOrderId | undefined;
473
+ earningId: PerpsBuilderEarningId;
474
+ tradeId: PerpsTradeId;
475
+ orderId: PerpsOrderId;
476
+ instrumentId: PerpsInstrumentId;
477
+ trader: _polymarket_types.EvmAddress;
478
+ side: OrderSide;
479
+ price: DecimalString;
480
+ quantity: DecimalString;
481
+ }, {
482
+ earning_id: PerpsBuilderEarningId;
483
+ trade_id: PerpsTradeId;
484
+ order_id: PerpsOrderId;
485
+ instrument_id: PerpsInstrumentId;
486
+ trader: _polymarket_types.EvmAddress;
487
+ buy: boolean;
488
+ price: DecimalString;
489
+ quantity: DecimalString;
490
+ side: PerpsLiquidityRole;
491
+ timestamp: EpochMilliseconds;
492
+ sequence: number;
493
+ notional: DecimalString;
494
+ fee_asset: string;
495
+ fee: DecimalString;
496
+ builder_fee: DecimalString;
497
+ total_fee: DecimalString;
498
+ fee_rate: DecimalString;
499
+ client_order_id?: PerpsClientOrderId | undefined;
500
+ }>>;
501
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
502
+ type PerpsBuilderEarning = z.infer<typeof PerpsBuilderEarningSchema>;
503
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
504
+ declare const PerpsBuilderEarningsSnapshotSchema: z.ZodPipe<z.ZodObject<{
505
+ start_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
506
+ end_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
507
+ as_of_sequence: z.ZodNumber;
508
+ }, z.core.$strip>, z.ZodTransform<{
509
+ start: EpochMilliseconds;
510
+ end: EpochMilliseconds;
511
+ asOfSequence: number;
512
+ }, {
513
+ start_timestamp: EpochMilliseconds;
514
+ end_timestamp: EpochMilliseconds;
515
+ as_of_sequence: number;
516
+ }>>;
517
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
518
+ type PerpsBuilderEarningsSnapshot = z.infer<typeof PerpsBuilderEarningsSnapshotSchema>;
519
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
520
+ declare const ListPerpsBuilderEarningsResponseSchema: z.ZodPipe<z.ZodObject<{
521
+ start_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
522
+ end_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
523
+ as_of_sequence: z.ZodNumber;
524
+ data: z.ZodArray<z.ZodPipe<z.ZodObject<{
525
+ earning_id: z.ZodPipe<z.ZodString, z.ZodTransform<PerpsBuilderEarningId, string>>;
526
+ trade_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
527
+ order_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
528
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
529
+ trader: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
530
+ buy: z.ZodBoolean;
531
+ price: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
532
+ quantity: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
533
+ client_order_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
534
+ side: z.ZodEnum<typeof PerpsLiquidityRole>;
535
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
536
+ sequence: z.ZodNumber;
537
+ notional: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
538
+ fee_asset: z.ZodString;
539
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
540
+ builder_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
541
+ total_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
542
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
543
+ }, z.core.$strip>, z.ZodTransform<{
544
+ liquidityRole: PerpsLiquidityRole;
545
+ timestamp: EpochMilliseconds;
546
+ sequence: number;
547
+ notional: DecimalString;
548
+ feeAsset: string;
549
+ /** Exchange fee for the fill, excluding the builder fee. */
550
+ fee: DecimalString;
551
+ /** Builder fee charged in addition to `fee` and credited to this builder. */
552
+ builderFee: DecimalString;
553
+ /** Sum of `fee` and `builderFee`. */
554
+ totalFee: DecimalString;
555
+ /** Builder fee rate for the fill, as a decimal fraction of `notional`. */
556
+ feeRate: DecimalString;
557
+ clientOrderId?: PerpsClientOrderId | undefined;
558
+ earningId: PerpsBuilderEarningId;
559
+ tradeId: PerpsTradeId;
560
+ orderId: PerpsOrderId;
561
+ instrumentId: PerpsInstrumentId;
562
+ trader: _polymarket_types.EvmAddress;
563
+ side: OrderSide;
564
+ price: DecimalString;
565
+ quantity: DecimalString;
566
+ }, {
567
+ earning_id: PerpsBuilderEarningId;
568
+ trade_id: PerpsTradeId;
569
+ order_id: PerpsOrderId;
570
+ instrument_id: PerpsInstrumentId;
571
+ trader: _polymarket_types.EvmAddress;
572
+ buy: boolean;
573
+ price: DecimalString;
574
+ quantity: DecimalString;
575
+ side: PerpsLiquidityRole;
576
+ timestamp: EpochMilliseconds;
577
+ sequence: number;
578
+ notional: DecimalString;
579
+ fee_asset: string;
580
+ fee: DecimalString;
581
+ builder_fee: DecimalString;
582
+ total_fee: DecimalString;
583
+ fee_rate: DecimalString;
584
+ client_order_id?: PerpsClientOrderId | undefined;
585
+ }>>>;
586
+ more: z.ZodBoolean;
587
+ cursor: z.ZodOptional<z.ZodString>;
588
+ }, z.core.$strip>, z.ZodTransform<{
589
+ snapshot: {
590
+ start: EpochMilliseconds;
591
+ end: EpochMilliseconds;
592
+ asOfSequence: number;
593
+ };
594
+ cursor?: string | undefined;
595
+ data: {
596
+ liquidityRole: PerpsLiquidityRole;
597
+ timestamp: EpochMilliseconds;
598
+ sequence: number;
599
+ notional: DecimalString;
600
+ feeAsset: string;
601
+ /** Exchange fee for the fill, excluding the builder fee. */
602
+ fee: DecimalString;
603
+ /** Builder fee charged in addition to `fee` and credited to this builder. */
604
+ builderFee: DecimalString;
605
+ /** Sum of `fee` and `builderFee`. */
606
+ totalFee: DecimalString;
607
+ /** Builder fee rate for the fill, as a decimal fraction of `notional`. */
608
+ feeRate: DecimalString;
609
+ clientOrderId?: PerpsClientOrderId | undefined;
610
+ earningId: PerpsBuilderEarningId;
611
+ tradeId: PerpsTradeId;
612
+ orderId: PerpsOrderId;
613
+ instrumentId: PerpsInstrumentId;
614
+ trader: _polymarket_types.EvmAddress;
615
+ side: OrderSide;
616
+ price: DecimalString;
617
+ quantity: DecimalString;
618
+ }[];
619
+ more: boolean;
620
+ }, {
621
+ start_timestamp: EpochMilliseconds;
622
+ end_timestamp: EpochMilliseconds;
623
+ as_of_sequence: number;
624
+ data: {
625
+ liquidityRole: PerpsLiquidityRole;
626
+ timestamp: EpochMilliseconds;
627
+ sequence: number;
628
+ notional: DecimalString;
629
+ feeAsset: string;
630
+ /** Exchange fee for the fill, excluding the builder fee. */
631
+ fee: DecimalString;
632
+ /** Builder fee charged in addition to `fee` and credited to this builder. */
633
+ builderFee: DecimalString;
634
+ /** Sum of `fee` and `builderFee`. */
635
+ totalFee: DecimalString;
636
+ /** Builder fee rate for the fill, as a decimal fraction of `notional`. */
637
+ feeRate: DecimalString;
638
+ clientOrderId?: PerpsClientOrderId | undefined;
639
+ earningId: PerpsBuilderEarningId;
640
+ tradeId: PerpsTradeId;
641
+ orderId: PerpsOrderId;
642
+ instrumentId: PerpsInstrumentId;
643
+ trader: _polymarket_types.EvmAddress;
644
+ side: OrderSide;
645
+ price: DecimalString;
646
+ quantity: DecimalString;
647
+ }[];
648
+ more: boolean;
649
+ cursor?: string | undefined;
650
+ }>>;
651
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
652
+ declare const PerpsBuilderEarningsAssetSchema: z.ZodPipe<z.ZodObject<{
653
+ fee_asset: z.ZodString;
654
+ fill_count: z.ZodNumber;
655
+ notional: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
656
+ builder_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
657
+ }, z.core.$strip>, z.ZodTransform<{
658
+ feeAsset: string;
659
+ fillCount: number;
660
+ notional: DecimalString;
661
+ builderFee: DecimalString;
662
+ }, {
663
+ fee_asset: string;
664
+ fill_count: number;
665
+ notional: DecimalString;
666
+ builder_fee: DecimalString;
667
+ }>>;
668
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
669
+ type PerpsBuilderEarningsAsset = z.infer<typeof PerpsBuilderEarningsAssetSchema>;
670
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
671
+ declare const PerpsBuilderEarningsSummarySchema: z.ZodPipe<z.ZodObject<{
672
+ start_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
673
+ end_timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
674
+ as_of_sequence: z.ZodNumber;
675
+ data: z.ZodArray<z.ZodPipe<z.ZodObject<{
676
+ fee_asset: z.ZodString;
677
+ fill_count: z.ZodNumber;
678
+ notional: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
679
+ builder_fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
680
+ }, z.core.$strip>, z.ZodTransform<{
681
+ feeAsset: string;
682
+ fillCount: number;
683
+ notional: DecimalString;
684
+ builderFee: DecimalString;
685
+ }, {
686
+ fee_asset: string;
687
+ fill_count: number;
688
+ notional: DecimalString;
689
+ builder_fee: DecimalString;
690
+ }>>>;
691
+ trader_count: z.ZodNumber;
692
+ active_approval_count: z.ZodNumber;
693
+ }, z.core.$strip>, z.ZodTransform<{
694
+ assets: {
695
+ feeAsset: string;
696
+ fillCount: number;
697
+ notional: DecimalString;
698
+ builderFee: DecimalString;
699
+ }[];
700
+ traderCount: number;
701
+ activeApprovalCount: number;
702
+ snapshot: {
703
+ start: EpochMilliseconds;
704
+ end: EpochMilliseconds;
705
+ asOfSequence: number;
706
+ };
707
+ }, {
708
+ start_timestamp: EpochMilliseconds;
709
+ end_timestamp: EpochMilliseconds;
710
+ as_of_sequence: number;
711
+ data: {
712
+ feeAsset: string;
713
+ fillCount: number;
714
+ notional: DecimalString;
715
+ builderFee: DecimalString;
716
+ }[];
717
+ trader_count: number;
718
+ active_approval_count: number;
719
+ }>>;
720
+ /** @experimental This API may change in a breaking way in any release, including patch releases. */
721
+ type PerpsBuilderEarningsSummary = z.infer<typeof PerpsBuilderEarningsSummarySchema>;
722
+
310
723
  /**
311
724
  * @experimental This API may change in a breaking way in any release, including patch releases.
312
725
  */
@@ -1112,6 +1525,35 @@ declare const PerpsCommandStatusSchema: z.ZodEnum<{
1112
1525
  ok: "ok";
1113
1526
  err: "err";
1114
1527
  }>;
1528
+ /**
1529
+ * Known rejection identifiers returned when a Perps order cancellation fails.
1530
+ *
1531
+ * The service evolves this set independently of released clients, so
1532
+ * cancellation parsing accepts unknown identifiers as plain strings; see
1533
+ * {@link PerpsCancelOrderErrorCode}.
1534
+ *
1535
+ * @experimental This API may change in a breaking way in any release, including patch releases.
1536
+ */
1537
+ declare enum PerpsKnownCancelOrderErrorCode {
1538
+ OrderUnknown = "order_unknown",
1539
+ OrderNotInOrderbook = "order_not_in_orderbook",
1540
+ OrderInFlight = "order_in_flight",
1541
+ OrderNotPendingEngine = "order_not_pending_engine",
1542
+ OrderNotFound = "order_not_found"
1543
+ }
1544
+ /**
1545
+ * A Perps order cancellation rejection identifier. Known identifiers are
1546
+ * enumerated in {@link PerpsKnownCancelOrderErrorCode}; newly introduced
1547
+ * identifiers flow through as plain strings so they can be handled before a
1548
+ * client release that enumerates them.
1549
+ *
1550
+ * @experimental This API may change in a breaking way in any release, including patch releases.
1551
+ */
1552
+ type PerpsCancelOrderErrorCode = PerpsKnownCancelOrderErrorCode | (string & {});
1553
+ /**
1554
+ * @experimental This API may change in a breaking way in any release, including patch releases.
1555
+ */
1556
+ declare const PerpsCancelOrderErrorCodeSchema: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownCancelOrderErrorCode, string>>;
1115
1557
  /**
1116
1558
  * @experimental This API may change in a breaking way in any release, including patch releases.
1117
1559
  */
@@ -1136,12 +1578,25 @@ declare const PerpsPostOrderAckSchema: z.ZodPipe<z.ZodObject<{
1136
1578
  oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1137
1579
  coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
1138
1580
  error: z.ZodOptional<z.ZodString>;
1581
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
1582
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
1583
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1584
+ }, z.core.$strip>, z.ZodTransform<{
1585
+ address: _polymarket_types.EvmAddress;
1586
+ feeRate: DecimalString;
1587
+ }, {
1588
+ address: _polymarket_types.EvmAddress;
1589
+ fee_rate: DecimalString;
1590
+ }>>>;
1139
1591
  }, z.core.$strip>, z.ZodTransform<{
1140
1592
  status: "err";
1141
1593
  error: string;
1142
1594
  clientOrderId: PerpsClientOrderId | undefined;
1143
- orderId?: undefined;
1144
1595
  } | {
1596
+ builder?: {
1597
+ address: _polymarket_types.EvmAddress;
1598
+ feeRate: DecimalString;
1599
+ } | undefined;
1145
1600
  status: "ok";
1146
1601
  orderId: PerpsOrderId;
1147
1602
  clientOrderId: PerpsClientOrderId | undefined;
@@ -1151,6 +1606,10 @@ declare const PerpsPostOrderAckSchema: z.ZodPipe<z.ZodObject<{
1151
1606
  oid?: PerpsOrderId | undefined;
1152
1607
  coid?: PerpsClientOrderId | undefined;
1153
1608
  error?: string | undefined;
1609
+ builder?: {
1610
+ address: _polymarket_types.EvmAddress;
1611
+ feeRate: DecimalString;
1612
+ } | undefined;
1154
1613
  }>>;
1155
1614
  /**
1156
1615
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1159,17 +1618,18 @@ type PerpsPostOrderAck = z.infer<typeof PerpsPostOrderAckSchema>;
1159
1618
  /**
1160
1619
  * @experimental This API may change in a breaking way in any release, including patch releases.
1161
1620
  */
1162
- declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodObject<{
1163
- status: z.ZodEnum<{
1164
- ok: "ok";
1165
- err: "err";
1166
- }>;
1621
+ declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
1622
+ status: z.ZodLiteral<"ok">;
1167
1623
  oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1168
1624
  coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
1169
- error: z.ZodOptional<z.ZodString>;
1170
- }, z.core.$strip>, z.ZodTransform<{
1625
+ }, z.core.$strip>, z.ZodObject<{
1626
+ status: z.ZodLiteral<"err">;
1627
+ error: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | PerpsKnownCancelOrderErrorCode, string>>;
1628
+ oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
1629
+ coid: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PerpsClientOrderId, string>>>;
1630
+ }, z.core.$strip>], "status">, z.ZodTransform<{
1171
1631
  status: "err";
1172
- error: string;
1632
+ error: (string & {}) | PerpsKnownCancelOrderErrorCode;
1173
1633
  orderId: PerpsOrderId | undefined;
1174
1634
  clientOrderId: PerpsClientOrderId | undefined;
1175
1635
  } | {
@@ -1178,10 +1638,14 @@ declare const PerpsCancelOrderResultSchema: z.ZodPipe<z.ZodObject<{
1178
1638
  clientOrderId: PerpsClientOrderId | undefined;
1179
1639
  error?: undefined;
1180
1640
  }, {
1181
- status: "ok" | "err";
1641
+ status: "ok";
1642
+ oid?: PerpsOrderId | undefined;
1643
+ coid?: PerpsClientOrderId | undefined;
1644
+ } | {
1645
+ status: "err";
1646
+ error: (string & {}) | PerpsKnownCancelOrderErrorCode;
1182
1647
  oid?: PerpsOrderId | undefined;
1183
1648
  coid?: PerpsClientOrderId | undefined;
1184
- error?: string | undefined;
1185
1649
  }>>;
1186
1650
  /**
1187
1651
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1260,7 +1724,21 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
1260
1724
  armed_qty?: DecimalString | undefined;
1261
1725
  slip_bps?: number | undefined;
1262
1726
  }>>>>;
1727
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
1728
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
1729
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1730
+ }, z.core.$strip>, z.ZodTransform<{
1731
+ address: _polymarket_types.EvmAddress;
1732
+ feeRate: DecimalString;
1733
+ }, {
1734
+ address: _polymarket_types.EvmAddress;
1735
+ fee_rate: DecimalString;
1736
+ }>>>;
1263
1737
  }, z.core.$strip>, z.ZodTransform<{
1738
+ builder?: {
1739
+ address: _polymarket_types.EvmAddress;
1740
+ feeRate: DecimalString;
1741
+ } | undefined;
1264
1742
  id: PerpsOrderId;
1265
1743
  instrumentId: PerpsInstrumentId;
1266
1744
  side: OrderSide;
@@ -1306,6 +1784,10 @@ declare const PerpsOrderSchema: z.ZodPipe<z.ZodObject<{
1306
1784
  armedQuantity: DecimalString | undefined;
1307
1785
  slippageBps: number | undefined;
1308
1786
  } | null | undefined;
1787
+ builder?: {
1788
+ address: _polymarket_types.EvmAddress;
1789
+ feeRate: DecimalString;
1790
+ } | undefined;
1309
1791
  }>>;
1310
1792
  /**
1311
1793
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1351,7 +1833,21 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
1351
1833
  armed_qty?: DecimalString | undefined;
1352
1834
  slip_bps?: number | undefined;
1353
1835
  }>>>>;
1836
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
1837
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
1838
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1839
+ }, z.core.$strip>, z.ZodTransform<{
1840
+ address: _polymarket_types.EvmAddress;
1841
+ feeRate: DecimalString;
1842
+ }, {
1843
+ address: _polymarket_types.EvmAddress;
1844
+ fee_rate: DecimalString;
1845
+ }>>>;
1354
1846
  }, z.core.$strip>, z.ZodTransform<{
1847
+ builder?: {
1848
+ address: _polymarket_types.EvmAddress;
1849
+ feeRate: DecimalString;
1850
+ } | undefined;
1355
1851
  id: PerpsOrderId;
1356
1852
  instrumentId: PerpsInstrumentId;
1357
1853
  side: OrderSide;
@@ -1397,6 +1893,10 @@ declare const FetchPerpsOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
1397
1893
  armedQuantity: DecimalString | undefined;
1398
1894
  slippageBps: number | undefined;
1399
1895
  } | null | undefined;
1896
+ builder?: {
1897
+ address: _polymarket_types.EvmAddress;
1898
+ feeRate: DecimalString;
1899
+ } | undefined;
1400
1900
  }>>>;
1401
1901
  /**
1402
1902
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1438,7 +1938,21 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
1438
1938
  armed_qty?: DecimalString | undefined;
1439
1939
  slip_bps?: number | undefined;
1440
1940
  }>>>>;
1941
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
1942
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
1943
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
1944
+ }, z.core.$strip>, z.ZodTransform<{
1945
+ address: _polymarket_types.EvmAddress;
1946
+ feeRate: DecimalString;
1947
+ }, {
1948
+ address: _polymarket_types.EvmAddress;
1949
+ fee_rate: DecimalString;
1950
+ }>>>;
1441
1951
  }, z.core.$strip>, z.ZodTransform<{
1952
+ builder?: {
1953
+ address: _polymarket_types.EvmAddress;
1954
+ feeRate: DecimalString;
1955
+ } | undefined;
1442
1956
  id: PerpsOrderId;
1443
1957
  instrumentId: PerpsInstrumentId;
1444
1958
  side: OrderSide;
@@ -1484,6 +1998,10 @@ declare const FetchPerpsOpenOrdersResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObje
1484
1998
  armedQuantity: DecimalString | undefined;
1485
1999
  slippageBps: number | undefined;
1486
2000
  } | null | undefined;
2001
+ builder?: {
2002
+ address: _polymarket_types.EvmAddress;
2003
+ feeRate: DecimalString;
2004
+ } | undefined;
1487
2005
  }>>>;
1488
2006
  /**
1489
2007
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1525,7 +2043,21 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
1525
2043
  armed_qty?: DecimalString | undefined;
1526
2044
  slip_bps?: number | undefined;
1527
2045
  }>>>>;
2046
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2047
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2048
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2049
+ }, z.core.$strip>, z.ZodTransform<{
2050
+ address: _polymarket_types.EvmAddress;
2051
+ feeRate: DecimalString;
2052
+ }, {
2053
+ address: _polymarket_types.EvmAddress;
2054
+ fee_rate: DecimalString;
2055
+ }>>>;
1528
2056
  }, z.core.$strip>, z.ZodTransform<{
2057
+ builder?: {
2058
+ address: _polymarket_types.EvmAddress;
2059
+ feeRate: DecimalString;
2060
+ } | undefined;
1529
2061
  id: PerpsOrderId;
1530
2062
  instrumentId: PerpsInstrumentId;
1531
2063
  side: OrderSide;
@@ -1571,6 +2103,10 @@ declare const PerpsOrderUpdateSchema: z.ZodPipe<z.ZodObject<{
1571
2103
  armedQuantity: DecimalString | undefined;
1572
2104
  slippageBps: number | undefined;
1573
2105
  } | null | undefined;
2106
+ builder?: {
2107
+ address: _polymarket_types.EvmAddress;
2108
+ feeRate: DecimalString;
2109
+ } | undefined;
1574
2110
  }>>;
1575
2111
  /**
1576
2112
  * @experimental This API may change in a breaking way in any release, including patch releases.
@@ -1583,7 +2119,19 @@ declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
1583
2119
  price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1584
2120
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1585
2121
  taker: z.ZodBoolean;
1586
- fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2122
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2123
+ builder_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2124
+ total_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2125
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2126
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2127
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2128
+ }, z.core.$strip>, z.ZodTransform<{
2129
+ address: _polymarket_types.EvmAddress;
2130
+ feeRate: DecimalString;
2131
+ }, {
2132
+ address: _polymarket_types.EvmAddress;
2133
+ fee_rate: DecimalString;
2134
+ }>>>;
1587
2135
  fee_asset: z.ZodString;
1588
2136
  previous_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1589
2137
  previous_entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -1592,6 +2140,17 @@ declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
1592
2140
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1593
2141
  hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
1594
2142
  }, z.core.$strip>, z.ZodTransform<{
2143
+ feeAsset: string;
2144
+ previousSize: DecimalString;
2145
+ previousEntryPrice: DecimalString;
2146
+ pnl: DecimalString;
2147
+ liquidation: boolean;
2148
+ timestamp: EpochMilliseconds;
2149
+ hash: _polymarket_types.TxHash | undefined;
2150
+ builder?: {
2151
+ address: _polymarket_types.EvmAddress;
2152
+ feeRate: DecimalString;
2153
+ } | undefined;
1595
2154
  tradeId: PerpsTradeId;
1596
2155
  orderId: PerpsOrderId;
1597
2156
  instrumentId: PerpsInstrumentId;
@@ -1599,14 +2158,12 @@ declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
1599
2158
  price: DecimalString;
1600
2159
  quantity: DecimalString;
1601
2160
  taker: boolean;
2161
+ /** Exchange fee for this fill, excluding any builder fee. */
1602
2162
  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;
2163
+ /** Builder fee charged in addition to `fee`; zero without one. */
2164
+ builderFee: DecimalString;
2165
+ /** Sum of `fee` and `builderFee`. */
2166
+ totalFee: DecimalString;
1610
2167
  }, {
1611
2168
  trade_id: PerpsTradeId;
1612
2169
  order_id: PerpsOrderId;
@@ -1622,6 +2179,12 @@ declare const PerpsAccountFillSchema: z.ZodPipe<z.ZodObject<{
1622
2179
  pnl: DecimalString;
1623
2180
  liquidation: boolean;
1624
2181
  timestamp: EpochMilliseconds;
2182
+ builder_fee?: DecimalString | undefined;
2183
+ total_fee?: DecimalString | undefined;
2184
+ builder?: {
2185
+ address: _polymarket_types.EvmAddress;
2186
+ feeRate: DecimalString;
2187
+ } | undefined;
1625
2188
  hash?: _polymarket_types.TxHash | undefined;
1626
2189
  }>>;
1627
2190
  /**
@@ -1640,7 +2203,19 @@ declare const ListPerpsFillsResponseSchema: z.ZodObject<{
1640
2203
  price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1641
2204
  quantity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1642
2205
  taker: z.ZodBoolean;
1643
- fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2206
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2207
+ builder_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2208
+ total_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2209
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2210
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2211
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2212
+ }, z.core.$strip>, z.ZodTransform<{
2213
+ address: _polymarket_types.EvmAddress;
2214
+ feeRate: DecimalString;
2215
+ }, {
2216
+ address: _polymarket_types.EvmAddress;
2217
+ fee_rate: DecimalString;
2218
+ }>>>;
1644
2219
  fee_asset: z.ZodString;
1645
2220
  previous_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1646
2221
  previous_entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -1649,6 +2224,17 @@ declare const ListPerpsFillsResponseSchema: z.ZodObject<{
1649
2224
  timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1650
2225
  hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
1651
2226
  }, z.core.$strip>, z.ZodTransform<{
2227
+ feeAsset: string;
2228
+ previousSize: DecimalString;
2229
+ previousEntryPrice: DecimalString;
2230
+ pnl: DecimalString;
2231
+ liquidation: boolean;
2232
+ timestamp: EpochMilliseconds;
2233
+ hash: _polymarket_types.TxHash | undefined;
2234
+ builder?: {
2235
+ address: _polymarket_types.EvmAddress;
2236
+ feeRate: DecimalString;
2237
+ } | undefined;
1652
2238
  tradeId: PerpsTradeId;
1653
2239
  orderId: PerpsOrderId;
1654
2240
  instrumentId: PerpsInstrumentId;
@@ -1656,14 +2242,12 @@ declare const ListPerpsFillsResponseSchema: z.ZodObject<{
1656
2242
  price: DecimalString;
1657
2243
  quantity: DecimalString;
1658
2244
  taker: boolean;
2245
+ /** Exchange fee for this fill, excluding any builder fee. */
1659
2246
  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;
2247
+ /** Builder fee charged in addition to `fee`; zero without one. */
2248
+ builderFee: DecimalString;
2249
+ /** Sum of `fee` and `builderFee`. */
2250
+ totalFee: DecimalString;
1667
2251
  }, {
1668
2252
  trade_id: PerpsTradeId;
1669
2253
  order_id: PerpsOrderId;
@@ -1679,6 +2263,12 @@ declare const ListPerpsFillsResponseSchema: z.ZodObject<{
1679
2263
  pnl: DecimalString;
1680
2264
  liquidation: boolean;
1681
2265
  timestamp: EpochMilliseconds;
2266
+ builder_fee?: DecimalString | undefined;
2267
+ total_fee?: DecimalString | undefined;
2268
+ builder?: {
2269
+ address: _polymarket_types.EvmAddress;
2270
+ feeRate: DecimalString;
2271
+ } | undefined;
1682
2272
  hash?: _polymarket_types.TxHash | undefined;
1683
2273
  }>>>;
1684
2274
  more: z.ZodBoolean;
@@ -1694,7 +2284,19 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
1694
2284
  p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1695
2285
  qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1696
2286
  taker: z.ZodBoolean;
1697
- fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2287
+ fee: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2288
+ builder_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2289
+ total_fee: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
2290
+ builder: z.ZodOptional<z.ZodPipe<z.ZodObject<{
2291
+ address: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2292
+ fee_rate: z.ZodPipe<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2293
+ }, z.core.$strip>, z.ZodTransform<{
2294
+ address: _polymarket_types.EvmAddress;
2295
+ feeRate: DecimalString;
2296
+ }, {
2297
+ address: _polymarket_types.EvmAddress;
2298
+ fee_rate: DecimalString;
2299
+ }>>>;
1698
2300
  fea: z.ZodString;
1699
2301
  psz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1700
2302
  pep: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
@@ -1703,6 +2305,17 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
1703
2305
  ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1704
2306
  coid: z.ZodOptional<z.ZodString>;
1705
2307
  }, z.core.$strip>, z.ZodTransform<{
2308
+ feeAsset: string;
2309
+ previousSize: DecimalString;
2310
+ previousEntryPrice: DecimalString;
2311
+ pnl: DecimalString;
2312
+ liquidation: boolean;
2313
+ timestamp: EpochMilliseconds;
2314
+ clientOrderId: string | undefined;
2315
+ builder?: {
2316
+ address: _polymarket_types.EvmAddress;
2317
+ feeRate: DecimalString;
2318
+ } | undefined;
1706
2319
  tradeId: PerpsTradeId;
1707
2320
  orderId: PerpsOrderId;
1708
2321
  instrumentId: PerpsInstrumentId;
@@ -1710,14 +2323,12 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
1710
2323
  price: DecimalString;
1711
2324
  quantity: DecimalString;
1712
2325
  taker: boolean;
2326
+ /** Exchange fee for this fill, excluding any builder fee. */
1713
2327
  fee: DecimalString;
1714
- feeAsset: string;
1715
- previousSize: DecimalString;
1716
- previousEntryPrice: DecimalString;
1717
- pnl: DecimalString;
1718
- liquidation: boolean;
1719
- timestamp: EpochMilliseconds;
1720
- clientOrderId: string | undefined;
2328
+ /** Builder fee charged in addition to `fee`; zero without one. */
2329
+ builderFee: DecimalString;
2330
+ /** Sum of `fee` and `builderFee`. */
2331
+ totalFee: DecimalString;
1721
2332
  }, {
1722
2333
  tid: PerpsTradeId;
1723
2334
  oid: PerpsOrderId;
@@ -1733,7 +2344,13 @@ declare const PerpsAccountFillUpdateSchema: z.ZodPipe<z.ZodObject<{
1733
2344
  pnl: DecimalString;
1734
2345
  liq: boolean;
1735
2346
  ts: EpochMilliseconds;
2347
+ builder_fee?: DecimalString | undefined;
2348
+ total_fee?: DecimalString | undefined;
2349
+ builder?: {
2350
+ address: _polymarket_types.EvmAddress;
2351
+ feeRate: DecimalString;
2352
+ } | undefined;
1736
2353
  coid?: string | undefined;
1737
2354
  }>>;
1738
2355
 
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 };
2356
+ export { PerpsDataResponseSchema as $, PerpsBuilderEarningSchema as A, type PerpsBuilderEarningsAsset as B, PerpsBuilderEarningsAssetSchema as C, type PerpsBuilderEarningsSnapshot as D, PerpsBuilderEarningsSnapshotSchema as E, FetchPerpsBuilderApprovalsResponseSchema as F, type PerpsBuilderEarningsSummary as G, PerpsBuilderEarningsSummarySchema as H, type PerpsBuilderStatus as I, PerpsBuilderStatusSchema as J, type PerpsBuilderTerms as K, ListPerpsBuilderEarningsResponseSchema as L, MarkPerpsNotificationsReadResponseSchema as M, PerpsBuilderTermsSchema as N, type PerpsCancelAllOrdersResponse as O, type PerpsInstrumentId as P, PerpsCancelAllOrdersResponseSchema as Q, type PerpsCancelOrderErrorCode as R, PerpsCancelOrderErrorCodeSchema as S, type PerpsCancelOrderResult as T, PerpsCancelOrderResultSchema as U, type PerpsClientOrderId as V, PerpsClientOrderIdSchema as W, type PerpsCommandAck as X, PerpsCommandAckSchema as Y, PerpsCommandStatusSchema as Z, type PerpsCredentials as _, type PerpsEntityId as a, PerpsTpSlScopeSchema as a$, type PerpsDecimal as a0, type PerpsDecimalInput as a1, PerpsDecimalInputSchema as a2, type PerpsDepositAmount as a3, PerpsDepositStatusSchema as a4, PerpsEntityIdSchema as a5, type PerpsFundingInterval as a6, PerpsFundingIntervalSchema as a7, PerpsFundingPaymentIdSchema as a8, PerpsInstrumentCategorySchema as a9, type PerpsOrder as aA, type PerpsOrderId as aB, PerpsOrderIdSchema as aC, PerpsOrderSchema as aD, PerpsOrderStatus as aE, PerpsOrderStatusSchema as aF, PerpsOrderUpdateSchema as aG, PerpsPnlInterval as aH, PerpsPnlIntervalSchema as aI, type PerpsPositionChangeNotification as aJ, PerpsPositionChangeNotificationSchema as aK, type PerpsPositionClosedNotification as aL, PerpsPositionClosedNotificationSchema as aM, type PerpsPositionLiquidatedNotification as aN, PerpsPositionLiquidatedNotificationSchema as aO, type PerpsPostOrderAck as aP, PerpsPostOrderAckSchema as aQ, PerpsSideSchema as aR, PerpsSortDirection as aS, PerpsSortDirectionSchema as aT, PerpsTimeInForce as aU, PerpsTimeInForceSchema as aV, PerpsTpSlKind as aW, PerpsTpSlKindSchema as aX, type PerpsTpSlOrderFields as aY, PerpsTpSlOrderFieldsSchema as aZ, PerpsTpSlScope as a_, PerpsInstrumentIdSchema as aa, PerpsInstrumentTypeSchema as ab, PerpsInternalTransferDirectionSchema as ac, PerpsInternalTransferIdSchema as ad, type PerpsInternalTransferType as ae, PerpsInternalTransferTypeSchema as af, PerpsKlineInterval as ag, PerpsKlineIntervalSchema as ah, PerpsKnownCancelOrderErrorCode as ai, type PerpsLimitOrderCanceledNotification as aj, PerpsLimitOrderCanceledNotificationSchema as ak, type PerpsLiquidationWarningNotification as al, PerpsLiquidationWarningNotificationSchema as am, PerpsLiquidityRole as an, PerpsMarginType as ao, PerpsMarginTypeSchema as ap, type PerpsNotification as aq, type PerpsNotificationEntry as ar, PerpsNotificationEntrySchema as as, type PerpsNotificationId as at, PerpsNotificationIdSchema as au, PerpsNotificationOrderType as av, PerpsNotificationOrderTypeSchema as aw, PerpsNotificationSchema as ax, PerpsNotificationType as ay, PerpsNotificationTypeSchema as az, type PerpsFundingPaymentId as b, PerpsTradeIdSchema as b0, type PerpsTxHash as b1, PerpsTxHashSchema as b2, type PerpsUpdateLeverageResult as b3, PerpsUpdateLeverageResultSchema as b4, type PerpsWithdrawalAmount as b5, PerpsWithdrawalIdSchema as b6, type PerpsWithdrawalStatus as b7, PerpsWithdrawalStatusSchema as b8, decimalString as b9, perpsBaseUnits as ba, perpsDecimal as bb, PerpsDepositStatus as c, type PerpsInternalTransferId as d, PerpsKnownInternalTransferType as e, PerpsInternalTransferDirection as f, type PerpsWithdrawalId as g, PerpsKnownWithdrawalStatus as h, PerpsInstrumentType as i, PerpsInstrumentCategory as j, type PerpsTradeId as k, PerpsSide as l, FetchPerpsOpenOrdersResponseSchema as m, FetchPerpsOrdersResponseSchema as n, FetchPerpsUnreadNotificationsCountResponseSchema as o, ListPerpsFillsResponseSchema as p, ListPerpsNotificationsResponseSchema as q, type PerpsAccountFill as r, PerpsAccountFillSchema as s, PerpsAccountFillUpdateSchema as t, PerpsAssetSchema as u, type PerpsBuilderApproval as v, PerpsBuilderApprovalSchema as w, type PerpsBuilderEarning as x, type PerpsBuilderEarningId as y, PerpsBuilderEarningIdSchema as z };