Package org.exoplatform.wallet.service
Interface BlockchainTransactionService
-
public interface BlockchainTransactionService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddTransactionToRefreshFromBlockchain(TransactionDetail transactionDetail)AddTransactionDetailto refresh processingQueuedoublegetGasPrice()Get gas price from blockchainlonggetLastWatchedBlockNumber()booleanhasManagedWalletInTransaction(ContractTransactionEvent contractEvent)Checks whether the Contract Transaction Topics contains a managed walletTransactionDetailrefreshTransactionFromBlockchain(String transactionHash)This will refresh transaction from blockchain.voidsaveLastWatchedBlockNumber(long lastWatchedBlockNumber)Saves last watched block numberList<TransactionDetail>sendPendingTransactionsToBlockchain()Sends raw transactions to blockchainFuturestartWatchingBlockchain()Renew subscription to listen to new transactions from BlockchainvoidstopWatchingBlockchain()Stop subscription to listen on Blockchain
-
-
-
Method Detail
-
sendPendingTransactionsToBlockchain
List<TransactionDetail> sendPendingTransactionsToBlockchain()
Sends raw transactions to blockchain- Returns:
ListofTransactionDetailasynchronously after sent to blockchain
-
refreshTransactionFromBlockchain
TransactionDetail refreshTransactionFromBlockchain(String transactionHash)
This will refresh transaction from blockchain. If the transaction detail exists in database, it will update its status, else it will create a new one with data found on Blockchain mined Transaction- Parameters:
transactionHash- hash of transaction to update- Returns:
- refreshed
TransactionDetailfrom blockchain
-
getGasPrice
double getGasPrice() throws IOExceptionGet gas price from blockchain- Returns:
- last gas price retrieved from blockchain
- Throws:
IOException- when an error occurs while requesting gas price from blockchain
-
addTransactionToRefreshFromBlockchain
void addTransactionToRefreshFromBlockchain(TransactionDetail transactionDetail)
AddTransactionDetailto refresh processingQueue- Parameters:
transactionDetail-TransactionDetailto refresh from blockchain
-
hasManagedWalletInTransaction
boolean hasManagedWalletInTransaction(ContractTransactionEvent contractEvent)
Checks whether the Contract Transaction Topics contains a managed wallet- Parameters:
contractEvent- Contract Event Log- Returns:
- true if a wallet is found in topics list
-
startWatchingBlockchain
Future startWatchingBlockchain()
Renew subscription to listen to new transactions from Blockchain- Returns:
Futureof async watching operation
-
stopWatchingBlockchain
void stopWatchingBlockchain()
Stop subscription to listen on Blockchain
-
getLastWatchedBlockNumber
long getLastWatchedBlockNumber()
- Returns:
- last watched block number
-
saveLastWatchedBlockNumber
void saveLastWatchedBlockNumber(long lastWatchedBlockNumber)
Saves last watched block number- Parameters:
lastWatchedBlockNumber-
-
-