- Fixed DI imports: javax.inject -> dev.zacsweers.metro - Fixed cardano-client-lib API: KoiosBackendService constructor, Amount.quantity type - Added kotlin-parcelize plugin - Workaround for Timeline.sendRaw(): use message prefix approach - Fixed MnemonicCode wordlist access - Fixed Compose lifecycle/context handling - Updated test fakes BUILD SUCCESSFUL - unit tests still need updating for new APIs
4.3 KiB
4.3 KiB
Element X ADA Wallet - Phase 1 Status
Current Build Status: ✅ COMPILES (with warnings)
Last build: 2026-03-27
Build command: ./gradlew :features:wallet:impl:compileDebugKotlin
Result: BUILD SUCCESSFUL in 7m 28s
Issues Fixed
1. ✅ DI Import Errors (17 files)
- Changed from
javax.inject.Inject→dev.zacsweers.metro.Inject - Changed from
io.element.android.libraries.di.AppScope→dev.zacsweers.metro.AppScope - Fixed
@ContributesBinding,@SingleIn,@AssistedInject,@Assistedimports
2. ✅ Parcelize Plugin
- Added
id("kotlin-parcelize")to wallet impl build.gradle.kts
3. ✅ cardano-client-lib API Fixes
- Fixed
KoiosBackendServiceconstructor (usenew KoiosBackendService(baseUrl)notBackendFactory.getKoiosBackendService()) - Fixed
Amount.quantitytype - it's aBigInteger, not aString, so use.toLong()not.toLongOrNull() - Fixed
Transaction.serializeToHex()andTransactionUtil.getTxHash()usage - Fixed
signedTx.body.fee.toLong()usage
4. ✅ Timeline.sendRaw() Issue
- Solution: The Matrix SDK doesn't expose raw event sending in the current version
- Workaround: Changed to send payment data as a structured message with
$CARDANO_PAY$prefix - The timeline UI will recognize this prefix and render a payment card
- This is a pragmatic Phase 1 solution; raw events can be added when SDK support arrives
5. ✅ MnemonicCode API
- Fixed
Words.ENGLISH.words→ useMnemonicCode().wordListdirectly
6. ✅ PaymentConfirmationNode Lifecycle
- Changed
lifecycleScope.launch→rememberCoroutineScope().launch(Compose-friendly) - Changed
requireActivity()→LocalContext.current as? FragmentActivity
7. ✅ Button Icon API
- Changed
leadingIcon = { Icon(...) }→leadingIcon = IconSource.Vector(icon)
Remaining Warnings (non-blocking)
- Deprecated
Account(Network, String, Int)constructor - cardano-client-lib deprecation - Deprecated
Icons.Filled.Send- useIcons.AutoMirrored.Filled.Sendinstead - Single @Inject constructor suggestions
- Deprecated
setUserAuthenticationValidityDurationSeconds- Android API deprecation
Test Status: ⚠️ Tests need updating
The unit tests need to be updated for the API changes:
- Test files reference old method signatures
- FakeCardanoKeyStorage and FakeWalletEntryPoint updated
- ~37 test errors to fix (API signature mismatches)
Files Changed
features/wallet/impl/build.gradle.kts
features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/
├── DefaultWalletEntryPoint.kt
├── biometric/BiometricAuthenticator.kt
├── cardano/CardanoWalletManager.kt
├── cardano/DefaultTransactionBuilder.kt
├── cardano/KoiosCardanoClient.kt
├── cardano/PaymentStatusPoller.kt
├── di/WalletModule.kt
├── payment/DefaultPaymentEventSender.kt
├── payment/PaymentConfirmationNode.kt
├── payment/PaymentConfirmationView.kt
├── seedphrase/SeedPhraseManager.kt
├── slash/SlashCommandParser.kt
├── storage/CardanoKeyStorageImpl.kt
└── timeline/TimelineItemContentPaymentFactory.kt
features/wallet/test/build.gradle.kts
features/wallet/test/src/main/kotlin/io/element/android/features/wallet/test/
├── FakeWalletEntryPoint.kt
└── storage/FakeCardanoKeyStorage.kt
Next Steps
- Fix unit tests - Update test files to match new API signatures
- Integration testing - Test actual Cardano transactions on Preview network
- Timeline rendering - Implement payment card rendering in messages feature
- UI polish - Add AutoMirrored icons, clean up deprecation warnings
Technical Notes
Payment Event Sending Strategy
Since the Matrix Rust SDK doesn't expose sendRaw() for custom events, we use a message-based approach:
// Payment messages have format:
"$CARDANO_PAY$" + json(PaymentEventData)
// Status updates have format:
"$CARDANO_STATUS$" + json(PaymentStatusUpdateData)
The timeline UI should check for these prefixes and render payment cards accordingly.
cardano-client-lib Version
Using version 0.7.1 with Koios backend. Key classes:
KoiosBackendService(baseUrl)- main backendQuickTxBuilder(backendService)- transaction buildingAccount(network, mnemonic)- key derivation (deprecated but functional)TransactionUtil.getTxHash(tx)- hash calculation