Links

eth_newBlockFilter

Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call eth_getFilterChanges.

Parameters

None

Returns

QUANTITY(hex string) - A filter id.

Example

Request

curl
TypeScript
curl https://blockvision.org/v1/<your api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_newBlockFilter",
"params": [],
"id": 0
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.OPT_MAINNET)
// Access BlockVision Enhanced API requests
bv.getNewBlockFilter().then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 0,
"result": "0x9fb7f13924bb605fd29f3ddd6d193ece"
}