Updated on 2026-08-14
This commit is contained in:
parent
093ee9dd0e
commit
5620f6afe7
2 changed files with 2 additions and 7 deletions
|
|
@ -9,7 +9,7 @@ internal fun calculateRateDif(currentTokenRate: BigDecimal, bestRate: BigDecimal
|
|||
if (currentTokenRate > bestRate) return null
|
||||
|
||||
val rateDif = BigDecimal.ONE - currentTokenRate / bestRate
|
||||
return if (rateDif >= BigDecimal("0.01")) rateDif else null
|
||||
return if (rateDif >= BigDecimal("0.0001")) rateDif else null
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
package com.tangem.features.onramp.mainv2.entity.factory
|
||||
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.format.bigdecimal.crypto
|
||||
import com.tangem.core.ui.format.bigdecimal.format
|
||||
import com.tangem.core.ui.format.bigdecimal.percent
|
||||
import com.tangem.domain.onramp.model.*
|
||||
import com.tangem.features.onramp.impl.R
|
||||
import com.tangem.features.onramp.mainv2.entity.*
|
||||
import com.tangem.utils.Provider
|
||||
import com.tangem.utils.StringsSigns.MINUS
|
||||
import kotlinx.collections.immutable.toPersistentList
|
||||
|
||||
internal class OnrampOffersStateFactory(
|
||||
|
|
@ -52,9 +49,7 @@ internal class OnrampOffersStateFactory(
|
|||
decimals = currentQuote.toAmount.decimals,
|
||||
)
|
||||
},
|
||||
diff = offer.rateDif?.let { diff ->
|
||||
stringReference("$MINUS${diff.format { percent() }}")
|
||||
},
|
||||
diff = null, // on main screen diff should not be shown
|
||||
onBuyClicked = {
|
||||
onrampIntents.onBuyClick(
|
||||
quote = OnrampProviderWithQuote.Data(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue