@liberfi.io/ui-predict 0.1.75 → 0.1.77

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/index.d.mts CHANGED
@@ -1,14 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
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-BphwuECY.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-BphwuECY.mjs';
2
+ import { EventSortField, ProviderSource, PredictEvent, PredictMarket, TagSlugSelection as TagSlugSelection$1, EventStatus, ResolveEventsParamsInput, ChartRangeType as ChartRangeType$1, ListCandlesticksParams, Candlestick, PredictPage, PredictPosition } from '@liberfi.io/react-predict';
3
+ export { BalanceResponse, CancelOrderResult, Candlestick, CreateOrderInput, DFlowOrderContext, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStatus, EventSummary, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, MarketOutcome, MarketResult, MarketStatus, MarketSummary, OrderSide, OrderStatus, Orderbook, OrderbookLevel, PolymarketOrderType, PositionsResponse, PredictClient, PredictContext, PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictPosition, PredictProvider, PredictProviderProps, PredictTag, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, PricePoint, ProviderMeta, ProviderSource, ResolveEventsParamsInput, SettlementSource, SimilarEventsParams, TradeType, createPredictClient, createPredictWsClient, useBalance, useCancelOrder, useCandlesticks, useDFlowQuote, useDFlowSubmit, useEvent, useEvents, useInfiniteEvents, useMarket, useMarketHistory, useMarketTrades, useOrder, useOrderbook, useOrders, usePositions, usePredictClient, usePriceHistory, useSearchEvents, useSimilarEvents, useTrades } from '@liberfi.io/react-predict';
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, g as V2SimilarEventsParams, h as V2Orderbook, i as V2ListMarketTradesParams, j as V2Trade, k as V2PriceHistoryRange, l as V2PriceHistoryResponse, m as V2ListCandlesticksParams, n as V2Candlestick, o as V2PositionsResponse, p as V2ListOrdersParams, q as V2UserOrder, r as V2CancelOrderResult, s as V2DFlowQuoteRequest, t as V2DFlowQuoteResponse, u as V2DFlowSubmitResponse, v as V2DFlowSubmitRequest, w as V2ListTradesByWalletParams } from './client-Doli88ls.mjs';
6
- export { y as V2MarketResult, z as V2MarketStatus, A as V2Outcome, B as V2ProviderMeta, C as V2SettlementSource, D as V2Tag, x as createPredictClientV2 } from './client-Doli88ls.mjs';
7
- import { C as ChartRangeType, a as CandlestickPeriodType } from './server-f1B7ItWZ.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-f1B7ItWZ.mjs';
9
5
  import * as _tanstack_react_query from '@tanstack/react-query';
10
- import { UseQueryOptions, UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
11
- import * as react from 'react';
12
6
  import { PropsWithChildren } from 'react';
13
7
 
14
8
  declare global {
@@ -18,134 +12,24 @@ declare global {
18
12
  };
19
13
  }
20
14
  }
21
- declare const _default: "0.1.75";
22
-
23
- interface EventsPageProps {
24
- /** Callback when an event is selected */
25
- onSelect?: (event: StandardEvent) => void;
26
- /** Callback when an outcome (yes/no) is selected */
27
- onSelectOutcome?: (event: StandardEvent, market: StandardMarket, side: "yes" | "no") => void;
28
- }
29
- declare function EventsPage({ onSelect, onSelectOutcome }: EventsPageProps): react_jsx_runtime.JSX.Element;
30
-
31
- /**
32
- * useEvents parameters — extends EventQueryParams (without cursor) with
33
- * optional category / tags filtering.
34
- */
35
- interface UseEventsParams extends Omit<EventQueryParams, "cursor"> {
36
- /** Filter events by category (scopes the series lookup when tags is set) */
37
- category?: string | null;
38
- /**
39
- * Filter events by tags.
40
- * Internally converts tags → matching series tickers, then filters events.
41
- * Takes precedence over `seriesTickers` when provided.
42
- */
43
- tags?: string[] | null;
44
- }
45
- /**
46
- * useEvents return value
47
- */
48
- interface UseEventsResult {
49
- /** All accumulated events data */
50
- data: StandardEvent[];
51
- /** Whether *initial* data is still loading (no cache yet) */
52
- isLoading: boolean;
53
- /** Whether any fetch is in-flight (includes refetch / param change, excludes fetchNextPage) */
54
- isFetching: boolean;
55
- /** Whether more data is being fetched (infinite scroll) */
56
- isFetchingMore: boolean;
57
- /** Whether there is an error */
58
- isError: boolean;
59
- /** Error information */
60
- error: Error | null;
61
- /** Whether there is more data to load */
62
- hasMore: boolean;
63
- /** Fetch more results */
64
- fetchMore: () => void;
65
- /** Refetch all pages */
66
- refetch: () => void;
67
- }
68
- /**
69
- * Events list hook with infinite scroll support (cursor-based pagination)
70
- *
71
- * Supports filtering by `tags` – internally converts tags into matching series
72
- * tickers via a series query, then filters events by `seriesTickers`.
73
- *
74
- * @example
75
- * ```tsx
76
- * const {
77
- * data,
78
- * isLoading,
79
- * hasMore,
80
- * isFetchingMore,
81
- * fetchMore,
82
- * } = useEvents({
83
- * limit: 20,
84
- * status: 'active',
85
- * withNestedMarkets: true,
86
- * category: 'Politics',
87
- * tags: ['US Elections'],
88
- * });
89
- * ```
90
- */
91
- declare function useEvents(params?: UseEventsParams): UseEventsResult;
92
-
93
- interface EventsWidgetProps extends UseEventsParams {
94
- /** Callback when an event is selected */
95
- onSelect?: (event: StandardEvent) => void;
96
- /** Callback when an outcome (yes/no) is selected */
97
- onSelectOutcome?: (event: StandardEvent, market: StandardMarket, side: "yes" | "no") => void;
98
- }
99
- declare function EventsWidget({ onSelect, onSelectOutcome, ...queryParams }: EventsWidgetProps): react_jsx_runtime.JSX.Element;
100
-
101
- type EventsUIProps = {
102
- /** Events data to render */
103
- events: StandardEvent[];
104
- /** Whether there is more data to load */
105
- hasMore?: boolean;
106
- /** Callback to fetch more data */
107
- onFetchMore?: () => void;
108
- /** Callback when an event is selected */
109
- onSelect?: (event: StandardEvent) => void;
110
- /** Callback when an outcome (yes/no) is selected */
111
- onSelectOutcome?: (event: StandardEvent, market: StandardMarket, side: "yes" | "no") => void;
112
- };
113
- declare function EventsUI({ events, hasMore, onFetchMore, onSelect, onSelectOutcome, }: EventsUIProps): react_jsx_runtime.JSX.Element;
114
-
115
- type EventItemSkeletonProps = {
116
- className?: string;
117
- };
118
- declare function EventItemSkeleton({ className }: EventItemSkeletonProps): react_jsx_runtime.JSX.Element;
119
- type EventsSkeletonProps = {
120
- count?: number;
121
- };
122
- declare function EventsSkeleton({ count }: EventsSkeletonProps): react_jsx_runtime.JSX.Element;
123
- declare function EventsPageSkeleton(): react_jsx_runtime.JSX.Element;
124
- declare function EventsPageV2Skeleton(): react_jsx_runtime.JSX.Element;
125
-
126
- type EventItemUIProps = {
127
- event: StandardEvent;
128
- onSelect?: (event: StandardEvent) => void;
129
- onSelectOutcome?: (event: StandardEvent, market: StandardMarket, side: "yes" | "no") => void;
130
- };
131
- declare function EventItemUI({ event, onSelect, onSelectOutcome, }: EventItemUIProps): react_jsx_runtime.JSX.Element;
15
+ declare const _default: "0.1.77";
132
16
 
133
17
  /**
134
- * A single category entry in the v2 navigation model.
18
+ * A single category entry in the static navigation model.
135
19
  *
136
20
  * Slug logic: slug === label (verbatim), matching mapTag() in the prediction
137
21
  * server's DFlow strategy. Pass the slug directly to DFlow API filters.
138
22
  */
