zks_L1ChainId
Returns the chain ID of the underlying L1.
Parameters
None.
Response
The L1 chain ID.
Example
Replace <YOUR-API-KEY>
with an API key from your MetaMask Developer dashboard.
Request
- curl
- WSS
curl https://zksync-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "zks_L1ChainId", "params": []}'
wscat -c wss://zksync-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "id": 1, "method": "zks_L1ChainId", "params": []}'
Response
- JSON
{
"jsonrpc": "2.0",
"result": "0x1",
"id": 1
}