Updated on 2026-08-14
This commit is contained in:
parent
ae33c00aae
commit
85cff6b0d3
10 changed files with 169 additions and 22 deletions
|
|
@ -6,7 +6,6 @@ import com.tangem.core.ui.format.bigdecimal.crypto
|
|||
import com.tangem.core.ui.format.bigdecimal.format
|
||||
import com.tangem.features.walletconnect.transaction.entity.blockaid.WcEstimatedWalletChangeUM
|
||||
import com.tangem.utils.converter.Converter
|
||||
import java.math.BigDecimal
|
||||
import javax.inject.Inject
|
||||
|
||||
internal class WcEstimatedWalletChangeUMConverter @Inject constructor() :
|
||||
|
|
@ -17,7 +16,7 @@ internal class WcEstimatedWalletChangeUMConverter @Inject constructor() :
|
|||
is AmountInfo.FungibleTokens -> WcEstimatedWalletChangeUM(
|
||||
iconRes = value.iconRes,
|
||||
title = resourceReference(value.titleRes),
|
||||
description = "${value.sign} ${amountInfo.amount.amountText()} ${amountInfo.token.symbol}",
|
||||
description = "${value.sign} ${amountInfo.amountText()} ${amountInfo.token.symbol}",
|
||||
tokenIconUrl = amountInfo.token.logoUrl,
|
||||
)
|
||||
is AmountInfo.NonFungibleTokens -> WcEstimatedWalletChangeUM(
|
||||
|
|
@ -29,7 +28,7 @@ internal class WcEstimatedWalletChangeUMConverter @Inject constructor() :
|
|||
}
|
||||
}
|
||||
|
||||
private fun BigDecimal.amountText() = format { crypto("", DECIMALS_AMOUNT) }
|
||||
private fun AmountInfo.FungibleTokens.amountText() = amount.format { crypto("", token.decimals) }
|
||||
|
||||
data class Input(
|
||||
val amountInfo: AmountInfo,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import kotlinx.collections.immutable.toImmutableList
|
|||
import java.math.BigDecimal
|
||||
import javax.inject.Inject
|
||||
|
||||
internal const val DECIMALS_AMOUNT = 2
|
||||
private const val DECIMALS_AMOUNT = 2
|
||||
|
||||
@Suppress("CyclomaticComplexMethod", "LongMethod")
|
||||
internal class WcSendAndReceiveBlockAidUiConverter @Inject constructor(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue