[#1316] Readable TxId on TransactionOverview

Closes #1316
This commit is contained in:
Honza Rychnovský 2024-01-05 09:56:23 +01:00 committed by GitHub
parent 437a2e08ec
commit 1dd369167a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,9 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- `TransactionOverview.txIdString()` to provide a readable transaction ID to SDK-consuming apps
### Changed
- Gradle 8.5
- Kotlin 1.9.21

View File

@ -1,5 +1,6 @@
package cash.z.ecc.android.sdk.model
import cash.z.ecc.android.sdk.internal.ext.toHexReversed
import cash.z.ecc.android.sdk.internal.model.DbTransactionOverview
/**
@ -29,6 +30,11 @@ data class TransactionOverview internal constructor(
) {
override fun toString() = "TransactionOverview"
/**
* @return Transaction ID in String obtained from `rawId`
*/
fun txIdString() = rawId.byteArray.toHexReversed()
companion object {
internal fun new(
dbTransactionOverview: DbTransactionOverview,