From 85d1614dd47ab66f9ba2abc3fc4875d23fd31bc6 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 26 Feb 2024 16:25:17 +0800 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/feature/swap/domain/SwapInteractorImpl.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt b/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt index 0bdde7ae48..1d90e85471 100644 --- a/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt +++ b/features/swap/domain/src/main/java/com/tangem/feature/swap/domain/SwapInteractorImpl.kt @@ -665,7 +665,9 @@ internal class SwapInteractorImpl @Inject constructor( blockchain == Blockchain.Aptos -> { Fee.Aptos( amount = feeAmount, - gasUnitPrice = fee.feeValue.toLong() / fee.gasLimit, + gasUnitPrice = fee.feeValue.divide(BigDecimal(fee.gasLimit)) + .movePointRight(Blockchain.Aptos.decimals()) + .toLong(), gasLimit = fee.gasLimit.toLong(), ) } @@ -1358,7 +1360,7 @@ internal class SwapInteractorImpl @Inject constructor( is Fee.Common -> 0 is Fee.Ethereum -> gasLimit.toInt() is Fee.VeChain -> gasLimit.toInt() - is Fee.Aptos -> amount.longValue?.div(gasUnitPrice)?.toInt() ?: 0 + is Fee.Aptos -> gasLimit.toInt() } }