Updated on 2026-08-14

This commit is contained in:
Tangem 2025-04-25 14:28:29 +05:00
parent 0bd68de818
commit 546a9decb0
7 changed files with 42 additions and 20 deletions

View file

@ -1,5 +1,6 @@
package com.tangem.domain.nft
import arrow.core.Either
import com.tangem.domain.nft.repository.NFTRepository
import com.tangem.domain.tokens.repository.CurrenciesRepository
import com.tangem.domain.wallets.models.UserWalletId
@ -9,7 +10,7 @@ class RefreshAllNFTUseCase(
private val nftRepository: NFTRepository,
) {
suspend operator fun invoke(userWalletId: UserWalletId) {
suspend operator fun invoke(userWalletId: UserWalletId): Either<Throwable, Unit> = Either.catch {
val currencies = currenciesRepository.getMultiCurrencyWalletCurrenciesSync(userWalletId)
nftRepository.refreshAll(userWalletId, currencies.map { it.network }.distinct())
}