@polymarket/client 0.1.0-beta.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/actions/index.d.ts +6 -6
- package/dist/actions/index.js +1 -1
- package/dist/chunk-3GYPYD7Z.js +2 -0
- package/dist/chunk-3GYPYD7Z.js.map +1 -0
- package/dist/chunk-FA3ZDOJN.js +2 -0
- package/dist/chunk-FA3ZDOJN.js.map +1 -0
- package/dist/chunk-TYJAXA3Y.js +6 -0
- package/dist/chunk-TYJAXA3Y.js.map +1 -0
- package/dist/ethers-v5.d.ts +2 -2
- package/dist/ethers-v5.js +1 -1
- package/dist/index.d.ts +14 -6
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/node.js +1 -1
- package/dist/privy.js +1 -1
- package/dist/{sports-BGrBawu_.d.ts → sports-CYYRGlQj.d.ts} +3 -3
- package/dist/{types-M1U0um0G.d.ts → types-vvy5wT5V.d.ts} +1787 -628
- package/dist/viem.d.ts +2 -2
- package/dist/viem.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-E2CLUN5M.js +0 -6
- package/dist/chunk-E2CLUN5M.js.map +0 -1
- package/dist/chunk-FSNACMPO.js +0 -2
- package/dist/chunk-FSNACMPO.js.map +0 -1
- package/dist/chunk-NTEPEJZK.js +0 -2
- package/dist/chunk-NTEPEJZK.js.map +0 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import * as _polymarket_bindings from '@polymarket/bindings';
|
|
2
|
-
import { PaginationCursor, OrderSide, OrderType, TokenId, BuilderCode, EvmAddress as EvmAddress$1, CtfConditionId, TickSizeValue,
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { WalletType, Event, TagReference, Market, Series, Tag, RelatedTag, SportsMetadata, SportsMarketTypesResponse, Team, PublicProfile, Comment, Profile, SearchTag } from '@polymarket/bindings/gamma';
|
|
2
|
+
import { PaginationCursor, DecimalString, OrderSide, OrderType, TokenId, BuilderCode, TxHash, EvmAddress as EvmAddress$1, CtfConditionId, TickSizeValue, PositionId, TransactionId } from '@polymarket/bindings';
|
|
3
|
+
import { PolymarketError, HexString, EvmAddress, EvmSignature, NonEmptyArray, Prettify, Erc1271Signature, TxHash as TxHash$1 } from '@polymarket/types';
|
|
4
|
+
import { WalletType, Event, TagReference, Market, Series, MarketClarification, Tag, RelatedTag, SportsMetadata, SportsMarketTypesResponse, Team, PublicProfile, Comment, MarketClarificationState, Profile, SearchTag } from '@polymarket/bindings/gamma';
|
|
6
5
|
import { RelayerTransactionType, RelayerExecuteParams, GaslessTransaction } from '@polymarket/bindings/relayer';
|
|
7
6
|
import { ZodError, z } from 'zod';
|
|
8
7
|
import * as _polymarket_bindings_clob from '@polymarket/bindings/clob';
|
|
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';
|
|
8
|
+
import { ClobTrade, NotificationsResponse, BuilderTrade, Midpoints, Prices, OrderBook, Spreads, LastTradePrice, LastTradePriceForToken, PriceHistoryPoint, CurrentReward, MarketReward, OrdersScoringResponse, UserEarning, TotalUserEarning, UserRewardsEarning, RewardsPercentages, CancelOrdersResponse, SignatureType, OrderResponse, OrderResponses, AcceptedOrderResponse, OpenOrder, ApiKeyCreds, BalanceAllowanceResponse, BuilderFeeRates, MarketInfo } from '@polymarket/bindings/clob';
|
|
10
9
|
import * as _polymarket_bindings_data from '@polymarket/bindings/data';
|
|
11
|
-
import { Value, Traded, ClosedPosition, ComboPosition, Position, MetaMarketPosition,
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { PerpsInstrument, PerpsTicker, PerpsBook, PerpsCandle, PerpsFundingRate, PerpsPublicTrade, PerpsFeeScheduleEntry, PerpsWithdrawalId,
|
|
10
|
+
import { Activity, ComboActivity, Trade, Value, Traded, ClosedPosition, ComboPosition, Position, MetaMarketPosition, LeaderboardEntry, BuilderVolumeEntry, TraderLeaderboardEntry, LiveVolume, OpenInterest, MetaHolder } from '@polymarket/bindings/data';
|
|
11
|
+
import * as _polymarket_bindings_combos from '@polymarket/bindings/combos';
|
|
12
|
+
import { ComboMarket, RfqQuoteRequest, RfqRequestedSize, RfqSide, RfqQuoteAck, RfqConfirmationRequest, RfqConfirmationAck as RfqConfirmationAck$1, RfqExecutionUpdate, RfqTrade, RfqQuoteCancelAck, RfqErrorCode, RfqId, RfqQuoteId, CollateralReturnPlanResponse } from '@polymarket/bindings/combos';
|
|
13
|
+
import { PerpsInstrument, PerpsTicker, PerpsBook, PerpsCandle, PerpsFundingRate, PerpsPublicTrade, PerpsFeeScheduleEntry, PerpsWithdrawalId, PerpsDepositStatus, PerpsWithdrawalStatus, PerpsPnlInterval, PerpsDecimalInput, PerpsTimeInForce, PerpsCredentials, PerpsBalance, PerpsPortfolio, PerpsAccountStats, PerpsAccountConfig, PerpsOrder, PerpsAccountFill, PerpsAccountFundingPayment, PerpsDeposit, PerpsWithdrawal, PerpsEquityPoint, PerpsPnlPoint, PerpsOrderId, PerpsPostOrderAck, PerpsCancelOrderResult, PerpsUpdateLeverageResult, PerpsInstrumentCategory, PerpsKlineInterval } from '@polymarket/bindings/perps';
|
|
15
14
|
import { PerpsSessionEvent, CommentsEvent, CryptoPricesTopic, EquityPricesTopic, EquityPricesEvent, MarketEvent, StandardMarketEvent, UserEvent, SportsEvent, CryptoPricesBinanceEvent, CryptoPricesChainlinkEvent, PerpsTradeEvent, PerpsBboEvent, PerpsBookEvent, PerpsCandleEvent, PerpsTickerEvent, PerpsStatisticEvent, CryptoPricesEvent, PerpsMarketDataEvent } from '@polymarket/bindings/subscriptions';
|
|
16
15
|
import { Hex } from 'ox';
|
|
17
16
|
|
|
@@ -46,6 +45,48 @@ declare class TransportError extends PolymarketError {
|
|
|
46
45
|
constructor(message: string, options?: ErrorOptions);
|
|
47
46
|
static fromError(error: unknown): TransportError;
|
|
48
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* WebSocket close codes defined by RFC 6455 and the IANA WebSocket Close Code
|
|
50
|
+
* Number registry. Codes 4000-4999 are reserved for application use and are
|
|
51
|
+
* intentionally not modeled here.
|
|
52
|
+
*/
|
|
53
|
+
declare enum WebSocketKnownCloseCode {
|
|
54
|
+
NormalClosure = 1000,
|
|
55
|
+
GoingAway = 1001,
|
|
56
|
+
ProtocolError = 1002,
|
|
57
|
+
UnsupportedData = 1003,
|
|
58
|
+
/** Synthesized locally when the peer closed without a status code. */
|
|
59
|
+
NoStatusReceived = 1005,
|
|
60
|
+
/** Synthesized locally when the connection dropped without a close frame. */
|
|
61
|
+
AbnormalClosure = 1006,
|
|
62
|
+
InvalidFramePayload = 1007,
|
|
63
|
+
PolicyViolation = 1008,
|
|
64
|
+
MessageTooBig = 1009,
|
|
65
|
+
InternalError = 1011,
|
|
66
|
+
ServiceRestart = 1012,
|
|
67
|
+
TryAgainLater = 1013
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A WebSocket close code. Codes enumerated in
|
|
71
|
+
* {@link WebSocketKnownCloseCode} are defined by RFC 6455; other values, such
|
|
72
|
+
* as application-defined 4000-4999 codes, flow through as plain numbers.
|
|
73
|
+
*/
|
|
74
|
+
type WebSocketCloseCode = WebSocketKnownCloseCode | (number & {});
|
|
75
|
+
type ConnectionLostErrorOptions = {
|
|
76
|
+
/** WebSocket close code reported for the lost connection. */
|
|
77
|
+
code: WebSocketCloseCode;
|
|
78
|
+
/** Close reason provided by the peer. Empty when none was sent. */
|
|
79
|
+
reason: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Error thrown when a live connection ends without the SDK requesting it.
|
|
83
|
+
*/
|
|
84
|
+
declare class ConnectionLostError extends PolymarketError {
|
|
85
|
+
name: "ConnectionLostError";
|
|
86
|
+
readonly code: WebSocketCloseCode;
|
|
87
|
+
readonly reason: string;
|
|
88
|
+
constructor(message: string, options: ErrorOptions & ConnectionLostErrorOptions);
|
|
89
|
+
}
|
|
49
90
|
type RequestRejectedErrorOptions = {
|
|
50
91
|
status: number;
|
|
51
92
|
};
|
|
@@ -123,6 +164,9 @@ type SendErc20TransferTransactionRequest = {
|
|
|
123
164
|
kind: 'sendErc20TransferTransaction';
|
|
124
165
|
request: SignerTransactionRequest;
|
|
125
166
|
};
|
|
167
|
+
/**
|
|
168
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
169
|
+
*/
|
|
126
170
|
type SendPerpsDepositTransactionRequest = {
|
|
127
171
|
kind: 'sendPerpsDepositTransaction';
|
|
128
172
|
request: SignerTransactionRequest;
|
|
@@ -271,6 +315,13 @@ declare const WaitForGaslessTransactionError: {
|
|
|
271
315
|
declare const PageSizeSchema: z.ZodNumber;
|
|
272
316
|
type Page<T> = {
|
|
273
317
|
items: T;
|
|
318
|
+
/**
|
|
319
|
+
* Whether another page may be available.
|
|
320
|
+
*
|
|
321
|
+
* On methods without a server-provided continuation signal, a full page
|
|
322
|
+
* reports `true` and the follow-up request returns an empty final page when
|
|
323
|
+
* the collection ended exactly on a page boundary.
|
|
324
|
+
*/
|
|
274
325
|
hasMore: boolean;
|
|
275
326
|
nextCursor?: PaginationCursor;
|
|
276
327
|
totalCount?: number;
|
|
@@ -280,75 +331,208 @@ type Paginated<T> = AsyncIterable<Page<T>> & {
|
|
|
280
331
|
from(cursor?: PaginationCursor): Paginated<T>;
|
|
281
332
|
};
|
|
282
333
|
|
|
283
|
-
declare const
|
|
284
|
-
cursor: z.ZodOptional<z.
|
|
285
|
-
|
|
334
|
+
declare const ListTradesRequestSchema: z.ZodObject<{
|
|
335
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
336
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
337
|
+
takerOnly: z.ZodOptional<z.ZodBoolean>;
|
|
338
|
+
filterType: z.ZodOptional<z.ZodEnum<{
|
|
339
|
+
CASH: "CASH";
|
|
340
|
+
TOKENS: "TOKENS";
|
|
341
|
+
}>>;
|
|
342
|
+
filterAmount: z.ZodOptional<z.ZodNumber>;
|
|
286
343
|
market: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
287
344
|
eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
345
|
+
user: z.ZodOptional<z.ZodString>;
|
|
346
|
+
side: z.ZodOptional<z.ZodEnum<{
|
|
347
|
+
BUY: "BUY";
|
|
348
|
+
SELL: "SELL";
|
|
349
|
+
}>>;
|
|
350
|
+
start: z.ZodOptional<z.ZodNumber>;
|
|
351
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
352
|
+
}, z.core.$strip>;
|
|
353
|
+
type ListTradesRequest = z.input<typeof ListTradesRequestSchema>;
|
|
354
|
+
type ListTradesError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
355
|
+
declare const ListTradesError: {
|
|
356
|
+
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
357
|
+
};
|
|
358
|
+
/**
|
|
359
|
+
* Lists trades for a wallet, market, or event.
|
|
360
|
+
*
|
|
361
|
+
* @remarks
|
|
362
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
363
|
+
*
|
|
364
|
+
* @throws {@link ListTradesError}
|
|
365
|
+
* Thrown on failure.
|
|
366
|
+
*
|
|
367
|
+
* @example
|
|
368
|
+
* Fetch the first page of results:
|
|
369
|
+
* ```ts
|
|
370
|
+
* const result = listTrades(client, {
|
|
371
|
+
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
372
|
+
* pageSize: 10,
|
|
373
|
+
* });
|
|
374
|
+
*
|
|
375
|
+
* const firstPage = await result.firstPage();
|
|
376
|
+
*
|
|
377
|
+
* // Optionally, fetch additional pages:
|
|
378
|
+
* for await (const page of result.from(firstPage.nextCursor)) {
|
|
379
|
+
* // page.items: Trade[]
|
|
380
|
+
* }
|
|
381
|
+
* ```
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* Loop through all pages with `for await`:
|
|
385
|
+
* ```ts
|
|
386
|
+
* const result = listTrades(client, {
|
|
387
|
+
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
388
|
+
* pageSize: 10,
|
|
389
|
+
* });
|
|
390
|
+
*
|
|
391
|
+
* for await (const page of result) {
|
|
392
|
+
* // page.items: Trade[]
|
|
393
|
+
* }
|
|
394
|
+
* ```
|
|
395
|
+
*/
|
|
396
|
+
declare function listTrades(client: BaseClient, request?: ListTradesRequest): Paginated<Trade[]>;
|
|
397
|
+
declare const ListActivityRequestSchema: z.ZodObject<{
|
|
398
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
291
399
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
400
|
+
user: z.ZodString;
|
|
401
|
+
market: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
402
|
+
eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
403
|
+
type: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof _polymarket_bindings_data.ActivityType>>>;
|
|
404
|
+
start: z.ZodOptional<z.ZodNumber>;
|
|
405
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
292
406
|
sortBy: z.ZodOptional<z.ZodEnum<{
|
|
293
|
-
|
|
294
|
-
INITIAL: "INITIAL";
|
|
407
|
+
CASH: "CASH";
|
|
295
408
|
TOKENS: "TOKENS";
|
|
296
|
-
|
|
297
|
-
PERCENTPNL: "PERCENTPNL";
|
|
298
|
-
TITLE: "TITLE";
|
|
299
|
-
RESOLVING: "RESOLVING";
|
|
300
|
-
PRICE: "PRICE";
|
|
301
|
-
AVGPRICE: "AVGPRICE";
|
|
409
|
+
TIMESTAMP: "TIMESTAMP";
|
|
302
410
|
}>>;
|
|
303
411
|
sortDirection: z.ZodOptional<z.ZodEnum<{
|
|
304
412
|
ASC: "ASC";
|
|
305
413
|
DESC: "DESC";
|
|
306
414
|
}>>;
|
|
307
|
-
|
|
415
|
+
side: z.ZodOptional<z.ZodEnum<{
|
|
416
|
+
BUY: "BUY";
|
|
417
|
+
SELL: "SELL";
|
|
418
|
+
}>>;
|
|
308
419
|
}, z.core.$strip>;
|
|
309
|
-
|
|
310
|
-
|
|
420
|
+
type ListActivityRequest = z.input<typeof ListActivityRequestSchema>;
|
|
421
|
+
type ListActivityError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
422
|
+
declare const ListActivityError: {
|
|
423
|
+
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
424
|
+
};
|
|
425
|
+
/**
|
|
426
|
+
* Lists wallet activity.
|
|
427
|
+
*
|
|
428
|
+
* @remarks
|
|
429
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
430
|
+
*
|
|
431
|
+
* @throws {@link ListActivityError}
|
|
432
|
+
* Thrown on failure.
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* Fetch the first page of results:
|
|
436
|
+
* ```ts
|
|
437
|
+
* const result = listActivity(client, {
|
|
438
|
+
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
439
|
+
* pageSize: 10,
|
|
440
|
+
* });
|
|
441
|
+
*
|
|
442
|
+
* const firstPage = await result.firstPage();
|
|
443
|
+
*
|
|
444
|
+
* // Optionally, fetch additional pages:
|
|
445
|
+
* for await (const page of result.from(firstPage.nextCursor)) {
|
|
446
|
+
* // page.items: Activity[]
|
|
447
|
+
* }
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* Loop through all pages with `for await`:
|
|
452
|
+
* ```ts
|
|
453
|
+
* const result = listActivity(client, {
|
|
454
|
+
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
455
|
+
* pageSize: 10,
|
|
456
|
+
* });
|
|
457
|
+
*
|
|
458
|
+
* for await (const page of result) {
|
|
459
|
+
* // page.items: Activity[]
|
|
460
|
+
* }
|
|
461
|
+
* ```
|
|
462
|
+
*/
|
|
463
|
+
declare function listActivity(client: BaseClient, request: ListActivityRequest): Paginated<Activity[]>;
|
|
464
|
+
declare const ListComboActivityRequestSchema: z.ZodObject<{
|
|
465
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
466
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
467
|
+
user: z.ZodString;
|
|
468
|
+
conditionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.ComboConditionId, string>>, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.ComboConditionId, string>>>]>>;
|
|
469
|
+
}, z.core.$strip>;
|
|
470
|
+
type ListComboActivityRequest = z.input<typeof ListComboActivityRequestSchema>;
|
|
471
|
+
type ListComboActivityError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
472
|
+
declare const ListComboActivityError: {
|
|
473
|
+
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* Lists combo lifecycle activity for a wallet.
|
|
477
|
+
*
|
|
478
|
+
* @remarks
|
|
479
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
480
|
+
*
|
|
481
|
+
* @throws {@link ListComboActivityError}
|
|
482
|
+
* Thrown on failure.
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* Fetch the first page of results:
|
|
486
|
+
* ```ts
|
|
487
|
+
* const result = listComboActivity(client, {
|
|
488
|
+
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
489
|
+
* pageSize: 10,
|
|
490
|
+
* });
|
|
491
|
+
*
|
|
492
|
+
* const firstPage = await result.firstPage();
|
|
493
|
+
*
|
|
494
|
+
* // Optionally, fetch additional pages:
|
|
495
|
+
* for await (const page of result.from(firstPage.nextCursor)) {
|
|
496
|
+
* // page.items: ComboActivity[]
|
|
497
|
+
* }
|
|
498
|
+
* ```
|
|
499
|
+
*/
|
|
500
|
+
declare function listComboActivity(client: BaseClient, request: ListComboActivityRequest): Paginated<ComboActivity[]>;
|
|
501
|
+
|
|
502
|
+
declare enum ComboPositionSort {
|
|
503
|
+
CurrentValueDesc = "current_value_desc",
|
|
504
|
+
FirstEntryDesc = "first_entry_desc",
|
|
505
|
+
EntryCostDesc = "entry_cost_desc",
|
|
506
|
+
ResolvedAtDesc = "resolved_at_desc",
|
|
507
|
+
UpdatedAsc = "updated_asc"
|
|
508
|
+
}
|
|
509
|
+
declare const ListPositionsRequestSchema: z.ZodObject<{
|
|
510
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
311
511
|
user: z.ZodString;
|
|
312
512
|
market: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
313
|
-
title: z.ZodOptional<z.ZodString>;
|
|
314
513
|
eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
514
|
+
sizeThreshold: z.ZodOptional<z.ZodNumber>;
|
|
515
|
+
redeemable: z.ZodOptional<z.ZodBoolean>;
|
|
516
|
+
mergeable: z.ZodOptional<z.ZodBoolean>;
|
|
315
517
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
316
518
|
sortBy: z.ZodOptional<z.ZodEnum<{
|
|
519
|
+
TOKENS: "TOKENS";
|
|
520
|
+
CURRENT: "CURRENT";
|
|
521
|
+
INITIAL: "INITIAL";
|
|
522
|
+
CASHPNL: "CASHPNL";
|
|
523
|
+
PERCENTPNL: "PERCENTPNL";
|
|
317
524
|
TITLE: "TITLE";
|
|
525
|
+
RESOLVING: "RESOLVING";
|
|
318
526
|
PRICE: "PRICE";
|
|
319
527
|
AVGPRICE: "AVGPRICE";
|
|
320
|
-
REALIZEDPNL: "REALIZEDPNL";
|
|
321
|
-
TIMESTAMP: "TIMESTAMP";
|
|
322
528
|
}>>;
|
|
323
529
|
sortDirection: z.ZodOptional<z.ZodEnum<{
|
|
324
530
|
ASC: "ASC";
|
|
325
531
|
DESC: "DESC";
|
|
326
532
|
}>>;
|
|
327
|
-
|
|
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;
|
|
533
|
+
title: z.ZodOptional<z.ZodString>;
|
|
345
534
|
}, z.core.$strip>;
|
|
346
535
|
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
536
|
type ListPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
353
537
|
declare const ListPositionsError: {
|
|
354
538
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
@@ -392,14 +576,30 @@ declare const ListPositionsError: {
|
|
|
392
576
|
* ```
|
|
393
577
|
*/
|
|
394
578
|
declare function listPositions(client: BaseClient, request: ListPositionsRequest): Paginated<Position[]>;
|
|
579
|
+
declare const ListClosedPositionsRequestSchema: z.ZodObject<{
|
|
580
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
581
|
+
user: z.ZodString;
|
|
582
|
+
market: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
583
|
+
title: z.ZodOptional<z.ZodString>;
|
|
584
|
+
eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
585
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
586
|
+
sortBy: z.ZodOptional<z.ZodEnum<{
|
|
587
|
+
TIMESTAMP: "TIMESTAMP";
|
|
588
|
+
TITLE: "TITLE";
|
|
589
|
+
PRICE: "PRICE";
|
|
590
|
+
AVGPRICE: "AVGPRICE";
|
|
591
|
+
REALIZEDPNL: "REALIZEDPNL";
|
|
592
|
+
}>>;
|
|
593
|
+
sortDirection: z.ZodOptional<z.ZodEnum<{
|
|
594
|
+
ASC: "ASC";
|
|
595
|
+
DESC: "DESC";
|
|
596
|
+
}>>;
|
|
597
|
+
}, z.core.$strip>;
|
|
598
|
+
type ListClosedPositionsRequest = z.input<typeof ListClosedPositionsRequestSchema>;
|
|
395
599
|
type ListClosedPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
396
600
|
declare const ListClosedPositionsError: {
|
|
397
601
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
398
602
|
};
|
|
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
603
|
/**
|
|
404
604
|
* Lists closed positions for a wallet.
|
|
405
605
|
*
|
|
@@ -439,6 +639,21 @@ declare const ListComboPositionsError: {
|
|
|
439
639
|
* ```
|
|
440
640
|
*/
|
|
441
641
|
declare function listClosedPositions(client: BaseClient, request: ListClosedPositionsRequest): Paginated<ClosedPosition[]>;
|
|
642
|
+
declare const ListComboPositionsRequestSchema: z.ZodObject<{
|
|
643
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
644
|
+
user: z.ZodString;
|
|
645
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
646
|
+
status: z.ZodOptional<z.ZodEnum<typeof _polymarket_bindings_data.ComboPositionStatus>>;
|
|
647
|
+
sort: z.ZodOptional<z.ZodEnum<typeof ComboPositionSort>>;
|
|
648
|
+
conditionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.ComboConditionId, string>>, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.ComboConditionId, string>>>]>>;
|
|
649
|
+
updatedAfter: z.ZodOptional<z.ZodNumber>;
|
|
650
|
+
updatedBefore: z.ZodOptional<z.ZodNumber>;
|
|
651
|
+
}, z.core.$strip>;
|
|
652
|
+
type ListComboPositionsRequest = z.input<typeof ListComboPositionsRequestSchema>;
|
|
653
|
+
type ListComboPositionsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
654
|
+
declare const ListComboPositionsError: {
|
|
655
|
+
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
656
|
+
};
|
|
442
657
|
/**
|
|
443
658
|
* Lists combo positions for a wallet.
|
|
444
659
|
*
|
|
@@ -472,8 +687,24 @@ declare function listClosedPositions(client: BaseClient, request: ListClosedPosi
|
|
|
472
687
|
* status: ComboPositionStatus.Open,
|
|
473
688
|
* });
|
|
474
689
|
* ```
|
|
690
|
+
*
|
|
691
|
+
* @example
|
|
692
|
+
* Incrementally sync changed combo positions:
|
|
693
|
+
* ```ts
|
|
694
|
+
* const result = listComboPositions(client, {
|
|
695
|
+
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
696
|
+
* updatedAfter: 1_797_360_000,
|
|
697
|
+
* sort: ComboPositionSort.UpdatedAsc,
|
|
698
|
+
* pageSize: 1000,
|
|
699
|
+
* });
|
|
700
|
+
* ```
|
|
475
701
|
*/
|
|
476
702
|
declare function listComboPositions(client: BaseClient, request: ListComboPositionsRequest): Paginated<ComboPosition[]>;
|
|
703
|
+
declare const FetchPortfolioValueRequestSchema: z.ZodObject<{
|
|
704
|
+
user: z.ZodString;
|
|
705
|
+
market: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
706
|
+
}, z.core.$strip>;
|
|
707
|
+
type FetchPortfolioValueRequest = z.input<typeof FetchPortfolioValueRequestSchema>;
|
|
477
708
|
type FetchPortfolioValueError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
478
709
|
declare const FetchPortfolioValueError: {
|
|
479
710
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
@@ -497,6 +728,10 @@ declare const FetchPortfolioValueError: {
|
|
|
497
728
|
* ```
|
|
498
729
|
*/
|
|
499
730
|
declare function fetchPortfolioValue(client: BaseClient, request: FetchPortfolioValueRequest): Promise<Value[]>;
|
|
731
|
+
declare const FetchTradedMarketCountRequestSchema: z.ZodObject<{
|
|
732
|
+
user: z.ZodString;
|
|
733
|
+
}, z.core.$strip>;
|
|
734
|
+
type FetchTradedMarketCountRequest = z.input<typeof FetchTradedMarketCountRequestSchema>;
|
|
500
735
|
type FetchTradedMarketCountError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
501
736
|
declare const FetchTradedMarketCountError: {
|
|
502
737
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
@@ -520,6 +755,10 @@ declare const FetchTradedMarketCountError: {
|
|
|
520
755
|
* ```
|
|
521
756
|
*/
|
|
522
757
|
declare function fetchTradedMarketCount(client: BaseClient, request: FetchTradedMarketCountRequest): Promise<Traded>;
|
|
758
|
+
declare const DownloadAccountingSnapshotRequestSchema: z.ZodObject<{
|
|
759
|
+
user: z.ZodString;
|
|
760
|
+
}, z.core.$strip>;
|
|
761
|
+
type DownloadAccountingSnapshotRequest = z.input<typeof DownloadAccountingSnapshotRequestSchema>;
|
|
523
762
|
type DownloadAccountingSnapshotError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
524
763
|
declare const DownloadAccountingSnapshotError: {
|
|
525
764
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
@@ -561,6 +800,7 @@ type SecureFetchPortfolioValueRequest = DefaultAccountWallet<FetchPortfolioValue
|
|
|
561
800
|
type SecureFetchTradedMarketCountRequest = DefaultAccountWallet<FetchTradedMarketCountRequest>;
|
|
562
801
|
type SecureDownloadAccountingSnapshotRequest = DefaultAccountWallet<DownloadAccountingSnapshotRequest>;
|
|
563
802
|
type SecureListActivityRequest = DefaultAccountWallet<ListActivityRequest>;
|
|
803
|
+
type SecureListComboActivityRequest = DefaultAccountWallet<ListComboActivityRequest>;
|
|
564
804
|
type CommonAccountActions = {
|
|
565
805
|
/**
|
|
566
806
|
* Lists positions for a market.
|
|
@@ -768,6 +1008,24 @@ type PublicAccountActions = Prettify<CommonAccountActions & {
|
|
|
768
1008
|
* ```
|
|
769
1009
|
*/
|
|
770
1010
|
listActivity(request: ListActivityRequest): Paginated<Activity[]>;
|
|
1011
|
+
/**
|
|
1012
|
+
* Lists combo lifecycle activity for a wallet.
|
|
1013
|
+
*
|
|
1014
|
+
* @throws {@link ListComboActivityError}
|
|
1015
|
+
* Thrown on failure.
|
|
1016
|
+
*
|
|
1017
|
+
* @example
|
|
1018
|
+
* Fetch the first page of results:
|
|
1019
|
+
* ```ts
|
|
1020
|
+
* const paginator = client.listComboActivity({
|
|
1021
|
+
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
1022
|
+
* pageSize: 10,
|
|
1023
|
+
* });
|
|
1024
|
+
*
|
|
1025
|
+
* const firstPage = await paginator.firstPage();
|
|
1026
|
+
* ```
|
|
1027
|
+
*/
|
|
1028
|
+
listComboActivity(request: ListComboActivityRequest): Paginated<ComboActivity[]>;
|
|
771
1029
|
}>;
|
|
772
1030
|
type SecureAccountActions = Prettify<CommonAccountActions & {
|
|
773
1031
|
/**
|
|
@@ -843,6 +1101,15 @@ type SecureAccountActions = Prettify<CommonAccountActions & {
|
|
|
843
1101
|
* Thrown on failure.
|
|
844
1102
|
*/
|
|
845
1103
|
listActivity(request?: SecureListActivityRequest): Paginated<Activity[]>;
|
|
1104
|
+
/**
|
|
1105
|
+
* Lists combo lifecycle activity for a wallet.
|
|
1106
|
+
*
|
|
1107
|
+
* Defaults to the authenticated account's wallet when `user` is omitted.
|
|
1108
|
+
*
|
|
1109
|
+
* @throws {@link ListComboActivityError}
|
|
1110
|
+
* Thrown on failure.
|
|
1111
|
+
*/
|
|
1112
|
+
listComboActivity(request?: SecureListComboActivityRequest): Paginated<ComboActivity[]>;
|
|
846
1113
|
/**
|
|
847
1114
|
* Lists trades for the authenticated account across all pages.
|
|
848
1115
|
*
|
|
@@ -1060,7 +1327,7 @@ type DataActions = {
|
|
|
1060
1327
|
*/
|
|
1061
1328
|
fetchEventLiveVolume(request: FetchEventLiveVolumeRequest): Promise<LiveVolume[]>;
|
|
1062
1329
|
/**
|
|
1063
|
-
* Fetches the midpoint price for a token.
|
|
1330
|
+
* Fetches the midpoint price for a token as a decimal string.
|
|
1064
1331
|
*
|
|
1065
1332
|
* @throws {@link FetchMidpointError}
|
|
1066
1333
|
* Thrown on failure.
|
|
@@ -1070,9 +1337,9 @@ type DataActions = {
|
|
|
1070
1337
|
* const midpoint = await client.fetchMidpoint({ tokenId: '123' });
|
|
1071
1338
|
* ```
|
|
1072
1339
|
*/
|
|
1073
|
-
fetchMidpoint(request: FetchMidpointRequest): Promise<
|
|
1340
|
+
fetchMidpoint(request: FetchMidpointRequest): Promise<DecimalString>;
|
|
1074
1341
|
/**
|
|
1075
|
-
* Fetches midpoint prices for multiple tokens.
|
|
1342
|
+
* Fetches midpoint prices for multiple tokens as a token ID keyed lookup.
|
|
1076
1343
|
*
|
|
1077
1344
|
* @throws {@link FetchMidpointsError}
|
|
1078
1345
|
* Thrown on failure.
|
|
@@ -1082,9 +1349,9 @@ type DataActions = {
|
|
|
1082
1349
|
* const midpoints = await client.fetchMidpoints([{ tokenId: '123' }]);
|
|
1083
1350
|
* ```
|
|
1084
1351
|
*/
|
|
1085
|
-
fetchMidpoints(request: FetchMidpointsRequest): Promise<
|
|
1352
|
+
fetchMidpoints(request: FetchMidpointsRequest): Promise<Midpoints>;
|
|
1086
1353
|
/**
|
|
1087
|
-
* Fetches the current quoted price for a token and side.
|
|
1354
|
+
* Fetches the current quoted price for a token and side as a decimal string.
|
|
1088
1355
|
*
|
|
1089
1356
|
* @throws {@link FetchPriceError}
|
|
1090
1357
|
* Thrown on failure.
|
|
@@ -1094,9 +1361,9 @@ type DataActions = {
|
|
|
1094
1361
|
* const price = await client.fetchPrice({ tokenId: '123', side: OrderSide.BUY });
|
|
1095
1362
|
* ```
|
|
1096
1363
|
*/
|
|
1097
|
-
fetchPrice(request: FetchPriceRequest): Promise<
|
|
1364
|
+
fetchPrice(request: FetchPriceRequest): Promise<DecimalString>;
|
|
1098
1365
|
/**
|
|
1099
|
-
* Fetches quoted prices for multiple tokens.
|
|
1366
|
+
* Fetches quoted prices for multiple tokens as a token ID keyed lookup.
|
|
1100
1367
|
*
|
|
1101
1368
|
* @throws {@link FetchPricesError}
|
|
1102
1369
|
* Thrown on failure.
|
|
@@ -1132,7 +1399,7 @@ type DataActions = {
|
|
|
1132
1399
|
*/
|
|
1133
1400
|
fetchOrderBooks(request: FetchOrderBooksRequest): Promise<OrderBook[]>;
|
|
1134
1401
|
/**
|
|
1135
|
-
* Fetches the spread for a token.
|
|
1402
|
+
* Fetches the spread for a token as a decimal string.
|
|
1136
1403
|
*
|
|
1137
1404
|
* @throws {@link FetchSpreadError}
|
|
1138
1405
|
* Thrown on failure.
|
|
@@ -1142,9 +1409,9 @@ type DataActions = {
|
|
|
1142
1409
|
* const spread = await client.fetchSpread({ tokenId: '123' });
|
|
1143
1410
|
* ```
|
|
1144
1411
|
*/
|
|
1145
|
-
fetchSpread(request: FetchSpreadRequest): Promise<
|
|
1412
|
+
fetchSpread(request: FetchSpreadRequest): Promise<DecimalString>;
|
|
1146
1413
|
/**
|
|
1147
|
-
* Fetches spreads for multiple tokens.
|
|
1414
|
+
* Fetches spreads for multiple tokens as a token ID keyed lookup.
|
|
1148
1415
|
*
|
|
1149
1416
|
* @throws {@link FetchSpreadsError}
|
|
1150
1417
|
* Thrown on failure.
|
|
@@ -1154,7 +1421,7 @@ type DataActions = {
|
|
|
1154
1421
|
* const spreads = await client.fetchSpreads([{ tokenId: '123' }]);
|
|
1155
1422
|
* ```
|
|
1156
1423
|
*/
|
|
1157
|
-
fetchSpreads(request: FetchSpreadsRequest): Promise<
|
|
1424
|
+
fetchSpreads(request: FetchSpreadsRequest): Promise<Spreads>;
|
|
1158
1425
|
/**
|
|
1159
1426
|
* Fetches the last traded price for a token.
|
|
1160
1427
|
*
|
|
@@ -1524,6 +1791,25 @@ type DiscoveryActions = {
|
|
|
1524
1791
|
* ```
|
|
1525
1792
|
*/
|
|
1526
1793
|
fetchSeries(request: FetchSeriesRequest): Promise<Series>;
|
|
1794
|
+
/**
|
|
1795
|
+
* Lists market clarifications — notes that resolve ambiguity in how a market
|
|
1796
|
+
* settles.
|
|
1797
|
+
*
|
|
1798
|
+
* @throws {@link ListMarketClarificationsError}
|
|
1799
|
+
* Thrown on failure.
|
|
1800
|
+
*
|
|
1801
|
+
* @example
|
|
1802
|
+
* ```ts
|
|
1803
|
+
* const paginator = client.listMarketClarifications({
|
|
1804
|
+
* marketId: '512038',
|
|
1805
|
+
* });
|
|
1806
|
+
*
|
|
1807
|
+
* for await (const page of paginator) {
|
|
1808
|
+
* // page.items: MarketClarification[]
|
|
1809
|
+
* }
|
|
1810
|
+
* ```
|
|
1811
|
+
*/
|
|
1812
|
+
listMarketClarifications(request?: ListMarketClarificationsRequest): Paginated<MarketClarification[]>;
|
|
1527
1813
|
/**
|
|
1528
1814
|
* Lists tags.
|
|
1529
1815
|
*
|
|
@@ -1795,70 +2081,150 @@ type DiscoveryActions = {
|
|
|
1795
2081
|
declare function discoveryActions(client: BasePublicClient): DiscoveryActions;
|
|
1796
2082
|
declare function discoveryActions(client: BaseSecureClient): DiscoveryActions;
|
|
1797
2083
|
|
|
2084
|
+
/**
|
|
2085
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2086
|
+
*/
|
|
1798
2087
|
type PublicPerpsActions = {
|
|
1799
2088
|
/**
|
|
1800
2089
|
* Fetches Perps instruments.
|
|
1801
2090
|
*
|
|
2091
|
+
* @example
|
|
2092
|
+
* ```ts
|
|
2093
|
+
* const instruments = await client.fetchPerpsInstruments();
|
|
2094
|
+
* ```
|
|
2095
|
+
*
|
|
1802
2096
|
* @throws {@link FetchPerpsInstrumentsError}
|
|
1803
2097
|
* Thrown on failure.
|
|
2098
|
+
*
|
|
2099
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1804
2100
|
*/
|
|
1805
2101
|
fetchPerpsInstruments(request?: FetchPerpsInstrumentsRequest): Promise<PerpsInstrument[]>;
|
|
1806
2102
|
/**
|
|
1807
2103
|
* Fetches the current Perps ticker for an instrument.
|
|
1808
2104
|
*
|
|
2105
|
+
* @example
|
|
2106
|
+
* ```ts
|
|
2107
|
+
* const ticker = await client.fetchPerpsTicker({ instrumentId: 1 });
|
|
2108
|
+
* ```
|
|
2109
|
+
*
|
|
1809
2110
|
* @throws {@link FetchPerpsTickerError}
|
|
1810
2111
|
* Thrown on failure.
|
|
2112
|
+
*
|
|
2113
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1811
2114
|
*/
|
|
1812
2115
|
fetchPerpsTicker(request: FetchPerpsTickerRequest): Promise<PerpsTicker>;
|
|
1813
2116
|
/**
|
|
1814
2117
|
* Fetches current Perps tickers.
|
|
1815
2118
|
*
|
|
2119
|
+
* @example
|
|
2120
|
+
* ```ts
|
|
2121
|
+
* const tickers = await client.fetchPerpsTickers();
|
|
2122
|
+
* ```
|
|
2123
|
+
*
|
|
1816
2124
|
* @throws {@link FetchPerpsTickersError}
|
|
1817
2125
|
* Thrown on failure.
|
|
2126
|
+
*
|
|
2127
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1818
2128
|
*/
|
|
1819
2129
|
fetchPerpsTickers(request?: FetchPerpsTickersRequest): Promise<PerpsTicker[]>;
|
|
1820
2130
|
/**
|
|
1821
2131
|
* Fetches a Perps order book.
|
|
1822
2132
|
*
|
|
2133
|
+
* @example
|
|
2134
|
+
* ```ts
|
|
2135
|
+
* const book = await client.fetchPerpsBook({ instrumentId: 1, depth: 100 });
|
|
2136
|
+
* ```
|
|
2137
|
+
*
|
|
1823
2138
|
* @throws {@link FetchPerpsBookError}
|
|
1824
2139
|
* Thrown on failure.
|
|
2140
|
+
*
|
|
2141
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1825
2142
|
*/
|
|
1826
2143
|
fetchPerpsBook(request: FetchPerpsBookRequest): Promise<PerpsBook>;
|
|
1827
2144
|
/**
|
|
1828
2145
|
* Lists Perps candles for an instrument with SDK-owned pagination.
|
|
1829
2146
|
*
|
|
2147
|
+
* @example
|
|
2148
|
+
* ```ts
|
|
2149
|
+
* for await (const candles of client.listPerpsCandles({
|
|
2150
|
+
* instrumentId: 1,
|
|
2151
|
+
* interval: PerpsKlineInterval.OneMinute,
|
|
2152
|
+
* })) {
|
|
2153
|
+
* console.log(candles);
|
|
2154
|
+
* }
|
|
2155
|
+
* ```
|
|
2156
|
+
*
|
|
1830
2157
|
* @throws {@link ListPerpsCandlesError}
|
|
1831
2158
|
* Thrown on failure.
|
|
2159
|
+
*
|
|
2160
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1832
2161
|
*/
|
|
1833
2162
|
listPerpsCandles(request: ListPerpsCandlesRequest): Paginated<PerpsCandle[]>;
|
|
1834
2163
|
/**
|
|
1835
2164
|
* Lists Perps funding-rate history for an instrument with SDK-owned pagination.
|
|
1836
2165
|
*
|
|
2166
|
+
* @example
|
|
2167
|
+
* ```ts
|
|
2168
|
+
* for await (const rates of client.listPerpsFundingHistory({
|
|
2169
|
+
* instrumentId: 1,
|
|
2170
|
+
* })) {
|
|
2171
|
+
* console.log(rates);
|
|
2172
|
+
* }
|
|
2173
|
+
* ```
|
|
2174
|
+
*
|
|
1837
2175
|
* @throws {@link ListPerpsFundingHistoryError}
|
|
1838
2176
|
* Thrown on failure.
|
|
2177
|
+
*
|
|
2178
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1839
2179
|
*/
|
|
1840
2180
|
listPerpsFundingHistory(request: ListPerpsFundingHistoryRequest): Paginated<PerpsFundingRate[]>;
|
|
1841
2181
|
/**
|
|
1842
2182
|
* Lists recent Perps trades for an instrument with SDK-owned pagination.
|
|
1843
2183
|
*
|
|
2184
|
+
* @example
|
|
2185
|
+
* ```ts
|
|
2186
|
+
* for await (const trades of client.listPerpsTrades({ instrumentId: 1 })) {
|
|
2187
|
+
* console.log(trades);
|
|
2188
|
+
* }
|
|
2189
|
+
* ```
|
|
2190
|
+
*
|
|
1844
2191
|
* @throws {@link ListPerpsTradesError}
|
|
1845
2192
|
* Thrown on failure.
|
|
2193
|
+
*
|
|
2194
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1846
2195
|
*/
|
|
1847
2196
|
listPerpsTrades(request: ListPerpsTradesRequest): Paginated<PerpsPublicTrade[]>;
|
|
1848
2197
|
/**
|
|
1849
2198
|
* Fetches the Perps fee schedule.
|
|
1850
2199
|
*
|
|
2200
|
+
* @example
|
|
2201
|
+
* ```ts
|
|
2202
|
+
* const fees = await client.fetchPerpsFees();
|
|
2203
|
+
* ```
|
|
2204
|
+
*
|
|
1851
2205
|
* @throws {@link FetchPerpsFeesError}
|
|
1852
2206
|
* Thrown on failure.
|
|
2207
|
+
*
|
|
2208
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1853
2209
|
*/
|
|
1854
2210
|
fetchPerpsFees(): Promise<PerpsFeeScheduleEntry[]>;
|
|
1855
2211
|
};
|
|
2212
|
+
/**
|
|
2213
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2214
|
+
*/
|
|
1856
2215
|
type SecurePerpsActions = PublicPerpsActions & {
|
|
1857
2216
|
/**
|
|
1858
2217
|
* Deposits collateral into Perps for the authenticated signer account.
|
|
1859
2218
|
*
|
|
2219
|
+
* @example
|
|
2220
|
+
* ```ts
|
|
2221
|
+
* const transaction = await client.depositToPerps({ amount: 100_000_000n });
|
|
2222
|
+
* ```
|
|
2223
|
+
*
|
|
1860
2224
|
* @throws {@link DepositToPerpsError}
|
|
1861
2225
|
* Thrown on failure.
|
|
2226
|
+
*
|
|
2227
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1862
2228
|
*/
|
|
1863
2229
|
depositToPerps(request: DepositToPerpsRequest): Promise<TransactionHandle>;
|
|
1864
2230
|
/**
|
|
@@ -1870,8 +2236,15 @@ type SecurePerpsActions = PublicPerpsActions & {
|
|
|
1870
2236
|
* longer credential lifetime, or pass existing credentials to validate and
|
|
1871
2237
|
* resume a previous session.
|
|
1872
2238
|
*
|
|
2239
|
+
* @example
|
|
2240
|
+
* ```ts
|
|
2241
|
+
* const session = await client.openPerpsSession();
|
|
2242
|
+
* ```
|
|
2243
|
+
*
|
|
1873
2244
|
* @throws {@link OpenPerpsSessionError}
|
|
1874
2245
|
* Thrown on failure.
|
|
2246
|
+
*
|
|
2247
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1875
2248
|
*/
|
|
1876
2249
|
openPerpsSession(request?: OpenPerpsSessionRequest): Promise<PerpsSession>;
|
|
1877
2250
|
/**
|
|
@@ -1880,20 +2253,43 @@ type SecurePerpsActions = PublicPerpsActions & {
|
|
|
1880
2253
|
* @remarks
|
|
1881
2254
|
* This can revoke credentials outside the currently open Perps session.
|
|
1882
2255
|
*
|
|
2256
|
+
* @example
|
|
2257
|
+
* ```ts
|
|
2258
|
+
* await client.revokePerpsCredentials({ proxy: session.credentials.proxy });
|
|
2259
|
+
* ```
|
|
2260
|
+
*
|
|
1883
2261
|
* @throws {@link RevokePerpsCredentialsError}
|
|
1884
2262
|
* Thrown on failure.
|
|
2263
|
+
*
|
|
2264
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1885
2265
|
*/
|
|
1886
2266
|
revokePerpsCredentials(request: RevokePerpsCredentialsRequest): Promise<void>;
|
|
1887
2267
|
/**
|
|
1888
2268
|
* Requests a Perps withdrawal to the authenticated wallet.
|
|
1889
2269
|
*
|
|
2270
|
+
* @example
|
|
2271
|
+
* ```ts
|
|
2272
|
+
* const withdrawalId = await client.withdrawFromPerps({ amount: 100_000_000n });
|
|
2273
|
+
* ```
|
|
2274
|
+
*
|
|
1890
2275
|
* @throws {@link WithdrawFromPerpsError}
|
|
1891
2276
|
* Thrown on failure.
|
|
2277
|
+
*
|
|
2278
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
1892
2279
|
*/
|
|
1893
2280
|
withdrawFromPerps(request: WithdrawFromPerpsRequest): Promise<PerpsWithdrawalId>;
|
|
1894
2281
|
};
|
|
2282
|
+
/**
|
|
2283
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2284
|
+
*/
|
|
1895
2285
|
type PerpsActions = PublicPerpsActions;
|
|
2286
|
+
/**
|
|
2287
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2288
|
+
*/
|
|
1896
2289
|
declare function perpsActions(client: BasePublicClient): PublicPerpsActions;
|
|
2290
|
+
/**
|
|
2291
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
2292
|
+
*/
|
|
1897
2293
|
declare function perpsActions(client: BaseSecureClient): SecurePerpsActions;
|
|
1898
2294
|
|
|
1899
2295
|
type PublicRewardsActions = {
|
|
@@ -2149,9 +2545,9 @@ declare class RfqQuoteRejectedError extends PolymarketError {
|
|
|
2149
2545
|
readonly rfqId: RfqId;
|
|
2150
2546
|
constructor(message: string, options: ErrorOptions & RfqQuoteRejectedErrorOptions);
|
|
2151
2547
|
}
|
|
2152
|
-
type RfqQuoteError = RfqQuoteRejectedError | SigningError | TimeoutError | TransportError | UserInputError;
|
|
2548
|
+
type RfqQuoteError = ConnectionLostError | RfqQuoteRejectedError | SigningError | TimeoutError | TransportError | UserInputError;
|
|
2153
2549
|
declare const RfqQuoteError: {
|
|
2154
|
-
isError(error: unknown): error is SigningError | TransportError | UserInputError | TimeoutError | RfqQuoteRejectedError;
|
|
2550
|
+
isError(error: unknown): error is SigningError | TransportError | UserInputError | ConnectionLostError | TimeoutError | RfqQuoteRejectedError;
|
|
2155
2551
|
};
|
|
2156
2552
|
type RfqCancelQuoteRejectedErrorOptions = {
|
|
2157
2553
|
/** RFQ error code for the rejected cancellation request. */
|
|
@@ -2174,9 +2570,9 @@ declare class RfqCancelQuoteRejectedError extends PolymarketError {
|
|
|
2174
2570
|
readonly quoteId: RfqQuoteId;
|
|
2175
2571
|
constructor(message: string, options: ErrorOptions & RfqCancelQuoteRejectedErrorOptions);
|
|
2176
2572
|
}
|
|
2177
|
-
type RfqCancelQuoteError = RfqCancelQuoteRejectedError | TimeoutError | TransportError;
|
|
2573
|
+
type RfqCancelQuoteError = ConnectionLostError | RfqCancelQuoteRejectedError | TimeoutError | TransportError;
|
|
2178
2574
|
declare const RfqCancelQuoteError: {
|
|
2179
|
-
isError(error: unknown): error is TransportError | TimeoutError | RfqCancelQuoteRejectedError;
|
|
2575
|
+
isError(error: unknown): error is TransportError | ConnectionLostError | TimeoutError | RfqCancelQuoteRejectedError;
|
|
2180
2576
|
};
|
|
2181
2577
|
type RfqConfirmationRejectedErrorOptions = {
|
|
2182
2578
|
/** RFQ error code for the rejected confirmation decision. */
|
|
@@ -2199,9 +2595,9 @@ declare class RfqConfirmationRejectedError extends PolymarketError {
|
|
|
2199
2595
|
readonly quoteId: RfqQuoteId;
|
|
2200
2596
|
constructor(message: string, options: ErrorOptions & RfqConfirmationRejectedErrorOptions);
|
|
2201
2597
|
}
|
|
2202
|
-
type RfqConfirmationError = RfqConfirmationRejectedError | TimeoutError | TransportError;
|
|
2598
|
+
type RfqConfirmationError = ConnectionLostError | RfqConfirmationRejectedError | TimeoutError | TransportError;
|
|
2203
2599
|
declare const RfqConfirmationError: {
|
|
2204
|
-
isError(error: unknown): error is TransportError | TimeoutError | RfqConfirmationRejectedError;
|
|
2600
|
+
isError(error: unknown): error is TransportError | ConnectionLostError | TimeoutError | RfqConfirmationRejectedError;
|
|
2205
2601
|
};
|
|
2206
2602
|
/**
|
|
2207
2603
|
* Server request asking the market maker to provide a quote for an RFQ.
|
|
@@ -2298,9 +2694,9 @@ interface RfqSession extends AsyncIterable<RfqEvent> {
|
|
|
2298
2694
|
*/
|
|
2299
2695
|
close(): Promise<void>;
|
|
2300
2696
|
}
|
|
2301
|
-
type OpenRfqSessionError = TransportError;
|
|
2697
|
+
type OpenRfqSessionError = ConnectionLostError | TransportError;
|
|
2302
2698
|
declare const OpenRfqSessionError: {
|
|
2303
|
-
isError(error: unknown): error is TransportError;
|
|
2699
|
+
isError(error: unknown): error is TransportError | ConnectionLostError;
|
|
2304
2700
|
};
|
|
2305
2701
|
/**
|
|
2306
2702
|
* Opens an RFQ event session.
|
|
@@ -2526,7 +2922,7 @@ declare const CancelOrderError: {
|
|
|
2526
2922
|
* orderId: '123',
|
|
2527
2923
|
* });
|
|
2528
2924
|
*
|
|
2529
|
-
* // response.canceled:
|
|
2925
|
+
* // response.canceled: OrderId[]
|
|
2530
2926
|
* ```
|
|
2531
2927
|
*/
|
|
2532
2928
|
declare function cancelOrder(client: BaseSecureClient, request: CancelOrderRequest): Promise<CancelOrdersResponse>;
|
|
@@ -2550,7 +2946,7 @@ declare const CancelOrdersError: {
|
|
|
2550
2946
|
* orderIds: ['1', '2'],
|
|
2551
2947
|
* });
|
|
2552
2948
|
*
|
|
2553
|
-
* // response.canceled:
|
|
2949
|
+
* // response.canceled: OrderId[]
|
|
2554
2950
|
* ```
|
|
2555
2951
|
*/
|
|
2556
2952
|
declare function cancelOrders(client: BaseSecureClient, request: CancelOrdersRequest): Promise<CancelOrdersResponse>;
|
|
@@ -2571,7 +2967,7 @@ declare const CancelAllError: {
|
|
|
2571
2967
|
* ```ts
|
|
2572
2968
|
* const response = await cancelAll(client);
|
|
2573
2969
|
*
|
|
2574
|
-
* // response.canceled:
|
|
2970
|
+
* // response.canceled: OrderId[]
|
|
2575
2971
|
* ```
|
|
2576
2972
|
*/
|
|
2577
2973
|
declare function cancelAll(client: BaseSecureClient): Promise<CancelOrdersResponse>;
|
|
@@ -2596,7 +2992,7 @@ declare const CancelMarketOrdersError: {
|
|
|
2596
2992
|
* market: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
2597
2993
|
* });
|
|
2598
2994
|
*
|
|
2599
|
-
* // response.canceled:
|
|
2995
|
+
* // response.canceled: OrderId[]
|
|
2600
2996
|
* ```
|
|
2601
2997
|
*/
|
|
2602
2998
|
declare function cancelMarketOrders(client: BaseSecureClient, request: CancelMarketOrdersRequest): Promise<CancelOrdersResponse>;
|
|
@@ -2764,7 +3160,7 @@ type PrepareLimitOrderRequest = {
|
|
|
2764
3160
|
* When provided, the SDK prepares a Good-Til-Date (GTD) limit order that
|
|
2765
3161
|
* expires at the given timestamp.
|
|
2766
3162
|
*
|
|
2767
|
-
* The timestamp must be at least
|
|
3163
|
+
* The timestamp must be at least 3 minutes in the future. Add your own
|
|
2768
3164
|
* buffer for network latency and clock skew when deriving it from the
|
|
2769
3165
|
* current time.
|
|
2770
3166
|
*
|
|
@@ -2854,6 +3250,52 @@ declare function postOrder(client: BaseSecureClient): (order: SignedOrder) => Pr
|
|
|
2854
3250
|
*/
|
|
2855
3251
|
declare function postOrders(client: BaseSecureClient): (orders: PostOrdersRequest) => Promise<OrderResponses>;
|
|
2856
3252
|
|
|
3253
|
+
type WaitForOrderFillSettlementRequest = {
|
|
3254
|
+
/**
|
|
3255
|
+
* Maximum time to wait for the order's fills to settle, in milliseconds.
|
|
3256
|
+
* Defaults to 30000.
|
|
3257
|
+
*/
|
|
3258
|
+
timeoutMs?: number;
|
|
3259
|
+
};
|
|
3260
|
+
type WaitForOrderFillSettlementError = RateLimitError | RequestRejectedError | SigningError | TimeoutError | TransactionFailedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
3261
|
+
declare const WaitForOrderFillSettlementError: {
|
|
3262
|
+
isError(error: unknown): error is SigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
|
|
3263
|
+
};
|
|
3264
|
+
/**
|
|
3265
|
+
* Waits until every fill listed in an order response reaches a terminal
|
|
3266
|
+
* settlement outcome and returns the settlement transaction hashes.
|
|
3267
|
+
*
|
|
3268
|
+
* @remarks
|
|
3269
|
+
* Settlement covers the fills listed in this order response, identified by the
|
|
3270
|
+
* response's `tradeIds`. These are the fills that happened immediately when
|
|
3271
|
+
* the order was accepted. It does not wait for later fills of any remaining
|
|
3272
|
+
* quantity resting on the book; subscribe to the `user` channel to follow
|
|
3273
|
+
* those.
|
|
3274
|
+
*
|
|
3275
|
+
* Orders without fill identifiers resolve immediately to any transaction
|
|
3276
|
+
* hashes carried by the order response, or an empty array. In the rare case
|
|
3277
|
+
* where some fills fail execution, the settled fills' hashes are still
|
|
3278
|
+
* returned; the failed fills simply contribute no hash.
|
|
3279
|
+
*
|
|
3280
|
+
* @example
|
|
3281
|
+
* ```ts
|
|
3282
|
+
* const response = await client.placeMarketOrder({
|
|
3283
|
+
* amount: 10,
|
|
3284
|
+
* side: OrderSide.BUY,
|
|
3285
|
+
* tokenId: '123',
|
|
3286
|
+
* });
|
|
3287
|
+
*
|
|
3288
|
+
* if (response.ok) {
|
|
3289
|
+
* const hashes = await waitForOrderFillSettlement(client, response);
|
|
3290
|
+
* }
|
|
3291
|
+
* ```
|
|
3292
|
+
*
|
|
3293
|
+
* @throws {@link WaitForOrderFillSettlementError}
|
|
3294
|
+
* Thrown on failure: a timeout while fills are still settling, or every fill
|
|
3295
|
+
* failing execution. The order placement itself is unaffected.
|
|
3296
|
+
*/
|
|
3297
|
+
declare function waitForOrderFillSettlement(client: BaseSecureClient, order: AcceptedOrderResponse, request?: WaitForOrderFillSettlementRequest): Promise<TxHash[]>;
|
|
3298
|
+
|
|
2857
3299
|
type SecureTradingActions = {
|
|
2858
3300
|
/**
|
|
2859
3301
|
* Creates a signed market order for the authenticated account.
|
|
@@ -2884,6 +3326,11 @@ type SecureTradingActions = {
|
|
|
2884
3326
|
/**
|
|
2885
3327
|
* Creates and posts a market order for the authenticated account.
|
|
2886
3328
|
*
|
|
3329
|
+
* @remarks
|
|
3330
|
+
* Settlement happens asynchronously, so a matched response is not
|
|
3331
|
+
* guaranteed to carry settlement transaction hashes. Use
|
|
3332
|
+
* `waitForOrderFillSettlement` to obtain them reliably.
|
|
3333
|
+
*
|
|
2887
3334
|
* @throws {@link PlaceMarketOrderError}
|
|
2888
3335
|
* Thrown on failure.
|
|
2889
3336
|
*
|
|
@@ -2909,13 +3356,27 @@ type SecureTradingActions = {
|
|
|
2909
3356
|
*
|
|
2910
3357
|
* // response: OrderResponse
|
|
2911
3358
|
* ```
|
|
3359
|
+
*
|
|
3360
|
+
* @example Market buy followed to settlement
|
|
3361
|
+
* ```ts
|
|
3362
|
+
* const response = await client.placeMarketOrder({
|
|
3363
|
+
* amount: 10,
|
|
3364
|
+
* side: OrderSide.BUY,
|
|
3365
|
+
* tokenId: '123',
|
|
3366
|
+
* });
|
|
3367
|
+
*
|
|
3368
|
+
* if (response.ok) {
|
|
3369
|
+
* const hashes = await client.waitForOrderFillSettlement(response);
|
|
3370
|
+
* // hashes: TxHash[]
|
|
3371
|
+
* }
|
|
3372
|
+
* ```
|
|
2912
3373
|
*/
|
|
2913
3374
|
placeMarketOrder(request: PrepareMarketOrderRequest): Promise<OrderResponse>;
|
|
2914
3375
|
/**
|
|
2915
3376
|
* Creates a signed limit order for the authenticated account.
|
|
2916
3377
|
*
|
|
2917
3378
|
* @remarks
|
|
2918
|
-
* GTD expirations must be at least
|
|
3379
|
+
* GTD expirations must be at least 3 minutes in the future. Add your own
|
|
2919
3380
|
* buffer for network latency and clock skew when deriving an expiration from
|
|
2920
3381
|
* the current time.
|
|
2921
3382
|
*
|
|
@@ -2938,7 +3399,7 @@ type SecureTradingActions = {
|
|
|
2938
3399
|
* Creates and posts a limit order for the authenticated account.
|
|
2939
3400
|
*
|
|
2940
3401
|
* @remarks
|
|
2941
|
-
* GTD expirations must be at least
|
|
3402
|
+
* GTD expirations must be at least 3 minutes in the future. Add your own
|
|
2942
3403
|
* buffer for network latency and clock skew when deriving an expiration from
|
|
2943
3404
|
* the current time.
|
|
2944
3405
|
*
|
|
@@ -2986,6 +3447,35 @@ type SecureTradingActions = {
|
|
|
2986
3447
|
* ```
|
|
2987
3448
|
*/
|
|
2988
3449
|
postOrders(orders: PostOrdersRequest): Promise<OrderResponses>;
|
|
3450
|
+
/**
|
|
3451
|
+
* Waits until every fill listed in an order response reaches a terminal
|
|
3452
|
+
* settlement outcome and returns the settlement transaction hashes.
|
|
3453
|
+
*
|
|
3454
|
+
* @remarks
|
|
3455
|
+
* Settlement covers the fills listed in this order response. These are the
|
|
3456
|
+
* fills that happened immediately when the order was accepted. It does not
|
|
3457
|
+
* wait for later fills of any remaining quantity resting on the book;
|
|
3458
|
+
* subscribe to the `user` channel to follow those.
|
|
3459
|
+
*
|
|
3460
|
+
* @throws {@link WaitForOrderFillSettlementError}
|
|
3461
|
+
* Thrown on failure: a timeout while fills are still settling, or every
|
|
3462
|
+
* fill failing execution. The order placement itself is unaffected.
|
|
3463
|
+
*
|
|
3464
|
+
* @example
|
|
3465
|
+
* ```ts
|
|
3466
|
+
* const response = await client.placeMarketOrder({
|
|
3467
|
+
* amount: 10,
|
|
3468
|
+
* side: OrderSide.BUY,
|
|
3469
|
+
* tokenId: '123',
|
|
3470
|
+
* });
|
|
3471
|
+
*
|
|
3472
|
+
* if (response.ok) {
|
|
3473
|
+
* const hashes = await client.waitForOrderFillSettlement(response);
|
|
3474
|
+
* // hashes: TxHash[]
|
|
3475
|
+
* }
|
|
3476
|
+
* ```
|
|
3477
|
+
*/
|
|
3478
|
+
waitForOrderFillSettlement(order: AcceptedOrderResponse, request?: WaitForOrderFillSettlementRequest): Promise<TxHash$1[]>;
|
|
2989
3479
|
/**
|
|
2990
3480
|
* Cancels a single open order for the authenticated account.
|
|
2991
3481
|
*
|
|
@@ -2996,7 +3486,7 @@ type SecureTradingActions = {
|
|
|
2996
3486
|
* ```ts
|
|
2997
3487
|
* const response = await client.cancelOrder({ orderId: '123' });
|
|
2998
3488
|
*
|
|
2999
|
-
* // response.canceled:
|
|
3489
|
+
* // response.canceled: OrderId[]
|
|
3000
3490
|
* ```
|
|
3001
3491
|
*/
|
|
3002
3492
|
cancelOrder(request: CancelOrderRequest): Promise<CancelOrdersResponse>;
|
|
@@ -3010,7 +3500,7 @@ type SecureTradingActions = {
|
|
|
3010
3500
|
* ```ts
|
|
3011
3501
|
* const response = await client.cancelOrders({ orderIds: ['1', '2'] });
|
|
3012
3502
|
*
|
|
3013
|
-
* // response.canceled:
|
|
3503
|
+
* // response.canceled: OrderId[]
|
|
3014
3504
|
* ```
|
|
3015
3505
|
*/
|
|
3016
3506
|
cancelOrders(request: CancelOrdersRequest): Promise<CancelOrdersResponse>;
|
|
@@ -3024,7 +3514,7 @@ type SecureTradingActions = {
|
|
|
3024
3514
|
* ```ts
|
|
3025
3515
|
* const response = await client.cancelAll();
|
|
3026
3516
|
*
|
|
3027
|
-
* // response.canceled:
|
|
3517
|
+
* // response.canceled: OrderId[]
|
|
3028
3518
|
* ```
|
|
3029
3519
|
*/
|
|
3030
3520
|
cancelAll(): Promise<CancelOrdersResponse>;
|
|
@@ -3040,7 +3530,7 @@ type SecureTradingActions = {
|
|
|
3040
3530
|
* market: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
3041
3531
|
* });
|
|
3042
3532
|
*
|
|
3043
|
-
* // response.canceled:
|
|
3533
|
+
* // response.canceled: OrderId[]
|
|
3044
3534
|
* ```
|
|
3045
3535
|
*/
|
|
3046
3536
|
cancelMarketOrders(request: CancelMarketOrdersRequest): Promise<CancelOrdersResponse>;
|
|
@@ -3094,12 +3584,6 @@ type SecureTradingActions = {
|
|
|
3094
3584
|
declare function tradingActions(client: BaseSecureClient): SecureTradingActions;
|
|
3095
3585
|
|
|
3096
3586
|
type SecureWalletActions = {
|
|
3097
|
-
/**
|
|
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.
|
|
3101
|
-
*/
|
|
3102
|
-
isGaslessReady(): Promise<boolean>;
|
|
3103
3587
|
/**
|
|
3104
3588
|
* Sets up the approvals required for trading and supported position lifecycle workflows.
|
|
3105
3589
|
*
|
|
@@ -3111,7 +3595,7 @@ type SecureWalletActions = {
|
|
|
3111
3595
|
* await client.setupTradingApprovals();
|
|
3112
3596
|
* ```
|
|
3113
3597
|
*/
|
|
3114
|
-
setupTradingApprovals(): Promise<
|
|
3598
|
+
setupTradingApprovals(): Promise<void>;
|
|
3115
3599
|
/**
|
|
3116
3600
|
* Approves ERC-20 token spending for the authenticated account.
|
|
3117
3601
|
*
|
|
@@ -3277,6 +3761,58 @@ type SecureWalletActions = {
|
|
|
3277
3761
|
* ```
|
|
3278
3762
|
*/
|
|
3279
3763
|
redeemPositions(request: PrepareRedeemPositionsRequest): Promise<TransactionHandle>;
|
|
3764
|
+
/**
|
|
3765
|
+
* Plans a collateral return for the authenticated account.
|
|
3766
|
+
*
|
|
3767
|
+
* The returned plan is an inspectable artifact: review the collateral it
|
|
3768
|
+
* releases, the inputs it consumes, and the residual-position impact, and
|
|
3769
|
+
* apply any application-specific limits before executing it with
|
|
3770
|
+
* {@link SecureWalletActions.executeCollateralReturnPlan | executeCollateralReturnPlan}.
|
|
3771
|
+
* A truncated plan is one executable chunk of a larger return; execute and
|
|
3772
|
+
* confirm it before requesting the next plan.
|
|
3773
|
+
*
|
|
3774
|
+
* @throws {@link PlanCollateralReturnError}
|
|
3775
|
+
* Thrown on failure.
|
|
3776
|
+
*
|
|
3777
|
+
* @example
|
|
3778
|
+
* ```ts
|
|
3779
|
+
* let plan: CollateralReturnPlanResponse;
|
|
3780
|
+
*
|
|
3781
|
+
* do {
|
|
3782
|
+
* plan = await client.planCollateralReturn();
|
|
3783
|
+
*
|
|
3784
|
+
* // Inspect the return and residual-position impact, and apply any
|
|
3785
|
+
* // application-specific limits before signing.
|
|
3786
|
+
* const handle = await client.executeCollateralReturnPlan({ plan });
|
|
3787
|
+
* await handle.wait();
|
|
3788
|
+
* } while (plan.truncated);
|
|
3789
|
+
* ```
|
|
3790
|
+
*/
|
|
3791
|
+
planCollateralReturn(): Promise<CollateralReturnPlanResponse>;
|
|
3792
|
+
/**
|
|
3793
|
+
* Executes a collateral return plan for the authenticated account.
|
|
3794
|
+
*
|
|
3795
|
+
* Execution signs and submits the exact call carried by the plan; nothing is
|
|
3796
|
+
* recomputed on the client, and no approval transactions are run implicitly.
|
|
3797
|
+
* Confirmation stays explicit through the returned handle's `wait()`.
|
|
3798
|
+
*
|
|
3799
|
+
* If wallet state changed since the plan was created, the service rejects
|
|
3800
|
+
* the submission; request a fresh plan and execute that instead.
|
|
3801
|
+
*
|
|
3802
|
+
* @throws {@link ExecuteCollateralReturnPlanError}
|
|
3803
|
+
* Thrown on failure.
|
|
3804
|
+
*
|
|
3805
|
+
* @example
|
|
3806
|
+
* ```ts
|
|
3807
|
+
* const plan = await client.planCollateralReturn();
|
|
3808
|
+
*
|
|
3809
|
+
* const handle = await client.executeCollateralReturnPlan({ plan });
|
|
3810
|
+
* const outcome = await handle.wait();
|
|
3811
|
+
*
|
|
3812
|
+
* // outcome.transactionHash: TxHash
|
|
3813
|
+
* ```
|
|
3814
|
+
*/
|
|
3815
|
+
executeCollateralReturnPlan(request: ExecuteCollateralReturnPlanRequest): Promise<TransactionHandle>;
|
|
3280
3816
|
};
|
|
3281
3817
|
declare function walletActions(client: BaseSecureClient): SecureWalletActions;
|
|
3282
3818
|
|
|
@@ -3306,7 +3842,12 @@ type ClobEndpoints = RestEndpoint & {
|
|
|
3306
3842
|
market: WebSocketEndpoint;
|
|
3307
3843
|
user: WebSocketEndpoint;
|
|
3308
3844
|
};
|
|
3309
|
-
type
|
|
3845
|
+
type CombosEndpoints = RestEndpoint & WebSocketEndpoint & {
|
|
3846
|
+
collateralReturn: RestEndpoint;
|
|
3847
|
+
};
|
|
3848
|
+
/**
|
|
3849
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
3850
|
+
*/
|
|
3310
3851
|
type PerpsEndpoints = RestEndpoint & WebSocketEndpoint;
|
|
3311
3852
|
type EnvironmentContracts = {
|
|
3312
3853
|
collateralToken: EvmAddress;
|
|
@@ -3343,7 +3884,9 @@ type EnvironmentConfigFork = {
|
|
|
3343
3884
|
relayer?: Partial<RestEndpoint>;
|
|
3344
3885
|
gamma?: Partial<RestEndpoint>;
|
|
3345
3886
|
data?: Partial<RestEndpoint>;
|
|
3346
|
-
|
|
3887
|
+
combos?: EnvironmentConfigForkEndpoint & {
|
|
3888
|
+
collateralReturn?: Partial<RestEndpoint>;
|
|
3889
|
+
};
|
|
3347
3890
|
perps?: EnvironmentConfigForkEndpoint;
|
|
3348
3891
|
rtds?: Partial<WebSocketEndpoint>;
|
|
3349
3892
|
sports?: Partial<WebSocketEndpoint>;
|
|
@@ -3489,12 +4032,6 @@ declare class BaseSecureClient<TPublicActions extends ClientActions = ClientActi
|
|
|
3489
4032
|
* The authenticated account identity associated with this client, including the signer and wallet addresses and wallet type.
|
|
3490
4033
|
*/
|
|
3491
4034
|
get account(): AccountIdentity;
|
|
3492
|
-
/**
|
|
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.
|
|
3496
|
-
*/
|
|
3497
|
-
setupGaslessWallet(): Promise<SecureClient<TPublicActions, TSecureActions>>;
|
|
3498
4035
|
/**
|
|
3499
4036
|
* Closes all active realtime subscriptions owned by this client.
|
|
3500
4037
|
*
|
|
@@ -3653,7 +4190,7 @@ declare const FetchClosedOnlyModeError: {
|
|
|
3653
4190
|
declare function fetchClosedOnlyMode(client: BaseSecureClient): Promise<boolean>;
|
|
3654
4191
|
declare const ListOpenOrdersRequestSchema: z.ZodDefault<z.ZodObject<{
|
|
3655
4192
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
3656
|
-
cursor: z.ZodOptional<z.
|
|
4193
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
3657
4194
|
id: z.ZodOptional<z.ZodString>;
|
|
3658
4195
|
market: z.ZodOptional<z.ZodString>;
|
|
3659
4196
|
}, z.core.$strip>>;
|
|
@@ -3726,7 +4263,7 @@ declare const ListAccountTradesRequestSchema: z.ZodDefault<z.ZodObject<{
|
|
|
3726
4263
|
after: z.ZodOptional<z.ZodString>;
|
|
3727
4264
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
3728
4265
|
before: z.ZodOptional<z.ZodString>;
|
|
3729
|
-
cursor: z.ZodOptional<z.
|
|
4266
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
3730
4267
|
id: z.ZodOptional<z.ZodString>;
|
|
3731
4268
|
makerAddress: z.ZodOptional<z.ZodString>;
|
|
3732
4269
|
market: z.ZodOptional<z.ZodString>;
|
|
@@ -3916,7 +4453,7 @@ declare const FetchOrdersScoringError: {
|
|
|
3916
4453
|
*/
|
|
3917
4454
|
declare function fetchOrdersScoring(client: BaseSecureClient, request: FetchOrdersScoringRequest): Promise<OrdersScoringResponse>;
|
|
3918
4455
|
declare const ListUserEarningsForDayRequestSchema: z.ZodObject<{
|
|
3919
|
-
cursor: z.ZodOptional<z.
|
|
4456
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
3920
4457
|
date: z.ZodString;
|
|
3921
4458
|
}, z.core.$strip>;
|
|
3922
4459
|
type ListUserEarningsForDayRequest = z.input<typeof ListUserEarningsForDayRequestSchema>;
|
|
@@ -3982,7 +4519,7 @@ declare const FetchTotalEarningsForUserForDayError: {
|
|
|
3982
4519
|
*/
|
|
3983
4520
|
declare function fetchTotalEarningsForUserForDay(client: BaseSecureClient, request: FetchTotalEarningsForUserForDayRequest): Promise<TotalUserEarning[]>;
|
|
3984
4521
|
declare const ListUserEarningsAndMarketsConfigRequestSchema: z.ZodObject<{
|
|
3985
|
-
cursor: z.ZodOptional<z.
|
|
4522
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
3986
4523
|
date: z.ZodString;
|
|
3987
4524
|
noCompetition: z.ZodOptional<z.ZodBoolean>;
|
|
3988
4525
|
orderBy: z.ZodOptional<z.ZodString>;
|
|
@@ -4049,150 +4586,21 @@ declare const FetchRewardPercentagesError: {
|
|
|
4049
4586
|
*/
|
|
4050
4587
|
declare function fetchRewardPercentages(client: BaseSecureClient): Promise<RewardsPercentages>;
|
|
4051
4588
|
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
}>>;
|
|
4060
|
-
filterAmount: z.ZodOptional<z.ZodNumber>;
|
|
4061
|
-
market: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4062
|
-
eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
4063
|
-
user: z.ZodOptional<z.ZodString>;
|
|
4064
|
-
side: z.ZodOptional<z.ZodEnum<{
|
|
4065
|
-
BUY: "BUY";
|
|
4066
|
-
SELL: "SELL";
|
|
4067
|
-
}>>;
|
|
4068
|
-
}, z.core.$strip>;
|
|
4069
|
-
declare const ListActivityRequestSchema: z.ZodObject<{
|
|
4070
|
-
cursor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.PaginationCursor, string>>>;
|
|
4071
|
-
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
4072
|
-
user: z.ZodString;
|
|
4073
|
-
market: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4074
|
-
eventId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
4075
|
-
type: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof _polymarket_bindings_data.ActivityType>>>;
|
|
4076
|
-
start: z.ZodOptional<z.ZodNumber>;
|
|
4077
|
-
end: z.ZodOptional<z.ZodNumber>;
|
|
4078
|
-
sortBy: z.ZodOptional<z.ZodEnum<{
|
|
4079
|
-
TOKENS: "TOKENS";
|
|
4080
|
-
TIMESTAMP: "TIMESTAMP";
|
|
4081
|
-
CASH: "CASH";
|
|
4082
|
-
}>>;
|
|
4083
|
-
sortDirection: z.ZodOptional<z.ZodEnum<{
|
|
4084
|
-
ASC: "ASC";
|
|
4085
|
-
DESC: "DESC";
|
|
4086
|
-
}>>;
|
|
4087
|
-
side: z.ZodOptional<z.ZodEnum<{
|
|
4088
|
-
BUY: "BUY";
|
|
4089
|
-
SELL: "SELL";
|
|
4090
|
-
}>>;
|
|
4589
|
+
type Erc20ApprovalWorkflowRequest = GaslessWorkflowRequest | SendErc20ApprovalTransactionRequest;
|
|
4590
|
+
type Erc20ApprovalWorkflow = AsyncGenerator<Erc20ApprovalWorkflowRequest, TransactionHandle, EvmAddress$1 | EvmSignature | TransactionHandle>;
|
|
4591
|
+
declare const PrepareErc20ApprovalRequestSchema: z.ZodObject<{
|
|
4592
|
+
amount: z.ZodUnion<readonly [z.ZodBigInt, z.ZodLiteral<"max">]>;
|
|
4593
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
4594
|
+
spenderAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress$1, string>>;
|
|
4595
|
+
tokenAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress$1, string>>;
|
|
4091
4596
|
}, z.core.$strip>;
|
|
4092
|
-
type
|
|
4093
|
-
type
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
4597
|
+
type PrepareErc20ApprovalRequest = z.input<typeof PrepareErc20ApprovalRequestSchema>;
|
|
4598
|
+
type PrepareErc20ApprovalError = UserInputError;
|
|
4599
|
+
declare const PrepareErc20ApprovalError: {
|
|
4600
|
+
isError(error: unknown): error is UserInputError;
|
|
4097
4601
|
};
|
|
4098
4602
|
/**
|
|
4099
|
-
*
|
|
4100
|
-
*
|
|
4101
|
-
* @remarks
|
|
4102
|
-
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
4103
|
-
*
|
|
4104
|
-
* @throws {@link ListTradesError}
|
|
4105
|
-
* Thrown on failure.
|
|
4106
|
-
*
|
|
4107
|
-
* @example
|
|
4108
|
-
* Fetch the first page of results:
|
|
4109
|
-
* ```ts
|
|
4110
|
-
* const result = listTrades(client, {
|
|
4111
|
-
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
4112
|
-
* pageSize: 10,
|
|
4113
|
-
* });
|
|
4114
|
-
*
|
|
4115
|
-
* const firstPage = await result.firstPage();
|
|
4116
|
-
*
|
|
4117
|
-
* // Optionally, fetch additional pages:
|
|
4118
|
-
* for await (const page of result.from(firstPage.nextCursor)) {
|
|
4119
|
-
* // page.items: Trade[]
|
|
4120
|
-
* }
|
|
4121
|
-
* ```
|
|
4122
|
-
*
|
|
4123
|
-
* @example
|
|
4124
|
-
* Loop through all pages with `for await`:
|
|
4125
|
-
* ```ts
|
|
4126
|
-
* const result = listTrades(client, {
|
|
4127
|
-
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
4128
|
-
* pageSize: 10,
|
|
4129
|
-
* });
|
|
4130
|
-
*
|
|
4131
|
-
* for await (const page of result) {
|
|
4132
|
-
* // page.items: Trade[]
|
|
4133
|
-
* }
|
|
4134
|
-
* ```
|
|
4135
|
-
*/
|
|
4136
|
-
declare function listTrades(client: BaseClient, request?: ListTradesRequest): Paginated<Trade[]>;
|
|
4137
|
-
type ListActivityError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
4138
|
-
declare const ListActivityError: {
|
|
4139
|
-
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
4140
|
-
};
|
|
4141
|
-
/**
|
|
4142
|
-
* Lists wallet activity.
|
|
4143
|
-
*
|
|
4144
|
-
* @remarks
|
|
4145
|
-
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
4146
|
-
*
|
|
4147
|
-
* @throws {@link ListActivityError}
|
|
4148
|
-
* Thrown on failure.
|
|
4149
|
-
*
|
|
4150
|
-
* @example
|
|
4151
|
-
* Fetch the first page of results:
|
|
4152
|
-
* ```ts
|
|
4153
|
-
* const result = listActivity(client, {
|
|
4154
|
-
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
4155
|
-
* pageSize: 10,
|
|
4156
|
-
* });
|
|
4157
|
-
*
|
|
4158
|
-
* const firstPage = await result.firstPage();
|
|
4159
|
-
*
|
|
4160
|
-
* // Optionally, fetch additional pages:
|
|
4161
|
-
* for await (const page of result.from(firstPage.nextCursor)) {
|
|
4162
|
-
* // page.items: Activity[]
|
|
4163
|
-
* }
|
|
4164
|
-
* ```
|
|
4165
|
-
*
|
|
4166
|
-
* @example
|
|
4167
|
-
* Loop through all pages with `for await`:
|
|
4168
|
-
* ```ts
|
|
4169
|
-
* const result = listActivity(client, {
|
|
4170
|
-
* user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',
|
|
4171
|
-
* pageSize: 10,
|
|
4172
|
-
* });
|
|
4173
|
-
*
|
|
4174
|
-
* for await (const page of result) {
|
|
4175
|
-
* // page.items: Activity[]
|
|
4176
|
-
* }
|
|
4177
|
-
* ```
|
|
4178
|
-
*/
|
|
4179
|
-
declare function listActivity(client: BaseClient, request: ListActivityRequest): Paginated<Activity[]>;
|
|
4180
|
-
|
|
4181
|
-
type Erc20ApprovalWorkflowRequest = GaslessWorkflowRequest | SendErc20ApprovalTransactionRequest;
|
|
4182
|
-
type Erc20ApprovalWorkflow = AsyncGenerator<Erc20ApprovalWorkflowRequest, TransactionHandle, EvmAddress$1 | EvmSignature | TransactionHandle>;
|
|
4183
|
-
declare const PrepareErc20ApprovalRequestSchema: z.ZodObject<{
|
|
4184
|
-
amount: z.ZodUnion<readonly [z.ZodBigInt, z.ZodLiteral<"max">]>;
|
|
4185
|
-
metadata: z.ZodOptional<z.ZodString>;
|
|
4186
|
-
spenderAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress$1, string>>;
|
|
4187
|
-
tokenAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress$1, string>>;
|
|
4188
|
-
}, z.core.$strip>;
|
|
4189
|
-
type PrepareErc20ApprovalRequest = z.input<typeof PrepareErc20ApprovalRequestSchema>;
|
|
4190
|
-
type PrepareErc20ApprovalError = UserInputError;
|
|
4191
|
-
declare const PrepareErc20ApprovalError: {
|
|
4192
|
-
isError(error: unknown): error is UserInputError;
|
|
4193
|
-
};
|
|
4194
|
-
/**
|
|
4195
|
-
* Starts an ERC-20 approval workflow.
|
|
4603
|
+
* Starts an ERC-20 approval workflow.
|
|
4196
4604
|
*
|
|
4197
4605
|
* @remarks
|
|
4198
4606
|
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
@@ -4294,13 +4702,6 @@ type SetupTradingApprovalsError = PrepareTradingApprovalsError | CancelledSignin
|
|
|
4294
4702
|
declare const SetupTradingApprovalsError: {
|
|
4295
4703
|
isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
|
|
4296
4704
|
};
|
|
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>;
|
|
4303
|
-
};
|
|
4304
4705
|
/**
|
|
4305
4706
|
* Sets up the approvals required for trading.
|
|
4306
4707
|
*
|
|
@@ -4310,13 +4711,13 @@ type DeprecatedTransactionHandle = Omit<TransactionHandle, 'wait'> & {
|
|
|
4310
4711
|
* @throws {@link SetupTradingApprovalsError}
|
|
4311
4712
|
* Thrown on failure.
|
|
4312
4713
|
*/
|
|
4313
|
-
declare function setupTradingApprovals(client: BaseSecureClient): Promise<
|
|
4714
|
+
declare function setupTradingApprovals(client: BaseSecureClient): Promise<void>;
|
|
4314
4715
|
|
|
4315
4716
|
declare const ListBuilderTradesRequestSchema: z.ZodObject<{
|
|
4316
4717
|
after: z.ZodOptional<z.ZodString>;
|
|
4317
4718
|
before: z.ZodOptional<z.ZodString>;
|
|
4318
4719
|
builderCode: z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.BuilderCode, string>>;
|
|
4319
|
-
cursor: z.ZodOptional<z.
|
|
4720
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
4320
4721
|
id: z.ZodOptional<z.ZodString>;
|
|
4321
4722
|
market: z.ZodOptional<z.ZodString>;
|
|
4322
4723
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
@@ -4369,7 +4770,7 @@ declare const FetchMidpointError: {
|
|
|
4369
4770
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
4370
4771
|
};
|
|
4371
4772
|
/**
|
|
4372
|
-
* Fetches the midpoint price for a token.
|
|
4773
|
+
* Fetches the midpoint price for a token as a decimal string.
|
|
4373
4774
|
*
|
|
4374
4775
|
* @remarks
|
|
4375
4776
|
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
@@ -4388,7 +4789,7 @@ declare const FetchMidpointError: {
|
|
|
4388
4789
|
* ```
|
|
4389
4790
|
*
|
|
4390
4791
|
*/
|
|
4391
|
-
declare function fetchMidpoint(client: BaseClient, request: FetchMidpointRequest): Promise<
|
|
4792
|
+
declare function fetchMidpoint(client: BaseClient, request: FetchMidpointRequest): Promise<DecimalString>;
|
|
4392
4793
|
declare const FetchMidpointsRequestSchema: z.ZodArray<z.ZodObject<{
|
|
4393
4794
|
tokenId: z.ZodString;
|
|
4394
4795
|
}, z.core.$strip>>;
|
|
@@ -4398,7 +4799,7 @@ declare const FetchMidpointsError: {
|
|
|
4398
4799
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
4399
4800
|
};
|
|
4400
4801
|
/**
|
|
4401
|
-
* Fetches midpoint prices for multiple tokens.
|
|
4802
|
+
* Fetches midpoint prices for multiple tokens as a token ID keyed lookup.
|
|
4402
4803
|
*
|
|
4403
4804
|
* @remarks
|
|
4404
4805
|
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
@@ -4419,7 +4820,7 @@ declare const FetchMidpointsError: {
|
|
|
4419
4820
|
* ```
|
|
4420
4821
|
*
|
|
4421
4822
|
*/
|
|
4422
|
-
declare function fetchMidpoints(client: BaseClient, request: FetchMidpointsRequest): Promise<
|
|
4823
|
+
declare function fetchMidpoints(client: BaseClient, request: FetchMidpointsRequest): Promise<Midpoints>;
|
|
4423
4824
|
declare const FetchTickSizeRequestSchema: z.ZodObject<{
|
|
4424
4825
|
tokenId: z.ZodString;
|
|
4425
4826
|
}, z.core.$strip>;
|
|
@@ -4540,7 +4941,7 @@ declare const FetchPriceError: {
|
|
|
4540
4941
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
4541
4942
|
};
|
|
4542
4943
|
/**
|
|
4543
|
-
* Fetches the current quoted price for a token and side.
|
|
4944
|
+
* Fetches the current quoted price for a token and side as a decimal string.
|
|
4544
4945
|
*
|
|
4545
4946
|
* @remarks
|
|
4546
4947
|
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
@@ -4560,7 +4961,7 @@ declare const FetchPriceError: {
|
|
|
4560
4961
|
* ```
|
|
4561
4962
|
*
|
|
4562
4963
|
*/
|
|
4563
|
-
declare function fetchPrice(client: BaseClient, request: FetchPriceRequest): Promise<
|
|
4964
|
+
declare function fetchPrice(client: BaseClient, request: FetchPriceRequest): Promise<DecimalString>;
|
|
4564
4965
|
declare const FetchPricesRequestSchema: z.ZodArray<z.ZodObject<{
|
|
4565
4966
|
tokenId: z.ZodString;
|
|
4566
4967
|
side: z.ZodEnum<typeof _polymarket_bindings.OrderSide>;
|
|
@@ -4571,7 +4972,7 @@ declare const FetchPricesError: {
|
|
|
4571
4972
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
4572
4973
|
};
|
|
4573
4974
|
/**
|
|
4574
|
-
* Fetches quoted prices for multiple tokens.
|
|
4975
|
+
* Fetches quoted prices for multiple tokens as a token ID keyed lookup.
|
|
4575
4976
|
*
|
|
4576
4977
|
* @remarks
|
|
4577
4978
|
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
@@ -4661,7 +5062,7 @@ declare const FetchSpreadError: {
|
|
|
4661
5062
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
4662
5063
|
};
|
|
4663
5064
|
/**
|
|
4664
|
-
* Fetches the spread for a token.
|
|
5065
|
+
* Fetches the spread for a token as a decimal string.
|
|
4665
5066
|
*
|
|
4666
5067
|
* @remarks
|
|
4667
5068
|
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
@@ -4680,7 +5081,7 @@ declare const FetchSpreadError: {
|
|
|
4680
5081
|
* ```
|
|
4681
5082
|
*
|
|
4682
5083
|
*/
|
|
4683
|
-
declare function fetchSpread(client: BaseClient, request: FetchSpreadRequest): Promise<
|
|
5084
|
+
declare function fetchSpread(client: BaseClient, request: FetchSpreadRequest): Promise<DecimalString>;
|
|
4684
5085
|
declare const FetchSpreadsRequestSchema: z.ZodArray<z.ZodObject<{
|
|
4685
5086
|
tokenId: z.ZodString;
|
|
4686
5087
|
}, z.core.$strip>>;
|
|
@@ -4690,7 +5091,7 @@ declare const FetchSpreadsError: {
|
|
|
4690
5091
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
4691
5092
|
};
|
|
4692
5093
|
/**
|
|
4693
|
-
* Fetches spreads for multiple tokens.
|
|
5094
|
+
* Fetches spreads for multiple tokens as a token ID keyed lookup.
|
|
4694
5095
|
*
|
|
4695
5096
|
* @remarks
|
|
4696
5097
|
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
@@ -4711,7 +5112,7 @@ declare const FetchSpreadsError: {
|
|
|
4711
5112
|
* ```
|
|
4712
5113
|
*
|
|
4713
5114
|
*/
|
|
4714
|
-
declare function fetchSpreads(client: BaseClient, request: FetchSpreadsRequest): Promise<
|
|
5115
|
+
declare function fetchSpreads(client: BaseClient, request: FetchSpreadsRequest): Promise<Spreads>;
|
|
4715
5116
|
declare const FetchLastTradePriceRequestSchema: z.ZodObject<{
|
|
4716
5117
|
tokenId: z.ZodString;
|
|
4717
5118
|
}, z.core.$strip>;
|
|
@@ -4808,7 +5209,7 @@ declare const FetchPriceHistoryError: {
|
|
|
4808
5209
|
*/
|
|
4809
5210
|
declare function fetchPriceHistory(client: BaseClient, request: FetchPriceHistoryRequest): Promise<PriceHistoryPoint[]>;
|
|
4810
5211
|
declare const ListCurrentRewardsRequestSchema: z.ZodDefault<z.ZodObject<{
|
|
4811
|
-
cursor: z.ZodOptional<z.
|
|
5212
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
4812
5213
|
sponsored: z.ZodOptional<z.ZodBoolean>;
|
|
4813
5214
|
}, z.core.$strip>>;
|
|
4814
5215
|
type ListCurrentRewardsRequest = z.input<typeof ListCurrentRewardsRequestSchema>;
|
|
@@ -4851,7 +5252,7 @@ declare const ListCurrentRewardsError: {
|
|
|
4851
5252
|
declare function listCurrentRewards(client: BaseClient, request?: ListCurrentRewardsRequest): Paginated<CurrentReward[]>;
|
|
4852
5253
|
declare const ListMarketRewardsRequestSchema: z.ZodObject<{
|
|
4853
5254
|
conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
4854
|
-
cursor: z.ZodOptional<z.
|
|
5255
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
4855
5256
|
sponsored: z.ZodOptional<z.ZodBoolean>;
|
|
4856
5257
|
}, z.core.$strip>;
|
|
4857
5258
|
type ListMarketRewardsRequest = z.input<typeof ListMarketRewardsRequestSchema>;
|
|
@@ -4899,9 +5300,71 @@ declare const ListMarketRewardsError: {
|
|
|
4899
5300
|
*/
|
|
4900
5301
|
declare function listMarketRewards(client: BaseClient, request: ListMarketRewardsRequest): Paginated<MarketReward[]>;
|
|
4901
5302
|
|
|
5303
|
+
type PlanCollateralReturnError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
5304
|
+
declare const PlanCollateralReturnError: {
|
|
5305
|
+
isError(error: unknown): error is TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
5306
|
+
};
|
|
5307
|
+
/**
|
|
5308
|
+
* Plans a collateral return for the authenticated account.
|
|
5309
|
+
*
|
|
5310
|
+
* @remarks
|
|
5311
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
5312
|
+
*
|
|
5313
|
+
* @throws {@link PlanCollateralReturnError}
|
|
5314
|
+
* Thrown on failure.
|
|
5315
|
+
*/
|
|
5316
|
+
declare function planCollateralReturn(client: BaseSecureClient): Promise<CollateralReturnPlanResponse>;
|
|
5317
|
+
declare const ExecuteCollateralReturnPlanRequestSchema: z.ZodObject<{
|
|
5318
|
+
plan: z.ZodObject<{
|
|
5319
|
+
planHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
5320
|
+
chainId: z.ZodNumber;
|
|
5321
|
+
wallet: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress$1, string>>;
|
|
5322
|
+
routerCall: z.ZodPipe<z.ZodObject<{
|
|
5323
|
+
to: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress$1, string>>;
|
|
5324
|
+
data: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
5325
|
+
}, z.core.$strip>, z.ZodTransform<_polymarket_bindings_combos.CollateralReturnRouterCall, {
|
|
5326
|
+
to: EvmAddress$1;
|
|
5327
|
+
data: `0x${string}`;
|
|
5328
|
+
}>>;
|
|
5329
|
+
}, z.core.$loose>;
|
|
5330
|
+
}, z.core.$strip>;
|
|
5331
|
+
type ExecuteCollateralReturnPlanRequest = z.infer<typeof ExecuteCollateralReturnPlanRequestSchema>;
|
|
5332
|
+
type CollateralReturnExecutionWorkflow = AsyncGenerator<GaslessWorkflowRequest, TransactionHandle, EvmAddress$1 | EvmSignature | TransactionHandle>;
|
|
5333
|
+
type PrepareCollateralReturnExecutionError = RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
5334
|
+
declare const PrepareCollateralReturnExecutionError: {
|
|
5335
|
+
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError;
|
|
5336
|
+
};
|
|
5337
|
+
/**
|
|
5338
|
+
* Starts a collateral return execution workflow for a previously requested
|
|
5339
|
+
* plan.
|
|
5340
|
+
*
|
|
5341
|
+
* The workflow signs and submits the exact call carried by the plan.
|
|
5342
|
+
*
|
|
5343
|
+
* @remarks
|
|
5344
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
5345
|
+
*
|
|
5346
|
+
* @throws {@link PrepareCollateralReturnExecutionError}
|
|
5347
|
+
* Thrown on failure.
|
|
5348
|
+
*/
|
|
5349
|
+
declare function prepareCollateralReturnExecution(client: BaseSecureClient, request: ExecuteCollateralReturnPlanRequest): Promise<CollateralReturnExecutionWorkflow>;
|
|
5350
|
+
type ExecuteCollateralReturnPlanError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError | CancelledSigningError | SigningError;
|
|
5351
|
+
declare const ExecuteCollateralReturnPlanError: {
|
|
5352
|
+
isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
5353
|
+
};
|
|
5354
|
+
/**
|
|
5355
|
+
* Executes a collateral return plan for the authenticated account.
|
|
5356
|
+
*
|
|
5357
|
+
* @remarks
|
|
5358
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
5359
|
+
*
|
|
5360
|
+
* @throws {@link ExecuteCollateralReturnPlanError}
|
|
5361
|
+
* Thrown on failure.
|
|
5362
|
+
*/
|
|
5363
|
+
declare function executeCollateralReturnPlan(client: BaseSecureClient, request: ExecuteCollateralReturnPlanRequest): Promise<TransactionHandle>;
|
|
5364
|
+
|
|
4902
5365
|
declare const ListCommentsRequestSchema: z.ZodObject<{
|
|
4903
5366
|
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
4904
|
-
cursor: z.ZodOptional<z.
|
|
5367
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
4905
5368
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
4906
5369
|
getPositions: z.ZodOptional<z.ZodBoolean>;
|
|
4907
5370
|
holdersOnly: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -4916,7 +5379,7 @@ declare const FetchCommentsByIdRequestSchema: z.ZodObject<{
|
|
|
4916
5379
|
declare const ListCommentsByUserAddressRequestSchema: z.ZodObject<{
|
|
4917
5380
|
address: z.ZodString;
|
|
4918
5381
|
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
4919
|
-
cursor: z.ZodOptional<z.
|
|
5382
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
4920
5383
|
order: z.ZodOptional<z.ZodString>;
|
|
4921
5384
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
4922
5385
|
}, z.core.$strip>;
|
|
@@ -5041,7 +5504,7 @@ declare function listCommentsByUserAddress(client: BaseClient, request: ListComm
|
|
|
5041
5504
|
declare const ListEventsRequestSchema: z.ZodObject<{
|
|
5042
5505
|
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
5043
5506
|
closed: z.ZodDefault<z.ZodBoolean>;
|
|
5044
|
-
cursor: z.ZodOptional<z.
|
|
5507
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
5045
5508
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
5046
5509
|
cyom: z.ZodOptional<z.ZodBoolean>;
|
|
5047
5510
|
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>>]>>;
|
|
@@ -5240,7 +5703,7 @@ declare const FetchEventLiveVolumeError: {
|
|
|
5240
5703
|
declare function fetchEventLiveVolume(client: BaseClient, request: FetchEventLiveVolumeRequest): Promise<LiveVolume[]>;
|
|
5241
5704
|
|
|
5242
5705
|
declare const ListBuilderLeaderboardRequestSchema: z.ZodObject<{
|
|
5243
|
-
cursor: z.ZodOptional<z.
|
|
5706
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
5244
5707
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
5245
5708
|
timePeriod: z.ZodOptional<z.ZodEnum<{
|
|
5246
5709
|
DAY: "DAY";
|
|
@@ -5270,7 +5733,7 @@ declare const ListTraderLeaderboardRequestSchema: z.ZodObject<{
|
|
|
5270
5733
|
TECH: "TECH";
|
|
5271
5734
|
FINANCE: "FINANCE";
|
|
5272
5735
|
}>>;
|
|
5273
|
-
cursor: z.ZodOptional<z.
|
|
5736
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
5274
5737
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
5275
5738
|
timePeriod: z.ZodOptional<z.ZodEnum<{
|
|
5276
5739
|
DAY: "DAY";
|
|
@@ -5400,11 +5863,68 @@ declare const ListTraderLeaderboardError: {
|
|
|
5400
5863
|
*/
|
|
5401
5864
|
declare function listTraderLeaderboard(client: BaseClient, request?: ListTraderLeaderboardRequest): Paginated<TraderLeaderboardEntry[]>;
|
|
5402
5865
|
|
|
5866
|
+
declare const ListMarketClarificationsRequestSchema: z.ZodObject<{
|
|
5867
|
+
marketId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
5868
|
+
eventId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
5869
|
+
questionId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
5870
|
+
state: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof MarketClarificationState>, z.ZodArray<z.ZodEnum<typeof MarketClarificationState>>]>>;
|
|
5871
|
+
showInFrontend: z.ZodOptional<z.ZodBoolean>;
|
|
5872
|
+
txHash: z.ZodOptional<z.ZodString>;
|
|
5873
|
+
order: z.ZodOptional<z.ZodString>;
|
|
5874
|
+
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
5875
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
5876
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
5877
|
+
}, z.core.$strip>;
|
|
5878
|
+
type ListMarketClarificationsRequest = z.input<typeof ListMarketClarificationsRequestSchema>;
|
|
5879
|
+
type ListMarketClarificationsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
5880
|
+
declare const ListMarketClarificationsError: {
|
|
5881
|
+
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
5882
|
+
};
|
|
5883
|
+
/**
|
|
5884
|
+
* Lists market clarifications — official notes that resolve ambiguity in how a
|
|
5885
|
+
* market settles.
|
|
5886
|
+
*
|
|
5887
|
+
* @remarks
|
|
5888
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
5889
|
+
*
|
|
5890
|
+
* @throws {@link ListMarketClarificationsError}
|
|
5891
|
+
* Thrown on failure.
|
|
5892
|
+
*
|
|
5893
|
+
* @example
|
|
5894
|
+
* Fetch the first page of results:
|
|
5895
|
+
* ```ts
|
|
5896
|
+
* const result = listMarketClarifications(client, {
|
|
5897
|
+
* marketId: '512038',
|
|
5898
|
+
* pageSize: 25,
|
|
5899
|
+
* });
|
|
5900
|
+
*
|
|
5901
|
+
* const firstPage = await result.firstPage();
|
|
5902
|
+
*
|
|
5903
|
+
* // Optionally, fetch additional pages:
|
|
5904
|
+
* for await (const page of result.from(firstPage.nextCursor)) {
|
|
5905
|
+
* // page.items: MarketClarification[]
|
|
5906
|
+
* }
|
|
5907
|
+
* ```
|
|
5908
|
+
*
|
|
5909
|
+
* @example
|
|
5910
|
+
* Loop through all pages with `for await`:
|
|
5911
|
+
* ```ts
|
|
5912
|
+
* const result = listMarketClarifications(client, {
|
|
5913
|
+
* marketId: '512038',
|
|
5914
|
+
* });
|
|
5915
|
+
*
|
|
5916
|
+
* for await (const page of result) {
|
|
5917
|
+
* // page.items: MarketClarification[]
|
|
5918
|
+
* }
|
|
5919
|
+
* ```
|
|
5920
|
+
*/
|
|
5921
|
+
declare function listMarketClarifications(client: BaseClient, request?: ListMarketClarificationsRequest): Paginated<MarketClarification[]>;
|
|
5922
|
+
|
|
5403
5923
|
declare const ListMarketsRequestSchema: z.ZodObject<{
|
|
5404
5924
|
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
5405
5925
|
closed: z.ZodOptional<z.ZodBoolean>;
|
|
5406
5926
|
clobTokenIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5407
|
-
cursor: z.ZodOptional<z.
|
|
5927
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
5408
5928
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
5409
5929
|
conditionIds: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.CtfConditionId, string>>>>;
|
|
5410
5930
|
cyom: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -5465,7 +5985,7 @@ declare const ListOpenInterestRequestSchema: z.ZodObject<{
|
|
|
5465
5985
|
market: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5466
5986
|
}, z.core.$strip>;
|
|
5467
5987
|
declare const ListMarketPositionsRequestSchema: z.ZodObject<{
|
|
5468
|
-
cursor: z.ZodOptional<z.
|
|
5988
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
5469
5989
|
market: z.ZodString;
|
|
5470
5990
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
5471
5991
|
user: z.ZodOptional<z.ZodString>;
|
|
@@ -5535,7 +6055,7 @@ declare const ListMarketsError: {
|
|
|
5535
6055
|
*/
|
|
5536
6056
|
declare function listMarkets(client: BaseClient, request?: ListMarketsRequest): Paginated<Market[]>;
|
|
5537
6057
|
declare const ListComboMarketsRequestSchema: z.ZodObject<{
|
|
5538
|
-
cursor: z.ZodOptional<z.
|
|
6058
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
5539
6059
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
5540
6060
|
exclude: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.CtfConditionId, string>>>>;
|
|
5541
6061
|
}, z.core.$strip>;
|
|
@@ -5727,196 +6247,138 @@ declare const ListMarketPositionsError: {
|
|
|
5727
6247
|
*/
|
|
5728
6248
|
declare function listMarketPositions(client: BaseClient, request: ListMarketPositionsRequest): Paginated<MetaMarketPosition[]>;
|
|
5729
6249
|
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
instrumentId
|
|
5743
|
-
}
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
clientOrderId
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
end?: number
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
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<{
|
|
6250
|
+
/**
|
|
6251
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6252
|
+
*/
|
|
6253
|
+
type FetchPerpsAccountConfigRequest = {
|
|
6254
|
+
/** Optional Perps instrument identifier filter. */
|
|
6255
|
+
instrumentId?: number;
|
|
6256
|
+
};
|
|
6257
|
+
/**
|
|
6258
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6259
|
+
*/
|
|
6260
|
+
type FetchPerpsOpenOrdersRequest = {
|
|
6261
|
+
/** Optional Perps instrument identifier filter. */
|
|
6262
|
+
instrumentId?: number;
|
|
6263
|
+
};
|
|
6264
|
+
/**
|
|
6265
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6266
|
+
*/
|
|
6267
|
+
type FetchPerpsOrdersRequest = {
|
|
6268
|
+
/** Optional order identifier filter. */
|
|
6269
|
+
orderId?: number;
|
|
6270
|
+
/** Optional caller-supplied idempotency identifier filter. */
|
|
6271
|
+
clientOrderId?: string;
|
|
6272
|
+
/** Optional Perps instrument identifier filter. */
|
|
6273
|
+
instrumentId?: number;
|
|
6274
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
6275
|
+
start?: number;
|
|
6276
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
6277
|
+
end?: number;
|
|
6278
|
+
};
|
|
6279
|
+
/**
|
|
6280
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6281
|
+
*/
|
|
6282
|
+
type ListPerpsFillsRequest = {
|
|
6283
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
6284
|
+
start?: number;
|
|
6285
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
6286
|
+
end?: number;
|
|
6287
|
+
/** Opaque cursor returned by a previous page. */
|
|
6288
|
+
cursor?: PaginationCursor;
|
|
6289
|
+
} | {
|
|
6290
|
+
/** Opaque cursor returned by a previous page. */
|
|
5838
6291
|
cursor: PaginationCursor;
|
|
5839
|
-
|
|
5840
|
-
|
|
6292
|
+
};
|
|
6293
|
+
/**
|
|
6294
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6295
|
+
*/
|
|
6296
|
+
type ListPerpsFundingPaymentsRequest = {
|
|
6297
|
+
/** Optional Perps instrument identifier filter. */
|
|
6298
|
+
instrumentId?: number;
|
|
6299
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
6300
|
+
start?: number;
|
|
6301
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
6302
|
+
end?: number;
|
|
6303
|
+
/** Opaque cursor returned by a previous page. */
|
|
6304
|
+
cursor?: PaginationCursor;
|
|
6305
|
+
} | {
|
|
6306
|
+
/** Opaque cursor returned by a previous page. */
|
|
5841
6307
|
cursor: PaginationCursor;
|
|
5842
|
-
}
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
hash
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
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<{
|
|
6308
|
+
};
|
|
6309
|
+
/**
|
|
6310
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6311
|
+
*/
|
|
6312
|
+
type ListPerpsDepositsRequest = {
|
|
6313
|
+
/** Optional deposit status filter. */
|
|
6314
|
+
depositStatus?: PerpsDepositStatus;
|
|
6315
|
+
/** Optional transaction hash filter. */
|
|
6316
|
+
hash?: string;
|
|
6317
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
6318
|
+
start?: number;
|
|
6319
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
6320
|
+
end?: number;
|
|
6321
|
+
/** Opaque cursor returned by a previous page. */
|
|
6322
|
+
cursor?: PaginationCursor;
|
|
6323
|
+
} | {
|
|
6324
|
+
/** Opaque cursor returned by a previous page. */
|
|
5867
6325
|
cursor: PaginationCursor;
|
|
5868
|
-
|
|
5869
|
-
|
|
6326
|
+
};
|
|
6327
|
+
/**
|
|
6328
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6329
|
+
*/
|
|
6330
|
+
type ListPerpsWithdrawalsRequest = {
|
|
6331
|
+
/** Optional withdrawal status filter. */
|
|
6332
|
+
withdrawalStatus?: PerpsWithdrawalStatus;
|
|
6333
|
+
/** Optional transaction hash filter. */
|
|
6334
|
+
hash?: string;
|
|
6335
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
6336
|
+
start?: number;
|
|
6337
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
6338
|
+
end?: number;
|
|
6339
|
+
/** Opaque cursor returned by a previous page. */
|
|
6340
|
+
cursor?: PaginationCursor;
|
|
6341
|
+
} | {
|
|
6342
|
+
/** Opaque cursor returned by a previous page. */
|
|
5870
6343
|
cursor: PaginationCursor;
|
|
5871
|
-
}
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
cursor: PaginationCursor | undefined;
|
|
5880
|
-
params: PerpsIntervalHistoryParams;
|
|
5881
|
-
}, {
|
|
5882
|
-
interval: _polymarket_bindings_perps.PerpsPnlInterval;
|
|
6344
|
+
};
|
|
6345
|
+
/**
|
|
6346
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6347
|
+
*/
|
|
6348
|
+
type ListPerpsEquityHistoryRequest = {
|
|
6349
|
+
/** History interval. */
|
|
6350
|
+
interval: PerpsPnlInterval;
|
|
6351
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
5883
6352
|
start: number;
|
|
5884
|
-
end
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
cursor
|
|
5888
|
-
}
|
|
5889
|
-
cursor
|
|
5890
|
-
params: undefined;
|
|
5891
|
-
}, {
|
|
6353
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
6354
|
+
end?: number;
|
|
6355
|
+
/** Opaque cursor returned by a previous page. */
|
|
6356
|
+
cursor?: PaginationCursor;
|
|
6357
|
+
} | {
|
|
6358
|
+
/** Opaque cursor returned by a previous page. */
|
|
5892
6359
|
cursor: PaginationCursor;
|
|
5893
|
-
}
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
cursor: PaginationCursor | undefined;
|
|
5902
|
-
params: PerpsIntervalHistoryParams;
|
|
5903
|
-
}, {
|
|
5904
|
-
interval: _polymarket_bindings_perps.PerpsPnlInterval;
|
|
6360
|
+
};
|
|
6361
|
+
/**
|
|
6362
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6363
|
+
*/
|
|
6364
|
+
type ListPerpsPnlHistoryRequest = {
|
|
6365
|
+
/** History interval. */
|
|
6366
|
+
interval: PerpsPnlInterval;
|
|
6367
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
5905
6368
|
start: number;
|
|
5906
|
-
end
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
cursor
|
|
5910
|
-
}
|
|
5911
|
-
cursor
|
|
5912
|
-
params: undefined;
|
|
5913
|
-
}, {
|
|
6369
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
6370
|
+
end?: number;
|
|
6371
|
+
/** Opaque cursor returned by a previous page. */
|
|
6372
|
+
cursor?: PaginationCursor;
|
|
6373
|
+
} | {
|
|
6374
|
+
/** Opaque cursor returned by a previous page. */
|
|
5914
6375
|
cursor: PaginationCursor;
|
|
5915
|
-
}
|
|
5916
|
-
type ListPerpsPnlHistoryRequest = z.input<typeof ListPerpsPnlHistoryRequestSchema>;
|
|
6376
|
+
};
|
|
5917
6377
|
|
|
5918
6378
|
/**
|
|
5919
6379
|
* Good-til-cancelled Perps order.
|
|
6380
|
+
*
|
|
6381
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
5920
6382
|
*/
|
|
5921
6383
|
type PerpsPlaceGtcOrderRequest = {
|
|
5922
6384
|
/** Perps instrument identifier to trade. */
|
|
@@ -5931,11 +6393,15 @@ type PerpsPlaceGtcOrderRequest = {
|
|
|
5931
6393
|
timeInForce: PerpsTimeInForce.GTC;
|
|
5932
6394
|
/** Whether the order must rest instead of taking liquidity. */
|
|
5933
6395
|
postOnly?: boolean;
|
|
6396
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6397
|
+
reduceOnly?: boolean;
|
|
5934
6398
|
/** Optional caller-supplied idempotency identifier. */
|
|
5935
6399
|
clientOrderId?: string;
|
|
5936
6400
|
};
|
|
5937
6401
|
/**
|
|
5938
6402
|
* Immediate-or-cancel Perps order.
|
|
6403
|
+
*
|
|
6404
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
5939
6405
|
*/
|
|
5940
6406
|
type PerpsPlaceIocOrderRequest = {
|
|
5941
6407
|
/** Perps instrument identifier to trade. */
|
|
@@ -5948,12 +6414,16 @@ type PerpsPlaceIocOrderRequest = {
|
|
|
5948
6414
|
quantity: PerpsDecimalInput;
|
|
5949
6415
|
/** Immediate-or-cancel execution. */
|
|
5950
6416
|
timeInForce: PerpsTimeInForce.IOC;
|
|
5951
|
-
postOnly?:
|
|
6417
|
+
postOnly?: never;
|
|
6418
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6419
|
+
reduceOnly?: boolean;
|
|
5952
6420
|
/** Optional caller-supplied idempotency identifier. */
|
|
5953
6421
|
clientOrderId?: string;
|
|
5954
6422
|
};
|
|
5955
6423
|
/**
|
|
5956
6424
|
* Fill-or-kill Perps order.
|
|
6425
|
+
*
|
|
6426
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
5957
6427
|
*/
|
|
5958
6428
|
type PerpsPlaceFokOrderRequest = {
|
|
5959
6429
|
/** Perps instrument identifier to trade. */
|
|
@@ -5966,61 +6436,333 @@ type PerpsPlaceFokOrderRequest = {
|
|
|
5966
6436
|
quantity: PerpsDecimalInput;
|
|
5967
6437
|
/** Fill-or-kill execution. */
|
|
5968
6438
|
timeInForce: PerpsTimeInForce.FOK;
|
|
5969
|
-
postOnly?:
|
|
6439
|
+
postOnly?: never;
|
|
6440
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6441
|
+
reduceOnly?: boolean;
|
|
5970
6442
|
/** Optional caller-supplied idempotency identifier. */
|
|
5971
6443
|
clientOrderId?: string;
|
|
5972
6444
|
};
|
|
5973
6445
|
/**
|
|
5974
|
-
* Request parameters for
|
|
6446
|
+
* Request parameters for one Perps order.
|
|
6447
|
+
*
|
|
6448
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6449
|
+
*/
|
|
6450
|
+
type PerpsOrderRequest = PerpsPlaceGtcOrderRequest | PerpsPlaceIocOrderRequest | PerpsPlaceFokOrderRequest;
|
|
6451
|
+
/**
|
|
6452
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6453
|
+
*/
|
|
6454
|
+
type PerpsTpSlTrigger = {
|
|
6455
|
+
triggerPrice: PerpsDecimalInput;
|
|
6456
|
+
limitPrice?: PerpsDecimalInput;
|
|
6457
|
+
};
|
|
6458
|
+
/**
|
|
6459
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6460
|
+
*/
|
|
6461
|
+
type PerpsPositionTpSlTrigger = {
|
|
6462
|
+
triggerPrice: PerpsDecimalInput;
|
|
6463
|
+
};
|
|
6464
|
+
/**
|
|
6465
|
+
* Request parameters for posting one or more Perps orders.
|
|
6466
|
+
*
|
|
6467
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
5975
6468
|
*/
|
|
5976
|
-
type PlacePerpsOrderRequest = PerpsPlaceGtcOrderRequest | PerpsPlaceIocOrderRequest | PerpsPlaceFokOrderRequest;
|
|
5977
|
-
/** Request parameters for posting one or more Perps orders. */
|
|
5978
6469
|
type PostPerpsOrdersRequest = {
|
|
5979
6470
|
/** Orders to post as one command. */
|
|
5980
|
-
orders:
|
|
6471
|
+
orders: PerpsOrderRequest[];
|
|
5981
6472
|
/** Optional command expiration timestamp in milliseconds. */
|
|
5982
6473
|
expiresAt?: number;
|
|
5983
6474
|
};
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
}
|
|
6009
|
-
|
|
6475
|
+
/**
|
|
6476
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6477
|
+
*/
|
|
6478
|
+
type PlacePerpsOrderRequest = {
|
|
6479
|
+
/** Perps instrument identifier to trade. */
|
|
6480
|
+
instrumentId: number;
|
|
6481
|
+
/** Trade direction. */
|
|
6482
|
+
side: OrderSide;
|
|
6483
|
+
/** Limit price. */
|
|
6484
|
+
price: PerpsDecimalInput;
|
|
6485
|
+
/** Order quantity. */
|
|
6486
|
+
quantity: PerpsDecimalInput;
|
|
6487
|
+
/** Good-til-cancelled execution. */
|
|
6488
|
+
timeInForce: PerpsTimeInForce.GTC;
|
|
6489
|
+
/** Whether the order must rest instead of taking liquidity. */
|
|
6490
|
+
postOnly?: boolean;
|
|
6491
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6492
|
+
reduceOnly?: boolean;
|
|
6493
|
+
/** Optional caller-supplied idempotency identifier. */
|
|
6494
|
+
clientOrderId?: string;
|
|
6495
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6496
|
+
expiresAt?: number;
|
|
6497
|
+
takeProfit?: never;
|
|
6498
|
+
stopLoss?: never;
|
|
6499
|
+
} | {
|
|
6500
|
+
/** Perps instrument identifier to trade. */
|
|
6501
|
+
instrumentId: number;
|
|
6502
|
+
/** Trade direction. */
|
|
6503
|
+
side: OrderSide;
|
|
6504
|
+
/** Optional limit price. Omit for market-style execution. */
|
|
6505
|
+
price?: PerpsDecimalInput;
|
|
6506
|
+
/** Order quantity. */
|
|
6507
|
+
quantity: PerpsDecimalInput;
|
|
6508
|
+
/** Immediate-or-cancel execution. */
|
|
6509
|
+
timeInForce: PerpsTimeInForce.IOC;
|
|
6510
|
+
postOnly?: never;
|
|
6511
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6512
|
+
reduceOnly?: boolean;
|
|
6513
|
+
/** Optional caller-supplied idempotency identifier. */
|
|
6514
|
+
clientOrderId?: string;
|
|
6515
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6516
|
+
expiresAt?: number;
|
|
6517
|
+
takeProfit?: never;
|
|
6518
|
+
stopLoss?: never;
|
|
6519
|
+
} | {
|
|
6520
|
+
/** Perps instrument identifier to trade. */
|
|
6521
|
+
instrumentId: number;
|
|
6522
|
+
/** Trade direction. */
|
|
6523
|
+
side: OrderSide;
|
|
6524
|
+
/** Optional limit price. Omit for market-style execution. */
|
|
6525
|
+
price?: PerpsDecimalInput;
|
|
6526
|
+
/** Order quantity. */
|
|
6527
|
+
quantity: PerpsDecimalInput;
|
|
6528
|
+
/** Fill-or-kill execution. */
|
|
6529
|
+
timeInForce: PerpsTimeInForce.FOK;
|
|
6530
|
+
postOnly?: never;
|
|
6531
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6532
|
+
reduceOnly?: boolean;
|
|
6533
|
+
/** Optional caller-supplied idempotency identifier. */
|
|
6534
|
+
clientOrderId?: string;
|
|
6535
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6536
|
+
expiresAt?: number;
|
|
6537
|
+
takeProfit?: never;
|
|
6538
|
+
stopLoss?: never;
|
|
6539
|
+
};
|
|
6540
|
+
/**
|
|
6541
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6542
|
+
*/
|
|
6543
|
+
type PlacePerpsOrderWithTpSlRequest = {
|
|
6544
|
+
/** Perps instrument identifier to trade. */
|
|
6545
|
+
instrumentId: number;
|
|
6546
|
+
/** Trade direction. */
|
|
6547
|
+
side: OrderSide;
|
|
6548
|
+
/** Limit price. */
|
|
6549
|
+
price: PerpsDecimalInput;
|
|
6550
|
+
/** Order quantity. */
|
|
6551
|
+
quantity: PerpsDecimalInput;
|
|
6552
|
+
/** Good-til-cancelled execution. */
|
|
6553
|
+
timeInForce: PerpsTimeInForce.GTC;
|
|
6554
|
+
/** Whether the order must rest instead of taking liquidity. */
|
|
6555
|
+
postOnly?: boolean;
|
|
6556
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6557
|
+
reduceOnly?: boolean;
|
|
6558
|
+
/** Optional caller-supplied idempotency identifier. */
|
|
6559
|
+
clientOrderId?: string;
|
|
6560
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6561
|
+
expiresAt?: number;
|
|
6562
|
+
/** Take-profit trigger to place with the entry order. */
|
|
6563
|
+
takeProfit: PerpsTpSlTrigger;
|
|
6564
|
+
/** Optional stop-loss trigger to place with the entry order. */
|
|
6565
|
+
stopLoss?: PerpsTpSlTrigger;
|
|
6566
|
+
} | {
|
|
6567
|
+
/** Perps instrument identifier to trade. */
|
|
6568
|
+
instrumentId: number;
|
|
6569
|
+
/** Trade direction. */
|
|
6570
|
+
side: OrderSide;
|
|
6571
|
+
/** Limit price. */
|
|
6572
|
+
price: PerpsDecimalInput;
|
|
6573
|
+
/** Order quantity. */
|
|
6574
|
+
quantity: PerpsDecimalInput;
|
|
6575
|
+
/** Good-til-cancelled execution. */
|
|
6576
|
+
timeInForce: PerpsTimeInForce.GTC;
|
|
6577
|
+
/** Whether the order must rest instead of taking liquidity. */
|
|
6578
|
+
postOnly?: boolean;
|
|
6579
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6580
|
+
reduceOnly?: boolean;
|
|
6581
|
+
/** Optional caller-supplied idempotency identifier. */
|
|
6582
|
+
clientOrderId?: string;
|
|
6583
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6584
|
+
expiresAt?: number;
|
|
6585
|
+
/** Optional take-profit trigger to place with the entry order. */
|
|
6586
|
+
takeProfit?: PerpsTpSlTrigger;
|
|
6587
|
+
/** Stop-loss trigger to place with the entry order. */
|
|
6588
|
+
stopLoss: PerpsTpSlTrigger;
|
|
6589
|
+
} | {
|
|
6590
|
+
/** Perps instrument identifier to trade. */
|
|
6591
|
+
instrumentId: number;
|
|
6592
|
+
/** Trade direction. */
|
|
6593
|
+
side: OrderSide;
|
|
6594
|
+
/** Optional limit price. Omit for market-style execution. */
|
|
6595
|
+
price?: PerpsDecimalInput;
|
|
6596
|
+
/** Order quantity. */
|
|
6597
|
+
quantity: PerpsDecimalInput;
|
|
6598
|
+
/** Immediate-or-cancel execution. */
|
|
6599
|
+
timeInForce: PerpsTimeInForce.IOC;
|
|
6600
|
+
postOnly?: never;
|
|
6601
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6602
|
+
reduceOnly?: boolean;
|
|
6603
|
+
/** Optional caller-supplied idempotency identifier. */
|
|
6604
|
+
clientOrderId?: string;
|
|
6605
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6606
|
+
expiresAt?: number;
|
|
6607
|
+
/** Take-profit trigger to place with the entry order. */
|
|
6608
|
+
takeProfit: PerpsTpSlTrigger;
|
|
6609
|
+
/** Optional stop-loss trigger to place with the entry order. */
|
|
6610
|
+
stopLoss?: PerpsTpSlTrigger;
|
|
6611
|
+
} | {
|
|
6612
|
+
/** Perps instrument identifier to trade. */
|
|
6613
|
+
instrumentId: number;
|
|
6614
|
+
/** Trade direction. */
|
|
6615
|
+
side: OrderSide;
|
|
6616
|
+
/** Optional limit price. Omit for market-style execution. */
|
|
6617
|
+
price?: PerpsDecimalInput;
|
|
6618
|
+
/** Order quantity. */
|
|
6619
|
+
quantity: PerpsDecimalInput;
|
|
6620
|
+
/** Immediate-or-cancel execution. */
|
|
6621
|
+
timeInForce: PerpsTimeInForce.IOC;
|
|
6622
|
+
postOnly?: never;
|
|
6623
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6624
|
+
reduceOnly?: boolean;
|
|
6625
|
+
/** Optional caller-supplied idempotency identifier. */
|
|
6626
|
+
clientOrderId?: string;
|
|
6627
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6628
|
+
expiresAt?: number;
|
|
6629
|
+
/** Optional take-profit trigger to place with the entry order. */
|
|
6630
|
+
takeProfit?: PerpsTpSlTrigger;
|
|
6631
|
+
/** Stop-loss trigger to place with the entry order. */
|
|
6632
|
+
stopLoss: PerpsTpSlTrigger;
|
|
6633
|
+
} | {
|
|
6634
|
+
/** Perps instrument identifier to trade. */
|
|
6635
|
+
instrumentId: number;
|
|
6636
|
+
/** Trade direction. */
|
|
6637
|
+
side: OrderSide;
|
|
6638
|
+
/** Optional limit price. Omit for market-style execution. */
|
|
6639
|
+
price?: PerpsDecimalInput;
|
|
6640
|
+
/** Order quantity. */
|
|
6641
|
+
quantity: PerpsDecimalInput;
|
|
6642
|
+
/** Fill-or-kill execution. */
|
|
6643
|
+
timeInForce: PerpsTimeInForce.FOK;
|
|
6644
|
+
postOnly?: never;
|
|
6645
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6646
|
+
reduceOnly?: boolean;
|
|
6647
|
+
/** Optional caller-supplied idempotency identifier. */
|
|
6648
|
+
clientOrderId?: string;
|
|
6649
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6650
|
+
expiresAt?: number;
|
|
6651
|
+
/** Take-profit trigger to place with the entry order. */
|
|
6652
|
+
takeProfit: PerpsTpSlTrigger;
|
|
6653
|
+
/** Optional stop-loss trigger to place with the entry order. */
|
|
6654
|
+
stopLoss?: PerpsTpSlTrigger;
|
|
6655
|
+
} | {
|
|
6656
|
+
/** Perps instrument identifier to trade. */
|
|
6657
|
+
instrumentId: number;
|
|
6658
|
+
/** Trade direction. */
|
|
6659
|
+
side: OrderSide;
|
|
6660
|
+
/** Optional limit price. Omit for market-style execution. */
|
|
6661
|
+
price?: PerpsDecimalInput;
|
|
6662
|
+
/** Order quantity. */
|
|
6663
|
+
quantity: PerpsDecimalInput;
|
|
6664
|
+
/** Fill-or-kill execution. */
|
|
6665
|
+
timeInForce: PerpsTimeInForce.FOK;
|
|
6666
|
+
postOnly?: never;
|
|
6667
|
+
/** Whether the order may only reduce or close an existing position. */
|
|
6668
|
+
reduceOnly?: boolean;
|
|
6669
|
+
/** Optional caller-supplied idempotency identifier. */
|
|
6670
|
+
clientOrderId?: string;
|
|
6671
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6672
|
+
expiresAt?: number;
|
|
6673
|
+
/** Optional take-profit trigger to place with the entry order. */
|
|
6674
|
+
takeProfit?: PerpsTpSlTrigger;
|
|
6675
|
+
/** Stop-loss trigger to place with the entry order. */
|
|
6676
|
+
stopLoss: PerpsTpSlTrigger;
|
|
6677
|
+
};
|
|
6678
|
+
/**
|
|
6679
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6680
|
+
*/
|
|
6681
|
+
type PlacePerpsPositionTpSlRequest = {
|
|
6682
|
+
/** Perps instrument identifier whose current position should receive TP/SL protection. */
|
|
6683
|
+
instrumentId: number;
|
|
6684
|
+
/** Take-profit trigger to place for the current position. */
|
|
6685
|
+
takeProfit: PerpsPositionTpSlTrigger;
|
|
6686
|
+
/** Optional stop-loss trigger to place alongside the take-profit. */
|
|
6687
|
+
stopLoss?: PerpsPositionTpSlTrigger;
|
|
6688
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6689
|
+
expiresAt?: number;
|
|
6690
|
+
} | {
|
|
6691
|
+
/** Perps instrument identifier whose current position should receive TP/SL protection. */
|
|
6692
|
+
instrumentId: number;
|
|
6693
|
+
/** Optional take-profit trigger to place alongside the stop-loss. */
|
|
6694
|
+
takeProfit?: PerpsPositionTpSlTrigger;
|
|
6695
|
+
/** Stop-loss trigger to place for the current position. */
|
|
6696
|
+
stopLoss: PerpsPositionTpSlTrigger;
|
|
6697
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6698
|
+
expiresAt?: number;
|
|
6699
|
+
};
|
|
6700
|
+
/**
|
|
6701
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6702
|
+
*/
|
|
6703
|
+
type CancelPerpsOrderRequest = {
|
|
6704
|
+
/** Order identifier to cancel. */
|
|
6705
|
+
orderId: number;
|
|
6706
|
+
clientOrderId?: never;
|
|
6707
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6708
|
+
expiresAt?: number;
|
|
6709
|
+
} | {
|
|
6710
|
+
/** Caller-supplied idempotency identifier to cancel. */
|
|
6711
|
+
clientOrderId: string;
|
|
6712
|
+
orderId?: never;
|
|
6713
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6714
|
+
expiresAt?: number;
|
|
6715
|
+
};
|
|
6716
|
+
/**
|
|
6717
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6718
|
+
*/
|
|
6719
|
+
type CancelPerpsOrdersRequest = {
|
|
6720
|
+
/** Order identifiers to cancel. */
|
|
6721
|
+
orderIds: number[];
|
|
6722
|
+
clientOrderIds?: never;
|
|
6723
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6724
|
+
expiresAt?: number;
|
|
6725
|
+
} | {
|
|
6726
|
+
/** Caller-supplied idempotency identifiers to cancel. */
|
|
6727
|
+
clientOrderIds: string[];
|
|
6728
|
+
orderIds?: never;
|
|
6729
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6730
|
+
expiresAt?: number;
|
|
6731
|
+
};
|
|
6732
|
+
/**
|
|
6733
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6734
|
+
*/
|
|
6735
|
+
type CancelAllPerpsOrdersRequest = {
|
|
6736
|
+
/** Optional Perps instrument identifier to scope cancellation. */
|
|
6737
|
+
instrumentId?: number;
|
|
6738
|
+
/** Optional command expiration timestamp in milliseconds. */
|
|
6739
|
+
expiresAt?: number;
|
|
6740
|
+
};
|
|
6741
|
+
/**
|
|
6742
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6743
|
+
*/
|
|
6744
|
+
type UpdatePerpsLeverageRequest = {
|
|
6745
|
+
/** Perps instrument identifier whose leverage should be updated. */
|
|
6746
|
+
instrumentId: number;
|
|
6747
|
+
/** Target leverage multiplier. */
|
|
6748
|
+
leverage: number;
|
|
6749
|
+
/** Whether the instrument should use cross margin. */
|
|
6750
|
+
crossMargin: boolean;
|
|
6751
|
+
};
|
|
6752
|
+
/**
|
|
6753
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6754
|
+
*/
|
|
6010
6755
|
type UpdatePerpsLeverageError = RequestRejectedError | SigningError | TransportError | UserInputError;
|
|
6756
|
+
/**
|
|
6757
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6758
|
+
*/
|
|
6011
6759
|
declare const UpdatePerpsLeverageError: {
|
|
6012
6760
|
isError(error: unknown): error is SigningError | TransportError | UserInputError | RequestRejectedError;
|
|
6013
6761
|
};
|
|
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>>]>;
|
|
6017
|
-
}, z.core.$strip>;
|
|
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
6762
|
|
|
6763
|
+
/**
|
|
6764
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6765
|
+
*/
|
|
6024
6766
|
type PerpsSessionOptions = {
|
|
6025
6767
|
chainId: number;
|
|
6026
6768
|
credentials: PerpsCredentials;
|
|
@@ -6029,43 +6771,286 @@ type PerpsSessionOptions = {
|
|
|
6029
6771
|
restUrl: string;
|
|
6030
6772
|
wsUrl: string;
|
|
6031
6773
|
};
|
|
6774
|
+
/**
|
|
6775
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6776
|
+
*/
|
|
6777
|
+
type PerpsSessionLifecycleError = RequestRejectedError | TransportError;
|
|
6778
|
+
/**
|
|
6779
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6780
|
+
*/
|
|
6781
|
+
type PerpsSessionAccountError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
6782
|
+
/**
|
|
6783
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6784
|
+
*/
|
|
6785
|
+
type PerpsSessionTradingError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
6786
|
+
/**
|
|
6787
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6788
|
+
*/
|
|
6789
|
+
type PerpsPlacedTpSlOrder = {
|
|
6790
|
+
orderId: PerpsOrderId;
|
|
6791
|
+
};
|
|
6792
|
+
/**
|
|
6793
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6794
|
+
*/
|
|
6795
|
+
type PerpsPlacedTpSlOrders = {
|
|
6796
|
+
takeProfit?: PerpsPlacedTpSlOrder;
|
|
6797
|
+
stopLoss?: PerpsPlacedTpSlOrder;
|
|
6798
|
+
};
|
|
6799
|
+
/**
|
|
6800
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6801
|
+
*/
|
|
6802
|
+
type PlacePerpsOrderResult = {
|
|
6803
|
+
order: PerpsOrder;
|
|
6804
|
+
};
|
|
6805
|
+
/**
|
|
6806
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6807
|
+
*/
|
|
6808
|
+
type PlacePerpsOrderWithTpSlResult = PlacePerpsOrderResult & {
|
|
6809
|
+
tpSl: PerpsPlacedTpSlOrders;
|
|
6810
|
+
};
|
|
6811
|
+
/**
|
|
6812
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6813
|
+
*/
|
|
6814
|
+
type PlacePerpsPositionTpSlResult = {
|
|
6815
|
+
tpSl: PerpsPlacedTpSlOrders;
|
|
6816
|
+
};
|
|
6817
|
+
/**
|
|
6818
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6819
|
+
*/
|
|
6032
6820
|
declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
|
|
6033
6821
|
#private;
|
|
6034
6822
|
readonly credentials: PerpsCredentials;
|
|
6823
|
+
/**
|
|
6824
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6825
|
+
*/
|
|
6035
6826
|
constructor(options: PerpsSessionOptions);
|
|
6827
|
+
/**
|
|
6828
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6829
|
+
*/
|
|
6036
6830
|
get closed(): boolean;
|
|
6831
|
+
/**
|
|
6832
|
+
* Connects and authenticates the session WebSocket.
|
|
6833
|
+
*
|
|
6834
|
+
* @throws {@link PerpsSessionLifecycleError}
|
|
6835
|
+
* Thrown on failure.
|
|
6836
|
+
*
|
|
6837
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6838
|
+
*/
|
|
6037
6839
|
connect(): Promise<void>;
|
|
6840
|
+
/**
|
|
6841
|
+
* Closes the session and releases pending requests.
|
|
6842
|
+
*
|
|
6843
|
+
* @throws {@link PerpsSessionLifecycleError}
|
|
6844
|
+
* Thrown on failure.
|
|
6845
|
+
*
|
|
6846
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6847
|
+
*/
|
|
6038
6848
|
close(): Promise<void>;
|
|
6849
|
+
/**
|
|
6850
|
+
* Iterates authenticated Perps account events emitted by this session.
|
|
6851
|
+
*
|
|
6852
|
+
* @example
|
|
6853
|
+
* ```ts
|
|
6854
|
+
* for await (const event of session) {
|
|
6855
|
+
* if (event.type === 'order') {
|
|
6856
|
+
* console.log(event.payload.id);
|
|
6857
|
+
* }
|
|
6858
|
+
* }
|
|
6859
|
+
* ```
|
|
6860
|
+
*
|
|
6861
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6862
|
+
*/
|
|
6039
6863
|
[Symbol.asyncIterator](): AsyncIterator<PerpsSessionEvent>;
|
|
6864
|
+
/**
|
|
6865
|
+
* Fetches current Perps balances for the authenticated account.
|
|
6866
|
+
*
|
|
6867
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6868
|
+
* Thrown on failure.
|
|
6869
|
+
*
|
|
6870
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6871
|
+
*/
|
|
6040
6872
|
fetchBalances(): Promise<PerpsBalance[]>;
|
|
6873
|
+
/**
|
|
6874
|
+
* Fetches the current Perps portfolio for the authenticated account.
|
|
6875
|
+
*
|
|
6876
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6877
|
+
* Thrown on failure.
|
|
6878
|
+
*
|
|
6879
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6880
|
+
*/
|
|
6041
6881
|
fetchPortfolio(): Promise<PerpsPortfolio>;
|
|
6882
|
+
/**
|
|
6883
|
+
* Fetches account-level Perps statistics for the authenticated account.
|
|
6884
|
+
*
|
|
6885
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6886
|
+
* Thrown on failure.
|
|
6887
|
+
*
|
|
6888
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6889
|
+
*/
|
|
6890
|
+
fetchStats(): Promise<PerpsAccountStats>;
|
|
6891
|
+
/**
|
|
6892
|
+
* Fetches Perps account configuration, optionally filtered by instrument.
|
|
6893
|
+
*
|
|
6894
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6895
|
+
* Thrown on failure.
|
|
6896
|
+
*
|
|
6897
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6898
|
+
*/
|
|
6042
6899
|
fetchAccountConfig(request?: FetchPerpsAccountConfigRequest): Promise<PerpsAccountConfig[]>;
|
|
6900
|
+
/**
|
|
6901
|
+
* Fetches currently open Perps orders, optionally filtered by instrument.
|
|
6902
|
+
*
|
|
6903
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6904
|
+
* Thrown on failure.
|
|
6905
|
+
*
|
|
6906
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6907
|
+
*/
|
|
6043
6908
|
fetchOpenOrders(request?: FetchPerpsOpenOrdersRequest): Promise<PerpsOrder[]>;
|
|
6909
|
+
/**
|
|
6910
|
+
* Fetches Perps orders for the authenticated account.
|
|
6911
|
+
*
|
|
6912
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6913
|
+
* Thrown on failure.
|
|
6914
|
+
*
|
|
6915
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6916
|
+
*/
|
|
6044
6917
|
fetchOrders(request?: FetchPerpsOrdersRequest): Promise<PerpsOrder[]>;
|
|
6918
|
+
/**
|
|
6919
|
+
* Lists Perps fills with SDK-owned pagination.
|
|
6920
|
+
*
|
|
6921
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6922
|
+
* Thrown on failure.
|
|
6923
|
+
*
|
|
6924
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6925
|
+
*/
|
|
6045
6926
|
listFills(request?: ListPerpsFillsRequest): Paginated<PerpsAccountFill[]>;
|
|
6927
|
+
/**
|
|
6928
|
+
* Lists Perps funding payments with SDK-owned pagination.
|
|
6929
|
+
*
|
|
6930
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6931
|
+
* Thrown on failure.
|
|
6932
|
+
*
|
|
6933
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6934
|
+
*/
|
|
6046
6935
|
listFundingPayments(request?: ListPerpsFundingPaymentsRequest): Paginated<PerpsAccountFundingPayment[]>;
|
|
6936
|
+
/**
|
|
6937
|
+
* Lists Perps deposits with SDK-owned pagination.
|
|
6938
|
+
*
|
|
6939
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6940
|
+
* Thrown on failure.
|
|
6941
|
+
*
|
|
6942
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6943
|
+
*/
|
|
6047
6944
|
listDeposits(request?: ListPerpsDepositsRequest): Paginated<PerpsDeposit[]>;
|
|
6945
|
+
/**
|
|
6946
|
+
* Lists Perps withdrawals with SDK-owned pagination.
|
|
6947
|
+
*
|
|
6948
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6949
|
+
* Thrown on failure.
|
|
6950
|
+
*
|
|
6951
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6952
|
+
*/
|
|
6048
6953
|
listWithdrawals(request?: ListPerpsWithdrawalsRequest): Paginated<PerpsWithdrawal[]>;
|
|
6954
|
+
/**
|
|
6955
|
+
* Lists Perps equity history with SDK-owned pagination.
|
|
6956
|
+
*
|
|
6957
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6958
|
+
* Thrown on failure.
|
|
6959
|
+
*
|
|
6960
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6961
|
+
*/
|
|
6049
6962
|
listEquityHistory(request: ListPerpsEquityHistoryRequest): Paginated<PerpsEquityPoint[]>;
|
|
6963
|
+
/**
|
|
6964
|
+
* Lists Perps PnL history with SDK-owned pagination.
|
|
6965
|
+
*
|
|
6966
|
+
* @throws {@link PerpsSessionAccountError}
|
|
6967
|
+
* Thrown on failure.
|
|
6968
|
+
*
|
|
6969
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6970
|
+
*/
|
|
6050
6971
|
listPnlHistory(request: ListPerpsPnlHistoryRequest): Paginated<PerpsPnlPoint[]>;
|
|
6051
6972
|
/**
|
|
6052
6973
|
* Places one Perps order and resolves with the first matching orders update.
|
|
6053
6974
|
*
|
|
6054
|
-
* @
|
|
6975
|
+
* @example
|
|
6976
|
+
* ```ts
|
|
6977
|
+
* const { order } = await session.placeOrder({
|
|
6978
|
+
* instrumentId: 1,
|
|
6979
|
+
* price: '100',
|
|
6980
|
+
* quantity: '1',
|
|
6981
|
+
* side: OrderSide.BUY,
|
|
6982
|
+
* timeInForce: PerpsTimeInForce.GTC,
|
|
6983
|
+
* });
|
|
6984
|
+
* ```
|
|
6985
|
+
*
|
|
6986
|
+
* @example
|
|
6987
|
+
* ```ts
|
|
6988
|
+
* const { order, tpSl } = await session.placeOrder({
|
|
6989
|
+
* instrumentId: 1,
|
|
6990
|
+
* price: '100',
|
|
6991
|
+
* quantity: '1',
|
|
6992
|
+
* side: OrderSide.BUY,
|
|
6993
|
+
* stopLoss: { triggerPrice: '90' },
|
|
6994
|
+
* timeInForce: PerpsTimeInForce.GTC,
|
|
6995
|
+
* });
|
|
6996
|
+
* ```
|
|
6997
|
+
*
|
|
6998
|
+
* @throws {@link PerpsSessionTradingError}
|
|
6999
|
+
* Thrown on failure.
|
|
7000
|
+
*
|
|
7001
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7002
|
+
*/
|
|
7003
|
+
placeOrder(request: PlacePerpsOrderWithTpSlRequest): Promise<PlacePerpsOrderWithTpSlResult>;
|
|
7004
|
+
/**
|
|
7005
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6055
7006
|
*/
|
|
6056
|
-
placeOrder(request: PlacePerpsOrderRequest): Promise<
|
|
7007
|
+
placeOrder(request: PlacePerpsOrderRequest): Promise<PlacePerpsOrderResult>;
|
|
6057
7008
|
/**
|
|
6058
7009
|
* Posts one or more Perps orders and returns queue-entry acknowledgements.
|
|
6059
7010
|
*
|
|
6060
7011
|
* @remarks
|
|
6061
7012
|
* This is a low-level method. Most SDK consumers should prefer `placeOrder`.
|
|
7013
|
+
*
|
|
7014
|
+
* @throws {@link PerpsSessionTradingError}
|
|
7015
|
+
* Thrown on failure.
|
|
7016
|
+
*
|
|
7017
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6062
7018
|
*/
|
|
6063
7019
|
postOrders(request: PostPerpsOrdersRequest): Promise<PerpsPostOrderAck[]>;
|
|
7020
|
+
/**
|
|
7021
|
+
* Places take-profit and/or stop-loss protection for the current position.
|
|
7022
|
+
*
|
|
7023
|
+
* @remarks
|
|
7024
|
+
* The exit side is inferred from the current position for the requested
|
|
7025
|
+
* instrument.
|
|
7026
|
+
*
|
|
7027
|
+
* @example
|
|
7028
|
+
* ```ts
|
|
7029
|
+
* const { tpSl } = await session.placePositionTpSl({
|
|
7030
|
+
* instrumentId: 1,
|
|
7031
|
+
* stopLoss: { triggerPrice: '90' },
|
|
7032
|
+
* });
|
|
7033
|
+
* ```
|
|
7034
|
+
*
|
|
7035
|
+
* @throws {@link PerpsSessionAccountError}
|
|
7036
|
+
* Thrown when the current position cannot be read.
|
|
7037
|
+
*
|
|
7038
|
+
* @throws {@link PerpsSessionTradingError}
|
|
7039
|
+
* Thrown when the TP/SL command fails.
|
|
7040
|
+
*
|
|
7041
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7042
|
+
*/
|
|
7043
|
+
placePositionTpSl(request: PlacePerpsPositionTpSlRequest): Promise<PlacePerpsPositionTpSlResult>;
|
|
6064
7044
|
/**
|
|
6065
7045
|
* Cancels one Perps order and returns the cancel result.
|
|
6066
7046
|
*
|
|
6067
7047
|
* @remarks
|
|
6068
7048
|
* The returned status reflects whether the cancel happened.
|
|
7049
|
+
*
|
|
7050
|
+
* @throws {@link PerpsSessionTradingError}
|
|
7051
|
+
* Thrown on failure.
|
|
7052
|
+
*
|
|
7053
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6069
7054
|
*/
|
|
6070
7055
|
cancelOrder(request: CancelPerpsOrderRequest): Promise<PerpsCancelOrderResult>;
|
|
6071
7056
|
/**
|
|
@@ -6073,34 +7058,67 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
|
|
|
6073
7058
|
*
|
|
6074
7059
|
* @remarks
|
|
6075
7060
|
* Each returned status reflects whether that cancel happened.
|
|
7061
|
+
*
|
|
7062
|
+
* @throws {@link PerpsSessionTradingError}
|
|
7063
|
+
* Thrown on failure.
|
|
7064
|
+
*
|
|
7065
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6076
7066
|
*/
|
|
6077
7067
|
cancelOrders(request: CancelPerpsOrdersRequest): Promise<PerpsCancelOrderResult[]>;
|
|
6078
|
-
|
|
6079
|
-
|
|
7068
|
+
/**
|
|
7069
|
+
* Cancels all open Perps orders for the authenticated account.
|
|
7070
|
+
*
|
|
7071
|
+
* @remarks
|
|
7072
|
+
* Omit `instrumentId` to cancel open orders across all instruments. The
|
|
7073
|
+
* endpoint returns once the cancel-all request is accepted; individual orders
|
|
7074
|
+
* can still race with fills or other cancels.
|
|
7075
|
+
*
|
|
7076
|
+
* @throws {@link PerpsSessionTradingError}
|
|
7077
|
+
* Thrown on failure.
|
|
7078
|
+
*
|
|
7079
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7080
|
+
*/
|
|
7081
|
+
cancelAllOrders(request?: CancelAllPerpsOrdersRequest): Promise<void>;
|
|
7082
|
+
/**
|
|
7083
|
+
* Updates Perps leverage and margin mode for an instrument.
|
|
7084
|
+
*
|
|
7085
|
+
* @example
|
|
7086
|
+
* ```ts
|
|
7087
|
+
* await session.updateLeverage({
|
|
7088
|
+
* crossMargin: true,
|
|
7089
|
+
* instrumentId: 1,
|
|
7090
|
+
* leverage: 2,
|
|
7091
|
+
* });
|
|
7092
|
+
* ```
|
|
7093
|
+
*
|
|
7094
|
+
* @throws {@link UpdatePerpsLeverageError}
|
|
7095
|
+
* Thrown on failure.
|
|
7096
|
+
*
|
|
7097
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7098
|
+
*/
|
|
7099
|
+
updateLeverage(request: UpdatePerpsLeverageRequest): Promise<PerpsUpdateLeverageResult>;
|
|
6080
7100
|
}
|
|
6081
7101
|
|
|
6082
7102
|
type PerpsPublicReadError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
6083
7103
|
declare const PerpsPublicReadError: {
|
|
6084
7104
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6085
7105
|
};
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
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>;
|
|
7106
|
+
/**
|
|
7107
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7108
|
+
*/
|
|
7109
|
+
type FetchPerpsInstrumentsRequest = {
|
|
7110
|
+
/** Perps instrument identifier to fetch. */
|
|
7111
|
+
instrumentId?: number;
|
|
7112
|
+
/** Optional instrument category filter. */
|
|
7113
|
+
category?: PerpsInstrumentCategory;
|
|
7114
|
+
};
|
|
7115
|
+
/**
|
|
7116
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7117
|
+
*/
|
|
6103
7118
|
type FetchPerpsInstrumentsError = PerpsPublicReadError;
|
|
7119
|
+
/**
|
|
7120
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7121
|
+
*/
|
|
6104
7122
|
declare const FetchPerpsInstrumentsError: {
|
|
6105
7123
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6106
7124
|
};
|
|
@@ -6112,13 +7130,24 @@ declare const FetchPerpsInstrumentsError: {
|
|
|
6112
7130
|
*
|
|
6113
7131
|
* @throws {@link FetchPerpsInstrumentsError}
|
|
6114
7132
|
* Thrown on failure.
|
|
7133
|
+
*
|
|
7134
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6115
7135
|
*/
|
|
6116
7136
|
declare function fetchPerpsInstruments(client: BaseClient, request?: FetchPerpsInstrumentsRequest): Promise<PerpsInstrument[]>;
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
type FetchPerpsTickerRequest =
|
|
7137
|
+
/**
|
|
7138
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7139
|
+
*/
|
|
7140
|
+
type FetchPerpsTickerRequest = {
|
|
7141
|
+
/** Perps instrument identifier whose ticker should be fetched. */
|
|
7142
|
+
instrumentId: number;
|
|
7143
|
+
};
|
|
7144
|
+
/**
|
|
7145
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7146
|
+
*/
|
|
6121
7147
|
type FetchPerpsTickerError = PerpsPublicReadError;
|
|
7148
|
+
/**
|
|
7149
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7150
|
+
*/
|
|
6122
7151
|
declare const FetchPerpsTickerError: {
|
|
6123
7152
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6124
7153
|
};
|
|
@@ -6130,13 +7159,24 @@ declare const FetchPerpsTickerError: {
|
|
|
6130
7159
|
*
|
|
6131
7160
|
* @throws {@link FetchPerpsTickerError}
|
|
6132
7161
|
* Thrown on failure.
|
|
7162
|
+
*
|
|
7163
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6133
7164
|
*/
|
|
6134
7165
|
declare function fetchPerpsTicker(client: BaseClient, request: FetchPerpsTickerRequest): Promise<PerpsTicker>;
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
type FetchPerpsTickersRequest =
|
|
7166
|
+
/**
|
|
7167
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7168
|
+
*/
|
|
7169
|
+
type FetchPerpsTickersRequest = {
|
|
7170
|
+
/** Optional Perps instrument identifier filter. */
|
|
7171
|
+
instrumentId?: number;
|
|
7172
|
+
};
|
|
7173
|
+
/**
|
|
7174
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7175
|
+
*/
|
|
6139
7176
|
type FetchPerpsTickersError = PerpsPublicReadError;
|
|
7177
|
+
/**
|
|
7178
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7179
|
+
*/
|
|
6140
7180
|
declare const FetchPerpsTickersError: {
|
|
6141
7181
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6142
7182
|
};
|
|
@@ -6148,15 +7188,30 @@ declare const FetchPerpsTickersError: {
|
|
|
6148
7188
|
*
|
|
6149
7189
|
* @throws {@link FetchPerpsTickersError}
|
|
6150
7190
|
* Thrown on failure.
|
|
7191
|
+
*
|
|
7192
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6151
7193
|
*/
|
|
6152
7194
|
declare function fetchPerpsTickers(client: BaseClient, request?: FetchPerpsTickersRequest): Promise<PerpsTicker[]>;
|
|
7195
|
+
/**
|
|
7196
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7197
|
+
*/
|
|
6153
7198
|
type PerpsBookDepth = 10 | 100 | 500 | 1000;
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
7199
|
+
/**
|
|
7200
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7201
|
+
*/
|
|
7202
|
+
type FetchPerpsBookRequest = {
|
|
7203
|
+
/** Perps instrument identifier whose order book should be fetched. */
|
|
7204
|
+
instrumentId: number;
|
|
7205
|
+
/** Number of price levels to return on each side. */
|
|
7206
|
+
depth?: PerpsBookDepth;
|
|
7207
|
+
};
|
|
7208
|
+
/**
|
|
7209
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7210
|
+
*/
|
|
6159
7211
|
type FetchPerpsBookError = PerpsPublicReadError;
|
|
7212
|
+
/**
|
|
7213
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7214
|
+
*/
|
|
6160
7215
|
declare const FetchPerpsBookError: {
|
|
6161
7216
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6162
7217
|
};
|
|
@@ -6168,33 +7223,35 @@ declare const FetchPerpsBookError: {
|
|
|
6168
7223
|
*
|
|
6169
7224
|
* @throws {@link FetchPerpsBookError}
|
|
6170
7225
|
* Thrown on failure.
|
|
7226
|
+
*
|
|
7227
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6171
7228
|
*/
|
|
6172
7229
|
declare function fetchPerpsBook(client: BaseClient, request: FetchPerpsBookRequest): Promise<PerpsBook>;
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
cursor: PaginationCursor | undefined;
|
|
6181
|
-
params: PerpsCandlesParams;
|
|
6182
|
-
}, {
|
|
6183
|
-
instrumentId: _polymarket_bindings_perps.PerpsInstrumentId;
|
|
7230
|
+
/**
|
|
7231
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7232
|
+
*/
|
|
7233
|
+
type ListPerpsCandlesRequest = {
|
|
7234
|
+
/** Perps instrument identifier whose candles should be listed. */
|
|
7235
|
+
instrumentId: number;
|
|
7236
|
+
/** Candle interval. */
|
|
6184
7237
|
interval: PerpsKlineInterval;
|
|
6185
|
-
start
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
cursor
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
}, {
|
|
7238
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
7239
|
+
start?: number;
|
|
7240
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
7241
|
+
end?: number;
|
|
7242
|
+
/** Opaque cursor returned by a previous page. */
|
|
7243
|
+
cursor?: PaginationCursor;
|
|
7244
|
+
} | {
|
|
7245
|
+
/** Opaque cursor returned by a previous page. */
|
|
6194
7246
|
cursor: PaginationCursor;
|
|
6195
|
-
}
|
|
6196
|
-
|
|
7247
|
+
};
|
|
7248
|
+
/**
|
|
7249
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7250
|
+
*/
|
|
6197
7251
|
type ListPerpsCandlesError = PerpsPublicReadError;
|
|
7252
|
+
/**
|
|
7253
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7254
|
+
*/
|
|
6198
7255
|
declare const ListPerpsCandlesError: {
|
|
6199
7256
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6200
7257
|
};
|
|
@@ -6206,31 +7263,33 @@ declare const ListPerpsCandlesError: {
|
|
|
6206
7263
|
*
|
|
6207
7264
|
* @throws {@link ListPerpsCandlesError}
|
|
6208
7265
|
* Thrown on failure.
|
|
7266
|
+
*
|
|
7267
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6209
7268
|
*/
|
|
6210
7269
|
declare function listPerpsCandles(client: BaseClient, request: ListPerpsCandlesRequest): Paginated<PerpsCandle[]>;
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
cursor: z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
|
|
6226
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
6227
|
-
cursor: PaginationCursor;
|
|
6228
|
-
params: undefined;
|
|
6229
|
-
}, {
|
|
7270
|
+
/**
|
|
7271
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7272
|
+
*/
|
|
7273
|
+
type ListPerpsFundingHistoryRequest = {
|
|
7274
|
+
/** Perps instrument identifier whose funding history should be listed. */
|
|
7275
|
+
instrumentId: number;
|
|
7276
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
7277
|
+
start?: number;
|
|
7278
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
7279
|
+
end?: number;
|
|
7280
|
+
/** Opaque cursor returned by a previous page. */
|
|
7281
|
+
cursor?: PaginationCursor;
|
|
7282
|
+
} | {
|
|
7283
|
+
/** Opaque cursor returned by a previous page. */
|
|
6230
7284
|
cursor: PaginationCursor;
|
|
6231
|
-
}
|
|
6232
|
-
|
|
7285
|
+
};
|
|
7286
|
+
/**
|
|
7287
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7288
|
+
*/
|
|
6233
7289
|
type ListPerpsFundingHistoryError = PerpsPublicReadError;
|
|
7290
|
+
/**
|
|
7291
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7292
|
+
*/
|
|
6234
7293
|
declare const ListPerpsFundingHistoryError: {
|
|
6235
7294
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6236
7295
|
};
|
|
@@ -6242,31 +7301,33 @@ declare const ListPerpsFundingHistoryError: {
|
|
|
6242
7301
|
*
|
|
6243
7302
|
* @throws {@link ListPerpsFundingHistoryError}
|
|
6244
7303
|
* Thrown on failure.
|
|
7304
|
+
*
|
|
7305
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6245
7306
|
*/
|
|
6246
7307
|
declare function listPerpsFundingHistory(client: BaseClient, request: ListPerpsFundingHistoryRequest): Paginated<PerpsFundingRate[]>;
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
cursor: z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>;
|
|
6262
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
6263
|
-
cursor: PaginationCursor;
|
|
6264
|
-
params: undefined;
|
|
6265
|
-
}, {
|
|
7308
|
+
/**
|
|
7309
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7310
|
+
*/
|
|
7311
|
+
type ListPerpsTradesRequest = {
|
|
7312
|
+
/** Perps instrument identifier whose recent trades should be listed. */
|
|
7313
|
+
instrumentId: number;
|
|
7314
|
+
/** Inclusive start timestamp in milliseconds. */
|
|
7315
|
+
start?: number;
|
|
7316
|
+
/** Inclusive end timestamp in milliseconds. */
|
|
7317
|
+
end?: number;
|
|
7318
|
+
/** Opaque cursor returned by a previous page. */
|
|
7319
|
+
cursor?: PaginationCursor;
|
|
7320
|
+
} | {
|
|
7321
|
+
/** Opaque cursor returned by a previous page. */
|
|
6266
7322
|
cursor: PaginationCursor;
|
|
6267
|
-
}
|
|
6268
|
-
|
|
7323
|
+
};
|
|
7324
|
+
/**
|
|
7325
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7326
|
+
*/
|
|
6269
7327
|
type ListPerpsTradesError = PerpsPublicReadError;
|
|
7328
|
+
/**
|
|
7329
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7330
|
+
*/
|
|
6270
7331
|
declare const ListPerpsTradesError: {
|
|
6271
7332
|
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6272
7333
|
};
|
|
@@ -6278,9 +7339,17 @@ declare const ListPerpsTradesError: {
|
|
|
6278
7339
|
*
|
|
6279
7340
|
* @throws {@link ListPerpsTradesError}
|
|
6280
7341
|
* Thrown on failure.
|
|
7342
|
+
*
|
|
7343
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6281
7344
|
*/
|
|
6282
7345
|
declare function listPerpsTrades(client: BaseClient, request: ListPerpsTradesRequest): Paginated<PerpsPublicTrade[]>;
|
|
7346
|
+
/**
|
|
7347
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7348
|
+
*/
|
|
6283
7349
|
type FetchPerpsFeesError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
7350
|
+
/**
|
|
7351
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7352
|
+
*/
|
|
6284
7353
|
declare const FetchPerpsFeesError: {
|
|
6285
7354
|
isError(error: unknown): error is TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6286
7355
|
};
|
|
@@ -6292,55 +7361,108 @@ declare const FetchPerpsFeesError: {
|
|
|
6292
7361
|
*
|
|
6293
7362
|
* @throws {@link FetchPerpsFeesError}
|
|
6294
7363
|
* Thrown on failure.
|
|
7364
|
+
*
|
|
7365
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6295
7366
|
*/
|
|
6296
7367
|
declare function fetchPerpsFees(client: BaseClient): Promise<PerpsFeeScheduleEntry[]>;
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
7368
|
+
/**
|
|
7369
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7370
|
+
*/
|
|
7371
|
+
type CreatePerpsSessionRequest = {
|
|
7372
|
+
/** Delegated credential lifetime in milliseconds. */
|
|
7373
|
+
expiresIn?: number;
|
|
7374
|
+
/** Optional label for the delegated credentials. */
|
|
7375
|
+
label?: string;
|
|
7376
|
+
};
|
|
7377
|
+
/**
|
|
7378
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7379
|
+
*/
|
|
7380
|
+
type ResumePerpsSessionRequest = {
|
|
7381
|
+
/** Existing delegated Perps credentials to validate and resume. */
|
|
7382
|
+
credentials: PerpsCredentials;
|
|
7383
|
+
};
|
|
7384
|
+
/**
|
|
7385
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7386
|
+
*/
|
|
6314
7387
|
type OpenPerpsSessionRequest = CreatePerpsSessionRequest | ResumePerpsSessionRequest;
|
|
6315
|
-
|
|
7388
|
+
/**
|
|
7389
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7390
|
+
*/
|
|
7391
|
+
type RevokePerpsCredentialsRequest = {
|
|
7392
|
+
/** Proxy address whose delegated credentials should be revoked. */
|
|
7393
|
+
proxy: string;
|
|
7394
|
+
};
|
|
7395
|
+
/**
|
|
7396
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7397
|
+
*/
|
|
6316
7398
|
type PerpsDepositWorkflowRequest = GaslessWorkflowRequest | SendPerpsDepositTransactionRequest;
|
|
7399
|
+
/**
|
|
7400
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7401
|
+
*/
|
|
6317
7402
|
type PerpsDepositWorkflow = AsyncGenerator<PerpsDepositWorkflowRequest, TransactionHandle, EvmAddress | EvmSignature | TransactionHandle>;
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
amount:
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
7403
|
+
/**
|
|
7404
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7405
|
+
*/
|
|
7406
|
+
type DepositToPerpsRequest = {
|
|
7407
|
+
/** Collateral amount in base units. */
|
|
7408
|
+
amount: bigint;
|
|
7409
|
+
/** Optional wallet-visible metadata for gasless deposit workflows. */
|
|
7410
|
+
metadata?: string;
|
|
7411
|
+
};
|
|
7412
|
+
/**
|
|
7413
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7414
|
+
*/
|
|
7415
|
+
type WithdrawFromPerpsRequest = {
|
|
7416
|
+
/** Collateral amount in base units. */
|
|
7417
|
+
amount: bigint;
|
|
7418
|
+
};
|
|
7419
|
+
/**
|
|
7420
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7421
|
+
*/
|
|
6327
7422
|
type OpenPerpsSessionError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
7423
|
+
/**
|
|
7424
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7425
|
+
*/
|
|
6328
7426
|
declare const OpenPerpsSessionError: {
|
|
6329
7427
|
isError(error: unknown): error is SigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6330
7428
|
};
|
|
7429
|
+
/**
|
|
7430
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7431
|
+
*/
|
|
6331
7432
|
type RevokePerpsCredentialsError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
7433
|
+
/**
|
|
7434
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7435
|
+
*/
|
|
6332
7436
|
declare const RevokePerpsCredentialsError: {
|
|
6333
7437
|
isError(error: unknown): error is SigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6334
7438
|
};
|
|
7439
|
+
/**
|
|
7440
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7441
|
+
*/
|
|
6335
7442
|
type PreparePerpsDepositError = UserInputError;
|
|
7443
|
+
/**
|
|
7444
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7445
|
+
*/
|
|
6336
7446
|
declare const PreparePerpsDepositError: {
|
|
6337
7447
|
isError(error: unknown): error is UserInputError;
|
|
6338
7448
|
};
|
|
7449
|
+
/**
|
|
7450
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7451
|
+
*/
|
|
6339
7452
|
type DepositToPerpsError = RateLimitError | RequestRejectedError | CancelledSigningError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
7453
|
+
/**
|
|
7454
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7455
|
+
*/
|
|
6340
7456
|
declare const DepositToPerpsError: {
|
|
6341
7457
|
isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6342
7458
|
};
|
|
7459
|
+
/**
|
|
7460
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7461
|
+
*/
|
|
6343
7462
|
type WithdrawFromPerpsError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
7463
|
+
/**
|
|
7464
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7465
|
+
*/
|
|
6344
7466
|
declare const WithdrawFromPerpsError: {
|
|
6345
7467
|
isError(error: unknown): error is SigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
6346
7468
|
};
|
|
@@ -6355,6 +7477,8 @@ declare const WithdrawFromPerpsError: {
|
|
|
6355
7477
|
*
|
|
6356
7478
|
* @throws {@link OpenPerpsSessionError}
|
|
6357
7479
|
* Thrown on failure.
|
|
7480
|
+
*
|
|
7481
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6358
7482
|
*/
|
|
6359
7483
|
declare function openPerpsSession(client: BaseSecureClient, request?: OpenPerpsSessionRequest): Promise<PerpsSession>;
|
|
6360
7484
|
/**
|
|
@@ -6366,6 +7490,8 @@ declare function openPerpsSession(client: BaseSecureClient, request?: OpenPerpsS
|
|
|
6366
7490
|
*
|
|
6367
7491
|
* @throws {@link RevokePerpsCredentialsError}
|
|
6368
7492
|
* Thrown on failure.
|
|
7493
|
+
*
|
|
7494
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6369
7495
|
*/
|
|
6370
7496
|
declare function revokePerpsCredentials(client: BaseSecureClient, request: RevokePerpsCredentialsRequest): Promise<void>;
|
|
6371
7497
|
/**
|
|
@@ -6378,6 +7504,8 @@ declare function revokePerpsCredentials(client: BaseSecureClient, request: Revok
|
|
|
6378
7504
|
*
|
|
6379
7505
|
* @throws {@link PreparePerpsDepositError}
|
|
6380
7506
|
* Thrown on failure.
|
|
7507
|
+
*
|
|
7508
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6381
7509
|
*/
|
|
6382
7510
|
declare function preparePerpsDeposit(client: BaseSecureClient, request: DepositToPerpsRequest): Promise<PerpsDepositWorkflow>;
|
|
6383
7511
|
/**
|
|
@@ -6385,6 +7513,8 @@ declare function preparePerpsDeposit(client: BaseSecureClient, request: DepositT
|
|
|
6385
7513
|
*
|
|
6386
7514
|
* @throws {@link DepositToPerpsError}
|
|
6387
7515
|
* Thrown on failure.
|
|
7516
|
+
*
|
|
7517
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6388
7518
|
*/
|
|
6389
7519
|
declare function depositToPerps(client: BaseSecureClient, request: DepositToPerpsRequest): Promise<TransactionHandle>;
|
|
6390
7520
|
/**
|
|
@@ -6396,6 +7526,8 @@ declare function depositToPerps(client: BaseSecureClient, request: DepositToPerp
|
|
|
6396
7526
|
*
|
|
6397
7527
|
* @throws {@link WithdrawFromPerpsError}
|
|
6398
7528
|
* Thrown on failure.
|
|
7529
|
+
*
|
|
7530
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6399
7531
|
*/
|
|
6400
7532
|
declare function withdrawFromPerps(client: BaseSecureClient, request: WithdrawFromPerpsRequest): Promise<PerpsWithdrawalId>;
|
|
6401
7533
|
|
|
@@ -6816,7 +7948,7 @@ declare const SearchRequestSchema: z.ZodObject<{
|
|
|
6816
7948
|
q: z.ZodString;
|
|
6817
7949
|
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
6818
7950
|
cache: z.ZodOptional<z.ZodBoolean>;
|
|
6819
|
-
cursor: z.ZodOptional<z.
|
|
7951
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
6820
7952
|
eventsStatus: z.ZodOptional<z.ZodString>;
|
|
6821
7953
|
eventsTag: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6822
7954
|
excludeTagIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
@@ -6877,7 +8009,7 @@ declare function search(client: BaseClient, request: SearchRequest): Paginated<S
|
|
|
6877
8009
|
declare const ListSeriesRequestSchema: z.ZodObject<{
|
|
6878
8010
|
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
6879
8011
|
closed: z.ZodOptional<z.ZodBoolean>;
|
|
6880
|
-
cursor: z.ZodOptional<z.
|
|
8012
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
6881
8013
|
excludeEvents: z.ZodOptional<z.ZodBoolean>;
|
|
6882
8014
|
locale: z.ZodOptional<z.ZodString>;
|
|
6883
8015
|
order: z.ZodOptional<z.ZodString>;
|
|
@@ -6969,7 +8101,13 @@ type SportsEventType = SportsEvent['type'];
|
|
|
6969
8101
|
type CommentsEventType = CommentsEvent['type'];
|
|
6970
8102
|
type CryptoPricesEventType = CryptoPricesEvent['type'];
|
|
6971
8103
|
type EquityPricesEventType = EquityPricesEvent['type'];
|
|
8104
|
+
/**
|
|
8105
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8106
|
+
*/
|
|
6972
8107
|
type PerpsMarketDataEventType = PerpsMarketDataEvent['type'];
|
|
8108
|
+
/**
|
|
8109
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8110
|
+
*/
|
|
6973
8111
|
type PerpsStreamingCandleInterval = Exclude<PerpsKlineInterval, PerpsKlineInterval.OneSecond>;
|
|
6974
8112
|
type PerpsInstrumentIdInput = number;
|
|
6975
8113
|
type MarketSubscription = {
|
|
@@ -7004,31 +8142,52 @@ type EquityPricesSubscription = {
|
|
|
7004
8142
|
symbol: string;
|
|
7005
8143
|
types?: readonly EquityPricesEventType[];
|
|
7006
8144
|
};
|
|
8145
|
+
/**
|
|
8146
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8147
|
+
*/
|
|
7007
8148
|
type PerpsTradesSubscription = {
|
|
7008
8149
|
topic: 'perps.trades';
|
|
7009
8150
|
instrumentId: PerpsInstrumentIdInput;
|
|
7010
8151
|
};
|
|
8152
|
+
/**
|
|
8153
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8154
|
+
*/
|
|
7011
8155
|
type PerpsBboSubscription = {
|
|
7012
8156
|
topic: 'perps.bbo';
|
|
7013
8157
|
instrumentId: PerpsInstrumentIdInput;
|
|
7014
8158
|
};
|
|
8159
|
+
/**
|
|
8160
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8161
|
+
*/
|
|
7015
8162
|
type PerpsBookSubscription = {
|
|
7016
8163
|
topic: 'perps.book';
|
|
7017
8164
|
instrumentId: PerpsInstrumentIdInput;
|
|
7018
8165
|
};
|
|
8166
|
+
/**
|
|
8167
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8168
|
+
*/
|
|
7019
8169
|
type PerpsCandlesSubscription = {
|
|
7020
8170
|
topic: 'perps.candles';
|
|
7021
8171
|
instrumentId: PerpsInstrumentIdInput;
|
|
7022
8172
|
interval: PerpsStreamingCandleInterval;
|
|
7023
8173
|
};
|
|
8174
|
+
/**
|
|
8175
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8176
|
+
*/
|
|
7024
8177
|
type PerpsTickersSubscription = {
|
|
7025
8178
|
topic: 'perps.tickers';
|
|
7026
8179
|
instrumentId?: PerpsInstrumentIdInput;
|
|
7027
8180
|
};
|
|
8181
|
+
/**
|
|
8182
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8183
|
+
*/
|
|
7028
8184
|
type PerpsStatisticsSubscription = {
|
|
7029
8185
|
topic: 'perps.statistics';
|
|
7030
8186
|
instrumentId?: PerpsInstrumentIdInput;
|
|
7031
8187
|
};
|
|
8188
|
+
/**
|
|
8189
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8190
|
+
*/
|
|
7032
8191
|
type PerpsMarketDataSubscription = PerpsTradesSubscription | PerpsBboSubscription | PerpsBookSubscription | PerpsCandlesSubscription | PerpsTickersSubscription | PerpsStatisticsSubscription;
|
|
7033
8192
|
type PublicSubscriptionSpec = MarketSubscription | SportsSubscription | CommentsSubscription | CryptoPricesSubscription | EquityPricesSubscription | PerpsMarketDataSubscription;
|
|
7034
8193
|
type SecureSubscriptionSpec = PublicSubscriptionSpec | UserSubscription;
|
|
@@ -7089,7 +8248,7 @@ declare function subscribe<const TSubscriptions extends readonly SecureSubscript
|
|
|
7089
8248
|
|
|
7090
8249
|
declare const ListTagsRequestSchema: z.ZodObject<{
|
|
7091
8250
|
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
7092
|
-
cursor: z.ZodOptional<z.
|
|
8251
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
7093
8252
|
includeTemplate: z.ZodOptional<z.ZodBoolean>;
|
|
7094
8253
|
isCarousel: z.ZodOptional<z.ZodBoolean>;
|
|
7095
8254
|
locale: z.ZodOptional<z.ZodString>;
|
|
@@ -7261,7 +8420,7 @@ declare function fetchRelatedTagResources(client: BaseClient, request: FetchRela
|
|
|
7261
8420
|
declare const ListTeamsRequestSchema: z.ZodObject<{
|
|
7262
8421
|
abbreviation: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7263
8422
|
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
7264
|
-
cursor: z.ZodOptional<z.
|
|
8423
|
+
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
7265
8424
|
league: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7266
8425
|
name: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7267
8426
|
order: z.ZodOptional<z.ZodString>;
|
|
@@ -7395,7 +8554,7 @@ type TransactionOutcome = {
|
|
|
7395
8554
|
/**
|
|
7396
8555
|
* The hash of the settled transaction.
|
|
7397
8556
|
*/
|
|
7398
|
-
transactionHash: TxHash;
|
|
8557
|
+
transactionHash: TxHash$1;
|
|
7399
8558
|
/**
|
|
7400
8559
|
* The unique identifier of the settled transaction when submitted through the Polymarket API,
|
|
7401
8560
|
* or null if the transaction was submitted directly to the blockchain.
|
|
@@ -7410,7 +8569,7 @@ interface TransactionHandle {
|
|
|
7410
8569
|
/**
|
|
7411
8570
|
* The hash of the submitted transaction, or null if the transaction is pending submission.
|
|
7412
8571
|
*/
|
|
7413
|
-
readonly transactionHash: TxHash | null;
|
|
8572
|
+
readonly transactionHash: TxHash$1 | null;
|
|
7414
8573
|
/**
|
|
7415
8574
|
* The unique identifier of the submitted transaction when submitted through the Polymarket API,
|
|
7416
8575
|
* or null if the transaction was submitted directly to the blockchain.
|
|
@@ -7431,4 +8590,4 @@ type Signer = {
|
|
|
7431
8590
|
sendTransaction(request: SignerTransactionRequest): Promise<TransactionHandle>;
|
|
7432
8591
|
};
|
|
7433
8592
|
|
|
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 };
|
|
8593
|
+
export { FetchMidpointError as $, type ApiKeyAuthorization as A, type BaseClient as B, CancelAllError as C, type DataActions as D, DepositToPerpsError as E, type DepositToPerpsRequest as F, type DiscoveryActions as G, DownloadAccountingSnapshotError as H, DropNotificationsError as I, type EnvironmentConfig as J, type EnvironmentConfigFork as K, type EnvironmentContracts as L, EstimateMarketPriceError as M, ExecuteCollateralReturnPlanError as N, type ExecuteCollateralReturnPlanRequest as O, FetchClosedOnlyModeError as P, FetchCommentsByIdError as Q, FetchEventError as R, type Signer as S, type TypedDataPayload as T, UserInputError as U, FetchEventLiveVolumeError as V, FetchEventTagsError as W, FetchLastTradePriceError as X, FetchLastTradePricesError as Y, FetchMarketError as Z, FetchMarketTagsError as _, type TypedData as a, type ListPerpsTradesRequest as a$, FetchMidpointsError as a0, FetchNotificationsError as a1, FetchOrderBookError as a2, FetchOrderBooksError as a3, FetchOrderError as a4, FetchOrderScoringError as a5, FetchOrdersScoringError as a6, type FetchPerpsAccountConfigRequest as a7, FetchPerpsBookError as a8, type FetchPerpsBookRequest as a9, ListBuilderLeaderboardError as aA, ListBuilderTradesError as aB, ListBuilderVolumeError as aC, ListClosedPositionsError as aD, ListComboActivityError as aE, ListComboMarketsError as aF, ListComboPositionsError as aG, ListCommentsByUserAddressError as aH, ListCommentsError as aI, ListCurrentRewardsError as aJ, ListEventsError as aK, ListMarketHoldersError as aL, ListMarketPositionsError as aM, ListMarketRewardsError as aN, ListMarketsError as aO, ListOpenInterestError as aP, ListOpenOrdersError as aQ, ListPerpsCandlesError as aR, type ListPerpsCandlesRequest as aS, type ListPerpsDepositsRequest as aT, type ListPerpsEquityHistoryRequest as aU, type ListPerpsFillsRequest as aV, ListPerpsFundingHistoryError as aW, type ListPerpsFundingHistoryRequest as aX, type ListPerpsFundingPaymentsRequest as aY, type ListPerpsPnlHistoryRequest as aZ, ListPerpsTradesError as a_, FetchPerpsFeesError as aa, FetchPerpsInstrumentsError as ab, type FetchPerpsInstrumentsRequest as ac, type FetchPerpsOpenOrdersRequest as ad, type FetchPerpsOrdersRequest as ae, FetchPerpsTickerError as af, type FetchPerpsTickerRequest as ag, FetchPerpsTickersError as ah, type FetchPerpsTickersRequest as ai, FetchPortfolioValueError as aj, FetchPriceError as ak, FetchPriceHistoryError as al, FetchPricesError as am, FetchPublicProfileError as an, FetchRelatedTagResourcesError as ao, FetchRelatedTagsError as ap, FetchRewardPercentagesError as aq, FetchSeriesError as ar, FetchSpreadError as as, FetchSpreadsError as at, FetchTagError as au, FetchTotalEarningsForUserForDayError as av, FetchTradedMarketCountError as aw, InsufficientLiquidityError as ax, ListAccountTradesError as ay, ListActivityError as az, type TransactionCall as b, type RfqConfirmationRequestEvent as b$, type ListPerpsWithdrawalsRequest as b0, ListPositionsError as b1, ListSeriesError as b2, ListTagsError as b3, ListTeamsError as b4, ListTraderLeaderboardError as b5, ListTradesError as b6, ListUserEarningsAndMarketsConfigError as b7, ListUserEarningsForDayError as b8, MergePositionsError as b9, type PlacePerpsPositionTpSlResult as bA, PlanCollateralReturnError as bB, PostOrderError as bC, PostOrdersError as bD, type PostPerpsOrdersRequest as bE, type PublicAccountActions as bF, type PublicActions as bG, type PublicClient as bH, type PublicClientOptions as bI, type PublicPerpsActions as bJ, type PublicRewardsActions as bK, type PublicSubscriptionsActions as bL, RateLimitError as bM, RedeemPositionsError as bN, RequestRejectedError as bO, type RequestRejectedErrorOptions as bP, type RestEndpoint as bQ, type ResumePerpsSessionRequest as bR, RevokePerpsCredentialsError as bS, type RevokePerpsCredentialsRequest as bT, type RfqCancelQuoteAck as bU, RfqCancelQuoteError as bV, RfqCancelQuoteRejectedError as bW, type RfqCancelQuoteRejectedErrorOptions as bX, type RfqConfirmationAck as bY, RfqConfirmationError as bZ, RfqConfirmationRejectedError as b_, OpenPerpsSessionError as ba, type OpenPerpsSessionRequest as bb, OpenRfqSessionError as bc, type Page as bd, PageSizeSchema as be, type Paginated as bf, type PerpsActions as bg, type PerpsBookDepth as bh, type PerpsEndpoints as bi, type PerpsOrderRequest as bj, type PerpsPlaceFokOrderRequest as bk, type PerpsPlaceGtcOrderRequest as bl, type PerpsPlaceIocOrderRequest as bm, type PerpsPlacedTpSlOrder as bn, type PerpsPlacedTpSlOrders as bo, type PerpsPositionTpSlTrigger as bp, PerpsSession as bq, type PerpsSessionAccountError as br, type PerpsSessionLifecycleError as bs, type PerpsSessionTradingError as bt, type PerpsTpSlTrigger as bu, type PlacePerpsOrderRequest as bv, type PlacePerpsOrderResult as bw, type PlacePerpsOrderWithTpSlRequest as bx, type PlacePerpsOrderWithTpSlResult as by, type PlacePerpsPositionTpSlRequest as bz, type AccountIdentity as c, perpsActions as c$, type RfqEvent as c0, RfqQuoteError as c1, type RfqQuoteReference as c2, RfqQuoteRejectedError as c3, type RfqQuoteRejectedErrorOptions as c4, type RfqQuoteRequestEvent as c5, type RfqQuoteResponse as c6, type RfqQuoteSource as c7, type RfqSession as c8, type RfqTradeEvent as c9, TransactionFailedError as cA, type TransactionHandle as cB, type TransactionOutcome as cC, TransferErc20Error as cD, TransportError as cE, type TypedDataDomain as cF, type TypedDataField as cG, UnexpectedResponseError as cH, UpdatePerpsLeverageError as cI, type UpdatePerpsLeverageRequest as cJ, WaitForOrderFillSettlementError as cK, WaitForTransactionError as cL, type WalletDerivationConfig as cM, type WebSocketCloseCode as cN, type WebSocketEndpoint as cO, WebSocketKnownCloseCode as cP, WithdrawFromPerpsError as cQ, type WithdrawFromPerpsRequest as cR, accountActions as cS, allActions as cT, analyticsActions as cU, createPublicClient as cV, createSecureClient as cW, dataActions as cX, discoveryActions as cY, forkEnvironmentConfig as cZ, makeErrorGuard as c_, SearchError as ca, SearchSort as cb, type SecureAccountActions as cc, type SecureActions as cd, type SecureClient as ce, type SecureClientOptions as cf, type SecureDownloadAccountingSnapshotRequest as cg, type SecureFetchPortfolioValueRequest as ch, type SecureFetchTradedMarketCountRequest as ci, type SecureListActivityRequest as cj, type SecureListClosedPositionsRequest as ck, type SecureListComboActivityRequest as cl, type SecureListComboPositionsRequest as cm, type SecureListPositionsRequest as cn, type SecurePerpsActions as co, type SecureRewardsActions as cp, type SecureRfqActions as cq, type SecureSubscriptionsActions as cr, type SecureTradingActions as cs, type SecureWalletActions as ct, SetupGaslessWalletError as cu, SetupTradingApprovalsError as cv, type SignerTransactionRequest as cw, SigningError as cx, SplitPositionError as cy, TimeoutError as cz, type AnalyticsActions as d, type FetchRelatedTagsRequest as d$, production as d0, rewardsActions as d1, rfqActions as d2, subscriptionsActions as d3, tradingActions as d4, walletActions as d5, type CancelMarketOrdersRequest as d6, type CancelOrderRequest as d7, type CancelOrdersRequest as d8, type CollateralReturnExecutionWorkflow as d9, type FetchEventLiveVolumeRequest as dA, type FetchEventRequest as dB, type FetchEventTagsRequest as dC, FetchExecuteParamsError as dD, type FetchExecuteParamsRequest as dE, type FetchGaslessTransactionRequest as dF, type FetchLastTradePriceRequest as dG, type FetchLastTradePricesRequest as dH, FetchMarketInfoError as dI, type FetchMarketInfoRequest as dJ, type FetchMarketRequest as dK, type FetchMarketTagsRequest as dL, type FetchMidpointRequest as dM, type FetchMidpointsRequest as dN, FetchNegRiskError as dO, type FetchNegRiskRequest as dP, type FetchOrderBookRequest as dQ, type FetchOrderBooksRequest as dR, type FetchOrderRequest as dS, type FetchOrderScoringRequest as dT, type FetchOrdersScoringRequest as dU, type FetchPortfolioValueRequest as dV, type FetchPriceHistoryRequest as dW, type FetchPriceRequest as dX, type FetchPricesRequest as dY, type FetchPublicProfileRequest as dZ, type FetchRelatedTagResourcesRequest as d_, type CommentsEventType as da, type CommentsSubscription as db, type CryptoPricesEventType as dc, type CryptoPricesSubscription as dd, DeployDepositWalletError as de, type DownloadAccountingSnapshotRequest as df, type DropNotificationsRequest as dg, type EquityPricesEventType as dh, type EquityPricesSubscription as di, type Erc1155ApprovalForAllWorkflow as dj, type Erc1155ApprovalForAllWorkflowRequest as dk, type Erc20ApprovalWorkflow as dl, type Erc20ApprovalWorkflowRequest as dm, type Erc20TransferWorkflow as dn, type Erc20TransferWorkflowRequest as dp, type EstimateMarketBuyPriceRequest as dq, type EstimateMarketPriceRequest as dr, type EstimateMarketSellPriceRequest as ds, type EventForSubscriptionSpec as dt, type EventForSubscriptionSpecs as du, FetchBalanceAllowanceError as dv, type FetchBalanceAllowanceRequest as dw, FetchBuilderFeeRatesError as dx, type FetchBuilderFeeRatesRequest as dy, type FetchCommentsByIdRequest as dz, ApproveErc1155ForAllError as e, type PostOrdersRequest as e$, type FetchSeriesRequest as e0, type FetchSpreadRequest as e1, type FetchSpreadsRequest as e2, type FetchTagRequest as e3, FetchTickSizeError as e4, type FetchTickSizeRequest as e5, type FetchTotalEarningsForUserForDayRequest as e6, type FetchTradedMarketCountRequest as e7, GaslessTransactionMetadataSchema as e8, type GaslessWorkflow as e9, type ListTagsRequest as eA, type ListTeamsRequest as eB, type ListTraderLeaderboardRequest as eC, type ListTradesRequest as eD, type ListUserEarningsAndMarketsConfigRequest as eE, type ListUserEarningsForDayRequest as eF, type MarketEventType as eG, type MarketSubscription as eH, MergeComboPositionError as eI, MergeMarketPositionError as eJ, type MergePositionsWorkflow as eK, type MergePositionsWorkflowRequest as eL, type OrderDraft as eM, type OrderPostingWorkflow as eN, type OrderWorkflow as eO, type OrderWorkflowRequest as eP, type PerpsBboSubscription as eQ, type PerpsBookSubscription as eR, type PerpsCandlesSubscription as eS, type PerpsDepositWorkflow as eT, type PerpsDepositWorkflowRequest as eU, type PerpsMarketDataEventType as eV, type PerpsMarketDataSubscription as eW, type PerpsStatisticsSubscription as eX, type PerpsStreamingCandleInterval as eY, type PerpsTickersSubscription as eZ, type PerpsTradesSubscription as e_, type GaslessWorkflowRequest as ea, IsWalletDeployedError as eb, type IsWalletDeployedRequest as ec, type ListAccountTradesRequest as ed, type ListActivityRequest as ee, type ListBuilderLeaderboardRequest as ef, type ListBuilderTradesRequest as eg, type ListBuilderVolumeRequest as eh, type ListClosedPositionsRequest as ei, type ListComboActivityRequest as ej, type ListComboMarketsRequest as ek, type ListComboPositionsRequest as el, type ListCommentsByUserAddressRequest as em, type ListCommentsRequest as en, type ListCurrentRewardsRequest as eo, type ListEventsRequest as ep, ListMarketClarificationsError as eq, type ListMarketClarificationsRequest as er, type ListMarketHoldersRequest as es, type ListMarketPositionsRequest as et, type ListMarketRewardsRequest as eu, type ListMarketsRequest as ev, type ListOpenInterestRequest as ew, type ListOpenOrdersRequest as ex, type ListPositionsRequest as ey, type ListSeriesRequest as ez, ApproveErc20Error as f, type UserSubscription as f$, PrepareCollateralReturnExecutionError as f0, PrepareErc1155ApprovalForAllError as f1, type PrepareErc1155ApprovalForAllRequest as f2, PrepareErc20ApprovalError as f3, type PrepareErc20ApprovalRequest as f4, PrepareErc20TransferError as f5, type PrepareErc20TransferRequest as f6, PrepareGaslessTransactionError as f7, type PrepareGaslessTransactionRequest as f8, type PrepareLimitOrderRequest as f9, type PublicRealtimeTopic as fA, type PublicSubscriptionSpec as fB, type RedeemPositionsWorkflow as fC, type RedeemPositionsWorkflowRequest as fD, ResolveConditionByTokenError as fE, type ResolveConditionByTokenRequest as fF, type RfqConfirmationRejectedErrorOptions as fG, type RfqExecutionUpdateEvent as fH, type SearchRequest as fI, type SearchResults as fJ, type SecureRealtimeEvent as fK, type SecureRealtimeTopic as fL, type SecureSubscriptionSpec as fM, type SignedOrder as fN, SplitComboPositionError as fO, SplitMarketPositionError as fP, type SplitPositionWorkflow as fQ, type SplitPositionWorkflowRequest as fR, type SportsEventType as fS, type SportsSubscription as fT, type SubscribeError as fU, type SubscriptionHandle as fV, type TradingApprovalsWorkflow as fW, type TradingApprovalsWorkflowRequest as fX, UpdateBalanceAllowanceError as fY, type UpdateBalanceAllowanceRequest as fZ, type UserEventType as f_, type PrepareMarketBuyOrderRequest as fa, type PrepareMarketOrderRequest as fb, type PrepareMarketSellOrderRequest as fc, PrepareMergeComboPositionError as fd, type PrepareMergeComboPositionRequest as fe, PrepareMergeMarketPositionError as ff, type PrepareMergeMarketPositionRequest as fg, PrepareMergePositionsError as fh, type PrepareMergePositionsRequest as fi, PreparePerpsDepositError as fj, PrepareRedeemComboPositionError as fk, type PrepareRedeemComboPositionRequest as fl, type PrepareRedeemMarketPositionsByConditionIdRequest as fm, type PrepareRedeemMarketPositionsByMarketIdRequest as fn, PrepareRedeemMarketPositionsError as fo, type PrepareRedeemMarketPositionsRequest as fp, PrepareRedeemPositionsError as fq, type PrepareRedeemPositionsRequest as fr, PrepareSplitComboPositionError as fs, type PrepareSplitComboPositionRequest as ft, PrepareSplitMarketPositionError as fu, type PrepareSplitMarketPositionRequest as fv, PrepareSplitPositionError as fw, type PrepareSplitPositionRequest as fx, PrepareTradingApprovalsError as fy, type PublicRealtimeEvent as fz, BasePublicClient as g, listClosedPositions as g$, WaitForGaslessTransactionError as g0, type WaitForOrderFillSettlementRequest as g1, approveErc1155ForAll as g2, approveErc20 as g3, cancelAll as g4, cancelMarketOrders as g5, cancelOrder as g6, cancelOrders as g7, deployDepositWallet as g8, depositToPerps as g9, fetchOrdersScoring as gA, fetchPerpsBook as gB, fetchPerpsFees as gC, fetchPerpsInstruments as gD, fetchPerpsTicker as gE, fetchPerpsTickers as gF, fetchPortfolioValue as gG, fetchPrice as gH, fetchPriceHistory as gI, fetchPrices as gJ, fetchPublicProfile as gK, fetchRelatedTagResources as gL, fetchRelatedTags as gM, fetchRewardPercentages as gN, fetchSeries as gO, fetchSpread as gP, fetchSpreads as gQ, fetchTag as gR, fetchTickSize as gS, fetchTotalEarningsForUserForDay as gT, fetchTradedMarketCount as gU, fetchTransaction as gV, isWalletDeployed as gW, listAccountTrades as gX, listActivity as gY, listBuilderLeaderboard as gZ, listBuilderTrades as g_, downloadAccountingSnapshot as ga, dropNotifications as gb, estimateMarketPrice as gc, executeCollateralReturnPlan as gd, fetchBalanceAllowance as ge, fetchBuilderFeeRates as gf, fetchBuilderVolume as gg, fetchClosedOnlyMode as gh, fetchCommentsById as gi, fetchEvent as gj, fetchEventLiveVolume as gk, fetchEventTags as gl, fetchExecuteParams as gm, fetchLastTradePrice as gn, fetchLastTradePrices as go, fetchMarket as gp, fetchMarketInfo as gq, fetchMarketTags as gr, fetchMidpoint as gs, fetchMidpoints as gt, fetchNegRisk as gu, fetchNotifications as gv, fetchOrder as gw, fetchOrderBook as gx, fetchOrderBooks as gy, fetchOrderScoring as gz, BaseSecureClient as h, listComboActivity as h0, listComboMarkets as h1, listComboPositions as h2, listComments as h3, listCommentsByUserAddress as h4, listCurrentRewards as h5, listEvents as h6, listMarketClarifications as h7, listMarketHolders as h8, listMarketPositions as h9, prepareErc20Transfer as hA, prepareGaslessTransaction as hB, prepareMergeComboPosition as hC, prepareMergeMarketPosition as hD, prepareMergePositions as hE, preparePerpsDeposit as hF, prepareRedeemComboPosition as hG, prepareRedeemMarketPositions as hH, prepareRedeemPositions as hI, prepareSplitComboPosition as hJ, prepareSplitMarketPosition as hK, prepareSplitPosition as hL, prepareTradingApprovals as hM, redeemPositions as hN, resolveConditionByToken as hO, revokePerpsCredentials as hP, search as hQ, setupTradingApprovals as hR, splitComboPosition as hS, splitMarketPosition as hT, splitPosition as hU, subscribe as hV, transferErc20 as hW, updateBalanceAllowance as hX, waitForOrderFillSettlement as hY, withdrawFromPerps as hZ, listMarketRewards as ha, listMarkets as hb, listOpenInterest as hc, listOpenOrders as hd, listPerpsCandles as he, listPerpsFundingHistory as hf, listPerpsTrades as hg, listPositions as hh, listSeries as hi, listTags as hj, listTeams as hk, listTraderLeaderboard as hl, listTrades as hm, listUserEarningsAndMarketsConfig as hn, listUserEarningsForDay as ho, mergeComboPosition as hp, mergeMarketPosition as hq, mergePositions as hr, openPerpsSession as hs, openRfqSession as ht, planCollateralReturn as hu, postOrder as hv, postOrders as hw, prepareCollateralReturnExecution as hx, prepareErc1155ApprovalForAll as hy, prepareErc20Approval as hz, type BeginAuthenticationRequest as i, type CancelAllPerpsOrdersRequest as j, CancelMarketOrdersError as k, CancelOrderError as l, CancelOrdersError as m, type CancelPerpsOrderRequest as n, type CancelPerpsOrdersRequest as o, CancelledSigningError as p, type Client as q, type ClientActions as r, type ClientDecorator as s, type ClobEndpoints as t, ComboPositionSort as u, type CombosEndpoints as v, ConnectionLostError as w, type ConnectionLostErrorOptions as x, type CreatePerpsSessionRequest as y, CreateSecureClientError as z };
|