@liberfi.io/ui-predict 4.0.38 → 4.0.39

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
@@ -279,13 +279,19 @@ interface EventDetailPageProps {
279
279
  * Wallet / deposit flow.
280
280
  */
281
281
  onInsufficientBalance?: (source: ProviderSource) => void;
282
+ /**
283
+ * Forwarded to the inline SellFormWidget and the mobile sell modal: invoked
284
+ * when the user attempts to sell while the Polymarket account still needs
285
+ * setup (deploy + approve). Use this to open the account setup modal.
286
+ */
287
+ onSetupRequired?: () => void;
282
288
  /**
283
289
  * Maximum tolerated slippage for market orders, in basis points
284
290
  * (100 = 1%). Forwarded to both buy and sell forms. Defaults to 100 bps.
285
291
  */
286
292
  slippageBps?: number;
287
293
  }
288
- declare function EventDetailPage({ eventSlug, source, chain, walletAddress, onSimilarEventClick, onSimilarEventHover, onBack, renderActivitySection, onInsufficientBalance, slippageBps, }: EventDetailPageProps): react_jsx_runtime.JSX.Element;
294
+ declare function EventDetailPage({ eventSlug, source, chain, walletAddress, onSimilarEventClick, onSimilarEventHover, onBack, renderActivitySection, onInsufficientBalance, onSetupRequired, slippageBps, }: EventDetailPageProps): react_jsx_runtime.JSX.Element;
289
295
 
290
296
  type TradeOutcome = "yes" | "no";
291
297
  type TradeSide = "buy" | "sell";
