Updated on 2026-08-14

This commit is contained in:
Tangem 2023-12-08 16:54:08 +02:00
parent 5d7aef4c6b
commit bec0253e6f
3 changed files with 6 additions and 32 deletions

View file

@ -11,6 +11,10 @@ class DefaultMarketCryptoCurrencyRepository(
) : MarketCryptoCurrencyRepository {
override suspend fun isExchangeable(userWalletId: UserWalletId, cryptoCurrency: CryptoCurrency): Boolean {
return getExchangeableFlag(userWalletId, cryptoCurrency) && !cryptoCurrency.isCustom
}
private suspend fun getExchangeableFlag(userWalletId: UserWalletId, cryptoCurrency: CryptoCurrency): Boolean {
val contractAddress = (cryptoCurrency as? CryptoCurrency.Token)?.contractAddress ?: EMPTY_CONTRACT_ADDRESS_VALUE
return assetsStore.getSyncOrNull(userWalletId)?.find {