# Execute.encodeBatchOfBatchesData

Encodes calls for the ERC-7821 `execute` function with "batch of batches" mode.

## Imports

:::code-group
```ts [Named]
import { Execute } from 'ox/erc7821'
```

```ts [Entrypoint]
import * as Execute from 'ox/erc7821/Execute'
```
:::

## Examples

```ts twoslash
import { Execute } from 'ox/erc7821'

const data = Execute.encodeBatchOfBatchesData([
  {
    calls: [
      {
        data: '0xcafebabe',
        to: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
        value: 1n
      }
    ]
  },
  {
    calls: [
      {
        data: '0xdeadbeef',
        to: '0xcafebabecafebabecafebabecafebabecafebabe',
        value: 2n
      }
    ],
    opData: '0xcafebabe'
  }
])
```

## Definition

```ts
function encodeBatchOfBatchesData(
  batches: readonly Batch[],
): `0x${string}`
```

**Source:** [src/erc7821/Execute.ts](https://github.com/wevm/ox/blob/main/src/erc7821/Execute.ts#L198)

## Parameters

### batches

* **Type:** `readonly Batch[]`

#### batches.calls

* **Type:** `readonly Call[]`

#### batches.opData

* **Type:** `0x${string}`
* **Optional**

## Return Type

The encoded data.

`0x${string}`
