eth_newBlockFilter - BSC

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 creates a filter to notify when new blocks arrive on the BNB Smart Chain. With BSC's ~3-second block times, this filter updates frequently.

Parameters

  • None

Request Example

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

Response Example

response.json
{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x1"
}

Response Parameters

Parameter
Type
Description

result

string

Filter ID for polling

Use Cases

  • Monitor new block production

  • Track chain progress

  • Trigger on-block actions

  • Build block explorers

Error Handling

Error Code
Description

-32603

Internal error

SDK Integration

Last updated

Was this helpful?