@liberfi.io/react-predict 0.3.61 → 0.3.62
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 +26 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.js +86 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +83 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{server-h41hs9SR.d.mts → server-BW_QhQos.d.mts} +44 -1
- package/dist/{server-h41hs9SR.d.ts → server-BW_QhQos.d.ts} +44 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +17 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +17 -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 OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse,
|
|
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 OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, q as PositionValueResponse, A as AvailableSharesResponse, B as BalanceResponse, r as ListOrdersParams, s as PredictOrder, t as ListOrdersMultiParams, u as PredictOrdersResponse, v as CancelOrderResult, M as MatchesParams, w as MatchGroupPage, x as MatchGroup, y as MatchMarketParams, z as MatchMarketPage, D as ListTradesParams, F as ListTradesMultiParams, G as DFlowQuoteRequest, H as DFlowQuoteResponse, I as DFlowSubmitResponse, J as DFlowSubmitRequest, K as DFlowKYCStatus, N as PolymarketSetupStatus, Q as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, R as WithdrawBuildRequest, T as WithdrawSubmitResponse, U as WithdrawSubmitRequest, V as WithdrawStatusResponse, X as PolymarketDepositAddresses, Y as PolymarketSupportedAsset, Z as PolymarketWithdrawResponse, _ as PolymarketWithdrawRequest, $ as PolymarketWithdrawPrepareResponse, a0 as PolymarketWithdrawPrepareRequest, a1 as PolymarketWithdrawQuoteResponse, a2 as PolymarketWithdrawQuoteRequest, a3 as PolymarketWithdrawRelayBuildResponse, a4 as PolymarketWithdrawRelayBuildRequest, a5 as PolymarketWithdrawRelaySubmitResponse, a6 as PolymarketWithdrawRelaySubmitRequest, a7 as PolymarketWithdrawBridgeStatusResponse, a8 as PolymarketRedeemResponse, a9 as PolymarketTypedData, aa as TickSizeResponse, ab as FeeRateResponse, ac as RebateConfig, ad as WsConnectionStatus, ae as WsDataMessage, af as WsPriceEvent, ag as WsOrderbookEvent, ah as WsTradeEvent, ai as CreateOrderInput } from './server-BW_QhQos.mjs';
|
|
2
|
+
export { bD as BuildClobAuthMessageInput, bR as BuildOrderMessageInput, bu as CLOB_AUTH_DOMAIN, bv as CLOB_AUTH_TYPES, bE as CTF_EXCHANGE_ADDRESS, bJ as CTF_ORDER_TYPES, bQ as ClobOrderPayload, aI as DFlowOrderContext, aM as DepositBuildRequest, aN as DepositBuildResponse, aQ as DepositStatusResponse, aO as DepositSubmitRequest, aP as DepositSubmitResponse, az as EventSummary, bA as HttpMethod, as as MarketOutcome, ar as MarketResult, aq as MarketStatus, aA as MarketSummary, a_ as MatchConfidenceTier, aW as MatchGroupEntry, aX as MatchGroupMarket, b0 as MatchLeg, b1 as MatchMarketFlat, aY as MatchSortField, aV as MatchStatus, aZ as MatchesStats, bF as NEG_RISK_CTF_EXCHANGE_ADDRESS, bK as ORDER_TYPE, bS as OrderMessage, aH as OrderSide, aG as OrderStatus, au as OrderbookBatchItem, av as OrderbookBatchResult, at as OrderbookLevel, aw as OrderbooksBatchRequest, ax as OrderbooksBatchResponse, bH as POLYGON_CHAIN_ID, aS as PolymarketBridgeToken, aL as PolymarketDepositWalletDeployRequest, bC as PolymarketL2Headers, bB as PolymarketL2HeadersInput, aJ as PolymarketOrderType, be as PolymarketRedeemInput, bc as PolymarketRedeemPrepareInput, bd as PolymarketRedeemPrepareResponse, aT as PolymarketSupportedAssetsResponse, aU as PolymarketTypedDataArg, aK as PolymarketWalletKind, aE as PositionValue, aF as PositionValueError, ak as PredictClientOptions, aB as PredictCommentProfile, aD as PredictPosition, ao as PredictTag, am as PredictWsClientConfig, aC as PricePoint, an as ProviderMeta, bl as ResolveEventsParamsInput, bL as SIDE, ap as SettlementSource, a$ as SignalTag, bT as SignedOrder, bm as TagSlugSelection, ay as TradeType, bG as USDC_ADDRESS, aR as UnsignedTx, b2 as WsChannel, b3 as WsChannelEvent, b4 as WsClientMessage, ba as WsErrorCode, bb as WsErrorMessage, b6 as WsPingMessage, b8 as WsPongMessage, b7 as WsServerMessage, b5 as WsSubscribeMessage, b9 as WsSubscribedMessage, bw as buildClobAuthMessage, bO as buildClobPayload, bI as buildCtfExchangeDomain, bM as buildOrderMessage, by as buildPolymarketL2Headers, bN as buildSignedOrder, aj as createPredictClient, al as createPredictWsClient, bz as derivePolymarketApiKey, bf as eventQueryKey, bg as fetchEvent, bk as fetchEventsPage, bo as fetchMarket, bt as fetchMatchMarketsPage, br as fetchMatchesPage, bP as getPolymarketSharesPrecision, bx as hmacSha256Base64, bj as infiniteEventsQueryKey, bn as marketQueryKey, bs as matchMarketsQueryKey, bq as matchQueryKey, bp as matchesQueryKey, bi as resolveEventsParams, bh as resolveTagSlug } from './server-BW_QhQos.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';
|
|
@@ -414,6 +414,29 @@ declare function usePositions(params: UsePositionsParams, queryOptions?: Omit<Us
|
|
|
414
414
|
*/
|
|
415
415
|
declare function usePositionsMulti(params: UsePositionsMultiParams, queryOptions?: Omit<UseQueryOptions<PositionsResponse, Error, PositionsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionsResponse, Error>;
|
|
416
416
|
|
|
417
|
+
declare function positionValueQueryKey(user: string, source?: ProviderSource): unknown[];
|
|
418
|
+
declare function positionValueMultiQueryKey(wallets: {
|
|
419
|
+
kalshi_user?: string;
|
|
420
|
+
polymarket_user?: string;
|
|
421
|
+
}): unknown[];
|
|
422
|
+
/** Single-source params (backward-compatible). */
|
|
423
|
+
interface UsePositionValueParams {
|
|
424
|
+
/** Provider source. Omit to aggregate all providers (same address). */
|
|
425
|
+
source?: ProviderSource;
|
|
426
|
+
user: string;
|
|
427
|
+
}
|
|
428
|
+
/** Multi-wallet params — each provider gets its own address. */
|
|
429
|
+
interface UsePositionValueMultiParams {
|
|
430
|
+
kalshi_user?: string;
|
|
431
|
+
polymarket_user?: string;
|
|
432
|
+
}
|
|
433
|
+
declare function usePositionValue(params: UsePositionValueParams, queryOptions?: Omit<UseQueryOptions<PositionValueResponse, Error, PositionValueResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionValueResponse, Error>;
|
|
434
|
+
/**
|
|
435
|
+
* Fetch current total position value for multiple wallets in a single request.
|
|
436
|
+
* Each provider is queried with its own address.
|
|
437
|
+
*/
|
|
438
|
+
declare function usePositionValueMulti(params: UsePositionValueMultiParams, queryOptions?: Omit<UseQueryOptions<PositionValueResponse, Error, PositionValueResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionValueResponse, Error>;
|
|
439
|
+
|
|
417
440
|
interface UseAvailableSharesParams {
|
|
418
441
|
source: ProviderSource;
|
|
419
442
|
user: string;
|
|
@@ -1142,4 +1165,4 @@ interface WalkOrderbookParams {
|
|
|
1142
1165
|
*/
|
|
1143
1166
|
declare function walkOrderbook({ orderbook, outcome, side, sharesNeeded, slippageBps, }: WalkOrderbookParams): WalkResult;
|
|
1144
1167
|
|
|
1145
|
-
export { AvailableSharesResponse, BalanceResponse, type BuildV2OrderParams, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, type ClobOrderV2Payload, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListCommentsParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, OrderbookOutcome, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketDepositWalletDeployResponse, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, PolymarketSetupStatus, type PolymarketSigner, PolymarketSupportedAsset, PolymarketTypedData, PolymarketWithdrawBridgeStatusResponse, PolymarketWithdrawPrepareRequest, PolymarketWithdrawPrepareResponse, PolymarketWithdrawQuoteRequest, PolymarketWithdrawQuoteResponse, PolymarketWithdrawRelayBuildRequest, PolymarketWithdrawRelayBuildResponse, PolymarketWithdrawRelaySubmitRequest, PolymarketWithdrawRelaySubmitResponse, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, RebateConfig, type RedeemPositionVariables, SimilarEventsParams, type StartTradeResultConfirmationInput, type SyncBalanceAllowanceParams, TickSizeResponse, type TradeResultConfirmationState, type TradeResultExpectation, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteCommentsParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesMultiParams, 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, type WalkOrderbookParams, type WalkOutcome, type WalkResult, type WalkSide, type WalkStatus, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, buildSignedV2OrderPayload, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, polymarketWithdrawStatusQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, updatePolymarketBalanceAllowance, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useDeployPolymarketDepositWallet, useEvent, useEventStats, useEvents, useFeeRate, useInfiniteComments, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketSupportedAssets, usePolymarketWithdraw, usePolymarketWithdrawPrepareMutation, usePolymarketWithdrawQuoteMutation, usePolymarketWithdrawRelayBuildMutation, usePolymarketWithdrawRelaySubmitMutation, usePolymarketWithdrawStatusQuery, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTradeResultConfirmation, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
|
|
1168
|
+
export { AvailableSharesResponse, BalanceResponse, type BuildV2OrderParams, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, type ClobOrderV2Payload, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListCommentsParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, OrderbookOutcome, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketDepositWalletDeployResponse, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, PolymarketSetupStatus, type PolymarketSigner, PolymarketSupportedAsset, PolymarketTypedData, PolymarketWithdrawBridgeStatusResponse, PolymarketWithdrawPrepareRequest, PolymarketWithdrawPrepareResponse, PolymarketWithdrawQuoteRequest, PolymarketWithdrawQuoteResponse, PolymarketWithdrawRelayBuildRequest, PolymarketWithdrawRelayBuildResponse, PolymarketWithdrawRelaySubmitRequest, PolymarketWithdrawRelaySubmitResponse, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionValueResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, RebateConfig, type RedeemPositionVariables, SimilarEventsParams, type StartTradeResultConfirmationInput, type SyncBalanceAllowanceParams, TickSizeResponse, type TradeResultConfirmationState, type TradeResultExpectation, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteCommentsParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesMultiParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersMultiOptions, type UseOrdersOptions, type UsePositionValueMultiParams, type UsePositionValueParams, 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, type WalkOrderbookParams, type WalkOutcome, type WalkResult, type WalkSide, type WalkStatus, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, buildSignedV2OrderPayload, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, polymarketWithdrawStatusQueryKey, positionValueMultiQueryKey, positionValueQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, updatePolymarketBalanceAllowance, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useDeployPolymarketDepositWallet, useEvent, useEventStats, useEvents, useFeeRate, useInfiniteComments, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketSupportedAssets, usePolymarketWithdraw, usePolymarketWithdrawPrepareMutation, usePolymarketWithdrawQuoteMutation, usePolymarketWithdrawRelayBuildMutation, usePolymarketWithdrawRelaySubmitMutation, usePolymarketWithdrawStatusQuery, usePositionValue, usePositionValueMulti, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTradeResultConfirmation, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, 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 OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse,
|
|
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 OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, q as PositionValueResponse, A as AvailableSharesResponse, B as BalanceResponse, r as ListOrdersParams, s as PredictOrder, t as ListOrdersMultiParams, u as PredictOrdersResponse, v as CancelOrderResult, M as MatchesParams, w as MatchGroupPage, x as MatchGroup, y as MatchMarketParams, z as MatchMarketPage, D as ListTradesParams, F as ListTradesMultiParams, G as DFlowQuoteRequest, H as DFlowQuoteResponse, I as DFlowSubmitResponse, J as DFlowSubmitRequest, K as DFlowKYCStatus, N as PolymarketSetupStatus, Q as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, R as WithdrawBuildRequest, T as WithdrawSubmitResponse, U as WithdrawSubmitRequest, V as WithdrawStatusResponse, X as PolymarketDepositAddresses, Y as PolymarketSupportedAsset, Z as PolymarketWithdrawResponse, _ as PolymarketWithdrawRequest, $ as PolymarketWithdrawPrepareResponse, a0 as PolymarketWithdrawPrepareRequest, a1 as PolymarketWithdrawQuoteResponse, a2 as PolymarketWithdrawQuoteRequest, a3 as PolymarketWithdrawRelayBuildResponse, a4 as PolymarketWithdrawRelayBuildRequest, a5 as PolymarketWithdrawRelaySubmitResponse, a6 as PolymarketWithdrawRelaySubmitRequest, a7 as PolymarketWithdrawBridgeStatusResponse, a8 as PolymarketRedeemResponse, a9 as PolymarketTypedData, aa as TickSizeResponse, ab as FeeRateResponse, ac as RebateConfig, ad as WsConnectionStatus, ae as WsDataMessage, af as WsPriceEvent, ag as WsOrderbookEvent, ah as WsTradeEvent, ai as CreateOrderInput } from './server-BW_QhQos.js';
|
|
2
|
+
export { bD as BuildClobAuthMessageInput, bR as BuildOrderMessageInput, bu as CLOB_AUTH_DOMAIN, bv as CLOB_AUTH_TYPES, bE as CTF_EXCHANGE_ADDRESS, bJ as CTF_ORDER_TYPES, bQ as ClobOrderPayload, aI as DFlowOrderContext, aM as DepositBuildRequest, aN as DepositBuildResponse, aQ as DepositStatusResponse, aO as DepositSubmitRequest, aP as DepositSubmitResponse, az as EventSummary, bA as HttpMethod, as as MarketOutcome, ar as MarketResult, aq as MarketStatus, aA as MarketSummary, a_ as MatchConfidenceTier, aW as MatchGroupEntry, aX as MatchGroupMarket, b0 as MatchLeg, b1 as MatchMarketFlat, aY as MatchSortField, aV as MatchStatus, aZ as MatchesStats, bF as NEG_RISK_CTF_EXCHANGE_ADDRESS, bK as ORDER_TYPE, bS as OrderMessage, aH as OrderSide, aG as OrderStatus, au as OrderbookBatchItem, av as OrderbookBatchResult, at as OrderbookLevel, aw as OrderbooksBatchRequest, ax as OrderbooksBatchResponse, bH as POLYGON_CHAIN_ID, aS as PolymarketBridgeToken, aL as PolymarketDepositWalletDeployRequest, bC as PolymarketL2Headers, bB as PolymarketL2HeadersInput, aJ as PolymarketOrderType, be as PolymarketRedeemInput, bc as PolymarketRedeemPrepareInput, bd as PolymarketRedeemPrepareResponse, aT as PolymarketSupportedAssetsResponse, aU as PolymarketTypedDataArg, aK as PolymarketWalletKind, aE as PositionValue, aF as PositionValueError, ak as PredictClientOptions, aB as PredictCommentProfile, aD as PredictPosition, ao as PredictTag, am as PredictWsClientConfig, aC as PricePoint, an as ProviderMeta, bl as ResolveEventsParamsInput, bL as SIDE, ap as SettlementSource, a$ as SignalTag, bT as SignedOrder, bm as TagSlugSelection, ay as TradeType, bG as USDC_ADDRESS, aR as UnsignedTx, b2 as WsChannel, b3 as WsChannelEvent, b4 as WsClientMessage, ba as WsErrorCode, bb as WsErrorMessage, b6 as WsPingMessage, b8 as WsPongMessage, b7 as WsServerMessage, b5 as WsSubscribeMessage, b9 as WsSubscribedMessage, bw as buildClobAuthMessage, bO as buildClobPayload, bI as buildCtfExchangeDomain, bM as buildOrderMessage, by as buildPolymarketL2Headers, bN as buildSignedOrder, aj as createPredictClient, al as createPredictWsClient, bz as derivePolymarketApiKey, bf as eventQueryKey, bg as fetchEvent, bk as fetchEventsPage, bo as fetchMarket, bt as fetchMatchMarketsPage, br as fetchMatchesPage, bP as getPolymarketSharesPrecision, bx as hmacSha256Base64, bj as infiniteEventsQueryKey, bn as marketQueryKey, bs as matchMarketsQueryKey, bq as matchQueryKey, bp as matchesQueryKey, bi as resolveEventsParams, bh as resolveTagSlug } from './server-BW_QhQos.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';
|
|
@@ -414,6 +414,29 @@ declare function usePositions(params: UsePositionsParams, queryOptions?: Omit<Us
|
|
|
414
414
|
*/
|
|
415
415
|
declare function usePositionsMulti(params: UsePositionsMultiParams, queryOptions?: Omit<UseQueryOptions<PositionsResponse, Error, PositionsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionsResponse, Error>;
|
|
416
416
|
|
|
417
|
+
declare function positionValueQueryKey(user: string, source?: ProviderSource): unknown[];
|
|
418
|
+
declare function positionValueMultiQueryKey(wallets: {
|
|
419
|
+
kalshi_user?: string;
|
|
420
|
+
polymarket_user?: string;
|
|
421
|
+
}): unknown[];
|
|
422
|
+
/** Single-source params (backward-compatible). */
|
|
423
|
+
interface UsePositionValueParams {
|
|
424
|
+
/** Provider source. Omit to aggregate all providers (same address). */
|
|
425
|
+
source?: ProviderSource;
|
|
426
|
+
user: string;
|
|
427
|
+
}
|
|
428
|
+
/** Multi-wallet params — each provider gets its own address. */
|
|
429
|
+
interface UsePositionValueMultiParams {
|
|
430
|
+
kalshi_user?: string;
|
|
431
|
+
polymarket_user?: string;
|
|
432
|
+
}
|
|
433
|
+
declare function usePositionValue(params: UsePositionValueParams, queryOptions?: Omit<UseQueryOptions<PositionValueResponse, Error, PositionValueResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionValueResponse, Error>;
|
|
434
|
+
/**
|
|
435
|
+
* Fetch current total position value for multiple wallets in a single request.
|
|
436
|
+
* Each provider is queried with its own address.
|
|
437
|
+
*/
|
|
438
|
+
declare function usePositionValueMulti(params: UsePositionValueMultiParams, queryOptions?: Omit<UseQueryOptions<PositionValueResponse, Error, PositionValueResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionValueResponse, Error>;
|
|
439
|
+
|
|
417
440
|
interface UseAvailableSharesParams {
|
|
418
441
|
source: ProviderSource;
|
|
419
442
|
user: string;
|
|
@@ -1142,4 +1165,4 @@ interface WalkOrderbookParams {
|
|
|
1142
1165
|
*/
|
|
1143
1166
|
declare function walkOrderbook({ orderbook, outcome, side, sharesNeeded, slippageBps, }: WalkOrderbookParams): WalkResult;
|
|
1144
1167
|
|
|
1145
|
-
export { AvailableSharesResponse, BalanceResponse, type BuildV2OrderParams, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, type ClobOrderV2Payload, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListCommentsParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, OrderbookOutcome, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketDepositWalletDeployResponse, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, PolymarketSetupStatus, type PolymarketSigner, PolymarketSupportedAsset, PolymarketTypedData, PolymarketWithdrawBridgeStatusResponse, PolymarketWithdrawPrepareRequest, PolymarketWithdrawPrepareResponse, PolymarketWithdrawQuoteRequest, PolymarketWithdrawQuoteResponse, PolymarketWithdrawRelayBuildRequest, PolymarketWithdrawRelayBuildResponse, PolymarketWithdrawRelaySubmitRequest, PolymarketWithdrawRelaySubmitResponse, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, RebateConfig, type RedeemPositionVariables, SimilarEventsParams, type StartTradeResultConfirmationInput, type SyncBalanceAllowanceParams, TickSizeResponse, type TradeResultConfirmationState, type TradeResultExpectation, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteCommentsParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesMultiParams, 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, type WalkOrderbookParams, type WalkOutcome, type WalkResult, type WalkSide, type WalkStatus, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, buildSignedV2OrderPayload, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, polymarketWithdrawStatusQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, updatePolymarketBalanceAllowance, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useDeployPolymarketDepositWallet, useEvent, useEventStats, useEvents, useFeeRate, useInfiniteComments, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketSupportedAssets, usePolymarketWithdraw, usePolymarketWithdrawPrepareMutation, usePolymarketWithdrawQuoteMutation, usePolymarketWithdrawRelayBuildMutation, usePolymarketWithdrawRelaySubmitMutation, usePolymarketWithdrawStatusQuery, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTradeResultConfirmation, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
|
|
1168
|
+
export { AvailableSharesResponse, BalanceResponse, type BuildV2OrderParams, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, type ClobOrderV2Payload, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListCommentsParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, OrderbookOutcome, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketDepositWalletDeployResponse, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, PolymarketSetupStatus, type PolymarketSigner, PolymarketSupportedAsset, PolymarketTypedData, PolymarketWithdrawBridgeStatusResponse, PolymarketWithdrawPrepareRequest, PolymarketWithdrawPrepareResponse, PolymarketWithdrawQuoteRequest, PolymarketWithdrawQuoteResponse, PolymarketWithdrawRelayBuildRequest, PolymarketWithdrawRelayBuildResponse, PolymarketWithdrawRelaySubmitRequest, PolymarketWithdrawRelaySubmitResponse, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionValueResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, RebateConfig, type RedeemPositionVariables, SimilarEventsParams, type StartTradeResultConfirmationInput, type SyncBalanceAllowanceParams, TickSizeResponse, type TradeResultConfirmationState, type TradeResultExpectation, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteCommentsParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesMultiParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersMultiOptions, type UseOrdersOptions, type UsePositionValueMultiParams, type UsePositionValueParams, 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, type WalkOrderbookParams, type WalkOutcome, type WalkResult, type WalkSide, type WalkStatus, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, buildSignedV2OrderPayload, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, polymarketWithdrawStatusQueryKey, positionValueMultiQueryKey, positionValueQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, updatePolymarketBalanceAllowance, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useDeployPolymarketDepositWallet, useEvent, useEventStats, useEvents, useFeeRate, useInfiniteComments, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketSupportedAssets, usePolymarketWithdraw, usePolymarketWithdrawPrepareMutation, usePolymarketWithdrawQuoteMutation, usePolymarketWithdrawRelayBuildMutation, usePolymarketWithdrawRelaySubmitMutation, usePolymarketWithdrawStatusQuery, usePositionValue, usePositionValueMulti, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTradeResultConfirmation, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
|
package/dist/index.js
CHANGED
|
@@ -176,6 +176,23 @@ var PredictClient = class {
|
|
|
176
176
|
const url = `${this.endpoint}/api/v1/positions${query}`;
|
|
177
177
|
return await utils.httpGet(url);
|
|
178
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Maps to `GET /api/v1/positions/value`.
|
|
181
|
+
*
|
|
182
|
+
* Single-source: `getPositionValue("addr", "polymarket")`.
|
|
183
|
+
* Multi-wallet: `getPositionValue({ kalshi_user: "SOLaddr", polymarket_user: "EVMaddr" })`.
|
|
184
|
+
* Legacy agg: `getPositionValue("addr")` (same address for all providers).
|
|
185
|
+
*/
|
|
186
|
+
async getPositionValue(userOrWallets, source) {
|
|
187
|
+
let query;
|
|
188
|
+
if (typeof userOrWallets === "string") {
|
|
189
|
+
query = buildQuery({ source, user: userOrWallets });
|
|
190
|
+
} else {
|
|
191
|
+
query = buildQuery(userOrWallets);
|
|
192
|
+
}
|
|
193
|
+
const url = `${this.endpoint}/api/v1/positions/value${query}`;
|
|
194
|
+
return await utils.httpGet(url);
|
|
195
|
+
}
|
|
179
196
|
// -------------------------------------------------------------------------
|
|
180
197
|
// Available shares (for sell flow)
|
|
181
198
|
// -------------------------------------------------------------------------
|
|
@@ -1468,6 +1485,41 @@ function usePositionsMulti(params, queryOptions = {}) {
|
|
|
1468
1485
|
...queryOptions
|
|
1469
1486
|
});
|
|
1470
1487
|
}
|
|
1488
|
+
function positionValueQueryKey(user, source) {
|
|
1489
|
+
return ["predict", "position-value", source ?? "all", user];
|
|
1490
|
+
}
|
|
1491
|
+
function positionValueMultiQueryKey(wallets) {
|
|
1492
|
+
return [
|
|
1493
|
+
"predict",
|
|
1494
|
+
"position-value",
|
|
1495
|
+
"multi",
|
|
1496
|
+
wallets.kalshi_user ?? "",
|
|
1497
|
+
wallets.polymarket_user ?? ""
|
|
1498
|
+
];
|
|
1499
|
+
}
|
|
1500
|
+
function usePositionValue(params, queryOptions = {}) {
|
|
1501
|
+
const client = usePredictClient();
|
|
1502
|
+
return reactQuery.useQuery({
|
|
1503
|
+
queryKey: positionValueQueryKey(params.user, params.source),
|
|
1504
|
+
queryFn: () => client.getPositionValue(params.user, params.source),
|
|
1505
|
+
enabled: Boolean(params.user),
|
|
1506
|
+
staleTime: 1e4,
|
|
1507
|
+
refetchInterval: 3e4,
|
|
1508
|
+
...queryOptions
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
function usePositionValueMulti(params, queryOptions = {}) {
|
|
1512
|
+
const client = usePredictClient();
|
|
1513
|
+
const hasAnyWallet = Boolean(params.kalshi_user || params.polymarket_user);
|
|
1514
|
+
return reactQuery.useQuery({
|
|
1515
|
+
queryKey: positionValueMultiQueryKey(params),
|
|
1516
|
+
queryFn: () => client.getPositionValue(params),
|
|
1517
|
+
enabled: hasAnyWallet,
|
|
1518
|
+
staleTime: 1e4,
|
|
1519
|
+
refetchInterval: 3e4,
|
|
1520
|
+
...queryOptions
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1471
1523
|
function availableSharesQueryKey(params) {
|
|
1472
1524
|
return [
|
|
1473
1525
|
"predict",
|
|
@@ -1603,7 +1655,8 @@ var SLOW_AFTER_MS = 12e3;
|
|
|
1603
1655
|
var QUERY_PREFIXES = [
|
|
1604
1656
|
["predict", "trades"],
|
|
1605
1657
|
["predict", "trades-by-wallet"],
|
|
1606
|
-
["predict", "available-shares"]
|
|
1658
|
+
["predict", "available-shares"],
|
|
1659
|
+
["predict", "position-value"]
|
|
1607
1660
|
];
|
|
1608
1661
|
var OPEN_ORDER_STATUSES = /* @__PURE__ */ new Set(["live", "open", "submitted", "pending"]);
|
|
1609
1662
|
function getPositionsWallets(input) {
|
|
@@ -1886,6 +1939,29 @@ function requestPositionsSnapshot(queryClient, predictClient, input) {
|
|
|
1886
1939
|
return normalizePositionsData(data, input);
|
|
1887
1940
|
});
|
|
1888
1941
|
}
|
|
1942
|
+
function refreshPositionValueSnapshot(queryClient, predictClient, input) {
|
|
1943
|
+
const wallets = getPositionsWallets(input);
|
|
1944
|
+
const tasks = [];
|
|
1945
|
+
if (wallets) {
|
|
1946
|
+
tasks.push(
|
|
1947
|
+
predictClient.getPositionValue(wallets).then((data) => {
|
|
1948
|
+
queryClient.setQueryData(positionValueMultiQueryKey(wallets), data);
|
|
1949
|
+
})
|
|
1950
|
+
);
|
|
1951
|
+
}
|
|
1952
|
+
if (input.user) {
|
|
1953
|
+
tasks.push(
|
|
1954
|
+
predictClient.getPositionValue(input.user, input.source).then((data) => {
|
|
1955
|
+
queryClient.setQueryData(
|
|
1956
|
+
positionValueQueryKey(input.user, input.source),
|
|
1957
|
+
data
|
|
1958
|
+
);
|
|
1959
|
+
})
|
|
1960
|
+
);
|
|
1961
|
+
}
|
|
1962
|
+
if (tasks.length === 0) return Promise.resolve();
|
|
1963
|
+
return Promise.all(tasks).then(() => void 0);
|
|
1964
|
+
}
|
|
1889
1965
|
function requestOrdersSnapshot(queryClient, predictClient, input) {
|
|
1890
1966
|
if (!input.user) return Promise.resolve(void 0);
|
|
1891
1967
|
const params = { source: input.source, wallet_address: input.user };
|
|
@@ -1976,7 +2052,11 @@ async function runFixedIntervalConfirmation({
|
|
|
1976
2052
|
const pollField = (field, request) => {
|
|
1977
2053
|
if (inFlight[field] || settled) return;
|
|
1978
2054
|
inFlight[field] = true;
|
|
1979
|
-
void request().then((value) => handleSnapshot(field, value)).
|
|
2055
|
+
void request().then((value) => handleSnapshot(field, value)).then(() => {
|
|
2056
|
+
if (field === "positions") {
|
|
2057
|
+
void refreshPositionValueSnapshot(queryClient, predictClient, input);
|
|
2058
|
+
}
|
|
2059
|
+
}).catch(() => void 0).finally(() => {
|
|
1980
2060
|
inFlight[field] = false;
|
|
1981
2061
|
});
|
|
1982
2062
|
};
|
|
@@ -3259,6 +3339,8 @@ exports.polymarketDepositAddressesQueryKey = polymarketDepositAddressesQueryKey;
|
|
|
3259
3339
|
exports.polymarketSetupQueryKey = polymarketSetupQueryKey;
|
|
3260
3340
|
exports.polymarketSupportedAssetsQueryKey = polymarketSupportedAssetsQueryKey;
|
|
3261
3341
|
exports.polymarketWithdrawStatusQueryKey = polymarketWithdrawStatusQueryKey;
|
|
3342
|
+
exports.positionValueMultiQueryKey = positionValueMultiQueryKey;
|
|
3343
|
+
exports.positionValueQueryKey = positionValueQueryKey;
|
|
3262
3344
|
exports.positionsMultiQueryKey = positionsMultiQueryKey;
|
|
3263
3345
|
exports.positionsQueryKey = positionsQueryKey;
|
|
3264
3346
|
exports.priceHistoryQueryKey = priceHistoryQueryKey;
|
|
@@ -3309,6 +3391,8 @@ exports.usePolymarketWithdrawQuoteMutation = usePolymarketWithdrawQuoteMutation;
|
|
|
3309
3391
|
exports.usePolymarketWithdrawRelayBuildMutation = usePolymarketWithdrawRelayBuildMutation;
|
|
3310
3392
|
exports.usePolymarketWithdrawRelaySubmitMutation = usePolymarketWithdrawRelaySubmitMutation;
|
|
3311
3393
|
exports.usePolymarketWithdrawStatusQuery = usePolymarketWithdrawStatusQuery;
|
|
3394
|
+
exports.usePositionValue = usePositionValue;
|
|
3395
|
+
exports.usePositionValueMulti = usePositionValueMulti;
|
|
3312
3396
|
exports.usePositions = usePositions;
|
|
3313
3397
|
exports.usePositionsMulti = usePositionsMulti;
|
|
3314
3398
|
exports.usePredictClient = usePredictClient;
|