Espresso Systems Logo

explorer API 0.0.1 Reference

HotShot chain state


The explorer API provides data from the storage layer node as-is without attempting to fill in the missing pieces. In this way it acts as a snapshot of the current state, and isn’t concerned about having data missing from the overall picture. Instead, it is more concerned with being able to retrieve data from the stored state as quickly as possible, and with a relatively simple path structure that is beneficial for caching solutions.

This API is entirely a REST API utilizing only the GET verb. The responses returned from this API adhere to the application/json MIME type. All JSON responses have the potential to return an error in the event that an error occurs. In the case of any error, the HTTP Status Code should reflect an non ok status. In addition the object returned will contain details about the error in question. As such, the object structure itself should be enough to determine whether the response was a success or an error.

All Errors returned by this API should take on the following form:

{
    "error": Error

Where the Error type has, at a minimum, the following fields:

{
    "code": string,
    "message": string

Any error returned SHOULD contain these fields at a minimum, and may included some addition fields for direct reference. Each Error type MUST be uniquely identifiable based on the code field alone. The message is included for convenience to explain the error so that the user does not need to look it up.

GET get_block_detail

Routes

/explorer/block/:height

/explorer/block/hash/:hash

Parameters

hashTaggedBase64
heightInteger

Description

Get details concerning the block based on it’s position in the block chain. The position is derived either from the given height or a hash that should uniquely identify the desired block.

Returns

{
    "block_detail": BlockDetail
}

GET get_block_summaries

Routes

/explorer/blocks/latest/:limit

/explorer/blocks/:from/:limit

Parameters

fromInteger
limitInteger

Description

Retrieve up to the desired limit of Block Summaries. This endpoint will target the Block identified by either :from or latest, and should return up to the previous :limit of Block Summaries.

Returns

{
    "block_summaries": BlockSummary[]
}

GET get_transaction_summaries

Routes

/explorer/transactions/latest/:limit

/explorer/transactions/from/:height/:offset/:limit

/explorer/transactions/hash/:hash/:limit

/explorer/transactions/latest/:limit/block/:block

/explorer/transactions/from/:height/:offset/:limit/block/:block

/explorer/transactions/hash/:hash/:limit/block/:block

/explorer/transactions/latest/:limit/namespace/:namespace

/explorer/transactions/from/:height/:offset/:limit/namespace/:namespace

/explorer/transactions/hash/:hash/:limit/namespace/:namespace

Parameters

limitInteger
heightInteger
offsetInteger
namespaceInteger
hashTaggedBase64
blockInteger

Description

Retrieve up to the desired limit of Transaction Summaries. This endpoint will target the Transaction that is identified by latest, the :height and :offset, or the :hash. It should return up to the previous :limit of Transaction Summaries. The term latest SHOULD refer to the last Transaction within the highest Block.

Returns

{
    "transaction_summaries": <TransactionSummary>[]
}

GET get_search_result

Routes

/explorer/search/:query

Parameters

queryTaggedBase64

Description

Retrieve search results for blocks or transactions that can be identified in some what by the given string ":query". At the moment the only field this matches against is the hash of the Block or Transaction.

Returns

{
    "search_result": SearchResult
}

GET get_explorer_summary

Routes

/explorer/explorer-summary

Parameters

None

Description

Returns

{
    "explorer_summary": ExplorerSummary
}

GET get_transaction_detail

Routes

/explorer/transaction/:height/:offset

/explorer/transaction/hash/:hash

Parameters

hashTaggedBase64
heightInteger
offsetInteger

Description

Get the details concerning the individual transaction that is identified by the request. The transaction SHOULD be uniquely identified by the given height, and offset or by the given hash.

Returns

{
    "transaction_detail": TransactionDetail
}

 

Copyright © 2022 Espresso Systems. All rights reserved.