Updated on 2026-08-14
This commit is contained in:
parent
d71d29b72b
commit
b750588ef9
21 changed files with 277 additions and 67 deletions
|
|
@ -3,10 +3,10 @@ package com.tangem.datasource.local.swaptx
|
|||
import com.tangem.datasource.local.datastore.core.StringKeyDataStore
|
||||
|
||||
internal class DefaultSwapTransactionStatusStore(
|
||||
private val dataStore: StringKeyDataStore<ExchangeAnalyticsStatus>,
|
||||
) : SwapTransactionStatusStore, StringKeyDataStore<ExchangeAnalyticsStatus> by dataStore {
|
||||
private val dataStore: StringKeyDataStore<ExpressAnalyticsStatus>,
|
||||
) : SwapTransactionStatusStore, StringKeyDataStore<ExpressAnalyticsStatus> by dataStore {
|
||||
|
||||
override suspend fun getTransactionStatus(txId: String) = getSyncOrNull(txId)
|
||||
|
||||
override suspend fun setTransactionStatus(txId: String, status: ExchangeAnalyticsStatus) = store(txId, status)
|
||||
override suspend fun setTransactionStatus(txId: String, status: ExpressAnalyticsStatus) = store(txId, status)
|
||||
}
|
||||
|
|
@ -4,12 +4,12 @@ package com.tangem.datasource.local.swaptx
|
|||
* Runtime cache for storing swap transactions statuses sent to analytics
|
||||
*/
|
||||
interface SwapTransactionStatusStore {
|
||||
suspend fun getTransactionStatus(txId: String): ExchangeAnalyticsStatus?
|
||||
suspend fun getTransactionStatus(txId: String): ExpressAnalyticsStatus?
|
||||
|
||||
suspend fun setTransactionStatus(txId: String, status: ExchangeAnalyticsStatus)
|
||||
suspend fun setTransactionStatus(txId: String, status: ExpressAnalyticsStatus)
|
||||
}
|
||||
|
||||
enum class ExchangeAnalyticsStatus(val value: String) {
|
||||
enum class ExpressAnalyticsStatus(val value: String) {
|
||||
WaitingTxHash("Waiting tx hash"),
|
||||
InProgress("In Progress"),
|
||||
Done("Done"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue