WalletMachineMemo class

FR-28 — OPAQUE machine-memo bytes a host attaches to a payment, together with the human-readable purpose it must state for them.

The purpose is a REQUIRED constructor argument, not a display rule the host may skip. That is the point of this being a type at all: bytes cannot exist here without a sentence explaining them, so "we forgot the disclosure" is not a reachable state. A display rule is documentation; a required parameter is a mechanism, and only the second one shows when it is skipped.

WHAT THE PURPOSE STRING BUYS, STATED SO IT IS NOT OVERSOLD. It is ACCOUNTABILITY, not verification. The SDK cannot check that the sentence describes the bytes, and a hostile host can lie in it. What the user gets is that something was attached and who said why — never that it is benign.

The SDK never interprets the bytes. Their layout is the host's: a length frame, a version, a purpose code, whatever the host's own format says. The wallet treats them as an opaque, length-bounded blob and never renders them — hex is meaningless to a user and alarming in the wrong direction.

Constructors

WalletMachineMemo({required List<int> bytes, required String purpose})
Throws ArgumentError on empty bytes or a blank purpose: both are host bugs, and the honest answer is a refusal before anything reaches a permanent ledger — not a silently dropped memo or an undisclosed one.

Properties

bytes → List<int>
The opaque bytes, exactly as the host supplied them.
final
hashCode → int
The hash code for this object.
no setterinherited
purpose → String
One short, human-readable sentence saying what the attachment is for, shown to the user at the authorization step, per send, never dismissible and never remembered.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

purposeMaxChars → const int
The bound on purpose. It is rendered on a money surface at any text scale, so it is a sentence, not a payload.