@structbuild/sdk 0.1.15 → 0.1.17

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/dist/client.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Venue } from "./types/common.js";
2
2
  import type { RetryConfig, RequestHookInfo, ResponseHookInfo } from "./types/index.js";
3
- import { HoldersNamespace, TagsNamespace, EventsNamespace, MarketsNamespace, SeriesNamespace, TraderNamespace, BondsNamespace, SearchNamespace, WebhooksNamespace } from "./namespaces/index.js";
3
+ import { AssetsNamespace, HoldersNamespace, TagsNamespace, EventsNamespace, MarketsNamespace, SeriesNamespace, TraderNamespace, BondsNamespace, SearchNamespace, WebhooksNamespace } from "./namespaces/index.js";
4
4
  export interface StructClientConfig {
5
5
  apiKey: string;
6
6
  baseUrl?: string;
@@ -12,6 +12,7 @@ export interface StructClientConfig {
12
12
  onResponse?: (info: ResponseHookInfo) => void | Promise<void>;
13
13
  }
14
14
  export declare class StructClient {
15
+ readonly assets: AssetsNamespace;
15
16
  readonly holders: HoldersNamespace;
16
17
  readonly tags: TagsNamespace;
17
18
  readonly events: EventsNamespace;
@@ -12,7 +12,7 @@ export interface paths {
12
12
  };
13
13
  /**
14
14
  * Get asset price history
15
- * @description Retrieve historical OHLC-style price data for a supported crypto asset (BTC, ETH, XRP, SOL) over a chosen time window variant. Timestamps are Unix seconds.
15
+ * @description Retrieve historical OHLC-style price data for a supported crypto asset (BTC, ETH, XRP, SOL) over a chosen time window variant. Timestamps are Unix seconds. Response includes `pagination: { has_more, pagination_key }` for cursor-based pagination — pass `pagination_key` from the previous response to fetch the next page.
16
16
  */
17
17
  get: operations["get_asset_history"];
18
18
  put?: never;
@@ -343,6 +343,26 @@ export interface paths {
343
343
  patch?: never;
344
344
  trace?: never;
345
345
  };
346
+ "/polymarket/market/price-jumps": {
347
+ parameters: {
348
+ query?: never;
349
+ header?: never;
350
+ path?: never;
351
+ cookie?: never;
352
+ };
353
+ /**
354
+ * Detect price jumps
355
+ * @description Scan candles for significant price movements. Returns jumps with from/to timestamps in milliseconds, directly usable as trades API time range parameters to identify traders who traded before or during the movement.
356
+ */
357
+ get: operations["get_price_jumps"];
358
+ put?: never;
359
+ post?: never;
360
+ delete?: never;
361
+ options?: never;
362
+ head?: never;
363
+ patch?: never;
364
+ trace?: never;
365
+ };
346
366
  "/polymarket/market/trades": {
347
367
  parameters: {
348
368
  query?: never;
@@ -742,8 +762,8 @@ export interface components {
742
762
  asset_close_price: number;
743
763
  /** Format: double */
744
764
  price_change_percentage?: number | null;
745
- /** @description Generated column: "up" if close > open, else "down" */
746
- outcome: string;
765
+ /** @description Generated column: "up" if close > open, "down" if close ≤ open, null if no close yet */
766
+ outcome?: string | null;
747
767
  /** @description Time window: "5m", "15m", "1h", "1d" */
748
768
  variant: string;
749
769
  /**
@@ -756,11 +776,6 @@ export interface components {
756
776
  * @description Window end timestamp (seconds since epoch)
757
777
  */
758
778
  end_time: number;
759
- /**
760
- * Format: int64
761
- * @description Canonical timestamp (= end_time, seconds since epoch)
762
- */
763
- asset_price_timestamp: number;
764
779
  };
765
780
  /** @enum {string} */
766
781
  AssetSymbol: "BTC" | "ETH" | "XRP" | "SOL";
@@ -1616,6 +1631,24 @@ export interface components {
1616
1631
  order_hash: string;
1617
1632
  position_id: string;
1618
1633
  };
1634
+ PriceJump: {
1635
+ /** Format: int64 */
1636
+ from: number;
1637
+ /** Format: int64 */
1638
+ to: number;
1639
+ /** Format: double */
1640
+ price_before: number;
1641
+ /** Format: double */
1642
+ price_after: number;
1643
+ /** Format: double */
1644
+ change_pct: number;
1645
+ direction: string;
1646
+ /** Format: double */
1647
+ volume: number;
1648
+ /** Format: int32 */
1649
+ trades_count: number;
1650
+ condition_id: string;
1651
+ };
1619
1652
  SearchResponse: {
1620
1653
  events: unknown;
1621
1654
  traders: components["schemas"]["Trader"][];
@@ -1693,6 +1726,8 @@ export interface components {
1693
1726
  /** @description Event-level PnL entry */
1694
1727
  TraderEventPnlEntry: {
1695
1728
  event_slug?: string | null;
1729
+ question?: string | null;
1730
+ image_url?: string | null;
1696
1731
  /** Format: int64 */
1697
1732
  markets_traded?: number | null;
1698
1733
  /** Format: int64 */
@@ -1741,6 +1776,8 @@ export interface components {
1741
1776
  TraderMarketPnlEntry: {
1742
1777
  condition_id?: string | null;
1743
1778
  event_slug?: string | null;
1779
+ question?: string | null;
1780
+ image_url?: string | null;
1744
1781
  /** Format: int64 */
1745
1782
  outcomes_traded?: number | null;
1746
1783
  /** Format: int64 */
@@ -1845,6 +1882,8 @@ export interface operations {
1845
1882
  to?: number;
1846
1883
  /** @description Number of results (default: 10, max: 100) */
1847
1884
  limit?: number;
1885
+ /** @description Cursor-based pagination key Obtained from previous response's `pagination.pagination_key`. Pass this to fetch the next page of results. */
1886
+ pagination_key?: string;
1848
1887
  };
1849
1888
  header?: never;
1850
1889
  path?: never;
@@ -1852,7 +1891,7 @@ export interface operations {
1852
1891
  };
1853
1892
  requestBody?: never;
1854
1893
  responses: {
1855
- /** @description Asset price history records, sorted newest first */
1894
+ /** @description Asset price history records, sorted newest first. Response includes `pagination: { has_more, pagination_key }` for cursor-based pagination. */
1856
1895
  200: {
1857
1896
  headers: {
1858
1897
  [name: string]: unknown;
@@ -2119,7 +2158,7 @@ export interface operations {
2119
2158
  query?: {
2120
2159
  /** @description Results limit (default: 10, max: 100) */
2121
2160
  limit?: number;
2122
- /** @description Cursor-based pagination key (base64-encoded, obtained from previous response's pagination.pagination_key) */
2161
+ /** @description Cursor-based pagination key */
2123
2162
  pagination_key?: string;
2124
2163
  /** @description Minimum shares held (decimal string) */
2125
2164
  min_shares?: string;
@@ -2251,7 +2290,7 @@ export interface operations {
2251
2290
  include_metrics?: boolean;
2252
2291
  /** @description Results limit (default: 10, max: 100) */
2253
2292
  limit?: number;
2254
- /** @description Cursor-based pagination key (base64-encoded, obtained from previous response's pagination.pagination_key) */
2293
+ /** @description Cursor-based pagination key */
2255
2294
  pagination_key?: string;
2256
2295
  };
2257
2296
  header?: never;
@@ -2505,6 +2544,39 @@ export interface operations {
2505
2544
  };
2506
2545
  };
2507
2546
  };
2547
+ get_price_jumps: {
2548
+ parameters: {
2549
+ query?: {
2550
+ /** @description Market condition ID (one of condition_id or market_slug required) */
2551
+ condition_id?: string;
2552
+ /** @description Market slug (resolved to condition_id) */
2553
+ market_slug?: string;
2554
+ /** @description Candle resolution in minutes: 1, 5, 15, 30, 60, 240 (default: 15) */
2555
+ resolution?: string;
2556
+ /** @description Minimum relative percent change to qualify as a jump (default: 10.0) */
2557
+ min_change_pct?: number;
2558
+ /** @description Number of candles to scan back from now (default: 1440, max: 2500) */
2559
+ lookback?: number;
2560
+ /** @description Offset in candles from now — window is [now - (lookback + offset) * resolution, now - offset * resolution] (default: 0) */
2561
+ offset?: number;
2562
+ };
2563
+ header?: never;
2564
+ path?: never;
2565
+ cookie?: never;
2566
+ };
2567
+ requestBody?: never;
2568
+ responses: {
2569
+ /** @description Price jumps sorted by timestamp descending */
2570
+ 200: {
2571
+ headers: {
2572
+ [name: string]: unknown;
2573
+ };
2574
+ content: {
2575
+ "application/json": components["schemas"]["PriceJump"][];
2576
+ };
2577
+ };
2578
+ };
2579
+ };
2508
2580
  get_market_trades: {
2509
2581
  parameters: {
2510
2582
  query?: {
@@ -2763,7 +2835,7 @@ export interface operations {
2763
2835
  query?: {
2764
2836
  /** @description Results limit (default: 10, max: 250) */
2765
2837
  limit?: number;
2766
- /** @description Cursor-based pagination key (base64-encoded, obtained from previous response's pagination.pagination_key) */
2838
+ /** @description Cursor-based pagination key */
2767
2839
  pagination_key?: string;
2768
2840
  };
2769
2841
  header?: never;
@@ -2824,7 +2896,7 @@ export interface operations {
2824
2896
  sort_direction?: components["schemas"]["SortDirection"];
2825
2897
  /** @description Results limit (default: 10, max: 200) */
2826
2898
  limit?: number;
2827
- /** @description Cursor-based pagination key (base64-encoded, obtained from previous response's pagination.pagination_key) */
2899
+ /** @description Cursor-based pagination key */
2828
2900
  pagination_key?: string;
2829
2901
  };
2830
2902
  header?: never;
@@ -2920,7 +2992,7 @@ export interface operations {
2920
2992
  sort_direction?: components["schemas"]["SortDirection"];
2921
2993
  /** @description Results limit (default: 10, max: 200) */
2922
2994
  limit?: number;
2923
- /** @description Cursor-based pagination key (base64-encoded, from previous response) */
2995
+ /** @description Cursor-based pagination key */
2924
2996
  pagination_key?: string;
2925
2997
  /** @description Filter by event slug */
2926
2998
  event_slug?: string;
@@ -2956,7 +3028,7 @@ export interface operations {
2956
3028
  sort_direction?: components["schemas"]["SortDirection"];
2957
3029
  /** @description Results limit (default: 10, max: 200) */
2958
3030
  limit?: number;
2959
- /** @description Cursor-based pagination key (base64-encoded, from previous response) */
3031
+ /** @description Cursor-based pagination key */
2960
3032
  pagination_key?: string;
2961
3033
  /** @description Filter by condition ID (or use market_slug) */
2962
3034
  condition_id?: string;
@@ -2996,7 +3068,7 @@ export interface operations {
2996
3068
  sort_direction?: components["schemas"]["SortDirection"];
2997
3069
  /** @description Results limit (default: 10, max: 200) */
2998
3070
  limit?: number;
2999
- /** @description Cursor-based pagination key (base64-encoded, from previous response) */
3071
+ /** @description Cursor-based pagination key */
3000
3072
  pagination_key?: string;
3001
3073
  /** @description Filter by market condition ID (or use market_slug) */
3002
3074
  condition_id?: string;