Updated on 2026-08-14
This commit is contained in:
parent
12583818ec
commit
dfd8bd0594
6 changed files with 62 additions and 29 deletions
|
|
@ -1,7 +1,5 @@
|
|||
package com.tangem.data.network;
|
||||
|
||||
import static com.tangem.data.network.Server.ApiTangem.URL_TANGEM;
|
||||
|
||||
public class Server {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -113,9 +113,11 @@ public class ServerApiHelper {
|
|||
* Infura
|
||||
* <p>
|
||||
* eth_getBalance
|
||||
* eth_getTransactionCount
|
||||
* eth_gasPrice
|
||||
*/
|
||||
public static final String INFURA_ETH_GET_BALANCE = "eth_getBalance";
|
||||
public static final String INFURA_ETH_GET_TRANSACTION_COUNT = "eth_getTransactionCount";
|
||||
public static final String INFURA_ETH_GAS_PRICE = "eth_gasPrice";
|
||||
private InfuraBodyListener infuraBodyListener;
|
||||
|
||||
|
|
@ -138,6 +140,7 @@ public class ServerApiHelper {
|
|||
InfuraBody infuraBody;
|
||||
switch (method) {
|
||||
case INFURA_ETH_GET_BALANCE:
|
||||
case INFURA_ETH_GET_TRANSACTION_COUNT:
|
||||
infuraBody = new InfuraBody(method, new String[]{wallet, "latest"}, id);
|
||||
break;
|
||||
|
||||
|
|
@ -246,11 +249,12 @@ public class ServerApiHelper {
|
|||
for (RateInfoResponse rateInfoMode : rateInfoModelList) {
|
||||
if (rateInfoMode.getId().equals(cryptoId)) {
|
||||
rateInfoDataListener.onRateInfoDataData(rateInfoMode);
|
||||
Log.i("rateInfoData", rateInfoMode.getId());
|
||||
Log.i("rateInfoData", rateInfoMode.getPriceUsd());
|
||||
Log.i(TAG, "rateInfoData " + cryptoId + " onResponse " + "200");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
Log.e(TAG, "rateInfoData " + cryptoId + " onResponse " + "Empty");
|
||||
|
||||
},
|
||||
// handle error
|
||||
Throwable::printStackTrace);
|
||||
|
|
@ -411,7 +415,7 @@ public class ServerApiHelper {
|
|||
call.enqueue(new Callback<ResponseBody>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) {
|
||||
Log.i(TAG, "LastVersion onResponse " + response.code());
|
||||
Log.i(TAG, "lastVersion onResponse " + response.code());
|
||||
if (response.code() == 200) {
|
||||
String stringResponse;
|
||||
try {
|
||||
|
|
@ -425,7 +429,7 @@ public class ServerApiHelper {
|
|||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
|
||||
Log.e(TAG, "LastVersion onFailure " + t.getMessage());
|
||||
Log.e(TAG, "lastVersion onFailure " + t.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class ETHRequestTask extends InfuraTask {
|
|||
nonce = nonce.substring(2);
|
||||
BigInteger count = new BigInteger(nonce, 16);
|
||||
|
||||
loadedWallet.getCard().SetConfirmTXCount(count);
|
||||
loadedWallet.getCard().setConfirmTXCount(count);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ public class ETHRequestTask extends InfuraTask {
|
|||
|
||||
BigInteger nonce = loadedWallet.getCard().GetConfirmTXCount();
|
||||
nonce.add(BigInteger.valueOf(1));
|
||||
loadedWallet.getCard().SetConfirmTXCount(nonce);
|
||||
loadedWallet.getCard().setConfirmTXCount(nonce);
|
||||
Log.e("TX_RESULT", hashTX);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class ETHRequestTask extends InfuraTask {
|
|||
LastSignStorage.setLastMessage(sendTransactionActivity.getCard().getWallet(), "");
|
||||
BigInteger nonce = sendTransactionActivity.getCard().GetConfirmTXCount();
|
||||
nonce.add(BigInteger.valueOf(1));
|
||||
sendTransactionActivity.getCard().SetConfirmTXCount(nonce);
|
||||
sendTransactionActivity.getCard().setConfirmTXCount(nonce);
|
||||
Log.e("TX_RESULT", hashTX);
|
||||
sendTransactionActivity.finishWithSuccess();
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue