Updated on 2026-08-14

This commit is contained in:
Tangem 2024-07-29 17:45:03 +03:00
parent 1451f23cb2
commit ff2907e26e
3 changed files with 14 additions and 3 deletions

View file

@ -100,7 +100,7 @@ internal class DefaultNetworksRepository(
override fun isNeedToCreateAccountWithoutReserve(network: Network): Boolean {
val blockchain = Blockchain.fromNetworkId(network.id.value)
return blockchain == Blockchain.Aptos
return REQUIRED_ACCOUNT_WITHOUT_RESERVE_BLOCKCHAINS.contains(blockchain)
}
override suspend fun getNetworkAddresses(
@ -345,4 +345,9 @@ internal class DefaultNetworksRepository(
private fun getNetworksStatusesCacheKey(userWalletId: UserWalletId, network: Network): String {
return "network_status_${userWalletId}_${network.id.value}_${network.derivationPath.value}"
}
private companion object {
val REQUIRED_ACCOUNT_WITHOUT_RESERVE_BLOCKCHAINS = listOf(Blockchain.Aptos, Blockchain.Filecoin)
}
}

View file

@ -88,7 +88,7 @@ markdown = "0.7.2"
# endregion Other libraries
# region Tangem
tangemBlockchainSdk = "develop-703"
tangemBlockchainSdk = "develop-710"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "develop-375"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^

View file

@ -118,6 +118,7 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
"koinos/test" -> Blockchain.KoinosTestnet
"joystream" -> Blockchain.Joystream
"bittensor" -> Blockchain.Bittensor
"filecoin" -> Blockchain.Filecoin
else -> null
}
}
@ -237,6 +238,7 @@ fun Blockchain.toNetworkId(): String {
Blockchain.KoinosTestnet -> "koinos/test"
Blockchain.Joystream -> "joystream"
Blockchain.Bittensor -> "bittensor"
Blockchain.Filecoin -> "filecoin"
}
}
@ -313,6 +315,7 @@ fun Blockchain.toCoinId(): String {
Blockchain.Koinos, Blockchain.KoinosTestnet -> "koinos"
Blockchain.Joystream -> "joystream"
Blockchain.Bittensor -> "bittensor"
Blockchain.Filecoin -> "filecoin"
}
}
@ -325,7 +328,9 @@ fun Blockchain.amountToCreateAccount(token: Token? = null): BigDecimal? {
Blockchain.Stellar -> if (token?.symbol == NODL) BigDecimal(NODL_AMOUNT_TO_CREATE_ACCOUNT) else BigDecimal.ONE
Blockchain.XRP -> BigDecimal.TEN
Blockchain.Near, Blockchain.NearTestnet -> 0.00182.toBigDecimal()
Blockchain.Aptos, Blockchain.AptosTestnet -> BigDecimal.ZERO
Blockchain.Aptos, Blockchain.AptosTestnet,
Blockchain.Filecoin,
-> BigDecimal.ZERO
else -> null
}
}
@ -343,4 +348,5 @@ private val excludedBlockchains = listOf(
Blockchain.NexaTestnet,
Blockchain.Mantle,
Blockchain.MantleTestnet,
Blockchain.Filecoin,
)