Updated on 2026-08-14
This commit is contained in:
parent
06914b63ae
commit
51c7e4e10b
2 changed files with 5 additions and 4 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue