WalletSendRequest.fromUri constructor

WalletSendRequest.fromUri(
  1. WalletSession session,
  2. String uri, {
  3. bool lockRecipient = false,
  4. String? correlationId,
})

Parse a ZIP-321 zcash: payment URI (a scanned QR, a deep link — HOSTILE input) into a prefill request, validated against THIS wallet's own network (the session is the sole network authority — a host can NOT coerce a wrong-network send; the same network-hiding seam as WalletSession.composePaymentUri). The audited core payment_uri parser is the single validator (DRY) — this never re-parses ZIP-321 in Dart.

Throws WalletSendRequestException (typed, payload-free — §5.4) at the SEAM, never a half-filled form:

The lockRecipient argument is AUTHORITATIVE in both directions (a scanned pay-a-contact URI often wants the recipient locked; false overrides even a lock a custom port implementation set on its returned request). SYNCHRONOUS (the parse is local + sync).

Implementation

factory WalletSendRequest.fromUri(
  WalletSession session,
  String uri, {
  bool lockRecipient = false,
  String? correlationId,
}) {
  final request = session.parseSendRequest(uri);
  return WalletSendRequest(
    address: request.address,
    amountZat: request.amountZat,
    memo: request.memo,
    label: request.label,
    lockRecipient: lockRecipient,
    // The host's own token, never anything read out of the (untrusted) URI.
    correlationId: correlationId,
  );
}