Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-03 16:39:54 +04:00
parent 06914b63ae
commit 51c7e4e10b
2 changed files with 5 additions and 4 deletions

View file

@ -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
}
}

View file

@ -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
}