From b9ce4eeefcf7bf26779029ac58c95d3af5221853 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 5 May 2025 13:58:53 +0200 Subject: [PATCH] Updated on 2026-08-14 --- app/build.gradle.kts | 1 + .../di/domain/NotificationsDomainModule.kt | 39 +++++++++++++++---- .../ui/notifications/NotificationsFactory.kt | 1 + .../local/preferences/PreferencesKeys.kt | 4 ++ .../DefaultNotificationsRepository.kt | 17 ++++++++ domain/notifications/build.gradle.kts | 2 + .../GetTronFeeNotificationShowCountUseCase.kt | 12 ++++++ .../IncrementNotificationsShowCountUseCase.kt | 19 +++++++++ .../repository/NotificationsRepository.kt | 4 ++ features/send-v2/impl/build.gradle.kts | 2 + .../notifications/model/NotificationsModel.kt | 38 ++++++++++++++++++ features/send/impl/build.gradle.kts | 1 + .../send/impl/presentation/model/SendModel.kt | 24 ++++++++++-- .../state/confirm/SendNotificationFactory.kt | 30 ++++++++++++++ 14 files changed, 184 insertions(+), 10 deletions(-) create mode 100644 domain/notifications/src/main/java/com/tangem/domain/notifications/GetTronFeeNotificationShowCountUseCase.kt create mode 100644 domain/notifications/src/main/java/com/tangem/domain/notifications/IncrementNotificationsShowCountUseCase.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 154659cd53..e666baaa4d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -156,6 +156,7 @@ dependencies { implementation(projects.data.networks) implementation(projects.data.quotes) implementation(projects.data.blockaid) + implementation(projects.data.notifications) /** Features */ implementation(projects.features.referral.impl) diff --git a/app/src/main/java/com/tangem/tap/di/domain/NotificationsDomainModule.kt b/app/src/main/java/com/tangem/tap/di/domain/NotificationsDomainModule.kt index fe5ea6d52f..c6f217e01c 100644 --- a/app/src/main/java/com/tangem/tap/di/domain/NotificationsDomainModule.kt +++ b/app/src/main/java/com/tangem/tap/di/domain/NotificationsDomainModule.kt @@ -1,6 +1,8 @@ package com.tangem.tap.di.domain import com.tangem.domain.notifications.GetApplicationIdUseCase +import com.tangem.domain.notifications.GetTronFeeNotificationShowCountUseCase +import com.tangem.domain.notifications.IncrementNotificationsShowCountUseCase import com.tangem.domain.notifications.SendPushTokenUseCase import com.tangem.domain.notifications.repository.NotificationsRepository import com.tangem.utils.notifications.PushNotificationsTokenProvider @@ -16,10 +18,11 @@ internal object NotificationsDomainModule { @Provides @Singleton - fun providesGetApplicationIdUseCase(notificationsRepository: NotificationsRepository): GetApplicationIdUseCase = - GetApplicationIdUseCase( + fun providesGetApplicationIdUseCase(notificationsRepository: NotificationsRepository): GetApplicationIdUseCase { + return GetApplicationIdUseCase( notificationsRepository = notificationsRepository, ) + } @Provides @Singleton @@ -27,9 +30,31 @@ internal object NotificationsDomainModule { notificationsRepository: NotificationsRepository, getApplicationIdUseCase: GetApplicationIdUseCase, pushNotificationsTokenProvider: PushNotificationsTokenProvider, - ): SendPushTokenUseCase = SendPushTokenUseCase( - notificationsRepository = notificationsRepository, - getApplicationIdUseCase = getApplicationIdUseCase, - pushNotificationsTokenProvider = pushNotificationsTokenProvider, - ) + ): SendPushTokenUseCase { + return SendPushTokenUseCase( + notificationsRepository = notificationsRepository, + getApplicationIdUseCase = getApplicationIdUseCase, + pushNotificationsTokenProvider = pushNotificationsTokenProvider, + ) + } + + @Provides + @Singleton + fun providesGetTronFeeNotificationShowCountUseCase( + notificationsRepository: NotificationsRepository, + ): GetTronFeeNotificationShowCountUseCase { + return GetTronFeeNotificationShowCountUseCase( + notificationsRepository = notificationsRepository, + ) + } + + @Provides + @Singleton + fun providesIncrementTronFeeNotificationShowCountUseCase( + notificationsRepository: NotificationsRepository, + ): IncrementNotificationsShowCountUseCase { + return IncrementNotificationsShowCountUseCase( + notificationsRepository = notificationsRepository, + ) + } } \ No newline at end of file diff --git a/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt b/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt index 008a2665bd..7d0784c67d 100644 --- a/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt +++ b/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt @@ -4,6 +4,7 @@ import com.tangem.blockchain.common.BlockchainSdkError import com.tangem.common.ui.R import com.tangem.common.ui.amountScreen.models.AmountFieldModel import com.tangem.common.ui.amountScreen.utils.getFiatString +import com.tangem.common.ui.notifications.NotificationUM.Warning import com.tangem.core.ui.extensions.networkIconResId import com.tangem.core.ui.format.bigdecimal.crypto import com.tangem.core.ui.format.bigdecimal.format diff --git a/core/datasource/src/main/java/com/tangem/datasource/local/preferences/PreferencesKeys.kt b/core/datasource/src/main/java/com/tangem/datasource/local/preferences/PreferencesKeys.kt index becb93bd80..90b07d055f 100644 --- a/core/datasource/src/main/java/com/tangem/datasource/local/preferences/PreferencesKeys.kt +++ b/core/datasource/src/main/java/com/tangem/datasource/local/preferences/PreferencesKeys.kt @@ -127,6 +127,10 @@ object PreferencesKeys { val NOTIFICATIONS_APPLICATION_ID_KEY by lazy { stringPreferencesKey(name = "notificationsApplicationId") } val NOTIFICATIONS_ENABLED_STATES_KEY by lazy { stringPreferencesKey(name = "notificationsEnabledStates") } + + val TRON_NETWORK_FEE_NOTIFICATION_SHOW_COUNT_KEY by lazy { + intPreferencesKey(name = "tronNetworkFeeNotificationShowCount") + } // endregion // region Promo diff --git a/data/notifications/src/main/java/com/tangem/data/notifications/DefaultNotificationsRepository.kt b/data/notifications/src/main/java/com/tangem/data/notifications/DefaultNotificationsRepository.kt index 57d8a6344a..1470589ef2 100644 --- a/data/notifications/src/main/java/com/tangem/data/notifications/DefaultNotificationsRepository.kt +++ b/data/notifications/src/main/java/com/tangem/data/notifications/DefaultNotificationsRepository.kt @@ -44,6 +44,23 @@ internal class DefaultNotificationsRepository @Inject constructor( return appPreferencesStore.getSyncOrNull(PreferencesKeys.NOTIFICATIONS_APPLICATION_ID_KEY) } + override suspend fun incrementTronTokenFeeNotificationShowCounter() { + appPreferencesStore.editData { preferences -> + val count = preferences.getOrDefault( + key = PreferencesKeys.TRON_NETWORK_FEE_NOTIFICATION_SHOW_COUNT_KEY, + default = 0, + ) + preferences[PreferencesKeys.TRON_NETWORK_FEE_NOTIFICATION_SHOW_COUNT_KEY] = count + 1 + } + } + + override suspend fun getTronTokenFeeNotificationShowCounter(): Int { + return appPreferencesStore.getSyncOrDefault( + key = PreferencesKeys.TRON_NETWORK_FEE_NOTIFICATION_SHOW_COUNT_KEY, + default = 0, + ) + } + override suspend fun associateApplicationIdWithWallets(appId: String, wallets: List) = withContext(dispatchers.io) { tangemTechApi.associateApplicationIdWithWallets( diff --git a/domain/notifications/build.gradle.kts b/domain/notifications/build.gradle.kts index 3c44620a5f..a81496ca84 100644 --- a/domain/notifications/build.gradle.kts +++ b/domain/notifications/build.gradle.kts @@ -14,8 +14,10 @@ dependencies { implementation(projects.core.utils) implementation(projects.domain.core) implementation(projects.domain.wallets.models) + implementation(projects.domain.tokens.models) implementation(projects.domain.notifications.models) implementation(projects.domain.wallets) + implementation(projects.libs.crypto) // region DI implementation(deps.hilt.android) diff --git a/domain/notifications/src/main/java/com/tangem/domain/notifications/GetTronFeeNotificationShowCountUseCase.kt b/domain/notifications/src/main/java/com/tangem/domain/notifications/GetTronFeeNotificationShowCountUseCase.kt new file mode 100644 index 0000000000..3451cdcd27 --- /dev/null +++ b/domain/notifications/src/main/java/com/tangem/domain/notifications/GetTronFeeNotificationShowCountUseCase.kt @@ -0,0 +1,12 @@ +package com.tangem.domain.notifications + +import com.tangem.domain.notifications.repository.NotificationsRepository + +class GetTronFeeNotificationShowCountUseCase( + private val notificationsRepository: NotificationsRepository, +) { + + suspend operator fun invoke(): Int { + return notificationsRepository.getTronTokenFeeNotificationShowCounter() + } +} \ No newline at end of file diff --git a/domain/notifications/src/main/java/com/tangem/domain/notifications/IncrementNotificationsShowCountUseCase.kt b/domain/notifications/src/main/java/com/tangem/domain/notifications/IncrementNotificationsShowCountUseCase.kt new file mode 100644 index 0000000000..210cdb7e2e --- /dev/null +++ b/domain/notifications/src/main/java/com/tangem/domain/notifications/IncrementNotificationsShowCountUseCase.kt @@ -0,0 +1,19 @@ +package com.tangem.domain.notifications + +import com.tangem.domain.notifications.repository.NotificationsRepository +import com.tangem.domain.tokens.model.CryptoCurrency +import com.tangem.lib.crypto.BlockchainUtils.isTron + +class IncrementNotificationsShowCountUseCase( + private val notificationsRepository: NotificationsRepository, +) { + + suspend operator fun invoke(cryptoCurrency: CryptoCurrency) { + val isTronToken = cryptoCurrency is CryptoCurrency.Token && + isTron(cryptoCurrency.network.id.value) + + if (isTronToken) { + notificationsRepository.incrementTronTokenFeeNotificationShowCounter() + } + } +} \ No newline at end of file diff --git a/domain/notifications/src/main/java/com/tangem/domain/notifications/repository/NotificationsRepository.kt b/domain/notifications/src/main/java/com/tangem/domain/notifications/repository/NotificationsRepository.kt index 18575a904c..b7f53ab51e 100644 --- a/domain/notifications/src/main/java/com/tangem/domain/notifications/repository/NotificationsRepository.kt +++ b/domain/notifications/src/main/java/com/tangem/domain/notifications/repository/NotificationsRepository.kt @@ -11,6 +11,10 @@ interface NotificationsRepository { suspend fun getApplicationId(): String? + suspend fun getTronTokenFeeNotificationShowCounter(): Int + + suspend fun incrementTronTokenFeeNotificationShowCounter() + @Throws suspend fun associateApplicationIdWithWallets(appId: String, wallets: List) diff --git a/features/send-v2/impl/build.gradle.kts b/features/send-v2/impl/build.gradle.kts index dcd5503302..60f8032742 100644 --- a/features/send-v2/impl/build.gradle.kts +++ b/features/send-v2/impl/build.gradle.kts @@ -57,6 +57,8 @@ dependencies { implementation(projects.domain.balanceHiding.models) implementation(projects.domain.balanceHiding) implementation(projects.domain.nft.models) + implementation(projects.domain.notifications) + /** Compose libraries */ implementation(deps.compose.foundation) diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt index 127a253df0..cdd377390b 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt @@ -5,6 +5,7 @@ import arrow.core.getOrElse import com.tangem.blockchain.common.transaction.Fee import com.tangem.common.routing.AppRoute import com.tangem.common.routing.AppRouter +import com.tangem.common.ui.R import com.tangem.common.ui.amountScreen.converters.AmountReduceByTransformer.ReduceByData import com.tangem.common.ui.notifications.NotificationUM import com.tangem.common.ui.notifications.NotificationsFactory.addDustWarningNotification @@ -23,6 +24,9 @@ import com.tangem.core.analytics.api.AnalyticsEventHandler import com.tangem.core.decompose.di.ModelScoped import com.tangem.core.decompose.model.Model import com.tangem.core.decompose.model.ParamsContainer +import com.tangem.core.ui.extensions.resourceReference +import com.tangem.domain.notifications.GetTronFeeNotificationShowCountUseCase +import com.tangem.domain.notifications.IncrementNotificationsShowCountUseCase import com.tangem.domain.tokens.GetBalanceNotEnoughForFeeWarningUseCase import com.tangem.domain.tokens.GetCurrencyCheckUseCase import com.tangem.domain.tokens.IsAmountSubtractAvailableUseCase @@ -40,6 +44,7 @@ import com.tangem.features.send.v2.subcomponents.notifications.NotificationsComp import com.tangem.features.send.v2.subcomponents.notifications.NotificationsUpdateTrigger import com.tangem.features.send.v2.subcomponents.notifications.analytics.NotificationsAnalyticEvents import com.tangem.lib.crypto.BlockchainUtils +import com.tangem.lib.crypto.BlockchainUtils.isTron import com.tangem.utils.coroutines.CoroutineDispatcherProvider import com.tangem.utils.extensions.orZero import kotlinx.collections.immutable.ImmutableList @@ -64,6 +69,8 @@ internal class NotificationsModel @Inject constructor( private val getCurrencyCheckUseCase: GetCurrencyCheckUseCase, private val getBalanceNotEnoughForFeeWarningUseCase: GetBalanceNotEnoughForFeeWarningUseCase, private val validateTransactionUseCase: ValidateTransactionUseCase, + private val getTronFeeNotificationShowCountUseCase: GetTronFeeNotificationShowCountUseCase, + private val incrementNotificationsShowCountUseCase: IncrementNotificationsShowCountUseCase, private val sendFeeReloadTrigger: SendFeeReloadTrigger, private val sendAmountReduceTrigger: SendAmountReduceTrigger, private val notificationsUpdateTrigger: NotificationsUpdateTrigger, @@ -89,6 +96,7 @@ internal class NotificationsModel @Inject constructor( init { subscribeToNotificationUpdateTrigger() checkIfSubtractAvailable() + incrementNotificationsShowCount() } private fun subscribeToNotificationUpdateTrigger() { @@ -104,6 +112,12 @@ internal class NotificationsModel @Inject constructor( } } + private fun incrementNotificationsShowCount() { + modelScope.launch { + incrementNotificationsShowCountUseCase(cryptoCurrencyStatus.currency) + } + } + private suspend fun updateState(data: NotificationData) { notificationData = data buildNotifications() @@ -193,6 +207,7 @@ internal class NotificationsModel @Inject constructor( isFeeCoverage = isFeeCoverage, currencyCheck = currencyCheck, ) + addInfoNotifications() } private fun getFeeCurrencyBalanceAfterTx(sendingAmount: BigDecimal, feeValue: BigDecimal): BigDecimal? { @@ -352,4 +367,27 @@ internal class NotificationsModel @Inject constructor( }, ) } + + private suspend fun MutableList.addInfoNotifications() { + addTronNetworkFeesNotification() + } + + private suspend fun MutableList.addTronNetworkFeesNotification() { + val cryptoCurrency = cryptoCurrencyStatus.currency + val isTronToken = cryptoCurrency is CryptoCurrency.Token && + isTron(cryptoCurrency.network.id.value) + + if (isTronToken && getTronFeeNotificationShowCountUseCase() <= TRON_FEE_NOTIFICATION_MAX_SHOW_COUNT) { + add( + NotificationUM.Info( + title = resourceReference(R.string.tron_will_be_send_token_fee_title), + subtitle = resourceReference(R.string.tron_will_be_send_token_fee_description), + ), + ) + } + } + + companion object { + const val TRON_FEE_NOTIFICATION_MAX_SHOW_COUNT = 3 + } } \ No newline at end of file diff --git a/features/send/impl/build.gradle.kts b/features/send/impl/build.gradle.kts index 8883699dbb..077fefbe77 100644 --- a/features/send/impl/build.gradle.kts +++ b/features/send/impl/build.gradle.kts @@ -80,6 +80,7 @@ dependencies { implementation(projects.domain.qrScanning) implementation(projects.domain.qrScanning.models) implementation(projects.domain.settings) + implementation(projects.domain.notifications) /** Feature modules */ implementation(projects.features.send.api) diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/model/SendModel.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/model/SendModel.kt index 63bbdb92ed..be16dae8cd 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/model/SendModel.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/model/SendModel.kt @@ -27,6 +27,8 @@ import com.tangem.domain.feedback.SaveBlockchainErrorUseCase import com.tangem.domain.feedback.SendFeedbackEmailUseCase import com.tangem.domain.feedback.models.BlockchainErrorInfo import com.tangem.domain.feedback.models.FeedbackEmailType +import com.tangem.domain.notifications.GetTronFeeNotificationShowCountUseCase +import com.tangem.domain.notifications.IncrementNotificationsShowCountUseCase import com.tangem.domain.qrscanning.models.SourceType import com.tangem.domain.qrscanning.usecases.ListenToQrScanningUseCase import com.tangem.domain.qrscanning.usecases.ParseQrCodeUseCase @@ -115,6 +117,7 @@ internal class SendModel @Inject constructor( private val shareManager: ShareManager, private val txHistoryFeatureToggles: TxHistoryFeatureToggles, private val txHistoryContentUpdateEmitter: TxHistoryContentUpdateEmitter, + private val incrementNotificationsShowCountUseCase: IncrementNotificationsShowCountUseCase, @DelayedWork private val coroutineScope: CoroutineScope, private val innerRouter: InnerSendRouter, appRouter: AppRouter, @@ -123,6 +126,7 @@ internal class SendModel @Inject constructor( getCurrencyCheckUseCase: GetCurrencyCheckUseCase, isFeeApproximateUseCase: IsFeeApproximateUseCase, getBalanceNotEnoughForFeeWarningUseCase: GetBalanceNotEnoughForFeeWarningUseCase, + getTronFeeNotificationShowCountUseCase: GetTronFeeNotificationShowCountUseCase, ) : Model(), SendClickIntents { private val params = paramsContainer.require() @@ -195,6 +199,7 @@ internal class SendModel @Inject constructor( validateTransactionUseCase = validateTransactionUseCase, getCurrencyCheckUseCase = getCurrencyCheckUseCase, getBalanceNotEnoughForFeeWarningUseCase = getBalanceNotEnoughForFeeWarningUseCase, + getTronFeeNotificationShowCountUseCase = getTronFeeNotificationShowCountUseCase, cryptoCurrencyStatusProvider = Provider { cryptoCurrencyStatus }, feeCryptoCurrencyStatusProvider = Provider { feeCryptoCurrencyStatus }, currentStateProvider = Provider { uiState.value }, @@ -528,16 +533,29 @@ internal class SendModel @Inject constructor( uiState.value = stateFactory.syncEditStates(isFromEdit = isFromEdit) sendScreenAnalyticSender.send(currentState.type, uiState.value) - when (currentState.type) { + prepareNextState(currentState.type, isFromEdit) + stateRouter.onNextClick() + } + + private fun prepareNextState(currentStateType: SendUiStateType, isFromEdit: Boolean) { + when (currentStateType) { SendUiStateType.Fee, SendUiStateType.EditFee, -> if (onFeeNextIntercept(isFromEdit)) return - SendUiStateType.Amount, + SendUiStateType.Amount -> { + loadFee() + incrementNotificationsShowCounter() + } SendUiStateType.EditAmount, -> loadFee() else -> Unit } - stateRouter.onNextClick() + } + + private fun incrementNotificationsShowCounter() { + modelScope.launch { + incrementNotificationsShowCountUseCase(cryptoCurrency) + } } override fun onAmountNext() = onNextClick(stateRouter.isEditState) diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt index 6b36be9240..b982ab7199 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/confirm/SendNotificationFactory.kt @@ -2,6 +2,7 @@ package com.tangem.features.send.impl.presentation.state.confirm import com.tangem.blockchain.common.transaction.Fee import com.tangem.blockchain.common.transaction.TransactionFee +import com.tangem.common.ui.R import com.tangem.common.ui.amountScreen.models.AmountState import com.tangem.common.ui.notifications.NotificationUM import com.tangem.common.ui.notifications.NotificationsFactory.addDustWarningNotification @@ -16,10 +17,13 @@ import com.tangem.common.ui.notifications.NotificationsFactory.addReserveAmountE import com.tangem.common.ui.notifications.NotificationsFactory.addTransactionLimitErrorNotification import com.tangem.common.ui.notifications.NotificationsFactory.addValidateTransactionNotifications import com.tangem.core.analytics.api.AnalyticsEventHandler +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.utils.parseToBigDecimal import com.tangem.domain.appcurrency.model.AppCurrency +import com.tangem.domain.notifications.GetTronFeeNotificationShowCountUseCase import com.tangem.domain.tokens.GetBalanceNotEnoughForFeeWarningUseCase import com.tangem.domain.tokens.GetCurrencyCheckUseCase +import com.tangem.domain.tokens.model.CryptoCurrency import com.tangem.domain.tokens.model.CryptoCurrencyStatus import com.tangem.domain.tokens.model.warnings.CryptoCurrencyCheck import com.tangem.domain.transaction.error.GetFeeError @@ -36,6 +40,7 @@ import com.tangem.features.send.impl.presentation.state.fee.* import com.tangem.lib.crypto.BlockchainUtils import com.tangem.lib.crypto.BlockchainUtils.getTezosThreshold import com.tangem.lib.crypto.BlockchainUtils.isTezos +import com.tangem.lib.crypto.BlockchainUtils.isTron import com.tangem.utils.Provider import com.tangem.utils.extensions.orZero import kotlinx.collections.immutable.ImmutableList @@ -52,6 +57,7 @@ internal class SendNotificationFactory( private val validateTransactionUseCase: ValidateTransactionUseCase, private val getCurrencyCheckUseCase: GetCurrencyCheckUseCase, private val getBalanceNotEnoughForFeeWarningUseCase: GetBalanceNotEnoughForFeeWarningUseCase, + private val getTronFeeNotificationShowCountUseCase: GetTronFeeNotificationShowCountUseCase, private val cryptoCurrencyStatusProvider: Provider, private val feeCryptoCurrencyStatusProvider: Provider, private val currentStateProvider: Provider, @@ -125,9 +131,14 @@ internal class SendNotificationFactory( isFeeCoverage = isFeeCoverage, currencyCheck = currencyCheck, ) + addInfoNotifications() }.toImmutableList() } + private suspend fun MutableList.addInfoNotifications() { + addTronNetworkFeesNotification() + } + fun dismissNotificationState(clazz: Class, isIgnored: Boolean = false): SendUiState { val state = currentStateProvider() val sendState = state.sendState ?: return state @@ -341,4 +352,23 @@ internal class SendNotificationFactory( add(NotificationUM.Warning.TooHigh(diff)) } } + + private suspend fun MutableList.addTronNetworkFeesNotification() { + val cryptoCurrency = cryptoCurrencyStatusProvider().currency + val isTronToken = cryptoCurrency is CryptoCurrency.Token && + isTron(cryptoCurrency.network.id.value) + + if (isTronToken && getTronFeeNotificationShowCountUseCase() <= TRON_FEE_NOTIFICATION_MAX_SHOW_COUNT) { + add( + NotificationUM.Info( + title = resourceReference(R.string.tron_will_be_send_token_fee_title), + subtitle = resourceReference(R.string.tron_will_be_send_token_fee_description), + ), + ) + } + } + + companion object { + const val TRON_FEE_NOTIFICATION_MAX_SHOW_COUNT = 3 + } } \ No newline at end of file