Skip to main content

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

The CameraScreen component (components/screens/CameraScreen.tsx) provides the core scanning interface:
From components/screens/CameraScreen.tsx:34-47.

Camera Permission Handling

The useHandleCameraPermission hook manages camera access:
From hooks/useHandleCameraPermission.ts:8-42.

Scanner Features

Focus Detection

Scanner only processes codes when screen is focused:
From components/screens/CameraScreen.tsx:59-80.

Scan Handling

Smart scan processing with UR code support:
From components/screens/CameraScreen.tsx:82-136.

Scanning Overlay

Visual feedback with corner indicators:
From components/screens/CameraScreen.tsx:209-279.

Additional Features

Torch/Flashlight Toggle

From components/screens/CameraScreen.tsx:138-150, 200. Scan QR codes from gallery images:
From components/screens/CameraScreen.tsx:152-174.

Clipboard Paste

Paste payment strings from clipboard:
From components/screens/CameraScreen.tsx:176-182.

Platform-Specific Buttons

iOS - Liquid Glass Buttons

From components/screens/CameraScreen.tsx:287-357.

Android - Blur Buttons

From components/screens/CameraScreen.tsx:359-383.

UR Code Support

Animated QR codes for large payloads:
From hooks/coco/useProcessPaymentString.ts:153-199.

Integration with Payment Processing

The scanner delegates payment processing to useProcessPaymentString:

Scan Sources

All scans are tracked with source attribution:
  • qr - Camera QR scan or gallery import
  • paste - Clipboard paste
  • deeplink - App deep link
  • nfc - 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