Updated on 2026-08-14

This commit is contained in:
Tangem 2018-10-04 12:48:07 +03:00
parent e97c936c92
commit 573101570b
15 changed files with 65 additions and 92 deletions

View file

@ -276,7 +276,7 @@ public class BtcEngine extends CoinEngine {
}
public String getBalanceCurrency(TangemCard card) {
return "mBTC";
return "BTC";
}
public boolean checkUnspentTransaction(TangemCard mCard) {
@ -284,7 +284,7 @@ public class BtcEngine extends CoinEngine {
}
public String getFeeCurrency() {
return "mBTC";
return "BTC";
}
public boolean validateAddress(String address, TangemCard card) {
@ -413,7 +413,7 @@ public class BtcEngine extends CoinEngine {
public String getBalanceValue(TangemCard mCard) {
if (mCard.hasBalanceInfo()) {
Double balance = mCard.getBalance() / (mCard.getBlockchain().getMultiplier() / 1000.0);
Double balance = mCard.getBalance() / (mCard.getBlockchain().getMultiplier());
String output = FormatUtil.DoubleToString(balance);
//String pattern = "#0.000"; // If you like 4 zeros
@ -467,7 +467,7 @@ public class BtcEngine extends CoinEngine {
if (bytes == null) return "";
byte[] reversed = new byte[bytes.length];
for (int i = 0; i < bytes.length; i++) reversed[i] = bytes[bytes.length - i - 1];
return FormatUtil.DoubleToString(1000.0 * mCard.AmountFromInternalUnits(Util.byteArrayToLong(reversed)));
return FormatUtil.DoubleToString(mCard.AmountFromInternalUnits(Util.byteArrayToLong(reversed)));
}
@Override
@ -480,7 +480,7 @@ public class BtcEngine extends CoinEngine {
@Override
public String getAmountDescription(TangemCard mCard, String amount) throws Exception {
return mCard.getAmountDescription(Double.parseDouble(amount) / 1000.0);
return mCard.getAmountDescription(Double.parseDouble(amount));
}
public static String getAmountEquivalentDescriptionBTC(Double amount, float rate) {
@ -492,7 +492,7 @@ public class BtcEngine extends CoinEngine {
}
public String getAmountEquivalentDescriptor(TangemCard mCard, String value) {
return getAmountEquivalentDescriptionBTC(Double.parseDouble(value) / 1000.0, mCard.getRate());
return getAmountEquivalentDescriptionBTC(Double.parseDouble(value), mCard.getRate());
}
public byte[] sign(String feeValue, String amountValue, boolean IncFee, String toValue, TangemCard mCard, CardProtocol protocol) throws Exception {