Package org.web3j.tx
Class ManagedTransaction
java.lang.Object
org.web3j.tx.ManagedTransaction
Generic transaction manager.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EnsResolverstatic final BigIntegerDeprecated.use ContractGasProviderprotected TransactionManagerprotected Web3j -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedManagedTransaction(EnsResolver ensResolver, Web3j web3j, TransactionManager transactionManager) protectedManagedTransaction(Web3j web3j, TransactionManager transactionManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringcall(String to, String data, DefaultBlockParameter defaultBlockParameter) longThis should only be used in case you need to get theEnsResolver.getSyncThreshold()parameter, which dictates the threshold in milliseconds since the last processed block timestamp should be to considered in sync the blockchain.Return the current gas price from the ethereum node.protected TransactionReceiptsend(String to, String data, BigInteger value, BigInteger gasPrice, BigInteger gasLimit) protected TransactionReceiptsend(String to, String data, BigInteger value, BigInteger gasPrice, BigInteger gasLimit, boolean constructor) protected TransactionReceiptsendEIP1559(long chainId, String to, String data, BigInteger value, BigInteger gasLimit, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas) protected TransactionReceiptsendEIP1559(long chainId, String to, String data, BigInteger value, BigInteger gasLimit, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, boolean constructor) voidsetSyncThreshold(long syncThreshold) This should only be used in case you need to modify theEnsResolver.getSyncThreshold()parameter, which dictates the threshold in milliseconds since the last processed block timestamp should be to considered in sync the blockchain.
-
Field Details
-
GAS_PRICE
Deprecated.use ContractGasProvider- See Also:
-
web3j
-
transactionManager
-
ensResolver
-
-
Constructor Details
-
ManagedTransaction
-
ManagedTransaction
protected ManagedTransaction(EnsResolver ensResolver, Web3j web3j, TransactionManager transactionManager)
-
-
Method Details
-
getSyncThreshold
public long getSyncThreshold()This should only be used in case you need to get theEnsResolver.getSyncThreshold()parameter, which dictates the threshold in milliseconds since the last processed block timestamp should be to considered in sync the blockchain.It is currently experimental and only used in ENS name resolution, but will probably be made available for read calls in the future.
- Returns:
- sync threshold value in milliseconds
-
setSyncThreshold
public void setSyncThreshold(long syncThreshold) This should only be used in case you need to modify theEnsResolver.getSyncThreshold()parameter, which dictates the threshold in milliseconds since the last processed block timestamp should be to considered in sync the blockchain.It is currently experimental and only used in ENS name resolution, but will probably be made available for read calls in the future.
- Parameters:
syncThreshold- the sync threshold in milliseconds
-
requestCurrentGasPrice
Return the current gas price from the ethereum node.Note: this method was previously called
getGasPricebut was renamed to distinguish it when a bean accessor method onContractwas added with that name. If you have a Contract subclass that is calling this method (unlikely since those classes are usually generated and until very recently those generated subclasses were markedfinal), then you will need to change your code to call this method instead, if you want the dynamic behavior.- Returns:
- the current gas price, determined dynamically at invocation
- Throws:
IOException- if there's a problem communicating with the ethereum node
-
send
protected TransactionReceipt send(String to, String data, BigInteger value, BigInteger gasPrice, BigInteger gasLimit) throws IOException, TransactionException - Throws:
IOExceptionTransactionException
-
sendEIP1559
protected TransactionReceipt sendEIP1559(long chainId, String to, String data, BigInteger value, BigInteger gasLimit, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas) throws IOException, TransactionException - Throws:
IOExceptionTransactionException
-
send
protected TransactionReceipt send(String to, String data, BigInteger value, BigInteger gasPrice, BigInteger gasLimit, boolean constructor) throws IOException, TransactionException - Throws:
IOExceptionTransactionException
-
sendEIP1559
protected TransactionReceipt sendEIP1559(long chainId, String to, String data, BigInteger value, BigInteger gasLimit, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, boolean constructor) throws IOException, TransactionException - Throws:
IOExceptionTransactionException
-
call
protected String call(String to, String data, DefaultBlockParameter defaultBlockParameter) throws IOException - Throws:
IOException
-