@liberfi.io/react-predict 0.3.55 → 0.3.57
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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -7
- package/dist/index.mjs.map +1 -1
- package/dist/{server-DoNRmZzs.d.mts → server-h41hs9SR.d.mts} +18 -3
- package/dist/{server-DoNRmZzs.d.ts → server-h41hs9SR.d.ts} +18 -3
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +21 -7
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +21 -7
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -159,6 +159,11 @@ interface ListEventsParams {
|
|
|
159
159
|
* `0` means no limit. Defaults to `3` when set via `resolveEventsParams`.
|
|
160
160
|
*/
|
|
161
161
|
markets_limit?: number;
|
|
162
|
+
/**
|
|
163
|
+
* Resolved UI language. Sent as `?lang=` so localized event/market fields are
|
|
164
|
+
* returned and TanStack Query keys remain language-specific.
|
|
165
|
+
*/
|
|
166
|
+
lang?: string;
|
|
162
167
|
}
|
|
163
168
|
/** Single price level in an order book. */
|
|
164
169
|
interface OrderbookLevel {
|
|
@@ -1139,6 +1144,9 @@ interface PolymarketRedeemResponse {
|
|
|
1139
1144
|
status: string;
|
|
1140
1145
|
}
|
|
1141
1146
|
|
|
1147
|
+
interface PredictClientOptions {
|
|
1148
|
+
headers?: HeadersInit | (() => HeadersInit | undefined);
|
|
1149
|
+
}
|
|
1142
1150
|
/**
|
|
1143
1151
|
* HTTP client for the prediction-server REST API.
|
|
1144
1152
|
*
|
|
@@ -1154,7 +1162,9 @@ interface PolymarketRedeemResponse {
|
|
|
1154
1162
|
*/
|
|
1155
1163
|
declare class PredictClient {
|
|
1156
1164
|
private readonly endpoint;
|
|
1157
|
-
|
|
1165
|
+
private readonly options;
|
|
1166
|
+
constructor(endpoint: string, options?: PredictClientOptions);
|
|
1167
|
+
private requestOptions;
|
|
1158
1168
|
/**
|
|
1159
1169
|
* List prediction events with optional filtering, sorting, and pagination.
|
|
1160
1170
|
*
|
|
@@ -1443,7 +1453,7 @@ declare class PredictClient {
|
|
|
1443
1453
|
*
|
|
1444
1454
|
* @param endpoint - Base URL of the prediction-server, without a trailing slash.
|
|
1445
1455
|
*/
|
|
1446
|
-
declare function createPredictClient(endpoint: string): PredictClient;
|
|
1456
|
+
declare function createPredictClient(endpoint: string, options?: PredictClientOptions): PredictClient;
|
|
1447
1457
|
|
|
1448
1458
|
/**
|
|
1449
1459
|
* PredictWsClient — WebSocket client for prediction-server real-time data.
|
|
@@ -1642,6 +1652,11 @@ interface ResolveEventsParamsInput {
|
|
|
1642
1652
|
* Defaults to `3` in `resolveEventsParams`.
|
|
1643
1653
|
*/
|
|
1644
1654
|
markets_limit?: number;
|
|
1655
|
+
/**
|
|
1656
|
+
* Resolved UI language. Included in the API query and query key so localized
|
|
1657
|
+
* payloads are not shared across languages.
|
|
1658
|
+
*/
|
|
1659
|
+
lang?: string;
|
|
1645
1660
|
}
|
|
1646
1661
|
/**
|
|
1647
1662
|
* Build a clean `ListEventsParams` from loose user inputs.
|
|
@@ -2026,4 +2041,4 @@ declare function buildClobPayload(signedOrder: SignedOrder, owner: string): Clob
|
|
|
2026
2041
|
*/
|
|
2027
2042
|
declare function getPolymarketSharesPrecision(tickSize: string): number;
|
|
2028
2043
|
|
|
2029
|
-
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
|
|
2044
|
+
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 WsChannel 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 PolymarketTypedData as a8, type TickSizeResponse as a9, type PredictCommentProfile as aA, type PricePoint as aB, type PredictPosition as aC, type OrderStatus as aD, type OrderSide as aE, type DFlowOrderContext as aF, type PolymarketOrderType as aG, type PolymarketWalletKind as aH, type PolymarketDepositWalletDeployRequest as aI, type DepositBuildRequest as aJ, type DepositBuildResponse as aK, type DepositSubmitRequest as aL, type DepositSubmitResponse as aM, type DepositStatusResponse as aN, type UnsignedTx as aO, type PolymarketBridgeToken as aP, type PolymarketSupportedAssetsResponse as aQ, type PolymarketTypedDataArg as aR, type MatchStatus as aS, type MatchGroupEntry as aT, type MatchGroupMarket as aU, type MatchSortField as aV, type MatchesStats as aW, type MatchConfidenceTier as aX, type SignalTag as aY, type MatchLeg as aZ, type MatchMarketFlat as a_, type FeeRateResponse as aa, type RebateConfig as ab, type WsConnectionStatus as ac, type WsDataMessage as ad, type WsPriceEvent as ae, type WsOrderbookEvent as af, type WsTradeEvent as ag, type CreateOrderInput as ah, createPredictClient as ai, type PredictClientOptions as aj, createPredictWsClient as ak, type PredictWsClientConfig as al, type ProviderMeta as am, type PredictTag as an, type SettlementSource as ao, type MarketStatus as ap, type MarketResult as aq, type MarketOutcome as ar, type OrderbookLevel as as, type OrderbookBatchItem as at, type OrderbookBatchResult as au, type OrderbooksBatchRequest as av, type OrderbooksBatchResponse as aw, type TradeType as ax, type EventSummary as ay, type MarketSummary as az, type PredictPage as b, type WsChannelEvent as b0, type WsClientMessage as b1, type WsSubscribeMessage as b2, type WsPingMessage as b3, type WsServerMessage as b4, type WsPongMessage as b5, type WsSubscribedMessage as b6, type WsErrorCode as b7, type WsErrorMessage as b8, type PolymarketRedeemPrepareInput as b9, type BuildClobAuthMessageInput as bA, CTF_EXCHANGE_ADDRESS as bB, NEG_RISK_CTF_EXCHANGE_ADDRESS as bC, USDC_ADDRESS as bD, POLYGON_CHAIN_ID as bE, buildCtfExchangeDomain as bF, CTF_ORDER_TYPES as bG, ORDER_TYPE as bH, SIDE as bI, buildOrderMessage as bJ, buildSignedOrder as bK, buildClobPayload as bL, getPolymarketSharesPrecision as bM, type ClobOrderPayload as bN, type BuildOrderMessageInput as bO, type OrderMessage as bP, type SignedOrder as bQ, DEFAULT_PAGE_SIZE as bR, type PolymarketRedeemPrepareResponse as ba, type PolymarketRedeemInput as bb, eventQueryKey as bc, fetchEvent as bd, resolveTagSlug as be, resolveEventsParams as bf, infiniteEventsQueryKey as bg, fetchEventsPage as bh, type ResolveEventsParamsInput as bi, type TagSlugSelection as bj, marketQueryKey as bk, fetchMarket as bl, matchesQueryKey as bm, matchQueryKey as bn, fetchMatchesPage as bo, matchMarketsQueryKey as bp, fetchMatchMarketsPage as bq, CLOB_AUTH_DOMAIN as br, CLOB_AUTH_TYPES as bs, buildClobAuthMessage as bt, hmacSha256Base64 as bu, buildPolymarketL2Headers as bv, derivePolymarketApiKey as bw, type HttpMethod as bx, type PolymarketL2HeadersInput as by, type PolymarketL2Headers 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 };
|
|
@@ -159,6 +159,11 @@ interface ListEventsParams {
|
|
|
159
159
|
* `0` means no limit. Defaults to `3` when set via `resolveEventsParams`.
|
|
160
160
|
*/
|
|
161
161
|
markets_limit?: number;
|
|
162
|
+
/**
|
|
163
|
+
* Resolved UI language. Sent as `?lang=` so localized event/market fields are
|
|
164
|
+
* returned and TanStack Query keys remain language-specific.
|
|
165
|
+
*/
|
|
166
|
+
lang?: string;
|
|
162
167
|
}
|
|
163
168
|
/** Single price level in an order book. */
|
|
164
169
|
interface OrderbookLevel {
|
|
@@ -1139,6 +1144,9 @@ interface PolymarketRedeemResponse {
|
|
|
1139
1144
|
status: string;
|
|
1140
1145
|
}
|
|
1141
1146
|
|
|
1147
|
+
interface PredictClientOptions {
|
|
1148
|
+
headers?: HeadersInit | (() => HeadersInit | undefined);
|
|
1149
|
+
}
|
|
1142
1150
|
/**
|
|
1143
1151
|
* HTTP client for the prediction-server REST API.
|
|
1144
1152
|
*
|
|
@@ -1154,7 +1162,9 @@ interface PolymarketRedeemResponse {
|
|
|
1154
1162
|
*/
|
|
1155
1163
|
declare class PredictClient {
|
|
1156
1164
|
private readonly endpoint;
|
|
1157
|
-
|
|
1165
|
+
private readonly options;
|
|
1166
|
+
constructor(endpoint: string, options?: PredictClientOptions);
|
|
1167
|
+
private requestOptions;
|
|
1158
1168
|
/**
|
|
1159
1169
|
* List prediction events with optional filtering, sorting, and pagination.
|
|
1160
1170
|
*
|
|
@@ -1443,7 +1453,7 @@ declare class PredictClient {
|
|
|
1443
1453
|
*
|
|
1444
1454
|
* @param endpoint - Base URL of the prediction-server, without a trailing slash.
|
|
1445
1455
|
*/
|
|
1446
|
-
declare function createPredictClient(endpoint: string): PredictClient;
|
|
1456
|
+
declare function createPredictClient(endpoint: string, options?: PredictClientOptions): PredictClient;
|
|
1447
1457
|
|
|
1448
1458
|
/**
|
|
1449
1459
|
* PredictWsClient — WebSocket client for prediction-server real-time data.
|
|
@@ -1642,6 +1652,11 @@ interface ResolveEventsParamsInput {
|
|
|
1642
1652
|
* Defaults to `3` in `resolveEventsParams`.
|
|
1643
1653
|
*/
|
|
1644
1654
|
markets_limit?: number;
|
|
1655
|
+
/**
|
|
1656
|
+
* Resolved UI language. Included in the API query and query key so localized
|
|
1657
|
+
* payloads are not shared across languages.
|
|
1658
|
+
*/
|
|
1659
|
+
lang?: string;
|
|
1645
1660
|
}
|
|
1646
1661
|
/**
|
|
1647
1662
|
* Build a clean `ListEventsParams` from loose user inputs.
|
|
@@ -2026,4 +2041,4 @@ declare function buildClobPayload(signedOrder: SignedOrder, owner: string): Clob
|
|
|
2026
2041
|
*/
|
|
2027
2042
|
declare function getPolymarketSharesPrecision(tickSize: string): number;
|
|
2028
2043
|
|
|
2029
|
-
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
|
|
2044
|
+
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 WsChannel 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 PolymarketTypedData as a8, type TickSizeResponse as a9, type PredictCommentProfile as aA, type PricePoint as aB, type PredictPosition as aC, type OrderStatus as aD, type OrderSide as aE, type DFlowOrderContext as aF, type PolymarketOrderType as aG, type PolymarketWalletKind as aH, type PolymarketDepositWalletDeployRequest as aI, type DepositBuildRequest as aJ, type DepositBuildResponse as aK, type DepositSubmitRequest as aL, type DepositSubmitResponse as aM, type DepositStatusResponse as aN, type UnsignedTx as aO, type PolymarketBridgeToken as aP, type PolymarketSupportedAssetsResponse as aQ, type PolymarketTypedDataArg as aR, type MatchStatus as aS, type MatchGroupEntry as aT, type MatchGroupMarket as aU, type MatchSortField as aV, type MatchesStats as aW, type MatchConfidenceTier as aX, type SignalTag as aY, type MatchLeg as aZ, type MatchMarketFlat as a_, type FeeRateResponse as aa, type RebateConfig as ab, type WsConnectionStatus as ac, type WsDataMessage as ad, type WsPriceEvent as ae, type WsOrderbookEvent as af, type WsTradeEvent as ag, type CreateOrderInput as ah, createPredictClient as ai, type PredictClientOptions as aj, createPredictWsClient as ak, type PredictWsClientConfig as al, type ProviderMeta as am, type PredictTag as an, type SettlementSource as ao, type MarketStatus as ap, type MarketResult as aq, type MarketOutcome as ar, type OrderbookLevel as as, type OrderbookBatchItem as at, type OrderbookBatchResult as au, type OrderbooksBatchRequest as av, type OrderbooksBatchResponse as aw, type TradeType as ax, type EventSummary as ay, type MarketSummary as az, type PredictPage as b, type WsChannelEvent as b0, type WsClientMessage as b1, type WsSubscribeMessage as b2, type WsPingMessage as b3, type WsServerMessage as b4, type WsPongMessage as b5, type WsSubscribedMessage as b6, type WsErrorCode as b7, type WsErrorMessage as b8, type PolymarketRedeemPrepareInput as b9, type BuildClobAuthMessageInput as bA, CTF_EXCHANGE_ADDRESS as bB, NEG_RISK_CTF_EXCHANGE_ADDRESS as bC, USDC_ADDRESS as bD, POLYGON_CHAIN_ID as bE, buildCtfExchangeDomain as bF, CTF_ORDER_TYPES as bG, ORDER_TYPE as bH, SIDE as bI, buildOrderMessage as bJ, buildSignedOrder as bK, buildClobPayload as bL, getPolymarketSharesPrecision as bM, type ClobOrderPayload as bN, type BuildOrderMessageInput as bO, type OrderMessage as bP, type SignedOrder as bQ, DEFAULT_PAGE_SIZE as bR, type PolymarketRedeemPrepareResponse as ba, type PolymarketRedeemInput as bb, eventQueryKey as bc, fetchEvent as bd, resolveTagSlug as be, resolveEventsParams as bf, infiniteEventsQueryKey as bg, fetchEventsPage as bh, type ResolveEventsParamsInput as bi, type TagSlugSelection as bj, marketQueryKey as bk, fetchMarket as bl, matchesQueryKey as bm, matchQueryKey as bn, fetchMatchesPage as bo, matchMarketsQueryKey as bp, fetchMatchMarketsPage as bq, CLOB_AUTH_DOMAIN as br, CLOB_AUTH_TYPES as bs, buildClobAuthMessage as bt, hmacSha256Base64 as bu, buildPolymarketL2Headers as bv, derivePolymarketApiKey as bw, type HttpMethod as bx, type PolymarketL2HeadersInput as by, type PolymarketL2Headers 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,
|
|
1
|
+
export { B as BalanceResponse, bA as BuildClobAuthMessageInput, bO as BuildOrderMessageInput, br as CLOB_AUTH_DOMAIN, bs as CLOB_AUTH_TYPES, bB as CTF_EXCHANGE_ADDRESS, bG as CTF_ORDER_TYPES, u as CancelOrderResult, C as Candlestick, bN as ClobOrderPayload, ah as CreateOrderInput, bR as DEFAULT_PAGE_SIZE, aF as DFlowOrderContext, F as DFlowQuoteRequest, G as DFlowQuoteResponse, I as DFlowSubmitRequest, H as DFlowSubmitResponse, aJ as DepositBuildRequest, aK as DepositBuildResponse, aN as DepositStatusResponse, aL as DepositSubmitRequest, aM as DepositSubmitResponse, f as EventSortField, e as EventStatus, ay as EventSummary, bx as HttpMethod, m as ListCandlesticksParams, L as ListEventsParams, i as ListMarketTradesParams, q as ListOrdersParams, z as ListTradesParams, ar as MarketOutcome, aq as MarketResult, ap as MarketStatus, az as MarketSummary, aX as MatchConfidenceTier, w as MatchGroup, aT as MatchGroupEntry, aU as MatchGroupMarket, v as MatchGroupPage, aZ as MatchLeg, a_ as MatchMarketFlat, y as MatchMarketPage, x as MatchMarketParams, aV as MatchSortField, aS as MatchStatus, M as MatchesParams, aW as MatchesStats, bC as NEG_RISK_CTF_EXCHANGE_ADDRESS, bH as ORDER_TYPE, bP as OrderMessage, aE as OrderSide, aD as OrderStatus, h as Orderbook, as as OrderbookLevel, bE as POLYGON_CHAIN_ID, bz as PolymarketL2Headers, by as PolymarketL2HeadersInput, aG as PolymarketOrderType, p as PositionsResponse, P as PredictClient, aj as PredictClientOptions, c as PredictEvent, g as PredictMarket, r as PredictOrder, b as PredictPage, aC as PredictPosition, an as PredictTag, j as PredictTrade, a as PredictWsClient, al as PredictWsClientConfig, k as PriceHistoryRange, l as PriceHistoryResponse, aB as PricePoint, am as ProviderMeta, d as ProviderSource, bi as ResolveEventsParamsInput, bI as SIDE, ao as SettlementSource, aY as SignalTag, bQ as SignedOrder, S as SimilarEventsParams, bj as TagSlugSelection, ax as TradeType, bD as USDC_ADDRESS, aO as UnsignedTx, a$ as WsChannel, b0 as WsChannelEvent, b1 as WsClientMessage, ac as WsConnectionStatus, ad as WsDataMessage, b7 as WsErrorCode, b8 as WsErrorMessage, af as WsOrderbookEvent, b3 as WsPingMessage, b5 as WsPongMessage, ae as WsPriceEvent, b4 as WsServerMessage, b2 as WsSubscribeMessage, b6 as WsSubscribedMessage, ag as WsTradeEvent, bt as buildClobAuthMessage, bL as buildClobPayload, bF as buildCtfExchangeDomain, bJ as buildOrderMessage, bv as buildPolymarketL2Headers, bK as buildSignedOrder, ai as createPredictClient, ak as createPredictWsClient, bw as derivePolymarketApiKey, bc as eventQueryKey, bd as fetchEvent, bh as fetchEventsPage, bl as fetchMarket, bq as fetchMatchMarketsPage, bo as fetchMatchesPage, bu as hmacSha256Base64, bg as infiniteEventsQueryKey, bk as marketQueryKey, bp as matchMarketsQueryKey, bn as matchQueryKey, bm as matchesQueryKey, bf as resolveEventsParams, be as resolveTagSlug } from './server-h41hs9SR.mjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BalanceResponse,
|
|
1
|
+
export { B as BalanceResponse, bA as BuildClobAuthMessageInput, bO as BuildOrderMessageInput, br as CLOB_AUTH_DOMAIN, bs as CLOB_AUTH_TYPES, bB as CTF_EXCHANGE_ADDRESS, bG as CTF_ORDER_TYPES, u as CancelOrderResult, C as Candlestick, bN as ClobOrderPayload, ah as CreateOrderInput, bR as DEFAULT_PAGE_SIZE, aF as DFlowOrderContext, F as DFlowQuoteRequest, G as DFlowQuoteResponse, I as DFlowSubmitRequest, H as DFlowSubmitResponse, aJ as DepositBuildRequest, aK as DepositBuildResponse, aN as DepositStatusResponse, aL as DepositSubmitRequest, aM as DepositSubmitResponse, f as EventSortField, e as EventStatus, ay as EventSummary, bx as HttpMethod, m as ListCandlesticksParams, L as ListEventsParams, i as ListMarketTradesParams, q as ListOrdersParams, z as ListTradesParams, ar as MarketOutcome, aq as MarketResult, ap as MarketStatus, az as MarketSummary, aX as MatchConfidenceTier, w as MatchGroup, aT as MatchGroupEntry, aU as MatchGroupMarket, v as MatchGroupPage, aZ as MatchLeg, a_ as MatchMarketFlat, y as MatchMarketPage, x as MatchMarketParams, aV as MatchSortField, aS as MatchStatus, M as MatchesParams, aW as MatchesStats, bC as NEG_RISK_CTF_EXCHANGE_ADDRESS, bH as ORDER_TYPE, bP as OrderMessage, aE as OrderSide, aD as OrderStatus, h as Orderbook, as as OrderbookLevel, bE as POLYGON_CHAIN_ID, bz as PolymarketL2Headers, by as PolymarketL2HeadersInput, aG as PolymarketOrderType, p as PositionsResponse, P as PredictClient, aj as PredictClientOptions, c as PredictEvent, g as PredictMarket, r as PredictOrder, b as PredictPage, aC as PredictPosition, an as PredictTag, j as PredictTrade, a as PredictWsClient, al as PredictWsClientConfig, k as PriceHistoryRange, l as PriceHistoryResponse, aB as PricePoint, am as ProviderMeta, d as ProviderSource, bi as ResolveEventsParamsInput, bI as SIDE, ao as SettlementSource, aY as SignalTag, bQ as SignedOrder, S as SimilarEventsParams, bj as TagSlugSelection, ax as TradeType, bD as USDC_ADDRESS, aO as UnsignedTx, a$ as WsChannel, b0 as WsChannelEvent, b1 as WsClientMessage, ac as WsConnectionStatus, ad as WsDataMessage, b7 as WsErrorCode, b8 as WsErrorMessage, af as WsOrderbookEvent, b3 as WsPingMessage, b5 as WsPongMessage, ae as WsPriceEvent, b4 as WsServerMessage, b2 as WsSubscribeMessage, b6 as WsSubscribedMessage, ag as WsTradeEvent, bt as buildClobAuthMessage, bL as buildClobPayload, bF as buildCtfExchangeDomain, bJ as buildOrderMessage, bv as buildPolymarketL2Headers, bK as buildSignedOrder, ai as createPredictClient, ak as createPredictWsClient, bw as derivePolymarketApiKey, bc as eventQueryKey, bd as fetchEvent, bh as fetchEventsPage, bl as fetchMarket, bq as fetchMatchMarketsPage, bo as fetchMatchesPage, bu as hmacSha256Base64, bg as infiniteEventsQueryKey, bk as marketQueryKey, bp as matchMarketsQueryKey, bn as matchQueryKey, bm as matchesQueryKey, bf as resolveEventsParams, be as resolveTagSlug } from './server-h41hs9SR.js';
|
package/dist/server.js
CHANGED
|
@@ -25,7 +25,8 @@ function resolveEventsParams(input = {}) {
|
|
|
25
25
|
minVolume,
|
|
26
26
|
minLiquidity,
|
|
27
27
|
timeRemaining,
|
|
28
|
-
markets_limit = 3
|
|
28
|
+
markets_limit = 3,
|
|
29
|
+
lang
|
|
29
30
|
} = input;
|
|
30
31
|
const tag_slug = resolveTagSlug(tagSlugSelection);
|
|
31
32
|
const min_volume = minVolume !== void 0 && minVolume !== "" ? Number(minVolume) : void 0;
|
|
@@ -42,7 +43,8 @@ function resolveEventsParams(input = {}) {
|
|
|
42
43
|
...min_volume !== void 0 && !isNaN(min_volume) ? { min_volume } : {},
|
|
43
44
|
...min_liquidity !== void 0 && !isNaN(min_liquidity) ? { min_liquidity } : {},
|
|
44
45
|
...end_before ? { end_before } : {},
|
|
45
|
-
...markets_limit ? { markets_limit } : {}
|
|
46
|
+
...markets_limit ? { markets_limit } : {},
|
|
47
|
+
...lang ? { lang } : {}
|
|
46
48
|
};
|
|
47
49
|
}
|
|
48
50
|
function infiniteEventsQueryKey(params) {
|
|
@@ -95,8 +97,20 @@ function buildQuery(params) {
|
|
|
95
97
|
return str ? `?${str}` : "";
|
|
96
98
|
}
|
|
97
99
|
var PredictClient = class {
|
|
98
|
-
constructor(endpoint) {
|
|
100
|
+
constructor(endpoint, options = {}) {
|
|
99
101
|
this.endpoint = endpoint;
|
|
102
|
+
this.options = options;
|
|
103
|
+
}
|
|
104
|
+
requestOptions(options) {
|
|
105
|
+
const baseHeaders = typeof this.options.headers === "function" ? this.options.headers() : this.options.headers;
|
|
106
|
+
if (!baseHeaders && !options) return void 0;
|
|
107
|
+
return {
|
|
108
|
+
...options,
|
|
109
|
+
headers: {
|
|
110
|
+
...baseHeaders ? Object.fromEntries(new Headers(baseHeaders)) : {},
|
|
111
|
+
...options?.headers ? Object.fromEntries(new Headers(options.headers)) : {}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
100
114
|
}
|
|
101
115
|
// -------------------------------------------------------------------------
|
|
102
116
|
// Events
|
|
@@ -112,7 +126,7 @@ var PredictClient = class {
|
|
|
112
126
|
async listEvents(params) {
|
|
113
127
|
const query = buildQuery(params ?? {});
|
|
114
128
|
const url = `${this.endpoint}/api/v1/events${query}`;
|
|
115
|
-
return await utils.httpGet(url);
|
|
129
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
116
130
|
}
|
|
117
131
|
/**
|
|
118
132
|
* Fetch a single prediction event by its slug.
|
|
@@ -128,7 +142,7 @@ var PredictClient = class {
|
|
|
128
142
|
async getEvent(slug, source) {
|
|
129
143
|
const query = source ? buildQuery({ source }) : "";
|
|
130
144
|
const url = `${this.endpoint}/api/v1/events/${encodeURIComponent(slug)}${query}`;
|
|
131
|
-
return await utils.httpGet(url);
|
|
145
|
+
return await utils.httpGet(url, this.requestOptions());
|
|
132
146
|
}
|
|
133
147
|
/**
|
|
134
148
|
* Fetch aggregate statistics for all open events.
|
|
@@ -619,8 +633,8 @@ var PredictClient = class {
|
|
|
619
633
|
return await utils.httpPost(url, body);
|
|
620
634
|
}
|
|
621
635
|
};
|
|
622
|
-
function createPredictClient(endpoint) {
|
|
623
|
-
return new PredictClient(endpoint);
|
|
636
|
+
function createPredictClient(endpoint, options) {
|
|
637
|
+
return new PredictClient(endpoint, options);
|
|
624
638
|
}
|
|
625
639
|
|
|
626
640
|
// src/client/ws.ts
|