@structbuild/sdk 0.1.13 → 0.1.15

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.
@@ -3,6 +3,26 @@
3
3
  * Do not make direct changes to the file.
4
4
  */
5
5
  export interface paths {
6
+ "/polymarket/asset-history": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ /**
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.
16
+ */
17
+ get: operations["get_asset_history"];
18
+ put?: never;
19
+ post?: never;
20
+ delete?: never;
21
+ options?: never;
22
+ head?: never;
23
+ patch?: never;
24
+ trace?: never;
25
+ };
6
26
  "/polymarket/events": {
7
27
  parameters: {
8
28
  query?: never;
@@ -707,6 +727,45 @@ export interface paths {
707
727
  export type webhooks = Record<string, never>;
708
728
  export interface components {
709
729
  schemas: {
730
+ /** @description A single asset price history record from the `asset_price_history` table. */
731
+ AssetPriceHistoryRow: {
732
+ asset_symbol: string;
733
+ /**
734
+ * Format: double
735
+ * @description Opening price at start_time (cast to f64 from NUMERIC in query)
736
+ */
737
+ asset_open_price: number;
738
+ /**
739
+ * Format: double
740
+ * @description Closing price at end_time (cast to f64 from NUMERIC in query)
741
+ */
742
+ asset_close_price: number;
743
+ /** Format: double */
744
+ price_change_percentage?: number | null;
745
+ /** @description Generated column: "up" if close > open, else "down" */
746
+ outcome: string;
747
+ /** @description Time window: "5m", "15m", "1h", "1d" */
748
+ variant: string;
749
+ /**
750
+ * Format: int64
751
+ * @description Window start timestamp (seconds since epoch)
752
+ */
753
+ start_time: number;
754
+ /**
755
+ * Format: int64
756
+ * @description Window end timestamp (seconds since epoch)
757
+ */
758
+ end_time: number;
759
+ /**
760
+ * Format: int64
761
+ * @description Canonical timestamp (= end_time, seconds since epoch)
762
+ */
763
+ asset_price_timestamp: number;
764
+ };
765
+ /** @enum {string} */
766
+ AssetSymbol: "BTC" | "ETH" | "XRP" | "SOL";
767
+ /** @enum {string} */
768
+ AssetVariant: "5m" | "15m" | "1h" | "1d";
710
769
  BondMarket: {
711
770
  condition_id: string;
712
771
  title?: string | null;
@@ -929,9 +988,9 @@ export interface components {
929
988
  /** @description Holder statistics data point (single time bucket) */
930
989
  HolderHistoryCandle: {
931
990
  /** Format: int64 */
932
- timestamp: number;
991
+ t: number;
933
992
  /** Format: int64 */
934
- total_holders?: number | null;
993
+ h?: number | null;
935
994
  };
936
995
  /** @description Market-level PnL data for a holder */
937
996
  MarketHolderPnl: {
@@ -1110,19 +1169,19 @@ export interface components {
1110
1169
  };
1111
1170
  MarketVolumeDataPoint: {
1112
1171
  /** Format: int64 */
1113
- timestamp: number;
1172
+ t: number;
1114
1173
  /** Format: double */
1115
- total_volume: number;
1174
+ v: number;
1116
1175
  /** Format: double */
1117
- yes_volume: number;
1176
+ yv: number;
1118
1177
  /** Format: double */
1119
- no_volume: number;
1178
+ nv: number;
1120
1179
  /** Format: int32 */
1121
- trades_count: number;
1180
+ tc: number;
1122
1181
  /** Format: int32 */
1123
- yes_trades_count: number;
1182
+ ytc: number;
1124
1183
  /** Format: int32 */
1125
- no_trades_count: number;
1184
+ ntc: number;
1126
1185
  };
1127
1186
  /** @enum {string} */
1128
1187
  MetricsTimeframe: "1m" | "5m" | "30m" | "1h" | "6h" | "24h" | "7d" | "30d";
@@ -1229,6 +1288,19 @@ export interface components {
1229
1288
  */
1230
1289
  price_change_percent: number | null;
1231
1290
  };
1291
+ /** @description A single PnL candle entry */
1292
+ PnlCandleEntry: {
1293
+ /**
1294
+ * Format: int64
1295
+ * @description Timestamp in epoch seconds (start of bucket window)
1296
+ */
1297
+ t: number;
1298
+ /**
1299
+ * Format: double
1300
+ * @description Sum of realized PnL in this bucket
1301
+ */
1302
+ pnl: number;
1303
+ };
1232
1304
  /** @enum {string} */
1233
1305
  PnlCandleResolution: "1m" | "1h" | "1d";
1234
1306
  /** @enum {string} */
@@ -1478,19 +1550,19 @@ export interface components {
1478
1550
  };
1479
1551
  PositionVolumeDataPoint: {
1480
1552
  /** Format: int64 */
1481
- timestamp: number;
1553
+ t: number;
1482
1554
  /** Format: double */
1483
- volume: number;
1555
+ v: number;
1484
1556
  /** Format: double */
1485
- buy_volume: number;
1557
+ bv: number;
1486
1558
  /** Format: double */
1487
- sell_volume: number;
1559
+ sv: number;
1488
1560
  /** Format: int32 */
1489
- trades_count: number;
1561
+ tc: number;
1490
1562
  /** Format: int32 */
1491
- buy_trades_count: number;
1563
+ btc: number;
1492
1564
  /** Format: int32 */
1493
- sell_trades_count: number;
1565
+ stc: number;
1494
1566
  };
1495
1567
  PredictionCandlestickBar: {
1496
1568
  /** Format: double */
@@ -1737,19 +1809,19 @@ export interface components {
1737
1809
  };
1738
1810
  TraderVolumeDataPoint: {
1739
1811
  /** Format: int64 */
1740
- timestamp: number;
1812
+ t: number;
1741
1813
  /** Format: double */
1742
- total_volume: number;
1814
+ v: number;
1743
1815
  /** Format: double */
1744
- buy_volume: number;
1816
+ bv: number;
1745
1817
  /** Format: double */
1746
- sell_volume: number;
1818
+ sv: number;
1747
1819
  /** Format: int32 */
1748
- trades_count: number;
1820
+ tc: number;
1749
1821
  /** Format: int32 */
1750
- buy_trades_count: number;
1822
+ btc: number;
1751
1823
  /** Format: int32 */
1752
- sell_trades_count: number;
1824
+ stc: number;
1753
1825
  };
1754
1826
  };
1755
1827
  responses: never;
@@ -1760,6 +1832,44 @@ export interface components {
1760
1832
  }
1761
1833
  export type $defs = Record<string, never>;
1762
1834
  export interface operations {
1835
+ get_asset_history: {
1836
+ parameters: {
1837
+ query: {
1838
+ /** @description Asset ticker: BTC, ETH, XRP, or SOL */
1839
+ asset_symbol: components["schemas"]["AssetSymbol"];
1840
+ /** @description Time window: 5m, 15m, 1h, or 1d */
1841
+ variant: components["schemas"]["AssetVariant"];
1842
+ /** @description Start timestamp (Unix seconds, inclusive) */
1843
+ from?: number;
1844
+ /** @description End timestamp (Unix seconds, inclusive, defaults to now) */
1845
+ to?: number;
1846
+ /** @description Number of results (default: 10, max: 100) */
1847
+ limit?: number;
1848
+ };
1849
+ header?: never;
1850
+ path?: never;
1851
+ cookie?: never;
1852
+ };
1853
+ requestBody?: never;
1854
+ responses: {
1855
+ /** @description Asset price history records, sorted newest first */
1856
+ 200: {
1857
+ headers: {
1858
+ [name: string]: unknown;
1859
+ };
1860
+ content: {
1861
+ "application/json": components["schemas"]["AssetPriceHistoryRow"][];
1862
+ };
1863
+ };
1864
+ /** @description Missing or invalid asset_symbol / variant */
1865
+ 400: {
1866
+ headers: {
1867
+ [name: string]: unknown;
1868
+ };
1869
+ content?: never;
1870
+ };
1871
+ };
1872
+ };
1763
1873
  get_events: {
1764
1874
  parameters: {
1765
1875
  query?: {
@@ -1841,8 +1951,6 @@ export interface operations {
1841
1951
  condition_ids?: string;
1842
1952
  /** @description Comma-separated market slugs to include (max 4, optional). Use either condition_ids or market_slugs, not both */
1843
1953
  market_slugs?: string;
1844
- /** @description Number of top markets to include if neither condition_ids nor market_slugs specified (max 4, default: 4) */
1845
- limit?: number;
1846
1954
  /** @description Time interval with implicit lookback: 1H (1 hour), 6H (6 hours), 1D (1 day), 1W (1 week), 1M (30 days), ALL (all data) (required) */
1847
1955
  resolution: "1H" | "6H" | "1D" | "1W" | "1M" | "ALL";
1848
1956
  };
@@ -2795,7 +2903,9 @@ export interface operations {
2795
2903
  headers: {
2796
2904
  [name: string]: unknown;
2797
2905
  };
2798
- content?: never;
2906
+ content: {
2907
+ "application/json": components["schemas"]["PnlCandleEntry"][];
2908
+ };
2799
2909
  };
2800
2910
  };
2801
2911
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structbuild/sdk",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",