@structbuild/sdk 0.3.10-staging.4 → 0.3.10-staging.6

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.
@@ -852,7 +852,7 @@ export interface paths {
852
852
  };
853
853
  /**
854
854
  * Get tags
855
- * @description Retrieve all available event tags/categories. Supports both cursor-based and offset-based pagination. Pass `sort=<metric>` to order tags by a traded-volume-style metric requires `timeframe` to pick the window.
855
+ * @description Retrieve all available event tags/categories. Default listing is alphabetical (cursor-paginated). If either `sort` or `timeframe` is provided, the listing is ranked by the chosen metric+window (offset-paginated): sort defaults to `volume` when only `timeframe` is set, timeframe defaults to `24h` when only `sort` is set.
856
856
  */
857
857
  get: operations["get_tags"];
858
858
  put?: never;
@@ -872,7 +872,7 @@ export interface paths {
872
872
  };
873
873
  /**
874
874
  * Get tag by slug
875
- * @description Retrieve a single tag by its ID or slug
875
+ * @description Retrieve a single tag by its ID or slug. Pass `include_metrics=true` to attach analytics metrics (volume_usd, txn_count, unique_traders, fees_usd) — adds +1 credit. Use `timeframe` to select the window; defaults to `1d`.
876
876
  */
877
877
  get: operations["get_tag_by_id"];
878
878
  put?: never;
