@liberfi.io/ui-predict 0.1.88 → 0.1.90

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
@@ -12,7 +12,7 @@ declare global {
12
12
  };
13
13
  }
14
14
  }
15
- declare const _default: "0.1.88";
15
+ declare const _default: "0.1.90";
16
16
 
17
17
  /**
18
18
  * A single category entry in the static navigation model.
@@ -247,6 +247,8 @@ declare function EventDetailPage({ eventSlug, source, chain, walletAddress, onSi
247
247
  type TradeOutcome = "yes" | "no";
248
248
  type TradeSide = "buy" | "sell";
249
249
  type OrderType = "market" | "limit";
250
+ type ExpirationPreset = "5m" | "1h" | "12h" | "24h" | "eod" | "custom";
251
+ type DurationUnit = "minutes" | "hours" | "days";
250
252
  interface TradeFormValidation {
251
253
  isValid: boolean;
252
254
  errors: string[];
@@ -279,8 +281,16 @@ interface UseTradeFormResult {
279
281
  setOutcome: (outcome: TradeOutcome) => void;
280
282
  setSide: (side: TradeSide) => void;
281
283
  setOrderType: (type: OrderType) => void;
284
+ expirationEnabled: boolean;
285
+ expirationPreset: ExpirationPreset;
286
+ customDuration: number;
287
+ customDurationUnit: DurationUnit;
282
288
  setQuantity: (quantity: number) => void;
283
289
  setLimitPrice: (price: number) => void;
290
+ setExpirationEnabled: (enabled: boolean) => void;
291
+ setExpirationPreset: (preset: ExpirationPreset) => void;
292
+ setCustomDuration: (v: number) => void;
293
+ setCustomDurationUnit: (u: DurationUnit) => void;
284
294
  submit: () => void;
285
295
  }
286
296
  declare function useTradeForm({ market, initialOutcome, initialSide, }: UseTradeFormParams): UseTradeFormResult;
@@ -449,14 +459,22 @@ interface TradeFormUIProps {
449
459
  supportsLimitOrder: boolean;
450
460
  kycRequired: boolean;
451
461
  kycUrl: string | null;
462
+ expirationEnabled: boolean;
463
+ expirationPreset: ExpirationPreset;
464
+ customDuration: number;
465
+ customDurationUnit: DurationUnit;
452
466
  onOutcomeChange: (outcome: TradeOutcome) => void;
453
467
  onSideChange: (side: TradeSide) => void;
454
468
  onOrderTypeChange: (type: OrderType) => void;
455
469
  onQuantityChange: (quantity: number) => void;
456
470
  onLimitPriceChange: (price: number) => void;
471
+ onExpirationEnabledChange: (enabled: boolean) => void;
472
+ onExpirationPresetChange: (preset: ExpirationPreset) => void;
473
+ onCustomDurationChange: (v: number) => void;
474
+ onCustomDurationUnitChange: (u: DurationUnit) => void;
457
475
  onSubmit: () => void;
458
476
  }
459
- declare function TradeFormUI({ event, market, variant, outcome, side, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, yesTokenBalance, noTokenBalance, isBalanceLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, onOutcomeChange, onSideChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
477
+ declare function TradeFormUI({ event, market, variant, outcome, side, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, yesTokenBalance, noTokenBalance, isBalanceLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onSideChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
460
478
 
461
479
  interface TradeFormWidgetProps {
462
480
  event?: PredictEvent;
@@ -710,4 +728,4 @@ type PredictWalletProviderProps = PropsWithChildren<{
710
728
  }>;
711
729
  declare function PredictWalletProvider({ pollingInterval, enabled, children, }: PredictWalletProviderProps): react_jsx_runtime.JSX.Element;
712
730
 
713
- export { CHART_RANGE_DURATION, CHART_RANGE_PERIOD, CHART_RANGE_SAMPLE_INTERVAL, CandlestickPeriod, type CandlestickPeriodType, CategoriesSkeleton, CategoriesUI, type CategoriesUIProps, CategoriesWidget, type CategoriesWidgetProps, type CategoryItem, type CategoryListItem, type CategoryTagItem, ChartRange, type ChartRangeType, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, EventDetailPage, type EventDetailPageProps, EventDetailSkeleton, type EventDetailSkeletonProps, EventDetailUI, type EventDetailUIProps, EventDetailWidget, type EventDetailWidgetProps, EventItem, type EventItemProps, EventMarketDepthChartUI, type EventMarketDepthChartUIProps, EventMarketDetailWidget, type EventMarketDetailWidgetProps, EventPriceChart, type EventPriceChartProps, type EventsFilterState, EventsFilterUI, type EventsFilterUIProps, EventsPage, type EventsPageProps, EventsPageSkeleton, type EventsPageSkeletonProps, EventsSkeleton, type EventsSkeletonProps, EventsToolbarUI, type EventsToolbarUIProps, EventsUI, type EventsUIProps, EventsWidget, type EventsWidgetProps, MAX_PRICE_HISTORY_MARKETS, ORDER_MAX_PRICE, ORDER_MIN_PRICE, ORDER_MIN_QUANTITY, ORDER_PRICE_STEP, type OrderType, PREDICT_SEARCH_MODAL_ID, PREDICT_TRADE_MODAL_ID, PRICE_HISTORY_SAMPLE_INTERVAL, PredictSearchModal, type PredictSearchModalParams, type PredictSearchModalResult, PredictTradeModal, type PredictTradeModalParams, type PredictTradeModalResult, type PredictWalletContextValue, PredictWalletProvider, type PredictWalletProviderProps, PriceHistoryInterval, type PriceHistoryIntervalType, SORT_PRESETS, STATIC_CATEGORIES, SearchEventsButton, type SearchEventsButtonProps, SearchHistoryUI, type SearchHistoryUIProps, SearchHistoryWidget, type SearchHistoryWidgetProps, SearchInputUI, type SearchInputUIProps, SearchResultItemUI, type SearchResultItemUIProps, SearchResultListWidget, type SearchResultListWidgetProps, SearchWidget, type SearchWidgetProps, SimilarEventCard, type SimilarEventCardProps, SimilarEventsSection, type SimilarEventsSectionProps, type SortPreset, type TagItem, type TagSlugSelection, TradeFormSkeleton, TradeFormUI, type TradeFormUIProps, type TradeFormValidation, TradeFormWidget, type TradeFormWidgetProps, type TradeOutcome, type TradeSide, type UseEventDetailParams, type UseEventsInfiniteParams, type UseEventsInfiniteResult, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, countActiveFilters, formatKMB, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useTradeForm, _default as version };
731
+ export { CHART_RANGE_DURATION, CHART_RANGE_PERIOD, CHART_RANGE_SAMPLE_INTERVAL, CandlestickPeriod, type CandlestickPeriodType, CategoriesSkeleton, CategoriesUI, type CategoriesUIProps, CategoriesWidget, type CategoriesWidgetProps, type CategoryItem, type CategoryListItem, type CategoryTagItem, ChartRange, type ChartRangeType, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, type DurationUnit, EventDetailPage, type EventDetailPageProps, EventDetailSkeleton, type EventDetailSkeletonProps, EventDetailUI, type EventDetailUIProps, EventDetailWidget, type EventDetailWidgetProps, EventItem, type EventItemProps, EventMarketDepthChartUI, type EventMarketDepthChartUIProps, EventMarketDetailWidget, type EventMarketDetailWidgetProps, EventPriceChart, type EventPriceChartProps, type EventsFilterState, EventsFilterUI, type EventsFilterUIProps, EventsPage, type EventsPageProps, EventsPageSkeleton, type EventsPageSkeletonProps, EventsSkeleton, type EventsSkeletonProps, EventsToolbarUI, type EventsToolbarUIProps, EventsUI, type EventsUIProps, EventsWidget, type EventsWidgetProps, type ExpirationPreset, MAX_PRICE_HISTORY_MARKETS, ORDER_MAX_PRICE, ORDER_MIN_PRICE, ORDER_MIN_QUANTITY, ORDER_PRICE_STEP, type OrderType, PREDICT_SEARCH_MODAL_ID, PREDICT_TRADE_MODAL_ID, PRICE_HISTORY_SAMPLE_INTERVAL, PredictSearchModal, type PredictSearchModalParams, type PredictSearchModalResult, PredictTradeModal, type PredictTradeModalParams, type PredictTradeModalResult, type PredictWalletContextValue, PredictWalletProvider, type PredictWalletProviderProps, PriceHistoryInterval, type PriceHistoryIntervalType, SORT_PRESETS, STATIC_CATEGORIES, SearchEventsButton, type SearchEventsButtonProps, SearchHistoryUI, type SearchHistoryUIProps, SearchHistoryWidget, type SearchHistoryWidgetProps, SearchInputUI, type SearchInputUIProps, SearchResultItemUI, type SearchResultItemUIProps, SearchResultListWidget, type SearchResultListWidgetProps, SearchWidget, type SearchWidgetProps, SimilarEventCard, type SimilarEventCardProps, SimilarEventsSection, type SimilarEventsSectionProps, type SortPreset, type TagItem, type TagSlugSelection, TradeFormSkeleton, TradeFormUI, type TradeFormUIProps, type TradeFormValidation, TradeFormWidget, type TradeFormWidgetProps, type TradeOutcome, type TradeSide, type UseEventDetailParams, type UseEventsInfiniteParams, type UseEventsInfiniteResult, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, countActiveFilters, formatKMB, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useTradeForm, _default as version };
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ declare global {
12
12
  };
13
13
  }
14
14
  }
15
- declare const _default: "0.1.88";
15
+ declare const _default: "0.1.90";
16
16
 
17
17
  /**
18
18
  * A single category entry in the static navigation model.
@@ -247,6 +247,8 @@ declare function EventDetailPage({ eventSlug, source, chain, walletAddress, onSi
247
247
  type TradeOutcome = "yes" | "no";
248
248
  type TradeSide = "buy" | "sell";
249
249
  type OrderType = "market" | "limit";
250
+ type ExpirationPreset = "5m" | "1h" | "12h" | "24h" | "eod" | "custom";
251
+ type DurationUnit = "minutes" | "hours" | "days";
250
252
  interface TradeFormValidation {
251
253
  isValid: boolean;
252
254
  errors: string[];
@@ -279,8 +281,16 @@ interface UseTradeFormResult {
279
281
  setOutcome: (outcome: TradeOutcome) => void;
280
282
  setSide: (side: TradeSide) => void;
281
283
  setOrderType: (type: OrderType) => void;
284
+ expirationEnabled: boolean;
285
+ expirationPreset: ExpirationPreset;
286
+ customDuration: number;
287
+ customDurationUnit: DurationUnit;
282
288
  setQuantity: (quantity: number) => void;
283
289
  setLimitPrice: (price: number) => void;
290
+ setExpirationEnabled: (enabled: boolean) => void;
291
+ setExpirationPreset: (preset: ExpirationPreset) => void;
292
+ setCustomDuration: (v: number) => void;
293
+ setCustomDurationUnit: (u: DurationUnit) => void;
284
294
  submit: () => void;
285
295
  }
286
296
  declare function useTradeForm({ market, initialOutcome, initialSide, }: UseTradeFormParams): UseTradeFormResult;
@@ -449,14 +459,22 @@ interface TradeFormUIProps {
449
459
  supportsLimitOrder: boolean;
450
460
  kycRequired: boolean;
451
461
  kycUrl: string | null;
462
+ expirationEnabled: boolean;
463
+ expirationPreset: ExpirationPreset;
464
+ customDuration: number;
465
+ customDurationUnit: DurationUnit;
452
466
  onOutcomeChange: (outcome: TradeOutcome) => void;
453
467
  onSideChange: (side: TradeSide) => void;
454
468
  onOrderTypeChange: (type: OrderType) => void;
455
469
  onQuantityChange: (quantity: number) => void;
456
470
  onLimitPriceChange: (price: number) => void;
471
+ onExpirationEnabledChange: (enabled: boolean) => void;
472
+ onExpirationPresetChange: (preset: ExpirationPreset) => void;
473
+ onCustomDurationChange: (v: number) => void;
474
+ onCustomDurationUnitChange: (u: DurationUnit) => void;
457
475
  onSubmit: () => void;
458
476
  }
459
- declare function TradeFormUI({ event, market, variant, outcome, side, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, yesTokenBalance, noTokenBalance, isBalanceLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, onOutcomeChange, onSideChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
477
+ declare function TradeFormUI({ event, market, variant, outcome, side, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, yesTokenBalance, noTokenBalance, isBalanceLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onSideChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
460
478
 
461
479
  interface TradeFormWidgetProps {
462
480
  event?: PredictEvent;
@@ -710,4 +728,4 @@ type PredictWalletProviderProps = PropsWithChildren<{
710
728
  }>;
711
729
  declare function PredictWalletProvider({ pollingInterval, enabled, children, }: PredictWalletProviderProps): react_jsx_runtime.JSX.Element;
712
730
 
713
- export { CHART_RANGE_DURATION, CHART_RANGE_PERIOD, CHART_RANGE_SAMPLE_INTERVAL, CandlestickPeriod, type CandlestickPeriodType, CategoriesSkeleton, CategoriesUI, type CategoriesUIProps, CategoriesWidget, type CategoriesWidgetProps, type CategoryItem, type CategoryListItem, type CategoryTagItem, ChartRange, type ChartRangeType, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, EventDetailPage, type EventDetailPageProps, EventDetailSkeleton, type EventDetailSkeletonProps, EventDetailUI, type EventDetailUIProps, EventDetailWidget, type EventDetailWidgetProps, EventItem, type EventItemProps, EventMarketDepthChartUI, type EventMarketDepthChartUIProps, EventMarketDetailWidget, type EventMarketDetailWidgetProps, EventPriceChart, type EventPriceChartProps, type EventsFilterState, EventsFilterUI, type EventsFilterUIProps, EventsPage, type EventsPageProps, EventsPageSkeleton, type EventsPageSkeletonProps, EventsSkeleton, type EventsSkeletonProps, EventsToolbarUI, type EventsToolbarUIProps, EventsUI, type EventsUIProps, EventsWidget, type EventsWidgetProps, MAX_PRICE_HISTORY_MARKETS, ORDER_MAX_PRICE, ORDER_MIN_PRICE, ORDER_MIN_QUANTITY, ORDER_PRICE_STEP, type OrderType, PREDICT_SEARCH_MODAL_ID, PREDICT_TRADE_MODAL_ID, PRICE_HISTORY_SAMPLE_INTERVAL, PredictSearchModal, type PredictSearchModalParams, type PredictSearchModalResult, PredictTradeModal, type PredictTradeModalParams, type PredictTradeModalResult, type PredictWalletContextValue, PredictWalletProvider, type PredictWalletProviderProps, PriceHistoryInterval, type PriceHistoryIntervalType, SORT_PRESETS, STATIC_CATEGORIES, SearchEventsButton, type SearchEventsButtonProps, SearchHistoryUI, type SearchHistoryUIProps, SearchHistoryWidget, type SearchHistoryWidgetProps, SearchInputUI, type SearchInputUIProps, SearchResultItemUI, type SearchResultItemUIProps, SearchResultListWidget, type SearchResultListWidgetProps, SearchWidget, type SearchWidgetProps, SimilarEventCard, type SimilarEventCardProps, SimilarEventsSection, type SimilarEventsSectionProps, type SortPreset, type TagItem, type TagSlugSelection, TradeFormSkeleton, TradeFormUI, type TradeFormUIProps, type TradeFormValidation, TradeFormWidget, type TradeFormWidgetProps, type TradeOutcome, type TradeSide, type UseEventDetailParams, type UseEventsInfiniteParams, type UseEventsInfiniteResult, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, countActiveFilters, formatKMB, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useTradeForm, _default as version };
731
+ export { CHART_RANGE_DURATION, CHART_RANGE_PERIOD, CHART_RANGE_SAMPLE_INTERVAL, CandlestickPeriod, type CandlestickPeriodType, CategoriesSkeleton, CategoriesUI, type CategoriesUIProps, CategoriesWidget, type CategoriesWidgetProps, type CategoryItem, type CategoryListItem, type CategoryTagItem, ChartRange, type ChartRangeType, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, type DurationUnit, EventDetailPage, type EventDetailPageProps, EventDetailSkeleton, type EventDetailSkeletonProps, EventDetailUI, type EventDetailUIProps, EventDetailWidget, type EventDetailWidgetProps, EventItem, type EventItemProps, EventMarketDepthChartUI, type EventMarketDepthChartUIProps, EventMarketDetailWidget, type EventMarketDetailWidgetProps, EventPriceChart, type EventPriceChartProps, type EventsFilterState, EventsFilterUI, type EventsFilterUIProps, EventsPage, type EventsPageProps, EventsPageSkeleton, type EventsPageSkeletonProps, EventsSkeleton, type EventsSkeletonProps, EventsToolbarUI, type EventsToolbarUIProps, EventsUI, type EventsUIProps, EventsWidget, type EventsWidgetProps, type ExpirationPreset, MAX_PRICE_HISTORY_MARKETS, ORDER_MAX_PRICE, ORDER_MIN_PRICE, ORDER_MIN_QUANTITY, ORDER_PRICE_STEP, type OrderType, PREDICT_SEARCH_MODAL_ID, PREDICT_TRADE_MODAL_ID, PRICE_HISTORY_SAMPLE_INTERVAL, PredictSearchModal, type PredictSearchModalParams, type PredictSearchModalResult, PredictTradeModal, type PredictTradeModalParams, type PredictTradeModalResult, type PredictWalletContextValue, PredictWalletProvider, type PredictWalletProviderProps, PriceHistoryInterval, type PriceHistoryIntervalType, SORT_PRESETS, STATIC_CATEGORIES, SearchEventsButton, type SearchEventsButtonProps, SearchHistoryUI, type SearchHistoryUIProps, SearchHistoryWidget, type SearchHistoryWidgetProps, SearchInputUI, type SearchInputUIProps, SearchResultItemUI, type SearchResultItemUIProps, SearchResultListWidget, type SearchResultListWidgetProps, SearchWidget, type SearchWidgetProps, SimilarEventCard, type SimilarEventCardProps, SimilarEventsSection, type SimilarEventsSectionProps, type SortPreset, type TagItem, type TagSlugSelection, TradeFormSkeleton, TradeFormUI, type TradeFormUIProps, type TradeFormValidation, TradeFormWidget, type TradeFormWidgetProps, type TradeOutcome, type TradeSide, type UseEventDetailParams, type UseEventsInfiniteParams, type UseEventsInfiniteResult, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, countActiveFilters, formatKMB, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useTradeForm, _default as version };