Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-14 21:28:31 +04:00
parent 8e433e111e
commit 17c591db4e
19 changed files with 180 additions and 81 deletions

View file

@ -124,6 +124,7 @@ internal class DefaultMultiWalletCryptoCurrenciesFetcher(
currencies = cardCryptoCurrencyFactory.createDefaultCoinsForMultiCurrencyWallet(userWallet),
isGroupedByNetwork = false,
isSortedByBalance = false,
accountId = null,
)
}
}

View file

@ -74,26 +74,6 @@ internal class DefaultCurrenciesRepository(
userTokensSaver.storeAndPush(userWalletId, response)
}
override suspend fun saveCurrenciesLocal(userWalletId: UserWalletId, currencies: List<CryptoCurrency>) {
withContext(dispatchers.io) {
val savedResponse = requireNotNull(
value = getSavedUserTokensResponseSync(key = userWalletId),
lazyMessage = { "Saved tokens empty. Can not perform add currencies action." },
)
val updatedResponse = savedResponse.copy(
tokens = currencies.map(userTokensResponseFactory::createResponseToken),
)
userTokensSaver.store(userWalletId = userWalletId, response = updatedResponse)
fetchExpressAssetsByNetworkIds(
userWallet = userWalletsStore.getSyncStrict(key = userWalletId),
userTokens = updatedResponse,
)
}
}
override suspend fun addCurrenciesCache(
userWalletId: UserWalletId,
currencies: List<CryptoCurrency>,
@ -667,6 +647,7 @@ internal class DefaultCurrenciesRepository(
return demoConfig.isDemoCardId(userWallet.cardId) && response == null
}
// TODO [REDACTED_JIRA]
private suspend fun fetchExpressAssetsByNetworkIds(userWallet: UserWallet, userTokens: UserTokensResponse) {
val tokens = userTokens.tokens.map { token ->
LeastTokenInfo(
@ -731,6 +712,7 @@ internal class DefaultCurrenciesRepository(
),
isGroupedByNetwork = false,
isSortedByBalance = false,
accountId = null,
)
private fun ensureIsCorrectUserWallet(userWalletId: UserWalletId, isMultiCurrencyWalletExpected: Boolean) {