@liberfi.io/react-predict 0.3.45 → 0.3.47

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.
@@ -167,6 +167,35 @@ interface Orderbook {
167
167
  /** best_ask − best_bid; absent when either side is empty. */
168
168
  spread?: number;
169
169
  }
170
+ /** One market to fetch in a batch order book request. */
171
+ interface OrderbookBatchItem {
172
+ slug: string;
173
+ source: ProviderSource;
174
+ /** Outcome side; defaults to `"yes"`. */
175
+ outcome?: OrderbookOutcome;
176
+ }
177
+ /** Request body for `POST /api/v1/markets/orderbooks`. */
178
+ interface OrderbooksBatchRequest {
179
+ /** Up to 100 markets to fetch in one call. */
180
+ items: OrderbookBatchItem[];
181
+ }
182
+ /**
183
+ * One result of a batch order book response, aligned with the request order.
184
+ * `orderbook` is `null` when the item failed (see `error`); per-item failures
185
+ * never fail the whole batch.
186
+ */
187
+ interface OrderbookBatchResult {
188
+ slug: string;
189
+ source: ProviderSource;
190
+ outcome: OrderbookOutcome;
191
+ orderbook: Orderbook | null;
192
+ /** Present only when this item failed. */
193
+ error?: string;
194
+ }
195
+ /** Response from `POST /api/v1/markets/orderbooks`. */
196
+ interface OrderbooksBatchResponse {
197
+ results: OrderbookBatchResult[];
198
+ }
170
199
  /** On-chain trade type. */
171
200
  type TradeType = "TRADE" | "SPLIT" | "MERGE" | "REDEEM" | "REWARD" | "CONVERSION" | "MAKER_REBATE" | "REFERRAL_REWARD";
172
201
  /** Lightweight event summary embedded in a trade. */
