feat(wallet): add recipient address to payment card UI

Enhanced the payment timeline card to display the recipient/sender address:
- Added truncatedToAddress and truncatedFromAddress to TimelineItemPaymentContent
- New truncateAddress() helper (first 8 + last 6 chars)
- Payment card now shows "To: addr_tes...ytjqp" for sent payments
- And "From: addr_tes...pd0hq" for received payments
- Updated wrapper to expose new properties

The card now displays:
- Amount in ADA (large, bold)
- Sent/Received indicator with Cardano icon
- Truncated recipient/sender address
- Status chip (Pending/Confirmed/Failed with icons)
- Truncated tx hash (tappable to CardanoScan)
- Testnet badge when applicable
- "View on CardanoScan →" link for confirmed transactions
This commit is contained in:
Kayos 2026-03-29 06:57:12 -07:00
parent faa6f768f6
commit 699807e1bd
3 changed files with 50 additions and 3 deletions

View file

@ -64,6 +64,18 @@ data class TimelineItemPaymentContent(
}
}
/**
* Truncated recipient address for display (first 8 + last 6 chars).
*/
val truncatedToAddress: String
get() = truncateAddress(toAddress)
/**
* Truncated sender address for display (first 8 + last 6 chars).
*/
val truncatedFromAddress: String
get() = truncateAddress(fromAddress)
/**
* CardanoScan URL for viewing the transaction.
*/
@ -93,5 +105,16 @@ data class TimelineItemPaymentContent(
"$formatted ADA"
}
}
/**
* Truncate a Cardano address for display (first 8 + last 6 chars).
*/
fun truncateAddress(address: String): String {
return if (address.length > 18) {
"${address.take(8)}...${address.takeLast(6)}"
} else {
address
}
}
}
}