# encodeCallsMAv2

> Overview of the encodeCallsMAv2 function

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function encodeCallsMAv2(calls): `0x${string}`;
```

Defined in: [packages/smart-accounts/src/ma-v2/accounts/calldataCodec.ts:20](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/ma-v2/accounts/calldataCodec.ts#L20)

Encodes an array of calls into ModularAccountV2 calldata for `execute` or `executeBatch`.
Used internally by the ModularAccountV2 SmartAccount implementation. Typically not needed
directly unless you have an advanced use case.

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `calls`
      </td>

      <td>
        readonly [`Call`](https://viem.sh)\[]
      </td>

      <td>
        The calls to encode.
      </td>
    </tr>

  </tbody>
</table>

## Returns

`` `0x${string}` ``

The encoded calldata.