@liberfi.io/ui-predict 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.d.mts +1 -21
- package/dist/client/index.d.ts +1 -21
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +1 -1
- package/dist/client/index.mjs.map +1 -1
- package/dist/index-BcVbsRbS.d.mts +1297 -0
- package/dist/index-BcVbsRbS.d.ts +1297 -0
- package/dist/index.d.mts +831 -130
- package/dist/index.d.ts +831 -130
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -4
- package/dist/index-CT0nyuNQ.d.mts +0 -1029
- package/dist/index-CT0nyuNQ.d.ts +0 -1029
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { S as StandardEvent, a as StandardMarket, E as EventQueryParams, O as OrderResponse, b as SeriesResponse, C as CandlesticksResponse, c as OrderbookLevel, d as SingleTradeResponse, I as IPredictClient, e as IPredictWsClient, f as StandardEventsResponse, M as MarketQueryParams, g as StandardMarketsResponse, h as MarketsBatchRequest, i as OrderbookResponse, T as TradesQueryParams, j as MultiTradeResponse, k as TradesByMintQueryParams, l as CandlesticksQueryParams, F as ForecastPercentileHistoryQueryParams, m as ForecastPercentileHistoryResponse, n as ForecastPercentileHistoryByMintQueryParams, L as LiveDataQueryParams, o as LiveDataResponse, p as LiveDataByEventQueryParams, q as LiveDataByMintQueryParams, r as SeriesQueryParams, s as SeriesListResponse, t as TagsByCategoriesResponse, u as FiltersBySportsResponse, v as SearchQueryParams, w as SearchResponse, x as OutcomeMintsQueryParams, y as OutcomeMintsResponse, z as FilterOutcomeMintsRequest, A as FilterOutcomeMintsResponse, Q as QuoteQueryParams, B as QuoteResponse, D as SwapRequestBody, G as SwapResponse, H as SwapInstructionsResponse, J as OrderQueryParams, K as OrderStatusQueryParams, N as OrderStatusResponse, P as IntentQuoteQueryParams, R as IntentQuoteResponse, U as IntentSwapRequestBody, V as IntentSwapResponse, W as PredictionMarketInitQueryParams, X as PredictionMarketInitResponse, Y as TokenListResponse, Z as TokenListWithDecimalsResponse, _ as VenueListResponse, $ as WsConnectionStatus, a0 as WsPriceUpdate, a1 as WsTradeUpdate, a2 as WsOrderbookUpdate } from './index-BcVbsRbS.mjs';
|
|
3
|
+
export { am as AccountMetaResponse, az as BasePredictClient, ao as BlockhashWithMetadata, af as CandlestickDataPoint, ae as CandlestickOHLC, ak as ComputeBudgetInfo, aw as CreateFeeAccountParams, av as DestinationTokenAccountParam, aC as DflowPredictClient, aD as DflowPredictWsClient, ab as ExecutionMode, ag as ForecastPercentileDataPoint, an as InstructionResponse, ar as IntentExpiry, ad as MarketAccountInfo, a4 as MarketStatus, ap as OrderFill, aq as OrderRevert, a7 as OrderStatus, at as OrderbookQueryParams, aj as PlatformFee, a8 as PlatformFeeMode, ax as PositiveSlippageParams, aC as PredictClient, aD as PredictWsClient, au as PrioritizationFeeLamports, al as PrioritizationType, aa as PriorityLevel, a3 as ProviderType, ai as RoutePlanLeg, ah as SeriesSettlementSource, ac as SettlementSource, a9 as SlippageTolerance, a5 as SortField, a6 as SortOrder, as as TokenWithDecimals, aF as WsClientConfig, ay as WsSubscribeOptions, aA as buildQuery, aE as createDflowPredictWsClient, aE as createPredictWsClient, aB as toRecord } from './index-BcVbsRbS.mjs';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { PropsWithChildren } from 'react';
|
|
6
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
|
-
import { UseQueryOptions } from '@tanstack/react-query';
|
|
7
|
+
import { UseQueryOptions, UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
|
|
8
8
|
|
|
9
9
|
declare global {
|
|
10
10
|
interface Window {
|
|
@@ -13,86 +13,77 @@ declare global {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
declare const _default: "0.1.
|
|
16
|
+
declare const _default: "0.1.1";
|
|
17
17
|
|
|
18
18
|
interface EventsWidgetProps {
|
|
19
19
|
/** Callback when an event is selected */
|
|
20
|
-
onSelect?: (event:
|
|
20
|
+
onSelect?: (event: StandardEvent) => void;
|
|
21
21
|
/** Callback when an outcome (yes/no) is selected */
|
|
22
|
-
onSelectOutcome?: (event:
|
|
22
|
+
onSelectOutcome?: (event: StandardEvent, market: StandardMarket, side: "yes" | "no") => void;
|
|
23
23
|
}
|
|
24
24
|
declare function EventsWidget({ onSelect, onSelectOutcome }: EventsWidgetProps): react_jsx_runtime.JSX.Element;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* useEvents parameters
|
|
27
|
+
* useEvents parameters — same as EventQueryParams but without cursor (managed internally)
|
|
28
28
|
*/
|
|
29
|
-
|
|
30
|
-
/** Initial page number, defaults to 1 */
|
|
31
|
-
initialPage?: number;
|
|
32
|
-
/** Number of items per page, defaults to 48 */
|
|
33
|
-
pageSize?: number;
|
|
34
|
-
/** Query options (excluding limit and offset) */
|
|
35
|
-
queryOptions?: Omit<EventQueryOptions, "limit" | "offset">;
|
|
36
|
-
}
|
|
29
|
+
type UseEventsParams = Omit<EventQueryParams, "cursor">;
|
|
37
30
|
/**
|
|
38
31
|
* useEvents return value
|
|
39
32
|
*/
|
|
40
33
|
interface UseEventsResult {
|
|
41
|
-
/**
|
|
42
|
-
data:
|
|
43
|
-
/** Whether data is loading */
|
|
34
|
+
/** All accumulated events data */
|
|
35
|
+
data: StandardEvent[];
|
|
36
|
+
/** Whether initial data is loading */
|
|
44
37
|
isLoading: boolean;
|
|
45
|
-
/** Whether data is being fetched
|
|
46
|
-
|
|
38
|
+
/** Whether more data is being fetched */
|
|
39
|
+
isFetchingMore: boolean;
|
|
47
40
|
/** Whether there is an error */
|
|
48
41
|
isError: boolean;
|
|
49
42
|
/** Error information */
|
|
50
43
|
error: Error | null;
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
hasPrevPage: boolean;
|
|
59
|
-
/** Navigate to a specific page */
|
|
60
|
-
goToPage: (page: number) => void;
|
|
61
|
-
/** Go to next page */
|
|
62
|
-
nextPage: () => void;
|
|
63
|
-
/** Go to previous page */
|
|
64
|
-
prevPage: () => void;
|
|
65
|
-
/** Update query options */
|
|
66
|
-
setQueryOptions: (options: Omit<EventQueryOptions, "limit" | "offset">) => void;
|
|
67
|
-
/** Refetch data */
|
|
44
|
+
/** Whether there is more data to load */
|
|
45
|
+
hasMore: boolean;
|
|
46
|
+
/** Fetch more results */
|
|
47
|
+
fetchMore: () => void;
|
|
48
|
+
/** Update query options (resets accumulated data) */
|
|
49
|
+
setQueryOptions: (options: UseEventsParams) => void;
|
|
50
|
+
/** Refetch all pages */
|
|
68
51
|
refetch: () => void;
|
|
69
52
|
}
|
|
70
53
|
/**
|
|
71
|
-
* Events list hook with
|
|
54
|
+
* Events list hook with infinite scroll support (cursor-based pagination)
|
|
72
55
|
*
|
|
73
56
|
* @example
|
|
74
57
|
* ```tsx
|
|
75
58
|
* const {
|
|
76
59
|
* data,
|
|
77
60
|
* isLoading,
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
61
|
+
* hasMore,
|
|
62
|
+
* isFetchingMore,
|
|
63
|
+
* fetchMore,
|
|
81
64
|
* setQueryOptions
|
|
82
65
|
* } = useEvents({
|
|
83
|
-
*
|
|
84
|
-
*
|
|
66
|
+
* limit: 20,
|
|
67
|
+
* status: 'active',
|
|
68
|
+
* withNestedMarkets: true
|
|
85
69
|
* });
|
|
86
70
|
* ```
|
|
87
71
|
*/
|
|
88
|
-
declare function useEvents(
|
|
72
|
+
declare function useEvents(initialParams?: UseEventsParams): UseEventsResult;
|
|
89
73
|
|
|
90
74
|
type EventsUIProps = {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
/** Events data to render */
|
|
76
|
+
events: StandardEvent[];
|
|
77
|
+
/** Whether there is more data to load */
|
|
78
|
+
hasMore?: boolean;
|
|
79
|
+
/** Callback to fetch more data */
|
|
80
|
+
onFetchMore?: () => void;
|
|
81
|
+
/** Callback when an event is selected */
|
|
82
|
+
onSelect?: (event: StandardEvent) => void;
|
|
83
|
+
/** Callback when an outcome (yes/no) is selected */
|
|
84
|
+
onSelectOutcome?: (event: StandardEvent, market: StandardMarket, side: "yes" | "no") => void;
|
|
94
85
|
};
|
|
95
|
-
declare function EventsUI({ events, onSelect, onSelectOutcome }: EventsUIProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
declare function EventsUI({ events, hasMore, onFetchMore, onSelect, onSelectOutcome, }: EventsUIProps): react_jsx_runtime.JSX.Element;
|
|
96
87
|
|
|
97
88
|
type EventItemSkeletonProps = {
|
|
98
89
|
className?: string;
|
|
@@ -104,139 +95,849 @@ type EventsSkeletonProps = {
|
|
|
104
95
|
declare function EventsSkeleton({ count }: EventsSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
105
96
|
|
|
106
97
|
type EventItemUIProps = {
|
|
107
|
-
event:
|
|
108
|
-
onSelect?: (event:
|
|
109
|
-
onSelectOutcome?: (event:
|
|
98
|
+
event: StandardEvent;
|
|
99
|
+
onSelect?: (event: StandardEvent) => void;
|
|
100
|
+
onSelectOutcome?: (event: StandardEvent, market: StandardMarket, side: "yes" | "no") => void;
|
|
110
101
|
};
|
|
111
102
|
declare function EventItemUI({ event, onSelect, onSelectOutcome, }: EventItemUIProps): react_jsx_runtime.JSX.Element;
|
|
112
103
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
104
|
+
/** Default page size for list queries */
|
|
105
|
+
declare const DEFAULT_PAGE_SIZE = 48;
|
|
106
|
+
/** Maximum number of markets to display in price history chart */
|
|
107
|
+
declare const MAX_PRICE_HISTORY_MARKETS = 4;
|
|
108
|
+
/**
|
|
109
|
+
* Candlestick period intervals in minutes (granularity for API queries)
|
|
110
|
+
*/
|
|
111
|
+
declare const CandlestickPeriod: {
|
|
112
|
+
/** 1 minute */
|
|
113
|
+
readonly ONE_MINUTE: 1;
|
|
114
|
+
/** 1 hour (60 minutes) */
|
|
115
|
+
readonly ONE_HOUR: 60;
|
|
116
|
+
/** 1 day (1440 minutes) */
|
|
117
|
+
readonly ONE_DAY: 1440;
|
|
118
|
+
};
|
|
119
|
+
type CandlestickPeriodType = (typeof CandlestickPeriod)[keyof typeof CandlestickPeriod];
|
|
120
|
+
/**
|
|
121
|
+
* Chart range options (the user-facing time range selector)
|
|
122
|
+
*/
|
|
123
|
+
declare const ChartRange: {
|
|
124
|
+
/** 1 day */
|
|
125
|
+
readonly ONE_DAY: "1d";
|
|
126
|
+
/** 1 week */
|
|
127
|
+
readonly ONE_WEEK: "1w";
|
|
128
|
+
/** 1 month */
|
|
129
|
+
readonly ONE_MONTH: "1m";
|
|
130
|
+
/** All time */
|
|
131
|
+
readonly ALL: "all";
|
|
132
|
+
};
|
|
133
|
+
type ChartRangeType = (typeof ChartRange)[keyof typeof ChartRange];
|
|
134
|
+
/** Default chart range */
|
|
135
|
+
declare const DEFAULT_CHART_RANGE: "all";
|
|
136
|
+
/** Candlestick granularity derived from chart range (1D → minute, 1W/1M → hourly, ALL → daily) */
|
|
137
|
+
declare const CHART_RANGE_PERIOD: Record<ChartRangeType, CandlestickPeriodType>;
|
|
138
|
+
/** Chart sampling interval in seconds (used to downsample candlestick data for display) */
|
|
139
|
+
declare const CHART_RANGE_SAMPLE_INTERVAL: Record<ChartRangeType, number>;
|
|
140
|
+
/** Duration in seconds for each chart range (null = all time) */
|
|
141
|
+
declare const CHART_RANGE_DURATION: Record<ChartRangeType, number | null>;
|
|
142
|
+
/** Minimum order quantity (contracts) */
|
|
143
|
+
declare const ORDER_MIN_QUANTITY = 1;
|
|
144
|
+
/** Price step size in cents */
|
|
145
|
+
declare const ORDER_PRICE_STEP = 1;
|
|
146
|
+
/** Minimum price in cents */
|
|
147
|
+
declare const ORDER_MIN_PRICE = 1;
|
|
148
|
+
/** Maximum price in cents */
|
|
149
|
+
declare const ORDER_MAX_PRICE = 99;
|
|
150
|
+
/** @deprecated Use ChartRange instead */
|
|
151
|
+
declare const PriceHistoryInterval: {
|
|
152
|
+
readonly ONE_HOUR: "1h";
|
|
153
|
+
readonly SIX_HOURS: "6h";
|
|
154
|
+
readonly ONE_DAY: "1d";
|
|
155
|
+
readonly ONE_WEEK: "1w";
|
|
156
|
+
readonly MAX: "max";
|
|
157
|
+
};
|
|
158
|
+
/** @deprecated Use ChartRangeType instead */
|
|
159
|
+
type PriceHistoryIntervalType = (typeof PriceHistoryInterval)[keyof typeof PriceHistoryInterval];
|
|
160
|
+
/** @deprecated Use DEFAULT_CHART_RANGE instead */
|
|
161
|
+
declare const DEFAULT_PRICE_HISTORY_INTERVAL: "1w";
|
|
162
|
+
/** @deprecated */
|
|
163
|
+
declare const PRICE_HISTORY_SAMPLE_INTERVAL: Record<PriceHistoryIntervalType, number>;
|
|
164
|
+
|
|
165
|
+
/** Trade outcome - yes or no */
|
|
166
|
+
type TradeOutcome = "yes" | "no";
|
|
167
|
+
/** Trade side - buy or sell */
|
|
168
|
+
type TradeSide = "buy" | "sell";
|
|
169
|
+
interface UseTradeFormParams {
|
|
170
|
+
/** Market to trade in */
|
|
171
|
+
market: StandardMarket;
|
|
172
|
+
/** Chain network to use (default: 'solana') */
|
|
173
|
+
chain?: string;
|
|
174
|
+
/** Initial trade outcome */
|
|
175
|
+
initialOutcome?: TradeOutcome;
|
|
176
|
+
/** Initial trade side */
|
|
177
|
+
initialSide?: TradeSide;
|
|
178
|
+
}
|
|
179
|
+
interface TradeFormValidation {
|
|
180
|
+
isValid: boolean;
|
|
181
|
+
errors: string[];
|
|
129
182
|
}
|
|
130
|
-
|
|
183
|
+
interface UseTradeFormResult {
|
|
184
|
+
/** Current outcome (yes/no) */
|
|
185
|
+
outcome: TradeOutcome;
|
|
186
|
+
/** Current side (buy/sell) */
|
|
187
|
+
side: TradeSide;
|
|
188
|
+
/** Number of contracts */
|
|
189
|
+
quantity: number;
|
|
190
|
+
/** Number of shares (buy: amount / price, sell: quantity) */
|
|
191
|
+
shares: number;
|
|
192
|
+
/** Estimated cost in dollars */
|
|
193
|
+
estimatedCost: number;
|
|
194
|
+
/** Potential payout in dollars */
|
|
195
|
+
potentialPayout: number;
|
|
196
|
+
/** Potential profit in dollars */
|
|
197
|
+
potentialProfit: number;
|
|
198
|
+
/** Whether the user is authenticated */
|
|
199
|
+
isAuthenticated: boolean;
|
|
200
|
+
/** Best bid price from order book (cents) */
|
|
201
|
+
bestBid: number | null;
|
|
202
|
+
/** Best ask price from order book (cents) */
|
|
203
|
+
bestAsk: number | null;
|
|
204
|
+
/** Current order response from the API (includes quote + transaction) */
|
|
205
|
+
order: OrderResponse | null;
|
|
206
|
+
/** Price impact percentage */
|
|
207
|
+
priceImpact: number | null;
|
|
208
|
+
/** USDC balance in dollars (for buy side) */
|
|
209
|
+
usdcBalance: number | null;
|
|
210
|
+
/** Outcome token balance in token units (for sell side) */
|
|
211
|
+
outcomeTokenBalance: number | null;
|
|
212
|
+
/** Yes token balance (shares held) */
|
|
213
|
+
yesTokenBalance: number | null;
|
|
214
|
+
/** No token balance (shares held) */
|
|
215
|
+
noTokenBalance: number | null;
|
|
216
|
+
/** Whether balance is being fetched */
|
|
217
|
+
isBalanceLoading: boolean;
|
|
218
|
+
/** Whether order/quote is being fetched */
|
|
219
|
+
isQuoteLoading: boolean;
|
|
220
|
+
/** Whether a transaction is being signed/sent */
|
|
221
|
+
isSubmitting: boolean;
|
|
222
|
+
/** Order/quote fetch error (if any) */
|
|
223
|
+
quoteError: Error | null;
|
|
224
|
+
/** Transaction hash after successful send */
|
|
225
|
+
txHash: string | null;
|
|
226
|
+
/** Form validation result */
|
|
227
|
+
validation: TradeFormValidation;
|
|
228
|
+
/** Set outcome */
|
|
229
|
+
setOutcome: (outcome: TradeOutcome) => void;
|
|
230
|
+
/** Set side */
|
|
231
|
+
setSide: (side: TradeSide) => void;
|
|
232
|
+
/** Set quantity (minimum ORDER_MIN_QUANTITY) */
|
|
233
|
+
setQuantity: (quantity: number) => void;
|
|
234
|
+
/** Submit the swap */
|
|
235
|
+
submit: () => void;
|
|
236
|
+
/** Reset form to initial values */
|
|
237
|
+
reset: () => void;
|
|
238
|
+
}
|
|
239
|
+
declare function useTradeForm({ market, chain: _chain, initialOutcome, initialSide, }: UseTradeFormParams): UseTradeFormResult;
|
|
131
240
|
|
|
132
241
|
interface EventDetailWidgetProps {
|
|
133
242
|
eventId: string;
|
|
134
|
-
/** Initial market
|
|
135
|
-
|
|
136
|
-
/** Initial
|
|
137
|
-
|
|
243
|
+
/** Initial market tickers to query candlesticks for. Default is first 4 markets of the event, max is 4. */
|
|
244
|
+
initialMarketTickers?: string[];
|
|
245
|
+
/** Initial chart range. Default is "1d" (1 day). */
|
|
246
|
+
initialChartRange?: ChartRangeType;
|
|
247
|
+
/** Callback when a trade action is triggered (market button / orderbook click) */
|
|
248
|
+
onTradeAction?: (market: StandardMarket, outcome: TradeOutcome, side: TradeSide) => void;
|
|
138
249
|
}
|
|
139
|
-
declare function EventDetailWidget({ eventId,
|
|
250
|
+
declare function EventDetailWidget({ eventId, initialMarketTickers, initialChartRange, onTradeAction, }: EventDetailWidgetProps): react_jsx_runtime.JSX.Element;
|
|
251
|
+
|
|
252
|
+
interface EventDetailPageProps extends Omit<EventDetailWidgetProps, "eventId" | "onTradeAction"> {
|
|
253
|
+
/** Event ticker ID */
|
|
254
|
+
eventId: string;
|
|
255
|
+
/** Chain network for trading (default: 'solana') */
|
|
256
|
+
chain?: string;
|
|
257
|
+
}
|
|
258
|
+
declare function EventDetailPage({ eventId, chain, ...widgetProps }: EventDetailPageProps): react_jsx_runtime.JSX.Element;
|
|
259
|
+
|
|
260
|
+
interface EventDetailUIProps {
|
|
261
|
+
event: StandardEvent;
|
|
262
|
+
/** Series data for the event */
|
|
263
|
+
series?: SeriesResponse;
|
|
264
|
+
/** Map of market ticker to candlestick data */
|
|
265
|
+
candlesticks?: Map<string, CandlesticksResponse>;
|
|
266
|
+
/** Currently selected chart range */
|
|
267
|
+
chartRange?: ChartRangeType;
|
|
268
|
+
/** Derived candlestick period interval (for chart formatting) */
|
|
269
|
+
periodInterval?: CandlestickPeriodType;
|
|
270
|
+
/** Whether candlesticks are loading */
|
|
271
|
+
isCandlesticksLoading?: boolean;
|
|
272
|
+
/** Map of market ticker to candlestick error */
|
|
273
|
+
candlestickErrors?: Map<string, Error>;
|
|
274
|
+
/** Callback when chart range changes */
|
|
275
|
+
onRangeChange?: (range: ChartRangeType) => void;
|
|
276
|
+
/** Selected market tickers for candlestick chart */
|
|
277
|
+
selectedMarketTickers?: string[];
|
|
278
|
+
/** Callback when selected markets change */
|
|
279
|
+
onMarketSelectionChange?: (marketTickers: string[]) => void;
|
|
280
|
+
/** Callback when a trade action is triggered (market button / orderbook click) */
|
|
281
|
+
onTradeAction?: (market: StandardMarket, outcome: TradeOutcome, side: TradeSide) => void;
|
|
282
|
+
}
|
|
283
|
+
declare function EventDetailUI({ event, series, candlesticks, chartRange, periodInterval, isCandlesticksLoading, onRangeChange, selectedMarketTickers, onMarketSelectionChange, onTradeAction, }: EventDetailUIProps): react_jsx_runtime.JSX.Element;
|
|
140
284
|
|
|
141
285
|
interface UseEventDetailParams {
|
|
142
286
|
eventId: string;
|
|
143
|
-
/** Market
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
|
|
287
|
+
/** Market tickers to query candlesticks for. Default is first 4 markets of the event, max is 4. */
|
|
288
|
+
candlestickMarketTickers?: string[];
|
|
289
|
+
/** Chart time range (1d / 1w / 1m / all). Determines both the query window and candlestick granularity. */
|
|
290
|
+
chartRange?: ChartRangeType;
|
|
147
291
|
}
|
|
148
292
|
declare const useEventDetail: (params: UseEventDetailParams) => {
|
|
149
|
-
event:
|
|
293
|
+
event: StandardEvent | undefined;
|
|
150
294
|
isEventLoading: boolean;
|
|
151
295
|
eventError: Error | null;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
296
|
+
series: SeriesResponse | undefined;
|
|
297
|
+
isSeriesLoading: boolean;
|
|
298
|
+
seriesError: Error | null;
|
|
299
|
+
/** Derived candlestick granularity (for chart formatting) */
|
|
300
|
+
periodInterval: CandlestickPeriodType;
|
|
301
|
+
candlesticks: Map<string, CandlesticksResponse>;
|
|
302
|
+
isCandlesticksLoading: boolean;
|
|
303
|
+
candlestickErrors: Map<string, Error>;
|
|
155
304
|
};
|
|
156
305
|
|
|
157
306
|
interface EventDetailSkeletonProps {
|
|
158
|
-
/** Number of market rows
|
|
307
|
+
/** Number of market rows */
|
|
159
308
|
marketCount?: number;
|
|
160
309
|
}
|
|
161
310
|
declare function EventDetailSkeleton({ marketCount, }: EventDetailSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
311
|
+
/** Compact skeleton for the sidebar trade form area */
|
|
312
|
+
declare function TradeFormSkeleton(): react_jsx_runtime.JSX.Element;
|
|
313
|
+
|
|
314
|
+
interface EventMarketDetailWidgetProps {
|
|
315
|
+
market: StandardMarket;
|
|
316
|
+
/** Callback when an orderbook row is clicked – propagates market, outcome & side */
|
|
317
|
+
onTradeAction?: (market: StandardMarket, outcome: TradeOutcome, side: TradeSide) => void;
|
|
318
|
+
}
|
|
319
|
+
declare function EventMarketDetailWidget({ market, onTradeAction, }: EventMarketDetailWidgetProps): react_jsx_runtime.JSX.Element;
|
|
320
|
+
|
|
321
|
+
interface TradeFormUIProps {
|
|
322
|
+
/** Event data */
|
|
323
|
+
event?: StandardEvent;
|
|
324
|
+
/** Market data */
|
|
325
|
+
market: StandardMarket;
|
|
326
|
+
/** Current outcome */
|
|
327
|
+
outcome: TradeOutcome;
|
|
328
|
+
/** Current side */
|
|
329
|
+
side: TradeSide;
|
|
330
|
+
/** Number of contracts */
|
|
331
|
+
quantity: number;
|
|
332
|
+
/** Estimated cost in cents */
|
|
333
|
+
estimatedCost: number;
|
|
334
|
+
/** Potential payout in cents */
|
|
335
|
+
potentialPayout: number;
|
|
336
|
+
/** Potential profit in cents */
|
|
337
|
+
potentialProfit: number;
|
|
338
|
+
/** Whether swap is being submitted */
|
|
339
|
+
isSubmitting: boolean;
|
|
340
|
+
/** USDC balance in dollars (null if not loaded) */
|
|
341
|
+
usdcBalance: number | null;
|
|
342
|
+
/** Yes token balance (shares held, for sell side) */
|
|
343
|
+
yesTokenBalance: number | null;
|
|
344
|
+
/** No token balance (shares held, for sell side) */
|
|
345
|
+
noTokenBalance: number | null;
|
|
346
|
+
/** Whether balance is loading */
|
|
347
|
+
isBalanceLoading: boolean;
|
|
348
|
+
/** Whether the form is valid */
|
|
349
|
+
isValid: boolean;
|
|
350
|
+
/** Validation error messages */
|
|
351
|
+
validationErrors: string[];
|
|
352
|
+
/** Set outcome */
|
|
353
|
+
onOutcomeChange: (outcome: TradeOutcome) => void;
|
|
354
|
+
/** Set side */
|
|
355
|
+
onSideChange: (side: TradeSide) => void;
|
|
356
|
+
/** Set quantity */
|
|
357
|
+
onQuantityChange: (quantity: number) => void;
|
|
358
|
+
/** Submit swap */
|
|
359
|
+
onSubmit: () => void;
|
|
360
|
+
}
|
|
361
|
+
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;
|
|
362
|
+
|
|
363
|
+
interface TradeFormWidgetProps {
|
|
364
|
+
/** Event data */
|
|
365
|
+
event?: StandardEvent;
|
|
366
|
+
/** Market to trade */
|
|
367
|
+
market: StandardMarket;
|
|
368
|
+
/** Initial trade side */
|
|
369
|
+
initialSide?: TradeSide;
|
|
370
|
+
/** Initial trade outcome */
|
|
371
|
+
initialOutcome?: TradeOutcome;
|
|
372
|
+
/** Chain network (default: 'solana') */
|
|
373
|
+
chain?: string;
|
|
374
|
+
}
|
|
375
|
+
declare function TradeFormWidget({ event, market, initialSide, initialOutcome, chain, }: TradeFormWidgetProps): react_jsx_runtime.JSX.Element;
|
|
376
|
+
|
|
377
|
+
interface UseOrderBookParams {
|
|
378
|
+
/** Market ticker */
|
|
379
|
+
marketTicker: string;
|
|
380
|
+
/** Maximum number of levels to display per side */
|
|
381
|
+
maxLevels?: number;
|
|
382
|
+
/** Polling interval in milliseconds (0 to disable) */
|
|
383
|
+
refetchInterval?: number;
|
|
384
|
+
/** Which outcome to display (yes or no). Defaults to yes. */
|
|
385
|
+
outcome?: "yes" | "no";
|
|
386
|
+
}
|
|
387
|
+
interface OrderBookRow extends OrderbookLevel {
|
|
388
|
+
/** Cumulative quantity up to (and including) this level */
|
|
389
|
+
cumulative: number;
|
|
390
|
+
/** Depth ratio 0–1 relative to the maximum cumulative quantity */
|
|
391
|
+
depth: number;
|
|
392
|
+
}
|
|
393
|
+
interface UseOrderBookResult {
|
|
394
|
+
/** Bid rows sorted from highest to lowest price */
|
|
395
|
+
bids: OrderBookRow[];
|
|
396
|
+
/** Ask rows sorted from lowest to highest price */
|
|
397
|
+
asks: OrderBookRow[];
|
|
398
|
+
/** Spread in cents */
|
|
399
|
+
spread: number | null;
|
|
400
|
+
/** Spread as percentage of midpoint */
|
|
401
|
+
spreadPercent: number | null;
|
|
402
|
+
/** Midpoint price in cents */
|
|
403
|
+
midpoint: number | null;
|
|
404
|
+
/** Whether initial data is loading */
|
|
405
|
+
isLoading: boolean;
|
|
406
|
+
/** Whether a background refetch is in progress */
|
|
407
|
+
isFetching: boolean;
|
|
408
|
+
}
|
|
409
|
+
declare function useOrderBook({ marketTicker, maxLevels, refetchInterval, outcome, }: UseOrderBookParams): UseOrderBookResult;
|
|
410
|
+
|
|
411
|
+
interface OrderBookUIProps {
|
|
412
|
+
/** Bid rows (highest to lowest) */
|
|
413
|
+
bids: OrderBookRow[];
|
|
414
|
+
/** Ask rows (lowest to highest) */
|
|
415
|
+
asks: OrderBookRow[];
|
|
416
|
+
/** Spread in cents */
|
|
417
|
+
spread: number | null;
|
|
418
|
+
/** Spread percentage */
|
|
419
|
+
spreadPercent: number | null;
|
|
420
|
+
/** Whether initial data is loading */
|
|
421
|
+
isLoading: boolean;
|
|
422
|
+
/** Callback when a price level is clicked */
|
|
423
|
+
onPriceClick?: (price: number) => void;
|
|
424
|
+
}
|
|
425
|
+
declare function OrderBookUI({ bids, asks, spread, spreadPercent, isLoading, onPriceClick, }: OrderBookUIProps): react_jsx_runtime.JSX.Element;
|
|
426
|
+
|
|
427
|
+
interface OrderBookWidgetProps {
|
|
428
|
+
/** Market ticker */
|
|
429
|
+
marketTicker: string;
|
|
430
|
+
/** Maximum levels per side (default 10) */
|
|
431
|
+
maxLevels?: number;
|
|
432
|
+
/** Polling interval in ms (default 5000, 0 to disable) */
|
|
433
|
+
refetchInterval?: number;
|
|
434
|
+
/** Callback when a price level is clicked */
|
|
435
|
+
onPriceClick?: (price: number) => void;
|
|
436
|
+
/** Which outcome to display (yes or no). Defaults to yes. */
|
|
437
|
+
outcome?: "yes" | "no";
|
|
438
|
+
}
|
|
439
|
+
declare function OrderBookWidget({ marketTicker, maxLevels, refetchInterval, onPriceClick, outcome, }: OrderBookWidgetProps): react_jsx_runtime.JSX.Element;
|
|
440
|
+
|
|
441
|
+
interface UseOpenOrdersParams {
|
|
442
|
+
/** Polling interval in ms (0 to disable) */
|
|
443
|
+
refetchInterval?: number;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* @deprecated Order type - new API uses swap model
|
|
447
|
+
*/
|
|
448
|
+
interface Order {
|
|
449
|
+
id: string;
|
|
450
|
+
marketId: string;
|
|
451
|
+
side: "buy" | "sell";
|
|
452
|
+
outcome: "yes" | "no";
|
|
453
|
+
type: "limit" | "market";
|
|
454
|
+
price: number;
|
|
455
|
+
quantity: number;
|
|
456
|
+
filledQuantity: number;
|
|
457
|
+
status: "open" | "partial" | "filled" | "cancelled";
|
|
458
|
+
createdAt: string;
|
|
459
|
+
}
|
|
460
|
+
interface UseOpenOrdersResult {
|
|
461
|
+
/** List of open orders */
|
|
462
|
+
orders: Order[];
|
|
463
|
+
/** Whether data is loading */
|
|
464
|
+
isLoading: boolean;
|
|
465
|
+
/** Whether a background refetch is in progress */
|
|
466
|
+
isFetching: boolean;
|
|
467
|
+
/** ID of the order currently being cancelled (null if none) */
|
|
468
|
+
cancellingOrderId: string | null;
|
|
469
|
+
/** Cancel an order by id */
|
|
470
|
+
cancelOrder: (orderId: string) => void;
|
|
471
|
+
/** Error from the most recent cancel attempt */
|
|
472
|
+
cancelError: Error | null;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* @deprecated This hook is deprecated. The new dflow API uses a swap-based model.
|
|
476
|
+
* Use `useOrderStatusQuery` to track swap status instead.
|
|
477
|
+
*/
|
|
478
|
+
declare function useOpenOrders(_params?: UseOpenOrdersParams): UseOpenOrdersResult;
|
|
479
|
+
|
|
480
|
+
interface OpenOrdersUIProps {
|
|
481
|
+
/** List of open orders */
|
|
482
|
+
orders: Order[];
|
|
483
|
+
/** Whether data is loading */
|
|
484
|
+
isLoading: boolean;
|
|
485
|
+
/** ID of the order currently being cancelled */
|
|
486
|
+
cancellingOrderId: string | null;
|
|
487
|
+
/** Cancel an order */
|
|
488
|
+
onCancel: (orderId: string) => void;
|
|
489
|
+
}
|
|
490
|
+
declare function OpenOrdersUI({ orders, isLoading, cancellingOrderId, onCancel, }: OpenOrdersUIProps): react_jsx_runtime.JSX.Element;
|
|
491
|
+
|
|
492
|
+
interface OpenOrdersWidgetProps {
|
|
493
|
+
/** Polling interval in ms (default 10000, 0 to disable) */
|
|
494
|
+
refetchInterval?: number;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* @deprecated This widget is deprecated. Use swap-based order model instead.
|
|
498
|
+
*/
|
|
499
|
+
declare function OpenOrdersWidget({ refetchInterval, }?: OpenOrdersWidgetProps): react_jsx_runtime.JSX.Element;
|
|
500
|
+
|
|
501
|
+
interface UseTradeHistoryParams {
|
|
502
|
+
/** Optional filter by market ticker */
|
|
503
|
+
ticker?: string;
|
|
504
|
+
/** Page size */
|
|
505
|
+
pageSize?: number;
|
|
506
|
+
}
|
|
507
|
+
interface UseTradeHistoryResult {
|
|
508
|
+
/** Current page of trades */
|
|
509
|
+
trades: SingleTradeResponse[];
|
|
510
|
+
/** Whether initial data is loading */
|
|
511
|
+
isLoading: boolean;
|
|
512
|
+
/** Whether a background refetch is in progress */
|
|
513
|
+
isFetching: boolean;
|
|
514
|
+
/** Current page (1-based) */
|
|
515
|
+
page: number;
|
|
516
|
+
/** Page size */
|
|
517
|
+
pageSize: number;
|
|
518
|
+
/** Whether more pages exist */
|
|
519
|
+
hasNextPage: boolean;
|
|
520
|
+
/** Whether a previous page exists */
|
|
521
|
+
hasPrevPage: boolean;
|
|
522
|
+
/** Navigate to a specific page */
|
|
523
|
+
goToPage: (page: number) => void;
|
|
524
|
+
/** Go to the next page */
|
|
525
|
+
nextPage: () => void;
|
|
526
|
+
/** Go to the previous page */
|
|
527
|
+
prevPage: () => void;
|
|
528
|
+
}
|
|
529
|
+
declare function useTradeHistory({ ticker, pageSize, }?: UseTradeHistoryParams): UseTradeHistoryResult;
|
|
530
|
+
|
|
531
|
+
interface TradeHistoryUIProps {
|
|
532
|
+
/** List of trades for current page */
|
|
533
|
+
trades: SingleTradeResponse[];
|
|
534
|
+
/** Whether data is loading */
|
|
535
|
+
isLoading: boolean;
|
|
536
|
+
/** Whether background refetch is in progress */
|
|
537
|
+
isFetching: boolean;
|
|
538
|
+
/** Current page (1-based) */
|
|
539
|
+
page: number;
|
|
540
|
+
/** Whether more pages exist */
|
|
541
|
+
hasNextPage: boolean;
|
|
542
|
+
/** Whether a previous page exists */
|
|
543
|
+
hasPrevPage: boolean;
|
|
544
|
+
/** Go to next page */
|
|
545
|
+
onNextPage: () => void;
|
|
546
|
+
/** Go to previous page */
|
|
547
|
+
onPrevPage: () => void;
|
|
548
|
+
}
|
|
549
|
+
declare function TradeHistoryUI({ trades, isLoading, isFetching, page, hasNextPage, hasPrevPage, onNextPage, onPrevPage, }: TradeHistoryUIProps): react_jsx_runtime.JSX.Element;
|
|
550
|
+
|
|
551
|
+
interface TradeHistoryWidgetProps {
|
|
552
|
+
/** Optional filter by market ticker */
|
|
553
|
+
ticker?: string;
|
|
554
|
+
/** Page size (default: DEFAULT_PAGE_SIZE) */
|
|
555
|
+
pageSize?: number;
|
|
556
|
+
}
|
|
557
|
+
declare function TradeHistoryWidget({ ticker, pageSize, }?: TradeHistoryWidgetProps): react_jsx_runtime.JSX.Element;
|
|
558
|
+
|
|
559
|
+
interface UsePositionsParams {
|
|
560
|
+
/** Polling interval in ms (0 to disable) */
|
|
561
|
+
refetchInterval?: number;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* @deprecated Position type - not provided by new API
|
|
565
|
+
*/
|
|
566
|
+
interface Position {
|
|
567
|
+
id: string;
|
|
568
|
+
marketId: string;
|
|
569
|
+
marketTitle: string;
|
|
570
|
+
outcome: "yes" | "no";
|
|
571
|
+
quantity: number;
|
|
572
|
+
avgPrice: number;
|
|
573
|
+
avgCostBasis: number;
|
|
574
|
+
currentPrice: number;
|
|
575
|
+
unrealizedPnl: number;
|
|
576
|
+
realizedPnl: number;
|
|
577
|
+
}
|
|
578
|
+
interface PositionsSummary {
|
|
579
|
+
/** Total market value in cents */
|
|
580
|
+
totalValue: number;
|
|
581
|
+
/** Total unrealised PnL in cents */
|
|
582
|
+
totalUnrealizedPnl: number;
|
|
583
|
+
/** Total realised PnL in cents */
|
|
584
|
+
totalRealizedPnl: number;
|
|
585
|
+
/** Number of positions */
|
|
586
|
+
count: number;
|
|
587
|
+
}
|
|
588
|
+
interface UsePositionsResult {
|
|
589
|
+
/** Positions list */
|
|
590
|
+
positions: Position[];
|
|
591
|
+
/** Whether data is loading */
|
|
592
|
+
isLoading: boolean;
|
|
593
|
+
/** Whether a background refetch is in progress */
|
|
594
|
+
isFetching: boolean;
|
|
595
|
+
/** Aggregated summary across all positions */
|
|
596
|
+
summary: PositionsSummary;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* @deprecated This hook is deprecated. The new dflow API does not provide
|
|
600
|
+
* positions data. Use on-chain token balance queries instead.
|
|
601
|
+
*/
|
|
602
|
+
declare function usePositions(_params?: UsePositionsParams): UsePositionsResult;
|
|
603
|
+
|
|
604
|
+
interface PositionsUIProps {
|
|
605
|
+
/** List of positions */
|
|
606
|
+
positions: Position[];
|
|
607
|
+
/** Whether data is loading */
|
|
608
|
+
isLoading: boolean;
|
|
609
|
+
/** Aggregated summary */
|
|
610
|
+
summary: PositionsSummary;
|
|
611
|
+
/** Callback when a position's sell button is clicked */
|
|
612
|
+
onSell?: (position: Position) => void;
|
|
613
|
+
}
|
|
614
|
+
declare function PositionsUI({ positions, isLoading, summary, onSell, }: PositionsUIProps): react_jsx_runtime.JSX.Element;
|
|
615
|
+
|
|
616
|
+
interface PositionsWidgetProps {
|
|
617
|
+
/** Polling interval in ms (default 15000, 0 to disable) */
|
|
618
|
+
refetchInterval?: number;
|
|
619
|
+
/** Callback when a position's sell action is triggered */
|
|
620
|
+
onSell?: (position: Position) => void;
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* @deprecated This widget is deprecated. Use on-chain token balance queries instead.
|
|
624
|
+
*/
|
|
625
|
+
declare function PositionsWidget({ refetchInterval, onSell, }?: PositionsWidgetProps): react_jsx_runtime.JSX.Element;
|
|
162
626
|
|
|
163
627
|
interface PredictContextValue {
|
|
628
|
+
/** The predict API client instance */
|
|
164
629
|
client: IPredictClient;
|
|
630
|
+
/** The WebSocket client instance for real-time data */
|
|
631
|
+
wsClient: IPredictWsClient | null;
|
|
165
632
|
}
|
|
166
633
|
declare const PredictContext: react.Context<PredictContextValue>;
|
|
167
634
|
|
|
168
635
|
type PredictProviderProps = PropsWithChildren<{
|
|
636
|
+
/** The predict API client instance */
|
|
169
637
|
client: IPredictClient;
|
|
638
|
+
/** WebSocket client instance (optional, enables WebSocket features) */
|
|
639
|
+
wsClient?: IPredictWsClient | null;
|
|
170
640
|
}>;
|
|
171
|
-
declare function PredictProvider({ client, children }: PredictProviderProps): react_jsx_runtime.JSX.Element;
|
|
641
|
+
declare function PredictProvider({ client, wsClient, children, }: PredictProviderProps): react_jsx_runtime.JSX.Element;
|
|
172
642
|
|
|
173
643
|
declare function usePredictContext(): PredictContextValue;
|
|
174
644
|
|
|
175
645
|
declare function usePredictClient(): IPredictClient;
|
|
176
646
|
|
|
177
|
-
declare function
|
|
178
|
-
declare function
|
|
179
|
-
declare function
|
|
647
|
+
declare function eventsQueryKey(params?: EventQueryParams): unknown[];
|
|
648
|
+
declare function fetchEvents(client: IPredictClient, params?: EventQueryParams): Promise<StandardEventsResponse>;
|
|
649
|
+
declare function useEventsQuery(params?: EventQueryParams, queryOptions?: Omit<UseQueryOptions<StandardEventsResponse, Error, StandardEventsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardEventsResponse, Error>;
|
|
650
|
+
|
|
651
|
+
declare function eventsInfiniteQueryKey(params?: Omit<EventQueryParams, "cursor">): unknown[];
|
|
652
|
+
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>;
|
|
653
|
+
|
|
654
|
+
interface UseEventByIdQueryParams {
|
|
655
|
+
/** Event ticker ID */
|
|
656
|
+
id: string;
|
|
657
|
+
/** Include nested markets in response */
|
|
658
|
+
withNestedMarkets?: boolean;
|
|
659
|
+
}
|
|
660
|
+
declare function eventByIdQueryKey(params: UseEventByIdQueryParams): unknown[];
|
|
661
|
+
declare function fetchEventById(client: IPredictClient, params: UseEventByIdQueryParams): Promise<StandardEvent>;
|
|
662
|
+
declare function useEventByIdQuery(params: UseEventByIdQueryParams, options?: Omit<UseQueryOptions<StandardEvent, Error, StandardEvent, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardEvent, Error>;
|
|
663
|
+
|
|
664
|
+
declare function marketsQueryKey(params?: MarketQueryParams): unknown[];
|
|
665
|
+
declare function fetchMarkets(client: IPredictClient, params?: MarketQueryParams): Promise<StandardMarketsResponse>;
|
|
666
|
+
declare function useMarketsQuery(params?: MarketQueryParams, queryOptions?: Omit<UseQueryOptions<StandardMarketsResponse, Error, StandardMarketsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardMarketsResponse, Error>;
|
|
180
667
|
|
|
181
668
|
interface UseMarketByIdQueryParams {
|
|
669
|
+
/** Market ticker ID */
|
|
182
670
|
id: string;
|
|
183
|
-
includeTag?: boolean;
|
|
184
671
|
}
|
|
185
672
|
declare function marketByIdQueryKey(params: UseMarketByIdQueryParams): unknown[];
|
|
186
|
-
declare function fetchMarketById(client: IPredictClient, params: UseMarketByIdQueryParams): Promise<
|
|
187
|
-
declare function useMarketByIdQuery(params: UseMarketByIdQueryParams, options?: Omit<UseQueryOptions<
|
|
673
|
+
declare function fetchMarketById(client: IPredictClient, params: UseMarketByIdQueryParams): Promise<StandardMarket>;
|
|
674
|
+
declare function useMarketByIdQuery(params: UseMarketByIdQueryParams, options?: Omit<UseQueryOptions<StandardMarket, Error, StandardMarket, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardMarket, Error>;
|
|
675
|
+
|
|
676
|
+
declare function marketByMintQueryKey(mintAddress: string): unknown[];
|
|
677
|
+
declare function fetchMarketByMint(client: IPredictClient, mintAddress: string): Promise<StandardMarket>;
|
|
678
|
+
declare function useMarketByMintQuery(mintAddress: string, options?: Omit<UseQueryOptions<StandardMarket, Error, StandardMarket, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardMarket, Error>;
|
|
679
|
+
|
|
680
|
+
declare function marketsBatchQueryKey(request: MarketsBatchRequest): unknown[];
|
|
681
|
+
declare function fetchMarketsBatch(client: IPredictClient, request: MarketsBatchRequest): Promise<StandardMarketsResponse>;
|
|
682
|
+
declare function useMarketsBatchQuery(request: MarketsBatchRequest, options?: Omit<UseQueryOptions<StandardMarketsResponse, Error, StandardMarketsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<StandardMarketsResponse, Error>;
|
|
683
|
+
|
|
684
|
+
declare function orderBookQueryKey(marketTicker: string): unknown[];
|
|
685
|
+
declare function fetchOrderBook(client: IPredictClient, marketTicker: string): Promise<OrderbookResponse>;
|
|
686
|
+
declare function useOrderBookQuery(marketTicker: string, options?: Omit<UseQueryOptions<OrderbookResponse, Error, OrderbookResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OrderbookResponse, Error>;
|
|
687
|
+
declare function orderBookByMintQueryKey(mintAddress: string): unknown[];
|
|
688
|
+
declare function fetchOrderBookByMint(client: IPredictClient, mintAddress: string): Promise<OrderbookResponse>;
|
|
689
|
+
declare function useOrderBookByMintQuery(mintAddress: string, options?: Omit<UseQueryOptions<OrderbookResponse, Error, OrderbookResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OrderbookResponse, Error>;
|
|
690
|
+
|
|
691
|
+
declare function tradesQueryKey(params?: TradesQueryParams): unknown[];
|
|
692
|
+
declare function fetchTrades(client: IPredictClient, params?: TradesQueryParams): Promise<MultiTradeResponse>;
|
|
693
|
+
declare function useTradesQuery(params?: TradesQueryParams, queryOptions?: Omit<UseQueryOptions<MultiTradeResponse, Error, MultiTradeResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<MultiTradeResponse, Error>;
|
|
694
|
+
declare function tradesByMintQueryKey(params: TradesByMintQueryParams): unknown[];
|
|
695
|
+
declare function fetchTradesByMint(client: IPredictClient, params: TradesByMintQueryParams): Promise<MultiTradeResponse>;
|
|
696
|
+
declare function useTradesByMintQuery(params: TradesByMintQueryParams, queryOptions?: Omit<UseQueryOptions<MultiTradeResponse, Error, MultiTradeResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<MultiTradeResponse, Error>;
|
|
188
697
|
|
|
189
|
-
interface
|
|
190
|
-
|
|
191
|
-
|
|
698
|
+
interface UseEventCandlesticksParams extends CandlesticksQueryParams {
|
|
699
|
+
/** Event ticker */
|
|
700
|
+
ticker: string;
|
|
192
701
|
}
|
|
193
|
-
declare function
|
|
194
|
-
declare function
|
|
195
|
-
declare function
|
|
702
|
+
declare function eventCandlesticksQueryKey(params: UseEventCandlesticksParams): unknown[];
|
|
703
|
+
declare function fetchEventCandlesticks(client: IPredictClient, params: UseEventCandlesticksParams): Promise<CandlesticksResponse>;
|
|
704
|
+
declare function useEventCandlesticksQuery(params: UseEventCandlesticksParams, options?: Omit<UseQueryOptions<CandlesticksResponse, Error, CandlesticksResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<CandlesticksResponse, Error>;
|
|
705
|
+
interface UseMarketCandlesticksParams extends CandlesticksQueryParams {
|
|
706
|
+
/** Market ticker */
|
|
707
|
+
ticker: string;
|
|
708
|
+
}
|
|
709
|
+
declare function marketCandlesticksQueryKey(params: UseMarketCandlesticksParams): unknown[];
|
|
710
|
+
declare function fetchMarketCandlesticks(client: IPredictClient, params: UseMarketCandlesticksParams): Promise<CandlesticksResponse>;
|
|
711
|
+
declare function useMarketCandlesticksQuery(params: UseMarketCandlesticksParams, options?: Omit<UseQueryOptions<CandlesticksResponse, Error, CandlesticksResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<CandlesticksResponse, Error>;
|
|
712
|
+
interface UseMarketCandlesticksByMintParams extends CandlesticksQueryParams {
|
|
713
|
+
/** Mint address */
|
|
714
|
+
mintAddress: string;
|
|
715
|
+
}
|
|
716
|
+
declare function marketCandlesticksByMintQueryKey(params: UseMarketCandlesticksByMintParams): unknown[];
|
|
717
|
+
declare function fetchMarketCandlesticksByMint(client: IPredictClient, params: UseMarketCandlesticksByMintParams): Promise<CandlesticksResponse>;
|
|
718
|
+
declare function useMarketCandlesticksByMintQuery(params: UseMarketCandlesticksByMintParams, options?: Omit<UseQueryOptions<CandlesticksResponse, Error, CandlesticksResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<CandlesticksResponse, Error>;
|
|
719
|
+
/** @deprecated Use useEventCandlesticksQuery or useMarketCandlesticksQuery instead */
|
|
720
|
+
declare const usePriceHistoryQuery: typeof useMarketCandlesticksQuery;
|
|
196
721
|
|
|
197
|
-
declare function
|
|
198
|
-
declare function
|
|
199
|
-
declare function
|
|
722
|
+
declare function forecastPercentileHistoryQueryKey(params: ForecastPercentileHistoryQueryParams): unknown[];
|
|
723
|
+
declare function fetchForecastPercentileHistory(client: IPredictClient, params: ForecastPercentileHistoryQueryParams): Promise<ForecastPercentileHistoryResponse>;
|
|
724
|
+
declare function useForecastPercentileHistoryQuery(params: ForecastPercentileHistoryQueryParams, options?: Omit<UseQueryOptions<ForecastPercentileHistoryResponse, Error, ForecastPercentileHistoryResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<ForecastPercentileHistoryResponse, Error>;
|
|
725
|
+
declare function forecastPercentileHistoryByMintQueryKey(params: ForecastPercentileHistoryByMintQueryParams): unknown[];
|
|
726
|
+
declare function fetchForecastPercentileHistoryByMint(client: IPredictClient, params: ForecastPercentileHistoryByMintQueryParams): Promise<ForecastPercentileHistoryResponse>;
|
|
727
|
+
declare function useForecastPercentileHistoryByMintQuery(params: ForecastPercentileHistoryByMintQueryParams, options?: Omit<UseQueryOptions<ForecastPercentileHistoryResponse, Error, ForecastPercentileHistoryResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<ForecastPercentileHistoryResponse, Error>;
|
|
200
728
|
|
|
201
|
-
declare function
|
|
202
|
-
declare function
|
|
203
|
-
declare function
|
|
729
|
+
declare function liveDataQueryKey(params: LiveDataQueryParams): unknown[];
|
|
730
|
+
declare function fetchLiveData(client: IPredictClient, params: LiveDataQueryParams): Promise<LiveDataResponse>;
|
|
731
|
+
declare function useLiveDataQuery(params: LiveDataQueryParams, options?: Omit<UseQueryOptions<LiveDataResponse, Error, LiveDataResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<LiveDataResponse, Error>;
|
|
732
|
+
declare function liveDataByEventQueryKey(params: LiveDataByEventQueryParams): unknown[];
|
|
733
|
+
declare function fetchLiveDataByEvent(client: IPredictClient, params: LiveDataByEventQueryParams): Promise<LiveDataResponse>;
|
|
734
|
+
declare function useLiveDataByEventQuery(params: LiveDataByEventQueryParams, options?: Omit<UseQueryOptions<LiveDataResponse, Error, LiveDataResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<LiveDataResponse, Error>;
|
|
735
|
+
declare function liveDataByMintQueryKey(params: LiveDataByMintQueryParams): unknown[];
|
|
736
|
+
declare function fetchLiveDataByMint(client: IPredictClient, params: LiveDataByMintQueryParams): Promise<LiveDataResponse>;
|
|
737
|
+
declare function useLiveDataByMintQuery(params: LiveDataByMintQueryParams, options?: Omit<UseQueryOptions<LiveDataResponse, Error, LiveDataResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<LiveDataResponse, Error>;
|
|
204
738
|
|
|
205
|
-
declare function
|
|
206
|
-
declare function
|
|
207
|
-
declare function
|
|
739
|
+
declare function seriesQueryKey(params?: SeriesQueryParams): unknown[];
|
|
740
|
+
declare function fetchSeries(client: IPredictClient, params?: SeriesQueryParams): Promise<SeriesListResponse>;
|
|
741
|
+
declare function useSeriesQuery(params?: SeriesQueryParams, queryOptions?: Omit<UseQueryOptions<SeriesListResponse, Error, SeriesListResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<SeriesListResponse, Error>;
|
|
742
|
+
declare function seriesByTickerQueryKey(seriesTicker: string): unknown[];
|
|
743
|
+
declare function fetchSeriesByTicker(client: IPredictClient, seriesTicker: string): Promise<SeriesResponse>;
|
|
744
|
+
declare function useSeriesByTickerQuery(seriesTicker: string, options?: Omit<UseQueryOptions<SeriesResponse, Error, SeriesResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<SeriesResponse, Error>;
|
|
208
745
|
|
|
209
|
-
declare function
|
|
210
|
-
declare function
|
|
211
|
-
declare function
|
|
746
|
+
declare function tagsByCategoriesQueryKey(): unknown[];
|
|
747
|
+
declare function fetchTagsByCategories(client: IPredictClient): Promise<TagsByCategoriesResponse>;
|
|
748
|
+
declare function useTagsByCategoriesQuery(options?: Omit<UseQueryOptions<TagsByCategoriesResponse, Error, TagsByCategoriesResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TagsByCategoriesResponse, Error>;
|
|
749
|
+
declare function filtersBySportsQueryKey(): unknown[];
|
|
750
|
+
declare function fetchFiltersBySports(client: IPredictClient): Promise<FiltersBySportsResponse>;
|
|
751
|
+
declare function useFiltersBySportsQuery(options?: Omit<UseQueryOptions<FiltersBySportsResponse, Error, FiltersBySportsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<FiltersBySportsResponse, Error>;
|
|
752
|
+
/** @deprecated Use useTagsByCategoriesQuery instead */
|
|
753
|
+
declare const useCategoriesQuery: typeof useTagsByCategoriesQuery;
|
|
212
754
|
|
|
213
|
-
declare function
|
|
214
|
-
declare function
|
|
215
|
-
declare function
|
|
755
|
+
declare function searchQueryKey(params: SearchQueryParams): unknown[];
|
|
756
|
+
declare function fetchSearch(client: IPredictClient, params: SearchQueryParams): Promise<SearchResponse>;
|
|
757
|
+
declare function useSearchQuery(params: SearchQueryParams, queryOptions?: Omit<UseQueryOptions<SearchResponse, Error, SearchResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<SearchResponse, Error>;
|
|
216
758
|
|
|
217
|
-
declare function
|
|
218
|
-
declare function
|
|
219
|
-
declare function
|
|
759
|
+
declare function outcomeMintsQueryKey(params?: OutcomeMintsQueryParams): unknown[];
|
|
760
|
+
declare function fetchOutcomeMints(client: IPredictClient, params?: OutcomeMintsQueryParams): Promise<OutcomeMintsResponse>;
|
|
761
|
+
declare function useOutcomeMintsQuery(params?: OutcomeMintsQueryParams, options?: Omit<UseQueryOptions<OutcomeMintsResponse, Error, OutcomeMintsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OutcomeMintsResponse, Error>;
|
|
762
|
+
declare function filterOutcomeMints(client: IPredictClient, request: FilterOutcomeMintsRequest): Promise<FilterOutcomeMintsResponse>;
|
|
763
|
+
declare function useFilterOutcomeMintsMutation(options?: Omit<UseMutationOptions<FilterOutcomeMintsResponse, Error, FilterOutcomeMintsRequest>, "mutationFn">): _tanstack_react_query.UseMutationResult<FilterOutcomeMintsResponse, Error, FilterOutcomeMintsRequest, unknown>;
|
|
220
764
|
|
|
221
|
-
declare function
|
|
222
|
-
declare function
|
|
223
|
-
declare function
|
|
765
|
+
declare function quoteQueryKey(params: QuoteQueryParams): unknown[];
|
|
766
|
+
declare function fetchQuote(client: IPredictClient, params: QuoteQueryParams): Promise<QuoteResponse>;
|
|
767
|
+
declare function useQuoteQuery(params: QuoteQueryParams, options?: Omit<UseQueryOptions<QuoteResponse, Error, QuoteResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<QuoteResponse, Error>;
|
|
224
768
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
769
|
+
declare function createSwap(client: IPredictClient, request: SwapRequestBody): Promise<SwapResponse>;
|
|
770
|
+
declare function useCreateSwapMutation(options?: Omit<UseMutationOptions<SwapResponse, Error, SwapRequestBody>, "mutationFn">): _tanstack_react_query.UseMutationResult<SwapResponse, Error, SwapRequestBody, unknown>;
|
|
771
|
+
declare function createSwapInstructions(client: IPredictClient, request: SwapRequestBody): Promise<SwapInstructionsResponse>;
|
|
772
|
+
declare function useCreateSwapInstructionsMutation(options?: Omit<UseMutationOptions<SwapInstructionsResponse, Error, SwapRequestBody>, "mutationFn">): _tanstack_react_query.UseMutationResult<SwapInstructionsResponse, Error, SwapRequestBody, unknown>;
|
|
773
|
+
|
|
774
|
+
declare function orderQueryKey(params: OrderQueryParams): unknown[];
|
|
775
|
+
declare function fetchOrder(client: IPredictClient, params: OrderQueryParams): Promise<OrderResponse>;
|
|
776
|
+
declare function useOrderQuery(params: OrderQueryParams, options?: Omit<UseQueryOptions<OrderResponse, Error, OrderResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OrderResponse, Error>;
|
|
777
|
+
declare function orderStatusQueryKey(params: OrderStatusQueryParams): unknown[];
|
|
778
|
+
declare function fetchOrderStatus(client: IPredictClient, params: OrderStatusQueryParams): Promise<OrderStatusResponse>;
|
|
779
|
+
declare function useOrderStatusQuery(params: OrderStatusQueryParams, options?: Omit<UseQueryOptions<OrderStatusResponse, Error, OrderStatusResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<OrderStatusResponse, Error>;
|
|
780
|
+
|
|
781
|
+
declare function intentQuoteQueryKey(params: IntentQuoteQueryParams): unknown[];
|
|
782
|
+
declare function fetchIntentQuote(client: IPredictClient, params: IntentQuoteQueryParams): Promise<IntentQuoteResponse>;
|
|
783
|
+
declare function useIntentQuoteQuery(params: IntentQuoteQueryParams, options?: Omit<UseQueryOptions<IntentQuoteResponse, Error, IntentQuoteResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<IntentQuoteResponse, Error>;
|
|
784
|
+
declare function submitIntentSwap(client: IPredictClient, request: IntentSwapRequestBody): Promise<IntentSwapResponse>;
|
|
785
|
+
declare function useSubmitIntentSwapMutation(options?: Omit<UseMutationOptions<IntentSwapResponse, Error, IntentSwapRequestBody>, "mutationFn">): _tanstack_react_query.UseMutationResult<IntentSwapResponse, Error, IntentSwapRequestBody, unknown>;
|
|
786
|
+
|
|
787
|
+
declare function initPredictionMarket(client: IPredictClient, params: PredictionMarketInitQueryParams): Promise<PredictionMarketInitResponse>;
|
|
788
|
+
declare function useInitPredictionMarketMutation(options?: Omit<UseMutationOptions<PredictionMarketInitResponse, Error, PredictionMarketInitQueryParams>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictionMarketInitResponse, Error, PredictionMarketInitQueryParams, unknown>;
|
|
789
|
+
|
|
790
|
+
declare function tokensQueryKey(): unknown[];
|
|
791
|
+
declare function fetchTokens(client: IPredictClient): Promise<TokenListResponse>;
|
|
792
|
+
declare function useTokensQuery(options?: Omit<UseQueryOptions<TokenListResponse, Error, TokenListResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenListResponse, Error>;
|
|
793
|
+
declare function tokensWithDecimalsQueryKey(): unknown[];
|
|
794
|
+
declare function fetchTokensWithDecimals(client: IPredictClient): Promise<TokenListWithDecimalsResponse>;
|
|
795
|
+
declare function useTokensWithDecimalsQuery(options?: Omit<UseQueryOptions<TokenListWithDecimalsResponse, Error, TokenListWithDecimalsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TokenListWithDecimalsResponse, Error>;
|
|
796
|
+
|
|
797
|
+
declare function venuesQueryKey(): unknown[];
|
|
798
|
+
declare function fetchVenues(client: IPredictClient): Promise<VenueListResponse>;
|
|
799
|
+
declare function useVenuesQuery(options?: Omit<UseQueryOptions<VenueListResponse, Error, VenueListResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<VenueListResponse, Error>;
|
|
800
|
+
|
|
801
|
+
interface UseWsConnectionParams {
|
|
802
|
+
/** WebSocket endpoint URL */
|
|
803
|
+
wsEndpoint: string;
|
|
804
|
+
/** Auto-connect on mount (default: true) */
|
|
805
|
+
autoConnect?: boolean;
|
|
806
|
+
/** Auto-reconnect on disconnect (default: true) */
|
|
807
|
+
autoReconnect?: boolean;
|
|
808
|
+
/** Enable connection (default: true) */
|
|
809
|
+
enabled?: boolean;
|
|
229
810
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
811
|
+
interface UseWsConnectionResult {
|
|
812
|
+
/** WebSocket client instance */
|
|
813
|
+
client: IPredictWsClient | null;
|
|
814
|
+
/** Current connection status */
|
|
815
|
+
status: WsConnectionStatus;
|
|
816
|
+
/** Whether currently connected */
|
|
817
|
+
isConnected: boolean;
|
|
818
|
+
/** Connect to WebSocket */
|
|
819
|
+
connect: () => void;
|
|
820
|
+
/** Disconnect from WebSocket */
|
|
821
|
+
disconnect: () => void;
|
|
822
|
+
/** Last error */
|
|
823
|
+
error: Error | null;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Hook for managing WebSocket connection lifecycle
|
|
827
|
+
*/
|
|
828
|
+
declare function useWsConnection({ wsEndpoint, autoConnect, autoReconnect, enabled, }: UseWsConnectionParams): UseWsConnectionResult;
|
|
233
829
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
830
|
+
interface UseWsClientResult {
|
|
831
|
+
/** WebSocket client instance (null if not configured) */
|
|
832
|
+
wsClient: IPredictWsClient | null;
|
|
833
|
+
/** Current connection status */
|
|
834
|
+
wsStatus: WsConnectionStatus;
|
|
835
|
+
/** Whether currently connected */
|
|
836
|
+
isWsConnected: boolean;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Hook to access the WebSocket client from PredictContext.
|
|
840
|
+
* Connection status is derived directly from the wsClient instance.
|
|
841
|
+
*/
|
|
842
|
+
declare function useWsClient(): UseWsClientResult;
|
|
843
|
+
|
|
844
|
+
interface UsePricesSubscriptionParams {
|
|
845
|
+
/** WebSocket client instance */
|
|
846
|
+
client: IPredictWsClient | null;
|
|
847
|
+
/** Subscribe to all markets */
|
|
848
|
+
all?: boolean;
|
|
849
|
+
/** Subscribe to specific market tickers */
|
|
850
|
+
tickers?: string[];
|
|
851
|
+
/** Enable subscription (default: true) */
|
|
852
|
+
enabled?: boolean;
|
|
853
|
+
/** Callback when price update received */
|
|
854
|
+
onUpdate?: (update: WsPriceUpdate) => void;
|
|
855
|
+
}
|
|
856
|
+
interface PriceData {
|
|
857
|
+
yesBid: string | null;
|
|
858
|
+
yesAsk: string | null;
|
|
859
|
+
noBid: string | null;
|
|
860
|
+
noAsk: string | null;
|
|
861
|
+
updatedAt: number;
|
|
862
|
+
}
|
|
863
|
+
interface UsePricesSubscriptionResult {
|
|
864
|
+
/** Map of market ticker to latest price data */
|
|
865
|
+
prices: Map<string, PriceData>;
|
|
866
|
+
/** Whether subscription is active */
|
|
867
|
+
isSubscribed: boolean;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Hook for subscribing to real-time price updates
|
|
871
|
+
*/
|
|
872
|
+
declare function usePricesSubscription({ client, all, tickers, enabled, onUpdate, }: UsePricesSubscriptionParams): UsePricesSubscriptionResult;
|
|
873
|
+
|
|
874
|
+
interface UseTradesSubscriptionParams {
|
|
875
|
+
/** WebSocket client instance */
|
|
876
|
+
client: IPredictWsClient | null;
|
|
877
|
+
/** Subscribe to all markets */
|
|
878
|
+
all?: boolean;
|
|
879
|
+
/** Subscribe to specific market tickers */
|
|
880
|
+
tickers?: string[];
|
|
881
|
+
/** Enable subscription (default: true) */
|
|
882
|
+
enabled?: boolean;
|
|
883
|
+
/** Maximum number of trades to keep in history (default: 100) */
|
|
884
|
+
maxHistory?: number;
|
|
885
|
+
/** Callback when trade update received */
|
|
886
|
+
onUpdate?: (update: WsTradeUpdate) => void;
|
|
887
|
+
}
|
|
888
|
+
interface TradeData {
|
|
889
|
+
tradeId: string;
|
|
890
|
+
marketTicker: string;
|
|
891
|
+
price: number;
|
|
892
|
+
count: number;
|
|
893
|
+
yesPrice: number;
|
|
894
|
+
noPrice: number;
|
|
895
|
+
takerSide: "yes" | "no";
|
|
896
|
+
createdTime: number;
|
|
897
|
+
}
|
|
898
|
+
interface UseTradesSubscriptionResult {
|
|
899
|
+
/** Recent trades (newest first) */
|
|
900
|
+
trades: TradeData[];
|
|
901
|
+
/** Whether subscription is active */
|
|
902
|
+
isSubscribed: boolean;
|
|
903
|
+
/** Clear trade history */
|
|
904
|
+
clearHistory: () => void;
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Hook for subscribing to real-time trade updates
|
|
908
|
+
*/
|
|
909
|
+
declare function useTradesSubscription({ client, all, tickers, enabled, maxHistory, onUpdate, }: UseTradesSubscriptionParams): UseTradesSubscriptionResult;
|
|
237
910
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
911
|
+
interface UseOrderbookSubscriptionParams {
|
|
912
|
+
/** WebSocket client instance */
|
|
913
|
+
client: IPredictWsClient | null;
|
|
914
|
+
/** Subscribe to all markets */
|
|
915
|
+
all?: boolean;
|
|
916
|
+
/** Subscribe to specific market tickers */
|
|
917
|
+
tickers?: string[];
|
|
918
|
+
/** Enable subscription (default: true) */
|
|
919
|
+
enabled?: boolean;
|
|
920
|
+
/** Callback when orderbook update received */
|
|
921
|
+
onUpdate?: (update: WsOrderbookUpdate) => void;
|
|
922
|
+
}
|
|
923
|
+
interface OrderbookData {
|
|
924
|
+
yesBids: OrderbookLevel[];
|
|
925
|
+
yesAsks: OrderbookLevel[];
|
|
926
|
+
noBids: OrderbookLevel[];
|
|
927
|
+
noAsks: OrderbookLevel[];
|
|
928
|
+
updatedAt: number;
|
|
929
|
+
}
|
|
930
|
+
interface UseOrderbookSubscriptionResult {
|
|
931
|
+
/** Map of market ticker to latest orderbook data */
|
|
932
|
+
orderbooks: Map<string, OrderbookData>;
|
|
933
|
+
/** Whether subscription is active */
|
|
934
|
+
isSubscribed: boolean;
|
|
935
|
+
/** Get orderbook for a specific ticker */
|
|
936
|
+
getOrderbook: (ticker: string) => OrderbookData | undefined;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Hook for subscribing to real-time orderbook updates
|
|
940
|
+
*/
|
|
941
|
+
declare function useOrderbookSubscription({ client, all, tickers, enabled, onUpdate, }: UseOrderbookSubscriptionParams): UseOrderbookSubscriptionResult;
|
|
241
942
|
|
|
242
|
-
export {
|
|
943
|
+
export { CHART_RANGE_DURATION, CHART_RANGE_PERIOD, CHART_RANGE_SAMPLE_INTERVAL, CandlestickPeriod, type CandlestickPeriodType, CandlesticksQueryParams, CandlesticksResponse, ChartRange, type ChartRangeType, DEFAULT_CHART_RANGE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, EventDetailPage, type EventDetailPageProps, EventDetailSkeleton, type EventDetailSkeletonProps, EventDetailUI, type EventDetailUIProps, EventDetailWidget, type EventDetailWidgetProps, EventItemSkeleton, type EventItemSkeletonProps, EventItemUI, type EventItemUIProps, EventMarketDetailWidget, type EventMarketDetailWidgetProps, EventQueryParams, EventsSkeleton, type EventsSkeletonProps, EventsUI, type EventsUIProps, EventsWidget, type EventsWidgetProps, FilterOutcomeMintsRequest, FilterOutcomeMintsResponse, FiltersBySportsResponse, ForecastPercentileHistoryByMintQueryParams, ForecastPercentileHistoryQueryParams, ForecastPercentileHistoryResponse, IPredictClient, IPredictWsClient, IntentQuoteQueryParams, IntentQuoteResponse, IntentSwapRequestBody, IntentSwapResponse, LiveDataByEventQueryParams, LiveDataByMintQueryParams, LiveDataQueryParams, LiveDataResponse, MAX_PRICE_HISTORY_MARKETS, MarketQueryParams, MarketsBatchRequest, MultiTradeResponse, ORDER_MAX_PRICE, ORDER_MIN_PRICE, ORDER_MIN_QUANTITY, ORDER_PRICE_STEP, OpenOrdersUI, type OpenOrdersUIProps, OpenOrdersWidget, type OpenOrdersWidgetProps, type Order, type OrderBookRow, OrderBookUI, type OrderBookUIProps, OrderBookWidget, type OrderBookWidgetProps, OrderQueryParams, OrderResponse, OrderStatusQueryParams, OrderStatusResponse, type OrderbookData, OrderbookLevel, OrderbookResponse, OutcomeMintsQueryParams, OutcomeMintsResponse, PRICE_HISTORY_SAMPLE_INTERVAL, type Position, type PositionsSummary, PositionsUI, type PositionsUIProps, PositionsWidget, type PositionsWidgetProps, PredictContext, type PredictContextValue, PredictProvider, type PredictProviderProps, PredictionMarketInitQueryParams, PredictionMarketInitResponse, type PriceData, PriceHistoryInterval, type PriceHistoryIntervalType, QuoteQueryParams, QuoteResponse, SearchQueryParams, SearchResponse, SeriesListResponse, SeriesQueryParams, SeriesResponse, SingleTradeResponse, StandardEvent, StandardEventsResponse, StandardMarket, StandardMarketsResponse, SwapInstructionsResponse, SwapRequestBody, SwapResponse, TagsByCategoriesResponse, TokenListResponse, TokenListWithDecimalsResponse, type TradeData, TradeFormSkeleton, TradeFormUI, type TradeFormUIProps, type TradeFormValidation, TradeFormWidget, type TradeFormWidgetProps, TradeHistoryUI, type TradeHistoryUIProps, TradeHistoryWidget, type TradeHistoryWidgetProps, type TradeOutcome, type TradeSide, TradesByMintQueryParams, TradesQueryParams, type UseEventByIdQueryParams, type UseEventCandlesticksParams, type UseEventDetailParams, type UseEventsParams, type UseEventsResult, type UseMarketByIdQueryParams, type UseMarketCandlesticksByMintParams, type UseMarketCandlesticksParams, type UseOpenOrdersParams, type UseOpenOrdersResult, type UseOrderBookParams, type UseOrderBookResult, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UsePositionsParams, type UsePositionsResult, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseTradeFormParams, type UseTradeFormResult, type UseTradeHistoryParams, type UseTradeHistoryResult, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWsClientResult, type UseWsConnectionParams, type UseWsConnectionResult, VenueListResponse, WsConnectionStatus, WsOrderbookUpdate, WsPriceUpdate, WsTradeUpdate, createSwap, createSwapInstructions, eventByIdQueryKey, eventCandlesticksQueryKey, eventsInfiniteQueryKey, eventsQueryKey, fetchEventById, fetchEventCandlesticks, fetchEvents, fetchFiltersBySports, fetchForecastPercentileHistory, fetchForecastPercentileHistoryByMint, fetchIntentQuote, fetchLiveData, fetchLiveDataByEvent, fetchLiveDataByMint, fetchMarketById, fetchMarketByMint, fetchMarketCandlesticks, fetchMarketCandlesticksByMint, fetchMarkets, fetchMarketsBatch, fetchOrder, fetchOrderBook, fetchOrderBookByMint, fetchOrderStatus, fetchOutcomeMints, fetchQuote, fetchSearch, fetchSeries, fetchSeriesByTicker, fetchTagsByCategories, fetchTokens, fetchTokensWithDecimals, fetchTrades, fetchTradesByMint, fetchVenues, filterOutcomeMints, filtersBySportsQueryKey, forecastPercentileHistoryByMintQueryKey, forecastPercentileHistoryQueryKey, initPredictionMarket, intentQuoteQueryKey, liveDataByEventQueryKey, liveDataByMintQueryKey, liveDataQueryKey, marketByIdQueryKey, marketByMintQueryKey, marketCandlesticksByMintQueryKey, marketCandlesticksQueryKey, marketsBatchQueryKey, marketsQueryKey, orderBookByMintQueryKey, orderBookQueryKey, orderQueryKey, orderStatusQueryKey, outcomeMintsQueryKey, quoteQueryKey, searchQueryKey, seriesByTickerQueryKey, seriesQueryKey, submitIntentSwap, tagsByCategoriesQueryKey, tokensQueryKey, tokensWithDecimalsQueryKey, tradesByMintQueryKey, tradesQueryKey, useCategoriesQuery, useCreateSwapInstructionsMutation, useCreateSwapMutation, useEventByIdQuery, useEventCandlesticksQuery, useEventDetail, useEvents, useEventsInfiniteQuery, useEventsQuery, useFilterOutcomeMintsMutation, useFiltersBySportsQuery, useForecastPercentileHistoryByMintQuery, useForecastPercentileHistoryQuery, useInitPredictionMarketMutation, useIntentQuoteQuery, useLiveDataByEventQuery, useLiveDataByMintQuery, useLiveDataQuery, useMarketByIdQuery, useMarketByMintQuery, useMarketCandlesticksByMintQuery, useMarketCandlesticksQuery, useMarketsBatchQuery, useMarketsQuery, useOpenOrders, useOrderBook, useOrderBookByMintQuery, useOrderBookQuery, useOrderQuery, useOrderStatusQuery, useOrderbookSubscription, useOutcomeMintsQuery, usePositions, usePredictClient, usePredictContext, usePriceHistoryQuery, usePricesSubscription, useQuoteQuery, useSearchQuery, useSeriesByTickerQuery, useSeriesQuery, useSubmitIntentSwapMutation, useTagsByCategoriesQuery, useTokensQuery, useTokensWithDecimalsQuery, useTradeForm, useTradeHistory, useTradesByMintQuery, useTradesQuery, useTradesSubscription, useVenuesQuery, useWsClient, useWsConnection, venuesQueryKey, _default as version };
|