Skip to content

Commit

Permalink
fix jettonTransferAmount
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokin0andrey committed Dec 20, 2024
1 parent 0f770a0 commit 7aeb02e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ data class TransferEntity(
companion object {

val BASE_FORWARD_AMOUNT = Coins.of(0.05, 9)
val ONE_TON = Coins.of(1, 9)
val ONE_TON = Coins.ONE
val POINT_ONE_TON = Coins.of(0.1, 9)

fun newWalletQueryId(): BigInteger {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ class SendViewModel(
val emulated = api.emulate(
cell = message,
testnet = transfer.wallet.testnet,
balance = Coins.of(2).toLong(),
address = transfer.wallet.accountId,
balance = (Coins.ONE + Coins.ONE).toLong(),
safeModeEnabled = settingsRepository.isSafeModeEnabled(api)
)
val extra = emulated?.event?.extra ?: 0
Expand Down Expand Up @@ -935,8 +936,8 @@ class SendViewModel(
val token = selectedTokenFlow.value

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

0 comments on commit 7aeb02e

Please sign in to comment.