@structbuild/sdk 0.5.6 → 0.5.7

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.
@@ -1868,17 +1868,17 @@ export interface components {
1868
1868
  slug?: string | null;
1869
1869
  event_slug?: string | null;
1870
1870
  };
1871
- /** @description A single asset price history record from the `asset_price_history` table. */
1871
+ /** @description One bucket of an asset's price history at a fixed time-window resolution. */
1872
1872
  AssetPriceHistoryRow: {
1873
1873
  asset_symbol: string;
1874
1874
  /**
1875
1875
  * Format: double
1876
- * @description Opening price at start_time (cast to f64 from NUMERIC in query)
1876
+ * @description Opening price at `start_time`.
1877
1877
  */
1878
1878
  asset_open_price: number;
1879
1879
  /**
1880
1880
  * Format: double
1881
- * @description Closing price at end_time (cast to f64 from NUMERIC in query)
1881
+ * @description Closing price at `end_time`.
1882
1882
  */
1883
1883
  asset_close_price: number;
1884
1884
  /** Format: double */
@@ -1902,7 +1902,11 @@ export interface components {
1902
1902
  AssetSymbol: "BTC" | "ETH" | "XRP" | "SOL" | "DOGE" | "BNB" | "HYPE";
1903
1903
  /** @enum {string} */
1904
1904
  AssetVariant: "5m" | "15m" | "1h" | "4h" | "1d";
1905
- /** @description Lightweight row — derived metrics only, no bids/asks JSONB. */
1905
+ /**
1906
+ * @description One bucket of derived order-book metrics for a position at a point in time.
1907
+ * Only summary metrics are returned — the underlying bid/ask ladders are
1908
+ * available from the snapshot endpoint.
1909
+ */
1906
1910
  SpreadRow: {
1907
1911
  /** Format: int64 */
1908
1912
  ts: number;
@@ -2212,12 +2216,9 @@ export interface components {
2212
2216
  builder_taker_fee_rate_bps: number;
2213
2217
  };
2214
2218
  /**
2215
- * @description Documentation-only response shape for endpoints that embed display
2216
- * metadata onto each row (`/`, `/{builder_code}`, `/tags/{tag}`). Mirrors
2217
- * `BuilderLatestRow` and adds a nullable `metadata` field. Not used as a
2218
- * data structure at runtime — the actual response is built by
2219
- * `BuilderLatestRow` plus a JSON-level merge from the metadata cache, which
2220
- * produces this exact shape.
2219
+ * @description Latest builder stats with builder display metadata (name, icon, links)
2220
+ * merged onto each row. Returned by endpoints that embed display metadata,
2221
+ * such as `/`, `/{builder_code}`, and `/tags/{tag}`.
2221
2222
  */
2222
2223
  BuilderLatestRowWithMetadata: components["schemas"]["BuilderLatestRow"] & {
2223
2224
  metadata?: null | components["schemas"]["BuilderMetadataInline"];
@@ -3016,10 +3017,8 @@ export interface components {
3016
3017
  accepting_orders: boolean | null;
3017
3018
  /** @default null */
3018
3019
  uma_resolution_status: string | null;
3019
- /** @default [] */
3020
- clob_rewards: components["schemas"]["ClobReward"][];
3021
- /** @default [] */
3022
- outcomes: components["schemas"]["EventMarketOutcome"][];
3020
+ clob_rewards?: components["schemas"]["ClobReward"][];
3021
+ outcomes?: components["schemas"]["EventMarketOutcome"][];
3023
3022
  /** @default null */
3024
3023
  winning_outcome: null | components["schemas"]["EventMarketOutcome"];
3025
3024
  };
@@ -3081,8 +3080,8 @@ export interface components {
3081
3080
  /**
3082
3081
  * @description Metric to order by when `sort=<value>` is provided.
3083
3082
  *
3084
- * `unique_*` ranks by window-distinct addresses exact `uniqExact` count
3085
- * of addresses active in the timeframe.
3083
+ * `unique_*` variants rank by the number of distinct wallet addresses
3084
+ * active in the selected timeframe.
3086
3085
  * @enum {string}
3087
3086
  */
3088
3087
  TagSortBy: "volume" | "txns" | "unique_traders" | "unique_makers" | "unique_takers" | "fees";
@@ -3514,7 +3513,7 @@ export interface components {
3514
3513
  slug?: string | null;
3515
3514
  /**
3516
3515
  * Format: int64
3517
- * @description Total unique holders across all outcomes (from holder_stats)
3516
+ * @description Total unique holders across all outcomes of this market.
3518
3517
  */
3519
3518
  total_holders: number;
3520
3519
  /** @description Holders grouped by outcome */
@@ -3528,8 +3527,17 @@ export interface components {
3528
3527
  last_price?: number | null;
3529
3528
  /** Format: double */
3530
3529
  last_probability?: number | null;
3530
+ /** @description Per-timeframe metrics keyed by lookback window. Each timeframe key is optional — present only when data exists for that window. */
3531
3531
  metrics?: {
3532
- [key: string]: components["schemas"]["OutcomeTimeframeMetrics"];
3532
+ "1m"?: components["schemas"]["OutcomeTimeframeMetrics"];
3533
+ "5m"?: components["schemas"]["OutcomeTimeframeMetrics"];
3534
+ "30m"?: components["schemas"]["OutcomeTimeframeMetrics"];
3535
+ "1h"?: components["schemas"]["OutcomeTimeframeMetrics"];
3536
+ "6h"?: components["schemas"]["OutcomeTimeframeMetrics"];
3537
+ "24h"?: components["schemas"]["OutcomeTimeframeMetrics"];
3538
+ "7d"?: components["schemas"]["OutcomeTimeframeMetrics"];
3539
+ "30d"?: components["schemas"]["OutcomeTimeframeMetrics"];
3540
+ lifetime?: components["schemas"]["OutcomeTimeframeMetrics"];
3533
3541
  };
3534
3542
  };
3535
3543
  /** @description Outcome for market API responses */
@@ -3606,8 +3614,17 @@ export interface components {
3606
3614
  tags?: string[];
3607
3615
  event_slug?: string | null;
3608
3616
  resolution_source?: string | null;
3617
+ /** @description Per-timeframe metrics keyed by lookback window. Each timeframe key is optional — present only when data exists for that window. */
3609
3618
  metrics?: {
3610
- [key: string]: components["schemas"]["SimpleTimeframeMetrics"];
3619
+ "1m"?: components["schemas"]["SimpleTimeframeMetrics"];
3620
+ "5m"?: components["schemas"]["SimpleTimeframeMetrics"];
3621
+ "30m"?: components["schemas"]["SimpleTimeframeMetrics"];
3622
+ "1h"?: components["schemas"]["SimpleTimeframeMetrics"];
3623
+ "6h"?: components["schemas"]["SimpleTimeframeMetrics"];
3624
+ "24h"?: components["schemas"]["SimpleTimeframeMetrics"];
3625
+ "7d"?: components["schemas"]["SimpleTimeframeMetrics"];
3626
+ "30d"?: components["schemas"]["SimpleTimeframeMetrics"];
3627
+ lifetime?: components["schemas"]["SimpleTimeframeMetrics"];
3611
3628
  };
3612
3629
  /** Format: double */
3613
3630
  relevance_score?: number | null;
@@ -3983,7 +4000,7 @@ export interface components {
3983
4000
  price?: number | null;
3984
4001
  /**
3985
4002
  * Format: int64
3986
- * @description Total holders count from holder_stats
4003
+ * @description Total holders count for this outcome.
3987
4004
  */
3988
4005
  total_holders: number;
3989
4006
  /** @description Top holders for this outcome */
@@ -4539,14 +4556,20 @@ export interface components {
4539
4556
  * @default null
4540
4557
  */
4541
4558
  status: string | null;
4542
- /** @default {} */
4543
- metrics: {
4544
- [key: string]: components["schemas"]["SimpleTimeframeMetrics"];
4545
- };
4546
- /** @default [] */
4547
- tags: components["schemas"]["PolymarketTag"][];
4548
- /** @default [] */
4549
- markets: components["schemas"]["EventMarket"][];
4559
+ /** @description Per-timeframe metrics keyed by lookback window. Each timeframe key is optional — present only when data exists for that window. */
4560
+ metrics?: {
4561
+ "1m"?: components["schemas"]["SimpleTimeframeMetrics"];
4562
+ "5m"?: components["schemas"]["SimpleTimeframeMetrics"];
4563
+ "30m"?: components["schemas"]["SimpleTimeframeMetrics"];
4564
+ "1h"?: components["schemas"]["SimpleTimeframeMetrics"];
4565
+ "6h"?: components["schemas"]["SimpleTimeframeMetrics"];
4566
+ "24h"?: components["schemas"]["SimpleTimeframeMetrics"];
4567
+ "7d"?: components["schemas"]["SimpleTimeframeMetrics"];
4568
+ "30d"?: components["schemas"]["SimpleTimeframeMetrics"];
4569
+ lifetime?: components["schemas"]["SimpleTimeframeMetrics"];
4570
+ };
4571
+ tags?: components["schemas"]["PolymarketTag"][];
4572
+ markets?: components["schemas"]["EventMarket"][];
4550
4573
  /** @default null */
4551
4574
  series: null | components["schemas"]["PolymarketSeries"];
4552
4575
  };
@@ -4615,39 +4638,27 @@ export interface components {
4615
4638
  label: string;
4616
4639
  /** @default null */
4617
4640
  slug: string | null;
4618
- /**
4619
- * Format: double
4620
- * @default null
4621
- */
4622
- volume_usd: number;
4623
- /**
4624
- * Format: int64
4625
- * @default null
4626
- */
4627
- txn_count: number;
4641
+ /** Format: double */
4642
+ volume_usd?: number;
4643
+ /** Format: int64 */
4644
+ txn_count?: number;
4628
4645
  /**
4629
4646
  * Format: int64
4630
4647
  * @description Distinct active traders in the window.
4631
- * @default null
4632
4648
  */
4633
- unique_traders: number;
4649
+ unique_traders?: number;
4634
4650
  /**
4635
4651
  * Format: int64
4636
4652
  * @description Distinct active makers in the window.
4637
- * @default null
4638
4653
  */
4639
- unique_makers: number;
4654
+ unique_makers?: number;
4640
4655
  /**
4641
4656
  * Format: int64
4642
4657
  * @description Distinct active takers in the window.
4643
- * @default null
4644
- */
4645
- unique_takers: number;
4646
- /**
4647
- * Format: double
4648
- * @default null
4649
4658
  */
4650
- fees_usd: number;
4659
+ unique_takers?: number;
4660
+ /** Format: double */
4661
+ fees_usd?: number;
4651
4662
  };
4652
4663
  /** @description Polymarket user profile (public API format) */
4653
4664
  PolymarketUserProfile: {
@@ -4711,7 +4722,7 @@ export interface components {
4711
4722
  price?: number | null;
4712
4723
  /**
4713
4724
  * Format: int64
4714
- * @description Total holders count from holder_stats
4725
+ * @description Total holders of this position.
4715
4726
  */
4716
4727
  total_holders: number;
4717
4728
  /** @description Top holders */
@@ -7138,54 +7149,7 @@ export interface operations {
7138
7149
  [name: string]: unknown;
7139
7150
  };
7140
7151
  content: {
7141
- "application/json": {
7142
- condition_id: string;
7143
- id?: string | null;
7144
- market_slug?: string | null;
7145
- question?: string | null;
7146
- title?: string | null;
7147
- description?: string | null;
7148
- image_url?: string | null;
7149
- oracle?: string | null;
7150
- status: string;
7151
- /** Format: int64 */
7152
- created_time?: number | null;
7153
- /** Format: int64 */
7154
- start_time?: number | null;
7155
- /** Format: int64 */
7156
- game_start_time?: number | null;
7157
- /** Format: int64 */
7158
- closed_time?: number | null;
7159
- /** Format: int64 */
7160
- end_time?: number | null;
7161
- accepting_orders?: boolean | null;
7162
- uma_resolution_status?: string | null;
7163
- is_neg_risk?: boolean | null;
7164
- market_maker_address?: string | null;
7165
- creator?: string | null;
7166
- category?: string | null;
7167
- /** Format: double */
7168
- volume_usd?: number | null;
7169
- /** Format: double */
7170
- liquidity_usd?: number | null;
7171
- /** Format: double */
7172
- highest_probability?: number | null;
7173
- /** Format: int64 */
7174
- total_holders?: number | null;
7175
- /** Format: double */
7176
- total_daily_rate?: number | null;
7177
- winning_outcome?: null | components["schemas"]["MarketOutcome"];
7178
- outcomes?: components["schemas"]["MarketOutcome"][];
7179
- clob_rewards?: components["schemas"]["ClobReward"][];
7180
- tags?: string[];
7181
- event_slug?: string | null;
7182
- resolution_source?: string | null;
7183
- metrics?: {
7184
- [key: string]: components["schemas"]["SimpleTimeframeMetrics"];
7185
- };
7186
- /** Format: double */
7187
- relevance_score?: number | null;
7188
- }[];
7152
+ "application/json": components["schemas"]["MarketResponse"][];
7189
7153
  };
7190
7154
  };
7191
7155
  /** @description Market not found */
@@ -7373,54 +7337,7 @@ export interface operations {
7373
7337
  [name: string]: unknown;
7374
7338
  };
7375
7339
  content: {
7376
- "application/json": {
7377
- condition_id: string;
7378
- id?: string | null;
7379
- market_slug?: string | null;
7380
- question?: string | null;
7381
- title?: string | null;
7382
- description?: string | null;
7383
- image_url?: string | null;
7384
- oracle?: string | null;
7385
- status: string;
7386
- /** Format: int64 */
7387
- created_time?: number | null;
7388
- /** Format: int64 */
7389
- start_time?: number | null;
7390
- /** Format: int64 */
7391
- game_start_time?: number | null;
7392
- /** Format: int64 */
7393
- closed_time?: number | null;
7394
- /** Format: int64 */
7395
- end_time?: number | null;
7396
- accepting_orders?: boolean | null;
7397
- uma_resolution_status?: string | null;
7398
- is_neg_risk?: boolean | null;
7399
- market_maker_address?: string | null;
7400
- creator?: string | null;
7401
- category?: string | null;
7402
- /** Format: double */
7403
- volume_usd?: number | null;
7404
- /** Format: double */
7405
- liquidity_usd?: number | null;
7406
- /** Format: double */
7407
- highest_probability?: number | null;
7408
- /** Format: int64 */
7409
- total_holders?: number | null;
7410
- /** Format: double */
7411
- total_daily_rate?: number | null;
7412
- winning_outcome?: null | components["schemas"]["MarketOutcome"];
7413
- outcomes?: components["schemas"]["MarketOutcome"][];
7414
- clob_rewards?: components["schemas"]["ClobReward"][];
7415
- tags?: string[];
7416
- event_slug?: string | null;
7417
- resolution_source?: string | null;
7418
- metrics?: {
7419
- [key: string]: components["schemas"]["SimpleTimeframeMetrics"];
7420
- };
7421
- /** Format: double */
7422
- relevance_score?: number | null;
7423
- }[];
7340
+ "application/json": components["schemas"]["MarketResponse"][];
7424
7341
  };
7425
7342
  };
7426
7343
  /** @description Market not found */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structbuild/sdk",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",