@liberfi.io/react-predict 0.1.50 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +32 -4
- package/dist/index.d.ts +32 -4
- package/dist/index.js +54 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{server-CaB0XJAa.d.mts → server-eKqIns8z.d.mts} +27 -2
- package/dist/{server-CaB0XJAa.d.ts → server-eKqIns8z.d.ts} +27 -2
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +16 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +16 -0
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as Orderbook, h as ListMarketTradesParams, i as PredictTrade, j as PriceHistoryRange, k as PriceHistoryResponse, l as ListCandlesticksParams, C as Candlestick, m as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, n as ListOrdersParams, o as PredictOrder, p as CancelOrderResult, M as MatchesParams,
|
|
2
|
-
export {
|
|
1
|
+
import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as Orderbook, h as ListMarketTradesParams, i as PredictTrade, j as PriceHistoryRange, k as PriceHistoryResponse, l as ListCandlesticksParams, C as Candlestick, m as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, n as ListOrdersParams, o as PredictOrder, p as ListOrdersMultiParams, q as PredictOrdersResponse, r as CancelOrderResult, M as MatchesParams, s as MatchGroupPage, t as MatchGroup, u as MatchMarketParams, v as MatchMarketPage, w as ListTradesParams, D as DFlowQuoteRequest, x as DFlowQuoteResponse, y as DFlowSubmitResponse, z as DFlowSubmitRequest, F as DFlowKYCStatus, G as PolymarketSetupStatus, W as WithdrawBuildResponse, H as WithdrawBuildRequest, I as WithdrawSubmitResponse, J as WithdrawSubmitRequest, K as WithdrawStatusResponse, N as PolymarketDepositAddresses, Q as PolymarketWithdrawResponse, R as PolymarketWithdrawRequest, T as TickSizeResponse, U as WsConnectionStatus, V as WsDataMessage, X as WsPriceEvent, Y as WsOrderbookEvent, Z as WsTradeEvent, _ as CreateOrderInput } from './server-eKqIns8z.mjs';
|
|
2
|
+
export { b1 as BuildClobAuthMessageInput, be as BuildOrderMessageInput, aU as CLOB_AUTH_DOMAIN, aV as CLOB_AUTH_TYPES, b2 as CTF_EXCHANGE_ADDRESS, b7 as CTF_ORDER_TYPES, bd as ClobOrderPayload, ag as DFlowOrderContext, ai as DepositBuildRequest, aj as DepositBuildResponse, am as DepositStatusResponse, ak as DepositSubmitRequest, al as DepositSubmitResponse, aa as EventSummary, a_ as HttpMethod, a7 as MarketOutcome, a6 as MarketResult, a5 as MarketStatus, ab as MarketSummary, at as MatchConfidenceTier, ap as MatchGroupEntry, aq as MatchGroupMarket, au as MatchMarketFlat, ar as MatchSortField, ao as MatchStatus, as as MatchesStats, b3 as NEG_RISK_CTF_EXCHANGE_ADDRESS, b8 as ORDER_TYPE, bf as OrderMessage, af as OrderSide, ae as OrderStatus, a8 as OrderbookLevel, b5 as POLYGON_CHAIN_ID, b0 as PolymarketL2Headers, a$ as PolymarketL2HeadersInput, ah as PolymarketOrderType, ad as PredictPosition, a3 as PredictTag, a1 as PredictWsClientConfig, ac as PricePoint, a2 as ProviderMeta, aL as ResolveEventsParamsInput, b9 as SIDE, a4 as SettlementSource, bg as SignedOrder, aM as TagSlugSelection, a9 as TradeType, b4 as USDC_ADDRESS, an as UnsignedTx, av as WsChannel, aw as WsChannelEvent, ax as WsClientMessage, aD as WsErrorCode, aE as WsErrorMessage, az as WsPingMessage, aB as WsPongMessage, aA as WsServerMessage, ay as WsSubscribeMessage, aC as WsSubscribedMessage, aW as buildClobAuthMessage, bc as buildClobPayload, b6 as buildCtfExchangeDomain, ba as buildOrderMessage, aY as buildPolymarketL2Headers, bb as buildSignedOrder, $ as createPredictClient, a0 as createPredictWsClient, aZ as derivePolymarketApiKey, aF as eventQueryKey, aG as fetchEvent, aK as fetchEventsPage, aO as fetchMarket, aT as fetchMatchMarketsPage, aR as fetchMatchesPage, aX as hmacSha256Base64, aJ as infiniteEventsQueryKey, aN as marketQueryKey, aS as matchMarketsQueryKey, aQ as matchQueryKey, aP as matchesQueryKey, aI as resolveEventsParams, aH as resolveTagSlug } from './server-eKqIns8z.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { PropsWithChildren } from 'react';
|
|
@@ -436,6 +436,27 @@ interface UseInfiniteOrdersOptions {
|
|
|
436
436
|
declare function infiniteOrdersQueryKey(params: UseInfiniteOrdersParams): unknown[];
|
|
437
437
|
declare function useInfiniteOrders(params: UseInfiniteOrdersParams, options?: UseInfiniteOrdersOptions): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PredictPage<PredictOrder>, unknown>, Error>;
|
|
438
438
|
|
|
439
|
+
declare function ordersMultiQueryKey(params: ListOrdersMultiParams): unknown[];
|
|
440
|
+
interface UseOrdersMultiOptions {
|
|
441
|
+
/**
|
|
442
|
+
* Async callback invoked before each request to obtain extra headers.
|
|
443
|
+
* Used by Polymarket orders to attach POLY_* HMAC authentication headers.
|
|
444
|
+
*/
|
|
445
|
+
getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
446
|
+
/**
|
|
447
|
+
* Extra values appended to the query key for cache invalidation.
|
|
448
|
+
* Use this to force a refetch when external state changes
|
|
449
|
+
* (e.g. `[!!credentials]` so the query re-runs once HMAC credentials load).
|
|
450
|
+
*/
|
|
451
|
+
keyExtra?: unknown[];
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Fetch enriched orders for multiple wallets in a single request.
|
|
455
|
+
* Each provider is queried with its own address. Orders include
|
|
456
|
+
* market and event summary data from the backend.
|
|
457
|
+
*/
|
|
458
|
+
declare function useOrdersMulti(params: ListOrdersMultiParams, options?: UseOrdersMultiOptions, queryOptions?: Omit<UseQueryOptions<PredictOrdersResponse, Error, PredictOrdersResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictOrdersResponse, Error>;
|
|
459
|
+
|
|
439
460
|
declare function orderQueryKey(id: string, source: ProviderSource): unknown[];
|
|
440
461
|
interface UseOrderParams {
|
|
441
462
|
id: string;
|
|
@@ -450,7 +471,14 @@ interface CancelOrderVariables {
|
|
|
450
471
|
id: string;
|
|
451
472
|
source: ProviderSource;
|
|
452
473
|
}
|
|
453
|
-
|
|
474
|
+
interface UseCancelOrderOptions {
|
|
475
|
+
/**
|
|
476
|
+
* Async callback invoked before the cancel request to obtain extra headers.
|
|
477
|
+
* Required for Polymarket orders (POLY_* HMAC authentication headers).
|
|
478
|
+
*/
|
|
479
|
+
getHeaders?: (vars: CancelOrderVariables) => Record<string, string> | Promise<Record<string, string>>;
|
|
480
|
+
}
|
|
481
|
+
declare function useCancelOrder(options?: UseCancelOrderOptions, mutationOptions?: Omit<UseMutationOptions<CancelOrderResult, Error, CancelOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<CancelOrderResult, Error, CancelOrderVariables, unknown>;
|
|
454
482
|
|
|
455
483
|
type UseInfiniteMatchesParams = Omit<MatchesParams, "cursor">;
|
|
456
484
|
type InfiniteQueryOptions$1 = Omit<UseInfiniteQueryOptions<MatchGroupPage, Error, InfiniteData<MatchGroupPage>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
@@ -824,4 +852,4 @@ interface CreatePolymarketOrderVariables {
|
|
|
824
852
|
*/
|
|
825
853
|
declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
|
|
826
854
|
|
|
827
|
-
export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersOptions, type UsePositionsMultiParams, type UsePositionsParams, type UsePredictWsClientResult, type UsePriceHistoryParams, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseRealtimeOrderbookParams, type UseRealtimePricesParams, type UseRealtimeTradesParams, type UseRealtimeTradesResult, type UseSearchEventsParams, type UseSimilarEventsParams, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWithdrawStatusQueryParams, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
|
|
855
|
+
export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersMultiOptions, type UseOrdersOptions, type UsePositionsMultiParams, type UsePositionsParams, type UsePredictWsClientResult, type UsePriceHistoryParams, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseRealtimeOrderbookParams, type UseRealtimePricesParams, type UseRealtimeTradesParams, type UseRealtimeTradesResult, type UseSearchEventsParams, type UseSimilarEventsParams, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWithdrawStatusQueryParams, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as Orderbook, h as ListMarketTradesParams, i as PredictTrade, j as PriceHistoryRange, k as PriceHistoryResponse, l as ListCandlesticksParams, C as Candlestick, m as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, n as ListOrdersParams, o as PredictOrder, p as CancelOrderResult, M as MatchesParams,
|
|
2
|
-
export {
|
|
1
|
+
import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as Orderbook, h as ListMarketTradesParams, i as PredictTrade, j as PriceHistoryRange, k as PriceHistoryResponse, l as ListCandlesticksParams, C as Candlestick, m as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, n as ListOrdersParams, o as PredictOrder, p as ListOrdersMultiParams, q as PredictOrdersResponse, r as CancelOrderResult, M as MatchesParams, s as MatchGroupPage, t as MatchGroup, u as MatchMarketParams, v as MatchMarketPage, w as ListTradesParams, D as DFlowQuoteRequest, x as DFlowQuoteResponse, y as DFlowSubmitResponse, z as DFlowSubmitRequest, F as DFlowKYCStatus, G as PolymarketSetupStatus, W as WithdrawBuildResponse, H as WithdrawBuildRequest, I as WithdrawSubmitResponse, J as WithdrawSubmitRequest, K as WithdrawStatusResponse, N as PolymarketDepositAddresses, Q as PolymarketWithdrawResponse, R as PolymarketWithdrawRequest, T as TickSizeResponse, U as WsConnectionStatus, V as WsDataMessage, X as WsPriceEvent, Y as WsOrderbookEvent, Z as WsTradeEvent, _ as CreateOrderInput } from './server-eKqIns8z.js';
|
|
2
|
+
export { b1 as BuildClobAuthMessageInput, be as BuildOrderMessageInput, aU as CLOB_AUTH_DOMAIN, aV as CLOB_AUTH_TYPES, b2 as CTF_EXCHANGE_ADDRESS, b7 as CTF_ORDER_TYPES, bd as ClobOrderPayload, ag as DFlowOrderContext, ai as DepositBuildRequest, aj as DepositBuildResponse, am as DepositStatusResponse, ak as DepositSubmitRequest, al as DepositSubmitResponse, aa as EventSummary, a_ as HttpMethod, a7 as MarketOutcome, a6 as MarketResult, a5 as MarketStatus, ab as MarketSummary, at as MatchConfidenceTier, ap as MatchGroupEntry, aq as MatchGroupMarket, au as MatchMarketFlat, ar as MatchSortField, ao as MatchStatus, as as MatchesStats, b3 as NEG_RISK_CTF_EXCHANGE_ADDRESS, b8 as ORDER_TYPE, bf as OrderMessage, af as OrderSide, ae as OrderStatus, a8 as OrderbookLevel, b5 as POLYGON_CHAIN_ID, b0 as PolymarketL2Headers, a$ as PolymarketL2HeadersInput, ah as PolymarketOrderType, ad as PredictPosition, a3 as PredictTag, a1 as PredictWsClientConfig, ac as PricePoint, a2 as ProviderMeta, aL as ResolveEventsParamsInput, b9 as SIDE, a4 as SettlementSource, bg as SignedOrder, aM as TagSlugSelection, a9 as TradeType, b4 as USDC_ADDRESS, an as UnsignedTx, av as WsChannel, aw as WsChannelEvent, ax as WsClientMessage, aD as WsErrorCode, aE as WsErrorMessage, az as WsPingMessage, aB as WsPongMessage, aA as WsServerMessage, ay as WsSubscribeMessage, aC as WsSubscribedMessage, aW as buildClobAuthMessage, bc as buildClobPayload, b6 as buildCtfExchangeDomain, ba as buildOrderMessage, aY as buildPolymarketL2Headers, bb as buildSignedOrder, $ as createPredictClient, a0 as createPredictWsClient, aZ as derivePolymarketApiKey, aF as eventQueryKey, aG as fetchEvent, aK as fetchEventsPage, aO as fetchMarket, aT as fetchMatchMarketsPage, aR as fetchMatchesPage, aX as hmacSha256Base64, aJ as infiniteEventsQueryKey, aN as marketQueryKey, aS as matchMarketsQueryKey, aQ as matchQueryKey, aP as matchesQueryKey, aI as resolveEventsParams, aH as resolveTagSlug } from './server-eKqIns8z.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { PropsWithChildren } from 'react';
|
|
@@ -436,6 +436,27 @@ interface UseInfiniteOrdersOptions {
|
|
|
436
436
|
declare function infiniteOrdersQueryKey(params: UseInfiniteOrdersParams): unknown[];
|
|
437
437
|
declare function useInfiniteOrders(params: UseInfiniteOrdersParams, options?: UseInfiniteOrdersOptions): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PredictPage<PredictOrder>, unknown>, Error>;
|
|
438
438
|
|
|
439
|
+
declare function ordersMultiQueryKey(params: ListOrdersMultiParams): unknown[];
|
|
440
|
+
interface UseOrdersMultiOptions {
|
|
441
|
+
/**
|
|
442
|
+
* Async callback invoked before each request to obtain extra headers.
|
|
443
|
+
* Used by Polymarket orders to attach POLY_* HMAC authentication headers.
|
|
444
|
+
*/
|
|
445
|
+
getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
446
|
+
/**
|
|
447
|
+
* Extra values appended to the query key for cache invalidation.
|
|
448
|
+
* Use this to force a refetch when external state changes
|
|
449
|
+
* (e.g. `[!!credentials]` so the query re-runs once HMAC credentials load).
|
|
450
|
+
*/
|
|
451
|
+
keyExtra?: unknown[];
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Fetch enriched orders for multiple wallets in a single request.
|
|
455
|
+
* Each provider is queried with its own address. Orders include
|
|
456
|
+
* market and event summary data from the backend.
|
|
457
|
+
*/
|
|
458
|
+
declare function useOrdersMulti(params: ListOrdersMultiParams, options?: UseOrdersMultiOptions, queryOptions?: Omit<UseQueryOptions<PredictOrdersResponse, Error, PredictOrdersResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictOrdersResponse, Error>;
|
|
459
|
+
|
|
439
460
|
declare function orderQueryKey(id: string, source: ProviderSource): unknown[];
|
|
440
461
|
interface UseOrderParams {
|
|
441
462
|
id: string;
|
|
@@ -450,7 +471,14 @@ interface CancelOrderVariables {
|
|
|
450
471
|
id: string;
|
|
451
472
|
source: ProviderSource;
|
|
452
473
|
}
|
|
453
|
-
|
|
474
|
+
interface UseCancelOrderOptions {
|
|
475
|
+
/**
|
|
476
|
+
* Async callback invoked before the cancel request to obtain extra headers.
|
|
477
|
+
* Required for Polymarket orders (POLY_* HMAC authentication headers).
|
|
478
|
+
*/
|
|
479
|
+
getHeaders?: (vars: CancelOrderVariables) => Record<string, string> | Promise<Record<string, string>>;
|
|
480
|
+
}
|
|
481
|
+
declare function useCancelOrder(options?: UseCancelOrderOptions, mutationOptions?: Omit<UseMutationOptions<CancelOrderResult, Error, CancelOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<CancelOrderResult, Error, CancelOrderVariables, unknown>;
|
|
454
482
|
|
|
455
483
|
type UseInfiniteMatchesParams = Omit<MatchesParams, "cursor">;
|
|
456
484
|
type InfiniteQueryOptions$1 = Omit<UseInfiniteQueryOptions<MatchGroupPage, Error, InfiniteData<MatchGroupPage>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
@@ -824,4 +852,4 @@ interface CreatePolymarketOrderVariables {
|
|
|
824
852
|
*/
|
|
825
853
|
declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
|
|
826
854
|
|
|
827
|
-
export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersOptions, type UsePositionsMultiParams, type UsePositionsParams, type UsePredictWsClientResult, type UsePriceHistoryParams, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseRealtimeOrderbookParams, type UseRealtimePricesParams, type UseRealtimeTradesParams, type UseRealtimeTradesResult, type UseSearchEventsParams, type UseSimilarEventsParams, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWithdrawStatusQueryParams, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
|
|
855
|
+
export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersMultiOptions, type UseOrdersOptions, type UsePositionsMultiParams, type UsePositionsParams, type UsePredictWsClientResult, type UsePriceHistoryParams, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseRealtimeOrderbookParams, type UseRealtimePricesParams, type UseRealtimeTradesParams, type UseRealtimeTradesResult, type UseSearchEventsParams, type UseSimilarEventsParams, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWithdrawStatusQueryParams, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
|
package/dist/index.js
CHANGED
|
@@ -188,6 +188,22 @@ var PredictClient = class {
|
|
|
188
188
|
headers ? { headers } : void 0
|
|
189
189
|
);
|
|
190
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Multi-wallet order listing with enriched market/event context.
|
|
193
|
+
*
|
|
194
|
+
* Maps to `GET /api/v1/orders?kalshi_user=...&polymarket_user=...`.
|
|
195
|
+
*
|
|
196
|
+
* @param params - Per-provider wallet addresses.
|
|
197
|
+
* @param headers - Optional extra headers (e.g. Polymarket POLY_* HMAC headers).
|
|
198
|
+
*/
|
|
199
|
+
async listOrdersMulti(params, headers) {
|
|
200
|
+
const query = buildQuery(params);
|
|
201
|
+
const url = `${this.endpoint}/api/v1/orders${query}`;
|
|
202
|
+
return await utils.httpGet(
|
|
203
|
+
url,
|
|
204
|
+
headers ? { headers } : void 0
|
|
205
|
+
);
|
|
206
|
+
}
|
|
191
207
|
/**
|
|
192
208
|
* Maps to `GET /api/v1/orders/:id?source=...`.
|
|
193
209
|
*
|
|
@@ -1337,6 +1353,30 @@ function useInfiniteOrders(params, options) {
|
|
|
1337
1353
|
enabled: Boolean(params.wallet_address)
|
|
1338
1354
|
});
|
|
1339
1355
|
}
|
|
1356
|
+
function ordersMultiQueryKey(params) {
|
|
1357
|
+
return [
|
|
1358
|
+
"predict",
|
|
1359
|
+
"orders",
|
|
1360
|
+
"multi",
|
|
1361
|
+
params.kalshi_user ?? "",
|
|
1362
|
+
params.polymarket_user ?? ""
|
|
1363
|
+
];
|
|
1364
|
+
}
|
|
1365
|
+
function useOrdersMulti(params, options, queryOptions = {}) {
|
|
1366
|
+
const client = usePredictClient();
|
|
1367
|
+
const hasAnyWallet = Boolean(params.kalshi_user || params.polymarket_user);
|
|
1368
|
+
return reactQuery.useQuery({
|
|
1369
|
+
queryKey: [...ordersMultiQueryKey(params), ...options?.keyExtra ?? []],
|
|
1370
|
+
queryFn: async () => {
|
|
1371
|
+
const headers = await options?.getHeaders?.();
|
|
1372
|
+
return client.listOrdersMulti(params, headers);
|
|
1373
|
+
},
|
|
1374
|
+
enabled: hasAnyWallet,
|
|
1375
|
+
staleTime: 1e4,
|
|
1376
|
+
refetchInterval: 3e4,
|
|
1377
|
+
...queryOptions
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1340
1380
|
function orderQueryKey(id, source) {
|
|
1341
1381
|
return ["predict", "order", id, source];
|
|
1342
1382
|
}
|
|
@@ -1350,15 +1390,23 @@ function useOrder(params, queryOptions = {}) {
|
|
|
1350
1390
|
...queryOptions
|
|
1351
1391
|
});
|
|
1352
1392
|
}
|
|
1353
|
-
function useCancelOrder(mutationOptions = {}) {
|
|
1393
|
+
function useCancelOrder(options, mutationOptions = {}) {
|
|
1354
1394
|
const client = usePredictClient();
|
|
1355
1395
|
const queryClient = reactQuery.useQueryClient();
|
|
1396
|
+
const { onSuccess, onError, ...restMutationOptions } = mutationOptions;
|
|
1356
1397
|
return reactQuery.useMutation({
|
|
1357
|
-
mutationFn: (vars) =>
|
|
1358
|
-
|
|
1398
|
+
mutationFn: async (vars) => {
|
|
1399
|
+
const headers = await options?.getHeaders?.(vars);
|
|
1400
|
+
return client.cancelOrder(vars.id, vars.source, headers);
|
|
1401
|
+
},
|
|
1402
|
+
onSuccess: (...args) => {
|
|
1359
1403
|
queryClient.invalidateQueries({ queryKey: ["predict", "orders"] });
|
|
1404
|
+
onSuccess?.(...args);
|
|
1360
1405
|
},
|
|
1361
|
-
...
|
|
1406
|
+
onError: (...args) => {
|
|
1407
|
+
onError?.(...args);
|
|
1408
|
+
},
|
|
1409
|
+
...restMutationOptions
|
|
1362
1410
|
});
|
|
1363
1411
|
}
|
|
1364
1412
|
|
|
@@ -2140,6 +2188,7 @@ exports.matchQueryKey = matchQueryKey;
|
|
|
2140
2188
|
exports.matchesQueryKey = matchesQueryKey;
|
|
2141
2189
|
exports.orderQueryKey = orderQueryKey;
|
|
2142
2190
|
exports.orderbookQueryKey = orderbookQueryKey;
|
|
2191
|
+
exports.ordersMultiQueryKey = ordersMultiQueryKey;
|
|
2143
2192
|
exports.ordersQueryKey = ordersQueryKey;
|
|
2144
2193
|
exports.polymarketDepositAddressesQueryKey = polymarketDepositAddressesQueryKey;
|
|
2145
2194
|
exports.polymarketSetupQueryKey = polymarketSetupQueryKey;
|
|
@@ -2175,6 +2224,7 @@ exports.useOrder = useOrder;
|
|
|
2175
2224
|
exports.useOrderbook = useOrderbook;
|
|
2176
2225
|
exports.useOrderbookSubscription = useOrderbookSubscription;
|
|
2177
2226
|
exports.useOrders = useOrders;
|
|
2227
|
+
exports.useOrdersMulti = useOrdersMulti;
|
|
2178
2228
|
exports.usePolymarket = usePolymarket;
|
|
2179
2229
|
exports.usePolymarketDeposit = usePolymarketDeposit;
|
|
2180
2230
|
exports.usePolymarketDepositAddresses = usePolymarketDepositAddresses;
|