@polymarket/bindings 0.1.0-beta.0 → 0.1.0-beta.10

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,8 @@
1
- import { TokenId, DecimalString, EpochMilliseconds, ConditionId, IsoDateTimeString, OrderSide, OrderType, CommentId, CommentParentEntityType, EventId, SeriesId, ImageOptimizationId, BaseUnits } from '../index.js';
1
+ import { TokenId, DecimalString, EpochMilliseconds, CtfConditionId, IsoDateTimeString, OrderSide, OrderType, BaseUnits, CommentId, CommentParentEntityType, EventId, SeriesId, ImageOptimizationId } from '../index.js';
2
2
  import { z } from 'zod';
3
+ import { P as PerpsInstrumentId, N as PerpsKlineInterval, b as PerpsDepositStatus, i as PerpsTradeId, R as PerpsOrderId, j as PerpsSide, a0 as PerpsTimeInForce, U as PerpsOrderStatus, a2 as PerpsTpSlKind, a6 as PerpsTpSlScope, c as PerpsWithdrawalId, d as PerpsWithdrawalStatus } from '../orders-DHP1WzKt.js';
4
+ import * as _polymarket_types from '@polymarket/types';
3
5
  import { R as ReactionType } from '../comment-C-jBbhp7.js';
4
- import '@polymarket/types';
5
6
 
6
7
  declare enum TradeStatus {
7
8
  Matched = "TRADE_STATUS_MATCHED",
@@ -284,7 +285,7 @@ declare const NewMarketEventSchema: z.ZodPipe<z.ZodObject<{
284
285
  }, z.core.$strip>>>;
285
286
  timestamp: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>>>;
286
287
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
287
- condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>>;
288
+ condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>>>;
288
289
  active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
289
290
  clob_token_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
290
291
  sports_market_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -307,7 +308,7 @@ declare const NewMarketEventSchema: z.ZodPipe<z.ZodObject<{
307
308
  title?: string | null | undefined;
308
309
  description?: string | null | undefined;
309
310
  } | null | undefined;
310
- conditionId: ConditionId | null | undefined;
311
+ conditionId: CtfConditionId | null | undefined;
311
312
  clobTokenIds: string[] | null | undefined;
312
313
  sportsMarketType: string | null | undefined;
313
314
  gameStartTime: IsoDateTimeString | null | undefined;
@@ -345,7 +346,7 @@ declare const NewMarketEventSchema: z.ZodPipe<z.ZodObject<{
345
346
  } | null | undefined;
346
347
  timestamp?: EpochMilliseconds | null | undefined;
347
348
  tags?: string[] | null | undefined;
348
- condition_id?: ConditionId | null | undefined;
349
+ condition_id?: CtfConditionId | null | undefined;
349
350
  active?: boolean | null | undefined;
350
351
  clob_token_ids?: string[] | null | undefined;
351
352
  sports_market_type?: string | null | undefined;
@@ -865,7 +866,7 @@ declare const CustomMarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodO
865
866
  }, z.core.$strip>>>;
866
867
  timestamp: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>>>;
867
868
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
868
- condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>>;
869
+ condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>>>;
869
870
  active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
870
871
  clob_token_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
871
872
  sports_market_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -888,7 +889,7 @@ declare const CustomMarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodO
888
889
  title?: string | null | undefined;
889
890
  description?: string | null | undefined;
890
891
  } | null | undefined;
891
- conditionId: ConditionId | null | undefined;
892
+ conditionId: CtfConditionId | null | undefined;
892
893
  clobTokenIds: string[] | null | undefined;
893
894
  sportsMarketType: string | null | undefined;
894
895
  gameStartTime: IsoDateTimeString | null | undefined;
@@ -926,7 +927,7 @@ declare const CustomMarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodO
926
927
  } | null | undefined;
927
928
  timestamp?: EpochMilliseconds | null | undefined;
928
929
  tags?: string[] | null | undefined;
929
- condition_id?: ConditionId | null | undefined;
930
+ condition_id?: CtfConditionId | null | undefined;
930
931
  active?: boolean | null | undefined;
931
932
  clob_token_ids?: string[] | null | undefined;
932
933
  sports_market_type?: string | null | undefined;
@@ -1207,7 +1208,7 @@ declare const MarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<
1207
1208
  }, z.core.$strip>>>;
1208
1209
  timestamp: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>>>;
1209
1210
  tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1210
- condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>>>;
1211
+ condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>>>;
1211
1212
  active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1212
1213
  clob_token_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1213
1214
  sports_market_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1230,7 +1231,7 @@ declare const MarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<
1230
1231
  title?: string | null | undefined;
1231
1232
  description?: string | null | undefined;
1232
1233
  } | null | undefined;
1233
- conditionId: ConditionId | null | undefined;
1234
+ conditionId: CtfConditionId | null | undefined;
1234
1235
  clobTokenIds: string[] | null | undefined;
1235
1236
  sportsMarketType: string | null | undefined;
1236
1237
  gameStartTime: IsoDateTimeString | null | undefined;
@@ -1268,7 +1269,7 @@ declare const MarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<
1268
1269
  } | null | undefined;
1269
1270
  timestamp?: EpochMilliseconds | null | undefined;
1270
1271
  tags?: string[] | null | undefined;
1271
- condition_id?: ConditionId | null | undefined;
1272
+ condition_id?: CtfConditionId | null | undefined;
1272
1273
  active?: boolean | null | undefined;
1273
1274
  clob_token_ids?: string[] | null | undefined;
1274
1275
  sports_market_type?: string | null | undefined;
@@ -1526,6 +1527,2023 @@ declare const UserEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<{
1526
1527
  }>>], "event_type">;
1527
1528
  type UserEvent = z.infer<typeof UserEventSchema>;
1528
1529
 
