feat: QR code generation and scanning modal for quick wallet pay requests - #456
Merged
Cjay-Cyber-2 merged 2 commits intoSep 8, 2026
Merged
Conversation
…t pay requests Implements mergepay#328 — a neobrutalist ReceiveQrModal so users can request funds by sharing a scannable QR of their Stellar public key (or a web+stellar: transaction URI) instead of copying long text. - Generate tab encodes the full key/URI via qrcode.react (display text is truncated for layout; the QR always carries the whole payload) - Scan tab validates a pasted payload (ed25519 address or payment URI) and offers a copy target so scanners pay the right destination - Copy buttons flip to a check state and fire sonner toasts; clipboard failures surface an error toast instead of a fake success - WalletWidget gains a "Receive" button that opens the modal Covers rendering, copy success/failure, scan validation, and payload parsing with 10 unit tests.
|
@oyebolarotimi269-ai Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Implements QR code generation and scanning for quick wallet pay requests, resolving #328.
Sharing a Stellar public key or payment request as raw text is error-prone and cumbersome. This adds a Receive Money modal where users can show a scannable QR code of their address (or a
web+stellar:transaction URI) and validate payloads they scan from others — so pay requests move at the speed of a camera shutter, not a copy-paste.Changes
src/components/ReceiveQrModal.tsx(new)qrcode.react(QRCodeSVG, levelM, 200px). The QR always encodes the full payload; the text readout truncates 56-character ed25519 keys for display only, so long keys never break the layout or the scan.parseScannedPayload()classifies it as a valid ed25519 public key (via the project'sStrKeyvalidator) or a payment URI, and rejects anything else with an inlinerole="alert"message plus an error toast — garbage never reaches the copy button.sonnersuccess toast. Clipboard failures (denied permission / insecure origin) surface an error toast instead of a fake "copied" state.border-2/border-3ink borders, sharp brutal shadows (shadow-brutal-sm/md), grape/butter/lime palette, uppercasefont-displaylabels — matching the existingShareQrModal/ShareAddressModalpatterns.Dialogcomponent handle narrow mobile viewports.aria-labels on icon-only buttons, state-awarearia-labelswap on copy, colour never the sole feedback channel.src/components/WalletWidget.tsxsrc/components/ReceiveQrModal.vitest.test.tsx(new)10 unit tests covering:
parseScannedPayloadunit cases (valid key / valid URI / garbage)Acceptance criteria
qrcode.reactinsrc/components/sonnertoast)Testing
bunx vitest run src/components/ReceiveQrModal.vitest.test.tsx— 10/10 passbunx vitest run src/components/wallet-widget.vitest.test.tsx— 7/7 pass (no regressions)bun tsc -b --noEmit— no new errors introduced (all reported errors are pre-existing in unrelated files:AnchorModal,AssetSelector,queries)Closes #328