curl --request POST \
--url https://nd-363-550-219.p2pify.com/942aad90bb6a082676497030b81e40ba \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "zkevm_batchNumber",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://nd-363-550-219.p2pify.com/942aad90bb6a082676497030b81e40ba \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "zkevm_batchNumber",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}zkevm_batchNumber method returns the current batch number of the zkEVM, which is used to identify the latest batch of transactions being verified.
noneresult — the latest batch number of the Polygon zkEVM chain, encoded as hexadecimal. The batch number is updated every time a new batch of transactions is added to the chain.zkevm_batchNumber code examplesconst Web3 = require("web3");
const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
const web3 = new Web3(NODE_URL);
web3.extend({
property: 'zkEVM',
methods: [{
name: 'batchNumber',
call: 'zkevm_batchNumber',
params: 0,
inputFormatter: null,
outputFormatter: null
}]
});
async function batchNumber() {
const output = await web3.zkEVM.batchNumber()
console.log(output)
}
batchNumber();
Was this page helpful?