Events
Events endpoints are used to retrieve a sequence of events about changes to indexer storage. Lightweight clients can follow events instead of implementing their own logic to handle complex blockchain processing scenarios.
/events/blocks
[INDEXER] Get a range of BlockEvents
/events/blocks
allows the caller to query a sequence of BlockEvents indicating which blocks were added and removed from storage to reach the current state. Following BlockEvents allows lightweight clients to update their state without needing to implement their own syncing logic (like finding the common parent in a reorg). /events/blocks
is considered an "indexer" endpoint and Rosetta implementations are not required to complete it to adhere to the Rosetta spec. However, any Rosetta "indexer" MUST support this endpoint.
Request
{
"network_identifier": {
"blockchain": "bitcoin",
"network": "mainnet",
"sub_network_identifier": {
"network": "shard 1",
"metadata": {
"producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
}
}
},
"offset": 5,
"limit": 5
}
Response
200 - OK
{
"max_sequence": 5,
"events": [
{
"sequence": 5,
"block_identifier": {
"index": 1123941,
"hash": "0x1f2cc6c5027d2f201a5453ad1119574d2aed23a392654742ac3c78783c071f85"
},
"type": "block_added"
}
]
}
500 - Error
{
"code": 12,
"message": "Invalid account format",
"description": "This error is returned when the requested AccountIdentifier is improperly formatted.",
"retriable": true,
"details": {
"address": "0x1dcc4de8dec75d7aab85b567b6",
"error": "not base64"
}
}