Updated on 2026-08-14

This commit is contained in:
Tangem 2018-09-04 15:55:59 +03:00
parent 90636a0e6a
commit cfaaa3205f
13 changed files with 98 additions and 47 deletions

View file

@ -46,20 +46,22 @@ public class ETHRequestTask extends InfuraTask {
BigInteger m = confirmPaymentActivity.getCard().getBlockchain() == Blockchain.Token ? BigInteger.valueOf(55000) : BigInteger.valueOf(21000);
l = l.multiply(m);
String feeInGwei = confirmPaymentActivity.getCard().getAmountInGwei(String.valueOf(l));
String MinFeeInGwei = confirmPaymentActivity.getCard().getAmountInGwei(String.valueOf(l));
String NormalFeeInGwei = confirmPaymentActivity.getCard().getAmountInGwei(String.valueOf(l.multiply(BigInteger.valueOf(12)).divide(BigInteger.valueOf(10))));
String MaxFeeInGwei = confirmPaymentActivity.getCard().getAmountInGwei(String.valueOf(l.multiply(BigInteger.valueOf(15)).divide(BigInteger.valueOf(10))));
Log.i("sjjoefeff", feeInGwei);
Log.i("sjjoefeff", MinFeeInGwei);
confirmPaymentActivity.setMinFee(feeInGwei);
confirmPaymentActivity.setMaxFee(feeInGwei);
confirmPaymentActivity.setNormalFee(feeInGwei);
confirmPaymentActivity.getEtFee().setText(feeInGwei);
confirmPaymentActivity.setMinFee(MinFeeInGwei);
confirmPaymentActivity.setNormalFee(NormalFeeInGwei);
confirmPaymentActivity.setMaxFee(MaxFeeInGwei);
confirmPaymentActivity.getEtFee().setText(NormalFeeInGwei);
confirmPaymentActivity.getEtFee().setError(null);
confirmPaymentActivity.getBtnSend().setVisibility(View.VISIBLE);
confirmPaymentActivity.setFeeRequestSuccess(true);
confirmPaymentActivity.setBalanceRequestSuccess(true);
confirmPaymentActivity.setDtVerified(new Date());
confirmPaymentActivity.setMinFeeInInternalUnits(confirmPaymentActivity.getCard().InternalUnitsFromString(feeInGwei));
confirmPaymentActivity.setMinFeeInInternalUnits(confirmPaymentActivity.getCard().InternalUnitsFromString(NormalFeeInGwei));
} catch (JSONException e) {
e.printStackTrace();

View file

@ -20,10 +20,12 @@ public class SignPaymentTask extends Thread {
private String txAmount = "";
private String txFee = "";
private Boolean txIncFee = true;
public void SetTransactionValue(String amount, String fee) {
public void SetTransactionValue(String amount, String fee, Boolean incfee) {
txAmount = amount;
txFee = fee;
txIncFee = incfee;
}
private String txOutAddress;
@ -34,14 +36,14 @@ public class SignPaymentTask extends Thread {
private CardProtocol.Notifications mNotifications;
private boolean isCancelled = false;
public SignPaymentTask(Activity context, TangemCard card, NfcManager nfcManager, IsoDep isoDep, CardProtocol.Notifications notifications, String amount, String fee, String outAddress) {
public SignPaymentTask(Activity context, TangemCard card, NfcManager nfcManager, IsoDep isoDep, CardProtocol.Notifications notifications, String amount, String fee, Boolean IncFee, String outAddress) {
mCard = card;
mContext = context;
mNfcManager = nfcManager;
mIsoDep = isoDep;
mNotifications = notifications;
txOutAddress = outAddress;
SetTransactionValue(amount, fee);
SetTransactionValue(amount, fee, IncFee);
}
@Override
@ -90,7 +92,7 @@ public class SignPaymentTask extends Thread {
byte[] tx;
// try {
tx = engine.sign(txFee, txAmount, txOutAddress, mCard, protocol);
tx = engine.sign(txFee, txAmount, txIncFee, txOutAddress, mCard, protocol);
// }
// finally {
// mNotifications.onReadWait(0);