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