@polymarket/client 0.1.0-beta.12 → 0.1.0-beta.13

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,8 +1,7 @@
1
1
  import * as _polymarket_bindings from '@polymarket/bindings';
2
- import { PaginationCursor, OrderSide, OrderType, TokenId, BuilderCode, EvmAddress as EvmAddress$1, CtfConditionId, TickSizeValue, TxHashSchema, PositionId, TransactionId } from '@polymarket/bindings';
3
- import * as _polymarket_types from '@polymarket/types';
4
- import { PolymarketError, HexString, EvmAddress, EvmSignature, NonEmptyArray, Prettify, Erc1271Signature, PrivateKey, TxHash } from '@polymarket/types';
5
- import { WalletType, Event, TagReference, Market, Series, Tag, RelatedTag, SportsMetadata, SportsMarketTypesResponse, Team, PublicProfile, Comment, Profile, SearchTag } from '@polymarket/bindings/gamma';
2
+ import { PaginationCursor, OrderSide, OrderType, TokenId, BuilderCode, EvmAddress as EvmAddress$1, CtfConditionId, TickSizeValue, PositionId, TransactionId } from '@polymarket/bindings';
3
+ import { PolymarketError, HexString, EvmAddress, EvmSignature, NonEmptyArray, Prettify, Erc1271Signature, TxHash } from '@polymarket/types';
4
+ import { WalletType, Event, TagReference, Market, Series, MarketClarification, Tag, RelatedTag, SportsMetadata, SportsMarketTypesResponse, Team, PublicProfile, Comment, MarketClarificationState, Profile, SearchTag } from '@polymarket/bindings/gamma';
6
5
  import { RelayerTransactionType, RelayerExecuteParams, GaslessTransaction } from '@polymarket/bindings/relayer';
7
6
  import { ZodError, z } from 'zod';
8
7
  import * as _polymarket_bindings_clob from '@polymarket/bindings/clob';
