ADD: /thorchain/block/:height API with decoded block and results
Nine Realms put up a convenience API awhile ago as an example that decodes block transactions, to illustrate the data contained in the block: https://api.ninerealms.com/thorchain/block/txs/12000002. Explorers have asked to use this so they do not have to deal with protobuf themselves, but we do not want any ecosystem components dependent on something proprietary - we should add an endpoint with a super set of this data that should allow anyone to fetch the entire decoded data for the block:
{
"height": ..., # from block_results
"hash": ..., # from block
"header": ..., # from block
"begin_block_events": ..., # from block_results
"end_block_events": ..., # from block_results
"txs": ..., # from block - except we decode and send the JSON
"txs_results": ..., # from block_results
}
Internally this just makes an RPC for the block
and block_result
and formats the response in a convenient way to ingest.
EDIT: This was modified slightly to just embed the result in the tx
and pass the id
struct instead of height
/hash
independently.
Edited by Ursa (9R)