How can I retrieve transaction details (including the input data) from a txHash using Web3j?
I tried the following method:
public void buscarHhash(Web3j web3, String txHash) throws IOException {
String inputdata;
EthSendTransaction ethSendTransaction = null;
Request<?, EthTransaction> transactionReceipt = web3.ethGetTransactionByHash(txHash);
transactionReceipt.send().getTransaction()
.ifPresent(tx -> {
inputdata = tx.getInput();
});
}
This method does not seem to work, and I don't know if I'm doing it right.
Does anyone know how to do it? Not necessarily with the method that I used.