Skip to content

Commit

Permalink
fix forward amount (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokin0andrey authored Dec 17, 2024
1 parent f663513 commit 33ef676
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,9 @@ class SendViewModel(
}
} else {
val totalAmount = if (getRawExtra().multiply(BigDecimal(-1)).isNegative) {
TransferEntity.POINT_ONE_TON
TransferEntity.BASE_FORWARD_AMOUNT
} else {
fee + TransferEntity.POINT_ONE_TON
fee + TransferEntity.BASE_FORWARD_AMOUNT
}
if (!withRelayer && totalAmount.value > tonBalance.value) {
showInsufficientBalance(tonBalance, totalAmount)
Expand Down Expand Up @@ -934,16 +934,13 @@ class SendViewModel(

val token = selectedTokenFlow.value

var jettonTransferAmount = when {
sendTransferType is SendTransferType.Gasless || extra.isNegative -> TransferEntity.BASE_FORWARD_AMOUNT
fee.isZero -> TransferEntity.POINT_ONE_TON
val jettonTransferAmount = when {
sendTransferType is SendTransferType.Gasless || extra.multiply(BigDecimal(-1)).isNegative -> TransferEntity.BASE_FORWARD_AMOUNT
fee.isZero -> TransferEntity.BASE_FORWARD_AMOUNT
token.isRequestMinting || token.customPayloadApiUri != null -> TransferEntity.POINT_ONE_TON
else -> fee + TransferEntity.BASE_FORWARD_AMOUNT
}

if (token.isRequestMinting || token.customPayloadApiUri != null) {
jettonTransferAmount = Coins.of(0.1)
}

val boc = signUseCase(
context = context,
wallet = wallet,
Expand Down

0 comments on commit 33ef676

Please sign in to comment.