Package io.meeds.wallet.service
Interface BlockchainTransactionService
public interface BlockchainTransactionService
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddTransactionToRefreshFromBlockchain(TransactionDetail transactionDetail) AddTransactionDetailto refresh processingQueuedoubleGet gas price from blockchainlongbooleanhasManagedWalletInTransaction(ContractTransactionEvent contractEvent) Checks whether the Contract Transaction Topics contains a managed walletrefreshTransactionFromBlockchain(String transactionHash) This will refresh transaction from blockchain.voidsaveLastWatchedBlockNumber(long lastWatchedBlockNumber) Saves last watched block numberSends raw transactions to blockchainRenew subscription to listen to new transactions from BlockchainvoidStop subscription to listen on Blockchain
-
Method Details
-
sendPendingTransactionsToBlockchain
List<TransactionDetail> sendPendingTransactionsToBlockchain()Sends raw transactions to blockchain- Returns:
ListofTransactionDetailasynchronously after sent to blockchain
-
refreshTransactionFromBlockchain
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
Get gas price from blockchain- Returns:
- last gas price retrieved from blockchain
- Throws:
IOException- when an error occurs while requesting gas price from blockchain
-
addTransactionToRefreshFromBlockchain
AddTransactionDetailto refresh processingQueue- Parameters:
transactionDetail-TransactionDetailto refresh from blockchain
-
hasManagedWalletInTransaction
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-
-