@@ -10,8 +9,7 @@ import { ClobTrade, NotificationsResponse, BuilderTrade, Prices, OrderBook, Last
10
9
  import * as _polymarket_bindings_data from '@polymarket/bindings/data';
11
10
  import { Value, Traded, ClosedPosition, ComboPosition, Position, MetaMarketPosition, Activity, LeaderboardEntry, BuilderVolumeEntry, TraderLeaderboardEntry, LiveVolume, OpenInterest, MetaHolder, Trade } from '@polymarket/bindings/data';
12
11
  import { ComboMarket, RfqQuoteRequest, RfqRequestedSize, RfqSide, RfqQuoteAck, RfqConfirmationRequest, RfqConfirmationAck as RfqConfirmationAck$1, RfqExecutionUpdate, RfqTrade, RfqQuoteCancelAck, RfqErrorCode, RfqId, RfqQuoteId } from '@polymarket/bindings/rfq';
13
- import * as _polymarket_bindings_perps from '@polymarket/bindings/perps';
14
- import { PerpsInstrument, PerpsTicker, PerpsBook, PerpsCandle, PerpsFundingRate, PerpsPublicTrade, PerpsFeeScheduleEntry, PerpsWithdrawalId, PerpsInstrumentId, PerpsDepositStatusSchema, PerpsWithdrawalStatusSchema, PerpsPnlIntervalSchema, PerpsDecimalInput, PerpsTimeInForce, PerpsCredentials, PerpsBalance, PerpsPortfolio, PerpsAccountStats, PerpsAccountConfig, PerpsOrder, PerpsAccountFill, PerpsAccountFundingPayment, PerpsDeposit, PerpsWithdrawal, PerpsEquityPoint, PerpsPnlPoint, PerpsOrderId, PerpsPostOrderAck, PerpsCancelOrderResult, PerpsUpdateLeverageResult, PerpsKlineInterval, PerpsInstrumentIdSchema } from '@polymarket/bindings/perps';
12
+ import { PerpsInstrument, PerpsTicker, PerpsBook, PerpsCandle, PerpsFundingRate, PerpsPublicTrade, PerpsFeeScheduleEntry, PerpsWithdrawalId, PerpsDepositStatus, PerpsWithdrawalStatus, PerpsPnlInterval, PerpsDecimalInput, PerpsTimeInForce, PerpsCredentials, PerpsBalance, PerpsPortfolio, PerpsAccountStats, PerpsAccountConfig, PerpsOrder, PerpsAccountFill, PerpsAccountFundingPayment, PerpsDeposit, PerpsWithdrawal, PerpsEquityPoint, PerpsPnlPoint, PerpsOrderId, PerpsPostOrderAck, PerpsCancelOrderResult, PerpsUpdateLeverageResult, PerpsInstrumentCategory, PerpsKlineInterval } from '@polymarket/bindings/perps';
15
13
  import { PerpsSessionEvent, CommentsEvent, CryptoPricesTopic, EquityPricesTopic, EquityPricesEvent, MarketEvent, StandardMarketEvent, UserEvent, SportsEvent, CryptoPricesBinanceEvent, CryptoPricesChainlinkEvent, PerpsTradeEvent, PerpsBboEvent, PerpsBookEvent, PerpsCandleEvent, PerpsTickerEvent, PerpsStatisticEvent, CryptoPricesEvent, PerpsMarketDataEvent } from '@polymarket/bindings/subscriptions';
16
14
  import { Hex } from 'ox';
17
15
 
@@ -1524,6 +1522,25 @@ type DiscoveryActions = {
1524
1522
  * ```
1525
1523
  */
1526
1524
  fetchSeries(request: FetchSeriesRequest): Promise<Series>;
1525
+ /**
1526
+ * Lists market clarifications — notes that resolve ambiguity in how a market
1527
+ * settles.
1528
+ *
1529
+ * @throws {@link ListMarketClarificationsError}
1530
+ * Thrown on failure.
1531
+ *
1532
+ * @example
1533
+ * ```ts
1534
+ * const paginator = client.listMarketClarifications({
1535
+ * marketId: '512038',
1536
+ * });
1537
+ *
1538
+ * for await (const page of paginator) {
1539
+ * // page.items: MarketClarification[]
1540
+ * }
1541
+ * ```
1542
+ */
1543
+ listMarketClarifications(request?: ListMarketClarificationsRequest): Paginated<MarketClarification[]>;
1527
1544
  /**
1528
1545
  * Lists tags.
1529
1546
  *
@@ -1799,6 +1816,11 @@ type PublicPerpsActions = {
1799
1816
  /**
1800
1817
  * Fetches Perps instruments.
1801
1818
  *
1819
+ * @example
1820
+ * ```ts
1821
+ * const instruments = await client.fetchPerpsInstruments();
1822
+ * ```
1823
+ *
1802
1824
  * @throws {@link FetchPerpsInstrumentsError}
1803
1825
  * Thrown on failure.
1804
1826
  */
@@ -1806,6 +1828,11 @@ type PublicPerpsActions = {
1806
1828
  /**
1807
1829
  * Fetches the current Perps ticker for an instrument.
1808
1830
  *
1831
+ * @example
1832
+ * ```ts
1833
+ * const ticker = await client.fetchPerpsTicker({ instrumentId: 1 });
1834
+ * ```
1835
+ *
1809
1836
  * @throws {@link FetchPerpsTickerError}
1810
1837
  * Thrown on failure.
1811
1838
  */
@@ -1813,6 +1840,11 @@ type PublicPerpsActions = {
1813
1840
  /**
1814
1841
  * Fetches current Perps tickers.
1815
1842
  *
1843
+ * @example
1844
+ * ```ts
1845
+ * const tickers = await client.fetchPerpsTickers();
1846
+ * ```
1847
+ *
1816
1848
  * @throws {@link FetchPerpsTickersError}
1817
1849
  * Thrown on failure.
1818
1850
  */
@@ -1820,6 +1852,11 @@ type PublicPerpsActions = {
1820
1852
  /**
1821
1853
  * Fetches a Perps order book.
1822
1854
  *
1855
+ * @example
1856
+ * ```ts
1857
+ * const book = await client.fetchPerpsBook({ instrumentId: 1, depth: 100 });
1858
+ * ```
1859
+ *
1823
1860
  * @throws {@link FetchPerpsBookError}
1824
1861
  * Thrown on failure.
1825
1862
  */
@@ -1827,6 +1864,16 @@ type PublicPerpsActions = {
1827
1864
  /**
1828
1865
  * Lists Perps candles for an instrument with SDK-owned pagination.
1829
1866
  *
1867
+ * @example
1868
+ * ```ts
1869
+ * for await (const candles of client.listPerpsCandles({
1870
+ * instrumentId: 1,
1871
+ * interval: PerpsKlineInterval.OneMinute,
1872
+ * })) {
1873
+ * console.log(candles);
1874
+ * }
1875
+ * ```
1876
+ *
1830
1877
  * @throws {@link ListPerpsCandlesError}
1831
1878
  * Thrown on failure.
1832
1879
  */
@@ -1834,6 +1881,15 @@ type PublicPerpsActions = {
1834
1881
  /**
1835
1882
  * Lists Perps funding-rate history for an instrument with SDK-owned pagination.
1836
1883
  *
1884
+ * @example
1885
+ * ```ts
1886
+ * for await (const rates of client.listPerpsFundingHistory({
1887
+ * instrumentId: 1,
1888
+ * })) {
1889
+ * console.log(rates);
1890
+ * }
1891
+ * ```
1892
+ *
1837
1893
  * @throws {@link ListPerpsFundingHistoryError}
1838
1894
  * Thrown on failure.
1839
1895
  */
@@ -1841,6 +1897,13 @@ type PublicPerpsActions = {
1841
1897
  /**
1842
1898
  * Lists recent Perps trades for an instrument with SDK-owned pagination.
1843
1899
  *
1900
+ * @example
1901
+ * ```ts
1902
+ * for await (const trades of client.listPerpsTrades({ instrumentId: 1 })) {
1903
+ * console.log(trades);
1904
+ * }
1905
+ * ```
1906
+ *
1844
1907
  * @throws {@link ListPerpsTradesError}
1845
1908
  * Thrown on failure.
1846
1909
  */
@@ -1848,6 +1911,11 @@ type PublicPerpsActions = {
1848
1911
  /**
1849
1912
  * Fetches the Perps fee schedule.
1850
1913
  *
1914
+ * @example
1915
+ * ```ts
1916
+ * const fees = await client.fetchPerpsFees();
1917
+ * ```
1918
+ *
1851
1919
  * @throws {@link FetchPerpsFeesError}
1852
1920
  * Thrown on failure.
1853
1921
  */
@@ -1857,6 +1925,11 @@ type SecurePerpsActions = PublicPerpsActions & {
1857
1925
  /**
1858
1926
  * Deposits collateral into Perps for the authenticated signer account.
1859
1927
  *
1928
+ * @example
1929
+ * ```ts
1930
+ * const transaction = await client.depositToPerps({ amount: 100_000_000n });
1931
+ * ```
1932
+ *
1860
1933
  * @throws {@link DepositToPerpsError}
1861
1934
  * Thrown on failure.
1862
1935
  */
@@ -1870,6 +1943,11 @@ type SecurePerpsActions = PublicPerpsActions & {
1870
1943
  * longer credential lifetime, or pass existing credentials to validate and
1871
1944
  * resume a previous session.
1872
1945
  *
1946
+ * @example
1947
+ * ```ts
1948
+ * const session = await client.openPerpsSession();
1949
+ * ```
1950
+ *
1873
1951
  * @throws {@link OpenPerpsSessionError}
1874
1952
  * Thrown on failure.
1875
1953
  */
@@ -1880,6 +1958,11 @@ type SecurePerpsActions = PublicPerpsActions & {
1880
1958
  * @remarks
1881
1959
  * This can revoke credentials outside the currently open Perps session.
1882
1960
  *
1961
+ * @example
1962
+ * ```ts
1963
+ * await client.revokePerpsCredentials({ proxy: session.credentials.proxy });
1964
+ * ```
1965
+ *
1883
1966
  * @throws {@link RevokePerpsCredentialsError}
1884
1967
  * Thrown on failure.
1885
1968
  */
@@ -1887,6 +1970,11 @@ type SecurePerpsActions = PublicPerpsActions & {
1887
1970
  /**
1888
1971
  * Requests a Perps withdrawal to the authenticated wallet.
1889
1972
  *
1973
+ * @example
1974
+ * ```ts
1975
+ * const withdrawalId = await client.withdrawFromPerps({ amount: 100_000_000n });
1976
+ * ```
1977
+ *
1890
1978
  * @throws {@link WithdrawFromPerpsError}
1891
1979
  * Thrown on failure.
1892
1980
  */
@@ -5400,6 +5488,63 @@ declare const ListTraderLeaderboardError: {
5400
5488
  */
5401
5489
  declare function listTraderLeaderboard(client: BaseClient, request?: ListTraderLeaderboardRequest): Paginated<TraderLeaderboardEntry[]>;
5402
5490
 
5491
+ declare const ListMarketClarificationsRequestSchema: z.ZodObject<{
5492
+ marketId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
5493
+ eventId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
5494
+ questionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
5495
+ state: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof MarketClarificationState>, z.ZodArray<z.ZodEnum<typeof MarketClarificationState>>]>>;
5496
+ showInFrontend: z.ZodOptional<z.ZodBoolean>;
5497
+ txHash: z.ZodOptional<z.ZodString>;
5498
+ order: z.ZodOptional<z.ZodString>;
5499
+ ascending: z.ZodOptional<z.ZodBoolean>;
5500
+ cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
5501
+ pageSize: z.ZodDefault<z.ZodNumber>;
5502
+ }, z.core.$strip>;
5503
+ type ListMarketClarificationsRequest = z.input<typeof ListMarketClarificationsRequestSchema>;
5504
+ type ListMarketClarificationsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
5505
+ declare const ListMarketClarificationsError: {
5506
+ isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
5507
+ };
5508
+ /**
5509
+ * Lists market clarifications — official notes that resolve ambiguity in how a
5510
+ * market settles.
5511
+ *
5512
+ * @remarks
5513
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5514
+ *
5515
+ * @throws {@link ListMarketClarificationsError}
5516
+ * Thrown on failure.
5517
+ *
5518
+ * @example
5519
+ * Fetch the first page of results:
5520
+ * ```ts
5521
+ * const result = listMarketClarifications(client, {
5522
+ * marketId: '512038',
5523
+ * pageSize: 25,
5524
+ * });
5525
+ *
5526
+ * const firstPage = await result.firstPage();
5527
+ *
5528
+ * // Optionally, fetch additional pages:
5529
+ * for await (const page of result.from(firstPage.nextCursor)) {
5530
+ * // page.items: MarketClarification[]
5531
+ * }
5532
+ * ```
5533
+ *
5534
+ * @example
5535
+ * Loop through all pages with `for await`:
5536
+ * ```ts
5537
+ * const result = listMarketClarifications(client, {
5538
+ * marketId: '512038',
5539
+ * });
5540
+ *
5541
+ * for await (const page of result) {
5542
+ * // page.items: MarketClarification[]
5543
+ * }
5544
+ * ```
5545
+ */
5546
+ declare function listMarketClarifications(client: BaseClient, request?: ListMarketClarificationsRequest): Paginated<MarketClarification[]>;
5547
+
5403
5548
  declare const ListMarketsRequestSchema: z.ZodObject<{
5404
5549
  ascending: z.ZodOptional<z.ZodBoolean>;
5405
5550
  closed: z.ZodOptional<z.ZodBoolean>;
@@ -5727,193 +5872,106 @@ declare const ListMarketPositionsError: {
5727
5872
  */
5728
5873
  declare function listMarketPositions(client: BaseClient, request: ListMarketPositionsRequest): Paginated<MetaMarketPosition[]>;
5729
5874
 
5730
- type PerpsHistoryParams = {
5731
- startTimestamp: number;
5732
- endTimestamp: number;
5733
- instrumentId?: PerpsInstrumentId;
5734
- depositStatus?: z.output<typeof PerpsDepositStatusSchema>;
5735
- withdrawalStatus?: z.output<typeof PerpsWithdrawalStatusSchema>;
5736
- hash?: z.output<typeof TxHashSchema>;
5737
- };
5738
- type PerpsIntervalHistoryParams = PerpsHistoryParams & {
5739
- interval: z.output<typeof PerpsPnlIntervalSchema>;
5740
- };
5741
- declare const FetchPerpsAccountConfigRequestSchema: z.ZodDefault<z.ZodObject<{
5742
- instrumentId: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>>;
5743
- }, z.core.$strip>>;
5744
- type FetchPerpsAccountConfigRequest = z.input<typeof FetchPerpsAccountConfigRequestSchema>;
5745
- declare const FetchPerpsOpenOrdersRequestSchema: z.ZodDefault<z.ZodObject<{
5746
- instrumentId: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>>;
5747
- }, z.core.$strip>>;
5748
- type FetchPerpsOpenOrdersRequest = z.input<typeof FetchPerpsOpenOrdersRequestSchema>;
5749
- declare const FetchPerpsOrdersRequestSchema: z.ZodPipe<z.ZodDefault<z.ZodObject<{
5750
- orderId: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsOrderId, number>>>;
5751
- clientOrderId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings_perps.PerpsClientOrderId, string>>>;
5752
- instrumentId: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>>;
5753
- start: z.ZodOptional<z.ZodNumber>;
5754
- end: z.ZodOptional<z.ZodNumber>;
5755
- }, z.core.$strip>>, z.ZodTransform<{
5756
- endTimestamp: number | undefined;
5757
- startTimestamp: number | undefined;
5758
- orderId?: _polymarket_bindings_perps.PerpsOrderId | undefined;
5759
- clientOrderId?: _polymarket_bindings_perps.PerpsClientOrderId | undefined;
5760
- instrumentId?: PerpsInstrumentId | undefined;
5761
- }, {
5762
- orderId?: _polymarket_bindings_perps.PerpsOrderId | undefined;
5763
- clientOrderId?: _polymarket_bindings_perps.PerpsClientOrderId | undefined;
5764
- instrumentId?: PerpsInstrumentId | undefined;
5765
- start?: number | undefined;
5766
- end?: number | undefined;
5767
- }>>;
5768
- type FetchPerpsOrdersRequest = z.input<typeof FetchPerpsOrdersRequestSchema>;
5769
- declare const ListPerpsFillsRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
5770
- start: z.ZodOptional<z.ZodNumber>;
5771
- end: z.ZodOptional<z.ZodNumber>;
5772
- cursor: z.ZodOptional<z.ZodCustom<PaginationCursor, PaginationCursor>>;
5773
- }, z.core.$strip>, z.ZodTransform<{
5774
- cursor: PaginationCursor | undefined;
5775
- params: Omit<Record<string, unknown>, "start" | "end"> & PerpsHistoryParams;
5776
- }, {
5777
- start?: number | undefined;
5778
- end?: number | undefined;
5779
- cursor?: PaginationCursor | undefined;
5780
- }>>, z.ZodPipe<z.ZodObject<{
5781
- cursor: z.ZodCustom<PaginationCursor, PaginationCursor>;
5782
- }, z.core.$strip>, z.ZodTransform<{
5783
- cursor: PaginationCursor;
5784
- params: undefined;
5785
- }, {
5786
- cursor: PaginationCursor;
5787
- }>>]>;
5788
- type ListPerpsFillsRequest = z.input<typeof ListPerpsFillsRequestSchema>;
5789
- declare const ListPerpsFundingPaymentsRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
5790
- start: z.ZodOptional<z.ZodNumber>;
5791
- end: z.ZodOptional<z.ZodNumber>;
5792
- cursor: z.ZodOptional<z.ZodCustom<PaginationCursor, PaginationCursor>>;
5793
- instrumentId: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>>;
5794
- }, z.core.$strip>, z.ZodTransform<{
5795
- cursor: PaginationCursor | undefined;
5796
- params: Omit<{
5797
- start?: number | undefined;
5798
- end?: number | undefined;
5799
- instrumentId?: PerpsInstrumentId | undefined;
5800
- }, "start" | "end"> & PerpsHistoryParams;
5801
- }, {
5802
- start?: number | undefined;
5803
- end?: number | undefined;
5804
- cursor?: PaginationCursor | undefined;
5805
- instrumentId?: PerpsInstrumentId | undefined;
5806
- }>>, z.ZodPipe<z.ZodObject<{
5807
- cursor: z.ZodCustom<PaginationCursor, PaginationCursor>;
5808
- }, z.core.$strip>, z.ZodTransform<{
5809
- cursor: PaginationCursor;
5810
- params: undefined;
5811
- }, {
5812
- cursor: PaginationCursor;
5813
- }>>]>;
5814
- type ListPerpsFundingPaymentsRequest = z.input<typeof ListPerpsFundingPaymentsRequestSchema>;
5815
- declare const ListPerpsDepositsRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
5816
- start: z.ZodOptional<z.ZodNumber>;
5817
- end: z.ZodOptional<z.ZodNumber>;
5818
- cursor: z.ZodOptional<z.ZodCustom<PaginationCursor, PaginationCursor>>;
5819
- depositStatus: z.ZodOptional<z.ZodEnum<typeof _polymarket_bindings_perps.PerpsDepositStatus>>;
5820
- hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>;
5821
- }, z.core.$strip>, z.ZodTransform<{
5822
- cursor: PaginationCursor | undefined;
5823
- params: Omit<{
5824
- start?: number | undefined;
5825
- end?: number | undefined;
5826
- depositStatus?: _polymarket_bindings_perps.PerpsDepositStatus | undefined;
5827
- hash?: _polymarket_types.TxHash | undefined;
5828
- }, "start" | "end"> & PerpsHistoryParams;
5829
- }, {
5830
- start?: number | undefined;
5831
- end?: number | undefined;
5832
- cursor?: PaginationCursor | undefined;
5833
- depositStatus?: _polymarket_bindings_perps.PerpsDepositStatus | undefined;
5834
- hash?: _polymarket_types.TxHash | undefined;
5835
- }>>, z.ZodPipe<z.ZodObject<{
5836
- cursor: z.ZodCustom<PaginationCursor, PaginationCursor>;
5837
- }, z.core.$strip>, z.ZodTransform<{
5875
+ type FetchPerpsAccountConfigRequest = {
5876
+ /** Optional Perps instrument identifier filter. */
5877
+ instrumentId?: number;
5878
+ };
5879
+ type FetchPerpsOpenOrdersRequest = {
5880
+ /** Optional Perps instrument identifier filter. */
5881
+ instrumentId?: number;
5882
+ };
5883
+ type FetchPerpsOrdersRequest = {
5884
+ /** Optional order identifier filter. */
5885
+ orderId?: number;
5886
+ /** Optional caller-supplied idempotency identifier filter. */
5887
+ clientOrderId?: string;
5888
+ /** Optional Perps instrument identifier filter. */
5889
+ instrumentId?: number;
5890
+ /** Inclusive start timestamp in milliseconds. */
5891
+ start?: number;
5892
+ /** Inclusive end timestamp in milliseconds. */
5893
+ end?: number;
5894
+ };
5895
+ type ListPerpsFillsRequest = {
5896
+ /** Inclusive start timestamp in milliseconds. */
5897
+ start?: number;
5898
+ /** Inclusive end timestamp in milliseconds. */
5899
+ end?: number;
5900
+ /** Opaque cursor returned by a previous page. */
5901
+ cursor?: PaginationCursor;
5902
+ } | {
5903
+ /** Opaque cursor returned by a previous page. */
5838
5904
  cursor: PaginationCursor;
5839
- params: undefined;
5840
- }, {
5905
+ };
5906
+ type ListPerpsFundingPaymentsRequest = {
5907
+ /** Optional Perps instrument identifier filter. */
5908
+ instrumentId?: number;
5909
+ /** Inclusive start timestamp in milliseconds. */
5910
+ start?: number;
5911
+ /** Inclusive end timestamp in milliseconds. */
5912
+ end?: number;
5913
+ /** Opaque cursor returned by a previous page. */
5914
+ cursor?: PaginationCursor;
5915
+ } | {
5916
+ /** Opaque cursor returned by a previous page. */
5841
5917
  cursor: PaginationCursor;
5842
- }>>]>;
5843
- type ListPerpsDepositsRequest = z.input<typeof ListPerpsDepositsRequestSchema>;
5844
- declare const ListPerpsWithdrawalsRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
5845
- start: z.ZodOptional<z.ZodNumber>;
5846
- end: z.ZodOptional<z.ZodNumber>;
5847
- cursor: z.ZodOptional<z.ZodCustom<PaginationCursor, PaginationCursor>>;
5848
- withdrawalStatus: z.ZodOptional<z.ZodEnum<typeof _polymarket_bindings_perps.PerpsWithdrawalStatus>>;
5849
- hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>;
5850
- }, z.core.$strip>, z.ZodTransform<{
5851
- cursor: PaginationCursor | undefined;
5852
- params: Omit<{
5853
- start?: number | undefined;
5854
- end?: number | undefined;
5855
- withdrawalStatus?: _polymarket_bindings_perps.PerpsWithdrawalStatus | undefined;
5856
- hash?: _polymarket_types.TxHash | undefined;
5857
- }, "start" | "end"> & PerpsHistoryParams;
5858
- }, {
5859
- start?: number | undefined;
5860
- end?: number | undefined;
5861
- cursor?: PaginationCursor | undefined;
5862
- withdrawalStatus?: _polymarket_bindings_perps.PerpsWithdrawalStatus | undefined;
5863
- hash?: _polymarket_types.TxHash | undefined;
5864
- }>>, z.ZodPipe<z.ZodObject<{
5865
- cursor: z.ZodCustom<PaginationCursor, PaginationCursor>;
5866
- }, z.core.$strip>, z.ZodTransform<{
5918
+ };
5919
+ type ListPerpsDepositsRequest = {
5920
+ /** Optional deposit status filter. */
5921
+ depositStatus?: PerpsDepositStatus;
5922
+ /** Optional transaction hash filter. */
5923
+ hash?: string;
5924
+ /** Inclusive start timestamp in milliseconds. */
5925
+ start?: number;
5926
+ /** Inclusive end timestamp in milliseconds. */
5927
+ end?: number;
5928
+ /** Opaque cursor returned by a previous page. */
5929
+ cursor?: PaginationCursor;
5930
+ } | {
5931
+ /** Opaque cursor returned by a previous page. */
5867
5932
  cursor: PaginationCursor;
5868
- params: undefined;
5869
- }, {
5933
+ };
5934
+ type ListPerpsWithdrawalsRequest = {
5935
+ /** Optional withdrawal status filter. */
5936
+ withdrawalStatus?: PerpsWithdrawalStatus;
5937
+ /** Optional transaction hash filter. */
5938
+ hash?: string;
5939
+ /** Inclusive start timestamp in milliseconds. */
5940
+ start?: number;
5941
+ /** Inclusive end timestamp in milliseconds. */
5942
+ end?: number;
5943
+ /** Opaque cursor returned by a previous page. */
5944
+ cursor?: PaginationCursor;
5945
+ } | {
5946
+ /** Opaque cursor returned by a previous page. */
5870
5947
  cursor: PaginationCursor;
5871
- }>>]>;
5872
- type ListPerpsWithdrawalsRequest = z.input<typeof ListPerpsWithdrawalsRequestSchema>;
5873
- declare const ListPerpsEquityHistoryRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
5874
- interval: z.ZodEnum<typeof _polymarket_bindings_perps.PerpsPnlInterval>;
5875
- start: z.ZodNumber;
5876
- end: z.ZodOptional<z.ZodNumber>;
5877
- cursor: z.ZodOptional<z.ZodCustom<PaginationCursor, PaginationCursor>>;
5878
- }, z.core.$strip>, z.ZodTransform<{
5879
- cursor: PaginationCursor | undefined;
5880
- params: PerpsIntervalHistoryParams;
5881
- }, {
5882
- interval: _polymarket_bindings_perps.PerpsPnlInterval;
5948
+ };
5949
+ type ListPerpsEquityHistoryRequest = {
5950
+ /** History interval. */
5951
+ interval: PerpsPnlInterval;
5952
+ /** Inclusive start timestamp in milliseconds. */
5883
5953
  start: number;
5884
- end?: number | undefined;
5885
- cursor?: PaginationCursor | undefined;
5886
- }>>, z.ZodPipe<z.ZodObject<{
5887
- cursor: z.ZodCustom<PaginationCursor, PaginationCursor>;
5888
- }, z.core.$strip>, z.ZodTransform<{
5889
- cursor: PaginationCursor;
5890
- params: undefined;
5891
- }, {
5954
+ /** Inclusive end timestamp in milliseconds. */
5955
+ end?: number;
5956
+ /** Opaque cursor returned by a previous page. */
5957
+ cursor?: PaginationCursor;
5958
+ } | {
5959
+ /** Opaque cursor returned by a previous page. */
5892
5960
  cursor: PaginationCursor;
5893
- }>>]>;
5894
- type ListPerpsEquityHistoryRequest = z.input<typeof ListPerpsEquityHistoryRequestSchema>;
5895
- declare const ListPerpsPnlHistoryRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
5896
- interval: z.ZodEnum<typeof _polymarket_bindings_perps.PerpsPnlInterval>;
5897
- start: z.ZodNumber;
5898
- end: z.ZodOptional<z.ZodNumber>;
5899
- cursor: z.ZodOptional<z.ZodCustom<PaginationCursor, PaginationCursor>>;
5900
- }, z.core.$strip>, z.ZodTransform<{
5901
- cursor: PaginationCursor | undefined;
5902
- params: PerpsIntervalHistoryParams;
5903
- }, {
5904
- interval: _polymarket_bindings_perps.PerpsPnlInterval;
5961
+ };
5962
+ type ListPerpsPnlHistoryRequest = {
5963
+ /** History interval. */
5964
+ interval: PerpsPnlInterval;
5965
+ /** Inclusive start timestamp in milliseconds. */
5905
5966
  start: number;
5906
- end?: number | undefined;
5907
- cursor?: PaginationCursor | undefined;
5908
- }>>, z.ZodPipe<z.ZodObject<{
5909
- cursor: z.ZodCustom<PaginationCursor, PaginationCursor>;
5910
- }, z.core.$strip>, z.ZodTransform<{
5911
- cursor: PaginationCursor;
5912
- params: undefined;
5913
- }, {
5967
+ /** Inclusive end timestamp in milliseconds. */
5968
+ end?: number;
5969
+ /** Opaque cursor returned by a previous page. */
5970
+ cursor?: PaginationCursor;
5971
+ } | {
5972
+ /** Opaque cursor returned by a previous page. */
5914
5973
  cursor: PaginationCursor;
5915
- }>>]>;
5916
- type ListPerpsPnlHistoryRequest = z.input<typeof ListPerpsPnlHistoryRequestSchema>;
5974
+ };
5917
5975
 
5918
5976
  /**
5919
5977
  * Good-til-cancelled Perps order.
@@ -5931,6 +5989,8 @@ type PerpsPlaceGtcOrderRequest = {
5931
5989
  timeInForce: PerpsTimeInForce.GTC;
5932
5990
  /** Whether the order must rest instead of taking liquidity. */
5933
5991
  postOnly?: boolean;
5992
+ /** Whether the order may only reduce or close an existing position. */
5993
+ reduceOnly?: boolean;
5934
5994
  /** Optional caller-supplied idempotency identifier. */
5935
5995
  clientOrderId?: string;
5936
5996
  };
@@ -5948,7 +6008,9 @@ type PerpsPlaceIocOrderRequest = {
5948
6008
  quantity: PerpsDecimalInput;
5949
6009
  /** Immediate-or-cancel execution. */
5950
6010
  timeInForce: PerpsTimeInForce.IOC;
5951
- postOnly?: undefined;
6011
+ postOnly?: never;
6012
+ /** Whether the order may only reduce or close an existing position. */
6013
+ reduceOnly?: boolean;
5952
6014
  /** Optional caller-supplied idempotency identifier. */
5953
6015
  clientOrderId?: string;
5954
6016
  };
@@ -5966,7 +6028,9 @@ type PerpsPlaceFokOrderRequest = {
5966
6028
  quantity: PerpsDecimalInput;
5967
6029
  /** Fill-or-kill execution. */
5968
6030
  timeInForce: PerpsTimeInForce.FOK;
5969
- postOnly?: undefined;
6031
+ postOnly?: never;
6032
+ /** Whether the order may only reduce or close an existing position. */
6033
+ reduceOnly?: boolean;
5970
6034
  /** Optional caller-supplied idempotency identifier. */
5971
6035
  clientOrderId?: string;
5972
6036
  };
@@ -5981,13 +6045,6 @@ type PerpsTpSlTrigger = {
5981
6045
  type PerpsPositionTpSlTrigger = {
5982
6046
  triggerPrice: PerpsDecimalInput;
5983
6047
  };
5984
- type PerpsTpSlPairRequest = {
5985
- takeProfit: PerpsTpSlTrigger;
5986
- stopLoss?: PerpsTpSlTrigger;
5987
- } | {
5988
- takeProfit?: PerpsTpSlTrigger;
5989
- stopLoss: PerpsTpSlTrigger;
5990
- };
5991
6048
  /** Request parameters for posting one or more Perps orders. */
5992
6049
  type PostPerpsOrdersRequest = {
5993
6050
  /** Orders to post as one command. */
@@ -5995,13 +6052,202 @@ type PostPerpsOrdersRequest = {
5995
6052
  /** Optional command expiration timestamp in milliseconds. */
5996
6053
  expiresAt?: number;
5997
6054
  };
5998
- type PlacePerpsOrderRequest = PerpsOrderRequest & {
6055
+ type PlacePerpsOrderRequest = {
6056
+ /** Perps instrument identifier to trade. */
6057
+ instrumentId: number;
6058
+ /** Trade direction. */
6059
+ side: OrderSide;
6060
+ /** Limit price. */
6061
+ price: PerpsDecimalInput;
6062
+ /** Order quantity. */
6063
+ quantity: PerpsDecimalInput;
6064
+ /** Good-til-cancelled execution. */
6065
+ timeInForce: PerpsTimeInForce.GTC;
6066
+ /** Whether the order must rest instead of taking liquidity. */
6067
+ postOnly?: boolean;
6068
+ /** Whether the order may only reduce or close an existing position. */
6069
+ reduceOnly?: boolean;
6070
+ /** Optional caller-supplied idempotency identifier. */
6071
+ clientOrderId?: string;
6072
+ /** Optional command expiration timestamp in milliseconds. */
5999
6073
  expiresAt?: number;
6000
- stopLoss?: undefined;
6001
- takeProfit?: undefined;
6074
+ takeProfit?: never;
6075
+ stopLoss?: never;
6076
+ } | {
6077
+ /** Perps instrument identifier to trade. */
6078
+ instrumentId: number;
6079
+ /** Trade direction. */
6080
+ side: OrderSide;
6081
+ /** Optional limit price. Omit for market-style execution. */
6082
+ price?: PerpsDecimalInput;
6083
+ /** Order quantity. */
6084
+ quantity: PerpsDecimalInput;
6085
+ /** Immediate-or-cancel execution. */
6086
+ timeInForce: PerpsTimeInForce.IOC;
6087
+ postOnly?: never;
6088
+ /** Whether the order may only reduce or close an existing position. */
6089
+ reduceOnly?: boolean;
6090
+ /** Optional caller-supplied idempotency identifier. */
6091
+ clientOrderId?: string;
6092
+ /** Optional command expiration timestamp in milliseconds. */
6093
+ expiresAt?: number;
6094
+ takeProfit?: never;
6095
+ stopLoss?: never;
6096
+ } | {
6097
+ /** Perps instrument identifier to trade. */
6098
+ instrumentId: number;
6099
+ /** Trade direction. */
6100
+ side: OrderSide;
6101
+ /** Optional limit price. Omit for market-style execution. */
6102
+ price?: PerpsDecimalInput;
6103
+ /** Order quantity. */
6104
+ quantity: PerpsDecimalInput;
6105
+ /** Fill-or-kill execution. */
6106
+ timeInForce: PerpsTimeInForce.FOK;
6107
+ postOnly?: never;
6108
+ /** Whether the order may only reduce or close an existing position. */
6109
+ reduceOnly?: boolean;
6110
+ /** Optional caller-supplied idempotency identifier. */
6111
+ clientOrderId?: string;
6112
+ /** Optional command expiration timestamp in milliseconds. */
6113
+ expiresAt?: number;
6114
+ takeProfit?: never;
6115
+ stopLoss?: never;
6002
6116
  };
6003
- type PlacePerpsOrderWithTpSlRequest = PerpsOrderRequest & PerpsTpSlPairRequest & {
6117
+ type PlacePerpsOrderWithTpSlRequest = {
6118
+ /** Perps instrument identifier to trade. */
6119
+ instrumentId: number;
6120
+ /** Trade direction. */
6121
+ side: OrderSide;
6122
+ /** Limit price. */
6123
+ price: PerpsDecimalInput;
6124
+ /** Order quantity. */
6125
+ quantity: PerpsDecimalInput;
6126
+ /** Good-til-cancelled execution. */
6127
+ timeInForce: PerpsTimeInForce.GTC;
6128
+ /** Whether the order must rest instead of taking liquidity. */
6129
+ postOnly?: boolean;
6130
+ /** Whether the order may only reduce or close an existing position. */
6131
+ reduceOnly?: boolean;
6132
+ /** Optional caller-supplied idempotency identifier. */
6133
+ clientOrderId?: string;
6134
+ /** Optional command expiration timestamp in milliseconds. */
6135
+ expiresAt?: number;
6136
+ /** Take-profit trigger to place with the entry order. */
6137
+ takeProfit: PerpsTpSlTrigger;
6138
+ /** Optional stop-loss trigger to place with the entry order. */
6139
+ stopLoss?: PerpsTpSlTrigger;
6140
+ } | {
6141
+ /** Perps instrument identifier to trade. */
6142
+ instrumentId: number;
6143
+ /** Trade direction. */
6144
+ side: OrderSide;
6145
+ /** Limit price. */
6146
+ price: PerpsDecimalInput;
6147
+ /** Order quantity. */
6148
+ quantity: PerpsDecimalInput;
6149
+ /** Good-til-cancelled execution. */
6150
+ timeInForce: PerpsTimeInForce.GTC;
6151
+ /** Whether the order must rest instead of taking liquidity. */
6152
+ postOnly?: boolean;
6153
+ /** Whether the order may only reduce or close an existing position. */
6154
+ reduceOnly?: boolean;
6155
+ /** Optional caller-supplied idempotency identifier. */
6156
+ clientOrderId?: string;
6157
+ /** Optional command expiration timestamp in milliseconds. */
6158
+ expiresAt?: number;
6159
+ /** Optional take-profit trigger to place with the entry order. */
6160
+ takeProfit?: PerpsTpSlTrigger;
6161
+ /** Stop-loss trigger to place with the entry order. */
6162
+ stopLoss: PerpsTpSlTrigger;
6163
+ } | {
6164
+ /** Perps instrument identifier to trade. */
6165
+ instrumentId: number;
6166
+ /** Trade direction. */
6167
+ side: OrderSide;
6168
+ /** Optional limit price. Omit for market-style execution. */
6169
+ price?: PerpsDecimalInput;
6170
+ /** Order quantity. */
6171
+ quantity: PerpsDecimalInput;
6172
+ /** Immediate-or-cancel execution. */
6173
+ timeInForce: PerpsTimeInForce.IOC;
6174
+ postOnly?: never;
6175
+ /** Whether the order may only reduce or close an existing position. */
6176
+ reduceOnly?: boolean;
6177
+ /** Optional caller-supplied idempotency identifier. */
6178
+ clientOrderId?: string;
6179
+ /** Optional command expiration timestamp in milliseconds. */
6180
+ expiresAt?: number;
6181
+ /** Take-profit trigger to place with the entry order. */
6182
+ takeProfit: PerpsTpSlTrigger;
6183
+ /** Optional stop-loss trigger to place with the entry order. */
6184
+ stopLoss?: PerpsTpSlTrigger;
6185
+ } | {
6186
+ /** Perps instrument identifier to trade. */
6187
+ instrumentId: number;
6188
+ /** Trade direction. */
6189
+ side: OrderSide;
6190
+ /** Optional limit price. Omit for market-style execution. */
6191
+ price?: PerpsDecimalInput;
6192
+ /** Order quantity. */
6193
+ quantity: PerpsDecimalInput;
6194
+ /** Immediate-or-cancel execution. */
6195
+ timeInForce: PerpsTimeInForce.IOC;
6196
+ postOnly?: never;
6197
+ /** Whether the order may only reduce or close an existing position. */
6198
+ reduceOnly?: boolean;
6199
+ /** Optional caller-supplied idempotency identifier. */
6200
+ clientOrderId?: string;
6201
+ /** Optional command expiration timestamp in milliseconds. */
6202
+ expiresAt?: number;
6203
+ /** Optional take-profit trigger to place with the entry order. */
6204
+ takeProfit?: PerpsTpSlTrigger;
6205
+ /** Stop-loss trigger to place with the entry order. */
6206
+ stopLoss: PerpsTpSlTrigger;
6207
+ } | {
6208
+ /** Perps instrument identifier to trade. */
6209
+ instrumentId: number;
6210
+ /** Trade direction. */
6211
+ side: OrderSide;
6212
+ /** Optional limit price. Omit for market-style execution. */
6213
+ price?: PerpsDecimalInput;
6214
+ /** Order quantity. */
6215
+ quantity: PerpsDecimalInput;
6216
+ /** Fill-or-kill execution. */
6217
+ timeInForce: PerpsTimeInForce.FOK;
6218
+ postOnly?: never;
6219
+ /** Whether the order may only reduce or close an existing position. */
6220
+ reduceOnly?: boolean;
6221
+ /** Optional caller-supplied idempotency identifier. */
6222
+ clientOrderId?: string;
6223
+ /** Optional command expiration timestamp in milliseconds. */
6004
6224
  expiresAt?: number;
6225
+ /** Take-profit trigger to place with the entry order. */
6226
+ takeProfit: PerpsTpSlTrigger;
6227
+ /** Optional stop-loss trigger to place with the entry order. */
6228
+ stopLoss?: PerpsTpSlTrigger;
6229
+ } | {
6230
+ /** Perps instrument identifier to trade. */
6231
+ instrumentId: number;
6232
+ /** Trade direction. */
6233
+ side: OrderSide;
6234
+ /** Optional limit price. Omit for market-style execution. */
6235
+ price?: PerpsDecimalInput;
6236
+ /** Order quantity. */
6237
+ quantity: PerpsDecimalInput;
6238
+ /** Fill-or-kill execution. */
6239
+ timeInForce: PerpsTimeInForce.FOK;
6240
+ postOnly?: never;
6241
+ /** Whether the order may only reduce or close an existing position. */
6242
+ reduceOnly?: boolean;
6243
+ /** Optional caller-supplied idempotency identifier. */
6244
+ clientOrderId?: string;
6245
+ /** Optional command expiration timestamp in milliseconds. */
6246
+ expiresAt?: number;
6247
+ /** Optional take-profit trigger to place with the entry order. */
6248
+ takeProfit?: PerpsTpSlTrigger;
6249
+ /** Stop-loss trigger to place with the entry order. */
6250
+ stopLoss: PerpsTpSlTrigger;
6005
6251
  };
6006
6252
  type PlacePerpsPositionTpSlRequest = {
6007
6253
  /** Perps instrument identifier whose current position should receive TP/SL protection. */
@@ -6022,32 +6268,46 @@ type PlacePerpsPositionTpSlRequest = {
6022
6268
  /** Optional command expiration timestamp in milliseconds. */
6023
6269
  expiresAt?: number;
6024
6270
  };
6025
- declare const CancelPerpsOrderRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
6026
- orderId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsOrderId, number>>;
6027
- clientOrderId: z.ZodOptional<z.ZodUndefined>;
6028
- expiresAt: z.ZodOptional<z.ZodNumber>;
6029
- }, z.core.$strip>, z.ZodObject<{
6030
- clientOrderId: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings_perps.PerpsClientOrderId, string>>;
6031
- orderId: z.ZodOptional<z.ZodUndefined>;
6032
- expiresAt: z.ZodOptional<z.ZodNumber>;
6033
- }, z.core.$strip>]>;
6034
- type CancelPerpsOrderRequest = z.input<typeof CancelPerpsOrderRequestSchema>;
6035
- declare const CancelPerpsOrdersRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
6036
- orderIds: z.ZodArray<z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsOrderId, number>>>;
6037
- clientOrderIds: z.ZodOptional<z.ZodUndefined>;
6038
- expiresAt: z.ZodOptional<z.ZodNumber>;
6039
- }, z.core.$strip>, z.ZodObject<{
6040
- clientOrderIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings_perps.PerpsClientOrderId, string>>>;
6041
- orderIds: z.ZodOptional<z.ZodUndefined>;
6042
- expiresAt: z.ZodOptional<z.ZodNumber>;
6043
- }, z.core.$strip>]>;
6044
- type CancelPerpsOrdersRequest = z.input<typeof CancelPerpsOrdersRequestSchema>;
6045
- declare const UpdatePerpsLeverageRequestSchema: z.ZodObject<{
6046
- instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
6047
- leverage: z.ZodNumber;
6048
- crossMargin: z.ZodBoolean;
6049
- }, z.core.$strip>;
6050
- type UpdatePerpsLeverageRequest = z.input<typeof UpdatePerpsLeverageRequestSchema>;
6271
+ type CancelPerpsOrderRequest = {
6272
+ /** Order identifier to cancel. */
6273
+ orderId: number;
6274
+ clientOrderId?: never;
6275
+ /** Optional command expiration timestamp in milliseconds. */
6276
+ expiresAt?: number;
6277
+ } | {
6278
+ /** Caller-supplied idempotency identifier to cancel. */
6279
+ clientOrderId: string;
6280
+ orderId?: never;
6281
+ /** Optional command expiration timestamp in milliseconds. */
6282
+ expiresAt?: number;
6283
+ };
6284
+ type CancelPerpsOrdersRequest = {
6285
+ /** Order identifiers to cancel. */
6286
+ orderIds: number[];
6287
+ clientOrderIds?: never;
6288
+ /** Optional command expiration timestamp in milliseconds. */
6289
+ expiresAt?: number;
6290
+ } | {
6291
+ /** Caller-supplied idempotency identifiers to cancel. */
6292
+ clientOrderIds: string[];
6293
+ orderIds?: never;
6294
+ /** Optional command expiration timestamp in milliseconds. */
6295
+ expiresAt?: number;
6296
+ };
6297
+ type CancelAllPerpsOrdersRequest = {
6298
+ /** Optional Perps instrument identifier to scope cancellation. */
6299
+ instrumentId?: number;
6300
+ /** Optional command expiration timestamp in milliseconds. */
6301
+ expiresAt?: number;
6302
+ };
6303
+ type UpdatePerpsLeverageRequest = {
6304
+ /** Perps instrument identifier whose leverage should be updated. */
6305
+ instrumentId: number;
6306
+ /** Target leverage multiplier. */
6307
+ leverage: number;
6308
+ /** Whether the instrument should use cross margin. */
6309
+ crossMargin: boolean;
6310
+ };
6051
6311
  type UpdatePerpsLeverageError = RequestRejectedError | SigningError | TransportError | UserInputError;
6052
6312
  declare const UpdatePerpsLeverageError: {
6053
6313
  isError(error: unknown): error is UserInputError | TransportError | RequestRejectedError | SigningError;
@@ -6061,6 +6321,9 @@ type PerpsSessionOptions = {
6061
6321
  restUrl: string;
6062
6322
  wsUrl: string;
6063
6323
  };
6324
+ type PerpsSessionLifecycleError = RequestRejectedError | TransportError;
6325
+ type PerpsSessionAccountError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
6326
+ type PerpsSessionTradingError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6064
6327
  type PerpsPlacedTpSlOrder = {
6065
6328
  orderId: PerpsOrderId;
6066
6329
  };
@@ -6082,25 +6345,145 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
6082
6345
  readonly credentials: PerpsCredentials;
6083
6346
  constructor(options: PerpsSessionOptions);
6084
6347
  get closed(): boolean;
6348
+ /**
6349
+ * Connects and authenticates the session WebSocket.
6350
+ *
6351
+ * @throws {@link PerpsSessionLifecycleError}
6352
+ * Thrown on failure.
6353
+ */
6085
6354
  connect(): Promise<void>;
6355
+ /**
6356
+ * Closes the session and releases pending requests.
6357
+ *
6358
+ * @throws {@link PerpsSessionLifecycleError}
6359
+ * Thrown on failure.
6360
+ */
6086
6361
  close(): Promise<void>;
6362
+ /**
6363
+ * Iterates authenticated Perps account events emitted by this session.
6364
+ *
6365
+ * @example
6366
+ * ```ts
6367
+ * for await (const event of session) {
6368
+ * if (event.type === 'order') {
6369
+ * console.log(event.payload.id);
6370
+ * }
6371
+ * }
6372
+ * ```
6373
+ */
6087
6374
  [Symbol.asyncIterator](): AsyncIterator<PerpsSessionEvent>;
6375
+ /**
6376
+ * Fetches current Perps balances for the authenticated account.
6377
+ *
6378
+ * @throws {@link PerpsSessionAccountError}
6379
+ * Thrown on failure.
6380
+ */
6088
6381
  fetchBalances(): Promise<PerpsBalance[]>;
6382
+ /**
6383
+ * Fetches the current Perps portfolio for the authenticated account.
6384
+ *
6385
+ * @throws {@link PerpsSessionAccountError}
6386
+ * Thrown on failure.
6387
+ */
6089
6388
  fetchPortfolio(): Promise<PerpsPortfolio>;
6389
+ /**
6390
+ * Fetches account-level Perps statistics for the authenticated account.
6391
+ *
6392
+ * @throws {@link PerpsSessionAccountError}
6393
+ * Thrown on failure.
6394
+ */
6090
6395
  fetchStats(): Promise<PerpsAccountStats>;
6396
+ /**
6397
+ * Fetches Perps account configuration, optionally filtered by instrument.
6398
+ *
6399
+ * @throws {@link PerpsSessionAccountError}
6400
+ * Thrown on failure.
6401
+ */
6091
6402
  fetchAccountConfig(request?: FetchPerpsAccountConfigRequest): Promise<PerpsAccountConfig[]>;
6403
+ /**
6404
+ * Fetches currently open Perps orders, optionally filtered by instrument.
6405
+ *
6406
+ * @throws {@link PerpsSessionAccountError}
6407
+ * Thrown on failure.
6408
+ */
6092
6409
  fetchOpenOrders(request?: FetchPerpsOpenOrdersRequest): Promise<PerpsOrder[]>;
6410
+ /**
6411
+ * Fetches Perps orders for the authenticated account.
6412
+ *
6413
+ * @throws {@link PerpsSessionAccountError}
6414
+ * Thrown on failure.
6415
+ */
6093
6416
  fetchOrders(request?: FetchPerpsOrdersRequest): Promise<PerpsOrder[]>;
6417
+ /**
6418
+ * Lists Perps fills with SDK-owned pagination.
6419
+ *
6420
+ * @throws {@link PerpsSessionAccountError}
6421
+ * Thrown on failure.
6422
+ */
6094
6423
  listFills(request?: ListPerpsFillsRequest): Paginated<PerpsAccountFill[]>;
6424
+ /**
6425
+ * Lists Perps funding payments with SDK-owned pagination.
6426
+ *
6427
+ * @throws {@link PerpsSessionAccountError}
6428
+ * Thrown on failure.
6429
+ */
6095
6430
  listFundingPayments(request?: ListPerpsFundingPaymentsRequest): Paginated<PerpsAccountFundingPayment[]>;
6431
+ /**
6432
+ * Lists Perps deposits with SDK-owned pagination.
6433
+ *
6434
+ * @throws {@link PerpsSessionAccountError}
6435
+ * Thrown on failure.
6436
+ */
6096
6437
  listDeposits(request?: ListPerpsDepositsRequest): Paginated<PerpsDeposit[]>;
6438
+ /**
6439
+ * Lists Perps withdrawals with SDK-owned pagination.
6440
+ *
6441
+ * @throws {@link PerpsSessionAccountError}
6442
+ * Thrown on failure.
6443
+ */
6097
6444
  listWithdrawals(request?: ListPerpsWithdrawalsRequest): Paginated<PerpsWithdrawal[]>;
6445
+ /**
6446
+ * Lists Perps equity history with SDK-owned pagination.
6447
+ *
6448
+ * @throws {@link PerpsSessionAccountError}
6449
+ * Thrown on failure.
6450
+ */
6098
6451
  listEquityHistory(request: ListPerpsEquityHistoryRequest): Paginated<PerpsEquityPoint[]>;
6452
+ /**
6453
+ * Lists Perps PnL history with SDK-owned pagination.
6454
+ *
6455
+ * @throws {@link PerpsSessionAccountError}
6456
+ * Thrown on failure.
6457
+ */
6099
6458
  listPnlHistory(request: ListPerpsPnlHistoryRequest): Paginated<PerpsPnlPoint[]>;
6100
6459
  /**
6101
6460
  * Places one Perps order and resolves with the first matching orders update.
6102
6461
  *
6103
- * @throws Thrown on failure.
6462
+ * @example
6463
+ * ```ts
6464
+ * const { order } = await session.placeOrder({
6465
+ * instrumentId: 1,
6466
+ * price: '100',
6467
+ * quantity: '1',
6468
+ * side: OrderSide.BUY,
6469
+ * timeInForce: PerpsTimeInForce.GTC,
6470
+ * });
6471
+ * ```
6472
+ *
6473
+ * @example
6474
+ * ```ts
6475
+ * const { order, tpSl } = await session.placeOrder({
6476
+ * instrumentId: 1,
6477
+ * price: '100',
6478
+ * quantity: '1',
6479
+ * side: OrderSide.BUY,
6480
+ * stopLoss: { triggerPrice: '90' },
6481
+ * timeInForce: PerpsTimeInForce.GTC,
6482
+ * });
6483
+ * ```
6484
+ *
6485
+ * @throws {@link PerpsSessionTradingError}
6486
+ * Thrown on failure.
6104
6487
  */
6105
6488
  placeOrder(request: PlacePerpsOrderWithTpSlRequest): Promise<PlacePerpsOrderWithTpSlResult>;
6106
6489
  placeOrder(request: PlacePerpsOrderRequest): Promise<PlacePerpsOrderResult>;
@@ -6109,14 +6492,41 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
6109
6492
  *
6110
6493
  * @remarks
6111
6494
  * This is a low-level method. Most SDK consumers should prefer `placeOrder`.
6495
+ *
6496
+ * @throws {@link PerpsSessionTradingError}
6497
+ * Thrown on failure.
6112
6498
  */
6113
6499
  postOrders(request: PostPerpsOrdersRequest): Promise<PerpsPostOrderAck[]>;
6500
+ /**
6501
+ * Places take-profit and/or stop-loss protection for the current position.
6502
+ *
6503
+ * @remarks
6504
+ * The exit side is inferred from the current position for the requested
6505
+ * instrument.
6506
+ *
6507
+ * @example
6508
+ * ```ts
6509
+ * const { tpSl } = await session.placePositionTpSl({
6510
+ * instrumentId: 1,
6511
+ * stopLoss: { triggerPrice: '90' },
6512
+ * });
6513
+ * ```
6514
+ *
6515
+ * @throws {@link PerpsSessionAccountError}
6516
+ * Thrown when the current position cannot be read.
6517
+ *
6518
+ * @throws {@link PerpsSessionTradingError}
6519
+ * Thrown when the TP/SL command fails.
6520
+ */
6114
6521
  placePositionTpSl(request: PlacePerpsPositionTpSlRequest): Promise<PlacePerpsPositionTpSlResult>;
6115
6522
  /**
6116
6523
  * Cancels one Perps order and returns the cancel result.
6117
6524
  *
6118
6525
  * @remarks
6119
6526
  * The returned status reflects whether the cancel happened.
6527
+ *
6528
+ * @throws {@link PerpsSessionTradingError}
6529
+ * Thrown on failure.
6120
6530
  */
6121
6531
  cancelOrder(request: CancelPerpsOrderRequest): Promise<PerpsCancelOrderResult>;
6122
6532
  /**
@@ -6124,8 +6534,38 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
6124
6534
  *
6125
6535
  * @remarks
6126
6536
  * Each returned status reflects whether that cancel happened.
6537
+ *
6538
+ * @throws {@link PerpsSessionTradingError}
6539
+ * Thrown on failure.
6127
6540
  */
6128
6541
  cancelOrders(request: CancelPerpsOrdersRequest): Promise<PerpsCancelOrderResult[]>;
6542
+ /**
6543
+ * Cancels all open Perps orders for the authenticated account.
6544
+ *
6545
+ * @remarks
6546
+ * Omit `instrumentId` to cancel open orders across all instruments. The
6547
+ * endpoint returns once the cancel-all request is accepted; individual orders
6548
+ * can still race with fills or other cancels.
6549
+ *
6550
+ * @throws {@link PerpsSessionTradingError}
6551
+ * Thrown on failure.
6552
+ */
6553
+ cancelAllOrders(request?: CancelAllPerpsOrdersRequest): Promise<void>;
6554
+ /**
6555
+ * Updates Perps leverage and margin mode for an instrument.
6556
+ *
6557
+ * @example
6558
+ * ```ts
6559
+ * await session.updateLeverage({
6560
+ * crossMargin: true,
6561
+ * instrumentId: 1,
6562
+ * leverage: 2,
6563
+ * });
6564
+ * ```
6565
+ *
6566
+ * @throws {@link UpdatePerpsLeverageError}
6567
+ * Thrown on failure.
6568
+ */
6129
6569
  updateLeverage(request: UpdatePerpsLeverageRequest): Promise<PerpsUpdateLeverageResult>;
6130
6570
  }
6131
6571
 
@@ -6133,23 +6573,12 @@ type PerpsPublicReadError = RateLimitError | RequestRejectedError | TransportErr
6133
6573
  declare const PerpsPublicReadError: {
6134
6574
  isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
6135
6575
  };
6136
- type PerpsCandlesParams = {
6137
- instrumentId: z.output<typeof PerpsInstrumentIdSchema>;
6138
- interval: PerpsKlineInterval;
6139
- startTimestamp: number;
6140
- endTimestamp: number;
6141
- };
6142
- type PerpsTimeRangeParams = {
6143
- instrumentId: z.output<typeof PerpsInstrumentIdSchema>;
6144
- startTimestamp: number;
6145
- endTimestamp: number;
6146
- };
6147
- declare const FetchPerpsInstrumentsRequestSchema: z.ZodDefault<z.ZodObject<{
6148
- instrumentId: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>>;
6149
- instrumentType: z.ZodOptional<z.ZodEnum<typeof _polymarket_bindings_perps.PerpsInstrumentType>>;
6150
- category: z.ZodOptional<z.ZodEnum<typeof _polymarket_bindings_perps.PerpsInstrumentCategory>>;
6151
- }, z.core.$strip>>;
6152
- type FetchPerpsInstrumentsRequest = z.input<typeof FetchPerpsInstrumentsRequestSchema>;
6576
+ type FetchPerpsInstrumentsRequest = {
6577
+ /** Perps instrument identifier to fetch. */
6578
+ instrumentId?: number;
6579
+ /** Optional instrument category filter. */
6580
+ category?: PerpsInstrumentCategory;
6581
+ };
6153
6582
  type FetchPerpsInstrumentsError = PerpsPublicReadError;
6154
6583
  declare const FetchPerpsInstrumentsError: {
6155
6584
  isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
@@ -6164,10 +6593,10 @@ declare const FetchPerpsInstrumentsError: {
6164
6593
  * Thrown on failure.
6165
6594
  */
6166
6595
  declare function fetchPerpsInstruments(client: BaseClient, request?: FetchPerpsInstrumentsRequest): Promise<PerpsInstrument[]>;
6167
- declare const FetchPerpsTickerRequestSchema: z.ZodObject<{
6168
- instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6169
- }, z.core.$strip>;
6170
- type FetchPerpsTickerRequest = z.input<typeof FetchPerpsTickerRequestSchema>;
6596
+ type FetchPerpsTickerRequest = {
6597
+ /** Perps instrument identifier whose ticker should be fetched. */
6598
+ instrumentId: number;
6599
+ };
6171
6600
  type FetchPerpsTickerError = PerpsPublicReadError;
6172
6601
  declare const FetchPerpsTickerError: {
6173
6602
  isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
@@ -6182,10 +6611,10 @@ declare const FetchPerpsTickerError: {
6182
6611
  * Thrown on failure.
6183
6612
  */
6184
6613
  declare function fetchPerpsTicker(client: BaseClient, request: FetchPerpsTickerRequest): Promise<PerpsTicker>;
6185
- declare const FetchPerpsTickersRequestSchema: z.ZodDefault<z.ZodObject<{
6186
- instrumentId: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>>;
6187
- }, z.core.$strip>>;
6188
- type FetchPerpsTickersRequest = z.input<typeof FetchPerpsTickersRequestSchema>;
6614
+ type FetchPerpsTickersRequest = {
6615
+ /** Optional Perps instrument identifier filter. */
6616
+ instrumentId?: number;
6617
+ };
6189
6618
  type FetchPerpsTickersError = PerpsPublicReadError;
6190
6619
  declare const FetchPerpsTickersError: {
6191
6620
  isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
@@ -6201,11 +6630,12 @@ declare const FetchPerpsTickersError: {
6201
6630
  */
6202
6631
  declare function fetchPerpsTickers(client: BaseClient, request?: FetchPerpsTickersRequest): Promise<PerpsTicker[]>;
6203
6632
  type PerpsBookDepth = 10 | 100 | 500 | 1000;
6204
- declare const FetchPerpsBookRequestSchema: z.ZodObject<{
6205
- instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6206
- depth: z.ZodDefault<z.ZodType<PerpsBookDepth, unknown, z.core.$ZodTypeInternals<PerpsBookDepth, unknown>>>;
6207
- }, z.core.$strip>;
6208
- type FetchPerpsBookRequest = z.input<typeof FetchPerpsBookRequestSchema>;
6633
+ type FetchPerpsBookRequest = {
6634
+ /** Perps instrument identifier whose order book should be fetched. */
6635
+ instrumentId: number;
6636
+ /** Number of price levels to return on each side. */
6637
+ depth?: PerpsBookDepth;
6638
+ };
6209
6639
  type FetchPerpsBookError = PerpsPublicReadError;
6210
6640
  declare const FetchPerpsBookError: {
6211
6641
  isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
@@ -6220,30 +6650,21 @@ declare const FetchPerpsBookError: {
6220
6650
  * Thrown on failure.
6221
6651
  */
6222
6652
  declare function fetchPerpsBook(client: BaseClient, request: FetchPerpsBookRequest): Promise<PerpsBook>;
6223
- declare const ListPerpsCandlesRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
6224
- instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6225
- interval: z.ZodEnum<typeof PerpsKlineInterval>;
6226
- start: z.ZodOptional<z.ZodNumber>;
6227
- end: z.ZodOptional<z.ZodNumber>;
6228
- cursor: z.ZodOptional<z.ZodCustom<PaginationCursor, PaginationCursor>>;
6229
- }, z.core.$strip>, z.ZodTransform<{
6230
- cursor: PaginationCursor | undefined;
6231
- params: PerpsCandlesParams;
6232
- }, {
6233
- instrumentId: _polymarket_bindings_perps.PerpsInstrumentId;
6653
+ type ListPerpsCandlesRequest = {
6654
+ /** Perps instrument identifier whose candles should be listed. */
6655
+ instrumentId: number;
6656
+ /** Candle interval. */
6234
6657
  interval: PerpsKlineInterval;
6235
- start?: number | undefined;
6236
- end?: number | undefined;
6237
- cursor?: PaginationCursor | undefined;
6238
- }>>, z.ZodPipe<z.ZodObject<{
6239
- cursor: z.ZodCustom<PaginationCursor, PaginationCursor>;
6240
- }, z.core.$strip>, z.ZodTransform<{
6241
- cursor: PaginationCursor;
6242
- params: undefined;
6243
- }, {
6658
+ /** Inclusive start timestamp in milliseconds. */
6659
+ start?: number;
6660
+ /** Inclusive end timestamp in milliseconds. */
6661
+ end?: number;
6662
+ /** Opaque cursor returned by a previous page. */
6663
+ cursor?: PaginationCursor;
6664
+ } | {
6665
+ /** Opaque cursor returned by a previous page. */
6244
6666
  cursor: PaginationCursor;
6245
- }>>]>;
6246
- type ListPerpsCandlesRequest = z.input<typeof ListPerpsCandlesRequestSchema>;
6667
+ };
6247
6668
  type ListPerpsCandlesError = PerpsPublicReadError;
6248
6669
  declare const ListPerpsCandlesError: {
6249
6670
  isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
@@ -6258,28 +6679,19 @@ declare const ListPerpsCandlesError: {
6258
6679
  * Thrown on failure.
6259
6680
  */
6260
6681
  declare function listPerpsCandles(client: BaseClient, request: ListPerpsCandlesRequest): Paginated<PerpsCandle[]>;
6261
- declare const ListPerpsFundingHistoryRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
6262
- instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6263
- start: z.ZodOptional<z.ZodNumber>;
6264
- end: z.ZodOptional<z.ZodNumber>;
6265
- cursor: z.ZodOptional<z.ZodCustom<PaginationCursor, PaginationCursor>>;
6266
- }, z.core.$strip>, z.ZodTransform<{
6267
- cursor: PaginationCursor | undefined;
6268
- params: PerpsTimeRangeParams;
6269
- }, {
6270
- instrumentId: _polymarket_bindings_perps.PerpsInstrumentId;
6271
- start?: number | undefined;
6272
- end?: number | undefined;
6273
- cursor?: PaginationCursor | undefined;
6274
- }>>, z.ZodPipe<z.ZodObject<{
6275
- cursor: z.ZodCustom<PaginationCursor, PaginationCursor>;
6276
- }, z.core.$strip>, z.ZodTransform<{
6277
- cursor: PaginationCursor;
6278
- params: undefined;
6279
- }, {
6682
+ type ListPerpsFundingHistoryRequest = {
6683
+ /** Perps instrument identifier whose funding history should be listed. */
6684
+ instrumentId: number;
6685
+ /** Inclusive start timestamp in milliseconds. */
6686
+ start?: number;
6687
+ /** Inclusive end timestamp in milliseconds. */
6688
+ end?: number;
6689
+ /** Opaque cursor returned by a previous page. */
6690
+ cursor?: PaginationCursor;
6691
+ } | {
6692
+ /** Opaque cursor returned by a previous page. */
6280
6693
  cursor: PaginationCursor;
6281
- }>>]>;
6282
- type ListPerpsFundingHistoryRequest = z.input<typeof ListPerpsFundingHistoryRequestSchema>;
6694
+ };
6283
6695
  type ListPerpsFundingHistoryError = PerpsPublicReadError;
6284
6696
  declare const ListPerpsFundingHistoryError: {
6285
6697
  isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
@@ -6294,28 +6706,19 @@ declare const ListPerpsFundingHistoryError: {
6294
6706
  * Thrown on failure.
6295
6707
  */
6296
6708
  declare function listPerpsFundingHistory(client: BaseClient, request: ListPerpsFundingHistoryRequest): Paginated<PerpsFundingRate[]>;
6297
- declare const ListPerpsTradesRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
6298
- instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6299
- start: z.ZodOptional<z.ZodNumber>;
6300
- end: z.ZodOptional<z.ZodNumber>;
6301
- cursor: z.ZodOptional<z.ZodCustom<PaginationCursor, PaginationCursor>>;
6302
- }, z.core.$strip>, z.ZodTransform<{
6303
- cursor: PaginationCursor | undefined;
6304
- params: PerpsTimeRangeParams;
6305
- }, {
6306
- instrumentId: _polymarket_bindings_perps.PerpsInstrumentId;
6307
- start?: number | undefined;
6308
- end?: number | undefined;
6309
- cursor?: PaginationCursor | undefined;
6310
- }>>, z.ZodPipe<z.ZodObject<{
6311
- cursor: z.ZodCustom<PaginationCursor, PaginationCursor>;
6312
- }, z.core.$strip>, z.ZodTransform<{
6313
- cursor: PaginationCursor;
6314
- params: undefined;
6315
- }, {
6709
+ type ListPerpsTradesRequest = {
6710
+ /** Perps instrument identifier whose recent trades should be listed. */
6711
+ instrumentId: number;
6712
+ /** Inclusive start timestamp in milliseconds. */
6713
+ start?: number;
6714
+ /** Inclusive end timestamp in milliseconds. */
6715
+ end?: number;
6716
+ /** Opaque cursor returned by a previous page. */
6717
+ cursor?: PaginationCursor;
6718
+ } | {
6719
+ /** Opaque cursor returned by a previous page. */
6316
6720
  cursor: PaginationCursor;
6317
- }>>]>;
6318
- type ListPerpsTradesRequest = z.input<typeof ListPerpsTradesRequestSchema>;
6721
+ };
6319
6722
  type ListPerpsTradesError = PerpsPublicReadError;
6320
6723
  declare const ListPerpsTradesError: {
6321
6724
  isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError;
@@ -6344,36 +6747,33 @@ declare const FetchPerpsFeesError: {
6344
6747
  * Thrown on failure.
6345
6748
  */
6346
6749
  declare function fetchPerpsFees(client: BaseClient): Promise<PerpsFeeScheduleEntry[]>;
6347
- declare const CreatePerpsSessionRequestSchema: z.ZodObject<{
6348
- expiresIn: z.ZodDefault<z.ZodNumber>;
6349
- label: z.ZodOptional<z.ZodString>;
6350
- }, z.core.$strict>;
6351
- declare const ResumePerpsSessionRequestSchema: z.ZodObject<{
6352
- credentials: z.ZodObject<{
6353
- proxy: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
6354
- privateKey: z.ZodCustom<PrivateKey, PrivateKey>;
6355
- secret: z.ZodString;
6356
- expiresAt: z.ZodNumber;
6357
- }, z.core.$strip>;
6358
- }, z.core.$strict>;
6359
- declare const RevokePerpsCredentialsRequestSchema: z.ZodObject<{
6360
- proxy: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
6361
- }, z.core.$strip>;
6362
- type CreatePerpsSessionRequest = z.input<typeof CreatePerpsSessionRequestSchema>;
6363
- type ResumePerpsSessionRequest = z.input<typeof ResumePerpsSessionRequestSchema>;
6750
+ type CreatePerpsSessionRequest = {
6751
+ /** Delegated credential lifetime in milliseconds. */
6752
+ expiresIn?: number;
6753
+ /** Optional label for the delegated credentials. */
6754
+ label?: string;
6755
+ };
6756
+ type ResumePerpsSessionRequest = {
6757
+ /** Existing delegated Perps credentials to validate and resume. */
6758
+ credentials: PerpsCredentials;
6759
+ };
6364
6760
  type OpenPerpsSessionRequest = CreatePerpsSessionRequest | ResumePerpsSessionRequest;
6365
- type RevokePerpsCredentialsRequest = z.input<typeof RevokePerpsCredentialsRequestSchema>;
6761
+ type RevokePerpsCredentialsRequest = {
6762
+ /** Proxy address whose delegated credentials should be revoked. */
6763
+ proxy: string;
6764
+ };
6366
6765
  type PerpsDepositWorkflowRequest = GaslessWorkflowRequest | SendPerpsDepositTransactionRequest;
6367
6766
  type PerpsDepositWorkflow = AsyncGenerator<PerpsDepositWorkflowRequest, TransactionHandle, EvmAddress | EvmSignature | TransactionHandle>;
6368
- declare const DepositToPerpsRequestSchema: z.ZodObject<{
6369
- amount: z.ZodBigInt;
6370
- metadata: z.ZodOptional<z.ZodString>;
6371
- }, z.core.$strip>;
6372
- declare const WithdrawFromPerpsRequestSchema: z.ZodObject<{
6373
- amount: z.ZodBigInt;
6374
- }, z.core.$strip>;
6375
- type DepositToPerpsRequest = z.input<typeof DepositToPerpsRequestSchema>;
6376
- type WithdrawFromPerpsRequest = z.input<typeof WithdrawFromPerpsRequestSchema>;
6767
+ type DepositToPerpsRequest = {
6768
+ /** Collateral amount in base units. */
6769
+ amount: bigint;
6770
+ /** Optional wallet-visible metadata for gasless deposit workflows. */
6771
+ metadata?: string;
6772
+ };
6773
+ type WithdrawFromPerpsRequest = {
6774
+ /** Collateral amount in base units. */
6775
+ amount: bigint;
6776
+ };
6377
6777
  type OpenPerpsSessionError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6378
6778
  declare const OpenPerpsSessionError: {
6379
6779
  isError(error: unknown): error is UserInputError | UnexpectedResponseError | TransportError | RequestRejectedError | RateLimitError | SigningError;
@@ -7481,4 +7881,4 @@ type Signer = {
7481
7881
  sendTransaction(request: SignerTransactionRequest): Promise<TransactionHandle>;
7482
7882
  };
7483
7883
 
7484
- export { FetchPublicProfileError as $, type ApiKeyAuthorization as A, type BaseClient as B, CancelAllError as C, type DataActions as D, type EnvironmentConfig as E, FetchClosedOnlyModeError as F, FetchEventLiveVolumeError as G, FetchEventTagsError as H, FetchLastTradePriceError as I, FetchLastTradePricesError as J, FetchMarketError as K, FetchMarketTagsError as L, FetchMidpointError as M, FetchMidpointsError as N, FetchNotificationsError as O, FetchOrderBookError as P, FetchOrderBooksError as Q, FetchOrderError as R, type Signer as S, type TypedDataPayload as T, UserInputError as U, FetchOrderScoringError as V, FetchOrdersScoringError as W, FetchPortfolioValueError as X, FetchPriceError as Y, FetchPriceHistoryError as Z, FetchPricesError as _, type TypedData as a, RfqConfirmationError as a$, FetchRelatedTagResourcesError as a0, FetchRelatedTagsError as a1, FetchRewardPercentagesError as a2, FetchSeriesError as a3, FetchSpreadError as a4, FetchSpreadsError as a5, FetchTagError as a6, FetchTotalEarningsForUserForDayError as a7, FetchTradedMarketCountError as a8, InsufficientLiquidityError as a9, MergePositionsError as aA, OpenRfqSessionError as aB, type Page as aC, PageSizeSchema as aD, type Paginated as aE, type PerpsActions as aF, type PerpsEndpoints as aG, PerpsSession as aH, PostOrderError as aI, PostOrdersError as aJ, type PublicAccountActions as aK, type PublicActions as aL, type PublicClient as aM, type PublicClientOptions as aN, type PublicPerpsActions as aO, type PublicRewardsActions as aP, type PublicSubscriptionsActions as aQ, RateLimitError as aR, RedeemPositionsError as aS, RequestRejectedError as aT, type RequestRejectedErrorOptions as aU, type RestEndpoint as aV, type RfqCancelQuoteAck as aW, RfqCancelQuoteError as aX, RfqCancelQuoteRejectedError as aY, type RfqCancelQuoteRejectedErrorOptions as aZ, type RfqConfirmationAck as a_, ListAccountTradesError as aa, ListActivityError as ab, ListBuilderLeaderboardError as ac, ListBuilderTradesError as ad, ListBuilderVolumeError as ae, ListClosedPositionsError as af, ListComboMarketsError as ag, ListComboPositionsError as ah, ListCommentsByUserAddressError as ai, ListCommentsError as aj, ListCurrentRewardsError as ak, ListEventsError as al, ListMarketHoldersError as am, ListMarketPositionsError as an, ListMarketRewardsError as ao, ListMarketsError as ap, ListOpenInterestError as aq, ListOpenOrdersError as ar, ListPositionsError as as, ListSeriesError as at, ListTagsError as au, ListTeamsError as av, ListTraderLeaderboardError as aw, ListTradesError as ax, ListUserEarningsAndMarketsConfigError as ay, ListUserEarningsForDayError as az, type TransactionCall as b, subscriptionsActions as b$, RfqConfirmationRejectedError as b0, type RfqConfirmationRequestEvent as b1, type RfqEndpoints as b2, type RfqEvent as b3, RfqQuoteError as b4, type RfqQuoteReference as b5, RfqQuoteRejectedError as b6, type RfqQuoteRejectedErrorOptions as b7, type RfqQuoteRequestEvent as b8, type RfqQuoteResponse as b9, SplitPositionError as bA, TimeoutError as bB, TransactionFailedError as bC, type TransactionHandle as bD, type TransactionOutcome as bE, TransferErc20Error as bF, TransportError as bG, type TypedDataDomain as bH, type TypedDataField as bI, UnexpectedResponseError as bJ, UpdatePerpsLeverageError as bK, WaitForTransactionError as bL, type WalletDerivationConfig as bM, type WebSocketEndpoint as bN, accountActions as bO, allActions as bP, analyticsActions as bQ, createPublicClient as bR, createSecureClient as bS, dataActions as bT, discoveryActions as bU, forkEnvironmentConfig as bV, makeErrorGuard as bW, perpsActions as bX, production as bY, rewardsActions as bZ, rfqActions as b_, type RfqQuoteSource as ba, type RfqSession as bb, type RfqTradeEvent as bc, SearchError as bd, SearchSort as be, type SecureAccountActions as bf, type SecureActions as bg, type SecureClient as bh, type SecureClientOptions as bi, type SecureDownloadAccountingSnapshotRequest as bj, type SecureFetchPortfolioValueRequest as bk, type SecureFetchTradedMarketCountRequest as bl, type SecureListActivityRequest as bm, type SecureListClosedPositionsRequest as bn, type SecureListComboPositionsRequest as bo, type SecureListPositionsRequest as bp, type SecurePerpsActions as bq, type SecureRewardsActions as br, type SecureRfqActions as bs, type SecureSubscriptionsActions as bt, type SecureTradingActions as bu, type SecureWalletActions as bv, SetupGaslessWalletError as bw, SetupTradingApprovalsError as bx, type SignerTransactionRequest as by, SigningError as bz, type AccountIdentity as c, type FetchPerpsOpenOrdersRequest as c$, tradingActions as c0, walletActions as c1, type CancelMarketOrdersRequest as c2, type CancelOrderRequest as c3, type CancelOrdersRequest as c4, type CancelPerpsOrderRequest as c5, type CancelPerpsOrdersRequest as c6, type CommentsEventType as c7, type CommentsSubscription as c8, type CreatePerpsSessionRequest as c9, type FetchEventLiveVolumeRequest as cA, type FetchEventRequest as cB, type FetchEventTagsRequest as cC, FetchExecuteParamsError as cD, type FetchExecuteParamsRequest as cE, type FetchGaslessTransactionRequest as cF, type FetchLastTradePriceRequest as cG, type FetchLastTradePricesRequest as cH, FetchMarketInfoError as cI, type FetchMarketInfoRequest as cJ, type FetchMarketRequest as cK, type FetchMarketTagsRequest as cL, type FetchMidpointRequest as cM, type FetchMidpointsRequest as cN, FetchNegRiskError as cO, type FetchNegRiskRequest as cP, type FetchOrderBookRequest as cQ, type FetchOrderBooksRequest as cR, type FetchOrderRequest as cS, type FetchOrderScoringRequest as cT, type FetchOrdersScoringRequest as cU, type FetchPerpsAccountConfigRequest as cV, FetchPerpsBookError as cW, type FetchPerpsBookRequest as cX, FetchPerpsFeesError as cY, FetchPerpsInstrumentsError as cZ, type FetchPerpsInstrumentsRequest as c_, type CryptoPricesEventType as ca, type CryptoPricesSubscription as cb, DeployDepositWalletError as cc, DepositToPerpsError as cd, type DepositToPerpsRequest as ce, type DeprecatedTransactionHandle as cf, type DownloadAccountingSnapshotRequest as cg, type DropNotificationsRequest as ch, type EquityPricesEventType as ci, type EquityPricesSubscription as cj, type Erc1155ApprovalForAllWorkflow as ck, type Erc1155ApprovalForAllWorkflowRequest as cl, type Erc20ApprovalWorkflow as cm, type Erc20ApprovalWorkflowRequest as cn, type Erc20TransferWorkflow as co, type Erc20TransferWorkflowRequest as cp, type EstimateMarketBuyPriceRequest as cq, type EstimateMarketPriceRequest as cr, type EstimateMarketSellPriceRequest as cs, type EventForSubscriptionSpec as ct, type EventForSubscriptionSpecs as cu, FetchBalanceAllowanceError as cv, type FetchBalanceAllowanceRequest as cw, FetchBuilderFeeRatesError as cx, type FetchBuilderFeeRatesRequest as cy, type FetchCommentsByIdRequest as cz, type AnalyticsActions as d, type ListUserEarningsForDayRequest as d$, type FetchPerpsOrdersRequest as d0, FetchPerpsTickerError as d1, type FetchPerpsTickerRequest as d2, FetchPerpsTickersError as d3, type FetchPerpsTickersRequest as d4, type FetchPortfolioValueRequest as d5, type FetchPriceHistoryRequest as d6, type FetchPriceRequest as d7, type FetchPricesRequest as d8, type FetchPublicProfileRequest as d9, type ListCurrentRewardsRequest as dA, type ListEventsRequest as dB, type ListMarketHoldersRequest as dC, type ListMarketPositionsRequest as dD, type ListMarketRewardsRequest as dE, type ListMarketsRequest as dF, type ListOpenInterestRequest as dG, type ListOpenOrdersRequest as dH, ListPerpsCandlesError as dI, type ListPerpsCandlesRequest as dJ, type ListPerpsDepositsRequest as dK, type ListPerpsEquityHistoryRequest as dL, type ListPerpsFillsRequest as dM, ListPerpsFundingHistoryError as dN, type ListPerpsFundingHistoryRequest as dO, type ListPerpsFundingPaymentsRequest as dP, type ListPerpsPnlHistoryRequest as dQ, ListPerpsTradesError as dR, type ListPerpsTradesRequest as dS, type ListPerpsWithdrawalsRequest as dT, type ListPositionsRequest as dU, type ListSeriesRequest as dV, type ListTagsRequest as dW, type ListTeamsRequest as dX, type ListTraderLeaderboardRequest as dY, type ListTradesRequest as dZ, type ListUserEarningsAndMarketsConfigRequest as d_, type FetchRelatedTagResourcesRequest as da, type FetchRelatedTagsRequest as db, type FetchSeriesRequest as dc, type FetchSpreadRequest as dd, type FetchSpreadsRequest as de, type FetchTagRequest as df, FetchTickSizeError as dg, type FetchTickSizeRequest as dh, type FetchTotalEarningsForUserForDayRequest as di, type FetchTradedMarketCountRequest as dj, GaslessTransactionMetadataSchema as dk, type GaslessWorkflow as dl, type GaslessWorkflowRequest as dm, IsWalletDeployedError as dn, type IsWalletDeployedRequest as dp, type ListAccountTradesRequest as dq, type ListActivityRequest as dr, type ListBuilderLeaderboardRequest as ds, type ListBuilderTradesRequest as dt, type ListBuilderVolumeRequest as du, type ListClosedPositionsRequest as dv, type ListComboMarketsRequest as dw, type ListComboPositionsRequest as dx, type ListCommentsByUserAddressRequest as dy, type ListCommentsRequest as dz, ApproveErc1155ForAllError as e, PrepareRedeemMarketPositionsError as e$, type MarketEventType as e0, type MarketSubscription as e1, MergeComboPositionError as e2, MergeMarketPositionError as e3, type MergePositionsWorkflow as e4, type MergePositionsWorkflowRequest as e5, OpenPerpsSessionError as e6, type OpenPerpsSessionRequest as e7, type OrderDraft as e8, type OrderPostingWorkflow as e9, type PlacePerpsPositionTpSlRequest as eA, type PlacePerpsPositionTpSlResult as eB, type PostOrdersRequest as eC, type PostPerpsOrdersRequest as eD, PrepareErc1155ApprovalForAllError as eE, type PrepareErc1155ApprovalForAllRequest as eF, PrepareErc20ApprovalError as eG, type PrepareErc20ApprovalRequest as eH, PrepareErc20TransferError as eI, type PrepareErc20TransferRequest as eJ, PrepareGaslessTransactionError as eK, type PrepareGaslessTransactionRequest as eL, type PrepareLimitOrderRequest as eM, type PrepareMarketBuyOrderRequest as eN, type PrepareMarketOrderRequest as eO, type PrepareMarketSellOrderRequest as eP, PrepareMergeComboPositionError as eQ, type PrepareMergeComboPositionRequest as eR, PrepareMergeMarketPositionError as eS, type PrepareMergeMarketPositionRequest as eT, PrepareMergePositionsError as eU, type PrepareMergePositionsRequest as eV, PreparePerpsDepositError as eW, PrepareRedeemComboPositionError as eX, type PrepareRedeemComboPositionRequest as eY, type PrepareRedeemMarketPositionsByConditionIdRequest as eZ, type PrepareRedeemMarketPositionsByMarketIdRequest as e_, type OrderWorkflow as ea, type OrderWorkflowRequest as eb, type PerpsBboSubscription as ec, type PerpsBookDepth as ed, type PerpsBookSubscription as ee, type PerpsCandlesSubscription as ef, type PerpsDepositWorkflow as eg, type PerpsDepositWorkflowRequest as eh, type PerpsMarketDataEventType as ei, type PerpsMarketDataSubscription as ej, type PerpsOrderRequest as ek, type PerpsPlaceFokOrderRequest as el, type PerpsPlaceGtcOrderRequest as em, type PerpsPlaceIocOrderRequest as en, type PerpsPlacedTpSlOrder as eo, type PerpsPlacedTpSlOrders as ep, type PerpsPositionTpSlTrigger as eq, type PerpsStatisticsSubscription as er, type PerpsStreamingCandleInterval as es, type PerpsTickersSubscription as et, type PerpsTpSlTrigger as eu, type PerpsTradesSubscription as ev, type PlacePerpsOrderRequest as ew, type PlacePerpsOrderResult as ex, type PlacePerpsOrderWithTpSlRequest as ey, type PlacePerpsOrderWithTpSlResult as ez, ApproveErc20Error as f, fetchEventLiveVolume as f$, type PrepareRedeemMarketPositionsRequest as f0, PrepareRedeemPositionsError as f1, type PrepareRedeemPositionsRequest as f2, PrepareSplitComboPositionError as f3, type PrepareSplitComboPositionRequest as f4, PrepareSplitMarketPositionError as f5, type PrepareSplitMarketPositionRequest as f6, PrepareSplitPositionError as f7, type PrepareSplitPositionRequest as f8, PrepareTradingApprovalsError as f9, type TradingApprovalsWorkflow as fA, type TradingApprovalsWorkflowRequest as fB, UpdateBalanceAllowanceError as fC, type UpdateBalanceAllowanceRequest as fD, type UpdatePerpsLeverageRequest as fE, type UserEventType as fF, type UserSubscription as fG, WaitForGaslessTransactionError as fH, WithdrawFromPerpsError as fI, type WithdrawFromPerpsRequest as fJ, approveErc1155ForAll as fK, approveErc20 as fL, cancelAll as fM, cancelMarketOrders as fN, cancelOrder as fO, cancelOrders as fP, deployDepositWallet as fQ, depositToPerps as fR, downloadAccountingSnapshot as fS, dropNotifications as fT, estimateMarketPrice as fU, fetchBalanceAllowance as fV, fetchBuilderFeeRates as fW, fetchBuilderVolume as fX, fetchClosedOnlyMode as fY, fetchCommentsById as fZ, fetchEvent as f_, type PublicRealtimeEvent as fa, type PublicRealtimeTopic as fb, type PublicSubscriptionSpec as fc, type RedeemPositionsWorkflow as fd, type RedeemPositionsWorkflowRequest as fe, ResolveConditionByTokenError as ff, type ResolveConditionByTokenRequest as fg, type ResumePerpsSessionRequest as fh, RevokePerpsCredentialsError as fi, type RevokePerpsCredentialsRequest as fj, type RfqConfirmationRejectedErrorOptions as fk, type RfqExecutionUpdateEvent as fl, type SearchRequest as fm, type SearchResults as fn, type SecureRealtimeEvent as fo, type SecureRealtimeTopic as fp, type SecureSubscriptionSpec as fq, type SignedOrder as fr, SplitComboPositionError as fs, SplitMarketPositionError as ft, type SplitPositionWorkflow as fu, type SplitPositionWorkflowRequest as fv, type SportsEventType as fw, type SportsSubscription as fx, type SubscribeError as fy, type SubscriptionHandle as fz, BasePublicClient as g, listTrades as g$, fetchEventTags as g0, fetchExecuteParams as g1, fetchLastTradePrice as g2, fetchLastTradePrices as g3, fetchMarket as g4, fetchMarketInfo as g5, fetchMarketTags as g6, fetchMidpoint as g7, fetchMidpoints as g8, fetchNegRisk as g9, fetchTransaction as gA, isWalletDeployed as gB, listAccountTrades as gC, listActivity as gD, listBuilderLeaderboard as gE, listBuilderTrades as gF, listClosedPositions as gG, listComboMarkets as gH, listComboPositions as gI, listComments as gJ, listCommentsByUserAddress as gK, listCurrentRewards as gL, listEvents as gM, listMarketHolders as gN, listMarketPositions as gO, listMarketRewards as gP, listMarkets as gQ, listOpenInterest as gR, listOpenOrders as gS, listPerpsCandles as gT, listPerpsFundingHistory as gU, listPerpsTrades as gV, listPositions as gW, listSeries as gX, listTags as gY, listTeams as gZ, listTraderLeaderboard as g_, fetchNotifications as ga, fetchOrder as gb, fetchOrderBook as gc, fetchOrderBooks as gd, fetchOrderScoring as ge, fetchOrdersScoring as gf, fetchPerpsBook as gg, fetchPerpsFees as gh, fetchPerpsInstruments as gi, fetchPerpsTicker as gj, fetchPerpsTickers as gk, fetchPortfolioValue as gl, fetchPrice as gm, fetchPriceHistory as gn, fetchPrices as go, fetchPublicProfile as gp, fetchRelatedTagResources as gq, fetchRelatedTags as gr, fetchRewardPercentages as gs, fetchSeries as gt, fetchSpread as gu, fetchSpreads as gv, fetchTag as gw, fetchTickSize as gx, fetchTotalEarningsForUserForDay as gy, fetchTradedMarketCount as gz, BaseSecureClient as h, listUserEarningsAndMarketsConfig as h0, listUserEarningsForDay as h1, mergeComboPosition as h2, mergeMarketPosition as h3, mergePositions as h4, openPerpsSession as h5, openRfqSession as h6, postOrder as h7, postOrders as h8, prepareErc1155ApprovalForAll as h9, prepareErc20Approval as ha, prepareErc20Transfer as hb, prepareGaslessTransaction as hc, prepareMergeComboPosition as hd, prepareMergeMarketPosition as he, prepareMergePositions as hf, preparePerpsDeposit as hg, prepareRedeemComboPosition as hh, prepareRedeemMarketPositions as hi, prepareRedeemPositions as hj, prepareSplitComboPosition as hk, prepareSplitMarketPosition as hl, prepareSplitPosition as hm, prepareTradingApprovals as hn, redeemPositions as ho, resolveConditionByToken as hp, revokePerpsCredentials as hq, search as hr, setupTradingApprovals as hs, splitComboPosition as ht, splitMarketPosition as hu, splitPosition as hv, subscribe as hw, transferErc20 as hx, updateBalanceAllowance as hy, withdrawFromPerps as hz, type BeginAuthenticationRequest as i, CancelMarketOrdersError as j, CancelOrderError as k, CancelOrdersError as l, CancelledSigningError as m, type Client as n, type ClientActions as o, type ClientDecorator as p, type ClobEndpoints as q, CreateSecureClientError as r, type DiscoveryActions as s, DownloadAccountingSnapshotError as t, DropNotificationsError as u, type EnvironmentConfigFork as v, type EnvironmentContracts as w, EstimateMarketPriceError as x, FetchCommentsByIdError as y, FetchEventError as z };
7884
+ export { FetchOrderScoringError as $, type ApiKeyAuthorization as A, type BaseClient as B, CancelAllError as C, type DataActions as D, DropNotificationsError as E, type EnvironmentConfig as F, type EnvironmentConfigFork as G, type EnvironmentContracts as H, EstimateMarketPriceError as I, FetchClosedOnlyModeError as J, FetchCommentsByIdError as K, FetchEventError as L, FetchEventLiveVolumeError as M, FetchEventTagsError as N, FetchLastTradePriceError as O, FetchLastTradePricesError as P, FetchMarketError as Q, FetchMarketTagsError as R, type Signer as S, type TypedDataPayload as T, UserInputError as U, FetchMidpointError as V, FetchMidpointsError as W, FetchNotificationsError as X, FetchOrderBookError as Y, FetchOrderBooksError as Z, FetchOrderError as _, type TypedData as a, ListTradesError as a$, FetchOrdersScoringError as a0, type FetchPerpsAccountConfigRequest as a1, FetchPerpsBookError as a2, type FetchPerpsBookRequest as a3, FetchPerpsFeesError as a4, FetchPerpsInstrumentsError as a5, type FetchPerpsInstrumentsRequest as a6, type FetchPerpsOpenOrdersRequest as a7, type FetchPerpsOrdersRequest as a8, FetchPerpsTickerError as a9, ListCommentsByUserAddressError as aA, ListCommentsError as aB, ListCurrentRewardsError as aC, ListEventsError as aD, ListMarketHoldersError as aE, ListMarketPositionsError as aF, ListMarketRewardsError as aG, ListMarketsError as aH, ListOpenInterestError as aI, ListOpenOrdersError as aJ, ListPerpsCandlesError as aK, type ListPerpsCandlesRequest as aL, type ListPerpsDepositsRequest as aM, type ListPerpsEquityHistoryRequest as aN, type ListPerpsFillsRequest as aO, ListPerpsFundingHistoryError as aP, type ListPerpsFundingHistoryRequest as aQ, type ListPerpsFundingPaymentsRequest as aR, type ListPerpsPnlHistoryRequest as aS, ListPerpsTradesError as aT, type ListPerpsTradesRequest as aU, type ListPerpsWithdrawalsRequest as aV, ListPositionsError as aW, ListSeriesError as aX, ListTagsError as aY, ListTeamsError as aZ, ListTraderLeaderboardError as a_, type FetchPerpsTickerRequest as aa, FetchPerpsTickersError as ab, type FetchPerpsTickersRequest as ac, FetchPortfolioValueError as ad, FetchPriceError as ae, FetchPriceHistoryError as af, FetchPricesError as ag, FetchPublicProfileError as ah, FetchRelatedTagResourcesError as ai, FetchRelatedTagsError as aj, FetchRewardPercentagesError as ak, FetchSeriesError as al, FetchSpreadError as am, FetchSpreadsError as an, FetchTagError as ao, FetchTotalEarningsForUserForDayError as ap, FetchTradedMarketCountError as aq, InsufficientLiquidityError as ar, ListAccountTradesError as as, ListActivityError as at, ListBuilderLeaderboardError as au, ListBuilderTradesError as av, ListBuilderVolumeError as aw, ListClosedPositionsError as ax, ListComboMarketsError as ay, ListComboPositionsError as az, type TransactionCall as b, type RfqQuoteResponse as b$, ListUserEarningsAndMarketsConfigError as b0, ListUserEarningsForDayError as b1, MergePositionsError as b2, OpenPerpsSessionError as b3, type OpenPerpsSessionRequest as b4, OpenRfqSessionError as b5, type Page as b6, PageSizeSchema as b7, type Paginated as b8, type PerpsActions as b9, type PublicClientOptions as bA, type PublicPerpsActions as bB, type PublicRewardsActions as bC, type PublicSubscriptionsActions as bD, RateLimitError as bE, RedeemPositionsError as bF, RequestRejectedError as bG, type RequestRejectedErrorOptions as bH, type RestEndpoint as bI, type ResumePerpsSessionRequest as bJ, RevokePerpsCredentialsError as bK, type RevokePerpsCredentialsRequest as bL, type RfqCancelQuoteAck as bM, RfqCancelQuoteError as bN, RfqCancelQuoteRejectedError as bO, type RfqCancelQuoteRejectedErrorOptions as bP, type RfqConfirmationAck as bQ, RfqConfirmationError as bR, RfqConfirmationRejectedError as bS, type RfqConfirmationRequestEvent as bT, type RfqEndpoints as bU, type RfqEvent as bV, RfqQuoteError as bW, type RfqQuoteReference as bX, RfqQuoteRejectedError as bY, type RfqQuoteRejectedErrorOptions as bZ, type RfqQuoteRequestEvent as b_, type PerpsBookDepth as ba, type PerpsEndpoints as bb, type PerpsOrderRequest as bc, type PerpsPlaceFokOrderRequest as bd, type PerpsPlaceGtcOrderRequest as be, type PerpsPlaceIocOrderRequest as bf, type PerpsPlacedTpSlOrder as bg, type PerpsPlacedTpSlOrders as bh, type PerpsPositionTpSlTrigger as bi, PerpsSession as bj, type PerpsSessionAccountError as bk, type PerpsSessionLifecycleError as bl, type PerpsSessionTradingError as bm, type PerpsTpSlTrigger as bn, type PlacePerpsOrderRequest as bo, type PlacePerpsOrderResult as bp, type PlacePerpsOrderWithTpSlRequest as bq, type PlacePerpsOrderWithTpSlResult as br, type PlacePerpsPositionTpSlRequest as bs, type PlacePerpsPositionTpSlResult as bt, PostOrderError as bu, PostOrdersError as bv, type PostPerpsOrdersRequest as bw, type PublicAccountActions as bx, type PublicActions as by, type PublicClient as bz, type AccountIdentity as c, type CommentsSubscription as c$, type RfqQuoteSource as c0, type RfqSession as c1, type RfqTradeEvent as c2, SearchError as c3, SearchSort as c4, type SecureAccountActions as c5, type SecureActions as c6, type SecureClient as c7, type SecureClientOptions as c8, type SecureDownloadAccountingSnapshotRequest as c9, UpdatePerpsLeverageError as cA, type UpdatePerpsLeverageRequest as cB, WaitForTransactionError as cC, type WalletDerivationConfig as cD, type WebSocketEndpoint as cE, WithdrawFromPerpsError as cF, type WithdrawFromPerpsRequest as cG, accountActions as cH, allActions as cI, analyticsActions as cJ, createPublicClient as cK, createSecureClient as cL, dataActions as cM, discoveryActions as cN, forkEnvironmentConfig as cO, makeErrorGuard as cP, perpsActions as cQ, production as cR, rewardsActions as cS, rfqActions as cT, subscriptionsActions as cU, tradingActions as cV, walletActions as cW, type CancelMarketOrdersRequest as cX, type CancelOrderRequest as cY, type CancelOrdersRequest as cZ, type CommentsEventType as c_, type SecureFetchPortfolioValueRequest as ca, type SecureFetchTradedMarketCountRequest as cb, type SecureListActivityRequest as cc, type SecureListClosedPositionsRequest as cd, type SecureListComboPositionsRequest as ce, type SecureListPositionsRequest as cf, type SecurePerpsActions as cg, type SecureRewardsActions as ch, type SecureRfqActions as ci, type SecureSubscriptionsActions as cj, type SecureTradingActions as ck, type SecureWalletActions as cl, SetupGaslessWalletError as cm, SetupTradingApprovalsError as cn, type SignerTransactionRequest as co, SigningError as cp, SplitPositionError as cq, TimeoutError as cr, TransactionFailedError as cs, type TransactionHandle as ct, type TransactionOutcome as cu, TransferErc20Error as cv, TransportError as cw, type TypedDataDomain as cx, type TypedDataField as cy, UnexpectedResponseError as cz, type AnalyticsActions as d, type GaslessWorkflowRequest as d$, type CryptoPricesEventType as d0, type CryptoPricesSubscription as d1, DeployDepositWalletError as d2, type DeprecatedTransactionHandle as d3, type DownloadAccountingSnapshotRequest as d4, type DropNotificationsRequest as d5, type EquityPricesEventType as d6, type EquityPricesSubscription as d7, type Erc1155ApprovalForAllWorkflow as d8, type Erc1155ApprovalForAllWorkflowRequest as d9, type FetchMarketTagsRequest as dA, type FetchMidpointRequest as dB, type FetchMidpointsRequest as dC, FetchNegRiskError as dD, type FetchNegRiskRequest as dE, type FetchOrderBookRequest as dF, type FetchOrderBooksRequest as dG, type FetchOrderRequest as dH, type FetchOrderScoringRequest as dI, type FetchOrdersScoringRequest as dJ, type FetchPortfolioValueRequest as dK, type FetchPriceHistoryRequest as dL, type FetchPriceRequest as dM, type FetchPricesRequest as dN, type FetchPublicProfileRequest as dO, type FetchRelatedTagResourcesRequest as dP, type FetchRelatedTagsRequest as dQ, type FetchSeriesRequest as dR, type FetchSpreadRequest as dS, type FetchSpreadsRequest as dT, type FetchTagRequest as dU, FetchTickSizeError as dV, type FetchTickSizeRequest as dW, type FetchTotalEarningsForUserForDayRequest as dX, type FetchTradedMarketCountRequest as dY, GaslessTransactionMetadataSchema as dZ, type GaslessWorkflow as d_, type Erc20ApprovalWorkflow as da, type Erc20ApprovalWorkflowRequest as db, type Erc20TransferWorkflow as dc, type Erc20TransferWorkflowRequest as dd, type EstimateMarketBuyPriceRequest as de, type EstimateMarketPriceRequest as df, type EstimateMarketSellPriceRequest as dg, type EventForSubscriptionSpec as dh, type EventForSubscriptionSpecs as di, FetchBalanceAllowanceError as dj, type FetchBalanceAllowanceRequest as dk, FetchBuilderFeeRatesError as dl, type FetchBuilderFeeRatesRequest as dm, type FetchCommentsByIdRequest as dn, type FetchEventLiveVolumeRequest as dp, type FetchEventRequest as dq, type FetchEventTagsRequest as dr, FetchExecuteParamsError as ds, type FetchExecuteParamsRequest as dt, type FetchGaslessTransactionRequest as du, type FetchLastTradePriceRequest as dv, type FetchLastTradePricesRequest as dw, FetchMarketInfoError as dx, type FetchMarketInfoRequest as dy, type FetchMarketRequest as dz, ApproveErc1155ForAllError as e, type PrepareMarketSellOrderRequest as e$, IsWalletDeployedError as e0, type IsWalletDeployedRequest as e1, type ListAccountTradesRequest as e2, type ListActivityRequest as e3, type ListBuilderLeaderboardRequest as e4, type ListBuilderTradesRequest as e5, type ListBuilderVolumeRequest as e6, type ListClosedPositionsRequest as e7, type ListComboMarketsRequest as e8, type ListComboPositionsRequest as e9, type OrderDraft as eA, type OrderPostingWorkflow as eB, type OrderWorkflow as eC, type OrderWorkflowRequest as eD, type PerpsBboSubscription as eE, type PerpsBookSubscription as eF, type PerpsCandlesSubscription as eG, type PerpsDepositWorkflow as eH, type PerpsDepositWorkflowRequest as eI, type PerpsMarketDataEventType as eJ, type PerpsMarketDataSubscription as eK, type PerpsStatisticsSubscription as eL, type PerpsStreamingCandleInterval as eM, type PerpsTickersSubscription as eN, type PerpsTradesSubscription as eO, type PostOrdersRequest as eP, PrepareErc1155ApprovalForAllError as eQ, type PrepareErc1155ApprovalForAllRequest as eR, PrepareErc20ApprovalError as eS, type PrepareErc20ApprovalRequest as eT, PrepareErc20TransferError as eU, type PrepareErc20TransferRequest as eV, PrepareGaslessTransactionError as eW, type PrepareGaslessTransactionRequest as eX, type PrepareLimitOrderRequest as eY, type PrepareMarketBuyOrderRequest as eZ, type PrepareMarketOrderRequest as e_, type ListCommentsByUserAddressRequest as ea, type ListCommentsRequest as eb, type ListCurrentRewardsRequest as ec, type ListEventsRequest as ed, ListMarketClarificationsError as ee, type ListMarketClarificationsRequest as ef, type ListMarketHoldersRequest as eg, type ListMarketPositionsRequest as eh, type ListMarketRewardsRequest as ei, type ListMarketsRequest as ej, type ListOpenInterestRequest as ek, type ListOpenOrdersRequest as el, type ListPositionsRequest as em, type ListSeriesRequest as en, type ListTagsRequest as eo, type ListTeamsRequest as ep, type ListTraderLeaderboardRequest as eq, type ListTradesRequest as er, type ListUserEarningsAndMarketsConfigRequest as es, type ListUserEarningsForDayRequest as et, type MarketEventType as eu, type MarketSubscription as ev, MergeComboPositionError as ew, MergeMarketPositionError as ex, type MergePositionsWorkflow as ey, type MergePositionsWorkflowRequest as ez, ApproveErc20Error as f, fetchBalanceAllowance as f$, PrepareMergeComboPositionError as f0, type PrepareMergeComboPositionRequest as f1, PrepareMergeMarketPositionError as f2, type PrepareMergeMarketPositionRequest as f3, PrepareMergePositionsError as f4, type PrepareMergePositionsRequest as f5, PreparePerpsDepositError as f6, PrepareRedeemComboPositionError as f7, type PrepareRedeemComboPositionRequest as f8, type PrepareRedeemMarketPositionsByConditionIdRequest as f9, type SignedOrder as fA, SplitComboPositionError as fB, SplitMarketPositionError as fC, type SplitPositionWorkflow as fD, type SplitPositionWorkflowRequest as fE, type SportsEventType as fF, type SportsSubscription as fG, type SubscribeError as fH, type SubscriptionHandle as fI, type TradingApprovalsWorkflow as fJ, type TradingApprovalsWorkflowRequest as fK, UpdateBalanceAllowanceError as fL, type UpdateBalanceAllowanceRequest as fM, type UserEventType as fN, type UserSubscription as fO, WaitForGaslessTransactionError as fP, approveErc1155ForAll as fQ, approveErc20 as fR, cancelAll as fS, cancelMarketOrders as fT, cancelOrder as fU, cancelOrders as fV, deployDepositWallet as fW, depositToPerps as fX, downloadAccountingSnapshot as fY, dropNotifications as fZ, estimateMarketPrice as f_, type PrepareRedeemMarketPositionsByMarketIdRequest as fa, PrepareRedeemMarketPositionsError as fb, type PrepareRedeemMarketPositionsRequest as fc, PrepareRedeemPositionsError as fd, type PrepareRedeemPositionsRequest as fe, PrepareSplitComboPositionError as ff, type PrepareSplitComboPositionRequest as fg, PrepareSplitMarketPositionError as fh, type PrepareSplitMarketPositionRequest as fi, PrepareSplitPositionError as fj, type PrepareSplitPositionRequest as fk, PrepareTradingApprovalsError as fl, type PublicRealtimeEvent as fm, type PublicRealtimeTopic as fn, type PublicSubscriptionSpec as fo, type RedeemPositionsWorkflow as fp, type RedeemPositionsWorkflowRequest as fq, ResolveConditionByTokenError as fr, type ResolveConditionByTokenRequest as fs, type RfqConfirmationRejectedErrorOptions as ft, type RfqExecutionUpdateEvent as fu, type SearchRequest as fv, type SearchResults as fw, type SecureRealtimeEvent as fx, type SecureRealtimeTopic as fy, type SecureSubscriptionSpec as fz, BasePublicClient as g, listPerpsFundingHistory as g$, fetchBuilderFeeRates as g0, fetchBuilderVolume as g1, fetchClosedOnlyMode as g2, fetchCommentsById as g3, fetchEvent as g4, fetchEventLiveVolume as g5, fetchEventTags as g6, fetchExecuteParams as g7, fetchLastTradePrice as g8, fetchLastTradePrices as g9, fetchSpread as gA, fetchSpreads as gB, fetchTag as gC, fetchTickSize as gD, fetchTotalEarningsForUserForDay as gE, fetchTradedMarketCount as gF, fetchTransaction as gG, isWalletDeployed as gH, listAccountTrades as gI, listActivity as gJ, listBuilderLeaderboard as gK, listBuilderTrades as gL, listClosedPositions as gM, listComboMarkets as gN, listComboPositions as gO, listComments as gP, listCommentsByUserAddress as gQ, listCurrentRewards as gR, listEvents as gS, listMarketClarifications as gT, listMarketHolders as gU, listMarketPositions as gV, listMarketRewards as gW, listMarkets as gX, listOpenInterest as gY, listOpenOrders as gZ, listPerpsCandles as g_, fetchMarket as ga, fetchMarketInfo as gb, fetchMarketTags as gc, fetchMidpoint as gd, fetchMidpoints as ge, fetchNegRisk as gf, fetchNotifications as gg, fetchOrder as gh, fetchOrderBook as gi, fetchOrderBooks as gj, fetchOrderScoring as gk, fetchOrdersScoring as gl, fetchPerpsBook as gm, fetchPerpsFees as gn, fetchPerpsInstruments as go, fetchPerpsTicker as gp, fetchPerpsTickers as gq, fetchPortfolioValue as gr, fetchPrice as gs, fetchPriceHistory as gt, fetchPrices as gu, fetchPublicProfile as gv, fetchRelatedTagResources as gw, fetchRelatedTags as gx, fetchRewardPercentages as gy, fetchSeries as gz, BaseSecureClient as h, listPerpsTrades as h0, listPositions as h1, listSeries as h2, listTags as h3, listTeams as h4, listTraderLeaderboard as h5, listTrades as h6, listUserEarningsAndMarketsConfig as h7, listUserEarningsForDay as h8, mergeComboPosition as h9, splitComboPosition as hA, splitMarketPosition as hB, splitPosition as hC, subscribe as hD, transferErc20 as hE, updateBalanceAllowance as hF, withdrawFromPerps as hG, mergeMarketPosition as ha, mergePositions as hb, openPerpsSession as hc, openRfqSession as hd, postOrder as he, postOrders as hf, prepareErc1155ApprovalForAll as hg, prepareErc20Approval as hh, prepareErc20Transfer as hi, prepareGaslessTransaction as hj, prepareMergeComboPosition as hk, prepareMergeMarketPosition as hl, prepareMergePositions as hm, preparePerpsDeposit as hn, prepareRedeemComboPosition as ho, prepareRedeemMarketPositions as hp, prepareRedeemPositions as hq, prepareSplitComboPosition as hr, prepareSplitMarketPosition as hs, prepareSplitPosition as ht, prepareTradingApprovals as hu, redeemPositions as hv, resolveConditionByToken as hw, revokePerpsCredentials as hx, search as hy, setupTradingApprovals as hz, type BeginAuthenticationRequest as i, type CancelAllPerpsOrdersRequest as j, CancelMarketOrdersError as k, CancelOrderError as l, CancelOrdersError as m, type CancelPerpsOrderRequest as n, type CancelPerpsOrdersRequest as o, CancelledSigningError as p, type Client as q, type ClientActions as r, type ClientDecorator as s, type ClobEndpoints as t, type CreatePerpsSessionRequest as u, CreateSecureClientError as v, DepositToPerpsError as w, type DepositToPerpsRequest as x, type DiscoveryActions as y, DownloadAccountingSnapshotError as z };