1530
+ declare const PerpsTradeEventSchema: z.ZodPipe<z.ZodObject<{
1531
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1532
+ sq: z.ZodNumber;
1533
+ ch: z.ZodString;
1534
+ data: z.ZodPipe<z.ZodObject<{
1535
+ tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
1536
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1537
+ side: z.ZodEnum<typeof PerpsSide>;
1538
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1539
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1540
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1541
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
1542
+ }, z.core.$strip>, z.ZodTransform<{
1543
+ tradeId: PerpsTradeId;
1544
+ instrumentId: PerpsInstrumentId;
1545
+ side: PerpsSide;
1546
+ price: DecimalString;
1547
+ quantity: DecimalString;
1548
+ timestamp: EpochMilliseconds;
1549
+ hash: _polymarket_types.TxHash | undefined;
1550
+ }, {
1551
+ tid: PerpsTradeId;
1552
+ iid: PerpsInstrumentId;
1553
+ side: PerpsSide;
1554
+ p: DecimalString;
1555
+ qty: DecimalString;
1556
+ ts: EpochMilliseconds;
1557
+ hash?: _polymarket_types.TxHash | undefined;
1558
+ }>>;
1559
+ }, z.core.$strip>, z.ZodTransform<{
1560
+ topic: "perps.trades";
1561
+ type: "trade";
1562
+ channel: string;
1563
+ timestamp: EpochMilliseconds;
1564
+ sequence: number;
1565
+ payload: {
1566
+ tradeId: PerpsTradeId;
1567
+ instrumentId: PerpsInstrumentId;
1568
+ side: PerpsSide;
1569
+ price: DecimalString;
1570
+ quantity: DecimalString;
1571
+ timestamp: EpochMilliseconds;
1572
+ hash: _polymarket_types.TxHash | undefined;
1573
+ };
1574
+ }, {
1575
+ ts: EpochMilliseconds;
1576
+ sq: number;
1577
+ ch: string;
1578
+ data: {
1579
+ tradeId: PerpsTradeId;
1580
+ instrumentId: PerpsInstrumentId;
1581
+ side: PerpsSide;
1582
+ price: DecimalString;
1583
+ quantity: DecimalString;
1584
+ timestamp: EpochMilliseconds;
1585
+ hash: _polymarket_types.TxHash | undefined;
1586
+ };
1587
+ }>>;
1588
+ type PerpsTradeEvent = z.infer<typeof PerpsTradeEventSchema>;
1589
+ declare const PerpsBboEventSchema: z.ZodPipe<z.ZodObject<{
1590
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1591
+ sq: z.ZodNumber;
1592
+ ch: z.ZodString;
1593
+ data: z.ZodPipe<z.ZodObject<{
1594
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1595
+ bp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1596
+ bq: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1597
+ ap: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1598
+ aq: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1599
+ }, z.core.$strip>, z.ZodTransform<{
1600
+ instrumentId: PerpsInstrumentId;
1601
+ bidPrice: DecimalString;
1602
+ bidQuantity: DecimalString;
1603
+ askPrice: DecimalString;
1604
+ askQuantity: DecimalString;
1605
+ }, {
1606
+ iid: PerpsInstrumentId;
1607
+ bp: DecimalString;
1608
+ bq: DecimalString;
1609
+ ap: DecimalString;
1610
+ aq: DecimalString;
1611
+ }>>;
1612
+ }, z.core.$strip>, z.ZodTransform<{
1613
+ topic: "perps.bbo";
1614
+ type: "bbo";
1615
+ channel: string;
1616
+ timestamp: EpochMilliseconds;
1617
+ sequence: number;
1618
+ payload: {
1619
+ instrumentId: PerpsInstrumentId;
1620
+ bidPrice: DecimalString;
1621
+ bidQuantity: DecimalString;
1622
+ askPrice: DecimalString;
1623
+ askQuantity: DecimalString;
1624
+ };
1625
+ }, {
1626
+ ts: EpochMilliseconds;
1627
+ sq: number;
1628
+ ch: string;
1629
+ data: {
1630
+ instrumentId: PerpsInstrumentId;
1631
+ bidPrice: DecimalString;
1632
+ bidQuantity: DecimalString;
1633
+ askPrice: DecimalString;
1634
+ askQuantity: DecimalString;
1635
+ };
1636
+ }>>;
1637
+ type PerpsBboEvent = z.infer<typeof PerpsBboEventSchema>;
1638
+ declare const PerpsBookEventSchema: z.ZodPipe<z.ZodObject<{
1639
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1640
+ sq: z.ZodNumber;
1641
+ ch: z.ZodString;
1642
+ data: z.ZodPipe<z.ZodObject<{
1643
+ b: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>], null>, z.ZodTransform<{
1644
+ price: DecimalString;
1645
+ quantity: DecimalString;
1646
+ }, [DecimalString, DecimalString]>>>;
1647
+ a: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>], null>, z.ZodTransform<{
1648
+ price: DecimalString;
1649
+ quantity: DecimalString;
1650
+ }, [DecimalString, DecimalString]>>>;
1651
+ }, z.core.$strip>, z.ZodTransform<{
1652
+ bids: {
1653
+ price: DecimalString;
1654
+ quantity: DecimalString;
1655
+ }[];
1656
+ asks: {
1657
+ price: DecimalString;
1658
+ quantity: DecimalString;
1659
+ }[];
1660
+ }, {
1661
+ b: {
1662
+ price: DecimalString;
1663
+ quantity: DecimalString;
1664
+ }[];
1665
+ a: {
1666
+ price: DecimalString;
1667
+ quantity: DecimalString;
1668
+ }[];
1669
+ }>>;
1670
+ }, z.core.$strip>, z.ZodTransform<{
1671
+ topic: "perps.book";
1672
+ type: "book";
1673
+ channel: string;
1674
+ timestamp: EpochMilliseconds;
1675
+ sequence: number;
1676
+ payload: {
1677
+ bids: {
1678
+ price: DecimalString;
1679
+ quantity: DecimalString;
1680
+ }[];
1681
+ asks: {
1682
+ price: DecimalString;
1683
+ quantity: DecimalString;
1684
+ }[];
1685
+ instrumentId: PerpsInstrumentId;
1686
+ };
1687
+ }, {
1688
+ ts: EpochMilliseconds;
1689
+ sq: number;
1690
+ ch: string;
1691
+ data: {
1692
+ bids: {
1693
+ price: DecimalString;
1694
+ quantity: DecimalString;
1695
+ }[];
1696
+ asks: {
1697
+ price: DecimalString;
1698
+ quantity: DecimalString;
1699
+ }[];
1700
+ };
1701
+ }>>;
1702
+ type PerpsBookEvent = z.infer<typeof PerpsBookEventSchema>;
1703
+ declare const PerpsTickerEventSchema: z.ZodPipe<z.ZodObject<{
1704
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1705
+ sq: z.ZodNumber;
1706
+ ch: z.ZodString;
1707
+ data: z.ZodPipe<z.ZodObject<{
1708
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1709
+ idx: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1710
+ mark: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1711
+ last: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1712
+ mid: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1713
+ oi: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1714
+ fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1715
+ nxf: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1716
+ }, z.core.$strip>, z.ZodTransform<{
1717
+ instrumentId: PerpsInstrumentId;
1718
+ indexPrice: DecimalString;
1719
+ markPrice: DecimalString;
1720
+ lastPrice: DecimalString;
1721
+ midPrice: DecimalString;
1722
+ openInterest: DecimalString;
1723
+ fundingRate: DecimalString;
1724
+ nextFunding: EpochMilliseconds;
1725
+ }, {
1726
+ iid: PerpsInstrumentId;
1727
+ idx: DecimalString;
1728
+ mark: DecimalString;
1729
+ last: DecimalString;
1730
+ mid: DecimalString;
1731
+ oi: DecimalString;
1732
+ fr: DecimalString;
1733
+ nxf: EpochMilliseconds;
1734
+ }>>;
1735
+ }, z.core.$strip>, z.ZodTransform<{
1736
+ topic: "perps.tickers";
1737
+ type: "ticker";
1738
+ channel: string;
1739
+ timestamp: EpochMilliseconds;
1740
+ sequence: number;
1741
+ payload: {
1742
+ instrumentId: PerpsInstrumentId;
1743
+ indexPrice: DecimalString;
1744
+ markPrice: DecimalString;
1745
+ lastPrice: DecimalString;
1746
+ midPrice: DecimalString;
1747
+ openInterest: DecimalString;
1748
+ fundingRate: DecimalString;
1749
+ nextFunding: EpochMilliseconds;
1750
+ };
1751
+ }, {
1752
+ ts: EpochMilliseconds;
1753
+ sq: number;
1754
+ ch: string;
1755
+ data: {
1756
+ instrumentId: PerpsInstrumentId;
1757
+ indexPrice: DecimalString;
1758
+ markPrice: DecimalString;
1759
+ lastPrice: DecimalString;
1760
+ midPrice: DecimalString;
1761
+ openInterest: DecimalString;
1762
+ fundingRate: DecimalString;
1763
+ nextFunding: EpochMilliseconds;
1764
+ };
1765
+ }>>;
1766
+ type PerpsTickerEvent = z.infer<typeof PerpsTickerEventSchema>;
1767
+ declare const PerpsStatisticEventSchema: z.ZodPipe<z.ZodObject<{
1768
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1769
+ sq: z.ZodNumber;
1770
+ ch: z.ZodString;
1771
+ data: z.ZodPipe<z.ZodObject<{
1772
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1773
+ vol: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1774
+ open: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1775
+ klines: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodNumber], null>, z.ZodTransform<{
1776
+ timestamp: EpochMilliseconds;
1777
+ open: DecimalString;
1778
+ high: DecimalString;
1779
+ low: DecimalString;
1780
+ close: DecimalString;
1781
+ volume: DecimalString;
1782
+ trades: number;
1783
+ }, [EpochMilliseconds, DecimalString, DecimalString, DecimalString, DecimalString, DecimalString, number]>>>;
1784
+ }, z.core.$strip>, z.ZodTransform<{
1785
+ instrumentId: PerpsInstrumentId;
1786
+ volume: DecimalString;
1787
+ openPrice: DecimalString;
1788
+ klines: {
1789
+ timestamp: EpochMilliseconds;
1790
+ open: DecimalString;
1791
+ high: DecimalString;
1792
+ low: DecimalString;
1793
+ close: DecimalString;
1794
+ volume: DecimalString;
1795
+ trades: number;
1796
+ }[];
1797
+ }, {
1798
+ iid: PerpsInstrumentId;
1799
+ vol: DecimalString;
1800
+ open: DecimalString;
1801
+ klines: {
1802
+ timestamp: EpochMilliseconds;
1803
+ open: DecimalString;
1804
+ high: DecimalString;
1805
+ low: DecimalString;
1806
+ close: DecimalString;
1807
+ volume: DecimalString;
1808
+ trades: number;
1809
+ }[];
1810
+ }>>;
1811
+ }, z.core.$strip>, z.ZodTransform<{
1812
+ topic: "perps.statistics";
1813
+ type: "statistic";
1814
+ channel: string;
1815
+ timestamp: EpochMilliseconds;
1816
+ sequence: number;
1817
+ payload: {
1818
+ instrumentId: PerpsInstrumentId;
1819
+ volume: DecimalString;
1820
+ openPrice: DecimalString;
1821
+ klines: {
1822
+ timestamp: EpochMilliseconds;
1823
+ open: DecimalString;
1824
+ high: DecimalString;
1825
+ low: DecimalString;
1826
+ close: DecimalString;
1827
+ volume: DecimalString;
1828
+ trades: number;
1829
+ }[];
1830
+ };
1831
+ }, {
1832
+ ts: EpochMilliseconds;
1833
+ sq: number;
1834
+ ch: string;
1835
+ data: {
1836
+ instrumentId: PerpsInstrumentId;
1837
+ volume: DecimalString;
1838
+ openPrice: DecimalString;
1839
+ klines: {
1840
+ timestamp: EpochMilliseconds;
1841
+ open: DecimalString;
1842
+ high: DecimalString;
1843
+ low: DecimalString;
1844
+ close: DecimalString;
1845
+ volume: DecimalString;
1846
+ trades: number;
1847
+ }[];
1848
+ };
1849
+ }>>;
1850
+ type PerpsStatisticEvent = z.infer<typeof PerpsStatisticEventSchema>;
1851
+ declare const PerpsCandleEventSchema: z.ZodPipe<z.ZodObject<{
1852
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1853
+ sq: z.ZodNumber;
1854
+ ch: z.ZodString;
1855
+ data: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodNumber], null>, z.ZodTransform<{
1856
+ timestamp: EpochMilliseconds;
1857
+ open: DecimalString;
1858
+ high: DecimalString;
1859
+ low: DecimalString;
1860
+ close: DecimalString;
1861
+ volume: DecimalString;
1862
+ trades: number;
1863
+ }, [EpochMilliseconds, DecimalString, DecimalString, DecimalString, DecimalString, DecimalString, number]>>>;
1864
+ }, z.core.$strip>, z.ZodTransform<{
1865
+ topic: "perps.candles";
1866
+ type: "candle";
1867
+ channel: string;
1868
+ timestamp: EpochMilliseconds;
1869
+ sequence: number;
1870
+ payload: {
1871
+ instrumentId: PerpsInstrumentId;
1872
+ interval: PerpsKlineInterval.OneMinute | PerpsKlineInterval.FiveMinutes | PerpsKlineInterval.FifteenMinutes | PerpsKlineInterval.OneHour | PerpsKlineInterval.FourHours | PerpsKlineInterval.OneDay | PerpsKlineInterval.OneWeek;
1873
+ candles: {
1874
+ timestamp: EpochMilliseconds;
1875
+ open: DecimalString;
1876
+ high: DecimalString;
1877
+ low: DecimalString;
1878
+ close: DecimalString;
1879
+ volume: DecimalString;
1880
+ trades: number;
1881
+ }[];
1882
+ };
1883
+ }, {
1884
+ ts: EpochMilliseconds;
1885
+ sq: number;
1886
+ ch: string;
1887
+ data: {
1888
+ timestamp: EpochMilliseconds;
1889
+ open: DecimalString;
1890
+ high: DecimalString;
1891
+ low: DecimalString;
1892
+ close: DecimalString;
1893
+ volume: DecimalString;
1894
+ trades: number;
1895
+ }[];
1896
+ }>>;
1897
+ type PerpsCandleEvent = z.infer<typeof PerpsCandleEventSchema>;
1898
+ declare const PerpsMarketDataEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
1899
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1900
+ sq: z.ZodNumber;
1901
+ ch: z.ZodString;
1902
+ data: z.ZodPipe<z.ZodObject<{
1903
+ tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
1904
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1905
+ side: z.ZodEnum<typeof PerpsSide>;
1906
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1907
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1908
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1909
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
1910
+ }, z.core.$strip>, z.ZodTransform<{
1911
+ tradeId: PerpsTradeId;
1912
+ instrumentId: PerpsInstrumentId;
1913
+ side: PerpsSide;
1914
+ price: DecimalString;
1915
+ quantity: DecimalString;
1916
+ timestamp: EpochMilliseconds;
1917
+ hash: _polymarket_types.TxHash | undefined;
1918
+ }, {
1919
+ tid: PerpsTradeId;
1920
+ iid: PerpsInstrumentId;
1921
+ side: PerpsSide;
1922
+ p: DecimalString;
1923
+ qty: DecimalString;
1924
+ ts: EpochMilliseconds;
1925
+ hash?: _polymarket_types.TxHash | undefined;
1926
+ }>>;
1927
+ }, z.core.$strip>, z.ZodTransform<{
1928
+ topic: "perps.trades";
1929
+ type: "trade";
1930
+ channel: string;
1931
+ timestamp: EpochMilliseconds;
1932
+ sequence: number;
1933
+ payload: {
1934
+ tradeId: PerpsTradeId;
1935
+ instrumentId: PerpsInstrumentId;
1936
+ side: PerpsSide;
1937
+ price: DecimalString;
1938
+ quantity: DecimalString;
1939
+ timestamp: EpochMilliseconds;
1940
+ hash: _polymarket_types.TxHash | undefined;
1941
+ };
1942
+ }, {
1943
+ ts: EpochMilliseconds;
1944
+ sq: number;
1945
+ ch: string;
1946
+ data: {
1947
+ tradeId: PerpsTradeId;
1948
+ instrumentId: PerpsInstrumentId;
1949
+ side: PerpsSide;
1950
+ price: DecimalString;
1951
+ quantity: DecimalString;
1952
+ timestamp: EpochMilliseconds;
1953
+ hash: _polymarket_types.TxHash | undefined;
1954
+ };
1955
+ }>>, z.ZodPipe<z.ZodObject<{
1956
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
1957
+ sq: z.ZodNumber;
1958
+ ch: z.ZodString;
1959
+ data: z.ZodPipe<z.ZodObject<{
1960
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
1961
+ bp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1962
+ bq: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1963
+ ap: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1964
+ aq: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
1965
+ }, z.core.$strip>, z.ZodTransform<{
1966
+ instrumentId: PerpsInstrumentId;
1967
+ bidPrice: DecimalString;
1968
+ bidQuantity: DecimalString;
1969
+ askPrice: DecimalString;
1970
+ askQuantity: DecimalString;
1971
+ }, {
1972
+ iid: PerpsInstrumentId;
1973
+ bp: DecimalString;
1974
+ bq: DecimalString;
1975
+ ap: DecimalString;
1976
+ aq: DecimalString;
1977
+ }>>;
1978
+ }, z.core.$strip>, z.ZodTransform<{
1979
+ topic: "perps.bbo";
1980
+ type: "bbo";
1981
+ channel: string;
1982
+ timestamp: EpochMilliseconds;
1983
+ sequence: number;
1984
+ payload: {
1985
+ instrumentId: PerpsInstrumentId;
1986
+ bidPrice: DecimalString;
1987
+ bidQuantity: DecimalString;
1988
+ askPrice: DecimalString;
1989
+ askQuantity: DecimalString;
1990
+ };
1991
+ }, {
1992
+ ts: EpochMilliseconds;
1993
+ sq: number;
1994
+ ch: string;
1995
+ data: {
1996
+ instrumentId: PerpsInstrumentId;
1997
+ bidPrice: DecimalString;
1998
+ bidQuantity: DecimalString;
1999
+ askPrice: DecimalString;
2000
+ askQuantity: DecimalString;
2001
+ };
2002
+ }>>, z.ZodPipe<z.ZodObject<{
2003
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2004
+ sq: z.ZodNumber;
2005
+ ch: z.ZodString;
2006
+ data: z.ZodPipe<z.ZodObject<{
2007
+ b: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>], null>, z.ZodTransform<{
2008
+ price: DecimalString;
2009
+ quantity: DecimalString;
2010
+ }, [DecimalString, DecimalString]>>>;
2011
+ a: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>], null>, z.ZodTransform<{
2012
+ price: DecimalString;
2013
+ quantity: DecimalString;
2014
+ }, [DecimalString, DecimalString]>>>;
2015
+ }, z.core.$strip>, z.ZodTransform<{
2016
+ bids: {
2017
+ price: DecimalString;
2018
+ quantity: DecimalString;
2019
+ }[];
2020
+ asks: {
2021
+ price: DecimalString;
2022
+ quantity: DecimalString;
2023
+ }[];
2024
+ }, {
2025
+ b: {
2026
+ price: DecimalString;
2027
+ quantity: DecimalString;
2028
+ }[];
2029
+ a: {
2030
+ price: DecimalString;
2031
+ quantity: DecimalString;
2032
+ }[];
2033
+ }>>;
2034
+ }, z.core.$strip>, z.ZodTransform<{
2035
+ topic: "perps.book";
2036
+ type: "book";
2037
+ channel: string;
2038
+ timestamp: EpochMilliseconds;
2039
+ sequence: number;
2040
+ payload: {
2041
+ bids: {
2042
+ price: DecimalString;
2043
+ quantity: DecimalString;
2044
+ }[];
2045
+ asks: {
2046
+ price: DecimalString;
2047
+ quantity: DecimalString;
2048
+ }[];
2049
+ instrumentId: PerpsInstrumentId;
2050
+ };
2051
+ }, {
2052
+ ts: EpochMilliseconds;
2053
+ sq: number;
2054
+ ch: string;
2055
+ data: {
2056
+ bids: {
2057
+ price: DecimalString;
2058
+ quantity: DecimalString;
2059
+ }[];
2060
+ asks: {
2061
+ price: DecimalString;
2062
+ quantity: DecimalString;
2063
+ }[];
2064
+ };
2065
+ }>>, z.ZodPipe<z.ZodObject<{
2066
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2067
+ sq: z.ZodNumber;
2068
+ ch: z.ZodString;
2069
+ data: z.ZodPipe<z.ZodObject<{
2070
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2071
+ idx: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2072
+ mark: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2073
+ last: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2074
+ mid: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2075
+ oi: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2076
+ fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2077
+ nxf: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2078
+ }, z.core.$strip>, z.ZodTransform<{
2079
+ instrumentId: PerpsInstrumentId;
2080
+ indexPrice: DecimalString;
2081
+ markPrice: DecimalString;
2082
+ lastPrice: DecimalString;
2083
+ midPrice: DecimalString;
2084
+ openInterest: DecimalString;
2085
+ fundingRate: DecimalString;
2086
+ nextFunding: EpochMilliseconds;
2087
+ }, {
2088
+ iid: PerpsInstrumentId;
2089
+ idx: DecimalString;
2090
+ mark: DecimalString;
2091
+ last: DecimalString;
2092
+ mid: DecimalString;
2093
+ oi: DecimalString;
2094
+ fr: DecimalString;
2095
+ nxf: EpochMilliseconds;
2096
+ }>>;
2097
+ }, z.core.$strip>, z.ZodTransform<{
2098
+ topic: "perps.tickers";
2099
+ type: "ticker";
2100
+ channel: string;
2101
+ timestamp: EpochMilliseconds;
2102
+ sequence: number;
2103
+ payload: {
2104
+ instrumentId: PerpsInstrumentId;
2105
+ indexPrice: DecimalString;
2106
+ markPrice: DecimalString;
2107
+ lastPrice: DecimalString;
2108
+ midPrice: DecimalString;
2109
+ openInterest: DecimalString;
2110
+ fundingRate: DecimalString;
2111
+ nextFunding: EpochMilliseconds;
2112
+ };
2113
+ }, {
2114
+ ts: EpochMilliseconds;
2115
+ sq: number;
2116
+ ch: string;
2117
+ data: {
2118
+ instrumentId: PerpsInstrumentId;
2119
+ indexPrice: DecimalString;
2120
+ markPrice: DecimalString;
2121
+ lastPrice: DecimalString;
2122
+ midPrice: DecimalString;
2123
+ openInterest: DecimalString;
2124
+ fundingRate: DecimalString;
2125
+ nextFunding: EpochMilliseconds;
2126
+ };
2127
+ }>>, z.ZodPipe<z.ZodObject<{
2128
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2129
+ sq: z.ZodNumber;
2130
+ ch: z.ZodString;
2131
+ data: z.ZodPipe<z.ZodObject<{
2132
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2133
+ vol: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2134
+ open: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2135
+ klines: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodNumber], null>, z.ZodTransform<{
2136
+ timestamp: EpochMilliseconds;
2137
+ open: DecimalString;
2138
+ high: DecimalString;
2139
+ low: DecimalString;
2140
+ close: DecimalString;
2141
+ volume: DecimalString;
2142
+ trades: number;
2143
+ }, [EpochMilliseconds, DecimalString, DecimalString, DecimalString, DecimalString, DecimalString, number]>>>;
2144
+ }, z.core.$strip>, z.ZodTransform<{
2145
+ instrumentId: PerpsInstrumentId;
2146
+ volume: DecimalString;
2147
+ openPrice: DecimalString;
2148
+ klines: {
2149
+ timestamp: EpochMilliseconds;
2150
+ open: DecimalString;
2151
+ high: DecimalString;
2152
+ low: DecimalString;
2153
+ close: DecimalString;
2154
+ volume: DecimalString;
2155
+ trades: number;
2156
+ }[];
2157
+ }, {
2158
+ iid: PerpsInstrumentId;
2159
+ vol: DecimalString;
2160
+ open: DecimalString;
2161
+ klines: {
2162
+ timestamp: EpochMilliseconds;
2163
+ open: DecimalString;
2164
+ high: DecimalString;
2165
+ low: DecimalString;
2166
+ close: DecimalString;
2167
+ volume: DecimalString;
2168
+ trades: number;
2169
+ }[];
2170
+ }>>;
2171
+ }, z.core.$strip>, z.ZodTransform<{
2172
+ topic: "perps.statistics";
2173
+ type: "statistic";
2174
+ channel: string;
2175
+ timestamp: EpochMilliseconds;
2176
+ sequence: number;
2177
+ payload: {
2178
+ instrumentId: PerpsInstrumentId;
2179
+ volume: DecimalString;
2180
+ openPrice: DecimalString;
2181
+ klines: {
2182
+ timestamp: EpochMilliseconds;
2183
+ open: DecimalString;
2184
+ high: DecimalString;
2185
+ low: DecimalString;
2186
+ close: DecimalString;
2187
+ volume: DecimalString;
2188
+ trades: number;
2189
+ }[];
2190
+ };
2191
+ }, {
2192
+ ts: EpochMilliseconds;
2193
+ sq: number;
2194
+ ch: string;
2195
+ data: {
2196
+ instrumentId: PerpsInstrumentId;
2197
+ volume: DecimalString;
2198
+ openPrice: DecimalString;
2199
+ klines: {
2200
+ timestamp: EpochMilliseconds;
2201
+ open: DecimalString;
2202
+ high: DecimalString;
2203
+ low: DecimalString;
2204
+ close: DecimalString;
2205
+ volume: DecimalString;
2206
+ trades: number;
2207
+ }[];
2208
+ };
2209
+ }>>, z.ZodPipe<z.ZodObject<{
2210
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2211
+ sq: z.ZodNumber;
2212
+ ch: z.ZodString;
2213
+ data: z.ZodArray<z.ZodPipe<z.ZodTuple<[z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodNumber], null>, z.ZodTransform<{
2214
+ timestamp: EpochMilliseconds;
2215
+ open: DecimalString;
2216
+ high: DecimalString;
2217
+ low: DecimalString;
2218
+ close: DecimalString;
2219
+ volume: DecimalString;
2220
+ trades: number;
2221
+ }, [EpochMilliseconds, DecimalString, DecimalString, DecimalString, DecimalString, DecimalString, number]>>>;
2222
+ }, z.core.$strip>, z.ZodTransform<{
2223
+ topic: "perps.candles";
2224
+ type: "candle";
2225
+ channel: string;
2226
+ timestamp: EpochMilliseconds;
2227
+ sequence: number;
2228
+ payload: {
2229
+ instrumentId: PerpsInstrumentId;
2230
+ interval: PerpsKlineInterval.OneMinute | PerpsKlineInterval.FiveMinutes | PerpsKlineInterval.FifteenMinutes | PerpsKlineInterval.OneHour | PerpsKlineInterval.FourHours | PerpsKlineInterval.OneDay | PerpsKlineInterval.OneWeek;
2231
+ candles: {
2232
+ timestamp: EpochMilliseconds;
2233
+ open: DecimalString;
2234
+ high: DecimalString;
2235
+ low: DecimalString;
2236
+ close: DecimalString;
2237
+ volume: DecimalString;
2238
+ trades: number;
2239
+ }[];
2240
+ };
2241
+ }, {
2242
+ ts: EpochMilliseconds;
2243
+ sq: number;
2244
+ ch: string;
2245
+ data: {
2246
+ timestamp: EpochMilliseconds;
2247
+ open: DecimalString;
2248
+ high: DecimalString;
2249
+ low: DecimalString;
2250
+ close: DecimalString;
2251
+ volume: DecimalString;
2252
+ trades: number;
2253
+ }[];
2254
+ }>>]>;
2255
+ type PerpsMarketDataEvent = z.infer<typeof PerpsMarketDataEventSchema>;
2256
+ declare const PerpsBalanceUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2257
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2258
+ sq: z.ZodNumber;
2259
+ ch: z.ZodLiteral<"balances">;
2260
+ data: z.ZodObject<{
2261
+ asset: z.ZodString;
2262
+ balance: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2263
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2264
+ }, z.core.$strip>;
2265
+ }, z.core.$strip>, z.ZodTransform<{
2266
+ type: "balance";
2267
+ channel: "balances";
2268
+ timestamp: number;
2269
+ sequence: number;
2270
+ payload: {
2271
+ asset: string;
2272
+ balance: DecimalString;
2273
+ value: DecimalString;
2274
+ };
2275
+ }, {
2276
+ ts: EpochMilliseconds;
2277
+ sq: number;
2278
+ ch: "balances";
2279
+ data: {
2280
+ asset: string;
2281
+ balance: DecimalString;
2282
+ value: DecimalString;
2283
+ };
2284
+ }>>;
2285
+ type PerpsBalanceUpdateEvent = z.infer<typeof PerpsBalanceUpdateEventSchema>;
2286
+ declare const PerpsPortfolioUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2287
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2288
+ sq: z.ZodNumber;
2289
+ ch: z.ZodLiteral<"portfolio">;
2290
+ data: z.ZodPipe<z.ZodObject<{
2291
+ positions: z.ZodArray<z.ZodPipe<z.ZodObject<{
2292
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2293
+ symbol: z.ZodString;
2294
+ size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2295
+ entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2296
+ leverage: z.ZodNumber;
2297
+ cross: z.ZodBoolean;
2298
+ initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2299
+ maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2300
+ position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2301
+ liquidation_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2302
+ unrealized_pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2303
+ return_on_equity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2304
+ cumulative_funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2305
+ }, z.core.$strip>, z.ZodTransform<{
2306
+ instrumentId: PerpsInstrumentId;
2307
+ symbol: string;
2308
+ size: DecimalString;
2309
+ entryPrice: DecimalString;
2310
+ leverage: number;
2311
+ cross: boolean;
2312
+ initialMargin: DecimalString;
2313
+ maintenanceMargin: DecimalString;
2314
+ positionValue: DecimalString;
2315
+ liquidationPrice: DecimalString;
2316
+ unrealizedPnl: DecimalString;
2317
+ returnOnEquity: DecimalString;
2318
+ cumulativeFunding: DecimalString;
2319
+ }, {
2320
+ instrument_id: PerpsInstrumentId;
2321
+ symbol: string;
2322
+ size: DecimalString;
2323
+ entry_price: DecimalString;
2324
+ leverage: number;
2325
+ cross: boolean;
2326
+ initial_margin: DecimalString;
2327
+ maintenance_margin: DecimalString;
2328
+ position_value: DecimalString;
2329
+ liquidation_price: DecimalString;
2330
+ unrealized_pnl: DecimalString;
2331
+ return_on_equity: DecimalString;
2332
+ cumulative_funding: DecimalString;
2333
+ }>>>;
2334
+ margin: z.ZodPipe<z.ZodObject<{
2335
+ total_account_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2336
+ total_initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2337
+ total_maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2338
+ total_position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2339
+ }, z.core.$strip>, z.ZodTransform<{
2340
+ totalAccountValue: DecimalString;
2341
+ totalInitialMargin: DecimalString;
2342
+ totalMaintenanceMargin: DecimalString;
2343
+ totalPositionValue: DecimalString;
2344
+ }, {
2345
+ total_account_value: DecimalString;
2346
+ total_initial_margin: DecimalString;
2347
+ total_maintenance_margin: DecimalString;
2348
+ total_position_value: DecimalString;
2349
+ }>>;
2350
+ withdrawable: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2351
+ in_liquidation: z.ZodBoolean;
2352
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2353
+ }, z.core.$strip>, z.ZodTransform<{
2354
+ positions: {
2355
+ instrumentId: PerpsInstrumentId;
2356
+ symbol: string;
2357
+ size: DecimalString;
2358
+ entryPrice: DecimalString;
2359
+ leverage: number;
2360
+ cross: boolean;
2361
+ initialMargin: DecimalString;
2362
+ maintenanceMargin: DecimalString;
2363
+ positionValue: DecimalString;
2364
+ liquidationPrice: DecimalString;
2365
+ unrealizedPnl: DecimalString;
2366
+ returnOnEquity: DecimalString;
2367
+ cumulativeFunding: DecimalString;
2368
+ }[];
2369
+ margin: {
2370
+ totalAccountValue: DecimalString;
2371
+ totalInitialMargin: DecimalString;
2372
+ totalMaintenanceMargin: DecimalString;
2373
+ totalPositionValue: DecimalString;
2374
+ };
2375
+ withdrawable: DecimalString;
2376
+ inLiquidation: boolean;
2377
+ timestamp: EpochMilliseconds;
2378
+ }, {
2379
+ positions: {
2380
+ instrumentId: PerpsInstrumentId;
2381
+ symbol: string;
2382
+ size: DecimalString;
2383
+ entryPrice: DecimalString;
2384
+ leverage: number;
2385
+ cross: boolean;
2386
+ initialMargin: DecimalString;
2387
+ maintenanceMargin: DecimalString;
2388
+ positionValue: DecimalString;
2389
+ liquidationPrice: DecimalString;
2390
+ unrealizedPnl: DecimalString;
2391
+ returnOnEquity: DecimalString;
2392
+ cumulativeFunding: DecimalString;
2393
+ }[];
2394
+ margin: {
2395
+ totalAccountValue: DecimalString;
2396
+ totalInitialMargin: DecimalString;
2397
+ totalMaintenanceMargin: DecimalString;
2398
+ totalPositionValue: DecimalString;
2399
+ };
2400
+ withdrawable: DecimalString;
2401
+ in_liquidation: boolean;
2402
+ timestamp: EpochMilliseconds;
2403
+ }>>;
2404
+ }, z.core.$strip>, z.ZodTransform<{
2405
+ type: "portfolio";
2406
+ channel: "portfolio";
2407
+ timestamp: number;
2408
+ sequence: number;
2409
+ payload: {
2410
+ positions: {
2411
+ instrumentId: PerpsInstrumentId;
2412
+ symbol: string;
2413
+ size: DecimalString;
2414
+ entryPrice: DecimalString;
2415
+ leverage: number;
2416
+ cross: boolean;
2417
+ initialMargin: DecimalString;
2418
+ maintenanceMargin: DecimalString;
2419
+ positionValue: DecimalString;
2420
+ liquidationPrice: DecimalString;
2421
+ unrealizedPnl: DecimalString;
2422
+ returnOnEquity: DecimalString;
2423
+ cumulativeFunding: DecimalString;
2424
+ }[];
2425
+ margin: {
2426
+ totalAccountValue: DecimalString;
2427
+ totalInitialMargin: DecimalString;
2428
+ totalMaintenanceMargin: DecimalString;
2429
+ totalPositionValue: DecimalString;
2430
+ };
2431
+ withdrawable: DecimalString;
2432
+ inLiquidation: boolean;
2433
+ timestamp: EpochMilliseconds;
2434
+ };
2435
+ }, {
2436
+ ts: EpochMilliseconds;
2437
+ sq: number;
2438
+ ch: "portfolio";
2439
+ data: {
2440
+ positions: {
2441
+ instrumentId: PerpsInstrumentId;
2442
+ symbol: string;
2443
+ size: DecimalString;
2444
+ entryPrice: DecimalString;
2445
+ leverage: number;
2446
+ cross: boolean;
2447
+ initialMargin: DecimalString;
2448
+ maintenanceMargin: DecimalString;
2449
+ positionValue: DecimalString;
2450
+ liquidationPrice: DecimalString;
2451
+ unrealizedPnl: DecimalString;
2452
+ returnOnEquity: DecimalString;
2453
+ cumulativeFunding: DecimalString;
2454
+ }[];
2455
+ margin: {
2456
+ totalAccountValue: DecimalString;
2457
+ totalInitialMargin: DecimalString;
2458
+ totalMaintenanceMargin: DecimalString;
2459
+ totalPositionValue: DecimalString;
2460
+ };
2461
+ withdrawable: DecimalString;
2462
+ inLiquidation: boolean;
2463
+ timestamp: EpochMilliseconds;
2464
+ };
2465
+ }>>;
2466
+ type PerpsPortfolioUpdateEvent = z.infer<typeof PerpsPortfolioUpdateEventSchema>;
2467
+ declare const PerpsOrderUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2468
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2469
+ sq: z.ZodNumber;
2470
+ ch: z.ZodLiteral<"orders">;
2471
+ data: z.ZodPipe<z.ZodObject<{
2472
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
2473
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2474
+ buy: z.ZodBoolean;
2475
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2476
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2477
+ tif: z.ZodEnum<typeof PerpsTimeInForce>;
2478
+ po: z.ZodBoolean;
2479
+ status: z.ZodEnum<typeof PerpsOrderStatus>;
2480
+ rest: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2481
+ fill: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2482
+ cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2483
+ uts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2484
+ coid: z.ZodOptional<z.ZodString>;
2485
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
2486
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
2487
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
2488
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2489
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
2490
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
2491
+ slip_bps: z.ZodOptional<z.ZodNumber>;
2492
+ }, z.core.$strip>, z.ZodTransform<{
2493
+ kind: PerpsTpSlKind;
2494
+ scope: PerpsTpSlScope;
2495
+ triggerPrice: DecimalString;
2496
+ parentOrderId: PerpsOrderId | undefined;
2497
+ armedQuantity: DecimalString | undefined;
2498
+ slippageBps: number | undefined;
2499
+ }, {
2500
+ kind: PerpsTpSlKind;
2501
+ scope: PerpsTpSlScope;
2502
+ trp: DecimalString;
2503
+ parent_oid?: PerpsOrderId | undefined;
2504
+ armed_qty?: DecimalString | undefined;
2505
+ slip_bps?: number | undefined;
2506
+ }>>>>;
2507
+ }, z.core.$strip>, z.ZodTransform<{
2508
+ id: PerpsOrderId;
2509
+ instrumentId: PerpsInstrumentId;
2510
+ side: OrderSide;
2511
+ price: DecimalString;
2512
+ quantity: DecimalString;
2513
+ timeInForce: PerpsTimeInForce;
2514
+ postOnly: boolean;
2515
+ status: PerpsOrderStatus;
2516
+ restingQuantity: DecimalString;
2517
+ filledQuantity: DecimalString;
2518
+ createdTimestamp: EpochMilliseconds;
2519
+ updatedTimestamp: EpochMilliseconds;
2520
+ clientOrderId: string | undefined;
2521
+ tpSl: {
2522
+ kind: PerpsTpSlKind;
2523
+ scope: PerpsTpSlScope;
2524
+ triggerPrice: DecimalString;
2525
+ parentOrderId: PerpsOrderId | undefined;
2526
+ armedQuantity: DecimalString | undefined;
2527
+ slippageBps: number | undefined;
2528
+ } | undefined;
2529
+ }, {
2530
+ oid: PerpsOrderId;
2531
+ iid: PerpsInstrumentId;
2532
+ buy: boolean;
2533
+ p: DecimalString;
2534
+ qty: DecimalString;
2535
+ tif: PerpsTimeInForce;
2536
+ po: boolean;
2537
+ status: PerpsOrderStatus;
2538
+ rest: DecimalString;
2539
+ fill: DecimalString;
2540
+ cts: EpochMilliseconds;
2541
+ uts: EpochMilliseconds;
2542
+ coid?: string | undefined;
2543
+ tpsl?: {
2544
+ kind: PerpsTpSlKind;
2545
+ scope: PerpsTpSlScope;
2546
+ triggerPrice: DecimalString;
2547
+ parentOrderId: PerpsOrderId | undefined;
2548
+ armedQuantity: DecimalString | undefined;
2549
+ slippageBps: number | undefined;
2550
+ } | null | undefined;
2551
+ }>>;
2552
+ }, z.core.$strip>, z.ZodTransform<{
2553
+ type: "order";
2554
+ channel: "orders";
2555
+ timestamp: number;
2556
+ sequence: number;
2557
+ payload: {
2558
+ id: PerpsOrderId;
2559
+ instrumentId: PerpsInstrumentId;
2560
+ side: OrderSide;
2561
+ price: DecimalString;
2562
+ quantity: DecimalString;
2563
+ timeInForce: PerpsTimeInForce;
2564
+ postOnly: boolean;
2565
+ status: PerpsOrderStatus;
2566
+ restingQuantity: DecimalString;
2567
+ filledQuantity: DecimalString;
2568
+ createdTimestamp: EpochMilliseconds;
2569
+ updatedTimestamp: EpochMilliseconds;
2570
+ clientOrderId: string | undefined;
2571
+ tpSl: {
2572
+ kind: PerpsTpSlKind;
2573
+ scope: PerpsTpSlScope;
2574
+ triggerPrice: DecimalString;
2575
+ parentOrderId: PerpsOrderId | undefined;
2576
+ armedQuantity: DecimalString | undefined;
2577
+ slippageBps: number | undefined;
2578
+ } | undefined;
2579
+ };
2580
+ }, {
2581
+ ts: EpochMilliseconds;
2582
+ sq: number;
2583
+ ch: "orders";
2584
+ data: {
2585
+ id: PerpsOrderId;
2586
+ instrumentId: PerpsInstrumentId;
2587
+ side: OrderSide;
2588
+ price: DecimalString;
2589
+ quantity: DecimalString;
2590
+ timeInForce: PerpsTimeInForce;
2591
+ postOnly: boolean;
2592
+ status: PerpsOrderStatus;
2593
+ restingQuantity: DecimalString;
2594
+ filledQuantity: DecimalString;
2595
+ createdTimestamp: EpochMilliseconds;
2596
+ updatedTimestamp: EpochMilliseconds;
2597
+ clientOrderId: string | undefined;
2598
+ tpSl: {
2599
+ kind: PerpsTpSlKind;
2600
+ scope: PerpsTpSlScope;
2601
+ triggerPrice: DecimalString;
2602
+ parentOrderId: PerpsOrderId | undefined;
2603
+ armedQuantity: DecimalString | undefined;
2604
+ slippageBps: number | undefined;
2605
+ } | undefined;
2606
+ };
2607
+ }>>;
2608
+ type PerpsOrderUpdateEvent = z.infer<typeof PerpsOrderUpdateEventSchema>;
2609
+ declare const PerpsFillUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2610
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2611
+ sq: z.ZodNumber;
2612
+ ch: z.ZodLiteral<"fills">;
2613
+ data: z.ZodPipe<z.ZodObject<{
2614
+ tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
2615
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
2616
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2617
+ side: z.ZodEnum<typeof PerpsSide>;
2618
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2619
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2620
+ taker: z.ZodBoolean;
2621
+ fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2622
+ fea: z.ZodString;
2623
+ psz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2624
+ pep: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2625
+ pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2626
+ liq: z.ZodBoolean;
2627
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2628
+ coid: z.ZodOptional<z.ZodString>;
2629
+ }, z.core.$strip>, z.ZodTransform<{
2630
+ tradeId: PerpsTradeId;
2631
+ orderId: PerpsOrderId;
2632
+ instrumentId: PerpsInstrumentId;
2633
+ side: PerpsSide;
2634
+ price: DecimalString;
2635
+ quantity: DecimalString;
2636
+ taker: boolean;
2637
+ fee: DecimalString;
2638
+ feeAsset: string;
2639
+ previousSize: DecimalString;
2640
+ previousEntryPrice: DecimalString;
2641
+ pnl: DecimalString;
2642
+ liquidation: boolean;
2643
+ timestamp: EpochMilliseconds;
2644
+ clientOrderId: string | undefined;
2645
+ }, {
2646
+ tid: PerpsTradeId;
2647
+ oid: PerpsOrderId;
2648
+ iid: PerpsInstrumentId;
2649
+ side: PerpsSide;
2650
+ p: DecimalString;
2651
+ qty: DecimalString;
2652
+ taker: boolean;
2653
+ fee: DecimalString;
2654
+ fea: string;
2655
+ psz: DecimalString;
2656
+ pep: DecimalString;
2657
+ pnl: DecimalString;
2658
+ liq: boolean;
2659
+ ts: EpochMilliseconds;
2660
+ coid?: string | undefined;
2661
+ }>>;
2662
+ }, z.core.$strip>, z.ZodTransform<{
2663
+ type: "fill";
2664
+ channel: "fills";
2665
+ timestamp: number;
2666
+ sequence: number;
2667
+ payload: {
2668
+ tradeId: PerpsTradeId;
2669
+ orderId: PerpsOrderId;
2670
+ instrumentId: PerpsInstrumentId;
2671
+ side: PerpsSide;
2672
+ price: DecimalString;
2673
+ quantity: DecimalString;
2674
+ taker: boolean;
2675
+ fee: DecimalString;
2676
+ feeAsset: string;
2677
+ previousSize: DecimalString;
2678
+ previousEntryPrice: DecimalString;
2679
+ pnl: DecimalString;
2680
+ liquidation: boolean;
2681
+ timestamp: EpochMilliseconds;
2682
+ clientOrderId: string | undefined;
2683
+ };
2684
+ }, {
2685
+ ts: EpochMilliseconds;
2686
+ sq: number;
2687
+ ch: "fills";
2688
+ data: {
2689
+ tradeId: PerpsTradeId;
2690
+ orderId: PerpsOrderId;
2691
+ instrumentId: PerpsInstrumentId;
2692
+ side: PerpsSide;
2693
+ price: DecimalString;
2694
+ quantity: DecimalString;
2695
+ taker: boolean;
2696
+ fee: DecimalString;
2697
+ feeAsset: string;
2698
+ previousSize: DecimalString;
2699
+ previousEntryPrice: DecimalString;
2700
+ pnl: DecimalString;
2701
+ liquidation: boolean;
2702
+ timestamp: EpochMilliseconds;
2703
+ clientOrderId: string | undefined;
2704
+ };
2705
+ }>>;
2706
+ type PerpsFillUpdateEvent = z.infer<typeof PerpsFillUpdateEventSchema>;
2707
+ declare const PerpsFundingUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2708
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2709
+ sq: z.ZodNumber;
2710
+ ch: z.ZodLiteral<"funding">;
2711
+ data: z.ZodPipe<z.ZodObject<{
2712
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2713
+ sz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2714
+ fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2715
+ fund: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2716
+ fua: z.ZodString;
2717
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2718
+ }, z.core.$strip>, z.ZodTransform<{
2719
+ instrumentId: PerpsInstrumentId;
2720
+ size: DecimalString;
2721
+ fundingRate: DecimalString;
2722
+ fundingAsset: string;
2723
+ funding: DecimalString;
2724
+ timestamp: EpochMilliseconds;
2725
+ }, {
2726
+ iid: PerpsInstrumentId;
2727
+ sz: DecimalString;
2728
+ fr: DecimalString;
2729
+ fund: DecimalString;
2730
+ fua: string;
2731
+ ts: EpochMilliseconds;
2732
+ }>>;
2733
+ }, z.core.$strip>, z.ZodTransform<{
2734
+ type: "funding";
2735
+ channel: "funding";
2736
+ timestamp: number;
2737
+ sequence: number;
2738
+ payload: {
2739
+ instrumentId: PerpsInstrumentId;
2740
+ size: DecimalString;
2741
+ fundingRate: DecimalString;
2742
+ fundingAsset: string;
2743
+ funding: DecimalString;
2744
+ timestamp: EpochMilliseconds;
2745
+ };
2746
+ }, {
2747
+ ts: EpochMilliseconds;
2748
+ sq: number;
2749
+ ch: "funding";
2750
+ data: {
2751
+ instrumentId: PerpsInstrumentId;
2752
+ size: DecimalString;
2753
+ fundingRate: DecimalString;
2754
+ fundingAsset: string;
2755
+ funding: DecimalString;
2756
+ timestamp: EpochMilliseconds;
2757
+ };
2758
+ }>>;
2759
+ type PerpsFundingUpdateEvent = z.infer<typeof PerpsFundingUpdateEventSchema>;
2760
+ declare const PerpsDepositUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2761
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2762
+ sq: z.ZodNumber;
2763
+ ch: z.ZodLiteral<"deposits">;
2764
+ data: z.ZodPipe<z.ZodObject<{
2765
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
2766
+ asset: z.ZodString;
2767
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
2768
+ status: z.ZodEnum<typeof PerpsDepositStatus>;
2769
+ }, z.core.$strip>, z.ZodTransform<{
2770
+ hash: _polymarket_types.TxHash | undefined;
2771
+ asset: string;
2772
+ amount: BaseUnits;
2773
+ status: PerpsDepositStatus;
2774
+ }, {
2775
+ asset: string;
2776
+ amount: BaseUnits;
2777
+ status: PerpsDepositStatus;
2778
+ hash?: _polymarket_types.TxHash | undefined;
2779
+ }>>;
2780
+ }, z.core.$strip>, z.ZodTransform<{
2781
+ type: "deposit";
2782
+ channel: "deposits";
2783
+ timestamp: number;
2784
+ sequence: number;
2785
+ payload: {
2786
+ hash: _polymarket_types.TxHash | undefined;
2787
+ asset: string;
2788
+ amount: BaseUnits;
2789
+ status: PerpsDepositStatus;
2790
+ };
2791
+ }, {
2792
+ ts: EpochMilliseconds;
2793
+ sq: number;
2794
+ ch: "deposits";
2795
+ data: {
2796
+ hash: _polymarket_types.TxHash | undefined;
2797
+ asset: string;
2798
+ amount: BaseUnits;
2799
+ status: PerpsDepositStatus;
2800
+ };
2801
+ }>>;
2802
+ type PerpsDepositUpdateEvent = z.infer<typeof PerpsDepositUpdateEventSchema>;
2803
+ declare const PerpsWithdrawalUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2804
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2805
+ sq: z.ZodNumber;
2806
+ ch: z.ZodLiteral<"withdrawals">;
2807
+ data: z.ZodPipe<z.ZodObject<{
2808
+ withdraw_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsWithdrawalId, number>>;
2809
+ asset: z.ZodString;
2810
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
2811
+ fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2812
+ status: z.ZodEnum<typeof PerpsWithdrawalStatus>;
2813
+ to: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
2814
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
2815
+ }, z.core.$strip>, z.ZodTransform<{
2816
+ withdrawalId: PerpsWithdrawalId;
2817
+ asset: string;
2818
+ amount: BaseUnits;
2819
+ fee: DecimalString;
2820
+ status: PerpsWithdrawalStatus;
2821
+ to: _polymarket_types.EvmAddress;
2822
+ hash: _polymarket_types.TxHash | undefined;
2823
+ }, {
2824
+ withdraw_id: PerpsWithdrawalId;
2825
+ asset: string;
2826
+ amount: BaseUnits;
2827
+ fee: DecimalString;
2828
+ status: PerpsWithdrawalStatus;
2829
+ to: _polymarket_types.EvmAddress;
2830
+ hash?: _polymarket_types.TxHash | undefined;
2831
+ }>>;
2832
+ }, z.core.$strip>, z.ZodTransform<{
2833
+ type: "withdrawal";
2834
+ channel: "withdrawals";
2835
+ timestamp: number;
2836
+ sequence: number;
2837
+ payload: {
2838
+ withdrawalId: PerpsWithdrawalId;
2839
+ asset: string;
2840
+ amount: BaseUnits;
2841
+ fee: DecimalString;
2842
+ status: PerpsWithdrawalStatus;
2843
+ to: _polymarket_types.EvmAddress;
2844
+ hash: _polymarket_types.TxHash | undefined;
2845
+ };
2846
+ }, {
2847
+ ts: EpochMilliseconds;
2848
+ sq: number;
2849
+ ch: "withdrawals";
2850
+ data: {
2851
+ withdrawalId: PerpsWithdrawalId;
2852
+ asset: string;
2853
+ amount: BaseUnits;
2854
+ fee: DecimalString;
2855
+ status: PerpsWithdrawalStatus;
2856
+ to: _polymarket_types.EvmAddress;
2857
+ hash: _polymarket_types.TxHash | undefined;
2858
+ };
2859
+ }>>;
2860
+ type PerpsWithdrawalUpdateEvent = z.infer<typeof PerpsWithdrawalUpdateEventSchema>;
2861
+ declare const PerpsTpSlUpdateEventSchema: z.ZodPipe<z.ZodObject<{
2862
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2863
+ sq: z.ZodNumber;
2864
+ ch: z.ZodString;
2865
+ data: z.ZodPipe<z.ZodObject<{
2866
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
2867
+ st: z.ZodEnum<{
2868
+ cancelled: "cancelled";
2869
+ untriggered: "untriggered";
2870
+ armed: "armed";
2871
+ expired: "expired";
2872
+ }>;
2873
+ reason: z.ZodOptional<z.ZodString>;
2874
+ }, z.core.$strip>, z.ZodTransform<{
2875
+ orderId: PerpsOrderId;
2876
+ status: "cancelled" | "untriggered" | "armed" | "expired";
2877
+ reason: string | undefined;
2878
+ }, {
2879
+ oid: PerpsOrderId;
2880
+ st: "cancelled" | "untriggered" | "armed" | "expired";
2881
+ reason?: string | undefined;
2882
+ }>>;
2883
+ }, z.core.$strip>, z.ZodTransform<{
2884
+ type: "tpsl";
2885
+ channel: string;
2886
+ timestamp: EpochMilliseconds;
2887
+ sequence: number;
2888
+ payload: {
2889
+ orderId: PerpsOrderId;
2890
+ status: "cancelled" | "untriggered" | "armed" | "expired";
2891
+ reason: string | undefined;
2892
+ };
2893
+ }, {
2894
+ ts: EpochMilliseconds;
2895
+ sq: number;
2896
+ ch: string;
2897
+ data: {
2898
+ orderId: PerpsOrderId;
2899
+ status: "cancelled" | "untriggered" | "armed" | "expired";
2900
+ reason: string | undefined;
2901
+ };
2902
+ }>>;
2903
+ type PerpsTpSlUpdateEvent = z.infer<typeof PerpsTpSlUpdateEventSchema>;
2904
+ declare const PerpsSessionUpdateEventSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
2905
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2906
+ sq: z.ZodNumber;
2907
+ ch: z.ZodLiteral<"balances">;
2908
+ data: z.ZodObject<{
2909
+ asset: z.ZodString;
2910
+ balance: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2911
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2912
+ }, z.core.$strip>;
2913
+ }, z.core.$strip>, z.ZodTransform<{
2914
+ type: "balance";
2915
+ channel: "balances";
2916
+ timestamp: number;
2917
+ sequence: number;
2918
+ payload: {
2919
+ asset: string;
2920
+ balance: DecimalString;
2921
+ value: DecimalString;
2922
+ };
2923
+ }, {
2924
+ ts: EpochMilliseconds;
2925
+ sq: number;
2926
+ ch: "balances";
2927
+ data: {
2928
+ asset: string;
2929
+ balance: DecimalString;
2930
+ value: DecimalString;
2931
+ };
2932
+ }>>, z.ZodPipe<z.ZodObject<{
2933
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2934
+ sq: z.ZodNumber;
2935
+ ch: z.ZodLiteral<"portfolio">;
2936
+ data: z.ZodPipe<z.ZodObject<{
2937
+ positions: z.ZodArray<z.ZodPipe<z.ZodObject<{
2938
+ instrument_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
2939
+ symbol: z.ZodString;
2940
+ size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2941
+ entry_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2942
+ leverage: z.ZodNumber;
2943
+ cross: z.ZodBoolean;
2944
+ initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2945
+ maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2946
+ position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2947
+ liquidation_price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2948
+ unrealized_pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2949
+ return_on_equity: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2950
+ cumulative_funding: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2951
+ }, z.core.$strip>, z.ZodTransform<{
2952
+ instrumentId: PerpsInstrumentId;
2953
+ symbol: string;
2954
+ size: DecimalString;
2955
+ entryPrice: DecimalString;
2956
+ leverage: number;
2957
+ cross: boolean;
2958
+ initialMargin: DecimalString;
2959
+ maintenanceMargin: DecimalString;
2960
+ positionValue: DecimalString;
2961
+ liquidationPrice: DecimalString;
2962
+ unrealizedPnl: DecimalString;
2963
+ returnOnEquity: DecimalString;
2964
+ cumulativeFunding: DecimalString;
2965
+ }, {
2966
+ instrument_id: PerpsInstrumentId;
2967
+ symbol: string;
2968
+ size: DecimalString;
2969
+ entry_price: DecimalString;
2970
+ leverage: number;
2971
+ cross: boolean;
2972
+ initial_margin: DecimalString;
2973
+ maintenance_margin: DecimalString;
2974
+ position_value: DecimalString;
2975
+ liquidation_price: DecimalString;
2976
+ unrealized_pnl: DecimalString;
2977
+ return_on_equity: DecimalString;
2978
+ cumulative_funding: DecimalString;
2979
+ }>>>;
2980
+ margin: z.ZodPipe<z.ZodObject<{
2981
+ total_account_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2982
+ total_initial_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2983
+ total_maintenance_margin: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2984
+ total_position_value: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2985
+ }, z.core.$strip>, z.ZodTransform<{
2986
+ totalAccountValue: DecimalString;
2987
+ totalInitialMargin: DecimalString;
2988
+ totalMaintenanceMargin: DecimalString;
2989
+ totalPositionValue: DecimalString;
2990
+ }, {
2991
+ total_account_value: DecimalString;
2992
+ total_initial_margin: DecimalString;
2993
+ total_maintenance_margin: DecimalString;
2994
+ total_position_value: DecimalString;
2995
+ }>>;
2996
+ withdrawable: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
2997
+ in_liquidation: z.ZodBoolean;
2998
+ timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
2999
+ }, z.core.$strip>, z.ZodTransform<{
3000
+ positions: {
3001
+ instrumentId: PerpsInstrumentId;
3002
+ symbol: string;
3003
+ size: DecimalString;
3004
+ entryPrice: DecimalString;
3005
+ leverage: number;
3006
+ cross: boolean;
3007
+ initialMargin: DecimalString;
3008
+ maintenanceMargin: DecimalString;
3009
+ positionValue: DecimalString;
3010
+ liquidationPrice: DecimalString;
3011
+ unrealizedPnl: DecimalString;
3012
+ returnOnEquity: DecimalString;
3013
+ cumulativeFunding: DecimalString;
3014
+ }[];
3015
+ margin: {
3016
+ totalAccountValue: DecimalString;
3017
+ totalInitialMargin: DecimalString;
3018
+ totalMaintenanceMargin: DecimalString;
3019
+ totalPositionValue: DecimalString;
3020
+ };
3021
+ withdrawable: DecimalString;
3022
+ inLiquidation: boolean;
3023
+ timestamp: EpochMilliseconds;
3024
+ }, {
3025
+ positions: {
3026
+ instrumentId: PerpsInstrumentId;
3027
+ symbol: string;
3028
+ size: DecimalString;
3029
+ entryPrice: DecimalString;
3030
+ leverage: number;
3031
+ cross: boolean;
3032
+ initialMargin: DecimalString;
3033
+ maintenanceMargin: DecimalString;
3034
+ positionValue: DecimalString;
3035
+ liquidationPrice: DecimalString;
3036
+ unrealizedPnl: DecimalString;
3037
+ returnOnEquity: DecimalString;
3038
+ cumulativeFunding: DecimalString;
3039
+ }[];
3040
+ margin: {
3041
+ totalAccountValue: DecimalString;
3042
+ totalInitialMargin: DecimalString;
3043
+ totalMaintenanceMargin: DecimalString;
3044
+ totalPositionValue: DecimalString;
3045
+ };
3046
+ withdrawable: DecimalString;
3047
+ in_liquidation: boolean;
3048
+ timestamp: EpochMilliseconds;
3049
+ }>>;
3050
+ }, z.core.$strip>, z.ZodTransform<{
3051
+ type: "portfolio";
3052
+ channel: "portfolio";
3053
+ timestamp: number;
3054
+ sequence: number;
3055
+ payload: {
3056
+ positions: {
3057
+ instrumentId: PerpsInstrumentId;
3058
+ symbol: string;
3059
+ size: DecimalString;
3060
+ entryPrice: DecimalString;
3061
+ leverage: number;
3062
+ cross: boolean;
3063
+ initialMargin: DecimalString;
3064
+ maintenanceMargin: DecimalString;
3065
+ positionValue: DecimalString;
3066
+ liquidationPrice: DecimalString;
3067
+ unrealizedPnl: DecimalString;
3068
+ returnOnEquity: DecimalString;
3069
+ cumulativeFunding: DecimalString;
3070
+ }[];
3071
+ margin: {
3072
+ totalAccountValue: DecimalString;
3073
+ totalInitialMargin: DecimalString;
3074
+ totalMaintenanceMargin: DecimalString;
3075
+ totalPositionValue: DecimalString;
3076
+ };
3077
+ withdrawable: DecimalString;
3078
+ inLiquidation: boolean;
3079
+ timestamp: EpochMilliseconds;
3080
+ };
3081
+ }, {
3082
+ ts: EpochMilliseconds;
3083
+ sq: number;
3084
+ ch: "portfolio";
3085
+ data: {
3086
+ positions: {
3087
+ instrumentId: PerpsInstrumentId;
3088
+ symbol: string;
3089
+ size: DecimalString;
3090
+ entryPrice: DecimalString;
3091
+ leverage: number;
3092
+ cross: boolean;
3093
+ initialMargin: DecimalString;
3094
+ maintenanceMargin: DecimalString;
3095
+ positionValue: DecimalString;
3096
+ liquidationPrice: DecimalString;
3097
+ unrealizedPnl: DecimalString;
3098
+ returnOnEquity: DecimalString;
3099
+ cumulativeFunding: DecimalString;
3100
+ }[];
3101
+ margin: {
3102
+ totalAccountValue: DecimalString;
3103
+ totalInitialMargin: DecimalString;
3104
+ totalMaintenanceMargin: DecimalString;
3105
+ totalPositionValue: DecimalString;
3106
+ };
3107
+ withdrawable: DecimalString;
3108
+ inLiquidation: boolean;
3109
+ timestamp: EpochMilliseconds;
3110
+ };
3111
+ }>>, z.ZodPipe<z.ZodObject<{
3112
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3113
+ sq: z.ZodNumber;
3114
+ ch: z.ZodLiteral<"orders">;
3115
+ data: z.ZodPipe<z.ZodObject<{
3116
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
3117
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
3118
+ buy: z.ZodBoolean;
3119
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3120
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3121
+ tif: z.ZodEnum<typeof PerpsTimeInForce>;
3122
+ po: z.ZodBoolean;
3123
+ status: z.ZodEnum<typeof PerpsOrderStatus>;
3124
+ rest: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3125
+ fill: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3126
+ cts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3127
+ uts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3128
+ coid: z.ZodOptional<z.ZodString>;
3129
+ tpsl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
3130
+ kind: z.ZodEnum<typeof PerpsTpSlKind>;
3131
+ scope: z.ZodEnum<typeof PerpsTpSlScope>;
3132
+ trp: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3133
+ parent_oid: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>>;
3134
+ armed_qty: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
3135
+ slip_bps: z.ZodOptional<z.ZodNumber>;
3136
+ }, z.core.$strip>, z.ZodTransform<{
3137
+ kind: PerpsTpSlKind;
3138
+ scope: PerpsTpSlScope;
3139
+ triggerPrice: DecimalString;
3140
+ parentOrderId: PerpsOrderId | undefined;
3141
+ armedQuantity: DecimalString | undefined;
3142
+ slippageBps: number | undefined;
3143
+ }, {
3144
+ kind: PerpsTpSlKind;
3145
+ scope: PerpsTpSlScope;
3146
+ trp: DecimalString;
3147
+ parent_oid?: PerpsOrderId | undefined;
3148
+ armed_qty?: DecimalString | undefined;
3149
+ slip_bps?: number | undefined;
3150
+ }>>>>;
3151
+ }, z.core.$strip>, z.ZodTransform<{
3152
+ id: PerpsOrderId;
3153
+ instrumentId: PerpsInstrumentId;
3154
+ side: OrderSide;
3155
+ price: DecimalString;
3156
+ quantity: DecimalString;
3157
+ timeInForce: PerpsTimeInForce;
3158
+ postOnly: boolean;
3159
+ status: PerpsOrderStatus;
3160
+ restingQuantity: DecimalString;
3161
+ filledQuantity: DecimalString;
3162
+ createdTimestamp: EpochMilliseconds;
3163
+ updatedTimestamp: EpochMilliseconds;
3164
+ clientOrderId: string | undefined;
3165
+ tpSl: {
3166
+ kind: PerpsTpSlKind;
3167
+ scope: PerpsTpSlScope;
3168
+ triggerPrice: DecimalString;
3169
+ parentOrderId: PerpsOrderId | undefined;
3170
+ armedQuantity: DecimalString | undefined;
3171
+ slippageBps: number | undefined;
3172
+ } | undefined;
3173
+ }, {
3174
+ oid: PerpsOrderId;
3175
+ iid: PerpsInstrumentId;
3176
+ buy: boolean;
3177
+ p: DecimalString;
3178
+ qty: DecimalString;
3179
+ tif: PerpsTimeInForce;
3180
+ po: boolean;
3181
+ status: PerpsOrderStatus;
3182
+ rest: DecimalString;
3183
+ fill: DecimalString;
3184
+ cts: EpochMilliseconds;
3185
+ uts: EpochMilliseconds;
3186
+ coid?: string | undefined;
3187
+ tpsl?: {
3188
+ kind: PerpsTpSlKind;
3189
+ scope: PerpsTpSlScope;
3190
+ triggerPrice: DecimalString;
3191
+ parentOrderId: PerpsOrderId | undefined;
3192
+ armedQuantity: DecimalString | undefined;
3193
+ slippageBps: number | undefined;
3194
+ } | null | undefined;
3195
+ }>>;
3196
+ }, z.core.$strip>, z.ZodTransform<{
3197
+ type: "order";
3198
+ channel: "orders";
3199
+ timestamp: number;
3200
+ sequence: number;
3201
+ payload: {
3202
+ id: PerpsOrderId;
3203
+ instrumentId: PerpsInstrumentId;
3204
+ side: OrderSide;
3205
+ price: DecimalString;
3206
+ quantity: DecimalString;
3207
+ timeInForce: PerpsTimeInForce;
3208
+ postOnly: boolean;
3209
+ status: PerpsOrderStatus;
3210
+ restingQuantity: DecimalString;
3211
+ filledQuantity: DecimalString;
3212
+ createdTimestamp: EpochMilliseconds;
3213
+ updatedTimestamp: EpochMilliseconds;
3214
+ clientOrderId: string | undefined;
3215
+ tpSl: {
3216
+ kind: PerpsTpSlKind;
3217
+ scope: PerpsTpSlScope;
3218
+ triggerPrice: DecimalString;
3219
+ parentOrderId: PerpsOrderId | undefined;
3220
+ armedQuantity: DecimalString | undefined;
3221
+ slippageBps: number | undefined;
3222
+ } | undefined;
3223
+ };
3224
+ }, {
3225
+ ts: EpochMilliseconds;
3226
+ sq: number;
3227
+ ch: "orders";
3228
+ data: {
3229
+ id: PerpsOrderId;
3230
+ instrumentId: PerpsInstrumentId;
3231
+ side: OrderSide;
3232
+ price: DecimalString;
3233
+ quantity: DecimalString;
3234
+ timeInForce: PerpsTimeInForce;
3235
+ postOnly: boolean;
3236
+ status: PerpsOrderStatus;
3237
+ restingQuantity: DecimalString;
3238
+ filledQuantity: DecimalString;
3239
+ createdTimestamp: EpochMilliseconds;
3240
+ updatedTimestamp: EpochMilliseconds;
3241
+ clientOrderId: string | undefined;
3242
+ tpSl: {
3243
+ kind: PerpsTpSlKind;
3244
+ scope: PerpsTpSlScope;
3245
+ triggerPrice: DecimalString;
3246
+ parentOrderId: PerpsOrderId | undefined;
3247
+ armedQuantity: DecimalString | undefined;
3248
+ slippageBps: number | undefined;
3249
+ } | undefined;
3250
+ };
3251
+ }>>, z.ZodPipe<z.ZodObject<{
3252
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3253
+ sq: z.ZodNumber;
3254
+ ch: z.ZodLiteral<"fills">;
3255
+ data: z.ZodPipe<z.ZodObject<{
3256
+ tid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsTradeId, number>>;
3257
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
3258
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
3259
+ side: z.ZodEnum<typeof PerpsSide>;
3260
+ p: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3261
+ qty: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3262
+ taker: z.ZodBoolean;
3263
+ fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3264
+ fea: z.ZodString;
3265
+ psz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3266
+ pep: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3267
+ pnl: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3268
+ liq: z.ZodBoolean;
3269
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3270
+ coid: z.ZodOptional<z.ZodString>;
3271
+ }, z.core.$strip>, z.ZodTransform<{
3272
+ tradeId: PerpsTradeId;
3273
+ orderId: PerpsOrderId;
3274
+ instrumentId: PerpsInstrumentId;
3275
+ side: PerpsSide;
3276
+ price: DecimalString;
3277
+ quantity: DecimalString;
3278
+ taker: boolean;
3279
+ fee: DecimalString;
3280
+ feeAsset: string;
3281
+ previousSize: DecimalString;
3282
+ previousEntryPrice: DecimalString;
3283
+ pnl: DecimalString;
3284
+ liquidation: boolean;
3285
+ timestamp: EpochMilliseconds;
3286
+ clientOrderId: string | undefined;
3287
+ }, {
3288
+ tid: PerpsTradeId;
3289
+ oid: PerpsOrderId;
3290
+ iid: PerpsInstrumentId;
3291
+ side: PerpsSide;
3292
+ p: DecimalString;
3293
+ qty: DecimalString;
3294
+ taker: boolean;
3295
+ fee: DecimalString;
3296
+ fea: string;
3297
+ psz: DecimalString;
3298
+ pep: DecimalString;
3299
+ pnl: DecimalString;
3300
+ liq: boolean;
3301
+ ts: EpochMilliseconds;
3302
+ coid?: string | undefined;
3303
+ }>>;
3304
+ }, z.core.$strip>, z.ZodTransform<{
3305
+ type: "fill";
3306
+ channel: "fills";
3307
+ timestamp: number;
3308
+ sequence: number;
3309
+ payload: {
3310
+ tradeId: PerpsTradeId;
3311
+ orderId: PerpsOrderId;
3312
+ instrumentId: PerpsInstrumentId;
3313
+ side: PerpsSide;
3314
+ price: DecimalString;
3315
+ quantity: DecimalString;
3316
+ taker: boolean;
3317
+ fee: DecimalString;
3318
+ feeAsset: string;
3319
+ previousSize: DecimalString;
3320
+ previousEntryPrice: DecimalString;
3321
+ pnl: DecimalString;
3322
+ liquidation: boolean;
3323
+ timestamp: EpochMilliseconds;
3324
+ clientOrderId: string | undefined;
3325
+ };
3326
+ }, {
3327
+ ts: EpochMilliseconds;
3328
+ sq: number;
3329
+ ch: "fills";
3330
+ data: {
3331
+ tradeId: PerpsTradeId;
3332
+ orderId: PerpsOrderId;
3333
+ instrumentId: PerpsInstrumentId;
3334
+ side: PerpsSide;
3335
+ price: DecimalString;
3336
+ quantity: DecimalString;
3337
+ taker: boolean;
3338
+ fee: DecimalString;
3339
+ feeAsset: string;
3340
+ previousSize: DecimalString;
3341
+ previousEntryPrice: DecimalString;
3342
+ pnl: DecimalString;
3343
+ liquidation: boolean;
3344
+ timestamp: EpochMilliseconds;
3345
+ clientOrderId: string | undefined;
3346
+ };
3347
+ }>>, z.ZodPipe<z.ZodObject<{
3348
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3349
+ sq: z.ZodNumber;
3350
+ ch: z.ZodLiteral<"funding">;
3351
+ data: z.ZodPipe<z.ZodObject<{
3352
+ iid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
3353
+ sz: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3354
+ fr: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3355
+ fund: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3356
+ fua: z.ZodString;
3357
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3358
+ }, z.core.$strip>, z.ZodTransform<{
3359
+ instrumentId: PerpsInstrumentId;
3360
+ size: DecimalString;
3361
+ fundingRate: DecimalString;
3362
+ fundingAsset: string;
3363
+ funding: DecimalString;
3364
+ timestamp: EpochMilliseconds;
3365
+ }, {
3366
+ iid: PerpsInstrumentId;
3367
+ sz: DecimalString;
3368
+ fr: DecimalString;
3369
+ fund: DecimalString;
3370
+ fua: string;
3371
+ ts: EpochMilliseconds;
3372
+ }>>;
3373
+ }, z.core.$strip>, z.ZodTransform<{
3374
+ type: "funding";
3375
+ channel: "funding";
3376
+ timestamp: number;
3377
+ sequence: number;
3378
+ payload: {
3379
+ instrumentId: PerpsInstrumentId;
3380
+ size: DecimalString;
3381
+ fundingRate: DecimalString;
3382
+ fundingAsset: string;
3383
+ funding: DecimalString;
3384
+ timestamp: EpochMilliseconds;
3385
+ };
3386
+ }, {
3387
+ ts: EpochMilliseconds;
3388
+ sq: number;
3389
+ ch: "funding";
3390
+ data: {
3391
+ instrumentId: PerpsInstrumentId;
3392
+ size: DecimalString;
3393
+ fundingRate: DecimalString;
3394
+ fundingAsset: string;
3395
+ funding: DecimalString;
3396
+ timestamp: EpochMilliseconds;
3397
+ };
3398
+ }>>, z.ZodPipe<z.ZodObject<{
3399
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3400
+ sq: z.ZodNumber;
3401
+ ch: z.ZodLiteral<"deposits">;
3402
+ data: z.ZodPipe<z.ZodObject<{
3403
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
3404
+ asset: z.ZodString;
3405
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
3406
+ status: z.ZodEnum<typeof PerpsDepositStatus>;
3407
+ }, z.core.$strip>, z.ZodTransform<{
3408
+ hash: _polymarket_types.TxHash | undefined;
3409
+ asset: string;
3410
+ amount: BaseUnits;
3411
+ status: PerpsDepositStatus;
3412
+ }, {
3413
+ asset: string;
3414
+ amount: BaseUnits;
3415
+ status: PerpsDepositStatus;
3416
+ hash?: _polymarket_types.TxHash | undefined;
3417
+ }>>;
3418
+ }, z.core.$strip>, z.ZodTransform<{
3419
+ type: "deposit";
3420
+ channel: "deposits";
3421
+ timestamp: number;
3422
+ sequence: number;
3423
+ payload: {
3424
+ hash: _polymarket_types.TxHash | undefined;
3425
+ asset: string;
3426
+ amount: BaseUnits;
3427
+ status: PerpsDepositStatus;
3428
+ };
3429
+ }, {
3430
+ ts: EpochMilliseconds;
3431
+ sq: number;
3432
+ ch: "deposits";
3433
+ data: {
3434
+ hash: _polymarket_types.TxHash | undefined;
3435
+ asset: string;
3436
+ amount: BaseUnits;
3437
+ status: PerpsDepositStatus;
3438
+ };
3439
+ }>>, z.ZodPipe<z.ZodObject<{
3440
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3441
+ sq: z.ZodNumber;
3442
+ ch: z.ZodLiteral<"withdrawals">;
3443
+ data: z.ZodPipe<z.ZodObject<{
3444
+ withdraw_id: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsWithdrawalId, number>>;
3445
+ asset: z.ZodString;
3446
+ amount: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
3447
+ fee: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
3448
+ status: z.ZodEnum<typeof PerpsWithdrawalStatus>;
3449
+ to: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.EvmAddress, string>>;
3450
+ hash: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>>;
3451
+ }, z.core.$strip>, z.ZodTransform<{
3452
+ withdrawalId: PerpsWithdrawalId;
3453
+ asset: string;
3454
+ amount: BaseUnits;
3455
+ fee: DecimalString;
3456
+ status: PerpsWithdrawalStatus;
3457
+ to: _polymarket_types.EvmAddress;
3458
+ hash: _polymarket_types.TxHash | undefined;
3459
+ }, {
3460
+ withdraw_id: PerpsWithdrawalId;
3461
+ asset: string;
3462
+ amount: BaseUnits;
3463
+ fee: DecimalString;
3464
+ status: PerpsWithdrawalStatus;
3465
+ to: _polymarket_types.EvmAddress;
3466
+ hash?: _polymarket_types.TxHash | undefined;
3467
+ }>>;
3468
+ }, z.core.$strip>, z.ZodTransform<{
3469
+ type: "withdrawal";
3470
+ channel: "withdrawals";
3471
+ timestamp: number;
3472
+ sequence: number;
3473
+ payload: {
3474
+ withdrawalId: PerpsWithdrawalId;
3475
+ asset: string;
3476
+ amount: BaseUnits;
3477
+ fee: DecimalString;
3478
+ status: PerpsWithdrawalStatus;
3479
+ to: _polymarket_types.EvmAddress;
3480
+ hash: _polymarket_types.TxHash | undefined;
3481
+ };
3482
+ }, {
3483
+ ts: EpochMilliseconds;
3484
+ sq: number;
3485
+ ch: "withdrawals";
3486
+ data: {
3487
+ withdrawalId: PerpsWithdrawalId;
3488
+ asset: string;
3489
+ amount: BaseUnits;
3490
+ fee: DecimalString;
3491
+ status: PerpsWithdrawalStatus;
3492
+ to: _polymarket_types.EvmAddress;
3493
+ hash: _polymarket_types.TxHash | undefined;
3494
+ };
3495
+ }>>, z.ZodPipe<z.ZodObject<{
3496
+ ts: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
3497
+ sq: z.ZodNumber;
3498
+ ch: z.ZodString;
3499
+ data: z.ZodPipe<z.ZodObject<{
3500
+ oid: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsOrderId, number>>;
3501
+ st: z.ZodEnum<{
3502
+ cancelled: "cancelled";
3503
+ untriggered: "untriggered";
3504
+ armed: "armed";
3505
+ expired: "expired";
3506
+ }>;
3507
+ reason: z.ZodOptional<z.ZodString>;
3508
+ }, z.core.$strip>, z.ZodTransform<{
3509
+ orderId: PerpsOrderId;
3510
+ status: "cancelled" | "untriggered" | "armed" | "expired";
3511
+ reason: string | undefined;
3512
+ }, {
3513
+ oid: PerpsOrderId;
3514
+ st: "cancelled" | "untriggered" | "armed" | "expired";
3515
+ reason?: string | undefined;
3516
+ }>>;
3517
+ }, z.core.$strip>, z.ZodTransform<{
3518
+ type: "tpsl";
3519
+ channel: string;
3520
+ timestamp: EpochMilliseconds;
3521
+ sequence: number;
3522
+ payload: {
3523
+ orderId: PerpsOrderId;
3524
+ status: "cancelled" | "untriggered" | "armed" | "expired";
3525
+ reason: string | undefined;
3526
+ };
3527
+ }, {
3528
+ ts: EpochMilliseconds;
3529
+ sq: number;
3530
+ ch: string;
3531
+ data: {
3532
+ orderId: PerpsOrderId;
3533
+ status: "cancelled" | "untriggered" | "armed" | "expired";
3534
+ reason: string | undefined;
3535
+ };
3536
+ }>>]>;
3537
+ type PerpsSessionUpdateEvent = z.infer<typeof PerpsSessionUpdateEventSchema>;
3538
+ type PerpsResyncEvent = {
3539
+ type: 'resync';
3540
+ reason: 'reconnect' | 'sequence_gap';
3541
+ channel?: string;
3542
+ previousSequence?: number;
3543
+ sequence?: number;
3544
+ };
3545
+ type PerpsSessionEvent = PerpsSessionUpdateEvent | PerpsResyncEvent;
3546
+
1529
3547
  declare const CommentRemovedPayloadSchema: z.ZodObject<{
1530
3548
  id: z.ZodString;
1531
3549
  body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -3746,4 +5764,4 @@ declare const SportsResultEventSchema: z.ZodPipe<z.ZodPipe<z.ZodObject<{
3746
5764
  }>>;
3747
5765
  type SportsEvent = z.infer<typeof SportsResultEventSchema>;
3748
5766
 
3749
- export { type CommentCreatedEvent, CommentCreatedEventSchema, type CommentRemovedEvent, CommentRemovedEventSchema, type CommentRemovedPayload, type CommentsEvent, CommentsEventSchema, type CryptoPricesBinanceEvent, CryptoPricesBinanceEventSchema, type CryptoPricesBinanceTopic, type CryptoPricesChainlinkEvent, CryptoPricesChainlinkEventSchema, type CryptoPricesChainlinkTopic, type CryptoPricesEvent, CryptoPricesEventSchema, type CryptoPricesTopic, type CustomMarketEvent, CustomMarketEventSchema, type EquityPriceSnapshotPoint, type EquityPriceSubscribePayload, type EquityPriceUpdatePayload, type EquityPricesEvent, EquityPricesEventSchema, type EquityPricesSubscribeEvent, EquityPricesSubscribeEventSchema, type EquityPricesTopic, type EquityPricesUpdateEvent, EquityPricesUpdateEventSchema, type MarketBestBidAskEvent, MarketBestBidAskEventSchema, type MarketBookEvent, MarketBookEventSchema, type MarketEvent, type MarketEventMessage, MarketEventSchema, type MarketLastTradePriceEvent, MarketLastTradePriceEventSchema, type MarketPriceChangeEvent, MarketPriceChangeEventSchema, type MarketResolvedEvent, MarketResolvedEventSchema, type MarketTickSizeChangeEvent, MarketTickSizeChangeEventSchema, type NewMarketEvent, NewMarketEventSchema, type OrderBookLevel, type PriceChange, type PriceUpdatePayload, type ReactionCreatedEvent, ReactionCreatedEventSchema, type ReactionRemovedEvent, ReactionRemovedEventSchema, type RealtimeEvent, RealtimeEventSchema, type SportsEvent, SportsResultEventSchema, type StandardMarketEvent, StandardMarketEventSchema, type TradeMakerOrder, TradeStatus, type UserEvent, UserEventSchema, type UserOrderEvent, UserOrderEventSchema, UserOrderEventType, UserOrderStatus, type UserTradeEvent, UserTradeEventSchema };
5767
+ export { type CommentCreatedEvent, CommentCreatedEventSchema, type CommentRemovedEvent, CommentRemovedEventSchema, type CommentRemovedPayload, type CommentsEvent, CommentsEventSchema, type CryptoPricesBinanceEvent, CryptoPricesBinanceEventSchema, type CryptoPricesBinanceTopic, type CryptoPricesChainlinkEvent, CryptoPricesChainlinkEventSchema, type CryptoPricesChainlinkTopic, type CryptoPricesEvent, CryptoPricesEventSchema, type CryptoPricesTopic, type CustomMarketEvent, CustomMarketEventSchema, type EquityPriceSnapshotPoint, type EquityPriceSubscribePayload, type EquityPriceUpdatePayload, type EquityPricesEvent, EquityPricesEventSchema, type EquityPricesSubscribeEvent, EquityPricesSubscribeEventSchema, type EquityPricesTopic, type EquityPricesUpdateEvent, EquityPricesUpdateEventSchema, type MarketBestBidAskEvent, MarketBestBidAskEventSchema, type MarketBookEvent, MarketBookEventSchema, type MarketEvent, type MarketEventMessage, MarketEventSchema, type MarketLastTradePriceEvent, MarketLastTradePriceEventSchema, type MarketPriceChangeEvent, MarketPriceChangeEventSchema, type MarketResolvedEvent, MarketResolvedEventSchema, type MarketTickSizeChangeEvent, MarketTickSizeChangeEventSchema, type NewMarketEvent, NewMarketEventSchema, type OrderBookLevel, type PerpsBalanceUpdateEvent, PerpsBalanceUpdateEventSchema, type PerpsBboEvent, PerpsBboEventSchema, type PerpsBookEvent, PerpsBookEventSchema, type PerpsCandleEvent, PerpsCandleEventSchema, type PerpsDepositUpdateEvent, PerpsDepositUpdateEventSchema, type PerpsFillUpdateEvent, PerpsFillUpdateEventSchema, type PerpsFundingUpdateEvent, PerpsFundingUpdateEventSchema, type PerpsMarketDataEvent, PerpsMarketDataEventSchema, type PerpsOrderUpdateEvent, PerpsOrderUpdateEventSchema, type PerpsPortfolioUpdateEvent, PerpsPortfolioUpdateEventSchema, type PerpsResyncEvent, type PerpsSessionEvent, type PerpsSessionUpdateEvent, PerpsSessionUpdateEventSchema, type PerpsStatisticEvent, PerpsStatisticEventSchema, type PerpsTickerEvent, PerpsTickerEventSchema, type PerpsTpSlUpdateEvent, PerpsTpSlUpdateEventSchema, type PerpsTradeEvent, PerpsTradeEventSchema, type PerpsWithdrawalUpdateEvent, PerpsWithdrawalUpdateEventSchema, type PriceChange, type PriceUpdatePayload, type ReactionCreatedEvent, ReactionCreatedEventSchema, type ReactionRemovedEvent, ReactionRemovedEventSchema, type RealtimeEvent, RealtimeEventSchema, type SportsEvent, SportsResultEventSchema, type StandardMarketEvent, StandardMarketEventSchema, type TradeMakerOrder, TradeStatus, type UserEvent, UserEventSchema, type UserOrderEvent, UserOrderEventSchema, UserOrderEventType, UserOrderStatus, type UserTradeEvent, UserTradeEventSchema };