Updated on 2026-08-14

This commit is contained in:
Tangem 2024-03-02 15:36:13 +05:00
parent 613bb9226f
commit 3f1102f232
20 changed files with 247 additions and 172 deletions

View file

@ -3,8 +3,8 @@ package com.tangem.domain.tokens.model
import java.math.BigDecimal
sealed class FeePaidCurrency {
object Coin : FeePaidCurrency()
object SameCurrency : FeePaidCurrency()
data object Coin : FeePaidCurrency()
data object SameCurrency : FeePaidCurrency()
data class Token(
val tokenId: CryptoCurrency.ID,
val name: String,

View file

@ -35,14 +35,14 @@ class GetFeePaidCryptoCurrencyStatusSyncUseCase(
return either {
when (feePaidCurrency) {
FeePaidCurrency.Coin -> getCryptoCurrency(operations, cryptoCurrency.id)
FeePaidCurrency.Coin -> getCryptoCurrencyStatus(operations, cryptoCurrency.id)
FeePaidCurrency.SameCurrency -> cryptoCurrencyStatus
is FeePaidCurrency.Token -> getCryptoCurrency(operations, feePaidCurrency.tokenId)
is FeePaidCurrency.Token -> getCryptoCurrencyStatus(operations, feePaidCurrency.tokenId)
}
}
}
private suspend fun getCryptoCurrency(
private suspend fun getCryptoCurrencyStatus(
operations: CurrenciesStatusesOperations,
cryptoCurrencyId: CryptoCurrency.ID,
): CryptoCurrencyStatus? {