eth_newBlockFilter - Arbitrum

Example code for the eth_newBlockFilter JSON RPC method. Сomplete guide on how to use eth_newBlockFilter JSON RPC in GetBlock Web3 documentation.

This method returns the number of uncles in a block specified by its block number.

Parameters

  • None

Request

curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
   "jsonrpc": "2.0",
    "method": "eth_newBlockFilter",
    "params": [],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0xd1073f126a0d0447987ff93c772d204c"
}

Reponse Parameter Definition

Field
Description
Data Type

result

A hexadecimal string representing the ID of the created filter.

String

Use case

The eth_newBlockFilter method helps developers to:

  • Listen for newly created blocks without constant RPC polling

  • Build live dashboards and monitoring systems

  • Support lightweight clients and browser-based dApps

  • Track chain activity for indexers, explorers, or analytics tools

  • Implement auto-refresh on UIs when new blocks are published

Error handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS_TOKEN.

-32602

Invalid argument

  • Invalid block number

Integration with Web3

Last updated

Was this helpful?