public interface QueryClient
extends java.io.Closeable
Modifier and Type | Method and Description |
---|---|
void |
close() |
AccountState |
getAccountState(Account account)
Get account state by address.
|
AccountState |
getAccountState(AccountAddress accountAddress)
Get account state by account.
|
BlockHash |
getBestBlockHash()
Get best block hash.
|
long |
getBestBlockHeight()
Get best block height.
|
Block |
getBlock(BlockHash blockHash)
Get block by hash.
|
Block |
getBlock(long height)
Get block by height.
|
BlockchainStatus |
getBlockchainStatus()
Get blockchain status.
|
BlockMetadata |
getBlockMetadata(BlockHash blockHash)
Get block metadata by hash.
|
BlockMetadata |
getBlockMetadata(long height)
Get block metadata by height.
|
ChainIdHash |
getChainIdHash()
Get chain id hash.
|
ChainInfo |
getChainInfo()
Get chain info of current node.
|
ChainStats |
getChainStats()
Get chain stats of current node.
|
ContractInterface |
getContractInterface(ContractAddress contractAddress)
Get smart contract interface corresponding to contract address.
|
AccountAddress |
getNameOwner(java.lang.String name)
Get owner of an account name.
|
AccountAddress |
getNameOwner(java.lang.String name,
long blockNumber)
Get owner of an account name at block number
blockNumber . |
NodeStatus |
getNodeStatus()
Get status of current node.
|
ContractTxReceipt |
getReceipt(ContractTxHash contractTxHash)
Get receipt of transaction.
|
ServerInfo |
getServerInfo(java.util.List<java.lang.String> categories)
Get server info of current node.
|
StakeInfo |
getStakingInfo(Account account)
Get staking information of
account . |
StakeInfo |
getStakingInfo(AccountAddress accountAddress)
Get staking information of
accountAddress . |
Transaction |
getTransaction(TxHash txHash)
Get transaction.
|
AccountTotalVote |
getVotesOf(Account account)
Get votes which
account votes for. |
AccountTotalVote |
getVotesOf(AccountAddress accountAddress)
Get votes which
accountAddress votes for. |
java.util.List<BlockMetadata> |
listBlockMetadatas(BlockHash blockHash,
int size)
Get block metadatas of
size backward starting from block for provided hash. |
java.util.List<BlockMetadata> |
listBlockMetadatas(long height,
int size)
Get block metadatas of
size backward starting from block for provided height. |
java.util.List<ElectedCandidate> |
listElected(java.lang.String voteId,
int showCount)
Get elected candidates per
voteId for current round. |
java.util.List<ElectedCandidate> |
listElectedBps(int showCount)
Get elected block producers for current round.
|
java.util.List<Event> |
listEvents(EventFilter filter)
List events corresponding with event filter.
|
java.util.List<Peer> |
listNodePeers()
Get blockchain peer addresses.
|
java.util.List<PeerMetric> |
listPeerMetrics()
Get metrics of peers.
|
java.util.List<AccountAddress> |
listServerKeyStoreAccounts()
Get account list on a server key store.
|
ContractResult |
query(ContractInvocation contractInvocation)
Query the smart contract state by calling smart contract function.
|
Subscription<Event> |
subscribeEvent(EventFilter filter,
StreamObserver<Event> observer)
Subscribe event corresponding with event filter.
|
Subscription<Block> |
subscribeNewBlock(StreamObserver<Block> observer)
Subscribe block stream which is triggered everytime new block is generated.
|
Subscription<BlockMetadata> |
subscribeNewBlockMetadata(StreamObserver<BlockMetadata> observer)
Subscribe block metadata stream which is triggered everytime new block is generated.
|
AccountState getAccountState(Account account)
account
- an accountAccountState getAccountState(AccountAddress accountAddress)
accountAddress
- account addressAccountAddress getNameOwner(java.lang.String name)
name
- an name of accountAccountAddress getNameOwner(java.lang.String name, long blockNumber)
blockNumber
.name
- an name of accountblockNumber
- a block numberStakeInfo getStakingInfo(Account account)
account
.account
- an account to check staking informationStakeInfo getStakingInfo(AccountAddress accountAddress)
accountAddress
.accountAddress
- an account address to check staking informationjava.util.List<ElectedCandidate> listElectedBps(int showCount)
showCount
- a show countjava.util.List<ElectedCandidate> listElected(java.lang.String voteId, int showCount)
voteId
for current round.voteId
- a vote idshowCount
- a show countAccountTotalVote getVotesOf(Account account)
account
votes for.account
- an accountAccountTotalVote getVotesOf(AccountAddress accountAddress)
accountAddress
votes for.accountAddress
- an account addressjava.util.List<AccountAddress> listServerKeyStoreAccounts()
BlockHash getBestBlockHash()
long getBestBlockHeight()
ChainIdHash getChainIdHash()
BlockchainStatus getBlockchainStatus()
ChainInfo getChainInfo()
ChainStats getChainStats()
java.util.List<Peer> listNodePeers()
java.util.List<PeerMetric> listPeerMetrics()
ServerInfo getServerInfo(java.util.List<java.lang.String> categories)
categories
- a categoriesNodeStatus getNodeStatus()
BlockMetadata getBlockMetadata(BlockHash blockHash)
blockHash
- block hashBlockMetadata getBlockMetadata(long height)
height
- block's heightjava.util.List<BlockMetadata> listBlockMetadatas(BlockHash blockHash, int size)
size
backward starting from block for provided hash.blockHash
- block hashsize
- block list size whose upper bound is 1000java.util.List<BlockMetadata> listBlockMetadatas(long height, int size)
size
backward starting from block for provided height.height
- block's heightsize
- block list size whose upper bound is 1000Block getBlock(BlockHash blockHash)
blockHash
- block hashBlock getBlock(long height)
height
- block's heightSubscription<BlockMetadata> subscribeNewBlockMetadata(StreamObserver<BlockMetadata> observer)
observer
- a stream observer which is invoked on new block metadataSubscription<Block> subscribeNewBlock(StreamObserver<Block> observer)
observer
- a stream observer which is invoked on new blockTransaction getTransaction(TxHash txHash)
txHash
- transaction's hashContractTxReceipt getReceipt(ContractTxHash contractTxHash)
contractTxHash
- contract transaction hashContractInterface getContractInterface(ContractAddress contractAddress)
contractAddress
- contract addressContractResult query(ContractInvocation contractInvocation)
contractInvocation
- a contract invocationjava.util.List<Event> listEvents(EventFilter filter)
filter
- an event filterSubscription<Event> subscribeEvent(EventFilter filter, StreamObserver<Event> observer)
filter
- an event filterobserver
- a stream observer which is invoked on eventvoid close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable