Updated on 2026-08-14

This commit is contained in:
Tangem 2024-08-29 18:44:22 +05:00
parent 473a936863
commit df938519a2
13 changed files with 155 additions and 32 deletions

View file

@ -1,6 +1,7 @@
package com.tangem.datasource.api.tangemTech.models
import com.squareup.moshi.Json
import com.tangem.common.extensions.calculateHashCode
data class UserTokensResponse(
@Json(name = "version") val version: Int = 0,
@ -17,7 +18,23 @@ data class UserTokensResponse(
@Json(name = "symbol") val symbol: String,
@Json(name = "decimals") val decimals: Int,
@Json(name = "contractAddress") val contractAddress: String?,
)
) {
override fun equals(other: Any?): Boolean {
val otherToken = other as? Token ?: return false
return otherToken.contractAddress == this.contractAddress &&
otherToken.networkId == this.networkId &&
otherToken.derivationPath == this.derivationPath &&
otherToken.decimals == this.decimals
}
override fun hashCode(): Int = calculateHashCode(
contractAddress.hashCode(),
networkId.hashCode(),
derivationPath.hashCode(),
decimals.hashCode(),
)
}
enum class GroupType {
@Json(name = "none")