Docs

eth_getBlockByNumber - Unichain RPC Method

Retrieve complete block data by block number on Unichain. Perfect for DeFi developers, liquidity protocol builders, and teams building on the Optimism Superchain building on Uniswap's DeFi-optimized Superchain L2 with 250ms sub-blocks and 95% lower costs than Ethereum.

Returns information about a block by block number on Unichain.

Why Unichain? Build on Uniswap's DeFi-optimized Superchain L2 with 250ms sub-blocks and 95% lower costs than Ethereum with 250ms sub-blocks (fastest L2), TEE-secured block building, native Superchain interoperability, and 65% revenue to validators.

Use Cases

The eth_getBlockByNumber method is essential for:

  • Block explorers - Display complete block information
  • Transaction indexers - Process all transactions in a block
  • Analytics platforms - Analyze blockchain data for decentralized exchanges, liquidity protocols, and MEV-protected DeFi applications
  • Timestamp verification - Get block timestamps for time-based logic

Code Examples

Error Handling

Error CodeMessageDescription
-32602Invalid paramsInvalid block number or parameter format
-32000Block not foundBlock does not exist