156 lines
5.9 KiB
Markdown
156 lines
5.9 KiB
Markdown
# Element X ADA - Phase 3 Build Result
|
|
|
|
**Date:** 2026-03-28
|
|
**Branch:** `phase1-dev`
|
|
**Commit:** `e33c87c164`
|
|
**Status:** ✅ Build Successful
|
|
|
|
## What Was Built
|
|
|
|
### 1. Wallet Panel UI (`features/wallet/impl/src/main/kotlin/io/element/android/features/wallet/impl/panel/`)
|
|
|
|
Created a complete wallet panel with 4 tabs:
|
|
|
|
**Overview Tab:**
|
|
- Balance display with ADA amount
|
|
- Testnet indicator when on preprod
|
|
- QR code for receiving payments (using zxing)
|
|
- Truncated address with tap-to-copy
|
|
- "Send ADA" button that navigates to payment flow
|
|
|
|
**Assets Tab:**
|
|
- Lists native tokens held at the wallet address
|
|
- Shows token name (decoded from hex if printable)
|
|
- Shows truncated policy ID
|
|
- Shows quantity
|
|
|
|
**History Tab:**
|
|
- Shows recent transactions
|
|
- Direction indicator (sent/received) with color coding
|
|
- Formatted date
|
|
- Truncated tx hash
|
|
- "View in explorer" link (cardanoscan.io or preprod.cardanoscan.io)
|
|
|
|
**Settings Tab:**
|
|
- Full wallet address display with copy button
|
|
- Network indicator (Testnet/Mainnet badge)
|
|
- Export recovery phrase option (UI only, biometric not wired)
|
|
- Delete wallet option (UI only, confirmation not wired)
|
|
|
|
### 2. Wallet API Models (`features/wallet/api/`)
|
|
|
|
**NativeAsset.kt:**
|
|
- Data class for Cardano native tokens
|
|
- Properties: policyId, assetName, quantity, displayName, fingerprint
|
|
- Computed properties: truncatedPolicyId, name (with hex→ASCII conversion)
|
|
|
|
**TxSummary.kt:**
|
|
- Data class for transaction history entries
|
|
- Properties: txHash, blockTime, totalOutput, fee, direction
|
|
- Computed properties: formattedDate, truncatedTxHash, amountAda, explorerUrl()
|
|
|
|
### 3. CardanoClient Extensions
|
|
|
|
Added to `CardanoClient` interface:
|
|
- `getAddressAssets(address: String): Result<List<NativeAsset>>`
|
|
- `getAddressTransactions(address: String, limit: Int = 20): Result<List<TxSummary>>`
|
|
|
|
Implemented in `KoiosCardanoClient`:
|
|
- Both methods use Koios API with retry logic and rate limiting
|
|
- Transaction history is simplified (direction detection needs UTXO analysis)
|
|
|
|
Updated `FakeCardanoClient` with corresponding methods for testing.
|
|
|
|
### 4. Messages Integration
|
|
|
|
**Wallet Button in DM Header:**
|
|
- Added `isDmRoom` property to `MessagesState`
|
|
- Added `onWalletClick` callback to `MessagesView` and `MessagesViewTopBar`
|
|
- Wallet button (Chart icon) shows only in DM rooms
|
|
- Uses `CompoundIcons.Chart()` as placeholder (Compound lacks a wallet icon)
|
|
|
|
**Navigation Wiring:**
|
|
- Added `NavTarget.WalletPanel` to `MessagesFlowNode`
|
|
- Added `navigateToWallet()` to `MessagesNode.Callback`
|
|
- Created `WalletPanelNode` with Appyx pattern
|
|
- `onSendAda` callback pops panel and pushes PaymentFlow
|
|
|
|
### 5. String Resources
|
|
|
|
Added `features/wallet/impl/src/main/res/values/strings.xml` with all wallet panel strings.
|
|
|
|
## What Was NOT Built (Lower Priority)
|
|
|
|
1. **Wallet Setup Flow** - The "Set Up Wallet" button UI exists but doesn't navigate to a real setup flow
|
|
2. **Recovery Phrase Export** - Settings option exists but biometric authentication flow not wired
|
|
3. **Wallet Deletion Confirmation** - Delete option exists but confirmation dialog not implemented
|
|
4. **No-wallet guard for /pay** - Not implemented (would need MessageComposerPresenter changes)
|
|
5. **Payment timeline card renderer** - Not implemented
|
|
6. **Detailed transaction amounts** - History shows total output but needs additional API calls for accurate amounts
|
|
|
|
## Known Issues
|
|
|
|
1. **Icon Placeholders:**
|
|
- Wallet icon uses `CompoundIcons.Chart()` (no wallet icon in Compound)
|
|
- Asset icon uses `CompoundIcons.Files()`
|
|
- External link uses `CompoundIcons.PopOut()`
|
|
- Arrow down for received tx uses `CompoundIcons.ArrowDown()` (no ArrowDownLeft)
|
|
|
|
2. **Transaction History Simplification:**
|
|
- Direction detection is simplified (always RECEIVED)
|
|
- Total output shown but actual sent/received amount needs UTXO analysis
|
|
|
|
3. **Deprecation Warnings:**
|
|
- `TabRow` deprecated in favor of `PrimaryTabRow`/`SecondaryTabRow`
|
|
- `LocalClipboardManager` deprecated in favor of `LocalClipboard`
|
|
- Cardano client `Account` constructor deprecated
|
|
|
|
## Build Verification
|
|
|
|
```
|
|
BUILD SUCCESSFUL in 1m 37s
|
|
3828 actionable tasks: 24 executed, 1 from cache, 3803 up-to-date
|
|
```
|
|
|
|
Full Gplay debug flavor builds successfully. APK available at:
|
|
`/tmp/element-x-android/app/build/outputs/apk/gplay/debug/`
|
|
|
|
## Files Changed (24 files)
|
|
|
|
**New Files:**
|
|
- `features/wallet/api/.../NativeAsset.kt`
|
|
- `features/wallet/api/.../TxSummary.kt`
|
|
- `features/wallet/impl/.../panel/WalletPanelNode.kt`
|
|
- `features/wallet/impl/.../panel/WalletPanelPresenter.kt`
|
|
- `features/wallet/impl/.../panel/WalletPanelState.kt`
|
|
- `features/wallet/impl/.../panel/WalletPanelView.kt`
|
|
- `features/wallet/impl/.../panel/tabs/AssetsTabView.kt`
|
|
- `features/wallet/impl/.../panel/tabs/HistoryTabView.kt`
|
|
- `features/wallet/impl/.../panel/tabs/OverviewTabView.kt`
|
|
- `features/wallet/impl/.../panel/tabs/SettingsTabView.kt`
|
|
- `features/wallet/impl/src/main/res/values/strings.xml`
|
|
|
|
**Modified Files:**
|
|
- `features/wallet/api/.../CardanoClient.kt`
|
|
- `features/wallet/impl/build.gradle.kts`
|
|
- `features/wallet/impl/.../cardano/KoiosCardanoClient.kt`
|
|
- `features/wallet/test/.../FakeCardanoClient.kt`
|
|
- `features/messages/impl/.../MessagesFlowNode.kt`
|
|
- `features/messages/impl/.../MessagesNode.kt`
|
|
- `features/messages/impl/.../MessagesPresenter.kt`
|
|
- `features/messages/impl/.../MessagesState.kt`
|
|
- `features/messages/impl/.../MessagesStateProvider.kt`
|
|
- `features/messages/impl/.../MessagesView.kt`
|
|
- `features/messages/impl/.../MessagesViewWithIdentityChangePreview.kt`
|
|
- `features/messages/impl/.../ThreadedMessagesNode.kt`
|
|
- `features/messages/impl/.../topbars/MessagesViewTopBar.kt`
|
|
|
|
## Next Steps
|
|
|
|
1. Add proper wallet icon to Compound design system or use custom icon
|
|
2. Implement wallet setup flow navigation
|
|
3. Wire biometric authentication for recovery phrase export
|
|
4. Add wallet deletion confirmation dialog
|
|
5. Implement no-wallet guard in MessageComposerPresenter for /pay command
|
|
6. Create payment timeline card renderer for m.payment events
|
|
7. Enhance transaction history with accurate amount calculation
|