I am attemping to send a transaction to the Ethereum blockchain using the Web3j library, I get an error that I must send it with Async. When I send it with Async I get an error that the function does not exist. I am using Android Studio, Java, and the Web3j library.
When calling the executeTransactionAsync
method, part of web3.abi.datatypes.Function
, I get an error saying the method can not be found. I figured out this means that the method executeTransactionAsync
does not exist in the Web3j library. However, the Web3j documentation says to use that method. I am using the latest version of Web3j which is 3.1.1.
If I remove the Async so the method is executeTransaction
, I get an error that the Transaction needs to be sent through Async.
Is there a way I could send this transaction with Realm or something else? Or maybe I am using Web3j wrong and I need to use it another way?
The code sending the transaction:
public TransactionReceipt approve() throws IOException, TransactionException {
Function function = new Function("approve", Arrays.<Type>asList(), Collections.<TypeReference<?>>emptyList());
return executeTransactionAsync (function);
}