How can I get the status of a transaction through the TxHash with web3j.
I tried it like this:
public int getEstado(String trx) {
try {
JSONObject json = readJsonFromUrl("https://api.infura.io/v1/jsonrpc/rinkeby/eth_getTransactionReceipt?params=[\"" + trx + "\"]");
if (json.toString().contains("error")) {
return -4;
}
String result = Parser.getMessageByKey(json.toString(), "status");
int estado = Integer.decode(result);
json = null;
result = null;
return estado;
} catch (Exception ex) {
return -4;
}
}
In the end this did not work, so I wanted to know if you can guide me in another way to get the status of txHash.