#69 Enhancement: Display QR codes for deposit addresses#97
Merged
Conversation
marinate305
approved these changes
Jun 10, 2026
marinate305
left a comment
Collaborator
There was a problem hiding this comment.
This is exactly what we identified as needed during MCP testing — great to see QR codes wired into all 5 receive surfaces. The qr_warning for memo-required chains is a smart safety addition. The path-based limitation is noted but acceptable for now. Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Generate and return a PNG file of the QR code for every deposit address and invoice the agent produces, so users can scan instead of copy-paste.
Closes #69 Enhancement: Display QR codes for deposit addresses.
Description
The agent previously returned addresses/invoices as plain text. This PR adds a
generate_qr()helper that saves a PNG QR to~/.aqua/qr/and returns its absolute path asqr_code_pathin the tool result. The system prompt is updated to instruct the agent to always surface the image. QR generation is best-effort. if it fails, the address/invoice is still returned along with aqr_errorfield (no silent fallbacks).A reviewer-caught fund-loss hazard was also addressed: SideShift shifts on memo-required chains (BNB, etc.) now include a
qr_warningbecause the QR encodes only the deposit address — the memo must be entered manually.Main Changes
generate_qr(data, output_dir, filename=None)tosrc/aqua/qr.py— atomic write (tempfile → fsync → chmod0o600→os.replace), content-addressed filenameqr_<sha256[:16]>.png_attach_deposit_qr()helper intools.py— shared seam wired into all 5 receive surfaces with best-effort error handlingbtc_address,lw_address,lightning_receive,changelly_receive,sideshift_receive— each now returnsqr_code_pathqr_warningfor SideShift memo-based chains — scanning the QR alone omits the memo and can cause loss of fundsStorage.qr_dir(~/.aqua/qr/,0o700) following existing~/.aqualayout invariantsserver.pytool descriptions and system prompt with a "QR CODES" guidance block (mirrors Pix precedent — description changes alone don't drive display)generate_qrunit tests (round-trip via real zxing decoder, perms, atomicity, idempotency) +TestDepositQrwiring tests (including memo-warning and bolt11 transform)qrcode[pil]>=7.0from dev extras to runtimedependencies(imported by runtime module)None.
qr_code_pathis an additive field. On QR failure,qr_erroris set and the address/invoice is always returned.Checklist