Package org.starcoin.api
Class TransactionRPCClient
- java.lang.Object
-
- org.starcoin.api.TransactionRPCClient
-
public class TransactionRPCClient extends Object
Starcoin Transaction 相关json-rpc接口的封装。- Since:
- 1.1.6
- Author:
- fanngyuan
-
-
Constructor Summary
Constructors Constructor Description TransactionRPCClient(URL baseUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Transaction>getBlockTransactions(String blockHash)通过 block hash 获取所有 TransactionList<Event>getEvents(Long fromBlock, Long toBlock, List<String> eventKeys, List<String> accountAddress, List<String> typeTags, Integer limit)PendingTransactiongetPendingTransaction(String hash)通过 transaction hash 获取某个 PendingTransactionTransactiongetTransactionByHash(String hash)通过 transaction hash 获取某个 TransactionList<Event>getTransactionEvents(String transactionHash)通过 transaction hash 获取某个 Transaction 的所有 EventTransactiongetTransactionInfoByBlockAndIndex(String blockHash, int transactionIndex)通过 block hash 和 transaction index 获取某个 TransactionInfoTransactiongetTransactionInfoByHash(String hash)通过 transaction hash 获取某个 TransactionInfoList<Transaction>getTransactionInfos(long startGlobalIndex, boolean reverse, int count)通过 transaction hash 获取某个 TransactionInfoTransactionInfoWithProofgetTransactionProof(String blockHash, long transactionGlobalIndex)获取block和transaction证明的相关信息TransactionInfoWithProofgetTransactionProof(String blockHash, long transactionGlobalIndex, int eventIndex)获取block和transaction证明的相关信息TransactionInfoWithProofgetTransactionProof(String blockHash, long transactionGlobalIndex, int eventIndex, String accessPath)获取block和transaction证明的相关信息
-
-
-
Constructor Detail
-
TransactionRPCClient
public TransactionRPCClient(URL baseUrl)
-
-
Method Detail
-
getPendingTransaction
public PendingTransaction getPendingTransaction(String hash) throws JSONRPC2SessionException
通过 transaction hash 获取某个 PendingTransaction- Throws:
JSONRPC2SessionException
-
getTransactionByHash
public Transaction getTransactionByHash(String hash) throws JSONRPC2SessionException
通过 transaction hash 获取某个 Transaction- Throws:
JSONRPC2SessionException
-
getTransactionInfoByHash
public Transaction getTransactionInfoByHash(String hash) throws JSONRPC2SessionException
通过 transaction hash 获取某个 TransactionInfo- Throws:
JSONRPC2SessionException
-
getTransactionInfos
public List<Transaction> getTransactionInfos(long startGlobalIndex, boolean reverse, int count) throws JSONRPC2SessionException
通过 transaction hash 获取某个 TransactionInfo- Throws:
JSONRPC2SessionException
-
getBlockTransactions
public List<Transaction> getBlockTransactions(String blockHash) throws JSONRPC2SessionException
通过 block hash 获取所有 Transaction- Throws:
JSONRPC2SessionException
-
getTransactionEvents
public List<Event> getTransactionEvents(String transactionHash) throws JSONRPC2SessionException
通过 transaction hash 获取某个 Transaction 的所有 Event- Throws:
JSONRPC2SessionException
-
getEvents
public List<Event> getEvents(Long fromBlock, Long toBlock, List<String> eventKeys, List<String> accountAddress, List<String> typeTags, Integer limit) throws JSONRPC2SessionException
- Throws:
JSONRPC2SessionException
-
getTransactionInfoByBlockAndIndex
public Transaction getTransactionInfoByBlockAndIndex(String blockHash, int transactionIndex) throws JSONRPC2SessionException
通过 block hash 和 transaction index 获取某个 TransactionInfo- Parameters:
blockHash-transactionIndex-- Returns:
- Throws:
JSONRPC2SessionException
-
getTransactionProof
public TransactionInfoWithProof getTransactionProof(String blockHash, long transactionGlobalIndex) throws JSONRPC2SessionException
获取block和transaction证明的相关信息- Parameters:
blockHash-transactionGlobalIndex-- Returns:
- Throws:
JSONRPC2SessionException
-
getTransactionProof
public TransactionInfoWithProof getTransactionProof(String blockHash, long transactionGlobalIndex, int eventIndex) throws JSONRPC2SessionException
获取block和transaction证明的相关信息- Parameters:
blockHash-transactionGlobalIndex-eventIndex-- Returns:
- Throws:
JSONRPC2SessionException
-
getTransactionProof
public TransactionInfoWithProof getTransactionProof(String blockHash, long transactionGlobalIndex, int eventIndex, String accessPath) throws JSONRPC2SessionException
获取block和transaction证明的相关信息- Parameters:
blockHash-transactionGlobalIndex-eventIndex-accessPath-- Returns:
- Throws:
JSONRPC2SessionException
-
-