POST
/
afb8312f3710a5bc469f4c87cad3a2e4
curl --request POST \
  --url https://nd-995-911-243.p2pify.com/afb8312f3710a5bc469f4c87cad3a2e4 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "zks_getL1BatchBlockRange",
  "params": [
    443314
  ]
}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "startBlock": 123,
    "endBlock": 123
  }
}

The zks_getL1BatchBlockRange API method is designed to provide the range of blocks within a specific zkSync network batch. Given a batch number, it returns the starting and ending block numbers in hexadecimal format.

Get your own node endpoint today

Start for free and elevate your app to production levels immediately. No credit card required.

Sign up with your GitHub, X, Google, or Microsoft account for immediate access.

Parameters

  • batch — an L1BatchNumber representing the batch number for which the block range is being requested.

Response

The response provides the starting and ending block numbers of the specified batch, returned as hexadecimal strings:

  • result — the block range is returned as an array containing two elements: the starting and ending block numbers in hexadecimal format.

You can use the Chainstack EVM Swiss Army Knife to convert values.

Use case

A developer creating a security audit tool for DeFi applications on zkSync could use zks_getL1BatchBlockRange to monitor and analyze transactions within specific batches. This enables timely detection of suspicious patterns or anomalies, enhancing the application’s security by ensuring transactions align with expected behavior and regulatory compliance.

Body

application/json
jsonrpc
string
default:2.0
required
Example:

"2.0"

id
integer
default:1
required
Example:

1

method
string
default:zks_getL1BatchBlockRange
required
Example:

"zks_getL1BatchBlockRange"

params
integer[]
required

Response

200 - application/json
Successful response
jsonrpc
string
default:2.0
required
Example:

"2.0"

id
integer
default:1
required
result
object
required