Updated on 2026-08-14
This commit is contained in:
parent
efd7fb467d
commit
591dce57c4
1 changed files with 6 additions and 5 deletions
|
|
@ -59,12 +59,13 @@ internal class SwapRepositoryImpl @Inject constructor(
|
|||
return withContext(coroutineDispatcher.io) {
|
||||
val rates = tangemTechApi.getRates(currencyId.lowercase(), addedTokens.joinToString(",")).rates
|
||||
val ethRate = rates[ETHEREUM_ID]
|
||||
rates.mapValues {
|
||||
if (it.key == OPTIMISM_ID || it.key == ARBITRUM_ID) {
|
||||
ethRate ?: 0.0
|
||||
} else {
|
||||
it.value
|
||||
if (tokenIds.contains(OPTIMISM_ID) || tokenIds.contains(ARBITRUM_ID)) {
|
||||
rates.toMutableMap().apply {
|
||||
put(OPTIMISM_ID, ethRate ?: 0.0)
|
||||
put(ARBITRUM_ID, ethRate ?: 0.0)
|
||||
}
|
||||
} else {
|
||||
rates
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue