# Calls.encode

Encodes a set of ERC-7821 calls.

## Imports

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

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

## Examples

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

const calls = Calls.encode([
  {
    data: '0xdeadbeef',
    to: '0xcafebabecafebabecafebabecafebabecafebabe',
    value: 1n
  },
  {
    data: '0xcafebabe',
    to: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
    value: 2n
  }
])
// @log: '0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000cafebabecafebabecafebabecafebabecafebabe0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000deadbeef000000000000000000000000deadbeefdeadbeefdeadbeefdeadbeefdeadbeef0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cafebabe'
```

## Definition

```ts
function encode(
  calls: readonly Call[],
  options?: encode.Options,
): `0x${string}`
```

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

## Parameters

### calls

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

Calls to encode.

#### calls.data

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

#### calls.to

* **Type:** `abitype_Address`

#### calls.value

* **Type:** `bigintType`
* **Optional**

### options

* **Type:** `encode.Options`
* **Optional**

Options for the encoding.

#### options.opData

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

Additional data to include for execution.

## Return Type

The encoded calls.

`0x${string}`
