@structbuild/sdk 0.1.2 → 0.1.3
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.
- package/dist/generated/polymarket.d.ts +149 -148
- package/package.json +1 -1
|
@@ -3,26 +3,6 @@
|
|
|
3
3
|
* Do not make direct changes to the file.
|
|
4
4
|
*/
|
|
5
5
|
export interface paths {
|
|
6
|
-
"/polymarket/bonds": {
|
|
7
|
-
parameters: {
|
|
8
|
-
query?: never;
|
|
9
|
-
header?: never;
|
|
10
|
-
path?: never;
|
|
11
|
-
cookie?: never;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Get bonds
|
|
15
|
-
* @description Retrieve a list of bond markets sorted by yield, filtered by probability and time to expiry
|
|
16
|
-
*/
|
|
17
|
-
get: operations["get_bonds"];
|
|
18
|
-
put?: never;
|
|
19
|
-
post?: never;
|
|
20
|
-
delete?: never;
|
|
21
|
-
options?: never;
|
|
22
|
-
head?: never;
|
|
23
|
-
patch?: never;
|
|
24
|
-
trace?: never;
|
|
25
|
-
};
|
|
26
6
|
"/polymarket/events": {
|
|
27
7
|
parameters: {
|
|
28
8
|
query?: never;
|
|
@@ -192,7 +172,7 @@ export interface paths {
|
|
|
192
172
|
};
|
|
193
173
|
/**
|
|
194
174
|
* Get markets
|
|
195
|
-
* @description Retrieve a list of markets with
|
|
175
|
+
* @description Retrieve a paginated list of markets with filtering, sorting, and optional nested tags/events/metrics
|
|
196
176
|
*/
|
|
197
177
|
get: operations["list_markets"];
|
|
198
178
|
put?: never;
|
|
@@ -203,6 +183,26 @@ export interface paths {
|
|
|
203
183
|
patch?: never;
|
|
204
184
|
trace?: never;
|
|
205
185
|
};
|
|
186
|
+
"/polymarket/market/bonds": {
|
|
187
|
+
parameters: {
|
|
188
|
+
query?: never;
|
|
189
|
+
header?: never;
|
|
190
|
+
path?: never;
|
|
191
|
+
cookie?: never;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Get bonds
|
|
195
|
+
* @description Retrieve a list of bond markets sorted by yield, filtered by probability and time to expiry
|
|
196
|
+
*/
|
|
197
|
+
get: operations["get_bonds"];
|
|
198
|
+
put?: never;
|
|
199
|
+
post?: never;
|
|
200
|
+
delete?: never;
|
|
201
|
+
options?: never;
|
|
202
|
+
head?: never;
|
|
203
|
+
patch?: never;
|
|
204
|
+
trace?: never;
|
|
205
|
+
};
|
|
206
206
|
"/polymarket/market/candlestick": {
|
|
207
207
|
parameters: {
|
|
208
208
|
query?: never;
|
|
@@ -303,26 +303,6 @@ export interface paths {
|
|
|
303
303
|
patch?: never;
|
|
304
304
|
trace?: never;
|
|
305
305
|
};
|
|
306
|
-
"/polymarket/market/slug/{slug}": {
|
|
307
|
-
parameters: {
|
|
308
|
-
query?: never;
|
|
309
|
-
header?: never;
|
|
310
|
-
path?: never;
|
|
311
|
-
cookie?: never;
|
|
312
|
-
};
|
|
313
|
-
/**
|
|
314
|
-
* Get market by slug
|
|
315
|
-
* @description Retrieve detailed market information by its slug
|
|
316
|
-
*/
|
|
317
|
-
get: operations["get_market_by_slug"];
|
|
318
|
-
put?: never;
|
|
319
|
-
post?: never;
|
|
320
|
-
delete?: never;
|
|
321
|
-
options?: never;
|
|
322
|
-
head?: never;
|
|
323
|
-
patch?: never;
|
|
324
|
-
trace?: never;
|
|
325
|
-
};
|
|
326
306
|
"/polymarket/market/trades": {
|
|
327
307
|
parameters: {
|
|
328
308
|
query?: never;
|
|
@@ -363,26 +343,6 @@ export interface paths {
|
|
|
363
343
|
patch?: never;
|
|
364
344
|
trace?: never;
|
|
365
345
|
};
|
|
366
|
-
"/polymarket/market/{condition_id}": {
|
|
367
|
-
parameters: {
|
|
368
|
-
query?: never;
|
|
369
|
-
header?: never;
|
|
370
|
-
path?: never;
|
|
371
|
-
cookie?: never;
|
|
372
|
-
};
|
|
373
|
-
/**
|
|
374
|
-
* Get market by condition ID
|
|
375
|
-
* @description Retrieve detailed market information by its condition ID
|
|
376
|
-
*/
|
|
377
|
-
get: operations["get_market"];
|
|
378
|
-
put?: never;
|
|
379
|
-
post?: never;
|
|
380
|
-
delete?: never;
|
|
381
|
-
options?: never;
|
|
382
|
-
head?: never;
|
|
383
|
-
patch?: never;
|
|
384
|
-
trace?: never;
|
|
385
|
-
};
|
|
386
346
|
"/polymarket/search": {
|
|
387
347
|
parameters: {
|
|
388
348
|
query?: never;
|
|
@@ -771,7 +731,7 @@ export interface components {
|
|
|
771
731
|
/** Format: int32 */
|
|
772
732
|
index: number;
|
|
773
733
|
/** Format: double */
|
|
774
|
-
|
|
734
|
+
price: number;
|
|
775
735
|
position_id: string;
|
|
776
736
|
};
|
|
777
737
|
/** @enum {string} */
|
|
@@ -927,7 +887,7 @@ export interface components {
|
|
|
927
887
|
/** @enum {string} */
|
|
928
888
|
EventPnlSortBy: "realized_pnl_usd" | "total_volume_usd" | "markets_traded" | "total_fees";
|
|
929
889
|
/** @enum {string} */
|
|
930
|
-
EventSortBy: "volume" | "txns" | "unique_traders" | "
|
|
890
|
+
EventSortBy: "volume" | "txns" | "unique_traders" | "title" | "creation_date" | "start_date" | "end_date" | "relevance";
|
|
931
891
|
/** @enum {string} */
|
|
932
892
|
GlobalPnlSortBy: "pnl_usd" | "win_rate" | "wins" | "losses" | "buys" | "sells" | "redemptions" | "merges" | "avg_hold_time" | "positions_traded" | "markets_traded" | "events_traded" | "markets_won" | "volume_usd" | "fees";
|
|
933
893
|
/** @description Individual trader entry in the global PnL leaderboard */
|
|
@@ -1061,6 +1021,8 @@ export interface components {
|
|
|
1061
1021
|
description: string;
|
|
1062
1022
|
slug: string;
|
|
1063
1023
|
event_slug?: string | null;
|
|
1024
|
+
event_id?: string | null;
|
|
1025
|
+
event_title?: string | null;
|
|
1064
1026
|
neg_risk: boolean;
|
|
1065
1027
|
tokens: components["schemas"]["TokenOutcome"][];
|
|
1066
1028
|
image_url?: string | null;
|
|
@@ -1107,6 +1069,10 @@ export interface components {
|
|
|
1107
1069
|
};
|
|
1108
1070
|
/** @enum {string} */
|
|
1109
1071
|
MarketPnlSortBy: "realized_pnl_usd" | "buy_usd" | "total_buys" | "total_fees" | "outcomes_traded";
|
|
1072
|
+
/** @enum {string} */
|
|
1073
|
+
MarketSortBy: "volume" | "txns" | "unique_traders" | "liquidity" | "holders" | "end_date" | "created_at" | "relevance";
|
|
1074
|
+
/** @enum {string} */
|
|
1075
|
+
MarketStatus: "open" | "closed";
|
|
1110
1076
|
MarketVolumeChartResponse: {
|
|
1111
1077
|
volumes: components["schemas"]["MarketVolumeDataPoint"][];
|
|
1112
1078
|
has_more: boolean;
|
|
@@ -1278,6 +1244,11 @@ export interface components {
|
|
|
1278
1244
|
neg_risk_market_id: string | null;
|
|
1279
1245
|
/** @default null */
|
|
1280
1246
|
game_status: string | null;
|
|
1247
|
+
/**
|
|
1248
|
+
* @description Event status: "open" or "closed"
|
|
1249
|
+
* @default null
|
|
1250
|
+
*/
|
|
1251
|
+
status: string | null;
|
|
1281
1252
|
/** @default {} */
|
|
1282
1253
|
metrics: {
|
|
1283
1254
|
[key: string]: components["schemas"]["SimpleTimeframeMetrics"];
|
|
@@ -1642,45 +1613,16 @@ export interface components {
|
|
|
1642
1613
|
}
|
|
1643
1614
|
export type $defs = Record<string, never>;
|
|
1644
1615
|
export interface operations {
|
|
1645
|
-
get_bonds: {
|
|
1646
|
-
parameters: {
|
|
1647
|
-
query?: {
|
|
1648
|
-
/** @description Minimum probability threshold (default: 0.85) */
|
|
1649
|
-
min_probability?: number;
|
|
1650
|
-
/** @description Maximum hours until market end */
|
|
1651
|
-
max_hours?: number;
|
|
1652
|
-
/** @description Number of results (default: 10, max: 200) */
|
|
1653
|
-
limit?: number;
|
|
1654
|
-
/** @description Cursor for pagination: end_date (unix epoch) of the last item from the previous page */
|
|
1655
|
-
pagination_key?: number;
|
|
1656
|
-
};
|
|
1657
|
-
header?: never;
|
|
1658
|
-
path?: never;
|
|
1659
|
-
cookie?: never;
|
|
1660
|
-
};
|
|
1661
|
-
requestBody?: never;
|
|
1662
|
-
responses: {
|
|
1663
|
-
/** @description List of bond markets sorted by yield */
|
|
1664
|
-
200: {
|
|
1665
|
-
headers: {
|
|
1666
|
-
[name: string]: unknown;
|
|
1667
|
-
};
|
|
1668
|
-
content: {
|
|
1669
|
-
"application/json": components["schemas"]["BondMarket"][];
|
|
1670
|
-
};
|
|
1671
|
-
};
|
|
1672
|
-
};
|
|
1673
|
-
};
|
|
1674
1616
|
get_events: {
|
|
1675
1617
|
parameters: {
|
|
1676
1618
|
query?: {
|
|
1677
|
-
/** @description
|
|
1619
|
+
/** @description Filter by event ID(s) - comma-separated (max 50). Cannot be used with 'slug'. Example: id=99600,99601,99583 */
|
|
1678
1620
|
id?: string;
|
|
1679
|
-
/** @description
|
|
1680
|
-
|
|
1681
|
-
/** @description Search
|
|
1621
|
+
/** @description Filter by event slug(s) - comma-separated (max 50). Cannot be used with 'id'. Example: slug=will-trump-win,bitcoin-100k */
|
|
1622
|
+
slug?: string;
|
|
1623
|
+
/** @description Search in title and description (3-100 characters). Example: search=trump */
|
|
1682
1624
|
search?: string;
|
|
1683
|
-
/** @description Sort: volume, txns, unique_traders,
|
|
1625
|
+
/** @description Sort: volume, txns, unique_traders, title, creation_date, start_date, end_date, relevance (relevance only works in search mode) */
|
|
1684
1626
|
sort_by?: components["schemas"]["EventSortBy"];
|
|
1685
1627
|
/** @description Sort direction: asc, desc */
|
|
1686
1628
|
sort_dir?: components["schemas"]["SortDirection"];
|
|
@@ -1692,7 +1634,7 @@ export interface operations {
|
|
|
1692
1634
|
categories?: string;
|
|
1693
1635
|
/** @description Comma-separated categories to exclude */
|
|
1694
1636
|
exclude_categories?: string;
|
|
1695
|
-
/** @description Filter by tag slug(s)
|
|
1637
|
+
/** @description Filter by tag slug(s) - comma-separated (max 50). Example: tags=sports,football,crypto */
|
|
1696
1638
|
tags?: string;
|
|
1697
1639
|
/** @description Comma-separated tag slugs to exclude */
|
|
1698
1640
|
exclude_tags?: string;
|
|
@@ -1716,7 +1658,7 @@ export interface operations {
|
|
|
1716
1658
|
include_metrics?: boolean;
|
|
1717
1659
|
/** @description Results limit (default: 10, max: 100) */
|
|
1718
1660
|
limit?: number;
|
|
1719
|
-
/** @description
|
|
1661
|
+
/** @description Cursor-based pagination key */
|
|
1720
1662
|
pagination_key?: string;
|
|
1721
1663
|
};
|
|
1722
1664
|
header?: never;
|
|
@@ -1734,6 +1676,13 @@ export interface operations {
|
|
|
1734
1676
|
"application/json": components["schemas"]["PolymarketEvent"][];
|
|
1735
1677
|
};
|
|
1736
1678
|
};
|
|
1679
|
+
/** @description Bad request - validation error (search length, array limits, conflicting params) */
|
|
1680
|
+
400: {
|
|
1681
|
+
headers: {
|
|
1682
|
+
[name: string]: unknown;
|
|
1683
|
+
};
|
|
1684
|
+
content?: never;
|
|
1685
|
+
};
|
|
1737
1686
|
};
|
|
1738
1687
|
};
|
|
1739
1688
|
get_event_metrics: {
|
|
@@ -2004,14 +1953,72 @@ export interface operations {
|
|
|
2004
1953
|
list_markets: {
|
|
2005
1954
|
parameters: {
|
|
2006
1955
|
query?: {
|
|
2007
|
-
/** @description
|
|
1956
|
+
/** @description Filter by condition ID(s) - comma-separated (max 50) */
|
|
2008
1957
|
condition_ids?: string;
|
|
2009
|
-
/** @description
|
|
2010
|
-
|
|
2011
|
-
/** @description
|
|
1958
|
+
/** @description Filter by question ID(s) - comma-separated (max 50) */
|
|
1959
|
+
question_ids?: string;
|
|
1960
|
+
/** @description Filter by market ID(s) - comma-separated (max 50) */
|
|
1961
|
+
market_ids?: string;
|
|
1962
|
+
/** @description Filter by market slug(s) - comma-separated (max 50) */
|
|
1963
|
+
market_slugs?: string;
|
|
1964
|
+
/** @description Filter by event slug(s) - comma-separated (max 50) */
|
|
1965
|
+
event_slugs?: string;
|
|
1966
|
+
/** @description Filter by position ID(s) - comma-separated (max 50), resolved via market_outcomes table */
|
|
1967
|
+
position_ids?: string;
|
|
1968
|
+
/** @description Search in title and description (3-100 characters) */
|
|
1969
|
+
search?: string;
|
|
1970
|
+
/** @description Filter by status: open or closed */
|
|
1971
|
+
status?: components["schemas"]["MarketStatus"];
|
|
1972
|
+
/** @description Sort: volume, txns, unique_traders, liquidity, holders, end_date, created_at, relevance */
|
|
1973
|
+
sort_by?: components["schemas"]["MarketSortBy"];
|
|
1974
|
+
/** @description Sort direction: asc, desc (default: desc) */
|
|
1975
|
+
sort_dir?: components["schemas"]["SortDirection"];
|
|
1976
|
+
/** @description Metrics timeframe: 1m, 5m, 30m, 1h, 6h, 24h, 7d, 30d (default: 24h) */
|
|
1977
|
+
timeframe?: components["schemas"]["MetricsTimeframe"];
|
|
1978
|
+
/** @description Minimum total volume USD */
|
|
1979
|
+
min_volume?: number;
|
|
1980
|
+
/** @description Maximum total volume USD */
|
|
1981
|
+
max_volume?: number;
|
|
1982
|
+
/** @description Minimum liquidity USD */
|
|
1983
|
+
min_liquidity?: number;
|
|
1984
|
+
/** @description Maximum liquidity USD */
|
|
1985
|
+
max_liquidity?: number;
|
|
1986
|
+
/** @description Minimum transactions in selected timeframe */
|
|
1987
|
+
min_txns?: number;
|
|
1988
|
+
/** @description Maximum transactions in selected timeframe */
|
|
1989
|
+
max_txns?: number;
|
|
1990
|
+
/** @description Minimum unique traders in selected timeframe */
|
|
1991
|
+
min_unique_traders?: number;
|
|
1992
|
+
/** @description Maximum unique traders in selected timeframe */
|
|
1993
|
+
max_unique_traders?: number;
|
|
1994
|
+
/** @description Minimum total holders */
|
|
1995
|
+
min_holders?: number;
|
|
1996
|
+
/** @description Maximum total holders */
|
|
1997
|
+
max_holders?: number;
|
|
1998
|
+
/** @description Comma-separated category filters (max 50) */
|
|
1999
|
+
categories?: string;
|
|
2000
|
+
/** @description Comma-separated categories to exclude */
|
|
2001
|
+
exclude_categories?: string;
|
|
2002
|
+
/** @description Filter by tag(s) - comma-separated (max 50) */
|
|
2003
|
+
tags?: string;
|
|
2004
|
+
/** @description Comma-separated tags to exclude */
|
|
2005
|
+
exclude_tags?: string;
|
|
2006
|
+
/** @description Filter markets with end_date >= start_time (Unix timestamp) */
|
|
2007
|
+
start_time?: number;
|
|
2008
|
+
/** @description Filter markets with end_date <= end_time (Unix timestamp) */
|
|
2009
|
+
end_time?: number;
|
|
2010
|
+
/** @description Include tags array (default: true) */
|
|
2011
|
+
include_tags?: boolean;
|
|
2012
|
+
/** @description Include event object (default: true) */
|
|
2013
|
+
include_event?: boolean;
|
|
2014
|
+
/** @description Include all timeframe metrics (default: true) */
|
|
2015
|
+
include_metrics?: boolean;
|
|
2016
|
+
/** @description Results limit (default: 50, max: 100) */
|
|
2012
2017
|
limit?: number;
|
|
2013
|
-
/** @description Cursor for pagination
|
|
2014
|
-
|
|
2018
|
+
/** @description Cursor value for pagination (sort column value) */
|
|
2019
|
+
cursor_value?: string;
|
|
2020
|
+
/** @description Cursor ID for pagination (condition_id) */
|
|
2021
|
+
cursor_id?: string;
|
|
2015
2022
|
};
|
|
2016
2023
|
header?: never;
|
|
2017
2024
|
path?: never;
|
|
@@ -2019,13 +2026,49 @@ export interface operations {
|
|
|
2019
2026
|
};
|
|
2020
2027
|
requestBody?: never;
|
|
2021
2028
|
responses: {
|
|
2022
|
-
/** @description List of markets with metadata */
|
|
2029
|
+
/** @description List of markets with metadata, outcomes, tags, event, and metrics */
|
|
2023
2030
|
200: {
|
|
2024
2031
|
headers: {
|
|
2025
2032
|
[name: string]: unknown;
|
|
2026
2033
|
};
|
|
2027
2034
|
content?: never;
|
|
2028
2035
|
};
|
|
2036
|
+
/** @description Bad request - validation error (search length, array limits, conflicting params) */
|
|
2037
|
+
400: {
|
|
2038
|
+
headers: {
|
|
2039
|
+
[name: string]: unknown;
|
|
2040
|
+
};
|
|
2041
|
+
content?: never;
|
|
2042
|
+
};
|
|
2043
|
+
};
|
|
2044
|
+
};
|
|
2045
|
+
get_bonds: {
|
|
2046
|
+
parameters: {
|
|
2047
|
+
query?: {
|
|
2048
|
+
/** @description Minimum probability threshold (default: 0.85) */
|
|
2049
|
+
min_probability?: number;
|
|
2050
|
+
/** @description Maximum hours until market end */
|
|
2051
|
+
max_hours?: number;
|
|
2052
|
+
/** @description Number of results (default: 10, max: 200) */
|
|
2053
|
+
limit?: number;
|
|
2054
|
+
/** @description Cursor for pagination: end_date (unix epoch) of the last item from the previous page */
|
|
2055
|
+
pagination_key?: number;
|
|
2056
|
+
};
|
|
2057
|
+
header?: never;
|
|
2058
|
+
path?: never;
|
|
2059
|
+
cookie?: never;
|
|
2060
|
+
};
|
|
2061
|
+
requestBody?: never;
|
|
2062
|
+
responses: {
|
|
2063
|
+
/** @description List of bond markets sorted by yield */
|
|
2064
|
+
200: {
|
|
2065
|
+
headers: {
|
|
2066
|
+
[name: string]: unknown;
|
|
2067
|
+
};
|
|
2068
|
+
content: {
|
|
2069
|
+
"application/json": components["schemas"]["BondMarket"][];
|
|
2070
|
+
};
|
|
2071
|
+
};
|
|
2029
2072
|
};
|
|
2030
2073
|
};
|
|
2031
2074
|
get_market_candlestick: {
|
|
@@ -2199,27 +2242,6 @@ export interface operations {
|
|
|
2199
2242
|
};
|
|
2200
2243
|
};
|
|
2201
2244
|
};
|
|
2202
|
-
get_market_by_slug: {
|
|
2203
|
-
parameters: {
|
|
2204
|
-
query?: never;
|
|
2205
|
-
header?: never;
|
|
2206
|
-
path: {
|
|
2207
|
-
/** @description Market slug */
|
|
2208
|
-
slug: string;
|
|
2209
|
-
};
|
|
2210
|
-
cookie?: never;
|
|
2211
|
-
};
|
|
2212
|
-
requestBody?: never;
|
|
2213
|
-
responses: {
|
|
2214
|
-
/** @description Market details by slug */
|
|
2215
|
-
200: {
|
|
2216
|
-
headers: {
|
|
2217
|
-
[name: string]: unknown;
|
|
2218
|
-
};
|
|
2219
|
-
content?: never;
|
|
2220
|
-
};
|
|
2221
|
-
};
|
|
2222
|
-
};
|
|
2223
2245
|
get_market_trades: {
|
|
2224
2246
|
parameters: {
|
|
2225
2247
|
query?: {
|
|
@@ -2312,27 +2334,6 @@ export interface operations {
|
|
|
2312
2334
|
};
|
|
2313
2335
|
};
|
|
2314
2336
|
};
|
|
2315
|
-
get_market: {
|
|
2316
|
-
parameters: {
|
|
2317
|
-
query?: never;
|
|
2318
|
-
header?: never;
|
|
2319
|
-
path: {
|
|
2320
|
-
/** @description Market condition ID */
|
|
2321
|
-
condition_id: string;
|
|
2322
|
-
};
|
|
2323
|
-
cookie?: never;
|
|
2324
|
-
};
|
|
2325
|
-
requestBody?: never;
|
|
2326
|
-
responses: {
|
|
2327
|
-
/** @description Market details by condition ID */
|
|
2328
|
-
200: {
|
|
2329
|
-
headers: {
|
|
2330
|
-
[name: string]: unknown;
|
|
2331
|
-
};
|
|
2332
|
-
content?: never;
|
|
2333
|
-
};
|
|
2334
|
-
};
|
|
2335
|
-
};
|
|
2336
2337
|
search: {
|
|
2337
2338
|
parameters: {
|
|
2338
2339
|
query: {
|