@predictorsdk/client 0.5.0 → 0.7.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.
- package/dist/Client.d.ts +27 -1
- package/dist/Client.js +145 -1
- package/dist/api/client/requests/GetEventRequest.d.ts +1 -1
- package/dist/api/client/requests/GetMarketRequest.d.ts +13 -0
- package/dist/api/client/requests/GetMarketRequest.js +2 -0
- package/dist/api/client/requests/index.d.ts +1 -0
- package/dist/api/types/GetMarketRequestPlatform.d.ts +7 -0
- package/dist/api/types/GetMarketRequestPlatform.js +7 -0
- package/dist/api/types/MarketDetailOutcome.d.ts +18 -0
- package/dist/api/types/MarketDetailOutcome.js +2 -0
- package/dist/api/types/MarketDetailPricing.d.ts +16 -0
- package/dist/api/types/MarketDetailPricing.js +2 -0
- package/dist/api/types/MarketDetailPricingAvailability.d.ts +8 -0
- package/dist/api/types/MarketDetailPricingAvailability.js +8 -0
- package/dist/api/types/MarketDetailPricingScale.d.ts +5 -0
- package/dist/api/types/MarketDetailPricingScale.js +5 -0
- package/dist/api/types/MarketDetailPricingSource.d.ts +6 -0
- package/dist/api/types/MarketDetailPricingSource.js +6 -0
- package/dist/api/types/MarketDetailResponse.d.ts +31 -0
- package/dist/api/types/MarketDetailResponse.js +2 -0
- package/dist/api/types/MarketDetailResponseProvider.d.ts +8 -0
- package/dist/api/types/MarketDetailResponseProvider.js +8 -0
- package/dist/api/types/MarketDetailResponseStatus.d.ts +7 -0
- package/dist/api/types/MarketDetailResponseStatus.js +7 -0
- package/dist/api/types/index.d.ts +9 -0
- package/dist/api/types/index.js +9 -0
- package/dist/serialization/types/GetMarketRequestPlatform.d.ts +7 -0
- package/dist/serialization/types/GetMarketRequestPlatform.js +3 -0
- package/dist/serialization/types/MarketDetailOutcome.d.ts +16 -0
- package/dist/serialization/types/MarketDetailOutcome.js +12 -0
- package/dist/serialization/types/MarketDetailPricing.d.ts +16 -0
- package/dist/serialization/types/MarketDetailPricing.js +12 -0
- package/dist/serialization/types/MarketDetailPricingAvailability.d.ts +7 -0
- package/dist/serialization/types/MarketDetailPricingAvailability.js +3 -0
- package/dist/serialization/types/MarketDetailPricingScale.d.ts +7 -0
- package/dist/serialization/types/MarketDetailPricingScale.js +3 -0
- package/dist/serialization/types/MarketDetailPricingSource.d.ts +7 -0
- package/dist/serialization/types/MarketDetailPricingSource.js +3 -0
- package/dist/serialization/types/MarketDetailResponse.d.ts +25 -0
- package/dist/serialization/types/MarketDetailResponse.js +21 -0
- package/dist/serialization/types/MarketDetailResponseProvider.d.ts +7 -0
- package/dist/serialization/types/MarketDetailResponseProvider.js +3 -0
- package/dist/serialization/types/MarketDetailResponseStatus.d.ts +7 -0
- package/dist/serialization/types/MarketDetailResponseStatus.js +3 -0
- package/dist/serialization/types/index.d.ts +9 -0
- package/dist/serialization/types/index.js +9 -0
- package/package.json +1 -1
package/dist/Client.d.ts
CHANGED
|
@@ -46,6 +46,32 @@ export declare class PredictorSDKClient {
|
|
|
46
46
|
*/
|
|
47
47
|
getMarkets(request?: PredictorSDK.GetMarketsRequest, requestOptions?: PredictorSDKClient.RequestOptions): core.HttpResponsePromise<PredictorSDK.MarketsListResponse>;
|
|
48
48
|
private __getMarkets;
|
|
49
|
+
/**
|
|
50
|
+
* Returns a single market across the four supported platforms. The `market_id` is either the composite form returned by `GET /v1/markets` (`{provider}:{native_id}`, e.g. `kalshi:KXNBA-26-SAS`) or the platform-native identifier. Composite IDs dispatch unambiguously by prefix. Native IDs are routed by format inference: Kalshi tickers match the all-caps-with-hyphens shape (`KX…-…`); SX Bet hashes match `0x` + 64 hex characters; numeric ids and kebab-case slugs are shared shape between Polymarket and Predict and probe Polymarket first, falling back to Predict on 404. Pass `?platform=` explicitly to skip the probe.
|
|
51
|
+
*
|
|
52
|
+
* Identity fields (id/provider/provider_id/title/status/ outcomes[].name) are strict-universal: every platform's single-market endpoint exposes them natively without a second fetch. close timestamps and parent event ids remain omitted (not nullable) — Predict's close time lives on the parent category and Polymarket's market record carries no event id.
|
|
53
|
+
*
|
|
54
|
+
* The pricing tier adds per-outcome quotes (`price`/`bid`/`ask`/ `last` as 0–1 probability numbers — price IS the implied probability), a `pricing` envelope (`availability`/`scale`/ `source`/`as_of`/`neg_risk`), and market-level aggregates (`liquidity_usd`, `volume_24h_usd`, `volume_total_usd`, plus Kalshi contract-count mirrors and `open_interest`). Kalshi/ Polymarket/Predict quotes come from the same record the identity fetch returns (`pricing.source=market_record`). SX Bet's market record carries no pricing, so the server makes one bounded second fetch to its best-odds order-book endpoint (`pricing.source=orderbook`) and on timeout/error degrades to `pricing.availability=unavailable` with identity intact — pricing failures never fail the lookup. Aggregates a platform doesn't natively expose are explicit `null` (e.g. Kalshi reports volume in contracts, so `volume_*_usd` stays null rather than fabricating a USD figure; its upstream `liquidity_dollars` field is deprecated and always zero, so `liquidity_usd` is null too).
|
|
55
|
+
*
|
|
56
|
+
* @param {PredictorSDK.GetMarketRequest} request
|
|
57
|
+
* @param {PredictorSDKClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link PredictorSDK.BadRequestError}
|
|
60
|
+
* @throws {@link PredictorSDK.UnauthorizedError}
|
|
61
|
+
* @throws {@link PredictorSDK.PaymentRequiredError}
|
|
62
|
+
* @throws {@link PredictorSDK.ForbiddenError}
|
|
63
|
+
* @throws {@link PredictorSDK.NotFoundError}
|
|
64
|
+
* @throws {@link PredictorSDK.TooManyRequestsError}
|
|
65
|
+
* @throws {@link PredictorSDK.BadGatewayError}
|
|
66
|
+
* @throws {@link PredictorSDK.ServiceUnavailableError}
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.getMarket({
|
|
70
|
+
* marketId: "kalshi:KXNBA-26-SAS"
|
|
71
|
+
* })
|
|
72
|
+
*/
|
|
73
|
+
getMarket(request: PredictorSDK.GetMarketRequest, requestOptions?: PredictorSDKClient.RequestOptions): core.HttpResponsePromise<PredictorSDK.MarketDetailResponse>;
|
|
74
|
+
private __getMarket;
|
|
49
75
|
/**
|
|
50
76
|
* Returns per-second price data for a Binance trading pair. When called without a time range, returns the latest price. With `start_time` and `end_time`, returns historical per-second prices in newest-first order. Supports cursor-based pagination for large result sets. Unknown or invalid symbols return `200` with `{"prices":[]}` and omit `total`.
|
|
51
77
|
*
|
|
@@ -122,7 +148,7 @@ export declare class PredictorSDKClient {
|
|
|
122
148
|
listPolymarketWalletPositions(request?: PredictorSDK.ListPolymarketWalletPositionsRequest, requestOptions?: PredictorSDKClient.RequestOptions): core.HttpResponsePromise<PredictorSDK.PolymarketPositionsResponse>;
|
|
123
149
|
private __listPolymarketWalletPositions;
|
|
124
150
|
/**
|
|
125
|
-
* Returns a single event and the markets nested under it on the identified platform. The `event_id` is the platform's native identifier — a Kalshi `event_ticker`, a Polymarket event slug, an SX Bet `eventId`, or a Predict market identifier. The `platform` is inferred from the ID format when unambiguous
|
|
151
|
+
* Returns a single event and the markets nested under it on the identified platform. The `event_id` is the platform's native identifier — a Kalshi `event_ticker`, a Polymarket event slug, an SX Bet `eventId`, or a Predict market identifier. The `platform` is inferred from the ID format when unambiguous (`KX…` → Kalshi, `L\d+` → SX Bet). Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; if `?platform=` is omitted in that case, the service probes Polymarket first and falls back to Predict when Polymarket returns 404. Pass `?platform=` explicitly to skip the probe.
|
|
126
152
|
*
|
|
127
153
|
* Response is minimal in v0: each market is returned with its platform-native `market_id` and a human-readable `title`. Pricing, volume, status, and timestamps are intentionally deferred — they'll be added as additive fields to `EventMarket` in a later release. The endpoint mirrors the `/v1/markets` rollout pattern (titles first, fields later).
|
|
128
154
|
*
|
package/dist/Client.js
CHANGED
|
@@ -249,6 +249,150 @@ export class PredictorSDKClient {
|
|
|
249
249
|
}
|
|
250
250
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/markets");
|
|
251
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Returns a single market across the four supported platforms. The `market_id` is either the composite form returned by `GET /v1/markets` (`{provider}:{native_id}`, e.g. `kalshi:KXNBA-26-SAS`) or the platform-native identifier. Composite IDs dispatch unambiguously by prefix. Native IDs are routed by format inference: Kalshi tickers match the all-caps-with-hyphens shape (`KX…-…`); SX Bet hashes match `0x` + 64 hex characters; numeric ids and kebab-case slugs are shared shape between Polymarket and Predict and probe Polymarket first, falling back to Predict on 404. Pass `?platform=` explicitly to skip the probe.
|
|
254
|
+
*
|
|
255
|
+
* Identity fields (id/provider/provider_id/title/status/ outcomes[].name) are strict-universal: every platform's single-market endpoint exposes them natively without a second fetch. close timestamps and parent event ids remain omitted (not nullable) — Predict's close time lives on the parent category and Polymarket's market record carries no event id.
|
|
256
|
+
*
|
|
257
|
+
* The pricing tier adds per-outcome quotes (`price`/`bid`/`ask`/ `last` as 0–1 probability numbers — price IS the implied probability), a `pricing` envelope (`availability`/`scale`/ `source`/`as_of`/`neg_risk`), and market-level aggregates (`liquidity_usd`, `volume_24h_usd`, `volume_total_usd`, plus Kalshi contract-count mirrors and `open_interest`). Kalshi/ Polymarket/Predict quotes come from the same record the identity fetch returns (`pricing.source=market_record`). SX Bet's market record carries no pricing, so the server makes one bounded second fetch to its best-odds order-book endpoint (`pricing.source=orderbook`) and on timeout/error degrades to `pricing.availability=unavailable` with identity intact — pricing failures never fail the lookup. Aggregates a platform doesn't natively expose are explicit `null` (e.g. Kalshi reports volume in contracts, so `volume_*_usd` stays null rather than fabricating a USD figure; its upstream `liquidity_dollars` field is deprecated and always zero, so `liquidity_usd` is null too).
|
|
258
|
+
*
|
|
259
|
+
* @param {PredictorSDK.GetMarketRequest} request
|
|
260
|
+
* @param {PredictorSDKClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
261
|
+
*
|
|
262
|
+
* @throws {@link PredictorSDK.BadRequestError}
|
|
263
|
+
* @throws {@link PredictorSDK.UnauthorizedError}
|
|
264
|
+
* @throws {@link PredictorSDK.PaymentRequiredError}
|
|
265
|
+
* @throws {@link PredictorSDK.ForbiddenError}
|
|
266
|
+
* @throws {@link PredictorSDK.NotFoundError}
|
|
267
|
+
* @throws {@link PredictorSDK.TooManyRequestsError}
|
|
268
|
+
* @throws {@link PredictorSDK.BadGatewayError}
|
|
269
|
+
* @throws {@link PredictorSDK.ServiceUnavailableError}
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* await client.getMarket({
|
|
273
|
+
* marketId: "kalshi:KXNBA-26-SAS"
|
|
274
|
+
* })
|
|
275
|
+
*/
|
|
276
|
+
getMarket(request, requestOptions) {
|
|
277
|
+
return core.HttpResponsePromise.fromPromise(this.__getMarket(request, requestOptions));
|
|
278
|
+
}
|
|
279
|
+
async __getMarket(request, requestOptions) {
|
|
280
|
+
const { marketId, platform } = request;
|
|
281
|
+
const _queryParams = {
|
|
282
|
+
platform: platform != null
|
|
283
|
+
? serializers.GetMarketRequestPlatform.jsonOrThrow(platform, {
|
|
284
|
+
unrecognizedObjectKeys: "strip",
|
|
285
|
+
omitUndefined: true,
|
|
286
|
+
})
|
|
287
|
+
: undefined,
|
|
288
|
+
};
|
|
289
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
290
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
291
|
+
const _response = await core.fetcher({
|
|
292
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
293
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
294
|
+
environments.PredictorSDKEnvironment.Production, `v1/markets/${core.url.encodePathParam(marketId)}`),
|
|
295
|
+
method: "GET",
|
|
296
|
+
headers: _headers,
|
|
297
|
+
queryString: core.url
|
|
298
|
+
.queryBuilder()
|
|
299
|
+
.addMany(_queryParams)
|
|
300
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
301
|
+
.build(),
|
|
302
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
303
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
304
|
+
abortSignal: requestOptions?.abortSignal,
|
|
305
|
+
fetchFn: this._options?.fetch,
|
|
306
|
+
logging: this._options.logging,
|
|
307
|
+
});
|
|
308
|
+
if (_response.ok) {
|
|
309
|
+
return {
|
|
310
|
+
data: serializers.MarketDetailResponse.parseOrThrow(_response.body, {
|
|
311
|
+
unrecognizedObjectKeys: "passthrough",
|
|
312
|
+
allowUnrecognizedUnionMembers: true,
|
|
313
|
+
allowUnrecognizedEnumValues: true,
|
|
314
|
+
skipValidation: true,
|
|
315
|
+
breadcrumbsPrefix: ["response"],
|
|
316
|
+
}),
|
|
317
|
+
rawResponse: _response.rawResponse,
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
if (_response.error.reason === "status-code") {
|
|
321
|
+
switch (_response.error.statusCode) {
|
|
322
|
+
case 400:
|
|
323
|
+
throw new PredictorSDK.BadRequestError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
324
|
+
unrecognizedObjectKeys: "passthrough",
|
|
325
|
+
allowUnrecognizedUnionMembers: true,
|
|
326
|
+
allowUnrecognizedEnumValues: true,
|
|
327
|
+
skipValidation: true,
|
|
328
|
+
breadcrumbsPrefix: ["response"],
|
|
329
|
+
}), _response.rawResponse);
|
|
330
|
+
case 401:
|
|
331
|
+
throw new PredictorSDK.UnauthorizedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
332
|
+
unrecognizedObjectKeys: "passthrough",
|
|
333
|
+
allowUnrecognizedUnionMembers: true,
|
|
334
|
+
allowUnrecognizedEnumValues: true,
|
|
335
|
+
skipValidation: true,
|
|
336
|
+
breadcrumbsPrefix: ["response"],
|
|
337
|
+
}), _response.rawResponse);
|
|
338
|
+
case 402:
|
|
339
|
+
throw new PredictorSDK.PaymentRequiredError(serializers.PaymentRequiredErrorBody.parseOrThrow(_response.error.body, {
|
|
340
|
+
unrecognizedObjectKeys: "passthrough",
|
|
341
|
+
allowUnrecognizedUnionMembers: true,
|
|
342
|
+
allowUnrecognizedEnumValues: true,
|
|
343
|
+
skipValidation: true,
|
|
344
|
+
breadcrumbsPrefix: ["response"],
|
|
345
|
+
}), _response.rawResponse);
|
|
346
|
+
case 403:
|
|
347
|
+
throw new PredictorSDK.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
348
|
+
unrecognizedObjectKeys: "passthrough",
|
|
349
|
+
allowUnrecognizedUnionMembers: true,
|
|
350
|
+
allowUnrecognizedEnumValues: true,
|
|
351
|
+
skipValidation: true,
|
|
352
|
+
breadcrumbsPrefix: ["response"],
|
|
353
|
+
}), _response.rawResponse);
|
|
354
|
+
case 404:
|
|
355
|
+
throw new PredictorSDK.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
356
|
+
unrecognizedObjectKeys: "passthrough",
|
|
357
|
+
allowUnrecognizedUnionMembers: true,
|
|
358
|
+
allowUnrecognizedEnumValues: true,
|
|
359
|
+
skipValidation: true,
|
|
360
|
+
breadcrumbsPrefix: ["response"],
|
|
361
|
+
}), _response.rawResponse);
|
|
362
|
+
case 429:
|
|
363
|
+
throw new PredictorSDK.TooManyRequestsError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
364
|
+
unrecognizedObjectKeys: "passthrough",
|
|
365
|
+
allowUnrecognizedUnionMembers: true,
|
|
366
|
+
allowUnrecognizedEnumValues: true,
|
|
367
|
+
skipValidation: true,
|
|
368
|
+
breadcrumbsPrefix: ["response"],
|
|
369
|
+
}), _response.rawResponse);
|
|
370
|
+
case 502:
|
|
371
|
+
throw new PredictorSDK.BadGatewayError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
372
|
+
unrecognizedObjectKeys: "passthrough",
|
|
373
|
+
allowUnrecognizedUnionMembers: true,
|
|
374
|
+
allowUnrecognizedEnumValues: true,
|
|
375
|
+
skipValidation: true,
|
|
376
|
+
breadcrumbsPrefix: ["response"],
|
|
377
|
+
}), _response.rawResponse);
|
|
378
|
+
case 503:
|
|
379
|
+
throw new PredictorSDK.ServiceUnavailableError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
380
|
+
unrecognizedObjectKeys: "passthrough",
|
|
381
|
+
allowUnrecognizedUnionMembers: true,
|
|
382
|
+
allowUnrecognizedEnumValues: true,
|
|
383
|
+
skipValidation: true,
|
|
384
|
+
breadcrumbsPrefix: ["response"],
|
|
385
|
+
}), _response.rawResponse);
|
|
386
|
+
default:
|
|
387
|
+
throw new errors.PredictorSDKError({
|
|
388
|
+
statusCode: _response.error.statusCode,
|
|
389
|
+
body: _response.error.body,
|
|
390
|
+
rawResponse: _response.rawResponse,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/markets/{market_id}");
|
|
395
|
+
}
|
|
252
396
|
/**
|
|
253
397
|
* Returns per-second price data for a Binance trading pair. When called without a time range, returns the latest price. With `start_time` and `end_time`, returns historical per-second prices in newest-first order. Supports cursor-based pagination for large result sets. Unknown or invalid symbols return `200` with `{"prices":[]}` and omit `total`.
|
|
254
398
|
*
|
|
@@ -664,7 +808,7 @@ export class PredictorSDKClient {
|
|
|
664
808
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/polymarket/wallet/positions");
|
|
665
809
|
}
|
|
666
810
|
/**
|
|
667
|
-
* Returns a single event and the markets nested under it on the identified platform. The `event_id` is the platform's native identifier — a Kalshi `event_ticker`, a Polymarket event slug, an SX Bet `eventId`, or a Predict market identifier. The `platform` is inferred from the ID format when unambiguous
|
|
811
|
+
* Returns a single event and the markets nested under it on the identified platform. The `event_id` is the platform's native identifier — a Kalshi `event_ticker`, a Polymarket event slug, an SX Bet `eventId`, or a Predict market identifier. The `platform` is inferred from the ID format when unambiguous (`KX…` → Kalshi, `L\d+` → SX Bet). Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; if `?platform=` is omitted in that case, the service probes Polymarket first and falls back to Predict when Polymarket returns 404. Pass `?platform=` explicitly to skip the probe.
|
|
668
812
|
*
|
|
669
813
|
* Response is minimal in v0: each market is returned with its platform-native `market_id` and a human-readable `title`. Pricing, volume, status, and timestamps are intentionally deferred — they'll be added as additive fields to `EventMarket` in a later release. The endpoint mirrors the `/v1/markets` rollout pattern (titles first, fields later).
|
|
670
814
|
*
|
|
@@ -8,6 +8,6 @@ import type * as PredictorSDK from "../../index.js";
|
|
|
8
8
|
export interface GetEventRequest {
|
|
9
9
|
/** Platform-native event identifier. Examples per platform: Kalshi event ticker (`KXMLBGAME-26MAY221840CLEPHI`), Polymarket event slug (`mlb-cle-phi-2026-05-22`), SX Bet event id (`L10073358`), Predict market id (`110629`). */
|
|
10
10
|
eventId: string;
|
|
11
|
-
/** Optional platform override. When omitted, inferred from the `event_id` format: `KX…` → Kalshi, `L\d+` → SX Bet. Numeric IDs and kebab-case slugs are
|
|
11
|
+
/** Optional platform override. When omitted, inferred from the `event_id` format: `KX…` → Kalshi, `L\d+` → SX Bet. Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; in that case the service probes Polymarket first and falls back to Predict on 404. Pass `platform` explicitly to skip the probe. */
|
|
12
12
|
platform?: PredictorSDK.GetEventRequestPlatform;
|
|
13
13
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* marketId: "kalshi:KXNBA-26-SAS"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface GetMarketRequest {
|
|
9
|
+
/** Composite (`{provider}:{native_id}`) or platform-native market identifier. Examples per platform: Kalshi market ticker (`KXNBA-26-SAS`), Polymarket numeric id or slug (`540817` or `new-rhianna-album-before-gta-vi-926`), Predict market id (`356635`), SX Bet `marketHash` (`0x…64hex`). */
|
|
10
|
+
marketId: string;
|
|
11
|
+
/** Optional platform override. When omitted, inferred from the composite prefix or from the native ID format (`KX…` → Kalshi, `0x…64hex` → SX Bet). Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; in that case the service probes Polymarket first and falls back to Predict on 404. Pass `platform` explicitly to skip the probe. When the override contradicts a composite prefix (e.g. `kalshi:X` with `?platform=polymarket`), the request returns 400. */
|
|
12
|
+
platform?: PredictorSDK.GetMarketRequestPlatform;
|
|
13
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { GetBinanceCryptoPricesRequest } from "./GetBinanceCryptoPricesRequest.js";
|
|
2
2
|
export type { GetEventRequest } from "./GetEventRequest.js";
|
|
3
|
+
export type { GetMarketRequest } from "./GetMarketRequest.js";
|
|
3
4
|
export type { GetMarketsRequest } from "./GetMarketsRequest.js";
|
|
4
5
|
export type { GetPolymarketWalletRequest } from "./GetPolymarketWalletRequest.js";
|
|
5
6
|
export type { GetSportsMatchingMarketsRequest } from "./GetSportsMatchingMarketsRequest.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const GetMarketRequestPlatform: {
|
|
2
|
+
readonly Kalshi: "kalshi";
|
|
3
|
+
readonly Polymarket: "polymarket";
|
|
4
|
+
readonly Predict: "predict";
|
|
5
|
+
readonly Sxbet: "sxbet";
|
|
6
|
+
};
|
|
7
|
+
export type GetMarketRequestPlatform = (typeof GetMarketRequestPlatform)[keyof typeof GetMarketRequestPlatform];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface MarketDetailOutcome {
|
|
2
|
+
/** Outcome label as the platform reports it. Kalshi binary markets normalize to `Yes`/`No`; Polymarket parses the stringified outcomes array (also typically `Yes`/`No`); Predict reports per-outcome names; SX Bet uses outcome-one/outcome-two names (e.g. team labels with spreads applied). */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Stable per-platform key for this outcome: Kalshi `yes`/`no`, Polymarket CLOB token id, Predict on-chain id, SX Bet `outcomeOne`/`outcomeTwo`. The join key for future per-outcome sub-resources (order-book depth). */
|
|
5
|
+
outcomeId?: string;
|
|
6
|
+
/** Current implied probability of this outcome in 0–1 — the headline field, equal to the implied probability on every supported platform. Derivation cascade: mid of bid/ask when two-sided → the single available side → last trade → platform mark (Polymarket `outcomePrices`, which preserves 0/1 resolution marks on settled markets). Because the cascade differs by what each platform exposes, `price` is a DISPLAY number — when comparing across platforms or sizing trades, prefer `bid`/`ask` directly where present. Null when no quote of any kind exists. GUARANTEE: when `pricing.availability` is `live`, `price` is non-null on every outcome. Values are rounded to at most 6 decimal places. */
|
|
7
|
+
price: number | null;
|
|
8
|
+
/** Best bid for this outcome in 0–1 probability. Null when that book side is empty or the platform doesn't publish per-outcome quotes on the record (Polymarket non-primary outcomes) — never synthesized from `1 − ask`. */
|
|
9
|
+
bid: number | null;
|
|
10
|
+
/** Best ask (price to take this outcome) in 0–1 probability. For SX Bet this is derived from the opposite side's best maker quote (`1 − bid(other)`), which is that book's actual taker price. */
|
|
11
|
+
ask: number | null;
|
|
12
|
+
/** Last traded price for this outcome in 0–1 probability. Null where the platform exposes no last-trade on the record (Predict, SX Bet). */
|
|
13
|
+
last: number | null;
|
|
14
|
+
/** Resting size at the best bid in native contract/share units (NOT USD). Omitted where the platform publishes no per-side size — Kalshi publishes YES-side sizes only; Polymarket and SX Bet publish none on this path. */
|
|
15
|
+
bidSize?: number;
|
|
16
|
+
/** Resting size at the best ask in native contract/share units. Same availability as `bid_size`. */
|
|
17
|
+
askSize?: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Market-wide quote metadata for the pricing tier. Always present on the response; `availability` tells the truth about what the tier could hydrate instead of leaving consumers to guess from nulls.
|
|
4
|
+
*/
|
|
5
|
+
export interface MarketDetailPricing {
|
|
6
|
+
/** `live` — every outcome carries a price. `partial` — some but not all outcomes priced. `no_quotes` — the pricing fetch succeeded but the book is empty (SX Bet with no resting orders; Kalshi provisional/multivariate markets whose quotes are empty-book placeholders). `unavailable` — the pricing enrichment fetch failed or timed out (SX Bet); identity fields are still served. */
|
|
7
|
+
availability: PredictorSDK.MarketDetailPricingAvailability;
|
|
8
|
+
/** Self-describing unit declaration for all price fields. Single canonical scale today; new values would be added alongside (never replacing) this one. */
|
|
9
|
+
scale: PredictorSDK.MarketDetailPricingScale;
|
|
10
|
+
/** Where the quotes came from. `market_record` — embedded in the same single-market record as the identity fetch (Kalshi, Polymarket, Predict). `orderbook` — required one bounded second fetch against the platform's order-book surface (SX Bet `/orders/odds/best`). */
|
|
11
|
+
source: PredictorSDK.MarketDetailPricingSource;
|
|
12
|
+
/** Quote freshness as RFC3339. When the two sides carry independent upstream timestamps (SX Bet), this is the OLDER of them — a conservative floor that never over-claims freshness. Null when the upstream record carries no quote timestamp at all (Predict) — treat freshness as UNKNOWN, not as fresh. Timestamps come from each platform's own clock; for Kalshi/Polymarket the value is the record's last-update time, the closest the platform exposes to a quote timestamp. */
|
|
13
|
+
asOf: Date | null;
|
|
14
|
+
/** True when this market belongs to a negative-risk multi-outcome event (Polymarket `negRisk`, Predict `isNegRisk`). On a multi-outcome record, outcome prices intentionally need not sum to 1 — do not "normalize" the book. Note that for the BINARY member markets these platforms serve today the flag signals event-level structure (this market is one leg of a mutually-exclusive set); the binary pair itself still sums to ~1. Omitted when false. */
|
|
15
|
+
negRisk?: boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** `live` — every outcome carries a price. `partial` — some but not all outcomes priced. `no_quotes` — the pricing fetch succeeded but the book is empty (SX Bet with no resting orders; Kalshi provisional/multivariate markets whose quotes are empty-book placeholders). `unavailable` — the pricing enrichment fetch failed or timed out (SX Bet); identity fields are still served. */
|
|
2
|
+
export declare const MarketDetailPricingAvailability: {
|
|
3
|
+
readonly Live: "live";
|
|
4
|
+
readonly Partial: "partial";
|
|
5
|
+
readonly NoQuotes: "no_quotes";
|
|
6
|
+
readonly Unavailable: "unavailable";
|
|
7
|
+
};
|
|
8
|
+
export type MarketDetailPricingAvailability = (typeof MarketDetailPricingAvailability)[keyof typeof MarketDetailPricingAvailability];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** `live` — every outcome carries a price. `partial` — some but not all outcomes priced. `no_quotes` — the pricing fetch succeeded but the book is empty (SX Bet with no resting orders; Kalshi provisional/multivariate markets whose quotes are empty-book placeholders). `unavailable` — the pricing enrichment fetch failed or timed out (SX Bet); identity fields are still served. */
|
|
3
|
+
export const MarketDetailPricingAvailability = {
|
|
4
|
+
Live: "live",
|
|
5
|
+
Partial: "partial",
|
|
6
|
+
NoQuotes: "no_quotes",
|
|
7
|
+
Unavailable: "unavailable",
|
|
8
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Self-describing unit declaration for all price fields. Single canonical scale today; new values would be added alongside (never replacing) this one. */
|
|
2
|
+
export declare const MarketDetailPricingScale: {
|
|
3
|
+
readonly Probability01: "probability_0_1";
|
|
4
|
+
};
|
|
5
|
+
export type MarketDetailPricingScale = (typeof MarketDetailPricingScale)[keyof typeof MarketDetailPricingScale];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Self-describing unit declaration for all price fields. Single canonical scale today; new values would be added alongside (never replacing) this one. */
|
|
3
|
+
export const MarketDetailPricingScale = {
|
|
4
|
+
Probability01: "probability_0_1",
|
|
5
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Where the quotes came from. `market_record` — embedded in the same single-market record as the identity fetch (Kalshi, Polymarket, Predict). `orderbook` — required one bounded second fetch against the platform's order-book surface (SX Bet `/orders/odds/best`). */
|
|
2
|
+
export declare const MarketDetailPricingSource: {
|
|
3
|
+
readonly MarketRecord: "market_record";
|
|
4
|
+
readonly Orderbook: "orderbook";
|
|
5
|
+
};
|
|
6
|
+
export type MarketDetailPricingSource = (typeof MarketDetailPricingSource)[keyof typeof MarketDetailPricingSource];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Where the quotes came from. `market_record` — embedded in the same single-market record as the identity fetch (Kalshi, Polymarket, Predict). `orderbook` — required one bounded second fetch against the platform's order-book surface (SX Bet `/orders/odds/best`). */
|
|
3
|
+
export const MarketDetailPricingSource = {
|
|
4
|
+
MarketRecord: "market_record",
|
|
5
|
+
Orderbook: "orderbook",
|
|
6
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Single-market detail across all four supported platforms. Identity fields are strict-universal (no second fetch on any platform); the pricing tier carries per-outcome quotes plus market-level aggregates with explicit nulls where a platform doesn't natively expose a figure — values are never fabricated. closes_at/event_id remain deliberately omitted, see the endpoint description for the rationale.
|
|
4
|
+
*/
|
|
5
|
+
export interface MarketDetailResponse {
|
|
6
|
+
/** Composite market identifier in the format `{provider}:{provider_id}`. Matches the `id` field returned by `GET /v1/markets` so list output flows into detail lookups without preprocessing. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Prediction market provider the market_id resolved against. */
|
|
9
|
+
provider: PredictorSDK.MarketDetailResponseProvider;
|
|
10
|
+
/** Platform-native market identifier. Kalshi ticker, Polymarket numeric id, Predict numeric id, or SX Bet `marketHash`. For Polymarket markets resolved by slug, this is normalized to the numeric id. */
|
|
11
|
+
providerId: string;
|
|
12
|
+
/** Human-readable market title. Each platform exposes a slightly different field — Kalshi `title`, Polymarket `question`, Predict `title`, SX Bet composed from outcome labels (team-pair fallback) so a game's moneyline, spread, and total markets stay distinguishable. */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Normalized lifecycle status. Mapping per platform: Kalshi `active` → open · `closed`/`determined` → closed · `settled`/`finalized` → settled. Polymarket `archived` → settled · `closed && !archived` → closed · otherwise → open. Predict `tradingStatus=OPEN` → open · `CLOSED && !RESOLVED` → closed · `status=RESOLVED` → settled. SX Bet `ACTIVE` → open · otherwise closed. Unknown upstream values default to closed. */
|
|
15
|
+
status: PredictorSDK.MarketDetailResponseStatus;
|
|
16
|
+
/** Outcomes with per-outcome quotes. ORDERING GUARANTEE: `outcomes[0]` is the platform's primary/headline outcome — Kalshi `Yes`, Polymarket's first outcome token (its `bestBid`/`bestAsk` side), Predict `indexSet=1`, SX Bet `outcomeOne`. Render `outcomes[0].price` as the headline probability; do NOT search for an outcome named "Yes" (names are free-text on Predict/SX Bet). Every supported platform models per-market outcomes as a 2-element list in practice (multi-outcome events are modeled as multiple binary markets nested under one event/category); the per-outcome quote shape handles binary and any future multi-outcome record identically with no special-casing. */
|
|
17
|
+
outcomes: PredictorSDK.MarketDetailOutcome[];
|
|
18
|
+
pricing: PredictorSDK.MarketDetailPricing;
|
|
19
|
+
/** Resting order-book depth valued in USD — strictly CLOB book depth, never an AMM pool size or a synthetic score. Polymarket exposes it natively (`liquidityNum`); null for Kalshi (its upstream `liquidity_dollars` is deprecated and always zero), Predict (stats is null on the record), and SX Bet (no scalar without summing the raw order book). */
|
|
20
|
+
liquidityUsd: number | null;
|
|
21
|
+
/** Trailing-24h traded volume in USD notional. Null where the platform doesn't denominate volume in USD — notably Kalshi (contracts; see `volume_24h_contracts`) — or doesn't expose a volume aggregate at all (SX Bet, Predict's record). */
|
|
22
|
+
volume24HUsd: number | null;
|
|
23
|
+
/** Lifetime traded volume in USD notional. Same per-platform availability as `volume_24h_usd`. Never fabricated by converting contract counts through a price. */
|
|
24
|
+
volumeTotalUsd: number | null;
|
|
25
|
+
/** Trailing-24h traded volume in contracts (Kalshi `volume_24h_fp`; fractional contracts supported). Omitted for platforms that denominate volume in USD. */
|
|
26
|
+
volume24HContracts?: number;
|
|
27
|
+
/** Lifetime traded volume in contracts (Kalshi `volume_fp`). Omitted for platforms that denominate volume in USD. */
|
|
28
|
+
volumeTotalContracts?: number;
|
|
29
|
+
/** Total outstanding contracts (Kalshi `open_interest_fp`). Contracts, not USD — a positioning gauge kept separate from `liquidity_usd` (depth). Omitted where the platform doesn't expose market-level open interest. */
|
|
30
|
+
openInterest?: number;
|
|
31
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Prediction market provider the market_id resolved against. */
|
|
2
|
+
export declare const MarketDetailResponseProvider: {
|
|
3
|
+
readonly Kalshi: "kalshi";
|
|
4
|
+
readonly Polymarket: "polymarket";
|
|
5
|
+
readonly Predict: "predict";
|
|
6
|
+
readonly Sxbet: "sxbet";
|
|
7
|
+
};
|
|
8
|
+
export type MarketDetailResponseProvider = (typeof MarketDetailResponseProvider)[keyof typeof MarketDetailResponseProvider];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Prediction market provider the market_id resolved against. */
|
|
3
|
+
export const MarketDetailResponseProvider = {
|
|
4
|
+
Kalshi: "kalshi",
|
|
5
|
+
Polymarket: "polymarket",
|
|
6
|
+
Predict: "predict",
|
|
7
|
+
Sxbet: "sxbet",
|
|
8
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Normalized lifecycle status. Mapping per platform: Kalshi `active` → open · `closed`/`determined` → closed · `settled`/`finalized` → settled. Polymarket `archived` → settled · `closed && !archived` → closed · otherwise → open. Predict `tradingStatus=OPEN` → open · `CLOSED && !RESOLVED` → closed · `status=RESOLVED` → settled. SX Bet `ACTIVE` → open · otherwise closed. Unknown upstream values default to closed. */
|
|
2
|
+
export declare const MarketDetailResponseStatus: {
|
|
3
|
+
readonly Open: "open";
|
|
4
|
+
readonly Closed: "closed";
|
|
5
|
+
readonly Settled: "settled";
|
|
6
|
+
};
|
|
7
|
+
export type MarketDetailResponseStatus = (typeof MarketDetailResponseStatus)[keyof typeof MarketDetailResponseStatus];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Normalized lifecycle status. Mapping per platform: Kalshi `active` → open · `closed`/`determined` → closed · `settled`/`finalized` → settled. Polymarket `archived` → settled · `closed && !archived` → closed · otherwise → open. Predict `tradingStatus=OPEN` → open · `CLOSED && !RESOLVED` → closed · `status=RESOLVED` → settled. SX Bet `ACTIVE` → open · otherwise closed. Unknown upstream values default to closed. */
|
|
3
|
+
export const MarketDetailResponseStatus = {
|
|
4
|
+
Open: "open",
|
|
5
|
+
Closed: "closed",
|
|
6
|
+
Settled: "settled",
|
|
7
|
+
};
|
|
@@ -6,6 +6,15 @@ export * from "./EventMarket.js";
|
|
|
6
6
|
export * from "./EventResponse.js";
|
|
7
7
|
export * from "./EventResponsePlatform.js";
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
|
+
export * from "./GetMarketRequestPlatform.js";
|
|
10
|
+
export * from "./MarketDetailOutcome.js";
|
|
11
|
+
export * from "./MarketDetailPricing.js";
|
|
12
|
+
export * from "./MarketDetailPricingAvailability.js";
|
|
13
|
+
export * from "./MarketDetailPricingScale.js";
|
|
14
|
+
export * from "./MarketDetailPricingSource.js";
|
|
15
|
+
export * from "./MarketDetailResponse.js";
|
|
16
|
+
export * from "./MarketDetailResponseProvider.js";
|
|
17
|
+
export * from "./MarketDetailResponseStatus.js";
|
|
9
18
|
export * from "./MarketsListResponse.js";
|
|
10
19
|
export * from "./PaginationBlock.js";
|
|
11
20
|
export * from "./PaymentRequiredErrorAction.js";
|
package/dist/api/types/index.js
CHANGED
|
@@ -6,6 +6,15 @@ export * from "./EventMarket.js";
|
|
|
6
6
|
export * from "./EventResponse.js";
|
|
7
7
|
export * from "./EventResponsePlatform.js";
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
|
+
export * from "./GetMarketRequestPlatform.js";
|
|
10
|
+
export * from "./MarketDetailOutcome.js";
|
|
11
|
+
export * from "./MarketDetailPricing.js";
|
|
12
|
+
export * from "./MarketDetailPricingAvailability.js";
|
|
13
|
+
export * from "./MarketDetailPricingScale.js";
|
|
14
|
+
export * from "./MarketDetailPricingSource.js";
|
|
15
|
+
export * from "./MarketDetailResponse.js";
|
|
16
|
+
export * from "./MarketDetailResponseProvider.js";
|
|
17
|
+
export * from "./MarketDetailResponseStatus.js";
|
|
9
18
|
export * from "./MarketsListResponse.js";
|
|
10
19
|
export * from "./PaginationBlock.js";
|
|
11
20
|
export * from "./PaymentRequiredErrorAction.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const GetMarketRequestPlatform: core.serialization.Schema<serializers.GetMarketRequestPlatform.Raw, PredictorSDK.GetMarketRequestPlatform>;
|
|
5
|
+
export declare namespace GetMarketRequestPlatform {
|
|
6
|
+
type Raw = "kalshi" | "polymarket" | "predict" | "sxbet";
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const MarketDetailOutcome: core.serialization.ObjectSchema<serializers.MarketDetailOutcome.Raw, PredictorSDK.MarketDetailOutcome>;
|
|
5
|
+
export declare namespace MarketDetailOutcome {
|
|
6
|
+
interface Raw {
|
|
7
|
+
name: string;
|
|
8
|
+
outcome_id?: string | null;
|
|
9
|
+
price?: number | null;
|
|
10
|
+
bid?: number | null;
|
|
11
|
+
ask?: number | null;
|
|
12
|
+
last?: number | null;
|
|
13
|
+
bid_size?: number | null;
|
|
14
|
+
ask_size?: number | null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
export const MarketDetailOutcome = core.serialization.object({
|
|
4
|
+
name: core.serialization.string(),
|
|
5
|
+
outcomeId: core.serialization.property("outcome_id", core.serialization.string().optional()),
|
|
6
|
+
price: core.serialization.number().nullable(),
|
|
7
|
+
bid: core.serialization.number().nullable(),
|
|
8
|
+
ask: core.serialization.number().nullable(),
|
|
9
|
+
last: core.serialization.number().nullable(),
|
|
10
|
+
bidSize: core.serialization.property("bid_size", core.serialization.number().optional()),
|
|
11
|
+
askSize: core.serialization.property("ask_size", core.serialization.number().optional()),
|
|
12
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
import { MarketDetailPricingAvailability } from "./MarketDetailPricingAvailability.js";
|
|
5
|
+
import { MarketDetailPricingScale } from "./MarketDetailPricingScale.js";
|
|
6
|
+
import { MarketDetailPricingSource } from "./MarketDetailPricingSource.js";
|
|
7
|
+
export declare const MarketDetailPricing: core.serialization.ObjectSchema<serializers.MarketDetailPricing.Raw, PredictorSDK.MarketDetailPricing>;
|
|
8
|
+
export declare namespace MarketDetailPricing {
|
|
9
|
+
interface Raw {
|
|
10
|
+
availability: MarketDetailPricingAvailability.Raw;
|
|
11
|
+
scale: MarketDetailPricingScale.Raw;
|
|
12
|
+
source: MarketDetailPricingSource.Raw;
|
|
13
|
+
as_of?: string | null;
|
|
14
|
+
neg_risk?: boolean | null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import { MarketDetailPricingAvailability } from "./MarketDetailPricingAvailability.js";
|
|
4
|
+
import { MarketDetailPricingScale } from "./MarketDetailPricingScale.js";
|
|
5
|
+
import { MarketDetailPricingSource } from "./MarketDetailPricingSource.js";
|
|
6
|
+
export const MarketDetailPricing = core.serialization.object({
|
|
7
|
+
availability: MarketDetailPricingAvailability,
|
|
8
|
+
scale: MarketDetailPricingScale,
|
|
9
|
+
source: MarketDetailPricingSource,
|
|
10
|
+
asOf: core.serialization.property("as_of", core.serialization.date().nullable()),
|
|
11
|
+
negRisk: core.serialization.property("neg_risk", core.serialization.boolean().optional()),
|
|
12
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const MarketDetailPricingAvailability: core.serialization.Schema<serializers.MarketDetailPricingAvailability.Raw, PredictorSDK.MarketDetailPricingAvailability>;
|
|
5
|
+
export declare namespace MarketDetailPricingAvailability {
|
|
6
|
+
type Raw = "live" | "partial" | "no_quotes" | "unavailable";
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const MarketDetailPricingScale: core.serialization.Schema<serializers.MarketDetailPricingScale.Raw, PredictorSDK.MarketDetailPricingScale>;
|
|
5
|
+
export declare namespace MarketDetailPricingScale {
|
|
6
|
+
type Raw = "probability_0_1";
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const MarketDetailPricingSource: core.serialization.Schema<serializers.MarketDetailPricingSource.Raw, PredictorSDK.MarketDetailPricingSource>;
|
|
5
|
+
export declare namespace MarketDetailPricingSource {
|
|
6
|
+
type Raw = "market_record" | "orderbook";
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
import { MarketDetailOutcome } from "./MarketDetailOutcome.js";
|
|
5
|
+
import { MarketDetailPricing } from "./MarketDetailPricing.js";
|
|
6
|
+
import { MarketDetailResponseProvider } from "./MarketDetailResponseProvider.js";
|
|
7
|
+
import { MarketDetailResponseStatus } from "./MarketDetailResponseStatus.js";
|
|
8
|
+
export declare const MarketDetailResponse: core.serialization.ObjectSchema<serializers.MarketDetailResponse.Raw, PredictorSDK.MarketDetailResponse>;
|
|
9
|
+
export declare namespace MarketDetailResponse {
|
|
10
|
+
interface Raw {
|
|
11
|
+
id: string;
|
|
12
|
+
provider: MarketDetailResponseProvider.Raw;
|
|
13
|
+
provider_id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
status: MarketDetailResponseStatus.Raw;
|
|
16
|
+
outcomes: MarketDetailOutcome.Raw[];
|
|
17
|
+
pricing: MarketDetailPricing.Raw;
|
|
18
|
+
liquidity_usd?: number | null;
|
|
19
|
+
volume_24h_usd?: number | null;
|
|
20
|
+
volume_total_usd?: number | null;
|
|
21
|
+
volume_24h_contracts?: number | null;
|
|
22
|
+
volume_total_contracts?: number | null;
|
|
23
|
+
open_interest?: number | null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import { MarketDetailOutcome } from "./MarketDetailOutcome.js";
|
|
4
|
+
import { MarketDetailPricing } from "./MarketDetailPricing.js";
|
|
5
|
+
import { MarketDetailResponseProvider } from "./MarketDetailResponseProvider.js";
|
|
6
|
+
import { MarketDetailResponseStatus } from "./MarketDetailResponseStatus.js";
|
|
7
|
+
export const MarketDetailResponse = core.serialization.object({
|
|
8
|
+
id: core.serialization.string(),
|
|
9
|
+
provider: MarketDetailResponseProvider,
|
|
10
|
+
providerId: core.serialization.property("provider_id", core.serialization.string()),
|
|
11
|
+
title: core.serialization.string(),
|
|
12
|
+
status: MarketDetailResponseStatus,
|
|
13
|
+
outcomes: core.serialization.list(MarketDetailOutcome),
|
|
14
|
+
pricing: MarketDetailPricing,
|
|
15
|
+
liquidityUsd: core.serialization.property("liquidity_usd", core.serialization.number().nullable()),
|
|
16
|
+
volume24HUsd: core.serialization.property("volume_24h_usd", core.serialization.number().nullable()),
|
|
17
|
+
volumeTotalUsd: core.serialization.property("volume_total_usd", core.serialization.number().nullable()),
|
|
18
|
+
volume24HContracts: core.serialization.property("volume_24h_contracts", core.serialization.number().optional()),
|
|
19
|
+
volumeTotalContracts: core.serialization.property("volume_total_contracts", core.serialization.number().optional()),
|
|
20
|
+
openInterest: core.serialization.property("open_interest", core.serialization.number().optional()),
|
|
21
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const MarketDetailResponseProvider: core.serialization.Schema<serializers.MarketDetailResponseProvider.Raw, PredictorSDK.MarketDetailResponseProvider>;
|
|
5
|
+
export declare namespace MarketDetailResponseProvider {
|
|
6
|
+
type Raw = "kalshi" | "polymarket" | "predict" | "sxbet";
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const MarketDetailResponseStatus: core.serialization.Schema<serializers.MarketDetailResponseStatus.Raw, PredictorSDK.MarketDetailResponseStatus>;
|
|
5
|
+
export declare namespace MarketDetailResponseStatus {
|
|
6
|
+
type Raw = "open" | "closed" | "settled";
|
|
7
|
+
}
|
|
@@ -6,6 +6,15 @@ export * from "./EventMarket.js";
|
|
|
6
6
|
export * from "./EventResponse.js";
|
|
7
7
|
export * from "./EventResponsePlatform.js";
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
|
+
export * from "./GetMarketRequestPlatform.js";
|
|
10
|
+
export * from "./MarketDetailOutcome.js";
|
|
11
|
+
export * from "./MarketDetailPricing.js";
|
|
12
|
+
export * from "./MarketDetailPricingAvailability.js";
|
|
13
|
+
export * from "./MarketDetailPricingScale.js";
|
|
14
|
+
export * from "./MarketDetailPricingSource.js";
|
|
15
|
+
export * from "./MarketDetailResponse.js";
|
|
16
|
+
export * from "./MarketDetailResponseProvider.js";
|
|
17
|
+
export * from "./MarketDetailResponseStatus.js";
|
|
9
18
|
export * from "./MarketsListResponse.js";
|
|
10
19
|
export * from "./PaginationBlock.js";
|
|
11
20
|
export * from "./PaymentRequiredErrorAction.js";
|
|
@@ -6,6 +6,15 @@ export * from "./EventMarket.js";
|
|
|
6
6
|
export * from "./EventResponse.js";
|
|
7
7
|
export * from "./EventResponsePlatform.js";
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
|
+
export * from "./GetMarketRequestPlatform.js";
|
|
10
|
+
export * from "./MarketDetailOutcome.js";
|
|
11
|
+
export * from "./MarketDetailPricing.js";
|
|
12
|
+
export * from "./MarketDetailPricingAvailability.js";
|
|
13
|
+
export * from "./MarketDetailPricingScale.js";
|
|
14
|
+
export * from "./MarketDetailPricingSource.js";
|
|
15
|
+
export * from "./MarketDetailResponse.js";
|
|
16
|
+
export * from "./MarketDetailResponseProvider.js";
|
|
17
|
+
export * from "./MarketDetailResponseStatus.js";
|
|
9
18
|
export * from "./MarketsListResponse.js";
|
|
10
19
|
export * from "./PaginationBlock.js";
|
|
11
20
|
export * from "./PaymentRequiredErrorAction.js";
|