diff --git a/domain/models/src/main/kotlin/com/tangem/domain/models/currency/CryptoCurrency.kt b/domain/models/src/main/kotlin/com/tangem/domain/models/currency/CryptoCurrency.kt index bb3a9b95ee..3e745dc152 100644 --- a/domain/models/src/main/kotlin/com/tangem/domain/models/currency/CryptoCurrency.kt +++ b/domain/models/src/main/kotlin/com/tangem/domain/models/currency/CryptoCurrency.kt @@ -99,7 +99,7 @@ sealed class CryptoCurrency { val rawCurrencyId: RawID? get() = (suffix as? Suffix.RawID)?.rawId?.let { RawID(it) } /** Represents a contract address */ - val contractAddress: String? get() = (suffix as? Suffix.RawID)?.contractAddress + val contractAddress: String? get() = suffix.contractAddress /** Represents a raw cryptocurrency's network ID */ val rawNetworkId: String @@ -170,10 +170,11 @@ sealed class CryptoCurrency { /** The value of the suffix, which could be either a raw ID or a contract address. */ abstract val value: String + abstract val contractAddress: String? /** Represents a raw ID suffix. */ @Serializable - data class RawID(val rawId: String, val contractAddress: String? = null) : Suffix() { + data class RawID(val rawId: String, override val contractAddress: String? = null) : Suffix() { override val value: String get() = buildString { append(rawId) @@ -186,7 +187,7 @@ sealed class CryptoCurrency { /** Represents a contract address suffix. */ @Serializable - data class ContractAddress(val contractAddress: String) : Suffix() { + data class ContractAddress(override val contractAddress: String) : Suffix() { override val value: String get() = contractAddress } } diff --git a/domain/staking/src/main/java/com/tangem/domain/staking/model/StakingIntegrationID.kt b/domain/staking/src/main/java/com/tangem/domain/staking/model/StakingIntegrationID.kt index 435abeeffc..f1514e69a5 100644 --- a/domain/staking/src/main/java/com/tangem/domain/staking/model/StakingIntegrationID.kt +++ b/domain/staking/src/main/java/com/tangem/domain/staking/model/StakingIntegrationID.kt @@ -110,7 +110,7 @@ sealed interface StakingIntegrationID { val integrationId = blockchain.integrationId ?: return null - if (integrationId is Coin && currencyId.contractAddress != null) { + if (integrationId is Coin && !currencyId.contractAddress.isNullOrBlank()) { return null }