@structbuild/sdk 0.3.10-staging.3 → 0.3.10-staging.5

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.
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
  /**
@@ -1691,22 +1690,22 @@ export interface components {
1691
1690
  no_count: number;
1692
1691
  /**
1693
1692
  * Format: int64
1694
- * @description Estimated row count of `polymarket_tags` (Postgres pg_class.reltuples).
1693
+ * @description Estimated total number of tags.
1695
1694
  */
1696
1695
  tags: number;
1697
1696
  /**
1698
1697
  * Format: int64
1699
- * @description Estimated row count of `polymarket_events`.
1698
+ * @description Estimated total number of events.
1700
1699
  */
1701
1700
  events: number;
1702
1701
  /**
1703
1702
  * Format: int64
1704
- * @description Estimated row count of `prediction_markets`.
1703
+ * @description Estimated total number of markets.
1705
1704
  */
1706
1705
  markets: number;
1707
1706
  /**
1708
1707
  * Format: int64
1709
- * @description Estimated row count of `polymarket_accounts` (traders / positions).
1708
+ * @description Estimated total number of unique positions / traders.
1710
1709
  */
1711
1710
  positions: number;
1712
1711
  };
@@ -2448,6 +2447,26 @@ export interface components {
2448
2447
  label: string;
2449
2448
  /** @default null */
2450
2449
  slug: string | null;
2450
+ /**
2451
+ * Format: double
2452
+ * @default null
2453
+ */
2454
+ volume_usd: number;
2455
+ /**
2456
+ * Format: int64
2457
+ * @default null
2458
+ */
2459
+ txn_count: number;
2460
+ /**
2461
+ * Format: int64
2462
+ * @default null
2463
+ */
2464
+ unique_traders: number;
2465
+ /**
2466
+ * Format: double
2467
+ * @default null
2468
+ */
2469
+ fees_usd: number;
2451
2470
  };
2452
2471
  /** @description Polymarket user profile (public API format) */
2453
2472
  PolymarketUserProfile: {
@@ -2960,11 +2979,30 @@ export interface components {
2960
2979
  ask_levels?: number | null;
2961
2980
  };
2962
2981
  /**
2963
- * @description Timeseries bucket row.
2982
+ * @description Metric to order by when `sort=<value>` is provided.
2983
+ * `traders` windowed sums per-block deltas — approximate for the "unique
2984
+ * traders in window" reading (double-counts traders active in multiple
2985
+ * blocks) but fine for ranking. `lifetime` uses the exact cumulative.
2986
+ * @enum {string}
2987
+ */
2988
+ TagSortBy: "volume" | "txns" | "traders" | "fees";
2989
+ /**
2990
+ * @description Timeframe for `?sort=...` — defines the window the metric is summed over
2991
+ * (or `lifetime` for all-time cumulative).
2992
+ * @enum {string}
2993
+ */
2994
+ TagSortTimeframe: "lifetime" | "1h" | "24h" | "7d" | "30d" | "1mo" | "1y";
2995
+ /**
2996
+ * @description Bucket row returned by both `/analytics/timeseries` (cumulative values
2997
+ * at end of bucket) and `/analytics/deltas` (per-bucket deltas). All metrics
2998
+ * the snapshot `/counts` returns are included.
2999
+ *
2964
3000
  * Short field names for compact JSON responses:
2965
3001
  * t=bucket (unix seconds), v=volume_usd, bv=buy_volume_usd, sv=sell_volume_usd,
2966
- * ut=unique_traders, tc=txn_count, f=fees_usd, sh=shares_volume,
2967
- * yv=yes_volume_usd, nv=no_volume_usd
3002
+ * ut=unique_traders, tc=txn_count, bc=buy_count, sc=sell_count,
3003
+ * rc=redemption_count, rv=redemption_volume_usd, mc=merge_count,
3004
+ * sp=split_count, f=fees_usd, sh=shares_volume,
3005
+ * yv=yes_volume_usd, nv=no_volume_usd, yc=yes_count, nc=no_count
2968
3006
  */
2969
3007
  TimeBucketRow: {
2970
3008
  /** Format: int32 */
@@ -2979,6 +3017,18 @@ export interface components {
2979
3017
  ut: number;
2980
3018
  /** Format: int64 */
2981
3019
  tc: number;
3020
+ /** Format: int64 */
3021
+ bc: number;
3022
+ /** Format: int64 */
3023
+ sc: number;
3024
+ /** Format: int64 */
3025
+ rc: number;
3026
+ /** Format: double */
3027
+ rv: number;
3028
+ /** Format: int64 */
3029
+ mc: number;
3030
+ /** Format: int64 */
3031
+ sp: number;
2982
3032
  /** Format: double */
2983
3033
  f: number;
2984
3034
  /** Format: double */
@@ -2987,6 +3037,10 @@ export interface components {
2987
3037
  yv: number;
2988
3038
  /** Format: double */
2989
3039
  nv: number;
3040
+ /** Format: int64 */
3041
+ yc: number;
3042
+ /** Format: int64 */
3043
+ nc: number;
2990
3044
  };
2991
3045
  /** @description Token outcome (position) */
2992
3046
  TokenOutcome: {
@@ -5192,8 +5246,12 @@ export interface operations {
5192
5246
  limit?: number;
5193
5247
  /** @description Offset-based pagination (number of results to skip). Takes precedence over pagination_key. */
5194
5248
  offset?: number;
5195
- /** @description Cursor-based pagination key */
5249
+ /** @description Cursor-based pagination key (alphabetical mode only). */
5196
5250
  pagination_key?: string;
5251
+ /** @description Sort metric. Defaults to `volume` when only `timeframe` is set. Setting either `sort` or `timeframe` adds +2 credits. */
5252
+ sort?: components["schemas"]["TagSortBy"];
5253
+ /** @description Window for the sort metric. Defaults to `24h` when only `sort` is set. Setting either `sort` or `timeframe` adds +2 credits. */
5254
+ timeframe?: components["schemas"]["TagSortTimeframe"];
5197
5255
  };
5198
5256
  header?: never;
5199
5257
  path?: never;
@@ -5214,7 +5272,12 @@ export interface operations {
5214
5272
  };
5215
5273
  get_tag_by_id: {
5216
5274
  parameters: {
5217
- query?: never;
5275
+ query?: {
5276
+ /** @description Attach analytics metrics. +1 credit. */
5277
+ include_metrics?: boolean;
5278
+ /** @description Metrics window. Default `1d` (= `24h`). Ignored unless `include_metrics=true`. */
5279
+ timeframe?: components["schemas"]["TagSortTimeframe"];
5280
+ };
5218
5281
  header?: never;
5219
5282
  path: {
5220
5283
  /** @description Tag ID or slug */
@@ -53,6 +53,8 @@ export type Event = Omit<Schemas["PolymarketEvent"], "metrics"> & {
53
53
  };
54
54
  export type PolymarketSeries = Schemas["PolymarketSeries"];
55
55
  export type Tag = Schemas["PolymarketTag"];
56
+ export type TagSortBy = Schemas["TagSortBy"];
57
+ export type TagSortTimeframe = Schemas["TagSortTimeframe"];
56
58
  export type UserProfile = Schemas["PolymarketUserProfile"];
57
59
  export type PositionHoldersResponse = Schemas["PositionHoldersResponse"];
58
60
  export type PositionStatus = Schemas["PositionStatus"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structbuild/sdk",
3
- "version": "0.3.10-staging.3",
3
+ "version": "0.3.10-staging.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",