This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. IMPORTANT: Update the justfile, README.md, and CLAUDE.md when making changes to the project structure or development flows.
SatsApp is a Bitcoin wallet iOS application using the Cashu ecash protocol. It uses a SwiftUI-based interface with no authentication required - the wallet opens directly on launch.
This project uses just (command runner) for build automation. Key commands:
# Build and Development
just build # Build for iOS simulator
just run # Build, install, and launch with log streaming
just quick # Fast rebuild and run (skips clean)
# Testing and Debugging
just test # Run tests on simulator
just logs # Stream console logs
# Dependency Management
just deps # Install Swift Package dependencies
just update-deps # Update all dependencies
just show-deps # Show resolved package versions
# Utilities
just clean # Clean build artifacts
just simulators # Show available simulators
just open # Open project in Xcode
just reset # Clean + reset all simulatorsIMPORTANT: Use the justfile to run and codify common development tasks. Update the tasks as necessary. Keep the tasks simple and DRY (do not repeat yourself).
The app follows MVVM pattern with SwiftUI:
- App/SatsApp.swift: Main app entry with @StateObject WalletManager
- Models/: Business logic and state management
WalletManager: Cashu wallet operations via MultiMintWallet, balance tracking, mint managementStorageManager: iCloud/local storage management for wallet dataMintDirectory,MintInfoService: Mint discovery and info fetchingUITransaction: Transaction data model for UI displayAppLogger: Centralized logging utility
- Views/: SwiftUI views organized by feature
- First launch: MintSelectionView, MintDetailView (configure initial mint)
- Main app: ContentView (tab container) -> TransactView, ActivityView, BalanceView
- Sheets: DepositSheetView (funding flow), WalletLoadingView (initialization)
- Components/: Reusable UI components
Theme.swift: Centralized UI theming and stylingQRCodeView.swift,AnimatedQRCodeView.swift: QR code display (static and animated)
- Cashu/Bitcoin:
cdk-swift0.14.2 (Cashu Development Kit) - provides MultiMintWallet and WalletSqliteDatabase
- Wallet data stored in iCloud Documents (with local fallback if iCloud unavailable)
- Mnemonic (seed) stored as seed.txt in wallet directory
- SQLite database (wallet.db) for wallet state via WalletSqliteDatabase
- StorageManager handles storage location selection and file operations
- Uses MultiMintWallet for multi-mint support with unified balance
- First launch requires mint selection (MintSelectionView)
- Connects to Cashu mints for ecash operations
- Supports Lightning invoice generation for funding (mint quote/melt)
Package Resolution: If dependencies fail to resolve:
just clean
just update-deps
just buildUse the iOS logging library. Most logs should remain at the DEBUG level, however log important applications events at INFO. Use WARN and ERROR as appropriate.
- Amounts use Bitcoin symbol as prefix:
₿1,000(no space between symbol and number) - Primary formatter:
WalletManager.formattedBalanceuses NumberFormatter with comma grouping - Used consistently across: balance display, transaction amounts, deposit flow, mints drawer
- Bundle ID: app.paywithsats
- Minimum iOS: 16.0 (deployment target)
- Swift Version: 5.0
- Xcode Project: SatsApp.xcodeproj