public class EthereumClientConnector extends Object implements org.exoplatform.wallet.statistic.ExoWalletStatisticService, org.picocontainer.Startable
| Constructor and Description |
|---|
EthereumClientConnector() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getContractTransactions(String contractsAddress,
long fromBlock,
long toBlock)
Retrieve from blockchain transaction hashes from contract starting from a
block number to a block number
|
BigInteger |
getGasPrice() |
long |
getLastestBlockNumber() |
BigInteger |
getNonce(String walletAddress,
org.web3j.protocol.core.DefaultBlockParameterName blockParameterName)
Retruns nonce corresponding for a given wallet address:
* if using
DefaultBlockParameterName.LATEST, this will return last mined transaction nonce
* if using DefaultBlockParameterName.PENDING, this will return last pending transaction nonce that can be used to compute next pending transaction nonce |
long |
getPoolingInterval() |
Map<String,Object> |
getStatisticParameters(String statisticType,
Object result,
Object... methodArgs) |
org.web3j.protocol.core.methods.response.Transaction |
getTransaction(String transactionHash)
Get transaction by hash
|
org.web3j.protocol.core.methods.response.TransactionReceipt |
getTransactionReceipt(String transactionHash)
Get transaction receipt by hash
|
org.web3j.protocol.Web3j |
getWeb3j() |
boolean |
isListeningToBlockchain() |
boolean |
isPermanentlyScanBlockchain() |
void |
renewBlockSubscription(long lastWatchedBlockNumber) |
CompletableFuture<org.web3j.protocol.core.methods.response.EthSendTransaction> |
sendTransactionToBlockchain(org.exoplatform.wallet.model.transaction.TransactionDetail transactionDetail)
Send raw transaction specified in Transaction detail
|
void |
setPoolingInterval(long poolingInterval) |
void |
start() |
void |
start(boolean blocking) |
void |
startListeningBlockchain() |
void |
stop() |
void |
stopListeningToBlockchain() |
public void start()
start in interface org.picocontainer.Startablepublic void start(boolean blocking)
public void stop()
stop in interface org.picocontainer.Startablepublic void startListeningBlockchain()
public void stopListeningToBlockchain()
public boolean isPermanentlyScanBlockchain()
public boolean isListeningToBlockchain()
public org.web3j.protocol.core.methods.response.Transaction getTransaction(String transactionHash)
transactionHash - transaction hash to retrievepublic org.web3j.protocol.core.methods.response.TransactionReceipt getTransactionReceipt(String transactionHash)
transactionHash - transaction hash to retrievepublic long getLastestBlockNumber()
throws IOException
IOException - when error sending transaction on blockchainpublic Set<String> getContractTransactions(String contractsAddress, long fromBlock, long toBlock) throws IOException
contractsAddress - blockchain contract addressfromBlock - search starting from this block numbertoBlock - search until this block numberSet of transaction hashesIOException - if an error happens while getting information from
blockchainpublic CompletableFuture<org.web3j.protocol.core.methods.response.EthSendTransaction> sendTransactionToBlockchain(org.exoplatform.wallet.model.transaction.TransactionDetail transactionDetail) throws IOException
transactionDetail - TransactionDetail having rawTransaction to
send to blockchainCompletableFuture for transaction sent asynchronously to
blockchainIOException - if an error occurs while sending transaction to
blockchainpublic BigInteger getNonce(String walletAddress, org.web3j.protocol.core.DefaultBlockParameterName blockParameterName) throws IOException
DefaultBlockParameterName.LATEST, this will return last mined transaction nonce
* if using DefaultBlockParameterName.PENDING, this will return last pending transaction nonce that can be used to compute next pending transaction noncewalletAddress - wallet adres to determine its next nonceblockParameterName - DefaultBlockParameterName valueIOException - if an I/O problem happens when connecting to blockchainpublic BigInteger getGasPrice() throws IOException
IOException - if an error occurs while sending transaction to
blockchainpublic org.web3j.protocol.Web3j getWeb3j()
public Map<String,Object> getStatisticParameters(String statisticType, Object result, Object... methodArgs)
getStatisticParameters in interface org.exoplatform.wallet.statistic.ExoWalletStatisticServicepublic void renewBlockSubscription(long lastWatchedBlockNumber)
throws IOException
IOExceptionpublic void setPoolingInterval(long poolingInterval)
public long getPoolingInterval()
Copyright © 2003–2021 eXo Platform SAS. All rights reserved.