Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-15 12:44:45 +02:00
parent 7703758e56
commit 65840babb1
5 changed files with 21 additions and 1 deletions

View file

@ -75,6 +75,8 @@ internal interface StakingClickIntents : AmountScreenClickIntents {
fun onActivateTonAccountNotificationShow()
fun onNotEnoughFeeNotificationShow()
fun onActivateTonAccountClick()
fun onAmountReduceByFeeClick(reduceAmount: BigDecimal, notification: Class<out NotificationUM>)

View file

@ -1120,6 +1120,14 @@ internal class StakingModel @Inject constructor(
)
}
override fun onNotEnoughFeeNotificationShow() {
analyticsEventHandler.send(
StakingAnalyticsEvent.NotEnoughFee(
token = cryptoCurrencyStatus.currency.symbol,
),
)
}
override fun onActivateTonAccountClick() {
analyticsEventHandler.send(
StakingAnalyticsEvent.ButtonActivate(

View file

@ -83,6 +83,8 @@ internal object StakingClickIntentsStub : StakingClickIntents {
override fun onActivateTonAccountNotificationShow() {}
override fun onNotEnoughFeeNotificationShow() {}
override fun onActivateTonAccountClick() {}
override fun onAmountReduceByFeeClick(reduceAmount: BigDecimal, notification: Class<out NotificationUM>) {}

View file

@ -226,6 +226,7 @@ internal class AddStakingNotificationsTransformer(
isSubtractionAvailable = isSubtractAvailable,
cryptoCurrencyStatus = cryptoCurrencyStatus,
onClick = prevState.clickIntents::openTokenDetails,
onNotEnoughFeeNotificationShow = prevState.clickIntents::onNotEnoughFeeNotificationShow,
)
addTonExtraFeeErrorNotification()
addExceedsBalanceNotification(
@ -233,7 +234,7 @@ internal class AddStakingNotificationsTransformer(
cryptoCurrencyStatus = cryptoCurrencyStatus,
shouldMergeFeeNetworkName = BlockchainUtils.isArbitrum(network.backendId),
onClick = prevState.clickIntents::openTokenDetails,
onAnalyticsEvent = { /* no-op */ },
onAnalyticsEvent = { prevState.clickIntents.onNotEnoughFeeNotificationShow() },
)
if (!BlockchainUtils.isCardano(network.rawId)) {
addDustWarningNotification(
@ -298,12 +299,14 @@ internal class AddStakingNotificationsTransformer(
isSubtractionAvailable: Boolean,
cryptoCurrencyStatus: CryptoCurrencyStatus,
onClick: (CryptoCurrency) -> Unit,
onNotEnoughFeeNotificationShow: () -> Unit,
) {
val balance = cryptoCurrencyStatus.value.amount.orZero()
if (!isSubtractionAvailable) return
val showNotification = sendingAmount + feeAmount > balance
if (showNotification) {
onNotEnoughFeeNotificationShow()
val notification = if (actionType is StakingActionCommonType.Enter) {
NotificationUM.Error.TotalExceedsBalance
} else {