@apicity/polymarket 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +729 -0
- package/dist/src/_helpers.d.ts +10 -0
- package/dist/src/_helpers.d.ts.map +1 -0
- package/dist/src/_helpers.js +128 -0
- package/dist/src/_helpers.js.map +1 -0
- package/dist/src/clob.d.ts +11 -0
- package/dist/src/clob.d.ts.map +1 -0
- package/dist/src/clob.js +193 -0
- package/dist/src/clob.js.map +1 -0
- package/dist/src/data.d.ts +8 -0
- package/dist/src/data.d.ts.map +1 -0
- package/dist/src/data.js +179 -0
- package/dist/src/data.js.map +1 -0
- package/dist/src/example.d.ts +8 -0
- package/dist/src/example.d.ts.map +1 -0
- package/dist/src/example.js +150 -0
- package/dist/src/example.js.map +1 -0
- package/dist/src/gamma.d.ts +8 -0
- package/dist/src/gamma.d.ts.map +1 -0
- package/dist/src/gamma.js +343 -0
- package/dist/src/gamma.js.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/polymarket.d.ts +3 -0
- package/dist/src/polymarket.d.ts.map +1 -0
- package/dist/src/polymarket.js +23 -0
- package/dist/src/polymarket.js.map +1 -0
- package/dist/src/types.d.ts +728 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +15 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/zod.d.ts +63 -0
- package/dist/src/zod.d.ts.map +1 -0
- package/dist/src/zod.js +52 -0
- package/dist/src/zod.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { PolymarketClobTokenBatchRequest, PolymarketClobPricesBatchRequest, PolymarketClobBatchPricesHistoryRequest } from "./zod";
|
|
3
|
+
export type { PolymarketOptions, PolymarketClobTokenBatchRequest, PolymarketClobPricesBatchRequest, PolymarketClobBatchPricesHistoryRequest, } from "./zod";
|
|
4
|
+
export type PolymarketClobSide = "BUY" | "SELL";
|
|
5
|
+
export type PolymarketServerTime = number;
|
|
6
|
+
export interface PolymarketClobBookLevel {
|
|
7
|
+
price: string;
|
|
8
|
+
size: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PolymarketClobBook {
|
|
11
|
+
market: string;
|
|
12
|
+
asset_id: string;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
hash: string;
|
|
15
|
+
bids: PolymarketClobBookLevel[];
|
|
16
|
+
asks: PolymarketClobBookLevel[];
|
|
17
|
+
}
|
|
18
|
+
export interface PolymarketClobPriceResponse {
|
|
19
|
+
price: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PolymarketClobMidpointResponse {
|
|
22
|
+
mid: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PolymarketClobSpreadResponse {
|
|
25
|
+
spread: string;
|
|
26
|
+
}
|
|
27
|
+
export interface PolymarketClobLastTradePriceResponse {
|
|
28
|
+
price: string;
|
|
29
|
+
side: PolymarketClobSide;
|
|
30
|
+
}
|
|
31
|
+
export interface PolymarketClobTickSizeResponse {
|
|
32
|
+
minimum_tick_size: number;
|
|
33
|
+
}
|
|
34
|
+
export interface PolymarketClobFeeRateResponse {
|
|
35
|
+
base_fee: number;
|
|
36
|
+
}
|
|
37
|
+
export interface PolymarketClobPriceHistoryPoint {
|
|
38
|
+
t: number;
|
|
39
|
+
p: number;
|
|
40
|
+
}
|
|
41
|
+
export interface PolymarketClobPriceHistoryResponse {
|
|
42
|
+
history: PolymarketClobPriceHistoryPoint[];
|
|
43
|
+
}
|
|
44
|
+
export interface PolymarketClobMarketToken {
|
|
45
|
+
token_id: string;
|
|
46
|
+
outcome: string;
|
|
47
|
+
price: number;
|
|
48
|
+
winner: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface PolymarketClobMarketRewardRate {
|
|
51
|
+
asset_address: string;
|
|
52
|
+
rewards_daily_rate: number;
|
|
53
|
+
}
|
|
54
|
+
export interface PolymarketClobMarketRewards {
|
|
55
|
+
rates: PolymarketClobMarketRewardRate[] | null;
|
|
56
|
+
min_size: number;
|
|
57
|
+
max_spread: number;
|
|
58
|
+
}
|
|
59
|
+
export interface PolymarketClobMarket {
|
|
60
|
+
enable_order_book: boolean;
|
|
61
|
+
active: boolean;
|
|
62
|
+
closed: boolean;
|
|
63
|
+
archived: boolean;
|
|
64
|
+
accepting_orders: boolean;
|
|
65
|
+
accepting_order_timestamp: string | null;
|
|
66
|
+
minimum_order_size: number;
|
|
67
|
+
minimum_tick_size: number;
|
|
68
|
+
condition_id: string;
|
|
69
|
+
question_id: string;
|
|
70
|
+
question: string;
|
|
71
|
+
description: string;
|
|
72
|
+
market_slug: string;
|
|
73
|
+
end_date_iso: string | null;
|
|
74
|
+
game_start_time: string | null;
|
|
75
|
+
seconds_delay: number;
|
|
76
|
+
fpmm: string;
|
|
77
|
+
maker_base_fee: number;
|
|
78
|
+
taker_base_fee: number;
|
|
79
|
+
notifications_enabled: boolean;
|
|
80
|
+
neg_risk: boolean;
|
|
81
|
+
neg_risk_market_id: string;
|
|
82
|
+
neg_risk_request_id: string;
|
|
83
|
+
icon: string;
|
|
84
|
+
image: string;
|
|
85
|
+
rewards: PolymarketClobMarketRewards;
|
|
86
|
+
is_50_50_outcome: boolean;
|
|
87
|
+
tokens: PolymarketClobMarketToken[];
|
|
88
|
+
tags: string[];
|
|
89
|
+
}
|
|
90
|
+
export interface PolymarketClobSimplifiedMarket {
|
|
91
|
+
condition_id: string;
|
|
92
|
+
rewards: PolymarketClobMarketRewards;
|
|
93
|
+
tokens: PolymarketClobMarketToken[];
|
|
94
|
+
active: boolean;
|
|
95
|
+
closed: boolean;
|
|
96
|
+
archived: boolean;
|
|
97
|
+
accepting_orders: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface PolymarketClobPaginationQuery {
|
|
100
|
+
next_cursor?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface PolymarketClobPaginatedResponse<T> {
|
|
103
|
+
data: T[];
|
|
104
|
+
next_cursor: string;
|
|
105
|
+
limit: number;
|
|
106
|
+
count: number;
|
|
107
|
+
}
|
|
108
|
+
export type PolymarketClobMarketListResponse = PolymarketClobPaginatedResponse<PolymarketClobMarket>;
|
|
109
|
+
export type PolymarketClobSimplifiedMarketListResponse = PolymarketClobPaginatedResponse<PolymarketClobSimplifiedMarket>;
|
|
110
|
+
export interface PolymarketClobMarketsByTokenResponse {
|
|
111
|
+
condition_id: string;
|
|
112
|
+
primary_token_id: string;
|
|
113
|
+
secondary_token_id: string;
|
|
114
|
+
}
|
|
115
|
+
export interface PolymarketClobMarketCompactToken {
|
|
116
|
+
t: string;
|
|
117
|
+
o: string;
|
|
118
|
+
}
|
|
119
|
+
export interface PolymarketClobMarketCompactRewards {
|
|
120
|
+
mi: number;
|
|
121
|
+
ma: number;
|
|
122
|
+
e: boolean;
|
|
123
|
+
moas: number;
|
|
124
|
+
}
|
|
125
|
+
export interface PolymarketClobMarketCompactFundingDetails {
|
|
126
|
+
r: number;
|
|
127
|
+
e: number;
|
|
128
|
+
to: boolean;
|
|
129
|
+
}
|
|
130
|
+
export interface PolymarketClobMarketCompact {
|
|
131
|
+
c: string;
|
|
132
|
+
t: PolymarketClobMarketCompactToken[];
|
|
133
|
+
r: PolymarketClobMarketCompactRewards;
|
|
134
|
+
mos: number;
|
|
135
|
+
mts: number;
|
|
136
|
+
mbf: number;
|
|
137
|
+
tbf: number;
|
|
138
|
+
ao: boolean;
|
|
139
|
+
cbos: boolean;
|
|
140
|
+
aot: string;
|
|
141
|
+
ibce: boolean;
|
|
142
|
+
fd: PolymarketClobMarketCompactFundingDetails;
|
|
143
|
+
}
|
|
144
|
+
export type PolymarketClobBooksBatchResponse = PolymarketClobBook[];
|
|
145
|
+
export type PolymarketClobPricesBatchResponse = Record<string, Partial<Record<PolymarketClobSide, string>>>;
|
|
146
|
+
export type PolymarketClobMidpointsBatchResponse = Record<string, string>;
|
|
147
|
+
export type PolymarketClobSpreadsBatchResponse = Record<string, string>;
|
|
148
|
+
export interface PolymarketClobLastTradesPricesEntry {
|
|
149
|
+
price: string;
|
|
150
|
+
side: PolymarketClobSide;
|
|
151
|
+
token_id: string;
|
|
152
|
+
}
|
|
153
|
+
export type PolymarketClobLastTradesPricesBatchResponse = PolymarketClobLastTradesPricesEntry[];
|
|
154
|
+
export interface PolymarketClobBatchPricesHistoryResponse {
|
|
155
|
+
history: Record<string, PolymarketClobPriceHistoryPoint[]>;
|
|
156
|
+
}
|
|
157
|
+
export interface PolymarketClobTokenQuery {
|
|
158
|
+
token_id: string;
|
|
159
|
+
}
|
|
160
|
+
export interface PolymarketClobPriceQuery extends PolymarketClobTokenQuery {
|
|
161
|
+
side: PolymarketClobSide;
|
|
162
|
+
}
|
|
163
|
+
export type PolymarketClobPriceHistoryInterval = "1m" | "1h" | "6h" | "1d" | "1w" | "max";
|
|
164
|
+
export interface PolymarketClobPriceHistoryQuery {
|
|
165
|
+
market: string;
|
|
166
|
+
interval?: PolymarketClobPriceHistoryInterval;
|
|
167
|
+
startTs?: number;
|
|
168
|
+
endTs?: number;
|
|
169
|
+
fidelity?: number;
|
|
170
|
+
}
|
|
171
|
+
export declare class PolymarketError extends Error {
|
|
172
|
+
readonly status: number;
|
|
173
|
+
readonly body: unknown;
|
|
174
|
+
constructor(message: string, status: number, body?: unknown);
|
|
175
|
+
}
|
|
176
|
+
export interface PolymarketClobTimeMethod {
|
|
177
|
+
(signal?: AbortSignal): Promise<PolymarketServerTime>;
|
|
178
|
+
}
|
|
179
|
+
export interface PolymarketClobBookMethod {
|
|
180
|
+
(params: PolymarketClobTokenQuery, signal?: AbortSignal): Promise<PolymarketClobBook>;
|
|
181
|
+
}
|
|
182
|
+
export interface PolymarketClobPriceMethod {
|
|
183
|
+
(params: PolymarketClobPriceQuery, signal?: AbortSignal): Promise<PolymarketClobPriceResponse>;
|
|
184
|
+
}
|
|
185
|
+
export interface PolymarketClobMidpointMethod {
|
|
186
|
+
(params: PolymarketClobTokenQuery, signal?: AbortSignal): Promise<PolymarketClobMidpointResponse>;
|
|
187
|
+
}
|
|
188
|
+
export interface PolymarketClobSpreadMethod {
|
|
189
|
+
(params: PolymarketClobTokenQuery, signal?: AbortSignal): Promise<PolymarketClobSpreadResponse>;
|
|
190
|
+
}
|
|
191
|
+
export interface PolymarketClobLastTradePriceMethod {
|
|
192
|
+
(params: PolymarketClobTokenQuery, signal?: AbortSignal): Promise<PolymarketClobLastTradePriceResponse>;
|
|
193
|
+
}
|
|
194
|
+
export interface PolymarketClobTickSizeMethod {
|
|
195
|
+
(tokenId: string, signal?: AbortSignal): Promise<PolymarketClobTickSizeResponse>;
|
|
196
|
+
}
|
|
197
|
+
export interface PolymarketClobFeeRateMethod {
|
|
198
|
+
(tokenId: string, signal?: AbortSignal): Promise<PolymarketClobFeeRateResponse>;
|
|
199
|
+
}
|
|
200
|
+
export interface PolymarketClobPricesHistoryMethod {
|
|
201
|
+
(params: PolymarketClobPriceHistoryQuery, signal?: AbortSignal): Promise<PolymarketClobPriceHistoryResponse>;
|
|
202
|
+
}
|
|
203
|
+
export interface PolymarketClobMarketsMethod {
|
|
204
|
+
(signal?: AbortSignal): Promise<PolymarketClobMarketListResponse>;
|
|
205
|
+
(params: PolymarketClobPaginationQuery, signal?: AbortSignal): Promise<PolymarketClobMarketListResponse>;
|
|
206
|
+
(conditionId: string, signal?: AbortSignal): Promise<PolymarketClobMarket>;
|
|
207
|
+
}
|
|
208
|
+
export interface PolymarketClobSamplingMarketsMethod {
|
|
209
|
+
(params?: PolymarketClobPaginationQuery, signal?: AbortSignal): Promise<PolymarketClobMarketListResponse>;
|
|
210
|
+
}
|
|
211
|
+
export interface PolymarketClobSimplifiedMarketsMethod {
|
|
212
|
+
(params?: PolymarketClobPaginationQuery, signal?: AbortSignal): Promise<PolymarketClobSimplifiedMarketListResponse>;
|
|
213
|
+
}
|
|
214
|
+
export interface PolymarketClobSamplingSimplifiedMarketsMethod {
|
|
215
|
+
(params?: PolymarketClobPaginationQuery, signal?: AbortSignal): Promise<PolymarketClobSimplifiedMarketListResponse>;
|
|
216
|
+
}
|
|
217
|
+
export interface PolymarketClobMarketsByTokenMethod {
|
|
218
|
+
(tokenId: string, signal?: AbortSignal): Promise<PolymarketClobMarketsByTokenResponse>;
|
|
219
|
+
}
|
|
220
|
+
export interface PolymarketClobMarketsCompactMethod {
|
|
221
|
+
(conditionId: string, signal?: AbortSignal): Promise<PolymarketClobMarketCompact>;
|
|
222
|
+
}
|
|
223
|
+
export interface PolymarketClobGetNamespace {
|
|
224
|
+
time: PolymarketClobTimeMethod;
|
|
225
|
+
book: PolymarketClobBookMethod;
|
|
226
|
+
price: PolymarketClobPriceMethod;
|
|
227
|
+
midpoint: PolymarketClobMidpointMethod;
|
|
228
|
+
spread: PolymarketClobSpreadMethod;
|
|
229
|
+
lastTradePrice: PolymarketClobLastTradePriceMethod;
|
|
230
|
+
tickSize: PolymarketClobTickSizeMethod;
|
|
231
|
+
feeRate: PolymarketClobFeeRateMethod;
|
|
232
|
+
pricesHistory: PolymarketClobPricesHistoryMethod;
|
|
233
|
+
markets: PolymarketClobMarketsMethod;
|
|
234
|
+
samplingMarkets: PolymarketClobSamplingMarketsMethod;
|
|
235
|
+
simplifiedMarkets: PolymarketClobSimplifiedMarketsMethod;
|
|
236
|
+
samplingSimplifiedMarkets: PolymarketClobSamplingSimplifiedMarketsMethod;
|
|
237
|
+
marketsByToken: PolymarketClobMarketsByTokenMethod;
|
|
238
|
+
clobMarkets: PolymarketClobMarketsCompactMethod;
|
|
239
|
+
}
|
|
240
|
+
export interface PolymarketClobBooksBatchMethod {
|
|
241
|
+
(req: PolymarketClobTokenBatchRequest, signal?: AbortSignal): Promise<PolymarketClobBooksBatchResponse>;
|
|
242
|
+
schema: z.ZodType<PolymarketClobTokenBatchRequest>;
|
|
243
|
+
}
|
|
244
|
+
export interface PolymarketClobPricesBatchMethod {
|
|
245
|
+
(req: PolymarketClobPricesBatchRequest, signal?: AbortSignal): Promise<PolymarketClobPricesBatchResponse>;
|
|
246
|
+
schema: z.ZodType<PolymarketClobPricesBatchRequest>;
|
|
247
|
+
}
|
|
248
|
+
export interface PolymarketClobMidpointsBatchMethod {
|
|
249
|
+
(req: PolymarketClobTokenBatchRequest, signal?: AbortSignal): Promise<PolymarketClobMidpointsBatchResponse>;
|
|
250
|
+
schema: z.ZodType<PolymarketClobTokenBatchRequest>;
|
|
251
|
+
}
|
|
252
|
+
export interface PolymarketClobSpreadsBatchMethod {
|
|
253
|
+
(req: PolymarketClobTokenBatchRequest, signal?: AbortSignal): Promise<PolymarketClobSpreadsBatchResponse>;
|
|
254
|
+
schema: z.ZodType<PolymarketClobTokenBatchRequest>;
|
|
255
|
+
}
|
|
256
|
+
export interface PolymarketClobLastTradesPricesBatchMethod {
|
|
257
|
+
(req: PolymarketClobTokenBatchRequest, signal?: AbortSignal): Promise<PolymarketClobLastTradesPricesBatchResponse>;
|
|
258
|
+
schema: z.ZodType<PolymarketClobTokenBatchRequest>;
|
|
259
|
+
}
|
|
260
|
+
export interface PolymarketClobBatchPricesHistoryMethod {
|
|
261
|
+
(req: PolymarketClobBatchPricesHistoryRequest, signal?: AbortSignal): Promise<PolymarketClobBatchPricesHistoryResponse>;
|
|
262
|
+
schema: z.ZodType<PolymarketClobBatchPricesHistoryRequest>;
|
|
263
|
+
}
|
|
264
|
+
export interface PolymarketClobPostNamespace {
|
|
265
|
+
books: PolymarketClobBooksBatchMethod;
|
|
266
|
+
prices: PolymarketClobPricesBatchMethod;
|
|
267
|
+
midpoints: PolymarketClobMidpointsBatchMethod;
|
|
268
|
+
spreads: PolymarketClobSpreadsBatchMethod;
|
|
269
|
+
lastTradesPrices: PolymarketClobLastTradesPricesBatchMethod;
|
|
270
|
+
batchPricesHistory: PolymarketClobBatchPricesHistoryMethod;
|
|
271
|
+
}
|
|
272
|
+
export interface PolymarketPostNamespace {
|
|
273
|
+
clob: PolymarketClobPostNamespace;
|
|
274
|
+
}
|
|
275
|
+
export interface PolymarketGammaMarket {
|
|
276
|
+
id: string;
|
|
277
|
+
conditionId?: string;
|
|
278
|
+
questionID?: string;
|
|
279
|
+
question: string;
|
|
280
|
+
description: string;
|
|
281
|
+
slug: string;
|
|
282
|
+
endDate?: string;
|
|
283
|
+
startDate?: string;
|
|
284
|
+
outcomes?: string;
|
|
285
|
+
outcomePrices?: string;
|
|
286
|
+
volume?: string;
|
|
287
|
+
liquidity?: string;
|
|
288
|
+
active?: boolean;
|
|
289
|
+
closed?: boolean;
|
|
290
|
+
archived?: boolean;
|
|
291
|
+
acceptingOrders?: boolean;
|
|
292
|
+
enableOrderBook?: boolean;
|
|
293
|
+
negRisk?: boolean;
|
|
294
|
+
clobTokenIds?: string;
|
|
295
|
+
[key: string]: unknown;
|
|
296
|
+
}
|
|
297
|
+
export interface PolymarketGammaEvent {
|
|
298
|
+
id: string;
|
|
299
|
+
ticker?: string;
|
|
300
|
+
slug: string;
|
|
301
|
+
title: string;
|
|
302
|
+
description: string;
|
|
303
|
+
startDate?: string;
|
|
304
|
+
creationDate?: string;
|
|
305
|
+
endDate?: string;
|
|
306
|
+
image?: string;
|
|
307
|
+
icon?: string;
|
|
308
|
+
active?: boolean;
|
|
309
|
+
closed?: boolean;
|
|
310
|
+
archived?: boolean;
|
|
311
|
+
new?: boolean;
|
|
312
|
+
featured?: boolean;
|
|
313
|
+
restricted?: boolean;
|
|
314
|
+
liquidity?: number;
|
|
315
|
+
volume?: number;
|
|
316
|
+
openInterest?: number;
|
|
317
|
+
competitive?: number;
|
|
318
|
+
volume24hr?: number;
|
|
319
|
+
volume1wk?: number;
|
|
320
|
+
volume1mo?: number;
|
|
321
|
+
volume1yr?: number;
|
|
322
|
+
enableOrderBook?: boolean;
|
|
323
|
+
liquidityClob?: number;
|
|
324
|
+
negRisk?: boolean;
|
|
325
|
+
commentCount?: number;
|
|
326
|
+
markets: PolymarketGammaMarket[];
|
|
327
|
+
tags?: PolymarketGammaTag[];
|
|
328
|
+
[key: string]: unknown;
|
|
329
|
+
}
|
|
330
|
+
export interface PolymarketGammaTag {
|
|
331
|
+
id: string;
|
|
332
|
+
label: string;
|
|
333
|
+
slug: string;
|
|
334
|
+
forceShow?: boolean;
|
|
335
|
+
publishedAt?: string;
|
|
336
|
+
createdAt?: string;
|
|
337
|
+
updatedAt?: string;
|
|
338
|
+
isCarousel?: boolean;
|
|
339
|
+
requiresTranslation?: boolean;
|
|
340
|
+
[key: string]: unknown;
|
|
341
|
+
}
|
|
342
|
+
export interface PolymarketGammaSeries {
|
|
343
|
+
id: string;
|
|
344
|
+
ticker?: string;
|
|
345
|
+
slug: string;
|
|
346
|
+
title: string;
|
|
347
|
+
seriesType?: string;
|
|
348
|
+
recurrence?: string;
|
|
349
|
+
description?: string;
|
|
350
|
+
image?: string;
|
|
351
|
+
icon?: string;
|
|
352
|
+
layout?: string;
|
|
353
|
+
active?: boolean;
|
|
354
|
+
closed?: boolean;
|
|
355
|
+
archived?: boolean;
|
|
356
|
+
new?: boolean;
|
|
357
|
+
featured?: boolean;
|
|
358
|
+
restricted?: boolean;
|
|
359
|
+
commentsEnabled?: boolean;
|
|
360
|
+
publishedAt?: string;
|
|
361
|
+
createdBy?: string;
|
|
362
|
+
updatedBy?: string;
|
|
363
|
+
createdAt?: string;
|
|
364
|
+
updatedAt?: string;
|
|
365
|
+
events?: PolymarketGammaEvent[];
|
|
366
|
+
[key: string]: unknown;
|
|
367
|
+
}
|
|
368
|
+
export interface PolymarketGammaRelatedTag {
|
|
369
|
+
id: string;
|
|
370
|
+
tagID: number;
|
|
371
|
+
relatedTagID: number;
|
|
372
|
+
rank: number;
|
|
373
|
+
}
|
|
374
|
+
export interface PolymarketGammaCommentProfile {
|
|
375
|
+
name?: string;
|
|
376
|
+
pseudonym?: string;
|
|
377
|
+
displayUsernamePublic?: boolean;
|
|
378
|
+
bio?: string;
|
|
379
|
+
proxyWallet?: string;
|
|
380
|
+
baseAddress?: string;
|
|
381
|
+
profileImage?: string;
|
|
382
|
+
[key: string]: unknown;
|
|
383
|
+
}
|
|
384
|
+
export interface PolymarketGammaComment {
|
|
385
|
+
id: string;
|
|
386
|
+
body: string;
|
|
387
|
+
parentEntityType: "Event" | "Market" | string;
|
|
388
|
+
parentEntityID: number;
|
|
389
|
+
userAddress: string;
|
|
390
|
+
createdAt: string;
|
|
391
|
+
updatedAt?: string;
|
|
392
|
+
profile?: PolymarketGammaCommentProfile;
|
|
393
|
+
[key: string]: unknown;
|
|
394
|
+
}
|
|
395
|
+
export interface PolymarketGammaCommentListQuery {
|
|
396
|
+
parent_entity_type: "Event" | "Market";
|
|
397
|
+
parent_entity_id: number | string;
|
|
398
|
+
limit?: number;
|
|
399
|
+
offset?: number;
|
|
400
|
+
order?: string;
|
|
401
|
+
ascending?: boolean;
|
|
402
|
+
}
|
|
403
|
+
export interface PolymarketGammaCommentByUserQuery {
|
|
404
|
+
limit?: number;
|
|
405
|
+
offset?: number;
|
|
406
|
+
}
|
|
407
|
+
export interface PolymarketGammaSearchProfile {
|
|
408
|
+
proxyWallet?: string;
|
|
409
|
+
name?: string;
|
|
410
|
+
pseudonym?: string;
|
|
411
|
+
bio?: string;
|
|
412
|
+
profileImage?: string;
|
|
413
|
+
baseAddress?: string;
|
|
414
|
+
[key: string]: unknown;
|
|
415
|
+
}
|
|
416
|
+
export interface PolymarketGammaSearchPagination {
|
|
417
|
+
hasMore: boolean;
|
|
418
|
+
totalResults: number;
|
|
419
|
+
[key: string]: unknown;
|
|
420
|
+
}
|
|
421
|
+
export interface PolymarketGammaSearchResponse {
|
|
422
|
+
events: PolymarketGammaEvent[];
|
|
423
|
+
markets?: PolymarketGammaMarket[];
|
|
424
|
+
profiles?: PolymarketGammaSearchProfile[];
|
|
425
|
+
pagination: PolymarketGammaSearchPagination;
|
|
426
|
+
}
|
|
427
|
+
export interface PolymarketGammaSearchQuery {
|
|
428
|
+
q: string;
|
|
429
|
+
limit_per_type?: number;
|
|
430
|
+
events_status?: string;
|
|
431
|
+
}
|
|
432
|
+
export interface PolymarketGammaSport {
|
|
433
|
+
id: number;
|
|
434
|
+
sport: string;
|
|
435
|
+
image?: string;
|
|
436
|
+
resolution?: string;
|
|
437
|
+
ordering?: string;
|
|
438
|
+
tags?: string;
|
|
439
|
+
[key: string]: unknown;
|
|
440
|
+
}
|
|
441
|
+
export interface PolymarketGammaSportsMarketTypesResponse {
|
|
442
|
+
marketTypes: string[];
|
|
443
|
+
}
|
|
444
|
+
export type PolymarketGammaEventListResponse = PolymarketGammaEvent[];
|
|
445
|
+
export interface PolymarketGammaEventKeysetResponse {
|
|
446
|
+
events: PolymarketGammaEvent[];
|
|
447
|
+
next_cursor: string;
|
|
448
|
+
}
|
|
449
|
+
export interface PolymarketGammaEventListQuery {
|
|
450
|
+
limit?: number;
|
|
451
|
+
offset?: number;
|
|
452
|
+
order?: string;
|
|
453
|
+
ascending?: boolean;
|
|
454
|
+
id?: number | number[];
|
|
455
|
+
slug?: string | string[];
|
|
456
|
+
archived?: boolean;
|
|
457
|
+
active?: boolean;
|
|
458
|
+
closed?: boolean;
|
|
459
|
+
liquidity_min?: number;
|
|
460
|
+
liquidity_max?: number;
|
|
461
|
+
volume_min?: number;
|
|
462
|
+
volume_max?: number;
|
|
463
|
+
start_date_min?: string;
|
|
464
|
+
start_date_max?: string;
|
|
465
|
+
end_date_min?: string;
|
|
466
|
+
end_date_max?: string;
|
|
467
|
+
tag?: string;
|
|
468
|
+
tag_id?: number;
|
|
469
|
+
related_tags?: boolean;
|
|
470
|
+
tag_slug?: string;
|
|
471
|
+
featured?: boolean;
|
|
472
|
+
restricted?: boolean;
|
|
473
|
+
cyom?: boolean;
|
|
474
|
+
recurrence?: string;
|
|
475
|
+
}
|
|
476
|
+
export interface PolymarketGammaKeysetQuery extends PolymarketGammaEventListQuery {
|
|
477
|
+
next_cursor?: string;
|
|
478
|
+
}
|
|
479
|
+
export interface PolymarketGammaMarketListQuery extends PolymarketGammaEventListQuery {
|
|
480
|
+
clob_token_ids?: string | string[];
|
|
481
|
+
}
|
|
482
|
+
export interface PolymarketGammaMarketKeysetQuery extends PolymarketGammaMarketListQuery {
|
|
483
|
+
next_cursor?: string;
|
|
484
|
+
}
|
|
485
|
+
export type PolymarketGammaMarketListResponse = PolymarketGammaMarket[];
|
|
486
|
+
export interface PolymarketGammaMarketKeysetResponse {
|
|
487
|
+
markets: PolymarketGammaMarket[];
|
|
488
|
+
next_cursor: string;
|
|
489
|
+
}
|
|
490
|
+
export interface PolymarketGammaEventsMethod {
|
|
491
|
+
(signal?: AbortSignal): Promise<PolymarketGammaEventListResponse>;
|
|
492
|
+
(params: PolymarketGammaEventListQuery, signal?: AbortSignal): Promise<PolymarketGammaEventListResponse>;
|
|
493
|
+
(id: string, signal?: AbortSignal): Promise<PolymarketGammaEvent>;
|
|
494
|
+
keyset(params?: PolymarketGammaKeysetQuery, signal?: AbortSignal): Promise<PolymarketGammaEventKeysetResponse>;
|
|
495
|
+
slug(slug: string, signal?: AbortSignal): Promise<PolymarketGammaEvent>;
|
|
496
|
+
tags(id: string, signal?: AbortSignal): Promise<PolymarketGammaTag[]>;
|
|
497
|
+
}
|
|
498
|
+
export interface PolymarketGammaMarketsMethod {
|
|
499
|
+
(signal?: AbortSignal): Promise<PolymarketGammaMarketListResponse>;
|
|
500
|
+
(params: PolymarketGammaMarketListQuery, signal?: AbortSignal): Promise<PolymarketGammaMarketListResponse>;
|
|
501
|
+
(id: string, signal?: AbortSignal): Promise<PolymarketGammaMarket>;
|
|
502
|
+
keyset(params?: PolymarketGammaMarketKeysetQuery, signal?: AbortSignal): Promise<PolymarketGammaMarketKeysetResponse>;
|
|
503
|
+
slug(slug: string, signal?: AbortSignal): Promise<PolymarketGammaMarket>;
|
|
504
|
+
tags(id: string, signal?: AbortSignal): Promise<PolymarketGammaTag[]>;
|
|
505
|
+
}
|
|
506
|
+
export interface PolymarketGammaSeriesMethod {
|
|
507
|
+
(signal?: AbortSignal): Promise<PolymarketGammaSeries[]>;
|
|
508
|
+
(params: PolymarketGammaEventListQuery, signal?: AbortSignal): Promise<PolymarketGammaSeries[]>;
|
|
509
|
+
(id: string, signal?: AbortSignal): Promise<PolymarketGammaSeries>;
|
|
510
|
+
}
|
|
511
|
+
export interface PolymarketGammaTagsMethod {
|
|
512
|
+
(signal?: AbortSignal): Promise<PolymarketGammaTag[]>;
|
|
513
|
+
(params: PolymarketGammaEventListQuery, signal?: AbortSignal): Promise<PolymarketGammaTag[]>;
|
|
514
|
+
(id: string, signal?: AbortSignal): Promise<PolymarketGammaTag>;
|
|
515
|
+
slug(slug: string, signal?: AbortSignal): Promise<PolymarketGammaTag>;
|
|
516
|
+
relatedTags: PolymarketGammaTagsRelatedMethod;
|
|
517
|
+
}
|
|
518
|
+
export interface PolymarketGammaTagsRelatedMethod {
|
|
519
|
+
(id: string, signal?: AbortSignal): Promise<PolymarketGammaRelatedTag[]>;
|
|
520
|
+
slug(slug: string, signal?: AbortSignal): Promise<PolymarketGammaRelatedTag[]>;
|
|
521
|
+
}
|
|
522
|
+
export interface PolymarketGammaCommentsByUserMethod {
|
|
523
|
+
(address: string, params?: PolymarketGammaCommentByUserQuery, signal?: AbortSignal): Promise<PolymarketGammaComment[]>;
|
|
524
|
+
}
|
|
525
|
+
export interface PolymarketGammaCommentsMethod {
|
|
526
|
+
(params: PolymarketGammaCommentListQuery, signal?: AbortSignal): Promise<PolymarketGammaComment[]>;
|
|
527
|
+
(id: string, signal?: AbortSignal): Promise<PolymarketGammaComment[]>;
|
|
528
|
+
byUser: PolymarketGammaCommentsByUserMethod;
|
|
529
|
+
}
|
|
530
|
+
export interface PolymarketGammaSearchMethod {
|
|
531
|
+
(params: PolymarketGammaSearchQuery, signal?: AbortSignal): Promise<PolymarketGammaSearchResponse>;
|
|
532
|
+
}
|
|
533
|
+
export interface PolymarketGammaSportsMarketTypesMethod {
|
|
534
|
+
(signal?: AbortSignal): Promise<PolymarketGammaSportsMarketTypesResponse>;
|
|
535
|
+
}
|
|
536
|
+
export interface PolymarketGammaSportsMethod {
|
|
537
|
+
(signal?: AbortSignal): Promise<PolymarketGammaSport[]>;
|
|
538
|
+
marketTypes: PolymarketGammaSportsMarketTypesMethod;
|
|
539
|
+
}
|
|
540
|
+
export interface PolymarketGammaGetNamespace {
|
|
541
|
+
events: PolymarketGammaEventsMethod;
|
|
542
|
+
markets: PolymarketGammaMarketsMethod;
|
|
543
|
+
series: PolymarketGammaSeriesMethod;
|
|
544
|
+
tags: PolymarketGammaTagsMethod;
|
|
545
|
+
comments: PolymarketGammaCommentsMethod;
|
|
546
|
+
search: PolymarketGammaSearchMethod;
|
|
547
|
+
sports: PolymarketGammaSportsMethod;
|
|
548
|
+
}
|
|
549
|
+
export interface PolymarketDataPosition {
|
|
550
|
+
proxyWallet: string;
|
|
551
|
+
asset: string;
|
|
552
|
+
conditionId: string;
|
|
553
|
+
size: number;
|
|
554
|
+
avgPrice: number;
|
|
555
|
+
initialValue: number;
|
|
556
|
+
currentValue: number;
|
|
557
|
+
cashPnl: number;
|
|
558
|
+
percentPnl: number;
|
|
559
|
+
totalBought: number;
|
|
560
|
+
realizedPnl: number;
|
|
561
|
+
percentRealizedPnl: number;
|
|
562
|
+
curPrice: number;
|
|
563
|
+
redeemable: boolean;
|
|
564
|
+
mergeable?: boolean;
|
|
565
|
+
title?: string;
|
|
566
|
+
slug?: string;
|
|
567
|
+
icon?: string;
|
|
568
|
+
eventId?: string;
|
|
569
|
+
eventSlug?: string;
|
|
570
|
+
outcome?: string;
|
|
571
|
+
outcomeIndex?: number;
|
|
572
|
+
endDate?: string;
|
|
573
|
+
[key: string]: unknown;
|
|
574
|
+
}
|
|
575
|
+
export interface PolymarketDataPositionsQuery {
|
|
576
|
+
user: string;
|
|
577
|
+
market?: string | string[];
|
|
578
|
+
eventId?: string;
|
|
579
|
+
sizeThreshold?: number;
|
|
580
|
+
redeemable?: boolean;
|
|
581
|
+
mergeable?: boolean;
|
|
582
|
+
title?: string;
|
|
583
|
+
sortBy?: string;
|
|
584
|
+
sortDirection?: "ASC" | "DESC";
|
|
585
|
+
limit?: number;
|
|
586
|
+
offset?: number;
|
|
587
|
+
}
|
|
588
|
+
export interface PolymarketDataValueEntry {
|
|
589
|
+
user: string;
|
|
590
|
+
value: number;
|
|
591
|
+
}
|
|
592
|
+
export type PolymarketDataValueResponse = PolymarketDataValueEntry[];
|
|
593
|
+
export interface PolymarketDataValueQuery {
|
|
594
|
+
user: string;
|
|
595
|
+
}
|
|
596
|
+
export interface PolymarketDataPositionsMethod {
|
|
597
|
+
(params: PolymarketDataPositionsQuery, signal?: AbortSignal): Promise<PolymarketDataPosition[]>;
|
|
598
|
+
}
|
|
599
|
+
export interface PolymarketDataValueMethod {
|
|
600
|
+
(params: PolymarketDataValueQuery, signal?: AbortSignal): Promise<PolymarketDataValueResponse>;
|
|
601
|
+
}
|
|
602
|
+
export interface PolymarketDataHolderEntry {
|
|
603
|
+
proxyWallet: string;
|
|
604
|
+
asset: string;
|
|
605
|
+
amount: number;
|
|
606
|
+
outcomeIndex?: number;
|
|
607
|
+
bio?: string;
|
|
608
|
+
pseudonym?: string;
|
|
609
|
+
name?: string;
|
|
610
|
+
displayUsernamePublic?: boolean;
|
|
611
|
+
profileImage?: string;
|
|
612
|
+
profileImageOptimized?: string;
|
|
613
|
+
verified?: boolean;
|
|
614
|
+
[key: string]: unknown;
|
|
615
|
+
}
|
|
616
|
+
export interface PolymarketDataHoldersGroup {
|
|
617
|
+
token: string;
|
|
618
|
+
holders: PolymarketDataHolderEntry[];
|
|
619
|
+
}
|
|
620
|
+
export interface PolymarketDataHoldersQuery {
|
|
621
|
+
market: string | string[];
|
|
622
|
+
limit?: number;
|
|
623
|
+
}
|
|
624
|
+
export type PolymarketDataActivityType = "TRADE" | "REDEEM" | "MERGE" | "SPLIT" | "REWARD" | string;
|
|
625
|
+
export interface PolymarketDataActivityEntry {
|
|
626
|
+
proxyWallet: string;
|
|
627
|
+
timestamp: number;
|
|
628
|
+
conditionId: string;
|
|
629
|
+
type: PolymarketDataActivityType;
|
|
630
|
+
size: number;
|
|
631
|
+
usdcSize?: number;
|
|
632
|
+
transactionHash: string;
|
|
633
|
+
asset?: string;
|
|
634
|
+
price?: number;
|
|
635
|
+
side?: "BUY" | "SELL";
|
|
636
|
+
outcomeIndex?: number;
|
|
637
|
+
title?: string;
|
|
638
|
+
slug?: string;
|
|
639
|
+
[key: string]: unknown;
|
|
640
|
+
}
|
|
641
|
+
export interface PolymarketDataActivityQuery {
|
|
642
|
+
user: string;
|
|
643
|
+
limit?: number;
|
|
644
|
+
offset?: number;
|
|
645
|
+
market?: string | string[];
|
|
646
|
+
type?: PolymarketDataActivityType | PolymarketDataActivityType[];
|
|
647
|
+
start?: number;
|
|
648
|
+
end?: number;
|
|
649
|
+
side?: "BUY" | "SELL";
|
|
650
|
+
sortBy?: string;
|
|
651
|
+
sortDirection?: "ASC" | "DESC";
|
|
652
|
+
}
|
|
653
|
+
export interface PolymarketDataTradeEntry {
|
|
654
|
+
proxyWallet: string;
|
|
655
|
+
side: "BUY" | "SELL";
|
|
656
|
+
asset: string;
|
|
657
|
+
conditionId: string;
|
|
658
|
+
size: number;
|
|
659
|
+
price: number;
|
|
660
|
+
timestamp: number;
|
|
661
|
+
title?: string;
|
|
662
|
+
slug?: string;
|
|
663
|
+
icon?: string;
|
|
664
|
+
eventSlug?: string;
|
|
665
|
+
[key: string]: unknown;
|
|
666
|
+
}
|
|
667
|
+
export interface PolymarketDataTradesQuery {
|
|
668
|
+
user?: string;
|
|
669
|
+
market?: string | string[];
|
|
670
|
+
limit?: number;
|
|
671
|
+
offset?: number;
|
|
672
|
+
takerOnly?: boolean;
|
|
673
|
+
filterType?: string;
|
|
674
|
+
}
|
|
675
|
+
export interface PolymarketDataOpenInterestEntry {
|
|
676
|
+
market: string;
|
|
677
|
+
value: number;
|
|
678
|
+
}
|
|
679
|
+
export type PolymarketDataOpenInterestResponse = PolymarketDataOpenInterestEntry[];
|
|
680
|
+
export interface PolymarketDataOpenInterestQuery {
|
|
681
|
+
market?: string | string[];
|
|
682
|
+
}
|
|
683
|
+
export interface PolymarketDataLiveVolumeMarket {
|
|
684
|
+
market: string;
|
|
685
|
+
value: number;
|
|
686
|
+
}
|
|
687
|
+
export interface PolymarketDataLiveVolumeEntry {
|
|
688
|
+
total: number;
|
|
689
|
+
markets: PolymarketDataLiveVolumeMarket[];
|
|
690
|
+
}
|
|
691
|
+
export type PolymarketDataLiveVolumeResponse = PolymarketDataLiveVolumeEntry[];
|
|
692
|
+
export interface PolymarketDataLiveVolumeQuery {
|
|
693
|
+
id: string | number;
|
|
694
|
+
}
|
|
695
|
+
export interface PolymarketDataHoldersMethod {
|
|
696
|
+
(params: PolymarketDataHoldersQuery, signal?: AbortSignal): Promise<PolymarketDataHoldersGroup[]>;
|
|
697
|
+
}
|
|
698
|
+
export interface PolymarketDataActivityMethod {
|
|
699
|
+
(params: PolymarketDataActivityQuery, signal?: AbortSignal): Promise<PolymarketDataActivityEntry[]>;
|
|
700
|
+
}
|
|
701
|
+
export interface PolymarketDataTradesMethod {
|
|
702
|
+
(params: PolymarketDataTradesQuery, signal?: AbortSignal): Promise<PolymarketDataTradeEntry[]>;
|
|
703
|
+
}
|
|
704
|
+
export interface PolymarketDataOpenInterestMethod {
|
|
705
|
+
(params?: PolymarketDataOpenInterestQuery, signal?: AbortSignal): Promise<PolymarketDataOpenInterestResponse>;
|
|
706
|
+
}
|
|
707
|
+
export interface PolymarketDataLiveVolumeMethod {
|
|
708
|
+
(params: PolymarketDataLiveVolumeQuery, signal?: AbortSignal): Promise<PolymarketDataLiveVolumeResponse>;
|
|
709
|
+
}
|
|
710
|
+
export interface PolymarketDataGetNamespace {
|
|
711
|
+
positions: PolymarketDataPositionsMethod;
|
|
712
|
+
value: PolymarketDataValueMethod;
|
|
713
|
+
holders: PolymarketDataHoldersMethod;
|
|
714
|
+
activity: PolymarketDataActivityMethod;
|
|
715
|
+
trades: PolymarketDataTradesMethod;
|
|
716
|
+
oi: PolymarketDataOpenInterestMethod;
|
|
717
|
+
liveVolume: PolymarketDataLiveVolumeMethod;
|
|
718
|
+
}
|
|
719
|
+
export interface PolymarketGetNamespace {
|
|
720
|
+
clob: PolymarketClobGetNamespace;
|
|
721
|
+
gamma: PolymarketGammaGetNamespace;
|
|
722
|
+
data: PolymarketDataGetNamespace;
|
|
723
|
+
}
|
|
724
|
+
export interface PolymarketProvider {
|
|
725
|
+
get: PolymarketGetNamespace;
|
|
726
|
+
post: PolymarketPostNamespace;
|
|
727
|
+
}
|
|
728
|
+
//# sourceMappingURL=types.d.ts.map
|