Updated on 2026-08-14

This commit is contained in:
Tangem 2023-11-21 10:53:09 +03:00
parent 7fdf9167ea
commit 5a277755c4
4 changed files with 12 additions and 2 deletions

View file

@ -30,6 +30,14 @@ internal class DefaultQuotesStore(
}
}
override suspend fun getSync(currenciesIds: Set<CryptoCurrency.ID>): Set<StoredQuote> {
return currenciesIds.mapNotNull { currencyId ->
currencyId.rawCurrencyId?.let {
dataStore.getSyncOrNull(it)
}
}.toSet()
}
override suspend fun store(response: QuotesResponse) {
val quotes = response.quotes.mapValues { (id, quote) ->
StoredQuote(id, quote)

View file

@ -9,5 +9,7 @@ interface QuotesStore {
fun get(currenciesIds: Set<CryptoCurrency.ID>): Flow<Set<StoredQuote>>
suspend fun getSync(currenciesIds: Set<CryptoCurrency.ID>): Set<StoredQuote>
suspend fun store(response: QuotesResponse)
}