Updated on 2026-08-14

This commit is contained in:
Tangem 2023-10-10 15:17:32 +03:00
parent 13ae7be53f
commit 75234e34df
2 changed files with 10 additions and 4 deletions

View file

@ -4,7 +4,7 @@ import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.Token
import java.math.BigDecimal
@Suppress("ComplexMethod")
@Suppress("ComplexMethod", "LongMethod")
fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
return when (networkId) {
"arbitrum-one" -> Blockchain.Arbitrum
@ -70,11 +70,13 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
"octaspace/test" -> Blockchain.OctaSpaceTestnet
"chia" -> Blockchain.Chia
"chia/test" -> Blockchain.ChiaTestnet
"near" -> Blockchain.Near
"near/test" -> Blockchain.NearTestnet
else -> null
}
}
@Suppress("ComplexMethod")
@Suppress("ComplexMethod", "LongMethod")
fun Blockchain.toNetworkId(): String {
return when (this) {
Blockchain.Unknown -> "unknown"
@ -141,10 +143,12 @@ fun Blockchain.toNetworkId(): String {
Blockchain.OctaSpaceTestnet -> "octaspace/test"
Blockchain.Chia -> "chia"
Blockchain.ChiaTestnet -> "chia/test"
Blockchain.Near -> "near"
Blockchain.NearTestnet -> "near/test"
}
}
@Suppress("ComplexMethod")
@Suppress("ComplexMethod", "LongMethod")
fun Blockchain.toCoinId(): String {
return when (this) {
Blockchain.Binance, Blockchain.BinanceTestnet, Blockchain.BSC, Blockchain.BSCTestnet -> "binancecoin"
@ -187,6 +191,8 @@ fun Blockchain.toCoinId(): String {
Blockchain.OctaSpace, Blockchain.OctaSpaceTestnet -> "octaspace"
Blockchain.Chia -> "chia"
Blockchain.ChiaTestnet -> "chia/test"
Blockchain.Near -> "near"
Blockchain.NearTestnet -> "near/test"
}
}

View file

@ -82,7 +82,7 @@ okHttp-prettyLogging = "3.1.0"
# endregion Other libraries
# region Tangem
tangemBlockchainSdk = "develop-354"
tangemBlockchainSdk = "develop-355"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "develop-302"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds