From 0c6aa6f862d6d331905fefd20b2c214c1a53decc Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 6 Jun 2024 19:11:52 +0100 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/feature/swap/models/states/FeeItemState.kt | 4 ++++ .../main/java/com/tangem/feature/swap/ui/StateBuilder.kt | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/states/FeeItemState.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/states/FeeItemState.kt index e01a8b8058..8c3218aa96 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/states/FeeItemState.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/states/FeeItemState.kt @@ -5,6 +5,10 @@ import com.tangem.feature.swap.domain.models.ui.FeeType sealed class FeeItemState { + /** + * @param amountCrypto - crypto amount formatted with symbol + * @param amountFiatFormatted - formatted fiat amount + */ data class Content( val feeType: FeeType, val title: TextReference, diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt index e65136aa1a..bfb07ed4a0 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/StateBuilder.kt @@ -472,9 +472,7 @@ internal class StateBuilder( warnings.add( SwapWarning.GeneralWarning( createNetworkFeeCoverageNotificationConfig( - quoteModel.fromTokenInfo.tokenAmount.getFormattedCryptoAmount( - quoteModel.fromTokenInfo.cryptoCurrencyStatus.currency, - ), + fee.feeCryptoFormatted, fee.feeFiatFormatted, ), ), @@ -572,7 +570,7 @@ internal class StateBuilder( warnings.add(getWarningForError(dataError, fromToken.cryptoCurrencyStatus.currency)) if (includeFeeInAmount is IncludeFeeInAmount.Included && uiStateHolder.fee is FeeItemState.Content) { val feeCoverageNotification = createNetworkFeeCoverageNotificationConfig( - fromToken.tokenAmount.getFormattedCryptoAmount(fromToken.cryptoCurrencyStatus.currency), + uiStateHolder.fee.amountCrypto, uiStateHolder.fee.amountFiatFormatted, ) warnings.add(SwapWarning.GeneralWarning(feeCoverageNotification))