Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-25 15:09:26 +03:00
parent 041ff02106
commit 307b311afd
8 changed files with 77 additions and 17 deletions

View file

@ -57,7 +57,7 @@ internal class DefaultNetworksRepository(
.map { currency ->
CryptoCurrencyAddress(
cryptoCurrency = currency,
address = getDefaultAddress(userWalletId, network),
address = getDefaultAddress(userWalletId, network).orEmpty(),
)
}
}
@ -74,11 +74,17 @@ internal class DefaultNetworksRepository(
.map { currency ->
CryptoCurrencyAddress(
cryptoCurrency = currency,
address = getDefaultAddress(userWalletId, currency.network),
address = getDefaultAddress(userWalletId, currency.network).orEmpty(),
)
}
}
override suspend fun getDefaultAddress(userWalletId: UserWalletId, network: Network): String? {
return withContext(dispatchers.io) {
walletManagersFacade.getDefaultAddress(userWalletId = userWalletId, network = network)
}
}
override suspend fun hasCachedStatuses(userWalletId: UserWalletId): Boolean {
return networksStatusesStore.contains(userWalletId)
}
@ -100,10 +106,4 @@ internal class DefaultNetworksRepository(
networksStatusesStore.storeStatus(userWalletId = userWalletId, status = networkStatus)
}
private suspend fun getDefaultAddress(userWalletId: UserWalletId, network: Network): String {
return withContext(dispatchers.io) {
walletManagersFacade.getDefaultAddress(userWalletId = userWalletId, network = network).orEmpty()
}
}
}