# l2\_getBatch

Return the number of submitted batch state.

### Parameters

* `batchIndex`: uint64|QUANTITY - specified batch number, enable hex-encoded and original string.
* `useDetail`: boolean - If true it returns the full transaction objects, if false it returns only the hashes of the transactions.

### Returns

Object - A batch object with the following fields:

* `batchHash`: 32 Bytes - hash of a batch
* `batchNumber`: QUANTITY - batch number
* `queueNum`: QUANTITY - the number of enqueued transactions included in batch
* `queueStart`: QUANTITY - the start index of enqueued transactions included in batch
* `sequencer`: Address - sequencer address
* `subBatches`: Array - Array of object that describe sub batch:
  * `timestamp`: QUANTITY - the timestamp of sub batch
  * `transactions`: Object|32 bytes - the transaction object or hash

### Example

Request

```
{
    "jsonrpc": "2.0",
    "method": "l2_getBatch",
    "id": 0,
    "params": [
        "0x21",
        true
    ]
}
```

Result

```
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "batchHash": "0x38437ca085523a8fca6d95e7285ae9bb56b4ba9ad1201ac19c273825daa08a33",
        "batchNumber": "0x21",
        "queueNum": "0x3",
        "queueStart": "0x23c",
        "sequencer": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
        "subBatches": [
            {
                "timestamp": "0x62e0e675",
                "transactions": [
                    {
                        "blockHash": "0x7be4f2685e9f560cfbcba650695ca6892b5ee800183db4e2302824f269dcba35",
                        "blockNumber": "0x3d6",
                        "from": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
                        "gas": "0xece64",
                        "gasPrice": "0x3b9aca00",
                        "hash": "0x7fbb55519186e17f8474908d69deef087d0042292613c69a0ff57eca3cfcdba6",
                        "input": "0x",
                        "nonce": "0x3d8",
                        "to": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
                        "transactionIndex": "0x0",
                        "value": "0xde0b6b3a7640000",
                        "type": "0x0",
                        "v": "0xaa3b",
                        "r": "0x9f18584051f29caf017379d321c29a298a11faa3942007aa5d3c59988aa18ec1",
                        "s": "0x7f8a82de309175f5e66e9bacc92ec85e2290c1381c331a521cc3bbf8f6d3e4fa"
                    },
                    {
                        "blockHash": "0x7be4f2685e9f560cfbcba650695ca6892b5ee800183db4e2302824f269dcba35",
                        "blockNumber": "0x3d6",
                        "from": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
                        "gas": "0xece64",
                        "gasPrice": "0x3b9aca00",
                        "hash": "0x3eb6ee6f17b4f3837d2081b373a079dff5e1ce0b6d454ecf2d1a9ccc6a3a79ab",
                        "input": "0x",
                        "nonce": "0x3d9",
                        "to": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
                        "transactionIndex": "0x1",
                        "value": "0xde0b6b3a7640000",
                        "type": "0x0",
                        "v": "0xaa3b",
                        "r": "0x3732b5ba4a13c1f40c7d6bbac7d5c5c9c1b39902f24689a9bce4d7ccdc5af3b1",
                        "s": "0x25225cfec02d7cf345e3d0fa68d106d1371704f1c837af28f9f336b4015f770d"
                    }
                ]
            },
            {
                "timestamp": "0x62e0e684",
                "transactions": [
                    {
                        "blockHash": "0xf3c3ddb0c11c5370242121d7ecf13ac50232c299eed89e9fa7933cc6ebb6a423",
                        "blockNumber": "0x3da",
                        "from": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
                        "gas": "0xece64",
                        "gasPrice": "0x3b9aca00",
                        "hash": "0xead302625bb2c185749b61cf201df0919b016d1f8a206e3af0df9cc90236ab75",
                        "input": "0x",
                        "nonce": "0x3dd",
                        "to": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
                        "transactionIndex": "0x0",
                        "value": "0xde0b6b3a7640000",
                        "type": "0x0",
                        "v": "0xaa3c",
                        "r": "0x199e207ef1c50d4b8ef82ba1e5f8cfe64bb1feddf8fac40d3fd45fc9e3fbdeb1",
                        "s": "0x4f5849c02ffb6297b94793455276dc3ff19f75fd1159bc1ae1ca33c390fb638d"
                    }
                ]
            },
            {
                "timestamp": "0x62e0e684",
                "transactions": [
                    {
                        "blockHash": "0x47fca9736145ab867d394192b3846848909e1b8ca122d8c4c252676ea1a7cdb7",
                        "blockNumber": "0x3db",
                        "from": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
                        "gas": "0xece64",
                        "gasPrice": "0x3b9aca00",
                        "hash": "0xa8ef4aa263900ca7d1596f18bb0cad276c891141b752c9057c0c3f93dd035b27",
                        "input": "0x",
                        "nonce": "0x3de",
                        "to": "0xc86cb1fdd29765dc1f2fe8029f7b36a823fa50e8",
                        "transactionIndex": "0x0",
                        "value": "0xde0b6b3a7640000",
                        "type": "0x0",
                        "v": "0xaa3c",
                        "r": "0x99b8abb63d5dedd51bcfd1b32a0d2563070e499bcdf9fffb2a25795581ca493b",
                        "s": "0x7658512aa0af4e31595cc8262f7302df226eec91c2a40cf5feabcfac8c3b6818"
                    }
                ]
            }
        ]
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.goshen.network/dev-docs/json-rpc-api/l2_getbatch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
