@structbuild/sdk 0.1.13 → 0.1.14

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;
@@ -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
+ ts: number;
1298
+ /**
1299
+ * Format: double
1300
+ * @description Sum of realized PnL in this bucket
1301
+ */
1302
+ pnl_usd: number;
1303
+ };
1232
1304
  /** @enum {string} */
1233
1305
  PnlCandleResolution: "1m" | "1h" | "1d";
1234
1306
  /** @enum {string} */
@@ -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.14",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",