Docs
Supported ChainsFlow EVM GatewayJSON-RPC APIBlock Methods

eth_getBlockByHash - Flow EVM RPC Method

Retrieve complete block data by block hash on Flow EVM Gateway. Essential for NFT developers, gaming studios, and Solidity devs seeking Cadence interoperability building on the EVM-equivalent layer on Flow blockchain enabling Cadence+Solidity composability.

Returns information about a block by hash on Flow EVM Gateway.

Why Flow EVM? Build on the EVM-equivalent layer on Flow blockchain enabling Cadence+Solidity composability with full EVM equivalence on Flow, atomic multi-operation transactions, 40% lower gas fees, and 473% contract growth in 2025.

Use Cases

The eth_getBlockByHash method is essential for:

  • Block verification - Verify block data using its unique hash
  • Chain reorganization handling - Track blocks during reorgs
  • Cross-chain bridges - Verify block finality for consumer NFTs (NBA Top Shot, Disney Pinnacle), gaming dApps, and hybrid Cadence-EVM applications
  • Deterministic queries - Get consistent block data regardless of chain state

Request Parameters

Request
blockHashDATA

32-byte block hash

fullTransactionsBoolean

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

Response Body

Response
numberQUANTITY

Block number

hashDATA

32-byte block hash

parentHashDATA

32-byte parent block hash

timestampQUANTITY

Unix timestamp

gasUsedQUANTITY

Total gas used

transactionsArray

Transaction objects or hashes

Code Examples

Bash
curl -X POST https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByHash",
    "params": [
      "0xee0158dc7a2e89b3de711f135d5d39f2bf5fa407233501c4b58a065bfe7089b8",
      false
    ],
    "id": 1
  }'
JavaScript
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY');

const blockHash = '0xee0158dc7a2e89b3de711f135d5d39f2bf5fa407233501c4b58a065bfe7089b8';
const block = await provider.getBlock(blockHash);

console.log('Block number:', block.number);
console.log('Timestamp:', new Date(block.timestamp * 1000));
Python
from web3 import Web3

w3 = Web3(Web3.HTTPProvider('https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY'))

block_hash = '0xee0158dc7a2e89b3de711f135d5d39f2bf5fa407233501c4b58a065bfe7089b8'
block = w3.eth.get_block(block_hash)

print(f'Block number: {block.number}')
print(f'Timestamp: {block.timestamp}')
Go
package main

import (
    "context"
    "fmt"
    "log"

    "github.com/ethereum/go-ethereum/common"
    "github.com/ethereum/go-ethereum/ethclient"
)

func main() {
    client, err := ethclient.Dial("https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY")
    if err != nil {
        log.Fatal(err)
    }

    blockHash := common.HexToHash("0xee0158dc7a2e89b3de711f135d5d39f2bf5fa407233501c4b58a065bfe7089b8")
    block, err := client.BlockByHash(context.Background(), blockHash)
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("Block number: %d\n", block.Number().Uint64())
}

Error Handling

Error CodeMessageDescription
-32602Invalid paramsInvalid block hash format
-32000Block not foundBlock with this hash does not exist