@gearbox-protocol/ui-kit 4.0.0-next.44 → 4.0.0-next.45

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.
@@ -16,6 +16,13 @@ export interface LiquidationPriceBlockProps {
16
16
  readonly collateral?: Token | null;
17
17
  /** Underlying token of the quoted pair. */
18
18
  readonly underlying?: Token;
19
+ /**
20
+ * Prefixes the figure with {@link APPROXIMATE_SYMBOL}. For a projection the
21
+ * operation cannot promise exactly — a routed leg the market can move under.
22
+ * Both columns are marked when the row renders `from → to`: the "from" of a
23
+ * projected pair is projected too.
24
+ */
25
+ readonly approximate?: boolean;
19
26
  /** Zone dot next to the price. */
20
27
  readonly zone?: HFZones;
21
28
  readonly isLoading?: boolean;
@@ -29,4 +36,4 @@ export interface LiquidationPriceBlockProps {
29
36
  * "Liquidation price" row of a preview: label + help tip, the formatted price
30
37
  * (with optional from → to and zone dot), and the price pair underneath.
31
38
  */
32
- export declare function LiquidationPriceBlock({ price, priceTo, collateral, underlying, zone, isLoading, title, tip, testId, }: LiquidationPriceBlockProps): React.ReactElement;
39
+ export declare function LiquidationPriceBlock({ price, priceTo, collateral, underlying, approximate, zone, isLoading, title, tip, testId, }: LiquidationPriceBlockProps): React.ReactElement;
@@ -12,6 +12,12 @@ export interface PositionAssetsProps {
12
12
  readonly to?: readonly TokenAmount[];
13
13
  /** Rendered in place of the rows when nothing survives the dust filter. */
14
14
  readonly empty?: React.ReactNode;
15
+ /**
16
+ * Prefixes the projected amount with {@link APPROXIMATE_SYMBOL} — the "after"
17
+ * of a pair, or the only column when the list itself is a projection. The
18
+ * struck "before" is never marked: it is what the account holds now.
19
+ */
20
+ readonly approximate?: boolean;
15
21
  readonly testId?: string;
16
22
  }
17
23
  /**
@@ -34,7 +40,7 @@ export interface PositionAssetsProps {
34
40
  * rounding, and listing them buries the holdings that matter. A token the
35
41
  * oracle cannot price is never dust — an unknown value is not a small one.
36
42
  */
37
- export declare function PositionAssets({ assets, to, empty, testId, }: PositionAssetsProps): React.ReactElement;
43
+ export declare function PositionAssets({ assets, to, empty, approximate, testId, }: PositionAssetsProps): React.ReactElement;
38
44
  /** One token across both sides of a change. */
39
45
  export interface AssetRow {
40
46
  readonly token: TokenAmount["token"];
@@ -11,6 +11,13 @@ export interface TimeToLiquidationBlockProps {
11
11
  readonly data?: bigint | null;
12
12
  /** Time after the operation; renders a from → to transition. */
13
13
  readonly dataTo?: bigint | null;
14
+ /**
15
+ * Prefixes the figure with {@link APPROXIMATE_SYMBOL}. For a projection the
16
+ * operation cannot promise exactly — a routed leg the market can move under.
17
+ * Both columns are marked when the row renders `from → to`: the "from" of a
18
+ * projected pair is projected too.
19
+ */
20
+ readonly approximate?: boolean;
14
21
  /** Pre-computed zone; if not set, derived from the value. */
15
22
  readonly zone?: TTLZones;
16
23
  readonly isLoading?: boolean;
@@ -24,4 +31,4 @@ export interface TimeToLiquidationBlockProps {
24
31
  * "Time to liquidation" row of a preview: label + help tip, the remaining
25
32
  * time as `Nmo` / `Nd` / `<1d` with a zone dot, optionally from → to.
26
33
  */
27
- export declare function TimeToLiquidationBlock({ data, dataTo, zone, isLoading, title, tip, testId, }: TimeToLiquidationBlockProps): React.ReactElement;
34
+ export declare function TimeToLiquidationBlock({ data, dataTo, approximate, zone, isLoading, title, tip, testId, }: TimeToLiquidationBlockProps): React.ReactElement;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Marks a figure as an estimate rather than a promise: a routed amount that
3
+ * slippage can move, a projection quoted at prices that will have drifted by
4
+ * the time the transaction lands.
5
+ *
6
+ * Declared once so every screen that hedges a number hedges it the same way.
7
+ **/
8
+ export declare const APPROXIMATE_SYMBOL = "\u2248";
1
9
  export declare function formatBytecodeSize(size: number): string;
2
10
  export declare function formatBytecodeVersion(version: number): string;
3
11
  export declare function formatTimestamp(timestamp: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "4.0.0-next.44",
3
+ "version": "4.0.0-next.45",
4
4
  "description": "Internal UI components",
5
5
  "repository": {
6
6
  "type": "git",