Package org.web3j.tx
Class ManagedTransaction
- java.lang.Object
-
- org.web3j.tx.ManagedTransaction
-
-
Field Summary
Fields Modifier and Type Field Description protected EnsResolver
ensResolver
static java.math.BigInteger
GAS_PRICE
Deprecated.use ContractGasProviderprotected TransactionManager
transactionManager
protected Web3j
web3j
-
Constructor Summary
Constructors Modifier Constructor Description protected
ManagedTransaction(EnsResolver ensResolver, Web3j web3j, TransactionManager transactionManager)
protected
ManagedTransaction(Web3j web3j, TransactionManager transactionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
call(java.lang.String to, java.lang.String data, DefaultBlockParameter defaultBlockParameter)
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.java.math.BigInteger
requestCurrentGasPrice()
Return the current gas price from the ethereum node.protected TransactionReceipt
send(java.lang.String to, java.lang.String data, java.math.BigInteger value, java.math.BigInteger gasPrice, java.math.BigInteger gasLimit)
protected TransactionReceipt
send(java.lang.String to, java.lang.String data, java.math.BigInteger value, java.math.BigInteger gasPrice, java.math.BigInteger gasLimit, boolean constructor)
protected TransactionReceipt
sendEIP1559(java.lang.String to, java.lang.String data, java.math.BigInteger value, java.math.BigInteger gasLimit, java.math.BigInteger gasPremium, java.math.BigInteger feeCap)
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.
-
-
-
Field Detail
-
GAS_PRICE
public static final java.math.BigInteger GAS_PRICE
Deprecated.use ContractGasProvider- See Also:
DefaultGasProvider
-
web3j
protected Web3j web3j
-
transactionManager
protected TransactionManager transactionManager
-
ensResolver
protected EnsResolver ensResolver
-
-
Constructor Detail
-
ManagedTransaction
protected ManagedTransaction(Web3j web3j, TransactionManager transactionManager)
-
ManagedTransaction
protected ManagedTransaction(EnsResolver ensResolver, Web3j web3j, TransactionManager transactionManager)
-
-
Method Detail
-
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
public java.math.BigInteger requestCurrentGasPrice() throws java.io.IOException
Return the current gas price from the ethereum node.Note: this method was previously called
getGasPrice
but was renamed to distinguish it when a bean accessor method onContract
was 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:
java.io.IOException
- if there's a problem communicating with the ethereum node
-
send
protected TransactionReceipt send(java.lang.String to, java.lang.String data, java.math.BigInteger value, java.math.BigInteger gasPrice, java.math.BigInteger gasLimit) throws java.io.IOException, TransactionException
- Throws:
java.io.IOException
TransactionException
-
sendEIP1559
protected TransactionReceipt sendEIP1559(java.lang.String to, java.lang.String data, java.math.BigInteger value, java.math.BigInteger gasLimit, java.math.BigInteger gasPremium, java.math.BigInteger feeCap) throws java.io.IOException, TransactionException
- Throws:
java.io.IOException
TransactionException
-
send
protected TransactionReceipt send(java.lang.String to, java.lang.String data, java.math.BigInteger value, java.math.BigInteger gasPrice, java.math.BigInteger gasLimit, boolean constructor) throws java.io.IOException, TransactionException
- Throws:
java.io.IOException
TransactionException
-
call
protected java.lang.String call(java.lang.String to, java.lang.String data, DefaultBlockParameter defaultBlockParameter) throws java.io.IOException
- Throws:
java.io.IOException
-
-