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

eth_getblockbynumber tempo

Returns information about a block by block number. Pass "latest", "earliest", "pending", "safe", or "finalized" as a block tag, or a hex-encoded block number. On Tempo, "finalized" reflects deterministic single-slot finality — there are no re-orgs, so finalized tracks very close to "latest".

Parameters

Parameter
Type
Required
Description

blockParameter

string

Yes

Block number in hex, or "latest", "earliest", "pending", "safe", "finalized"

fullTransactions

boolean

Yes

If true, returns full transaction objects; if false, only hashes

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByNumber",
    "params": [
        "latest",
        false
    ],
    "id": "getblock.io"
}'
import axios from 'axios';

const data = JSON.stringify({
    "jsonrpc": "2.0",
    "method": "eth_getBlockByNumber",
    "params": [
        "latest",
        false
    ],
    "id": "getblock.io"
});

const config = {
    method: 'post',
    url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
    headers: {
        'Content-Type': 'application/json'
    },
    data: data
};

axios(config)
    .then(response => console.log(JSON.stringify(response.data, null, 2)))
    .catch(error => console.log(error));

Response Example

Response Parameters

Field
Type
Description

result.number

string

Block number (hex)

result.hash

string

Block hash (32 bytes hex)

result.parentHash

string

Hash of the parent block

result.timestamp

string

Unix timestamp of the block (hex)

result.gasUsed

string

Total gas used by transactions in this block (hex)

result.baseFeePerGas

string

Base fee per gas (hex). On Tempo this is denominated in TIP-20 fee units, not native ETH

result.transactions

array

Array of transaction hashes, or full transaction objects if fullTransactions=true

Use Cases

  • Block-by-block indexing of Tempo transactions

  • Building payment-focused explorers

  • Computing per-block statistics

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32601

Method not found

Method does not exist or is not enabled on this node

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Was this helpful?