Package io.keyko.common.web3
Class PersonalTransactionManager
- java.lang.Object
-
- org.web3j.tx.TransactionManager
-
- io.keyko.common.web3.PersonalTransactionManager
-
public class PersonalTransactionManager extends org.web3j.tx.TransactionManager
-
-
Field Summary
Fields Modifier and Type Field Description private org.web3j.crypto.Credentials
credentials
private static org.apache.logging.log4j.Logger
log
private BigInteger
nonce
private NonceBuilder
nonceBuilder
private String
password
private Boolean
recalculateNonce
protected org.web3j.utils.TxHashVerifier
txHashVerifier
private org.web3j.protocol.Web3j
web3j
-
Constructor Summary
Constructors Constructor Description PersonalTransactionManager(org.web3j.protocol.admin.Admin web3j, org.web3j.crypto.Credentials credentials, String password)
PersonalTransactionManager(org.web3j.protocol.Web3j web3j, org.web3j.crypto.Credentials credentials, String password, int attempts, long sleepDuration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static void
assertCallNotReverted(org.web3j.protocol.core.methods.response.EthCall ethCall)
org.web3j.protocol.core.methods.response.EthGetCode
getCode(String contractAddress, org.web3j.protocol.core.DefaultBlockParameter defaultBlockParameter)
protected BigInteger
getEstimatedGas(String to, String data)
BigInteger
getNonce()
String
sendCall(String to, String data, org.web3j.protocol.core.DefaultBlockParameter defaultBlockParameter)
org.web3j.protocol.core.methods.response.EthSendTransaction
sendTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value)
org.web3j.protocol.core.methods.response.EthSendTransaction
sendTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor)
void
setNonceBuilder(NonceBuilder nonceBuilder)
PersonalTransactionManager
setNonceRecalculation(Boolean activate)
String
sign(org.web3j.crypto.RawTransaction rawTransaction)
org.web3j.protocol.core.methods.response.EthSendTransaction
signAndSend(org.web3j.crypto.RawTransaction rawTransaction)
-
-
-
Field Detail
-
log
private static final org.apache.logging.log4j.Logger log
-
web3j
private final org.web3j.protocol.Web3j web3j
-
credentials
private final org.web3j.crypto.Credentials credentials
-
password
private final String password
-
recalculateNonce
private Boolean recalculateNonce
-
nonce
private volatile BigInteger nonce
-
nonceBuilder
private NonceBuilder nonceBuilder
-
txHashVerifier
protected org.web3j.utils.TxHashVerifier txHashVerifier
-
-
Constructor Detail
-
PersonalTransactionManager
public PersonalTransactionManager(org.web3j.protocol.Web3j web3j, org.web3j.crypto.Credentials credentials, String password, int attempts, long sleepDuration)
-
PersonalTransactionManager
public PersonalTransactionManager(org.web3j.protocol.admin.Admin web3j, org.web3j.crypto.Credentials credentials, String password)
-
-
Method Detail
-
setNonceRecalculation
public PersonalTransactionManager setNonceRecalculation(Boolean activate)
-
setNonceBuilder
public void setNonceBuilder(NonceBuilder nonceBuilder)
-
getEstimatedGas
protected BigInteger getEstimatedGas(String to, String data) throws IOException
- Throws:
IOException
-
getNonce
public BigInteger getNonce() throws IOException
- Throws:
IOException
-
sendTransaction
public org.web3j.protocol.core.methods.response.EthSendTransaction sendTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value) throws IOException
- Overrides:
sendTransaction
in classorg.web3j.tx.TransactionManager
- Throws:
IOException
-
sendTransaction
public org.web3j.protocol.core.methods.response.EthSendTransaction sendTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, BigInteger value, boolean constructor) throws IOException
- Specified by:
sendTransaction
in classorg.web3j.tx.TransactionManager
- Throws:
IOException
-
sendCall
public String sendCall(String to, String data, org.web3j.protocol.core.DefaultBlockParameter defaultBlockParameter) throws IOException
- Specified by:
sendCall
in classorg.web3j.tx.TransactionManager
- Throws:
IOException
-
getCode
public org.web3j.protocol.core.methods.response.EthGetCode getCode(String contractAddress, org.web3j.protocol.core.DefaultBlockParameter defaultBlockParameter) throws IOException
- Specified by:
getCode
in classorg.web3j.tx.TransactionManager
- Throws:
IOException
-
sign
public String sign(org.web3j.crypto.RawTransaction rawTransaction)
-
signAndSend
public org.web3j.protocol.core.methods.response.EthSendTransaction signAndSend(org.web3j.crypto.RawTransaction rawTransaction) throws IOException
- Throws:
IOException
-
assertCallNotReverted
static void assertCallNotReverted(org.web3j.protocol.core.methods.response.EthCall ethCall)
-
-