Updated on 2026-08-14
This commit is contained in:
parent
605f17c873
commit
517a9609ec
5 changed files with 44 additions and 0 deletions
|
|
@ -454,6 +454,21 @@ internal class DefaultCurrenciesRepository(
|
|||
) ?: error("Unable to create token")
|
||||
}
|
||||
|
||||
override suspend fun hasTokens(userWalletId: UserWalletId, network: Network): Boolean {
|
||||
val userWallet = getUserWallet(userWalletId)
|
||||
fetchTokensIfCacheExpired(userWallet, refresh = false)
|
||||
|
||||
val storedTokens = requireNotNull(userTokensStore.getSyncOrNull(userWallet.walletId)) {
|
||||
"Unable to find tokens response for user wallet with provided ID: $userWalletId"
|
||||
}
|
||||
|
||||
return storedTokens.tokens.any {
|
||||
it.contractAddress != null &&
|
||||
it.networkId == network.backendId &&
|
||||
it.derivationPath == network.derivationPath.value
|
||||
}
|
||||
}
|
||||
|
||||
private fun getMultiCurrencyWalletCurrencies(userWallet: UserWallet): Flow<List<CryptoCurrency>> {
|
||||
return userTokensStore.get(userWallet.walletId).map { storedTokens ->
|
||||
responseCurrenciesFactory.createCurrencies(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue