Updated on 2026-08-14

This commit is contained in:
Tangem 2020-04-20 21:20:38 +03:00
parent 81785a6b44
commit 452a4f05a2

View file

@ -12,6 +12,7 @@ import kotlinx.coroutines.coroutineScope
import org.kethereum.ETH_IN_WEI
import java.math.BigDecimal
import java.math.BigInteger
import java.math.RoundingMode
class EthereumNetworkManager {
@ -70,8 +71,8 @@ class EthereumNetworkManager {
private fun String.parseFee(gasLimit: Long): List<BigDecimal> {
val gasPrice = this.responseToNumber().toBigDecimal()
val minFee = gasPrice.multiply(gasLimit.toBigDecimal())
val normalFee = minFee.multiply(BigDecimal(1.2))
val priorityFee = minFee.multiply(BigDecimal(1.5))
val normalFee = minFee.multiply(BigDecimal(1.2)).setScale(0, RoundingMode.HALF_UP)
val priorityFee = minFee.multiply(BigDecimal(1.5)).setScale(0, RoundingMode.HALF_UP)
return listOf(
minFee.convertFeeToEth(),
normalFee.convertFeeToEth(),