Updated on 2026-08-14
This commit is contained in:
parent
39ee5c12e1
commit
5dff0e709c
2 changed files with 13 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.domain.common.extensions
|
||||
|
||||
import com.tangem.blockchain.blockchains.bitcoincash.cashaddr.CashAddr
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
|
||||
fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
|
||||
|
|
@ -104,4 +105,12 @@ fun Blockchain.toCoinId(): String {
|
|||
Blockchain.Tron, Blockchain.TronTestnet -> "tron"
|
||||
else -> "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
fun Blockchain.removePrefixFromAddress(address: String): String {
|
||||
return when (this) {
|
||||
Blockchain.BitcoinCash -> address
|
||||
.removePrefix(CashAddr.MAIN_NET_PREFIX).removePrefix(":")
|
||||
else -> address
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue