eth_getBlockByNumber - Sonic RPC Method
Retrieve complete block data by block number on Sonic. Perfect for DeFi developers, high-frequency trading builders, and teams requiring sub-second finality building on the world's fastest EVM chain with 720ms finality, $1.2B+ TVL, and 1,534% growth since launch.
Returns information about a block by block number on Sonic.
Why Sonic? Build on the world's fastest EVM chain with 720ms finality, $1.2B+ TVL, and 1,534% growth since launch with 720ms transaction finality, 10K TPS, 90% fee sharing via FeeM, Fantom heritage with Andre Cronje leadership.
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 ultra-fast DeFi, high-frequency trading dApps, and performance-critical applications
- Timestamp verification - Get block timestamps for time-based logic
Code Examples
Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32602 | Invalid params | Invalid block number or parameter format |
| -32000 | Block not found | Block does not exist |
Related Methods
eth_blockNumber- Get latest block numbereth_getBlockByHash- Get block by hasheth_getTransactionByHash- Get transaction details
eth_blockNumber
Get the current block height on Sonic. Essential for syncing dApps, monitoring transaction confirmations, and blockchain state tracking.
eth_getBlockByHash
Retrieve complete block data by block hash on Sonic. Essential for DeFi developers, high-frequency trading builders, and teams requiring sub-second finality building on the world's fastest EVM chain with 720ms finality, $1.2B+ TVL, and 1,534% growth since launch.