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_isBlockConsolidated",
"params": [
"0xd29e"
]
}'
{
"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_isBlockConsolidated",
"params": [
"0xd29e"
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}
zkevm_isBlockConsolidated
method allows users to check whether a specific block is part of a consolidated batch or not.
blockNumber
— the block number to check if it is connected to a verified batch, encoded as hexadecimal.result
— a boolean value indicating whether the block is connected to a verified batch or not.zkevm_isBlockConsolidated
code examplesconst Web3 = require("web3");
const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
const web3 = new Web3(NODE_URL);
web3.extend({
property: 'zkEVM',
methods: [{
name: 'isBlockConsolidated',
call: 'zkevm_isBlockConsolidated',
params: 1,
inputFormatter: null,
outputFormatter: null
}]
});
async function isBlockConsolidated(blockId) {
const output = await web3.zkEVM.isBlockConsolidated(blockId)
console.log(output)
}
isBlockConsolidated("0xd29e");
Checks if the given block is consolidated.
The response is of type object
.