@liberfi.io/react-predict 0.1.14 → 0.1.16

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 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 EventStatus, S as SimilarEventsParams, e as PredictMarket, O as Orderbook, f as ListMarketTradesParams, g as PredictTrade, h as PriceHistoryRange, i as PriceHistoryResponse, j as ListCandlesticksParams, C as Candlestick, k as PositionsResponse, B as BalanceResponse, l as ListOrdersParams, m as PredictOrder, n as CancelOrderResult, o as ListTradesParams, D as DFlowQuoteRequest, p as DFlowQuoteResponse, q as DFlowSubmitResponse, r as DFlowSubmitRequest, s as DFlowKYCStatus, W as WsConnectionStatus, t as WsDataMessage, u as WsPriceEvent, v as WsOrderbookEvent, w as WsTradeEvent, x as CreateOrderInput } from './server-9UGzVqNH.mjs';
2
- export { as as BuildClobAuthMessageInput, aD as BuildOrderMessageInput, aF as BuildSignedOrderInput, aj as CLOB_AUTH_DOMAIN, ak as CLOB_AUTH_TYPES, at as CTF_EXCHANGE_ADDRESS, ay as CTF_ORDER_TYPES, Z as DFlowOrderContext, K as EventSortField, Q as EventSummary, ap as HttpMethod, J as MarketOutcome, I as MarketResult, M as MarketStatus, R as MarketSummary, au as NEG_RISK_CTF_EXCHANGE_ADDRESS, az as ORDER_TYPE, aE as OrderMessage, Y as OrderSide, X as OrderStatus, N as OrderbookLevel, aw as POLYGON_CHAIN_ID, ar as PolymarketL2Headers, aq as PolymarketL2HeadersInput, _ as PolymarketOrderType, V as PredictPosition, G as PredictTag, A as PredictWsClientConfig, U as PricePoint, F as ProviderMeta, af as ResolveEventsParamsInput, aA as SIDE, H as SettlementSource, aG as SignedOrder, ag as TagSlugSelection, T as TradeType, av as USDC_ADDRESS, $ as WsChannel, a0 as WsChannelEvent, a1 as WsClientMessage, a7 as WsErrorCode, a8 as WsErrorMessage, a3 as WsPingMessage, a5 as WsPongMessage, a4 as WsServerMessage, a2 as WsSubscribeMessage, a6 as WsSubscribedMessage, al as buildClobAuthMessage, ax as buildCtfExchangeDomain, aB as buildOrderMessage, an as buildPolymarketL2Headers, aC as buildSignedOrder, y as createPredictClient, z as createPredictWsClient, ao as derivePolymarketApiKey, a9 as eventQueryKey, aa as fetchEvent, ae as fetchEventsPage, ai as fetchMarket, am as hmacSha256Base64, ad as infiniteEventsQueryKey, ah as marketQueryKey, ac as resolveEventsParams, ab as resolveTagSlug } from './server-9UGzVqNH.mjs';
1
+ import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStatus, S as SimilarEventsParams, e as PredictMarket, O as Orderbook, f as ListMarketTradesParams, g as PredictTrade, h as PriceHistoryRange, i as PriceHistoryResponse, j as ListCandlesticksParams, C as Candlestick, k as PositionsResponse, B as BalanceResponse, l as ListOrdersParams, m as PredictOrder, n as CancelOrderResult, o as ListTradesParams, D as DFlowQuoteRequest, p as DFlowQuoteResponse, q as DFlowSubmitResponse, r as DFlowSubmitRequest, s as DFlowKYCStatus, W as WsConnectionStatus, t as WsDataMessage, u as WsPriceEvent, v as WsOrderbookEvent, w as WsTradeEvent, x as CreateOrderInput } from './server-C52oqeh8.mjs';
2
+ export { as as BuildClobAuthMessageInput, aD as BuildOrderMessageInput, aF as BuildSignedOrderInput, aj as CLOB_AUTH_DOMAIN, ak as CLOB_AUTH_TYPES, at as CTF_EXCHANGE_ADDRESS, ay as CTF_ORDER_TYPES, Z as DFlowOrderContext, K as EventSortField, Q as EventSummary, ap as HttpMethod, J as MarketOutcome, I as MarketResult, M as MarketStatus, R as MarketSummary, au as NEG_RISK_CTF_EXCHANGE_ADDRESS, az as ORDER_TYPE, aE as OrderMessage, Y as OrderSide, X as OrderStatus, N as OrderbookLevel, aw as POLYGON_CHAIN_ID, ar as PolymarketL2Headers, aq as PolymarketL2HeadersInput, _ as PolymarketOrderType, V as PredictPosition, G as PredictTag, A as PredictWsClientConfig, U as PricePoint, F as ProviderMeta, af as ResolveEventsParamsInput, aA as SIDE, H as SettlementSource, aG as SignedOrder, ag as TagSlugSelection, T as TradeType, av as USDC_ADDRESS, $ as WsChannel, a0 as WsChannelEvent, a1 as WsClientMessage, a7 as WsErrorCode, a8 as WsErrorMessage, a3 as WsPingMessage, a5 as WsPongMessage, a4 as WsServerMessage, a2 as WsSubscribeMessage, a6 as WsSubscribedMessage, al as buildClobAuthMessage, ax as buildCtfExchangeDomain, aB as buildOrderMessage, an as buildPolymarketL2Headers, aC as buildSignedOrder, y as createPredictClient, z as createPredictWsClient, ao as derivePolymarketApiKey, a9 as eventQueryKey, aa as fetchEvent, ae as fetchEventsPage, ai as fetchMarket, am as hmacSha256Base64, ad as infiniteEventsQueryKey, ah as marketQueryKey, ac as resolveEventsParams, ab as resolveTagSlug } from './server-C52oqeh8.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';
@@ -201,7 +201,7 @@ interface UseEventParams {
201
201
  *
202
202
  * @example
203
203
  * ```tsx
204
- * const { data, isLoading } = useEvent({ slug: "CONTROLH-2026", source: "dflow" });
204
+ * const { data, isLoading } = useEvent({ slug: "CONTROLH-2026", source: "kalshi" });
205
205
  * ```
206
206
  */
207
207
  declare function useEvent(params: UseEventParams, queryOptions?: Omit<UseQueryOptions<PredictEvent, Error, PredictEvent, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictEvent, Error>;
@@ -269,7 +269,7 @@ interface UseMarketParams {
269
269
  *
270
270
  * @example
271
271
  * ```tsx
272
- * const { data, isLoading } = useMarket({ slug: "KXBTCD-25FEB-T68000-yes", source: "dflow" });
272
+ * const { data, isLoading } = useMarket({ slug: "KXBTCD-25FEB-T68000-yes", source: "kalshi" });
273
273
  * ```
274
274
  */
275
275
  declare function useMarket(params: UseMarketParams, queryOptions?: Omit<UseQueryOptions<PredictMarket, Error, PredictMarket, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictMarket, Error>;
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 EventStatus, S as SimilarEventsParams, e as PredictMarket, O as Orderbook, f as ListMarketTradesParams, g as PredictTrade, h as PriceHistoryRange, i as PriceHistoryResponse, j as ListCandlesticksParams, C as Candlestick, k as PositionsResponse, B as BalanceResponse, l as ListOrdersParams, m as PredictOrder, n as CancelOrderResult, o as ListTradesParams, D as DFlowQuoteRequest, p as DFlowQuoteResponse, q as DFlowSubmitResponse, r as DFlowSubmitRequest, s as DFlowKYCStatus, W as WsConnectionStatus, t as WsDataMessage, u as WsPriceEvent, v as WsOrderbookEvent, w as WsTradeEvent, x as CreateOrderInput } from './server-9UGzVqNH.js';
2
- export { as as BuildClobAuthMessageInput, aD as BuildOrderMessageInput, aF as BuildSignedOrderInput, aj as CLOB_AUTH_DOMAIN, ak as CLOB_AUTH_TYPES, at as CTF_EXCHANGE_ADDRESS, ay as CTF_ORDER_TYPES, Z as DFlowOrderContext, K as EventSortField, Q as EventSummary, ap as HttpMethod, J as MarketOutcome, I as MarketResult, M as MarketStatus, R as MarketSummary, au as NEG_RISK_CTF_EXCHANGE_ADDRESS, az as ORDER_TYPE, aE as OrderMessage, Y as OrderSide, X as OrderStatus, N as OrderbookLevel, aw as POLYGON_CHAIN_ID, ar as PolymarketL2Headers, aq as PolymarketL2HeadersInput, _ as PolymarketOrderType, V as PredictPosition, G as PredictTag, A as PredictWsClientConfig, U as PricePoint, F as ProviderMeta, af as ResolveEventsParamsInput, aA as SIDE, H as SettlementSource, aG as SignedOrder, ag as TagSlugSelection, T as TradeType, av as USDC_ADDRESS, $ as WsChannel, a0 as WsChannelEvent, a1 as WsClientMessage, a7 as WsErrorCode, a8 as WsErrorMessage, a3 as WsPingMessage, a5 as WsPongMessage, a4 as WsServerMessage, a2 as WsSubscribeMessage, a6 as WsSubscribedMessage, al as buildClobAuthMessage, ax as buildCtfExchangeDomain, aB as buildOrderMessage, an as buildPolymarketL2Headers, aC as buildSignedOrder, y as createPredictClient, z as createPredictWsClient, ao as derivePolymarketApiKey, a9 as eventQueryKey, aa as fetchEvent, ae as fetchEventsPage, ai as fetchMarket, am as hmacSha256Base64, ad as infiniteEventsQueryKey, ah as marketQueryKey, ac as resolveEventsParams, ab as resolveTagSlug } from './server-9UGzVqNH.js';
1
+ import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStatus, S as SimilarEventsParams, e as PredictMarket, O as Orderbook, f as ListMarketTradesParams, g as PredictTrade, h as PriceHistoryRange, i as PriceHistoryResponse, j as ListCandlesticksParams, C as Candlestick, k as PositionsResponse, B as BalanceResponse, l as ListOrdersParams, m as PredictOrder, n as CancelOrderResult, o as ListTradesParams, D as DFlowQuoteRequest, p as DFlowQuoteResponse, q as DFlowSubmitResponse, r as DFlowSubmitRequest, s as DFlowKYCStatus, W as WsConnectionStatus, t as WsDataMessage, u as WsPriceEvent, v as WsOrderbookEvent, w as WsTradeEvent, x as CreateOrderInput } from './server-C52oqeh8.js';
2
+ export { as as BuildClobAuthMessageInput, aD as BuildOrderMessageInput, aF as BuildSignedOrderInput, aj as CLOB_AUTH_DOMAIN, ak as CLOB_AUTH_TYPES, at as CTF_EXCHANGE_ADDRESS, ay as CTF_ORDER_TYPES, Z as DFlowOrderContext, K as EventSortField, Q as EventSummary, ap as HttpMethod, J as MarketOutcome, I as MarketResult, M as MarketStatus, R as MarketSummary, au as NEG_RISK_CTF_EXCHANGE_ADDRESS, az as ORDER_TYPE, aE as OrderMessage, Y as OrderSide, X as OrderStatus, N as OrderbookLevel, aw as POLYGON_CHAIN_ID, ar as PolymarketL2Headers, aq as PolymarketL2HeadersInput, _ as PolymarketOrderType, V as PredictPosition, G as PredictTag, A as PredictWsClientConfig, U as PricePoint, F as ProviderMeta, af as ResolveEventsParamsInput, aA as SIDE, H as SettlementSource, aG as SignedOrder, ag as TagSlugSelection, T as TradeType, av as USDC_ADDRESS, $ as WsChannel, a0 as WsChannelEvent, a1 as WsClientMessage, a7 as WsErrorCode, a8 as WsErrorMessage, a3 as WsPingMessage, a5 as WsPongMessage, a4 as WsServerMessage, a2 as WsSubscribeMessage, a6 as WsSubscribedMessage, al as buildClobAuthMessage, ax as buildCtfExchangeDomain, aB as buildOrderMessage, an as buildPolymarketL2Headers, aC as buildSignedOrder, y as createPredictClient, z as createPredictWsClient, ao as derivePolymarketApiKey, a9 as eventQueryKey, aa as fetchEvent, ae as fetchEventsPage, ai as fetchMarket, am as hmacSha256Base64, ad as infiniteEventsQueryKey, ah as marketQueryKey, ac as resolveEventsParams, ab as resolveTagSlug } from './server-C52oqeh8.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';
@@ -201,7 +201,7 @@ interface UseEventParams {
201
201
  *
202
202
  * @example
203
203
  * ```tsx
204
- * const { data, isLoading } = useEvent({ slug: "CONTROLH-2026", source: "dflow" });
204
+ * const { data, isLoading } = useEvent({ slug: "CONTROLH-2026", source: "kalshi" });
205
205
  * ```
206
206
  */
207
207
  declare function useEvent(params: UseEventParams, queryOptions?: Omit<UseQueryOptions<PredictEvent, Error, PredictEvent, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictEvent, Error>;
@@ -269,7 +269,7 @@ interface UseMarketParams {
269
269
  *
270
270
  * @example
271
271
  * ```tsx
272
- * const { data, isLoading } = useMarket({ slug: "KXBTCD-25FEB-T68000-yes", source: "dflow" });
272
+ * const { data, isLoading } = useMarket({ slug: "KXBTCD-25FEB-T68000-yes", source: "kalshi" });
273
273
  * ```
274
274
  */
275
275
  declare function useMarket(params: UseMarketParams, queryOptions?: Omit<UseQueryOptions<PredictMarket, Error, PredictMarket, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictMarket, Error>;
package/dist/index.js CHANGED
@@ -42,8 +42,8 @@ var PredictClient = class {
42
42
  * Maps to `GET /api/v1/events/:slug?source=...`.
43
43
  *
44
44
  * @param slug - Canonical event slug (e.g. "will-trump-win-2024" for Polymarket
45
- * or "KXBTCD-25FEB-T68000" for DFlow).
46
- * @param source - Upstream provider (`"dflow"` or `"polymarket"`).
45
+ * or "KXBTCD-25FEB-T68000" for Kalshi).
46
+ * @param source - Upstream provider (`"kalshi"` or `"polymarket"`).
47
47
  * @returns The matching event.
48
48
  * @throws When the server responds with 404 or any other non-2xx status.
49
49
  */
@@ -71,7 +71,7 @@ var PredictClient = class {
71
71
  * Maps to `GET /api/v1/markets/:slug?source=...`.
72
72
  *
73
73
  * @param slug - Canonical market slug.
74
- * @param source - Upstream provider (`"dflow"` or `"polymarket"`).
74
+ * @param source - Upstream provider (`"kalshi"` or `"polymarket"`).
75
75
  * @returns The matching market.
76
76
  * @throws When the server responds with 404 or any other non-2xx status.
77
77
  */
@@ -126,7 +126,7 @@ var PredictClient = class {
126
126
  *
127
127
  * Maps to `GET /api/v1/balance?source=...&user=...`.
128
128
  *
129
- * @param source - Provider source (`"dflow"` for Solana, `"polymarket"` for Polygon).
129
+ * @param source - Provider source (`"kalshi"` for Solana, `"polymarket"` for Polygon).
130
130
  * @param user - Wallet address.
131
131
  */
132
132
  async getBalance(source, user) {
@@ -179,14 +179,14 @@ var PredictClient = class {
179
179
  // -------------------------------------------------------------------------
180
180
  // DFlow trading
181
181
  // -------------------------------------------------------------------------
182
- /** Maps to `POST /api/v1/orders/dflow/quote`. */
182
+ /** Maps to `POST /api/v1/orders/kalshi/quote`. */
183
183
  async createDFlowQuote(body) {
184
- const url = `${this.endpoint}/api/v1/orders/dflow/quote`;
184
+ const url = `${this.endpoint}/api/v1/orders/kalshi/quote`;
185
185
  return await utils.httpPost(url, body);
186
186
  }
187
- /** Maps to `POST /api/v1/orders/dflow/submit`. */
187
+ /** Maps to `POST /api/v1/orders/kalshi/submit`. */
188
188
  async submitDFlowTransaction(body) {
189
- const url = `${this.endpoint}/api/v1/orders/dflow/submit`;
189
+ const url = `${this.endpoint}/api/v1/orders/kalshi/submit`;
190
190
  return await utils.httpPost(url, body);
191
191
  }
192
192
  // -------------------------------------------------------------------------
@@ -195,11 +195,11 @@ var PredictClient = class {
195
195
  /**
196
196
  * Check DFlow KYC verification status for a wallet address.
197
197
  *
198
- * Maps to `GET /api/v1/kyc/dflow?wallet_address=...`.
198
+ * Maps to `GET /api/v1/kyc/kalshi?wallet_address=...`.
199
199
  */
200
200
  async checkDFlowKYC(walletAddress) {
201
201
  const query = buildQuery({ wallet_address: walletAddress });
202
- const url = `${this.endpoint}/api/v1/kyc/dflow${query}`;
202
+ const url = `${this.endpoint}/api/v1/kyc/kalshi${query}`;
203
203
  return await utils.httpGet(url);
204
204
  }
205
205
  // -------------------------------------------------------------------------
@@ -1346,7 +1346,7 @@ function useRealtimeTrades({
1346
1346
  if (!old) return old;
1347
1347
  const syntheticTrade = {
1348
1348
  id: trade.trade_id ?? `ws-${msg.ts}`,
1349
- source: "dflow",
1349
+ source: "kalshi",
1350
1350
  side: trade.side,
1351
1351
  outcome: trade.outcome ?? "",
1352
1352
  outcome_index: 0,