@liberfi.io/ui-predict 4.0.54 → 4.0.56
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 +46 -5
- package/dist/index.d.ts +46 -5
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
package/dist/index.d.mts
CHANGED
|
@@ -362,6 +362,19 @@ interface EstimatePolymarketBuyFeeParams {
|
|
|
362
362
|
* case (`factor = 1`).
|
|
363
363
|
*/
|
|
364
364
|
declare function estimatePolymarketBuyFee({ usdcAmount, pricePerShare, feeRateBps, }: EstimatePolymarketBuyFeeParams): number;
|
|
365
|
+
interface EstimatePolymarketSellFeeParams {
|
|
366
|
+
/** Gross USDC proceeds before fees. */
|
|
367
|
+
grossReturn: number;
|
|
368
|
+
/** Per-share execution price (0-1). */
|
|
369
|
+
pricePerShare: number;
|
|
370
|
+
/** Price-dependent fee in basis points. */
|
|
371
|
+
feeRateBps: number;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Estimate the Polymarket taker fee (USDC) for a sell, using the same
|
|
375
|
+
* user-facing builder-code formula as buys.
|
|
376
|
+
*/
|
|
377
|
+
declare function estimatePolymarketSellFee({ grossReturn, pricePerShare, feeRateBps, }: EstimatePolymarketSellFeeParams): number;
|
|
365
378
|
/**
|
|
366
379
|
* Parse a Polymarket CLOB API error message into a user-friendly string.
|
|
367
380
|
* Falls back to the raw message (with order-hash stripped) if no pattern matches.
|
|
@@ -405,6 +418,8 @@ interface UseTradeFormResult {
|
|
|
405
418
|
quantity: number;
|
|
406
419
|
limitPrice: number;
|
|
407
420
|
shares: number;
|
|
421
|
+
/** Per-share price used for the visible buy estimate (0-1). */
|
|
422
|
+
effectivePrice: number;
|
|
408
423
|
estimatedCost: number;
|
|
409
424
|
/**
|
|
410
425
|
* Estimated Polymarket taker fee (USDC) reserved on top of the order amount.
|
|
@@ -747,6 +762,7 @@ interface TradeFormUIProps {
|
|
|
747
762
|
quantity: number;
|
|
748
763
|
limitPrice: number;
|
|
749
764
|
shares: number;
|
|
765
|
+
effectivePrice: number;
|
|
750
766
|
estimatedCost: number;
|
|
751
767
|
/** Estimated Polymarket taker fee (USDC). 0 hides the fee row. */
|
|
752
768
|
estimatedFee?: number;
|
|
@@ -788,7 +804,7 @@ interface TradeFormUIProps {
|
|
|
788
804
|
onCustomDurationUnitChange: (u: DurationUnit) => void;
|
|
789
805
|
onSubmit: () => void;
|
|
790
806
|
}
|
|
791
|
-
declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, estimatedFee, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, isInsufficientBalance, onInsufficientBalance, supportsLimitOrder, maxBuyAmount, kycRequired, needsKyc, needsSetup, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, oddsFormatter, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
|
|
807
|
+
declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, effectivePrice, potentialProfit, potentialPayout, estimatedCost, estimatedFee, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, isInsufficientBalance, onInsufficientBalance, supportsLimitOrder, maxBuyAmount, kycRequired, needsKyc, needsSetup, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, oddsFormatter, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
|
|
792
808
|
|
|
793
809
|
interface TradeFormWidgetProps {
|
|
794
810
|
event?: PredictEvent;
|
|
@@ -837,6 +853,11 @@ type PredictSellModalParams = {
|
|
|
837
853
|
event: PredictEvent;
|
|
838
854
|
market: PredictMarket;
|
|
839
855
|
initialOutcome?: TradeOutcome;
|
|
856
|
+
/**
|
|
857
|
+
* Original position side from the portfolio API. Some sports markets expose
|
|
858
|
+
* team keys (for example "france") while the tradable outcome remains YES/NO.
|
|
859
|
+
*/
|
|
860
|
+
initialPositionSide?: string;
|
|
840
861
|
chain?: string;
|
|
841
862
|
/** Forwarded slippage tolerance (basis points). */
|
|
842
863
|
slippageBps?: number;
|
|
@@ -857,6 +878,11 @@ interface UseSellFormParams {
|
|
|
857
878
|
chain?: string;
|
|
858
879
|
/** Fixed outcome — the sell form doesn't offer a YES/NO toggle. */
|
|
859
880
|
initialOutcome?: TradeOutcome;
|
|
881
|
+
/**
|
|
882
|
+
* Original position side from the portfolio API. Some sports markets expose
|
|
883
|
+
* provider-specific side keys while the tradable outcome remains YES/NO.
|
|
884
|
+
*/
|
|
885
|
+
initialPositionSide?: string;
|
|
860
886
|
/**
|
|
861
887
|
* Maximum tolerated slippage between best-of-book and the worst price
|
|
862
888
|
* walked into when filling a market sell, in basis points (100 = 1%).
|
|
@@ -872,6 +898,13 @@ interface UseSellFormResult {
|
|
|
872
898
|
quantity: number;
|
|
873
899
|
limitPrice: number;
|
|
874
900
|
shares: number;
|
|
901
|
+
/** Per-share price used for the visible sell estimate (0-1). */
|
|
902
|
+
effectivePrice: number;
|
|
903
|
+
/** Gross proceeds before fees. */
|
|
904
|
+
grossReturn: number;
|
|
905
|
+
/** Estimated Polymarket taker fee (USDC). 0 for non-Polymarket markets. */
|
|
906
|
+
estimatedFee: number;
|
|
907
|
+
/** Estimated proceeds after fees. */
|
|
875
908
|
estimatedReturn: number;
|
|
876
909
|
/**
|
|
877
910
|
* Live best-bid price for the selected outcome (per-share, 0–1). Sourced
|
|
@@ -912,7 +945,7 @@ interface UseSellFormResult {
|
|
|
912
945
|
setCustomDurationUnit: (u: DurationUnit) => void;
|
|
913
946
|
submit: () => void;
|
|
914
947
|
}
|
|
915
|
-
declare function useSellForm({ market, initialOutcome, slippageBps, onSuccess, }: UseSellFormParams): UseSellFormResult;
|
|
948
|
+
declare function useSellForm({ market, initialOutcome, initialPositionSide, slippageBps, onSuccess, }: UseSellFormParams): UseSellFormResult;
|
|
916
949
|
|
|
917
950
|
interface SellFormUIProps {
|
|
918
951
|
event?: StandardEvent;
|
|
@@ -922,6 +955,9 @@ interface SellFormUIProps {
|
|
|
922
955
|
orderType: OrderType;
|
|
923
956
|
quantity: number;
|
|
924
957
|
limitPrice: number;
|
|
958
|
+
effectivePrice: number;
|
|
959
|
+
grossReturn: number;
|
|
960
|
+
estimatedFee?: number;
|
|
925
961
|
estimatedReturn: number;
|
|
926
962
|
isMarketDataLoading: boolean;
|
|
927
963
|
isSubmitting: boolean;
|
|
@@ -961,13 +997,18 @@ interface SellFormUIProps {
|
|
|
961
997
|
onCustomDurationUnitChange: (u: DurationUnit) => void;
|
|
962
998
|
onSubmit: () => void;
|
|
963
999
|
}
|
|
964
|
-
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, oddsFormatter, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSellAll, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: SellFormUIProps): react_jsx_runtime.JSX.Element;
|
|
1000
|
+
declare function SellFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, effectivePrice, grossReturn, estimatedFee, estimatedReturn, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, supportsLimitOrder, kycRequired, needsKyc, needsSetup, onSetupRequired, kycUrl, totalShares, activeOrderShares, availableShares, isAvailableLoading, precision, expirationEnabled, expirationPreset, customDuration, customDurationUnit, oddsFormatter, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSellAll, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: SellFormUIProps): react_jsx_runtime.JSX.Element;
|
|
965
1001
|
|
|
966
1002
|
interface SellFormWidgetProps {
|
|
967
1003
|
event?: PredictEvent;
|
|
968
1004
|
market: PredictMarket;
|
|
969
1005
|
variant?: "bordered" | "flat";
|
|
970
1006
|
initialOutcome?: TradeOutcome;
|
|
1007
|
+
/**
|
|
1008
|
+
* Original position side from the portfolio API. Used to match portfolio
|
|
1009
|
+
* positions whose provider side is not literally YES/NO.
|
|
1010
|
+
*/
|
|
1011
|
+
initialPositionSide?: string;
|
|
971
1012
|
chain?: string;
|
|
972
1013
|
/**
|
|
973
1014
|
* Maximum tolerated slippage (basis points) when filling a market sell.
|
|
@@ -987,7 +1028,7 @@ interface SellFormWidgetProps {
|
|
|
987
1028
|
/** Optional formatter for display-only odds/price labels. */
|
|
988
1029
|
oddsFormatter?: OddsFormatter;
|
|
989
1030
|
}
|
|
990
|
-
declare function SellFormWidget({ event, market, variant, initialOutcome, chain, slippageBps, onOutcomeChange, onSetupRequired, onSuccess, oddsFormatter, }: SellFormWidgetProps): react_jsx_runtime.JSX.Element;
|
|
1031
|
+
declare function SellFormWidget({ event, market, variant, initialOutcome, initialPositionSide, chain, slippageBps, onOutcomeChange, onSetupRequired, onSuccess, oddsFormatter, }: SellFormWidgetProps): react_jsx_runtime.JSX.Element;
|
|
991
1032
|
|
|
992
1033
|
type PredictRedeemModalParams = {
|
|
993
1034
|
event: PredictEvent;
|
|
@@ -1463,4 +1504,4 @@ type PredictWalletProviderProps = PropsWithChildren<{
|
|
|
1463
1504
|
}>;
|
|
1464
1505
|
declare function PredictWalletProvider({ pollingInterval, enabled, enableKalshi, children, }: PredictWalletProviderProps): react_jsx_runtime.JSX.Element;
|
|
1465
1506
|
|
|
1466
|
-
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, type ComputeMaxBuyAmountParams, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, type DurationUnit, type EstimatePolymarketBuyFeeParams, 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 OddsFormatter, type OrderType, POLYMARKET_BUILDER_TAKER_FEE_BPS, POLYMARKET_SPORTS_TAKER_FEE_BPS, 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 TradeResultToastController, type TradeResultToastMessages, type TradeSide, type UseEventDetailParams, type UseEventsInfiniteParams, type UseEventsInfiniteResult, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseSellFormParams, type UseSellFormResult, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, computeMaxBuyAmount, countActiveFilters, createTradeResultToast, estimatePolymarketBuyFee, fireCelebration, floorToDecimals, formatKMB, formatShares, getSourceMeta, parsePolymarketError, polymarketFeeFactor, resolveExpiration, resolvePolymarketDisplayFeeRateBps, roundToTickSize, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useSellForm, useTradeForm };
|
|
1507
|
+
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, type ComputeMaxBuyAmountParams, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, type DurationUnit, type EstimatePolymarketBuyFeeParams, type EstimatePolymarketSellFeeParams, 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 OddsFormatter, type OrderType, POLYMARKET_BUILDER_TAKER_FEE_BPS, POLYMARKET_SPORTS_TAKER_FEE_BPS, 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 TradeResultToastController, type TradeResultToastMessages, type TradeSide, type UseEventDetailParams, type UseEventsInfiniteParams, type UseEventsInfiniteResult, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseSellFormParams, type UseSellFormResult, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, computeMaxBuyAmount, countActiveFilters, createTradeResultToast, estimatePolymarketBuyFee, estimatePolymarketSellFee, fireCelebration, floorToDecimals, formatKMB, formatShares, getSourceMeta, parsePolymarketError, polymarketFeeFactor, resolveExpiration, resolvePolymarketDisplayFeeRateBps, roundToTickSize, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useSellForm, useTradeForm };
|
package/dist/index.d.ts
CHANGED
|
@@ -362,6 +362,19 @@ interface EstimatePolymarketBuyFeeParams {
|
|
|
362
362
|
* case (`factor = 1`).
|
|
363
363
|
*/
|
|
364
364
|
declare function estimatePolymarketBuyFee({ usdcAmount, pricePerShare, feeRateBps, }: EstimatePolymarketBuyFeeParams): number;
|
|
365
|
+
interface EstimatePolymarketSellFeeParams {
|
|
366
|
+
/** Gross USDC proceeds before fees. */
|
|
367
|
+
grossReturn: number;
|
|
368
|
+
/** Per-share execution price (0-1). */
|
|
369
|
+
pricePerShare: number;
|
|
370
|
+
/** Price-dependent fee in basis points. */
|
|
371
|
+
feeRateBps: number;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Estimate the Polymarket taker fee (USDC) for a sell, using the same
|
|
375
|
+
* user-facing builder-code formula as buys.
|
|
376
|
+
*/
|
|
377
|
+
declare function estimatePolymarketSellFee({ grossReturn, pricePerShare, feeRateBps, }: EstimatePolymarketSellFeeParams): number;
|
|
365
378
|
/**
|
|
366
379
|
* Parse a Polymarket CLOB API error message into a user-friendly string.
|
|
367
380
|
* Falls back to the raw message (with order-hash stripped) if no pattern matches.
|
|
@@ -405,6 +418,8 @@ interface UseTradeFormResult {
|
|
|
405
418
|
quantity: number;
|
|
406
419
|
limitPrice: number;
|
|
407
420
|
shares: number;
|
|
421
|
+
/** Per-share price used for the visible buy estimate (0-1). */
|
|
422
|
+
effectivePrice: number;
|
|
408
423
|
estimatedCost: number;
|
|
409
424
|
/**
|
|
410
425
|
* Estimated Polymarket taker fee (USDC) reserved on top of the order amount.
|
|
@@ -747,6 +762,7 @@ interface TradeFormUIProps {
|
|
|
747
762
|
quantity: number;
|
|
748
763
|
limitPrice: number;
|
|
749
764
|
shares: number;
|
|
765
|
+
effectivePrice: number;
|
|
750
766
|
estimatedCost: number;
|
|
751
767
|
/** Estimated Polymarket taker fee (USDC). 0 hides the fee row. */
|
|
752
768
|
estimatedFee?: number;
|
|
@@ -788,7 +804,7 @@ interface TradeFormUIProps {
|
|
|
788
804
|
onCustomDurationUnitChange: (u: DurationUnit) => void;
|
|
789
805
|
onSubmit: () => void;
|
|
790
806
|
}
|
|
791
|
-
declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, estimatedFee, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, isInsufficientBalance, onInsufficientBalance, supportsLimitOrder, maxBuyAmount, kycRequired, needsKyc, needsSetup, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, oddsFormatter, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
|
|
807
|
+
declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, effectivePrice, potentialProfit, potentialPayout, estimatedCost, estimatedFee, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, isInsufficientBalance, onInsufficientBalance, supportsLimitOrder, maxBuyAmount, kycRequired, needsKyc, needsSetup, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, oddsFormatter, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
|
|
792
808
|
|
|
793
809
|
interface TradeFormWidgetProps {
|
|
794
810
|
event?: PredictEvent;
|
|
@@ -837,6 +853,11 @@ type PredictSellModalParams = {
|
|
|
837
853
|
event: PredictEvent;
|
|
838
854
|
market: PredictMarket;
|
|
839
855
|
initialOutcome?: TradeOutcome;
|
|
856
|
+
/**
|
|
857
|
+
* Original position side from the portfolio API. Some sports markets expose
|
|
858
|
+
* team keys (for example "france") while the tradable outcome remains YES/NO.
|
|
859
|
+
*/
|
|
860
|
+
initialPositionSide?: string;
|
|
840
861
|
chain?: string;
|
|
841
862
|
/** Forwarded slippage tolerance (basis points). */
|
|
842
863
|
slippageBps?: number;
|
|
@@ -857,6 +878,11 @@ interface UseSellFormParams {
|
|
|
857
878
|
chain?: string;
|
|
858
879
|
/** Fixed outcome — the sell form doesn't offer a YES/NO toggle. */
|
|
859
880
|
initialOutcome?: TradeOutcome;
|
|
881
|
+
/**
|
|
882
|
+
* Original position side from the portfolio API. Some sports markets expose
|
|
883
|
+
* provider-specific side keys while the tradable outcome remains YES/NO.
|
|
884
|
+
*/
|
|
885
|
+
initialPositionSide?: string;
|
|
860
886
|
/**
|
|
861
887
|
* Maximum tolerated slippage between best-of-book and the worst price
|
|
862
888
|
* walked into when filling a market sell, in basis points (100 = 1%).
|
|
@@ -872,6 +898,13 @@ interface UseSellFormResult {
|
|
|
872
898
|
quantity: number;
|
|
873
899
|
limitPrice: number;
|
|
874
900
|
shares: number;
|
|
901
|
+
/** Per-share price used for the visible sell estimate (0-1). */
|
|
902
|
+
effectivePrice: number;
|
|
903
|
+
/** Gross proceeds before fees. */
|
|
904
|
+
grossReturn: number;
|
|
905
|
+
/** Estimated Polymarket taker fee (USDC). 0 for non-Polymarket markets. */
|
|
906
|
+
estimatedFee: number;
|
|
907
|
+
/** Estimated proceeds after fees. */
|
|
875
908
|
estimatedReturn: number;
|
|
876
909
|
/**
|
|
877
910
|
* Live best-bid price for the selected outcome (per-share, 0–1). Sourced
|
|
@@ -912,7 +945,7 @@ interface UseSellFormResult {
|
|
|
912
945
|
setCustomDurationUnit: (u: DurationUnit) => void;
|
|
913
946
|
submit: () => void;
|
|
914
947
|
}
|
|
915
|
-
declare function useSellForm({ market, initialOutcome, slippageBps, onSuccess, }: UseSellFormParams): UseSellFormResult;
|
|
948
|
+
declare function useSellForm({ market, initialOutcome, initialPositionSide, slippageBps, onSuccess, }: UseSellFormParams): UseSellFormResult;
|
|
916
949
|
|
|
917
950
|
interface SellFormUIProps {
|
|
918
951
|
event?: StandardEvent;
|
|
@@ -922,6 +955,9 @@ interface SellFormUIProps {
|
|
|
922
955
|
orderType: OrderType;
|
|
923
956
|
quantity: number;
|
|
924
957
|
limitPrice: number;
|
|
958
|
+
effectivePrice: number;
|
|
959
|
+
grossReturn: number;
|
|
960
|
+
estimatedFee?: number;
|
|
925
961
|
estimatedReturn: number;
|
|
926
962
|
isMarketDataLoading: boolean;
|
|
927
963
|
isSubmitting: boolean;
|
|
@@ -961,13 +997,18 @@ interface SellFormUIProps {
|
|
|
961
997
|
onCustomDurationUnitChange: (u: DurationUnit) => void;
|
|
962
998
|
onSubmit: () => void;
|
|
963
999
|
}
|
|
964
|
-
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, oddsFormatter, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSellAll, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: SellFormUIProps): react_jsx_runtime.JSX.Element;
|
|
1000
|
+
declare function SellFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, effectivePrice, grossReturn, estimatedFee, estimatedReturn, isMarketDataLoading, isSubmitting, authStatus, isValid, validationErrors, supportsLimitOrder, kycRequired, needsKyc, needsSetup, onSetupRequired, kycUrl, totalShares, activeOrderShares, availableShares, isAvailableLoading, precision, expirationEnabled, expirationPreset, customDuration, customDurationUnit, oddsFormatter, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onSellAll, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: SellFormUIProps): react_jsx_runtime.JSX.Element;
|
|
965
1001
|
|
|
966
1002
|
interface SellFormWidgetProps {
|
|
967
1003
|
event?: PredictEvent;
|
|
968
1004
|
market: PredictMarket;
|
|
969
1005
|
variant?: "bordered" | "flat";
|
|
970
1006
|
initialOutcome?: TradeOutcome;
|
|
1007
|
+
/**
|
|
1008
|
+
* Original position side from the portfolio API. Used to match portfolio
|
|
1009
|
+
* positions whose provider side is not literally YES/NO.
|
|
1010
|
+
*/
|
|
1011
|
+
initialPositionSide?: string;
|
|
971
1012
|
chain?: string;
|
|
972
1013
|
/**
|
|
973
1014
|
* Maximum tolerated slippage (basis points) when filling a market sell.
|
|
@@ -987,7 +1028,7 @@ interface SellFormWidgetProps {
|
|
|
987
1028
|
/** Optional formatter for display-only odds/price labels. */
|
|
988
1029
|
oddsFormatter?: OddsFormatter;
|
|
989
1030
|
}
|
|
990
|
-
declare function SellFormWidget({ event, market, variant, initialOutcome, chain, slippageBps, onOutcomeChange, onSetupRequired, onSuccess, oddsFormatter, }: SellFormWidgetProps): react_jsx_runtime.JSX.Element;
|
|
1031
|
+
declare function SellFormWidget({ event, market, variant, initialOutcome, initialPositionSide, chain, slippageBps, onOutcomeChange, onSetupRequired, onSuccess, oddsFormatter, }: SellFormWidgetProps): react_jsx_runtime.JSX.Element;
|
|
991
1032
|
|
|
992
1033
|
type PredictRedeemModalParams = {
|
|
993
1034
|
event: PredictEvent;
|
|
@@ -1463,4 +1504,4 @@ type PredictWalletProviderProps = PropsWithChildren<{
|
|
|
1463
1504
|
}>;
|
|
1464
1505
|
declare function PredictWalletProvider({ pollingInterval, enabled, enableKalshi, children, }: PredictWalletProviderProps): react_jsx_runtime.JSX.Element;
|
|
1465
1506
|
|
|
1466
|
-
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, type ComputeMaxBuyAmountParams, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, type DurationUnit, type EstimatePolymarketBuyFeeParams, 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 OddsFormatter, type OrderType, POLYMARKET_BUILDER_TAKER_FEE_BPS, POLYMARKET_SPORTS_TAKER_FEE_BPS, 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 TradeResultToastController, type TradeResultToastMessages, type TradeSide, type UseEventDetailParams, type UseEventsInfiniteParams, type UseEventsInfiniteResult, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseSellFormParams, type UseSellFormResult, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, computeMaxBuyAmount, countActiveFilters, createTradeResultToast, estimatePolymarketBuyFee, fireCelebration, floorToDecimals, formatKMB, formatShares, getSourceMeta, parsePolymarketError, polymarketFeeFactor, resolveExpiration, resolvePolymarketDisplayFeeRateBps, roundToTickSize, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useSellForm, useTradeForm };
|
|
1507
|
+
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, type ComputeMaxBuyAmountParams, DEFAULT_CHART_RANGE, DEFAULT_FILTER_STATE, DEFAULT_PAGE_SIZE, DEFAULT_PRICE_HISTORY_INTERVAL, type DepthLevel, type DepthSlot, type DurationUnit, type EstimatePolymarketBuyFeeParams, type EstimatePolymarketSellFeeParams, 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 OddsFormatter, type OrderType, POLYMARKET_BUILDER_TAKER_FEE_BPS, POLYMARKET_SPORTS_TAKER_FEE_BPS, 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 TradeResultToastController, type TradeResultToastMessages, type TradeSide, type UseEventDetailParams, type UseEventsInfiniteParams, type UseEventsInfiniteResult, type UseSearchResultListScriptParams, type UseSearchScriptParams, type UseSellFormParams, type UseSellFormResult, type UseTradeFormParams, type UseTradeFormResult, UserActivitySection, type UserActivitySectionProps, computeMaxBuyAmount, countActiveFilters, createTradeResultToast, estimatePolymarketBuyFee, estimatePolymarketSellFee, fireCelebration, floorToDecimals, formatKMB, formatShares, getSourceMeta, parsePolymarketError, polymarketFeeFactor, resolveExpiration, resolvePolymarketDisplayFeeRateBps, roundToTickSize, useEventDetail, useEventsInfinite, usePredictSearchHistory, usePredictWallet, useSearchResultListScript, useSearchScript, useSellForm, useTradeForm };
|