@structbuild/sdk 0.1.19 → 0.1.21
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/README.md +1 -2
- package/dist/generated/polymarket.d.ts +78 -152
- package/dist/generated/webhooks.d.ts +398 -52
- package/dist/index.cjs +1 -9
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +1 -9
- package/dist/index.js.map +3 -3
- package/dist/namespaces/series.d.ts +1 -3
- package/dist/types/index.d.ts +7 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,8 +89,7 @@ const history = await client.holders.getMarketHoldersHistory({ condition_id: "0x
|
|
|
89
89
|
|
|
90
90
|
```typescript
|
|
91
91
|
const series = await client.series.getSeriesList();
|
|
92
|
-
const
|
|
93
|
-
const seriesEvents = await client.series.getSeriesEvents({ identifier: "my-series" });
|
|
92
|
+
const outcomes = await client.series.getSeriesOutcomes({ series_slug: "my-series" });
|
|
94
93
|
```
|
|
95
94
|
|
|
96
95
|
### Search, Tags, Bonds
|
|
@@ -491,8 +491,14 @@ export interface paths {
|
|
|
491
491
|
cookie?: never;
|
|
492
492
|
};
|
|
493
493
|
/**
|
|
494
|
-
* Search events
|
|
495
|
-
* @description Search across events and traders
|
|
494
|
+
* Search events, markets, and traders
|
|
495
|
+
* @description Search across events, markets, and traders simultaneously.
|
|
496
|
+
*
|
|
497
|
+
* All three categories are queried in parallel. Each has independent cursor-based pagination via its own `*_pagination_key`.
|
|
498
|
+
*
|
|
499
|
+
* **Trader search** matches by wallet address (exact, `0x...` 42 chars) or by display name / pseudonym (ILIKE).
|
|
500
|
+
*
|
|
501
|
+
* **sort_by / timeframe** apply to events and markets. Some sort fields only apply to one category (e.g. `liquidity` and `holders` are markets-only; `title`, `creation_date`, `start_date`, `end_date` are events-only) — unrecognised fields fall back to `volume`.
|
|
496
502
|
*/
|
|
497
503
|
get: operations["search"];
|
|
498
504
|
put?: never;
|
|
@@ -511,8 +517,8 @@ export interface paths {
|
|
|
511
517
|
cookie?: never;
|
|
512
518
|
};
|
|
513
519
|
/**
|
|
514
|
-
*
|
|
515
|
-
* @description Retrieve
|
|
520
|
+
* List or get series
|
|
521
|
+
* @description Retrieve series. Use `id` or `series_slug` for single lookup, `series_ids` or `series_slugs` (comma-separated, max 250, mutually exclusive) for multi-lookup, or paginate with `active_only`.
|
|
516
522
|
*/
|
|
517
523
|
get: operations["get_series_list"];
|
|
518
524
|
put?: never;
|
|
@@ -543,46 +549,6 @@ export interface paths {
|
|
|
543
549
|
patch?: never;
|
|
544
550
|
trace?: never;
|
|
545
551
|
};
|
|
546
|
-
"/polymarket/series/{identifier}": {
|
|
547
|
-
parameters: {
|
|
548
|
-
query?: never;
|
|
549
|
-
header?: never;
|
|
550
|
-
path?: never;
|
|
551
|
-
cookie?: never;
|
|
552
|
-
};
|
|
553
|
-
/**
|
|
554
|
-
* Get series by ID
|
|
555
|
-
* @description Retrieve a single series by its ID or slug
|
|
556
|
-
*/
|
|
557
|
-
get: operations["get_series_by_id"];
|
|
558
|
-
put?: never;
|
|
559
|
-
post?: never;
|
|
560
|
-
delete?: never;
|
|
561
|
-
options?: never;
|
|
562
|
-
head?: never;
|
|
563
|
-
patch?: never;
|
|
564
|
-
trace?: never;
|
|
565
|
-
};
|
|
566
|
-
"/polymarket/series/{identifier}/events": {
|
|
567
|
-
parameters: {
|
|
568
|
-
query?: never;
|
|
569
|
-
header?: never;
|
|
570
|
-
path?: never;
|
|
571
|
-
cookie?: never;
|
|
572
|
-
};
|
|
573
|
-
/**
|
|
574
|
-
* Get events from series
|
|
575
|
-
* @description Retrieve all events belonging to a specific series
|
|
576
|
-
*/
|
|
577
|
-
get: operations["get_series_events"];
|
|
578
|
-
put?: never;
|
|
579
|
-
post?: never;
|
|
580
|
-
delete?: never;
|
|
581
|
-
options?: never;
|
|
582
|
-
head?: never;
|
|
583
|
-
patch?: never;
|
|
584
|
-
trace?: never;
|
|
585
|
-
};
|
|
586
552
|
"/polymarket/tags": {
|
|
587
553
|
parameters: {
|
|
588
554
|
query?: never;
|
|
@@ -1177,16 +1143,22 @@ export interface components {
|
|
|
1177
1143
|
[key: string]: components["schemas"]["OutcomeTimeframeMetrics"];
|
|
1178
1144
|
};
|
|
1179
1145
|
};
|
|
1180
|
-
/** @description
|
|
1146
|
+
/** @description Outcome for market API responses */
|
|
1181
1147
|
MarketOutcome: {
|
|
1182
|
-
/**
|
|
1183
|
-
index: number;
|
|
1148
|
+
/** @default */
|
|
1184
1149
|
name: string;
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1150
|
+
/**
|
|
1151
|
+
* Format: double
|
|
1152
|
+
* @default null
|
|
1153
|
+
*/
|
|
1154
|
+
price: number | null;
|
|
1155
|
+
/** @default null */
|
|
1156
|
+
position_id: string | null;
|
|
1157
|
+
/**
|
|
1158
|
+
* Format: int32
|
|
1159
|
+
* @default null
|
|
1160
|
+
*/
|
|
1161
|
+
outcome_index: number | null;
|
|
1190
1162
|
};
|
|
1191
1163
|
/** @enum {string} */
|
|
1192
1164
|
MarketPnlSortBy: "realized_pnl_usd" | "buy_usd" | "total_buys" | "total_fees" | "outcomes_traded";
|
|
@@ -1383,6 +1355,13 @@ export interface components {
|
|
|
1383
1355
|
*/
|
|
1384
1356
|
price_change_percent: number | null;
|
|
1385
1357
|
};
|
|
1358
|
+
/** @description Pagination metadata to include in API responses */
|
|
1359
|
+
PaginationMeta: {
|
|
1360
|
+
/** @description Whether there are more results available */
|
|
1361
|
+
has_more: boolean;
|
|
1362
|
+
/** @description Pagination key for the next page (if has_more is true) */
|
|
1363
|
+
pagination_key?: string | null;
|
|
1364
|
+
};
|
|
1386
1365
|
/** @description A single PnL candle entry */
|
|
1387
1366
|
PnlCandleEntry: {
|
|
1388
1367
|
/**
|
|
@@ -1731,27 +1710,17 @@ export interface components {
|
|
|
1731
1710
|
};
|
|
1732
1711
|
SearchResponse: {
|
|
1733
1712
|
events: unknown;
|
|
1713
|
+
events_pagination: components["schemas"]["PaginationMeta"];
|
|
1714
|
+
markets: components["schemas"]["MarketResponse"][];
|
|
1715
|
+
markets_pagination: components["schemas"]["PaginationMeta"];
|
|
1734
1716
|
traders: components["schemas"]["Trader"][];
|
|
1717
|
+
traders_pagination: components["schemas"]["PaginationMeta"];
|
|
1735
1718
|
};
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
description?: string | null;
|
|
1742
|
-
series_type?: string | null;
|
|
1743
|
-
recurrence?: string | null;
|
|
1744
|
-
image_url?: string | null;
|
|
1745
|
-
active: boolean;
|
|
1746
|
-
closed: boolean;
|
|
1747
|
-
archived: boolean;
|
|
1748
|
-
featured: boolean;
|
|
1749
|
-
restricted: boolean;
|
|
1750
|
-
pyth_token_id?: string | null;
|
|
1751
|
-
cg_asset_name?: string | null;
|
|
1752
|
-
tags: components["schemas"]["PolymarketTag"][];
|
|
1753
|
-
events: components["schemas"]["PolymarketEvent"][];
|
|
1754
|
-
};
|
|
1719
|
+
/**
|
|
1720
|
+
* @description Combined sort options valid for both events and markets in search
|
|
1721
|
+
* @enum {string}
|
|
1722
|
+
*/
|
|
1723
|
+
SearchSortBy: "volume" | "txns" | "unique_traders" | "relevance" | "title" | "creation_date" | "start_date" | "end_date" | "liquidity" | "holders" | "end_time" | "start_time" | "created_time";
|
|
1755
1724
|
SimpleTimeframeMetrics: {
|
|
1756
1725
|
/**
|
|
1757
1726
|
* Format: double
|
|
@@ -2916,12 +2885,22 @@ export interface operations {
|
|
|
2916
2885
|
search: {
|
|
2917
2886
|
parameters: {
|
|
2918
2887
|
query: {
|
|
2919
|
-
/** @description Search query (min 2 characters) */
|
|
2888
|
+
/** @description Search query (min 2 characters). Prefix with 0x for exact wallet address lookup. */
|
|
2920
2889
|
q: string;
|
|
2921
|
-
/** @description
|
|
2890
|
+
/** @description Sort field applied to both events and markets (default: volume). Fields marked events-only or markets-only fall back to volume on the other category. */
|
|
2891
|
+
sort_by?: components["schemas"]["SearchSortBy"];
|
|
2892
|
+
/** @description Sort direction (default: desc) */
|
|
2893
|
+
sort_dir?: components["schemas"]["SortDirection"];
|
|
2894
|
+
/** @description Metrics timeframe used for volume/txns/unique_traders sort (default: 24h) */
|
|
2895
|
+
timeframe?: components["schemas"]["MetricsTimeframe"];
|
|
2896
|
+
/** @description Results limit per category (default: 10, max: 250) */
|
|
2922
2897
|
limit?: number;
|
|
2923
|
-
/** @description
|
|
2924
|
-
|
|
2898
|
+
/** @description Cursor for the next page of events, obtained from previous response's events_pagination.pagination_key */
|
|
2899
|
+
events_pagination_key?: string;
|
|
2900
|
+
/** @description Cursor for the next page of markets, obtained from previous response's markets_pagination.pagination_key */
|
|
2901
|
+
markets_pagination_key?: string;
|
|
2902
|
+
/** @description Cursor for the next page of traders, obtained from previous response's traders_pagination.pagination_key */
|
|
2903
|
+
traders_pagination_key?: string;
|
|
2925
2904
|
};
|
|
2926
2905
|
header?: never;
|
|
2927
2906
|
path?: never;
|
|
@@ -2929,7 +2908,7 @@ export interface operations {
|
|
|
2929
2908
|
};
|
|
2930
2909
|
requestBody?: never;
|
|
2931
2910
|
responses: {
|
|
2932
|
-
/** @description Search results with events and traders */
|
|
2911
|
+
/** @description Search results with events, markets, and traders */
|
|
2933
2912
|
200: {
|
|
2934
2913
|
headers: {
|
|
2935
2914
|
[name: string]: unknown;
|
|
@@ -2938,14 +2917,27 @@ export interface operations {
|
|
|
2938
2917
|
"application/json": components["schemas"]["SearchResponse"];
|
|
2939
2918
|
};
|
|
2940
2919
|
};
|
|
2920
|
+
/** @description Bad request — q is missing or shorter than 2 characters */
|
|
2921
|
+
400: {
|
|
2922
|
+
headers: {
|
|
2923
|
+
[name: string]: unknown;
|
|
2924
|
+
};
|
|
2925
|
+
content?: never;
|
|
2926
|
+
};
|
|
2941
2927
|
};
|
|
2942
2928
|
};
|
|
2943
2929
|
get_series_list: {
|
|
2944
2930
|
parameters: {
|
|
2945
2931
|
query?: {
|
|
2946
|
-
/** @description
|
|
2932
|
+
/** @description Single series ID for direct lookup */
|
|
2933
|
+
id?: string;
|
|
2934
|
+
/** @description Comma-separated series IDs (max 250). Mutually exclusive with series_slugs. */
|
|
2935
|
+
series_ids?: string;
|
|
2936
|
+
/** @description Comma-separated series slugs (max 250). Mutually exclusive with series_ids. */
|
|
2937
|
+
series_slugs?: string;
|
|
2938
|
+
/** @description Only active series (default: true). Ignored when series_ids or series_slugs are provided. */
|
|
2947
2939
|
active_only?: boolean;
|
|
2948
|
-
/** @description Results limit (default: 10) */
|
|
2940
|
+
/** @description Results limit (default: 10, max: 250) */
|
|
2949
2941
|
limit?: number;
|
|
2950
2942
|
/** @description Cursor for pagination: id of the last series from the previous page */
|
|
2951
2943
|
pagination_key?: string;
|
|
@@ -2956,7 +2948,7 @@ export interface operations {
|
|
|
2956
2948
|
};
|
|
2957
2949
|
requestBody?: never;
|
|
2958
2950
|
responses: {
|
|
2959
|
-
/** @description
|
|
2951
|
+
/** @description Series or list of series */
|
|
2960
2952
|
200: {
|
|
2961
2953
|
headers: {
|
|
2962
2954
|
[name: string]: unknown;
|
|
@@ -2965,6 +2957,13 @@ export interface operations {
|
|
|
2965
2957
|
"application/json": components["schemas"]["PolymarketSeries"][];
|
|
2966
2958
|
};
|
|
2967
2959
|
};
|
|
2960
|
+
/** @description series_ids and series_slugs cannot both be provided */
|
|
2961
|
+
400: {
|
|
2962
|
+
headers: {
|
|
2963
|
+
[name: string]: unknown;
|
|
2964
|
+
};
|
|
2965
|
+
content?: never;
|
|
2966
|
+
};
|
|
2968
2967
|
};
|
|
2969
2968
|
};
|
|
2970
2969
|
get_series_outcomes: {
|
|
@@ -2999,79 +2998,6 @@ export interface operations {
|
|
|
2999
2998
|
};
|
|
3000
2999
|
};
|
|
3001
3000
|
};
|
|
3002
|
-
get_series_by_id: {
|
|
3003
|
-
parameters: {
|
|
3004
|
-
query?: {
|
|
3005
|
-
/** @description Return minimal data without events (default: false) */
|
|
3006
|
-
slim?: boolean;
|
|
3007
|
-
/** @description Events to include (default: 20, max: 100) */
|
|
3008
|
-
event_limit?: number;
|
|
3009
|
-
/** @description Event pagination offset */
|
|
3010
|
-
event_offset?: number;
|
|
3011
|
-
};
|
|
3012
|
-
header?: never;
|
|
3013
|
-
path: {
|
|
3014
|
-
/** @description Series slug or ID */
|
|
3015
|
-
identifier: string;
|
|
3016
|
-
};
|
|
3017
|
-
cookie?: never;
|
|
3018
|
-
};
|
|
3019
|
-
requestBody?: never;
|
|
3020
|
-
responses: {
|
|
3021
|
-
/** @description Series details with events and tags */
|
|
3022
|
-
200: {
|
|
3023
|
-
headers: {
|
|
3024
|
-
[name: string]: unknown;
|
|
3025
|
-
};
|
|
3026
|
-
content: {
|
|
3027
|
-
"application/json": components["schemas"]["SeriesFullResponse"];
|
|
3028
|
-
};
|
|
3029
|
-
};
|
|
3030
|
-
/** @description Series not found */
|
|
3031
|
-
404: {
|
|
3032
|
-
headers: {
|
|
3033
|
-
[name: string]: unknown;
|
|
3034
|
-
};
|
|
3035
|
-
content?: never;
|
|
3036
|
-
};
|
|
3037
|
-
};
|
|
3038
|
-
};
|
|
3039
|
-
get_series_events: {
|
|
3040
|
-
parameters: {
|
|
3041
|
-
query?: {
|
|
3042
|
-
/** @description Only active events (default: false) */
|
|
3043
|
-
active_only?: boolean;
|
|
3044
|
-
/** @description Include tags array (default: true) */
|
|
3045
|
-
include_tags?: boolean;
|
|
3046
|
-
/** @description Include markets array with outcomes (default: true) */
|
|
3047
|
-
include_markets?: boolean;
|
|
3048
|
-
/** @description Include metrics object with all timeframes (default: true) */
|
|
3049
|
-
include_metrics?: boolean;
|
|
3050
|
-
/** @description Results limit (default: 10) */
|
|
3051
|
-
limit?: number;
|
|
3052
|
-
/** @description Offset-based pagination key (integer offset into result set) */
|
|
3053
|
-
pagination_key?: string;
|
|
3054
|
-
};
|
|
3055
|
-
header?: never;
|
|
3056
|
-
path: {
|
|
3057
|
-
/** @description Series slug or ID */
|
|
3058
|
-
identifier: string;
|
|
3059
|
-
};
|
|
3060
|
-
cookie?: never;
|
|
3061
|
-
};
|
|
3062
|
-
requestBody?: never;
|
|
3063
|
-
responses: {
|
|
3064
|
-
/** @description Events belonging to this series with nested tags and markets */
|
|
3065
|
-
200: {
|
|
3066
|
-
headers: {
|
|
3067
|
-
[name: string]: unknown;
|
|
3068
|
-
};
|
|
3069
|
-
content: {
|
|
3070
|
-
"application/json": components["schemas"]["PolymarketEvent"][];
|
|
3071
|
-
};
|
|
3072
|
-
};
|
|
3073
|
-
};
|
|
3074
|
-
};
|
|
3075
3001
|
get_tags: {
|
|
3076
3002
|
parameters: {
|
|
3077
3003
|
query?: {
|