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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,18 @@
1
1
  import * as _polymarket_bindings from '@polymarket/bindings';
2
- import { PaginationCursor, OrderSide, OrderType, TokenId, BuilderCode, EvmAddress as EvmAddress$1, ConditionId, TickSizeValue, TransactionId } from '@polymarket/bindings';
3
- import { PolymarketError, HexString, EvmAddress, EvmSignature, NonEmptyArray, Prettify, Erc1271Signature, TxHash } from '@polymarket/types';
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';
4
5
  import { WalletType, Event, TagReference, Market, Series, Tag, RelatedTag, SportsMetadata, SportsMarketTypesResponse, Team, PublicProfile, Comment, Profile, SearchTag } from '@polymarket/bindings/gamma';
5
6
  import { RelayerTransactionType, RelayerExecuteParams, GaslessTransaction } from '@polymarket/bindings/relayer';
6
7
  import { ZodError, z } from 'zod';
7
8
  import * as _polymarket_bindings_clob from '@polymarket/bindings/clob';
8
9
  import { ClobTrade, NotificationsResponse, BuilderTrade, Prices, OrderBook, LastTradePrice, LastTradePriceForToken, PriceHistoryPoint, CurrentReward, MarketReward, OrdersScoringResponse, UserEarning, TotalUserEarning, UserRewardsEarning, RewardsPercentages, CancelOrdersResponse, SignatureType, OrderResponse, OrderResponses, OpenOrder, ApiKeyCreds, BalanceAllowanceResponse, BuilderFeeRates, MarketInfo } from '@polymarket/bindings/clob';
9
10
  import * as _polymarket_bindings_data from '@polymarket/bindings/data';
10
- import { MetaMarketPosition, Position, ClosedPosition, Value, Traded, Activity, LeaderboardEntry, BuilderVolumeEntry, TraderLeaderboardEntry, LiveVolume, OpenInterest, MetaHolder, Trade } from '@polymarket/bindings/data';
11
- import { CommentsEvent, CryptoPricesTopic, EquityPricesTopic, EquityPricesEvent, MarketEvent, StandardMarketEvent, UserEvent, SportsEvent, CryptoPricesBinanceEvent, CryptoPricesChainlinkEvent, CryptoPricesEvent } from '@polymarket/bindings/subscriptions';
11
+ import { Value, Traded, ClosedPosition, ComboPosition, Position, MetaMarketPosition, Activity, LeaderboardEntry, BuilderVolumeEntry, TraderLeaderboardEntry, LiveVolume, OpenInterest, MetaHolder, Trade } from '@polymarket/bindings/data';
12
+ 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, PerpsAccountConfig, PerpsOrder, PerpsAccountFill, PerpsAccountFundingPayment, PerpsDeposit, PerpsWithdrawal, PerpsEquityPoint, PerpsPnlPoint, PerpsPostOrderAck, PerpsCancelOrderResult, PerpsKlineInterval, PerpsInstrumentIdSchema } from '@polymarket/bindings/perps';
15
+ import { PerpsSessionEvent, CommentsEvent, CryptoPricesTopic, EquityPricesTopic, EquityPricesEvent, MarketEvent, StandardMarketEvent, UserEvent, SportsEvent, CryptoPricesBinanceEvent, CryptoPricesChainlinkEvent, PerpsTradeEvent, PerpsBboEvent, PerpsBookEvent, PerpsCandleEvent, PerpsTickerEvent, PerpsStatisticEvent, CryptoPricesEvent, PerpsMarketDataEvent } from '@polymarket/bindings/subscriptions';
12
16
  import { Hex } from 'ox';
13
17
 
