Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

block_results - Cronos

Example code for the block_results JSON-RPC method. Complete guide on how to use block_results JSON-RPC in GetBlock Web3 documentation.

Returns the execution results for every transaction in a block — ABCI codes, gas, and emitted events — along with block-level events and any validator or consensus parameter updates. This is the primary surface for event-driven indexers reading what actually happened in a block.

Parameters

Parameter
Type
Required
Description

height

string

Optional

Block height as a string; omit for the latest block

Request

curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "method": "block_results",
    "params": {
        "height": "12345678"
    }
}'
example.js
const axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    id: 'getblock.io',
    method: 'block_results',
    params: {
        "height": "12345678"
    }
}, { headers: { 'Content-Type': 'application/json' } });

console.log(response.data.result);

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "height": "12345678",
        "txs_results": [
            {
                "code": 0,
                "data": "EisKKS9jb3Ntb3MuYmFuay52MWJldGExLk1zZ1NlbmRSZXNwb25zZQ==",
                "log": "",
                "gas_wanted": "200000",
                "gas_used": "118000",
                "events": [
                    {
                        "type": "transfer",
                        "attributes": [
                            {
                                "key": "recipient",
                                "value": "crc1p9zq0lr6h6n5s2wk9m3v7t4x8c6b2d0f1g3h5j"
                            },
                            {
                                "key": "amount",
                                "value": "100000basecro"
                            }
                        ]
                    }
                ]
            }
        ],
        "finalize_block_events": [],
        "validator_updates": [],
        "consensus_param_updates": {
            "block": {
                "max_bytes": "22020096",
                "max_gas": "-1"
            }
        }
    }
}

Response Fields

Field
Type
Description

height

string

Block height the results belong to

txs_results

array

Per-transaction ABCI execution results, in block order

txs_results[].code

integer

ABCI code: 0 on success, non-zero on failure

txs_results[].gas_used

string

Gas actually consumed by the transaction

txs_results[].events

array

Events emitted by the transaction — the event-sourcing surface

finalize_block_events

array

Events emitted by the block's begin/end app phases

validator_updates

array

Validator set changes applied at this block

Use Cases

  • Event Indexing: Extract transfer, staking, and module events per block

  • Failure Analysis: Find failed transactions via txs_results[].code

  • Gas Accounting: Sum gas_used across a block for fee analytics

Error Handling

Error
Message
Description

-32603 / Internal error

Internal error

Height is above the current tip or below the retained range

403 / RBAC: access denied

Access denied

The GetBlock access token is missing or incorrect

Last updated

Was this helpful?