Updated on 2026-08-14

This commit is contained in:
Tangem 2025-03-31 11:09:21 +04:00
parent ded9de148c
commit 377f2cd6fd
8 changed files with 406 additions and 1 deletions

View file

@ -31,6 +31,14 @@ class ResponseCryptoCurrenciesFactory(
.toList()
}
fun createCurrencies(tokens: List<UserTokensResponse.Token>, scanResponse: ScanResponse): List<CryptoCurrency> {
return tokens
.asSequence()
.mapNotNull { createCurrency(it, scanResponse) }
.distinctBy(CryptoCurrency::id)
.toList()
}
fun createCurrency(responseToken: UserTokensResponse.Token, scanResponse: ScanResponse): CryptoCurrency? {
var blockchain = Blockchain.fromNetworkId(responseToken.networkId)
if (blockchain == null || blockchain == Blockchain.Unknown) {