Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-23 17:15:32 +03:00
parent 035a094201
commit 24d163b5e7
5 changed files with 37 additions and 4 deletions

View file

@ -21,6 +21,8 @@ import java.math.BigDecimal
object BlockchainUtils {
private const val XRP_X_ADDRESS = 'X'
private const val TERRA_CLASSIC_USD_COIN_ID = "terrausd"
private const val TERRA_LUNA_CLASSIC_COIN_ID = "terra-luna"
const val SOLANA_TRANSACTION_SIZE_THRESHOLD_BYTES = 930
/** Decodes XRP Blockchain address */
@ -191,4 +193,19 @@ object BlockchainUtils {
private fun getNetworkNameWithoutTestnet(blockchain: Blockchain): String {
return blockchain.fullName.replace(oldValue = " Testnet", newValue = "")
}
/**
* Checks if token is not blocked by TerraV1 (Terra Classic) filter.
* For non-TerraV1 networks, tokens are never blocked.
* For TerraV1 network, all tokens are blocked except native coin (LUNC) and TerraClassicUSD (USTC).
*
* @param networkId network ID (e.g. "terra")
* @param coinId token/coin ID (e.g. "terrausd")
* @return true if token is not blocked, false otherwise
*/
fun isNotBlockedByTerraV1Filter(networkId: String, coinId: String): Boolean {
return Blockchain.fromNetworkId(networkId) != Blockchain.TerraV1 ||
coinId == TERRA_CLASSIC_USD_COIN_ID ||
coinId == TERRA_LUNA_CLASSIC_COIN_ID
}
}