139
- interface CategoryItemV2 {
23
+ interface CategoryListItem {
140
24
  /** Category slug — equals the label; use directly as DFlow `category` filter */
141
25
  slug: string;
142
26
  /** Display label */
143
27
  label: string;
144
28
  /** Tag entries for this category (empty array when the category has no sub-tags) */
145
- tags: TagItemV2[];
29
+ tags: CategoryTagItem[];
146
30
  }
147
- /** A single tag entry in the v2 navigation model */
148
- interface TagItemV2 {
31
+ /** A single tag entry in the static navigation model */
32
+ interface CategoryTagItem {
149
33
  /** Tag slug — equals the label; use directly as DFlow `tags` filter */
150
34
  slug: string;
151
35
  /** Display label */
@@ -157,9 +41,9 @@ interface TagItemV2 {
157
41
  * Sorted category list derived from the static DFlow API snapshot.
158
42
  * Memoised at module level — computed once, never re-created.
159
43
  */
160
- declare const CATEGORIES_V2: CategoryItemV2[];
44
+ declare const STATIC_CATEGORIES: CategoryListItem[];
161
45
  /**
162
- * Selection emitted by CategoriesWidgetV2.
46
+ * Selection emitted by CategoriesWidget.
163
47
  *
164
48
  * - `categorySlug = null, tagSlug = null` → "Trending" (no filter)
165
49
  * - `categorySlug = "Politics", tagSlug = null` → category selected, all its tags
@@ -172,11 +56,28 @@ interface TagSlugSelection {
172
56
  tagSlug: string | null;
173
57
  }
174
58
 
59
+ interface CategoriesWidgetProps {
60
+ /**
61
+ * Callback fired when the category / tag selection changes.
62
+ *
63
+ * Slug values follow the DFlow `mapTag()` convention (slug === label):
64
+ * - `{ categorySlug: null, tagSlug: null }` → "Trending" (no filter)
65
+ * - `{ categorySlug: "Crypto", tagSlug: null }` → category selected
66
+ * - `{ categorySlug: "Crypto", tagSlug: "BTC" }` → specific tag selected
67
+ */
68
+ onSelect?: (selection: TagSlugSelection) => void;
69
+ /** Content rendered at the end of the primary chip row (e.g. sort/filter controls) */
70
+ trailing?: React.ReactNode;
71
+ /** Optional class name applied to the root element */
72
+ className?: string;
73
+ }
74
+ declare function CategoriesWidget({ onSelect, trailing, className, }: CategoriesWidgetProps): react_jsx_runtime.JSX.Element;
75
+
175
76
  type SortPreset = "start_time" | "volume" | "liquidity" | "ending_soon";
176
77
  declare const SORT_PRESETS: Record<SortPreset, {
177
- sort_by: V2EventSortField;
78
+ sort_by: EventSortField;
178
79
  }>;
179
- interface EventsToolbarV2UIProps {
80
+ interface EventsToolbarUIProps {
180
81
  /** Currently active sort preset */
181
82
  sortPreset: SortPreset;
182
83
  /** Callback when the user picks a different sort preset */
@@ -192,12 +93,12 @@ interface EventsToolbarV2UIProps {
192
93
  /** Optional class name for the root element */
193
94
  className?: string;
194
95
  }
195
- declare function EventsToolbarV2UI({ sortPreset, onSortChange, sortAsc, onSortAscChange, onFilterPress, filterCount, className, }: EventsToolbarV2UIProps): react_jsx_runtime.JSX.Element;
96
+ declare function EventsToolbarUI({ sortPreset, onSortChange, sortAsc, onSortAscChange, onFilterPress, filterCount, className, }: EventsToolbarUIProps): react_jsx_runtime.JSX.Element;
196
97
 
197
98
  interface EventsFilterState {
198
99
  sortPreset: SortPreset;
199
100
  sortAsc: boolean;
200
- source?: V2ProviderSource;
101
+ source?: ProviderSource;
201
102
  timeRemaining?: string;
202
103
  minVolume?: string;
203
104
  minLiquidity?: string;
@@ -205,7 +106,7 @@ interface EventsFilterState {
205
106
  declare const DEFAULT_FILTER_STATE: EventsFilterState;
206
107
  /** Count how many non-default filters are active (excluding sortPreset) */
207
108
  declare function countActiveFilters(state: EventsFilterState): number;
208
- interface EventsFilterV2UIProps {
109
+ interface EventsFilterUIProps {
209
110
  /** Whether the modal is open */
210
111
  isOpen: boolean;
211
112
  /** Callback to close the modal */
@@ -215,378 +116,280 @@ interface EventsFilterV2UIProps {
215
116
  /** Callback when "Show Results" is pressed with the new filter state */
216
117
  onChange: (state: EventsFilterState) => void;
217
118
  }
218
- declare function EventsFilterV2UI({ isOpen, onClose, value, onChange, }: EventsFilterV2UIProps): react_jsx_runtime.JSX.Element;
119
+ declare function EventsFilterUI({ isOpen, onClose, value, onChange, }: EventsFilterUIProps): react_jsx_runtime.JSX.Element;
219
120
 
220
- interface EventsPageV2Props {
121
+ interface EventsPageProps {
221
122
  /** Callback when an event card is selected */
222
- onSelect?: (event: V2Event) => void;
123
+ onSelect?: (event: PredictEvent) => void;
223
124
  /** Callback when an outcome button (yes / no) is pressed */
224
- onSelectOutcome?: (event: V2Event, market: V2Market, side: "yes" | "no") => void;
125
+ onSelectOutcome?: (event: PredictEvent, market: PredictMarket, side: "yes" | "no") => void;
225
126
  /** Generate href for each event card. When set, cards render as links. */
226
- getEventHref?: (event: V2Event) => string;
127
+ getEventHref?: (event: PredictEvent) => string;
227
128
  /** Custom link component (e.g. next/link). */
228
129
  LinkComponent?: LinkComponentType;
229
130
  /** Called when a card is hovered (for data prefetching). */
230
- onHover?: (event: V2Event) => void;
131
+ onHover?: (event: PredictEvent) => void;
231
132
  }
232
- declare function EventsPageV2({ onSelect, onSelectOutcome, getEventHref, LinkComponent, onHover, }: EventsPageV2Props): react_jsx_runtime.JSX.Element;
133
+ declare function EventsPage({ onSelect, onSelectOutcome, getEventHref, LinkComponent, onHover, }: EventsPageProps): react_jsx_runtime.JSX.Element;
233
134
 
234
- interface EventsWidgetV2Props {
235
- /**
236
- * Category / tag selection from CategoriesWidgetV2.
237
- * Passed through directly to useEventsV2.
238
- */
239
- tagSlugSelection?: TagSlugSelection | null;
135
+ interface EventsWidgetProps {
136
+ /** Category / tag selection from the categories widget. */
137
+ tagSlugSelection?: TagSlugSelection$1 | null;
240
138
  /** Page size (default: DEFAULT_PAGE_SIZE) */
241
139
  limit?: number;
242
140
  /** Event lifecycle status filter (default: "open") */
243
- status?: V2EventStatus;
141
+ status?: EventStatus;
244
142
  /** Sort field */
245
- sort_by?: V2EventSortField;
143
+ sort_by?: EventSortField;
246
144
  /** Ascending sort order (default: false → descending) */
247
145
  sort_asc?: boolean;
248
146
  /** Filter by upstream provider (undefined = all providers) */
249
- source?: V2ProviderSource;
147
+ source?: ProviderSource;
250
148
  /** Include nested markets in the response (default: true) */
251
149
  with_markets?: boolean;
252
150
  /** Callback when an event card is selected */
253
- onSelect?: (event: V2Event) => void;
151
+ onSelect?: (event: PredictEvent) => void;
254
152
  /** Callback when an outcome button (yes/no) is pressed */
255
- onSelectOutcome?: (event: V2Event, market: V2Market, side: "yes" | "no") => void;
153
+ onSelectOutcome?: (event: PredictEvent, market: PredictMarket, side: "yes" | "no") => void;
256
154
  /** Generate href for each event card. When set, cards render as links. */
257
- getEventHref?: (event: V2Event) => string;
155
+ getEventHref?: (event: PredictEvent) => string;
258
156
  /** Custom link component (e.g. next/link). */
259
157
  LinkComponent?: LinkComponentType;
260
158
  /** Called when a card is hovered (for data prefetching). */
261
- onHover?: (event: V2Event) => void;
159
+ onHover?: (event: PredictEvent) => void;
262
160
  }
263
- declare function EventsWidgetV2({ tagSlugSelection, limit, status, sort_by, sort_asc, source, with_markets, onSelect, onSelectOutcome, getEventHref, LinkComponent, onHover, }: EventsWidgetV2Props): react_jsx_runtime.JSX.Element;
161
+ declare function EventsWidget({ tagSlugSelection, limit, status, sort_by, sort_asc, source, with_markets, onSelect, onSelectOutcome, getEventHref, LinkComponent, onHover, }: EventsWidgetProps): react_jsx_runtime.JSX.Element;
264
162
 
265
- /** Parameters for useEventsV2 */
266
- interface UseEventsV2Params {
267
- /**
268
- * Category / tag selection from CategoriesWidgetV2.
269
- *
270
- * Mapped to `V2ListEventsParams.tag_slug`:
271
- * - tagSlug is set → use tagSlug
272
- * - only categorySlug is set → use categorySlug
273
- * - both null → no filter (Trending)
274
- */
275
- tagSlugSelection?: TagSlugSelection | null;
276
- /** Page size (default: DEFAULT_PAGE_SIZE) */
277
- limit?: number;
278
- /** Event lifecycle status filter (default: "open") */
279
- status?: V2EventStatus;
280
- /** Sort field */
281
- sort_by?: V2EventSortField;
282
- /** Ascending sort (default: false → descending) */
283
- sort_asc?: boolean;
284
- /** Filter by upstream provider (undefined = all providers) */
285
- source?: V2ProviderSource;
286
- /** Include nested markets (default: true) */
287
- with_markets?: boolean;
288
- }
289
- /** Return value of useEventsV2 — mirrors the UseEventsResult interface from v1 */
290
- interface UseEventsV2Result {
291
- /** All accumulated V2 events from all loaded pages */
292
- data: V2Event[];
293
- /** True only on initial load (no cache yet) */
163
+ /** Parameters for useEventsInfinite */
164
+ type UseEventsInfiniteParams = ResolveEventsParamsInput;
165
+ /** Return value of useEventsInfinite */
166
+ interface UseEventsInfiniteResult {
167
+ data: PredictEvent[];
294
168
  isLoading: boolean;
295
- /** True whenever a request is in-flight (param change / refetch), excludes fetchMore */
296
169
  isFetching: boolean;
297
- /** True while loading additional pages via fetchMore */
298
170
  isFetchingMore: boolean;
299
- /** True when any query errored */
300
171
  isError: boolean;
301
- /** Error instance, or null */
302
172
  error: Error | null;
303
- /** True when more pages are available */
304
173
  hasMore: boolean;
305
- /** Load the next page */
306
174
  fetchMore: () => void;
307
- /** Refetch all pages from the first */
308
175
  refetch: () => void;
309
176
  }
310
177
  /**
311
- * V2 events list hook with cursor-based infinite scroll.
178
+ * Infinite events list hook with flattened pages for virtualized grids.
312
179
  *
313
- * Uses the prediction-server v2 client (PredictClientV2) directly, avoiding
314
- * the legacy DFlow series-lookup path that the v1 `useEvents` hook requires.
315
- *
316
- * @example
317
- * ```tsx
318
- * const { data, isLoading, hasMore, fetchMore } = useEventsV2({
319
- * tagSlugSelection: { categorySlug: "Crypto", tagSlug: "BTC" },
320
- * limit: 20,
321
- * });
322
- * ```
180
+ * Wraps {@link useInfiniteEvents} from `@liberfi.io/react-predict` and exposes
181
+ * a single `data` array plus loading helpers matching legacy list-hook ergonomics.
323
182
  */
324
- declare function useEventsV2(params?: UseEventsV2Params): UseEventsV2Result;
183
+ declare function useEventsInfinite(params?: UseEventsInfiniteParams): UseEventsInfiniteResult;
325
184
 
326
- type EventsV2UIProps = {
327
- /** V2 events to render */
328
- events: V2Event[];
329
- /** Whether more data is available */
185
+ type EventsUIProps = {
186
+ events: PredictEvent[];
330
187
  hasMore?: boolean;
331
- /** Callback to request the next page */
332
188
  onFetchMore?: () => void;
333
- /** Callback when a card is selected */
334
- onSelect?: (event: V2Event) => void;
335
- /** Callback when an outcome button (yes/no) is pressed */
336
- onSelectOutcome?: (event: V2Event, market: V2Market, side: "yes" | "no") => void;
337
- /** Generate href for each event card. When set, cards render as links. */
338
- getEventHref?: (event: V2Event) => string;
339
- /** Custom link component (e.g. next/link). */
189
+ onSelect?: (event: PredictEvent) => void;
190
+ onSelectOutcome?: (event: PredictEvent, market: PredictMarket, side: "yes" | "no") => void;
191
+ getEventHref?: (event: PredictEvent) => string;
340
192
  LinkComponent?: LinkComponentType;
341
- /** Called when a card is hovered (for data prefetching). */
342
- onHover?: (event: V2Event) => void;
193
+ onHover?: (event: PredictEvent) => void;
343
194
  };
344
- declare function EventsV2UI({ events, hasMore, onFetchMore, onSelect, onSelectOutcome, getEventHref, LinkComponent, onHover, }: EventsV2UIProps): react_jsx_runtime.JSX.Element;
195
+ declare function EventsUI({ events, hasMore, onFetchMore, onSelect, onSelectOutcome, getEventHref, LinkComponent, onHover, }: EventsUIProps): react_jsx_runtime.JSX.Element;
345
196
 
346
- type EventItemV2UIProps = {
347
- event: V2Event;
197
+ interface EventsSkeletonProps {
198
+ count?: number;
199
+ }
200
+ declare function EventsSkeleton({ count }: EventsSkeletonProps): react_jsx_runtime.JSX.Element;
201
+ interface EventsPageSkeletonProps extends EventsSkeletonProps {
202
+ }
203
+ /**
204
+ * Page-level loading skeleton for `EventsPage`.
205
+ * Includes placeholders for categories / toolbar, then the events grid skeleton.
206
+ */
207
+ declare function EventsPageSkeleton({ count }: EventsPageSkeletonProps): react_jsx_runtime.JSX.Element;
208
+
209
+ type EventItemProps = {
210
+ event: PredictEvent;
348
211
  /** URL for the detail page. When set, header / Show More render as links. */
349
212
  href?: string;
350
213
  /** Custom link component (e.g. next/link). Passed to Linkable. */
351
214
  LinkComponent?: LinkComponentType;
352
- onSelect?: (event: V2Event) => void;
353
- onSelectOutcome?: (event: V2Event, market: V2Market, side: "yes" | "no") => void;
215
+ onSelect?: (event: PredictEvent) => void;
216
+ onSelectOutcome?: (event: PredictEvent, market: PredictMarket, side: "yes" | "no") => void;
354
217
  /** Called when the card is hovered (for data prefetching). */
355
- onHover?: (event: V2Event) => void;
218
+ onHover?: (event: PredictEvent) => void;
356
219
  };
357
- declare function EventItemV2UI({ event, href, LinkComponent, onSelect, onSelectOutcome, onHover, }: EventItemV2UIProps): react_jsx_runtime.JSX.Element;
220
+ declare function EventItem({ event, href, LinkComponent, onSelect, onSelectOutcome, onHover, }: EventItemProps): react_jsx_runtime.JSX.Element;
221
+
222
+ interface EventDetailPageProps {
223
+ /** Event slug (canonical business key). */
224
+ eventSlug: string;
225
+ /** Upstream provider (`"dflow"` or `"polymarket"`). Required by prediction-server. */
226
+ source?: ProviderSource;
227
+ /** Chain network for trading (default: 'solana'). */
228
+ chain?: string;
229
+ /** Connected wallet address for user activity (positions/orders/trades). */
230
+ walletAddress?: string;
231
+ /** Callback when a similar event card is clicked. Receives the clicked event. */
232
+ onSimilarEventClick?: (event: PredictEvent) => void;
233
+ /** Navigation callback — if provided, a "Back" button is shown at the top. */
234
+ onBack?: () => void;
235
+ }
236
+ declare function EventDetailPage({ eventSlug, source, chain, walletAddress, onSimilarEventClick, onBack, }: EventDetailPageProps): react_jsx_runtime.JSX.Element;
358
237
 
359
- /** Trade outcome - yes or no */
360
238
  type TradeOutcome = "yes" | "no";
361
- /** Trade side - buy or sell */
362
239
  type TradeSide = "buy" | "sell";
240
+ interface TradeFormValidation {
241
+ isValid: boolean;
242
+ errors: string[];
243
+ }
363
244
  interface UseTradeFormParams {
364
- /** Market to trade in */
365
- market: StandardMarket;
366
- /** Chain network to use (default: 'solana') */
245
+ market: PredictMarket;
367
246
  chain?: string;
368
- /** Initial trade outcome */
369
247
  initialOutcome?: TradeOutcome;
370
- /** Initial trade side */
371
248
  initialSide?: TradeSide;
372
249
  }
373
- interface TradeFormValidation {
374
- isValid: boolean;
375
- errors: string[];
376
- }
377
250
  interface UseTradeFormResult {
378
- /** Current outcome (yes/no) */
379
251
  outcome: TradeOutcome;
380
- /** Current side (buy/sell) */
381
252
  side: TradeSide;
382
- /** Number of contracts */
383
253
  quantity: number;
384
- /** Number of shares (buy: amount / price, sell: quantity) */
385
- shares: number;
386
- /** Estimated cost in dollars */
387
254
  estimatedCost: number;
388
- /** Potential payout in dollars */
389
255
  potentialPayout: number;
390
- /** Potential profit in dollars */
391
256
  potentialProfit: number;
392
- /** Whether the user is authenticated */
393
- isAuthenticated: boolean;
394
- /** Best bid price from order book (cents) */
395
- bestBid: number | null;
396
- /** Best ask price from order book (cents) */
397
- bestAsk: number | null;
398
- /** Current order response from the API (includes quote + transaction) */
399
- order: OrderResponse | null;
400
- /** Price impact percentage */
401
- priceImpact: number | null;
402
- /** USDC balance in dollars (for buy side) */
403
257
  usdcBalance: number | null;
404
- /** Outcome token balance in token units (for sell side) */
405
- outcomeTokenBalance: number | null;
406
- /** Yes token balance (shares held) */
407
258
  yesTokenBalance: number | null;
408
- /** No token balance (shares held) */
409
259
  noTokenBalance: number | null;
410
- /** Whether balance is being fetched */
411
260
  isBalanceLoading: boolean;
412
- /** Whether order/quote is being fetched */
413
- isQuoteLoading: boolean;
414
- /** Whether a transaction is being signed/sent or order is pending */
415
261
  isSubmitting: boolean;
416
- /** Order/quote fetch error (if any) */
417
- quoteError: Error | null;
418
- /** Transaction hash after successful send */
419
- txHash: string | null;
420
- /** Order status polling result (null before submit or after reset) */
421
- orderStatus: OrderStatusResponse | null;
422
- /** Form validation result */
423
262
  validation: TradeFormValidation;
424
- /** Set outcome */
425
263
  setOutcome: (outcome: TradeOutcome) => void;
426
- /** Set side */
427
264
  setSide: (side: TradeSide) => void;
428
- /** Set quantity (minimum ORDER_MIN_QUANTITY) */
429
265
  setQuantity: (quantity: number) => void;
430
- /** Submit the swap */
431
266
  submit: () => void;
432
- /** Reset form to initial values */
433
- reset: () => void;
434
267
  }
435
268
  declare function useTradeForm({ market, chain: _chain, initialOutcome, initialSide, }: UseTradeFormParams): UseTradeFormResult;
436
269
 
437
- interface EventDetailWidgetProps {
438
- eventId: string;
439
- /** Initial market tickers to query candlesticks for. Default is first 4 markets of the event, max is 4. */
440
- initialMarketTickers?: string[];
441
- /** Initial chart range. Default is "1d" (1 day). */
442
- initialChartRange?: ChartRangeType;
443
- /** Callback when a trade action is triggered (market button / orderbook click) */
444
- onTradeAction?: (market: StandardMarket, outcome: TradeOutcome, side: TradeSide) => void;
445
- }
446
- declare function EventDetailWidget({ eventId, initialMarketTickers, initialChartRange, onTradeAction, }: EventDetailWidgetProps): react_jsx_runtime.JSX.Element;
447
-
448
- interface EventDetailPageProps extends Omit<EventDetailWidgetProps, "eventId" | "onTradeAction"> {
449
- /** Event ticker ID */
450
- eventId: string;
451
- /** Chain network for trading (default: 'solana') */
452
- chain?: string;
270
+ interface EventDetailUIProps {
271
+ event: PredictEvent;
272
+ /** Callback when a trade action is triggered */
273
+ onTradeAction?: (market: PredictMarket, outcome: TradeOutcome, side: TradeSide) => void;
453
274
  }
454
- declare function EventDetailPage({ eventId, chain, ...widgetProps }: EventDetailPageProps): react_jsx_runtime.JSX.Element;
275
+ declare function EventDetailUI({ event, onTradeAction }: EventDetailUIProps): react_jsx_runtime.JSX.Element;
455
276
 
456
- interface EventDetailUIProps {
457
- event: StandardEvent;
458
- /** Series data for the event */
459
- series?: SeriesResponse;
460
- /** Map of market ticker to candlestick data */
461
- candlesticks?: Map<string, CandlesticksResponse>;
462
- /** Currently selected chart range */
463
- chartRange?: ChartRangeType;
464
- /** Derived candlestick period interval (for chart formatting) */
465
- periodInterval?: CandlestickPeriodType;
466
- /** Whether candlesticks are loading */
467
- isCandlesticksLoading?: boolean;
468
- /** Map of market ticker to candlestick error */
469
- candlestickErrors?: Map<string, Error>;
470
- /** Callback when chart range changes */
471
- onRangeChange?: (range: ChartRangeType) => void;
472
- /** Selected market tickers for candlestick chart */
473
- selectedMarketTickers?: string[];
474
- /** Callback when selected markets change */
475
- onMarketSelectionChange?: (marketTickers: string[]) => void;
476
- /** Callback when a trade action is triggered (market button / orderbook click) */
477
- onTradeAction?: (market: StandardMarket, outcome: TradeOutcome, side: TradeSide) => void;
277
+ interface EventDetailWidgetProps {
278
+ /** Event slug (canonical business key). */
279
+ eventSlug: string;
280
+ /** Upstream provider (`"dflow"` or `"polymarket"`). Required by prediction-server. */
281
+ source?: ProviderSource;
282
+ /** Callback when a trade action is triggered (market button / orderbook click). */
283
+ onTradeAction?: (market: PredictMarket, outcome: TradeOutcome, side: TradeSide) => void;
478
284
  }
479
- declare function EventDetailUI({ event, series, candlesticks, chartRange, periodInterval, isCandlesticksLoading, onRangeChange, selectedMarketTickers, onMarketSelectionChange, onTradeAction, }: EventDetailUIProps): react_jsx_runtime.JSX.Element;
285
+ declare function EventDetailWidget({ eventSlug, source, onTradeAction, }: EventDetailWidgetProps): react_jsx_runtime.JSX.Element;
480
286
 
481
287
  interface UseEventDetailParams {
482
- eventId: string;
483
- /** Market tickers to query candlesticks for. Default is first 4 markets of the event, max is 4. */
484
- candlestickMarketTickers?: string[];
485
- /** Chart time range (1d / 1w / 1m / all). Determines both the query window and candlestick granularity. */
486
- chartRange?: ChartRangeType;
288
+ /** Event slug (canonical business key). */
289
+ eventSlug: string;
290
+ /** Upstream provider (`"dflow"` or `"polymarket"`). Required by prediction-server. */
291
+ source?: ProviderSource;
292
+ /** Market slugs to query candlesticks for. Default: top 4 by yesAsk. */
293
+ candlestickMarketSlugs?: string[];
294
+ /** Chart time range (1d / 1w / 1m / all). */
295
+ chartRange?: ChartRangeType$1;
487
296
  }
488
297
  declare const useEventDetail: (params: UseEventDetailParams) => {
489
- event: StandardEvent | undefined;
298
+ event: PredictEvent | undefined;
490
299
  isEventLoading: boolean;
491
300
  eventError: Error | null;
492
- series: SeriesResponse | undefined;
493
- isSeriesLoading: boolean;
494
- seriesError: Error | null;
495
- /** Derived candlestick granularity (for chart formatting) */
496
- periodInterval: CandlestickPeriodType;
497
- candlesticks: Map<string, CandlesticksResponse>;
301
+ candlestickParams: ListCandlesticksParams;
302
+ candlesticks: Map<string, Candlestick[]>;
498
303
  isCandlesticksLoading: boolean;
499
304
  candlestickErrors: Map<string, Error>;
500
305
  };
501
306
 
502
307
  interface EventDetailSkeletonProps {
503
- /** Number of market rows */
504
308
  marketCount?: number;
505
309
  }
506
310
  declare function EventDetailSkeleton({ marketCount, }: EventDetailSkeletonProps): react_jsx_runtime.JSX.Element;
507
- /** Compact skeleton for the sidebar trade form area */
508
311
  declare function TradeFormSkeleton(): react_jsx_runtime.JSX.Element;
509
312
 
510
313
  interface EventMarketDetailWidgetProps {
511
- market: StandardMarket;
512
- /** Callback when an orderbook row is clicked – propagates market, outcome & side */
513
- onTradeAction?: (market: StandardMarket, outcome: TradeOutcome, side: TradeSide) => void;
314
+ market: PredictMarket;
315
+ onTradeAction?: (market: PredictMarket, outcome: TradeOutcome, side: TradeSide) => void;
514
316
  }
515
317
  declare function EventMarketDetailWidget({ market, onTradeAction, }: EventMarketDetailWidgetProps): react_jsx_runtime.JSX.Element;
516
318
 
517
- interface EventDetailPageV2Props {
518
- /** Event slug (canonical business key). */
519
- eventSlug: string;
520
- /** Upstream provider (`"dflow"` or `"polymarket"`). Required by prediction-server. */
521
- source?: V2ProviderSource;
522
- /** Chain network for trading (default: 'solana'). */
523
- chain?: string;
524
- /** Connected wallet address for user activity (positions/orders/trades). */
525
- walletAddress?: string;
526
- /** Callback when a similar event card is clicked. Receives the clicked event. */
527
- onSimilarEventClick?: (event: V2Event) => void;
319
+ interface EventPriceChartProps {
320
+ event: PredictEvent;
321
+ isLoading?: boolean;
322
+ /** Optional CSS class for the outer container */
323
+ className?: string;
324
+ /** Event total volume (shown in chart footer bar alongside interval switcher) */
325
+ volume?: number;
528
326
  }
529
- declare function EventDetailPageV2({ eventSlug, source, chain, walletAddress, onSimilarEventClick, }: EventDetailPageV2Props): react_jsx_runtime.JSX.Element;
327
+ declare function EventPriceChart(props: EventPriceChartProps): react_jsx_runtime.JSX.Element;
530
328
 
531
- interface EventDetailV2UIProps {
532
- event: V2Event;
533
- /** Callback when a trade action is triggered */
534
- onTradeAction?: (market: V2Market, outcome: TradeOutcome, side: TradeSide) => void;
329
+ interface UserActivitySectionProps {
330
+ event: PredictEvent;
331
+ /** Connected wallet address. When empty the section shows a connect prompt. */
332
+ walletAddress?: string;
333
+ /** Callback to cancel an open order. */
334
+ onCancelOrder?: (orderId: string) => void;
535
335
  }
536
- declare function EventDetailV2UI({ event, onTradeAction, }: EventDetailV2UIProps): react_jsx_runtime.JSX.Element;
336
+ declare function UserActivitySection({ event, walletAddress, onCancelOrder, }: UserActivitySectionProps): react_jsx_runtime.JSX.Element;
537
337
 
538
- interface EventDetailWidgetV2Props {
539
- /** Event slug (canonical business key). */
338
+ interface SimilarEventsSectionProps {
540
339
  eventSlug: string;
541
- /** Upstream provider (`"dflow"` or `"polymarket"`). Required by prediction-server. */
542
- source?: V2ProviderSource;
543
- /** Callback when a trade action is triggered (market button / orderbook click). */
544
- onTradeAction?: (market: V2Market, outcome: TradeOutcome, side: TradeSide) => void;
340
+ source: ProviderSource;
341
+ /** Number of similar events to fetch (default: 4). */
342
+ limit?: number;
343
+ onEventClick?: (event: PredictEvent) => void;
545
344
  }
546
- declare function EventDetailWidgetV2({ eventSlug, source, onTradeAction, }: EventDetailWidgetV2Props): react_jsx_runtime.JSX.Element;
547
-
548
- interface UseEventDetailV2Params {
549
- /** Event slug (canonical business key). */
550
- eventSlug: string;
551
- /** Upstream provider (`"dflow"` or `"polymarket"`). Required by prediction-server. */
552
- source?: V2ProviderSource;
553
- /** Market slugs to query candlesticks for. Default: top 4 by yesAsk. */
554
- candlestickMarketSlugs?: string[];
555
- /** Chart time range (1d / 1w / 1m / all). */
556
- chartRange?: ChartRangeType;
345
+ interface SimilarEventCardProps {
346
+ event: PredictEvent;
347
+ onClick?: (event: PredictEvent) => void;
557
348
  }
558
- declare const useEventDetailV2: (params: UseEventDetailV2Params) => {
559
- event: V2Event | undefined;
560
- isEventLoading: boolean;
561
- eventError: Error | null;
562
- periodInterval: CandlestickPeriodType;
563
- candlesticks: Map<string, CandlesticksResponse>;
564
- isCandlesticksLoading: boolean;
565
- candlestickErrors: Map<string, Error>;
566
- };
349
+ declare function SimilarEventsSection({ eventSlug, source, limit, onEventClick, }: SimilarEventsSectionProps): react_jsx_runtime.JSX.Element | null;
350
+ declare function SimilarEventCard({ event, onClick }: SimilarEventCardProps): react_jsx_runtime.JSX.Element;
567
351
 
568
- interface EventPriceChartV2Props {
569
- event: V2Event;
570
- isLoading?: boolean;
571
- /** Optional CSS class for the outer container */
572
- className?: string;
352
+ interface DepthLevel {
353
+ price: number;
354
+ quantity: number;
573
355
  }
574
- declare function EventPriceChartV2(props: EventPriceChartV2Props): react_jsx_runtime.JSX.Element;
575
-
576
- interface EventMarketDetailV2WidgetProps {
577
- market: V2Market;
578
- onTradeAction?: (market: V2Market, outcome: TradeOutcome, side: TradeSide) => void;
356
+ interface EventMarketDepthChartUIProps {
357
+ bids: DepthLevel[];
358
+ asks: DepthLevel[];
579
359
  }
580
- declare function EventMarketDetailV2Widget({ market, onTradeAction, }: EventMarketDetailV2WidgetProps): react_jsx_runtime.JSX.Element;
360
+ /**
361
+ * Format a number using 万 (10 000) notation.
362
+ * 12000 → "1.2万" | 787000 → "78.7万" | 9999 → "9,999"
363
+ */
364
+ declare function formatWan(n: number): string;
365
+ interface DepthSlot {
366
+ priceCents: number;
367
+ displayHeight: number;
368
+ opacity: number;
369
+ isBid: boolean;
370
+ isAsk: boolean;
371
+ bidCumTotal: number;
372
+ askCumTotal: number;
373
+ bidCumCost: number;
374
+ askCumCost: number;
375
+ }
376
+ declare function EventMarketDepthChartUI({ bids, asks, }: EventMarketDepthChartUIProps): react_jsx_runtime.JSX.Element;
581
377
 
582
- interface UserActivityV2SectionProps {
583
- event: V2Event;
584
- /** Connected wallet address. When empty the section shows a connect prompt. */
585
- walletAddress?: string;
586
- /** Callback to cancel an open order. */
587
- onCancelOrder?: (orderId: string) => void;
378
+ /**
379
+ * Presentation-layer shapes for trade-form and related UI (camelCase, binary fields).
380
+ */
381
+ interface StandardEvent {
382
+ title: string;
383
+ imageUrl?: string;
384
+ }
385
+ interface StandardMarket {
386
+ yesAsk?: number;
387
+ noAsk?: number;
388
+ yesBid?: number;
389
+ noBid?: number;
390
+ yesSubTitle: string;
391
+ noSubTitle: string;
588
392
  }
589
- declare function UserActivityV2Section({ event, walletAddress, onCancelOrder, }: UserActivityV2SectionProps): react_jsx_runtime.JSX.Element;
590
393
 
591
394
  interface TradeFormUIProps {
592
395
  /** Event data */
@@ -631,341 +434,14 @@ interface TradeFormUIProps {
631
434
  declare function TradeFormUI({ event, market, outcome, side, quantity, potentialProfit, estimatedCost, usdcBalance, yesTokenBalance, noTokenBalance, isBalanceLoading, isSubmitting, isValid, onOutcomeChange, onSideChange, onQuantityChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
632
435
 
633
436
  interface TradeFormWidgetProps {
634
- /** Event data */
635
- event?: StandardEvent;
636
- /** Market to trade */
637
- market: StandardMarket;
638
- /** Initial trade side */
437
+ event?: PredictEvent;
438
+ market: PredictMarket;
639
439
  initialSide?: TradeSide;
640
- /** Initial trade outcome */
641
440
  initialOutcome?: TradeOutcome;
642
- /** Chain network (default: 'solana') */
643
441
  chain?: string;
644
442
  }
645
443
  declare function TradeFormWidget({ event, market, initialSide, initialOutcome, chain, }: TradeFormWidgetProps): react_jsx_runtime.JSX.Element;
646
444
 
647
- interface UseTradeFormV2Params {
648
- market: V2Market;
649
- chain?: string;
650
- initialOutcome?: TradeOutcome;
651
- initialSide?: TradeSide;
652
- }
653
- interface UseTradeFormV2Result {
654
- outcome: TradeOutcome;
655
- side: TradeSide;
656
- quantity: number;
657
- estimatedCost: number;
658
- potentialPayout: number;
659
- potentialProfit: number;
660
- usdcBalance: number | null;
661
- yesTokenBalance: number | null;
662
- noTokenBalance: number | null;
663
- isBalanceLoading: boolean;
664
- isSubmitting: boolean;
665
- validation: TradeFormValidation;
666
- setOutcome: (outcome: TradeOutcome) => void;
667
- setSide: (side: TradeSide) => void;
668
- setQuantity: (quantity: number) => void;
669
- submit: () => void;
670
- }
671
- declare function useTradeFormV2({ market, chain: _chain, initialOutcome, initialSide, }: UseTradeFormV2Params): UseTradeFormV2Result;
672
-
673
- interface TradeFormV2WidgetProps {
674
- event?: V2Event;
675
- market: V2Market;
676
- initialSide?: TradeSide;
677
- initialOutcome?: TradeOutcome;
678
- chain?: string;
679
- }
680
- declare function TradeFormV2Widget({ event, market, initialSide, initialOutcome, chain, }: TradeFormV2WidgetProps): react_jsx_runtime.JSX.Element;
681
-
682
- interface UseOrderBookParams {
683
- /** Market ticker */
684
- marketTicker: string;
685
- /** Maximum number of levels to display per side */
686
- maxLevels?: number;
687
- /** Polling interval in milliseconds (0 to disable) */
688
- refetchInterval?: number;
689
- /** Which outcome to display (yes or no). Defaults to yes. */
690
- outcome?: "yes" | "no";
691
- }
692
- interface OrderBookRow extends OrderbookLevel {
693
- /** Cumulative quantity up to (and including) this level */
694
- cumulative: number;
695
- /** Depth ratio 0–1 relative to the maximum cumulative quantity */
696
- depth: number;
697
- }
698
- interface UseOrderBookResult {
699
- /** Bid rows sorted from highest to lowest price */
700
- bids: OrderBookRow[];
701
- /** Ask rows sorted from lowest to highest price */
702
- asks: OrderBookRow[];
703
- /** Spread in cents */
704
- spread: number | null;
705
- /** Spread as percentage of midpoint */
706
- spreadPercent: number | null;
707
- /** Midpoint price in cents */
708
- midpoint: number | null;
709
- /** Whether initial data is loading */
710
- isLoading: boolean;
711
- /** Whether a background refetch is in progress */
712
- isFetching: boolean;
713
- }
714
- declare function useOrderBook({ marketTicker, maxLevels, refetchInterval, outcome, }: UseOrderBookParams): UseOrderBookResult;
715
-
716
- interface OrderBookUIProps {
717
- /** Bid rows (highest to lowest) */
718
- bids: OrderBookRow[];
719
- /** Ask rows (lowest to highest) */
720
- asks: OrderBookRow[];
721
- /** Spread in cents */
722
- spread: number | null;
723
- /** Spread percentage */
724
- spreadPercent: number | null;
725
- /** Whether initial data is loading */
726
- isLoading: boolean;
727
- /** Callback when a price level is clicked */
728
- onPriceClick?: (price: number) => void;
729
- }
730
- declare function OrderBookUI({ bids, asks, spread, spreadPercent, isLoading, onPriceClick, }: OrderBookUIProps): react_jsx_runtime.JSX.Element;
731
-
732
- interface OrderBookWidgetProps {
733
- /** Market ticker */
734
- marketTicker: string;
735
- /** Maximum levels per side (default 10) */
736
- maxLevels?: number;
737
- /** Polling interval in ms (default 5000, 0 to disable) */
738
- refetchInterval?: number;
739
- /** Callback when a price level is clicked */
740
- onPriceClick?: (price: number) => void;
741
- /** Which outcome to display (yes or no). Defaults to yes. */
742
- outcome?: "yes" | "no";
743
- }
744
- declare function OrderBookWidget({ marketTicker, maxLevels, refetchInterval, onPriceClick, outcome, }: OrderBookWidgetProps): react_jsx_runtime.JSX.Element;
745
-
746
- interface UseOpenOrdersParams {
747
- /** Polling interval in ms (0 to disable) */
748
- refetchInterval?: number;
749
- }
750
- /**
751
- * @deprecated Order type - new API uses swap model
752
- */
753
- interface Order {
754
- id: string;
755
- marketId: string;
756
- side: "buy" | "sell";
757
- outcome: "yes" | "no";
758
- type: "limit" | "market";
759
- price: number;
760
- quantity: number;
761
- filledQuantity: number;
762
- status: "open" | "partial" | "filled" | "cancelled";
763
- createdAt: string;
764
- }
765
- interface UseOpenOrdersResult {
766
- /** List of open orders */
767
- orders: Order[];
768
- /** Whether data is loading */
769
- isLoading: boolean;
770
- /** Whether a background refetch is in progress */
771
- isFetching: boolean;
772
- /** ID of the order currently being cancelled (null if none) */
773
- cancellingOrderId: string | null;
774
- /** Cancel an order by id */
775
- cancelOrder: (orderId: string) => void;
776
- /** Error from the most recent cancel attempt */
777
- cancelError: Error | null;
778
- }
779
- /**
780
- * @deprecated This hook is deprecated. The new dflow API uses a swap-based model.
781
- * Use `useOrderStatusQuery` to track swap status instead.
782
- */
783
- declare function useOpenOrders(_params?: UseOpenOrdersParams): UseOpenOrdersResult;
784
-
785
- interface OpenOrdersUIProps {
786
- /** List of open orders */
787
- orders: Order[];
788
- /** Whether data is loading */
789
- isLoading: boolean;
790
- /** ID of the order currently being cancelled */
791
- cancellingOrderId: string | null;
792
- /** Cancel an order */
793
- onCancel: (orderId: string) => void;
794
- }
795
- declare function OpenOrdersUI({ orders, isLoading, cancellingOrderId, onCancel, }: OpenOrdersUIProps): react_jsx_runtime.JSX.Element;
796
-
797
- interface OpenOrdersWidgetProps {
798
- /** Polling interval in ms (default 10000, 0 to disable) */
799
- refetchInterval?: number;
800
- }
801
- /**
802
- * @deprecated This widget is deprecated. Use swap-based order model instead.
803
- */
804
- declare function OpenOrdersWidget({ refetchInterval, }?: OpenOrdersWidgetProps): react_jsx_runtime.JSX.Element;
805
-
806
- interface UseTradeHistoryParams {
807
- /** Optional filter by market ticker */
808
- ticker?: string;
809
- /** Page size */
810
- pageSize?: number;
811
- }
812
- interface UseTradeHistoryResult {
813
- /** Current page of trades */
814
- trades: SingleTradeResponse[];
815
- /** Whether initial data is loading */
816
- isLoading: boolean;
817
- /** Whether a background refetch is in progress */
818
- isFetching: boolean;
819
- /** Current page (1-based) */
820
- page: number;
821
- /** Page size */
822
- pageSize: number;
823
- /** Whether more pages exist */
824
- hasNextPage: boolean;
825
- /** Whether a previous page exists */
826
- hasPrevPage: boolean;
827
- /** Navigate to a specific page */
828
- goToPage: (page: number) => void;
829
- /** Go to the next page */
830
- nextPage: () => void;
831
- /** Go to the previous page */
832
- prevPage: () => void;
833
- }
834
- declare function useTradeHistory({ ticker, pageSize, }?: UseTradeHistoryParams): UseTradeHistoryResult;
835
-
836
- interface TradeHistoryUIProps {
837
- /** List of trades for current page */
838
- trades: SingleTradeResponse[];
839
- /** Whether data is loading */
840
- isLoading: boolean;
841
- /** Whether background refetch is in progress */
842
- isFetching: boolean;
843
- /** Current page (1-based) */
844
- page: number;
845
- /** Whether more pages exist */
846
- hasNextPage: boolean;
847
- /** Whether a previous page exists */
848
- hasPrevPage: boolean;
849
- /** Go to next page */
850
- onNextPage: () => void;
851
- /** Go to previous page */
852
- onPrevPage: () => void;
853
- }
854
- declare function TradeHistoryUI({ trades, isLoading, isFetching, page, hasNextPage, hasPrevPage, onNextPage, onPrevPage, }: TradeHistoryUIProps): react_jsx_runtime.JSX.Element;
855
-
856
- interface TradeHistoryWidgetProps {
857
- /** Optional filter by market ticker */
858
- ticker?: string;
859
- /** Page size (default: DEFAULT_PAGE_SIZE) */
860
- pageSize?: number;
861
- }
862
- declare function TradeHistoryWidget({ ticker, pageSize, }?: TradeHistoryWidgetProps): react_jsx_runtime.JSX.Element;
863
-
864
- interface UsePositionsParams {
865
- /** Polling interval in ms (0 to disable) */
866
- refetchInterval?: number;
867
- }
868
- /**
869
- * @deprecated Position type - not provided by new API
870
- */
871
- interface Position {
872
- id: string;
873
- marketId: string;
874
- marketTitle: string;
875
- outcome: "yes" | "no";
876
- quantity: number;
877
- avgPrice: number;
878
- avgCostBasis: number;
879
- currentPrice: number;
880
- unrealizedPnl: number;
881
- realizedPnl: number;
882
- }
883
- interface PositionsSummary {
884
- /** Total market value in cents */
885
- totalValue: number;
886
- /** Total unrealised PnL in cents */
887
- totalUnrealizedPnl: number;
888
- /** Total realised PnL in cents */
889
- totalRealizedPnl: number;
890
- /** Number of positions */
891
- count: number;
892
- }
893
- interface UsePositionsResult {
894
- /** Positions list */
895
- positions: Position[];
896
- /** Whether data is loading */
897
- isLoading: boolean;
898
- /** Whether a background refetch is in progress */
899
- isFetching: boolean;
900
- /** Aggregated summary across all positions */
901
- summary: PositionsSummary;
902
- }
903
- /**
904
- * @deprecated This hook is deprecated. The new dflow API does not provide
905
- * positions data. Use on-chain token balance queries instead.
906
- */
907
- declare function usePositions(_params?: UsePositionsParams): UsePositionsResult;
908
-
909
- interface PositionsUIProps {
910
- /** List of positions */
911
- positions: Position[];
912
- /** Whether data is loading */
913
- isLoading: boolean;
914
- /** Aggregated summary */
915
- summary: PositionsSummary;
916
- /** Callback when a position's sell button is clicked */
917
- onSell?: (position: Position) => void;
918
- }
919
- declare function PositionsUI({ positions, isLoading, summary, onSell, }: PositionsUIProps): react_jsx_runtime.JSX.Element;
920
-
921
- interface PositionsWidgetProps {
922
- /** Polling interval in ms (default 15000, 0 to disable) */
923
- refetchInterval?: number;
924
- /** Callback when a position's sell action is triggered */
925
- onSell?: (position: Position) => void;
926
- }
927
- /**
928
- * @deprecated This widget is deprecated. Use on-chain token balance queries instead.
929
- */
930
- declare function PositionsWidget({ refetchInterval, onSell, }?: PositionsWidgetProps): react_jsx_runtime.JSX.Element;
931
-
932
- /** A single category with its tags */
933
- interface EventCategory {
934
- /** Category name (e.g. "Politics", "Economics") */
935
- category: string;
936
- /** Tags associated with this category */
937
- tags: string[];
938
- }
939
- /** Return type for the useEventsCategories hook */
940
- interface UseEventsCategoriesResult {
941
- /** Structured category list */
942
- data: EventCategory[];
943
- /** Whether data is still loading */
944
- isLoading: boolean;
945
- /** Whether there is an error */
946
- isError: boolean;
947
- /** Error information */
948
- error: Error | null;
949
- }
950
- /**
951
- * Fetches event categories and their tags.
952
- *
953
- * Uses `getTagsByCategories()` to build a sorted list of categories, each
954
- * containing the tags that belong to it.
955
- *
956
- * @example
957
- * ```tsx
958
- * const { data: categories, isLoading } = useEventsCategories();
959
- *
960
- * // categories = [
961
- * // { category: "Politics", tags: ["US Elections", ...] },
962
- * // { category: "Sports", tags: ["NFL", "NBA", ...] },
963
- * // ...
964
- * // ]
965
- * ```
966
- */
967
- declare function useEventsCategories(): UseEventsCategoriesResult;
968
-
969
445
  interface CategoryItem {
970
446
  category: string;
971
447
  tags: string[];
@@ -1002,53 +478,17 @@ declare function CategoriesSkeleton({ count }: {
1002
478
  count?: number;
1003
479
  }): react_jsx_runtime.JSX.Element;
1004
480
 
1005
- /** Selection state emitted by the categories widget */
1006
- interface CategorySelection {
1007
- /** Selected category name, null when "Trending" is selected */
1008
- category: string | null;
1009
- /** Tags to filter by, null when no filter is applied */
1010
- tags: string[] | null;
1011
- }
1012
- interface CategoriesWidgetProps {
1013
- /**
1014
- * Callback when category / tag selection changes.
1015
- * - `category = null, tags = null` → "Trending" is selected (no filter)
1016
- * - `category = "Politics", tags = [...]` → category selected with its tags
1017
- */
1018
- onSelect?: (selection: CategorySelection) => void;
1019
- /** Optional class name */
1020
- className?: string;
1021
- }
1022
- declare function CategoriesWidget({ onSelect, className, }: CategoriesWidgetProps): react_jsx_runtime.JSX.Element;
1023
-
1024
- interface CategoriesWidgetV2Props {
1025
- /**
1026
- * Callback fired when the category / tag selection changes.
1027
- *
1028
- * Slug values follow the DFlow `mapTag()` convention (slug === label):
1029
- * - `{ categorySlug: null, tagSlug: null }` → "Trending" (no filter)
1030
- * - `{ categorySlug: "Crypto", tagSlug: null }` → category selected
1031
- * - `{ categorySlug: "Crypto", tagSlug: "BTC" }` → specific tag selected
1032
- */
1033
- onSelect?: (selection: TagSlugSelection) => void;
1034
- /** Content rendered at the end of the primary chip row (e.g. sort/filter controls) */
1035
- trailing?: React.ReactNode;
1036
- /** Optional class name applied to the root element */
1037
- className?: string;
1038
- }
1039
- declare function CategoriesWidgetV2({ onSelect, trailing, className, }: CategoriesWidgetV2Props): react_jsx_runtime.JSX.Element;
1040
-
1041
481
  type PredictSearchModalParams = {
1042
482
  /** Generate href for each event row. When set, rows render as links. */
1043
- getEventHref?: (event: V2Event) => string;
483
+ getEventHref?: (event: PredictEvent) => string;
1044
484
  /** Custom link component (e.g. next/link). */
1045
485
  LinkComponent?: LinkComponentType;
1046
486
  /** Called when a row is hovered (for data prefetching). */
1047
- onHover?: (event: V2Event) => void;
487
+ onHover?: (event: PredictEvent) => void;
1048
488
  /** Filter by upstream provider. When set, only events from that provider are returned. */
1049
- source?: V2ProviderSource;
489
+ source?: ProviderSource;
1050
490
  };
1051
- type PredictSearchModalResult = V2Event;
491
+ type PredictSearchModalResult = PredictEvent;
1052
492
  declare const PREDICT_SEARCH_MODAL_ID = "predict-search";
1053
493
  declare function PredictSearchModal({ id, }: {
1054
494
  id?: string;
@@ -1056,7 +496,7 @@ declare function PredictSearchModal({ id, }: {
1056
496
 
1057
497
  type SearchEventsButtonProps = {
1058
498
  /** Callback when an event is selected from the search modal */
1059
- onSelectEvent?: (event: V2Event) => void;
499
+ onSelectEvent?: (event: PredictEvent) => void;
1060
500
  /** Params forwarded to the search modal (getEventHref, LinkComponent, onHover) */
1061
501
  modalParams?: Omit<PredictSearchModalParams, never>;
1062
502
  className?: string;
@@ -1098,14 +538,14 @@ type SearchInputUIProps = {
1098
538
  declare function SearchInputUI({ value, onValueChange, onClear, onEscape, className, }: SearchInputUIProps): react_jsx_runtime.JSX.Element;
1099
539
 
1100
540
  type SearchResultItemUIProps = {
1101
- event: V2Event;
541
+ event: PredictEvent;
1102
542
  /** URL for the detail page. When set, the row renders as a link via Linkable. */
1103
543
  href?: string;
1104
544
  /** Custom link component (e.g. next/link). */
1105
545
  LinkComponent?: LinkComponentType;
1106
- onSelect?: (event: V2Event) => void;
546
+ onSelect?: (event: PredictEvent) => void;
1107
547
  /** Called when the row is hovered (for data prefetching). */
1108
- onHover?: (event: V2Event) => void;
548
+ onHover?: (event: PredictEvent) => void;
1109
549
  className?: string;
1110
550
  };
1111
551
  declare function SearchResultItemUI({ event, href, LinkComponent, onSelect, onHover, className, }: SearchResultItemUIProps): react_jsx_runtime.JSX.Element;
@@ -1114,24 +554,24 @@ interface UseSearchResultListScriptParams {
1114
554
  keyword?: string;
1115
555
  limit?: number;
1116
556
  /** Filter by upstream provider. When set, only events from that provider are returned. */
1117
- source?: V2ProviderSource;
557
+ source?: ProviderSource;
1118
558
  }
1119
559
  declare function useSearchResultListScript({ keyword, limit, source, }: UseSearchResultListScriptParams): {
1120
- events: V2Event[];
560
+ events: PredictEvent[];
1121
561
  isLoading: boolean;
1122
562
  isFetchingNextPage: boolean;
1123
563
  hasNextPage: boolean;
1124
- fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<V2Page<V2Event>, unknown>, Error>>;
564
+ fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<_tanstack_react_query.InfiniteData<PredictPage<PredictEvent>, unknown>, Error>>;
1125
565
  };
1126
566
 
1127
567
  type SearchResultListWidgetProps = {
1128
- onSelect?: (event: V2Event) => void;
568
+ onSelect?: (event: PredictEvent) => void;
1129
569
  /** Generate href for each event row. When set, rows render as links. */
1130
- getEventHref?: (event: V2Event) => string;
570
+ getEventHref?: (event: PredictEvent) => string;
1131
571
  /** Custom link component (e.g. next/link). */
1132
572
  LinkComponent?: LinkComponentType;
1133
573
  /** Called when a row is hovered (for data prefetching). */
1134
- onHover?: (event: V2Event) => void;
574
+ onHover?: (event: PredictEvent) => void;
1135
575
  className?: string;
1136
576
  } & UseSearchResultListScriptParams;
1137
577
  declare function SearchResultListWidget({ onSelect, getEventHref, LinkComponent, onHover, className, ...scriptParams }: SearchResultListWidgetProps): react_jsx_runtime.JSX.Element;
@@ -1152,674 +592,94 @@ type SearchWidgetProps = {
1152
592
  /** Callback when the debounced keyword changes */
1153
593
  onKeywordChange?: (keyword: string) => void;
1154
594
  /** Callback when an event is selected */
1155
- onSelectEvent?: (event: V2Event) => void;
595
+ onSelectEvent?: (event: PredictEvent) => void;
1156
596
  /** Generate href for each event row. When set, rows render as links. */
1157
- getEventHref?: (event: V2Event) => string;
597
+ getEventHref?: (event: PredictEvent) => string;
1158
598
  /** Custom link component (e.g. next/link). */
1159
599
  LinkComponent?: LinkComponentType;
1160
600
  /** Called when a row is hovered (for data prefetching). */
1161
- onHover?: (event: V2Event) => void;
601
+ onHover?: (event: PredictEvent) => void;
1162
602
  /** Called when the Esc button / key is pressed. */
1163
603
  onEscape?: () => void;
1164
604
  /** Filter by upstream provider. When set, only events from that provider are returned. */
1165
- source?: V2ProviderSource;
605
+ source?: ProviderSource;
1166
606
  };
1167
607
  declare function SearchWidget({ onKeywordChange, onSelectEvent, getEventHref, LinkComponent, onHover, onEscape, source, }: SearchWidgetProps): react_jsx_runtime.JSX.Element;
1168
608
 
1169
- interface PredictContextValue {
1170
- /** The predict API client instance */
1171
- client: IPredictClient;
1172
- /** The WebSocket client instance for real-time data */
1173
- wsClient: IPredictWsClient | null;
1174
- }
1175
- declare const PredictContext: react.Context<PredictContextValue>;
609
+ /** Default page size for list queries */
610
+ declare const DEFAULT_PAGE_SIZE = 48;
611
+ /** Maximum number of markets to display in price history chart */
612
+ declare const MAX_PRICE_HISTORY_MARKETS = 4;
613
+ /**
614
+ * Candlestick period intervals in minutes (granularity for API queries)
615
+ */
616
+ declare const CandlestickPeriod: {
617
+ /** 1 minute */
618
+ readonly ONE_MINUTE: 1;
619
+ /** 1 hour (60 minutes) */
620
+ readonly ONE_HOUR: 60;
621
+ /** 1 day (1440 minutes) */
622
+ readonly ONE_DAY: 1440;
623
+ };
624
+ type CandlestickPeriodType = (typeof CandlestickPeriod)[keyof typeof CandlestickPeriod];
625
+ /**
626
+ * Chart range options (the user-facing time range selector)
627
+ */
628
+ declare const ChartRange: {
629
+ /** 1 day */
630
+ readonly ONE_DAY: "1d";
631
+ /** 1 week */
632
+ readonly ONE_WEEK: "1w";
633
+ /** 1 month */
634
+ readonly ONE_MONTH: "1m";
635
+ /** All time */
636
+ readonly ALL: "all";
637
+ };
638
+ type ChartRangeType = (typeof ChartRange)[keyof typeof ChartRange];
639
+ /** Default chart range */
640
+ declare const DEFAULT_CHART_RANGE: "all";
641
+ /** Candlestick granularity derived from chart range (1D → minute, 1W/1M → hourly, ALL → daily) */
642
+ declare const CHART_RANGE_PERIOD: Record<ChartRangeType, CandlestickPeriodType>;
643
+ /** Chart sampling interval in seconds (used to downsample candlestick data for display) */
644
+ declare const CHART_RANGE_SAMPLE_INTERVAL: Record<ChartRangeType, number>;
645
+ /** Duration in seconds for each chart range (null = all time) */
646
+ declare const CHART_RANGE_DURATION: Record<ChartRangeType, number | null>;
647
+ /** Minimum order quantity (contracts) */
648
+ declare const ORDER_MIN_QUANTITY = 1;
649
+ /** Price step size in cents */
650
+ declare const ORDER_PRICE_STEP = 1;
651
+ /** Minimum price in cents */
652
+ declare const ORDER_MIN_PRICE = 1;
653
+ /** Maximum price in cents */
654
+ declare const ORDER_MAX_PRICE = 99;
655
+ /** @deprecated Use ChartRange instead */
656
+ declare const PriceHistoryInterval: {
657
+ readonly ONE_HOUR: "1h";
658
+ readonly SIX_HOURS: "6h";
659
+ readonly ONE_DAY: "1d";
660
+ readonly ONE_WEEK: "1w";
661
+ readonly MAX: "max";
662
+ };
663
+ /** @deprecated Use ChartRangeType instead */
664
+ type PriceHistoryIntervalType = (typeof PriceHistoryInterval)[keyof typeof PriceHistoryInterval];
665
+ /** @deprecated Use DEFAULT_CHART_RANGE instead */
666
+ declare const DEFAULT_PRICE_HISTORY_INTERVAL: "1w";
667
+ /** @deprecated */
668
+ declare const PRICE_HISTORY_SAMPLE_INTERVAL: Record<PriceHistoryIntervalType, number>;
1176
669
 
1177
670
  interface UserPredictContextValue {
1178
- /** User's wallet positions */
1179
- positions: WalletPositionItem[];
1180
- /** USDC balance (UI amount) */
671
+ positions: PredictPosition[];
1181
672
  usdcBalance: number;
1182
- /** Whether positions are currently loading for the first time */
1183
673
  isLoading: boolean;
1184
- /** Error from the latest fetch, null if none */
1185
674
  error: Error | null;
1186
- /** Manually trigger a refetch */
1187
675
  refetch: () => void;
1188
676
  }
1189
- declare const UserPredictContext: react.Context<UserPredictContextValue | null>;
1190
-
1191
- interface PredictV2ContextValue {
1192
- /** The prediction-server v2 HTTP client instance. */
1193
- client: PredictClientV2;
1194
- }
1195
- /**
1196
- * Context that carries the v2 prediction client (prediction-server backend).
1197
- *
1198
- * Intentionally separate from `PredictContext` so that the legacy DFlow client
1199
- * and the new prediction-server client can coexist in the same application
1200
- * during an incremental migration.
1201
- *
1202
- * Consumers must be wrapped in `PredictV2Provider`.
1203
- */
1204
- declare const PredictV2Context: react.Context<PredictV2ContextValue | null>;
1205
-
1206
- type PredictProviderProps = PropsWithChildren<{
1207
- /** The predict API client instance */
1208
- client: IPredictClient;
1209
- /** WebSocket client instance (optional, enables WebSocket features) */
1210
- wsClient?: IPredictWsClient | null;
1211
- }>;
1212
- declare function PredictProvider({ client, wsClient, children, }: PredictProviderProps): react_jsx_runtime.JSX.Element;
1213
-
1214
677
  type UserPredictProviderProps = PropsWithChildren<{
1215
- /** Wallet address to poll positions for */
1216
678
  walletAddress: string;
1217
- /** Polling interval in milliseconds (default: 30 000) */
679
+ source?: ProviderSource;
1218
680
  pollingInterval?: number;
1219
- /** Whether polling is enabled (default: true) */
1220
681
  enabled?: boolean;
1221
682
  }>;
1222
- declare function UserPredictProvider({ walletAddress, pollingInterval, enabled, children, }: UserPredictProviderProps): react_jsx_runtime.JSX.Element;
1223
-
1224
- type PredictV2ProviderProps = PropsWithChildren<{
1225
- /**
1226
- * A `PredictClientV2` instance pointed at the prediction-server endpoint.
1227
- *
1228
- * @example
1229
- * ```tsx
1230
- * import { createPredictClientV2 } from "@liberfi.io/ui-predict";
1231
- *
1232
- * const client = createPredictClientV2("https://api.example.com");
1233
- *
1234
- * <PredictV2Provider client={client}>
1235
- * <App />
1236
- * </PredictV2Provider>
1237
- * ```
1238
- */
1239
- client: PredictClientV2;
1240
- }>;
1241
- /**
1242
- * Provides the v2 prediction client via React context.
1243
- *
1244
- * Place this provider at the application root (or any subtree boundary)
1245
- * where v2 prediction hooks are used. It is independent of `PredictProvider`,
1246
- * allowing both to coexist during an incremental migration.
1247
- */
1248
- declare function PredictV2Provider({ client, children, }: PredictV2ProviderProps): react_jsx_runtime.JSX.Element;
1249
-
1250
- /**
1251
- * Returns the v2 prediction context value.
1252
- *
1253
- * Must be called inside a component tree wrapped by `PredictV2Provider`.
1254
- *
1255
- * @throws When used outside of `PredictV2Provider`.
1256
- */
1257
- declare function usePredictV2Context(): PredictV2ContextValue;
1258
-
1259
- /**
1260
- * Convenience hook that returns the `PredictClientV2` instance from context.
1261
- *
1262
- * Must be called inside a component tree wrapped by `PredictV2Provider`.
1263
- */
1264
- declare function usePredictV2Client(): PredictClientV2;
1265
-
1266
- /** Stable TanStack Query key for the v2 events list. */
1267
- declare function eventsV2QueryKey(params?: V2ListEventsParams): unknown[];
1268
- /**
1269
- * Fetch function that can be used outside of React (e.g. in loaders or tests).
1270
- *
1271
- * @param client - A `PredictClientV2` instance.
1272
- * @param params - Optional filter / sort / pagination parameters.
1273
- */
1274
- declare function fetchEventsV2(client: PredictClientV2, params?: V2ListEventsParams): Promise<V2Page<V2Event>>;
1275
- /**
1276
- * React Query hook for `GET /api/v1/events` via the prediction-server v2 client.
1277
- *
1278
- * @param params - Optional filter / sort / pagination parameters.
1279
- * @param queryOptions - Additional TanStack Query options (e.g. `enabled`, `staleTime`).
1280
- *
1281
- * @example
1282
- * ```tsx
1283
- * const { data, isLoading } = useEventsV2Query({ status: "open", limit: 20 });
1284
- * ```
1285
- */
1286
- declare function useEventsV2Query(params?: V2ListEventsParams, queryOptions?: Omit<UseQueryOptions<V2Page<V2Event>, Error, V2Page<V2Event>, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Page<V2Event>, Error>;
1287
-
1288
- interface UseEventV2QueryParams {
1289
- /** Canonical event slug (e.g. "will-trump-win-2024" or "KXBTCD-25FEB-T68000"). */
1290
- slug: string;
1291
- /** Upstream provider. Required by prediction-server for single-event fetch. */
1292
- source?: V2ProviderSource;
1293
- }
1294
- /**
1295
- * React Query hook for `GET /api/v1/events/:slug` via the prediction-server v2 client.
1296
- *
1297
- * @param params - Object containing the event `slug` and optional `source`.
1298
- * @param queryOptions - Additional TanStack Query options (e.g. `enabled`, `staleTime`).
1299
- *
1300
- * @example
1301
- * ```tsx
1302
- * const { data, isLoading } = useEventV2Query({ slug: "CONTROLH-2026", source: "dflow" });
1303
- * ```
1304
- */
1305
- declare function useEventV2Query(params: UseEventV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2Event, Error, V2Event, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Event, Error>;
1306
-
1307
- type InfiniteQueryOptions = Omit<UseInfiniteQueryOptions<V2Page<V2Event>, Error, InfiniteData<V2Page<V2Event>>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
1308
- /**
1309
- * TanStack Query infinite-query hook for `GET /api/v1/events` with cursor-based
1310
- * pagination via the prediction-server v2 client.
1311
- *
1312
- * @param params - Resolved query parameters (use {@link resolveEventsV2Params}
1313
- * to build from user inputs). Do NOT include `cursor` — it is
1314
- * managed automatically by TanStack Query's `pageParam`.
1315
- * @param queryOptions - Additional TanStack Query options.
1316
- *
1317
- * @example
1318
- * ```tsx
1319
- * const params = resolveEventsV2Params({ status: "open", limit: 20 });
1320
- * const { data, hasNextPage, fetchNextPage } = useEventsV2InfiniteQuery(params);
1321
- * ```
1322
- */
1323
- declare function useEventsV2InfiniteQuery(params: V2ListEventsParams, queryOptions?: InfiniteQueryOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<V2Page<V2Event>, unknown>, Error>;
1324
-
1325
- interface UseSearchEventsInfiniteQueryParams {
1326
- /** Search keyword */
1327
- keyword: string;
1328
- /** Page size (default: 20) */
1329
- limit?: number;
1330
- /** Event status filter (default: "open") */
1331
- status?: V2EventStatus;
1332
- /** Filter by upstream provider. When set, only events from that provider are returned. */
1333
- source?: V2ProviderSource;
1334
- /** Include nested markets (default: false for lighter search payloads) */
1335
- with_markets?: boolean;
1336
- }
1337
- /**
1338
- * Infinite query hook for searching prediction events via the V2 `listEvents`
1339
- * endpoint with a `search` parameter.
1340
- *
1341
- * Designed to be consumed by component-level scripts that flatten the paginated
1342
- * data for rendering.
1343
- *
1344
- * @example
1345
- * ```tsx
1346
- * const { data, isLoading, hasNextPage, fetchNextPage } =
1347
- * useSearchEventsInfiniteQuery({ keyword: "trump" });
1348
- * ```
1349
- */
1350
- declare function useSearchEventsInfiniteQuery(params: UseSearchEventsInfiniteQueryParams, queryOptions?: {
1351
- enabled?: boolean;
1352
- }): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<V2Page<V2Event>, unknown>, Error>;
1353
-
1354
- declare function similarEventsV2QueryKey(slug: string, source: V2ProviderSource, params?: V2SimilarEventsParams): unknown[];
1355
- interface UseSimilarEventsV2QueryParams {
1356
- slug: string;
1357
- source: V2ProviderSource;
1358
- limit?: number;
1359
- same_source?: boolean;
1360
- }
1361
- declare function useSimilarEventsV2Query(params: UseSimilarEventsV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2Event[], Error, V2Event[], unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Event[], Error>;
1362
-
1363
- /** Stable TanStack Query key for a single v2 market. */
1364
- declare function marketV2QueryKey(slug: string, source?: V2ProviderSource): unknown[];
1365
- /**
1366
- * Fetch function that can be used outside of React (e.g. in loaders or tests).
1367
- *
1368
- * @param client - A `PredictClientV2` instance.
1369
- * @param slug - Canonical market slug.
1370
- * @param source - Upstream provider (`"dflow"` or `"polymarket"`).
1371
- */
1372
- declare function fetchMarketV2(client: PredictClientV2, slug: string, source?: V2ProviderSource): Promise<V2Market>;
1373
- interface UseMarketV2QueryParams {
1374
- /** Canonical market slug. */
1375
- slug: string;
1376
- /** Upstream provider. Required by prediction-server for single-market fetch. */
1377
- source?: V2ProviderSource;
1378
- }
1379
- /**
1380
- * React Query hook for `GET /api/v1/markets/:slug` via the prediction-server v2 client.
1381
- *
1382
- * @param params - Object containing the market `slug` and optional `source`.
1383
- * @param queryOptions - Additional TanStack Query options (e.g. `enabled`, `staleTime`).
1384
- *
1385
- * @example
1386
- * ```tsx
1387
- * const { data, isLoading } = useMarketV2Query({ slug: "KXBTCD-25FEB-T68000-yes", source: "dflow" });
1388
- * ```
1389
- */
1390
- declare function useMarketV2Query(params: UseMarketV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2Market, Error, V2Market, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Market, Error>;
1391
-
1392
- interface MarketHistoryPoint {
1393
- /** Unix timestamp in milliseconds. */
1394
- timestamp: number;
1395
- /** Implied probability [0, 1]. */
1396
- price: number;
1397
- }
1398
- interface MarketHistorySeries {
1399
- marketSlug: string;
1400
- label: string;
1401
- /** Chronologically ordered price history. */
1402
- data: MarketHistoryPoint[];
1403
- }
1404
- interface UseMarketHistoryV2Result {
1405
- series: MarketHistorySeries[];
1406
- isLoading: boolean;
1407
- }
1408
- /**
1409
- * Returns price history series for the provided V2Markets using the
1410
- * prediction-server `GET /api/v1/markets/{slug}/price-history` endpoint.
1411
- */
1412
- declare function useMarketHistoryV2(markets: V2Market[], range?: ChartRangeType): UseMarketHistoryV2Result;
1413
-
1414
- declare function orderbookV2QueryKey(slug: string, source: V2ProviderSource): unknown[];
1415
- interface UseOrderbookV2QueryParams {
1416
- slug: string;
1417
- source: V2ProviderSource;
1418
- }
1419
- declare function useOrderbookV2Query(params: UseOrderbookV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2Orderbook, Error, V2Orderbook, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Orderbook, Error>;
1420
-
1421
- declare function marketTradesV2QueryKey(slug: string, params: V2ListMarketTradesParams): unknown[];
1422
- interface UseMarketTradesV2QueryParams {
1423
- slug: string;
1424
- source: V2ProviderSource;
1425
- limit?: number;
1426
- cursor?: string;
1427
- side?: string;
1428
- }
1429
- declare function useMarketTradesV2Query(params: UseMarketTradesV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2Page<V2Trade>, Error, V2Page<V2Trade>, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Page<V2Trade>, Error>;
1430
-
1431
- declare function priceHistoryV2QueryKey(slug: string, source: V2ProviderSource, range?: V2PriceHistoryRange): unknown[];
1432
- interface UsePriceHistoryV2QueryParams {
1433
- slug: string;
1434
- source: V2ProviderSource;
1435
- range?: V2PriceHistoryRange;
1436
- }
1437
- declare function usePriceHistoryV2Query(params: UsePriceHistoryV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2PriceHistoryResponse, Error, V2PriceHistoryResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2PriceHistoryResponse, Error>;
1438
-
1439
- declare function candlesticksV2QueryKey(slug: string, params?: V2ListCandlesticksParams): unknown[];
1440
- interface UseCandlesticksV2QueryParams {
1441
- slug: string;
1442
- interval?: string;
1443
- limit?: number;
1444
- }
1445
- declare function useCandlesticksV2Query(params: UseCandlesticksV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2Candlestick[], Error, V2Candlestick[], unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Candlestick[], Error>;
1446
-
1447
- declare function positionsV2QueryKey(source: V2ProviderSource, user: string): unknown[];
1448
- interface UsePositionsV2QueryParams {
1449
- source: V2ProviderSource;
1450
- user: string;
1451
- }
1452
- declare function usePositionsV2Query(params: UsePositionsV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2PositionsResponse, Error, V2PositionsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2PositionsResponse, Error>;
1453
-
1454
- declare function ordersV2QueryKey(params: V2ListOrdersParams): unknown[];
1455
- declare function useOrdersV2Query(params: V2ListOrdersParams, queryOptions?: Omit<UseQueryOptions<V2Page<V2UserOrder>, Error, V2Page<V2UserOrder>, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Page<V2UserOrder>, Error>;
1456
-
1457
- declare function orderV2QueryKey(id: string, source: V2ProviderSource): unknown[];
1458
- interface UseOrderV2QueryParams {
1459
- id: string;
1460
- source: V2ProviderSource;
1461
- }
1462
- /**
1463
- * Query a single order by ID with optional polling.
1464
- * Automatically polls every 1 s while enabled.
1465
- */
1466
- declare function useOrderV2Query(params: UseOrderV2QueryParams, queryOptions?: Omit<UseQueryOptions<V2UserOrder, Error, V2UserOrder, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2UserOrder, Error>;
1467
-
1468
- interface CancelOrderV2Variables {
1469
- id: string;
1470
- source: V2ProviderSource;
1471
- }
1472
- declare function useCancelOrderV2Mutation(mutationOptions?: Omit<UseMutationOptions<V2CancelOrderResult, Error, CancelOrderV2Variables>, "mutationFn">): _tanstack_react_query.UseMutationResult<V2CancelOrderResult, Error, CancelOrderV2Variables, unknown>;
1473
-
1474
- declare function dflowQuoteV2QueryKey(params: V2DFlowQuoteRequest): unknown[];
1475
- /**
1476
- * Fetch a DFlow quote. The query is only enabled when all required
1477
- * fields are present and amount > 0.
1478
- */
1479
- declare function useDFlowQuoteV2(params: V2DFlowQuoteRequest, queryOptions?: Omit<UseQueryOptions<V2DFlowQuoteResponse, Error, V2DFlowQuoteResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2DFlowQuoteResponse, Error>;
1480
-
1481
- declare function useDFlowSubmitV2(mutationOptions?: Omit<UseMutationOptions<V2DFlowSubmitResponse, Error, V2DFlowSubmitRequest>, "mutationFn">): _tanstack_react_query.UseMutationResult<V2DFlowSubmitResponse, Error, V2DFlowSubmitRequest, unknown>;
1482
-
1483
- declare function tradesByWalletV2QueryKey(params: V2ListTradesByWalletParams): unknown[];
1484
- declare function useTradesByWalletV2Query(params: V2ListTradesByWalletParams, queryOptions?: Omit<UseQueryOptions<V2Page<V2Trade>, Error, V2Page<V2Trade>, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<V2Page<V2Trade>, Error>;
1485
-
1486
- declare function usePredictContext(): PredictContextValue;
1487
-
1488
- declare function usePredictClient(): IPredictClient;
1489
-
1490
- declare function eventsQueryKey(params?: EventQueryParams): unknown[];
1491
- declare function fetchEvents(client: IPredictClient, params?: EventQueryParams): Promise<StandardEventsResponse>;
1492
- declare function useEventsQuery(params?: EventQueryParams, queryOptions?: Omit<UseQueryOptions<StandardEventsResponse, Error, StandardEventsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardEventsResponse, Error>;
1493
-
1494
- declare function eventsInfiniteQueryKey(params?: Omit<EventQueryParams, "cursor">): unknown[];
1495
- declare function useEventsInfiniteQuery(params?: Omit<EventQueryParams, "cursor">, options?: Omit<UseInfiniteQueryOptions<StandardEventsResponse, Error, InfiniteData<StandardEventsResponse>, unknown[], number | undefined>, "queryKey" | "queryFn" | "getNextPageParam" | "initialPageParam">): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<StandardEventsResponse, unknown>, Error>;
1496
-
1497
- interface UseEventByIdQueryParams {
1498
- /** Event ticker ID */
1499
- id: string;
1500
- /** Include nested markets in response */
1501
- withNestedMarkets?: boolean;
1502
- }
1503
- declare function eventByIdQueryKey(params: UseEventByIdQueryParams): unknown[];
1504
- declare function fetchEventById(client: IPredictClient, params: UseEventByIdQueryParams): Promise<StandardEvent>;
1505
- declare function useEventByIdQuery(params: UseEventByIdQueryParams, options?: Omit<UseQueryOptions<StandardEvent, Error, StandardEvent, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardEvent, Error>;
1506
-
1507
- declare function marketsQueryKey(params?: MarketQueryParams): unknown[];
1508
- declare function fetchMarkets(client: IPredictClient, params?: MarketQueryParams): Promise<StandardMarketsResponse>;
1509
- declare function useMarketsQuery(params?: MarketQueryParams, queryOptions?: Omit<UseQueryOptions<StandardMarketsResponse, Error, StandardMarketsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardMarketsResponse, Error>;
1510
-
1511
- interface UseMarketByIdQueryParams {
1512
- /** Market ticker ID */
1513
- id: string;
1514
- }
1515
- declare function marketByIdQueryKey(params: UseMarketByIdQueryParams): unknown[];
1516
- declare function fetchMarketById(client: IPredictClient, params: UseMarketByIdQueryParams): Promise<StandardMarket>;
1517
- declare function useMarketByIdQuery(params: UseMarketByIdQueryParams, options?: Omit<UseQueryOptions<StandardMarket, Error, StandardMarket, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardMarket, Error>;
1518
-
1519
- declare function marketByMintQueryKey(mintAddress: string): unknown[];
1520
- declare function fetchMarketByMint(client: IPredictClient, mintAddress: string): Promise<StandardMarket>;
1521
- declare function useMarketByMintQuery(mintAddress: string, options?: Omit<UseQueryOptions<StandardMarket, Error, StandardMarket, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardMarket, Error>;
1522
-
1523
- declare function marketsBatchQueryKey(request: MarketsBatchRequest): unknown[];
1524
- declare function fetchMarketsBatch(client: IPredictClient, request: MarketsBatchRequest): Promise<StandardMarketsResponse>;
1525
- declare function useMarketsBatchQuery(request: MarketsBatchRequest, options?: Omit<UseQueryOptions<StandardMarketsResponse, Error, StandardMarketsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardMarketsResponse, Error>;
1526
-
1527
- declare function orderBookQueryKey(marketTicker: string): unknown[];
1528
- declare function fetchOrderBook(client: IPredictClient, marketTicker: string): Promise<OrderbookResponse>;
1529
- declare function useOrderBookQuery(marketTicker: string, options?: Omit<UseQueryOptions<OrderbookResponse, Error, OrderbookResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OrderbookResponse, Error>;
1530
- declare function orderBookByMintQueryKey(mintAddress: string): unknown[];
1531
- declare function fetchOrderBookByMint(client: IPredictClient, mintAddress: string): Promise<OrderbookResponse>;
1532
- declare function useOrderBookByMintQuery(mintAddress: string, options?: Omit<UseQueryOptions<OrderbookResponse, Error, OrderbookResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OrderbookResponse, Error>;
1533
-
1534
- declare function tradesQueryKey(params?: TradesQueryParams): unknown[];
1535
- declare function fetchTrades(client: IPredictClient, params?: TradesQueryParams): Promise<MultiTradeResponse>;
1536
- declare function useTradesQuery(params?: TradesQueryParams, queryOptions?: Omit<UseQueryOptions<MultiTradeResponse, Error, MultiTradeResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<MultiTradeResponse, Error>;
1537
- declare function tradesByMintQueryKey(params: TradesByMintQueryParams): unknown[];
1538
- declare function fetchTradesByMint(client: IPredictClient, params: TradesByMintQueryParams): Promise<MultiTradeResponse>;
1539
- declare function useTradesByMintQuery(params: TradesByMintQueryParams, queryOptions?: Omit<UseQueryOptions<MultiTradeResponse, Error, MultiTradeResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<MultiTradeResponse, Error>;
1540
-
1541
- declare function onchainTradesByWalletQueryKey(params: OnchainTradesByWalletQueryParams): unknown[];
1542
- declare function fetchOnchainTradesByWallet(client: IPredictClient, params: OnchainTradesByWalletQueryParams): Promise<MultiOnchainTradeResponse>;
1543
- declare function useOnchainTradesByWalletQuery(params: OnchainTradesByWalletQueryParams, queryOptions?: Omit<UseQueryOptions<MultiOnchainTradeResponse, Error, MultiOnchainTradeResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<MultiOnchainTradeResponse, Error>;
1544
- declare function onchainTradesByEventQueryKey(params: OnchainTradesByEventQueryParams): unknown[];
1545
- declare function fetchOnchainTradesByEvent(client: IPredictClient, params: OnchainTradesByEventQueryParams): Promise<MultiOnchainTradeResponse>;
1546
- declare function useOnchainTradesByEventQuery(params: OnchainTradesByEventQueryParams, queryOptions?: Omit<UseQueryOptions<MultiOnchainTradeResponse, Error, MultiOnchainTradeResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<MultiOnchainTradeResponse, Error>;
1547
- declare function onchainTradesByMarketQueryKey(params: OnchainTradesByMarketQueryParams): unknown[];
1548
- declare function fetchOnchainTradesByMarket(client: IPredictClient, params: OnchainTradesByMarketQueryParams): Promise<MultiOnchainTradeResponse>;
1549
- declare function useOnchainTradesByMarketQuery(params: OnchainTradesByMarketQueryParams, queryOptions?: Omit<UseQueryOptions<MultiOnchainTradeResponse, Error, MultiOnchainTradeResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<MultiOnchainTradeResponse, Error>;
1550
-
1551
- type OnchainTradesInfiniteOptions = Omit<UseInfiniteQueryOptions<MultiOnchainTradeResponse, Error, InfiniteData<MultiOnchainTradeResponse>, unknown[], string | undefined>, "queryKey" | "queryFn" | "getNextPageParam" | "initialPageParam">;
1552
- declare function onchainTradesByWalletInfiniteQueryKey(params: Omit<OnchainTradesByWalletQueryParams, "cursor">): unknown[];
1553
- declare function useOnchainTradesByWalletInfiniteQuery(params: Omit<OnchainTradesByWalletQueryParams, "cursor">, options?: OnchainTradesInfiniteOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<MultiOnchainTradeResponse, unknown>, Error>;
1554
- declare function onchainTradesByEventInfiniteQueryKey(params: Omit<OnchainTradesByEventQueryParams, "cursor">): unknown[];
1555
- declare function useOnchainTradesByEventInfiniteQuery(params: Omit<OnchainTradesByEventQueryParams, "cursor">, options?: OnchainTradesInfiniteOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<MultiOnchainTradeResponse, unknown>, Error>;
1556
- declare function onchainTradesByMarketInfiniteQueryKey(params: Omit<OnchainTradesByMarketQueryParams, "cursor">): unknown[];
1557
- declare function useOnchainTradesByMarketInfiniteQuery(params: Omit<OnchainTradesByMarketQueryParams, "cursor">, options?: OnchainTradesInfiniteOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<MultiOnchainTradeResponse, unknown>, Error>;
1558
-
1559
- interface UseEventCandlesticksParams extends CandlesticksQueryParams {
1560
- /** Event ticker */
1561
- ticker: string;
1562
- }
1563
- declare function eventCandlesticksQueryKey(params: UseEventCandlesticksParams): unknown[];
1564
- declare function fetchEventCandlesticks(client: IPredictClient, params: UseEventCandlesticksParams): Promise<CandlesticksResponse>;
1565
- declare function useEventCandlesticksQuery(params: UseEventCandlesticksParams, options?: Omit<UseQueryOptions<CandlesticksResponse, Error, CandlesticksResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<CandlesticksResponse, Error>;
1566
- interface UseMarketCandlesticksParams extends CandlesticksQueryParams {
1567
- /** Market ticker */
1568
- ticker: string;
1569
- }
1570
- declare function marketCandlesticksQueryKey(params: UseMarketCandlesticksParams): unknown[];
1571
- declare function fetchMarketCandlesticks(client: IPredictClient, params: UseMarketCandlesticksParams): Promise<CandlesticksResponse>;
1572
- declare function useMarketCandlesticksQuery(params: UseMarketCandlesticksParams, options?: Omit<UseQueryOptions<CandlesticksResponse, Error, CandlesticksResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<CandlesticksResponse, Error>;
1573
- interface UseMarketCandlesticksByMintParams extends CandlesticksQueryParams {
1574
- /** Mint address */
1575
- mintAddress: string;
1576
- }
1577
- declare function marketCandlesticksByMintQueryKey(params: UseMarketCandlesticksByMintParams): unknown[];
1578
- declare function fetchMarketCandlesticksByMint(client: IPredictClient, params: UseMarketCandlesticksByMintParams): Promise<CandlesticksResponse>;
1579
- declare function useMarketCandlesticksByMintQuery(params: UseMarketCandlesticksByMintParams, options?: Omit<UseQueryOptions<CandlesticksResponse, Error, CandlesticksResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<CandlesticksResponse, Error>;
1580
- /** @deprecated Use useEventCandlesticksQuery or useMarketCandlesticksQuery instead */
1581
- declare const usePriceHistoryQuery: typeof useMarketCandlesticksQuery;
1582
-
1583
- declare function forecastPercentileHistoryQueryKey(params: ForecastPercentileHistoryQueryParams): unknown[];
1584
- declare function fetchForecastPercentileHistory(client: IPredictClient, params: ForecastPercentileHistoryQueryParams): Promise<ForecastPercentileHistoryResponse>;
1585
- declare function useForecastPercentileHistoryQuery(params: ForecastPercentileHistoryQueryParams, options?: Omit<UseQueryOptions<ForecastPercentileHistoryResponse, Error, ForecastPercentileHistoryResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<ForecastPercentileHistoryResponse, Error>;
1586
- declare function forecastPercentileHistoryByMintQueryKey(params: ForecastPercentileHistoryByMintQueryParams): unknown[];
1587
- declare function fetchForecastPercentileHistoryByMint(client: IPredictClient, params: ForecastPercentileHistoryByMintQueryParams): Promise<ForecastPercentileHistoryResponse>;
1588
- declare function useForecastPercentileHistoryByMintQuery(params: ForecastPercentileHistoryByMintQueryParams, options?: Omit<UseQueryOptions<ForecastPercentileHistoryResponse, Error, ForecastPercentileHistoryResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<ForecastPercentileHistoryResponse, Error>;
1589
-
1590
- declare function liveDataQueryKey(params: LiveDataQueryParams): unknown[];
1591
- declare function fetchLiveData(client: IPredictClient, params: LiveDataQueryParams): Promise<LiveDataResponse>;
1592
- declare function useLiveDataQuery(params: LiveDataQueryParams, options?: Omit<UseQueryOptions<LiveDataResponse, Error, LiveDataResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<LiveDataResponse, Error>;
1593
- declare function liveDataByEventQueryKey(params: LiveDataByEventQueryParams): unknown[];
1594
- declare function fetchLiveDataByEvent(client: IPredictClient, params: LiveDataByEventQueryParams): Promise<LiveDataResponse>;
1595
- declare function useLiveDataByEventQuery(params: LiveDataByEventQueryParams, options?: Omit<UseQueryOptions<LiveDataResponse, Error, LiveDataResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<LiveDataResponse, Error>;
1596
- declare function liveDataByMintQueryKey(params: LiveDataByMintQueryParams): unknown[];
1597
- declare function fetchLiveDataByMint(client: IPredictClient, params: LiveDataByMintQueryParams): Promise<LiveDataResponse>;
1598
- declare function useLiveDataByMintQuery(params: LiveDataByMintQueryParams, options?: Omit<UseQueryOptions<LiveDataResponse, Error, LiveDataResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<LiveDataResponse, Error>;
1599
-
1600
- declare function seriesQueryKey(params?: SeriesQueryParams): unknown[];
1601
- declare function fetchSeries(client: IPredictClient, params?: SeriesQueryParams): Promise<SeriesListResponse>;
1602
- declare function useSeriesQuery(params?: SeriesQueryParams, queryOptions?: Omit<UseQueryOptions<SeriesListResponse, Error, SeriesListResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<SeriesListResponse, Error>;
1603
- declare function seriesByTickerQueryKey(seriesTicker: string): unknown[];
1604
- declare function fetchSeriesByTicker(client: IPredictClient, seriesTicker: string): Promise<SeriesResponse>;
1605
- declare function useSeriesByTickerQuery(seriesTicker: string, options?: Omit<UseQueryOptions<SeriesResponse, Error, SeriesResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<SeriesResponse, Error>;
1606
-
1607
- declare function tagsByCategoriesQueryKey(): unknown[];
1608
- declare function fetchTagsByCategories(client: IPredictClient): Promise<TagsByCategoriesResponse>;
1609
- declare function useTagsByCategoriesQuery(options?: Omit<UseQueryOptions<TagsByCategoriesResponse, Error, TagsByCategoriesResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TagsByCategoriesResponse, Error>;
1610
- declare function filtersBySportsQueryKey(): unknown[];
1611
- declare function fetchFiltersBySports(client: IPredictClient): Promise<FiltersBySportsResponse>;
1612
- declare function useFiltersBySportsQuery(options?: Omit<UseQueryOptions<FiltersBySportsResponse, Error, FiltersBySportsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<FiltersBySportsResponse, Error>;
1613
- /** @deprecated Use useTagsByCategoriesQuery instead */
1614
- declare const useCategoriesQuery: typeof useTagsByCategoriesQuery;
1615
-
1616
- declare function searchQueryKey(params: SearchQueryParams): unknown[];
1617
- declare function fetchSearch(client: IPredictClient, params: SearchQueryParams): Promise<SearchResponse>;
1618
- declare function useSearchQuery(params: SearchQueryParams, queryOptions?: Omit<UseQueryOptions<SearchResponse, Error, SearchResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<SearchResponse, Error>;
1619
-
1620
- declare function positionsByWalletQueryKey(params: PositionsByWalletQueryParams): unknown[];
1621
- declare function fetchPositionsByWallet(client: IPredictClient, params: PositionsByWalletQueryParams): Promise<WalletPositionsResponse>;
1622
- declare function usePositionsByWalletQuery(params: PositionsByWalletQueryParams, queryOptions?: Omit<UseQueryOptions<WalletPositionsResponse, Error, WalletPositionsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<WalletPositionsResponse, Error>;
1623
-
1624
- declare function useUserPredictContext(): UserPredictContextValue;
1625
-
1626
- interface MarketPositionsResult {
1627
- /** Positions matching the given market */
1628
- positions: WalletPositionItem[];
1629
- /** Whether the positions query is loading */
1630
- isLoading: boolean;
1631
- /** Whether UserPredictProvider is available in the tree */
1632
- isAvailable: boolean;
1633
- }
1634
- /**
1635
- * Returns the current user's positions filtered to a specific market.
1636
- * Safe to call without UserPredictProvider — returns empty positions
1637
- * with `isAvailable: false`.
1638
- */
1639
- declare function useMarketPositions(market: StandardMarket): MarketPositionsResult;
1640
-
1641
- declare function outcomeMintsQueryKey(params?: OutcomeMintsQueryParams): unknown[];
1642
- declare function fetchOutcomeMints(client: IPredictClient, params?: OutcomeMintsQueryParams): Promise<OutcomeMintsResponse>;
1643
- declare function useOutcomeMintsQuery(params?: OutcomeMintsQueryParams, options?: Omit<UseQueryOptions<OutcomeMintsResponse, Error, OutcomeMintsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OutcomeMintsResponse, Error>;
1644
- declare function filterOutcomeMints(client: IPredictClient, request: FilterOutcomeMintsRequest): Promise<FilterOutcomeMintsResponse>;
1645
- declare function useFilterOutcomeMintsMutation(options?: Omit<UseMutationOptions<FilterOutcomeMintsResponse, Error, FilterOutcomeMintsRequest>, "mutationFn">): _tanstack_react_query.UseMutationResult<FilterOutcomeMintsResponse, Error, FilterOutcomeMintsRequest, unknown>;
1646
-
1647
- declare function quoteQueryKey(params: QuoteQueryParams): unknown[];
1648
- declare function fetchQuote(client: IPredictClient, params: QuoteQueryParams): Promise<QuoteResponse>;
1649
- declare function useQuoteQuery(params: QuoteQueryParams, options?: Omit<UseQueryOptions<QuoteResponse, Error, QuoteResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<QuoteResponse, Error>;
1650
-
1651
- declare function createSwap(client: IPredictClient, request: SwapRequestBody): Promise<SwapResponse>;
1652
- declare function useCreateSwapMutation(options?: Omit<UseMutationOptions<SwapResponse, Error, SwapRequestBody>, "mutationFn">): _tanstack_react_query.UseMutationResult<SwapResponse, Error, SwapRequestBody, unknown>;
1653
- declare function createSwapInstructions(client: IPredictClient, request: SwapRequestBody): Promise<SwapInstructionsResponse>;
1654
- declare function useCreateSwapInstructionsMutation(options?: Omit<UseMutationOptions<SwapInstructionsResponse, Error, SwapRequestBody>, "mutationFn">): _tanstack_react_query.UseMutationResult<SwapInstructionsResponse, Error, SwapRequestBody, unknown>;
1655
-
1656
- declare function orderQueryKey(params: OrderQueryParams): unknown[];
1657
- declare function fetchOrder(client: IPredictClient, params: OrderQueryParams): Promise<OrderResponse>;
1658
- declare function useOrderQuery(params: OrderQueryParams, options?: Omit<UseQueryOptions<OrderResponse, Error, OrderResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OrderResponse, Error>;
1659
- declare function orderStatusQueryKey(params: OrderStatusQueryParams): unknown[];
1660
- declare function fetchOrderStatus(client: IPredictClient, params: OrderStatusQueryParams): Promise<OrderStatusResponse>;
1661
- declare function useOrderStatusQuery(params: OrderStatusQueryParams, options?: Omit<UseQueryOptions<OrderStatusResponse, Error, OrderStatusResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OrderStatusResponse, Error>;
1662
-
1663
- declare function intentQuoteQueryKey(params: IntentQuoteQueryParams): unknown[];
1664
- declare function fetchIntentQuote(client: IPredictClient, params: IntentQuoteQueryParams): Promise<IntentQuoteResponse>;
1665
- declare function useIntentQuoteQuery(params: IntentQuoteQueryParams, options?: Omit<UseQueryOptions<IntentQuoteResponse, Error, IntentQuoteResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<IntentQuoteResponse, Error>;
1666
- declare function submitIntentSwap(client: IPredictClient, request: IntentSwapRequestBody): Promise<IntentSwapResponse>;
1667
- declare function useSubmitIntentSwapMutation(options?: Omit<UseMutationOptions<IntentSwapResponse, Error, IntentSwapRequestBody>, "mutationFn">): _tanstack_react_query.UseMutationResult<IntentSwapResponse, Error, IntentSwapRequestBody, unknown>;
1668
-
1669
- declare function initPredictionMarket(client: IPredictClient, params: PredictionMarketInitQueryParams): Promise<PredictionMarketInitResponse>;
1670
- declare function useInitPredictionMarketMutation(options?: Omit<UseMutationOptions<PredictionMarketInitResponse, Error, PredictionMarketInitQueryParams>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictionMarketInitResponse, Error, PredictionMarketInitQueryParams, unknown>;
1671
-
1672
- declare function tokensQueryKey(): unknown[];
1673
- declare function fetchTokens(client: IPredictClient): Promise<TokenListResponse>;
1674
- declare function useTokensQuery(options?: Omit<UseQueryOptions<TokenListResponse, Error, TokenListResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenListResponse, Error>;
1675
- declare function tokensWithDecimalsQueryKey(): unknown[];
1676
- declare function fetchTokensWithDecimals(client: IPredictClient): Promise<TokenListWithDecimalsResponse>;
1677
- declare function useTokensWithDecimalsQuery(options?: Omit<UseQueryOptions<TokenListWithDecimalsResponse, Error, TokenListWithDecimalsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenListWithDecimalsResponse, Error>;
1678
-
1679
- declare function venuesQueryKey(): unknown[];
1680
- declare function fetchVenues(client: IPredictClient): Promise<VenueListResponse>;
1681
- declare function useVenuesQuery(options?: Omit<UseQueryOptions<VenueListResponse, Error, VenueListResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<VenueListResponse, Error>;
1682
-
1683
- interface UseWsConnectionParams {
1684
- /** WebSocket endpoint URL */
1685
- wsEndpoint: string;
1686
- /** Auto-connect on mount (default: true) */
1687
- autoConnect?: boolean;
1688
- /** Auto-reconnect on disconnect (default: true) */
1689
- autoReconnect?: boolean;
1690
- /** Enable connection (default: true) */
1691
- enabled?: boolean;
1692
- }
1693
- interface UseWsConnectionResult {
1694
- /** WebSocket client instance */
1695
- client: IPredictWsClient | null;
1696
- /** Current connection status */
1697
- status: WsConnectionStatus;
1698
- /** Whether currently connected */
1699
- isConnected: boolean;
1700
- /** Connect to WebSocket */
1701
- connect: () => void;
1702
- /** Disconnect from WebSocket */
1703
- disconnect: () => void;
1704
- /** Last error */
1705
- error: Error | null;
1706
- }
1707
- /**
1708
- * Hook for managing WebSocket connection lifecycle
1709
- */
1710
- declare function useWsConnection({ wsEndpoint, autoConnect, autoReconnect, enabled, }: UseWsConnectionParams): UseWsConnectionResult;
1711
-
1712
- interface UseWsClientResult {
1713
- /** WebSocket client instance (null if not configured) */
1714
- wsClient: IPredictWsClient | null;
1715
- /** Current connection status */
1716
- wsStatus: WsConnectionStatus;
1717
- /** Whether currently connected */
1718
- isWsConnected: boolean;
1719
- }
1720
- /**
1721
- * Hook to access the WebSocket client from PredictContext.
1722
- * Connection status is derived directly from the wsClient instance.
1723
- */
1724
- declare function useWsClient(): UseWsClientResult;
1725
-
1726
- interface UsePricesSubscriptionParams {
1727
- /** WebSocket client instance */
1728
- client: IPredictWsClient | null;
1729
- /** Subscribe to all markets */
1730
- all?: boolean;
1731
- /** Subscribe to specific market tickers */
1732
- tickers?: string[];
1733
- /** Enable subscription (default: true) */
1734
- enabled?: boolean;
1735
- /** Callback when price update received */
1736
- onUpdate?: (update: WsPriceUpdate) => void;
1737
- }
1738
- interface PriceData {
1739
- yesBid: string | null;
1740
- yesAsk: string | null;
1741
- noBid: string | null;
1742
- noAsk: string | null;
1743
- updatedAt: number;
1744
- }
1745
- interface UsePricesSubscriptionResult {
1746
- /** Map of market ticker to latest price data */
1747
- prices: Map<string, PriceData>;
1748
- /** Whether subscription is active */
1749
- isSubscribed: boolean;
1750
- }
1751
- /**
1752
- * Hook for subscribing to real-time price updates
1753
- */
1754
- declare function usePricesSubscription({ client, all, tickers, enabled, onUpdate, }: UsePricesSubscriptionParams): UsePricesSubscriptionResult;
1755
-
1756
- interface UseTradesSubscriptionParams {
1757
- /** WebSocket client instance */
1758
- client: IPredictWsClient | null;
1759
- /** Subscribe to all markets */
1760
- all?: boolean;
1761
- /** Subscribe to specific market tickers */
1762
- tickers?: string[];
1763
- /** Enable subscription (default: true) */
1764
- enabled?: boolean;
1765
- /** Maximum number of trades to keep in history (default: 100) */
1766
- maxHistory?: number;
1767
- /** Callback when trade update received */
1768
- onUpdate?: (update: WsTradeUpdate) => void;
1769
- }
1770
- interface TradeData {
1771
- tradeId: string;
1772
- marketTicker: string;
1773
- price: number;
1774
- count: number;
1775
- yesPrice: number;
1776
- noPrice: number;
1777
- takerSide: "yes" | "no";
1778
- createdTime: number;
1779
- }
1780
- interface UseTradesSubscriptionResult {
1781
- /** Recent trades (newest first) */
1782
- trades: TradeData[];
1783
- /** Whether subscription is active */
1784
- isSubscribed: boolean;
1785
- /** Clear trade history */
1786
- clearHistory: () => void;
1787
- }
1788
- /**
1789
- * Hook for subscribing to real-time trade updates
1790
- */
1791
- declare function useTradesSubscription({ client, all, tickers, enabled, maxHistory, onUpdate, }: UseTradesSubscriptionParams): UseTradesSubscriptionResult;
1792
-
1793
- interface UseOrderbookSubscriptionParams {
1794
- /** WebSocket client instance */
1795
- client: IPredictWsClient | null;
1796
- /** Subscribe to all markets */
1797
- all?: boolean;
1798
- /** Subscribe to specific market tickers */
1799
- tickers?: string[];
1800
- /** Enable subscription (default: true) */
1801
- enabled?: boolean;
1802
- /** Callback when orderbook update received */
1803
- onUpdate?: (update: WsOrderbookUpdate) => void;
1804
- }
1805
- interface OrderbookData {
1806
- yesBids: OrderbookLevel[];
1807
- yesAsks: OrderbookLevel[];
1808
- noBids: OrderbookLevel[];
1809
- noAsks: OrderbookLevel[];
1810
- updatedAt: number;
1811
- }
1812
- interface UseOrderbookSubscriptionResult {
1813
- /** Map of market ticker to latest orderbook data */
1814
- orderbooks: Map<string, OrderbookData>;
1815
- /** Whether subscription is active */
1816
- isSubscribed: boolean;
1817
- /** Get orderbook for a specific ticker */
1818
- getOrderbook: (ticker: string) => OrderbookData | undefined;
1819
- }
1820
- /**
1821
- * Hook for subscribing to real-time orderbook updates
1822
- */
1823
- declare function useOrderbookSubscription({ client, all, tickers, enabled, onUpdate, }: UseOrderbookSubscriptionParams): UseOrderbookSubscriptionResult;
683
+ declare function UserPredictProvider({ walletAddress, source, pollingInterval, enabled, children, }: UserPredictProviderProps): react_jsx_runtime.JSX.Element;
1824
684
 
1825
- export { CATEGORIES_V2, type CancelOrderV2Variables, CandlestickPeriodType, CandlesticksQueryParams, CandlesticksResponse, CategoriesSkeleton, CategoriesUI, type CategoriesUIProps, CategoriesWidget, type CategoriesWidgetProps, CategoriesWidgetV2, type CategoriesWidgetV2Props, type CategoryItem, 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, EventMarketDetailV2Widget, type EventMarketDetailV2WidgetProps, EventMarketDetailWidget, type EventMarketDetailWidgetProps, EventPriceChartV2, type EventPriceChartV2Props, EventQueryParams, type EventsFilterState, EventsFilterV2UI, type EventsFilterV2UIProps, EventsPage, type EventsPageProps, EventsPageSkeleton, EventsPageV2, type EventsPageV2Props, EventsPageV2Skeleton, 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 MarketHistoryPoint, type MarketHistorySeries, 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 TagItem, type TagItemV2, type TagSlugSelection, TagsByCategoriesResponse, TokenListResponse, TokenListWithDecimalsResponse, type TradeData, TradeFormSkeleton, TradeFormUI, type TradeFormUIProps, TradeFormV2Widget, type TradeFormV2WidgetProps, type TradeFormValidation, TradeFormWidget, type TradeFormWidgetProps, TradeHistoryUI, type TradeHistoryUIProps, TradeHistoryWidget, type TradeHistoryWidgetProps, type TradeOutcome, type TradeSide, TradesByMintQueryParams, TradesQueryParams, type UseCandlesticksV2QueryParams, 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 UseMarketHistoryV2Result, type UseMarketTradesV2QueryParams, type UseMarketV2QueryParams, type UseOpenOrdersParams, type UseOpenOrdersResult, type UseOrderBookParams, type UseOrderBookResult, type UseOrderV2QueryParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrderbookV2QueryParams, type UsePositionsParams, type UsePositionsResult, type UsePositionsV2QueryParams, type UsePriceHistoryV2QueryParams, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseSearchEventsInfiniteQueryParams, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseSimilarEventsV2QueryParams, type UseTradeFormParams, type UseTradeFormResult, type UseTradeFormV2Params, type UseTradeFormV2Result, type UseTradeHistoryParams, type UseTradeHistoryResult, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWsClientResult, type UseWsConnectionParams, type UseWsConnectionResult, UserActivityV2Section, type UserActivityV2SectionProps, UserPredictContext, type UserPredictContextValue, UserPredictProvider, type UserPredictProviderProps, V2Event, V2EventSortField, V2EventStatus, V2ListEventsParams, V2Market, V2Page, V2ProviderSource, VenueListResponse, WalletPositionItem, WalletPositionsResponse, WsConnectionStatus, WsOrderbookUpdate, WsPriceUpdate, WsTradeUpdate, candlesticksV2QueryKey, countActiveFilters, createSwap, createSwapInstructions, dflowQuoteV2QueryKey, 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, marketTradesV2QueryKey, marketV2QueryKey, marketsBatchQueryKey, marketsQueryKey, onchainTradesByEventInfiniteQueryKey, onchainTradesByEventQueryKey, onchainTradesByMarketInfiniteQueryKey, onchainTradesByMarketQueryKey, onchainTradesByWalletInfiniteQueryKey, onchainTradesByWalletQueryKey, orderBookByMintQueryKey, orderBookQueryKey, orderQueryKey, orderStatusQueryKey, orderV2QueryKey, orderbookV2QueryKey, ordersV2QueryKey, outcomeMintsQueryKey, positionsByWalletQueryKey, positionsV2QueryKey, priceHistoryV2QueryKey, quoteQueryKey, searchQueryKey, seriesByTickerQueryKey, seriesQueryKey, similarEventsV2QueryKey, submitIntentSwap, tagsByCategoriesQueryKey, tokensQueryKey, tokensWithDecimalsQueryKey, tradesByMintQueryKey, tradesByWalletV2QueryKey, tradesQueryKey, useCancelOrderV2Mutation, useCandlesticksV2Query, useCategoriesQuery, useCreateSwapInstructionsMutation, useCreateSwapMutation, useDFlowQuoteV2, useDFlowSubmitV2, 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, useMarketHistoryV2, useMarketPositions, useMarketTradesV2Query, useMarketV2Query, useMarketsBatchQuery, useMarketsQuery, useOnchainTradesByEventInfiniteQuery, useOnchainTradesByEventQuery, useOnchainTradesByMarketInfiniteQuery, useOnchainTradesByMarketQuery, useOnchainTradesByWalletInfiniteQuery, useOnchainTradesByWalletQuery, useOpenOrders, useOrderBook, useOrderBookByMintQuery, useOrderBookQuery, useOrderQuery, useOrderStatusQuery, useOrderV2Query, useOrderbookSubscription, useOrderbookV2Query, useOrdersV2Query, useOutcomeMintsQuery, usePositions, usePositionsByWalletQuery, usePositionsV2Query, usePredictClient, usePredictContext, usePredictSearchHistory, usePredictV2Client, usePredictV2Context, usePriceHistoryQuery, usePriceHistoryV2Query, usePricesSubscription, useQuoteQuery, useSearchEventsInfiniteQuery, useSearchQuery, useSearchResultListScript, useSearchScript, useSeriesByTickerQuery, useSeriesQuery, useSimilarEventsV2Query, useSubmitIntentSwapMutation, useTagsByCategoriesQuery, useTokensQuery, useTokensWithDecimalsQuery, useTradeForm, useTradeFormV2, useTradeHistory, useTradesByMintQuery, useTradesByWalletV2Query, useTradesQuery, useTradesSubscription, useUserPredictContext, useVenuesQuery, useWsClient, useWsConnection, venuesQueryKey, _default as version };
685
+ export { CHART_RANGE_DURATION, CHART_RANGE_PERIOD, CHART_RANGE_SAMPLE_INTERVAL, CandlestickPeriod, type CandlestickPeriodType, CategoriesSkeleton, CategoriesUI, type CategoriesUIProps, CategoriesWidget, type CategoriesWidgetProps, type CategoryItem, type CategoryListItem, type CategoryTagItem, ChartRange, type ChartRangeType, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, EventDetailPage, type EventDetailPageProps, EventDetailSkeleton, type EventDetailSkeletonProps, EventDetailUI, type EventDetailUIProps, EventDetailWidget, type EventDetailWidgetProps, EventItem, type EventItemProps, EventMarketDepthChartUI, type EventMarketDepthChartUIProps, EventMarketDetailWidget, type EventMarketDetailWidgetProps, EventPriceChart, type EventPriceChartProps, type EventsFilterState, EventsFilterUI, type EventsFilterUIProps, EventsPage, type EventsPageProps, EventsPageSkeleton, type EventsPageSkeletonProps, EventsSkeleton, type EventsSkeletonProps, EventsToolbarUI, type EventsToolbarUIProps, EventsUI, type EventsUIProps, EventsWidget, type EventsWidgetProps, MAX_PRICE_HISTORY_MARKETS, ORDER_MAX_PRICE, ORDER_MIN_PRICE, ORDER_MIN_QUANTITY, ORDER_PRICE_STEP, PREDICT_SEARCH_MODAL_ID, PRICE_HISTORY_SAMPLE_INTERVAL, PredictSearchModal, type PredictSearchModalParams, type PredictSearchModalResult, PriceHistoryInterval, type PriceHistoryIntervalType, SORT_PRESETS, STATIC_CATEGORIES, SearchEventsButton, type SearchEventsButtonProps, SearchHistoryUI, type SearchHistoryUIProps, SearchHistoryWidget, type SearchHistoryWidgetProps, SearchInputUI, type SearchInputUIProps, SearchResultItemUI, type SearchResultItemUIProps, SearchResultListWidget, type SearchResultListWidgetProps, SearchWidget, type SearchWidgetProps, SimilarEventCard, type SimilarEventCardProps, SimilarEventsSection, type SimilarEventsSectionProps, type SortPreset, type TagItem, type TagSlugSelection, TradeFormSkeleton, TradeFormUI, type TradeFormUIProps, type TradeFormValidation, TradeFormWidget, type TradeFormWidgetProps, type TradeOutcome, type TradeSide, type UseEventDetailParams, type UseEventsInfiniteParams, type UseEventsInfiniteResult, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, type UserPredictContextValue, UserPredictProvider, type UserPredictProviderProps, countActiveFilters, formatWan, useEventDetail, useEventsInfinite, usePredictSearchHistory, useSearchResultListScript, useSearchScript, useTradeForm, _default as version };