Build tested on Lucy using Docker (mingc/android-build-box)
- wallet:api: COMPILES SUCCESSFULLY ✅
- wallet:impl: FAILS with ~60 errors (documented issues)
5.8 KiB
Phase 1 Status Report
Date: 2026-03-27 Auditor: Kayos (automated audit) Build Environment: Docker on Lucy (mingc/android-build-box)
Executive Summary
BUILD STATUS: ⚠️ PARTIAL
- ✅
features:wallet:api- COMPILES SUCCESSFULLY - ❌
features:wallet:impl- FAILS (~60 errors)
The Phase 1 code has fundamental issues that prevent compilation. The code makes API assumptions that don't match the actual Element X and cardano-client-lib APIs. This requires significant rework before it can be tested on device.
Audit Findings
Issues Fixed (Pushed to Gitea)
-
DI Package Typo ✅ FIXED
dev.zacsweeny.metro→dev.zacsweers.metro(missing 's')- Files: KoiosCardanoClient, DefaultTransactionBuilder, PaymentStatusPoller, WalletModule
-
Missing Dependency ✅ FIXED
- Added
implementation(projects.features.wallet.impl)to messages:impl build.gradle.kts
- Added
-
Event Type Inconsistency ✅ FIXED
- Standardized to
co.sulkta.payment.requesteverywhere - Updated TimelineItemPaymentContent.EVENT_TYPE and tests
- Standardized to
-
Scope Inconsistency ✅ FIXED
- PaymentStatusPoller changed from AppScope to SessionScope (matches CardanoClient scope)
-
Sealed Interface Inheritance ✅ FIXED
- TimelineItemPaymentContent can't inherit from sealed TimelineItemEventContent (different modules)
- Created TimelineItemPaymentContentWrapper adapter in messages:impl
-
cardano-client-lib API ✅ PARTIALLY FIXED
- Changed
getNetworks()togetNetwork()returningNetworkinstead ofNetworks
- Changed
Critical Issues Remaining (Blocks Compilation)
1. DI Import Paths Wrong
Impact: ~20 compilation errors Files: Most wallet/impl files
The code uses:
import dev.zacsweers.metro.SessionScope // WRONG
import dev.zacsweers.metro.Inject // WRONG
Should be:
import io.element.android.libraries.di.SessionScope
import javax.inject.Inject
Status: Partially fixed, but more instances remain
2. Timeline.sendRaw() Doesn't Exist
Impact: Critical - payment sending broken Files: DefaultPaymentEventSender.kt
The code assumes:
timeline.sendRaw(eventType, content) // DOESN'T EXIST
The Matrix Rust SDK's Timeline API doesn't expose raw event sending. The BLOCKERS.md claimed this was resolved in SDK version 26.03.24, but grep shows no sendRaw method in the Element X libraries/matrix module.
Required Fix: Either:
- Find the actual API for sending custom events (if it exists)
- Use a workaround (message with structured body?)
- Wait for SDK to add this capability
3. Koios Backend API Wrong
Impact: Balance/UTxO fetching broken File: KoiosCardanoClient.kt
The code uses:
BackendFactory.getKoiosBackendService() // DOESN'T EXIST
cardano-client-lib doesn't have a BackendFactory class. The actual API is:
val backendService = KoiosBackendService(CardanoNetworkConfig.KOIOS_BASE_URL)
4. Parcelize Plugin Missing
Impact: ~15 compilation errors Files: ParsedPayCommand.kt, PaymentEntryNode.kt, PaymentConfirmationNode.kt, PaymentProgressNode.kt
The build.gradle.kts has id("kotlin-parcelize") but the imports use wrong paths:
import kotlinx.parcelize.Parcelize // Correct
import android.os.parcelize.Parcelize // Used incorrectly in some places
5. Compose API Mismatches
Impact: UI won't compile File: PaymentConfirmationView.kt
Button(
onClick = { ... },
icon = { Icon(...) } // WRONG: Button doesn't have icon parameter
)
Element X's Button API differs from what was assumed.
6. SeedPhraseManager ENGLISH Wordlist Reference
Impact: Mnemonic generation broken File: SeedPhraseManager.kt
MnemonicCode.ENGLISH // DOESN'T EXIST
The correct API uses the MnemonicCode class differently.
Architecture Assessment
What's Correct
- Module structure (api/impl/test) follows Element X patterns
- Basic DI approach using Metro with @ContributesBinding
- Network configuration centralized in CardanoNetworkConfig
- Security design for key storage (Keystore, biometric, per-session)
- Timeline payment card concept
What Needs Rework
- Payment Event Sending - Fundamental approach needs re-evaluation since
sendRawdoesn't exist - Koios Client - API usage completely wrong, needs rewrite to actual cardano-client-lib API
- Import Statements - Systematic cleanup of DI and parcelize imports
- Compose Components - Match Element X's actual component APIs
Recommendations
Immediate Actions Required
-
Verify SDK Capabilities - Check if Matrix Rust SDK actually supports custom event types at all. If not, Phase 1 needs fundamental redesign.
-
Fix Koios Client - Rewrite KoiosCardanoClient to use actual cardano-client-lib API:
val backendService = KoiosBackendService(CardanoNetworkConfig.KOIOS_BASE_URL) val addressService = AddressService(backendService) // etc. -
Element X API Review - Before writing more code, do a thorough review of:
- Timeline event APIs
- Button/UI component APIs
- DI patterns used in existing features
Phase 1 Assessment
Ready for device testing? ❌ NO
The code cannot compile. Estimated work to fix:
- Import cleanup: ~1 hour
- Koios client rewrite: ~2 hours
- Payment event sending redesign: ~4-8 hours (depends on SDK capabilities)
- UI component fixes: ~1 hour
- Testing: ~2 hours
Total estimated fix time: 10-14 hours of focused work
Commits Made
fix(wallet): resolve audit findings - DI typos, missing dependency, event type consistencyfix(wallet): resolve sealed interface inheritance issuefix(wallet): fix cardano-client-lib API compatibility
All changes pushed to phase1-dev branch on Gitea.
Report generated automatically by Phase 1 audit subagent