Docs
Supported ChainszkSync EraJSON-RPC APISmart Contract Methods

eth_newBlockFilter - zkSync RPC Method

Create new block filter on zkSync Era. Essential for monitoring new blocks.

Creates a filter on zkSync Era to notify when a new block arrives.

Request Parameters

Request

This method accepts no parameters.

Response Body

Response
resultQUANTITY

Filter ID

Code Examples

Bash
curl -X POST https://api-zksync-era-mainnet-full.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_newBlockFilter",
    "params": [],
    "id": 1
  }'
JavaScript
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('https://api-zksync-era-mainnet-full.n.dwellir.com/YOUR_API_KEY');

const filterId = await provider.send('eth_newBlockFilter', []);

// Poll for new blocks
const newBlocks = await provider.send('eth_getFilterChanges', [filterId]);
console.log('New block hashes:', newBlocks);

On this page