@liberfi.io/react-predict 0.3.64 → 0.3.65
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 +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -9
- package/dist/index.mjs.map +1 -1
- package/dist/{server-Dk8PqvnI.d.mts → server-pS5Vlydo.d.mts} +10 -3
- package/dist/{server-Dk8PqvnI.d.ts → server-pS5Vlydo.d.ts} +10 -3
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +6 -6
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +6 -6
- 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, 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-
|
|
2
|
-
export { bE as BuildClobAuthMessageInput, bT as BuildOrderMessageInput, bv as CLOB_AUTH_DOMAIN, bw as CLOB_AUTH_TYPES, bF as CTF_EXCHANGE_ADDRESS, bK as CTF_ORDER_TYPES, bS as ClobOrderPayload, aI as DFlowOrderContext, aN as DepositBuildRequest, aO as DepositBuildResponse, aR as DepositStatusResponse, aP as DepositSubmitRequest, aQ as DepositSubmitResponse, az as EventSummary, bB as HttpMethod, as as MarketOutcome, ar as MarketResult, aq as MarketStatus, aA as MarketSummary, a$ as MatchConfidenceTier, aX as MatchGroupEntry, aY as MatchGroupMarket, b1 as MatchLeg, b2 as MatchMarketFlat, aZ as MatchSortField, aW as MatchStatus, a_ as MatchesStats, bG as NEG_RISK_CTF_EXCHANGE_ADDRESS, bL as ORDER_TYPE, bU as OrderMessage, aH as OrderSide, aG as OrderStatus, au as OrderbookBatchItem, av as OrderbookBatchResult, at as OrderbookLevel, aw as OrderbooksBatchRequest, ax as OrderbooksBatchResponse, bI as POLYGON_CHAIN_ID, aT as PolymarketBridgeToken, aM as PolymarketDepositWalletDeployRequest, bD as PolymarketL2Headers, bC as PolymarketL2HeadersInput, aJ as PolymarketOrderType, bf as PolymarketRedeemInput, bd as PolymarketRedeemPrepareInput, be as PolymarketRedeemPrepareResponse, aU as PolymarketSupportedAssetsResponse, aK as PolymarketTickSize, aV as PolymarketTypedDataArg, aL 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, bm as ResolveEventsParamsInput, bM as SIDE, ap as SettlementSource, b0 as SignalTag, bV as SignedOrder, bn as TagSlugSelection, ay as TradeType, bH as USDC_ADDRESS, aS as UnsignedTx, b3 as WsChannel, b4 as WsChannelEvent, b5 as WsClientMessage, bb as WsErrorCode, bc as WsErrorMessage, b7 as WsPingMessage, b9 as WsPongMessage, b8 as WsServerMessage, b6 as WsSubscribeMessage, ba as WsSubscribedMessage, bx as buildClobAuthMessage, bP as buildClobPayload, bJ as buildCtfExchangeDomain, bN as buildOrderMessage, bz as buildPolymarketL2Headers, bO as buildSignedOrder, aj as createPredictClient, al as createPredictWsClient, bA as derivePolymarketApiKey, bg as eventQueryKey, bh as fetchEvent, bl as fetchEventsPage, bp as fetchMarket, bu as fetchMatchMarketsPage, bs as fetchMatchesPage, bQ as getPolymarketSharesPrecision, by as hmacSha256Base64, bk as infiniteEventsQueryKey, bo as marketQueryKey, bt as matchMarketsQueryKey, br as matchQueryKey, bq as matchesQueryKey, bR as normalizePolymarketTickSize, bj as resolveEventsParams, bi as resolveTagSlug } from './server-
|
|
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-pS5Vlydo.mjs';
|
|
2
|
+
export { bE as BuildClobAuthMessageInput, bT as BuildOrderMessageInput, bv as CLOB_AUTH_DOMAIN, bw as CLOB_AUTH_TYPES, bF as CTF_EXCHANGE_ADDRESS, bK as CTF_ORDER_TYPES, bS as ClobOrderPayload, aI as DFlowOrderContext, aN as DepositBuildRequest, aO as DepositBuildResponse, aR as DepositStatusResponse, aP as DepositSubmitRequest, aQ as DepositSubmitResponse, az as EventSummary, bB as HttpMethod, as as MarketOutcome, ar as MarketResult, aq as MarketStatus, aA as MarketSummary, a$ as MatchConfidenceTier, aX as MatchGroupEntry, aY as MatchGroupMarket, b1 as MatchLeg, b2 as MatchMarketFlat, aZ as MatchSortField, aW as MatchStatus, a_ as MatchesStats, bG as NEG_RISK_CTF_EXCHANGE_ADDRESS, bL as ORDER_TYPE, bU as OrderMessage, aH as OrderSide, aG as OrderStatus, au as OrderbookBatchItem, av as OrderbookBatchResult, at as OrderbookLevel, aw as OrderbooksBatchRequest, ax as OrderbooksBatchResponse, bI as POLYGON_CHAIN_ID, aT as PolymarketBridgeToken, aM as PolymarketDepositWalletDeployRequest, bD as PolymarketL2Headers, bC as PolymarketL2HeadersInput, aJ as PolymarketOrderType, bf as PolymarketRedeemInput, bd as PolymarketRedeemPrepareInput, be as PolymarketRedeemPrepareResponse, aU as PolymarketSupportedAssetsResponse, aK as PolymarketTickSize, aV as PolymarketTypedDataArg, aL 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, bm as ResolveEventsParamsInput, bM as SIDE, ap as SettlementSource, b0 as SignalTag, bV as SignedOrder, bn as TagSlugSelection, ay as TradeType, bH as USDC_ADDRESS, aS as UnsignedTx, b3 as WsChannel, b4 as WsChannelEvent, b5 as WsClientMessage, bb as WsErrorCode, bc as WsErrorMessage, b7 as WsPingMessage, b9 as WsPongMessage, b8 as WsServerMessage, b6 as WsSubscribeMessage, ba as WsSubscribedMessage, bx as buildClobAuthMessage, bP as buildClobPayload, bJ as buildCtfExchangeDomain, bN as buildOrderMessage, bz as buildPolymarketL2Headers, bO as buildSignedOrder, aj as createPredictClient, al as createPredictWsClient, bA as derivePolymarketApiKey, bg as eventQueryKey, bh as fetchEvent, bl as fetchEventsPage, bp as fetchMarket, bu as fetchMatchMarketsPage, bs as fetchMatchesPage, bQ as getPolymarketSharesPrecision, by as hmacSha256Base64, bk as infiniteEventsQueryKey, bo as marketQueryKey, bt as matchMarketsQueryKey, br as matchQueryKey, bq as matchesQueryKey, bR as normalizePolymarketTickSize, bj as resolveEventsParams, bi as resolveTagSlug } from './server-pS5Vlydo.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';
|
|
@@ -213,6 +213,8 @@ interface UseEventParams {
|
|
|
213
213
|
slug: string;
|
|
214
214
|
/** Upstream provider. Required by prediction-server for single-event fetch. */
|
|
215
215
|
source?: ProviderSource;
|
|
216
|
+
/** Resolved UI language for localized event payloads. */
|
|
217
|
+
lang?: string;
|
|
216
218
|
}
|
|
217
219
|
/**
|
|
218
220
|
* React Query hook for `GET /api/v1/events/:slug` via the prediction-server client.
|
|
@@ -290,6 +292,8 @@ interface UseSimilarEventsParams {
|
|
|
290
292
|
source: ProviderSource;
|
|
291
293
|
limit?: number;
|
|
292
294
|
same_source?: boolean;
|
|
295
|
+
/** Resolved UI language for localized event payloads. */
|
|
296
|
+
lang?: string;
|
|
293
297
|
}
|
|
294
298
|
declare function useSimilarEvents(params: UseSimilarEventsParams, queryOptions?: Omit<UseQueryOptions<PredictEvent[], Error, PredictEvent[], unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictEvent[], Error>;
|
|
295
299
|
|
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, 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-
|
|
2
|
-
export { bE as BuildClobAuthMessageInput, bT as BuildOrderMessageInput, bv as CLOB_AUTH_DOMAIN, bw as CLOB_AUTH_TYPES, bF as CTF_EXCHANGE_ADDRESS, bK as CTF_ORDER_TYPES, bS as ClobOrderPayload, aI as DFlowOrderContext, aN as DepositBuildRequest, aO as DepositBuildResponse, aR as DepositStatusResponse, aP as DepositSubmitRequest, aQ as DepositSubmitResponse, az as EventSummary, bB as HttpMethod, as as MarketOutcome, ar as MarketResult, aq as MarketStatus, aA as MarketSummary, a$ as MatchConfidenceTier, aX as MatchGroupEntry, aY as MatchGroupMarket, b1 as MatchLeg, b2 as MatchMarketFlat, aZ as MatchSortField, aW as MatchStatus, a_ as MatchesStats, bG as NEG_RISK_CTF_EXCHANGE_ADDRESS, bL as ORDER_TYPE, bU as OrderMessage, aH as OrderSide, aG as OrderStatus, au as OrderbookBatchItem, av as OrderbookBatchResult, at as OrderbookLevel, aw as OrderbooksBatchRequest, ax as OrderbooksBatchResponse, bI as POLYGON_CHAIN_ID, aT as PolymarketBridgeToken, aM as PolymarketDepositWalletDeployRequest, bD as PolymarketL2Headers, bC as PolymarketL2HeadersInput, aJ as PolymarketOrderType, bf as PolymarketRedeemInput, bd as PolymarketRedeemPrepareInput, be as PolymarketRedeemPrepareResponse, aU as PolymarketSupportedAssetsResponse, aK as PolymarketTickSize, aV as PolymarketTypedDataArg, aL 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, bm as ResolveEventsParamsInput, bM as SIDE, ap as SettlementSource, b0 as SignalTag, bV as SignedOrder, bn as TagSlugSelection, ay as TradeType, bH as USDC_ADDRESS, aS as UnsignedTx, b3 as WsChannel, b4 as WsChannelEvent, b5 as WsClientMessage, bb as WsErrorCode, bc as WsErrorMessage, b7 as WsPingMessage, b9 as WsPongMessage, b8 as WsServerMessage, b6 as WsSubscribeMessage, ba as WsSubscribedMessage, bx as buildClobAuthMessage, bP as buildClobPayload, bJ as buildCtfExchangeDomain, bN as buildOrderMessage, bz as buildPolymarketL2Headers, bO as buildSignedOrder, aj as createPredictClient, al as createPredictWsClient, bA as derivePolymarketApiKey, bg as eventQueryKey, bh as fetchEvent, bl as fetchEventsPage, bp as fetchMarket, bu as fetchMatchMarketsPage, bs as fetchMatchesPage, bQ as getPolymarketSharesPrecision, by as hmacSha256Base64, bk as infiniteEventsQueryKey, bo as marketQueryKey, bt as matchMarketsQueryKey, br as matchQueryKey, bq as matchesQueryKey, bR as normalizePolymarketTickSize, bj as resolveEventsParams, bi as resolveTagSlug } from './server-
|
|
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-pS5Vlydo.js';
|
|
2
|
+
export { bE as BuildClobAuthMessageInput, bT as BuildOrderMessageInput, bv as CLOB_AUTH_DOMAIN, bw as CLOB_AUTH_TYPES, bF as CTF_EXCHANGE_ADDRESS, bK as CTF_ORDER_TYPES, bS as ClobOrderPayload, aI as DFlowOrderContext, aN as DepositBuildRequest, aO as DepositBuildResponse, aR as DepositStatusResponse, aP as DepositSubmitRequest, aQ as DepositSubmitResponse, az as EventSummary, bB as HttpMethod, as as MarketOutcome, ar as MarketResult, aq as MarketStatus, aA as MarketSummary, a$ as MatchConfidenceTier, aX as MatchGroupEntry, aY as MatchGroupMarket, b1 as MatchLeg, b2 as MatchMarketFlat, aZ as MatchSortField, aW as MatchStatus, a_ as MatchesStats, bG as NEG_RISK_CTF_EXCHANGE_ADDRESS, bL as ORDER_TYPE, bU as OrderMessage, aH as OrderSide, aG as OrderStatus, au as OrderbookBatchItem, av as OrderbookBatchResult, at as OrderbookLevel, aw as OrderbooksBatchRequest, ax as OrderbooksBatchResponse, bI as POLYGON_CHAIN_ID, aT as PolymarketBridgeToken, aM as PolymarketDepositWalletDeployRequest, bD as PolymarketL2Headers, bC as PolymarketL2HeadersInput, aJ as PolymarketOrderType, bf as PolymarketRedeemInput, bd as PolymarketRedeemPrepareInput, be as PolymarketRedeemPrepareResponse, aU as PolymarketSupportedAssetsResponse, aK as PolymarketTickSize, aV as PolymarketTypedDataArg, aL 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, bm as ResolveEventsParamsInput, bM as SIDE, ap as SettlementSource, b0 as SignalTag, bV as SignedOrder, bn as TagSlugSelection, ay as TradeType, bH as USDC_ADDRESS, aS as UnsignedTx, b3 as WsChannel, b4 as WsChannelEvent, b5 as WsClientMessage, bb as WsErrorCode, bc as WsErrorMessage, b7 as WsPingMessage, b9 as WsPongMessage, b8 as WsServerMessage, b6 as WsSubscribeMessage, ba as WsSubscribedMessage, bx as buildClobAuthMessage, bP as buildClobPayload, bJ as buildCtfExchangeDomain, bN as buildOrderMessage, bz as buildPolymarketL2Headers, bO as buildSignedOrder, aj as createPredictClient, al as createPredictWsClient, bA as derivePolymarketApiKey, bg as eventQueryKey, bh as fetchEvent, bl as fetchEventsPage, bp as fetchMarket, bu as fetchMatchMarketsPage, bs as fetchMatchesPage, bQ as getPolymarketSharesPrecision, by as hmacSha256Base64, bk as infiniteEventsQueryKey, bo as marketQueryKey, bt as matchMarketsQueryKey, br as matchQueryKey, bq as matchesQueryKey, bR as normalizePolymarketTickSize, bj as resolveEventsParams, bi as resolveTagSlug } from './server-pS5Vlydo.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';
|
|
@@ -213,6 +213,8 @@ interface UseEventParams {
|
|
|
213
213
|
slug: string;
|
|
214
214
|
/** Upstream provider. Required by prediction-server for single-event fetch. */
|
|
215
215
|
source?: ProviderSource;
|
|
216
|
+
/** Resolved UI language for localized event payloads. */
|
|
217
|
+
lang?: string;
|
|
216
218
|
}
|
|
217
219
|
/**
|
|
218
220
|
* React Query hook for `GET /api/v1/events/:slug` via the prediction-server client.
|
|
@@ -290,6 +292,8 @@ interface UseSimilarEventsParams {
|
|
|
290
292
|
source: ProviderSource;
|
|
291
293
|
limit?: number;
|
|
292
294
|
same_source?: boolean;
|
|
295
|
+
/** Resolved UI language for localized event payloads. */
|
|
296
|
+
lang?: string;
|
|
293
297
|
}
|
|
294
298
|
declare function useSimilarEvents(params: UseSimilarEventsParams, queryOptions?: Omit<UseQueryOptions<PredictEvent[], Error, PredictEvent[], unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictEvent[], Error>;
|
|
295
299
|
|
package/dist/index.js
CHANGED
|
@@ -60,8 +60,8 @@ var PredictClient = class {
|
|
|
60
60
|
* @returns The matching event.
|
|
61
61
|
* @throws When the server responds with 404 or any other non-2xx status.
|
|
62
62
|
*/
|
|
63
|
-
async getEvent(slug, source) {
|
|
64
|
-
const query =
|
|
63
|
+
async getEvent(slug, source, params) {
|
|
64
|
+
const query = buildQuery({ source, ...params });
|
|
65
65
|
const url = `${this.endpoint}/api/v1/events/${encodeURIComponent(slug)}${query}`;
|
|
66
66
|
return await utils.httpGet(url, this.requestOptions());
|
|
67
67
|
}
|
|
@@ -1204,19 +1204,19 @@ function infiniteEventsQueryKey(params) {
|
|
|
1204
1204
|
async function fetchEventsPage(client, params) {
|
|
1205
1205
|
return client.listEvents(params);
|
|
1206
1206
|
}
|
|
1207
|
-
function eventQueryKey(slug, source) {
|
|
1208
|
-
return ["predict", "event", slug, source];
|
|
1207
|
+
function eventQueryKey(slug, source, lang) {
|
|
1208
|
+
return ["predict", "event", slug, source, lang];
|
|
1209
1209
|
}
|
|
1210
|
-
async function fetchEvent(client, slug, source) {
|
|
1211
|
-
return client.getEvent(slug, source);
|
|
1210
|
+
async function fetchEvent(client, slug, source, lang) {
|
|
1211
|
+
return client.getEvent(slug, source, { lang });
|
|
1212
1212
|
}
|
|
1213
1213
|
|
|
1214
1214
|
// src/hooks/predict/useEvent.ts
|
|
1215
1215
|
function useEvent(params, queryOptions = {}) {
|
|
1216
1216
|
const client = usePredictClient();
|
|
1217
1217
|
return reactQuery.useQuery({
|
|
1218
|
-
queryKey: eventQueryKey(params.slug, params.source),
|
|
1219
|
-
queryFn: () => fetchEvent(client, params.slug, params.source),
|
|
1218
|
+
queryKey: eventQueryKey(params.slug, params.source, params.lang),
|
|
1219
|
+
queryFn: () => fetchEvent(client, params.slug, params.source, params.lang),
|
|
1220
1220
|
enabled: Boolean(params.slug),
|
|
1221
1221
|
...queryOptions
|
|
1222
1222
|
});
|
|
@@ -1289,7 +1289,8 @@ function useSimilarEvents(params, queryOptions = {}) {
|
|
|
1289
1289
|
const client = usePredictClient();
|
|
1290
1290
|
const apiParams = {
|
|
1291
1291
|
limit: params.limit,
|
|
1292
|
-
same_source: params.same_source
|
|
1292
|
+
same_source: params.same_source,
|
|
1293
|
+
lang: params.lang
|
|
1293
1294
|
};
|
|
1294
1295
|
return reactQuery.useQuery({
|
|
1295
1296
|
queryKey: similarEventsQueryKey(params.slug, params.source, apiParams),
|