From ec818bfd0aa7aac3ec37805417c18e28ad44aae4 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 1 Jun 2026 20:59:34 +0400 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/feature/swap/analytics/SwapEvents.kt | 13 +++++++++++++ .../java/com/tangem/feature/swap/model/SwapModel.kt | 1 + 2 files changed, 14 insertions(+) diff --git a/features/swap/impl/src/main/java/com/tangem/feature/swap/analytics/SwapEvents.kt b/features/swap/impl/src/main/java/com/tangem/feature/swap/analytics/SwapEvents.kt index c17789bc7a..ceac6df113 100644 --- a/features/swap/impl/src/main/java/com/tangem/feature/swap/analytics/SwapEvents.kt +++ b/features/swap/impl/src/main/java/com/tangem/feature/swap/analytics/SwapEvents.kt @@ -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" } \ No newline at end of file diff --git a/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapModel.kt b/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapModel.kt index bbd9023571..9772880a1c 100644 --- a/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapModel.kt +++ b/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapModel.kt @@ -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