@@ -360,6 +366,8 @@ interface UseTradeFormResult {
360
366
  isBalanceLoading: boolean;
361
367
  isMarketDataLoading: boolean;
362
368
  isSubmitting: boolean;
369
+ /** Current authentication status, used to drive the submit-button states. */
370
+ authStatus: "unauthenticated" | "authenticating" | "authenticated" | "deauthenticating";
363
371
  validation: TradeFormValidation;
364
372
  /** True when the user has entered an amount that exceeds the available USDC balance. */
365
373
  isInsufficientBalance: boolean;
@@ -367,6 +375,17 @@ interface UseTradeFormResult {
367
375
  source: ProviderSource;
368
376
  supportsLimitOrder: boolean;
369
377
  kycRequired: boolean;
378
+ /**
379
+ * True when the market's source requires identity verification (KYC) and the
380
+ * user has not completed it yet. Used to gate the deposit flow behind KYC.
381
+ */
382
+ needsKyc: boolean;
383
+ /**
384
+ * True when the market's source requires an on-chain account setup (e.g.
385
+ * Polymarket deposit/Safe wallet deployment + token approval) that the user
386
+ * has not completed yet. Used to gate trading behind account setup.
387
+ */
388
+ needsSetup: boolean;
370
389
  kycUrl: string | null;
371
390
  setOutcome: (outcome: TradeOutcome) => void;
372
391
  setOrderType: (type: OrderType) => void;
@@ -673,6 +692,8 @@ interface TradeFormUIProps {
673
692
  potentialProfit: number;
674
693
  isMarketDataLoading: boolean;
675
694
  isSubmitting: boolean;
695
+ /** Auth status driving the login/checking/normal submit-button states. */
696
+ authStatus: "unauthenticated" | "authenticating" | "authenticated" | "deauthenticating";
676
697
  usdcBalance: number | null;
677
698
  isBalanceLoading: boolean;
678
699
  isValid: boolean;
@@ -683,6 +704,10 @@ interface TradeFormUIProps {
683
704
  onInsufficientBalance?: () => void;
684
705
  supportsLimitOrder: boolean;
685
706
  kycRequired: boolean;
707
+ /** True when the user must complete KYC before the deposit flow is allowed. */
708
+ needsKyc: boolean;
709
+ /** True when the user must set up (deploy) their Polymarket account first. */
710
+ needsSetup: boolean;
686
711
  kycUrl: string | null;
687
712
  expirationEnabled: boolean;
688
713
  expirationPreset: ExpirationPreset;
@@ -698,7 +723,7 @@ interface TradeFormUIProps {
698
723
  onCustomDurationUnitChange: (u: DurationUnit) => void;
699
724
  onSubmit: () => void;
700
725
  }
701
- declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, isValid, validationErrors, isInsufficientBalance, onInsufficientBalance, supportsLimitOrder, kycRequired, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
726
+ declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, isInsufficientBalance, onInsufficientBalance, supportsLimitOrder, kycRequired, needsKyc, needsSetup, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
702
727
 
703
728
  interface TradeFormWidgetProps {
704
729
  event?: PredictEvent;
@@ -729,6 +754,11 @@ type PredictSellModalParams = {
729
754
  chain?: string;
730
755
  /** Forwarded slippage tolerance (basis points). */
731
756
  slippageBps?: number;
757
+ /**
758
+ * Invoked when the Polymarket account still needs setup (deploy + approve).
759
+ * The consumer should open the account setup modal.
760
+ */
761
+ onSetupRequired?: () => void;
732
762
  };
733
763
  type PredictSellModalResult = void;
734
764
  declare const PREDICT_SELL_MODAL_ID = "predict-sell";
@@ -747,6 +777,8 @@ interface UseSellFormParams {
747
777
  * Defaults to 100 bps. Use `0` to disable the check (not recommended).
748
778
  */
749
779
  slippageBps?: number;
780
+ /** Called after a sell order completes successfully (e.g. to close a modal). */
781
+ onSuccess?: () => void;
750
782
  }
751
783
  interface UseSellFormResult {
752
784
  outcome: TradeOutcome;
@@ -762,9 +794,15 @@ interface UseSellFormResult {
762
794
  pricePerShare: number;
763
795
  isMarketDataLoading: boolean;
764
796
  isSubmitting: boolean;
797
+ /** Current authentication status, used to drive the submit-button states. */
798
+ authStatus: "unauthenticated" | "authenticating" | "authenticated" | "deauthenticating";
765
799
  validation: TradeFormValidation;
766
800
  supportsLimitOrder: boolean;
767
801
  kycRequired: boolean;
802
+ /** True when the market requires KYC the user has not completed (Kalshi). */
803
+ needsKyc: boolean;
804
+ /** True when the Polymarket account is not yet set up (deployed + approved). */
805
+ needsSetup: boolean;
768
806
  kycUrl: string | null;
769
807
  totalShares: number;
770
808
  activeOrderShares: number;
@@ -788,7 +826,7 @@ interface UseSellFormResult {
788
826
  setCustomDurationUnit: (u: DurationUnit) => void;
789
827
  submit: () => void;
790
828
  }
791
- declare function useSellForm({ market, initialOutcome, slippageBps, }: UseSellFormParams): UseSellFormResult;
829
+ declare function useSellForm({ market, initialOutcome, slippageBps, onSuccess, }: UseSellFormParams): UseSellFormResult;
792
830
 
793
831
  interface SellFormUIProps {
794
832
  event?: StandardEvent;
@@ -801,10 +839,18 @@ interface SellFormUIProps {
801
839
  estimatedReturn: number;
802
840
  isMarketDataLoading: boolean;
803
841
  isSubmitting: boolean;
842
+ /** Auth status driving the login/checking/normal submit-button states. */
843
+ authStatus: "unauthenticated" | "authenticating" | "authenticated" | "deauthenticating";
804
844
  isValid: boolean;
805
845
  validationErrors: string[];
806
846
  supportsLimitOrder: boolean;
807
847
  kycRequired: boolean;
848
+ /** True when the user must complete KYC before trading (Kalshi). */
849
+ needsKyc: boolean;
850
+ /** True when the Polymarket account must be set up (deployed) first. */
851
+ needsSetup: boolean;
852
+ /** Opens the account setup modal when the Polymarket account isn't ready. */
853
+ onSetupRequired?: () => void;
808
854
  kycUrl: string | null;
809
855
  totalShares: number;
810
856
  activeOrderShares: number;
@@ -827,7 +873,7 @@ interface SellFormUIProps {
827
873
  onCustomDurationUnitChange: (u: DurationUnit) => void;
828
874
  onSubmit: () => void;
829
875
  }
830
- declare function SellFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, estimatedReturn, isMarketDataLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, totalShares, activeOrderShares, availableShares, isAvailableLoading, precision, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSellAll, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: SellFormUIProps): react_jsx_runtime.JSX.Element;
876
+ declare function SellFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, estimatedReturn, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, supportsLimitOrder, kycRequired, needsKyc, needsSetup, onSetupRequired, kycUrl, totalShares, activeOrderShares, availableShares, isAvailableLoading, precision, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSellAll, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: SellFormUIProps): react_jsx_runtime.JSX.Element;
831
877
 
832
878
  interface SellFormWidgetProps {
833
879
  event?: PredictEvent;
@@ -842,8 +888,16 @@ interface SellFormWidgetProps {
842
888
  slippageBps?: number;
843
889
  /** Called whenever the user switches between YES and NO. */
844
890
  onOutcomeChange?: (outcome: TradeOutcome) => void;
891
+ /**
892
+ * Called when the user presses the submit button while the Polymarket
893
+ * account still needs setup (deploy + approve). The consumer should open the
894
+ * account setup modal.
895
+ */
896
+ onSetupRequired?: () => void;
897
+ /** Called after a sell order completes successfully (e.g. to close a modal). */
898
+ onSuccess?: () => void;
845
899
  }
846
- declare function SellFormWidget({ event, market, variant, initialOutcome, chain, slippageBps, onOutcomeChange, }: SellFormWidgetProps): react_jsx_runtime.JSX.Element;
900
+ declare function SellFormWidget({ event, market, variant, initialOutcome, chain, slippageBps, onOutcomeChange, onSetupRequired, onSuccess, }: SellFormWidgetProps): react_jsx_runtime.JSX.Element;
847
901
 
848
902
  type PredictRedeemModalParams = {
849
903
  event: PredictEvent;
@@ -1302,7 +1356,14 @@ declare function usePredictWallet(): PredictWalletContextValue;
1302
1356
  type PredictWalletProviderProps = PropsWithChildren<{
1303
1357
  pollingInterval?: number;
1304
1358
  enabled?: boolean;
1359
+ /**
1360
+ * Whether the Kalshi (Solana / DFlow) venue is active. When `false`, the
1361
+ * Kalshi USDC balance and DFlow KYC status queries are disabled so no
1362
+ * polling happens for a venue the app does not surface. Defaults to `true`
1363
+ * for backward compatibility.
1364
+ */
1365
+ enableKalshi?: boolean;
1305
1366
  }>;
1306
- declare function PredictWalletProvider({ pollingInterval, enabled, children, }: PredictWalletProviderProps): react_jsx_runtime.JSX.Element;
1367
+ declare function PredictWalletProvider({ pollingInterval, enabled, enableKalshi, children, }: PredictWalletProviderProps): react_jsx_runtime.JSX.Element;
1307
1368
 
1308
1369
  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, CommentItemUI, type CommentItemUIProps, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, type DurationUnit, EventCommentsWidget, type EventCommentsWidgetProps, 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, EventsHero, type EventsHeroProps, EventsPage, type EventsPageProps, EventsPageSkeleton, type EventsPageSkeletonProps, EventsSkeleton, type EventsSkeletonProps, EventsToolbarUI, type EventsToolbarUIProps, EventsUI, type EventsUIProps, EventsWidget, type EventsWidgetProps, type ExpirationPreset, KycModal, type KycModalProps, MAX_PRICE_HISTORY_MARKETS, MatchGroupCard, type MatchGroupCardProps, MatchMarketCard, type MatchMarketCardProps, MatchesFilterBar, type MatchesFilterBarProps, MatchesHero, type MatchesHeroProps, type MatchesHeroStats, MatchesPage, type MatchesPageProps, MatchesStatsBar, type MatchesStatsBarProps, MatchesWidget, type MatchesWidgetProps, type MatchesWidgetRef, ORDER_MAX_PRICE, ORDER_MIN_PRICE, ORDER_MIN_QUANTITY, ORDER_MIN_USDC, ORDER_PRICE_STEP, type OrderType, PREDICT_REDEEM_MODAL_ID, PREDICT_SEARCH_MODAL_ID, PREDICT_SELL_MODAL_ID, PREDICT_TRADE_MODAL_ID, PRICE_HISTORY_SAMPLE_INTERVAL, PredictRedeemModal, type PredictRedeemModalParams, type PredictRedeemModalResult, PredictSearchModal, type PredictSearchModalParams, type PredictSearchModalResult, PredictSellModal, type PredictSellModalParams, type PredictSellModalResult, PredictTradeModal, type PredictTradeModalParams, type PredictTradeModalResult, type PredictWalletContextValue, PredictWalletProvider, type PredictWalletProviderProps, PriceHistoryInterval, type PriceHistoryIntervalType, ProfilePage, type ProfilePageProps, RedeemFormWidget, type RedeemFormWidgetProps, 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, SellFormUI, type SellFormUIProps, SellFormWidget, type SellFormWidgetProps, SetupModal, type SetupModalProps, SimilarEventCard, type SimilarEventCardProps, SimilarEventsSection, type SimilarEventsSectionProps, type SortPreset, SourceBadge, type SourceBadgeProps, SpreadIndicator, type SpreadIndicatorProps, 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 UseSellFormParams, type UseSellFormResult, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, countActiveFilters, fireCelebration, floorToDecimals, formatKMB, formatShares, getSourceMeta, parsePolymarketError, resolveExpiration, roundToTickSize, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useSellForm, useTradeForm };
package/dist/index.d.ts CHANGED
@@ -279,13 +279,19 @@ interface EventDetailPageProps {
279
279
  * Wallet / deposit flow.
280
280
  */
281
281
  onInsufficientBalance?: (source: ProviderSource) => void;
282
+ /**
283
+ * Forwarded to the inline SellFormWidget and the mobile sell modal: invoked
284
+ * when the user attempts to sell while the Polymarket account still needs
285
+ * setup (deploy + approve). Use this to open the account setup modal.
286
+ */
287
+ onSetupRequired?: () => void;
282
288
  /**
283
289
  * Maximum tolerated slippage for market orders, in basis points
284
290
  * (100 = 1%). Forwarded to both buy and sell forms. Defaults to 100 bps.
285
291
  */
286
292
  slippageBps?: number;
287
293
  }
288
- declare function EventDetailPage({ eventSlug, source, chain, walletAddress, onSimilarEventClick, onSimilarEventHover, onBack, renderActivitySection, onInsufficientBalance, slippageBps, }: EventDetailPageProps): react_jsx_runtime.JSX.Element;
294
+ declare function EventDetailPage({ eventSlug, source, chain, walletAddress, onSimilarEventClick, onSimilarEventHover, onBack, renderActivitySection, onInsufficientBalance, onSetupRequired, slippageBps, }: EventDetailPageProps): react_jsx_runtime.JSX.Element;
289
295
 
290
296
  type TradeOutcome = "yes" | "no";
291
297
  type TradeSide = "buy" | "sell";
@@ -360,6 +366,8 @@ interface UseTradeFormResult {
360
366
  isBalanceLoading: boolean;
361
367
  isMarketDataLoading: boolean;
362
368
  isSubmitting: boolean;
369
+ /** Current authentication status, used to drive the submit-button states. */
370
+ authStatus: "unauthenticated" | "authenticating" | "authenticated" | "deauthenticating";
363
371
  validation: TradeFormValidation;
364
372
  /** True when the user has entered an amount that exceeds the available USDC balance. */
365
373
  isInsufficientBalance: boolean;
@@ -367,6 +375,17 @@ interface UseTradeFormResult {
367
375
  source: ProviderSource;
368
376
  supportsLimitOrder: boolean;
369
377
  kycRequired: boolean;
378
+ /**
379
+ * True when the market's source requires identity verification (KYC) and the
380
+ * user has not completed it yet. Used to gate the deposit flow behind KYC.
381
+ */
382
+ needsKyc: boolean;
383
+ /**
384
+ * True when the market's source requires an on-chain account setup (e.g.
385
+ * Polymarket deposit/Safe wallet deployment + token approval) that the user
386
+ * has not completed yet. Used to gate trading behind account setup.
387
+ */
388
+ needsSetup: boolean;
370
389
  kycUrl: string | null;
371
390
  setOutcome: (outcome: TradeOutcome) => void;
372
391
  setOrderType: (type: OrderType) => void;
@@ -673,6 +692,8 @@ interface TradeFormUIProps {
673
692
  potentialProfit: number;
674
693
  isMarketDataLoading: boolean;
675
694
  isSubmitting: boolean;
695
+ /** Auth status driving the login/checking/normal submit-button states. */
696
+ authStatus: "unauthenticated" | "authenticating" | "authenticated" | "deauthenticating";
676
697
  usdcBalance: number | null;
677
698
  isBalanceLoading: boolean;
678
699
  isValid: boolean;
@@ -683,6 +704,10 @@ interface TradeFormUIProps {
683
704
  onInsufficientBalance?: () => void;
684
705
  supportsLimitOrder: boolean;
685
706
  kycRequired: boolean;
707
+ /** True when the user must complete KYC before the deposit flow is allowed. */
708
+ needsKyc: boolean;
709
+ /** True when the user must set up (deploy) their Polymarket account first. */
710
+ needsSetup: boolean;
686
711
  kycUrl: string | null;
687
712
  expirationEnabled: boolean;
688
713
  expirationPreset: ExpirationPreset;
@@ -698,7 +723,7 @@ interface TradeFormUIProps {
698
723
  onCustomDurationUnitChange: (u: DurationUnit) => void;
699
724
  onSubmit: () => void;
700
725
  }
701
- declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, isValid, validationErrors, isInsufficientBalance, onInsufficientBalance, supportsLimitOrder, kycRequired, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
726
+ declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, isInsufficientBalance, onInsufficientBalance, supportsLimitOrder, kycRequired, needsKyc, needsSetup, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
702
727
 
703
728
  interface TradeFormWidgetProps {
704
729
  event?: PredictEvent;
@@ -729,6 +754,11 @@ type PredictSellModalParams = {
729
754
  chain?: string;
730
755
  /** Forwarded slippage tolerance (basis points). */
731
756
  slippageBps?: number;
757
+ /**
758
+ * Invoked when the Polymarket account still needs setup (deploy + approve).
759
+ * The consumer should open the account setup modal.
760
+ */
761
+ onSetupRequired?: () => void;
732
762
  };
733
763
  type PredictSellModalResult = void;
734
764
  declare const PREDICT_SELL_MODAL_ID = "predict-sell";
@@ -747,6 +777,8 @@ interface UseSellFormParams {
747
777
  * Defaults to 100 bps. Use `0` to disable the check (not recommended).
748
778
  */
749
779
  slippageBps?: number;
780
+ /** Called after a sell order completes successfully (e.g. to close a modal). */
781
+ onSuccess?: () => void;
750
782
  }
751
783
  interface UseSellFormResult {
752
784
  outcome: TradeOutcome;
@@ -762,9 +794,15 @@ interface UseSellFormResult {
762
794
  pricePerShare: number;
763
795
  isMarketDataLoading: boolean;
764
796
  isSubmitting: boolean;
797
+ /** Current authentication status, used to drive the submit-button states. */
798
+ authStatus: "unauthenticated" | "authenticating" | "authenticated" | "deauthenticating";
765
799
  validation: TradeFormValidation;
766
800
  supportsLimitOrder: boolean;
767
801
  kycRequired: boolean;
802
+ /** True when the market requires KYC the user has not completed (Kalshi). */
803
+ needsKyc: boolean;
804
+ /** True when the Polymarket account is not yet set up (deployed + approved). */
805
+ needsSetup: boolean;
768
806
  kycUrl: string | null;
769
807
  totalShares: number;
770
808
  activeOrderShares: number;
@@ -788,7 +826,7 @@ interface UseSellFormResult {
788
826
  setCustomDurationUnit: (u: DurationUnit) => void;
789
827
  submit: () => void;
790
828
  }
791
- declare function useSellForm({ market, initialOutcome, slippageBps, }: UseSellFormParams): UseSellFormResult;
829
+ declare function useSellForm({ market, initialOutcome, slippageBps, onSuccess, }: UseSellFormParams): UseSellFormResult;
792
830
 
793
831
  interface SellFormUIProps {
794
832
  event?: StandardEvent;
@@ -801,10 +839,18 @@ interface SellFormUIProps {
801
839
  estimatedReturn: number;
802
840
  isMarketDataLoading: boolean;
803
841
  isSubmitting: boolean;
842
+ /** Auth status driving the login/checking/normal submit-button states. */
843
+ authStatus: "unauthenticated" | "authenticating" | "authenticated" | "deauthenticating";
804
844
  isValid: boolean;
805
845
  validationErrors: string[];
806
846
  supportsLimitOrder: boolean;
807
847
  kycRequired: boolean;
848
+ /** True when the user must complete KYC before trading (Kalshi). */
849
+ needsKyc: boolean;
850
+ /** True when the Polymarket account must be set up (deployed) first. */
851
+ needsSetup: boolean;
852
+ /** Opens the account setup modal when the Polymarket account isn't ready. */
853
+ onSetupRequired?: () => void;
808
854
  kycUrl: string | null;
809
855
  totalShares: number;
810
856
  activeOrderShares: number;
@@ -827,7 +873,7 @@ interface SellFormUIProps {
827
873
  onCustomDurationUnitChange: (u: DurationUnit) => void;
828
874
  onSubmit: () => void;
829
875
  }
830
- declare function SellFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, estimatedReturn, isMarketDataLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, totalShares, activeOrderShares, availableShares, isAvailableLoading, precision, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSellAll, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: SellFormUIProps): react_jsx_runtime.JSX.Element;
876
+ declare function SellFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, estimatedReturn, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, supportsLimitOrder, kycRequired, needsKyc, needsSetup, onSetupRequired, kycUrl, totalShares, activeOrderShares, availableShares, isAvailableLoading, precision, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSellAll, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: SellFormUIProps): react_jsx_runtime.JSX.Element;
831
877
 
832
878
  interface SellFormWidgetProps {
833
879
  event?: PredictEvent;
@@ -842,8 +888,16 @@ interface SellFormWidgetProps {
842
888
  slippageBps?: number;
843
889
  /** Called whenever the user switches between YES and NO. */
844
890
  onOutcomeChange?: (outcome: TradeOutcome) => void;
891
+ /**
892
+ * Called when the user presses the submit button while the Polymarket
893
+ * account still needs setup (deploy + approve). The consumer should open the
894
+ * account setup modal.
895
+ */
896
+ onSetupRequired?: () => void;
897
+ /** Called after a sell order completes successfully (e.g. to close a modal). */
898
+ onSuccess?: () => void;
845
899
  }
846
- declare function SellFormWidget({ event, market, variant, initialOutcome, chain, slippageBps, onOutcomeChange, }: SellFormWidgetProps): react_jsx_runtime.JSX.Element;
900
+ declare function SellFormWidget({ event, market, variant, initialOutcome, chain, slippageBps, onOutcomeChange, onSetupRequired, onSuccess, }: SellFormWidgetProps): react_jsx_runtime.JSX.Element;
847
901
 
848
902
  type PredictRedeemModalParams = {
849
903
  event: PredictEvent;
@@ -1302,7 +1356,14 @@ declare function usePredictWallet(): PredictWalletContextValue;
1302
1356
  type PredictWalletProviderProps = PropsWithChildren<{
1303
1357
  pollingInterval?: number;
1304
1358
  enabled?: boolean;
1359
+ /**
1360
+ * Whether the Kalshi (Solana / DFlow) venue is active. When `false`, the
1361
+ * Kalshi USDC balance and DFlow KYC status queries are disabled so no
1362
+ * polling happens for a venue the app does not surface. Defaults to `true`
1363
+ * for backward compatibility.
1364
+ */
1365
+ enableKalshi?: boolean;
1305
1366
  }>;
1306
- declare function PredictWalletProvider({ pollingInterval, enabled, children, }: PredictWalletProviderProps): react_jsx_runtime.JSX.Element;
1367
+ declare function PredictWalletProvider({ pollingInterval, enabled, enableKalshi, children, }: PredictWalletProviderProps): react_jsx_runtime.JSX.Element;
1307
1368
 
1308
1369
  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, CommentItemUI, type CommentItemUIProps, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, type DurationUnit, EventCommentsWidget, type EventCommentsWidgetProps, 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, EventsHero, type EventsHeroProps, EventsPage, type EventsPageProps, EventsPageSkeleton, type EventsPageSkeletonProps, EventsSkeleton, type EventsSkeletonProps, EventsToolbarUI, type EventsToolbarUIProps, EventsUI, type EventsUIProps, EventsWidget, type EventsWidgetProps, type ExpirationPreset, KycModal, type KycModalProps, MAX_PRICE_HISTORY_MARKETS, MatchGroupCard, type MatchGroupCardProps, MatchMarketCard, type MatchMarketCardProps, MatchesFilterBar, type MatchesFilterBarProps, MatchesHero, type MatchesHeroProps, type MatchesHeroStats, MatchesPage, type MatchesPageProps, MatchesStatsBar, type MatchesStatsBarProps, MatchesWidget, type MatchesWidgetProps, type MatchesWidgetRef, ORDER_MAX_PRICE, ORDER_MIN_PRICE, ORDER_MIN_QUANTITY, ORDER_MIN_USDC, ORDER_PRICE_STEP, type OrderType, PREDICT_REDEEM_MODAL_ID, PREDICT_SEARCH_MODAL_ID, PREDICT_SELL_MODAL_ID, PREDICT_TRADE_MODAL_ID, PRICE_HISTORY_SAMPLE_INTERVAL, PredictRedeemModal, type PredictRedeemModalParams, type PredictRedeemModalResult, PredictSearchModal, type PredictSearchModalParams, type PredictSearchModalResult, PredictSellModal, type PredictSellModalParams, type PredictSellModalResult, PredictTradeModal, type PredictTradeModalParams, type PredictTradeModalResult, type PredictWalletContextValue, PredictWalletProvider, type PredictWalletProviderProps, PriceHistoryInterval, type PriceHistoryIntervalType, ProfilePage, type ProfilePageProps, RedeemFormWidget, type RedeemFormWidgetProps, 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, SellFormUI, type SellFormUIProps, SellFormWidget, type SellFormWidgetProps, SetupModal, type SetupModalProps, SimilarEventCard, type SimilarEventCardProps, SimilarEventsSection, type SimilarEventsSectionProps, type SortPreset, SourceBadge, type SourceBadgeProps, SpreadIndicator, type SpreadIndicatorProps, 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 UseSellFormParams, type UseSellFormResult, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, countActiveFilters, fireCelebration, floorToDecimals, formatKMB, formatShares, getSourceMeta, parsePolymarketError, resolveExpiration, roundToTickSize, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useSellForm, useTradeForm };