Updated on 2026-08-14

This commit is contained in:
Tangem 2023-09-27 14:44:19 +03:00
parent f3f29813e0
commit b74e2b9168
25 changed files with 405 additions and 72 deletions

View file

@ -2,6 +2,7 @@ package com.tangem.tap.domain.tokens
import com.tangem.blockchain.common.derivation.DerivationStyle
import com.tangem.common.core.TangemSdkError
import com.tangem.datasource.api.common.response.getOrThrow
import com.tangem.datasource.api.tangemTech.TangemTechApi
import com.tangem.datasource.api.tangemTech.TangemTechService
import com.tangem.datasource.api.tangemTech.models.UserTokensResponse
@ -106,7 +107,8 @@ class UserTokensRepository(
return runCatching { tangemTechApi.getUserTokens(userWalletId) }
.fold(
onSuccess = { response ->
response.tokens
response.getOrThrow()
.tokens
.mapNotNull(Currency.Companion::fromTokenResponse)
.also { storageService.saveUserTokens(userWalletId, it.toUserTokensResponse()) }
.distinct()