@structbuild/sdk 0.2.11 → 0.3.1

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.
@@ -0,0 +1,921 @@
1
+ export type paths = Record<string, never>;
2
+ export type webhooks = Record<string, never>;
3
+ export interface components {
4
+ schemas: {
5
+ /** @description Server-pushed CLOB reward change event. Envelope type: "clob_rewards_update". */
6
+ ClobRewardsUpdateEvent: {
7
+ /**
8
+ * @description Type of change
9
+ * @enum {string}
10
+ */
11
+ event_type?: "added" | "removed" | "updated";
12
+ /** @description Affected market condition ID */
13
+ condition_id?: string;
14
+ /** @description Full reward state (null for 'removed' events) */
15
+ reward?: {
16
+ condition_id?: string;
17
+ rewards_config?: {
18
+ id?: number;
19
+ /** @description Reward token address (e.g. USDC) */
20
+ asset_address?: string;
21
+ /** Format: date */
22
+ start_date?: string;
23
+ /** Format: date */
24
+ end_date?: string;
25
+ /** @description Daily reward rate in USDC */
26
+ rate_per_day?: number;
27
+ /** @description Cumulative rewards distributed */
28
+ total_rewards?: number;
29
+ }[];
30
+ /** @description Max spread to qualify for rewards */
31
+ rewards_max_spread?: number | null;
32
+ /** @description Min order size to qualify for rewards */
33
+ rewards_min_size?: number | null;
34
+ /** @description Native (non-sponsored) daily rate */
35
+ native_daily_rate?: number | null;
36
+ /** @description Sponsored daily rate */
37
+ sponsored_daily_rate?: number | null;
38
+ /** @description Combined daily rate (native + sponsored) */
39
+ total_daily_rate?: number | null;
40
+ /** @description Number of sponsors */
41
+ sponsors_count?: number | null;
42
+ } | null;
43
+ /** @description Unix timestamp in milliseconds */
44
+ timestamp_ms?: number;
45
+ };
46
+ /** @description Server acknowledgement for a CLOB rewards subscription. Envelope type: "clob_rewards_stream_subscribe_response". */
47
+ ClobRewardsSubscribeResponse: {
48
+ /** @description Accepted condition IDs */
49
+ condition_ids?: string[];
50
+ /** @description Whether subscribed to all changes */
51
+ subscribe_all?: boolean;
52
+ /** @description Filter values that were rejected */
53
+ rejected?: string[];
54
+ };
55
+ /** @description Subscribe to CLOB reward changes. Either provide specific condition_ids or set subscribe_all to true. */
56
+ ClobRewardsSubscribeMessage: {
57
+ /** @enum {string} */
58
+ action: "subscribe" | "unsubscribe_all";
59
+ /** @description Condition IDs to watch for reward changes. */
60
+ condition_ids?: string[];
61
+ /** @description If true, receive ALL reward changes across all markets. Overrides condition_ids. */
62
+ subscribe_all?: boolean;
63
+ };
64
+ /** @description Server-pushed event: full CLOB orderbook snapshot for an outcome token. Envelope type: "order_book_update". Delivered whenever the book changes for a subscribed condition or position. */
65
+ OrderBookUpdateEvent: {
66
+ /** @description Hex token ID (position / outcome token) */
67
+ asset_id: string;
68
+ /** @description Condition ID (hex) */
69
+ market: string;
70
+ /** @description Bid levels sorted best-first (highest price first) */
71
+ bids: components["schemas"]["OrderBookLevel"][];
72
+ /** @description Ask levels sorted best-first (lowest price first) */
73
+ asks: components["schemas"]["OrderBookLevel"][];
74
+ /**
75
+ * Format: int64
76
+ * @description Unix milliseconds from CLOB message
77
+ */
78
+ timestamp: number;
79
+ /** @description Orderbook content hash — identical hash means no change */
80
+ hash: string;
81
+ /** @description Best bid price (0–1) */
82
+ best_bid?: number | null;
83
+ /** @description Best ask price (0–1) */
84
+ best_ask?: number | null;
85
+ /** @description (best_bid + best_ask) / 2 */
86
+ mid_price?: number | null;
87
+ /** @description best_ask − best_bid */
88
+ spread?: number | null;
89
+ /** @description Total USD value of all bid levels */
90
+ bid_liquidity_usd?: number | null;
91
+ /** @description Total USD value of all ask levels */
92
+ ask_liquidity_usd?: number | null;
93
+ /** @description Number of bid price levels */
94
+ bid_levels?: number | null;
95
+ /** @description Number of ask price levels */
96
+ ask_levels?: number | null;
97
+ };
98
+ /** @description A single price level: [price_string, size_string] */
99
+ OrderBookLevel: string[];
100
+ /** @description Subscribe to the trades stream. No filters = subscribe to all trades. */
101
+ TradesStreamSubscribeMessage: {
102
+ /** @enum {string} */
103
+ action: "subscribe" | "unsubscribe_all";
104
+ /** @description 64-char hex condition IDs (with or without 0x prefix) */
105
+ condition_ids?: string[];
106
+ /** @description Market slugs */
107
+ market_slugs?: string[];
108
+ /** @description Event slugs — subscribes to all markets under each event */
109
+ event_slugs?: string[];
110
+ /** @description ERC-1155 outcome token IDs (decimal or hex strings) */
111
+ position_ids?: string[];
112
+ /** @description Trader wallet addresses (lowercase 0x-prefixed) */
113
+ traders?: string[];
114
+ /** @description Only receive events of these types. Empty array = all types. */
115
+ trade_types?: ("OrderFilled" | "OrdersMatched" | "Redemption" | "Merge" | "Split" | "Cancelled" | "PositionsConverted" | "Initialization" | "Proposal" | "Dispute" | "Settled" | "Resolution" | "ConditionResolution" | "Reset" | "Flag" | "Unflag" | "Pause" | "Unpause" | "ManualResolution" | "NegRiskOutcomeReported" | "RegisterToken" | "Approval")[];
116
+ /**
117
+ * @description Trade status filter: "confirmed" (default) = on-chain only, "pending" = mempool only, "all" = both
118
+ * @enum {string}
119
+ */
120
+ status?: "confirmed" | "pending" | "all";
121
+ /** @description Explicitly subscribe to all trades. Also implicitly true when no filters are provided. */
122
+ subscribe_all?: boolean;
123
+ };
124
+ /** @description Server acknowledgement for a trades stream subscription */
125
+ TradesStreamSubscribeResponse: {
126
+ condition_ids?: string[];
127
+ market_slugs?: string[];
128
+ event_slugs?: string[];
129
+ position_ids?: string[];
130
+ traders?: string[];
131
+ trade_types?: string[];
132
+ /** @enum {string} */
133
+ status?: "confirmed" | "pending" | "all";
134
+ subscribe_all?: boolean;
135
+ /** @description Filter values that were rejected (invalid format or unknown type) */
136
+ rejected?: string[];
137
+ };
138
+ /**
139
+ * @description Server-pushed event. Discriminated by `trade_type` — each variant only includes relevant fields.
140
+ *
141
+ * Envelope: `{"type": "trade_stream_update", "room_id": "polymarket_trades", "status": "confirmed"|"pending", "data": {...}}`
142
+ *
143
+ * **Pending trades:** `block`, `confirmed_at`, `log_index`, `block_index` are absent. `received_at` (milliseconds) is included instead. For OrderFilled/OrdersMatched, `order_hash`, `taker`, `fee`, `fee_shares`, `fee_pct` are also absent.
144
+ */
145
+ TradeStreamEvent: {
146
+ /** @enum {string} */
147
+ trade_type: "OrderFilled" | "OrdersMatched";
148
+ id: string;
149
+ hash: string;
150
+ /** @description Absent for pending trades */
151
+ block?: number;
152
+ /** @description Unix seconds. Absent for pending trades */
153
+ confirmed_at?: number;
154
+ /** @description Unix milliseconds. Present for pending trades only */
155
+ received_at?: number;
156
+ /** @description Absent for pending trades */
157
+ log_index?: number;
158
+ /** @description Absent for pending trades */
159
+ block_index?: number;
160
+ /** @description Absent for pending trades */
161
+ order_hash?: string;
162
+ trader: {
163
+ address?: string;
164
+ name?: string | null;
165
+ pseudonym?: string | null;
166
+ profile_image?: string | null;
167
+ x_username?: string | null;
168
+ verified_badge?: boolean;
169
+ };
170
+ /** @description Absent for pending trades */
171
+ taker?: string;
172
+ /** @enum {string} */
173
+ side?: "Buy" | "Sell";
174
+ condition_id?: string | null;
175
+ position_id?: string;
176
+ outcome?: string | null;
177
+ outcome_index?: number | null;
178
+ question?: string | null;
179
+ image_url?: string | null;
180
+ slug?: string | null;
181
+ event_slug?: string | null;
182
+ usd_amount?: number;
183
+ shares_amount?: number;
184
+ price?: number;
185
+ probability?: number | null;
186
+ /** @description Absent for pending trades */
187
+ fee?: number;
188
+ /** @description Absent for pending trades */
189
+ fee_shares?: number;
190
+ /** @description Absent for pending trades */
191
+ fee_pct?: number;
192
+ exchange: number;
193
+ } | {
194
+ /** @enum {string} */
195
+ trade_type: "Redemption";
196
+ id: string;
197
+ hash: string;
198
+ block?: number;
199
+ confirmed_at?: number;
200
+ received_at?: number;
201
+ log_index?: number;
202
+ block_index?: number;
203
+ trader: {
204
+ address?: string;
205
+ name?: string | null;
206
+ pseudonym?: string | null;
207
+ profile_image?: string | null;
208
+ x_username?: string | null;
209
+ verified_badge?: boolean;
210
+ };
211
+ condition_id?: string | null;
212
+ outcome?: string | null;
213
+ outcome_index?: number | null;
214
+ question?: string | null;
215
+ image_url?: string | null;
216
+ slug?: string | null;
217
+ event_slug?: string | null;
218
+ usd_amount?: number;
219
+ winning_outcome_index?: number | null;
220
+ position_details?: {
221
+ position_id?: string;
222
+ outcome_index?: number;
223
+ amount?: string;
224
+ }[];
225
+ exchange: number;
226
+ } | {
227
+ /** @enum {string} */
228
+ trade_type: "Merge";
229
+ id: string;
230
+ hash: string;
231
+ block?: number;
232
+ confirmed_at?: number;
233
+ received_at?: number;
234
+ log_index?: number;
235
+ block_index?: number;
236
+ trader: {
237
+ address?: string;
238
+ name?: string | null;
239
+ pseudonym?: string | null;
240
+ profile_image?: string | null;
241
+ x_username?: string | null;
242
+ verified_badge?: boolean;
243
+ };
244
+ condition_id?: string | null;
245
+ question?: string | null;
246
+ image_url?: string | null;
247
+ slug?: string | null;
248
+ event_slug?: string | null;
249
+ usd_amount?: number;
250
+ position_details?: {
251
+ position_id?: string;
252
+ outcome_index?: number;
253
+ amount?: string;
254
+ }[];
255
+ exchange: number;
256
+ } | {
257
+ /** @enum {string} */
258
+ trade_type: "Split";
259
+ id: string;
260
+ hash: string;
261
+ block?: number;
262
+ confirmed_at?: number;
263
+ received_at?: number;
264
+ log_index?: number;
265
+ block_index?: number;
266
+ trader: {
267
+ address?: string;
268
+ name?: string | null;
269
+ pseudonym?: string | null;
270
+ profile_image?: string | null;
271
+ x_username?: string | null;
272
+ verified_badge?: boolean;
273
+ };
274
+ condition_id?: string | null;
275
+ question?: string | null;
276
+ image_url?: string | null;
277
+ slug?: string | null;
278
+ event_slug?: string | null;
279
+ usd_amount?: number;
280
+ position_details?: {
281
+ position_id?: string;
282
+ outcome_index?: number;
283
+ amount?: string;
284
+ }[];
285
+ exchange: number;
286
+ } | {
287
+ /** @enum {string} */
288
+ trade_type: "PositionsConverted";
289
+ id: string;
290
+ hash: string;
291
+ block?: number;
292
+ confirmed_at?: number;
293
+ received_at?: number;
294
+ log_index?: number;
295
+ block_index?: number;
296
+ trader: {
297
+ address?: string;
298
+ name?: string | null;
299
+ pseudonym?: string | null;
300
+ profile_image?: string | null;
301
+ x_username?: string | null;
302
+ verified_badge?: boolean;
303
+ };
304
+ market_id?: string;
305
+ index_set?: string;
306
+ shares_amount?: number;
307
+ exchange: number;
308
+ } | {
309
+ /** @enum {string} */
310
+ trade_type: "Cancelled";
311
+ id: string;
312
+ hash: string;
313
+ block?: number;
314
+ confirmed_at?: number;
315
+ received_at?: number;
316
+ log_index?: number;
317
+ block_index?: number;
318
+ order_hash?: string;
319
+ question?: string | null;
320
+ image_url?: string | null;
321
+ slug?: string | null;
322
+ event_slug?: string | null;
323
+ exchange: number;
324
+ } | {
325
+ /** @enum {string} */
326
+ trade_type: "Initialization" | "Proposal" | "Dispute" | "Settled" | "Resolution" | "ConditionResolution" | "Reset" | "Flag" | "Unflag" | "Pause" | "Unpause" | "ManualResolution" | "NegRiskOutcomeReported";
327
+ id: string;
328
+ hash: string;
329
+ block?: number;
330
+ confirmed_at?: number;
331
+ received_at?: number;
332
+ log_index?: number;
333
+ block_index?: number;
334
+ oracle_contract: string;
335
+ condition_id: string;
336
+ question?: string | null;
337
+ image_url?: string | null;
338
+ slug?: string | null;
339
+ event_slug?: string | null;
340
+ assertion_id?: string | null;
341
+ proposer?: string | null;
342
+ disputer?: string | null;
343
+ proposed_outcome?: string | null;
344
+ settled_price?: number | null;
345
+ disputed?: boolean | null;
346
+ settlement_resolution?: boolean | null;
347
+ bond?: string | null;
348
+ expiration_time?: number | null;
349
+ creator?: string | null;
350
+ reward_token?: string | null;
351
+ reward?: string | null;
352
+ proposal_bond?: string | null;
353
+ } | {
354
+ /** @enum {string} */
355
+ trade_type: "RegisterToken";
356
+ id: string;
357
+ hash: string;
358
+ block?: number;
359
+ confirmed_at?: number;
360
+ received_at?: number;
361
+ log_index?: number;
362
+ block_index?: number;
363
+ condition_id: string;
364
+ token0?: string;
365
+ token1?: string;
366
+ question?: string | null;
367
+ image_url?: string | null;
368
+ slug?: string | null;
369
+ event_slug?: string | null;
370
+ exchange: number;
371
+ } | {
372
+ /** @enum {string} */
373
+ trade_type: "Approval";
374
+ id: string;
375
+ hash: string;
376
+ block?: number;
377
+ confirmed_at?: number;
378
+ received_at?: number;
379
+ log_index?: number;
380
+ block_index?: number;
381
+ trader: {
382
+ address?: string;
383
+ name?: string | null;
384
+ pseudonym?: string | null;
385
+ profile_image?: string | null;
386
+ x_username?: string | null;
387
+ verified_badge?: boolean;
388
+ };
389
+ operator?: string;
390
+ approved?: boolean;
391
+ question?: string | null;
392
+ image_url?: string | null;
393
+ slug?: string | null;
394
+ event_slug?: string | null;
395
+ exchange: number;
396
+ };
397
+ /** @description Subscribe to the asset prices stream. Empty asset_symbols = all assets. */
398
+ AssetPricesSubscribeMessage: {
399
+ /** @enum {string} */
400
+ action: "subscribe" | "unsubscribe_all";
401
+ /** @description Uppercase asset symbols (e.g. "BTC", "ETH"). Empty = subscribe to all. */
402
+ asset_symbols?: string[];
403
+ };
404
+ /** @description Server acknowledgement for an asset prices subscription */
405
+ AssetPricesSubscribeResponse: {
406
+ /** @description Accepted symbols. Empty array means subscribed to all symbols. */
407
+ asset_symbols?: string[];
408
+ };
409
+ /** @description Server-pushed event: a crypto-asset price tick. Envelope type: "asset_price_tick". */
410
+ AssetPriceTickEvent: {
411
+ /** @description Always "asset_price_tick" */
412
+ event_type: string;
413
+ /** @description Uppercase asset symbol (e.g. "BTC") */
414
+ symbol: string;
415
+ /** @description Current price in USD */
416
+ price: number;
417
+ /**
418
+ * Format: int64
419
+ * @description Event timestamp in Unix milliseconds
420
+ */
421
+ timestamp_ms: number;
422
+ /**
423
+ * Format: int64
424
+ * @description Publish timestamp in Unix milliseconds
425
+ */
426
+ published_at: number;
427
+ };
428
+ /** @description Server-pushed event: candle open or close for a crypto asset. Envelope type: "asset_price_window_update". Delivered from both `polymarket_asset_prices` and `polymarket_asset_window_updates` rooms. */
429
+ AssetPriceWindowUpdateEvent: {
430
+ /** @description Always "asset_price_window_update" */
431
+ event_type: string;
432
+ /** @description Uppercase asset symbol (e.g. "BTC") */
433
+ symbol: string;
434
+ /** @description Candle size / timeframe (e.g. "5m", "1h", "1d") */
435
+ variant: string;
436
+ /**
437
+ * Format: int64
438
+ * @description Candle start in Unix milliseconds
439
+ */
440
+ start_time: number;
441
+ /**
442
+ * Format: int64
443
+ * @description Candle end in Unix milliseconds
444
+ */
445
+ end_time: number;
446
+ /** @description Candle open price in USD */
447
+ open_price: number;
448
+ /** @description Candle close price in USD */
449
+ close_price: number;
450
+ /** @description "open" = candle starting, "close" = candle finalised */
451
+ update_type: string;
452
+ /**
453
+ * Format: int64
454
+ * @description Publish timestamp in Unix milliseconds
455
+ */
456
+ published_at: number;
457
+ };
458
+ /** @description Subscribe to the asset window updates stream. At least one of asset_symbols or timeframes must be non-empty. */
459
+ AssetWindowUpdatesSubscribeMessage: {
460
+ /** @enum {string} */
461
+ action: "subscribe" | "unsubscribe_all";
462
+ /** @description Uppercase asset symbols (e.g. "BTC", "ETH") */
463
+ asset_symbols?: string[];
464
+ /** @description Candle sizes to filter by. "1d" and "24h" are treated as equivalent. */
465
+ timeframes?: ("5m" | "15m" | "1h" | "4h" | "1d" | "24h")[];
466
+ };
467
+ /** @description Server acknowledgement for an asset window updates subscription */
468
+ AssetWindowUpdatesSubscribeResponse: {
469
+ asset_symbols?: string[];
470
+ timeframes?: string[];
471
+ /** @description Set if the subscription was rejected (e.g. no filters provided) */
472
+ error?: string | null;
473
+ };
474
+ /** @description Server-pushed event from the polymarket_asset_window_updates room. Same payload as AssetPriceWindowUpdateEvent. Envelope type: "asset_price_window_update". */
475
+ AssetWindowUpdateEvent: components["schemas"]["AssetPriceWindowUpdateEvent"];
476
+ /** @description Subscribe to the market metrics stream. condition_ids is required and must be non-empty. */
477
+ MarketMetricsSubscribeMessage: {
478
+ /** @enum {string} */
479
+ action: "subscribe" | "unsubscribe_all";
480
+ /** @description 64-char hex condition IDs (with or without 0x prefix) */
481
+ condition_ids: string[];
482
+ };
483
+ /** @description Server acknowledgement for a market metrics subscription */
484
+ MarketMetricsSubscribeResponse: {
485
+ condition_ids?: string[];
486
+ /** @description Condition IDs that were rejected (invalid format) */
487
+ rejected?: string[];
488
+ /** @description Set if the entire subscription was rejected */
489
+ error?: string | null;
490
+ };
491
+ /** @description Server-pushed event: metrics update for one timeframe of a condition. Envelope type: "market_metrics_update". One event is emitted per timeframe window on each update. */
492
+ MarketMetricsEvent: {
493
+ /** @description 64-char hex condition ID */
494
+ condition_id: string;
495
+ /** @enum {string} */
496
+ timeframe: "1m" | "5m" | "30m" | "1h" | "6h" | "24h" | "7d" | "30d";
497
+ /**
498
+ * Format: int64
499
+ * @description Optional event timestamp (Unix seconds)
500
+ */
501
+ timestamp?: number | null;
502
+ /** @description USD volume in this timeframe window (decimal string) */
503
+ usd_volume: string;
504
+ /** @description Total fees in this window */
505
+ fees: number;
506
+ /**
507
+ * Format: int64
508
+ * @description Number of transactions
509
+ */
510
+ txns: number;
511
+ /** Format: int64 */
512
+ unique_traders: number;
513
+ };
514
+ /** @description Subscribe to the event metrics stream. event_slugs is required and must be non-empty. */
515
+ EventMetricsSubscribeMessage: {
516
+ /** @enum {string} */
517
+ action: "subscribe" | "unsubscribe_all";
518
+ /** @description Event slugs (lowercase) */
519
+ event_slugs: string[];
520
+ };
521
+ /** @description Server acknowledgement for an event metrics subscription */
522
+ EventMetricsSubscribeResponse: {
523
+ event_slugs?: string[];
524
+ rejected?: string[];
525
+ error?: string | null;
526
+ };
527
+ /** @description Server-pushed event: aggregated metrics update for one timeframe of an event. Envelope type: "event_metrics_update". One event is emitted per timeframe window on each update. */
528
+ EventMetricsEvent: {
529
+ event_slug: string;
530
+ /** @enum {string} */
531
+ timeframe: "1m" | "5m" | "30m" | "1h" | "6h" | "24h" | "7d" | "30d";
532
+ /**
533
+ * Format: int64
534
+ * @description Optional event timestamp (Unix seconds)
535
+ */
536
+ timestamp?: number | null;
537
+ /** @description USD volume in this timeframe window (decimal string) */
538
+ usd_volume: string;
539
+ fees: number;
540
+ /** Format: int64 */
541
+ txns: number;
542
+ /** Format: int64 */
543
+ unique_traders: number;
544
+ };
545
+ /** @description Subscribe to the position metrics stream. position_ids is required and must be non-empty. */
546
+ PositionMetricsSubscribeMessage: {
547
+ /** @enum {string} */
548
+ action: "subscribe" | "unsubscribe_all";
549
+ /** @description ERC-1155 outcome token IDs (decimal or hex strings) */
550
+ position_ids: string[];
551
+ };
552
+ /** @description Server acknowledgement for a position metrics subscription */
553
+ PositionMetricsSubscribeResponse: {
554
+ position_ids?: string[];
555
+ rejected?: string[];
556
+ error?: string | null;
557
+ };
558
+ /** @description Server-pushed event: metrics update for one timeframe of an outcome token. Envelope type: "position_metrics_update". One event is emitted per timeframe window on each update. */
559
+ PositionMetricsEvent: {
560
+ /** @description 64-char hex condition ID */
561
+ condition_id: string;
562
+ /** @description ERC-1155 token ID (decimal string) */
563
+ position_id: string;
564
+ /** @description Outcome name (e.g. "Yes") */
565
+ outcome?: string | null;
566
+ outcome_index?: number | null;
567
+ /** @enum {string} */
568
+ timeframe: "1m" | "5m" | "30m" | "1h" | "6h" | "24h" | "7d" | "30d";
569
+ /**
570
+ * Format: int64
571
+ * @description Optional event timestamp (Unix seconds)
572
+ */
573
+ timestamp?: number | null;
574
+ /** @description Total USD volume (decimal string) */
575
+ usd_volume: string;
576
+ /** @description USD buy volume (decimal string) */
577
+ usd_buy_volume: string;
578
+ /** @description USD sell volume (decimal string) */
579
+ usd_sell_volume: string;
580
+ fees: number;
581
+ /** Format: int64 */
582
+ txns: number;
583
+ /** Format: int64 */
584
+ buys: number;
585
+ /** Format: int64 */
586
+ sells: number;
587
+ /** Format: int64 */
588
+ unique_traders: number;
589
+ /** @description OHLC open price (0–1) */
590
+ price_open: number;
591
+ /** @description OHLC close price (0–1) */
592
+ price_close: number;
593
+ /** @description OHLC high price (0–1) */
594
+ price_high: number;
595
+ /** @description OHLC low price (0–1) */
596
+ price_low: number;
597
+ /** @description Implied probability at open (0–1) */
598
+ probability_open: number;
599
+ /** @description Implied probability at close (0–1) */
600
+ probability_close: number;
601
+ /** @description Highest implied probability in window (0–1) */
602
+ probability_high: number;
603
+ /** @description Lowest implied probability in window (0–1) */
604
+ probability_low: number;
605
+ /** Format: int64 */
606
+ historical_confirmed_at: number;
607
+ /** Format: int64 */
608
+ latest_confirmed_at: number;
609
+ /** Format: int64 */
610
+ latest_block: number;
611
+ };
612
+ /** @description Subscribe to the trader PnL stream. traders is required and must be non-empty. */
613
+ TraderPnlSubscribeMessage: {
614
+ /** @enum {string} */
615
+ action: "subscribe" | "unsubscribe_all";
616
+ /** @description EVM wallet addresses */
617
+ traders: string[];
618
+ };
619
+ /** @description Server acknowledgement for a trader PnL subscription */
620
+ TraderPnlSubscribeResponse: {
621
+ traders?: string[];
622
+ rejected?: string[];
623
+ error?: string | null;
624
+ };
625
+ /** @description Server-pushed event: global (portfolio-level) PnL update for a trader. Envelope type: "trader_global_pnl_update". */
626
+ TraderGlobalPnlEvent: {
627
+ /** @description Trader EVM wallet address */
628
+ trader: string;
629
+ /** @description Total realized PnL in USD (decimal string) */
630
+ realized_pnl_usd: string;
631
+ /** Format: int64 */
632
+ events_traded?: number | null;
633
+ /** Format: int64 */
634
+ markets_traded?: number | null;
635
+ /** Format: int64 */
636
+ total_buys?: number | null;
637
+ /** Format: int64 */
638
+ total_sells?: number | null;
639
+ /** Format: int64 */
640
+ total_redemptions?: number | null;
641
+ /** Format: int64 */
642
+ total_merges?: number | null;
643
+ /** @description Total USD volume (decimal string) */
644
+ total_volume_usd: string;
645
+ buy_volume_usd: string;
646
+ sell_volume_usd: string;
647
+ redemption_volume_usd: string;
648
+ merge_volume_usd: string;
649
+ /** Format: int64 */
650
+ markets_won?: number | null;
651
+ /** Format: int64 */
652
+ markets_lost?: number | null;
653
+ /** @description Win rate percentage (decimal string) */
654
+ market_win_rate_pct: string;
655
+ avg_pnl_per_market: string;
656
+ avg_pnl_per_trade: string;
657
+ avg_hold_time_seconds: string;
658
+ total_fees: string;
659
+ best_trade_pnl_usd: string;
660
+ best_trade_condition_id?: string | null;
661
+ worst_trade_pnl_usd: string;
662
+ worst_trade_condition_id?: string | null;
663
+ /**
664
+ * Format: int64
665
+ * @description Unix seconds
666
+ */
667
+ first_trade_at?: number | null;
668
+ /**
669
+ * Format: int64
670
+ * @description Unix seconds
671
+ */
672
+ last_trade_at?: number | null;
673
+ /** Format: int64 */
674
+ timestamp?: number | null;
675
+ /** @description "1d", "7d", "30d", or "lifetime" */
676
+ timeframe?: string | null;
677
+ };
678
+ /** @description Server-pushed event: per-market PnL update for a trader. Envelope type: "trader_market_pnl_update". */
679
+ TraderMarketPnlEvent: {
680
+ trader: string;
681
+ /** @description 64-char hex condition ID */
682
+ condition_id: string;
683
+ event_slug?: string | null;
684
+ /** Format: int64 */
685
+ outcomes_traded?: number | null;
686
+ /** Format: int64 */
687
+ total_buys?: number | null;
688
+ /** Format: int64 */
689
+ total_sells?: number | null;
690
+ /** Format: int64 */
691
+ total_redemptions?: number | null;
692
+ /** Format: int64 */
693
+ total_merges?: number | null;
694
+ /** @description Total buy volume in USD (decimal string) */
695
+ buy_usd: string;
696
+ sell_usd: string;
697
+ redemption_usd: string;
698
+ merge_usd: string;
699
+ /** @description Realized PnL in USD (decimal string) */
700
+ realized_pnl_usd: string;
701
+ /** Format: int64 */
702
+ winning_outcomes?: number | null;
703
+ total_fees: string;
704
+ /**
705
+ * Format: int64
706
+ * @description Unix seconds
707
+ */
708
+ first_trade_at?: number | null;
709
+ /**
710
+ * Format: int64
711
+ * @description Unix seconds
712
+ */
713
+ last_trade_at?: number | null;
714
+ /** Format: int64 */
715
+ timestamp?: number | null;
716
+ /** @description "1d", "7d", "30d", or "lifetime" */
717
+ timeframe?: string | null;
718
+ };
719
+ /** @description Server-pushed event: per-event PnL update for a trader. Envelope type: "trader_event_pnl_update". */
720
+ TraderEventPnlEvent: {
721
+ trader: string;
722
+ event_slug: string;
723
+ /** Format: int64 */
724
+ markets_traded?: number | null;
725
+ /** Format: int64 */
726
+ outcomes_traded?: number | null;
727
+ /** Format: int64 */
728
+ total_buys?: number | null;
729
+ /** Format: int64 */
730
+ total_sells?: number | null;
731
+ /** Format: int64 */
732
+ total_redemptions?: number | null;
733
+ /** Format: int64 */
734
+ total_merges?: number | null;
735
+ /** @description Total USD volume (decimal string) */
736
+ total_volume_usd: string;
737
+ buy_usd: string;
738
+ sell_usd: string;
739
+ redemption_usd: string;
740
+ merge_usd: string;
741
+ /** @description Realized PnL in USD (decimal string) */
742
+ realized_pnl_usd: string;
743
+ /** Format: int64 */
744
+ winning_markets?: number | null;
745
+ /** Format: int64 */
746
+ losing_markets?: number | null;
747
+ total_fees: string;
748
+ /**
749
+ * Format: int64
750
+ * @description Unix seconds
751
+ */
752
+ first_trade_at?: number | null;
753
+ /**
754
+ * Format: int64
755
+ * @description Unix seconds
756
+ */
757
+ last_trade_at?: number | null;
758
+ /** Format: int64 */
759
+ timestamp?: number | null;
760
+ /** @description "1d", "7d", "30d", or "lifetime" */
761
+ timeframe?: string | null;
762
+ };
763
+ /** @description Subscribe to the trader positions stream. traders is required and must be non-empty. */
764
+ TraderPositionsSubscribeMessage: {
765
+ /** @enum {string} */
766
+ action: "subscribe" | "unsubscribe_all";
767
+ /** @description EVM wallet addresses */
768
+ traders: string[];
769
+ };
770
+ /** @description Server acknowledgement for a trader positions subscription */
771
+ TraderPositionsSubscribeResponse: {
772
+ traders?: string[];
773
+ rejected?: string[];
774
+ error?: string | null;
775
+ };
776
+ /** @description Server-pushed event: full position snapshot for a tracked trader. Envelope type: "trader_position_update". Pushed whenever a position's PnL changes. */
777
+ TraderPositionUpdateEvent: {
778
+ /** @description Trader EVM wallet address */
779
+ trader: string;
780
+ /** @description ERC-1155 token ID (decimal string) */
781
+ position_id?: string | null;
782
+ condition_id?: string | null;
783
+ market_slug?: string | null;
784
+ event_slug?: string | null;
785
+ /** @description Market title / question */
786
+ title?: string | null;
787
+ image_url?: string | null;
788
+ /** @description Outcome name (e.g. "Yes") */
789
+ outcome?: string | null;
790
+ outcome_index?: number | null;
791
+ /** @description True if this outcome resolved as winner */
792
+ won?: boolean | null;
793
+ /** Format: int64 */
794
+ total_buys?: number | null;
795
+ /** Format: int64 */
796
+ total_sells?: number | null;
797
+ total_shares_bought?: number | null;
798
+ total_shares_sold?: number | null;
799
+ total_buy_usd?: number | null;
800
+ total_sell_usd?: number | null;
801
+ redemption_usd?: number | null;
802
+ /** @description Average entry price (0–1) */
803
+ avg_entry_price?: number | null;
804
+ /** @description Average exit price (0–1) */
805
+ avg_exit_price?: number | null;
806
+ realized_pnl_usd?: number | null;
807
+ total_fees?: number | null;
808
+ /**
809
+ * Format: int64
810
+ * @description Unix seconds
811
+ */
812
+ first_trade_at?: number | null;
813
+ /**
814
+ * Format: int64
815
+ * @description Unix seconds
816
+ */
817
+ last_trade_at?: number | null;
818
+ /** @description Current ERC-1155 token balance */
819
+ current_shares_balance?: number | null;
820
+ /** @description Realized PnL as a percentage of cost basis */
821
+ realized_pnl_pct?: number | null;
822
+ };
823
+ /** @description Subscribe to the accounts stream. `wallets` is required. Share balance updates (`accounts_update`) are always delivered. Set `include_usdce` or `include_matic` to also receive those balance streams. */
824
+ AccountsSubscribeMessage: {
825
+ /** @enum {string} */
826
+ action: "subscribe" | "unsubscribe_all";
827
+ /** @description EVM wallet addresses */
828
+ wallets: string[];
829
+ /** @description Also stream USDCe collateral balance updates for subscribed wallets */
830
+ include_usdce?: boolean;
831
+ /** @description Also stream MATIC gas balance updates for subscribed wallets */
832
+ include_matic?: boolean;
833
+ };
834
+ /** @description Server acknowledgement for an accounts subscription */
835
+ AccountsSubscribeResponse: {
836
+ wallets?: string[];
837
+ /** @description Addresses rejected (invalid format) */
838
+ rejected?: string[];
839
+ include_usdce?: boolean;
840
+ include_matic?: boolean;
841
+ error?: string | null;
842
+ };
843
+ /** @description Server-pushed event: ERC-1155 outcome token balance change for a wallet. Envelope type: "accounts_update". */
844
+ AccountsUpdateEvent: {
845
+ /** @description Wallet address */
846
+ wallet: string;
847
+ /** @description ERC-1155 outcome token ID (decimal string) */
848
+ position_id: string;
849
+ /** @description Current token balance (decimal string) */
850
+ balance: string;
851
+ /** Format: int64 */
852
+ block_number: number;
853
+ /**
854
+ * Format: int64
855
+ * @description Unix seconds
856
+ */
857
+ updated_at: number;
858
+ /** @description Condition ID — omitted when not available */
859
+ condition_id?: string;
860
+ /** @description Event slug — omitted when not available */
861
+ event_slug?: string;
862
+ };
863
+ /** @description Server-pushed event: USDCe collateral balance change for a wallet. Envelope type: "usdce_update". Only delivered when `include_usdce: true`. */
864
+ UsdceUpdateEvent: {
865
+ /** @description Wallet address (0x-prefixed hex) */
866
+ address: string;
867
+ /** @description USDCe contract address — omitted when not available */
868
+ token_address?: string;
869
+ /** @description Current USDCe balance (decimal string) — omitted when not available */
870
+ balance?: string;
871
+ /** Format: uint64 */
872
+ block_number: number;
873
+ /**
874
+ * Format: int64
875
+ * @description Unix seconds
876
+ */
877
+ updated_at: number;
878
+ };
879
+ /** @description Server-pushed event: MATIC native balance change for a wallet. Envelope type: "matic_update". Only delivered when `include_matic: true`. */
880
+ MaticUpdateEvent: {
881
+ /** @description Wallet address (0x-prefixed hex) */
882
+ address: string;
883
+ /** @description Native token address — omitted when not available */
884
+ token_address?: string;
885
+ /** @description Current MATIC balance (decimal string) — omitted when not available */
886
+ balance?: string;
887
+ /** Format: uint64 */
888
+ block_number: number;
889
+ /**
890
+ * Format: int64
891
+ * @description Unix seconds
892
+ */
893
+ updated_at: number;
894
+ };
895
+ /** @description Subscribe to the order book stream. At least one filter is required. Maximum 500 combined condition_ids + position_ids per client. No `type` field is needed — the server routes by room_id. */
896
+ OrderBookSubscribeMessage: {
897
+ /** @enum {string} */
898
+ action: "subscribe" | "unsubscribe_all";
899
+ /** @description Condition IDs (markets). All positions within each market are delivered. */
900
+ condition_ids?: string[];
901
+ /** @description Token / asset IDs (individual outcome positions, hex strings). */
902
+ position_ids?: string[];
903
+ };
904
+ /** @description Server acknowledgement for an order book subscription. Envelope type: "order_book_stream_subscribe_response". */
905
+ OrderBookSubscribeResponse: {
906
+ /** @description Accepted condition IDs */
907
+ condition_ids?: string[];
908
+ /** @description Accepted position IDs */
909
+ position_ids?: string[];
910
+ /** @description Filter values that were rejected (invalid format or limit exceeded) */
911
+ rejected?: string[];
912
+ };
913
+ };
914
+ responses: never;
915
+ parameters: never;
916
+ requestBodies: never;
917
+ headers: never;
918
+ pathItems: never;
919
+ }
920
+ export type $defs = Record<string, never>;
921
+ export type operations = Record<string, never>;