Updated on 2026-08-14

This commit is contained in:
Tangem 2022-10-12 12:17:19 +04:00
parent 7efc129909
commit ed47aefb33
3 changed files with 5 additions and 11 deletions

@ -1 +1 @@
Subproject commit f33f020823031f1c532cf5a9d5cf3fbecadcf050
Subproject commit 8a36217ba816e1cc7cbc7290ffb948282ec15f6b

View file

@ -61,7 +61,7 @@ sealed interface Currency {
return TokenResponse(
id = coinId,
networkId = blockchain.toNetworkId(),
derivationPath = derivationPath ?: DERIVATION_PATH_RAW_VALUE,
derivationPath = derivationPath,
name = currencyName,
symbol = currencySymbol,
decimals = decimals,
@ -70,7 +70,6 @@ sealed interface Currency {
}
companion object {
private const val DERIVATION_PATH_RAW_VALUE = "m/44'/60'/0'/0/0"
fun fromBlockchainNetwork(
blockchainNetwork: BlockchainNetwork,
token: com.tangem.blockchain.common.Token? = null,
@ -112,11 +111,6 @@ sealed interface Currency {
}
fun fromTokenResponse(tokenResponse: TokenResponse): Currency {
val derivationPath = if (tokenResponse.derivationPath == DERIVATION_PATH_RAW_VALUE) {
null
} else {
tokenResponse.derivationPath
}
return when {
tokenResponse.contractAddress != null -> Token(
com.tangem.blockchain.common.Token(
@ -127,11 +121,11 @@ sealed interface Currency {
id = tokenResponse.id,
),
blockchain = com.tangem.blockchain.common.Blockchain.fromNetworkId(tokenResponse.networkId)!!,
derivationPath = derivationPath,
derivationPath = tokenResponse.derivationPath,
)
else -> Blockchain(
blockchain = com.tangem.blockchain.common.Blockchain.fromNetworkId(tokenResponse.networkId)!!,
derivationPath = derivationPath,
derivationPath = tokenResponse.derivationPath,
)
}
}