Updated on 2026-08-14
This commit is contained in:
parent
b27e8171fb
commit
4ea8243da3
19 changed files with 375 additions and 126 deletions
|
|
@ -36,6 +36,7 @@ internal class CryptoPortfolioConverter @AssistedInject constructor(
|
|||
responseCryptoCurrenciesFactory.createCurrencies(
|
||||
tokens = tokens,
|
||||
userWallet = userWallet,
|
||||
accountIndex = value.derivationIndex.toDerivationIndex(),
|
||||
).toSet()
|
||||
} else {
|
||||
emptySet()
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import arrow.core.Option
|
|||
import arrow.core.some
|
||||
import com.tangem.data.account.store.AccountsResponseStoreFactory
|
||||
import com.tangem.data.common.currency.ResponseCryptoCurrenciesFactory
|
||||
import com.tangem.datasource.api.tangemTech.models.account.toUserTokensResponse
|
||||
import com.tangem.datasource.local.userwallet.UserWalletsStore
|
||||
import com.tangem.domain.models.account.DerivationIndex
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.wallet.isMultiCurrency
|
||||
import com.tangem.domain.tokens.MultiWalletCryptoCurrenciesProducer
|
||||
|
|
@ -48,10 +48,13 @@ internal class AccountListCryptoCurrenciesProducer @AssistedInject constructor(
|
|||
.map { response ->
|
||||
if (response == null) return@map emptySet()
|
||||
|
||||
responseCryptoCurrenciesFactory.createCurrencies(
|
||||
response = response.toUserTokensResponse(),
|
||||
userWallet = userWallet,
|
||||
).toSet()
|
||||
response.accounts.flatMapTo(hashSetOf()) { accountDTO ->
|
||||
responseCryptoCurrenciesFactory.createCurrencies(
|
||||
tokens = accountDTO.tokens.orEmpty(),
|
||||
userWallet = userWallet,
|
||||
accountIndex = DerivationIndex(accountDTO.derivationIndex).getOrNull(),
|
||||
)
|
||||
}
|
||||
}
|
||||
.onEmpty { emit(emptySet()) }
|
||||
.distinctUntilChanged()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue