POST
/
efb0a5eccd2caa5135eb54eba6f7f300
curl --request POST \
  --url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "eth_newBlockFilter",
  "id": 1
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}

Optimism API method eth_newBlockFilter creates a new filter object that notifies subscribers when a new block is added to the blockchain. This method is particularly useful for applications that need to stay updated with the latest blocks for processing or monitoring purposes.

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • none — This method does not require any parameters.

Response

  • result — the ID of the created filter. This ID is used to identify the filter in subsequent calls to methods like eth_getFilterChanges or eth_getFilterLogs to retrieve updates about new blocks.

Use case

The eth_newBlockFilter method is essential for:

  • Applications that perform actions triggered by the addition of new blocks, such as updating a user interface with the latest transactions or block information.
  • Services that monitor the blockchain for security or analytical purposes, needing real-time data on block additions.
  • Wallets and exchanges that track new blocks to confirm transactions.

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_newBlockFilter
id
integer
default:1

Response

200 - application/json
The ID of the created block filter
jsonrpc
string
id
integer
result
string