githubEdit

eth_newBlockFilter - Celo

Example code for the eth_newBlockFilter JSON-RPC method. Complete 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 Celo network. With Celo's ~1-second block times, this filter updates rapidly.

circle-info

This method creates a filter and returns a filter ID. It takes no parameters.

Parameters

  • None

Request Example

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

Response Example

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

Response Definition

Field
Type
Description

result

string

Filter ID

Use Cases

  • Monitor new block production

  • Track network activity

  • Trigger actions on new blocks

  • Build block explorers

Error Handling

Error Code
Description

-32603

Internal error

SDK Integration

Last updated

Was this helpful?