@liberfi.io/ui-predict 0.1.138 → 0.1.140

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
@@ -13,7 +13,7 @@ declare global {
13
13
  };
14
14
  }
15
15
  }
16
- declare const _default: "0.1.138";
16
+ declare const _default: "0.1.140";
17
17
 
18
18
  /**
19
19
  * A single category entry in the static navigation model.
@@ -278,7 +278,13 @@ declare function floorToDecimals(value: number, decimals: number): number;
278
278
  declare function parsePolymarketError(raw: string, t: (...args: any[]) => string, side?: "buy" | "sell"): string;
279
279
  /**
280
280
  * Format a share count for display: floor-truncate to the given number of
281
- * decimal places (default 4) and strip trailing zeros.
281
+ * decimal places and strip trailing zeros.
282
+ *
283
+ * Default is 2, matching the official Polymarket CLOB client where
284
+ * `ROUNDING_CONFIG[tickSize].size` is always 2 for all tick sizes.
285
+ * DFlow/Kalshi uses 0 decimals, so 2 is a safe upper bound for both.
286
+ *
287
+ * @see https://github.com/Polymarket/clob-client/blob/main/src/order-builder/helpers.ts
282
288
  */
283
289
  declare function formatShares(size: number, maxDecimals?: number): string;
284
290
  declare function fireCelebration(): void;
@@ -299,6 +305,7 @@ interface UseTradeFormResult {
299
305
  potentialProfit: number;
300
306
  usdcBalance: number | null;
301
307
  isBalanceLoading: boolean;
308
+ isMarketDataLoading: boolean;
302
309
  isSubmitting: boolean;
303
310
  validation: TradeFormValidation;
304
311
  supportsLimitOrder: boolean;
@@ -477,6 +484,7 @@ interface TradeFormUIProps {
477
484
  estimatedCost: number;
478
485
  potentialPayout: number;
479
486
  potentialProfit: number;
487
+ isMarketDataLoading: boolean;
480
488
  isSubmitting: boolean;
481
489
  usdcBalance: number | null;
482
490
  isBalanceLoading: boolean;
@@ -499,7 +507,7 @@ interface TradeFormUIProps {
499
507
  onCustomDurationUnitChange: (u: DurationUnit) => void;
500
508
  onSubmit: () => void;
501
509
  }
502
- declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, isBalanceLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
510
+ declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
503
511
 
504
512
  interface TradeFormWidgetProps {
505
513
  event?: PredictEvent;
@@ -535,6 +543,7 @@ interface UseSellFormResult {
535
543
  limitPrice: number;
536
544
  shares: number;
537
545
  estimatedReturn: number;
546
+ isMarketDataLoading: boolean;
538
547
  isSubmitting: boolean;
539
548
  validation: TradeFormValidation;
540
549
  supportsLimitOrder: boolean;
@@ -573,6 +582,7 @@ interface SellFormUIProps {
573
582
  quantity: number;
574
583
  limitPrice: number;
575
584
  estimatedReturn: number;
585
+ isMarketDataLoading: boolean;
576
586
  isSubmitting: boolean;
577
587
  isValid: boolean;
578
588
  validationErrors: string[];
@@ -600,7 +610,7 @@ interface SellFormUIProps {
600
610
  onCustomDurationUnitChange: (u: DurationUnit) => void;
601
611
  onSubmit: () => void;
602
612
  }
603
- declare function SellFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, estimatedReturn, 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;
613
+ 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;
604
614
 
605
615
  interface SellFormWidgetProps {
606
616
  event?: PredictEvent;
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ declare global {
13
13
  };
14
14
  }
15
15
  }
16
- declare const _default: "0.1.138";
16
+ declare const _default: "0.1.140";
17
17
 
18
18
  /**
19
19
  * A single category entry in the static navigation model.
@@ -278,7 +278,13 @@ declare function floorToDecimals(value: number, decimals: number): number;
278
278
  declare function parsePolymarketError(raw: string, t: (...args: any[]) => string, side?: "buy" | "sell"): string;
279
279
  /**
280
280
  * Format a share count for display: floor-truncate to the given number of
281
- * decimal places (default 4) and strip trailing zeros.
281
+ * decimal places and strip trailing zeros.
282
+ *
283
+ * Default is 2, matching the official Polymarket CLOB client where
284
+ * `ROUNDING_CONFIG[tickSize].size` is always 2 for all tick sizes.
285
+ * DFlow/Kalshi uses 0 decimals, so 2 is a safe upper bound for both.
286
+ *
287
+ * @see https://github.com/Polymarket/clob-client/blob/main/src/order-builder/helpers.ts
282
288
  */
283
289
  declare function formatShares(size: number, maxDecimals?: number): string;
284
290
  declare function fireCelebration(): void;
@@ -299,6 +305,7 @@ interface UseTradeFormResult {
299
305
  potentialProfit: number;
300
306
  usdcBalance: number | null;
301
307
  isBalanceLoading: boolean;
308
+ isMarketDataLoading: boolean;
302
309
  isSubmitting: boolean;
303
310
  validation: TradeFormValidation;
304
311
  supportsLimitOrder: boolean;
@@ -477,6 +484,7 @@ interface TradeFormUIProps {
477
484
  estimatedCost: number;
478
485
  potentialPayout: number;
479
486
  potentialProfit: number;
487
+ isMarketDataLoading: boolean;
480
488
  isSubmitting: boolean;
481
489
  usdcBalance: number | null;
482
490
  isBalanceLoading: boolean;
@@ -499,7 +507,7 @@ interface TradeFormUIProps {
499
507
  onCustomDurationUnitChange: (u: DurationUnit) => void;
500
508
  onSubmit: () => void;
501
509
  }
502
- declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, isBalanceLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
510
+ declare function TradeFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, shares, potentialProfit, potentialPayout, estimatedCost, usdcBalance, isBalanceLoading, isMarketDataLoading, isSubmitting, isValid, validationErrors, supportsLimitOrder, kycRequired, kycUrl, expirationEnabled, expirationPreset, customDuration, customDurationUnit, onOutcomeChange, onOrderTypeChange, onQuantityChange, onLimitPriceChange, onExpirationEnabledChange, onExpirationPresetChange, onCustomDurationChange, onCustomDurationUnitChange, onSubmit, }: TradeFormUIProps): react_jsx_runtime.JSX.Element;
503
511
 
504
512
  interface TradeFormWidgetProps {
505
513
  event?: PredictEvent;
@@ -535,6 +543,7 @@ interface UseSellFormResult {
535
543
  limitPrice: number;
536
544
  shares: number;
537
545
  estimatedReturn: number;
546
+ isMarketDataLoading: boolean;
538
547
  isSubmitting: boolean;
539
548
  validation: TradeFormValidation;
540
549
  supportsLimitOrder: boolean;
@@ -573,6 +582,7 @@ interface SellFormUIProps {
573
582
  quantity: number;
574
583
  limitPrice: number;
575
584
  estimatedReturn: number;
585
+ isMarketDataLoading: boolean;
576
586
  isSubmitting: boolean;
577
587
  isValid: boolean;
578
588
  validationErrors: string[];
@@ -600,7 +610,7 @@ interface SellFormUIProps {
600
610
  onCustomDurationUnitChange: (u: DurationUnit) => void;
601
611
  onSubmit: () => void;
602
612
  }
603
- declare function SellFormUI({ event, market, variant, outcome, orderType, quantity, limitPrice, estimatedReturn, 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;
613
+ 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;
604
614
 
605
615
  interface SellFormWidgetProps {
606
616
  event?: PredictEvent;