14
18
  type ResponseValidationContext = {
@@ -119,6 +123,10 @@ type SendErc20TransferTransactionRequest = {
119
123
  kind: 'sendErc20TransferTransaction';
120
124
  request: SignerTransactionRequest;
121
125
  };
126
+ type SendPerpsDepositTransactionRequest = {
127
+ kind: 'sendPerpsDepositTransaction';
128
+ request: SignerTransactionRequest;
129
+ };
122
130
  type SignGaslessTypedDataRequest = {
123
131
  kind: 'signGaslessTypedData';
124
132
  payload: TypedDataPayload;
@@ -157,7 +165,7 @@ declare const FetchExecuteParamsError: {
157
165
  * Fetches the parameters needed to prepare a low-level transaction submission.
158
166
  *
159
167
  * @remarks
160
- * This is a low-level action that most SDK consumers will not need.
168
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
161
169
  *
162
170
  * @throws {@link FetchExecuteParamsError}
163
171
  * Thrown on failure.
@@ -167,32 +175,35 @@ declare const FetchGaslessTransactionRequestSchema: z.ZodObject<{
167
175
  transactionId: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.TransactionId, string>>;
168
176
  }, z.core.$strip>;
169
177
  type FetchGaslessTransactionRequest = z.input<typeof FetchGaslessTransactionRequestSchema>;
170
- declare const IsGaslessReadyRequestSchema: z.ZodObject<{
178
+ declare const IsWalletDeployedRequestSchema: z.ZodObject<{
171
179
  wallet: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
172
180
  type: z.ZodEnum<typeof WalletType>;
173
181
  }, z.core.$strip>;
174
- type IsGaslessReadyRequest = z.input<typeof IsGaslessReadyRequestSchema>;
175
- type IsGaslessReadyError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
176
- declare const IsGaslessReadyError: {
182
+ type IsWalletDeployedRequest = z.input<typeof IsWalletDeployedRequestSchema>;
183
+ type IsWalletDeployedError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
184
+ declare const IsWalletDeployedError: {
177
185
  isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
178
186
  };
179
187
  /**
180
- * Checks whether a wallet is ready for gasless transactions.
188
+ * Checks whether a wallet is deployed for relayer-backed transactions.
189
+ *
190
+ * It only checks deployment status; it does not check trading approvals or complete
191
+ * order-readiness.
181
192
  *
182
193
  * @remarks
183
- * This is a low-level action that most SDK consumers will not need.
194
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
184
195
  *
185
- * @throws {@link IsGaslessReadyError}
196
+ * @throws {@link IsWalletDeployedError}
186
197
  * Thrown on failure.
187
198
  *
188
199
  * @example
189
200
  * ```ts
190
- * const ready = await isGaslessReady(client, {
201
+ * const deployed = await isWalletDeployed(client, {
191
202
  * wallet: '0x1234...',
192
203
  * });
193
204
  * ```
194
205
  */
195
- declare function isGaslessReady(client: BaseClient, request?: IsGaslessReadyRequest): Promise<boolean>;
206
+ declare function isWalletDeployed(client: BaseClient, request?: IsWalletDeployedRequest): Promise<boolean>;
196
207
  declare const GaslessTransactionMetadataSchema: z.ZodString;
197
208
  type DeployDepositWalletError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
198
209
  declare const DeployDepositWalletError: {
@@ -202,7 +213,7 @@ declare const DeployDepositWalletError: {
202
213
  * Deploys a Deposit Wallet for the authenticated signer.
203
214
  *
204
215
  * @remarks
205
- * This is a low-level action that most SDK consumers will not need.
216
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
206
217
  *
207
218
  * @throws {@link DeployDepositWalletError}
208
219
  * Thrown on failure.
@@ -212,7 +223,7 @@ declare function deployDepositWallet(client: BaseSecureClient): Promise<Transact
212
223
  * Fetches a submitted transaction.
213
224
  *
214
225
  * @remarks
215
- * This is a low-level action that most SDK consumers will not need.
226
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
216
227
  *
217
228
  * @throws {@link FetchGaslessTransactionError}
218
229
  * Thrown on failure.
@@ -245,7 +256,7 @@ declare const PrepareGaslessTransactionError: {
245
256
  * Starts preparing a low-level transaction workflow from one or more calls.
246
257
  *
247
258
  * @remarks
248
- * This is a low-level action that most SDK consumers will not need.
259
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
249
260
  *
250
261
  * @throws {@link PrepareGaslessTransactionError}
251
262
  * Thrown on failure.
@@ -269,6 +280,270 @@ type Paginated<T> = AsyncIterable<Page<T>> & {
269
280
  from(cursor?: PaginationCursor): Paginated<T>;
270
281
  };
271
282
 
283
+ declare const ListPositionsRequestSchema: z.ZodObject<{
284
+ cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
285
+ user: z.ZodString;
286
+ market: z.ZodOptional<z.ZodArray<z.ZodString>>;
287
+ eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
288
+ sizeThreshold: z.ZodOptional<z.ZodNumber>;
289
+ redeemable: z.ZodOptional<z.ZodBoolean>;
290
+ mergeable: z.ZodOptional<z.ZodBoolean>;
291
+ pageSize: z.ZodDefault<z.ZodNumber>;
292
+ sortBy: z.ZodOptional<z.ZodEnum<{
293
+ CURRENT: "CURRENT";
294
+ INITIAL: "INITIAL";
295
+ TOKENS: "TOKENS";
296
+ CASHPNL: "CASHPNL";
297
+ PERCENTPNL: "PERCENTPNL";
298
+ TITLE: "TITLE";
299
+ RESOLVING: "RESOLVING";
300
+ PRICE: "PRICE";
301
+ AVGPRICE: "AVGPRICE";
302
+ }>>;
303
+ sortDirection: z.ZodOptional<z.ZodEnum<{
304
+ ASC: "ASC";
305
+ DESC: "DESC";
306
+ }>>;
307
+ title: z.ZodOptional<z.ZodString>;
308
+ }, z.core.$strip>;
309
+ declare const ListClosedPositionsRequestSchema: z.ZodObject<{
310
+ cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
311
+ user: z.ZodString;
312
+ market: z.ZodOptional<z.ZodArray<z.ZodString>>;
313
+ title: z.ZodOptional<z.ZodString>;
314
+ eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
315
+ pageSize: z.ZodDefault<z.ZodNumber>;
316
+ sortBy: z.ZodOptional<z.ZodEnum<{
317
+ TITLE: "TITLE";
318
+ PRICE: "PRICE";
319
+ AVGPRICE: "AVGPRICE";
320
+ REALIZEDPNL: "REALIZEDPNL";
321
+ TIMESTAMP: "TIMESTAMP";
322
+ }>>;
323
+ sortDirection: z.ZodOptional<z.ZodEnum<{
324
+ ASC: "ASC";
325
+ DESC: "DESC";
326
+ }>>;
327
+ }, z.core.$strip>;
328
+ declare const ListComboPositionsRequestSchema: z.ZodObject<{
329
+ cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
330
+ user: z.ZodString;
331
+ pageSize: z.ZodDefault<z.ZodNumber>;
332
+ status: z.ZodOptional<z.ZodEnum<typeof _polymarket_bindings_data.ComboPositionStatus>>;
333
+ conditionId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.ComboConditionId, string>>>;
334
+ positionId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PositionId, string>>>;
335
+ }, z.core.$strip>;
336
+ declare const FetchPortfolioValueRequestSchema: z.ZodObject<{
337
+ user: z.ZodString;
338
+ market: z.ZodOptional<z.ZodArray<z.ZodString>>;
339
+ }, z.core.$strip>;
340
+ declare const FetchTradedMarketCountRequestSchema: z.ZodObject<{
341
+ user: z.ZodString;
342
+ }, z.core.$strip>;
343
+ declare const DownloadAccountingSnapshotRequestSchema: z.ZodObject<{
344
+ user: z.ZodString;
345
+ }, z.core.$strip>;
346
+ type ListPositionsRequest = z.input<typeof ListPositionsRequestSchema>;
347
+ type ListClosedPositionsRequest = z.input<typeof ListClosedPositionsRequestSchema>;
348
+ type ListComboPositionsRequest = z.input<typeof ListComboPositionsRequestSchema>;
349
+ type FetchPortfolioValueRequest = z.input<typeof FetchPortfolioValueRequestSchema>;
350
+ type FetchTradedMarketCountRequest = z.input<typeof FetchTradedMarketCountRequestSchema>;
351
+ type DownloadAccountingSnapshotRequest = z.input<typeof DownloadAccountingSnapshotRequestSchema>;
352
+ type ListPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
353
+ declare const ListPositionsError: {
354
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
355
+ };
356
+ /**
357
+ * Lists current positions for a wallet.
358
+ *
359
+ * @remarks
360
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
361
+ *
362
+ * @throws {@link ListPositionsError}
363
+ * Thrown on failure.
364
+ *
365
+ * @example
366
+ * Fetch the first page of results:
367
+ * ```ts
368
+ * const result = listPositions(client, {
369
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
370
+ * pageSize: 10,
371
+ * });
372
+ *
373
+ * const firstPage = await result.firstPage();
374
+ *
375
+ * // Optionally, fetch additional pages:
376
+ * for await (const page of result.from(firstPage.nextCursor)) {
377
+ * // page.items: Position[]
378
+ * }
379
+ * ```
380
+ *
381
+ * @example
382
+ * Loop through all pages with `for await`:
383
+ * ```ts
384
+ * const result = listPositions(client, {
385
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
386
+ * pageSize: 10,
387
+ * });
388
+ *
389
+ * for await (const page of result) {
390
+ * // page.items: Position[]
391
+ * }
392
+ * ```
393
+ */
394
+ declare function listPositions(client: BaseClient, request: ListPositionsRequest): Paginated<Position[]>;
395
+ type ListClosedPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
396
+ declare const ListClosedPositionsError: {
397
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
398
+ };
399
+ type ListComboPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
400
+ declare const ListComboPositionsError: {
401
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
402
+ };
403
+ /**
404
+ * Lists closed positions for a wallet.
405
+ *
406
+ * @remarks
407
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
408
+ *
409
+ * @throws {@link ListClosedPositionsError}
410
+ * Thrown on failure.
411
+ *
412
+ * @example
413
+ * Fetch the first page of results:
414
+ * ```ts
415
+ * const result = listClosedPositions(client, {
416
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
417
+ * pageSize: 10,
418
+ * });
419
+ *
420
+ * const firstPage = await result.firstPage();
421
+ *
422
+ * // Optionally, fetch additional pages:
423
+ * for await (const page of result.from(firstPage.nextCursor)) {
424
+ * // page.items: ClosedPosition[]
425
+ * }
426
+ * ```
427
+ *
428
+ * @example
429
+ * Loop through all pages with `for await`:
430
+ * ```ts
431
+ * const result = listClosedPositions(client, {
432
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
433
+ * pageSize: 10,
434
+ * });
435
+ *
436
+ * for await (const page of result) {
437
+ * // page.items: ClosedPosition[]
438
+ * }
439
+ * ```
440
+ */
441
+ declare function listClosedPositions(client: BaseClient, request: ListClosedPositionsRequest): Paginated<ClosedPosition[]>;
442
+ /**
443
+ * Lists combo positions for a wallet.
444
+ *
445
+ * @remarks
446
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
447
+ *
448
+ * @throws {@link ListComboPositionsError}
449
+ * Thrown on failure.
450
+ *
451
+ * @example
452
+ * Fetch the first page of results:
453
+ * ```ts
454
+ * const result = listComboPositions(client, {
455
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
456
+ * pageSize: 10,
457
+ * });
458
+ *
459
+ * const firstPage = await result.firstPage();
460
+ *
461
+ * // Optionally, fetch additional pages:
462
+ * for await (const page of result.from(firstPage.nextCursor)) {
463
+ * // page.items: ComboPosition[]
464
+ * }
465
+ * ```
466
+ *
467
+ * @example
468
+ * Filter to open combo positions:
469
+ * ```ts
470
+ * const result = listComboPositions(client, {
471
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
472
+ * status: ComboPositionStatus.Open,
473
+ * });
474
+ * ```
475
+ */
476
+ declare function listComboPositions(client: BaseClient, request: ListComboPositionsRequest): Paginated<ComboPosition[]>;
477
+ type FetchPortfolioValueError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
478
+ declare const FetchPortfolioValueError: {
479
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
480
+ };
481
+ /**
482
+ * Fetches the total value for a wallet's positions.
483
+ *
484
+ * @remarks
485
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
486
+ *
487
+ * @throws {@link FetchPortfolioValueError}
488
+ * Thrown on failure.
489
+ *
490
+ * @example
491
+ * ```ts
492
+ * const value = await fetchPortfolioValue(client, {
493
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
494
+ * });
495
+ *
496
+ * // value: Value[]
497
+ * ```
498
+ */
499
+ declare function fetchPortfolioValue(client: BaseClient, request: FetchPortfolioValueRequest): Promise<Value[]>;
500
+ type FetchTradedMarketCountError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
501
+ declare const FetchTradedMarketCountError: {
502
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
503
+ };
504
+ /**
505
+ * Fetches the total number of markets a wallet has traded.
506
+ *
507
+ * @remarks
508
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
509
+ *
510
+ * @throws {@link FetchTradedMarketCountError}
511
+ * Thrown on failure.
512
+ *
513
+ * @example
514
+ * ```ts
515
+ * const traded = await fetchTradedMarketCount(client, {
516
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
517
+ * });
518
+ *
519
+ * // traded === Traded
520
+ * ```
521
+ */
522
+ declare function fetchTradedMarketCount(client: BaseClient, request: FetchTradedMarketCountRequest): Promise<Traded>;
523
+ type DownloadAccountingSnapshotError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
524
+ declare const DownloadAccountingSnapshotError: {
525
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
526
+ };
527
+ /**
528
+ * Downloads an accounting snapshot archive for a wallet.
529
+ *
530
+ * @remarks
531
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
532
+ *
533
+ * @throws {@link DownloadAccountingSnapshotError}
534
+ * Thrown on failure.
535
+ *
536
+ * @example
537
+ * ```ts
538
+ * const snapshot = await downloadAccountingSnapshot(client, {
539
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
540
+ * });
541
+ *
542
+ * // snapshot === Blob
543
+ * ```
544
+ */
545
+ declare function downloadAccountingSnapshot(client: BaseClient, request: DownloadAccountingSnapshotRequest): Promise<Blob>;
546
+
272
547
  type DefaultAccountWallet<TRequest extends {
273
548
  user: string;
274
549
  }> = Prettify<Omit<TRequest, 'user'> & {
@@ -281,6 +556,7 @@ type DefaultAccountWallet<TRequest extends {
281
556
  }>;
282
557
  type SecureListPositionsRequest = DefaultAccountWallet<ListPositionsRequest>;
283
558
  type SecureListClosedPositionsRequest = DefaultAccountWallet<ListClosedPositionsRequest>;
559
+ type SecureListComboPositionsRequest = DefaultAccountWallet<ListComboPositionsRequest>;
284
560
  type SecureFetchPortfolioValueRequest = DefaultAccountWallet<FetchPortfolioValueRequest>;
285
561
  type SecureFetchTradedMarketCountRequest = DefaultAccountWallet<FetchTradedMarketCountRequest>;
286
562
  type SecureDownloadAccountingSnapshotRequest = DefaultAccountWallet<DownloadAccountingSnapshotRequest>;
@@ -396,6 +672,24 @@ type PublicAccountActions = Prettify<CommonAccountActions & {
396
672
  * ```
397
673
  */
398
674
  listClosedPositions(request: ListClosedPositionsRequest): Paginated<ClosedPosition[]>;
675
+ /**
676
+ * Lists combo positions for a wallet.
677
+ *
678
+ * @throws {@link ListComboPositionsError}
679
+ * Thrown on failure.
680
+ *
681
+ * @example
682
+ * Fetch the first page of results:
683
+ * ```ts
684
+ * const paginator = client.listComboPositions({
685
+ * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
686
+ * pageSize: 10,
687
+ * });
688
+ *
689
+ * const firstPage = await paginator.firstPage();
690
+ * ```
691
+ */
692
+ listComboPositions(request: ListComboPositionsRequest): Paginated<ComboPosition[]>;
399
693
  /**
400
694
  * Fetches the total value for a wallet's positions.
401
695
  *
@@ -504,6 +798,15 @@ type SecureAccountActions = Prettify<CommonAccountActions & {
504
798
  * Thrown on failure.
505
799
  */
506
800
  listClosedPositions(request?: SecureListClosedPositionsRequest): Paginated<ClosedPosition[]>;
801
+ /**
802
+ * Lists combo positions for a wallet.
803
+ *
804
+ * Defaults to the authenticated account's wallet when `user` is omitted.
805
+ *
806
+ * @throws {@link ListComboPositionsError}
807
+ * Thrown on failure.
808
+ */
809
+ listComboPositions(request?: SecureListComboPositionsRequest): Paginated<ComboPosition[]>;
507
810
  /**
508
811
  * Fetches the total value for a wallet's positions.
509
812
  *
@@ -980,6 +1283,8 @@ type DiscoveryActions = {
980
1283
  /**
981
1284
  * Lists events.
982
1285
  *
1286
+ * Defaults to open events. Pass `closed: true` to list settled events.
1287
+ *
983
1288
  * @throws {@link ListEventsError}
984
1289
  * Thrown on failure.
985
1290
  *
@@ -1050,6 +1355,10 @@ type DiscoveryActions = {
1050
1355
  /**
1051
1356
  * Lists markets.
1052
1357
  *
1358
+ * @remarks
1359
+ * Legacy multi-outcome markets cannot be represented by the binary
1360
+ * {@link Market} model and are omitted from results.
1361
+ *
1053
1362
  * @throws {@link ListMarketsError}
1054
1363
  * Thrown on failure.
1055
1364
  *
@@ -1083,9 +1392,57 @@ type DiscoveryActions = {
1083
1392
  * ```
1084
1393
  */
1085
1394
  listMarkets(request?: ListMarketsRequest): Paginated<Market[]>;
1395
+ /**
1396
+ * Lists markets available for Combos.
1397
+ *
1398
+ * @throws {@link ListComboMarketsError}
1399
+ * Thrown on failure.
1400
+ *
1401
+ * @example
1402
+ * Fetch the first page of results:
1403
+ * ```ts
1404
+ * const paginator = client.listComboMarkets({
1405
+ * pageSize: 10,
1406
+ * });
1407
+ *
1408
+ * const firstPage = await paginator.firstPage();
1409
+ *
1410
+ * // Optionally, fetch additional pages:
1411
+ * for await (const page of paginator.from(firstPage.nextCursor)) {
1412
+ * // page.items: ComboMarket[]
1413
+ * }
1414
+ * ```
1415
+ *
1416
+ * @example
1417
+ * Loop through all pages with `for await`:
1418
+ * ```ts
1419
+ * const paginator = client.listComboMarkets({
1420
+ * pageSize: 10,
1421
+ * });
1422
+ *
1423
+ * for await (const page of paginator) {
1424
+ * // page.items: ComboMarket[]
1425
+ * }
1426
+ * ```
1427
+ *
1428
+ * @example
1429
+ * Omit markets the caller has already displayed:
1430
+ * ```ts
1431
+ * const paginator = client.listComboMarkets({
1432
+ * exclude: ['0x4cd77d456c83e7d8c569a8fb8f6396c3f40154f657e6d970733e2b1b6a7110ff'],
1433
+ * pageSize: 10,
1434
+ * });
1435
+ * ```
1436
+ */
1437
+ listComboMarkets(request?: ListComboMarketsRequest): Paginated<ComboMarket[]>;
1086
1438
  /**
1087
1439
  * Fetches a market.
1088
1440
  *
1441
+ * @remarks
1442
+ * Legacy multi-outcome markets cannot be represented by the binary
1443
+ * {@link Market} model, so fetching one fails with an
1444
+ * `UnexpectedResponseError`.
1445
+ *
1089
1446
  * @throws {@link FetchMarketError}
1090
1447
  * Thrown on failure.
1091
1448
  *
@@ -1100,7 +1457,7 @@ type DiscoveryActions = {
1100
1457
  * });
1101
1458
  *
1102
1459
  * const marketByUrl = await client.fetchMarket({
1103
- * url: 'https://polymarket.com/market/some-market-slug',
1460
+ * url: 'https://polymarket.com/event/some-market-slug',
1104
1461
  * });
1105
1462
  * ```
1106
1463
  */
@@ -1246,6 +1603,9 @@ type DiscoveryActions = {
1246
1603
  /**
1247
1604
  * Runs a public full-text search.
1248
1605
  *
1606
+ * `keepClosedMarkets` is an hour window for including recently closed markets
1607
+ * when searching active events.
1608
+ *
1249
1609
  * @throws {@link SearchError}
1250
1610
  * Thrown on failure.
1251
1611
  *
@@ -1435,6 +1795,107 @@ type DiscoveryActions = {
1435
1795
  declare function discoveryActions(client: BasePublicClient): DiscoveryActions;
1436
1796
  declare function discoveryActions(client: BaseSecureClient): DiscoveryActions;
1437
1797
 
1798
+ type PublicPerpsActions = {
1799
+ /**
1800
+ * Fetches Perps instruments.
1801
+ *
1802
+ * @throws {@link FetchPerpsInstrumentsError}
1803
+ * Thrown on failure.
1804
+ */
1805
+ fetchPerpsInstruments(request?: FetchPerpsInstrumentsRequest): Promise<PerpsInstrument[]>;
1806
+ /**
1807
+ * Fetches the current Perps ticker for an instrument.
1808
+ *
1809
+ * @throws {@link FetchPerpsTickerError}
1810
+ * Thrown on failure.
1811
+ */
1812
+ fetchPerpsTicker(request: FetchPerpsTickerRequest): Promise<PerpsTicker>;
1813
+ /**
1814
+ * Fetches current Perps tickers.
1815
+ *
1816
+ * @throws {@link FetchPerpsTickersError}
1817
+ * Thrown on failure.
1818
+ */
1819
+ fetchPerpsTickers(request?: FetchPerpsTickersRequest): Promise<PerpsTicker[]>;
1820
+ /**
1821
+ * Fetches a Perps order book.
1822
+ *
1823
+ * @throws {@link FetchPerpsBookError}
1824
+ * Thrown on failure.
1825
+ */
1826
+ fetchPerpsBook(request: FetchPerpsBookRequest): Promise<PerpsBook>;
1827
+ /**
1828
+ * Lists Perps candles for an instrument with SDK-owned pagination.
1829
+ *
1830
+ * @throws {@link ListPerpsCandlesError}
1831
+ * Thrown on failure.
1832
+ */
1833
+ listPerpsCandles(request: ListPerpsCandlesRequest): Paginated<PerpsCandle[]>;
1834
+ /**
1835
+ * Lists Perps funding-rate history for an instrument with SDK-owned pagination.
1836
+ *
1837
+ * @throws {@link ListPerpsFundingHistoryError}
1838
+ * Thrown on failure.
1839
+ */
1840
+ listPerpsFundingHistory(request: ListPerpsFundingHistoryRequest): Paginated<PerpsFundingRate[]>;
1841
+ /**
1842
+ * Lists recent Perps trades for an instrument with SDK-owned pagination.
1843
+ *
1844
+ * @throws {@link ListPerpsTradesError}
1845
+ * Thrown on failure.
1846
+ */
1847
+ listPerpsTrades(request: ListPerpsTradesRequest): Paginated<PerpsPublicTrade[]>;
1848
+ /**
1849
+ * Fetches the Perps fee schedule.
1850
+ *
1851
+ * @throws {@link FetchPerpsFeesError}
1852
+ * Thrown on failure.
1853
+ */
1854
+ fetchPerpsFees(): Promise<PerpsFeeScheduleEntry[]>;
1855
+ };
1856
+ type SecurePerpsActions = PublicPerpsActions & {
1857
+ /**
1858
+ * Deposits collateral into Perps for the authenticated signer account.
1859
+ *
1860
+ * @throws {@link DepositToPerpsError}
1861
+ * Thrown on failure.
1862
+ */
1863
+ depositToPerps(request: DepositToPerpsRequest): Promise<TransactionHandle>;
1864
+ /**
1865
+ * Opens a Perps account session.
1866
+ *
1867
+ * @remarks
1868
+ * Omit `expiresIn` to create new delegated Perps credentials that expire after
1869
+ * one week. Pass `expiresIn` as a duration in milliseconds to use a shorter or
1870
+ * longer credential lifetime, or pass existing credentials to validate and
1871
+ * resume a previous session.
1872
+ *
1873
+ * @throws {@link OpenPerpsSessionError}
1874
+ * Thrown on failure.
1875
+ */
1876
+ openPerpsSession(request?: OpenPerpsSessionRequest): Promise<PerpsSession>;
1877
+ /**
1878
+ * Revokes delegated Perps credentials by proxy address.
1879
+ *
1880
+ * @remarks
1881
+ * This can revoke credentials outside the currently open Perps session.
1882
+ *
1883
+ * @throws {@link RevokePerpsCredentialsError}
1884
+ * Thrown on failure.
1885
+ */
1886
+ revokePerpsCredentials(request: RevokePerpsCredentialsRequest): Promise<void>;
1887
+ /**
1888
+ * Requests a Perps withdrawal to the authenticated wallet.
1889
+ *
1890
+ * @throws {@link WithdrawFromPerpsError}
1891
+ * Thrown on failure.
1892
+ */
1893
+ withdrawFromPerps(request: WithdrawFromPerpsRequest): Promise<PerpsWithdrawalId>;
1894
+ };
1895
+ type PerpsActions = PublicPerpsActions;
1896
+ declare function perpsActions(client: BasePublicClient): PublicPerpsActions;
1897
+ declare function perpsActions(client: BaseSecureClient): SecurePerpsActions;
1898
+
1438
1899
  type PublicRewardsActions = {
1439
1900
  /**
1440
1901
  * Lists current active market rewards.
@@ -1567,68 +2028,429 @@ type SecureRewardsActions = Prettify<PublicRewardsActions & {
1567
2028
  */
1568
2029
  listUserEarningsForDay(request: ListUserEarningsForDayRequest): Paginated<UserEarning[]>;
1569
2030
  /**
1570
- * Fetches total earnings for the authenticated account on a given day.
2031
+ * Fetches total earnings for the authenticated account on a given day.
2032
+ *
2033
+ * @throws {@link FetchTotalEarningsForUserForDayError}
2034
+ * Thrown on failure.
2035
+ *
2036
+ * @example
2037
+ * ```ts
2038
+ * const earnings = await client.fetchTotalEarningsForUserForDay({
2039
+ * date: '2026-04-16',
2040
+ * });
2041
+ * ```
2042
+ */
2043
+ fetchTotalEarningsForUserForDay(request: FetchTotalEarningsForUserForDayRequest): Promise<TotalUserEarning[]>;
2044
+ /**
2045
+ * Lists market reward configuration and earnings for the authenticated account on a given day.
2046
+ *
2047
+ * @throws {@link ListUserEarningsAndMarketsConfigError}
2048
+ * Thrown on failure.
2049
+ *
2050
+ * @example
2051
+ * Fetch the first page of results:
2052
+ * ```ts
2053
+ * const paginator = client.listUserEarningsAndMarketsConfig({
2054
+ * date: '2026-04-16',
2055
+ * });
2056
+ *
2057
+ * const firstPage = await paginator.firstPage();
2058
+ *
2059
+ * // Optionally, fetch additional pages:
2060
+ * for await (const page of paginator.from(firstPage.nextCursor)) {
2061
+ * // page.items: UserRewardsEarning[]
2062
+ * }
2063
+ * ```
2064
+ *
2065
+ * @example
2066
+ * Loop through all pages with `for await`:
2067
+ * ```ts
2068
+ * const paginator = client.listUserEarningsAndMarketsConfig({
2069
+ * date: '2026-04-16',
2070
+ * });
2071
+ *
2072
+ * for await (const page of paginator) {
2073
+ * // page.items: UserRewardsEarning[]
2074
+ * }
2075
+ * ```
2076
+ */
2077
+ listUserEarningsAndMarketsConfig(request: ListUserEarningsAndMarketsConfigRequest): Paginated<UserRewardsEarning[]>;
2078
+ /**
2079
+ * Fetches reward percentages for the authenticated account.
2080
+ *
2081
+ * @throws {@link FetchRewardPercentagesError}
2082
+ * Thrown on failure.
2083
+ *
2084
+ * @example
2085
+ * ```ts
2086
+ * const percentages = await client.fetchRewardPercentages();
2087
+ * ```
2088
+ */
2089
+ fetchRewardPercentages(): Promise<RewardsPercentages>;
2090
+ }>;
2091
+ declare function rewardsActions(client: BasePublicClient): PublicRewardsActions;
2092
+ declare function rewardsActions(client: BaseSecureClient): SecureRewardsActions;
2093
+
2094
+ /**
2095
+ * Plain-data reference identifying a submitted RFQ quote.
2096
+ *
2097
+ * @remarks
2098
+ * This identifies the quote; it does not imply execution or guarantee that a
2099
+ * later cancellation request can withdraw it.
2100
+ */
2101
+ type RfqQuoteReference = Omit<RfqQuoteAck, 'type'>;
2102
+ /** Acknowledgement that a quote cancellation request was processed. */
2103
+ type RfqCancelQuoteAck = Omit<RfqQuoteCancelAck, 'type'>;
2104
+ type RfqConfirmationAck = Omit<RfqConfirmationAck$1, 'decision' | 'type'>;
2105
+ type RfqQuoteSource = 'collateral' | 'inventory';
2106
+ type RfqQuoteResponse = {
2107
+ /** Quote price in pUSD per outcome token, for example `0.45` or `"0.45"`. */
2108
+ price: number | string;
2109
+ /**
2110
+ * How the maker wants to fund the quote.
2111
+ *
2112
+ * @remarks
2113
+ * For a BUY request (BUY YES):
2114
+ * - `inventory` sells YES tokens from the maker's inventory at `price`.
2115
+ * - `collateral` buys NO tokens with collateral at `1 - price`.
2116
+ *
2117
+ * For a SELL request (SELL YES):
2118
+ * - `inventory` sells NO tokens from the maker's inventory at `1 - price`.
2119
+ * - `collateral` buys YES tokens with collateral at `price`.
2120
+ *
2121
+ * When omitted, the SDK uses `collateral`.
2122
+ *
2123
+ * @defaultValue `'collateral'`
2124
+ */
2125
+ source?: RfqQuoteSource;
2126
+ /**
2127
+ * Optional quote size in outcome tokens.
2128
+ *
2129
+ * This is the human-readable token amount: `1` means one full share, not one
2130
+ * 6-decimal base unit. When omitted, the quote uses the full RFQ request size.
2131
+ */
2132
+ size?: number | string;
2133
+ };
2134
+ type RfqQuoteRejectedErrorOptions = {
2135
+ /** RFQ error code for the rejected quote. */
2136
+ code?: RfqErrorCode;
2137
+ /** Error identifier for the rejected quote. */
2138
+ errorId?: string;
2139
+ /** RFQ identifier for the rejected quote. */
2140
+ rfqId: RfqId;
2141
+ };
2142
+ /**
2143
+ * Error thrown when the RFQ server rejects a quote response.
2144
+ */
2145
+ declare class RfqQuoteRejectedError extends PolymarketError {
2146
+ name: "RfqQuoteRejectedError";
2147
+ readonly code: RfqErrorCode | undefined;
2148
+ readonly errorId: string | undefined;
2149
+ readonly rfqId: RfqId;
2150
+ constructor(message: string, options: ErrorOptions & RfqQuoteRejectedErrorOptions);
2151
+ }
2152
+ type RfqQuoteError = RfqQuoteRejectedError | SigningError | TimeoutError | TransportError | UserInputError;
2153
+ declare const RfqQuoteError: {
2154
+ isError(error: unknown): error is SigningError | TransportError | UserInputError | TimeoutError | RfqQuoteRejectedError;
2155
+ };
2156
+ type RfqCancelQuoteRejectedErrorOptions = {
2157
+ /** RFQ error code for the rejected cancellation request. */
2158
+ code?: RfqErrorCode;
2159
+ /** Error identifier for the rejected cancellation request. */
2160
+ errorId?: string;
2161
+ /** RFQ identifier for the cancellation request. */
2162
+ rfqId: RfqId;
2163
+ /** Quote identifier for the cancellation request. */
2164
+ quoteId: RfqQuoteId;
2165
+ };
2166
+ /**
2167
+ * Error thrown when the RFQ server rejects a quote cancellation request.
2168
+ */
2169
+ declare class RfqCancelQuoteRejectedError extends PolymarketError {
2170
+ name: "RfqCancelQuoteRejectedError";
2171
+ readonly code: RfqErrorCode | undefined;
2172
+ readonly errorId: string | undefined;
2173
+ readonly rfqId: RfqId;
2174
+ readonly quoteId: RfqQuoteId;
2175
+ constructor(message: string, options: ErrorOptions & RfqCancelQuoteRejectedErrorOptions);
2176
+ }
2177
+ type RfqCancelQuoteError = RfqCancelQuoteRejectedError | TimeoutError | TransportError;
2178
+ declare const RfqCancelQuoteError: {
2179
+ isError(error: unknown): error is TransportError | TimeoutError | RfqCancelQuoteRejectedError;
2180
+ };
2181
+ type RfqConfirmationRejectedErrorOptions = {
2182
+ /** RFQ error code for the rejected confirmation decision. */
2183
+ code?: RfqErrorCode;
2184
+ /** Error identifier for the rejected confirmation decision. */
2185
+ errorId?: string;
2186
+ /** RFQ identifier for the rejected confirmation decision. */
2187
+ rfqId: RfqId;
2188
+ /** Quote identifier for the rejected confirmation decision. */
2189
+ quoteId: RfqQuoteId;
2190
+ };
2191
+ /**
2192
+ * Error thrown when the RFQ server rejects a confirmation decision.
2193
+ */
2194
+ declare class RfqConfirmationRejectedError extends PolymarketError {
2195
+ name: "RfqConfirmationRejectedError";
2196
+ readonly code: RfqErrorCode | undefined;
2197
+ readonly errorId: string | undefined;
2198
+ readonly rfqId: RfqId;
2199
+ readonly quoteId: RfqQuoteId;
2200
+ constructor(message: string, options: ErrorOptions & RfqConfirmationRejectedErrorOptions);
2201
+ }
2202
+ type RfqConfirmationError = RfqConfirmationRejectedError | TimeoutError | TransportError;
2203
+ declare const RfqConfirmationError: {
2204
+ isError(error: unknown): error is TransportError | TimeoutError | RfqConfirmationRejectedError;
2205
+ };
2206
+ /**
2207
+ * Server request asking the market maker to provide a quote for an RFQ.
2208
+ */
2209
+ interface RfqQuoteRequestEvent extends RfqQuoteRequest {
2210
+ /** Requested RFQ size and unit. Share values are human-readable outcome-token amounts. */
2211
+ requestedSize: RfqRequestedSize;
2212
+ /**
2213
+ * Requested RFQ position side.
2214
+ *
2215
+ * @remarks
2216
+ * The current RFQ system only supports YES-side requests, so this is always
2217
+ * {@link RfqSide.Yes}. Use {@link RfqQuoteRequestEvent.direction} to determine
2218
+ * whether the requester wants to buy or sell that YES-side position.
2219
+ */
2220
+ side: RfqSide.Yes;
2221
+ /**
2222
+ * Sends a quote response for this RFQ request.
2223
+ *
2224
+ * @remarks
2225
+ * If this resolves, the server accepted the quote and assigned `quoteId`.
2226
+ *
2227
+ * @throws {@link RfqQuoteError}
2228
+ * Thrown when validation fails, signing fails, the websocket fails, the quote
2229
+ * acknowledgement times out, or the server rejects the quote.
2230
+ */
2231
+ quote(response: RfqQuoteResponse): Promise<RfqQuoteReference>;
2232
+ }
2233
+ /**
2234
+ * Server request asking the market maker to confirm or decline a selected quote.
2235
+ */
2236
+ interface RfqConfirmationRequestEvent extends RfqConfirmationRequest {
2237
+ /**
2238
+ * Requested RFQ position side.
2239
+ *
2240
+ * @remarks
2241
+ * The current RFQ system only supports YES-side requests, so this is always
2242
+ * {@link RfqSide.Yes}. Use {@link RfqConfirmationRequestEvent.direction} to
2243
+ * determine whether the requester wants to buy or sell that YES-side position.
2244
+ */
2245
+ side: RfqSide.Yes;
2246
+ /**
2247
+ * Confirms that the maker wants to proceed with the selected quote.
2248
+ *
2249
+ * @remarks
2250
+ * If this resolves, the server accepted the confirmation decision.
2251
+ *
2252
+ * @throws {@link RfqConfirmationError}
2253
+ * Thrown when the websocket fails, the acknowledgement times out, or the
2254
+ * server rejects the confirmation decision.
2255
+ */
2256
+ confirm(): Promise<RfqConfirmationAck>;
2257
+ /**
2258
+ * Declines the selected quote during the confirmation window.
2259
+ *
2260
+ * @remarks
2261
+ * If this resolves, the server accepted the decline decision.
2262
+ *
2263
+ * @throws {@link RfqConfirmationError}
2264
+ * Thrown when the websocket fails, the acknowledgement times out, or the
2265
+ * server rejects the decline decision.
2266
+ */
2267
+ decline(): Promise<RfqConfirmationAck>;
2268
+ }
2269
+ /**
2270
+ * Execution status update for an RFQ after acceptance and handoff.
2271
+ */
2272
+ interface RfqExecutionUpdateEvent extends RfqExecutionUpdate {
2273
+ }
2274
+ /**
2275
+ * Confirmed combo trade broadcast visible to all authenticated quoters.
2276
+ */
2277
+ interface RfqTradeEvent extends RfqTrade {
2278
+ }
2279
+ /**
2280
+ * Event emitted by an RFQ session.
2281
+ */
2282
+ type RfqEvent = RfqQuoteRequestEvent | RfqConfirmationRequestEvent | RfqExecutionUpdateEvent | RfqTradeEvent;
2283
+ interface RfqSession extends AsyncIterable<RfqEvent> {
2284
+ /**
2285
+ * Requests cancellation of a submitted RFQ quote.
2286
+ *
2287
+ * @remarks
2288
+ * The returned ack means the backend processed the cancellation request; it
2289
+ * does not guarantee the quote was withdrawn from an already-selected RFQ.
2290
+ *
2291
+ * @throws {@link RfqCancelQuoteError}
2292
+ * Thrown when the websocket fails, the acknowledgement times out, or the
2293
+ * server rejects the cancellation request.
2294
+ */
2295
+ cancelQuote(reference: RfqQuoteReference): Promise<RfqCancelQuoteAck>;
2296
+ /**
2297
+ * Closes the RFQ quoter stream.
2298
+ */
2299
+ close(): Promise<void>;
2300
+ }
2301
+ type OpenRfqSessionError = TransportError;
2302
+ declare const OpenRfqSessionError: {
2303
+ isError(error: unknown): error is TransportError;
2304
+ };
2305
+ /**
2306
+ * Opens an RFQ event session.
2307
+ *
2308
+ * @remarks
2309
+ * The returned async iterator is a stream, not a worker queue. Await inside the
2310
+ * loop to process RFQ events sequentially, or dispatch handlers without awaiting
2311
+ * them to fan out handling when quote windows are tight.
2312
+ *
2313
+ * @throws {@link OpenRfqSessionError}
2314
+ * Thrown on failure.
2315
+ */
2316
+ declare function openRfqSession(client: BaseSecureClient): Promise<RfqSession>;
2317
+
2318
+ type SecureRfqActions = {
2319
+ /**
2320
+ * Opens an RFQ event session.
1571
2321
  *
1572
- * @throws {@link FetchTotalEarningsForUserForDayError}
1573
- * Thrown on failure.
2322
+ * @remarks
2323
+ * The returned async iterator is a stream, not a worker queue. Await inside the
2324
+ * loop to process RFQ events sequentially, or dispatch handlers without awaiting
2325
+ * them to fan out handling when quote windows are tight.
1574
2326
  *
1575
2327
  * @example
2328
+ * Quote the full requested size:
1576
2329
  * ```ts
1577
- * const earnings = await client.fetchTotalEarningsForUserForDay({
1578
- * date: '2026-04-16',
1579
- * });
2330
+ * const session = await client.openRfqSession();
2331
+ *
2332
+ * for await (const event of session) {
2333
+ * switch (event.type) {
2334
+ * case 'quote_request':
2335
+ * await event.quote({ price: 0.45 });
2336
+ * break;
2337
+ *
2338
+ * case 'execution_update':
2339
+ * // event.rfqId: RfqId
2340
+ * // event.status: RfqExecutionStatus
2341
+ * // event.txHash: TxHash | undefined
2342
+ * break;
2343
+ * }
2344
+ * }
1580
2345
  * ```
1581
- */
1582
- fetchTotalEarningsForUserForDay(request: FetchTotalEarningsForUserForDayRequest): Promise<TotalUserEarning[]>;
1583
- /**
1584
- * Lists market reward configuration and earnings for the authenticated account on a given day.
1585
- *
1586
- * @throws {@link ListUserEarningsAndMarketsConfigError}
1587
- * Thrown on failure.
1588
2346
  *
1589
2347
  * @example
1590
- * Fetch the first page of results:
2348
+ * Quote a specific outcome-token size. `0.5` means half of one share, not
2349
+ * half of one 6-decimal base unit:
1591
2350
  * ```ts
1592
- * const paginator = client.listUserEarningsAndMarketsConfig({
1593
- * date: '2026-04-16',
1594
- * });
2351
+ * const session = await client.openRfqSession();
1595
2352
  *
1596
- * const firstPage = await paginator.firstPage();
2353
+ * for await (const event of session) {
2354
+ * switch (event.type) {
2355
+ * case 'quote_request':
2356
+ * await event.quote({ price: 0.45, size: 0.5 });
2357
+ * break;
1597
2358
  *
1598
- * // Optionally, fetch additional pages:
1599
- * for await (const page of paginator.from(firstPage.nextCursor)) {
1600
- * // page.items: UserRewardsEarning[]
2359
+ * //
2360
+ * }
1601
2361
  * }
1602
2362
  * ```
1603
2363
  *
1604
2364
  * @example
1605
- * Loop through all pages with `for await`:
2365
+ * Cancel a submitted quote using the live session:
1606
2366
  * ```ts
1607
- * const paginator = client.listUserEarningsAndMarketsConfig({
1608
- * date: '2026-04-16',
1609
- * });
2367
+ * const session = await client.openRfqSession();
1610
2368
  *
1611
- * for await (const page of paginator) {
1612
- * // page.items: UserRewardsEarning[]
2369
+ * for await (const event of session) {
2370
+ * switch (event.type) {
2371
+ * case 'quote_request': {
2372
+ * const ref = await event.quote({ price: 0.45 });
2373
+ *
2374
+ * if (shouldCancel(ref)) {
2375
+ * await session.cancelQuote(ref);
2376
+ * }
2377
+ * break;
2378
+ * }
2379
+ *
2380
+ * // …
2381
+ * }
1613
2382
  * }
1614
2383
  * ```
1615
- */
1616
- listUserEarningsAndMarketsConfig(request: ListUserEarningsAndMarketsConfigRequest): Paginated<UserRewardsEarning[]>;
1617
- /**
1618
- * Fetches reward percentages for the authenticated account.
2384
+ * The cancellation ack means the backend processed the request; it does not
2385
+ * guarantee the quote was withdrawn from an already-selected RFQ.
1619
2386
  *
1620
- * @throws {@link FetchRewardPercentagesError}
1621
- * Thrown on failure.
2387
+ * @example
2388
+ * Handle Last Look confirmation requests:
2389
+ * ```ts
2390
+ * const session = await client.openRfqSession();
2391
+ *
2392
+ * for await (const event of session) {
2393
+ * switch (event.type) {
2394
+ * case 'quote_request':
2395
+ * await event.quote({ price: 0.45 });
2396
+ * break;
2397
+ *
2398
+ * case 'confirmation_request':
2399
+ * await event.confirm();
2400
+ * break;
2401
+ *
2402
+ * // …
2403
+ * }
2404
+ * }
2405
+ * ```
2406
+ * Any maker can quote permissionlessly. Last Look confirmation requests are
2407
+ * only sent to makers with Last Look enabled.
1622
2408
  *
1623
2409
  * @example
2410
+ * Choose collateral or inventory per request:
1624
2411
  * ```ts
1625
- * const percentages = await client.fetchRewardPercentages();
2412
+ * const session = await client.openRfqSession();
2413
+ *
2414
+ * for await (const event of session) {
2415
+ * switch (event.type) {
2416
+ * case 'quote_request': {
2417
+ * switch (event.direction) {
2418
+ * case RfqDirection.Buy:
2419
+ * await event.quote({
2420
+ * price: 0.45,
2421
+ * source: chooseSource(event.yesPositionId, event.requestedSize),
2422
+ * });
2423
+ * break;
2424
+ *
2425
+ * case RfqDirection.Sell:
2426
+ * await event.quote({
2427
+ * price: 0.45,
2428
+ * source: chooseSource(event.noPositionId, event.requestedSize),
2429
+ * });
2430
+ * break;
2431
+ * }
2432
+ * break;
2433
+ * }
2434
+ *
2435
+ * case 'confirmation_request':
2436
+ * await event.confirm();
2437
+ * break;
2438
+ *
2439
+ * // …
2440
+ * }
2441
+ * }
2442
+ *
2443
+ * function chooseSource(positionId: PositionId, requestedSize: RfqRequestedSize): RfqQuoteSource {
2444
+ * return hasInventory(positionId, requestedSize) ? 'inventory' : 'collateral';
2445
+ * }
1626
2446
  * ```
2447
+ *
2448
+ * @throws {@link OpenRfqSessionError}
2449
+ * Thrown on failure.
1627
2450
  */
1628
- fetchRewardPercentages(): Promise<RewardsPercentages>;
1629
- }>;
1630
- declare function rewardsActions(client: BasePublicClient): PublicRewardsActions;
1631
- declare function rewardsActions(client: BaseSecureClient): SecureRewardsActions;
2451
+ openRfqSession(): Promise<RfqSession>;
2452
+ };
2453
+ declare function rfqActions(client: BaseSecureClient): SecureRfqActions;
1632
2454
 
1633
2455
  type PublicSubscriptionsActions = {
1634
2456
  /**
@@ -1692,6 +2514,9 @@ declare const CancelOrderError: {
1692
2514
  /**
1693
2515
  * Cancels a single open order for the authenticated account.
1694
2516
  *
2517
+ * @remarks
2518
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2519
+ *
1695
2520
  * @throws {@link CancelOrderError}
1696
2521
  * Thrown on failure.
1697
2522
  *
@@ -1713,6 +2538,9 @@ declare const CancelOrdersError: {
1713
2538
  /**
1714
2539
  * Cancels multiple open orders for the authenticated account.
1715
2540
  *
2541
+ * @remarks
2542
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2543
+ *
1716
2544
  * @throws {@link CancelOrdersError}
1717
2545
  * Thrown on failure.
1718
2546
  *
@@ -1733,6 +2561,9 @@ declare const CancelAllError: {
1733
2561
  /**
1734
2562
  * Cancels all open orders for the authenticated account.
1735
2563
  *
2564
+ * @remarks
2565
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2566
+ *
1736
2567
  * @throws {@link CancelAllError}
1737
2568
  * Thrown on failure.
1738
2569
  *
@@ -1753,6 +2584,9 @@ declare const CancelMarketOrdersError: {
1753
2584
  * Cancels all open orders for the authenticated account that match the market
1754
2585
  * or token filter.
1755
2586
  *
2587
+ * @remarks
2588
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2589
+ *
1756
2590
  * @throws {@link CancelMarketOrdersError}
1757
2591
  * Thrown on failure.
1758
2592
  *
@@ -1813,6 +2647,9 @@ declare const EstimateMarketPriceError: {
1813
2647
  * should be treated as a partial-fill execution estimate rather than a full-fill
1814
2648
  * guarantee.
1815
2649
  *
2650
+ * @remarks
2651
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2652
+ *
1816
2653
  * @example
1817
2654
  * ```ts
1818
2655
  * const price = await estimateMarketPrice(client, {
@@ -1868,14 +2705,35 @@ type PrepareMarketBuyOrderRequest = BasePrepareMarketOrderRequest & {
1868
2705
  * fees. Leave it unset to pay fees on top of `amount`.
1869
2706
  */
1870
2707
  maxSpend?: number | string;
2708
+ /**
2709
+ * Highest acceptable price per share for the BUY.
2710
+ *
2711
+ * The order may only fill at this price or better. For FOK, the full
2712
+ * `amount` must fill within this bound or the order is killed. For FAK, any
2713
+ * immediately available liquidity within this bound fills and the remainder
2714
+ * is canceled.
2715
+ */
2716
+ maxPrice?: number | string;
1871
2717
  };
1872
2718
  type PrepareMarketSellOrderRequest = BasePrepareMarketOrderRequest & {
1873
2719
  /** Sell side of the order. */
1874
2720
  side: OrderSide.SELL;
1875
2721
  /**
1876
- * Number of conditional-token shares to sell.
2722
+ * Number of outcome tokens to sell.
2723
+ *
2724
+ * This is the human-readable token amount: `1` means one full share, not one
2725
+ * 6-decimal base unit.
1877
2726
  */
1878
2727
  shares: number | string;
2728
+ /**
2729
+ * Lowest acceptable price per share for the SELL.
2730
+ *
2731
+ * The order may only fill at this price or better. For FOK, all `shares`
2732
+ * must fill within this bound or the order is killed. For FAK, any
2733
+ * immediately available liquidity within this bound fills and the remainder
2734
+ * is canceled.
2735
+ */
2736
+ minPrice?: number | string;
1879
2737
  };
1880
2738
  type PrepareMarketOrderRequest = PrepareMarketBuyOrderRequest | PrepareMarketSellOrderRequest;
1881
2739
  type PrepareLimitOrderRequest = {
@@ -1883,7 +2741,12 @@ type PrepareLimitOrderRequest = {
1883
2741
  tokenId: string;
1884
2742
  /** Price used to create the order */
1885
2743
  price: number | string;
1886
- /** Size in terms of the conditional token */
2744
+ /**
2745
+ * Order size in outcome tokens.
2746
+ *
2747
+ * This is the human-readable token amount: `1` means one full share, not one
2748
+ * 6-decimal base unit.
2749
+ */
1887
2750
  size: number | string;
1888
2751
  /** Side of the order */
1889
2752
  side: OrderSide;
@@ -1901,6 +2764,10 @@ type PrepareLimitOrderRequest = {
1901
2764
  * When provided, the SDK prepares a Good-Til-Date (GTD) limit order that
1902
2765
  * expires at the given timestamp.
1903
2766
  *
2767
+ * The timestamp must be at least 60 seconds in the future. Add your own
2768
+ * buffer for network latency and clock skew when deriving it from the
2769
+ * current time.
2770
+ *
1904
2771
  * When omitted, the SDK prepares a Good-Til-Cancelled (GTC) limit order.
1905
2772
  */
1906
2773
  expiration?: number;
@@ -1952,6 +2819,9 @@ declare const PostOrdersError: {
1952
2819
  /**
1953
2820
  * Posts a signed order for the authenticated account.
1954
2821
  *
2822
+ * @remarks
2823
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2824
+ *
1955
2825
  * @example
1956
2826
  * ```ts
1957
2827
  * const order = await client.createMarketOrder({
@@ -1970,6 +2840,8 @@ declare function postOrder(client: BaseSecureClient): (order: SignedOrder) => Pr
1970
2840
  * Posts multiple signed orders for the authenticated account.
1971
2841
  *
1972
2842
  * @remarks
2843
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2844
+ *
1973
2845
  * Accepts between 1 and 15 orders, matching the current service limit.
1974
2846
  *
1975
2847
  * @example
@@ -1989,10 +2861,20 @@ type SecureTradingActions = {
1989
2861
  * @throws {@link CreateMarketOrderError}
1990
2862
  * Thrown on failure.
1991
2863
  *
1992
- * @example
2864
+ * @example Basic market buy
2865
+ * ```ts
2866
+ * const order = await client.createMarketOrder({
2867
+ * amount: 10,
2868
+ * side: OrderSide.BUY,
2869
+ * tokenId: '123',
2870
+ * });
2871
+ * ```
2872
+ *
2873
+ * @example Protected market buy
1993
2874
  * ```ts
1994
2875
  * const order = await client.createMarketOrder({
1995
2876
  * amount: 10,
2877
+ * maxPrice: '0.55',
1996
2878
  * side: OrderSide.BUY,
1997
2879
  * tokenId: '123',
1998
2880
  * });
@@ -2005,7 +2887,7 @@ type SecureTradingActions = {
2005
2887
  * @throws {@link PlaceMarketOrderError}
2006
2888
  * Thrown on failure.
2007
2889
  *
2008
- * @example
2890
+ * @example Basic market buy
2009
2891
  * ```ts
2010
2892
  * const response = await client.placeMarketOrder({
2011
2893
  * amount: 10,
@@ -2015,11 +2897,28 @@ type SecureTradingActions = {
2015
2897
  *
2016
2898
  * // response: OrderResponse
2017
2899
  * ```
2900
+ *
2901
+ * @example Protected market sell
2902
+ * ```ts
2903
+ * const response = await client.placeMarketOrder({
2904
+ * minPrice: '0.54',
2905
+ * shares: 10,
2906
+ * side: OrderSide.SELL,
2907
+ * tokenId: '123',
2908
+ * });
2909
+ *
2910
+ * // response: OrderResponse
2911
+ * ```
2018
2912
  */
2019
2913
  placeMarketOrder(request: PrepareMarketOrderRequest): Promise<OrderResponse>;
2020
2914
  /**
2021
2915
  * Creates a signed limit order for the authenticated account.
2022
2916
  *
2917
+ * @remarks
2918
+ * GTD expirations must be at least 60 seconds in the future. Add your own
2919
+ * buffer for network latency and clock skew when deriving an expiration from
2920
+ * the current time.
2921
+ *
2023
2922
  * @throws {@link CreateLimitOrderError}
2024
2923
  * Thrown on failure.
2025
2924
  *
@@ -2038,6 +2937,11 @@ type SecureTradingActions = {
2038
2937
  /**
2039
2938
  * Creates and posts a limit order for the authenticated account.
2040
2939
  *
2940
+ * @remarks
2941
+ * GTD expirations must be at least 60 seconds in the future. Add your own
2942
+ * buffer for network latency and clock skew when deriving an expiration from
2943
+ * the current time.
2944
+ *
2041
2945
  * @throws {@link PlaceLimitOrderError}
2042
2946
  * Thrown on failure.
2043
2947
  *
@@ -2191,15 +3095,9 @@ declare function tradingActions(client: BaseSecureClient): SecureTradingActions;
2191
3095
 
2192
3096
  type SecureWalletActions = {
2193
3097
  /**
2194
- * Checks whether the authenticated account wallet is ready for gasless transactions.
2195
- *
2196
- * @throws {@link IsGaslessReadyError}
2197
- * Thrown on failure.
2198
- *
2199
- * @example
2200
- * ```ts
2201
- * const ready = await client.isGaslessReady();
2202
- * ```
3098
+ * @deprecated You no longer need to call this. `createSecureClient` ensures
3099
+ * the account wallet is set up for its trading flow, so this always resolves
3100
+ * to `true` and is retained only for backward compatibility.
2203
3101
  */
2204
3102
  isGaslessReady(): Promise<boolean>;
2205
3103
  /**
@@ -2210,14 +3108,10 @@ type SecureWalletActions = {
2210
3108
  *
2211
3109
  * @example
2212
3110
  * ```ts
2213
- * const handle = await client.setupTradingApprovals();
2214
- *
2215
- * const outcome = await handle.wait();
2216
- *
2217
- * // outcome.transactionHash: TxHash
3111
+ * await client.setupTradingApprovals();
2218
3112
  * ```
2219
3113
  */
2220
- setupTradingApprovals(): Promise<TransactionHandle>;
3114
+ setupTradingApprovals(): Promise<DeprecatedTransactionHandle>;
2221
3115
  /**
2222
3116
  * Approves ERC-20 token spending for the authenticated account.
2223
3117
  *
@@ -2268,7 +3162,7 @@ type SecureWalletActions = {
2268
3162
  * const handle = await client.transferErc20({
2269
3163
  * amount: 1n,
2270
3164
  * recipientAddress: client.account.signer,
2271
- * tokenAddress: client.environment.collateralToken,
3165
+ * tokenAddress: client.environment.contracts.collateralToken,
2272
3166
  * });
2273
3167
  *
2274
3168
  * const outcome = await handle.wait();
@@ -2278,12 +3172,12 @@ type SecureWalletActions = {
2278
3172
  */
2279
3173
  transferErc20(request: PrepareErc20TransferRequest): Promise<TransactionHandle>;
2280
3174
  /**
2281
- * Splits collateral into market positions.
3175
+ * Splits collateral into market or combo positions.
2282
3176
  *
2283
3177
  * @throws {@link SplitPositionError}
2284
3178
  * Thrown on failure.
2285
3179
  *
2286
- * @example
3180
+ * @example Split a market by condition ID.
2287
3181
  * ```ts
2288
3182
  * const handle = await client.splitPosition({
2289
3183
  * amount: 1n,
@@ -2295,15 +3189,27 @@ type SecureWalletActions = {
2295
3189
  *
2296
3190
  * // outcome.transactionHash: TxHash
2297
3191
  * ```
3192
+ *
3193
+ * @example Split a combo by legs.
3194
+ * ```ts
3195
+ * const handle = await client.splitPosition({
3196
+ * amount: 1n,
3197
+ * legs: ['123', '456'],
3198
+ * });
3199
+ *
3200
+ * const outcome = await handle.wait();
3201
+ *
3202
+ * // outcome.transactionHash: TxHash
3203
+ * ```
2298
3204
  */
2299
3205
  splitPosition(request: PrepareSplitPositionRequest): Promise<TransactionHandle>;
2300
3206
  /**
2301
- * Merges complementary market positions back into collateral.
3207
+ * Merges complementary market or combo positions back into collateral.
2302
3208
  *
2303
3209
  * @throws {@link MergePositionsError}
2304
3210
  * Thrown on failure.
2305
3211
  *
2306
- * @example
3212
+ * @example Merge a market by condition ID.
2307
3213
  * ```ts
2308
3214
  * const handle = await client.mergePositions({
2309
3215
  * amount: 'max',
@@ -2315,21 +3221,41 @@ type SecureWalletActions = {
2315
3221
  *
2316
3222
  * // outcome.transactionHash: TxHash
2317
3223
  * ```
3224
+ *
3225
+ * @example Merge a combo by legs.
3226
+ * ```ts
3227
+ * const handle = await client.mergePositions({
3228
+ * amount: 'max',
3229
+ * legs: ['123', '456'],
3230
+ * });
3231
+ *
3232
+ * const outcome = await handle.wait();
3233
+ *
3234
+ * // outcome.transactionHash: TxHash
3235
+ * ```
2318
3236
  */
2319
3237
  mergePositions(request: PrepareMergePositionsRequest): Promise<TransactionHandle>;
2320
3238
  /**
2321
- * Redeems resolved market positions.
3239
+ * Redeems resolved market or combo positions.
2322
3240
  *
2323
3241
  * @throws {@link RedeemPositionsError}
2324
3242
  * Thrown on failure.
2325
3243
  *
2326
3244
  * @example
2327
3245
  * ```ts
3246
+ * // Redeem a market by condition ID.
2328
3247
  * const handle = await client.redeemPositions({
2329
3248
  * conditionId:
2330
3249
  * '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
2331
3250
  * });
2332
3251
  *
3252
+ * const outcome = await handle.wait();
3253
+ *
3254
+ * // outcome.transactionHash: TxHash
3255
+ * ```
3256
+ *
3257
+ * @example Redeem a market by market ID.
3258
+ * ```ts
2333
3259
  * const handle = await client.redeemPositions({
2334
3260
  * marketId: '12345',
2335
3261
  * });
@@ -2338,13 +3264,24 @@ type SecureWalletActions = {
2338
3264
  *
2339
3265
  * // outcome.transactionHash: TxHash
2340
3266
  * ```
3267
+ *
3268
+ * @example Redeem a combo by position ID.
3269
+ * ```ts
3270
+ * const handle = await client.redeemPositions({
3271
+ * positionId: '123',
3272
+ * });
3273
+ *
3274
+ * const outcome = await handle.wait();
3275
+ *
3276
+ * // outcome.transactionHash: TxHash
3277
+ * ```
2341
3278
  */
2342
3279
  redeemPositions(request: PrepareRedeemPositionsRequest): Promise<TransactionHandle>;
2343
3280
  };
2344
3281
  declare function walletActions(client: BaseSecureClient): SecureWalletActions;
2345
3282
 
2346
- type PublicActions = Prettify<DiscoveryActions & DataActions & AnalyticsActions & PublicAccountActions & PublicRewardsActions & PublicSubscriptionsActions>;
2347
- type SecureActions = Prettify<DiscoveryActions & DataActions & AnalyticsActions & SecureAccountActions & SecureRewardsActions & SecureSubscriptionsActions & SecureWalletActions & SecureTradingActions>;
3283
+ type PublicActions = Prettify<DiscoveryActions & DataActions & AnalyticsActions & PublicPerpsActions & PublicAccountActions & PublicRewardsActions & PublicSubscriptionsActions>;
3284
+ type SecureActions = Prettify<DiscoveryActions & DataActions & AnalyticsActions & SecurePerpsActions & SecureAccountActions & SecureRewardsActions & SecureRfqActions & SecureSubscriptionsActions & SecureWalletActions & SecureTradingActions>;
2348
3285
  declare function allActions(client: BasePublicClient): PublicActions;
2349
3286
  declare function allActions(client: BaseSecureClient): SecureActions;
2350
3287
 
@@ -2357,17 +3294,76 @@ type WalletDerivationConfig = {
2357
3294
  safeFactory: EvmAddress;
2358
3295
  safeInitCodeHash: Hex.Hex;
2359
3296
  };
3297
+ type RestEndpoint = {
3298
+ rest: string;
3299
+ headers?: Record<string, string>;
3300
+ };
3301
+ type WebSocketEndpoint = {
3302
+ ws: string;
3303
+ headers?: Record<string, string>;
3304
+ };
3305
+ type ClobEndpoints = RestEndpoint & {
3306
+ market: WebSocketEndpoint;
3307
+ user: WebSocketEndpoint;
3308
+ };
3309
+ type RfqEndpoints = RestEndpoint & WebSocketEndpoint;
3310
+ type PerpsEndpoints = RestEndpoint & WebSocketEndpoint;
3311
+ type EnvironmentContracts = {
3312
+ collateralToken: EvmAddress;
3313
+ conditionalTokens: EvmAddress;
3314
+ negRiskAdapter: EvmAddress;
3315
+ collateralAdapter: EvmAddress;
3316
+ negRiskCollateralAdapter: EvmAddress;
3317
+ standardExchange: EvmAddress;
3318
+ negRiskExchange: EvmAddress;
3319
+ exchangeV3: EvmAddress;
3320
+ protocolV2Router: EvmAddress;
3321
+ combinatorialModule: EvmAddress;
3322
+ positionManager: EvmAddress;
3323
+ autoRedeemOperator: EvmAddress;
3324
+ safeMultisend: EvmAddress;
3325
+ relayHub: EvmAddress;
3326
+ perpsDepositContract: EvmAddress;
3327
+ };
2360
3328
  type EnvironmentConfig = {
2361
3329
  name: string;
2362
3330
  chainId: number;
2363
3331
  };
3332
+ type EnvironmentConfigForkEndpoint = Partial<RestEndpoint & WebSocketEndpoint>;
3333
+ type EnvironmentConfigFork = {
3334
+ name: string;
3335
+ chainId?: number;
3336
+ rpc?: string;
3337
+ walletDerivation?: Partial<WalletDerivationConfig>;
3338
+ contracts?: Partial<EnvironmentContracts>;
3339
+ clob?: Partial<RestEndpoint> & {
3340
+ market?: Partial<WebSocketEndpoint>;
3341
+ user?: Partial<WebSocketEndpoint>;
3342
+ };
3343
+ relayer?: Partial<RestEndpoint>;
3344
+ gamma?: Partial<RestEndpoint>;
3345
+ data?: Partial<RestEndpoint>;
3346
+ rfq?: EnvironmentConfigForkEndpoint;
3347
+ perps?: EnvironmentConfigForkEndpoint;
3348
+ rtds?: Partial<WebSocketEndpoint>;
3349
+ sports?: Partial<WebSocketEndpoint>;
3350
+ relayerMaxPolls?: number;
3351
+ relayerPollFrequencyMs?: number;
3352
+ };
2364
3353
  /**
2365
3354
  * The production environment configuration.
2366
3355
  */
2367
3356
  declare const production: EnvironmentConfig;
3357
+ /**
3358
+ * Forks an environment config from production unless a different base is passed.
3359
+ *
3360
+ * @experimental This helper is intended for advanced custom environment use,
3361
+ * not general SDK usage. Its signature may change without notice.
3362
+ */
3363
+ declare function forkEnvironmentConfig(fork: EnvironmentConfigFork, base?: EnvironmentConfig): EnvironmentConfig;
2368
3364
 
2369
3365
  type ServiceRequest = {
2370
- method: 'DELETE' | 'GET' | 'POST';
3366
+ method: 'DELETE' | 'GET' | 'PATCH' | 'POST';
2371
3367
  path: string;
2372
3368
  body?: string;
2373
3369
  headers?: HeadersInit;
@@ -2494,15 +3490,9 @@ declare class BaseSecureClient<TPublicActions extends ClientActions = ClientActi
2494
3490
  */
2495
3491
  get account(): AccountIdentity;
2496
3492
  /**
2497
- * Sets up a gasless wallet and returns a secure client bound to it.
2498
- *
2499
- * @remarks
2500
- * If this client is already bound to a gasless wallet, this returns a secure
2501
- * client for the current wallet. For EOA clients, this deploys or reuses the
2502
- * authenticated signer's deterministic Deposit Wallet.
2503
- *
2504
- * @throws {@link SetupGaslessWalletError}
2505
- * Thrown on failure.
3493
+ * @deprecated `createSecureClient` now sets up the account wallet for its
3494
+ * trading flow, so this is a no-op retained only for backward compatibility
3495
+ * and returns the current secure client.
2506
3496
  */
2507
3497
  setupGaslessWallet(): Promise<SecureClient<TPublicActions, TSecureActions>>;
2508
3498
  /**
@@ -2563,7 +3553,7 @@ type SecureContext = PublicContext & {};
2563
3553
  type SecureClientConfig = PublicClientConfig & {
2564
3554
  account: AccountIdentity;
2565
3555
  credentials: ApiKeyCreds;
2566
- signer?: Signer;
3556
+ signer: Signer;
2567
3557
  };
2568
3558
  type PublicClient<TPublicActions extends ClientActions = PublicActions, TSecureActions extends ClientActions = SecureActions> = BasePublicClient<TPublicActions, TSecureActions> & TPublicActions;
2569
3559
  type SecureClient<TPublicActions extends ClientActions = PublicActions, TSecureActions extends ClientActions = SecureActions> = BaseSecureClient<TPublicActions, TSecureActions> & TSecureActions;
@@ -2586,13 +3576,10 @@ type SecureClientOptions = PublicClientOptions & {
2586
3576
  /**
2587
3577
  * Wallet address to use as the account wallet.
2588
3578
  *
2589
- * If omitted, the client uses the signer address as the account wallet and
2590
- * operates as an EOA account. EOA clients do not use gasless relayer flows:
2591
- * approvals, transfers, and other wallet operations are submitted directly by
2592
- * the signer and require the signer wallet to hold gas. Pass a supported Poly
2593
- * Deposit Wallet, Poly Safe, or Poly Proxy wallet address to use that wallet
2594
- * as the account/funder and enable gasless wallet operations when an API key
2595
- * strategy supports them.
3579
+ * If omitted, the client uses the signer's deterministic Deposit Wallet as
3580
+ * the account wallet. Pass the signer address itself to explicitly trade as
3581
+ * an EOA account, or pass a supported Poly Deposit Wallet, Poly Safe, or Poly
3582
+ * Proxy wallet address to use that wallet as the account/funder.
2596
3583
  */
2597
3584
  wallet?: string;
2598
3585
  /**
@@ -2623,13 +3610,13 @@ type SecureClientOptions = PublicClientOptions & {
2623
3610
  * ```
2624
3611
  */
2625
3612
  declare function createPublicClient(options?: PublicClientOptions): PublicClient<PublicActions, SecureActions>;
2626
- type CreateSecureClientError = CancelledSigningError | RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
3613
+ type CreateSecureClientError = CancelledSigningError | DeployDepositWalletError | IsWalletDeployedError | RateLimitError | RequestRejectedError | SigningError | TimeoutError | TransactionFailedError | TransportError | UnexpectedResponseError | UserInputError | WaitForGaslessTransactionError;
2627
3614
  declare const CreateSecureClientError: {
2628
- isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
3615
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
2629
3616
  };
2630
- type SetupGaslessWalletError = DeployDepositWalletError | IsGaslessReadyError | SigningError | WaitForGaslessTransactionError | UserInputError;
3617
+ type SetupGaslessWalletError = UserInputError;
2631
3618
  declare const SetupGaslessWalletError: {
2632
- isError(error: unknown): error is SigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
3619
+ isError(error: unknown): error is UserInputError;
2633
3620
  };
2634
3621
  /**
2635
3622
  * Creates a new authenticated `SecureClient` instance.
@@ -2653,6 +3640,9 @@ declare const FetchClosedOnlyModeError: {
2653
3640
  /**
2654
3641
  * Fetches whether the account is restricted to closed-only trading.
2655
3642
  *
3643
+ * @remarks
3644
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3645
+ *
2656
3646
  * @throws {@link FetchClosedOnlyModeError}
2657
3647
  *
2658
3648
  * @example
@@ -2675,6 +3665,9 @@ declare const ListOpenOrdersError: {
2675
3665
  /**
2676
3666
  * Lists open orders for the authenticated account across all pages.
2677
3667
  *
3668
+ * @remarks
3669
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3670
+ *
2678
3671
  * @throws {@link ListOpenOrdersError}
2679
3672
  *
2680
3673
  * @example
@@ -2716,6 +3709,9 @@ declare const FetchOrderError: {
2716
3709
  /**
2717
3710
  * Fetches a single order for the authenticated account.
2718
3711
  *
3712
+ * @remarks
3713
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3714
+ *
2719
3715
  * @throws {@link FetchOrderError}
2720
3716
  *
2721
3717
  * @example
@@ -2743,6 +3739,9 @@ declare const ListAccountTradesError: {
2743
3739
  /**
2744
3740
  * Lists trades for the authenticated account across all pages.
2745
3741
  *
3742
+ * @remarks
3743
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3744
+ *
2746
3745
  * @throws {@link ListAccountTradesError}
2747
3746
  *
2748
3747
  * @example
@@ -2784,6 +3783,9 @@ type DropNotificationsRequest = z.input<typeof DropNotificationsRequestSchema>;
2784
3783
  /**
2785
3784
  * Fetches notifications for the authenticated account.
2786
3785
  *
3786
+ * @remarks
3787
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3788
+ *
2787
3789
  * @throws {@link FetchNotificationsError}
2788
3790
  *
2789
3791
  * @example
@@ -2799,6 +3801,9 @@ declare const DropNotificationsError: {
2799
3801
  /**
2800
3802
  * Drops notifications for the authenticated account.
2801
3803
  *
3804
+ * @remarks
3805
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3806
+ *
2802
3807
  * @throws {@link DropNotificationsError}
2803
3808
  * Thrown on failure.
2804
3809
  *
@@ -2823,7 +3828,7 @@ declare const FetchBalanceAllowanceError: {
2823
3828
  * Fetches balance and allowance for the authenticated account.
2824
3829
  *
2825
3830
  * @remarks
2826
- * This is a low-level action that most SDK consumers will not need.
3831
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2827
3832
  *
2828
3833
  * @throws {@link FetchBalanceAllowanceError}
2829
3834
  * Thrown on failure.
@@ -2849,7 +3854,7 @@ declare const UpdateBalanceAllowanceError: {
2849
3854
  * Refreshes balance and allowance for the authenticated account.
2850
3855
  *
2851
3856
  * @remarks
2852
- * This is a low-level action that most SDK consumers will not need.
3857
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2853
3858
  *
2854
3859
  * @throws {@link UpdateBalanceAllowanceError}
2855
3860
  * Thrown on failure.
@@ -2873,6 +3878,9 @@ declare const FetchOrderScoringError: {
2873
3878
  /**
2874
3879
  * Fetches whether a single order is currently scoring.
2875
3880
  *
3881
+ * @remarks
3882
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3883
+ *
2876
3884
  * @throws {@link FetchOrderScoringError}
2877
3885
  *
2878
3886
  * @example
@@ -2894,6 +3902,9 @@ declare const FetchOrdersScoringError: {
2894
3902
  /**
2895
3903
  * Fetches scoring state for multiple orders.
2896
3904
  *
3905
+ * @remarks
3906
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3907
+ *
2897
3908
  * @throws {@link FetchOrdersScoringError}
2898
3909
  *
2899
3910
  * @example
@@ -2916,6 +3927,9 @@ declare const ListUserEarningsForDayError: {
2916
3927
  /**
2917
3928
  * Lists per-market earnings for the authenticated account on a given day.
2918
3929
  *
3930
+ * @remarks
3931
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3932
+ *
2919
3933
  * @throws {@link ListUserEarningsForDayError}
2920
3934
  *
2921
3935
  * @example
@@ -2954,6 +3968,9 @@ declare const FetchTotalEarningsForUserForDayError: {
2954
3968
  /**
2955
3969
  * Fetches total earnings for the authenticated account on a given day.
2956
3970
  *
3971
+ * @remarks
3972
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3973
+ *
2957
3974
  * @throws {@link FetchTotalEarningsForUserForDayError}
2958
3975
  *
2959
3976
  * @example
@@ -2980,6 +3997,9 @@ declare const ListUserEarningsAndMarketsConfigError: {
2980
3997
  /**
2981
3998
  * Lists market reward configuration and earnings for the authenticated account on a given day.
2982
3999
  *
4000
+ * @remarks
4001
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4002
+ *
2983
4003
  * @throws {@link ListUserEarningsAndMarketsConfigError}
2984
4004
  *
2985
4005
  * @example
@@ -3017,6 +4037,9 @@ declare const FetchRewardPercentagesError: {
3017
4037
  /**
3018
4038
  * Fetches reward percentages for the authenticated account.
3019
4039
  *
4040
+ * @remarks
4041
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4042
+ *
3020
4043
  * @throws {@link FetchRewardPercentagesError}
3021
4044
  *
3022
4045
  * @example
@@ -3075,6 +4098,9 @@ declare const ListTradesError: {
3075
4098
  /**
3076
4099
  * Lists trades for a wallet, market, or event.
3077
4100
  *
4101
+ * @remarks
4102
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4103
+ *
3078
4104
  * @throws {@link ListTradesError}
3079
4105
  * Thrown on failure.
3080
4106
  *
@@ -3115,6 +4141,9 @@ declare const ListActivityError: {
3115
4141
  /**
3116
4142
  * Lists wallet activity.
3117
4143
  *
4144
+ * @remarks
4145
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4146
+ *
3118
4147
  * @throws {@link ListActivityError}
3119
4148
  * Thrown on failure.
3120
4149
  *
@@ -3166,7 +4195,7 @@ declare const PrepareErc20ApprovalError: {
3166
4195
  * Starts an ERC-20 approval workflow.
3167
4196
  *
3168
4197
  * @remarks
3169
- * This is a low-level action that most SDK consumers will not need.
4198
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3170
4199
  *
3171
4200
  * @example
3172
4201
  * ```ts
@@ -3181,13 +4210,16 @@ declare const PrepareErc20ApprovalError: {
3181
4210
  * Thrown on failure.
3182
4211
  */
3183
4212
  declare function prepareErc20Approval(client: BaseSecureClient, request: PrepareErc20ApprovalRequest): Promise<Erc20ApprovalWorkflow>;
3184
- type ApproveErc20Error = PrepareErc20ApprovalError | CancelledSigningError | SigningError;
4213
+ type ApproveErc20Error = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError | CancelledSigningError | SigningError;
3185
4214
  declare const ApproveErc20Error: {
3186
- isError(error: unknown): error is SigningError | CancelledSigningError | UserInputError;
4215
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
3187
4216
  };
3188
4217
  /**
3189
4218
  * Approves ERC-20 token spending for the authenticated account.
3190
4219
  *
4220
+ * @remarks
4221
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4222
+ *
3191
4223
  * @throws {@link ApproveErc20Error}
3192
4224
  * Thrown on failure.
3193
4225
  */
@@ -3209,7 +4241,7 @@ declare const PrepareErc1155ApprovalForAllError: {
3209
4241
  * Starts an ERC-1155 approval-for-all workflow.
3210
4242
  *
3211
4243
  * @remarks
3212
- * This is a low-level action that most SDK consumers will not need.
4244
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3213
4245
  *
3214
4246
  * @example
3215
4247
  * ```ts
@@ -3223,34 +4255,31 @@ declare const PrepareErc1155ApprovalForAllError: {
3223
4255
  * Thrown on failure.
3224
4256
  */
3225
4257
  declare function prepareErc1155ApprovalForAll(client: BaseSecureClient, request: PrepareErc1155ApprovalForAllRequest): Promise<Erc1155ApprovalForAllWorkflow>;
3226
- type ApproveErc1155ForAllError = PrepareErc1155ApprovalForAllError | CancelledSigningError | SigningError;
4258
+ type ApproveErc1155ForAllError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError | CancelledSigningError | SigningError;
3227
4259
  declare const ApproveErc1155ForAllError: {
3228
- isError(error: unknown): error is SigningError | CancelledSigningError | UserInputError;
4260
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
3229
4261
  };
3230
4262
  /**
3231
4263
  * Approves or revokes ERC-1155 operator access for the authenticated account.
3232
4264
  *
4265
+ * @remarks
4266
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4267
+ *
3233
4268
  * @throws {@link ApproveErc1155ForAllError}
3234
4269
  * Thrown on failure.
3235
4270
  */
3236
4271
  declare function approveErc1155ForAll(client: BaseSecureClient, request: PrepareErc1155ApprovalForAllRequest): Promise<TransactionHandle>;
3237
4272
  type TradingApprovalsWorkflowRequest = GaslessWorkflowRequest | SendErc20ApprovalTransactionRequest | SendErc1155ApprovalForAllTransactionRequest;
3238
- type TradingApprovalsWorkflow = AsyncGenerator<TradingApprovalsWorkflowRequest, TransactionHandle, EvmAddress$1 | EvmSignature | TransactionHandle>;
3239
- type PrepareTradingApprovalsError = UserInputError;
4273
+ type TradingApprovalsWorkflow = AsyncGenerator<TradingApprovalsWorkflowRequest, void, EvmAddress$1 | EvmSignature | TransactionHandle>;
4274
+ type PrepareTradingApprovalsError = RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
3240
4275
  declare const PrepareTradingApprovalsError: {
3241
- isError(error: unknown): error is UserInputError;
4276
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError;
3242
4277
  };
3243
4278
  /**
3244
4279
  * Starts a trading-setup approval workflow.
3245
4280
  *
3246
4281
  * @remarks
3247
- * This is a low-level action that most SDK consumers will not need.
3248
- *
3249
- * Prepares all approvals required for trading, including collateral and
3250
- * position token approvals for both standard and neg-risk market flows.
3251
- * The collateral adapter approvals cover split, merge, and redemption workflows.
3252
- * Auto-redeem approval is included so accounts are ready for supported position
3253
- * lifecycle workflows.
4282
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3254
4283
  *
3255
4284
  * @example
3256
4285
  * ```ts
@@ -3261,17 +4290,27 @@ declare const PrepareTradingApprovalsError: {
3261
4290
  * Thrown on failure.
3262
4291
  */
3263
4292
  declare function prepareTradingApprovals(client: BaseSecureClient): Promise<TradingApprovalsWorkflow>;
3264
- type SetupTradingApprovalsError = PrepareTradingApprovalsError | CancelledSigningError | SigningError;
4293
+ type SetupTradingApprovalsError = PrepareTradingApprovalsError | CancelledSigningError | SigningError | WaitForGaslessTransactionError;
3265
4294
  declare const SetupTradingApprovalsError: {
3266
- isError(error: unknown): error is SigningError | CancelledSigningError | UserInputError;
4295
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
4296
+ };
4297
+ type DeprecatedTransactionHandle = Omit<TransactionHandle, 'wait'> & {
4298
+ /**
4299
+ * @deprecated `setupTradingApprovals` now waits internally. You do not need
4300
+ * to call this method, and it will be removed in a later version.
4301
+ */
4302
+ wait(): Promise<void>;
3267
4303
  };
3268
4304
  /**
3269
4305
  * Sets up the approvals required for trading.
3270
4306
  *
4307
+ * @remarks
4308
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4309
+ *
3271
4310
  * @throws {@link SetupTradingApprovalsError}
3272
4311
  * Thrown on failure.
3273
4312
  */
3274
- declare function setupTradingApprovals(client: BaseSecureClient): Promise<TransactionHandle>;
4313
+ declare function setupTradingApprovals(client: BaseSecureClient): Promise<DeprecatedTransactionHandle>;
3275
4314
 
3276
4315
  declare const ListBuilderTradesRequestSchema: z.ZodObject<{
3277
4316
  after: z.ZodOptional<z.ZodString>;
@@ -3290,6 +4329,9 @@ declare const ListBuilderTradesError: {
3290
4329
  /**
3291
4330
  * Lists builder-attributed trades.
3292
4331
  *
4332
+ * @remarks
4333
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4334
+ *
3293
4335
  * @throws {@link ListBuilderTradesError}
3294
4336
  * Thrown on failure.
3295
4337
  *
@@ -3329,6 +4371,9 @@ declare const FetchMidpointError: {
3329
4371
  /**
3330
4372
  * Fetches the midpoint price for a token.
3331
4373
  *
4374
+ * @remarks
4375
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4376
+ *
3332
4377
  * @throws {@link FetchMidpointError}
3333
4378
  * Thrown on failure.
3334
4379
  *
@@ -3355,6 +4400,9 @@ declare const FetchMidpointsError: {
3355
4400
  /**
3356
4401
  * Fetches midpoint prices for multiple tokens.
3357
4402
  *
4403
+ * @remarks
4404
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4405
+ *
3358
4406
  * @throws {@link FetchMidpointsError}
3359
4407
  * Thrown on failure.
3360
4408
  *
@@ -3384,7 +4432,7 @@ declare const FetchTickSizeError: {
3384
4432
  * Fetches the minimum price tick size for a token's order book.
3385
4433
  *
3386
4434
  * @remarks
3387
- * This is a low-level market action that most SDK consumers will not need.
4435
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3388
4436
  *
3389
4437
  * @throws {@link FetchTickSizeError}
3390
4438
  * Thrown on failure.
@@ -3412,7 +4460,7 @@ declare const FetchNegRiskError: {
3412
4460
  * Fetches whether a token is in a negative-risk market.
3413
4461
  *
3414
4462
  * @remarks
3415
- * This is a low-level market action that most SDK consumers will not need.
4463
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3416
4464
  *
3417
4465
  * @throws {@link FetchNegRiskError}
3418
4466
  * Thrown on failure.
@@ -3440,14 +4488,14 @@ declare const ResolveConditionByTokenError: {
3440
4488
  * Resolves the condition ID for a token.
3441
4489
  *
3442
4490
  * @remarks
3443
- * This is a low-level market action that most SDK consumers will not need.
4491
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3444
4492
  *
3445
4493
  * @throws {@link ResolveConditionByTokenError}
3446
4494
  * Thrown on failure.
3447
4495
  */
3448
- declare function resolveConditionByToken(client: BaseClient, request: ResolveConditionByTokenRequest): Promise<ConditionId>;
4496
+ declare function resolveConditionByToken(client: BaseClient, request: ResolveConditionByTokenRequest): Promise<CtfConditionId>;
3449
4497
  declare const FetchMarketInfoRequestSchema: z.ZodObject<{
3450
- conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>;
4498
+ conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
3451
4499
  }, z.core.$strip>;
3452
4500
  type FetchMarketInfoRequest = z.input<typeof FetchMarketInfoRequestSchema>;
3453
4501
  type FetchMarketInfoError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
@@ -3458,7 +4506,7 @@ declare const FetchMarketInfoError: {
3458
4506
  * Fetches market-level metadata for a condition.
3459
4507
  *
3460
4508
  * @remarks
3461
- * This is a low-level market action that most SDK consumers will not need.
4509
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3462
4510
  *
3463
4511
  * @throws {@link FetchMarketInfoError}
3464
4512
  * Thrown on failure.
@@ -3476,7 +4524,7 @@ declare const FetchBuilderFeeRatesError: {
3476
4524
  * Fetches builder maker and taker fee rates.
3477
4525
  *
3478
4526
  * @remarks
3479
- * This is a low-level market action that most SDK consumers will not need.
4527
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3480
4528
  *
3481
4529
  * @throws {@link FetchBuilderFeeRatesError}
3482
4530
  * Thrown on failure.
@@ -3494,6 +4542,9 @@ declare const FetchPriceError: {
3494
4542
  /**
3495
4543
  * Fetches the current quoted price for a token and side.
3496
4544
  *
4545
+ * @remarks
4546
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4547
+ *
3497
4548
  * @throws {@link FetchPriceError}
3498
4549
  * Thrown on failure.
3499
4550
  *
@@ -3522,6 +4573,9 @@ declare const FetchPricesError: {
3522
4573
  /**
3523
4574
  * Fetches quoted prices for multiple tokens.
3524
4575
  *
4576
+ * @remarks
4577
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4578
+ *
3525
4579
  * @throws {@link FetchPricesError}
3526
4580
  * Thrown on failure.
3527
4581
  *
@@ -3551,6 +4605,9 @@ declare const FetchOrderBookError: {
3551
4605
  /**
3552
4606
  * Fetches the current order book for a token.
3553
4607
  *
4608
+ * @remarks
4609
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4610
+ *
3554
4611
  * @throws {@link FetchOrderBookError}
3555
4612
  * Thrown on failure.
3556
4613
  *
@@ -3576,6 +4633,9 @@ declare const FetchOrderBooksError: {
3576
4633
  /**
3577
4634
  * Fetches order books for multiple tokens.
3578
4635
  *
4636
+ * @remarks
4637
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4638
+ *
3579
4639
  * @throws {@link FetchOrderBooksError}
3580
4640
  * Thrown on failure.
3581
4641
  *
@@ -3603,6 +4663,9 @@ declare const FetchSpreadError: {
3603
4663
  /**
3604
4664
  * Fetches the spread for a token.
3605
4665
  *
4666
+ * @remarks
4667
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4668
+ *
3606
4669
  * @throws {@link FetchSpreadError}
3607
4670
  * Thrown on failure.
3608
4671
  *
@@ -3629,6 +4692,9 @@ declare const FetchSpreadsError: {
3629
4692
  /**
3630
4693
  * Fetches spreads for multiple tokens.
3631
4694
  *
4695
+ * @remarks
4696
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4697
+ *
3632
4698
  * @throws {@link FetchSpreadsError}
3633
4699
  * Thrown on failure.
3634
4700
  *
@@ -3657,6 +4723,9 @@ declare const FetchLastTradePriceError: {
3657
4723
  /**
3658
4724
  * Fetches the last traded price for a token.
3659
4725
  *
4726
+ * @remarks
4727
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4728
+ *
3660
4729
  * @throws {@link FetchLastTradePriceError}
3661
4730
  * Thrown on failure.
3662
4731
  *
@@ -3683,6 +4752,9 @@ declare const FetchLastTradePricesError: {
3683
4752
  /**
3684
4753
  * Fetches last traded prices for multiple tokens.
3685
4754
  *
4755
+ * @remarks
4756
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4757
+ *
3686
4758
  * @throws {@link FetchLastTradePricesError}
3687
4759
  * Thrown on failure.
3688
4760
  *
@@ -3715,6 +4787,9 @@ declare const FetchPriceHistoryError: {
3715
4787
  /**
3716
4788
  * Fetches historical price points for a token.
3717
4789
  *
4790
+ * @remarks
4791
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4792
+ *
3718
4793
  * @throws {@link FetchPriceHistoryError}
3719
4794
  * Thrown on failure.
3720
4795
  *
@@ -3744,6 +4819,9 @@ declare const ListCurrentRewardsError: {
3744
4819
  /**
3745
4820
  * Lists current active market rewards.
3746
4821
  *
4822
+ * @remarks
4823
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4824
+ *
3747
4825
  * @throws {@link ListCurrentRewardsError}
3748
4826
  * Thrown on failure.
3749
4827
  *
@@ -3772,7 +4850,7 @@ declare const ListCurrentRewardsError: {
3772
4850
  */
3773
4851
  declare function listCurrentRewards(client: BaseClient, request?: ListCurrentRewardsRequest): Paginated<CurrentReward[]>;
3774
4852
  declare const ListMarketRewardsRequestSchema: z.ZodObject<{
3775
- conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>;
4853
+ conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
3776
4854
  cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
3777
4855
  sponsored: z.ZodOptional<z.ZodBoolean>;
3778
4856
  }, z.core.$strip>;
@@ -3784,6 +4862,9 @@ declare const ListMarketRewardsError: {
3784
4862
  /**
3785
4863
  * Lists reward configurations for a market.
3786
4864
  *
4865
+ * @remarks
4866
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4867
+ *
3787
4868
  * @throws {@link ListMarketRewardsError}
3788
4869
  * Thrown on failure.
3789
4870
  *
@@ -3849,6 +4930,9 @@ declare const ListCommentsError: {
3849
4930
  /**
3850
4931
  * Lists comments for an event or series.
3851
4932
  *
4933
+ * @remarks
4934
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4935
+ *
3852
4936
  * @throws {@link ListCommentsError}
3853
4937
  * Thrown on failure.
3854
4938
  *
@@ -3891,6 +4975,9 @@ declare const FetchCommentsByIdError: {
3891
4975
  /**
3892
4976
  * Fetches a comment thread by comment id.
3893
4977
  *
4978
+ * @remarks
4979
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4980
+ *
3894
4981
  * @throws {@link FetchCommentsByIdError}
3895
4982
  * Thrown on failure.
3896
4983
  *
@@ -3912,6 +4999,9 @@ declare const ListCommentsByUserAddressError: {
3912
4999
  /**
3913
5000
  * Lists comments written by a wallet address.
3914
5001
  *
5002
+ * @remarks
5003
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5004
+ *
3915
5005
  * @throws {@link ListCommentsByUserAddressError}
3916
5006
  * Thrown on failure.
3917
5007
  *
@@ -3950,7 +5040,7 @@ declare function listCommentsByUserAddress(client: BaseClient, request: ListComm
3950
5040
 
3951
5041
  declare const ListEventsRequestSchema: z.ZodObject<{
3952
5042
  ascending: z.ZodOptional<z.ZodBoolean>;
3953
- closed: z.ZodOptional<z.ZodBoolean>;
5043
+ closed: z.ZodDefault<z.ZodBoolean>;
3954
5044
  cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
3955
5045
  pageSize: z.ZodOptional<z.ZodNumber>;
3956
5046
  cyom: z.ZodOptional<z.ZodBoolean>;
@@ -4033,6 +5123,11 @@ declare const ListEventsError: {
4033
5123
  /**
4034
5124
  * Lists events.
4035
5125
  *
5126
+ * Defaults to open events. Pass `closed: true` to list settled events.
5127
+ *
5128
+ * @remarks
5129
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5130
+ *
4036
5131
  * @throws {@link ListEventsError}
4037
5132
  * Thrown on failure.
4038
5133
  *
@@ -4073,6 +5168,9 @@ declare const FetchEventError: {
4073
5168
  /**
4074
5169
  * Fetches an event.
4075
5170
  *
5171
+ * @remarks
5172
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5173
+ *
4076
5174
  * @throws {@link FetchEventError}
4077
5175
  * Thrown on failure.
4078
5176
  *
@@ -4101,6 +5199,9 @@ declare const FetchEventTagsError: {
4101
5199
  /**
4102
5200
  * Fetches an event's tags.
4103
5201
  *
5202
+ * @remarks
5203
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5204
+ *
4104
5205
  * @throws {@link FetchEventTagsError}
4105
5206
  * Thrown on failure.
4106
5207
  *
@@ -4121,6 +5222,9 @@ declare const FetchEventLiveVolumeError: {
4121
5222
  /**
4122
5223
  * Fetches live volume for an event.
4123
5224
  *
5225
+ * @remarks
5226
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5227
+ *
4124
5228
  * @throws {@link FetchEventLiveVolumeError}
4125
5229
  * Thrown on failure.
4126
5230
  *
@@ -4191,6 +5295,9 @@ declare const ListBuilderLeaderboardError: {
4191
5295
  /**
4192
5296
  * Lists builder leaderboard rankings.
4193
5297
  *
5298
+ * @remarks
5299
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5300
+ *
4194
5301
  * @throws {@link ListBuilderLeaderboardError}
4195
5302
  * Thrown on failure.
4196
5303
  *
@@ -4231,6 +5338,9 @@ declare const ListBuilderVolumeError: {
4231
5338
  /**
4232
5339
  * Lists daily builder volume entries.
4233
5340
  *
5341
+ * @remarks
5342
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5343
+ *
4234
5344
  * @throws {@link ListBuilderVolumeError}
4235
5345
  * Thrown on failure.
4236
5346
  *
@@ -4251,6 +5361,9 @@ declare const ListTraderLeaderboardError: {
4251
5361
  /**
4252
5362
  * Lists trader leaderboard rankings.
4253
5363
  *
5364
+ * @remarks
5365
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5366
+ *
4254
5367
  * @throws {@link ListTraderLeaderboardError}
4255
5368
  * Thrown on failure.
4256
5369
  *
@@ -4293,7 +5406,7 @@ declare const ListMarketsRequestSchema: z.ZodObject<{
4293
5406
  clobTokenIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
4294
5407
  cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
4295
5408
  pageSize: z.ZodOptional<z.ZodNumber>;
4296
- conditionIds: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.ConditionId, string>>>>;
5409
+ conditionIds: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.CtfConditionId, string>>>>;
4297
5410
  cyom: z.ZodOptional<z.ZodBoolean>;
4298
5411
  decimalized: z.ZodOptional<z.ZodBoolean>;
4299
5412
  endDateMax: z.ZodOptional<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.IsoDateTimeString, string>>, z.ZodPipe<z.ZodDate, z.ZodTransform<_polymarket_bindings.IsoDateTimeString, Date>>]>>;
@@ -4306,6 +5419,7 @@ declare const ListMarketsRequestSchema: z.ZodObject<{
4306
5419
  locale: z.ZodOptional<z.ZodString>;
4307
5420
  marketMakerAddresses: z.ZodOptional<z.ZodArray<z.ZodString>>;
4308
5421
  order: z.ZodOptional<z.ZodString>;
5422
+ positionIds: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PositionId, string>>>>;
4309
5423
  questionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
4310
5424
  relatedTags: z.ZodOptional<z.ZodBoolean>;
4311
5425
  rfqEnabled: z.ZodOptional<z.ZodBoolean>;
@@ -4381,6 +5495,12 @@ declare const ListMarketsError: {
4381
5495
  /**
4382
5496
  * Lists markets.
4383
5497
  *
5498
+ * @remarks
5499
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5500
+ *
5501
+ * Legacy multi-outcome markets cannot be represented by the binary
5502
+ * {@link Market} model and are omitted from results.
5503
+ *
4384
5504
  * @throws {@link ListMarketsError}
4385
5505
  * Thrown on failure.
4386
5506
  *
@@ -4414,6 +5534,50 @@ declare const ListMarketsError: {
4414
5534
  * ```
4415
5535
  */
4416
5536
  declare function listMarkets(client: BaseClient, request?: ListMarketsRequest): Paginated<Market[]>;
5537
+ declare const ListComboMarketsRequestSchema: z.ZodObject<{
5538
+ cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
5539
+ pageSize: z.ZodOptional<z.ZodNumber>;
5540
+ exclude: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.CtfConditionId, string>>>>;
5541
+ }, z.core.$strip>;
5542
+ type ListComboMarketsRequest = z.input<typeof ListComboMarketsRequestSchema>;
5543
+ type ListComboMarketsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
5544
+ declare const ListComboMarketsError: {
5545
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
5546
+ };
5547
+ /**
5548
+ * Lists markets available for Combos.
5549
+ *
5550
+ * @remarks
5551
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5552
+ *
5553
+ * @throws {@link ListComboMarketsError}
5554
+ * Thrown on failure.
5555
+ *
5556
+ * @example
5557
+ * Fetch the first page of results:
5558
+ * ```ts
5559
+ * const result = listComboMarkets(client, {
5560
+ * pageSize: 10,
5561
+ * });
5562
+ *
5563
+ * const firstPage = await result.firstPage();
5564
+ *
5565
+ * // Optionally, fetch additional pages:
5566
+ * for await (const page of result.from(firstPage.nextCursor)) {
5567
+ * // page.items: ComboMarket[]
5568
+ * }
5569
+ * ```
5570
+ *
5571
+ * @example
5572
+ * Omit markets the caller has already displayed:
5573
+ * ```ts
5574
+ * const result = listComboMarkets(client, {
5575
+ * exclude: ['0x4cd77d456c83e7d8c569a8fb8f6396c3f40154f657e6d970733e2b1b6a7110ff'],
5576
+ * pageSize: 10,
5577
+ * });
5578
+ * ```
5579
+ */
5580
+ declare function listComboMarkets(client: BaseClient, request?: ListComboMarketsRequest): Paginated<ComboMarket[]>;
4417
5581
  type FetchMarketError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
4418
5582
  declare const FetchMarketError: {
4419
5583
  isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
@@ -4421,6 +5585,13 @@ declare const FetchMarketError: {
4421
5585
  /**
4422
5586
  * Fetches a market.
4423
5587
  *
5588
+ * @remarks
5589
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5590
+ *
5591
+ * Legacy multi-outcome markets cannot be represented by the binary
5592
+ * {@link Market} model, so fetching one fails with an
5593
+ * {@link UnexpectedResponseError}.
5594
+ *
4424
5595
  * @throws {@link FetchMarketError}
4425
5596
  * Thrown on failure.
4426
5597
  *
@@ -4435,7 +5606,7 @@ declare const FetchMarketError: {
4435
5606
  * });
4436
5607
  *
4437
5608
  * const marketByUrl = await fetchMarket(client, {
4438
- * url: 'https://polymarket.com/market/some-market-slug',
5609
+ * url: 'https://polymarket.com/event/some-market-slug',
4439
5610
  * });
4440
5611
  *
4441
5612
  * // market === Market
@@ -4449,6 +5620,9 @@ declare const FetchMarketTagsError: {
4449
5620
  /**
4450
5621
  * Fetches a market's tags.
4451
5622
  *
5623
+ * @remarks
5624
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5625
+ *
4452
5626
  * @throws {@link FetchMarketTagsError}
4453
5627
  * Thrown on failure.
4454
5628
  *
@@ -4469,6 +5643,9 @@ declare const ListMarketHoldersError: {
4469
5643
  /**
4470
5644
  * Lists the top holders for one or more markets.
4471
5645
  *
5646
+ * @remarks
5647
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5648
+ *
4472
5649
  * @throws {@link ListMarketHoldersError}
4473
5650
  * Thrown on failure.
4474
5651
  *
@@ -4490,6 +5667,9 @@ declare const ListOpenInterestError: {
4490
5667
  /**
4491
5668
  * Lists open interest for one or more markets.
4492
5669
  *
5670
+ * @remarks
5671
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5672
+ *
4493
5673
  * @throws {@link ListOpenInterestError}
4494
5674
  * Thrown on failure.
4495
5675
  *
@@ -4510,6 +5690,9 @@ declare const ListMarketPositionsError: {
4510
5690
  /**
4511
5691
  * Lists positions for a market.
4512
5692
  *
5693
+ * @remarks
5694
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5695
+ *
4513
5696
  * @throws {@link ListMarketPositionsError}
4514
5697
  * Thrown on failure.
4515
5698
  *
@@ -4544,316 +5727,996 @@ declare const ListMarketPositionsError: {
4544
5727
  */
4545
5728
  declare function listMarketPositions(client: BaseClient, request: ListMarketPositionsRequest): Paginated<MetaMarketPosition[]>;
4546
5729
 
4547
- declare const ListPositionsRequestSchema: z.ZodObject<{
4548
- cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
4549
- user: z.ZodString;
4550
- market: z.ZodOptional<z.ZodArray<z.ZodString>>;
4551
- eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
4552
- sizeThreshold: z.ZodOptional<z.ZodNumber>;
4553
- redeemable: z.ZodOptional<z.ZodBoolean>;
4554
- mergeable: z.ZodOptional<z.ZodBoolean>;
4555
- pageSize: z.ZodDefault<z.ZodNumber>;
4556
- sortBy: z.ZodOptional<z.ZodEnum<{
4557
- CURRENT: "CURRENT";
4558
- INITIAL: "INITIAL";
4559
- TOKENS: "TOKENS";
4560
- CASHPNL: "CASHPNL";
4561
- PERCENTPNL: "PERCENTPNL";
4562
- TITLE: "TITLE";
4563
- RESOLVING: "RESOLVING";
4564
- PRICE: "PRICE";
4565
- AVGPRICE: "AVGPRICE";
4566
- }>>;
4567
- sortDirection: z.ZodOptional<z.ZodEnum<{
4568
- ASC: "ASC";
4569
- DESC: "DESC";
4570
- }>>;
4571
- title: z.ZodOptional<z.ZodString>;
4572
- }, z.core.$strip>;
4573
- declare const ListClosedPositionsRequestSchema: z.ZodObject<{
4574
- cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
4575
- user: z.ZodString;
4576
- market: z.ZodOptional<z.ZodArray<z.ZodString>>;
4577
- title: z.ZodOptional<z.ZodString>;
4578
- eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
4579
- pageSize: z.ZodDefault<z.ZodNumber>;
4580
- sortBy: z.ZodOptional<z.ZodEnum<{
4581
- TITLE: "TITLE";
4582
- PRICE: "PRICE";
4583
- AVGPRICE: "AVGPRICE";
4584
- REALIZEDPNL: "REALIZEDPNL";
4585
- TIMESTAMP: "TIMESTAMP";
4586
- }>>;
4587
- sortDirection: z.ZodOptional<z.ZodEnum<{
4588
- ASC: "ASC";
4589
- DESC: "DESC";
4590
- }>>;
4591
- }, z.core.$strip>;
4592
- declare const FetchPortfolioValueRequestSchema: z.ZodObject<{
4593
- user: z.ZodString;
4594
- market: z.ZodOptional<z.ZodArray<z.ZodString>>;
4595
- }, z.core.$strip>;
4596
- declare const FetchTradedMarketCountRequestSchema: z.ZodObject<{
4597
- user: z.ZodString;
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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>;
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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>;
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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>;
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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
5837
+ }, z.core.$strip>, z.ZodTransform<{
5838
+ cursor: PaginationCursor;
5839
+ params: undefined;
5840
+ }, {
5841
+ 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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>;
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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
5866
+ }, z.core.$strip>, z.ZodTransform<{
5867
+ cursor: PaginationCursor;
5868
+ params: undefined;
5869
+ }, {
5870
+ 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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>;
5878
+ }, z.core.$strip>, z.ZodTransform<{
5879
+ cursor: PaginationCursor | undefined;
5880
+ params: PerpsIntervalHistoryParams;
5881
+ }, {
5882
+ interval: _polymarket_bindings_perps.PerpsPnlInterval;
5883
+ start: number;
5884
+ end?: number | undefined;
5885
+ cursor?: PaginationCursor | undefined;
5886
+ }>>, z.ZodPipe<z.ZodObject<{
5887
+ cursor: z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
5888
+ }, z.core.$strip>, z.ZodTransform<{
5889
+ cursor: PaginationCursor;
5890
+ params: undefined;
5891
+ }, {
5892
+ 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.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>;
5900
+ }, z.core.$strip>, z.ZodTransform<{
5901
+ cursor: PaginationCursor | undefined;
5902
+ params: PerpsIntervalHistoryParams;
5903
+ }, {
5904
+ interval: _polymarket_bindings_perps.PerpsPnlInterval;
5905
+ start: number;
5906
+ end?: number | undefined;
5907
+ cursor?: PaginationCursor | undefined;
5908
+ }>>, z.ZodPipe<z.ZodObject<{
5909
+ cursor: z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
5910
+ }, z.core.$strip>, z.ZodTransform<{
5911
+ cursor: PaginationCursor;
5912
+ params: undefined;
5913
+ }, {
5914
+ cursor: PaginationCursor;
5915
+ }>>]>;
5916
+ type ListPerpsPnlHistoryRequest = z.input<typeof ListPerpsPnlHistoryRequestSchema>;
5917
+
5918
+ /**
5919
+ * Good-til-cancelled Perps order.
5920
+ */
5921
+ type PerpsPlaceGtcOrderRequest = {
5922
+ /** Perps instrument identifier to trade. */
5923
+ instrumentId: number;
5924
+ /** Trade direction. */
5925
+ side: OrderSide;
5926
+ /** Limit price. */
5927
+ price: PerpsDecimalInput;
5928
+ /** Order quantity. */
5929
+ quantity: PerpsDecimalInput;
5930
+ /** Good-til-cancelled execution. */
5931
+ timeInForce: PerpsTimeInForce.GTC;
5932
+ /** Whether the order must rest instead of taking liquidity. */
5933
+ postOnly?: boolean;
5934
+ /** Optional caller-supplied idempotency identifier. */
5935
+ clientOrderId?: string;
5936
+ };
5937
+ /**
5938
+ * Immediate-or-cancel Perps order.
5939
+ */
5940
+ type PerpsPlaceIocOrderRequest = {
5941
+ /** Perps instrument identifier to trade. */
5942
+ instrumentId: number;
5943
+ /** Trade direction. */
5944
+ side: OrderSide;
5945
+ /** Optional limit price. Omit for market-style execution. */
5946
+ price?: PerpsDecimalInput;
5947
+ /** Order quantity. */
5948
+ quantity: PerpsDecimalInput;
5949
+ /** Immediate-or-cancel execution. */
5950
+ timeInForce: PerpsTimeInForce.IOC;
5951
+ postOnly?: undefined;
5952
+ /** Optional caller-supplied idempotency identifier. */
5953
+ clientOrderId?: string;
5954
+ };
5955
+ /**
5956
+ * Fill-or-kill Perps order.
5957
+ */
5958
+ type PerpsPlaceFokOrderRequest = {
5959
+ /** Perps instrument identifier to trade. */
5960
+ instrumentId: number;
5961
+ /** Trade direction. */
5962
+ side: OrderSide;
5963
+ /** Optional limit price. Omit for market-style execution. */
5964
+ price?: PerpsDecimalInput;
5965
+ /** Order quantity. */
5966
+ quantity: PerpsDecimalInput;
5967
+ /** Fill-or-kill execution. */
5968
+ timeInForce: PerpsTimeInForce.FOK;
5969
+ postOnly?: undefined;
5970
+ /** Optional caller-supplied idempotency identifier. */
5971
+ clientOrderId?: string;
5972
+ };
5973
+ /**
5974
+ * Request parameters for placing one Perps order.
5975
+ */
5976
+ type PlacePerpsOrderRequest = PerpsPlaceGtcOrderRequest | PerpsPlaceIocOrderRequest | PerpsPlaceFokOrderRequest;
5977
+ /** Request parameters for posting one or more Perps orders. */
5978
+ type PostPerpsOrdersRequest = {
5979
+ /** Orders to post as one command. */
5980
+ orders: PlacePerpsOrderRequest[];
5981
+ /** Optional command expiration timestamp in milliseconds. */
5982
+ expiresAt?: number;
5983
+ };
5984
+ declare const CancelPerpsOrderRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
5985
+ orderId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsOrderId, number>>;
5986
+ clientOrderId: z.ZodOptional<z.ZodUndefined>;
5987
+ expiresAt: z.ZodOptional<z.ZodNumber>;
5988
+ }, z.core.$strip>, z.ZodObject<{
5989
+ clientOrderId: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings_perps.PerpsClientOrderId, string>>;
5990
+ orderId: z.ZodOptional<z.ZodUndefined>;
5991
+ expiresAt: z.ZodOptional<z.ZodNumber>;
5992
+ }, z.core.$strip>]>;
5993
+ type CancelPerpsOrderRequest = z.input<typeof CancelPerpsOrderRequestSchema>;
5994
+ declare const CancelPerpsOrdersRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
5995
+ orderIds: z.ZodArray<z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsOrderId, number>>>;
5996
+ clientOrderIds: z.ZodOptional<z.ZodUndefined>;
5997
+ expiresAt: z.ZodOptional<z.ZodNumber>;
5998
+ }, z.core.$strip>, z.ZodObject<{
5999
+ clientOrderIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings_perps.PerpsClientOrderId, string>>>;
6000
+ orderIds: z.ZodOptional<z.ZodUndefined>;
6001
+ expiresAt: z.ZodOptional<z.ZodNumber>;
6002
+ }, z.core.$strip>]>;
6003
+ type CancelPerpsOrdersRequest = z.input<typeof CancelPerpsOrdersRequestSchema>;
6004
+ declare const UpdatePerpsLeverageRequestSchema: z.ZodObject<{
6005
+ instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
6006
+ leverage: z.ZodNumber;
6007
+ crossMargin: z.ZodBoolean;
4598
6008
  }, z.core.$strip>;
4599
- declare const DownloadAccountingSnapshotRequestSchema: z.ZodObject<{
4600
- user: z.ZodString;
6009
+ type UpdatePerpsLeverageRequest = z.input<typeof UpdatePerpsLeverageRequestSchema>;
6010
+ type UpdatePerpsLeverageError = RequestRejectedError | SigningError | TransportError | UserInputError;
6011
+ declare const UpdatePerpsLeverageError: {
6012
+ isError(error: unknown): error is SigningError | TransportError | UserInputError | RequestRejectedError;
6013
+ };
6014
+ declare const UpdatePerpsMarginRequestSchema: z.ZodObject<{
6015
+ instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<PerpsInstrumentId, number>>;
6016
+ amount: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings.DecimalString, number>>]>;
4601
6017
  }, z.core.$strip>;
4602
- type ListPositionsRequest = z.input<typeof ListPositionsRequestSchema>;
4603
- type ListClosedPositionsRequest = z.input<typeof ListClosedPositionsRequestSchema>;
4604
- type FetchPortfolioValueRequest = z.input<typeof FetchPortfolioValueRequestSchema>;
4605
- type FetchTradedMarketCountRequest = z.input<typeof FetchTradedMarketCountRequestSchema>;
4606
- type DownloadAccountingSnapshotRequest = z.input<typeof DownloadAccountingSnapshotRequestSchema>;
4607
- type ListPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
4608
- declare const ListPositionsError: {
6018
+ type UpdatePerpsMarginRequest = z.input<typeof UpdatePerpsMarginRequestSchema>;
6019
+ type UpdatePerpsMarginError = RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6020
+ declare const UpdatePerpsMarginError: {
6021
+ isError(error: unknown): error is SigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError;
6022
+ };
6023
+
6024
+ type PerpsSessionOptions = {
6025
+ chainId: number;
6026
+ credentials: PerpsCredentials;
6027
+ headers?: Record<string, string>;
6028
+ onClose: (session: PerpsSession) => void;
6029
+ restUrl: string;
6030
+ wsUrl: string;
6031
+ };
6032
+ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
6033
+ #private;
6034
+ readonly credentials: PerpsCredentials;
6035
+ constructor(options: PerpsSessionOptions);
6036
+ get closed(): boolean;
6037
+ connect(): Promise<void>;
6038
+ close(): Promise<void>;
6039
+ [Symbol.asyncIterator](): AsyncIterator<PerpsSessionEvent>;
6040
+ fetchBalances(): Promise<PerpsBalance[]>;
6041
+ fetchPortfolio(): Promise<PerpsPortfolio>;
6042
+ fetchAccountConfig(request?: FetchPerpsAccountConfigRequest): Promise<PerpsAccountConfig[]>;
6043
+ fetchOpenOrders(request?: FetchPerpsOpenOrdersRequest): Promise<PerpsOrder[]>;
6044
+ fetchOrders(request?: FetchPerpsOrdersRequest): Promise<PerpsOrder[]>;
6045
+ listFills(request?: ListPerpsFillsRequest): Paginated<PerpsAccountFill[]>;
6046
+ listFundingPayments(request?: ListPerpsFundingPaymentsRequest): Paginated<PerpsAccountFundingPayment[]>;
6047
+ listDeposits(request?: ListPerpsDepositsRequest): Paginated<PerpsDeposit[]>;
6048
+ listWithdrawals(request?: ListPerpsWithdrawalsRequest): Paginated<PerpsWithdrawal[]>;
6049
+ listEquityHistory(request: ListPerpsEquityHistoryRequest): Paginated<PerpsEquityPoint[]>;
6050
+ listPnlHistory(request: ListPerpsPnlHistoryRequest): Paginated<PerpsPnlPoint[]>;
6051
+ /**
6052
+ * Places one Perps order and resolves with the first matching orders update.
6053
+ *
6054
+ * @throws Thrown on failure.
6055
+ */
6056
+ placeOrder(request: PlacePerpsOrderRequest): Promise<PerpsOrder>;
6057
+ /**
6058
+ * Posts one or more Perps orders and returns queue-entry acknowledgements.
6059
+ *
6060
+ * @remarks
6061
+ * This is a low-level method. Most SDK consumers should prefer `placeOrder`.
6062
+ */
6063
+ postOrders(request: PostPerpsOrdersRequest): Promise<PerpsPostOrderAck[]>;
6064
+ /**
6065
+ * Cancels one Perps order and returns the cancel result.
6066
+ *
6067
+ * @remarks
6068
+ * The returned status reflects whether the cancel happened.
6069
+ */
6070
+ cancelOrder(request: CancelPerpsOrderRequest): Promise<PerpsCancelOrderResult>;
6071
+ /**
6072
+ * Cancels one or more Perps orders and returns one result per requested order.
6073
+ *
6074
+ * @remarks
6075
+ * Each returned status reflects whether that cancel happened.
6076
+ */
6077
+ cancelOrders(request: CancelPerpsOrdersRequest): Promise<PerpsCancelOrderResult[]>;
6078
+ updateLeverage(request: UpdatePerpsLeverageRequest): Promise<void>;
6079
+ updateMargin(request: UpdatePerpsMarginRequest): Promise<void>;
6080
+ }
6081
+
6082
+ type PerpsPublicReadError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
6083
+ declare const PerpsPublicReadError: {
6084
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6085
+ };
6086
+ type PerpsCandlesParams = {
6087
+ instrumentId: z.output<typeof PerpsInstrumentIdSchema>;
6088
+ interval: PerpsKlineInterval;
6089
+ startTimestamp: number;
6090
+ endTimestamp: number;
6091
+ };
6092
+ type PerpsTimeRangeParams = {
6093
+ instrumentId: z.output<typeof PerpsInstrumentIdSchema>;
6094
+ startTimestamp: number;
6095
+ endTimestamp: number;
6096
+ };
6097
+ declare const FetchPerpsInstrumentsRequestSchema: z.ZodDefault<z.ZodObject<{
6098
+ instrumentId: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>>;
6099
+ instrumentType: z.ZodOptional<z.ZodEnum<typeof _polymarket_bindings_perps.PerpsInstrumentType>>;
6100
+ category: z.ZodOptional<z.ZodEnum<typeof _polymarket_bindings_perps.PerpsInstrumentCategory>>;
6101
+ }, z.core.$strip>>;
6102
+ type FetchPerpsInstrumentsRequest = z.input<typeof FetchPerpsInstrumentsRequestSchema>;
6103
+ type FetchPerpsInstrumentsError = PerpsPublicReadError;
6104
+ declare const FetchPerpsInstrumentsError: {
4609
6105
  isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
4610
6106
  };
4611
6107
  /**
4612
- * Lists current positions for a wallet.
4613
- *
4614
- * @throws {@link ListPositionsError}
4615
- * Thrown on failure.
4616
- *
4617
- * @example
4618
- * Fetch the first page of results:
4619
- * ```ts
4620
- * const result = listPositions(client, {
4621
- * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
4622
- * pageSize: 10,
4623
- * });
6108
+ * Fetches Perps instruments.
4624
6109
  *
4625
- * const firstPage = await result.firstPage();
6110
+ * @remarks
6111
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4626
6112
  *
4627
- * // Optionally, fetch additional pages:
4628
- * for await (const page of result.from(firstPage.nextCursor)) {
4629
- * // page.items: Position[]
4630
- * }
4631
- * ```
6113
+ * @throws {@link FetchPerpsInstrumentsError}
6114
+ * Thrown on failure.
6115
+ */
6116
+ declare function fetchPerpsInstruments(client: BaseClient, request?: FetchPerpsInstrumentsRequest): Promise<PerpsInstrument[]>;
6117
+ declare const FetchPerpsTickerRequestSchema: z.ZodObject<{
6118
+ instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6119
+ }, z.core.$strip>;
6120
+ type FetchPerpsTickerRequest = z.input<typeof FetchPerpsTickerRequestSchema>;
6121
+ type FetchPerpsTickerError = PerpsPublicReadError;
6122
+ declare const FetchPerpsTickerError: {
6123
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6124
+ };
6125
+ /**
6126
+ * Fetches the current Perps ticker for an instrument.
4632
6127
  *
4633
- * @example
4634
- * Loop through all pages with `for await`:
4635
- * ```ts
4636
- * const result = listPositions(client, {
4637
- * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
4638
- * pageSize: 10,
4639
- * });
6128
+ * @remarks
6129
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4640
6130
  *
4641
- * for await (const page of result) {
4642
- * // page.items: Position[]
4643
- * }
4644
- * ```
6131
+ * @throws {@link FetchPerpsTickerError}
6132
+ * Thrown on failure.
4645
6133
  */
4646
- declare function listPositions(client: BaseClient, request: ListPositionsRequest): Paginated<Position[]>;
4647
- type ListClosedPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
4648
- declare const ListClosedPositionsError: {
6134
+ declare function fetchPerpsTicker(client: BaseClient, request: FetchPerpsTickerRequest): Promise<PerpsTicker>;
6135
+ declare const FetchPerpsTickersRequestSchema: z.ZodDefault<z.ZodObject<{
6136
+ instrumentId: z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>>;
6137
+ }, z.core.$strip>>;
6138
+ type FetchPerpsTickersRequest = z.input<typeof FetchPerpsTickersRequestSchema>;
6139
+ type FetchPerpsTickersError = PerpsPublicReadError;
6140
+ declare const FetchPerpsTickersError: {
4649
6141
  isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
4650
6142
  };
4651
6143
  /**
4652
- * Lists closed positions for a wallet.
6144
+ * Fetches current Perps tickers.
4653
6145
  *
4654
- * @throws {@link ListClosedPositionsError}
6146
+ * @remarks
6147
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6148
+ *
6149
+ * @throws {@link FetchPerpsTickersError}
4655
6150
  * Thrown on failure.
6151
+ */
6152
+ declare function fetchPerpsTickers(client: BaseClient, request?: FetchPerpsTickersRequest): Promise<PerpsTicker[]>;
6153
+ type PerpsBookDepth = 10 | 100 | 500 | 1000;
6154
+ declare const FetchPerpsBookRequestSchema: z.ZodObject<{
6155
+ instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6156
+ depth: z.ZodDefault<z.ZodType<PerpsBookDepth, unknown, z.core.$ZodTypeInternals<PerpsBookDepth, unknown>>>;
6157
+ }, z.core.$strip>;
6158
+ type FetchPerpsBookRequest = z.input<typeof FetchPerpsBookRequestSchema>;
6159
+ type FetchPerpsBookError = PerpsPublicReadError;
6160
+ declare const FetchPerpsBookError: {
6161
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6162
+ };
6163
+ /**
6164
+ * Fetches a Perps order book.
4656
6165
  *
4657
- * @example
4658
- * Fetch the first page of results:
4659
- * ```ts
4660
- * const result = listClosedPositions(client, {
4661
- * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
4662
- * pageSize: 10,
4663
- * });
6166
+ * @remarks
6167
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4664
6168
  *
4665
- * const firstPage = await result.firstPage();
6169
+ * @throws {@link FetchPerpsBookError}
6170
+ * Thrown on failure.
6171
+ */
6172
+ declare function fetchPerpsBook(client: BaseClient, request: FetchPerpsBookRequest): Promise<PerpsBook>;
6173
+ declare const ListPerpsCandlesRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
6174
+ instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6175
+ interval: z.ZodEnum<typeof PerpsKlineInterval>;
6176
+ start: z.ZodOptional<z.ZodNumber>;
6177
+ end: z.ZodOptional<z.ZodNumber>;
6178
+ cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>;
6179
+ }, z.core.$strip>, z.ZodTransform<{
6180
+ cursor: PaginationCursor | undefined;
6181
+ params: PerpsCandlesParams;
6182
+ }, {
6183
+ instrumentId: _polymarket_bindings_perps.PerpsInstrumentId;
6184
+ interval: PerpsKlineInterval;
6185
+ start?: number | undefined;
6186
+ end?: number | undefined;
6187
+ cursor?: PaginationCursor | undefined;
6188
+ }>>, z.ZodPipe<z.ZodObject<{
6189
+ cursor: z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
6190
+ }, z.core.$strip>, z.ZodTransform<{
6191
+ cursor: PaginationCursor;
6192
+ params: undefined;
6193
+ }, {
6194
+ cursor: PaginationCursor;
6195
+ }>>]>;
6196
+ type ListPerpsCandlesRequest = z.input<typeof ListPerpsCandlesRequestSchema>;
6197
+ type ListPerpsCandlesError = PerpsPublicReadError;
6198
+ declare const ListPerpsCandlesError: {
6199
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6200
+ };
6201
+ /**
6202
+ * Lists Perps candles for an instrument with SDK-owned pagination.
4666
6203
  *
4667
- * // Optionally, fetch additional pages:
4668
- * for await (const page of result.from(firstPage.nextCursor)) {
4669
- * // page.items: ClosedPosition[]
4670
- * }
4671
- * ```
6204
+ * @remarks
6205
+ * Defaults to the past 24 hours when `start` is omitted.
4672
6206
  *
4673
- * @example
4674
- * Loop through all pages with `for await`:
4675
- * ```ts
4676
- * const result = listClosedPositions(client, {
4677
- * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
4678
- * pageSize: 10,
4679
- * });
6207
+ * @throws {@link ListPerpsCandlesError}
6208
+ * Thrown on failure.
6209
+ */
6210
+ declare function listPerpsCandles(client: BaseClient, request: ListPerpsCandlesRequest): Paginated<PerpsCandle[]>;
6211
+ declare const ListPerpsFundingHistoryRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
6212
+ instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6213
+ start: z.ZodOptional<z.ZodNumber>;
6214
+ end: z.ZodOptional<z.ZodNumber>;
6215
+ cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>;
6216
+ }, z.core.$strip>, z.ZodTransform<{
6217
+ cursor: PaginationCursor | undefined;
6218
+ params: PerpsTimeRangeParams;
6219
+ }, {
6220
+ instrumentId: _polymarket_bindings_perps.PerpsInstrumentId;
6221
+ start?: number | undefined;
6222
+ end?: number | undefined;
6223
+ cursor?: PaginationCursor | undefined;
6224
+ }>>, z.ZodPipe<z.ZodObject<{
6225
+ cursor: z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
6226
+ }, z.core.$strip>, z.ZodTransform<{
6227
+ cursor: PaginationCursor;
6228
+ params: undefined;
6229
+ }, {
6230
+ cursor: PaginationCursor;
6231
+ }>>]>;
6232
+ type ListPerpsFundingHistoryRequest = z.input<typeof ListPerpsFundingHistoryRequestSchema>;
6233
+ type ListPerpsFundingHistoryError = PerpsPublicReadError;
6234
+ declare const ListPerpsFundingHistoryError: {
6235
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6236
+ };
6237
+ /**
6238
+ * Lists Perps funding-rate history for an instrument with SDK-owned pagination.
4680
6239
  *
4681
- * for await (const page of result) {
4682
- * // page.items: ClosedPosition[]
4683
- * }
4684
- * ```
6240
+ * @remarks
6241
+ * Defaults to the past 24 hours when `start` is omitted.
6242
+ *
6243
+ * @throws {@link ListPerpsFundingHistoryError}
6244
+ * Thrown on failure.
4685
6245
  */
4686
- declare function listClosedPositions(client: BaseClient, request: ListClosedPositionsRequest): Paginated<ClosedPosition[]>;
4687
- type FetchPortfolioValueError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
4688
- declare const FetchPortfolioValueError: {
6246
+ declare function listPerpsFundingHistory(client: BaseClient, request: ListPerpsFundingHistoryRequest): Paginated<PerpsFundingRate[]>;
6247
+ declare const ListPerpsTradesRequestSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
6248
+ instrumentId: z.ZodPipe<z.ZodNumber, z.ZodTransform<_polymarket_bindings_perps.PerpsInstrumentId, number>>;
6249
+ start: z.ZodOptional<z.ZodNumber>;
6250
+ end: z.ZodOptional<z.ZodNumber>;
6251
+ cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>;
6252
+ }, z.core.$strip>, z.ZodTransform<{
6253
+ cursor: PaginationCursor | undefined;
6254
+ params: PerpsTimeRangeParams;
6255
+ }, {
6256
+ instrumentId: _polymarket_bindings_perps.PerpsInstrumentId;
6257
+ start?: number | undefined;
6258
+ end?: number | undefined;
6259
+ cursor?: PaginationCursor | undefined;
6260
+ }>>, z.ZodPipe<z.ZodObject<{
6261
+ cursor: z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
6262
+ }, z.core.$strip>, z.ZodTransform<{
6263
+ cursor: PaginationCursor;
6264
+ params: undefined;
6265
+ }, {
6266
+ cursor: PaginationCursor;
6267
+ }>>]>;
6268
+ type ListPerpsTradesRequest = z.input<typeof ListPerpsTradesRequestSchema>;
6269
+ type ListPerpsTradesError = PerpsPublicReadError;
6270
+ declare const ListPerpsTradesError: {
4689
6271
  isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
4690
6272
  };
4691
6273
  /**
4692
- * Fetches the total value for a wallet's positions.
6274
+ * Lists recent Perps trades for an instrument with SDK-owned pagination.
4693
6275
  *
4694
- * @throws {@link FetchPortfolioValueError}
6276
+ * @remarks
6277
+ * Defaults to the past 24 hours when `start` is omitted.
6278
+ *
6279
+ * @throws {@link ListPerpsTradesError}
4695
6280
  * Thrown on failure.
6281
+ */
6282
+ declare function listPerpsTrades(client: BaseClient, request: ListPerpsTradesRequest): Paginated<PerpsPublicTrade[]>;
6283
+ type FetchPerpsFeesError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
6284
+ declare const FetchPerpsFeesError: {
6285
+ isError(error: unknown): error is TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6286
+ };
6287
+ /**
6288
+ * Fetches the Perps fee schedule.
4696
6289
  *
4697
- * @example
4698
- * ```ts
4699
- * const value = await fetchPortfolioValue(client, {
4700
- * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
4701
- * });
6290
+ * @remarks
6291
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4702
6292
  *
4703
- * // value: Value[]
4704
- * ```
6293
+ * @throws {@link FetchPerpsFeesError}
6294
+ * Thrown on failure.
4705
6295
  */
4706
- declare function fetchPortfolioValue(client: BaseClient, request: FetchPortfolioValueRequest): Promise<Value[]>;
4707
- type FetchTradedMarketCountError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
4708
- declare const FetchTradedMarketCountError: {
4709
- isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6296
+ declare function fetchPerpsFees(client: BaseClient): Promise<PerpsFeeScheduleEntry[]>;
6297
+ declare const CreatePerpsSessionRequestSchema: z.ZodObject<{
6298
+ expiresIn: z.ZodDefault<z.ZodNumber>;
6299
+ label: z.ZodOptional<z.ZodString>;
6300
+ }, z.core.$strict>;
6301
+ declare const ResumePerpsSessionRequestSchema: z.ZodObject<{
6302
+ credentials: z.ZodObject<{
6303
+ proxy: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
6304
+ privateKey: z.ZodCustom<PrivateKey, PrivateKey>;
6305
+ secret: z.ZodString;
6306
+ expiresAt: z.ZodNumber;
6307
+ }, z.core.$strip>;
6308
+ }, z.core.$strict>;
6309
+ declare const RevokePerpsCredentialsRequestSchema: z.ZodObject<{
6310
+ proxy: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
6311
+ }, z.core.$strip>;
6312
+ type CreatePerpsSessionRequest = z.input<typeof CreatePerpsSessionRequestSchema>;
6313
+ type ResumePerpsSessionRequest = z.input<typeof ResumePerpsSessionRequestSchema>;
6314
+ type OpenPerpsSessionRequest = CreatePerpsSessionRequest | ResumePerpsSessionRequest;
6315
+ type RevokePerpsCredentialsRequest = z.input<typeof RevokePerpsCredentialsRequestSchema>;
6316
+ type PerpsDepositWorkflowRequest = GaslessWorkflowRequest | SendPerpsDepositTransactionRequest;
6317
+ type PerpsDepositWorkflow = AsyncGenerator<PerpsDepositWorkflowRequest, TransactionHandle, EvmAddress | EvmSignature | TransactionHandle>;
6318
+ declare const DepositToPerpsRequestSchema: z.ZodObject<{
6319
+ amount: z.ZodBigInt;
6320
+ metadata: z.ZodOptional<z.ZodString>;
6321
+ }, z.core.$strip>;
6322
+ declare const WithdrawFromPerpsRequestSchema: z.ZodObject<{
6323
+ amount: z.ZodBigInt;
6324
+ }, z.core.$strip>;
6325
+ type DepositToPerpsRequest = z.input<typeof DepositToPerpsRequestSchema>;
6326
+ type WithdrawFromPerpsRequest = z.input<typeof WithdrawFromPerpsRequestSchema>;
6327
+ type OpenPerpsSessionError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6328
+ declare const OpenPerpsSessionError: {
6329
+ isError(error: unknown): error is SigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6330
+ };
6331
+ type RevokePerpsCredentialsError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6332
+ declare const RevokePerpsCredentialsError: {
6333
+ isError(error: unknown): error is SigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6334
+ };
6335
+ type PreparePerpsDepositError = UserInputError;
6336
+ declare const PreparePerpsDepositError: {
6337
+ isError(error: unknown): error is UserInputError;
6338
+ };
6339
+ type DepositToPerpsError = RateLimitError | RequestRejectedError | CancelledSigningError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6340
+ declare const DepositToPerpsError: {
6341
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6342
+ };
6343
+ type WithdrawFromPerpsError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6344
+ declare const WithdrawFromPerpsError: {
6345
+ isError(error: unknown): error is SigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
4710
6346
  };
4711
6347
  /**
4712
- * Fetches the total number of markets a wallet has traded.
6348
+ * Opens a Perps account session.
4713
6349
  *
4714
- * @throws {@link FetchTradedMarketCountError}
6350
+ * @remarks
6351
+ * Omit `expiresIn` to create new delegated Perps credentials that expire after
6352
+ * one week. Pass `expiresIn` as a duration in milliseconds to use a shorter or
6353
+ * longer credential lifetime, or pass existing credentials to validate and
6354
+ * resume a previous session.
6355
+ *
6356
+ * @throws {@link OpenPerpsSessionError}
4715
6357
  * Thrown on failure.
6358
+ */
6359
+ declare function openPerpsSession(client: BaseSecureClient, request?: OpenPerpsSessionRequest): Promise<PerpsSession>;
6360
+ /**
6361
+ * Revokes delegated Perps credentials by proxy address.
4716
6362
  *
4717
- * @example
4718
- * ```ts
4719
- * const traded = await fetchTradedMarketCount(client, {
4720
- * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
4721
- * });
6363
+ * @remarks
6364
+ * This signs the revocation with the owner account. It can revoke credentials
6365
+ * outside the currently open Perps session.
4722
6366
  *
4723
- * // traded === Traded
4724
- * ```
6367
+ * @throws {@link RevokePerpsCredentialsError}
6368
+ * Thrown on failure.
4725
6369
  */
4726
- declare function fetchTradedMarketCount(client: BaseClient, request: FetchTradedMarketCountRequest): Promise<Traded>;
4727
- type DownloadAccountingSnapshotError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
4728
- declare const DownloadAccountingSnapshotError: {
4729
- isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
4730
- };
6370
+ declare function revokePerpsCredentials(client: BaseSecureClient, request: RevokePerpsCredentialsRequest): Promise<void>;
4731
6371
  /**
4732
- * Downloads an accounting snapshot archive for a wallet.
6372
+ * Starts a Perps deposit workflow.
4733
6373
  *
4734
- * @throws {@link DownloadAccountingSnapshotError}
6374
+ * @remarks
6375
+ * The deposit sends approved collateral into the Perps deposit contract and
6376
+ * credits the authenticated signer account. It does not approve collateral
6377
+ * spending; call `setupTradingApprovals` first when allowance is missing.
6378
+ *
6379
+ * @throws {@link PreparePerpsDepositError}
4735
6380
  * Thrown on failure.
6381
+ */
6382
+ declare function preparePerpsDeposit(client: BaseSecureClient, request: DepositToPerpsRequest): Promise<PerpsDepositWorkflow>;
6383
+ /**
6384
+ * Deposits collateral into Perps for the authenticated signer account.
4736
6385
  *
4737
- * @example
4738
- * ```ts
4739
- * const snapshot = await downloadAccountingSnapshot(client, {
4740
- * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
4741
- * });
6386
+ * @throws {@link DepositToPerpsError}
6387
+ * Thrown on failure.
6388
+ */
6389
+ declare function depositToPerps(client: BaseSecureClient, request: DepositToPerpsRequest): Promise<TransactionHandle>;
6390
+ /**
6391
+ * Requests a Perps withdrawal to the authenticated wallet.
4742
6392
  *
4743
- * // snapshot === Blob
4744
- * ```
6393
+ * @remarks
6394
+ * The withdrawal is signed by the owner account and sends funds to the SDK
6395
+ * wallet address associated with the authenticated account.
6396
+ *
6397
+ * @throws {@link WithdrawFromPerpsError}
6398
+ * Thrown on failure.
4745
6399
  */
4746
- declare function downloadAccountingSnapshot(client: BaseClient, request: DownloadAccountingSnapshotRequest): Promise<Blob>;
6400
+ declare function withdrawFromPerps(client: BaseSecureClient, request: WithdrawFromPerpsRequest): Promise<PerpsWithdrawalId>;
4747
6401
 
4748
- declare const PrepareSplitPositionRequestSchema: z.ZodObject<{
4749
- amount: z.ZodBigInt;
4750
- conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>;
4751
- metadata: z.ZodOptional<z.ZodString>;
4752
- }, z.core.$strip>;
4753
- declare const PrepareMergePositionsRequestSchema: z.ZodObject<{
4754
- amount: z.ZodUnion<readonly [z.ZodBigInt, z.ZodLiteral<"max">]>;
4755
- conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>;
4756
- metadata: z.ZodOptional<z.ZodString>;
4757
- }, z.core.$strip>;
4758
- declare const PrepareRedeemPositionsRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
4759
- conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>;
4760
- marketId: z.ZodOptional<z.ZodNever>;
4761
- metadata: z.ZodOptional<z.ZodString>;
4762
- }, z.core.$strip>, z.ZodObject<{
4763
- conditionId: z.ZodOptional<z.ZodNever>;
4764
- marketId: z.ZodString;
4765
- metadata: z.ZodOptional<z.ZodString>;
4766
- }, z.core.$strip>]>;
6402
+ /**
6403
+ * Parameters for preparing a market position split.
6404
+ */
6405
+ type PrepareSplitMarketPositionRequest = {
6406
+ /** Amount of collateral to convert into market positions. */
6407
+ amount: bigint;
6408
+ /** Existing market condition ID that identifies the positions to mint. */
6409
+ conditionId: string | CtfConditionId;
6410
+ /** Optional transaction metadata for workflows that support metadata. */
6411
+ metadata?: string;
6412
+ };
6413
+ /**
6414
+ * Parameters for preparing a combo position split.
6415
+ */
6416
+ type PrepareSplitComboPositionRequest = {
6417
+ /** Amount of collateral to convert into combo positions. */
6418
+ amount: bigint;
6419
+ /** Protocol v2 leg position IDs that define the combo condition. */
6420
+ legs: string[] | PositionId[];
6421
+ /** Optional transaction metadata for workflows that support metadata. */
6422
+ metadata?: string;
6423
+ };
6424
+ /**
6425
+ * Parameters for preparing either supported position split workflow.
6426
+ *
6427
+ * @remarks
6428
+ * Provide either a market `conditionId` or combo `legs`.
6429
+ */
6430
+ type PrepareSplitPositionRequest = PrepareSplitMarketPositionRequest | PrepareSplitComboPositionRequest;
4767
6431
  type SplitPositionWorkflowRequest = GaslessWorkflowRequest | SendSplitPositionTransactionRequest;
4768
6432
  type MergePositionsWorkflowRequest = GaslessWorkflowRequest | SendMergePositionsTransactionRequest;
4769
6433
  type RedeemPositionsWorkflowRequest = GaslessWorkflowRequest | SendRedeemPositionsTransactionRequest;
4770
6434
  type SplitPositionWorkflow = AsyncGenerator<SplitPositionWorkflowRequest, TransactionHandle, EvmAddress | EvmSignature | TransactionHandle>;
4771
6435
  type MergePositionsWorkflow = AsyncGenerator<MergePositionsWorkflowRequest, TransactionHandle, EvmAddress | EvmSignature | TransactionHandle>;
4772
6436
  type RedeemPositionsWorkflow = AsyncGenerator<RedeemPositionsWorkflowRequest, TransactionHandle, EvmAddress | EvmSignature | TransactionHandle>;
4773
- type PrepareSplitPositionRequest = z.input<typeof PrepareSplitPositionRequestSchema>;
4774
- type PrepareMergePositionsRequest = z.input<typeof PrepareMergePositionsRequestSchema>;
4775
- type PrepareRedeemPositionsRequest = z.input<typeof PrepareRedeemPositionsRequestSchema>;
4776
- type PrepareSplitPositionError = UserInputError;
6437
+ type PrepareSplitPositionError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
4777
6438
  declare const PrepareSplitPositionError: {
4778
- isError(error: unknown): error is UserInputError;
6439
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6440
+ };
6441
+ type PrepareSplitMarketPositionError = PrepareSplitPositionError;
6442
+ declare const PrepareSplitMarketPositionError: {
6443
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6444
+ };
6445
+ type PrepareSplitComboPositionError = PrepareSplitPositionError;
6446
+ declare const PrepareSplitComboPositionError: {
6447
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
4779
6448
  };
4780
6449
  type PrepareMergePositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
4781
6450
  declare const PrepareMergePositionsError: {
4782
6451
  isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
4783
6452
  };
6453
+ type PrepareMergeMarketPositionError = PrepareMergePositionsError;
6454
+ declare const PrepareMergeMarketPositionError: {
6455
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6456
+ };
6457
+ type PrepareMergeComboPositionError = PrepareMergePositionsError;
6458
+ declare const PrepareMergeComboPositionError: {
6459
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6460
+ };
4784
6461
  type PrepareRedeemPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
4785
6462
  declare const PrepareRedeemPositionsError: {
4786
6463
  isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
4787
6464
  };
6465
+ type PrepareRedeemMarketPositionsError = PrepareRedeemPositionsError;
6466
+ declare const PrepareRedeemMarketPositionsError: {
6467
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6468
+ };
6469
+ type PrepareRedeemComboPositionError = PrepareRedeemPositionsError;
6470
+ declare const PrepareRedeemComboPositionError: {
6471
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6472
+ };
4788
6473
  /**
4789
6474
  * Starts a split workflow for a market condition.
4790
6475
  *
4791
6476
  * @remarks
4792
- * This is a low-level action that most SDK consumers will not need.
6477
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4793
6478
  *
4794
6479
  * @example
4795
6480
  * ```ts
4796
- * const workflow = await prepareSplitPosition(client, {
6481
+ * const workflow = await prepareSplitMarketPosition(client, {
4797
6482
  * amount: 1n,
4798
6483
  * conditionId:
4799
6484
  * '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
4800
6485
  * });
4801
6486
  * ```
4802
6487
  *
6488
+ * @throws {@link PrepareSplitMarketPositionError}
6489
+ * Thrown on failure.
6490
+ */
6491
+ declare function prepareSplitMarketPosition(client: BaseSecureClient, request: PrepareSplitMarketPositionRequest): Promise<SplitPositionWorkflow>;
6492
+ /**
6493
+ * Starts a split workflow for a combo position from leg position IDs.
6494
+ *
6495
+ * @remarks
6496
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6497
+ *
6498
+ * @example
6499
+ * ```ts
6500
+ * const workflow = await prepareSplitComboPosition(client, {
6501
+ * amount: 1n,
6502
+ * legs: ['123', '456'],
6503
+ * });
6504
+ * ```
6505
+ *
6506
+ * @throws {@link PrepareSplitComboPositionError}
6507
+ * Thrown on failure.
6508
+ */
6509
+ declare function prepareSplitComboPosition(client: BaseSecureClient, request: PrepareSplitComboPositionRequest): Promise<SplitPositionWorkflow>;
6510
+ /**
6511
+ * Starts a split workflow for market or combo positions.
6512
+ *
4803
6513
  * @throws {@link PrepareSplitPositionError}
4804
6514
  * Thrown on failure.
4805
6515
  */
4806
6516
  declare function prepareSplitPosition(client: BaseSecureClient, request: PrepareSplitPositionRequest): Promise<SplitPositionWorkflow>;
4807
- type SplitPositionError = PrepareSplitPositionError | CancelledSigningError | SigningError;
6517
+ type SplitPositionError = CancelledSigningError | RateLimitError | RequestRejectedError | SigningError | TimeoutError | TransactionFailedError | TransportError | UnexpectedResponseError | UserInputError;
4808
6518
  declare const SplitPositionError: {
4809
- isError(error: unknown): error is SigningError | CancelledSigningError | UserInputError;
6519
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
6520
+ };
6521
+ type SplitMarketPositionError = SplitPositionError;
6522
+ declare const SplitMarketPositionError: {
6523
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
6524
+ };
6525
+ type SplitComboPositionError = SplitPositionError;
6526
+ declare const SplitComboPositionError: {
6527
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
4810
6528
  };
4811
6529
  /**
4812
6530
  * Splits collateral into market positions.
4813
6531
  *
6532
+ * @remarks
6533
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6534
+ *
6535
+ * @throws {@link SplitMarketPositionError}
6536
+ * Thrown on failure.
6537
+ */
6538
+ declare function splitMarketPosition(client: BaseSecureClient, request: PrepareSplitMarketPositionRequest): Promise<TransactionHandle>;
6539
+ /**
6540
+ * Splits collateral into combo positions from leg position IDs.
6541
+ *
6542
+ * @remarks
6543
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6544
+ *
6545
+ * @throws {@link SplitComboPositionError}
6546
+ * Thrown on failure.
6547
+ */
6548
+ declare function splitComboPosition(client: BaseSecureClient, request: PrepareSplitComboPositionRequest): Promise<TransactionHandle>;
6549
+ /**
6550
+ * Splits collateral into market or combo positions.
6551
+ *
4814
6552
  * @throws {@link SplitPositionError}
4815
6553
  * Thrown on failure.
4816
6554
  */
4817
6555
  declare function splitPosition(client: BaseSecureClient, request: PrepareSplitPositionRequest): Promise<TransactionHandle>;
6556
+ /**
6557
+ * Parameters for preparing a market position merge.
6558
+ */
6559
+ type PrepareMergeMarketPositionRequest = {
6560
+ /** Amount per complementary market position to merge. */
6561
+ amount: bigint | 'max';
6562
+ /** Existing market condition ID that identifies the positions to merge. */
6563
+ conditionId: string | CtfConditionId;
6564
+ /** Optional transaction metadata for workflows that support metadata. */
6565
+ metadata?: string;
6566
+ };
6567
+ /**
6568
+ * Parameters for preparing a combo position merge.
6569
+ */
6570
+ type PrepareMergeComboPositionRequest = {
6571
+ /** Amount per complementary combo position to merge. */
6572
+ amount: bigint | 'max';
6573
+ /** Protocol v2 leg position IDs that define the combo condition. */
6574
+ legs: string[] | PositionId[];
6575
+ /** Optional transaction metadata for workflows that support metadata. */
6576
+ metadata?: string;
6577
+ };
6578
+ /**
6579
+ * Parameters for preparing either supported position merge workflow.
6580
+ *
6581
+ * @remarks
6582
+ * Provide either a market `conditionId` or combo `legs`.
6583
+ */
6584
+ type PrepareMergePositionsRequest = PrepareMergeMarketPositionRequest | PrepareMergeComboPositionRequest;
4818
6585
  /**
4819
6586
  * Starts a workflow to merge complementary positions in a market back into collateral.
4820
6587
  *
4821
6588
  * @remarks
4822
- * This is a low-level action that most SDK consumers will not need.
6589
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4823
6590
  *
4824
6591
  * @example
4825
6592
  * ```ts
4826
- * const workflow = await prepareMergePositions(client, {
6593
+ * const workflow = await prepareMergeMarketPosition(client, {
4827
6594
  * amount: 'max',
4828
6595
  * conditionId:
4829
6596
  * '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
4830
6597
  * });
4831
6598
  * ```
4832
6599
  *
6600
+ * @throws {@link PrepareMergeMarketPositionError}
6601
+ * Thrown on failure.
6602
+ */
6603
+ declare function prepareMergeMarketPosition(client: BaseSecureClient, request: PrepareMergeMarketPositionRequest): Promise<MergePositionsWorkflow>;
6604
+ /**
6605
+ * Starts a workflow to merge complementary combo positions back into collateral.
6606
+ *
6607
+ * @remarks
6608
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6609
+ *
6610
+ * @example
6611
+ * ```ts
6612
+ * const workflow = await prepareMergeComboPosition(client, {
6613
+ * amount: 'max',
6614
+ * legs: ['123', '456'],
6615
+ * });
6616
+ * ```
6617
+ *
6618
+ * @throws {@link PrepareMergeComboPositionError}
6619
+ * Thrown on failure.
6620
+ */
6621
+ declare function prepareMergeComboPosition(client: BaseSecureClient, request: PrepareMergeComboPositionRequest): Promise<MergePositionsWorkflow>;
6622
+ /**
6623
+ * Starts a merge workflow for market or combo positions.
6624
+ *
4833
6625
  * @throws {@link PrepareMergePositionsError}
4834
6626
  * Thrown on failure.
4835
6627
  */
4836
6628
  declare function prepareMergePositions(client: BaseSecureClient, request: PrepareMergePositionsRequest): Promise<MergePositionsWorkflow>;
4837
- type MergePositionsError = PrepareMergePositionsError | CancelledSigningError | SigningError;
6629
+ type MergePositionsError = CancelledSigningError | RateLimitError | RequestRejectedError | SigningError | TimeoutError | TransactionFailedError | TransportError | UnexpectedResponseError | UserInputError;
4838
6630
  declare const MergePositionsError: {
4839
- isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
6631
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
6632
+ };
6633
+ type MergeMarketPositionError = MergePositionsError;
6634
+ declare const MergeMarketPositionError: {
6635
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
6636
+ };
6637
+ type MergeComboPositionError = MergePositionsError;
6638
+ declare const MergeComboPositionError: {
6639
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
4840
6640
  };
4841
6641
  /**
4842
6642
  * Merges complementary market positions back into collateral.
4843
6643
  *
6644
+ * @remarks
6645
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6646
+ *
6647
+ * @throws {@link MergeMarketPositionError}
6648
+ * Thrown on failure.
6649
+ */
6650
+ declare function mergeMarketPosition(client: BaseSecureClient, request: PrepareMergeMarketPositionRequest): Promise<TransactionHandle>;
6651
+ /**
6652
+ * Merges complementary combo positions back into collateral.
6653
+ *
6654
+ * @remarks
6655
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6656
+ *
6657
+ * @throws {@link MergeComboPositionError}
6658
+ * Thrown on failure.
6659
+ */
6660
+ declare function mergeComboPosition(client: BaseSecureClient, request: PrepareMergeComboPositionRequest): Promise<TransactionHandle>;
6661
+ /**
6662
+ * Merges complementary market or combo positions back into collateral.
6663
+ *
4844
6664
  * @throws {@link MergePositionsError}
4845
6665
  * Thrown on failure.
4846
6666
  */
4847
6667
  declare function mergePositions(client: BaseSecureClient, request: PrepareMergePositionsRequest): Promise<TransactionHandle>;
4848
6668
  /**
4849
- * Starts a redemption workflow for resolved positions.
6669
+ * Parameters for preparing a market position redemption by condition ID.
6670
+ */
6671
+ type PrepareRedeemMarketPositionsByConditionIdRequest = {
6672
+ /** Existing market condition ID that identifies the positions to redeem. */
6673
+ conditionId: string | CtfConditionId;
6674
+ marketId?: never;
6675
+ amount?: never;
6676
+ positionId?: never;
6677
+ /** Optional transaction metadata for workflows that support metadata. */
6678
+ metadata?: string;
6679
+ };
6680
+ /**
6681
+ * Parameters for preparing a market position redemption by market ID.
6682
+ */
6683
+ type PrepareRedeemMarketPositionsByMarketIdRequest = {
6684
+ conditionId?: never;
6685
+ /** Existing market ID that identifies the positions to redeem. */
6686
+ marketId: string;
6687
+ amount?: never;
6688
+ positionId?: never;
6689
+ /** Optional transaction metadata for workflows that support metadata. */
6690
+ metadata?: string;
6691
+ };
6692
+ /**
6693
+ * Parameters for preparing a combo position redemption.
6694
+ */
6695
+ type PrepareRedeemComboPositionRequest = {
6696
+ /** Protocol v2 combo YES/NO position ID to redeem. */
6697
+ positionId: string | PositionId;
6698
+ conditionId?: never;
6699
+ marketId?: never;
6700
+ /** Optional transaction metadata for workflows that support metadata. */
6701
+ metadata?: string;
6702
+ };
6703
+ /**
6704
+ * Parameters for preparing either supported position redemption workflow.
6705
+ *
6706
+ * @remarks
6707
+ * Provide either a market `conditionId` or `marketId`, or a combo `positionId`.
6708
+ */
6709
+ type PrepareRedeemPositionsRequest = PrepareRedeemMarketPositionsByConditionIdRequest | PrepareRedeemMarketPositionsByMarketIdRequest | PrepareRedeemComboPositionRequest;
6710
+ type PrepareRedeemMarketPositionsRequest = PrepareRedeemMarketPositionsByConditionIdRequest | PrepareRedeemMarketPositionsByMarketIdRequest;
6711
+ /**
6712
+ * Starts a redemption workflow for resolved market positions.
4850
6713
  *
4851
6714
  * @remarks
4852
- * This is a low-level action that most SDK consumers will not need.
6715
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4853
6716
  *
4854
6717
  * @example
4855
6718
  * ```ts
4856
- * const workflow = await prepareRedeemPositions(client, {
6719
+ * const workflow = await prepareRedeemMarketPositions(client, {
4857
6720
  * conditionId:
4858
6721
  * '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
4859
6722
  * });
@@ -4861,21 +6724,51 @@ declare function mergePositions(client: BaseSecureClient, request: PrepareMergeP
4861
6724
  *
4862
6725
  * @example
4863
6726
  * ```ts
4864
- * const workflow = await prepareRedeemPositions(client, {
6727
+ * const workflow = await prepareRedeemMarketPositions(client, {
4865
6728
  * marketId: '12345',
4866
6729
  * });
4867
6730
  * ```
4868
6731
  *
6732
+ * @throws {@link PrepareRedeemMarketPositionsError}
6733
+ * Thrown on failure.
6734
+ */
6735
+ declare function prepareRedeemMarketPositions(client: BaseSecureClient, request: PrepareRedeemMarketPositionsRequest): Promise<RedeemPositionsWorkflow>;
6736
+ /**
6737
+ * Starts a redemption workflow for a resolved combo position.
6738
+ *
6739
+ * @remarks
6740
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6741
+ *
6742
+ * @example
6743
+ * ```ts
6744
+ * const workflow = await prepareRedeemComboPosition(client, {
6745
+ * positionId: '123',
6746
+ * });
6747
+ * ```
6748
+ *
6749
+ * @throws {@link PrepareRedeemComboPositionError}
6750
+ * Thrown on failure.
6751
+ */
6752
+ declare function prepareRedeemComboPosition(client: BaseSecureClient, request: PrepareRedeemComboPositionRequest): Promise<RedeemPositionsWorkflow>;
6753
+ /**
6754
+ * Starts a redemption workflow for resolved market or combo positions.
6755
+ *
6756
+ * @remarks
6757
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6758
+ *
4869
6759
  * @throws {@link PrepareRedeemPositionsError}
4870
6760
  * Thrown on failure.
4871
6761
  */
4872
6762
  declare function prepareRedeemPositions(client: BaseSecureClient, request: PrepareRedeemPositionsRequest): Promise<RedeemPositionsWorkflow>;
4873
- type RedeemPositionsError = PrepareRedeemPositionsError | CancelledSigningError | SigningError;
6763
+ type RedeemPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError | CancelledSigningError | SigningError;
4874
6764
  declare const RedeemPositionsError: {
4875
6765
  isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
4876
6766
  };
4877
6767
  /**
4878
- * Redeems resolved market positions.
6768
+ * Redeems resolved market or combo positions.
6769
+ *
6770
+ * @remarks
6771
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
4879
6772
  *
4880
6773
  * @throws {@link RedeemPositionsError}
4881
6774
  * Thrown on failure.
@@ -4893,6 +6786,9 @@ declare const FetchPublicProfileError: {
4893
6786
  /**
4894
6787
  * Fetches a public profile by wallet address.
4895
6788
  *
6789
+ * @remarks
6790
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6791
+ *
4896
6792
  * @throws {@link FetchPublicProfileError}
4897
6793
  * Thrown on failure.
4898
6794
  *
@@ -4907,6 +6803,15 @@ declare const FetchPublicProfileError: {
4907
6803
  */
4908
6804
  declare function fetchPublicProfile(client: BaseClient, request: FetchPublicProfileRequest): Promise<PublicProfile | null>;
4909
6805
 
6806
+ declare enum SearchSort {
6807
+ Volume = "volume",
6808
+ Volume24Hr = "volume_24hr",
6809
+ Liquidity = "liquidity",
6810
+ Competitive = "competitive",
6811
+ ClosedTime = "closed_time",
6812
+ StartDate = "start_date",
6813
+ EndDate = "end_date"
6814
+ }
4910
6815
  declare const SearchRequestSchema: z.ZodObject<{
4911
6816
  q: z.ZodString;
4912
6817
  ascending: z.ZodOptional<z.ZodBoolean>;
@@ -4926,7 +6831,7 @@ declare const SearchRequestSchema: z.ZodObject<{
4926
6831
  }>>;
4927
6832
  searchProfiles: z.ZodOptional<z.ZodBoolean>;
4928
6833
  searchTags: z.ZodOptional<z.ZodBoolean>;
4929
- sort: z.ZodOptional<z.ZodString>;
6834
+ sort: z.ZodOptional<z.ZodEnum<typeof SearchSort>>;
4930
6835
  }, z.core.$strip>;
4931
6836
  type SearchRequest = z.input<typeof SearchRequestSchema>;
4932
6837
  type SearchResults = {
@@ -4941,6 +6846,11 @@ declare const SearchError: {
4941
6846
  /**
4942
6847
  * Runs a public full-text search.
4943
6848
  *
6849
+ * @remarks
6850
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6851
+ * `keepClosedMarkets` is an hour window for including recently closed markets
6852
+ * when searching active events.
6853
+ *
4944
6854
  * @throws {@link SearchError}
4945
6855
  * Thrown on failure.
4946
6856
  *
@@ -4966,12 +6876,9 @@ declare function search(client: BaseClient, request: SearchRequest): Paginated<S
4966
6876
 
4967
6877
  declare const ListSeriesRequestSchema: z.ZodObject<{
4968
6878
  ascending: z.ZodOptional<z.ZodBoolean>;
4969
- categoriesIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
4970
- categoriesLabels: z.ZodOptional<z.ZodArray<z.ZodString>>;
4971
6879
  closed: z.ZodOptional<z.ZodBoolean>;
4972
6880
  cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
4973
6881
  excludeEvents: z.ZodOptional<z.ZodBoolean>;
4974
- includeChat: z.ZodOptional<z.ZodBoolean>;
4975
6882
  locale: z.ZodOptional<z.ZodString>;
4976
6883
  order: z.ZodOptional<z.ZodString>;
4977
6884
  pageSize: z.ZodDefault<z.ZodNumber>;
@@ -4984,7 +6891,6 @@ declare const ListSeriesRequestSchema: z.ZodObject<{
4984
6891
  }, z.core.$strip>;
4985
6892
  declare const FetchSeriesRequestSchema: z.ZodObject<{
4986
6893
  id: z.ZodString;
4987
- includeChat: z.ZodOptional<z.ZodBoolean>;
4988
6894
  locale: z.ZodOptional<z.ZodString>;
4989
6895
  }, z.core.$strip>;
4990
6896
  type ListSeriesRequest = z.input<typeof ListSeriesRequestSchema>;
@@ -4996,6 +6902,9 @@ declare const ListSeriesError: {
4996
6902
  /**
4997
6903
  * Lists series.
4998
6904
  *
6905
+ * @remarks
6906
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6907
+ *
4999
6908
  * @throws {@link ListSeriesError}
5000
6909
  * Thrown on failure.
5001
6910
  *
@@ -5036,6 +6945,9 @@ declare const FetchSeriesError: {
5036
6945
  /**
5037
6946
  * Fetches a series.
5038
6947
  *
6948
+ * @remarks
6949
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
6950
+ *
5039
6951
  * @throws {@link FetchSeriesError}
5040
6952
  * Thrown on failure.
5041
6953
  *
@@ -5043,7 +6955,7 @@ declare const FetchSeriesError: {
5043
6955
  * ```ts
5044
6956
  * const series = await fetchSeries(client, {
5045
6957
  * id: 'fed-daily-series',
5046
- * includeChat: true,
6958
+ * locale: 'en',
5047
6959
  * });
5048
6960
  *
5049
6961
  * // series === Series
@@ -5057,9 +6969,17 @@ type SportsEventType = SportsEvent['type'];
5057
6969
  type CommentsEventType = CommentsEvent['type'];
5058
6970
  type CryptoPricesEventType = CryptoPricesEvent['type'];
5059
6971
  type EquityPricesEventType = EquityPricesEvent['type'];
6972
+ type PerpsMarketDataEventType = PerpsMarketDataEvent['type'];
6973
+ type PerpsStreamingCandleInterval = Exclude<PerpsKlineInterval, PerpsKlineInterval.OneSecond>;
6974
+ type PerpsInstrumentIdInput = number;
5060
6975
  type MarketSubscription = {
5061
6976
  topic: 'market';
6977
+ /** Token IDs whose market events should be delivered. */
5062
6978
  tokenIds: readonly string[];
6979
+ /**
6980
+ * When `true`, the server additionally emits `MarketBestBidAskEvent`,
6981
+ * `NewMarketEvent`, and `MarketResolvedEvent`.
6982
+ */
5063
6983
  customFeatureEnabled?: boolean;
5064
6984
  };
5065
6985
  type UserSubscription = {
@@ -5084,9 +7004,35 @@ type EquityPricesSubscription = {
5084
7004
  symbol: string;
5085
7005
  types?: readonly EquityPricesEventType[];
5086
7006
  };
5087
- type PublicSubscriptionSpec = MarketSubscription | SportsSubscription | CommentsSubscription | CryptoPricesSubscription | EquityPricesSubscription;
7007
+ type PerpsTradesSubscription = {
7008
+ topic: 'perps.trades';
7009
+ instrumentId: PerpsInstrumentIdInput;
7010
+ };
7011
+ type PerpsBboSubscription = {
7012
+ topic: 'perps.bbo';
7013
+ instrumentId: PerpsInstrumentIdInput;
7014
+ };
7015
+ type PerpsBookSubscription = {
7016
+ topic: 'perps.book';
7017
+ instrumentId: PerpsInstrumentIdInput;
7018
+ };
7019
+ type PerpsCandlesSubscription = {
7020
+ topic: 'perps.candles';
7021
+ instrumentId: PerpsInstrumentIdInput;
7022
+ interval: PerpsStreamingCandleInterval;
7023
+ };
7024
+ type PerpsTickersSubscription = {
7025
+ topic: 'perps.tickers';
7026
+ instrumentId?: PerpsInstrumentIdInput;
7027
+ };
7028
+ type PerpsStatisticsSubscription = {
7029
+ topic: 'perps.statistics';
7030
+ instrumentId?: PerpsInstrumentIdInput;
7031
+ };
7032
+ type PerpsMarketDataSubscription = PerpsTradesSubscription | PerpsBboSubscription | PerpsBookSubscription | PerpsCandlesSubscription | PerpsTickersSubscription | PerpsStatisticsSubscription;
7033
+ type PublicSubscriptionSpec = MarketSubscription | SportsSubscription | CommentsSubscription | CryptoPricesSubscription | EquityPricesSubscription | PerpsMarketDataSubscription;
5088
7034
  type SecureSubscriptionSpec = PublicSubscriptionSpec | UserSubscription;
5089
- type PublicRealtimeEvent = MarketEvent | SportsEvent | CommentsEvent | CryptoPricesEvent | EquityPricesEvent;
7035
+ type PublicRealtimeEvent = MarketEvent | SportsEvent | CommentsEvent | CryptoPricesEvent | EquityPricesEvent | PerpsMarketDataEvent;
5090
7036
  type SecureRealtimeEvent = PublicRealtimeEvent | UserEvent;
5091
7037
  type PublicRealtimeTopic = Prettify<PublicRealtimeEvent['topic']>;
5092
7038
  type SecureRealtimeTopic = Prettify<SecureRealtimeEvent['topic']>;
@@ -5097,6 +7043,12 @@ type EventByTopic = {
5097
7043
  'prices.crypto.binance': CryptoPricesBinanceEvent;
5098
7044
  'prices.crypto.chainlink': CryptoPricesChainlinkEvent;
5099
7045
  'prices.equity.pyth': EquityPricesEvent;
7046
+ 'perps.trades': PerpsTradeEvent;
7047
+ 'perps.bbo': PerpsBboEvent;
7048
+ 'perps.book': PerpsBookEvent;
7049
+ 'perps.candles': PerpsCandleEvent;
7050
+ 'perps.tickers': PerpsTickerEvent;
7051
+ 'perps.statistics': PerpsStatisticEvent;
5100
7052
  };
5101
7053
  type EventForMarketSubscription<TSpec extends MarketSubscription> = 'customFeatureEnabled' extends keyof TSpec ? true extends TSpec['customFeatureEnabled'] ? MarketEvent : StandardMarketEvent : StandardMarketEvent;
5102
7054
  type EventForSubscriptionSpec<TSpec extends SecureSubscriptionSpec> = TSpec extends MarketSubscription ? EventForMarketSubscription<TSpec> : TSpec extends {
@@ -5115,6 +7067,9 @@ type SubscribeError = TransportError;
5115
7067
  /**
5116
7068
  * Starts one or more realtime subscriptions on this client.
5117
7069
  *
7070
+ * @remarks
7071
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
7072
+ *
5118
7073
  * @throws {@link SubscribeError}
5119
7074
  * Thrown when the realtime subscription cannot be established or fails.
5120
7075
  *
@@ -5135,7 +7090,6 @@ declare function subscribe<const TSubscriptions extends readonly SecureSubscript
5135
7090
  declare const ListTagsRequestSchema: z.ZodObject<{
5136
7091
  ascending: z.ZodOptional<z.ZodBoolean>;
5137
7092
  cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
5138
- includeChat: z.ZodOptional<z.ZodBoolean>;
5139
7093
  includeTemplate: z.ZodOptional<z.ZodBoolean>;
5140
7094
  isCarousel: z.ZodOptional<z.ZodBoolean>;
5141
7095
  locale: z.ZodOptional<z.ZodString>;
@@ -5144,7 +7098,6 @@ declare const ListTagsRequestSchema: z.ZodObject<{
5144
7098
  }, z.core.$strip>;
5145
7099
  declare const FetchTagRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
5146
7100
  id: z.ZodString;
5147
- includeChat: z.ZodOptional<z.ZodBoolean>;
5148
7101
  includeTemplate: z.ZodOptional<z.ZodBoolean>;
5149
7102
  locale: z.ZodOptional<z.ZodString>;
5150
7103
  }, z.core.$strip>, z.ZodObject<{
@@ -5194,6 +7147,9 @@ declare const ListTagsError: {
5194
7147
  /**
5195
7148
  * Lists tags.
5196
7149
  *
7150
+ * @remarks
7151
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
7152
+ *
5197
7153
  * @throws {@link ListTagsError}
5198
7154
  * Thrown on failure.
5199
7155
  *
@@ -5234,6 +7190,9 @@ declare const FetchTagError: {
5234
7190
  /**
5235
7191
  * Fetches a tag by id or slug.
5236
7192
  *
7193
+ * @remarks
7194
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
7195
+ *
5237
7196
  * @throws {@link FetchTagError}
5238
7197
  * Thrown on failure.
5239
7198
  *
@@ -5255,6 +7214,9 @@ declare const FetchRelatedTagsError: {
5255
7214
  /**
5256
7215
  * Fetches related tag relationships by id or slug.
5257
7216
  *
7217
+ * @remarks
7218
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
7219
+ *
5258
7220
  * @throws {@link FetchRelatedTagsError}
5259
7221
  * Thrown on failure.
5260
7222
  *
@@ -5277,6 +7239,9 @@ declare const FetchRelatedTagResourcesError: {
5277
7239
  /**
5278
7240
  * Fetches resources linked from related tag relationships by id or slug.
5279
7241
  *
7242
+ * @remarks
7243
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
7244
+ *
5280
7245
  * @throws {@link FetchRelatedTagResourcesError}
5281
7246
  * Thrown on failure.
5282
7247
  *
@@ -5311,6 +7276,9 @@ declare const ListTeamsError: {
5311
7276
  /**
5312
7277
  * Lists teams.
5313
7278
  *
7279
+ * @remarks
7280
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
7281
+ *
5314
7282
  * @throws {@link ListTeamsError}
5315
7283
  * Thrown on failure.
5316
7284
  *
@@ -5362,14 +7330,14 @@ declare const PrepareErc20TransferError: {
5362
7330
  * Starts an ERC-20 transfer workflow.
5363
7331
  *
5364
7332
  * @remarks
5365
- * This is a low-level action that most SDK consumers will not need.
7333
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
5366
7334
  *
5367
7335
  * @example
5368
7336
  * ```ts
5369
7337
  * const workflow = await prepareErc20Transfer(client, {
5370
7338
  * amount: 1n,
5371
7339
  * recipientAddress: client.account.signer,
5372
- * tokenAddress: client.environment.collateralToken,
7340
+ * tokenAddress: client.environment.contracts.collateralToken,
5373
7341
  * });
5374
7342
  * ```
5375
7343
  *
@@ -5377,13 +7345,16 @@ declare const PrepareErc20TransferError: {
5377
7345
  * Thrown on failure.
5378
7346
  */
5379
7347
  declare function prepareErc20Transfer(client: BaseSecureClient, request: PrepareErc20TransferRequest): Promise<Erc20TransferWorkflow>;
5380
- type TransferErc20Error = PrepareErc20TransferError | CancelledSigningError | SigningError;
7348
+ type TransferErc20Error = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError | CancelledSigningError | SigningError;
5381
7349
  declare const TransferErc20Error: {
5382
- isError(error: unknown): error is SigningError | CancelledSigningError | UserInputError;
7350
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
5383
7351
  };
5384
7352
  /**
5385
7353
  * Transfers ERC-20 tokens from the authenticated account.
5386
7354
  *
7355
+ * @remarks
7356
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
7357
+ *
5387
7358
  * @throws {@link TransferErc20Error}
5388
7359
  * Thrown on failure.
5389
7360
  */
@@ -5460,4 +7431,4 @@ type Signer = {
5460
7431
  sendTransaction(request: SignerTransactionRequest): Promise<TransactionHandle>;
5461
7432
  };
5462
7433
 
5463
- export { FetchRewardPercentagesError as $, type ApiKeyAuthorization as A, type BaseClient as B, CancelAllError as C, type DataActions as D, type EnvironmentConfig as E, FetchClosedOnlyModeError as F, FetchLastTradePricesError as G, FetchMarketError as H, FetchMarketTagsError as I, FetchMidpointError as J, FetchMidpointsError as K, FetchNotificationsError as L, FetchOrderBookError as M, FetchOrderBooksError as N, FetchOrderError as O, FetchOrderScoringError as P, FetchOrdersScoringError as Q, FetchPortfolioValueError as R, type Signer as S, type TypedDataPayload as T, UserInputError as U, FetchPriceError as V, FetchPriceHistoryError as W, FetchPricesError as X, FetchPublicProfileError as Y, FetchRelatedTagResourcesError as Z, FetchRelatedTagsError as _, type TypedData as a, SetupGaslessWalletError as a$, FetchSeriesError as a0, FetchSpreadError as a1, FetchSpreadsError as a2, FetchTagError as a3, FetchTotalEarningsForUserForDayError as a4, FetchTradedMarketCountError as a5, InsufficientLiquidityError as a6, IsGaslessReadyError as a7, ListAccountTradesError as a8, ListActivityError as a9, PostOrderError as aA, PostOrdersError as aB, type PublicAccountActions as aC, type PublicActions as aD, type PublicClient as aE, type PublicClientOptions as aF, type PublicRewardsActions as aG, type PublicSubscriptionsActions as aH, RateLimitError as aI, RedeemPositionsError as aJ, RequestRejectedError as aK, type RequestRejectedErrorOptions as aL, SearchError as aM, type SecureAccountActions as aN, type SecureActions as aO, type SecureClient as aP, type SecureClientOptions as aQ, type SecureDownloadAccountingSnapshotRequest as aR, type SecureFetchPortfolioValueRequest as aS, type SecureFetchTradedMarketCountRequest as aT, type SecureListActivityRequest as aU, type SecureListClosedPositionsRequest as aV, type SecureListPositionsRequest as aW, type SecureRewardsActions as aX, type SecureSubscriptionsActions as aY, type SecureTradingActions as aZ, type SecureWalletActions as a_, ListBuilderLeaderboardError as aa, ListBuilderTradesError as ab, ListBuilderVolumeError as ac, ListClosedPositionsError as ad, ListCommentsByUserAddressError as ae, ListCommentsError as af, ListCurrentRewardsError as ag, ListEventsError as ah, ListMarketHoldersError as ai, ListMarketPositionsError as aj, ListMarketRewardsError as ak, ListMarketsError as al, ListOpenInterestError as am, ListOpenOrdersError as an, ListPositionsError as ao, ListSeriesError as ap, ListTagsError as aq, ListTeamsError as ar, ListTraderLeaderboardError as as, ListTradesError as at, ListUserEarningsAndMarketsConfigError as au, ListUserEarningsForDayError as av, MergePositionsError as aw, type Page as ax, PageSizeSchema as ay, type Paginated as az, type TransactionCall as b, type FetchLastTradePricesRequest as b$, SetupTradingApprovalsError as b0, type SignerTransactionRequest as b1, SigningError as b2, SplitPositionError as b3, TimeoutError as b4, TransactionFailedError as b5, type TransactionHandle as b6, type TransactionOutcome as b7, TransferErc20Error as b8, TransportError as b9, type DownloadAccountingSnapshotRequest as bA, type DropNotificationsRequest as bB, type EquityPricesEventType as bC, type EquityPricesSubscription as bD, type Erc1155ApprovalForAllWorkflow as bE, type Erc1155ApprovalForAllWorkflowRequest as bF, type Erc20ApprovalWorkflow as bG, type Erc20ApprovalWorkflowRequest as bH, type Erc20TransferWorkflow as bI, type Erc20TransferWorkflowRequest as bJ, type EstimateMarketBuyPriceRequest as bK, type EstimateMarketPriceRequest as bL, type EstimateMarketSellPriceRequest as bM, type EventForSubscriptionSpec as bN, type EventForSubscriptionSpecs as bO, FetchBalanceAllowanceError as bP, type FetchBalanceAllowanceRequest as bQ, FetchBuilderFeeRatesError as bR, type FetchBuilderFeeRatesRequest as bS, type FetchCommentsByIdRequest as bT, type FetchEventLiveVolumeRequest as bU, type FetchEventRequest as bV, type FetchEventTagsRequest as bW, FetchExecuteParamsError as bX, type FetchExecuteParamsRequest as bY, type FetchGaslessTransactionRequest as bZ, type FetchLastTradePriceRequest as b_, type TypedDataDomain as ba, type TypedDataField as bb, UnexpectedResponseError as bc, WaitForTransactionError as bd, type WalletDerivationConfig as be, accountActions as bf, allActions as bg, analyticsActions as bh, createPublicClient as bi, createSecureClient as bj, dataActions as bk, discoveryActions as bl, makeErrorGuard as bm, production as bn, rewardsActions as bo, subscriptionsActions as bp, tradingActions as bq, walletActions as br, type CancelMarketOrdersRequest as bs, type CancelOrderRequest as bt, type CancelOrdersRequest as bu, type CommentsEventType as bv, type CommentsSubscription as bw, type CryptoPricesEventType as bx, type CryptoPricesSubscription as by, DeployDepositWalletError as bz, type AccountIdentity as c, type OrderWorkflowRequest as c$, FetchMarketInfoError as c0, type FetchMarketInfoRequest as c1, type FetchMarketRequest as c2, type FetchMarketTagsRequest as c3, type FetchMidpointRequest as c4, type FetchMidpointsRequest as c5, FetchNegRiskError as c6, type FetchNegRiskRequest as c7, type FetchOrderBookRequest as c8, type FetchOrderBooksRequest as c9, type ListBuilderVolumeRequest as cA, type ListClosedPositionsRequest as cB, type ListCommentsByUserAddressRequest as cC, type ListCommentsRequest as cD, type ListCurrentRewardsRequest as cE, type ListEventsRequest as cF, type ListMarketHoldersRequest as cG, type ListMarketPositionsRequest as cH, type ListMarketRewardsRequest as cI, type ListMarketsRequest as cJ, type ListOpenInterestRequest as cK, type ListOpenOrdersRequest as cL, type ListPositionsRequest as cM, type ListSeriesRequest as cN, type ListTagsRequest as cO, type ListTeamsRequest as cP, type ListTraderLeaderboardRequest as cQ, type ListTradesRequest as cR, type ListUserEarningsAndMarketsConfigRequest as cS, type ListUserEarningsForDayRequest as cT, type MarketEventType as cU, type MarketSubscription as cV, type MergePositionsWorkflow as cW, type MergePositionsWorkflowRequest as cX, type OrderDraft as cY, type OrderPostingWorkflow as cZ, type OrderWorkflow as c_, type FetchOrderRequest as ca, type FetchOrderScoringRequest as cb, type FetchOrdersScoringRequest as cc, type FetchPortfolioValueRequest as cd, type FetchPriceHistoryRequest as ce, type FetchPriceRequest as cf, type FetchPricesRequest as cg, type FetchPublicProfileRequest as ch, type FetchRelatedTagResourcesRequest as ci, type FetchRelatedTagsRequest as cj, type FetchSeriesRequest as ck, type FetchSpreadRequest as cl, type FetchSpreadsRequest as cm, type FetchTagRequest as cn, FetchTickSizeError as co, type FetchTickSizeRequest as cp, type FetchTotalEarningsForUserForDayRequest as cq, type FetchTradedMarketCountRequest as cr, GaslessTransactionMetadataSchema as cs, type GaslessWorkflow as ct, type GaslessWorkflowRequest as cu, type IsGaslessReadyRequest as cv, type ListAccountTradesRequest as cw, type ListActivityRequest as cx, type ListBuilderLeaderboardRequest as cy, type ListBuilderTradesRequest as cz, type AnalyticsActions as d, fetchEventLiveVolume as d$, type PostOrdersRequest as d0, PrepareErc1155ApprovalForAllError as d1, type PrepareErc1155ApprovalForAllRequest as d2, PrepareErc20ApprovalError as d3, type PrepareErc20ApprovalRequest as d4, PrepareErc20TransferError as d5, type PrepareErc20TransferRequest as d6, PrepareGaslessTransactionError as d7, type PrepareGaslessTransactionRequest as d8, type PrepareLimitOrderRequest as d9, type SportsEventType as dA, type SportsSubscription as dB, type SubscribeError as dC, type SubscriptionHandle as dD, type TradingApprovalsWorkflow as dE, type TradingApprovalsWorkflowRequest as dF, UpdateBalanceAllowanceError as dG, type UpdateBalanceAllowanceRequest as dH, type UserEventType as dI, type UserSubscription as dJ, WaitForGaslessTransactionError as dK, approveErc1155ForAll as dL, approveErc20 as dM, cancelAll as dN, cancelMarketOrders as dO, cancelOrder as dP, cancelOrders as dQ, deployDepositWallet as dR, downloadAccountingSnapshot as dS, dropNotifications as dT, estimateMarketPrice as dU, fetchBalanceAllowance as dV, fetchBuilderFeeRates as dW, fetchBuilderVolume as dX, fetchClosedOnlyMode as dY, fetchCommentsById as dZ, fetchEvent as d_, type PrepareMarketBuyOrderRequest as da, type PrepareMarketOrderRequest as db, type PrepareMarketSellOrderRequest as dc, PrepareMergePositionsError as dd, type PrepareMergePositionsRequest as de, PrepareRedeemPositionsError as df, type PrepareRedeemPositionsRequest as dg, PrepareSplitPositionError as dh, type PrepareSplitPositionRequest as di, PrepareTradingApprovalsError as dj, type PublicRealtimeEvent as dk, type PublicRealtimeTopic as dl, type PublicSubscriptionSpec as dm, type RedeemPositionsWorkflow as dn, type RedeemPositionsWorkflowRequest as dp, ResolveConditionByTokenError as dq, type ResolveConditionByTokenRequest as dr, type SearchRequest as ds, type SearchResults as dt, type SecureRealtimeEvent as du, type SecureRealtimeTopic as dv, type SecureSubscriptionSpec as dw, type SignedOrder as dx, type SplitPositionWorkflow as dy, type SplitPositionWorkflowRequest as dz, ApproveErc1155ForAllError as e, prepareMergePositions as e$, fetchEventTags as e0, fetchExecuteParams as e1, fetchLastTradePrice as e2, fetchLastTradePrices as e3, fetchMarket as e4, fetchMarketInfo as e5, fetchMarketTags as e6, fetchMidpoint as e7, fetchMidpoints as e8, fetchNegRisk as e9, listBuilderTrades as eA, listClosedPositions as eB, listComments as eC, listCommentsByUserAddress as eD, listCurrentRewards as eE, listEvents as eF, listMarketHolders as eG, listMarketPositions as eH, listMarketRewards as eI, listMarkets as eJ, listOpenInterest as eK, listOpenOrders as eL, listPositions as eM, listSeries as eN, listTags as eO, listTeams as eP, listTraderLeaderboard as eQ, listTrades as eR, listUserEarningsAndMarketsConfig as eS, listUserEarningsForDay as eT, mergePositions as eU, postOrder as eV, postOrders as eW, prepareErc1155ApprovalForAll as eX, prepareErc20Approval as eY, prepareErc20Transfer as eZ, prepareGaslessTransaction as e_, fetchNotifications as ea, fetchOrder as eb, fetchOrderBook as ec, fetchOrderBooks as ed, fetchOrderScoring as ee, fetchOrdersScoring as ef, fetchPortfolioValue as eg, fetchPrice as eh, fetchPriceHistory as ei, fetchPrices as ej, fetchPublicProfile as ek, fetchRelatedTagResources as el, fetchRelatedTags as em, fetchRewardPercentages as en, fetchSeries as eo, fetchSpread as ep, fetchSpreads as eq, fetchTag as er, fetchTickSize as es, fetchTotalEarningsForUserForDay as et, fetchTradedMarketCount as eu, fetchTransaction as ev, isGaslessReady as ew, listAccountTrades as ex, listActivity as ey, listBuilderLeaderboard as ez, ApproveErc20Error as f, prepareRedeemPositions as f0, prepareSplitPosition as f1, prepareTradingApprovals as f2, redeemPositions as f3, resolveConditionByToken as f4, search as f5, setupTradingApprovals as f6, splitPosition as f7, subscribe as f8, transferErc20 as f9, updateBalanceAllowance as fa, BasePublicClient as g, BaseSecureClient as h, 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, CreateSecureClientError as q, type DiscoveryActions as r, DownloadAccountingSnapshotError as s, DropNotificationsError as t, EstimateMarketPriceError as u, FetchCommentsByIdError as v, FetchEventError as w, FetchEventLiveVolumeError as x, FetchEventTagsError as y, FetchLastTradePriceError as z };
7434
+ 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, rfqActions 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, UpdatePerpsMarginError as bL, WaitForTransactionError as bM, type WalletDerivationConfig as bN, type WebSocketEndpoint as bO, accountActions as bP, allActions as bQ, analyticsActions as bR, createPublicClient as bS, createSecureClient as bT, dataActions as bU, discoveryActions as bV, forkEnvironmentConfig as bW, makeErrorGuard as bX, perpsActions as bY, production as bZ, rewardsActions 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 FetchPerpsInstrumentsRequest as c$, subscriptionsActions as c0, tradingActions as c1, walletActions as c2, type CancelMarketOrdersRequest as c3, type CancelOrderRequest as c4, type CancelOrdersRequest as c5, type CancelPerpsOrderRequest as c6, type CancelPerpsOrdersRequest as c7, type CommentsEventType as c8, type CommentsSubscription as c9, type FetchCommentsByIdRequest as cA, type FetchEventLiveVolumeRequest as cB, type FetchEventRequest as cC, type FetchEventTagsRequest as cD, FetchExecuteParamsError as cE, type FetchExecuteParamsRequest as cF, type FetchGaslessTransactionRequest as cG, type FetchLastTradePriceRequest as cH, type FetchLastTradePricesRequest as cI, FetchMarketInfoError as cJ, type FetchMarketInfoRequest as cK, type FetchMarketRequest as cL, type FetchMarketTagsRequest as cM, type FetchMidpointRequest as cN, type FetchMidpointsRequest as cO, FetchNegRiskError as cP, type FetchNegRiskRequest as cQ, type FetchOrderBookRequest as cR, type FetchOrderBooksRequest as cS, type FetchOrderRequest as cT, type FetchOrderScoringRequest as cU, type FetchOrdersScoringRequest as cV, type FetchPerpsAccountConfigRequest as cW, FetchPerpsBookError as cX, type FetchPerpsBookRequest as cY, FetchPerpsFeesError as cZ, FetchPerpsInstrumentsError as c_, type CreatePerpsSessionRequest as ca, type CryptoPricesEventType as cb, type CryptoPricesSubscription as cc, DeployDepositWalletError as cd, DepositToPerpsError as ce, type DepositToPerpsRequest as cf, type DeprecatedTransactionHandle as cg, type DownloadAccountingSnapshotRequest as ch, type DropNotificationsRequest as ci, type EquityPricesEventType as cj, type EquityPricesSubscription as ck, type Erc1155ApprovalForAllWorkflow as cl, type Erc1155ApprovalForAllWorkflowRequest as cm, type Erc20ApprovalWorkflow as cn, type Erc20ApprovalWorkflowRequest as co, type Erc20TransferWorkflow as cp, type Erc20TransferWorkflowRequest as cq, type EstimateMarketBuyPriceRequest as cr, type EstimateMarketPriceRequest as cs, type EstimateMarketSellPriceRequest as ct, type EventForSubscriptionSpec as cu, type EventForSubscriptionSpecs as cv, FetchBalanceAllowanceError as cw, type FetchBalanceAllowanceRequest as cx, FetchBuilderFeeRatesError as cy, type FetchBuilderFeeRatesRequest as cz, type AnalyticsActions as d, type ListUserEarningsAndMarketsConfigRequest as d$, type FetchPerpsOpenOrdersRequest as d0, type FetchPerpsOrdersRequest as d1, FetchPerpsTickerError as d2, type FetchPerpsTickerRequest as d3, FetchPerpsTickersError as d4, type FetchPerpsTickersRequest as d5, type FetchPortfolioValueRequest as d6, type FetchPriceHistoryRequest as d7, type FetchPriceRequest as d8, type FetchPricesRequest as d9, type ListCommentsRequest as dA, type ListCurrentRewardsRequest as dB, type ListEventsRequest as dC, type ListMarketHoldersRequest as dD, type ListMarketPositionsRequest as dE, type ListMarketRewardsRequest as dF, type ListMarketsRequest as dG, type ListOpenInterestRequest as dH, type ListOpenOrdersRequest as dI, ListPerpsCandlesError as dJ, type ListPerpsCandlesRequest as dK, type ListPerpsDepositsRequest as dL, type ListPerpsEquityHistoryRequest as dM, type ListPerpsFillsRequest as dN, ListPerpsFundingHistoryError as dO, type ListPerpsFundingHistoryRequest as dP, type ListPerpsFundingPaymentsRequest as dQ, type ListPerpsPnlHistoryRequest as dR, ListPerpsTradesError as dS, type ListPerpsTradesRequest as dT, type ListPerpsWithdrawalsRequest as dU, type ListPositionsRequest as dV, type ListSeriesRequest as dW, type ListTagsRequest as dX, type ListTeamsRequest as dY, type ListTraderLeaderboardRequest as dZ, type ListTradesRequest as d_, type FetchPublicProfileRequest as da, type FetchRelatedTagResourcesRequest as db, type FetchRelatedTagsRequest as dc, type FetchSeriesRequest as dd, type FetchSpreadRequest as de, type FetchSpreadsRequest as df, type FetchTagRequest as dg, FetchTickSizeError as dh, type FetchTickSizeRequest as di, type FetchTotalEarningsForUserForDayRequest as dj, type FetchTradedMarketCountRequest as dk, GaslessTransactionMetadataSchema as dl, type GaslessWorkflow as dm, type GaslessWorkflowRequest as dn, IsWalletDeployedError as dp, type IsWalletDeployedRequest as dq, type ListAccountTradesRequest as dr, type ListActivityRequest as ds, type ListBuilderLeaderboardRequest as dt, type ListBuilderTradesRequest as du, type ListBuilderVolumeRequest as dv, type ListClosedPositionsRequest as dw, type ListComboMarketsRequest as dx, type ListComboPositionsRequest as dy, type ListCommentsByUserAddressRequest as dz, ApproveErc1155ForAllError as e, type PrepareSplitPositionRequest as e$, type ListUserEarningsForDayRequest as e0, type MarketEventType as e1, type MarketSubscription as e2, MergeComboPositionError as e3, MergeMarketPositionError as e4, type MergePositionsWorkflow as e5, type MergePositionsWorkflowRequest as e6, OpenPerpsSessionError as e7, type OpenPerpsSessionRequest as e8, type OrderDraft as e9, type PrepareErc20TransferRequest as eA, PrepareGaslessTransactionError as eB, type PrepareGaslessTransactionRequest as eC, type PrepareLimitOrderRequest as eD, type PrepareMarketBuyOrderRequest as eE, type PrepareMarketOrderRequest as eF, type PrepareMarketSellOrderRequest as eG, PrepareMergeComboPositionError as eH, type PrepareMergeComboPositionRequest as eI, PrepareMergeMarketPositionError as eJ, type PrepareMergeMarketPositionRequest as eK, PrepareMergePositionsError as eL, type PrepareMergePositionsRequest as eM, PreparePerpsDepositError as eN, PrepareRedeemComboPositionError as eO, type PrepareRedeemComboPositionRequest as eP, type PrepareRedeemMarketPositionsByConditionIdRequest as eQ, type PrepareRedeemMarketPositionsByMarketIdRequest as eR, PrepareRedeemMarketPositionsError as eS, type PrepareRedeemMarketPositionsRequest as eT, PrepareRedeemPositionsError as eU, type PrepareRedeemPositionsRequest as eV, PrepareSplitComboPositionError as eW, type PrepareSplitComboPositionRequest as eX, PrepareSplitMarketPositionError as eY, type PrepareSplitMarketPositionRequest as eZ, PrepareSplitPositionError as e_, type OrderPostingWorkflow as ea, type OrderWorkflow as eb, type OrderWorkflowRequest as ec, type PerpsBboSubscription as ed, type PerpsBookDepth 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 PerpsPlaceFokOrderRequest as el, type PerpsPlaceGtcOrderRequest as em, type PerpsPlaceIocOrderRequest as en, type PerpsStatisticsSubscription as eo, type PerpsStreamingCandleInterval as ep, type PerpsTickersSubscription as eq, type PerpsTradesSubscription as er, type PlacePerpsOrderRequest as es, type PostOrdersRequest as et, type PostPerpsOrdersRequest as eu, PrepareErc1155ApprovalForAllError as ev, type PrepareErc1155ApprovalForAllRequest as ew, PrepareErc20ApprovalError as ex, type PrepareErc20ApprovalRequest as ey, PrepareErc20TransferError as ez, ApproveErc20Error as f, fetchMidpoint as f$, PrepareTradingApprovalsError as f0, type PublicRealtimeEvent as f1, type PublicRealtimeTopic as f2, type PublicSubscriptionSpec as f3, type RedeemPositionsWorkflow as f4, type RedeemPositionsWorkflowRequest as f5, ResolveConditionByTokenError as f6, type ResolveConditionByTokenRequest as f7, type ResumePerpsSessionRequest as f8, RevokePerpsCredentialsError as f9, WithdrawFromPerpsError as fA, type WithdrawFromPerpsRequest as fB, approveErc1155ForAll as fC, approveErc20 as fD, cancelAll as fE, cancelMarketOrders as fF, cancelOrder as fG, cancelOrders as fH, deployDepositWallet as fI, depositToPerps as fJ, downloadAccountingSnapshot as fK, dropNotifications as fL, estimateMarketPrice as fM, fetchBalanceAllowance as fN, fetchBuilderFeeRates as fO, fetchBuilderVolume as fP, fetchClosedOnlyMode as fQ, fetchCommentsById as fR, fetchEvent as fS, fetchEventLiveVolume as fT, fetchEventTags as fU, fetchExecuteParams as fV, fetchLastTradePrice as fW, fetchLastTradePrices as fX, fetchMarket as fY, fetchMarketInfo as fZ, fetchMarketTags as f_, type RevokePerpsCredentialsRequest as fa, type RfqConfirmationRejectedErrorOptions as fb, type RfqExecutionUpdateEvent as fc, type SearchRequest as fd, type SearchResults as fe, type SecureRealtimeEvent as ff, type SecureRealtimeTopic as fg, type SecureSubscriptionSpec as fh, type SignedOrder as fi, SplitComboPositionError as fj, SplitMarketPositionError as fk, type SplitPositionWorkflow as fl, type SplitPositionWorkflowRequest as fm, type SportsEventType as fn, type SportsSubscription as fo, type SubscribeError as fp, type SubscriptionHandle as fq, type TradingApprovalsWorkflow as fr, type TradingApprovalsWorkflowRequest as fs, UpdateBalanceAllowanceError as ft, type UpdateBalanceAllowanceRequest as fu, type UpdatePerpsLeverageRequest as fv, type UpdatePerpsMarginRequest as fw, type UserEventType as fx, type UserSubscription as fy, WaitForGaslessTransactionError as fz, BasePublicClient as g, postOrder as g$, fetchMidpoints as g0, fetchNegRisk as g1, fetchNotifications as g2, fetchOrder as g3, fetchOrderBook as g4, fetchOrderBooks as g5, fetchOrderScoring as g6, fetchOrdersScoring as g7, fetchPerpsBook as g8, fetchPerpsFees as g9, listComboPositions as gA, listComments as gB, listCommentsByUserAddress as gC, listCurrentRewards as gD, listEvents as gE, listMarketHolders as gF, listMarketPositions as gG, listMarketRewards as gH, listMarkets as gI, listOpenInterest as gJ, listOpenOrders as gK, listPerpsCandles as gL, listPerpsFundingHistory as gM, listPerpsTrades as gN, listPositions as gO, listSeries as gP, listTags as gQ, listTeams as gR, listTraderLeaderboard as gS, listTrades as gT, listUserEarningsAndMarketsConfig as gU, listUserEarningsForDay as gV, mergeComboPosition as gW, mergeMarketPosition as gX, mergePositions as gY, openPerpsSession as gZ, openRfqSession as g_, fetchPerpsInstruments as ga, fetchPerpsTicker as gb, fetchPerpsTickers as gc, fetchPortfolioValue as gd, fetchPrice as ge, fetchPriceHistory as gf, fetchPrices as gg, fetchPublicProfile as gh, fetchRelatedTagResources as gi, fetchRelatedTags as gj, fetchRewardPercentages as gk, fetchSeries as gl, fetchSpread as gm, fetchSpreads as gn, fetchTag as go, fetchTickSize as gp, fetchTotalEarningsForUserForDay as gq, fetchTradedMarketCount as gr, fetchTransaction as gs, isWalletDeployed as gt, listAccountTrades as gu, listActivity as gv, listBuilderLeaderboard as gw, listBuilderTrades as gx, listClosedPositions as gy, listComboMarkets as gz, BaseSecureClient as h, postOrders as h0, prepareErc1155ApprovalForAll as h1, prepareErc20Approval as h2, prepareErc20Transfer as h3, prepareGaslessTransaction as h4, prepareMergeComboPosition as h5, prepareMergeMarketPosition as h6, prepareMergePositions as h7, preparePerpsDeposit as h8, prepareRedeemComboPosition as h9, prepareRedeemMarketPositions as ha, prepareRedeemPositions as hb, prepareSplitComboPosition as hc, prepareSplitMarketPosition as hd, prepareSplitPosition as he, prepareTradingApprovals as hf, redeemPositions as hg, resolveConditionByToken as hh, revokePerpsCredentials as hi, search as hj, setupTradingApprovals as hk, splitComboPosition as hl, splitMarketPosition as hm, splitPosition as hn, subscribe as ho, transferErc20 as hp, updateBalanceAllowance as hq, withdrawFromPerps as hr, 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 };