Class TransactionStorage
java.lang.Object
io.meeds.wallet.storage.TransactionStorage
- Direct Known Subclasses:
CachedTransactionStorage
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionStorage(org.exoplatform.services.listener.ListenerService listenerService, WalletTransactionDAO walletTransactionDAO) -
Method Summary
Modifier and TypeMethodDescriptionlongcountContractPendingTransactionsSent(long networkId) longcountContractPendingTransactionsToSend(long networkId) longcountEtherTransfersFromAddressForIssuer(long networkId, long issuerIdentityId, String fromAddress) longcountPendingTransactionAsSender(long networkId, String fromAddress) longcountPendingTransactionSent(long networkId, String fromAddress) longcountPendingTransactionsWithSameNonce(long networkId, String transactionHash, String fromAddress, long nonce) Count the number of transactions for a given address that corresponds to a given nonce and that are always marked as pendingdoublecountReceivedContractAmount(String contractAddress, String address, ZonedDateTime startDate, ZonedDateTime endDate) doublecountSentContractAmount(String contractAddress, String address, ZonedDateTime startDate, ZonedDateTime endDate) longList<io.meeds.wallet.model.TransactionDetail> getContractTransactions(String contractAddress, String contractMethodName, int limit) longgetMaxUsedNonce(long networkId, String fromAddress) List<io.meeds.wallet.model.TransactionDetail> getPendingEtherTransactions(String address, long networkId) io.meeds.wallet.model.TransactionDetailRetrieve aTransactionDetailidentified by its blockchain hashList<io.meeds.wallet.model.TransactionDetail> getPendingTransactionsWithSameNonce(long networkId, String transactionHash, String fromAddress, long nonce) Return list of transactions for a given address that corresponds to a nonceList<io.meeds.wallet.model.TransactionDetail> getPendingWalletTransactionsNotSent(String address, long networkId) List<io.meeds.wallet.model.TransactionDetail> getPendingWalletTransactionsSent(String address, long networkId) io.meeds.wallet.model.TransactionDetailgetTransactionByHash(String hash) Retrieve aTransactionDetailidentified by its blockchain hashList<io.meeds.wallet.model.TransactionDetail> getTransactions(long networkId, int limit) List<io.meeds.wallet.model.TransactionDetail> getTransactionsToSend(long networkId) List<io.meeds.wallet.model.TransactionDetail> getWalletTransactions(long networkId, String address, String contractAddress, String contractMethodName, String hash, int limit, boolean pending, boolean administration) voidsaveTransactionDetail(io.meeds.wallet.model.TransactionDetail transactionDetail) Saves a decoded transaction detail in internal database
-
Constructor Details
-
TransactionStorage
public TransactionStorage(org.exoplatform.services.listener.ListenerService listenerService, WalletTransactionDAO walletTransactionDAO)
-
-
Method Details
-
getPendingEtherTransactions
-
getPendingWalletTransactionsNotSent
-
getPendingWalletTransactionsSent
-
countContractPendingTransactionsSent
public long countContractPendingTransactionsSent(long networkId) -
countContractPendingTransactionsToSend
public long countContractPendingTransactionsToSend(long networkId) -
getTransactionsToSend
-
getMaxUsedNonce
- Parameters:
networkId- blockchain network idfromAddress- wallet address- Returns:
- the max used nonce from stored transactions in internal database
-
getContractTransactions
public List<io.meeds.wallet.model.TransactionDetail> getContractTransactions(String contractAddress, String contractMethodName, int limit) - Parameters:
contractAddress- filter transactions by a contract addresscontractMethodName- filter transactions by a contract methodlimit- size limit of transactions to retrieve- Returns:
ListofTransactionDetailwith corresponding filter entries
-
getTransactions
-
getWalletTransactions
public List<io.meeds.wallet.model.TransactionDetail> getWalletTransactions(long networkId, String address, String contractAddress, String contractMethodName, String hash, int limit, boolean pending, boolean administration) - Parameters:
networkId- blockchain network idaddress- wallet addresscontractAddress- filter transactions by a contract addresscontractMethodName- filter transactions by a contract methodhash- retrieve include in the list of transactions this hash even if the limit is reachedlimit- size limit of transactions to retrievepending- whether include pending or notadministration- whether include administration transactions or not- Returns:
ListofTransactionDetailwith corresponding filter entries
-
saveTransactionDetail
public void saveTransactionDetail(io.meeds.wallet.model.TransactionDetail transactionDetail) Saves a decoded transaction detail in internal database- Parameters:
transactionDetail- decoded transaction detail
-
getPendingTransactionsWithSameNonce
public List<io.meeds.wallet.model.TransactionDetail> getPendingTransactionsWithSameNonce(long networkId, String transactionHash, String fromAddress, long nonce) Return list of transactions for a given address that corresponds to a nonce- Parameters:
networkId- blockchain network idtransactionHash- Transaction hash that will replace othersfromAddress- transaction sender addressnonce- Nonce of the transaction- Returns:
ListofTransactionDetail
-
countPendingTransactionsWithSameNonce
public long countPendingTransactionsWithSameNonce(long networkId, String transactionHash, String fromAddress, long nonce) Count the number of transactions for a given address that corresponds to a given nonce and that are always marked as pending- Parameters:
networkId- blockchain network idtransactionHash- Transaction hash to exclude from countfromAddress- transaction sender addressnonce- Nonce of the transaction- Returns:
ListofTransactionDetail
-
getTransactionByHash
Retrieve aTransactionDetailidentified by its blockchain hash- Parameters:
hash- blockchain transaction hash- Returns:
TransactionDetail
-
getPendingTransactionByHash
Retrieve aTransactionDetailidentified by its blockchain hash- Parameters:
hash- blockchain transaction hash- Returns:
TransactionDetail
-
countPendingTransactionSent
- Parameters:
networkId- blockchain network idfromAddress- transaction sender address- Returns:
- count of pending transactions sent on a blockchain network for a specified user
-
countEtherTransfersFromAddressForIssuer
public long countEtherTransfersFromAddressForIssuer(long networkId, long issuerIdentityId, String fromAddress) - Parameters:
networkId- blockchain network idissuerIdentityId- identity id of the user the transactions were issued forfromAddress- transaction sender address- Returns:
- count of non dropped ether transfers on the given network, sent from the given address, issued for the given identity, to an address that no wallet of another identity holds
-
countPendingTransactionAsSender
- Parameters:
networkId- blockchain network idfromAddress- transaction sender address- Returns:
- count of pending transactions of a sender
-
countReceivedContractAmount
public double countReceivedContractAmount(String contractAddress, String address, ZonedDateTime startDate, ZonedDateTime endDate) - Parameters:
contractAddress- blockchain contract addressaddress- wallet addressstartDate- start date of selected periodendDate- end date of selected period- Returns:
- sum of token amounts received during selected period
-
countSentContractAmount
public double countSentContractAmount(String contractAddress, String address, ZonedDateTime startDate, ZonedDateTime endDate) - Parameters:
contractAddress- blockchain contract addressaddress- wallet addressstartDate- start date of selected periodendDate- end date of selected period- Returns:
- sum of token amounts sent during selected period
-
countTransactions
public long countTransactions()
-