@structbuild/sdk 0.1.8 → 0.1.10
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 +115 -214
- package/dist/index.cjs +3 -10
- package/dist/index.cjs.map +5 -5
- package/dist/index.js +3 -10
- package/dist/index.js.map +5 -5
- package/dist/namespaces/holders.d.ts +1 -3
- package/dist/namespaces/trader.d.ts +5 -5
- package/dist/types/http.d.ts +5 -0
- package/dist/types/index.d.ts +2 -66
- package/package.json +1 -1
package/dist/types/http.d.ts
CHANGED
|
@@ -34,9 +34,14 @@ export interface ApiResponseInfo {
|
|
|
34
34
|
credits_consumed: number;
|
|
35
35
|
compute_time_ms: number;
|
|
36
36
|
}
|
|
37
|
+
export interface PaginationInfo {
|
|
38
|
+
has_more: boolean;
|
|
39
|
+
pagination_key: string | number | null;
|
|
40
|
+
}
|
|
37
41
|
export interface HttpResponse<T> {
|
|
38
42
|
data: T;
|
|
39
43
|
message: string | null;
|
|
40
44
|
success: boolean;
|
|
41
45
|
info?: ApiResponseInfo;
|
|
46
|
+
pagination?: PaginationInfo;
|
|
42
47
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,9 +9,6 @@ export type BondOutcome = Schemas["BondOutcome"];
|
|
|
9
9
|
export type CandlestickResolution = Schemas["CandlestickResolution"];
|
|
10
10
|
export type ClobReward = Schemas["ClobReward"];
|
|
11
11
|
export type ConditionMetricsResponse = Schemas["ConditionMetricsResponse"];
|
|
12
|
-
export type EventHolder = Schemas["EventHolder"];
|
|
13
|
-
export type EventHolderPnl = Schemas["EventHolderPnl"];
|
|
14
|
-
export type EventHoldersResponse = Schemas["EventHoldersResponse"];
|
|
15
12
|
export type EventMarket = Schemas["EventMarket"];
|
|
16
13
|
export type EventMarketOutcome = Schemas["EventMarketOutcome"];
|
|
17
14
|
export type EventMetricsResponse = Schemas["EventMetricsResponse"];
|
|
@@ -41,11 +38,9 @@ export type UserProfile = Schemas["PolymarketUserProfile"];
|
|
|
41
38
|
export type PositionHolderPnl = Schemas["PositionHolderPnl"];
|
|
42
39
|
export type PositionHoldersResponse = Schemas["PositionHoldersResponse"];
|
|
43
40
|
export type PositionMetricsResponse = Schemas["PositionMetricsResponse"];
|
|
44
|
-
export type PositionStatus = Schemas["PositionStatus"];
|
|
45
41
|
export type PositionVolumeChartResponse = Schemas["PositionVolumeChartResponse"];
|
|
46
42
|
export type PositionVolumeDataPoint = Schemas["PositionVolumeDataPoint"];
|
|
47
43
|
export type PredictionCandlestickBar = Schemas["PredictionCandlestickBar"];
|
|
48
|
-
export type PredictionCandlestickResponseData = Schemas["PredictionCandlestickResponseData"];
|
|
49
44
|
export type PredictionTradeResponse = Schemas["PredictionTradeResponse"];
|
|
50
45
|
export type SearchResponse = Schemas["SearchResponse"];
|
|
51
46
|
export type SeriesFullResponse = Schemas["SeriesFullResponse"];
|
|
@@ -60,7 +55,7 @@ export type Series = Schemas["PolymarketSeries"];
|
|
|
60
55
|
export type SeriesDetail = Schemas["SeriesFullResponse"];
|
|
61
56
|
export type Trade = Schemas["PredictionTradeResponse"];
|
|
62
57
|
export type Candlestick = Schemas["PredictionCandlestickBar"];
|
|
63
|
-
export type CandlestickResponse = Schemas["
|
|
58
|
+
export type CandlestickResponse = Schemas["PredictionCandlestickBar"][];
|
|
64
59
|
export type Timeframe = Schemas["MetricsTimeframe"];
|
|
65
60
|
export type GlobalPnlTimeframe = Schemas["PnlTimeframe"];
|
|
66
61
|
export type TradeSide = "Buy" | "Sell";
|
|
@@ -187,54 +182,6 @@ export interface PositionsResponse {
|
|
|
187
182
|
limit: number;
|
|
188
183
|
offset: number;
|
|
189
184
|
}
|
|
190
|
-
export interface TradeEntry {
|
|
191
|
-
id: string;
|
|
192
|
-
hash: string | null;
|
|
193
|
-
condition_id: string | null;
|
|
194
|
-
side: number | null;
|
|
195
|
-
outcome: string | null;
|
|
196
|
-
outcome_index: number | null;
|
|
197
|
-
usd_amount: number | null;
|
|
198
|
-
shares_amount: number | null;
|
|
199
|
-
price: number | null;
|
|
200
|
-
probability: number | null;
|
|
201
|
-
confirmed_at: number | null;
|
|
202
|
-
market: PositionMarketMetadata | null;
|
|
203
|
-
}
|
|
204
|
-
export interface TradesResponse {
|
|
205
|
-
trades: TradeEntry[];
|
|
206
|
-
total_count: number | null;
|
|
207
|
-
limit: number;
|
|
208
|
-
offset: number;
|
|
209
|
-
}
|
|
210
|
-
export interface TraderPnlSummary {
|
|
211
|
-
realized_pnl_usd: number | null;
|
|
212
|
-
events_traded: number | null;
|
|
213
|
-
markets_traded: number | null;
|
|
214
|
-
positions_traded: number | null;
|
|
215
|
-
total_buys: number | null;
|
|
216
|
-
total_sells: number | null;
|
|
217
|
-
total_redemptions: number | null;
|
|
218
|
-
total_merges: number | null;
|
|
219
|
-
total_volume_usd: number | null;
|
|
220
|
-
buy_volume_usd: number | null;
|
|
221
|
-
sell_volume_usd: number | null;
|
|
222
|
-
redemption_volume_usd: number | null;
|
|
223
|
-
merge_volume_usd: number | null;
|
|
224
|
-
winning_positions: number | null;
|
|
225
|
-
losing_positions: number | null;
|
|
226
|
-
win_rate_pct: number | null;
|
|
227
|
-
markets_won: number | null;
|
|
228
|
-
markets_lost: number | null;
|
|
229
|
-
market_win_rate_pct: number | null;
|
|
230
|
-
open_positions: number | null;
|
|
231
|
-
avg_pnl_per_position: number | null;
|
|
232
|
-
avg_pnl_per_trade: number | null;
|
|
233
|
-
avg_hold_time_seconds: number | null;
|
|
234
|
-
total_fees: number | null;
|
|
235
|
-
first_trade_at: number | null;
|
|
236
|
-
last_trade_at: number | null;
|
|
237
|
-
}
|
|
238
185
|
export interface TraderPositionPnlEntry {
|
|
239
186
|
condition_id: string | null;
|
|
240
187
|
position_id: string | null;
|
|
@@ -313,10 +260,6 @@ export interface PnlListResponse<T> {
|
|
|
313
260
|
export interface PnlCandlesResponse {
|
|
314
261
|
data: PnlCandleEntry[];
|
|
315
262
|
}
|
|
316
|
-
export interface GlobalPnlResponse {
|
|
317
|
-
traders: GlobalPnlTrader[];
|
|
318
|
-
total_count: number;
|
|
319
|
-
}
|
|
320
263
|
export interface TraderSearchResult {
|
|
321
264
|
address: string;
|
|
322
265
|
name?: string;
|
|
@@ -335,13 +278,6 @@ export interface GetMarketMetricsParams extends OperationQuery<"get_market_metri
|
|
|
335
278
|
}
|
|
336
279
|
export interface GetPositionMetricsParams extends OperationQuery<"get_position_metrics"> {
|
|
337
280
|
}
|
|
338
|
-
export interface GetEventHoldersParams extends OperationQuery<"get_event_holders"> {
|
|
339
|
-
eventSlug: string;
|
|
340
|
-
}
|
|
341
|
-
export interface GetEventHoldersHistoryParams {
|
|
342
|
-
eventSlug: string;
|
|
343
|
-
hours?: number;
|
|
344
|
-
}
|
|
345
281
|
export interface GetMarketHoldersParams extends OperationQuery<"get_market_holders"> {
|
|
346
282
|
conditionId: string;
|
|
347
283
|
}
|
|
@@ -462,6 +398,6 @@ export interface DeleteWebhookParams {
|
|
|
462
398
|
export interface TestWebhookParams {
|
|
463
399
|
webhookId: string;
|
|
464
400
|
}
|
|
465
|
-
export type { RetryConfig, HttpClientConfig, RequestOptions, HttpResponse, RequestHookInfo, ResponseHookInfo, ApiResponseInfo } from "./http.js";
|
|
401
|
+
export type { RetryConfig, HttpClientConfig, RequestOptions, HttpResponse, RequestHookInfo, ResponseHookInfo, ApiResponseInfo, PaginationInfo } from "./http.js";
|
|
466
402
|
export type { Address, PaginationParams, SortParams, Venue } from "./common.js";
|
|
467
403
|
export type { ConnectionState, StructWebSocketConfig, PredictionTrade, EnrichedPredictionTrade, PredictionMarketMetadata, PredictionWalletTrackingAlert, WebSocketEventMap, WebSocketMessage, WebSocketServerMessage, } from "./ws.js";
|