@structbuild/sdk 0.1.20 → 0.1.21

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.
@@ -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 (ILIKE).
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
@@ -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: {
@@ -128,7 +128,7 @@ export interface webhooks {
128
128
  put?: never;
129
129
  /**
130
130
  * First trade callback
131
- * @description Fired when a tracked trader executes their first trade on a market
131
+ * @description Fired when a tracked trader executes their first trade on Polymarket
132
132
  */
133
133
  post: operations["trader-first-trade"];
134
134
  delete?: never;
@@ -29,6 +29,7 @@ export type MarketVolumeDataPoint = Schemas["MarketVolumeDataPoint"];
29
29
  export type MetricsTimeframe = Schemas["MetricsTimeframe"];
30
30
  export type OutcomeHolders = Schemas["OutcomeHolders"];
31
31
  export type OutcomeTimeframeMetrics = Schemas["OutcomeTimeframeMetrics"];
32
+ export type PaginationMeta = Schemas["PaginationMeta"];
32
33
  export type PnlCandleResolution = Schemas["PnlCandleResolution"];
33
34
  export type PnlTimeframe = Schemas["PnlTimeframe"];
34
35
  export type Event = Schemas["PolymarketEvent"];
@@ -43,6 +44,7 @@ export type PositionVolumeDataPoint = Schemas["PositionVolumeDataPoint"];
43
44
  export type PredictionCandlestickBar = Schemas["PredictionCandlestickBar"];
44
45
  export type PredictionTradeResponse = Schemas["PredictionTradeResponse"];
45
46
  export type SearchResponse = Schemas["SearchResponse"];
47
+ export type SearchSortBy = Schemas["SearchSortBy"];
46
48
  export type SimpleTimeframeMetrics = Schemas["SimpleTimeframeMetrics"];
47
49
  export type SortDirection = Schemas["SortDirection"];
48
50
  export type TokenOutcome = Schemas["TokenOutcome"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structbuild/sdk",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",