@structbuild/sdk 0.1.25 → 0.2.0

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.
@@ -955,6 +955,31 @@ export interface components {
955
955
  /** Format: int32 */
956
956
  unique_traders: number;
957
957
  };
958
+ ConditionOrderbookRow: {
959
+ /** Format: int64 */
960
+ ts: number;
961
+ position_id: string;
962
+ condition_id: string;
963
+ bids: components["schemas"]["OrderbookLevel"][];
964
+ asks: components["schemas"]["OrderbookLevel"][];
965
+ hash: string;
966
+ /** Format: double */
967
+ best_bid?: number | null;
968
+ /** Format: double */
969
+ best_ask?: number | null;
970
+ /** Format: double */
971
+ mid_price?: number | null;
972
+ /** Format: double */
973
+ spread?: number | null;
974
+ /** Format: double */
975
+ bid_liquidity_usd?: number | null;
976
+ /** Format: double */
977
+ ask_liquidity_usd?: number | null;
978
+ /** Format: int32 */
979
+ bid_levels?: number | null;
980
+ /** Format: int32 */
981
+ ask_levels?: number | null;
982
+ };
958
983
  /** @description Enriched market data for event API responses */
959
984
  EventMarket: {
960
985
  /** @default */
@@ -1328,6 +1353,63 @@ export interface components {
1328
1353
  };
1329
1354
  /** @enum {string} */
1330
1355
  MetricsTimeframe: "1m" | "5m" | "30m" | "1h" | "6h" | "24h" | "7d" | "30d";
1356
+ OrderbookHistoryRow: {
1357
+ /** Format: int64 */
1358
+ ts: number;
1359
+ position_id: string;
1360
+ condition_id: string;
1361
+ bids: components["schemas"]["OrderbookLevel"][];
1362
+ asks: components["schemas"]["OrderbookLevel"][];
1363
+ hash: string;
1364
+ /** Format: double */
1365
+ best_bid?: number | null;
1366
+ /** Format: double */
1367
+ best_ask?: number | null;
1368
+ /** Format: double */
1369
+ mid_price?: number | null;
1370
+ /** Format: double */
1371
+ spread?: number | null;
1372
+ /** Format: double */
1373
+ bid_liquidity_usd?: number | null;
1374
+ /** Format: double */
1375
+ ask_liquidity_usd?: number | null;
1376
+ /** Format: int32 */
1377
+ bid_levels?: number | null;
1378
+ /** Format: int32 */
1379
+ ask_levels?: number | null;
1380
+ };
1381
+ /** @description A single price level in a bids/asks array. */
1382
+ OrderbookLevel: {
1383
+ /** @description Price as a decimal string */
1384
+ p: string;
1385
+ /** @description Size as a decimal string */
1386
+ s: string;
1387
+ };
1388
+ OrderbookSnapshotRow: {
1389
+ /** Format: int64 */
1390
+ ts: number;
1391
+ position_id: string;
1392
+ condition_id: string;
1393
+ bids: components["schemas"]["OrderbookLevel"][];
1394
+ asks: components["schemas"]["OrderbookLevel"][];
1395
+ hash: string;
1396
+ /** Format: double */
1397
+ best_bid?: number | null;
1398
+ /** Format: double */
1399
+ best_ask?: number | null;
1400
+ /** Format: double */
1401
+ mid_price?: number | null;
1402
+ /** Format: double */
1403
+ spread?: number | null;
1404
+ /** Format: double */
1405
+ bid_liquidity_usd?: number | null;
1406
+ /** Format: double */
1407
+ ask_liquidity_usd?: number | null;
1408
+ /** Format: int32 */
1409
+ bid_levels?: number | null;
1410
+ /** Format: int32 */
1411
+ ask_levels?: number | null;
1412
+ };
1331
1413
  /** @description Holder data grouped by outcome for market-level queries */
1332
1414
  OutcomeHolders: {
1333
1415
  /**
@@ -1826,6 +1908,29 @@ export interface components {
1826
1908
  * @enum {string}
1827
1909
  */
1828
1910
  SpikeDirection: "up" | "down" | "both";
1911
+ /** @description Lightweight row — derived metrics only, no bids/asks JSONB. */
1912
+ SpreadRow: {
1913
+ /** Format: int64 */
1914
+ ts: number;
1915
+ position_id: string;
1916
+ condition_id: string;
1917
+ /** Format: double */
1918
+ best_bid?: number | null;
1919
+ /** Format: double */
1920
+ best_ask?: number | null;
1921
+ /** Format: double */
1922
+ mid_price?: number | null;
1923
+ /** Format: double */
1924
+ spread?: number | null;
1925
+ /** Format: double */
1926
+ bid_liquidity_usd?: number | null;
1927
+ /** Format: double */
1928
+ ask_liquidity_usd?: number | null;
1929
+ /** Format: int32 */
1930
+ bid_levels?: number | null;
1931
+ /** Format: int32 */
1932
+ ask_levels?: number | null;
1933
+ };
1829
1934
  /** @description Token outcome (position) */
1830
1935
  TokenOutcome: {
1831
1936
  token_id: string;
@@ -2829,7 +2934,55 @@ export interface operations {
2829
2934
  headers: {
2830
2935
  [name: string]: unknown;
2831
2936
  };
2832
- content?: never;
2937
+ content: {
2938
+ "application/json": {
2939
+ condition_id: string;
2940
+ id?: string | null;
2941
+ market_slug?: string | null;
2942
+ question?: string | null;
2943
+ title?: string | null;
2944
+ description?: string | null;
2945
+ image_url?: string | null;
2946
+ oracle?: string | null;
2947
+ status: string;
2948
+ /** Format: int64 */
2949
+ created_time?: number | null;
2950
+ /** Format: int64 */
2951
+ start_time?: number | null;
2952
+ /** Format: int64 */
2953
+ game_start_time?: number | null;
2954
+ /** Format: int64 */
2955
+ closed_time?: number | null;
2956
+ /** Format: int64 */
2957
+ end_time?: number | null;
2958
+ accepting_orders?: boolean | null;
2959
+ uma_resolution_status?: string | null;
2960
+ is_neg_risk?: boolean | null;
2961
+ market_maker_address?: string | null;
2962
+ creator?: string | null;
2963
+ category?: string | null;
2964
+ /** Format: double */
2965
+ volume_usd?: number | null;
2966
+ /** Format: double */
2967
+ liquidity_usd?: number | null;
2968
+ /** Format: double */
2969
+ highest_probability?: number | null;
2970
+ /** Format: int64 */
2971
+ total_holders?: number | null;
2972
+ winning_outcome?: null | components["schemas"]["MarketOutcome"];
2973
+ outcomes?: components["schemas"]["MarketOutcome"][];
2974
+ rewards?: components["schemas"]["MarketReward"][];
2975
+ clob_rewards?: components["schemas"]["ClobReward"][];
2976
+ tags?: string[];
2977
+ event_slug?: string | null;
2978
+ resolution_source?: string | null;
2979
+ metrics?: {
2980
+ [key: string]: components["schemas"]["SimpleTimeframeMetrics"];
2981
+ };
2982
+ /** Format: double */
2983
+ relevance_score?: number | null;
2984
+ };
2985
+ };
2833
2986
  };
2834
2987
  /** @description Market not found */
2835
2988
  404: {
@@ -2962,7 +3115,55 @@ export interface operations {
2962
3115
  headers: {
2963
3116
  [name: string]: unknown;
2964
3117
  };
2965
- content?: never;
3118
+ content: {
3119
+ "application/json": {
3120
+ condition_id: string;
3121
+ id?: string | null;
3122
+ market_slug?: string | null;
3123
+ question?: string | null;
3124
+ title?: string | null;
3125
+ description?: string | null;
3126
+ image_url?: string | null;
3127
+ oracle?: string | null;
3128
+ status: string;
3129
+ /** Format: int64 */
3130
+ created_time?: number | null;
3131
+ /** Format: int64 */
3132
+ start_time?: number | null;
3133
+ /** Format: int64 */
3134
+ game_start_time?: number | null;
3135
+ /** Format: int64 */
3136
+ closed_time?: number | null;
3137
+ /** Format: int64 */
3138
+ end_time?: number | null;
3139
+ accepting_orders?: boolean | null;
3140
+ uma_resolution_status?: string | null;
3141
+ is_neg_risk?: boolean | null;
3142
+ market_maker_address?: string | null;
3143
+ creator?: string | null;
3144
+ category?: string | null;
3145
+ /** Format: double */
3146
+ volume_usd?: number | null;
3147
+ /** Format: double */
3148
+ liquidity_usd?: number | null;
3149
+ /** Format: double */
3150
+ highest_probability?: number | null;
3151
+ /** Format: int64 */
3152
+ total_holders?: number | null;
3153
+ winning_outcome?: null | components["schemas"]["MarketOutcome"];
3154
+ outcomes?: components["schemas"]["MarketOutcome"][];
3155
+ rewards?: components["schemas"]["MarketReward"][];
3156
+ clob_rewards?: components["schemas"]["ClobReward"][];
3157
+ tags?: string[];
3158
+ event_slug?: string | null;
3159
+ resolution_source?: string | null;
3160
+ metrics?: {
3161
+ [key: string]: components["schemas"]["SimpleTimeframeMetrics"];
3162
+ };
3163
+ /** Format: double */
3164
+ relevance_score?: number | null;
3165
+ };
3166
+ };
2966
3167
  };
2967
3168
  /** @description Market not found */
2968
3169
  404: {
@@ -2990,7 +3191,33 @@ export interface operations {
2990
3191
  headers: {
2991
3192
  [name: string]: unknown;
2992
3193
  };
2993
- content?: never;
3194
+ content: {
3195
+ "application/json": {
3196
+ /** Format: int64 */
3197
+ ts: number;
3198
+ position_id: string;
3199
+ condition_id: string;
3200
+ bids: components["schemas"]["OrderbookLevel"][];
3201
+ asks: components["schemas"]["OrderbookLevel"][];
3202
+ hash: string;
3203
+ /** Format: double */
3204
+ best_bid?: number | null;
3205
+ /** Format: double */
3206
+ best_ask?: number | null;
3207
+ /** Format: double */
3208
+ mid_price?: number | null;
3209
+ /** Format: double */
3210
+ spread?: number | null;
3211
+ /** Format: double */
3212
+ bid_liquidity_usd?: number | null;
3213
+ /** Format: double */
3214
+ ask_liquidity_usd?: number | null;
3215
+ /** Format: int32 */
3216
+ bid_levels?: number | null;
3217
+ /** Format: int32 */
3218
+ ask_levels?: number | null;
3219
+ };
3220
+ };
2994
3221
  };
2995
3222
  /** @description Missing or invalid parameters */
2996
3223
  400: {
@@ -3043,7 +3270,33 @@ export interface operations {
3043
3270
  headers: {
3044
3271
  [name: string]: unknown;
3045
3272
  };
3046
- content?: never;
3273
+ content: {
3274
+ "application/json": {
3275
+ /** Format: int64 */
3276
+ ts: number;
3277
+ position_id: string;
3278
+ condition_id: string;
3279
+ bids: components["schemas"]["OrderbookLevel"][];
3280
+ asks: components["schemas"]["OrderbookLevel"][];
3281
+ hash: string;
3282
+ /** Format: double */
3283
+ best_bid?: number | null;
3284
+ /** Format: double */
3285
+ best_ask?: number | null;
3286
+ /** Format: double */
3287
+ mid_price?: number | null;
3288
+ /** Format: double */
3289
+ spread?: number | null;
3290
+ /** Format: double */
3291
+ bid_liquidity_usd?: number | null;
3292
+ /** Format: double */
3293
+ ask_liquidity_usd?: number | null;
3294
+ /** Format: int32 */
3295
+ bid_levels?: number | null;
3296
+ /** Format: int32 */
3297
+ ask_levels?: number | null;
3298
+ }[];
3299
+ };
3047
3300
  };
3048
3301
  /** @description Missing or invalid parameters */
3049
3302
  400: {
@@ -3073,7 +3326,33 @@ export interface operations {
3073
3326
  headers: {
3074
3327
  [name: string]: unknown;
3075
3328
  };
3076
- content?: never;
3329
+ content: {
3330
+ "application/json": {
3331
+ /** Format: int64 */
3332
+ ts: number;
3333
+ position_id: string;
3334
+ condition_id: string;
3335
+ bids: components["schemas"]["OrderbookLevel"][];
3336
+ asks: components["schemas"]["OrderbookLevel"][];
3337
+ hash: string;
3338
+ /** Format: double */
3339
+ best_bid?: number | null;
3340
+ /** Format: double */
3341
+ best_ask?: number | null;
3342
+ /** Format: double */
3343
+ mid_price?: number | null;
3344
+ /** Format: double */
3345
+ spread?: number | null;
3346
+ /** Format: double */
3347
+ bid_liquidity_usd?: number | null;
3348
+ /** Format: double */
3349
+ ask_liquidity_usd?: number | null;
3350
+ /** Format: int32 */
3351
+ bid_levels?: number | null;
3352
+ /** Format: int32 */
3353
+ ask_levels?: number | null;
3354
+ }[];
3355
+ };
3077
3356
  };
3078
3357
  /** @description Missing or invalid parameters */
3079
3358
  400: {
@@ -3126,7 +3405,30 @@ export interface operations {
3126
3405
  headers: {
3127
3406
  [name: string]: unknown;
3128
3407
  };
3129
- content?: never;
3408
+ content: {
3409
+ "application/json": {
3410
+ /** Format: int64 */
3411
+ ts: number;
3412
+ position_id: string;
3413
+ condition_id: string;
3414
+ /** Format: double */
3415
+ best_bid?: number | null;
3416
+ /** Format: double */
3417
+ best_ask?: number | null;
3418
+ /** Format: double */
3419
+ mid_price?: number | null;
3420
+ /** Format: double */
3421
+ spread?: number | null;
3422
+ /** Format: double */
3423
+ bid_liquidity_usd?: number | null;
3424
+ /** Format: double */
3425
+ ask_liquidity_usd?: number | null;
3426
+ /** Format: int32 */
3427
+ bid_levels?: number | null;
3428
+ /** Format: int32 */
3429
+ ask_levels?: number | null;
3430
+ }[];
3431
+ };
3130
3432
  };
3131
3433
  /** @description Missing or invalid parameters */
3132
3434
  400: {
@@ -81,6 +81,11 @@ export type PositionChartDataPoint = Schemas["PositionChartDataPoint"];
81
81
  export type TradeType = Schemas["TradeType"];
82
82
  export type WebhookAssetSymbol = Schemas["WebhookAssetSymbol"];
83
83
  export type WebhookTimeframe = Schemas["WebhookTimeframe"];
84
+ export type ConditionOrderbookRow = Schemas["ConditionOrderbookRow"];
85
+ export type OrderbookHistoryRow = Schemas["OrderbookHistoryRow"];
86
+ export type OrderbookLevel = Schemas["OrderbookLevel"];
87
+ export type OrderbookSnapshotRow = Schemas["OrderbookSnapshotRow"];
88
+ export type SpreadRow = Schemas["SpreadRow"];
84
89
  export type Series = Schemas["PolymarketSeries"];
85
90
  export type Trade = Schemas["PredictionTradeResponse"];
86
91
  export type Candlestick = Schemas["PredictionCandlestickBar"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structbuild/sdk",
3
- "version": "0.1.25",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",