Updated on 2026-08-14

This commit is contained in:
Tangem 2019-02-01 13:24:39 +03:00
parent a8dabeca28
commit 49d6521bc5
2 changed files with 18 additions and 12 deletions

View file

@ -105,12 +105,15 @@ public class RskTokenEngine extends TokenEngine {
//
case ServerApiRootstock.ROOTSTOCK_ETH_CALL: {
try {
String balanceCap = rootstockResponse.getResult();
balanceCap = balanceCap.substring(2);
BigInteger l = new BigInteger(balanceCap, 16);
coinData.setBalanceInInternalUnits(new CoinEngine.InternalAmount(l, ctx.getCard().tokenSymbol));
// Log.i("$TAG eth_call", balanceCap)
if (validateAddress(getContractAddress(ctx.getCard()))) {
String balanceCap = rootstockResponse.getResult();
balanceCap = balanceCap.substring(2);
BigInteger l = new BigInteger(balanceCap, 16);
coinData.setBalanceInInternalUnits(new CoinEngine.InternalAmount(l, ctx.getCard().tokenSymbol));
// Log.i("$TAG eth_call", balanceCap)
} else {
ctx.setError("Smart contract address not defined");
}
if (blockchainRequestsCallbacks.allowAdvance()) {
serverApiRootstock.requestData(ServerApiRootstock.ROOTSTOCK_ETH_GET_BALANCE, 67, coinData.getWallet(), "", "");

View file

@ -679,12 +679,15 @@ public class TokenEngine extends CoinEngine {
//
case ServerApiInfura.INFURA_ETH_CALL: {
try {
String balanceCap = infuraResponse.getResult();
balanceCap = balanceCap.substring(2);
BigInteger l = new BigInteger(balanceCap, 16);
coinData.setBalanceInInternalUnits(new CoinEngine.InternalAmount(l, ctx.getCard().tokenSymbol));
// Log.i("$TAG eth_call", balanceCap)
if (validateAddress(getContractAddress(ctx.getCard()))) {
String balanceCap = infuraResponse.getResult();
balanceCap = balanceCap.substring(2);
BigInteger l = new BigInteger(balanceCap, 16);
coinData.setBalanceInInternalUnits(new CoinEngine.InternalAmount(l, ctx.getCard().tokenSymbol));
// Log.i("$TAG eth_call", balanceCap)
} else {
ctx.setError("Smart contract address not defined");
}
if (blockchainRequestsCallbacks.allowAdvance()) {
serverApiInfura.requestData(ServerApiInfura.INFURA_ETH_GET_BALANCE, 67, coinData.getWallet(), "", "");