@apicity/polymarket 0.4.2 → 0.5.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 +639 -74
- package/dist/src/_helpers.d.ts +2 -1
- package/dist/src/_helpers.d.ts.map +1 -1
- package/dist/src/_helpers.js +25 -0
- package/dist/src/_helpers.js.map +1 -1
- package/dist/src/clob.d.ts +1 -1
- package/dist/src/clob.d.ts.map +1 -1
- package/dist/src/clob.js +225 -46
- package/dist/src/clob.js.map +1 -1
- package/dist/src/data.d.ts +1 -1
- package/dist/src/data.d.ts.map +1 -1
- package/dist/src/data.js +118 -119
- package/dist/src/data.js.map +1 -1
- package/dist/src/example.d.ts.map +1 -1
- package/dist/src/example.js +173 -0
- package/dist/src/example.js.map +1 -1
- package/dist/src/gamma.d.ts +1 -1
- package/dist/src/gamma.d.ts.map +1 -1
- package/dist/src/gamma.js +104 -105
- package/dist/src/gamma.js.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/polymarket.d.ts +1 -1
- package/dist/src/sign.d.ts +2 -2
- package/dist/src/types.d.ts +603 -23
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/zod.d.ts +234 -0
- package/dist/src/zod.d.ts.map +1 -1
- package/dist/src/zod.js +116 -0
- package/dist/src/zod.js.map +1 -1
- package/package.json +1 -1
package/dist/src/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
|
-
import type { PolymarketClobL1Headers, PolymarketClobTokenBatchRequest, PolymarketClobPricesBatchRequest, PolymarketClobBatchPricesHistoryRequest, PolymarketClobPostOrderRequest, PolymarketClobPlaceOrderRequest, PolymarketClobPostOrdersRequest, PolymarketClobCancelOrderRequest, PolymarketClobCancelOrdersRequest, PolymarketClobCancelMarketOrdersRequest, PolymarketClobBalanceAllowanceQuery, PolymarketClobUserOrdersQuery, PolymarketClobUserTradesQuery, PolymarketClobNotificationsQuery, PolymarketClobDropNotificationsQuery, PolymarketClobOrderScoringQuery, PolymarketClobOrdersScoringQuery, PolymarketClobOrdersScoringRequest, PolymarketClobHeartbeatRequest } from "./zod";
|
|
3
|
-
export type { PolymarketOptions, PolymarketClobApiCredentials, PolymarketClobL1Headers, PolymarketClobL2HeaderArgs, PolymarketClobL2Headers, PolymarketClobL2HeaderSigner, PolymarketClobTokenBatchRequest, PolymarketClobPricesBatchRequest, PolymarketClobBatchPricesHistoryRequest, PolymarketClobSignedOrder, PolymarketClobPostOrderRequest, PolymarketClobPlaceOrderRequest, PolymarketClobPostOrdersRequest, PolymarketClobCancelOrderRequest, PolymarketClobCancelOrdersRequest, PolymarketClobCancelMarketOrdersRequest, PolymarketClobBalanceAllowanceQuery, PolymarketClobUserOrdersQuery, PolymarketClobUserTradesQuery, PolymarketClobNotificationsQuery, PolymarketClobDropNotificationsQuery, PolymarketClobOrderScoringQuery, PolymarketClobOrdersScoringQuery, PolymarketClobOrdersScoringRequest, PolymarketClobHeartbeatRequest, } from "./zod";
|
|
2
|
+
import type { PolymarketClobL1Headers, PolymarketClobTokenIdsQuery, PolymarketClobPricesQuery, PolymarketClobLiveActivityRequest, PolymarketClobTokenBatchRequest, PolymarketClobPricesBatchRequest, PolymarketClobBatchPricesHistoryRequest, PolymarketClobPostOrderRequest, PolymarketClobPlaceOrderRequest, PolymarketClobPostOrdersRequest, PolymarketClobCancelOrderRequest, PolymarketClobCancelOrdersRequest, PolymarketClobCancelMarketOrdersRequest, PolymarketClobBalanceAllowanceQuery, PolymarketClobUserOrdersQuery, PolymarketClobUserTradesQuery, PolymarketClobNotificationsQuery, PolymarketClobDropNotificationsQuery, PolymarketClobOrderScoringQuery, PolymarketClobOrdersScoringQuery, PolymarketClobOrdersScoringRequest, PolymarketClobHeartbeatRequest, PolymarketClobRewardsUserQuery, PolymarketClobRewardsUserTotalQuery, PolymarketClobRewardPercentagesQuery, PolymarketClobRewardsUserMarketsQuery, PolymarketClobRewardsCurrentQuery, PolymarketClobRewardsMarketQuery, PolymarketClobRewardsMultiMarketsQuery, PolymarketClobRebatesCurrentQuery, PolymarketClobBuilderTradesQuery } from "./zod.js";
|
|
3
|
+
export type { PolymarketOptions, PolymarketClobApiCredentials, PolymarketClobL1Headers, PolymarketClobL2HeaderArgs, PolymarketClobL2Headers, PolymarketClobL2HeaderSigner, PolymarketClobTokenIdsQuery, PolymarketClobPricesQuery, PolymarketClobLiveActivityRequest, PolymarketClobTokenBatchRequest, PolymarketClobPricesBatchRequest, PolymarketClobBatchPricesHistoryRequest, PolymarketClobSignedOrder, PolymarketClobPostOrderRequest, PolymarketClobPlaceOrderRequest, PolymarketClobPostOrdersRequest, PolymarketClobCancelOrderRequest, PolymarketClobCancelOrdersRequest, PolymarketClobCancelMarketOrdersRequest, PolymarketClobBalanceAllowanceQuery, PolymarketClobUserOrdersQuery, PolymarketClobUserTradesQuery, PolymarketClobNotificationsQuery, PolymarketClobDropNotificationsQuery, PolymarketClobOrderScoringQuery, PolymarketClobOrdersScoringQuery, PolymarketClobOrdersScoringRequest, PolymarketClobHeartbeatRequest, PolymarketClobRewardsUserQuery, PolymarketClobRewardsUserTotalQuery, PolymarketClobRewardPercentagesQuery, PolymarketClobRewardsUserMarketsQuery, PolymarketClobRewardsCurrentQuery, PolymarketClobRewardsMarketQuery, PolymarketClobRewardsMultiMarketsQuery, PolymarketClobRebatesCurrentQuery, PolymarketClobBuilderTradesQuery, } from "./zod.js";
|
|
4
4
|
export type PolymarketClobSide = "BUY" | "SELL";
|
|
5
5
|
export type PolymarketClobSignatureType = 0 | 1 | 2 | 3;
|
|
6
6
|
export type PolymarketClobOrderType = "GTC" | "FOK" | "GTD" | "FAK";
|
|
@@ -18,6 +18,10 @@ export interface PolymarketClobBook {
|
|
|
18
18
|
hash: string;
|
|
19
19
|
bids: PolymarketClobBookLevel[];
|
|
20
20
|
asks: PolymarketClobBookLevel[];
|
|
21
|
+
min_order_size?: string;
|
|
22
|
+
tick_size?: string;
|
|
23
|
+
neg_risk?: boolean;
|
|
24
|
+
last_trade_price?: string;
|
|
21
25
|
}
|
|
22
26
|
export interface PolymarketClobPriceResponse {
|
|
23
27
|
price: string;
|
|
@@ -30,7 +34,7 @@ export interface PolymarketClobSpreadResponse {
|
|
|
30
34
|
}
|
|
31
35
|
export interface PolymarketClobLastTradePriceResponse {
|
|
32
36
|
price: string;
|
|
33
|
-
side: PolymarketClobSide;
|
|
37
|
+
side: PolymarketClobSide | "";
|
|
34
38
|
}
|
|
35
39
|
export interface PolymarketClobTickSizeResponse {
|
|
36
40
|
minimum_tick_size: number;
|
|
@@ -38,6 +42,21 @@ export interface PolymarketClobTickSizeResponse {
|
|
|
38
42
|
export interface PolymarketClobFeeRateResponse {
|
|
39
43
|
base_fee: number;
|
|
40
44
|
}
|
|
45
|
+
export interface PolymarketClobNegRiskResponse {
|
|
46
|
+
neg_risk: boolean;
|
|
47
|
+
}
|
|
48
|
+
export type PolymarketClobBooksResponse = PolymarketClobBook[];
|
|
49
|
+
export type PolymarketClobPricesResponse = Record<string, Partial<Record<PolymarketClobSide, string | number>>>;
|
|
50
|
+
export type PolymarketClobMidpointsResponse = Record<string, string | number>;
|
|
51
|
+
export type PolymarketClobLastTradesPricesResponse = PolymarketClobLastTradesPricesEntry[];
|
|
52
|
+
export interface PolymarketClobLiveActivityMarket {
|
|
53
|
+
condition_id?: string;
|
|
54
|
+
market?: string;
|
|
55
|
+
active?: boolean;
|
|
56
|
+
accepting_orders?: boolean;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
export type PolymarketClobLiveActivityResponse = PolymarketClobLiveActivityMarket[];
|
|
41
60
|
export interface PolymarketClobPriceHistoryPoint {
|
|
42
61
|
t: number;
|
|
43
62
|
p: number;
|
|
@@ -166,6 +185,12 @@ export interface PolymarketClobApiKeyResponse {
|
|
|
166
185
|
export interface PolymarketClobApiKeysResponse {
|
|
167
186
|
apiKeys: string[];
|
|
168
187
|
}
|
|
188
|
+
export interface PolymarketClobBuilderApiKeyResponse {
|
|
189
|
+
key: string;
|
|
190
|
+
secret: string;
|
|
191
|
+
passphrase: string;
|
|
192
|
+
}
|
|
193
|
+
export type PolymarketClobBuilderApiKeysResponse = string[];
|
|
169
194
|
export interface PolymarketClobPostOrderResponse {
|
|
170
195
|
success: boolean;
|
|
171
196
|
orderID: string;
|
|
@@ -273,6 +298,81 @@ export interface PolymarketClobTradesResponse {
|
|
|
273
298
|
count: number;
|
|
274
299
|
data: PolymarketClobTrade[];
|
|
275
300
|
}
|
|
301
|
+
export interface PolymarketClobRewardToken {
|
|
302
|
+
asset_address?: string;
|
|
303
|
+
rewards_daily_rate?: number;
|
|
304
|
+
[key: string]: unknown;
|
|
305
|
+
}
|
|
306
|
+
export interface PolymarketClobRewardConfig {
|
|
307
|
+
condition_id?: string;
|
|
308
|
+
rewards?: PolymarketClobRewardToken[];
|
|
309
|
+
min_size?: number;
|
|
310
|
+
max_spread?: number;
|
|
311
|
+
event_start_date?: string;
|
|
312
|
+
event_end_date?: string;
|
|
313
|
+
[key: string]: unknown;
|
|
314
|
+
}
|
|
315
|
+
export interface PolymarketClobUserReward {
|
|
316
|
+
condition_id?: string;
|
|
317
|
+
asset_address?: string;
|
|
318
|
+
amount?: number | string;
|
|
319
|
+
maker_address?: string;
|
|
320
|
+
[key: string]: unknown;
|
|
321
|
+
}
|
|
322
|
+
export interface PolymarketClobUserRewardTotal {
|
|
323
|
+
amount?: number | string;
|
|
324
|
+
maker_address?: string;
|
|
325
|
+
[key: string]: unknown;
|
|
326
|
+
}
|
|
327
|
+
export type PolymarketClobRewardPercentagesResponse = Record<string, number>;
|
|
328
|
+
export interface PolymarketClobRewardsUserMarket {
|
|
329
|
+
condition_id?: string;
|
|
330
|
+
question?: string;
|
|
331
|
+
market_slug?: string;
|
|
332
|
+
rewards?: PolymarketClobRewardConfig[];
|
|
333
|
+
[key: string]: unknown;
|
|
334
|
+
}
|
|
335
|
+
export interface PolymarketClobCurrentRewardsMarket {
|
|
336
|
+
condition_id?: string;
|
|
337
|
+
rewards?: PolymarketClobRewardConfig[];
|
|
338
|
+
[key: string]: unknown;
|
|
339
|
+
}
|
|
340
|
+
export interface PolymarketClobMultiRewardsMarket {
|
|
341
|
+
condition_id?: string;
|
|
342
|
+
question?: string;
|
|
343
|
+
rewards?: PolymarketClobRewardConfig[];
|
|
344
|
+
[key: string]: unknown;
|
|
345
|
+
}
|
|
346
|
+
export type PolymarketClobRewardsUserResponse = PolymarketClobPaginatedResponse<PolymarketClobUserReward>;
|
|
347
|
+
export type PolymarketClobRewardsUserTotalResponse = PolymarketClobUserRewardTotal;
|
|
348
|
+
export type PolymarketClobRewardsUserMarketsResponse = PolymarketClobPaginatedResponse<PolymarketClobRewardsUserMarket>;
|
|
349
|
+
export type PolymarketClobRewardsCurrentResponse = PolymarketClobPaginatedResponse<PolymarketClobCurrentRewardsMarket>;
|
|
350
|
+
export type PolymarketClobRewardsMarketResponse = PolymarketClobPaginatedResponse<PolymarketClobRewardConfig>;
|
|
351
|
+
export type PolymarketClobRewardsMultiMarketsResponse = PolymarketClobPaginatedResponse<PolymarketClobMultiRewardsMarket>;
|
|
352
|
+
export interface PolymarketClobRebatedFee {
|
|
353
|
+
condition_id?: string;
|
|
354
|
+
asset_address?: string;
|
|
355
|
+
amount?: number | string;
|
|
356
|
+
maker_address?: string;
|
|
357
|
+
[key: string]: unknown;
|
|
358
|
+
}
|
|
359
|
+
export type PolymarketClobRebatesCurrentResponse = PolymarketClobRebatedFee[];
|
|
360
|
+
export interface PolymarketClobBuilderTrade {
|
|
361
|
+
id: string;
|
|
362
|
+
market?: string;
|
|
363
|
+
asset_id?: string;
|
|
364
|
+
side?: PolymarketClobSide;
|
|
365
|
+
size?: string;
|
|
366
|
+
price?: string;
|
|
367
|
+
builder_code?: string;
|
|
368
|
+
[key: string]: unknown;
|
|
369
|
+
}
|
|
370
|
+
export interface PolymarketClobBuilderTradesResponse {
|
|
371
|
+
limit: number;
|
|
372
|
+
next_cursor: string;
|
|
373
|
+
count: number;
|
|
374
|
+
data: PolymarketClobBuilderTrade[];
|
|
375
|
+
}
|
|
276
376
|
export interface PolymarketClobTokenQuery {
|
|
277
377
|
token_id: string;
|
|
278
378
|
}
|
|
@@ -310,12 +410,36 @@ export interface PolymarketClobSpreadMethod {
|
|
|
310
410
|
export interface PolymarketClobLastTradePriceMethod {
|
|
311
411
|
(params: PolymarketClobTokenQuery, signal?: AbortSignal): Promise<PolymarketClobLastTradePriceResponse>;
|
|
312
412
|
}
|
|
413
|
+
export interface PolymarketClobBooksMethod {
|
|
414
|
+
(params: PolymarketClobTokenIdsQuery, signal?: AbortSignal): Promise<PolymarketClobBooksResponse>;
|
|
415
|
+
}
|
|
416
|
+
export interface PolymarketClobPricesMethod {
|
|
417
|
+
(params: PolymarketClobPricesQuery, signal?: AbortSignal): Promise<PolymarketClobPricesResponse>;
|
|
418
|
+
}
|
|
419
|
+
export interface PolymarketClobMidpointsMethod {
|
|
420
|
+
(params: PolymarketClobTokenIdsQuery, signal?: AbortSignal): Promise<PolymarketClobMidpointsResponse>;
|
|
421
|
+
}
|
|
422
|
+
export interface PolymarketClobLastTradesPricesMethod {
|
|
423
|
+
(params: PolymarketClobTokenIdsQuery, signal?: AbortSignal): Promise<PolymarketClobLastTradesPricesResponse>;
|
|
424
|
+
}
|
|
313
425
|
export interface PolymarketClobTickSizeMethod {
|
|
314
426
|
(tokenId: string, signal?: AbortSignal): Promise<PolymarketClobTickSizeResponse>;
|
|
315
427
|
}
|
|
428
|
+
export interface PolymarketClobTickSizeQueryMethod {
|
|
429
|
+
(params: PolymarketClobTokenQuery, signal?: AbortSignal): Promise<PolymarketClobTickSizeResponse>;
|
|
430
|
+
}
|
|
316
431
|
export interface PolymarketClobFeeRateMethod {
|
|
317
432
|
(tokenId: string, signal?: AbortSignal): Promise<PolymarketClobFeeRateResponse>;
|
|
318
433
|
}
|
|
434
|
+
export interface PolymarketClobFeeRateQueryMethod {
|
|
435
|
+
(params: PolymarketClobTokenQuery, signal?: AbortSignal): Promise<PolymarketClobFeeRateResponse>;
|
|
436
|
+
}
|
|
437
|
+
export interface PolymarketClobNegRiskMethod {
|
|
438
|
+
(tokenId: string, signal?: AbortSignal): Promise<PolymarketClobNegRiskResponse>;
|
|
439
|
+
}
|
|
440
|
+
export interface PolymarketClobNegRiskQueryMethod {
|
|
441
|
+
(params: PolymarketClobTokenQuery, signal?: AbortSignal): Promise<PolymarketClobNegRiskResponse>;
|
|
442
|
+
}
|
|
319
443
|
export interface PolymarketClobPricesHistoryMethod {
|
|
320
444
|
(params: PolymarketClobPriceHistoryQuery, signal?: AbortSignal): Promise<PolymarketClobPriceHistoryResponse>;
|
|
321
445
|
}
|
|
@@ -339,6 +463,26 @@ export interface PolymarketClobMarketsByTokenMethod {
|
|
|
339
463
|
export interface PolymarketClobMarketsCompactMethod {
|
|
340
464
|
(conditionId: string, signal?: AbortSignal): Promise<PolymarketClobMarketCompact>;
|
|
341
465
|
}
|
|
466
|
+
export interface PolymarketClobMarketLiveActivityMethod {
|
|
467
|
+
(conditionId: string, signal?: AbortSignal): Promise<PolymarketClobLiveActivityResponse>;
|
|
468
|
+
}
|
|
469
|
+
export interface PolymarketClobRewardsGetNamespace {
|
|
470
|
+
user(params: PolymarketClobRewardsUserQuery, signal?: AbortSignal): Promise<PolymarketClobRewardsUserResponse>;
|
|
471
|
+
userTotal(params: PolymarketClobRewardsUserTotalQuery, signal?: AbortSignal): Promise<PolymarketClobRewardsUserTotalResponse>;
|
|
472
|
+
userPercentages(params?: PolymarketClobRewardPercentagesQuery, signal?: AbortSignal): Promise<PolymarketClobRewardPercentagesResponse>;
|
|
473
|
+
userMarkets(params?: PolymarketClobRewardsUserMarketsQuery, signal?: AbortSignal): Promise<PolymarketClobRewardsUserMarketsResponse>;
|
|
474
|
+
markets: {
|
|
475
|
+
current(params?: PolymarketClobRewardsCurrentQuery, signal?: AbortSignal): Promise<PolymarketClobRewardsCurrentResponse>;
|
|
476
|
+
byCondition(conditionId: string, params?: PolymarketClobRewardsMarketQuery, signal?: AbortSignal): Promise<PolymarketClobRewardsMarketResponse>;
|
|
477
|
+
multi(params?: PolymarketClobRewardsMultiMarketsQuery, signal?: AbortSignal): Promise<PolymarketClobRewardsMultiMarketsResponse>;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
export interface PolymarketClobRebatesGetNamespace {
|
|
481
|
+
current(params: PolymarketClobRebatesCurrentQuery, signal?: AbortSignal): Promise<PolymarketClobRebatesCurrentResponse>;
|
|
482
|
+
}
|
|
483
|
+
export interface PolymarketClobBuilderTradesMethod {
|
|
484
|
+
(params: PolymarketClobBuilderTradesQuery, signal?: AbortSignal): Promise<PolymarketClobBuilderTradesResponse>;
|
|
485
|
+
}
|
|
342
486
|
export interface PolymarketClobGetNamespace {
|
|
343
487
|
auth: PolymarketClobAuthGetNamespace;
|
|
344
488
|
time: PolymarketClobTimeMethod;
|
|
@@ -347,8 +491,16 @@ export interface PolymarketClobGetNamespace {
|
|
|
347
491
|
midpoint: PolymarketClobMidpointMethod;
|
|
348
492
|
spread: PolymarketClobSpreadMethod;
|
|
349
493
|
lastTradePrice: PolymarketClobLastTradePriceMethod;
|
|
494
|
+
books: PolymarketClobBooksMethod;
|
|
495
|
+
prices: PolymarketClobPricesMethod;
|
|
496
|
+
midpoints: PolymarketClobMidpointsMethod;
|
|
497
|
+
lastTradesPrices: PolymarketClobLastTradesPricesMethod;
|
|
350
498
|
tickSize: PolymarketClobTickSizeMethod;
|
|
499
|
+
tickSizeByQuery: PolymarketClobTickSizeQueryMethod;
|
|
351
500
|
feeRate: PolymarketClobFeeRateMethod;
|
|
501
|
+
feeRateByQuery: PolymarketClobFeeRateQueryMethod;
|
|
502
|
+
negRisk: PolymarketClobNegRiskMethod;
|
|
503
|
+
negRiskByQuery: PolymarketClobNegRiskQueryMethod;
|
|
352
504
|
pricesHistory: PolymarketClobPricesHistoryMethod;
|
|
353
505
|
markets: PolymarketClobMarketsMethod;
|
|
354
506
|
samplingMarkets: PolymarketClobSamplingMarketsMethod;
|
|
@@ -356,6 +508,10 @@ export interface PolymarketClobGetNamespace {
|
|
|
356
508
|
samplingSimplifiedMarkets: PolymarketClobSamplingSimplifiedMarketsMethod;
|
|
357
509
|
marketsByToken: PolymarketClobMarketsByTokenMethod;
|
|
358
510
|
clobMarkets: PolymarketClobMarketsCompactMethod;
|
|
511
|
+
marketLiveActivity: PolymarketClobMarketLiveActivityMethod;
|
|
512
|
+
rewards: PolymarketClobRewardsGetNamespace;
|
|
513
|
+
rebates: PolymarketClobRebatesGetNamespace;
|
|
514
|
+
builderTrades: PolymarketClobBuilderTradesMethod;
|
|
359
515
|
data: PolymarketClobDataGetNamespace;
|
|
360
516
|
balanceAllowance: PolymarketClobBalanceAllowanceMethod;
|
|
361
517
|
notifications: PolymarketClobNotificationsMethod;
|
|
@@ -386,6 +542,10 @@ export interface PolymarketClobBatchPricesHistoryMethod {
|
|
|
386
542
|
(req: PolymarketClobBatchPricesHistoryRequest, signal?: AbortSignal): Promise<PolymarketClobBatchPricesHistoryResponse>;
|
|
387
543
|
schema: z.ZodType<PolymarketClobBatchPricesHistoryRequest>;
|
|
388
544
|
}
|
|
545
|
+
export interface PolymarketClobMarketsLiveActivityMethod {
|
|
546
|
+
(req: PolymarketClobLiveActivityRequest, signal?: AbortSignal): Promise<PolymarketClobLiveActivityResponse>;
|
|
547
|
+
schema: z.ZodType<PolymarketClobLiveActivityRequest>;
|
|
548
|
+
}
|
|
389
549
|
export interface PolymarketClobL1AuthMethod<T> {
|
|
390
550
|
(signal?: AbortSignal): Promise<T>;
|
|
391
551
|
(headers: PolymarketClobL1Headers, signal?: AbortSignal): Promise<T>;
|
|
@@ -393,15 +553,18 @@ export interface PolymarketClobL1AuthMethod<T> {
|
|
|
393
553
|
export interface PolymarketClobAuthGetNamespace {
|
|
394
554
|
apiKeys: PolymarketClobL1AuthMethod<PolymarketClobApiKeysResponse>;
|
|
395
555
|
deriveApiKey: PolymarketClobL1AuthMethod<PolymarketClobApiKeyResponse>;
|
|
556
|
+
builderApiKey(signal?: AbortSignal): Promise<PolymarketClobBuilderApiKeysResponse>;
|
|
396
557
|
banStatus: {
|
|
397
558
|
closedOnly(signal?: AbortSignal): Promise<PolymarketClobClosedOnlyResponse>;
|
|
398
559
|
};
|
|
399
560
|
}
|
|
400
561
|
export interface PolymarketClobAuthPostNamespace {
|
|
401
562
|
apiKey: PolymarketClobL1AuthMethod<PolymarketClobApiKeyResponse>;
|
|
563
|
+
builderApiKey(signal?: AbortSignal): Promise<PolymarketClobBuilderApiKeyResponse>;
|
|
402
564
|
}
|
|
403
565
|
export interface PolymarketClobAuthDeleteNamespace {
|
|
404
566
|
apiKey(signal?: AbortSignal): Promise<string>;
|
|
567
|
+
builderApiKey(signal?: AbortSignal): Promise<string>;
|
|
405
568
|
}
|
|
406
569
|
export interface PolymarketClobPostOrderMethod {
|
|
407
570
|
(req: PolymarketClobPostOrderRequest, signal?: AbortSignal): Promise<PolymarketClobPostOrderResponse>;
|
|
@@ -485,6 +648,7 @@ export interface PolymarketClobPostNamespace {
|
|
|
485
648
|
spreads: PolymarketClobSpreadsBatchMethod;
|
|
486
649
|
lastTradesPrices: PolymarketClobLastTradesPricesBatchMethod;
|
|
487
650
|
batchPricesHistory: PolymarketClobBatchPricesHistoryMethod;
|
|
651
|
+
marketsLiveActivity: PolymarketClobMarketsLiveActivityMethod;
|
|
488
652
|
heartbeats: PolymarketClobHeartbeatMethod;
|
|
489
653
|
v1: {
|
|
490
654
|
heartbeats: PolymarketClobHeartbeatV1Method;
|
|
@@ -610,6 +774,10 @@ export interface PolymarketGammaRelatedTag {
|
|
|
610
774
|
relatedTagID: number;
|
|
611
775
|
rank: number;
|
|
612
776
|
}
|
|
777
|
+
export interface PolymarketGammaRelatedTagsQuery {
|
|
778
|
+
omit_empty?: boolean;
|
|
779
|
+
status?: "active" | "closed" | "all";
|
|
780
|
+
}
|
|
613
781
|
export interface PolymarketGammaCommentProfile {
|
|
614
782
|
name?: string;
|
|
615
783
|
pseudonym?: string;
|
|
@@ -632,12 +800,14 @@ export interface PolymarketGammaComment {
|
|
|
632
800
|
[key: string]: unknown;
|
|
633
801
|
}
|
|
634
802
|
export interface PolymarketGammaCommentListQuery {
|
|
635
|
-
parent_entity_type: "Event" | "Market";
|
|
803
|
+
parent_entity_type: "Event" | "Series" | "Market" | "market";
|
|
636
804
|
parent_entity_id: number | string;
|
|
637
805
|
limit?: number;
|
|
638
806
|
offset?: number;
|
|
639
807
|
order?: string;
|
|
640
808
|
ascending?: boolean;
|
|
809
|
+
get_positions?: boolean;
|
|
810
|
+
holders_only?: boolean;
|
|
641
811
|
}
|
|
642
812
|
export interface PolymarketGammaCommentByUserQuery {
|
|
643
813
|
limit?: number;
|
|
@@ -680,6 +850,50 @@ export interface PolymarketGammaSport {
|
|
|
680
850
|
export interface PolymarketGammaSportsMarketTypesResponse {
|
|
681
851
|
marketTypes: string[];
|
|
682
852
|
}
|
|
853
|
+
export type PolymarketGammaStatusResponse = string;
|
|
854
|
+
export interface PolymarketGammaTeam {
|
|
855
|
+
id: number;
|
|
856
|
+
name?: string | null;
|
|
857
|
+
league?: string | null;
|
|
858
|
+
record?: string | null;
|
|
859
|
+
logo?: string | null;
|
|
860
|
+
abbreviation?: string | null;
|
|
861
|
+
alias?: string | null;
|
|
862
|
+
createdAt?: string | null;
|
|
863
|
+
updatedAt?: string | null;
|
|
864
|
+
[key: string]: unknown;
|
|
865
|
+
}
|
|
866
|
+
export interface PolymarketGammaTeamsQuery {
|
|
867
|
+
limit?: number;
|
|
868
|
+
offset?: number;
|
|
869
|
+
order?: string;
|
|
870
|
+
ascending?: boolean;
|
|
871
|
+
league?: string | string[];
|
|
872
|
+
name?: string | string[];
|
|
873
|
+
abbreviation?: string | string[];
|
|
874
|
+
}
|
|
875
|
+
export interface PolymarketGammaPublicProfileUser {
|
|
876
|
+
id: string;
|
|
877
|
+
creator?: boolean;
|
|
878
|
+
mod?: boolean;
|
|
879
|
+
[key: string]: unknown;
|
|
880
|
+
}
|
|
881
|
+
export interface PolymarketGammaPublicProfileResponse {
|
|
882
|
+
createdAt?: string | null;
|
|
883
|
+
proxyWallet?: string | null;
|
|
884
|
+
profileImage?: string | null;
|
|
885
|
+
displayUsernamePublic?: boolean | null;
|
|
886
|
+
bio?: string | null;
|
|
887
|
+
pseudonym?: string | null;
|
|
888
|
+
name?: string | null;
|
|
889
|
+
users?: PolymarketGammaPublicProfileUser[] | null;
|
|
890
|
+
xUsername?: string | null;
|
|
891
|
+
verifiedBadge?: boolean | null;
|
|
892
|
+
[key: string]: unknown;
|
|
893
|
+
}
|
|
894
|
+
export interface PolymarketGammaPublicProfileQuery {
|
|
895
|
+
address: string;
|
|
896
|
+
}
|
|
683
897
|
export type PolymarketGammaEventListResponse = PolymarketGammaEvent[];
|
|
684
898
|
export interface PolymarketGammaEventKeysetResponse {
|
|
685
899
|
events: PolymarketGammaEvent[];
|
|
@@ -692,9 +906,11 @@ export interface PolymarketGammaEventListQuery {
|
|
|
692
906
|
ascending?: boolean;
|
|
693
907
|
id?: number | number[];
|
|
694
908
|
slug?: string | string[];
|
|
909
|
+
exclude_tag_id?: number | number[];
|
|
695
910
|
archived?: boolean;
|
|
696
911
|
active?: boolean;
|
|
697
912
|
closed?: boolean;
|
|
913
|
+
live?: boolean;
|
|
698
914
|
liquidity_min?: number;
|
|
699
915
|
liquidity_max?: number;
|
|
700
916
|
volume_min?: number;
|
|
@@ -703,22 +919,56 @@ export interface PolymarketGammaEventListQuery {
|
|
|
703
919
|
start_date_max?: string;
|
|
704
920
|
end_date_min?: string;
|
|
705
921
|
end_date_max?: string;
|
|
922
|
+
start_time_min?: string;
|
|
923
|
+
start_time_max?: string;
|
|
706
924
|
tag?: string;
|
|
707
|
-
tag_id?: number;
|
|
925
|
+
tag_id?: number | number[];
|
|
708
926
|
related_tags?: boolean;
|
|
927
|
+
tag_match?: string;
|
|
709
928
|
tag_slug?: string;
|
|
710
929
|
featured?: boolean;
|
|
930
|
+
title_search?: string;
|
|
711
931
|
restricted?: boolean;
|
|
712
932
|
cyom?: boolean;
|
|
933
|
+
series_id?: number | number[];
|
|
934
|
+
game_id?: number | number[] | string;
|
|
935
|
+
event_date?: string;
|
|
936
|
+
event_week?: number;
|
|
937
|
+
featured_order?: boolean;
|
|
713
938
|
recurrence?: string;
|
|
939
|
+
created_by?: string | string[];
|
|
940
|
+
parent_event_id?: number;
|
|
941
|
+
include_children?: boolean;
|
|
942
|
+
partner_slug?: string;
|
|
943
|
+
include_chat?: boolean;
|
|
944
|
+
include_template?: boolean;
|
|
945
|
+
include_best_lines?: boolean;
|
|
946
|
+
locale?: string;
|
|
714
947
|
}
|
|
715
948
|
export interface PolymarketGammaKeysetQuery extends PolymarketGammaEventListQuery {
|
|
949
|
+
after_cursor?: string;
|
|
950
|
+
/** @deprecated Use after_cursor for requests; responses still use next_cursor. */
|
|
716
951
|
next_cursor?: string;
|
|
717
952
|
}
|
|
718
953
|
export interface PolymarketGammaMarketListQuery extends PolymarketGammaEventListQuery {
|
|
719
954
|
clob_token_ids?: string | string[];
|
|
955
|
+
condition_ids?: string | string[];
|
|
956
|
+
market_maker_address?: string | string[];
|
|
957
|
+
liquidity_num_min?: number;
|
|
958
|
+
liquidity_num_max?: number;
|
|
959
|
+
volume_num_min?: number;
|
|
960
|
+
volume_num_max?: number;
|
|
961
|
+
uma_resolution_status?: string;
|
|
962
|
+
sports_market_types?: string | string[];
|
|
963
|
+
rewards_min_size?: number;
|
|
964
|
+
question_ids?: string | string[];
|
|
965
|
+
include_tag?: boolean;
|
|
966
|
+
decimalized?: boolean;
|
|
967
|
+
rfq_enabled?: boolean;
|
|
720
968
|
}
|
|
721
969
|
export interface PolymarketGammaMarketKeysetQuery extends PolymarketGammaMarketListQuery {
|
|
970
|
+
after_cursor?: string;
|
|
971
|
+
/** @deprecated Use after_cursor for requests; responses still use next_cursor. */
|
|
722
972
|
next_cursor?: string;
|
|
723
973
|
}
|
|
724
974
|
export type PolymarketGammaMarketListResponse = PolymarketGammaMarket[];
|
|
@@ -727,7 +977,17 @@ export interface PolymarketGammaMarketKeysetResponse {
|
|
|
727
977
|
next_cursor: string;
|
|
728
978
|
}
|
|
729
979
|
export interface PolymarketGammaEventsMethod {
|
|
980
|
+
/**
|
|
981
|
+
* @deprecated Upstream marked the list form of GET /events deprecated and
|
|
982
|
+
* recommends /events/keyset. Use events.keyset() for new paginated event
|
|
983
|
+
* list callers.
|
|
984
|
+
*/
|
|
730
985
|
(signal?: AbortSignal): Promise<PolymarketGammaEventListResponse>;
|
|
986
|
+
/**
|
|
987
|
+
* @deprecated Upstream marked the list form of GET /events deprecated and
|
|
988
|
+
* recommends /events/keyset. Use events.keyset() for new paginated event
|
|
989
|
+
* list callers.
|
|
990
|
+
*/
|
|
731
991
|
(params: PolymarketGammaEventListQuery, signal?: AbortSignal): Promise<PolymarketGammaEventListResponse>;
|
|
732
992
|
(id: string, signal?: AbortSignal): Promise<PolymarketGammaEvent>;
|
|
733
993
|
keyset(params?: PolymarketGammaKeysetQuery, signal?: AbortSignal): Promise<PolymarketGammaEventKeysetResponse>;
|
|
@@ -756,7 +1016,16 @@ export interface PolymarketGammaTagsMethod {
|
|
|
756
1016
|
}
|
|
757
1017
|
export interface PolymarketGammaTagsRelatedMethod {
|
|
758
1018
|
(id: string, signal?: AbortSignal): Promise<PolymarketGammaRelatedTag[]>;
|
|
1019
|
+
(id: string, params: PolymarketGammaRelatedTagsQuery, signal?: AbortSignal): Promise<PolymarketGammaRelatedTag[]>;
|
|
759
1020
|
slug(slug: string, signal?: AbortSignal): Promise<PolymarketGammaRelatedTag[]>;
|
|
1021
|
+
slug(slug: string, params: PolymarketGammaRelatedTagsQuery, signal?: AbortSignal): Promise<PolymarketGammaRelatedTag[]>;
|
|
1022
|
+
tags: PolymarketGammaTagsRelatedTagsMethod;
|
|
1023
|
+
}
|
|
1024
|
+
export interface PolymarketGammaTagsRelatedTagsMethod {
|
|
1025
|
+
(id: string, signal?: AbortSignal): Promise<PolymarketGammaTag[]>;
|
|
1026
|
+
(id: string, params: PolymarketGammaRelatedTagsQuery, signal?: AbortSignal): Promise<PolymarketGammaTag[]>;
|
|
1027
|
+
slug(slug: string, signal?: AbortSignal): Promise<PolymarketGammaTag[]>;
|
|
1028
|
+
slug(slug: string, params: PolymarketGammaRelatedTagsQuery, signal?: AbortSignal): Promise<PolymarketGammaTag[]>;
|
|
760
1029
|
}
|
|
761
1030
|
export interface PolymarketGammaCommentsByUserMethod {
|
|
762
1031
|
(address: string, params?: PolymarketGammaCommentByUserQuery, signal?: AbortSignal): Promise<PolymarketGammaComment[]>;
|
|
@@ -776,7 +1045,18 @@ export interface PolymarketGammaSportsMethod {
|
|
|
776
1045
|
(signal?: AbortSignal): Promise<PolymarketGammaSport[]>;
|
|
777
1046
|
marketTypes: PolymarketGammaSportsMarketTypesMethod;
|
|
778
1047
|
}
|
|
1048
|
+
export interface PolymarketGammaStatusMethod {
|
|
1049
|
+
(signal?: AbortSignal): Promise<PolymarketGammaStatusResponse>;
|
|
1050
|
+
}
|
|
1051
|
+
export interface PolymarketGammaTeamsMethod {
|
|
1052
|
+
(signal?: AbortSignal): Promise<PolymarketGammaTeam[]>;
|
|
1053
|
+
(params: PolymarketGammaTeamsQuery, signal?: AbortSignal): Promise<PolymarketGammaTeam[]>;
|
|
1054
|
+
}
|
|
1055
|
+
export interface PolymarketGammaPublicProfileMethod {
|
|
1056
|
+
(params: PolymarketGammaPublicProfileQuery, signal?: AbortSignal): Promise<PolymarketGammaPublicProfileResponse>;
|
|
1057
|
+
}
|
|
779
1058
|
export interface PolymarketGammaGetNamespace {
|
|
1059
|
+
status: PolymarketGammaStatusMethod;
|
|
780
1060
|
events: PolymarketGammaEventsMethod;
|
|
781
1061
|
markets: PolymarketGammaMarketsMethod;
|
|
782
1062
|
series: PolymarketGammaSeriesMethod;
|
|
@@ -784,7 +1064,20 @@ export interface PolymarketGammaGetNamespace {
|
|
|
784
1064
|
comments: PolymarketGammaCommentsMethod;
|
|
785
1065
|
search: PolymarketGammaSearchMethod;
|
|
786
1066
|
sports: PolymarketGammaSportsMethod;
|
|
1067
|
+
teams: PolymarketGammaTeamsMethod;
|
|
1068
|
+
publicProfile: PolymarketGammaPublicProfileMethod;
|
|
1069
|
+
}
|
|
1070
|
+
export type PolymarketDataCsvParam = string | number | Array<string | number>;
|
|
1071
|
+
export type PolymarketDataSortDirection = "ASC" | "DESC";
|
|
1072
|
+
export type PolymarketDataTimePeriod = "DAY" | "WEEK" | "MONTH" | "ALL";
|
|
1073
|
+
export interface PolymarketDataHealthResponse {
|
|
1074
|
+
data: string;
|
|
1075
|
+
[key: string]: unknown;
|
|
787
1076
|
}
|
|
1077
|
+
export interface PolymarketDataUserQuery {
|
|
1078
|
+
user: string;
|
|
1079
|
+
}
|
|
1080
|
+
export type PolymarketDataAccountingSnapshotQuery = PolymarketDataUserQuery;
|
|
788
1081
|
export interface PolymarketDataPosition {
|
|
789
1082
|
proxyWallet: string;
|
|
790
1083
|
asset: string;
|
|
@@ -808,22 +1101,57 @@ export interface PolymarketDataPosition {
|
|
|
808
1101
|
eventSlug?: string;
|
|
809
1102
|
outcome?: string;
|
|
810
1103
|
outcomeIndex?: number;
|
|
1104
|
+
oppositeOutcome?: string;
|
|
1105
|
+
oppositeAsset?: string;
|
|
811
1106
|
endDate?: string;
|
|
1107
|
+
negativeRisk?: boolean;
|
|
812
1108
|
[key: string]: unknown;
|
|
813
1109
|
}
|
|
1110
|
+
export type PolymarketDataPositionsSortBy = "CURRENT" | "INITIAL" | "TOKENS" | "CASHPNL" | "PERCENTPNL" | "TITLE" | "RESOLVING" | "PRICE" | "AVGPRICE" | string;
|
|
814
1111
|
export interface PolymarketDataPositionsQuery {
|
|
815
1112
|
user: string;
|
|
816
|
-
market?:
|
|
817
|
-
eventId?:
|
|
1113
|
+
market?: PolymarketDataCsvParam;
|
|
1114
|
+
eventId?: PolymarketDataCsvParam;
|
|
818
1115
|
sizeThreshold?: number;
|
|
819
1116
|
redeemable?: boolean;
|
|
820
1117
|
mergeable?: boolean;
|
|
821
1118
|
title?: string;
|
|
822
|
-
sortBy?:
|
|
823
|
-
sortDirection?:
|
|
1119
|
+
sortBy?: PolymarketDataPositionsSortBy;
|
|
1120
|
+
sortDirection?: PolymarketDataSortDirection;
|
|
824
1121
|
limit?: number;
|
|
825
1122
|
offset?: number;
|
|
826
1123
|
}
|
|
1124
|
+
export interface PolymarketDataClosedPosition {
|
|
1125
|
+
proxyWallet: string;
|
|
1126
|
+
asset: string;
|
|
1127
|
+
conditionId: string;
|
|
1128
|
+
avgPrice: number;
|
|
1129
|
+
totalBought: number;
|
|
1130
|
+
realizedPnl: number;
|
|
1131
|
+
curPrice: number;
|
|
1132
|
+
timestamp: number;
|
|
1133
|
+
title?: string;
|
|
1134
|
+
slug?: string;
|
|
1135
|
+
icon?: string;
|
|
1136
|
+
eventSlug?: string;
|
|
1137
|
+
outcome?: string;
|
|
1138
|
+
outcomeIndex?: number;
|
|
1139
|
+
oppositeOutcome?: string;
|
|
1140
|
+
oppositeAsset?: string;
|
|
1141
|
+
endDate?: string;
|
|
1142
|
+
[key: string]: unknown;
|
|
1143
|
+
}
|
|
1144
|
+
export type PolymarketDataClosedPositionsSortBy = "REALIZEDPNL" | "TITLE" | "PRICE" | "AVGPRICE" | "TIMESTAMP" | string;
|
|
1145
|
+
export interface PolymarketDataClosedPositionsQuery {
|
|
1146
|
+
user: string;
|
|
1147
|
+
market?: PolymarketDataCsvParam;
|
|
1148
|
+
title?: string;
|
|
1149
|
+
eventId?: PolymarketDataCsvParam;
|
|
1150
|
+
limit?: number;
|
|
1151
|
+
offset?: number;
|
|
1152
|
+
sortBy?: PolymarketDataClosedPositionsSortBy;
|
|
1153
|
+
sortDirection?: PolymarketDataSortDirection;
|
|
1154
|
+
}
|
|
827
1155
|
export interface PolymarketDataValueEntry {
|
|
828
1156
|
user: string;
|
|
829
1157
|
value: number;
|
|
@@ -831,12 +1159,7 @@ export interface PolymarketDataValueEntry {
|
|
|
831
1159
|
export type PolymarketDataValueResponse = PolymarketDataValueEntry[];
|
|
832
1160
|
export interface PolymarketDataValueQuery {
|
|
833
1161
|
user: string;
|
|
834
|
-
|
|
835
|
-
export interface PolymarketDataPositionsMethod {
|
|
836
|
-
(params: PolymarketDataPositionsQuery, signal?: AbortSignal): Promise<PolymarketDataPosition[]>;
|
|
837
|
-
}
|
|
838
|
-
export interface PolymarketDataValueMethod {
|
|
839
|
-
(params: PolymarketDataValueQuery, signal?: AbortSignal): Promise<PolymarketDataValueResponse>;
|
|
1162
|
+
market?: PolymarketDataCsvParam;
|
|
840
1163
|
}
|
|
841
1164
|
export interface PolymarketDataHolderEntry {
|
|
842
1165
|
proxyWallet: string;
|
|
@@ -857,10 +1180,10 @@ export interface PolymarketDataHoldersGroup {
|
|
|
857
1180
|
holders: PolymarketDataHolderEntry[];
|
|
858
1181
|
}
|
|
859
1182
|
export interface PolymarketDataHoldersQuery {
|
|
860
|
-
market:
|
|
1183
|
+
market: PolymarketDataCsvParam;
|
|
861
1184
|
limit?: number;
|
|
862
1185
|
}
|
|
863
|
-
export type PolymarketDataActivityType = "TRADE" | "
|
|
1186
|
+
export type PolymarketDataActivityType = "TRADE" | "SPLIT" | "MERGE" | "REDEEM" | "REWARD" | "CONVERSION" | "MAKER_REBATE" | "TAKER_REBATE" | "REFERRAL_REWARD" | string;
|
|
864
1187
|
export interface PolymarketDataActivityEntry {
|
|
865
1188
|
proxyWallet: string;
|
|
866
1189
|
timestamp: number;
|
|
@@ -875,19 +1198,30 @@ export interface PolymarketDataActivityEntry {
|
|
|
875
1198
|
outcomeIndex?: number;
|
|
876
1199
|
title?: string;
|
|
877
1200
|
slug?: string;
|
|
1201
|
+
icon?: string;
|
|
1202
|
+
eventSlug?: string;
|
|
1203
|
+
outcome?: string;
|
|
1204
|
+
name?: string;
|
|
1205
|
+
pseudonym?: string;
|
|
1206
|
+
bio?: string;
|
|
1207
|
+
profileImage?: string;
|
|
1208
|
+
profileImageOptimized?: string;
|
|
1209
|
+
isCombo?: boolean;
|
|
878
1210
|
[key: string]: unknown;
|
|
879
1211
|
}
|
|
1212
|
+
export type PolymarketDataActivitySortBy = "TIMESTAMP" | "TOKENS" | "CASH";
|
|
880
1213
|
export interface PolymarketDataActivityQuery {
|
|
881
1214
|
user: string;
|
|
882
1215
|
limit?: number;
|
|
883
1216
|
offset?: number;
|
|
884
|
-
market?:
|
|
1217
|
+
market?: PolymarketDataCsvParam;
|
|
1218
|
+
eventId?: PolymarketDataCsvParam;
|
|
885
1219
|
type?: PolymarketDataActivityType | PolymarketDataActivityType[];
|
|
886
1220
|
start?: number;
|
|
887
1221
|
end?: number;
|
|
888
1222
|
side?: "BUY" | "SELL";
|
|
889
|
-
sortBy?:
|
|
890
|
-
sortDirection?:
|
|
1223
|
+
sortBy?: PolymarketDataActivitySortBy;
|
|
1224
|
+
sortDirection?: PolymarketDataSortDirection;
|
|
891
1225
|
}
|
|
892
1226
|
export interface PolymarketDataTradeEntry {
|
|
893
1227
|
proxyWallet: string;
|
|
@@ -901,15 +1235,31 @@ export interface PolymarketDataTradeEntry {
|
|
|
901
1235
|
slug?: string;
|
|
902
1236
|
icon?: string;
|
|
903
1237
|
eventSlug?: string;
|
|
1238
|
+
outcome?: string;
|
|
1239
|
+
outcomeIndex?: number;
|
|
1240
|
+
name?: string;
|
|
1241
|
+
pseudonym?: string;
|
|
1242
|
+
bio?: string;
|
|
1243
|
+
profileImage?: string;
|
|
1244
|
+
profileImageOptimized?: string;
|
|
1245
|
+
transactionHash?: string;
|
|
904
1246
|
[key: string]: unknown;
|
|
905
1247
|
}
|
|
906
1248
|
export interface PolymarketDataTradesQuery {
|
|
907
1249
|
user?: string;
|
|
908
|
-
market?:
|
|
1250
|
+
market?: PolymarketDataCsvParam;
|
|
1251
|
+
eventId?: PolymarketDataCsvParam;
|
|
909
1252
|
limit?: number;
|
|
910
1253
|
offset?: number;
|
|
911
1254
|
takerOnly?: boolean;
|
|
912
|
-
filterType?: string;
|
|
1255
|
+
filterType?: "CASH" | "TOKENS" | string;
|
|
1256
|
+
filterAmount?: number;
|
|
1257
|
+
side?: "BUY" | "SELL";
|
|
1258
|
+
}
|
|
1259
|
+
export interface PolymarketDataTradedResponse {
|
|
1260
|
+
user: string;
|
|
1261
|
+
traded: number;
|
|
1262
|
+
[key: string]: unknown;
|
|
913
1263
|
}
|
|
914
1264
|
export interface PolymarketDataOpenInterestEntry {
|
|
915
1265
|
market: string;
|
|
@@ -917,7 +1267,7 @@ export interface PolymarketDataOpenInterestEntry {
|
|
|
917
1267
|
}
|
|
918
1268
|
export type PolymarketDataOpenInterestResponse = PolymarketDataOpenInterestEntry[];
|
|
919
1269
|
export interface PolymarketDataOpenInterestQuery {
|
|
920
|
-
market?:
|
|
1270
|
+
market?: PolymarketDataCsvParam;
|
|
921
1271
|
}
|
|
922
1272
|
export interface PolymarketDataLiveVolumeMarket {
|
|
923
1273
|
market: string;
|
|
@@ -931,29 +1281,259 @@ export type PolymarketDataLiveVolumeResponse = PolymarketDataLiveVolumeEntry[];
|
|
|
931
1281
|
export interface PolymarketDataLiveVolumeQuery {
|
|
932
1282
|
id: string | number;
|
|
933
1283
|
}
|
|
1284
|
+
export interface PolymarketDataPagination {
|
|
1285
|
+
limit: number;
|
|
1286
|
+
offset: number;
|
|
1287
|
+
has_more: boolean;
|
|
1288
|
+
next_cursor: string | null;
|
|
1289
|
+
[key: string]: unknown;
|
|
1290
|
+
}
|
|
1291
|
+
export interface PolymarketDataComboEvent {
|
|
1292
|
+
event_id?: string;
|
|
1293
|
+
event_slug?: string;
|
|
1294
|
+
event_title?: string;
|
|
1295
|
+
event_image?: string;
|
|
1296
|
+
[key: string]: unknown;
|
|
1297
|
+
}
|
|
1298
|
+
export interface PolymarketDataComboMarket {
|
|
1299
|
+
market_id?: string;
|
|
1300
|
+
slug?: string;
|
|
1301
|
+
title?: string;
|
|
1302
|
+
outcome?: string;
|
|
1303
|
+
image_url?: string;
|
|
1304
|
+
icon_url?: string;
|
|
1305
|
+
category?: string;
|
|
1306
|
+
subcategory?: string;
|
|
1307
|
+
tags?: string[];
|
|
1308
|
+
end_date?: string;
|
|
1309
|
+
event?: PolymarketDataComboEvent;
|
|
1310
|
+
[key: string]: unknown;
|
|
1311
|
+
}
|
|
1312
|
+
export interface PolymarketDataComboLeg {
|
|
1313
|
+
leg_index?: number;
|
|
1314
|
+
leg_position_id?: string;
|
|
1315
|
+
leg_condition_id?: string;
|
|
1316
|
+
leg_outcome_index?: number;
|
|
1317
|
+
leg_outcome_label?: string;
|
|
1318
|
+
leg_status?: string;
|
|
1319
|
+
leg_resolved_at?: string | null;
|
|
1320
|
+
leg_current_price?: string;
|
|
1321
|
+
market?: PolymarketDataComboMarket;
|
|
1322
|
+
[key: string]: unknown;
|
|
1323
|
+
}
|
|
1324
|
+
export type PolymarketDataComboStatus = "OPEN" | "PARTIAL" | "RESOLVED_WIN" | "RESOLVED_LOSS";
|
|
1325
|
+
export interface PolymarketDataComboPosition {
|
|
1326
|
+
combo_condition_id: string;
|
|
1327
|
+
combo_position_id: string;
|
|
1328
|
+
module_id: number;
|
|
1329
|
+
user_address: string;
|
|
1330
|
+
shares_balance: string;
|
|
1331
|
+
entry_avg_price_usdc: string;
|
|
1332
|
+
entry_cost_usdc: string;
|
|
1333
|
+
realized_payout_usdc: string;
|
|
1334
|
+
total_cost_usdc: string;
|
|
1335
|
+
status: PolymarketDataComboStatus;
|
|
1336
|
+
first_entry_at: string;
|
|
1337
|
+
resolved_at: string | null;
|
|
1338
|
+
legs_total: number;
|
|
1339
|
+
legs_resolved: number;
|
|
1340
|
+
legs_pending: number;
|
|
1341
|
+
legs: PolymarketDataComboLeg[];
|
|
1342
|
+
[key: string]: unknown;
|
|
1343
|
+
}
|
|
1344
|
+
export interface PolymarketDataComboActivity {
|
|
1345
|
+
id: string;
|
|
1346
|
+
event_kind: string;
|
|
1347
|
+
side: "Split" | "Merge" | "Convert" | "Compress" | "Wrap" | "Unwrap" | "Redeem";
|
|
1348
|
+
module_kind: string;
|
|
1349
|
+
user_address: string;
|
|
1350
|
+
combo_condition_id: string;
|
|
1351
|
+
combo_position_id: string;
|
|
1352
|
+
module_id: number;
|
|
1353
|
+
amount_usdc: number | null;
|
|
1354
|
+
payout_usdc: number | null;
|
|
1355
|
+
timestamp: number;
|
|
1356
|
+
tx_dttm: string;
|
|
1357
|
+
tx_hash: string;
|
|
1358
|
+
log_index: number;
|
|
1359
|
+
block_number: number;
|
|
1360
|
+
legs: PolymarketDataComboLeg[];
|
|
1361
|
+
[key: string]: unknown;
|
|
1362
|
+
}
|
|
1363
|
+
export interface PolymarketDataComboPositionsResponse {
|
|
1364
|
+
combos: PolymarketDataComboPosition[];
|
|
1365
|
+
pagination: PolymarketDataPagination;
|
|
1366
|
+
}
|
|
1367
|
+
export interface PolymarketDataComboActivityResponse {
|
|
1368
|
+
activity: PolymarketDataComboActivity[];
|
|
1369
|
+
pagination: PolymarketDataPagination;
|
|
1370
|
+
}
|
|
1371
|
+
export interface PolymarketDataComboActivityQuery {
|
|
1372
|
+
user: string;
|
|
1373
|
+
market_id?: PolymarketDataCsvParam;
|
|
1374
|
+
limit?: number;
|
|
1375
|
+
offset?: number;
|
|
1376
|
+
}
|
|
1377
|
+
export type PolymarketDataComboPositionsSort = "current_value_desc" | "first_entry_desc" | "entry_cost_desc" | "resolved_at_desc";
|
|
1378
|
+
export interface PolymarketDataComboPositionsQuery {
|
|
1379
|
+
user: string;
|
|
1380
|
+
status?: PolymarketDataComboStatus;
|
|
1381
|
+
sort?: PolymarketDataComboPositionsSort;
|
|
1382
|
+
market_id?: PolymarketDataCsvParam;
|
|
1383
|
+
limit?: number;
|
|
1384
|
+
offset?: number;
|
|
1385
|
+
}
|
|
1386
|
+
export interface PolymarketDataMarketPosition {
|
|
1387
|
+
proxyWallet: string;
|
|
1388
|
+
name?: string;
|
|
1389
|
+
profileImage?: string;
|
|
1390
|
+
verified?: boolean;
|
|
1391
|
+
asset: string;
|
|
1392
|
+
conditionId: string;
|
|
1393
|
+
avgPrice: number;
|
|
1394
|
+
size: number;
|
|
1395
|
+
currPrice: number;
|
|
1396
|
+
currentValue: number;
|
|
1397
|
+
cashPnl: number;
|
|
1398
|
+
totalBought: number;
|
|
1399
|
+
realizedPnl: number;
|
|
1400
|
+
totalPnl: number;
|
|
1401
|
+
outcome?: string;
|
|
1402
|
+
outcomeIndex?: number;
|
|
1403
|
+
[key: string]: unknown;
|
|
1404
|
+
}
|
|
1405
|
+
export interface PolymarketDataMarketPositionsGroup {
|
|
1406
|
+
token: string;
|
|
1407
|
+
positions: PolymarketDataMarketPosition[];
|
|
1408
|
+
}
|
|
1409
|
+
export type PolymarketDataMarketPositionStatus = "OPEN" | "CLOSED" | "ALL";
|
|
1410
|
+
export type PolymarketDataMarketPositionsSortBy = "TOKENS" | "CASH_PNL" | "REALIZED_PNL" | "TOTAL_PNL";
|
|
1411
|
+
export interface PolymarketDataMarketPositionsQuery {
|
|
1412
|
+
market: string;
|
|
1413
|
+
user?: string;
|
|
1414
|
+
status?: PolymarketDataMarketPositionStatus;
|
|
1415
|
+
sortBy?: PolymarketDataMarketPositionsSortBy;
|
|
1416
|
+
sortDirection?: PolymarketDataSortDirection;
|
|
1417
|
+
limit?: number;
|
|
1418
|
+
offset?: number;
|
|
1419
|
+
}
|
|
1420
|
+
export interface PolymarketDataBuilderLeaderboardEntry {
|
|
1421
|
+
rank: string;
|
|
1422
|
+
builder: string;
|
|
1423
|
+
builderCode?: string;
|
|
1424
|
+
volume: number;
|
|
1425
|
+
activeUsers: number;
|
|
1426
|
+
verified: boolean;
|
|
1427
|
+
builderLogo?: string;
|
|
1428
|
+
[key: string]: unknown;
|
|
1429
|
+
}
|
|
1430
|
+
export interface PolymarketDataBuilderVolumeEntry extends PolymarketDataBuilderLeaderboardEntry {
|
|
1431
|
+
dt: string;
|
|
1432
|
+
}
|
|
1433
|
+
export interface PolymarketDataBuildersLeaderboardQuery {
|
|
1434
|
+
timePeriod?: PolymarketDataTimePeriod;
|
|
1435
|
+
limit?: number;
|
|
1436
|
+
offset?: number;
|
|
1437
|
+
}
|
|
1438
|
+
export interface PolymarketDataBuildersVolumeQuery {
|
|
1439
|
+
timePeriod?: PolymarketDataTimePeriod;
|
|
1440
|
+
}
|
|
1441
|
+
export interface PolymarketDataTraderLeaderboardEntry {
|
|
1442
|
+
rank: string;
|
|
1443
|
+
proxyWallet: string;
|
|
1444
|
+
userName: string;
|
|
1445
|
+
vol: number;
|
|
1446
|
+
pnl: number;
|
|
1447
|
+
profileImage?: string;
|
|
1448
|
+
xUsername?: string;
|
|
1449
|
+
verifiedBadge?: boolean;
|
|
1450
|
+
[key: string]: unknown;
|
|
1451
|
+
}
|
|
1452
|
+
export type PolymarketDataLeaderboardCategory = "OVERALL" | "POLITICS" | "SPORTS" | "ESPORTS" | "CRYPTO" | "CULTURE" | "MENTIONS" | "WEATHER" | "ECONOMICS" | "TECH" | "FINANCE";
|
|
1453
|
+
export interface PolymarketDataLeaderboardQuery {
|
|
1454
|
+
category?: PolymarketDataLeaderboardCategory;
|
|
1455
|
+
timePeriod?: PolymarketDataTimePeriod;
|
|
1456
|
+
orderBy?: "PNL" | "VOL";
|
|
1457
|
+
limit?: number;
|
|
1458
|
+
offset?: number;
|
|
1459
|
+
user?: string;
|
|
1460
|
+
userName?: string;
|
|
1461
|
+
}
|
|
1462
|
+
export interface PolymarketDataHealthMethod {
|
|
1463
|
+
(signal?: AbortSignal): Promise<PolymarketDataHealthResponse>;
|
|
1464
|
+
}
|
|
1465
|
+
export interface PolymarketDataAccountingSnapshotMethod {
|
|
1466
|
+
(params: PolymarketDataAccountingSnapshotQuery, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
1467
|
+
}
|
|
1468
|
+
export interface PolymarketDataAccountingNamespace {
|
|
1469
|
+
snapshot: PolymarketDataAccountingSnapshotMethod;
|
|
1470
|
+
}
|
|
1471
|
+
export interface PolymarketDataComboPositionsMethod {
|
|
1472
|
+
(params: PolymarketDataComboPositionsQuery, signal?: AbortSignal): Promise<PolymarketDataComboPositionsResponse>;
|
|
1473
|
+
}
|
|
1474
|
+
export interface PolymarketDataPositionsMethod {
|
|
1475
|
+
(params: PolymarketDataPositionsQuery, signal?: AbortSignal): Promise<PolymarketDataPosition[]>;
|
|
1476
|
+
combos: PolymarketDataComboPositionsMethod;
|
|
1477
|
+
}
|
|
1478
|
+
export interface PolymarketDataValueMethod {
|
|
1479
|
+
(params: PolymarketDataValueQuery, signal?: AbortSignal): Promise<PolymarketDataValueResponse>;
|
|
1480
|
+
}
|
|
934
1481
|
export interface PolymarketDataHoldersMethod {
|
|
935
1482
|
(params: PolymarketDataHoldersQuery, signal?: AbortSignal): Promise<PolymarketDataHoldersGroup[]>;
|
|
936
1483
|
}
|
|
1484
|
+
export interface PolymarketDataComboActivityMethod {
|
|
1485
|
+
(params: PolymarketDataComboActivityQuery, signal?: AbortSignal): Promise<PolymarketDataComboActivityResponse>;
|
|
1486
|
+
}
|
|
937
1487
|
export interface PolymarketDataActivityMethod {
|
|
938
1488
|
(params: PolymarketDataActivityQuery, signal?: AbortSignal): Promise<PolymarketDataActivityEntry[]>;
|
|
1489
|
+
combos: PolymarketDataComboActivityMethod;
|
|
939
1490
|
}
|
|
940
1491
|
export interface PolymarketDataTradesMethod {
|
|
941
1492
|
(params: PolymarketDataTradesQuery, signal?: AbortSignal): Promise<PolymarketDataTradeEntry[]>;
|
|
942
1493
|
}
|
|
1494
|
+
export interface PolymarketDataTradedMethod {
|
|
1495
|
+
(params: PolymarketDataUserQuery, signal?: AbortSignal): Promise<PolymarketDataTradedResponse>;
|
|
1496
|
+
}
|
|
943
1497
|
export interface PolymarketDataOpenInterestMethod {
|
|
944
1498
|
(params?: PolymarketDataOpenInterestQuery, signal?: AbortSignal): Promise<PolymarketDataOpenInterestResponse>;
|
|
945
1499
|
}
|
|
946
1500
|
export interface PolymarketDataLiveVolumeMethod {
|
|
947
1501
|
(params: PolymarketDataLiveVolumeQuery, signal?: AbortSignal): Promise<PolymarketDataLiveVolumeResponse>;
|
|
948
1502
|
}
|
|
1503
|
+
export interface PolymarketDataClosedPositionsMethod {
|
|
1504
|
+
(params: PolymarketDataClosedPositionsQuery, signal?: AbortSignal): Promise<PolymarketDataClosedPosition[]>;
|
|
1505
|
+
}
|
|
1506
|
+
export interface PolymarketDataMarketPositionsMethod {
|
|
1507
|
+
(params: PolymarketDataMarketPositionsQuery, signal?: AbortSignal): Promise<PolymarketDataMarketPositionsGroup[]>;
|
|
1508
|
+
}
|
|
1509
|
+
export interface PolymarketDataBuildersLeaderboardMethod {
|
|
1510
|
+
(params?: PolymarketDataBuildersLeaderboardQuery, signal?: AbortSignal): Promise<PolymarketDataBuilderLeaderboardEntry[]>;
|
|
1511
|
+
}
|
|
1512
|
+
export interface PolymarketDataBuildersVolumeMethod {
|
|
1513
|
+
(params?: PolymarketDataBuildersVolumeQuery, signal?: AbortSignal): Promise<PolymarketDataBuilderVolumeEntry[]>;
|
|
1514
|
+
}
|
|
1515
|
+
export interface PolymarketDataBuildersNamespace {
|
|
1516
|
+
leaderboard: PolymarketDataBuildersLeaderboardMethod;
|
|
1517
|
+
volume: PolymarketDataBuildersVolumeMethod;
|
|
1518
|
+
}
|
|
1519
|
+
export interface PolymarketDataLeaderboardMethod {
|
|
1520
|
+
(params?: PolymarketDataLeaderboardQuery, signal?: AbortSignal): Promise<PolymarketDataTraderLeaderboardEntry[]>;
|
|
1521
|
+
}
|
|
949
1522
|
export interface PolymarketDataGetNamespace {
|
|
1523
|
+
health: PolymarketDataHealthMethod;
|
|
1524
|
+
accounting: PolymarketDataAccountingNamespace;
|
|
950
1525
|
positions: PolymarketDataPositionsMethod;
|
|
951
1526
|
value: PolymarketDataValueMethod;
|
|
952
1527
|
holders: PolymarketDataHoldersMethod;
|
|
953
1528
|
activity: PolymarketDataActivityMethod;
|
|
954
1529
|
trades: PolymarketDataTradesMethod;
|
|
1530
|
+
traded: PolymarketDataTradedMethod;
|
|
955
1531
|
oi: PolymarketDataOpenInterestMethod;
|
|
956
1532
|
liveVolume: PolymarketDataLiveVolumeMethod;
|
|
1533
|
+
closedPositions: PolymarketDataClosedPositionsMethod;
|
|
1534
|
+
marketPositions: PolymarketDataMarketPositionsMethod;
|
|
1535
|
+
builders: PolymarketDataBuildersNamespace;
|
|
1536
|
+
leaderboard: PolymarketDataLeaderboardMethod;
|
|
957
1537
|
}
|
|
958
1538
|
export interface PolymarketGetNamespace {
|
|
959
1539
|
clob: PolymarketClobGetNamespace;
|