Overview
Sovran’s QR scanner provides a comprehensive interface for scanning payment strings, ecash tokens, Lightning invoices, and more. The scanner supports animated UR codes, clipboard paste, and gallery image import.Camera Screen Component
TheCameraScreen component (components/screens/CameraScreen.tsx) provides the core scanning interface:
components/screens/CameraScreen.tsx:34-47.
Camera Permission Handling
TheuseHandleCameraPermission hook manages camera access:
hooks/useHandleCameraPermission.ts:8-42.
Scanner Features
Focus Detection
Scanner only processes codes when screen is focused:components/screens/CameraScreen.tsx:59-80.
Scan Handling
Smart scan processing with UR code support:components/screens/CameraScreen.tsx:82-136.
Scanning Overlay
Visual feedback with corner indicators:components/screens/CameraScreen.tsx:209-279.
Additional Features
Torch/Flashlight Toggle
components/screens/CameraScreen.tsx:138-150, 200.
Gallery Import
Scan QR codes from gallery images:components/screens/CameraScreen.tsx:152-174.
Clipboard Paste
Paste payment strings from clipboard:components/screens/CameraScreen.tsx:176-182.
Platform-Specific Buttons
iOS - Liquid Glass Buttons
components/screens/CameraScreen.tsx:287-357.
Android - Blur Buttons
components/screens/CameraScreen.tsx:359-383.
UR Code Support
Animated QR codes for large payloads:hooks/coco/useProcessPaymentString.ts:153-199.
Integration with Payment Processing
The scanner delegates payment processing touseProcessPaymentString:
Scan Sources
All scans are tracked with source attribution:qr- Camera QR scan or gallery importpaste- Clipboard pastedeeplink- App deep linknfc- NFC tap
Key Features
Multi-Source Input
Camera, clipboard, gallery, and NFC support
UR Code Support
Animated QR codes for large tokens with progress tracking
Smart Processing
Background state detection and duplicate scan prevention
Visual Feedback
Corner indicators, progress bars, and haptic feedback
Related Documentation
- Lightning Payments - Invoice scanning
- Ecash Tokens - Token scanning
- NFC Payments - NFC integration