L0vdL0vd

eth_newBlockFilter

Creates a filter that reports new block hashes; poll it with eth_getFilterChanges.

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_newBlockFilter","params":[]}'

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x050000000000000025ecda100596be70"
}
Params and your endpoint

Parameters

This method takes no parameters.

Returns

string Filter ID.

When to use it

Get notified of new blocks by polling, for example to trigger work on every new head.

How to read the result

Filter ID; eth_getFilterChanges then returns the hashes of blocks added since the last poll.

Tips

  • Polling eth_blockNumber is an equally good, stateless alternative.

Related methods