shared/address_text library

Classes

AddressText
Displays a (long) wallet address in monospace with its FIRST and LAST few characters emphasized (bold, full text colour) and the middle de-emphasized (muted) — the at-a-glance verification pattern every wallet uses: the ends are what a person checks against a known address, so they read first while the middle recedes. The FULL address is always present (never truncated) and stays selectable, so copy-by-hand and screen-reader read-out are unaffected.
AddressVerificationText
Renders an address in equal-weight, space-separated MONOSPACE chunks for character-by-character VERIFICATION (a typo to the wrong address loses coins). The companion to AddressText: that emphasizes head+tail for at-a-glance read-only display; THIS gives every glyph equal weight because the user is checking the WHOLE string against a known address.

Functions

groupAddress(String address, {int groupSize = 4}) → String
Visually group an address into space-separated, fixed-size groupSize chunks ("u1qx z9k2 …") so a long string is scannable character-by-character. The ONE source of truth for the equal-weight VERIFICATION rendering (the send recipient review + the swap refund-verification echo). Purely a render aid: it is loss-free — stripping the inserted spaces yields the original verbatim (an address never contains a space) — so a grouping bug could only mis-render, never change the value a user verifies. Pure + total; tested at its boundaries.