@liberfi.io/ui-predict 0.1.62 → 0.1.64
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/index.d.mts +2 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client-DgC5flVr.d.mts +201 -0
- package/dist/client-DgC5flVr.d.ts +201 -0
- package/dist/{index-DEqlfEAn.d.mts → index-BCkesJZQ.d.mts} +3 -201
- package/dist/{index-DEqlfEAn.d.ts → index-TBHCY2AW.d.ts} +3 -201
- package/dist/index.d.mts +26 -75
- package/dist/index.d.ts +26 -75
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/server-CUXRrxGG.d.ts +120 -0
- package/dist/server-Cb45Eqd0.d.mts +120 -0
- package/dist/server.d.mts +2 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +2 -0
- package/dist/server.mjs.map +1 -0
- package/package.json +16 -11
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import './client-DgC5flVr.js';
|
|
2
|
+
|
|
1
3
|
/** Supported prediction market providers */
|
|
2
4
|
type ProviderType = "dflow" | "kalshi" | "polymarket";
|
|
3
5
|
/** Market lifecycle status */
|
|
@@ -1214,206 +1216,6 @@ interface IPredictWsClient {
|
|
|
1214
1216
|
subscribeOrderbook(options: WsSubscribeOptions, onUpdate: (update: WsOrderbookUpdate) => void): () => void;
|
|
1215
1217
|
}
|
|
1216
1218
|
|
|
1217
|
-
/**
|
|
1218
|
-
* V2 types for the prediction-server REST API (/api/v1/events).
|
|
1219
|
-
*
|
|
1220
|
-
* These types are intentionally isolated from the legacy client types so that
|
|
1221
|
-
* the v1 (DFlow) and v2 (prediction-server) clients can coexist and be migrated
|
|
1222
|
-
* incrementally.
|
|
1223
|
-
*
|
|
1224
|
-
* Mirrors: github.com/liberfi-io/prediction-server/internal/domain
|
|
1225
|
-
*/
|
|
1226
|
-
/** Upstream data provider that produced a domain object. */
|
|
1227
|
-
type V2ProviderSource = "dflow" | "polymarket";
|
|
1228
|
-
/**
|
|
1229
|
-
* Provider-specific metadata attached to every domain aggregate.
|
|
1230
|
-
* Keys are namespaced field paths, e.g. "polymarket.conditionId" or "dflow.yesMint".
|
|
1231
|
-
* Values are raw JSON-decoded values.
|
|
1232
|
-
*/
|
|
1233
|
-
type V2ProviderMeta = Record<string, unknown>;
|
|
1234
|
-
/** Provider-sourced label attached to an Event. */
|
|
1235
|
-
interface V2Tag {
|
|
1236
|
-
slug: string;
|
|
1237
|
-
label: string;
|
|
1238
|
-
source: V2ProviderSource;
|
|
1239
|
-
provider_meta?: V2ProviderMeta;
|
|
1240
|
-
}
|
|
1241
|
-
/** Lifecycle status of a prediction event (normalised across all providers). */
|
|
1242
|
-
type V2EventStatus = "pending" | "open" | "closed" | "voided";
|
|
1243
|
-
/** Settlement / resolution data source for an event. */
|
|
1244
|
-
interface V2SettlementSource {
|
|
1245
|
-
url: string;
|
|
1246
|
-
name?: string;
|
|
1247
|
-
}
|
|
1248
|
-
/** Root aggregate for a prediction event from the prediction-server API. */
|
|
1249
|
-
interface V2Event {
|
|
1250
|
-
/** Internal database surrogate key (absent when not yet persisted). */
|
|
1251
|
-
id?: number;
|
|
1252
|
-
/**
|
|
1253
|
-
* Canonical business key shared across all providers.
|
|
1254
|
-
* - DFlow: ticker (e.g. "KXBTCD-25FEB-T68000")
|
|
1255
|
-
* - Polymarket: slug (e.g. "will-trump-win-2024")
|
|
1256
|
-
*/
|
|
1257
|
-
slug: string;
|
|
1258
|
-
title: string;
|
|
1259
|
-
subtitle?: string;
|
|
1260
|
-
description?: string;
|
|
1261
|
-
image_url?: string;
|
|
1262
|
-
status: V2EventStatus;
|
|
1263
|
-
/** ISO 8601 timestamp; absent if the provider does not supply it. */
|
|
1264
|
-
start_at?: string;
|
|
1265
|
-
end_at?: string;
|
|
1266
|
-
created_at?: string;
|
|
1267
|
-
updated_at?: string;
|
|
1268
|
-
/** Provider-sourced labels for display only. */
|
|
1269
|
-
tags?: V2Tag[];
|
|
1270
|
-
/** All values are USD amounts. */
|
|
1271
|
-
volume?: number;
|
|
1272
|
-
volume_24h?: number;
|
|
1273
|
-
liquidity?: number;
|
|
1274
|
-
open_interest?: number;
|
|
1275
|
-
settlement_sources?: V2SettlementSource[];
|
|
1276
|
-
/** Nested markets; omitted when the request used `with_markets=false`. */
|
|
1277
|
-
markets?: V2Market[];
|
|
1278
|
-
source: V2ProviderSource;
|
|
1279
|
-
provider_meta?: V2ProviderMeta;
|
|
1280
|
-
}
|
|
1281
|
-
/** Lifecycle status of a prediction market (normalised across all providers). */
|
|
1282
|
-
type V2MarketStatus = "pending" | "open" | "closed" | "voided";
|
|
1283
|
-
/** Final resolution of a closed market. Empty string means unresolved. */
|
|
1284
|
-
type V2MarketResult = "yes" | "no" | "voided" | "";
|
|
1285
|
-
/** One possible outcome in a binary (or multi-outcome) prediction market. */
|
|
1286
|
-
interface V2Outcome {
|
|
1287
|
-
/** Display name, e.g. "Yes" or "No". */
|
|
1288
|
-
label: string;
|
|
1289
|
-
/** Current implied probability [0, 1]. */
|
|
1290
|
-
price?: number;
|
|
1291
|
-
best_bid?: number;
|
|
1292
|
-
best_ask?: number;
|
|
1293
|
-
}
|
|
1294
|
-
/** Tradeable prediction outcome within an Event. */
|
|
1295
|
-
interface V2Market {
|
|
1296
|
-
id?: number;
|
|
1297
|
-
event_id?: number;
|
|
1298
|
-
slug: string;
|
|
1299
|
-
event_slug: string;
|
|
1300
|
-
question: string;
|
|
1301
|
-
description?: string;
|
|
1302
|
-
/** Resolution/settlement rules in order. */
|
|
1303
|
-
rules?: string[];
|
|
1304
|
-
status: V2MarketStatus;
|
|
1305
|
-
result?: V2MarketResult;
|
|
1306
|
-
start_at?: string;
|
|
1307
|
-
end_at?: string;
|
|
1308
|
-
expires_at?: string;
|
|
1309
|
-
created_at?: string;
|
|
1310
|
-
updated_at?: string;
|
|
1311
|
-
/** Always present; binary markets have exactly 2 outcomes (YES at [0], NO at [1]). */
|
|
1312
|
-
outcomes: V2Outcome[];
|
|
1313
|
-
volume?: number;
|
|
1314
|
-
volume_24h?: number;
|
|
1315
|
-
liquidity?: number;
|
|
1316
|
-
open_interest?: number;
|
|
1317
|
-
source: V2ProviderSource;
|
|
1318
|
-
provider_meta?: V2ProviderMeta;
|
|
1319
|
-
}
|
|
1320
|
-
/** Generic paginated result set returned by the prediction-server list endpoints. */
|
|
1321
|
-
interface V2Page<T> {
|
|
1322
|
-
items: T[];
|
|
1323
|
-
next_cursor?: string;
|
|
1324
|
-
has_more?: boolean;
|
|
1325
|
-
limit?: number;
|
|
1326
|
-
/** Not all backends support total count. */
|
|
1327
|
-
total?: number;
|
|
1328
|
-
}
|
|
1329
|
-
/** Valid sort fields accepted by `GET /api/v1/events`. */
|
|
1330
|
-
type V2EventSortField = "volume" | "volume_24h" | "liquidity" | "open_interest" | "end_at" | "start_at" | "created_at";
|
|
1331
|
-
/** Query parameters for `listEvents`. All fields are optional. */
|
|
1332
|
-
interface V2ListEventsParams {
|
|
1333
|
-
/** Page size. Server default: 20. */
|
|
1334
|
-
limit?: number;
|
|
1335
|
-
/** Opaque pagination cursor returned by the previous page's `next_cursor`. */
|
|
1336
|
-
cursor?: string;
|
|
1337
|
-
/** Filter by event lifecycle status. */
|
|
1338
|
-
status?: V2EventStatus;
|
|
1339
|
-
/** Filter by upstream provider. */
|
|
1340
|
-
source?: V2ProviderSource;
|
|
1341
|
-
/** Unified navigation tag slug (e.g. "politics", "sports"). */
|
|
1342
|
-
tag_slug?: string;
|
|
1343
|
-
/** Full-text search query. */
|
|
1344
|
-
search?: string;
|
|
1345
|
-
/** Field to sort by. */
|
|
1346
|
-
sort_by?: V2EventSortField;
|
|
1347
|
-
/** When `true`, sort ascending. Defaults to descending. */
|
|
1348
|
-
sort_asc?: boolean;
|
|
1349
|
-
/**
|
|
1350
|
-
* When `false`, markets are omitted from each event for lighter payloads.
|
|
1351
|
-
* Defaults to `true` on the server.
|
|
1352
|
-
*/
|
|
1353
|
-
with_markets?: boolean;
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
/**
|
|
1357
|
-
* HTTP client for the prediction-server REST API (v2 / prediction-server backend).
|
|
1358
|
-
*
|
|
1359
|
-
* Covers `GET /api/v1/events` (listEvents), `GET /api/v1/events/:slug` (getEvent),
|
|
1360
|
-
* and `GET /api/v1/markets/:slug` (getMarket).
|
|
1361
|
-
*
|
|
1362
|
-
* This client is intentionally decoupled from the legacy `DflowPredictClient` so
|
|
1363
|
-
* that both can be used in parallel during the incremental migration from the old
|
|
1364
|
-
* DFlow-direct integration to the unified prediction-server backend.
|
|
1365
|
-
*
|
|
1366
|
-
* @example
|
|
1367
|
-
* ```ts
|
|
1368
|
-
* const client = new PredictClientV2("https://api.example.com");
|
|
1369
|
-
* const page = await client.listEvents({ status: "open", limit: 20 });
|
|
1370
|
-
* const event = await client.getEvent("will-trump-win-2024");
|
|
1371
|
-
* const market = await client.getMarket("will-trump-win-2024-yes");
|
|
1372
|
-
* ```
|
|
1373
|
-
*/
|
|
1374
|
-
declare class PredictClientV2 {
|
|
1375
|
-
private readonly endpoint;
|
|
1376
|
-
constructor(endpoint: string);
|
|
1377
|
-
/**
|
|
1378
|
-
* List prediction events with optional filtering, sorting, and pagination.
|
|
1379
|
-
*
|
|
1380
|
-
* Maps to `GET /api/v1/events`.
|
|
1381
|
-
*
|
|
1382
|
-
* @param params - Optional query parameters (filter, sort, pagination).
|
|
1383
|
-
* @returns A paginated page of events.
|
|
1384
|
-
*/
|
|
1385
|
-
listEvents(params?: V2ListEventsParams): Promise<V2Page<V2Event>>;
|
|
1386
|
-
/**
|
|
1387
|
-
* Fetch a single prediction event by its slug.
|
|
1388
|
-
*
|
|
1389
|
-
* Maps to `GET /api/v1/events/:slug?source=...`.
|
|
1390
|
-
*
|
|
1391
|
-
* @param slug - Canonical event slug (e.g. "will-trump-win-2024" for Polymarket
|
|
1392
|
-
* or "KXBTCD-25FEB-T68000" for DFlow).
|
|
1393
|
-
* @param source - Upstream provider (`"dflow"` or `"polymarket"`).
|
|
1394
|
-
* @returns The matching event.
|
|
1395
|
-
* @throws When the server responds with 404 or any other non-2xx status.
|
|
1396
|
-
*/
|
|
1397
|
-
getEvent(slug: string, source?: V2ProviderSource): Promise<V2Event>;
|
|
1398
|
-
/**
|
|
1399
|
-
* Fetch a single prediction market by its slug.
|
|
1400
|
-
*
|
|
1401
|
-
* Maps to `GET /api/v1/markets/:slug?source=...`.
|
|
1402
|
-
*
|
|
1403
|
-
* @param slug - Canonical market slug.
|
|
1404
|
-
* @param source - Upstream provider (`"dflow"` or `"polymarket"`).
|
|
1405
|
-
* @returns The matching market.
|
|
1406
|
-
* @throws When the server responds with 404 or any other non-2xx status.
|
|
1407
|
-
*/
|
|
1408
|
-
getMarket(slug: string, source?: V2ProviderSource): Promise<V2Market>;
|
|
1409
|
-
}
|
|
1410
|
-
/**
|
|
1411
|
-
* Factory function for `PredictClientV2`.
|
|
1412
|
-
*
|
|
1413
|
-
* @param endpoint - Base URL of the prediction-server, without a trailing slash.
|
|
1414
|
-
*/
|
|
1415
|
-
declare function createPredictClientV2(endpoint: string): PredictClientV2;
|
|
1416
|
-
|
|
1417
1219
|
/**
|
|
1418
1220
|
* Build a query string from a params object.
|
|
1419
1221
|
* Skips `undefined` and `null` values.
|
|
@@ -1615,4 +1417,4 @@ declare class DflowPredictWsClient implements IPredictWsClient {
|
|
|
1615
1417
|
*/
|
|
1616
1418
|
declare function createDflowPredictWsClient(config: WsClientConfig): DflowPredictWsClient;
|
|
1617
1419
|
|
|
1618
|
-
export { type
|
|
1420
|
+
export { type IntentSwapRequestBody as $, type SearchQueryParams as A, type SearchResponse as B, type CandlesticksResponse as C, type WalletPositionsResponse as D, type EventQueryParams as E, type ForecastPercentileHistoryQueryParams as F, type OutcomeMintsQueryParams as G, type OutcomeMintsResponse as H, type IPredictClient as I, type FilterOutcomeMintsRequest as J, type FilterOutcomeMintsResponse as K, type LiveDataQueryParams as L, type MarketQueryParams as M, type QuoteResponse as N, type OrderResponse as O, type PositionsByWalletQueryParams as P, type QuoteQueryParams as Q, type SwapRequestBody as R, type StandardEvent as S, type TradesQueryParams as T, type SwapResponse as U, type SwapInstructionsResponse as V, type WalletPositionItem as W, type OrderQueryParams as X, type OrderStatusQueryParams as Y, type IntentQuoteQueryParams as Z, type IntentQuoteResponse as _, type StandardMarket as a, type IntentSwapResponse as a0, type PredictionMarketInitQueryParams as a1, type PredictionMarketInitResponse as a2, type TokenListResponse as a3, type TokenListWithDecimalsResponse as a4, type VenueListResponse as a5, type WsConnectionStatus as a6, type WsPriceUpdate as a7, type WsTradeUpdate as a8, type WsOrderbookUpdate as a9, type OrderRevert as aA, type IntentExpiry as aB, type TokenWithDecimals as aC, type OrderbookQueryParams as aD, type PrioritizationFeeLamports as aE, type DestinationTokenAccountParam as aF, type CreateFeeAccountParams as aG, type PositiveSlippageParams as aH, type WsSubscribeOptions as aI, BasePredictClient as aJ, buildQuery as aK, toRecord as aL, DflowPredictClient as aM, DflowPredictWsClient as aN, createDflowPredictWsClient as aO, type WsClientConfig as aP, type ProviderType as aa, type MarketStatus as ab, type SortField as ac, type SortOrder as ad, type OrderStatus as ae, type PlatformFeeMode as af, type SlippageTolerance as ag, type PriorityLevel as ah, type ExecutionMode as ai, type SettlementSource as aj, type MarketAccountInfo as ak, type OnchainTrade as al, type OnchainTradeSortBy as am, type OnchainTradesBaseQueryParams as an, type CandlestickOHLC as ao, type CandlestickDataPoint as ap, type ForecastPercentileDataPoint as aq, type SeriesSettlementSource as ar, type RoutePlanLeg as as, type PlatformFee as at, type ComputeBudgetInfo as au, type PrioritizationType as av, type AccountMetaResponse as aw, type InstructionResponse as ax, type BlockhashWithMetadata as ay, type OrderFill as az, type OrderStatusResponse as b, type SeriesResponse as c, type OrderbookLevel as d, type SingleTradeResponse as e, type IPredictWsClient as f, type StandardEventsResponse as g, type StandardMarketsResponse as h, type MarketsBatchRequest as i, type OrderbookResponse as j, type MultiTradeResponse as k, type TradesByMintQueryParams as l, type OnchainTradesByWalletQueryParams as m, type MultiOnchainTradeResponse as n, type OnchainTradesByEventQueryParams as o, type OnchainTradesByMarketQueryParams as p, type CandlesticksQueryParams as q, type ForecastPercentileHistoryResponse as r, type ForecastPercentileHistoryByMintQueryParams as s, type LiveDataResponse as t, type LiveDataByEventQueryParams as u, type LiveDataByMintQueryParams as v, type SeriesQueryParams as w, type SeriesListResponse as x, type TagsByCategoriesResponse as y, type FiltersBySportsResponse as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { S as StandardEvent, a as StandardMarket, E as EventQueryParams,
|
|
3
|
-
export {
|
|
2
|
+
import { S as StandardEvent, a as StandardMarket, E as EventQueryParams, O as OrderResponse, b as OrderStatusResponse, c as SeriesResponse, C as CandlesticksResponse, d as OrderbookLevel, e as SingleTradeResponse, I as IPredictClient, f as IPredictWsClient, W as WalletPositionItem, g as StandardEventsResponse, M as MarketQueryParams, h as StandardMarketsResponse, i as MarketsBatchRequest, j as OrderbookResponse, T as TradesQueryParams, k as MultiTradeResponse, l as TradesByMintQueryParams, m as OnchainTradesByWalletQueryParams, n as MultiOnchainTradeResponse, o as OnchainTradesByEventQueryParams, p as OnchainTradesByMarketQueryParams, q as CandlesticksQueryParams, F as ForecastPercentileHistoryQueryParams, r as ForecastPercentileHistoryResponse, s as ForecastPercentileHistoryByMintQueryParams, L as LiveDataQueryParams, t as LiveDataResponse, u as LiveDataByEventQueryParams, v as LiveDataByMintQueryParams, w as SeriesQueryParams, x as SeriesListResponse, y as TagsByCategoriesResponse, z as FiltersBySportsResponse, A as SearchQueryParams, B as SearchResponse, P as PositionsByWalletQueryParams, D as WalletPositionsResponse, G as OutcomeMintsQueryParams, H as OutcomeMintsResponse, J as FilterOutcomeMintsRequest, K as FilterOutcomeMintsResponse, Q as QuoteQueryParams, N as QuoteResponse, R as SwapRequestBody, U as SwapResponse, V as SwapInstructionsResponse, X as OrderQueryParams, Y as OrderStatusQueryParams, Z as IntentQuoteQueryParams, _ as IntentQuoteResponse, $ as IntentSwapRequestBody, a0 as IntentSwapResponse, a1 as PredictionMarketInitQueryParams, a2 as PredictionMarketInitResponse, a3 as TokenListResponse, a4 as TokenListWithDecimalsResponse, a5 as VenueListResponse, a6 as WsConnectionStatus, a7 as WsPriceUpdate, a8 as WsTradeUpdate, a9 as WsOrderbookUpdate } from './index-BCkesJZQ.mjs';
|
|
3
|
+
export { aw as AccountMetaResponse, aJ as BasePredictClient, ay as BlockhashWithMetadata, ap as CandlestickDataPoint, ao as CandlestickOHLC, au as ComputeBudgetInfo, aG as CreateFeeAccountParams, aF as DestinationTokenAccountParam, aM as DflowPredictClient, aN as DflowPredictWsClient, ai as ExecutionMode, aq as ForecastPercentileDataPoint, ax as InstructionResponse, aB as IntentExpiry, ak as MarketAccountInfo, ab as MarketStatus, al as OnchainTrade, am as OnchainTradeSortBy, an as OnchainTradesBaseQueryParams, az as OrderFill, aA as OrderRevert, ae as OrderStatus, aD as OrderbookQueryParams, at as PlatformFee, af as PlatformFeeMode, aH as PositiveSlippageParams, aM as PredictClient, aN as PredictWsClient, aE as PrioritizationFeeLamports, av as PrioritizationType, ah as PriorityLevel, aa as ProviderType, as as RoutePlanLeg, ar as SeriesSettlementSource, aj as SettlementSource, ag as SlippageTolerance, ac as SortField, ad as SortOrder, aC as TokenWithDecimals, aP as WsClientConfig, aI as WsSubscribeOptions, aK as buildQuery, aO as createDflowPredictWsClient, aO as createPredictWsClient, aL as toRecord } from './index-BCkesJZQ.mjs';
|
|
4
4
|
import { LinkComponentType } from '@liberfi.io/ui';
|
|
5
|
+
import { V as V2EventSortField, a as V2ProviderSource, b as V2Event, c as V2Market, d as V2EventStatus, e as V2Page, P as PredictClientV2, f as V2ListEventsParams } from './client-DgC5flVr.mjs';
|
|
6
|
+
export { h as V2MarketResult, i as V2MarketStatus, j as V2Outcome, k as V2ProviderMeta, l as V2SettlementSource, m as V2Tag, g as createPredictClientV2 } from './client-DgC5flVr.mjs';
|
|
7
|
+
import { C as ChartRangeType, a as CandlestickPeriodType } from './server-Cb45Eqd0.mjs';
|
|
8
|
+
export { g as CHART_RANGE_DURATION, e as CHART_RANGE_PERIOD, f as CHART_RANGE_SAMPLE_INTERVAL, c as CandlestickPeriod, b as ChartRange, d as DEFAULT_CHART_RANGE, D as DEFAULT_PAGE_SIZE, l as DEFAULT_PRICE_HISTORY_INTERVAL, M as MAX_PRICE_HISTORY_MARKETS, j as ORDER_MAX_PRICE, i as ORDER_MIN_PRICE, O as ORDER_MIN_QUANTITY, h as ORDER_PRICE_STEP, m as PRICE_HISTORY_SAMPLE_INTERVAL, P as PriceHistoryInterval, k as PriceHistoryIntervalType, R as ResolveEventsV2ParamsInput, n as eventV2QueryKey, q as eventsV2InfiniteQueryKey, o as fetchEventV2, s as fetchEventsV2Page, p as resolveEventsV2Params, r as resolveTagSlug } from './server-Cb45Eqd0.mjs';
|
|
5
9
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
10
|
import { UseQueryOptions, UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
|
|
7
11
|
import * as react from 'react';
|
|
@@ -14,7 +18,7 @@ declare global {
|
|
|
14
18
|
};
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
|
-
declare const _default: "0.1.
|
|
21
|
+
declare const _default: "0.1.64";
|
|
18
22
|
|
|
19
23
|
interface EventsPageProps {
|
|
20
24
|
/** Callback when an event is selected */
|
|
@@ -348,67 +352,6 @@ type EventItemV2UIProps = {
|
|
|
348
352
|
};
|
|
349
353
|
declare function EventItemV2UI({ event, href, LinkComponent, onSelect, onSelectOutcome, onHover, }: EventItemV2UIProps): react_jsx_runtime.JSX.Element;
|
|
350
354
|
|
|
351
|
-
/** Default page size for list queries */
|
|
352
|
-
declare const DEFAULT_PAGE_SIZE = 48;
|
|
353
|
-
/** Maximum number of markets to display in price history chart */
|
|
354
|
-
declare const MAX_PRICE_HISTORY_MARKETS = 4;
|
|
355
|
-
/**
|
|
356
|
-
* Candlestick period intervals in minutes (granularity for API queries)
|
|
357
|
-
*/
|
|
358
|
-
declare const CandlestickPeriod: {
|
|
359
|
-
/** 1 minute */
|
|
360
|
-
readonly ONE_MINUTE: 1;
|
|
361
|
-
/** 1 hour (60 minutes) */
|
|
362
|
-
readonly ONE_HOUR: 60;
|
|
363
|
-
/** 1 day (1440 minutes) */
|
|
364
|
-
readonly ONE_DAY: 1440;
|
|
365
|
-
};
|
|
366
|
-
type CandlestickPeriodType = (typeof CandlestickPeriod)[keyof typeof CandlestickPeriod];
|
|
367
|
-
/**
|
|
368
|
-
* Chart range options (the user-facing time range selector)
|
|
369
|
-
*/
|
|
370
|
-
declare const ChartRange: {
|
|
371
|
-
/** 1 day */
|
|
372
|
-
readonly ONE_DAY: "1d";
|
|
373
|
-
/** 1 week */
|
|
374
|
-
readonly ONE_WEEK: "1w";
|
|
375
|
-
/** 1 month */
|
|
376
|
-
readonly ONE_MONTH: "1m";
|
|
377
|
-
/** All time */
|
|
378
|
-
readonly ALL: "all";
|
|
379
|
-
};
|
|
380
|
-
type ChartRangeType = (typeof ChartRange)[keyof typeof ChartRange];
|
|
381
|
-
/** Default chart range */
|
|
382
|
-
declare const DEFAULT_CHART_RANGE: "all";
|
|
383
|
-
/** Candlestick granularity derived from chart range (1D → minute, 1W/1M → hourly, ALL → daily) */
|
|
384
|
-
declare const CHART_RANGE_PERIOD: Record<ChartRangeType, CandlestickPeriodType>;
|
|
385
|
-
/** Chart sampling interval in seconds (used to downsample candlestick data for display) */
|
|
386
|
-
declare const CHART_RANGE_SAMPLE_INTERVAL: Record<ChartRangeType, number>;
|
|
387
|
-
/** Duration in seconds for each chart range (null = all time) */
|
|
388
|
-
declare const CHART_RANGE_DURATION: Record<ChartRangeType, number | null>;
|
|
389
|
-
/** Minimum order quantity (contracts) */
|
|
390
|
-
declare const ORDER_MIN_QUANTITY = 1;
|
|
391
|
-
/** Price step size in cents */
|
|
392
|
-
declare const ORDER_PRICE_STEP = 1;
|
|
393
|
-
/** Minimum price in cents */
|
|
394
|
-
declare const ORDER_MIN_PRICE = 1;
|
|
395
|
-
/** Maximum price in cents */
|
|
396
|
-
declare const ORDER_MAX_PRICE = 99;
|
|
397
|
-
/** @deprecated Use ChartRange instead */
|
|
398
|
-
declare const PriceHistoryInterval: {
|
|
399
|
-
readonly ONE_HOUR: "1h";
|
|
400
|
-
readonly SIX_HOURS: "6h";
|
|
401
|
-
readonly ONE_DAY: "1d";
|
|
402
|
-
readonly ONE_WEEK: "1w";
|
|
403
|
-
readonly MAX: "max";
|
|
404
|
-
};
|
|
405
|
-
/** @deprecated Use ChartRangeType instead */
|
|
406
|
-
type PriceHistoryIntervalType = (typeof PriceHistoryInterval)[keyof typeof PriceHistoryInterval];
|
|
407
|
-
/** @deprecated Use DEFAULT_CHART_RANGE instead */
|
|
408
|
-
declare const DEFAULT_PRICE_HISTORY_INTERVAL: "1w";
|
|
409
|
-
/** @deprecated */
|
|
410
|
-
declare const PRICE_HISTORY_SAMPLE_INTERVAL: Record<PriceHistoryIntervalType, number>;
|
|
411
|
-
|
|
412
355
|
/** Trade outcome - yes or no */
|
|
413
356
|
type TradeOutcome = "yes" | "no";
|
|
414
357
|
/** Trade side - buy or sell */
|
|
@@ -1283,16 +1226,6 @@ declare function fetchEventsV2(client: PredictClientV2, params?: V2ListEventsPar
|
|
|
1283
1226
|
*/
|
|
1284
1227
|
declare function useEventsV2Query(params?: V2ListEventsParams, queryOptions?: Omit<UseQueryOptions<V2Page<V2Event>, Error, V2Page<V2Event>, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Page<V2Event>, Error>;
|
|
1285
1228
|
|
|
1286
|
-
/** Stable TanStack Query key for a single v2 event. */
|
|
1287
|
-
declare function eventV2QueryKey(slug: string, source?: V2ProviderSource): unknown[];
|
|
1288
|
-
/**
|
|
1289
|
-
* Fetch function that can be used outside of React (e.g. in loaders or tests).
|
|
1290
|
-
*
|
|
1291
|
-
* @param client - A `PredictClientV2` instance.
|
|
1292
|
-
* @param slug - Canonical event slug.
|
|
1293
|
-
* @param source - Upstream provider (`"dflow"` or `"polymarket"`).
|
|
1294
|
-
*/
|
|
1295
|
-
declare function fetchEventV2(client: PredictClientV2, slug: string, source?: V2ProviderSource): Promise<V2Event>;
|
|
1296
1229
|
interface UseEventV2QueryParams {
|
|
1297
1230
|
/** Canonical event slug (e.g. "will-trump-win-2024" or "KXBTCD-25FEB-T68000"). */
|
|
1298
1231
|
slug: string;
|
|
@@ -1312,6 +1245,24 @@ interface UseEventV2QueryParams {
|
|
|
1312
1245
|
*/
|
|
1313
1246
|
declare function useEventV2Query(params: UseEventV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2Event, Error, V2Event, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Event, Error>;
|
|
1314
1247
|
|
|
1248
|
+
type InfiniteQueryOptions = Omit<UseInfiniteQueryOptions<V2Page<V2Event>, Error, InfiniteData<V2Page<V2Event>>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
1249
|
+
/**
|
|
1250
|
+
* TanStack Query infinite-query hook for `GET /api/v1/events` with cursor-based
|
|
1251
|
+
* pagination via the prediction-server v2 client.
|
|
1252
|
+
*
|
|
1253
|
+
* @param params - Resolved query parameters (use {@link resolveEventsV2Params}
|
|
1254
|
+
* to build from user inputs). Do NOT include `cursor` — it is
|
|
1255
|
+
* managed automatically by TanStack Query's `pageParam`.
|
|
1256
|
+
* @param queryOptions - Additional TanStack Query options.
|
|
1257
|
+
*
|
|
1258
|
+
* @example
|
|
1259
|
+
* ```tsx
|
|
1260
|
+
* const params = resolveEventsV2Params({ status: "open", limit: 20 });
|
|
1261
|
+
* const { data, hasNextPage, fetchNextPage } = useEventsV2InfiniteQuery(params);
|
|
1262
|
+
* ```
|
|
1263
|
+
*/
|
|
1264
|
+
declare function useEventsV2InfiniteQuery(params: V2ListEventsParams, queryOptions?: InfiniteQueryOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<V2Page<V2Event>, unknown>, Error>;
|
|
1265
|
+
|
|
1315
1266
|
interface UseSearchEventsInfiniteQueryParams {
|
|
1316
1267
|
/** Search keyword */
|
|
1317
1268
|
keyword: string;
|
|
@@ -1709,4 +1660,4 @@ interface UseOrderbookSubscriptionResult {
|
|
|
1709
1660
|
*/
|
|
1710
1661
|
declare function useOrderbookSubscription({ client, all, tickers, enabled, onUpdate, }: UseOrderbookSubscriptionParams): UseOrderbookSubscriptionResult;
|
|
1711
1662
|
|
|
1712
|
-
export { CATEGORIES_V2,
|
|
1663
|
+
export { CATEGORIES_V2, CandlestickPeriodType, CandlesticksQueryParams, CandlesticksResponse, CategoriesSkeleton, CategoriesUI, type CategoriesUIProps, CategoriesWidget, type CategoriesWidgetProps, CategoriesWidgetV2, type CategoriesWidgetV2Props, type CategoryItemV2, type CategorySelection, ChartRangeType, DEFAULT_FILTER_STATE, type EventCategory, EventDetailPage, type EventDetailPageProps, EventDetailPageV2, type EventDetailPageV2Props, EventDetailSkeleton, type EventDetailSkeletonProps, EventDetailUI, type EventDetailUIProps, EventDetailV2UI, type EventDetailV2UIProps, EventDetailWidget, type EventDetailWidgetProps, EventDetailWidgetV2, type EventDetailWidgetV2Props, EventItemSkeleton, type EventItemSkeletonProps, EventItemUI, type EventItemUIProps, EventItemV2UI, type EventItemV2UIProps, EventMarketDetailWidget, type EventMarketDetailWidgetProps, EventQueryParams, type EventsFilterState, EventsFilterV2UI, type EventsFilterV2UIProps, EventsPage, type EventsPageProps, EventsPageV2, type EventsPageV2Props, EventsSkeleton, type EventsSkeletonProps, EventsToolbarV2UI, type EventsToolbarV2UIProps, EventsUI, type EventsUIProps, EventsV2UI, type EventsV2UIProps, EventsWidget, type EventsWidgetProps, EventsWidgetV2, type EventsWidgetV2Props, FilterOutcomeMintsRequest, FilterOutcomeMintsResponse, FiltersBySportsResponse, ForecastPercentileHistoryByMintQueryParams, ForecastPercentileHistoryQueryParams, ForecastPercentileHistoryResponse, IPredictClient, IPredictWsClient, IntentQuoteQueryParams, IntentQuoteResponse, IntentSwapRequestBody, IntentSwapResponse, LiveDataByEventQueryParams, LiveDataByMintQueryParams, LiveDataQueryParams, LiveDataResponse, type MarketPositionsResult, MarketQueryParams, MarketsBatchRequest, MultiOnchainTradeResponse, MultiTradeResponse, OnchainTradesByEventQueryParams, OnchainTradesByMarketQueryParams, OnchainTradesByWalletQueryParams, OpenOrdersUI, type OpenOrdersUIProps, OpenOrdersWidget, type OpenOrdersWidgetProps, type Order, type OrderBookRow, OrderBookUI, type OrderBookUIProps, OrderBookWidget, type OrderBookWidgetProps, OrderQueryParams, OrderResponse, OrderStatusQueryParams, OrderStatusResponse, type OrderbookData, OrderbookLevel, OrderbookResponse, OutcomeMintsQueryParams, OutcomeMintsResponse, PREDICT_SEARCH_MODAL_ID, type Position, PositionsByWalletQueryParams, type PositionsSummary, PositionsUI, type PositionsUIProps, PositionsWidget, type PositionsWidgetProps, PredictClientV2, PredictContext, type PredictContextValue, PredictProvider, type PredictProviderProps, PredictSearchModal, type PredictSearchModalParams, type PredictSearchModalResult, PredictV2Context, type PredictV2ContextValue, PredictV2Provider, type PredictV2ProviderProps, PredictionMarketInitQueryParams, PredictionMarketInitResponse, type PriceData, QuoteQueryParams, QuoteResponse, SORT_PRESETS, SearchEventsButton, type SearchEventsButtonProps, SearchHistoryUI, type SearchHistoryUIProps, SearchHistoryWidget, type SearchHistoryWidgetProps, SearchInputUI, type SearchInputUIProps, SearchQueryParams, SearchResponse, SearchResultItemUI, type SearchResultItemUIProps, SearchResultListWidget, type SearchResultListWidgetProps, SearchWidget, type SearchWidgetProps, SeriesListResponse, SeriesQueryParams, SeriesResponse, SingleTradeResponse, type SortPreset, StandardEvent, StandardEventsResponse, StandardMarket, StandardMarketsResponse, SwapInstructionsResponse, SwapRequestBody, SwapResponse, type TagItemV2, type TagSlugSelection, TagsByCategoriesResponse, TokenListResponse, TokenListWithDecimalsResponse, type TradeData, TradeFormSkeleton, TradeFormUI, type TradeFormUIProps, type TradeFormValidation, TradeFormWidget, type TradeFormWidgetProps, TradeHistoryUI, type TradeHistoryUIProps, TradeHistoryWidget, type TradeHistoryWidgetProps, type TradeOutcome, type TradeSide, TradesByMintQueryParams, TradesQueryParams, type UseEventByIdQueryParams, type UseEventCandlesticksParams, type UseEventDetailParams, type UseEventDetailV2Params, type UseEventV2QueryParams, type UseEventsCategoriesResult, type UseEventsParams, type UseEventsResult, type UseEventsV2Params, type UseEventsV2Result, type UseMarketByIdQueryParams, type UseMarketCandlesticksByMintParams, type UseMarketCandlesticksParams, type UseMarketV2QueryParams, type UseOpenOrdersParams, type UseOpenOrdersResult, type UseOrderBookParams, type UseOrderBookResult, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UsePositionsParams, type UsePositionsResult, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseSearchEventsInfiniteQueryParams, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseTradeFormParams, type UseTradeFormResult, type UseTradeHistoryParams, type UseTradeHistoryResult, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWsClientResult, type UseWsConnectionParams, type UseWsConnectionResult, UserPredictContext, type UserPredictContextValue, UserPredictProvider, type UserPredictProviderProps, V2Event, V2EventSortField, V2EventStatus, V2ListEventsParams, V2Market, V2Page, V2ProviderSource, VenueListResponse, WalletPositionItem, WalletPositionsResponse, WsConnectionStatus, WsOrderbookUpdate, WsPriceUpdate, WsTradeUpdate, countActiveFilters, createSwap, createSwapInstructions, eventByIdQueryKey, eventCandlesticksQueryKey, eventsInfiniteQueryKey, eventsQueryKey, eventsV2QueryKey, fetchEventById, fetchEventCandlesticks, fetchEvents, fetchEventsV2, fetchFiltersBySports, fetchForecastPercentileHistory, fetchForecastPercentileHistoryByMint, fetchIntentQuote, fetchLiveData, fetchLiveDataByEvent, fetchLiveDataByMint, fetchMarketById, fetchMarketByMint, fetchMarketCandlesticks, fetchMarketCandlesticksByMint, fetchMarketV2, fetchMarkets, fetchMarketsBatch, fetchOnchainTradesByEvent, fetchOnchainTradesByMarket, fetchOnchainTradesByWallet, fetchOrder, fetchOrderBook, fetchOrderBookByMint, fetchOrderStatus, fetchOutcomeMints, fetchPositionsByWallet, fetchQuote, fetchSearch, fetchSeries, fetchSeriesByTicker, fetchTagsByCategories, fetchTokens, fetchTokensWithDecimals, fetchTrades, fetchTradesByMint, fetchVenues, filterOutcomeMints, filtersBySportsQueryKey, forecastPercentileHistoryByMintQueryKey, forecastPercentileHistoryQueryKey, initPredictionMarket, intentQuoteQueryKey, liveDataByEventQueryKey, liveDataByMintQueryKey, liveDataQueryKey, marketByIdQueryKey, marketByMintQueryKey, marketCandlesticksByMintQueryKey, marketCandlesticksQueryKey, marketV2QueryKey, marketsBatchQueryKey, marketsQueryKey, onchainTradesByEventInfiniteQueryKey, onchainTradesByEventQueryKey, onchainTradesByMarketInfiniteQueryKey, onchainTradesByMarketQueryKey, onchainTradesByWalletInfiniteQueryKey, onchainTradesByWalletQueryKey, orderBookByMintQueryKey, orderBookQueryKey, orderQueryKey, orderStatusQueryKey, outcomeMintsQueryKey, positionsByWalletQueryKey, quoteQueryKey, searchQueryKey, seriesByTickerQueryKey, seriesQueryKey, submitIntentSwap, tagsByCategoriesQueryKey, tokensQueryKey, tokensWithDecimalsQueryKey, tradesByMintQueryKey, tradesQueryKey, useCategoriesQuery, useCreateSwapInstructionsMutation, useCreateSwapMutation, useEventByIdQuery, useEventCandlesticksQuery, useEventDetail, useEventDetailV2, useEventV2Query, useEvents, useEventsCategories, useEventsInfiniteQuery, useEventsQuery, useEventsV2, useEventsV2InfiniteQuery, useEventsV2Query, useFilterOutcomeMintsMutation, useFiltersBySportsQuery, useForecastPercentileHistoryByMintQuery, useForecastPercentileHistoryQuery, useInitPredictionMarketMutation, useIntentQuoteQuery, useLiveDataByEventQuery, useLiveDataByMintQuery, useLiveDataQuery, useMarketByIdQuery, useMarketByMintQuery, useMarketCandlesticksByMintQuery, useMarketCandlesticksQuery, useMarketPositions, useMarketV2Query, useMarketsBatchQuery, useMarketsQuery, useOnchainTradesByEventInfiniteQuery, useOnchainTradesByEventQuery, useOnchainTradesByMarketInfiniteQuery, useOnchainTradesByMarketQuery, useOnchainTradesByWalletInfiniteQuery, useOnchainTradesByWalletQuery, useOpenOrders, useOrderBook, useOrderBookByMintQuery, useOrderBookQuery, useOrderQuery, useOrderStatusQuery, useOrderbookSubscription, useOutcomeMintsQuery, usePositions, usePositionsByWalletQuery, usePredictClient, usePredictContext, usePredictSearchHistory, usePredictV2Client, usePredictV2Context, usePriceHistoryQuery, usePricesSubscription, useQuoteQuery, useSearchEventsInfiniteQuery, useSearchQuery, useSearchResultListScript, useSearchScript, useSeriesByTickerQuery, useSeriesQuery, useSubmitIntentSwapMutation, useTagsByCategoriesQuery, useTokensQuery, useTokensWithDecimalsQuery, useTradeForm, useTradeHistory, useTradesByMintQuery, useTradesQuery, useTradesSubscription, useUserPredictContext, useVenuesQuery, useWsClient, useWsConnection, venuesQueryKey, _default as version };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { S as StandardEvent, a as StandardMarket, E as EventQueryParams,
|
|
3
|
-
export {
|
|
2
|
+
import { S as StandardEvent, a as StandardMarket, E as EventQueryParams, O as OrderResponse, b as OrderStatusResponse, c as SeriesResponse, C as CandlesticksResponse, d as OrderbookLevel, e as SingleTradeResponse, I as IPredictClient, f as IPredictWsClient, W as WalletPositionItem, g as StandardEventsResponse, M as MarketQueryParams, h as StandardMarketsResponse, i as MarketsBatchRequest, j as OrderbookResponse, T as TradesQueryParams, k as MultiTradeResponse, l as TradesByMintQueryParams, m as OnchainTradesByWalletQueryParams, n as MultiOnchainTradeResponse, o as OnchainTradesByEventQueryParams, p as OnchainTradesByMarketQueryParams, q as CandlesticksQueryParams, F as ForecastPercentileHistoryQueryParams, r as ForecastPercentileHistoryResponse, s as ForecastPercentileHistoryByMintQueryParams, L as LiveDataQueryParams, t as LiveDataResponse, u as LiveDataByEventQueryParams, v as LiveDataByMintQueryParams, w as SeriesQueryParams, x as SeriesListResponse, y as TagsByCategoriesResponse, z as FiltersBySportsResponse, A as SearchQueryParams, B as SearchResponse, P as PositionsByWalletQueryParams, D as WalletPositionsResponse, G as OutcomeMintsQueryParams, H as OutcomeMintsResponse, J as FilterOutcomeMintsRequest, K as FilterOutcomeMintsResponse, Q as QuoteQueryParams, N as QuoteResponse, R as SwapRequestBody, U as SwapResponse, V as SwapInstructionsResponse, X as OrderQueryParams, Y as OrderStatusQueryParams, Z as IntentQuoteQueryParams, _ as IntentQuoteResponse, $ as IntentSwapRequestBody, a0 as IntentSwapResponse, a1 as PredictionMarketInitQueryParams, a2 as PredictionMarketInitResponse, a3 as TokenListResponse, a4 as TokenListWithDecimalsResponse, a5 as VenueListResponse, a6 as WsConnectionStatus, a7 as WsPriceUpdate, a8 as WsTradeUpdate, a9 as WsOrderbookUpdate } from './index-TBHCY2AW.js';
|
|
3
|
+
export { aw as AccountMetaResponse, aJ as BasePredictClient, ay as BlockhashWithMetadata, ap as CandlestickDataPoint, ao as CandlestickOHLC, au as ComputeBudgetInfo, aG as CreateFeeAccountParams, aF as DestinationTokenAccountParam, aM as DflowPredictClient, aN as DflowPredictWsClient, ai as ExecutionMode, aq as ForecastPercentileDataPoint, ax as InstructionResponse, aB as IntentExpiry, ak as MarketAccountInfo, ab as MarketStatus, al as OnchainTrade, am as OnchainTradeSortBy, an as OnchainTradesBaseQueryParams, az as OrderFill, aA as OrderRevert, ae as OrderStatus, aD as OrderbookQueryParams, at as PlatformFee, af as PlatformFeeMode, aH as PositiveSlippageParams, aM as PredictClient, aN as PredictWsClient, aE as PrioritizationFeeLamports, av as PrioritizationType, ah as PriorityLevel, aa as ProviderType, as as RoutePlanLeg, ar as SeriesSettlementSource, aj as SettlementSource, ag as SlippageTolerance, ac as SortField, ad as SortOrder, aC as TokenWithDecimals, aP as WsClientConfig, aI as WsSubscribeOptions, aK as buildQuery, aO as createDflowPredictWsClient, aO as createPredictWsClient, aL as toRecord } from './index-TBHCY2AW.js';
|
|
4
4
|
import { LinkComponentType } from '@liberfi.io/ui';
|
|
5
|
+
import { V as V2EventSortField, a as V2ProviderSource, b as V2Event, c as V2Market, d as V2EventStatus, e as V2Page, P as PredictClientV2, f as V2ListEventsParams } from './client-DgC5flVr.js';
|
|
6
|
+
export { h as V2MarketResult, i as V2MarketStatus, j as V2Outcome, k as V2ProviderMeta, l as V2SettlementSource, m as V2Tag, g as createPredictClientV2 } from './client-DgC5flVr.js';
|
|
7
|
+
import { C as ChartRangeType, a as CandlestickPeriodType } from './server-CUXRrxGG.js';
|
|
8
|
+
export { g as CHART_RANGE_DURATION, e as CHART_RANGE_PERIOD, f as CHART_RANGE_SAMPLE_INTERVAL, c as CandlestickPeriod, b as ChartRange, d as DEFAULT_CHART_RANGE, D as DEFAULT_PAGE_SIZE, l as DEFAULT_PRICE_HISTORY_INTERVAL, M as MAX_PRICE_HISTORY_MARKETS, j as ORDER_MAX_PRICE, i as ORDER_MIN_PRICE, O as ORDER_MIN_QUANTITY, h as ORDER_PRICE_STEP, m as PRICE_HISTORY_SAMPLE_INTERVAL, P as PriceHistoryInterval, k as PriceHistoryIntervalType, R as ResolveEventsV2ParamsInput, n as eventV2QueryKey, q as eventsV2InfiniteQueryKey, o as fetchEventV2, s as fetchEventsV2Page, p as resolveEventsV2Params, r as resolveTagSlug } from './server-CUXRrxGG.js';
|
|
5
9
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
10
|
import { UseQueryOptions, UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
|
|
7
11
|
import * as react from 'react';
|
|
@@ -14,7 +18,7 @@ declare global {
|
|
|
14
18
|
};
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
|
-
declare const _default: "0.1.
|
|
21
|
+
declare const _default: "0.1.64";
|
|
18
22
|
|
|
19
23
|
interface EventsPageProps {
|
|
20
24
|
/** Callback when an event is selected */
|
|
@@ -348,67 +352,6 @@ type EventItemV2UIProps = {
|
|
|
348
352
|
};
|
|
349
353
|
declare function EventItemV2UI({ event, href, LinkComponent, onSelect, onSelectOutcome, onHover, }: EventItemV2UIProps): react_jsx_runtime.JSX.Element;
|
|
350
354
|
|
|
351
|
-
/** Default page size for list queries */
|
|
352
|
-
declare const DEFAULT_PAGE_SIZE = 48;
|
|
353
|
-
/** Maximum number of markets to display in price history chart */
|
|
354
|
-
declare const MAX_PRICE_HISTORY_MARKETS = 4;
|
|
355
|
-
/**
|
|
356
|
-
* Candlestick period intervals in minutes (granularity for API queries)
|
|
357
|
-
*/
|
|
358
|
-
declare const CandlestickPeriod: {
|
|
359
|
-
/** 1 minute */
|
|
360
|
-
readonly ONE_MINUTE: 1;
|
|
361
|
-
/** 1 hour (60 minutes) */
|
|
362
|
-
readonly ONE_HOUR: 60;
|
|
363
|
-
/** 1 day (1440 minutes) */
|
|
364
|
-
readonly ONE_DAY: 1440;
|
|
365
|
-
};
|
|
366
|
-
type CandlestickPeriodType = (typeof CandlestickPeriod)[keyof typeof CandlestickPeriod];
|
|
367
|
-
/**
|
|
368
|
-
* Chart range options (the user-facing time range selector)
|
|
369
|
-
*/
|
|
370
|
-
declare const ChartRange: {
|
|
371
|
-
/** 1 day */
|
|
372
|
-
readonly ONE_DAY: "1d";
|
|
373
|
-
/** 1 week */
|
|
374
|
-
readonly ONE_WEEK: "1w";
|
|
375
|
-
/** 1 month */
|
|
376
|
-
readonly ONE_MONTH: "1m";
|
|
377
|
-
/** All time */
|
|
378
|
-
readonly ALL: "all";
|
|
379
|
-
};
|
|
380
|
-
type ChartRangeType = (typeof ChartRange)[keyof typeof ChartRange];
|
|
381
|
-
/** Default chart range */
|
|
382
|
-
declare const DEFAULT_CHART_RANGE: "all";
|
|
383
|
-
/** Candlestick granularity derived from chart range (1D → minute, 1W/1M → hourly, ALL → daily) */
|
|
384
|
-
declare const CHART_RANGE_PERIOD: Record<ChartRangeType, CandlestickPeriodType>;
|
|
385
|
-
/** Chart sampling interval in seconds (used to downsample candlestick data for display) */
|
|
386
|
-
declare const CHART_RANGE_SAMPLE_INTERVAL: Record<ChartRangeType, number>;
|
|
387
|
-
/** Duration in seconds for each chart range (null = all time) */
|
|
388
|
-
declare const CHART_RANGE_DURATION: Record<ChartRangeType, number | null>;
|
|
389
|
-
/** Minimum order quantity (contracts) */
|
|
390
|
-
declare const ORDER_MIN_QUANTITY = 1;
|
|
391
|
-
/** Price step size in cents */
|
|
392
|
-
declare const ORDER_PRICE_STEP = 1;
|
|
393
|
-
/** Minimum price in cents */
|
|
394
|
-
declare const ORDER_MIN_PRICE = 1;
|
|
395
|
-
/** Maximum price in cents */
|
|
396
|
-
declare const ORDER_MAX_PRICE = 99;
|
|
397
|
-
/** @deprecated Use ChartRange instead */
|
|
398
|
-
declare const PriceHistoryInterval: {
|
|
399
|
-
readonly ONE_HOUR: "1h";
|
|
400
|
-
readonly SIX_HOURS: "6h";
|
|
401
|
-
readonly ONE_DAY: "1d";
|
|
402
|
-
readonly ONE_WEEK: "1w";
|
|
403
|
-
readonly MAX: "max";
|
|
404
|
-
};
|
|
405
|
-
/** @deprecated Use ChartRangeType instead */
|
|
406
|
-
type PriceHistoryIntervalType = (typeof PriceHistoryInterval)[keyof typeof PriceHistoryInterval];
|
|
407
|
-
/** @deprecated Use DEFAULT_CHART_RANGE instead */
|
|
408
|
-
declare const DEFAULT_PRICE_HISTORY_INTERVAL: "1w";
|
|
409
|
-
/** @deprecated */
|
|
410
|
-
declare const PRICE_HISTORY_SAMPLE_INTERVAL: Record<PriceHistoryIntervalType, number>;
|
|
411
|
-
|
|
412
355
|
/** Trade outcome - yes or no */
|
|
413
356
|
type TradeOutcome = "yes" | "no";
|
|
414
357
|
/** Trade side - buy or sell */
|
|
@@ -1283,16 +1226,6 @@ declare function fetchEventsV2(client: PredictClientV2, params?: V2ListEventsPar
|
|
|
1283
1226
|
*/
|
|
1284
1227
|
declare function useEventsV2Query(params?: V2ListEventsParams, queryOptions?: Omit<UseQueryOptions<V2Page<V2Event>, Error, V2Page<V2Event>, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Page<V2Event>, Error>;
|
|
1285
1228
|
|
|
1286
|
-
/** Stable TanStack Query key for a single v2 event. */
|
|
1287
|
-
declare function eventV2QueryKey(slug: string, source?: V2ProviderSource): unknown[];
|
|
1288
|
-
/**
|
|
1289
|
-
* Fetch function that can be used outside of React (e.g. in loaders or tests).
|
|
1290
|
-
*
|
|
1291
|
-
* @param client - A `PredictClientV2` instance.
|
|
1292
|
-
* @param slug - Canonical event slug.
|
|
1293
|
-
* @param source - Upstream provider (`"dflow"` or `"polymarket"`).
|
|
1294
|
-
*/
|
|
1295
|
-
declare function fetchEventV2(client: PredictClientV2, slug: string, source?: V2ProviderSource): Promise<V2Event>;
|
|
1296
1229
|
interface UseEventV2QueryParams {
|
|
1297
1230
|
/** Canonical event slug (e.g. "will-trump-win-2024" or "KXBTCD-25FEB-T68000"). */
|
|
1298
1231
|
slug: string;
|
|
@@ -1312,6 +1245,24 @@ interface UseEventV2QueryParams {
|
|
|
1312
1245
|
*/
|
|
1313
1246
|
declare function useEventV2Query(params: UseEventV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2Event, Error, V2Event, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Event, Error>;
|
|
1314
1247
|
|
|
1248
|
+
type InfiniteQueryOptions = Omit<UseInfiniteQueryOptions<V2Page<V2Event>, Error, InfiniteData<V2Page<V2Event>>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
1249
|
+
/**
|
|
1250
|
+
* TanStack Query infinite-query hook for `GET /api/v1/events` with cursor-based
|
|
1251
|
+
* pagination via the prediction-server v2 client.
|
|
1252
|
+
*
|
|
1253
|
+
* @param params - Resolved query parameters (use {@link resolveEventsV2Params}
|
|
1254
|
+
* to build from user inputs). Do NOT include `cursor` — it is
|
|
1255
|
+
* managed automatically by TanStack Query's `pageParam`.
|
|
1256
|
+
* @param queryOptions - Additional TanStack Query options.
|
|
1257
|
+
*
|
|
1258
|
+
* @example
|
|
1259
|
+
* ```tsx
|
|
1260
|
+
* const params = resolveEventsV2Params({ status: "open", limit: 20 });
|
|
1261
|
+
* const { data, hasNextPage, fetchNextPage } = useEventsV2InfiniteQuery(params);
|
|
1262
|
+
* ```
|
|
1263
|
+
*/
|
|
1264
|
+
declare function useEventsV2InfiniteQuery(params: V2ListEventsParams, queryOptions?: InfiniteQueryOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<V2Page<V2Event>, unknown>, Error>;
|
|
1265
|
+
|
|
1315
1266
|
interface UseSearchEventsInfiniteQueryParams {
|
|
1316
1267
|
/** Search keyword */
|
|
1317
1268
|
keyword: string;
|
|
@@ -1709,4 +1660,4 @@ interface UseOrderbookSubscriptionResult {
|
|
|
1709
1660
|
*/
|
|
1710
1661
|
declare function useOrderbookSubscription({ client, all, tickers, enabled, onUpdate, }: UseOrderbookSubscriptionParams): UseOrderbookSubscriptionResult;
|
|
1711
1662
|
|
|
1712
|
-
export { CATEGORIES_V2,
|
|
1663
|
+
export { CATEGORIES_V2, CandlestickPeriodType, CandlesticksQueryParams, CandlesticksResponse, CategoriesSkeleton, CategoriesUI, type CategoriesUIProps, CategoriesWidget, type CategoriesWidgetProps, CategoriesWidgetV2, type CategoriesWidgetV2Props, type CategoryItemV2, type CategorySelection, ChartRangeType, DEFAULT_FILTER_STATE, type EventCategory, EventDetailPage, type EventDetailPageProps, EventDetailPageV2, type EventDetailPageV2Props, EventDetailSkeleton, type EventDetailSkeletonProps, EventDetailUI, type EventDetailUIProps, EventDetailV2UI, type EventDetailV2UIProps, EventDetailWidget, type EventDetailWidgetProps, EventDetailWidgetV2, type EventDetailWidgetV2Props, EventItemSkeleton, type EventItemSkeletonProps, EventItemUI, type EventItemUIProps, EventItemV2UI, type EventItemV2UIProps, EventMarketDetailWidget, type EventMarketDetailWidgetProps, EventQueryParams, type EventsFilterState, EventsFilterV2UI, type EventsFilterV2UIProps, EventsPage, type EventsPageProps, EventsPageV2, type EventsPageV2Props, EventsSkeleton, type EventsSkeletonProps, EventsToolbarV2UI, type EventsToolbarV2UIProps, EventsUI, type EventsUIProps, EventsV2UI, type EventsV2UIProps, EventsWidget, type EventsWidgetProps, EventsWidgetV2, type EventsWidgetV2Props, FilterOutcomeMintsRequest, FilterOutcomeMintsResponse, FiltersBySportsResponse, ForecastPercentileHistoryByMintQueryParams, ForecastPercentileHistoryQueryParams, ForecastPercentileHistoryResponse, IPredictClient, IPredictWsClient, IntentQuoteQueryParams, IntentQuoteResponse, IntentSwapRequestBody, IntentSwapResponse, LiveDataByEventQueryParams, LiveDataByMintQueryParams, LiveDataQueryParams, LiveDataResponse, type MarketPositionsResult, MarketQueryParams, MarketsBatchRequest, MultiOnchainTradeResponse, MultiTradeResponse, OnchainTradesByEventQueryParams, OnchainTradesByMarketQueryParams, OnchainTradesByWalletQueryParams, OpenOrdersUI, type OpenOrdersUIProps, OpenOrdersWidget, type OpenOrdersWidgetProps, type Order, type OrderBookRow, OrderBookUI, type OrderBookUIProps, OrderBookWidget, type OrderBookWidgetProps, OrderQueryParams, OrderResponse, OrderStatusQueryParams, OrderStatusResponse, type OrderbookData, OrderbookLevel, OrderbookResponse, OutcomeMintsQueryParams, OutcomeMintsResponse, PREDICT_SEARCH_MODAL_ID, type Position, PositionsByWalletQueryParams, type PositionsSummary, PositionsUI, type PositionsUIProps, PositionsWidget, type PositionsWidgetProps, PredictClientV2, PredictContext, type PredictContextValue, PredictProvider, type PredictProviderProps, PredictSearchModal, type PredictSearchModalParams, type PredictSearchModalResult, PredictV2Context, type PredictV2ContextValue, PredictV2Provider, type PredictV2ProviderProps, PredictionMarketInitQueryParams, PredictionMarketInitResponse, type PriceData, QuoteQueryParams, QuoteResponse, SORT_PRESETS, SearchEventsButton, type SearchEventsButtonProps, SearchHistoryUI, type SearchHistoryUIProps, SearchHistoryWidget, type SearchHistoryWidgetProps, SearchInputUI, type SearchInputUIProps, SearchQueryParams, SearchResponse, SearchResultItemUI, type SearchResultItemUIProps, SearchResultListWidget, type SearchResultListWidgetProps, SearchWidget, type SearchWidgetProps, SeriesListResponse, SeriesQueryParams, SeriesResponse, SingleTradeResponse, type SortPreset, StandardEvent, StandardEventsResponse, StandardMarket, StandardMarketsResponse, SwapInstructionsResponse, SwapRequestBody, SwapResponse, type TagItemV2, type TagSlugSelection, TagsByCategoriesResponse, TokenListResponse, TokenListWithDecimalsResponse, type TradeData, TradeFormSkeleton, TradeFormUI, type TradeFormUIProps, type TradeFormValidation, TradeFormWidget, type TradeFormWidgetProps, TradeHistoryUI, type TradeHistoryUIProps, TradeHistoryWidget, type TradeHistoryWidgetProps, type TradeOutcome, type TradeSide, TradesByMintQueryParams, TradesQueryParams, type UseEventByIdQueryParams, type UseEventCandlesticksParams, type UseEventDetailParams, type UseEventDetailV2Params, type UseEventV2QueryParams, type UseEventsCategoriesResult, type UseEventsParams, type UseEventsResult, type UseEventsV2Params, type UseEventsV2Result, type UseMarketByIdQueryParams, type UseMarketCandlesticksByMintParams, type UseMarketCandlesticksParams, type UseMarketV2QueryParams, type UseOpenOrdersParams, type UseOpenOrdersResult, type UseOrderBookParams, type UseOrderBookResult, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UsePositionsParams, type UsePositionsResult, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseSearchEventsInfiniteQueryParams, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseTradeFormParams, type UseTradeFormResult, type UseTradeHistoryParams, type UseTradeHistoryResult, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWsClientResult, type UseWsConnectionParams, type UseWsConnectionResult, UserPredictContext, type UserPredictContextValue, UserPredictProvider, type UserPredictProviderProps, V2Event, V2EventSortField, V2EventStatus, V2ListEventsParams, V2Market, V2Page, V2ProviderSource, VenueListResponse, WalletPositionItem, WalletPositionsResponse, WsConnectionStatus, WsOrderbookUpdate, WsPriceUpdate, WsTradeUpdate, countActiveFilters, createSwap, createSwapInstructions, eventByIdQueryKey, eventCandlesticksQueryKey, eventsInfiniteQueryKey, eventsQueryKey, eventsV2QueryKey, fetchEventById, fetchEventCandlesticks, fetchEvents, fetchEventsV2, fetchFiltersBySports, fetchForecastPercentileHistory, fetchForecastPercentileHistoryByMint, fetchIntentQuote, fetchLiveData, fetchLiveDataByEvent, fetchLiveDataByMint, fetchMarketById, fetchMarketByMint, fetchMarketCandlesticks, fetchMarketCandlesticksByMint, fetchMarketV2, fetchMarkets, fetchMarketsBatch, fetchOnchainTradesByEvent, fetchOnchainTradesByMarket, fetchOnchainTradesByWallet, fetchOrder, fetchOrderBook, fetchOrderBookByMint, fetchOrderStatus, fetchOutcomeMints, fetchPositionsByWallet, fetchQuote, fetchSearch, fetchSeries, fetchSeriesByTicker, fetchTagsByCategories, fetchTokens, fetchTokensWithDecimals, fetchTrades, fetchTradesByMint, fetchVenues, filterOutcomeMints, filtersBySportsQueryKey, forecastPercentileHistoryByMintQueryKey, forecastPercentileHistoryQueryKey, initPredictionMarket, intentQuoteQueryKey, liveDataByEventQueryKey, liveDataByMintQueryKey, liveDataQueryKey, marketByIdQueryKey, marketByMintQueryKey, marketCandlesticksByMintQueryKey, marketCandlesticksQueryKey, marketV2QueryKey, marketsBatchQueryKey, marketsQueryKey, onchainTradesByEventInfiniteQueryKey, onchainTradesByEventQueryKey, onchainTradesByMarketInfiniteQueryKey, onchainTradesByMarketQueryKey, onchainTradesByWalletInfiniteQueryKey, onchainTradesByWalletQueryKey, orderBookByMintQueryKey, orderBookQueryKey, orderQueryKey, orderStatusQueryKey, outcomeMintsQueryKey, positionsByWalletQueryKey, quoteQueryKey, searchQueryKey, seriesByTickerQueryKey, seriesQueryKey, submitIntentSwap, tagsByCategoriesQueryKey, tokensQueryKey, tokensWithDecimalsQueryKey, tradesByMintQueryKey, tradesQueryKey, useCategoriesQuery, useCreateSwapInstructionsMutation, useCreateSwapMutation, useEventByIdQuery, useEventCandlesticksQuery, useEventDetail, useEventDetailV2, useEventV2Query, useEvents, useEventsCategories, useEventsInfiniteQuery, useEventsQuery, useEventsV2, useEventsV2InfiniteQuery, useEventsV2Query, useFilterOutcomeMintsMutation, useFiltersBySportsQuery, useForecastPercentileHistoryByMintQuery, useForecastPercentileHistoryQuery, useInitPredictionMarketMutation, useIntentQuoteQuery, useLiveDataByEventQuery, useLiveDataByMintQuery, useLiveDataQuery, useMarketByIdQuery, useMarketByMintQuery, useMarketCandlesticksByMintQuery, useMarketCandlesticksQuery, useMarketPositions, useMarketV2Query, useMarketsBatchQuery, useMarketsQuery, useOnchainTradesByEventInfiniteQuery, useOnchainTradesByEventQuery, useOnchainTradesByMarketInfiniteQuery, useOnchainTradesByMarketQuery, useOnchainTradesByWalletInfiniteQuery, useOnchainTradesByWalletQuery, useOpenOrders, useOrderBook, useOrderBookByMintQuery, useOrderBookQuery, useOrderQuery, useOrderStatusQuery, useOrderbookSubscription, useOutcomeMintsQuery, usePositions, usePositionsByWalletQuery, usePredictClient, usePredictContext, usePredictSearchHistory, usePredictV2Client, usePredictV2Context, usePriceHistoryQuery, usePricesSubscription, useQuoteQuery, useSearchEventsInfiniteQuery, useSearchQuery, useSearchResultListScript, useSearchScript, useSeriesByTickerQuery, useSeriesQuery, useSubmitIntentSwapMutation, useTagsByCategoriesQuery, useTokensQuery, useTokensWithDecimalsQuery, useTradeForm, useTradeHistory, useTradesByMintQuery, useTradesQuery, useTradesSubscription, useUserPredictContext, useVenuesQuery, useWsClient, useWsConnection, venuesQueryKey, _default as version };
|