@predictorsdk/client 0.6.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 +5 -3
- package/dist/Client.js +5 -3
- package/dist/api/client/requests/GetMarketRequest.d.ts +2 -2
- package/dist/api/types/MarketDetailOutcome.d.ts +14 -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 +16 -3
- package/dist/api/types/index.d.ts +4 -0
- package/dist/api/types/index.js +4 -0
- package/dist/serialization/types/MarketDetailOutcome.d.ts +7 -0
- package/dist/serialization/types/MarketDetailOutcome.js +7 -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 +8 -0
- package/dist/serialization/types/MarketDetailResponse.js +8 -0
- package/dist/serialization/types/index.d.ts +4 -0
- package/dist/serialization/types/index.js +4 -0
- package/package.json +1 -1
package/dist/Client.d.ts
CHANGED
|
@@ -47,9 +47,11 @@ export declare class PredictorSDKClient {
|
|
|
47
47
|
getMarkets(request?: PredictorSDK.GetMarketsRequest, requestOptions?: PredictorSDKClient.RequestOptions): core.HttpResponsePromise<PredictorSDK.MarketsListResponse>;
|
|
48
48
|
private __getMarkets;
|
|
49
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:
|
|
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
51
|
*
|
|
52
|
-
*
|
|
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).
|
|
53
55
|
*
|
|
54
56
|
* @param {PredictorSDK.GetMarketRequest} request
|
|
55
57
|
* @param {PredictorSDKClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -65,7 +67,7 @@ export declare class PredictorSDKClient {
|
|
|
65
67
|
*
|
|
66
68
|
* @example
|
|
67
69
|
* await client.getMarket({
|
|
68
|
-
* marketId: "kalshi:
|
|
70
|
+
* marketId: "kalshi:KXNBA-26-SAS"
|
|
69
71
|
* })
|
|
70
72
|
*/
|
|
71
73
|
getMarket(request: PredictorSDK.GetMarketRequest, requestOptions?: PredictorSDKClient.RequestOptions): core.HttpResponsePromise<PredictorSDK.MarketDetailResponse>;
|
package/dist/Client.js
CHANGED
|
@@ -250,9 +250,11 @@ export class PredictorSDKClient {
|
|
|
250
250
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/markets");
|
|
251
251
|
}
|
|
252
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:
|
|
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
254
|
*
|
|
255
|
-
*
|
|
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).
|
|
256
258
|
*
|
|
257
259
|
* @param {PredictorSDK.GetMarketRequest} request
|
|
258
260
|
* @param {PredictorSDKClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -268,7 +270,7 @@ export class PredictorSDKClient {
|
|
|
268
270
|
*
|
|
269
271
|
* @example
|
|
270
272
|
* await client.getMarket({
|
|
271
|
-
* marketId: "kalshi:
|
|
273
|
+
* marketId: "kalshi:KXNBA-26-SAS"
|
|
272
274
|
* })
|
|
273
275
|
*/
|
|
274
276
|
getMarket(request, requestOptions) {
|
|
@@ -2,11 +2,11 @@ import type * as PredictorSDK from "../../index.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
5
|
-
* marketId: "kalshi:
|
|
5
|
+
* marketId: "kalshi:KXNBA-26-SAS"
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface GetMarketRequest {
|
|
9
|
-
/** Composite (`{provider}:{native_id}`) or platform-native market identifier. Examples per platform: Kalshi market ticker (`
|
|
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
10
|
marketId: string;
|
|
11
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
12
|
platform?: PredictorSDK.GetMarketRequestPlatform;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
export interface MarketDetailOutcome {
|
|
2
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
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;
|
|
4
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
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as PredictorSDK from "../index.js";
|
|
2
2
|
/**
|
|
3
|
-
* Single-market detail across all four supported platforms.
|
|
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
4
|
*/
|
|
5
5
|
export interface MarketDetailResponse {
|
|
6
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. */
|
|
@@ -9,10 +9,23 @@ export interface MarketDetailResponse {
|
|
|
9
9
|
provider: PredictorSDK.MarketDetailResponseProvider;
|
|
10
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
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
|
|
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
13
|
title: string;
|
|
14
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
15
|
status: PredictorSDK.MarketDetailResponseStatus;
|
|
16
|
-
/**
|
|
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
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;
|
|
18
31
|
}
|
|
@@ -8,6 +8,10 @@ export * from "./EventResponsePlatform.js";
|
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
9
|
export * from "./GetMarketRequestPlatform.js";
|
|
10
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";
|
|
11
15
|
export * from "./MarketDetailResponse.js";
|
|
12
16
|
export * from "./MarketDetailResponseProvider.js";
|
|
13
17
|
export * from "./MarketDetailResponseStatus.js";
|
package/dist/api/types/index.js
CHANGED
|
@@ -8,6 +8,10 @@ export * from "./EventResponsePlatform.js";
|
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
9
|
export * from "./GetMarketRequestPlatform.js";
|
|
10
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";
|
|
11
15
|
export * from "./MarketDetailResponse.js";
|
|
12
16
|
export * from "./MarketDetailResponseProvider.js";
|
|
13
17
|
export * from "./MarketDetailResponseStatus.js";
|
|
@@ -5,5 +5,12 @@ export declare const MarketDetailOutcome: core.serialization.ObjectSchema<serial
|
|
|
5
5
|
export declare namespace MarketDetailOutcome {
|
|
6
6
|
interface Raw {
|
|
7
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;
|
|
8
15
|
}
|
|
9
16
|
}
|
|
@@ -2,4 +2,11 @@
|
|
|
2
2
|
import * as core from "../../core/index.js";
|
|
3
3
|
export const MarketDetailOutcome = core.serialization.object({
|
|
4
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()),
|
|
5
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
|
+
}
|
|
@@ -2,6 +2,7 @@ import type * as PredictorSDK from "../../api/index.js";
|
|
|
2
2
|
import * as core from "../../core/index.js";
|
|
3
3
|
import type * as serializers from "../index.js";
|
|
4
4
|
import { MarketDetailOutcome } from "./MarketDetailOutcome.js";
|
|
5
|
+
import { MarketDetailPricing } from "./MarketDetailPricing.js";
|
|
5
6
|
import { MarketDetailResponseProvider } from "./MarketDetailResponseProvider.js";
|
|
6
7
|
import { MarketDetailResponseStatus } from "./MarketDetailResponseStatus.js";
|
|
7
8
|
export declare const MarketDetailResponse: core.serialization.ObjectSchema<serializers.MarketDetailResponse.Raw, PredictorSDK.MarketDetailResponse>;
|
|
@@ -13,5 +14,12 @@ export declare namespace MarketDetailResponse {
|
|
|
13
14
|
title: string;
|
|
14
15
|
status: MarketDetailResponseStatus.Raw;
|
|
15
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;
|
|
16
24
|
}
|
|
17
25
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import * as core from "../../core/index.js";
|
|
3
3
|
import { MarketDetailOutcome } from "./MarketDetailOutcome.js";
|
|
4
|
+
import { MarketDetailPricing } from "./MarketDetailPricing.js";
|
|
4
5
|
import { MarketDetailResponseProvider } from "./MarketDetailResponseProvider.js";
|
|
5
6
|
import { MarketDetailResponseStatus } from "./MarketDetailResponseStatus.js";
|
|
6
7
|
export const MarketDetailResponse = core.serialization.object({
|
|
@@ -10,4 +11,11 @@ export const MarketDetailResponse = core.serialization.object({
|
|
|
10
11
|
title: core.serialization.string(),
|
|
11
12
|
status: MarketDetailResponseStatus,
|
|
12
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()),
|
|
13
21
|
});
|
|
@@ -8,6 +8,10 @@ export * from "./EventResponsePlatform.js";
|
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
9
|
export * from "./GetMarketRequestPlatform.js";
|
|
10
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";
|
|
11
15
|
export * from "./MarketDetailResponse.js";
|
|
12
16
|
export * from "./MarketDetailResponseProvider.js";
|
|
13
17
|
export * from "./MarketDetailResponseStatus.js";
|
|
@@ -8,6 +8,10 @@ export * from "./EventResponsePlatform.js";
|
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
9
|
export * from "./GetMarketRequestPlatform.js";
|
|
10
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";
|
|
11
15
|
export * from "./MarketDetailResponse.js";
|
|
12
16
|
export * from "./MarketDetailResponseProvider.js";
|
|
13
17
|
export * from "./MarketDetailResponseStatus.js";
|