Updated on 2026-08-14
This commit is contained in:
parent
8afcc6fbdf
commit
608753d937
10 changed files with 100 additions and 83 deletions
|
|
@ -52,19 +52,19 @@ public class ServerApiHelper {
|
|||
|
||||
/**
|
||||
* HTTP
|
||||
* Infura
|
||||
* InfuraEthGasPrice
|
||||
*/
|
||||
private InfuraListener infuraListener;
|
||||
private InfuraEthGasPriceBodyListener infuraEthGasPriceBodyListener;
|
||||
|
||||
public interface InfuraListener {
|
||||
void onInfura(CardVerifyResponse cardVerifyResponse);
|
||||
public interface InfuraEthGasPriceBodyListener {
|
||||
void onInfuraEthGasPrice(InfuraEthGasPriceResponse cardVerifyResponse);
|
||||
}
|
||||
|
||||
public void setInfura(InfuraListener listener) {
|
||||
infuraListener = listener;
|
||||
public void setInfuraEthGasPrice(InfuraEthGasPriceBodyListener listener) {
|
||||
infuraEthGasPriceBodyListener = listener;
|
||||
}
|
||||
|
||||
public void infura(String method, int id) {
|
||||
public void infuraEthGasPrice(String method, int id) {
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(Server.ApiInfura.URL_INFURA)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
|
|
@ -80,15 +80,15 @@ public class ServerApiHelper {
|
|||
@Override
|
||||
public void onResponse(@NonNull Call<InfuraEthGasPriceResponse> call, @NonNull Response<InfuraEthGasPriceResponse> response) {
|
||||
if (response.code() == 200) {
|
||||
Log.i(TAG, "infura onResponse " + response.code());
|
||||
Log.i(TAG, "infura onResponse " + response.body().getResult());
|
||||
infuraEthGasPriceBodyListener.onInfuraEthGasPrice(response.body());
|
||||
Log.i(TAG, "infuraEthGasPrice onResponse " + response.code());
|
||||
} else
|
||||
Log.e(TAG, "infura onResponse " + response.code());
|
||||
Log.e(TAG, "infuraEthGasPrice onResponse " + response.code());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<InfuraEthGasPriceResponse> call, @NonNull Throwable t) {
|
||||
Log.e(TAG, "infura onFailure " + t.getMessage());
|
||||
Log.e(TAG, "infuraEthGasPrice onFailure " + t.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class ConnectFeeTask extends FeeTask {
|
|||
|
||||
if ((request.getBlockCount() == FeeRequest.MINIMAL) && (confirmPaymentActivity.getMinFee() == null)) {
|
||||
confirmPaymentActivity.setMinFee(String.valueOf(finalFee));
|
||||
confirmPaymentActivity.setMinFeeInInternalUnits(confirmPaymentActivity.getCard().InternalUnitsFromString(String.valueOf(finalFee)));
|
||||
confirmPaymentActivity.setMinFeeInInternalUnits(confirmPaymentActivity.getCard().internalUnitsFromString(String.valueOf(finalFee)));
|
||||
} else if ((request.getBlockCount() == FeeRequest.NORMAL) && (confirmPaymentActivity.getNormalFee() == null)) {
|
||||
confirmPaymentActivity.setNormalFee(String.valueOf(finalFee));
|
||||
} else if ((request.getBlockCount() == FeeRequest.PRIORITY) && (confirmPaymentActivity.getMaxFee() == null)) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class ETHRequestTask extends InfuraTask {
|
|||
confirmPaymentActivity.setFeeRequestSuccess(true);
|
||||
confirmPaymentActivity.setBalanceRequestSuccess(true);
|
||||
confirmPaymentActivity.setDtVerified(new Date());
|
||||
confirmPaymentActivity.setMinFeeInInternalUnits(confirmPaymentActivity.getCard().InternalUnitsFromString(feeInGwei));
|
||||
confirmPaymentActivity.setMinFeeInInternalUnits(confirmPaymentActivity.getCard().internalUnitsFromString(feeInGwei));
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue