5.0.0 • Published 6 months ago
explorer_api_js v5.0.0
ParallelChain Mainnet Explorer API JavaScript Client Library (explorer-api-js).
This crate is a library that wraps networked interactions with ParallelChain Mainnet Explorer APIs.
Usage Example
let client = new ExplorerAPI("http://service.parallelchain.io");
Methods
ExplorerAPI
implements methods which query blockchain information by sending HTTP request to the Explorer API endpoint.
Summary of methods provided by ExplorerAPI
:
Method | Description |
---|---|
getBalance | get the balance from an account |
getNonce | get the nonce from an account |
getLatestBlock | get the latest block |
getBlockByBlockNumber | get the block by block number |
getBlockByBlockHash | get the block by block hash |
getCBIVersion | get Contract Binary Interface (CBI) Version of the contract |
getCode | get contract code from an account |
getStorageState | get the value of storage state from the corresponding key |
getStorageStateTuples | get list of tuples of storage state from the corresponding keys |
submit | submit transaction to the node |
view | submit a view call to the node to execute contract view method |
getValidatorSets | get the previous validator sets (previous, current and next) |
getNextValidatorSet | get the next validator sets |
getCurrentValidatorSet | get the current validator sets |
getPreviousValidatorSet | get the previous validator sets |
getDeposits | get deposits from pairs of operator and owner |
getPools | get pools from operator's address |
getTentativeStakes | get tentative stakes from pairs of operator and owner |
getDelegatedStakes | get the owner's stake that is delegated to the operator in validator set |
getCurrentEpoch | get current epoch number |
getBlockSummariesBy | get a maximum Limit number of block summaries filtered by Identifier, in and order specified by Order |
getBlockHeadersBy | get a maximum Limit number of block headers filtered by Identifier, in and order specified by Order |
getBlocksBy | get a maximum Limit number of blocks filtered by Identifier, in and order specified by Order |
getTxsSummariesByPageIdx | get transaction summaries by page ID |
getTxsBy | get a maximum Limit number of transactions filtered by a combination of Identifier and Filter(s), in format specified by Parts and order specified by Order |
getAccountBy | Query account's fields - speculative nonce and pending transactions |
getMetricsGasPerBlock | get metrics - Gas Per Block |
getMetricsBlockTime | get metrics - Average block time |
getMetricsAverageTPS | get metrics - Average Transaction Per Second |
getMetricsIssuanceReward | get metrics - calculation of Issuance Reward |
getMetricsNetworkBaseFee | get the network base fee calculated from latest committed block |
getMetricsMinimumGas | get the minimum gas required for a transaction to pass through |
getMetrics | get metrics |
getContractsBy | get contract descriptors from Explorer Backend |
getLockupContract | get an instance for interfacing with Lockup Contract |