Updated on 2026-08-14
This commit is contained in:
parent
8780aca5e1
commit
39e8a00638
6 changed files with 80 additions and 31 deletions
|
|
@ -115,11 +115,13 @@ public class ServerApiHelper {
|
|||
* eth_getBalance
|
||||
* eth_getTransactionCount
|
||||
* eth_call
|
||||
* eth_sendRawTransaction
|
||||
* 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_CALL = "eth_call";
|
||||
public static final String INFURA_ETH_SEND_RAW_TRANSACTION = "eth_sendRawTransaction";
|
||||
public static final String INFURA_ETH_GAS_PRICE = "eth_gasPrice";
|
||||
private InfuraBodyListener infuraBodyListener;
|
||||
|
||||
|
|
@ -131,7 +133,7 @@ public class ServerApiHelper {
|
|||
infuraBodyListener = listener;
|
||||
}
|
||||
|
||||
public void infura(String method, int id, String wallet, String contract) {
|
||||
public void infura(String method, int id, String wallet, String contract, String tx) {
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(Server.ApiInfura.URL_INFURA)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
|
|
@ -151,6 +153,10 @@ public class ServerApiHelper {
|
|||
infuraBody = new InfuraBody(method, new Object[]{new InfuraBody.EthCallParams("0x70a08231000000000000000000000000" + address, contract), "latest"}, id);
|
||||
break;
|
||||
|
||||
case INFURA_ETH_SEND_RAW_TRANSACTION:
|
||||
infuraBody = new InfuraBody(method, new String[]{tx}, id);
|
||||
break;
|
||||
|
||||
case INFURA_ETH_GAS_PRICE:
|
||||
infuraBody = new InfuraBody(method, id);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public class InfuraBody {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
// body for eth getBalance, eth getTransactionCount, eth sendRawTransaction
|
||||
public InfuraBody(String method, String[] params, int id) {
|
||||
this.method = method;
|
||||
this.params = params;
|
||||
|
|
@ -36,4 +37,5 @@ public class InfuraBody {
|
|||
this.to = to;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -107,9 +107,9 @@ public class SignPaymentTask extends Thread {
|
|||
//LastSignStorage.setLastTX(mCard.getWallet(), txStr);
|
||||
|
||||
Intent intent = new Intent(mContext, SendTransactionActivity.class);
|
||||
intent.putExtra("UID", mCard.getUID());
|
||||
intent.putExtra("Card", mCard.getAsBundle());
|
||||
intent.putExtra("TX", txStr);
|
||||
intent.putExtra(SendTransactionActivity.EXTRA_UID, mCard.getUID());
|
||||
intent.putExtra(SendTransactionActivity.EXTRA_CARD, mCard.getAsBundle());
|
||||
intent.putExtra(SendTransactionActivity.EXTRA_TX, txStr);
|
||||
mContext.startActivityForResult(intent, SignPaymentActivity.REQUEST_CODE_SEND_PAYMENT);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue