@structbuild/sdk 0.3.0 → 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.
package/README.md CHANGED
@@ -7,8 +7,6 @@ TypeScript SDK for prediction market data via [api.struct.to](https://api.struct
7
7
  ```bash
8
8
  npm install @structbuild/sdk
9
9
  # or
10
- pnpm add @structbuild/sdk
11
- # or
12
10
  bun add @structbuild/sdk
13
11
  ```
14
12
 
@@ -73,11 +71,11 @@ const trades = await client.trader.getTraderTrades({ address: "0x..." });
73
71
  const profile = await client.trader.getTraderProfile({ address: "0x..." });
74
72
  const profiles = await client.trader.getTraderProfilesBatch({ addresses: "0x...,0x..." });
75
73
  const pnl = await client.trader.getTraderPnl({ address: "0x..." });
76
- const pnlByMarket = await client.trader.getTraderMarketPnl({ address: "0x..." });
77
- const pnlByEvent = await client.trader.getTraderEventPnl({ address: "0x..." });
74
+ const marketPnl = await client.trader.getTraderMarketPnl({ address: "0x..." });
75
+ const eventPnl = await client.trader.getTraderEventPnl({ address: "0x..." });
76
+ const outcomePnl = await client.trader.getTraderOutcomePnl({ address: "0x..." });
78
77
  const pnlCandles = await client.trader.getTraderPnlCandles({ address: "0x..." });
79
- const calendar = await client.trader.getTraderPnlCalendar({ address: "0x..." });
80
- const positionPnl = await client.trader.getTraderOutcomePnl({ address: "0x..." });
78
+ const pnlCalendar = await client.trader.getTraderPnlCalendar({ address: "0x..." });
81
79
  const volumeChart = await client.trader.getTraderVolumeChart({ address: "0x..." });
82
80
  const leaderboard = await client.trader.getGlobalPnl();
83
81
  ```
@@ -91,16 +89,20 @@ const history = await client.holders.getMarketHoldersHistory({ condition_id: "0x
91
89
  const posHistory = await client.holders.getPositionHoldersHistory({ positionId: "123" });
92
90
  ```
93
91
 
94
- ### Series
92
+ ### Order Book
95
93
 
96
94
  ```typescript
97
- const series = await client.series.getSeriesList();
98
- const outcomes = await client.series.getSeriesOutcomes({ series_slug: "my-series" });
95
+ const orderBook = await client.orderBook.getOrderBook({ asset_id: "0x..." });
96
+ const history = await client.orderBook.getOrderBookHistory();
97
+ const marketBook = await client.orderBook.getMarketOrderBook();
98
+ const spreads = await client.orderBook.getSpreadHistory();
99
99
  ```
100
100
 
101
- ### Assets, Search, Tags, Bonds
101
+ ### Series, Search, Tags, Assets, Bonds
102
102
 
103
103
  ```typescript
104
+ const series = await client.series.getSeriesList();
105
+ const outcomes = await client.series.getSeriesOutcomes({ series_slug: "my-series" });
104
106
  const assetHistory = await client.assets.getAssetHistory({ symbol: "BTC", variant: "1d" });
105
107
  const results = await client.search.search({ query: "election" });
106
108
  const tags = await client.tags.getTags();
@@ -147,7 +149,7 @@ Individual schemas are also exported: `OrderFilledTrade`, `RedemptionTrade`, `Me
147
149
 
148
150
  ### Webhooks
149
151
 
150
- Manage webhook subscriptions for real-time event notifications. Webhook endpoints are platform-level (not venue-scoped).
152
+ Manage webhook subscriptions for real-time event notifications:
151
153
 
152
154
  ```typescript
153
155
  const webhooks = await client.webhooks.list();
@@ -159,32 +161,129 @@ const webhook = await client.webhooks.create({
159
161
  min_usd_value: 100,
160
162
  },
161
163
  });
162
- const detail = await client.webhooks.getWebhook({ webhookId: webhook.data.id });
163
- await client.webhooks.update({ webhookId: webhook.data.id, events: ["first_trade"] });
164
164
  await client.webhooks.test({ webhookId: webhook.data.id });
165
165
  await client.webhooks.rotateSecret({ webhookId: webhook.data.id });
166
166
  await client.webhooks.deleteWebhook({ webhookId: webhook.data.id });
167
167
  const events = await client.webhooks.listEvents();
168
168
  ```
169
169
 
170
- #### Webhook Payload Types
170
+ ## WebSocket API
171
171
 
172
- The SDK exports typed payload schemas for building webhook receivers:
172
+ Real-time streaming via room-based subscriptions with fully typed filters, responses, and events.
173
173
 
174
174
  ```typescript
175
- import type {
176
- FirstTradePayload,
177
- ProbabilitySpikePayload,
178
- GlobalPnlPayload,
179
- VolumeMilestonePayload,
180
- } from "@structbuild/sdk";
181
-
182
- function handleWebhook(payload: FirstTradePayload) {
183
- console.log(payload.trader, payload.price, payload.side);
184
- }
175
+ import { StructWebSocket } from "@structbuild/sdk";
176
+
177
+ const ws = new StructWebSocket({ apiKey: "your-api-key" });
178
+ await ws.connect();
179
+ ```
180
+
181
+ ### Subscribing to rooms
182
+
183
+ Each room has typed filters and a typed subscribe response:
184
+
185
+ ```typescript
186
+ const res = await ws.subscribe("polymarket_trades", {
187
+ condition_ids: ["0xabc123"],
188
+ });
189
+
190
+ await ws.subscribe("polymarket_order_book", {
191
+ asset_ids: ["0xabc123"],
192
+ });
193
+
194
+ // Some rooms have optional filters
195
+ await ws.subscribe("polymarket_asset_prices");
196
+ await ws.subscribe("polymarket_clob_rewards", { subscribe_all: true });
197
+ ```
198
+
199
+ ### Listening for events
200
+
201
+ ```typescript
202
+ ws.on("trade_stream_update", (event) => {
203
+ event.condition_id;
204
+ event.price;
205
+ event.size;
206
+ event.side;
207
+ });
208
+
209
+ ws.on("order_book_update", (event) => {
210
+ event.asset_id;
211
+ event.bids;
212
+ event.asks;
213
+ });
214
+
215
+ ws.on("clob_rewards_update", (event) => {
216
+ event.event_type; // "added" | "removed" | "updated"
217
+ event.condition_id;
218
+ event.reward;
219
+ });
185
220
  ```
186
221
 
187
- Available payload types: `FirstTradePayload`, `GlobalPnlPayload`, `MarketPnlPayload`, `EventPnlPayload`, `ConditionMetricsPayload`, `EventMetricsPayload`, `PositionMetricsPayload`, `VolumeMilestonePayload`, `EventVolumeMilestonePayload`, `PositionVolumeMilestonePayload`, `ProbabilitySpikePayload`.
222
+ ### Alerts
223
+
224
+ Alerts use a separate client with per-event typed filters and payloads:
225
+
226
+ ```typescript
227
+ import { StructAlertsWebSocket } from "@structbuild/sdk";
228
+
229
+ const alerts = new StructAlertsWebSocket({ apiKey: "your-api-key" });
230
+ await alerts.connect();
231
+
232
+ await alerts.subscribe("trader_whale_trade", {
233
+ wallet_addresses: ["0xd91..."],
234
+ min_usd_value: 10000,
235
+ });
236
+
237
+ await alerts.subscribe("probability_spike", {
238
+ spike_direction: "up",
239
+ min_probability_change_pct: 5,
240
+ });
241
+
242
+ alerts.on("trader_whale_trade", (payload) => {
243
+ payload.data.trader;
244
+ payload.data.amount_usd;
245
+ });
246
+
247
+ alerts.on("probability_spike", (payload) => {
248
+ payload.data.spike_direction;
249
+ payload.data.spike_pct;
250
+ });
251
+ ```
252
+
253
+ ### Available rooms
254
+
255
+ | Room | Filters | Event |
256
+ |------|---------|-------|
257
+ | `polymarket_trades` | `condition_ids` | `trade_stream_update` |
258
+ | `polymarket_asset_prices` | `condition_ids?` | `asset_price_tick`, `asset_price_window_update` |
259
+ | `polymarket_asset_window_updates` | `condition_ids` | `asset_window_update` |
260
+ | `polymarket_market_metrics` | `condition_ids` | `market_metrics_update` |
261
+ | `polymarket_event_metrics` | `event_slugs` | `event_metrics_update` |
262
+ | `polymarket_position_metrics` | `position_ids` | `position_metrics_update` |
263
+ | `polymarket_trader_pnl` | `addresses` | `trader_global_pnl_update`, `trader_market_pnl_update`, `trader_event_pnl_update` |
264
+ | `polymarket_trader_positions` | `addresses` | `trader_position_update` |
265
+ | `polymarket_accounts` | `wallets` | `accounts_update`, `usdce_update`, `matic_update` |
266
+ | `polymarket_order_book` | `asset_ids` | `order_book_update` |
267
+ | `polymarket_clob_rewards` | `condition_ids?`, `subscribe_all?` | `clob_rewards_update` |
268
+
269
+ ### Lifecycle events
270
+
271
+ ```typescript
272
+ ws.on("connected", () => {});
273
+ ws.on("disconnected", ({ code, reason }) => {});
274
+ ws.on("reconnecting", ({ attempt }) => {});
275
+ ws.on("reconnect_failed", (err) => {});
276
+ ws.on("auth_failed", (err) => {});
277
+ ws.on("warning", (warning) => {});
278
+ ws.on("error", (err) => {});
279
+ ```
280
+
281
+ ### Cleanup
282
+
283
+ ```typescript
284
+ ws.unsubscribe("polymarket_trades");
285
+ ws.disconnect();
286
+ ```
188
287
 
189
288
  ## JWT Auth
190
289
 
@@ -208,6 +307,15 @@ const ws = new StructWebSocket({
208
307
 
209
308
  The `pk_jwt_*` key is safe to hardcode in frontend bundles — it is useless without a valid JWT from your configured auth provider.
210
309
 
310
+ If your JWT can rotate while a socket stays alive, prefer `getJwt` so reconnects always rebuild the URL with a fresh token:
311
+
312
+ ```typescript
313
+ const ws = new StructWebSocket({
314
+ apiKey: "pk_jwt_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
315
+ getJwt: () => userAccessToken,
316
+ });
317
+ ```
318
+
211
319
  ## Pagination
212
320
 
213
321
  Use the `paginate` helper to iterate through all results:
@@ -632,7 +632,7 @@ export interface paths {
632
632
  };
633
633
  /**
634
634
  * Get tags
635
- * @description Retrieve all available event tags/categories. Uses cursor-based pagination for efficient traversal.
635
+ * @description Retrieve all available event tags/categories. Supports both cursor-based and offset-based pagination.
636
636
  */
637
637
  get: operations["get_tags"];
638
638
  put?: never;
@@ -892,13 +892,15 @@ export interface components {
892
892
  id: string;
893
893
  hash: string;
894
894
  /** Format: int64 */
895
- block: number;
895
+ block?: number | null;
896
896
  /** Format: int64 */
897
- confirmed_at: number;
897
+ confirmed_at?: number | null;
898
898
  /** Format: int64 */
899
- log_index: number;
899
+ received_at?: number | null;
900
900
  /** Format: int64 */
901
- block_index: number;
901
+ log_index?: number | null;
902
+ /** Format: int64 */
903
+ block_index?: number | null;
902
904
  trader: components["schemas"]["TraderInfo"];
903
905
  operator: string;
904
906
  approved: boolean;
@@ -913,13 +915,15 @@ export interface components {
913
915
  id: string;
914
916
  hash: string;
915
917
  /** Format: int64 */
916
- block: number;
918
+ block?: number | null;
919
+ /** Format: int64 */
920
+ confirmed_at?: number | null;
917
921
  /** Format: int64 */
918
- confirmed_at: number;
922
+ received_at?: number | null;
919
923
  /** Format: int64 */
920
- log_index: number;
924
+ log_index?: number | null;
921
925
  /** Format: int64 */
922
- block_index: number;
926
+ block_index?: number | null;
923
927
  oracle_contract: string;
924
928
  assertion_id: string;
925
929
  caller: string;
@@ -935,13 +939,15 @@ export interface components {
935
939
  id: string;
936
940
  hash: string;
937
941
  /** Format: int64 */
938
- block: number;
942
+ block?: number | null;
943
+ /** Format: int64 */
944
+ confirmed_at?: number | null;
939
945
  /** Format: int64 */
940
- confirmed_at: number;
946
+ received_at?: number | null;
941
947
  /** Format: int64 */
942
- log_index: number;
948
+ log_index?: number | null;
943
949
  /** Format: int64 */
944
- block_index: number;
950
+ block_index?: number | null;
945
951
  oracle_contract: string;
946
952
  assertion_id: string;
947
953
  domain_id: string;
@@ -967,13 +973,15 @@ export interface components {
967
973
  id: string;
968
974
  hash: string;
969
975
  /** Format: int64 */
970
- block: number;
976
+ block?: number | null;
971
977
  /** Format: int64 */
972
- confirmed_at: number;
978
+ confirmed_at?: number | null;
973
979
  /** Format: int64 */
974
- log_index: number;
980
+ received_at?: number | null;
975
981
  /** Format: int64 */
976
- block_index: number;
982
+ log_index?: number | null;
983
+ /** Format: int64 */
984
+ block_index?: number | null;
977
985
  oracle_contract: string;
978
986
  assertion_id: string;
979
987
  bond_recipient: string;
@@ -1052,14 +1060,16 @@ export interface components {
1052
1060
  id: string;
1053
1061
  hash: string;
1054
1062
  /** Format: int64 */
1055
- block: number;
1063
+ block?: number | null;
1064
+ /** Format: int64 */
1065
+ confirmed_at?: number | null;
1056
1066
  /** Format: int64 */
1057
- confirmed_at: number;
1067
+ received_at?: number | null;
1058
1068
  /** Format: int64 */
1059
- log_index: number;
1069
+ log_index?: number | null;
1060
1070
  /** Format: int64 */
1061
- block_index: number;
1062
- order_hash: string;
1071
+ block_index?: number | null;
1072
+ order_hash?: string | null;
1063
1073
  question?: string | null;
1064
1074
  image_url?: string | null;
1065
1075
  slug?: string | null;
@@ -1137,13 +1147,15 @@ export interface components {
1137
1147
  id: string;
1138
1148
  hash: string;
1139
1149
  /** Format: int64 */
1140
- block: number;
1150
+ block?: number | null;
1151
+ /** Format: int64 */
1152
+ confirmed_at?: number | null;
1141
1153
  /** Format: int64 */
1142
- confirmed_at: number;
1154
+ received_at?: number | null;
1143
1155
  /** Format: int64 */
1144
- log_index: number;
1156
+ log_index?: number | null;
1145
1157
  /** Format: int64 */
1146
- block_index: number;
1158
+ block_index?: number | null;
1147
1159
  oracle_contract: string;
1148
1160
  condition_id: string;
1149
1161
  oracle: string;
@@ -1471,13 +1483,15 @@ export interface components {
1471
1483
  id: string;
1472
1484
  hash: string;
1473
1485
  /** Format: int64 */
1474
- block: number;
1486
+ block?: number | null;
1475
1487
  /** Format: int64 */
1476
- confirmed_at: number;
1488
+ confirmed_at?: number | null;
1477
1489
  /** Format: int64 */
1478
- log_index: number;
1490
+ received_at?: number | null;
1479
1491
  /** Format: int64 */
1480
- block_index: number;
1492
+ log_index?: number | null;
1493
+ /** Format: int64 */
1494
+ block_index?: number | null;
1481
1495
  trader: components["schemas"]["TraderInfo"];
1482
1496
  condition_id?: string | null;
1483
1497
  question?: string | null;
@@ -1497,13 +1511,15 @@ export interface components {
1497
1511
  id: string;
1498
1512
  hash: string;
1499
1513
  /** Format: int64 */
1500
- block: number;
1514
+ block?: number | null;
1515
+ /** Format: int64 */
1516
+ confirmed_at?: number | null;
1501
1517
  /** Format: int64 */
1502
- confirmed_at: number;
1518
+ received_at?: number | null;
1503
1519
  /** Format: int64 */
1504
- log_index: number;
1520
+ log_index?: number | null;
1505
1521
  /** Format: int64 */
1506
- block_index: number;
1522
+ block_index?: number | null;
1507
1523
  oracle_contract: string;
1508
1524
  condition_id: string;
1509
1525
  proposed_outcome?: string | null;
@@ -1517,16 +1533,18 @@ export interface components {
1517
1533
  id: string;
1518
1534
  hash: string;
1519
1535
  /** Format: int64 */
1520
- block: number;
1536
+ block?: number | null;
1537
+ /** Format: int64 */
1538
+ confirmed_at?: number | null;
1521
1539
  /** Format: int64 */
1522
- confirmed_at: number;
1540
+ received_at?: number | null;
1523
1541
  /** Format: int64 */
1524
- log_index: number;
1542
+ log_index?: number | null;
1525
1543
  /** Format: int64 */
1526
- block_index: number;
1527
- order_hash: string;
1544
+ block_index?: number | null;
1545
+ order_hash?: string | null;
1528
1546
  trader: components["schemas"]["TraderInfo"];
1529
- taker: string;
1547
+ taker?: string | null;
1530
1548
  side: string;
1531
1549
  condition_id?: string | null;
1532
1550
  position_id: string;
@@ -1546,11 +1564,11 @@ export interface components {
1546
1564
  /** Format: double */
1547
1565
  probability?: number | null;
1548
1566
  /** Format: double */
1549
- fee: number;
1567
+ fee?: number | null;
1550
1568
  /** Format: double */
1551
- fee_shares: number;
1569
+ fee_shares?: number | null;
1552
1570
  /** Format: double */
1553
- fee_pct: number;
1571
+ fee_pct?: number | null;
1554
1572
  exchange: components["schemas"]["PolymarketExchange"];
1555
1573
  };
1556
1574
  OrderbookHistoryRow: {
@@ -1907,6 +1925,8 @@ export interface components {
1907
1925
  * @description Outcome index (0 = Yes, 1 = No for binary)
1908
1926
  */
1909
1927
  outcome_index: number;
1928
+ /** @description Outcome name (e.g. "Yes", "No") — enriched from market metadata */
1929
+ outcome?: string | null;
1910
1930
  /** @description Amount of shares created/burned/redeemed for this position */
1911
1931
  amount: string;
1912
1932
  };
@@ -2001,13 +2021,15 @@ export interface components {
2001
2021
  id: string;
2002
2022
  hash: string;
2003
2023
  /** Format: int64 */
2004
- block: number;
2024
+ block?: number | null;
2025
+ /** Format: int64 */
2026
+ confirmed_at?: number | null;
2005
2027
  /** Format: int64 */
2006
- confirmed_at: number;
2028
+ received_at?: number | null;
2007
2029
  /** Format: int64 */
2008
- log_index: number;
2030
+ log_index?: number | null;
2009
2031
  /** Format: int64 */
2010
- block_index: number;
2032
+ block_index?: number | null;
2011
2033
  trader: components["schemas"]["TraderInfo"];
2012
2034
  /** @description NegRisk umbrella market ID */
2013
2035
  market_id: string;
@@ -2058,13 +2080,15 @@ export interface components {
2058
2080
  id: string;
2059
2081
  hash: string;
2060
2082
  /** Format: int64 */
2061
- block: number;
2083
+ block?: number | null;
2084
+ /** Format: int64 */
2085
+ confirmed_at?: number | null;
2062
2086
  /** Format: int64 */
2063
- confirmed_at: number;
2087
+ received_at?: number | null;
2064
2088
  /** Format: int64 */
2065
- log_index: number;
2089
+ log_index?: number | null;
2066
2090
  /** Format: int64 */
2067
- block_index: number;
2091
+ block_index?: number | null;
2068
2092
  oracle_contract: string;
2069
2093
  condition_id: string;
2070
2094
  proposed_outcome?: string | null;
@@ -2078,13 +2102,15 @@ export interface components {
2078
2102
  id: string;
2079
2103
  hash: string;
2080
2104
  /** Format: int64 */
2081
- block: number;
2105
+ block?: number | null;
2082
2106
  /** Format: int64 */
2083
- confirmed_at: number;
2107
+ confirmed_at?: number | null;
2084
2108
  /** Format: int64 */
2085
- log_index: number;
2109
+ received_at?: number | null;
2086
2110
  /** Format: int64 */
2087
- block_index: number;
2111
+ log_index?: number | null;
2112
+ /** Format: int64 */
2113
+ block_index?: number | null;
2088
2114
  oracle_contract: string;
2089
2115
  condition_id: string;
2090
2116
  question?: string | null;
@@ -2097,13 +2123,15 @@ export interface components {
2097
2123
  id: string;
2098
2124
  hash: string;
2099
2125
  /** Format: int64 */
2100
- block: number;
2126
+ block?: number | null;
2127
+ /** Format: int64 */
2128
+ confirmed_at?: number | null;
2101
2129
  /** Format: int64 */
2102
- confirmed_at: number;
2130
+ received_at?: number | null;
2103
2131
  /** Format: int64 */
2104
- log_index: number;
2132
+ log_index?: number | null;
2105
2133
  /** Format: int64 */
2106
- block_index: number;
2134
+ block_index?: number | null;
2107
2135
  oracle_contract: string;
2108
2136
  condition_id: string;
2109
2137
  creator: string;
@@ -2120,13 +2148,15 @@ export interface components {
2120
2148
  id: string;
2121
2149
  hash: string;
2122
2150
  /** Format: int64 */
2123
- block: number;
2151
+ block?: number | null;
2152
+ /** Format: int64 */
2153
+ confirmed_at?: number | null;
2124
2154
  /** Format: int64 */
2125
- confirmed_at: number;
2155
+ received_at?: number | null;
2126
2156
  /** Format: int64 */
2127
- log_index: number;
2157
+ log_index?: number | null;
2128
2158
  /** Format: int64 */
2129
- block_index: number;
2159
+ block_index?: number | null;
2130
2160
  oracle_contract: string;
2131
2161
  condition_id: string;
2132
2162
  question?: string | null;
@@ -2139,13 +2169,15 @@ export interface components {
2139
2169
  id: string;
2140
2170
  hash: string;
2141
2171
  /** Format: int64 */
2142
- block: number;
2172
+ block?: number | null;
2143
2173
  /** Format: int64 */
2144
- confirmed_at: number;
2174
+ confirmed_at?: number | null;
2145
2175
  /** Format: int64 */
2146
- log_index: number;
2176
+ received_at?: number | null;
2147
2177
  /** Format: int64 */
2148
- block_index: number;
2178
+ log_index?: number | null;
2179
+ /** Format: int64 */
2180
+ block_index?: number | null;
2149
2181
  oracle_contract: string;
2150
2182
  condition_id: string;
2151
2183
  question?: string | null;
@@ -2158,13 +2190,15 @@ export interface components {
2158
2190
  id: string;
2159
2191
  hash: string;
2160
2192
  /** Format: int64 */
2161
- block: number;
2193
+ block?: number | null;
2194
+ /** Format: int64 */
2195
+ confirmed_at?: number | null;
2162
2196
  /** Format: int64 */
2163
- confirmed_at: number;
2197
+ received_at?: number | null;
2164
2198
  /** Format: int64 */
2165
- log_index: number;
2199
+ log_index?: number | null;
2166
2200
  /** Format: int64 */
2167
- block_index: number;
2201
+ block_index?: number | null;
2168
2202
  oracle_contract: string;
2169
2203
  condition_id: string;
2170
2204
  /** Format: int64 */
@@ -2180,13 +2214,15 @@ export interface components {
2180
2214
  id: string;
2181
2215
  hash: string;
2182
2216
  /** Format: int64 */
2183
- block: number;
2217
+ block?: number | null;
2218
+ /** Format: int64 */
2219
+ confirmed_at?: number | null;
2184
2220
  /** Format: int64 */
2185
- confirmed_at: number;
2221
+ received_at?: number | null;
2186
2222
  /** Format: int64 */
2187
- log_index: number;
2223
+ log_index?: number | null;
2188
2224
  /** Format: int64 */
2189
- block_index: number;
2225
+ block_index?: number | null;
2190
2226
  oracle_contract: string;
2191
2227
  condition_id: string;
2192
2228
  question?: string | null;
@@ -2199,13 +2235,15 @@ export interface components {
2199
2235
  id: string;
2200
2236
  hash: string;
2201
2237
  /** Format: int64 */
2202
- block: number;
2238
+ block?: number | null;
2203
2239
  /** Format: int64 */
2204
- confirmed_at: number;
2240
+ confirmed_at?: number | null;
2205
2241
  /** Format: int64 */
2206
- log_index: number;
2242
+ received_at?: number | null;
2207
2243
  /** Format: int64 */
2208
- block_index: number;
2244
+ log_index?: number | null;
2245
+ /** Format: int64 */
2246
+ block_index?: number | null;
2209
2247
  oracle_contract: string;
2210
2248
  condition_id: string;
2211
2249
  question?: string | null;
@@ -2218,13 +2256,15 @@ export interface components {
2218
2256
  id: string;
2219
2257
  hash: string;
2220
2258
  /** Format: int64 */
2221
- block: number;
2259
+ block?: number | null;
2260
+ /** Format: int64 */
2261
+ confirmed_at?: number | null;
2222
2262
  /** Format: int64 */
2223
- confirmed_at: number;
2263
+ received_at?: number | null;
2224
2264
  /** Format: int64 */
2225
- log_index: number;
2265
+ log_index?: number | null;
2226
2266
  /** Format: int64 */
2227
- block_index: number;
2267
+ block_index?: number | null;
2228
2268
  trader: components["schemas"]["TraderInfo"];
2229
2269
  condition_id?: string | null;
2230
2270
  outcome?: string | null;
@@ -2247,13 +2287,15 @@ export interface components {
2247
2287
  id: string;
2248
2288
  hash: string;
2249
2289
  /** Format: int64 */
2250
- block: number;
2290
+ block?: number | null;
2291
+ /** Format: int64 */
2292
+ confirmed_at?: number | null;
2251
2293
  /** Format: int64 */
2252
- confirmed_at: number;
2294
+ received_at?: number | null;
2253
2295
  /** Format: int64 */
2254
- log_index: number;
2296
+ log_index?: number | null;
2255
2297
  /** Format: int64 */
2256
- block_index: number;
2298
+ block_index?: number | null;
2257
2299
  condition_id: string;
2258
2300
  token0: string;
2259
2301
  token1: string;
@@ -2310,13 +2352,15 @@ export interface components {
2310
2352
  id: string;
2311
2353
  hash: string;
2312
2354
  /** Format: int64 */
2313
- block: number;
2355
+ block?: number | null;
2314
2356
  /** Format: int64 */
2315
- confirmed_at: number;
2357
+ confirmed_at?: number | null;
2316
2358
  /** Format: int64 */
2317
- log_index: number;
2359
+ received_at?: number | null;
2318
2360
  /** Format: int64 */
2319
- block_index: number;
2361
+ log_index?: number | null;
2362
+ /** Format: int64 */
2363
+ block_index?: number | null;
2320
2364
  trader: components["schemas"]["TraderInfo"];
2321
2365
  condition_id?: string | null;
2322
2366
  question?: string | null;
@@ -4147,6 +4191,8 @@ export interface operations {
4147
4191
  query?: {
4148
4192
  /** @description Results limit (default: 10, max: 250) */
4149
4193
  limit?: number;
4194
+ /** @description Offset-based pagination (number of results to skip). Takes precedence over pagination_key. */
4195
+ offset?: number;
4150
4196
  /** @description Cursor-based pagination key */
4151
4197
  pagination_key?: string;
4152
4198
  };