@@ -1641,8 +1641,7 @@ export interface components {
1641
1641
  EventSortBy: "volume" | "txns" | "unique_traders" | "title" | "creation_date" | "start_date" | "end_date" | "relevance";
1642
1642
  /**
1643
1643
  * @description Response body for `GET /polymarket/analytics/counts`.
1644
- * Cumulative analytics metrics (from ClickHouse `analytics_global`) plus
1645
- * entity-count enrichment (from Postgres `pg_class.reltuples` estimates).
1644
+ * Cumulative analytics metrics plus entity-count enrichment.
1646
1645
  */
1647
1646
  GlobalCountsResponse: {
1648
1647
  /**
@@ -1675,9 +1674,13 @@ export interface components {
1675
1674
  redemption_volume_usd: number;
1676
1675
  /** Format: int64 */
1677
1676
  merge_count: number;
1677
+ /** Format: double */
1678
+ merge_volume_usd: number;
1678
1679
  /** Format: int64 */
1679
1680
  split_count: number;
1680
1681
  /** Format: double */
1682
+ split_volume_usd: number;
1683
+ /** Format: double */
1681
1684
  fees_usd: number;
1682
1685
  /** Format: double */
1683
1686
  shares_volume: number;
@@ -1689,24 +1692,36 @@ export interface components {
1689
1692
  yes_count: number;
1690
1693
  /** Format: int64 */
1691
1694
  no_count: number;
1695
+ /** Format: int64 */
1696
+ buy_dist_under_10: number;
1697
+ /** Format: int64 */
1698
+ buy_dist_10_100: number;
1699
+ /** Format: int64 */
1700
+ buy_dist_100_1k: number;
1701
+ /** Format: int64 */
1702
+ buy_dist_1k_10k: number;
1703
+ /** Format: int64 */
1704
+ buy_dist_10k_50k: number;
1705
+ /** Format: int64 */
1706
+ buy_dist_50k_plus: number;
1692
1707
  /**
1693
1708
  * Format: int64
1694
- * @description Estimated row count of `polymarket_tags` (Postgres pg_class.reltuples).
1709
+ * @description Estimated total number of tags.
1695
1710
  */
1696
1711
  tags: number;
1697
1712
  /**
1698
1713
  * Format: int64
1699
- * @description Estimated row count of `polymarket_events`.
1714
+ * @description Estimated total number of events.
1700
1715
  */
1701
1716
  events: number;
1702
1717
  /**
1703
1718
  * Format: int64
1704
- * @description Estimated row count of `prediction_markets`.
1719
+ * @description Estimated total number of markets.
1705
1720
  */
1706
1721
  markets: number;
1707
1722
  /**
1708
1723
  * Format: int64
1709
- * @description Estimated row count of `polymarket_accounts` (traders / positions).
1724
+ * @description Estimated total number of unique positions / traders.
1710
1725
  */
1711
1726
  positions: number;
1712
1727
  };
@@ -2994,11 +3009,16 @@ export interface components {
2994
3009
  */
2995
3010
  TagSortTimeframe: "lifetime" | "1h" | "24h" | "7d" | "30d" | "1mo" | "1y";
2996
3011
  /**
2997
- * @description Timeseries bucket row.
3012
+ * @description Bucket row returned by both `/analytics/timeseries` (cumulative values
3013
+ * at end of bucket) and `/analytics/deltas` (per-bucket deltas). All metrics
3014
+ * the snapshot `/counts` returns are included.
3015
+ *
2998
3016
  * Short field names for compact JSON responses:
2999
3017
  * t=bucket (unix seconds), v=volume_usd, bv=buy_volume_usd, sv=sell_volume_usd,
3000
- * ut=unique_traders, tc=txn_count, f=fees_usd, sh=shares_volume,
3001
- * yv=yes_volume_usd, nv=no_volume_usd
3018
+ * ut=unique_traders, tc=txn_count, bc=buy_count, sc=sell_count,
3019
+ * rc=redemption_count, rv=redemption_volume_usd, mc=merge_count,
3020
+ * sp=split_count, f=fees_usd, sh=shares_volume,
3021
+ * yv=yes_volume_usd, nv=no_volume_usd, yc=yes_count, nc=no_count
3002
3022
  */
3003
3023
  TimeBucketRow: {
3004
3024
  /** Format: int32 */
@@ -3013,6 +3033,22 @@ export interface components {
3013
3033
  ut: number;
3014
3034
  /** Format: int64 */
3015
3035
  tc: number;
3036
+ /** Format: int64 */
3037
+ bc: number;
3038
+ /** Format: int64 */
3039
+ sc: number;
3040
+ /** Format: int64 */
3041
+ rc: number;
3042
+ /** Format: double */
3043
+ rv: number;
3044
+ /** Format: int64 */
3045
+ mc: number;
3046
+ /** Format: double */
3047
+ mv: number;
3048
+ /** Format: int64 */
3049
+ sp: number;
3050
+ /** Format: double */
3051
+ spv: number;
3016
3052
  /** Format: double */
3017
3053
  f: number;
3018
3054
  /** Format: double */
@@ -3021,6 +3057,25 @@ export interface components {
3021
3057
  yv: number;
3022
3058
  /** Format: double */
3023
3059
  nv: number;
3060
+ /** Format: int64 */
3061
+ yc: number;
3062
+ /** Format: int64 */
3063
+ nc: number;
3064
+ /**
3065
+ * Format: int64
3066
+ * @description Buy distribution — count of buy trades falling in each USD bucket.
3067
+ */
3068
+ bd_u10: number;
3069
+ /** Format: int64 */
3070
+ bd_100: number;
3071
+ /** Format: int64 */
3072
+ bd_1k: number;
3073
+ /** Format: int64 */
3074
+ bd_10k: number;
3075
+ /** Format: int64 */
3076
+ bd_50k: number;
3077
+ /** Format: int64 */
3078
+ bd_50p: number;
3024
3079
  };
3025
3080
  /** @description Token outcome (position) */
3026
3081
  TokenOutcome: {
@@ -5228,9 +5283,9 @@ export interface operations {
5228
5283
  offset?: number;
5229
5284
  /** @description Cursor-based pagination key (alphabetical mode only). */
5230
5285
  pagination_key?: string;
5231
- /** @description Sort metric (offset-paginated). Omit for default alphabetical listing. */
5286
+ /** @description Sort metric. Defaults to `volume` when only `timeframe` is set. Setting either `sort` or `timeframe` adds +2 credits. */
5232
5287
  sort?: components["schemas"]["TagSortBy"];
5233
- /** @description Window for the sort metric. Required when `sort` is set. */
5288
+ /** @description Window for the sort metric. Defaults to `24h` when only `sort` is set. Setting either `sort` or `timeframe` adds +2 credits. */
5234
5289
  timeframe?: components["schemas"]["TagSortTimeframe"];
5235
5290
  };
5236
5291
  header?: never;
@@ -5252,7 +5307,12 @@ export interface operations {
5252
5307
  };
5253
5308
  get_tag_by_id: {
5254
5309
  parameters: {
5255
- query?: never;
5310
+ query?: {
5311
+ /** @description Attach analytics metrics. +1 credit. */
5312
+ include_metrics?: boolean;
5313
+ /** @description Metrics window. Default `1d` (= `24h`). Ignored unless `include_metrics=true`. */
5314
+ timeframe?: components["schemas"]["TagSortTimeframe"];
5315
+ };
5256
5316
  header?: never;
5257
5317
  path: {
5258
5318
  /** @description Tag ID or slug */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structbuild/sdk",
3
- "version": "0.3.10-staging.4",
3
+ "version": "0.3.10-staging.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",