Skip to main content
POST
eth_getBlockByNumber
curl --request POST \
  --url https://rpc.testnet.tempo.xyz/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByNumber",
  "params": [
    "latest",
    false
  ],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}
Tempo API method that returns information about a block specified by its number or tag. This method can return full transaction objects or just transaction hashes depending on the second parameter. Tempo blocks include additional fields not found in standard Ethereum blocks: mainBlockGeneralGasLimit, sharedGasLimit, and timestampMillisPart for sub-second precision.

Parameters

  • blockNumber — the block number (hex) or tag (latest, earliest, pending)
  • fullTransactions — if true, returns full transaction objects; if false, returns only transaction hashes

Response

  • result — a block object, or null if no block was found:
    • number — the block number
    • hash — the block hash
    • parentHash — hash of the parent block
    • timestamp — block timestamp in seconds
    • timestampMillisPart — sub-second timestamp (0-999 ms), Tempo-specific
    • transactions — array of transaction objects or hashes
    • Additional Tempo fields for payment lanes gas limits

eth_getBlockByNumber code examples

const Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);

async function getBlockByNumber() {
  const block = await web3.eth.getBlock("latest");
  console.log(block);
}

getBlockByNumber()

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_getBlockByNumber
params
any[]

Block number (hex) or tag, and boolean for full transactions

id
integer
default:1

Response

200 - application/json

The block information

jsonrpc
string
id
integer
result
object

Block object or null if not found