@liberfi.io/react-predict 0.1.11 → 0.1.12

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-cst0UoFG.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-cst0UoFG.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-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';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { PropsWithChildren } from 'react';
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-cst0UoFG.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-cst0UoFG.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-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';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { PropsWithChildren } from 'react';
package/dist/index.js CHANGED
@@ -747,6 +747,11 @@ function resolveTagSlug(selection) {
747
747
  if (!selection) return void 0;
748
748
  return selection.tagSlug ?? selection.categorySlug ?? void 0;
749
749
  }
750
+ function resolveEndBefore(timeRemaining) {
751
+ if (!timeRemaining) return void 0;
752
+ const days = timeRemaining === "1d" ? 1 : timeRemaining === "7d" ? 7 : 30;
753
+ return new Date(Date.now() + days * 24 * 60 * 60 * 1e3).toISOString();
754
+ }
750
755
  function resolveEventsParams(input = {}) {
751
756
  const {
752
757
  tagSlugSelection,
@@ -755,9 +760,15 @@ function resolveEventsParams(input = {}) {
755
760
  with_markets = true,
756
761
  source,
757
762
  sort_by,
758
- sort_asc
763
+ sort_asc,
764
+ minVolume,
765
+ minLiquidity,
766
+ timeRemaining
759
767
  } = input;
760
768
  const tag_slug = resolveTagSlug(tagSlugSelection);
769
+ const min_volume = minVolume !== void 0 && minVolume !== "" ? Number(minVolume) : void 0;
770
+ const min_liquidity = minLiquidity !== void 0 && minLiquidity !== "" ? Number(minLiquidity) : void 0;
771
+ const end_before = resolveEndBefore(timeRemaining);
761
772
  return {
762
773
  limit,
763
774
  status,
@@ -765,7 +776,10 @@ function resolveEventsParams(input = {}) {
765
776
  ...source ? { source } : {},
766
777
  ...tag_slug ? { tag_slug } : {},
767
778
  ...sort_by ? { sort_by } : {},
768
- ...sort_asc !== void 0 ? { sort_asc } : {}
779
+ ...sort_asc !== void 0 ? { sort_asc } : {},
780
+ ...min_volume !== void 0 && !isNaN(min_volume) ? { min_volume } : {},
781
+ ...min_liquidity !== void 0 && !isNaN(min_liquidity) ? { min_liquidity } : {},
782
+ ...end_before ? { end_before } : {}
769
783
  };
770
784
  }
771
785
  function infiniteEventsQueryKey(params) {