jmwallet.cli.info_render
jmwallet.cli.info_render
'full' renderer for the extended wallet info view.
Consumes the canonical row model (:mod:jmwallet.wallet.rows) and produces
pipe-aligned table lines: one line per UTXO (hard rule), no elision, exact
confirmation counts. The renderer only formats the rows it is given — it
never re-derives labels, visibility or ordering (that is the model's job).
Column layout (regular branch tables share one global width vector, see
:func:compute_widths; fidelity-bond tables keep their own per-table
widths)::
idx | address | sats | confs | tag | state | outpoint
idx is the derivation index within the branch, rendered as /5 — the
branch path printed once in the branch header above the table plus this cell
gives the full derivation path. The units live in the headers
(sats/confs), so the cells carry bare numbers. The RU! reuse
flag is not a column: it is appended at the end of the row, after the
outpoint (like the legacy (reused) suffix), so the rare edge case does
not tax the tag column width.
The fidelity bond branch adds a fb-date column — the locktime date
(YY-MM-DD) qualifying the fb-a/fb-x label — after state, which
there shows the bond spendability (lock while time-locked, spend
once expired; a pending outgoing spend overrides it). Frozen UTXOs append
frozn to that state. A 0-conf bond shows 0 under confs
instead of an unconf state.
Attributes
BRANCH_NAME_WIDTH = len('fidelity bond addr.')
module-attribute
Classes
Functions:
compute_widths(rows: Sequence[Row], *, fidelity_bond: bool = False, num_width: int | None = None) -> list[int]
Column-width vector for a set of rows (header + data cells).
The CLI computes this once over the rows of all regular branches of a
page and passes it to :func:render_branch_table via widths, so
every regular branch table shares the same column widths (global
alignment). Fidelity-bond tables use their own fully independent vector
(wider addresses, fb-date, own amount width).
Source code in jmwallet/src/jmwallet/cli/info_render.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
render_branch_summary(summary: BranchSummaryRow) -> str
Per-branch balance line, fed from the summary row.
Fidelity bond funds are excluded from normal automatic selection; their breakdown distinguishes time-locked from expired funds (chain facts). The final figure is the honestly spendable part: expired bonds minus frozen ones — a frozen expired bond is excluded from any transaction until unfrozen.
Source code in jmwallet/src/jmwallet/cli/info_render.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | |
render_branch_table(rows: Sequence[Row], *, fidelity_bond: bool = False, num_width: int | None = None, widths: Sequence[int] | None = None, sep_width: int | None = None) -> list[str]
Render the rows of one branch as a pipe-aligned table.
Returns header, separator, one line per row (hard rule: one line per
UTXO), plus the hidden-count note when a :class:HiddenRow is present.
Every row spans all columns (closed grid), so empty trailing cells keep
their separators. Column widths are computed over this table's header
and data cells unless a widths vector (see :func:compute_widths)
is passed to force global alignment across tables. num_width
right-aligns the amount cells; pass a wallet-global value to align the
amounts across tables (default: computed from this table's rows).
sep_width right-extends the dashed separator line with dashes so
every separator on the page shares one length (no-op when the
separator is already that long). Returns [] when there is nothing
to show.
Source code in jmwallet/src/jmwallet/cli/info_render.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | |
render_hidden_note(hidden_count: int) -> str
Note line for the empty addresses hidden by the gap/show-empty logic.
Source code in jmwallet/src/jmwallet/cli/info_render.py
266 267 268 | |
render_legend(*, show_fidelity_bonds: bool = True) -> list[str]
Legend for the three-level vocabulary: tags, states, and the RU! flag.
show_fidelity_bonds=False drops the fb-a/fb-x tags and the lock
state — used when the fidelity bond branch is hidden from the page
(wallet.info_show_fidelity_bonds = false).
Source code in jmwallet/src/jmwallet/cli/info_render.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | |
render_mixdepth_summary(summary: MixdepthSummaryRow) -> str
Mixdepth total line (legacy wording, fixed padding after the label).
Source code in jmwallet/src/jmwallet/cli/info_render.py
294 295 296 297 298 | |
separator_width(widths: Sequence[int]) -> int
Length of a table's dashed separator line (-+--joined column runs).
Used to size the page-level separators and to right-extend shorter table separators, so every dashed line on the page has the same length.
Source code in jmwallet/src/jmwallet/cli/info_render.py
61 62 63 64 65 66 67 | |