Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-18 10:02:42 +04:00
parent f10002c0e5
commit c3c4eaf1f6
2 changed files with 32 additions and 8 deletions

View file

@ -204,6 +204,17 @@ sealed class YieldSupplyAnalytics(
),
)
data class NoticeHighFee(
val token: String,
val blockchain: String,
) : YieldSupplyAnalytics(
event = "Notice - High Network Fee",
params = mapOf(
TOKEN_PARAM to token,
BLOCKCHAIN to blockchain,
),
)
enum class Action(val value: String) {
Start("Start"),
Approve("Approve"),

View file

@ -80,14 +80,7 @@ internal class YieldSupplyNotificationsModel @Inject constructor(
}
}
if (notifications.any { it is NotificationUM.Error.TokenExceedsBalance }) {
analyticsEventHandler.send(
YieldSupplyAnalytics.NoticeNotEnoughFee(
token = cryptoCurrencyStatus.currency.symbol,
blockchain = cryptoCurrencyStatus.currency.network.name,
),
)
}
sendAnalytics(notifications, cryptoCurrencyStatus.currency)
uiState.update { notifications.toPersistentList() }
@ -97,6 +90,26 @@ internal class YieldSupplyNotificationsModel @Inject constructor(
}.launchIn(modelScope)
}
private fun sendAnalytics(notifications: List<NotificationUM>, currency: CryptoCurrency) {
if (notifications.any { it is NotificationUM.Error.TokenExceedsBalance }) {
analyticsEventHandler.send(
YieldSupplyAnalytics.NoticeNotEnoughFee(
token = currency.symbol,
blockchain = currency.network.name,
),
)
}
if (notifications.any { it is NotificationUM.Info.YieldSupplyHighNetworkFee }) {
analyticsEventHandler.send(
YieldSupplyAnalytics.NoticeHighFee(
token = currency.symbol,
blockchain = currency.network.name,
),
)
}
}
private fun openTokenDetails(cryptoCurrency: CryptoCurrency) {
appRouter.push(
AppRoute.CurrencyDetails(