Updated on 2026-08-14
This commit is contained in:
commit
e1262077cf
3 changed files with 11 additions and 6 deletions
|
|
@ -413,13 +413,17 @@ internal class SwapInteractorImpl @Inject constructor(
|
|||
fromToken.network.backendId,
|
||||
fromToken.network.derivationPath.value,
|
||||
) ?: ProxyAmount.empty()
|
||||
// ignore if amount is bigger than balance
|
||||
if (amount.value > nativeBalance.value) {
|
||||
return
|
||||
}
|
||||
val fee = when (txFee) {
|
||||
TxFeeState.Empty -> BigDecimal.ZERO
|
||||
is TxFeeState.MultipleFeeState -> txFee.priorityFee.feeValue
|
||||
is TxFeeState.SingleFeeState -> txFee.fee.feeValue
|
||||
}
|
||||
val minAvailableAmount = nativeBalance.value - existentialDeposit - fee
|
||||
if (nativeBalance.value.minus(amount.value) < existentialDeposit) {
|
||||
if (nativeBalance.value.minus(amount.value + fee) < existentialDeposit) {
|
||||
warnings.add(Warning.ExistentialDepositWarning(existentialDeposit, minAvailableAmount))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,7 +282,10 @@ private fun Content(
|
|||
|
||||
if (amountEquivalent != null) {
|
||||
if (type is TransactionCardType.ReadOnly) {
|
||||
Row(modifier = Modifier.defaultMinSize(minHeight = TangemTheme.dimens.size20)) {
|
||||
Row(
|
||||
modifier = Modifier.defaultMinSize(minHeight = TangemTheme.dimens.size20),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
if (priceImpact is PriceImpact.Value) {
|
||||
Text(
|
||||
text = makePriceImpactBalanceWarning(
|
||||
|
|
@ -291,8 +294,6 @@ private fun Content(
|
|||
),
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
style = TangemTheme.typography.body2,
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterVertically),
|
||||
)
|
||||
} else {
|
||||
AnimatedContent(targetState = amountEquivalent, label = "") {
|
||||
|
|
@ -312,7 +313,7 @@ private fun Content(
|
|||
modifier = Modifier.size(size = TangemTheme.dimens.size20),
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_alert_24),
|
||||
painter = painterResource(id = R.drawable.ic_information_24),
|
||||
contentDescription = null,
|
||||
tint = if (priceImpact is PriceImpact.Value) {
|
||||
TangemTheme.colors.text.attention
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ markdown = "0.7.2"
|
|||
# endregion Other libraries
|
||||
|
||||
# region Tangem
|
||||
tangemBlockchainSdk = "release-app_5.12-683"
|
||||
tangemBlockchainSdk = "release-app_5.12-689"
|
||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||
tangemCardSdk = "release-app_5.12-364"
|
||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue