parseSendRequest method

  1. @override
WalletSendRequest parseSendRequest(
  1. String uri
)
override

Parse a ZIP-321 zcash: payment URI (a scanned QR, a deep link — HOSTILE input) into a WalletSendRequest for the FR-25 prefilled-send seam — the DECODE inverse of composePaymentUri. SYNCHRONOUS, no money movement: the adapter runs it through the audited core payment_uri parser against the wallet's OWN network (so a cross-network URI is the SDK's typed NetworkMismatch, never a host-supplied-network footgun), and applies the single-recipient / text-memo seam policy. The bridge crossing (parsePaymentUri) lives in the adapter — never in the UI layer — so the prefill flow stays host-VM testable behind a fake. Throws a typed WalletSendRequestException (malformed / wrong-network / multi-leg / unsupported-memo) so the host rejects at the seam, never a half-filled form. WalletSendRequest.fromUri is the public sugar over this.

Implementation

@override
WalletSendRequest parseSendRequest(String uri) {
  parseSendRequestCount++;
  lastParsedUri = uri;
  if (parseSendRequestThrows != null) throw parseSendRequestThrows!;
  // The host-VM fake never touches the native ZIP-321 parser; the real
  // parse + seam policy is covered by the adapter's pure mapper tests. Default
  // echoes the URI as the address so a prefill test that doesn't pin a request
  // still gets a deterministic, Review-enabled recipient.
  return parseSendRequestResult ?? WalletSendRequest(address: uri);
}