Skip to main content
POST
/
zks_getL1BatchDetails
zks_getL1BatchDetails
curl --request POST \
  --url https://api.mainnet.abs.xyz/zks_getL1BatchDetails \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "zks_getL1BatchDetails",
  "params": [
    1
  ]
}
'
import requests

url = "https://api.mainnet.abs.xyz/zks_getL1BatchDetails"

payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "zks_getL1BatchDetails",
"params": [1]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'zks_getL1BatchDetails', params: [1]})
};

fetch('https://api.mainnet.abs.xyz/zks_getL1BatchDetails', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mainnet.abs.xyz/zks_getL1BatchDetails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 1,
'method' => 'zks_getL1BatchDetails',
'params' => [
1
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.mainnet.abs.xyz/zks_getL1BatchDetails"

payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"zks_getL1BatchDetails\",\n \"params\": [\n 1\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.mainnet.abs.xyz/zks_getL1BatchDetails")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"zks_getL1BatchDetails\",\n \"params\": [\n 1\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.mainnet.abs.xyz/zks_getL1BatchDetails")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"zks_getL1BatchDetails\",\n \"params\": [\n 1\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "jsonrpc": "2.0",
  "result": {
    "baseSystemContractsHashes": {
      "bootloader": "0x010007fcd651b289b6490bd5c486c8e4991528709311b88d821e55dc7f9fb9d8",
      "defaultAa": "0x0100066a8106bcdf1ce55cc99fa43c0f23d883755572b17e9a00d8cfa8f145f6"
    },
    "commitTxHash": "0xb5f9b86c661053e7d7e864f11bc33bf9fa2c6dc9d5432cf0fa7bf0bce5921747",
    "committedAt": "2023-10-18T14:00:33.546988Z",
    "executeTxHash": "0x2a7ab1ccf99cb20765f3ae5b079a9be8c77df3b84fe1e237c262cb0b7d92e4c6",
    "executedAt": "2023-10-18T14:05:38.651462Z",
    "l1GasPrice": "0x2a0aafd7c",
    "l1TxCount": "0x1",
    "l2FairGasPrice": "0x5f5e100",
    "l2TxCount": "0x2",
    "number": "0x1",
    "proveTxHash": "0xc47a5a9407df1c95e71a9de9e7dba8e28a6922e55a99cf8d7f9d706afc89958c",
    "provenAt": "2023-10-18T14:03:11.398461Z",
    "rootHash": "0x4bff3066df2ac2fbf2d8c1267ce9afab85a8e8b406ab849f94f4defcb618a4b8",
    "status": "verified",
    "timestamp": "0x6530111a"
  },
  "id": 1
}

Body

application/json
jsonrpc
string
default:2.0
required

JSON-RPC version

method
string
default:zks_getL1BatchDetails
required

The method to call

params
any[]
required

Call parameters

id
integer
default:1
required

Request identifier

Response

200 - application/json

Returns the details of the L1 batch