Implements Task 5 of Phase 1: New files: - ParsedPayCommand.kt: Sealed interface for parse results - WithAddressRecipient: Pay to Cardano address - WithMatrixRecipient: Pay to Matrix user (requires lookup) - AmountOnly: Amount specified, prompt for recipient - Empty: Open payment flow with no prefilled data - ParseError: Parse error with human-readable reason - SlashCommandParser.kt: Full /pay command parser - Handles: /pay, /pay 10, /pay 10 ADA, /pay 10 tADA - Matrix recipients: /pay 10 ADA @user:server - Cardano addresses: /pay 10 ADA addr1... - Validates amounts (decimal support, max supply check) - Validates addresses (prefix, length, network match) - Comprehensive error messages - SlashCommandParserTest.kt: 40+ unit tests covering all patterns Modified files: - ResolvedSuggestion.kt: Added Command type for slash commands - SuggestionsProcessor.kt: /pay shows as autocomplete suggestion - MarkdownTextEditorState.kt: Command insertion in text editor - MessageComposerPresenter.kt: Command handling in InsertSuggestion Note: MessageComposerPresenter sendMessage interception deferred to Task 6 (requires PaymentFlowPresenter for navigation).
4.2 KiB
BLOCKERS.md - Phase 1 Implementation Blockers
Task 1: Module Scaffolding
Completed
- ✅ Module structure created (api/impl/test)
- ✅ Metro DI setup following Element X patterns
- ✅ WalletEntryPoint and WalletState APIs defined
- ✅ PaymentFlowNode placeholder with Appyx navigation
- ✅ FakeWalletEntryPoint for testing
- ✅ Cardano client library dependencies added
- ✅ ProGuard rules configured
- ✅ Basic unit tests added
- ✅ Pushed to Gitea phase1-dev branch
Not Verified (No Android SDK in build environment)
- ⚠️
./gradlew :features:wallet:impl:assemble- compilation not tested - ⚠️
./gradlew ktlintCheck --continue- code style not verified - ⚠️
./gradlew :features:wallet:impl:test- unit tests not run
Action Required
When a developer with Android SDK runs this code:
- Run
./gradlew :features:wallet:impl:assembleto verify compilation - Run
./gradlew ktlintCheck --continueand fix any code style issues - Run
./gradlew :features:wallet:impl:testto verify tests pass
Resolved Decisions
Q1: Wallet Scope ✅ RESOLVED
Decision: Per-session (each Matrix account has its own wallet)
Each Matrix session maintains its own independent wallet. This aligns with Matrix's account-centric model and provides proper isolation between accounts.
Phase 3 Planned: Optional wallet sharing between accounts — will be implemented as a user preference, not default behavior.
Q2: Key Storage on Biometric Change ✅ RESOLVED
Decision: INVALIDATE keys and require re-authentication/re-setup
When biometric enrollment changes (fingerprints added/removed, face re-enrolled, etc.), stored wallet keys are invalidated. Users must re-authenticate and re-setup their wallet access. This is intentional security behavior, not a bug — it prevents unauthorized access if a device is compromised or biometrics are changed by an attacker.
Q3: Network Configuration ✅ RESOLVED
Decision: TESTNET first, with easy mainnet swap
Development and initial testing will target Cardano testnet. The network configuration must be a single constant or build flavor — no scattered hardcoded values throughout the codebase.
Implementation requirements:
- Single source of truth:
Constants.NETWORK_MODEor build variant - All network-dependent URLs/configs derived from this single value
- Clean swap to mainnet via config change or release build flavor
- No hunting through code for hardcoded "testnet" strings
Android Emulator
Development Android emulator is live and available:
| Service | Address |
|---|---|
| ADB | 192.168.0.5:5555 |
| noVNC (browser access) | http://192.168.0.5:6080 |
Connect via: adb connect 192.168.0.5:5555
Task 5: /pay Slash Command Parser + SuggestionsProcessor Extension
Completed
- ✅
ParsedPayCommand.kt- Sealed interface for parse results (WithAddressRecipient, WithMatrixRecipient, AmountOnly, Empty, ParseError) - ✅
SlashCommandParser.kt- Full parser implementation with:- Amount parsing (integers, decimals, up to 6 decimal places for lovelace precision)
- Unit support (ADA, tADA for testnet, lovelace)
- Matrix user ID validation (@user:server format)
- Cardano address validation (addr1/addr_test1 prefixes, length checks, network mismatch detection)
- Comprehensive error messages
- ✅
ResolvedSuggestion.kt- AddedCommand(command: String, description: String)type - ✅
SuggestionsProcessor.kt- Added /pay command suggestion with filtering - ✅
MarkdownTextEditorState.kt- Added Command case to insertSuggestion() - ✅
MessageComposerPresenter.kt- Added Command handling in InsertSuggestion event - ✅
SlashCommandParserTest.kt- Comprehensive unit tests (40+ test cases)
What's Still Needed (Task 6)
- ⚠️ MessageComposerPresenter interception of /pay on send (requires PaymentFlowPresenter from Task 6)
- ⚠️ Navigation to payment flow when /pay is sent
- ⚠️ Integration with PaymentFlowNode for actual payment execution
Testing Notes
- Tests use plain JUnit with Truth assertions
- Parser handles edge cases: whitespace, case sensitivity, decimal precision, network mismatches
- Testnet support via
tADAunit oraddr_test1addresses
Last updated: 2026-03-27