Updated on 2026-08-14
This commit is contained in:
commit
b8e40c6e73
5 changed files with 46 additions and 38 deletions
|
|
@ -110,7 +110,9 @@ sealed interface Currency {
|
|||
)
|
||||
}
|
||||
|
||||
fun fromTokenResponse(tokenResponse: TokenResponse): Currency {
|
||||
fun fromTokenResponse(tokenResponse: TokenResponse): Currency? {
|
||||
val blockchain = com.tangem.blockchain.common.Blockchain.fromNetworkId(tokenResponse.networkId)
|
||||
?: return null
|
||||
return when {
|
||||
tokenResponse.contractAddress != null -> Token(
|
||||
com.tangem.blockchain.common.Token(
|
||||
|
|
@ -120,11 +122,11 @@ sealed interface Currency {
|
|||
decimals = tokenResponse.decimals,
|
||||
id = tokenResponse.id,
|
||||
),
|
||||
blockchain = com.tangem.blockchain.common.Blockchain.fromNetworkId(tokenResponse.networkId)!!,
|
||||
blockchain = blockchain,
|
||||
derivationPath = tokenResponse.derivationPath,
|
||||
)
|
||||
else -> Blockchain(
|
||||
blockchain = com.tangem.blockchain.common.Blockchain.fromNetworkId(tokenResponse.networkId)!!,
|
||||
blockchain = blockchain,
|
||||
derivationPath = tokenResponse.derivationPath,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue