Updated on 2026-08-14

This commit is contained in:
Tangem 2018-10-02 13:13:14 +03:00
parent f403e50309
commit 8eeda55d9d
12 changed files with 183 additions and 153 deletions

View file

@ -253,13 +253,13 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
ServerApiHelper.INFURA_ETH_GAS_PRICE -> {
var gasPrice = infuraResponse.result
gasPrice = gasPrice.substring(2)
var l = BigInteger(gasPrice, 16)
// Rounding gas price to integer gweis
var l = BigInteger(gasPrice, 16).divide(BigInteger.valueOf(1000000000L)).multiply(BigInteger.valueOf(1000000000L))
val m = if (card!!.blockchain == Blockchain.Token) BigInteger.valueOf(60000) else BigInteger.valueOf(21000)
l = l.multiply(m)
val minFeeInGwei = card!!.getAmountInGwei(l.toString())
val normalFeeInGwei = card!!.getAmountInGwei(l.multiply(BigInteger.valueOf(12)).divide(BigInteger.valueOf(10)).toString())
val maxFeeInGwei = card!!.getAmountInGwei(l.multiply(BigInteger.valueOf(15)).divide(BigInteger.valueOf(10)).toString())
val minFeeInGwei = card!!.getAmountInGwei(l.multiply(m).toString())
val normalFeeInGwei = card!!.getAmountInGwei(l.multiply(BigInteger.valueOf(12)).divide(BigInteger.valueOf(10)).multiply(m).toString())
val maxFeeInGwei = card!!.getAmountInGwei(l.multiply(BigInteger.valueOf(15)).divide(BigInteger.valueOf(10)).multiply(m).toString())
minFee = minFeeInGwei
normalFee = normalFeeInGwei

View file

@ -96,9 +96,9 @@ class SendTransactionActivity : AppCompatActivity() {
Log.e("TX_RESULT", hashTX)
val nonce = card!!.GetConfirmTXCount()
val nonce = card!!.getConfirmedTXCount()
nonce.add(BigInteger.valueOf(1))
card!!.setConfirmTXCount(nonce)
card!!.setConfirmedTXCount(nonce)
Log.e("TX_RESULT", hashTX)
finishWithSuccess()