hydra-tui
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.TUI.Drawing.Utils

Synopsis

Documentation

prettyHeadId :: HeadId -> Text Source #

Render a HeadId as its hex-encoded bytes (matches the Main tab display).

prettyTxId :: TxId -> Text Source #

Render a TxId as its hex-encoded bytes (no quotes, no wrapper type).

drawHex :: SerialiseAsRawBytes a => a -> Widget n Source #

drawShow :: forall a n. Show a => a -> Widget n Source #

drawAddress :: AddressInEra -> Widget n Source #

Render a full address as text.

highlightOwnAddress :: AddressInEra -> AddressInEra -> Widget n Source #

Highlight the given address if it matches the own address.

drawUTxO :: (AddressInEra -> Widget n) -> UTxO -> Widget n Source #

Render a UTxO map grouped by address, with ADA amounts and global 1-based numbering across all entries (so users can confirm scrollable views are scrolling).

drawUTxOEntryAda :: Int -> (TxIn, TxOut CtxUTxO) -> Widget n Source #

Render a single UTxO entry: index, last part of the TxIn, and ADA value. The TxIn is shortened to the last 10 characters of the hash plus its '#index' suffix, derived structurally so it stays correct if the rendering of TxIn ever changes width.

scrollableViewport :: (Ord n, Show n) => n -> Widget n -> Widget n Source #

Wrap a widget in a clickable, vertically scrollable viewport using a single name for both. The shared name lets the mouse-wheel handler (matching MouseDown on any clickable) target the corresponding viewport, and lets keyboard handlers scroll it by name too.

renderAda :: Value -> Text Source #

Render a lovelace value as ADA with the ₳ symbol.

renderTime :: (Ord t, Num t, FormatTime t) => t -> String Source #

Format a time duration as "Xd Xh Xm Xs".

spinnerFrame :: UTCTime -> Text Source #

Animated spinner character cycling with wall-clock time.

drawRemainingContestationPeriod :: UTCTime -> UTCTime -> Widget n Source #

Remaining contestation time, or a "ready to fan out" notice. Used by both the Main tab (head state panel) and the Funds tab (closed state).

drawFanoutPossibleMessage :: Widget n Source #

Status message shown when the contestation period has passed and a fanout transaction can be submitted. Shared between the Main and Funds tabs so the wording matches.

drawFanningOutMessage :: FanoutProgressMode -> UTxO -> Widget n Source #

Status message shown while a fanout is in progress, reporting how many UTxO are still to be fanned out. The wording follows the node-reported FanoutProgressMode: while auto-draining we just report progress; when the node awaits the next selection we prompt for [P]. Shared between the Main and Funds tabs so the wording and count match.

drawHeadFinalizedMessage :: UTxO -> Widget n Source #

Status message shown when the head has been finalized, including the total ADA value of the distributed UTxO. Shared between the Main and Funds tabs so the wording matches.