Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-01 20:59:34 +04:00
parent 0fb88d97c9
commit ec818bfd0a
2 changed files with 14 additions and 0 deletions

View file

@ -15,6 +15,7 @@ import com.tangem.core.analytics.models.AnalyticsParam.Key.SEND_TOKEN
import com.tangem.core.analytics.models.AppsFlyerIncludedEvent
import com.tangem.core.analytics.models.getReferralParams
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.swap.models.PredefinedPercentAmount
import com.tangem.feature.swap.domain.models.domain.SwapProvider
import com.tangem.feature.swap.domain.models.domain.SwapUIMode
import com.tangem.feature.swap.domain.models.ui.FeeBucket
@ -291,4 +292,16 @@ sealed class SwapEvents(
"Provider" to provider.name,
),
)
class FastAmountInput(percent: PredefinedPercentAmount) : SwapEvents(
event = "Fast amount input",
params = mapOf("Percentage" to percent.toAnalyticsValue()),
)
}
private fun PredefinedPercentAmount.toAnalyticsValue(): String = when (this) {
PredefinedPercentAmount.PERCENT_25 -> "25"
PredefinedPercentAmount.PERCENT_50 -> "50"
PredefinedPercentAmount.PERCENT_75 -> "75"
PredefinedPercentAmount.MAX -> "Max"
}

View file

@ -1522,6 +1522,7 @@ internal class SwapModel @Inject constructor(
}
private fun onPredefinedPercentSelected(percent: PredefinedPercentAmount) {
analyticsEventHandler.send(SwapEvents.FastAmountInput(percent))
if (percent == PredefinedPercentAmount.MAX) {
onMaxAmountClicked()
return