Skip to content

feat: QR Code Scanner with SEP-0007 Support#139

Merged
ONEONUORA merged 6 commits intoFracverse:masterfrom
Bhenzdizma:frontend
Apr 27, 2026
Merged

feat: QR Code Scanner with SEP-0007 Support#139
ONEONUORA merged 6 commits intoFracverse:masterfrom
Bhenzdizma:frontend

Conversation

@Bhenzdizma
Copy link
Copy Markdown
Contributor

Implements a fully functional QR code scanner with SEP-0007 payment URI support, enabling scan-to-pay and receive-via-QR flows across both personal and merchant accounts.

Changes

New files

  • src/utils/sep0007.ts — SEP-0007 URI parser, validator, and builder. Handles web+stellar:pay and web+stellar:tx operations, validates Stellar G-addresses and federated addresses, and exports buildSep0007PayUri for QR generation.
  • src/hooks/useCameraPermission.ts — Thin hook wrapping expo-camera's permission API with granted / denied / undetermined / loading state and a requestPermission() helper.

Modified files

  • app/scan.tsx — Full rewrite. Live camera feed via expo-camera, QR-only barcode scanner, flash toggle, gallery picker, manual address/URI entry fallback, SEP-0007 payment preview screen, graceful error handling, and camera permission flow with Settings deep-link.
  • app/receive.tsx — Replaces the QR placeholder icon with a real react-native-qrcode-svg QR. External wallet mode generates a web+stellar:pay URI; Copy ID button now writes to clipboard with toast feedback.
  • app/merchant/qr-code.tsx — Merchant QR now encodes a SEP-0007 URI (destination + amount + asset + memo) instead of a raw JSON blob, making it scannable by any SEP-0007 compatible wallet. Share button shares the URI directly.

Dependencies added

  • expo-camera — camera feed + QR barcode scanning
  • expo-image-picker — gallery access

Acceptance criteria met

Criteria Status
Scan QR codes from camera
Parse SEP-0007 payment URIs correctly
Display payment details (recipient, amount, memo)
User can confirm or cancel payment
Handle invalid QR codes gracefully
Generate QR codes for receiving payments
Camera permission properly requested
Support G-addresses and federated addresses
Manual address entry fallback
Flash / low-light support

Notes for reviewers

  • MERCHANT_STELLAR_ADDRESS and walletAddress in receive.tsx are placeholder values — these should be wired to the authenticated wallet address from the auth/wallet context once that layer is in place.
  • Gallery QR decoding is not supported by expo-camera's static API; the gallery button currently guides users to use the camera or manual entry. A dedicated image QR decoder library can be added in a follow-up if needed.

closes #95

- parseSep0007Uri: parses web+stellar:pay and web+stellar:tx URIs
- buildSep0007PayUri: builds a SEP-0007 pay URI from params
- detectQrContentType: classifies scanned QR content
- isStellarAddress / isFederatedAddress / isValidStellarDestination helpers
- Full TypeScript types for pay and tx operation params
Wraps expo-camera's useCameraPermissions with a clean interface:
- granted / denied / undetermined state flags
- loading state during permission request
- requestPermission() async helper
- Live camera feed via expo-camera CameraView
- Barcode scanner restricted to QR type
- Flash toggle (on/off)
- Gallery picker via expo-image-picker
- Manual address / URI entry fallback
- SEP-0007 pay and tx URI parsing with payment preview
- Plain Stellar G-address and federated address detection
- Payment details preview screen (recipient, amount, asset, memo)
- Confirm → navigates to /transfer pre-filled with scanned params
- Graceful error screen for invalid QR codes with retry
- Camera permission request and denied state with Settings deep-link
- Responsive scanner viewport (tablet-aware)
- Corner bracket overlay for scan target UX
- Accessibility labels and roles throughout
- Replace QR placeholder icon with react-native-qrcode-svg
- External wallet receive generates a web+stellar:pay URI via buildSep0007PayUri
- BLINKS ID receive shows blinkId as QR value
- Wire up Copy ID button with Clipboard + toast feedback
- Import buildSep0007PayUri from sep0007 utils
- Build web+stellar:pay URI with destination, amount, asset_code, memo
- Replace JSON payload with standards-compliant SEP-0007 URI
- Add Share functionality to share the URI directly
- Any SEP-0007 compatible wallet can now scan and pay the merchant
- expo-camera: live camera feed + QR barcode scanning
- expo-image-picker: gallery access for QR image selection
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 27, 2026

@Bhenzdizma 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! 🚀

Learn more about application limits

Copy link
Copy Markdown
Contributor

@ONEONUORA ONEONUORA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @Bhenzdizma

@ONEONUORA ONEONUORA merged commit c68d4f6 into Fracverse:master Apr 27, 2026
3 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Frontend] Implement QR Code Scanner with SEP-0007 Support

2 participants