Updated on 2026-08-14

This commit is contained in:
Tangem 2024-08-09 15:10:19 +03:00
parent d570dd215f
commit e045a08252
10 changed files with 21 additions and 20 deletions

View file

@ -3,15 +3,16 @@ package com.tangem.tap.common.extensions
import com.tangem.blockchain.common.Blockchain
import com.tangem.common.extensions.remove
fun Blockchain.getNetworkName(): String {
fun Blockchain.getNetworkStandardName(): String {
return when (this) {
Blockchain.Ethereum, Blockchain.EthereumTestnet -> "ERC20"
Blockchain.BSC, Blockchain.BSCTestnet -> "BEP20"
Blockchain.Binance, Blockchain.BinanceTestnet -> "BEP2"
Blockchain.Tron, Blockchain.TronTestnet -> "TRC20"
Blockchain.TON -> "TON"
else -> ""
}
}
val Blockchain.fullNameWithoutTestnet
get() = this.fullName.remove(" Testnet")
val Blockchain.networkNameWithoutTestnet
get() = this.getNetworkName().remove(" Testnet")