@structbuild/sdk 0.1.20 → 0.1.22

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.
@@ -152,7 +152,7 @@ export interface paths {
152
152
  };
153
153
  /**
154
154
  * Get market holders
155
- * @description Retrieve holders of a market grouped by outcome, sorted by shares held. Identify the market with either `condition_id` or `market_slug` — exactly one must be provided. Each holder includes a nested `pnl` object with position-level PnL sourced from the position PnL table.
155
+ * @description Retrieve holders of a market grouped by outcome, sorted by shares held. Identify the market with either `condition_id` or `market_slug` — exactly one must be provided. Each holder includes a nested `pnl` object with position-level PnL.
156
156
  */
157
157
  get: operations["get_market_holders"];
158
158
  put?: never;
@@ -192,7 +192,7 @@ export interface paths {
192
192
  };
193
193
  /**
194
194
  * Get position holders
195
- * @description Retrieve holders of a specific position (ERC1155 token), sorted by shares held. Each holder includes a nested `pnl` object with position-level PnL (realized_pnl_usd, buy_usd, sell_usd, avg_entry_price, avg_exit_price, total_buys, total_sells, total_fees, first/last_trade_at) sourced from the position PnL table — no extra joins required at query time. Uses cursor-based pagination for efficient traversal.
195
+ * @description Retrieve holders of a specific position (ERC1155 token), sorted by shares held. Each holder includes a nested `pnl` object with position-level PnL (realized_pnl_usd, buy_usd, sell_usd, avg_entry_price, avg_exit_price, total_buys, total_sells, total_fees, first/last_trade_at). Uses cursor-based pagination for efficient traversal.
196
196
  */
197
197
  get: operations["get_position_holders"];
198
198
  put?: never;
@@ -491,8 +491,14 @@ export interface paths {
491
491
  cookie?: never;
492
492
  };
493
493
  /**
494
- * Search events or traders
495
- * @description Search across events and traders by keyword
494
+ * Search events, markets, and traders
495
+ * @description Search across events, markets, and traders simultaneously.
496
+ *
497
+ * All three categories are queried in parallel. Each has independent cursor-based pagination via its own `*_pagination_key`.
498
+ *
499
+ * **Trader search** matches by wallet address (exact, `0x...` 42 chars) or by display name / pseudonym (case-insensitive partial match).
500
+ *
501
+ * **sort_by / timeframe** apply to events and markets. Some sort fields only apply to one category (e.g. `liquidity` and `holders` are markets-only; `title`, `creation_date`, `start_date`, `end_date` are events-only) — unrecognised fields fall back to `volume`.
496
502
  */
497
503
  get: operations["search"];
498
504
  put?: never;
@@ -1137,16 +1143,22 @@ export interface components {
1137
1143
  [key: string]: components["schemas"]["OutcomeTimeframeMetrics"];
1138
1144
  };
1139
1145
  };
1140
- /** @description Market outcome with price/volume data */
1146
+ /** @description Outcome for market API responses */
1141
1147
  MarketOutcome: {
1142
- /** Format: int32 */
1143
- index: number;
1148
+ /** @default */
1144
1149
  name: string;
1145
- position_id: string;
1146
- /** Format: double */
1147
- price?: number | null;
1148
- /** Format: double */
1149
- volume?: number | null;
1150
+ /**
1151
+ * Format: double
1152
+ * @default null
1153
+ */
1154
+ price: number | null;
1155
+ /** @default null */
1156
+ position_id: string | null;
1157
+ /**
1158
+ * Format: int32
1159
+ * @default null
1160
+ */
1161
+ outcome_index: number | null;
1150
1162
  };
1151
1163
  /** @enum {string} */
1152
1164
  MarketPnlSortBy: "realized_pnl_usd" | "buy_usd" | "total_buys" | "total_fees" | "outcomes_traded";
@@ -1343,6 +1355,13 @@ export interface components {
1343
1355
  */
1344
1356
  price_change_percent: number | null;
1345
1357
  };
1358
+ /** @description Pagination metadata to include in API responses */
1359
+ PaginationMeta: {
1360
+ /** @description Whether there are more results available */
1361
+ has_more: boolean;
1362
+ /** @description Pagination key for the next page (if has_more is true) */
1363
+ pagination_key?: string | null;
1364
+ };
1346
1365
  /** @description A single PnL candle entry */
1347
1366
  PnlCandleEntry: {
1348
1367
  /**
@@ -1691,8 +1710,17 @@ export interface components {
1691
1710
  };
1692
1711
  SearchResponse: {
1693
1712
  events: unknown;
1713
+ events_pagination: components["schemas"]["PaginationMeta"];
1714
+ markets: components["schemas"]["MarketResponse"][];
1715
+ markets_pagination: components["schemas"]["PaginationMeta"];
1694
1716
  traders: components["schemas"]["Trader"][];
1717
+ traders_pagination: components["schemas"]["PaginationMeta"];
1695
1718
  };
1719
+ /**
1720
+ * @description Combined sort options valid for both events and markets in search
1721
+ * @enum {string}
1722
+ */
1723
+ SearchSortBy: "volume" | "txns" | "unique_traders" | "relevance" | "title" | "creation_date" | "start_date" | "end_date" | "liquidity" | "holders" | "end_time" | "start_time" | "created_time";
1696
1724
  SimpleTimeframeMetrics: {
1697
1725
  /**
1698
1726
  * Format: double
@@ -2238,7 +2266,7 @@ export interface operations {
2238
2266
  };
2239
2267
  requestBody?: never;
2240
2268
  responses: {
2241
- /** @description Market holder count history with automatic view selection (1m/5m/15m/1h/6h buckets) */
2269
+ /** @description Market holder count history with automatic granularity (1m/5m/15m/1h/6h buckets) */
2242
2270
  200: {
2243
2271
  headers: {
2244
2272
  [name: string]: unknown;
@@ -2312,7 +2340,7 @@ export interface operations {
2312
2340
  };
2313
2341
  requestBody?: never;
2314
2342
  responses: {
2315
- /** @description Position holder count history with automatic view selection (1m/5m/15m/1h/6h buckets) */
2343
+ /** @description Position holder count history with automatic granularity (1m/5m/15m/1h/6h buckets) */
2316
2344
  200: {
2317
2345
  headers: {
2318
2346
  [name: string]: unknown;
@@ -2343,7 +2371,7 @@ export interface operations {
2343
2371
  market_slugs?: string;
2344
2372
  /** @description Filter by event slug(s) - comma-separated (max 50) */
2345
2373
  event_slugs?: string;
2346
- /** @description Filter by position ID(s) - comma-separated (max 50), resolved via market_outcomes table */
2374
+ /** @description Filter by position ID(s) - comma-separated (max 50) */
2347
2375
  position_ids?: string;
2348
2376
  /** @description Search in title (3-100 characters) */
2349
2377
  search?: string;
@@ -2857,12 +2885,22 @@ export interface operations {
2857
2885
  search: {
2858
2886
  parameters: {
2859
2887
  query: {
2860
- /** @description Search query (min 2 characters) */
2888
+ /** @description Search query (min 2 characters). Prefix with 0x for exact wallet address lookup. */
2861
2889
  q: string;
2862
- /** @description Results limit (default: 20) */
2890
+ /** @description Sort field applied to both events and markets (default: volume). Fields marked events-only or markets-only fall back to volume on the other category. */
2891
+ sort_by?: components["schemas"]["SearchSortBy"];
2892
+ /** @description Sort direction (default: desc) */
2893
+ sort_dir?: components["schemas"]["SortDirection"];
2894
+ /** @description Metrics timeframe used for volume/txns/unique_traders sort (default: 24h) */
2895
+ timeframe?: components["schemas"]["MetricsTimeframe"];
2896
+ /** @description Results limit per category (default: 10, max: 250) */
2863
2897
  limit?: number;
2864
- /** @description Offset-based pagination key (integer offset into result set) */
2865
- pagination_key?: string;
2898
+ /** @description Cursor for the next page of events, obtained from previous response's events_pagination.pagination_key */
2899
+ events_pagination_key?: string;
2900
+ /** @description Cursor for the next page of markets, obtained from previous response's markets_pagination.pagination_key */
2901
+ markets_pagination_key?: string;
2902
+ /** @description Cursor for the next page of traders, obtained from previous response's traders_pagination.pagination_key */
2903
+ traders_pagination_key?: string;
2866
2904
  };
2867
2905
  header?: never;
2868
2906
  path?: never;
@@ -2870,7 +2908,7 @@ export interface operations {
2870
2908
  };
2871
2909
  requestBody?: never;
2872
2910
  responses: {
2873
- /** @description Search results with events and traders */
2911
+ /** @description Search results with events, markets, and traders */
2874
2912
  200: {
2875
2913
  headers: {
2876
2914
  [name: string]: unknown;
@@ -2879,6 +2917,13 @@ export interface operations {
2879
2917
  "application/json": components["schemas"]["SearchResponse"];
2880
2918
  };
2881
2919
  };
2920
+ /** @description Bad request — q is missing or shorter than 2 characters */
2921
+ 400: {
2922
+ headers: {
2923
+ [name: string]: unknown;
2924
+ };
2925
+ content?: never;
2926
+ };
2882
2927
  };
2883
2928
  };
2884
2929
  get_series_list: {