Package org.web3j.tx
Class TransactionManager
java.lang.Object
org.web3j.tx.TransactionManager
- Direct Known Subclasses:
ClientTransactionManager
,RawTransactionManager
,ReadonlyTransactionManager
Transaction manager abstraction for executing transactions with Ethereum client via various
mechanisms.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
TransactionManager
(Web3j web3j, int attempts, long sleepDuration, String fromAddress) protected
TransactionManager
(Web3j web3j, String fromAddress) protected
TransactionManager
(TransactionReceiptProcessor transactionReceiptProcessor, String fromAddress) -
Method Summary
Modifier and TypeMethodDescriptionprotected TransactionReceipt
executeTransaction
(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value) protected TransactionReceipt
executeTransaction
(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor) protected TransactionReceipt
executeTransactionEIP1559
(long chainId, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, String data, BigInteger value) protected TransactionReceipt
executeTransactionEIP1559
(long chainId, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor) abstract EthGetCode
getCode
(String contractAddress, DefaultBlockParameter defaultBlockParameter) protected TransactionReceipt
processResponse
(EthSendTransaction transactionResponse) abstract String
sendCall
(String to, String data, DefaultBlockParameter defaultBlockParameter) sendEIP1559Transaction
(long chainId, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, String data, BigInteger value) abstract EthSendTransaction
sendEIP1559Transaction
(long chainId, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor) sendTransaction
(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value) abstract EthSendTransaction
sendTransaction
(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor)
-
Field Details
-
DEFAULT_POLLING_ATTEMPTS_PER_TX_HASH
public static final int DEFAULT_POLLING_ATTEMPTS_PER_TX_HASH- See Also:
-
DEFAULT_POLLING_FREQUENCY
public static final long DEFAULT_POLLING_FREQUENCY- See Also:
-
REVERT_ERR_STR
- See Also:
-
-
Constructor Details
-
TransactionManager
protected TransactionManager(TransactionReceiptProcessor transactionReceiptProcessor, String fromAddress) -
TransactionManager
-
TransactionManager
-
-
Method Details
-
executeTransaction
protected TransactionReceipt executeTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value) throws IOException, TransactionException - Throws:
IOException
TransactionException
-
executeTransaction
protected TransactionReceipt executeTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor) throws IOException, TransactionException - Throws:
IOException
TransactionException
-
executeTransactionEIP1559
protected TransactionReceipt executeTransactionEIP1559(long chainId, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, String data, BigInteger value) throws IOException, TransactionException - Throws:
IOException
TransactionException
-
executeTransactionEIP1559
protected TransactionReceipt executeTransactionEIP1559(long chainId, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor) throws IOException, TransactionException - Throws:
IOException
TransactionException
-
sendTransaction
public EthSendTransaction sendTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value) throws IOException - Throws:
IOException
-
sendEIP1559Transaction
public EthSendTransaction sendEIP1559Transaction(long chainId, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, String data, BigInteger value) throws IOException - Throws:
IOException
-
sendTransaction
public abstract EthSendTransaction sendTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor) throws IOException - Throws:
IOException
-
sendEIP1559Transaction
public abstract EthSendTransaction sendEIP1559Transaction(long chainId, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor) throws IOException - Throws:
IOException
-
sendCall
public abstract String sendCall(String to, String data, DefaultBlockParameter defaultBlockParameter) throws IOException - Throws:
IOException
-
getCode
public abstract EthGetCode getCode(String contractAddress, DefaultBlockParameter defaultBlockParameter) throws IOException - Throws:
IOException
-
getFromAddress
-
processResponse
protected TransactionReceipt processResponse(EthSendTransaction transactionResponse) throws IOException, TransactionException - Throws:
IOException
TransactionException
-