@@ -1161,6 +1190,13 @@ declare class PredictClient {
1161
1190
  getMarket(slug: string, source?: ProviderSource): Promise<PredictMarket>;
1162
1191
  /** Maps to `GET /api/v1/markets/:slug/orderbook?source=...&outcome=...`. */
1163
1192
  getOrderbook(slug: string, source: ProviderSource, outcome?: OrderbookOutcome): Promise<Orderbook>;
1193
+ /**
1194
+ * Maps to `POST /api/v1/markets/orderbooks`.
1195
+ * Fetches order books for many markets in a single request (max 100 items).
1196
+ * Results are returned in the same order as `items`; per-item failures are
1197
+ * reported via `OrderbookBatchResult.error` and never fail the whole batch.
1198
+ */
1199
+ getOrderbooks(items: OrderbookBatchItem[]): Promise<OrderbookBatchResult[]>;
1164
1200
  /** Maps to `GET /api/v1/markets/:slug/trades?source=...`. */
1165
1201
  listMarketTrades(slug: string, params: ListMarketTradesParams): Promise<PredictPage<PredictTrade>>;
1166
1202
  /** Maps to `GET /api/v1/markets/:slug/price-history?source=...&range=...`. */
@@ -1958,4 +1994,4 @@ declare function buildClobPayload(signedOrder: SignedOrder, owner: string): Clob
1958
1994
  */
1959
1995
  declare function getPolymarketSharesPrecision(tickSize: string): number;
1960
1996
 
1961
- export { type PolymarketWithdrawPrepareRequest as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type ListTradesMultiParams as D, type EventStats as E, type DFlowQuoteRequest as F, type DFlowQuoteResponse as G, type DFlowSubmitResponse as H, type DFlowSubmitRequest as I, type DFlowKYCStatus as J, type PolymarketSetupStatus as K, type ListEventsParams as L, type MatchesParams as M, type PolymarketDepositWalletDeployResponse as N, type OrderbookOutcome as O, PredictClient as P, type WithdrawBuildRequest as Q, type WithdrawSubmitResponse as R, type SimilarEventsParams as S, type WithdrawSubmitRequest as T, type WithdrawStatusResponse as U, type PolymarketDepositAddresses as V, type WithdrawBuildResponse as W, type PolymarketSupportedAsset as X, type PolymarketWithdrawResponse as Y, type PolymarketWithdrawRequest as Z, type PolymarketWithdrawPrepareResponse as _, PredictWsClient as a, type WsServerMessage as a$, type PolymarketWithdrawQuoteResponse as a0, type PolymarketWithdrawQuoteRequest as a1, type PolymarketWithdrawRelayBuildResponse as a2, type PolymarketWithdrawRelayBuildRequest as a3, type PolymarketWithdrawRelaySubmitResponse as a4, type PolymarketWithdrawRelaySubmitRequest as a5, type PolymarketWithdrawBridgeStatusResponse as a6, type PolymarketRedeemResponse as a7, type TickSizeResponse as a8, type FeeRateResponse as a9, type PolymarketOrderType as aA, type PolymarketWalletKind as aB, type PolymarketDepositWalletDeployRequest as aC, type DepositBuildRequest as aD, type DepositBuildResponse as aE, type DepositSubmitRequest as aF, type DepositSubmitResponse as aG, type DepositStatusResponse as aH, type UnsignedTx as aI, type PolymarketBridgeToken as aJ, type PolymarketSupportedAssetsResponse as aK, type PolymarketTypedData as aL, type PolymarketTypedDataArg as aM, type MatchStatus as aN, type MatchGroupEntry as aO, type MatchGroupMarket as aP, type MatchSortField as aQ, type MatchesStats as aR, type MatchConfidenceTier as aS, type SignalTag as aT, type MatchLeg as aU, type MatchMarketFlat as aV, type WsChannel as aW, type WsChannelEvent as aX, type WsClientMessage as aY, type WsSubscribeMessage as aZ, type WsPingMessage as a_, type RebateConfig as aa, type WsConnectionStatus as ab, type WsDataMessage as ac, type WsPriceEvent as ad, type WsOrderbookEvent as ae, type WsTradeEvent as af, type CreateOrderInput as ag, createPredictClient as ah, createPredictWsClient as ai, type PredictWsClientConfig as aj, type ProviderMeta as ak, type PredictTag as al, type SettlementSource as am, type MarketStatus as an, type MarketResult as ao, type MarketOutcome as ap, type OrderbookLevel as aq, type TradeType as ar, type EventSummary as as, type MarketSummary as at, type PredictCommentProfile as au, type PricePoint as av, type PredictPosition as aw, type OrderStatus as ax, type OrderSide as ay, type DFlowOrderContext as az, type PredictPage as b, type WsPongMessage as b0, type WsSubscribedMessage as b1, type WsErrorCode as b2, type WsErrorMessage as b3, type PolymarketRedeemPrepareInput as b4, type PolymarketRedeemPrepareResponse as b5, type PolymarketRedeemInput as b6, eventQueryKey as b7, fetchEvent as b8, resolveTagSlug as b9, buildCtfExchangeDomain as bA, CTF_ORDER_TYPES as bB, ORDER_TYPE as bC, SIDE as bD, buildOrderMessage as bE, buildSignedOrder as bF, buildClobPayload as bG, getPolymarketSharesPrecision as bH, type ClobOrderPayload as bI, type BuildOrderMessageInput as bJ, type OrderMessage as bK, type SignedOrder as bL, DEFAULT_PAGE_SIZE as bM, resolveEventsParams as ba, infiniteEventsQueryKey as bb, fetchEventsPage as bc, type ResolveEventsParamsInput as bd, type TagSlugSelection as be, marketQueryKey as bf, fetchMarket as bg, matchesQueryKey as bh, matchQueryKey as bi, fetchMatchesPage as bj, matchMarketsQueryKey as bk, fetchMatchMarketsPage as bl, CLOB_AUTH_DOMAIN as bm, CLOB_AUTH_TYPES as bn, buildClobAuthMessage as bo, hmacSha256Base64 as bp, buildPolymarketL2Headers as bq, derivePolymarketApiKey as br, type HttpMethod as bs, type PolymarketL2HeadersInput as bt, type PolymarketL2Headers as bu, type BuildClobAuthMessageInput as bv, CTF_EXCHANGE_ADDRESS as bw, NEG_RISK_CTF_EXCHANGE_ADDRESS as bx, USDC_ADDRESS as by, POLYGON_CHAIN_ID as bz, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type Orderbook as h, type ListMarketTradesParams as i, type PredictTrade as j, type PriceHistoryRange as k, type PriceHistoryResponse as l, type ListCandlesticksParams as m, type ListCommentsParams as n, type PredictComment as o, type PositionsResponse as p, type ListOrdersParams as q, type PredictOrder as r, type ListOrdersMultiParams as s, type PredictOrdersResponse as t, type CancelOrderResult as u, type MatchGroupPage as v, type MatchGroup as w, type MatchMarketParams as x, type MatchMarketPage as y, type ListTradesParams as z };
1997
+ export { type PolymarketWithdrawPrepareRequest as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type ListTradesMultiParams as D, type EventStats as E, type DFlowQuoteRequest as F, type DFlowQuoteResponse as G, type DFlowSubmitResponse as H, type DFlowSubmitRequest as I, type DFlowKYCStatus as J, type PolymarketSetupStatus as K, type ListEventsParams as L, type MatchesParams as M, type PolymarketDepositWalletDeployResponse as N, type OrderbookOutcome as O, PredictClient as P, type WithdrawBuildRequest as Q, type WithdrawSubmitResponse as R, type SimilarEventsParams as S, type WithdrawSubmitRequest as T, type WithdrawStatusResponse as U, type PolymarketDepositAddresses as V, type WithdrawBuildResponse as W, type PolymarketSupportedAsset as X, type PolymarketWithdrawResponse as Y, type PolymarketWithdrawRequest as Z, type PolymarketWithdrawPrepareResponse as _, PredictWsClient as a, type WsChannelEvent as a$, type PolymarketWithdrawQuoteResponse as a0, type PolymarketWithdrawQuoteRequest as a1, type PolymarketWithdrawRelayBuildResponse as a2, type PolymarketWithdrawRelayBuildRequest as a3, type PolymarketWithdrawRelaySubmitResponse as a4, type PolymarketWithdrawRelaySubmitRequest as a5, type PolymarketWithdrawBridgeStatusResponse as a6, type PolymarketRedeemResponse as a7, type TickSizeResponse as a8, type FeeRateResponse as a9, type PredictPosition as aA, type OrderStatus as aB, type OrderSide as aC, type DFlowOrderContext as aD, type PolymarketOrderType as aE, type PolymarketWalletKind as aF, type PolymarketDepositWalletDeployRequest as aG, type DepositBuildRequest as aH, type DepositBuildResponse as aI, type DepositSubmitRequest as aJ, type DepositSubmitResponse as aK, type DepositStatusResponse as aL, type UnsignedTx as aM, type PolymarketBridgeToken as aN, type PolymarketSupportedAssetsResponse as aO, type PolymarketTypedData as aP, type PolymarketTypedDataArg as aQ, type MatchStatus as aR, type MatchGroupEntry as aS, type MatchGroupMarket as aT, type MatchSortField as aU, type MatchesStats as aV, type MatchConfidenceTier as aW, type SignalTag as aX, type MatchLeg as aY, type MatchMarketFlat as aZ, type WsChannel as a_, type RebateConfig as aa, type WsConnectionStatus as ab, type WsDataMessage as ac, type WsPriceEvent as ad, type WsOrderbookEvent as ae, type WsTradeEvent as af, type CreateOrderInput as ag, createPredictClient as ah, createPredictWsClient as ai, type PredictWsClientConfig as aj, type ProviderMeta as ak, type PredictTag as al, type SettlementSource as am, type MarketStatus as an, type MarketResult as ao, type MarketOutcome as ap, type OrderbookLevel as aq, type OrderbookBatchItem as ar, type OrderbookBatchResult as as, type OrderbooksBatchRequest as at, type OrderbooksBatchResponse as au, type TradeType as av, type EventSummary as aw, type MarketSummary as ax, type PredictCommentProfile as ay, type PricePoint as az, type PredictPage as b, type WsClientMessage as b0, type WsSubscribeMessage as b1, type WsPingMessage as b2, type WsServerMessage as b3, type WsPongMessage as b4, type WsSubscribedMessage as b5, type WsErrorCode as b6, type WsErrorMessage as b7, type PolymarketRedeemPrepareInput as b8, type PolymarketRedeemPrepareResponse as b9, CTF_EXCHANGE_ADDRESS as bA, NEG_RISK_CTF_EXCHANGE_ADDRESS as bB, USDC_ADDRESS as bC, POLYGON_CHAIN_ID as bD, buildCtfExchangeDomain as bE, CTF_ORDER_TYPES as bF, ORDER_TYPE as bG, SIDE as bH, buildOrderMessage as bI, buildSignedOrder as bJ, buildClobPayload as bK, getPolymarketSharesPrecision as bL, type ClobOrderPayload as bM, type BuildOrderMessageInput as bN, type OrderMessage as bO, type SignedOrder as bP, DEFAULT_PAGE_SIZE as bQ, type PolymarketRedeemInput as ba, eventQueryKey as bb, fetchEvent as bc, resolveTagSlug as bd, resolveEventsParams as be, infiniteEventsQueryKey as bf, fetchEventsPage as bg, type ResolveEventsParamsInput as bh, type TagSlugSelection as bi, marketQueryKey as bj, fetchMarket as bk, matchesQueryKey as bl, matchQueryKey as bm, fetchMatchesPage as bn, matchMarketsQueryKey as bo, fetchMatchMarketsPage as bp, CLOB_AUTH_DOMAIN as bq, CLOB_AUTH_TYPES as br, buildClobAuthMessage as bs, hmacSha256Base64 as bt, buildPolymarketL2Headers as bu, derivePolymarketApiKey as bv, type HttpMethod as bw, type PolymarketL2HeadersInput as bx, type PolymarketL2Headers as by, type BuildClobAuthMessageInput as bz, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type Orderbook as h, type ListMarketTradesParams as i, type PredictTrade as j, type PriceHistoryRange as k, type PriceHistoryResponse as l, type ListCandlesticksParams as m, type ListCommentsParams as n, type PredictComment as o, type PositionsResponse as p, type ListOrdersParams as q, type PredictOrder as r, type ListOrdersMultiParams as s, type PredictOrdersResponse as t, type CancelOrderResult as u, type MatchGroupPage as v, type MatchGroup as w, type MatchMarketParams as x, type MatchMarketPage as y, type ListTradesParams as z };
@@ -167,6 +167,35 @@ interface Orderbook {
167
167
  /** best_ask − best_bid; absent when either side is empty. */
168
168
  spread?: number;
169
169
  }
170
+ /** One market to fetch in a batch order book request. */
171
+ interface OrderbookBatchItem {
172
+ slug: string;
173
+ source: ProviderSource;
174
+ /** Outcome side; defaults to `"yes"`. */
175
+ outcome?: OrderbookOutcome;
176
+ }
177
+ /** Request body for `POST /api/v1/markets/orderbooks`. */
178
+ interface OrderbooksBatchRequest {
179
+ /** Up to 100 markets to fetch in one call. */
180
+ items: OrderbookBatchItem[];
181
+ }
182
+ /**
183
+ * One result of a batch order book response, aligned with the request order.
184
+ * `orderbook` is `null` when the item failed (see `error`); per-item failures
185
+ * never fail the whole batch.
186
+ */
187
+ interface OrderbookBatchResult {
188
+ slug: string;
189
+ source: ProviderSource;
190
+ outcome: OrderbookOutcome;
191
+ orderbook: Orderbook | null;
192
+ /** Present only when this item failed. */
193
+ error?: string;
194
+ }
195
+ /** Response from `POST /api/v1/markets/orderbooks`. */
196
+ interface OrderbooksBatchResponse {
197
+ results: OrderbookBatchResult[];
198
+ }
170
199
  /** On-chain trade type. */
171
200
  type TradeType = "TRADE" | "SPLIT" | "MERGE" | "REDEEM" | "REWARD" | "CONVERSION" | "MAKER_REBATE" | "REFERRAL_REWARD";
172
201
  /** Lightweight event summary embedded in a trade. */
@@ -1161,6 +1190,13 @@ declare class PredictClient {
1161
1190
  getMarket(slug: string, source?: ProviderSource): Promise<PredictMarket>;
1162
1191
  /** Maps to `GET /api/v1/markets/:slug/orderbook?source=...&outcome=...`. */
1163
1192
  getOrderbook(slug: string, source: ProviderSource, outcome?: OrderbookOutcome): Promise<Orderbook>;
1193
+ /**
1194
+ * Maps to `POST /api/v1/markets/orderbooks`.
1195
+ * Fetches order books for many markets in a single request (max 100 items).
1196
+ * Results are returned in the same order as `items`; per-item failures are
1197
+ * reported via `OrderbookBatchResult.error` and never fail the whole batch.
1198
+ */
1199
+ getOrderbooks(items: OrderbookBatchItem[]): Promise<OrderbookBatchResult[]>;
1164
1200
  /** Maps to `GET /api/v1/markets/:slug/trades?source=...`. */
1165
1201
  listMarketTrades(slug: string, params: ListMarketTradesParams): Promise<PredictPage<PredictTrade>>;
1166
1202
  /** Maps to `GET /api/v1/markets/:slug/price-history?source=...&range=...`. */
@@ -1958,4 +1994,4 @@ declare function buildClobPayload(signedOrder: SignedOrder, owner: string): Clob
1958
1994
  */
1959
1995
  declare function getPolymarketSharesPrecision(tickSize: string): number;
1960
1996
 
1961
- export { type PolymarketWithdrawPrepareRequest as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type ListTradesMultiParams as D, type EventStats as E, type DFlowQuoteRequest as F, type DFlowQuoteResponse as G, type DFlowSubmitResponse as H, type DFlowSubmitRequest as I, type DFlowKYCStatus as J, type PolymarketSetupStatus as K, type ListEventsParams as L, type MatchesParams as M, type PolymarketDepositWalletDeployResponse as N, type OrderbookOutcome as O, PredictClient as P, type WithdrawBuildRequest as Q, type WithdrawSubmitResponse as R, type SimilarEventsParams as S, type WithdrawSubmitRequest as T, type WithdrawStatusResponse as U, type PolymarketDepositAddresses as V, type WithdrawBuildResponse as W, type PolymarketSupportedAsset as X, type PolymarketWithdrawResponse as Y, type PolymarketWithdrawRequest as Z, type PolymarketWithdrawPrepareResponse as _, PredictWsClient as a, type WsServerMessage as a$, type PolymarketWithdrawQuoteResponse as a0, type PolymarketWithdrawQuoteRequest as a1, type PolymarketWithdrawRelayBuildResponse as a2, type PolymarketWithdrawRelayBuildRequest as a3, type PolymarketWithdrawRelaySubmitResponse as a4, type PolymarketWithdrawRelaySubmitRequest as a5, type PolymarketWithdrawBridgeStatusResponse as a6, type PolymarketRedeemResponse as a7, type TickSizeResponse as a8, type FeeRateResponse as a9, type PolymarketOrderType as aA, type PolymarketWalletKind as aB, type PolymarketDepositWalletDeployRequest as aC, type DepositBuildRequest as aD, type DepositBuildResponse as aE, type DepositSubmitRequest as aF, type DepositSubmitResponse as aG, type DepositStatusResponse as aH, type UnsignedTx as aI, type PolymarketBridgeToken as aJ, type PolymarketSupportedAssetsResponse as aK, type PolymarketTypedData as aL, type PolymarketTypedDataArg as aM, type MatchStatus as aN, type MatchGroupEntry as aO, type MatchGroupMarket as aP, type MatchSortField as aQ, type MatchesStats as aR, type MatchConfidenceTier as aS, type SignalTag as aT, type MatchLeg as aU, type MatchMarketFlat as aV, type WsChannel as aW, type WsChannelEvent as aX, type WsClientMessage as aY, type WsSubscribeMessage as aZ, type WsPingMessage as a_, type RebateConfig as aa, type WsConnectionStatus as ab, type WsDataMessage as ac, type WsPriceEvent as ad, type WsOrderbookEvent as ae, type WsTradeEvent as af, type CreateOrderInput as ag, createPredictClient as ah, createPredictWsClient as ai, type PredictWsClientConfig as aj, type ProviderMeta as ak, type PredictTag as al, type SettlementSource as am, type MarketStatus as an, type MarketResult as ao, type MarketOutcome as ap, type OrderbookLevel as aq, type TradeType as ar, type EventSummary as as, type MarketSummary as at, type PredictCommentProfile as au, type PricePoint as av, type PredictPosition as aw, type OrderStatus as ax, type OrderSide as ay, type DFlowOrderContext as az, type PredictPage as b, type WsPongMessage as b0, type WsSubscribedMessage as b1, type WsErrorCode as b2, type WsErrorMessage as b3, type PolymarketRedeemPrepareInput as b4, type PolymarketRedeemPrepareResponse as b5, type PolymarketRedeemInput as b6, eventQueryKey as b7, fetchEvent as b8, resolveTagSlug as b9, buildCtfExchangeDomain as bA, CTF_ORDER_TYPES as bB, ORDER_TYPE as bC, SIDE as bD, buildOrderMessage as bE, buildSignedOrder as bF, buildClobPayload as bG, getPolymarketSharesPrecision as bH, type ClobOrderPayload as bI, type BuildOrderMessageInput as bJ, type OrderMessage as bK, type SignedOrder as bL, DEFAULT_PAGE_SIZE as bM, resolveEventsParams as ba, infiniteEventsQueryKey as bb, fetchEventsPage as bc, type ResolveEventsParamsInput as bd, type TagSlugSelection as be, marketQueryKey as bf, fetchMarket as bg, matchesQueryKey as bh, matchQueryKey as bi, fetchMatchesPage as bj, matchMarketsQueryKey as bk, fetchMatchMarketsPage as bl, CLOB_AUTH_DOMAIN as bm, CLOB_AUTH_TYPES as bn, buildClobAuthMessage as bo, hmacSha256Base64 as bp, buildPolymarketL2Headers as bq, derivePolymarketApiKey as br, type HttpMethod as bs, type PolymarketL2HeadersInput as bt, type PolymarketL2Headers as bu, type BuildClobAuthMessageInput as bv, CTF_EXCHANGE_ADDRESS as bw, NEG_RISK_CTF_EXCHANGE_ADDRESS as bx, USDC_ADDRESS as by, POLYGON_CHAIN_ID as bz, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type Orderbook as h, type ListMarketTradesParams as i, type PredictTrade as j, type PriceHistoryRange as k, type PriceHistoryResponse as l, type ListCandlesticksParams as m, type ListCommentsParams as n, type PredictComment as o, type PositionsResponse as p, type ListOrdersParams as q, type PredictOrder as r, type ListOrdersMultiParams as s, type PredictOrdersResponse as t, type CancelOrderResult as u, type MatchGroupPage as v, type MatchGroup as w, type MatchMarketParams as x, type MatchMarketPage as y, type ListTradesParams as z };
1997
+ export { type PolymarketWithdrawPrepareRequest as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type ListTradesMultiParams as D, type EventStats as E, type DFlowQuoteRequest as F, type DFlowQuoteResponse as G, type DFlowSubmitResponse as H, type DFlowSubmitRequest as I, type DFlowKYCStatus as J, type PolymarketSetupStatus as K, type ListEventsParams as L, type MatchesParams as M, type PolymarketDepositWalletDeployResponse as N, type OrderbookOutcome as O, PredictClient as P, type WithdrawBuildRequest as Q, type WithdrawSubmitResponse as R, type SimilarEventsParams as S, type WithdrawSubmitRequest as T, type WithdrawStatusResponse as U, type PolymarketDepositAddresses as V, type WithdrawBuildResponse as W, type PolymarketSupportedAsset as X, type PolymarketWithdrawResponse as Y, type PolymarketWithdrawRequest as Z, type PolymarketWithdrawPrepareResponse as _, PredictWsClient as a, type WsChannelEvent as a$, type PolymarketWithdrawQuoteResponse as a0, type PolymarketWithdrawQuoteRequest as a1, type PolymarketWithdrawRelayBuildResponse as a2, type PolymarketWithdrawRelayBuildRequest as a3, type PolymarketWithdrawRelaySubmitResponse as a4, type PolymarketWithdrawRelaySubmitRequest as a5, type PolymarketWithdrawBridgeStatusResponse as a6, type PolymarketRedeemResponse as a7, type TickSizeResponse as a8, type FeeRateResponse as a9, type PredictPosition as aA, type OrderStatus as aB, type OrderSide as aC, type DFlowOrderContext as aD, type PolymarketOrderType as aE, type PolymarketWalletKind as aF, type PolymarketDepositWalletDeployRequest as aG, type DepositBuildRequest as aH, type DepositBuildResponse as aI, type DepositSubmitRequest as aJ, type DepositSubmitResponse as aK, type DepositStatusResponse as aL, type UnsignedTx as aM, type PolymarketBridgeToken as aN, type PolymarketSupportedAssetsResponse as aO, type PolymarketTypedData as aP, type PolymarketTypedDataArg as aQ, type MatchStatus as aR, type MatchGroupEntry as aS, type MatchGroupMarket as aT, type MatchSortField as aU, type MatchesStats as aV, type MatchConfidenceTier as aW, type SignalTag as aX, type MatchLeg as aY, type MatchMarketFlat as aZ, type WsChannel as a_, type RebateConfig as aa, type WsConnectionStatus as ab, type WsDataMessage as ac, type WsPriceEvent as ad, type WsOrderbookEvent as ae, type WsTradeEvent as af, type CreateOrderInput as ag, createPredictClient as ah, createPredictWsClient as ai, type PredictWsClientConfig as aj, type ProviderMeta as ak, type PredictTag as al, type SettlementSource as am, type MarketStatus as an, type MarketResult as ao, type MarketOutcome as ap, type OrderbookLevel as aq, type OrderbookBatchItem as ar, type OrderbookBatchResult as as, type OrderbooksBatchRequest as at, type OrderbooksBatchResponse as au, type TradeType as av, type EventSummary as aw, type MarketSummary as ax, type PredictCommentProfile as ay, type PricePoint as az, type PredictPage as b, type WsClientMessage as b0, type WsSubscribeMessage as b1, type WsPingMessage as b2, type WsServerMessage as b3, type WsPongMessage as b4, type WsSubscribedMessage as b5, type WsErrorCode as b6, type WsErrorMessage as b7, type PolymarketRedeemPrepareInput as b8, type PolymarketRedeemPrepareResponse as b9, CTF_EXCHANGE_ADDRESS as bA, NEG_RISK_CTF_EXCHANGE_ADDRESS as bB, USDC_ADDRESS as bC, POLYGON_CHAIN_ID as bD, buildCtfExchangeDomain as bE, CTF_ORDER_TYPES as bF, ORDER_TYPE as bG, SIDE as bH, buildOrderMessage as bI, buildSignedOrder as bJ, buildClobPayload as bK, getPolymarketSharesPrecision as bL, type ClobOrderPayload as bM, type BuildOrderMessageInput as bN, type OrderMessage as bO, type SignedOrder as bP, DEFAULT_PAGE_SIZE as bQ, type PolymarketRedeemInput as ba, eventQueryKey as bb, fetchEvent as bc, resolveTagSlug as bd, resolveEventsParams as be, infiniteEventsQueryKey as bf, fetchEventsPage as bg, type ResolveEventsParamsInput as bh, type TagSlugSelection as bi, marketQueryKey as bj, fetchMarket as bk, matchesQueryKey as bl, matchQueryKey as bm, fetchMatchesPage as bn, matchMarketsQueryKey as bo, fetchMatchMarketsPage as bp, CLOB_AUTH_DOMAIN as bq, CLOB_AUTH_TYPES as br, buildClobAuthMessage as bs, hmacSha256Base64 as bt, buildPolymarketL2Headers as bu, derivePolymarketApiKey as bv, type HttpMethod as bw, type PolymarketL2HeadersInput as bx, type PolymarketL2Headers as by, type BuildClobAuthMessageInput as bz, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type Orderbook as h, type ListMarketTradesParams as i, type PredictTrade as j, type PriceHistoryRange as k, type PriceHistoryResponse as l, type ListCandlesticksParams as m, type ListCommentsParams as n, type PredictComment as o, type PositionsResponse as p, type ListOrdersParams as q, type PredictOrder as r, type ListOrdersMultiParams as s, type PredictOrdersResponse as t, type CancelOrderResult as u, type MatchGroupPage as v, type MatchGroup as w, type MatchMarketParams as x, type MatchMarketPage as y, type ListTradesParams as z };
package/dist/server.d.mts CHANGED
@@ -1 +1 @@
1
- export { B as BalanceResponse, bv as BuildClobAuthMessageInput, bJ as BuildOrderMessageInput, bm as CLOB_AUTH_DOMAIN, bn as CLOB_AUTH_TYPES, bw as CTF_EXCHANGE_ADDRESS, bB as CTF_ORDER_TYPES, u as CancelOrderResult, C as Candlestick, bI as ClobOrderPayload, ag as CreateOrderInput, bM as DEFAULT_PAGE_SIZE, az as DFlowOrderContext, F as DFlowQuoteRequest, G as DFlowQuoteResponse, I as DFlowSubmitRequest, H as DFlowSubmitResponse, aD as DepositBuildRequest, aE as DepositBuildResponse, aH as DepositStatusResponse, aF as DepositSubmitRequest, aG as DepositSubmitResponse, f as EventSortField, e as EventStatus, as as EventSummary, bs as HttpMethod, m as ListCandlesticksParams, L as ListEventsParams, i as ListMarketTradesParams, q as ListOrdersParams, z as ListTradesParams, ap as MarketOutcome, ao as MarketResult, an as MarketStatus, at as MarketSummary, aS as MatchConfidenceTier, w as MatchGroup, aO as MatchGroupEntry, aP as MatchGroupMarket, v as MatchGroupPage, aU as MatchLeg, aV as MatchMarketFlat, y as MatchMarketPage, x as MatchMarketParams, aQ as MatchSortField, aN as MatchStatus, M as MatchesParams, aR as MatchesStats, bx as NEG_RISK_CTF_EXCHANGE_ADDRESS, bC as ORDER_TYPE, bK as OrderMessage, ay as OrderSide, ax as OrderStatus, h as Orderbook, aq as OrderbookLevel, bz as POLYGON_CHAIN_ID, bu as PolymarketL2Headers, bt as PolymarketL2HeadersInput, aA as PolymarketOrderType, p as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, r as PredictOrder, b as PredictPage, aw as PredictPosition, al as PredictTag, j as PredictTrade, a as PredictWsClient, aj as PredictWsClientConfig, k as PriceHistoryRange, l as PriceHistoryResponse, av as PricePoint, ak as ProviderMeta, d as ProviderSource, bd as ResolveEventsParamsInput, bD as SIDE, am as SettlementSource, aT as SignalTag, bL as SignedOrder, S as SimilarEventsParams, be as TagSlugSelection, ar as TradeType, by as USDC_ADDRESS, aI as UnsignedTx, aW as WsChannel, aX as WsChannelEvent, aY as WsClientMessage, ab as WsConnectionStatus, ac as WsDataMessage, b2 as WsErrorCode, b3 as WsErrorMessage, ae as WsOrderbookEvent, a_ as WsPingMessage, b0 as WsPongMessage, ad as WsPriceEvent, a$ as WsServerMessage, aZ as WsSubscribeMessage, b1 as WsSubscribedMessage, af as WsTradeEvent, bo as buildClobAuthMessage, bG as buildClobPayload, bA as buildCtfExchangeDomain, bE as buildOrderMessage, bq as buildPolymarketL2Headers, bF as buildSignedOrder, ah as createPredictClient, ai as createPredictWsClient, br as derivePolymarketApiKey, b7 as eventQueryKey, b8 as fetchEvent, bc as fetchEventsPage, bg as fetchMarket, bl as fetchMatchMarketsPage, bj as fetchMatchesPage, bp as hmacSha256Base64, bb as infiniteEventsQueryKey, bf as marketQueryKey, bk as matchMarketsQueryKey, bi as matchQueryKey, bh as matchesQueryKey, ba as resolveEventsParams, b9 as resolveTagSlug } from './server-BYvRRFCr.mjs';
1
+ export { B as BalanceResponse, bz as BuildClobAuthMessageInput, bN as BuildOrderMessageInput, bq as CLOB_AUTH_DOMAIN, br as CLOB_AUTH_TYPES, bA as CTF_EXCHANGE_ADDRESS, bF as CTF_ORDER_TYPES, u as CancelOrderResult, C as Candlestick, bM as ClobOrderPayload, ag as CreateOrderInput, bQ as DEFAULT_PAGE_SIZE, aD as DFlowOrderContext, F as DFlowQuoteRequest, G as DFlowQuoteResponse, I as DFlowSubmitRequest, H as DFlowSubmitResponse, aH as DepositBuildRequest, aI as DepositBuildResponse, aL as DepositStatusResponse, aJ as DepositSubmitRequest, aK as DepositSubmitResponse, f as EventSortField, e as EventStatus, aw as EventSummary, bw as HttpMethod, m as ListCandlesticksParams, L as ListEventsParams, i as ListMarketTradesParams, q as ListOrdersParams, z as ListTradesParams, ap as MarketOutcome, ao as MarketResult, an as MarketStatus, ax as MarketSummary, aW as MatchConfidenceTier, w as MatchGroup, aS as MatchGroupEntry, aT as MatchGroupMarket, v as MatchGroupPage, aY as MatchLeg, aZ as MatchMarketFlat, y as MatchMarketPage, x as MatchMarketParams, aU as MatchSortField, aR as MatchStatus, M as MatchesParams, aV as MatchesStats, bB as NEG_RISK_CTF_EXCHANGE_ADDRESS, bG as ORDER_TYPE, bO as OrderMessage, aC as OrderSide, aB as OrderStatus, h as Orderbook, aq as OrderbookLevel, bD as POLYGON_CHAIN_ID, by as PolymarketL2Headers, bx as PolymarketL2HeadersInput, aE as PolymarketOrderType, p as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, r as PredictOrder, b as PredictPage, aA as PredictPosition, al as PredictTag, j as PredictTrade, a as PredictWsClient, aj as PredictWsClientConfig, k as PriceHistoryRange, l as PriceHistoryResponse, az as PricePoint, ak as ProviderMeta, d as ProviderSource, bh as ResolveEventsParamsInput, bH as SIDE, am as SettlementSource, aX as SignalTag, bP as SignedOrder, S as SimilarEventsParams, bi as TagSlugSelection, av as TradeType, bC as USDC_ADDRESS, aM as UnsignedTx, a_ as WsChannel, a$ as WsChannelEvent, b0 as WsClientMessage, ab as WsConnectionStatus, ac as WsDataMessage, b6 as WsErrorCode, b7 as WsErrorMessage, ae as WsOrderbookEvent, b2 as WsPingMessage, b4 as WsPongMessage, ad as WsPriceEvent, b3 as WsServerMessage, b1 as WsSubscribeMessage, b5 as WsSubscribedMessage, af as WsTradeEvent, bs as buildClobAuthMessage, bK as buildClobPayload, bE as buildCtfExchangeDomain, bI as buildOrderMessage, bu as buildPolymarketL2Headers, bJ as buildSignedOrder, ah as createPredictClient, ai as createPredictWsClient, bv as derivePolymarketApiKey, bb as eventQueryKey, bc as fetchEvent, bg as fetchEventsPage, bk as fetchMarket, bp as fetchMatchMarketsPage, bn as fetchMatchesPage, bt as hmacSha256Base64, bf as infiniteEventsQueryKey, bj as marketQueryKey, bo as matchMarketsQueryKey, bm as matchQueryKey, bl as matchesQueryKey, be as resolveEventsParams, bd as resolveTagSlug } from './server-Byq4PK9C.mjs';
package/dist/server.d.ts CHANGED
@@ -1 +1 @@
1
- export { B as BalanceResponse, bv as BuildClobAuthMessageInput, bJ as BuildOrderMessageInput, bm as CLOB_AUTH_DOMAIN, bn as CLOB_AUTH_TYPES, bw as CTF_EXCHANGE_ADDRESS, bB as CTF_ORDER_TYPES, u as CancelOrderResult, C as Candlestick, bI as ClobOrderPayload, ag as CreateOrderInput, bM as DEFAULT_PAGE_SIZE, az as DFlowOrderContext, F as DFlowQuoteRequest, G as DFlowQuoteResponse, I as DFlowSubmitRequest, H as DFlowSubmitResponse, aD as DepositBuildRequest, aE as DepositBuildResponse, aH as DepositStatusResponse, aF as DepositSubmitRequest, aG as DepositSubmitResponse, f as EventSortField, e as EventStatus, as as EventSummary, bs as HttpMethod, m as ListCandlesticksParams, L as ListEventsParams, i as ListMarketTradesParams, q as ListOrdersParams, z as ListTradesParams, ap as MarketOutcome, ao as MarketResult, an as MarketStatus, at as MarketSummary, aS as MatchConfidenceTier, w as MatchGroup, aO as MatchGroupEntry, aP as MatchGroupMarket, v as MatchGroupPage, aU as MatchLeg, aV as MatchMarketFlat, y as MatchMarketPage, x as MatchMarketParams, aQ as MatchSortField, aN as MatchStatus, M as MatchesParams, aR as MatchesStats, bx as NEG_RISK_CTF_EXCHANGE_ADDRESS, bC as ORDER_TYPE, bK as OrderMessage, ay as OrderSide, ax as OrderStatus, h as Orderbook, aq as OrderbookLevel, bz as POLYGON_CHAIN_ID, bu as PolymarketL2Headers, bt as PolymarketL2HeadersInput, aA as PolymarketOrderType, p as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, r as PredictOrder, b as PredictPage, aw as PredictPosition, al as PredictTag, j as PredictTrade, a as PredictWsClient, aj as PredictWsClientConfig, k as PriceHistoryRange, l as PriceHistoryResponse, av as PricePoint, ak as ProviderMeta, d as ProviderSource, bd as ResolveEventsParamsInput, bD as SIDE, am as SettlementSource, aT as SignalTag, bL as SignedOrder, S as SimilarEventsParams, be as TagSlugSelection, ar as TradeType, by as USDC_ADDRESS, aI as UnsignedTx, aW as WsChannel, aX as WsChannelEvent, aY as WsClientMessage, ab as WsConnectionStatus, ac as WsDataMessage, b2 as WsErrorCode, b3 as WsErrorMessage, ae as WsOrderbookEvent, a_ as WsPingMessage, b0 as WsPongMessage, ad as WsPriceEvent, a$ as WsServerMessage, aZ as WsSubscribeMessage, b1 as WsSubscribedMessage, af as WsTradeEvent, bo as buildClobAuthMessage, bG as buildClobPayload, bA as buildCtfExchangeDomain, bE as buildOrderMessage, bq as buildPolymarketL2Headers, bF as buildSignedOrder, ah as createPredictClient, ai as createPredictWsClient, br as derivePolymarketApiKey, b7 as eventQueryKey, b8 as fetchEvent, bc as fetchEventsPage, bg as fetchMarket, bl as fetchMatchMarketsPage, bj as fetchMatchesPage, bp as hmacSha256Base64, bb as infiniteEventsQueryKey, bf as marketQueryKey, bk as matchMarketsQueryKey, bi as matchQueryKey, bh as matchesQueryKey, ba as resolveEventsParams, b9 as resolveTagSlug } from './server-BYvRRFCr.js';
1
+ export { B as BalanceResponse, bz as BuildClobAuthMessageInput, bN as BuildOrderMessageInput, bq as CLOB_AUTH_DOMAIN, br as CLOB_AUTH_TYPES, bA as CTF_EXCHANGE_ADDRESS, bF as CTF_ORDER_TYPES, u as CancelOrderResult, C as Candlestick, bM as ClobOrderPayload, ag as CreateOrderInput, bQ as DEFAULT_PAGE_SIZE, aD as DFlowOrderContext, F as DFlowQuoteRequest, G as DFlowQuoteResponse, I as DFlowSubmitRequest, H as DFlowSubmitResponse, aH as DepositBuildRequest, aI as DepositBuildResponse, aL as DepositStatusResponse, aJ as DepositSubmitRequest, aK as DepositSubmitResponse, f as EventSortField, e as EventStatus, aw as EventSummary, bw as HttpMethod, m as ListCandlesticksParams, L as ListEventsParams, i as ListMarketTradesParams, q as ListOrdersParams, z as ListTradesParams, ap as MarketOutcome, ao as MarketResult, an as MarketStatus, ax as MarketSummary, aW as MatchConfidenceTier, w as MatchGroup, aS as MatchGroupEntry, aT as MatchGroupMarket, v as MatchGroupPage, aY as MatchLeg, aZ as MatchMarketFlat, y as MatchMarketPage, x as MatchMarketParams, aU as MatchSortField, aR as MatchStatus, M as MatchesParams, aV as MatchesStats, bB as NEG_RISK_CTF_EXCHANGE_ADDRESS, bG as ORDER_TYPE, bO as OrderMessage, aC as OrderSide, aB as OrderStatus, h as Orderbook, aq as OrderbookLevel, bD as POLYGON_CHAIN_ID, by as PolymarketL2Headers, bx as PolymarketL2HeadersInput, aE as PolymarketOrderType, p as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, r as PredictOrder, b as PredictPage, aA as PredictPosition, al as PredictTag, j as PredictTrade, a as PredictWsClient, aj as PredictWsClientConfig, k as PriceHistoryRange, l as PriceHistoryResponse, az as PricePoint, ak as ProviderMeta, d as ProviderSource, bh as ResolveEventsParamsInput, bH as SIDE, am as SettlementSource, aX as SignalTag, bP as SignedOrder, S as SimilarEventsParams, bi as TagSlugSelection, av as TradeType, bC as USDC_ADDRESS, aM as UnsignedTx, a_ as WsChannel, a$ as WsChannelEvent, b0 as WsClientMessage, ab as WsConnectionStatus, ac as WsDataMessage, b6 as WsErrorCode, b7 as WsErrorMessage, ae as WsOrderbookEvent, b2 as WsPingMessage, b4 as WsPongMessage, ad as WsPriceEvent, b3 as WsServerMessage, b1 as WsSubscribeMessage, b5 as WsSubscribedMessage, af as WsTradeEvent, bs as buildClobAuthMessage, bK as buildClobPayload, bE as buildCtfExchangeDomain, bI as buildOrderMessage, bu as buildPolymarketL2Headers, bJ as buildSignedOrder, ah as createPredictClient, ai as createPredictWsClient, bv as derivePolymarketApiKey, bb as eventQueryKey, bc as fetchEvent, bg as fetchEventsPage, bk as fetchMarket, bp as fetchMatchMarketsPage, bn as fetchMatchesPage, bt as hmacSha256Base64, bf as infiniteEventsQueryKey, bj as marketQueryKey, bo as matchMarketsQueryKey, bm as matchQueryKey, bl as matchesQueryKey, be as resolveEventsParams, bd as resolveTagSlug } from './server-Byq4PK9C.js';
package/dist/server.js CHANGED
@@ -192,6 +192,17 @@ var PredictClient = class {
192
192
  const url = `${this.endpoint}/api/v1/markets/${encodeURIComponent(slug)}/orderbook${query}`;
193
193
  return await utils.httpGet(url);
194
194
  }
195
+ /**
196
+ * Maps to `POST /api/v1/markets/orderbooks`.
197
+ * Fetches order books for many markets in a single request (max 100 items).
198
+ * Results are returned in the same order as `items`; per-item failures are
199
+ * reported via `OrderbookBatchResult.error` and never fail the whole batch.
200
+ */
201
+ async getOrderbooks(items) {
202
+ const url = `${this.endpoint}/api/v1/markets/orderbooks`;
203
+ const res = await utils.httpPost(url, { items });
204
+ return res.results;
205
+ }
195
206
  /** Maps to `GET /api/v1/markets/:slug/trades?source=...`. */
196
207
  async listMarketTrades(slug, params) {
197
208
  const query = buildQuery(params);