> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://ensforge.com/api/mcp` to find what you need.

# prepareHcaCalls

Validate raw calls or ENS intents into an HCA plan.

## Import

```ts
import { Ensforge } from "@ensforge/sdk";
```

## Usage

:::code-group
```ts [index.ts]
import { sdk } from "./client";

const result = await sdk.hca.prepareHcaCalls({
  hca: "0x1234567890123456789012345678901234567890",
  authorization: { kind: "owner" },
  calls: [{ to: "0x2345678901234567890123456789012345678901", value: 0n, data: "0x" }],
});
```

```ts [client.ts]
// [!include ~/snippets/hca/client.ts]
```
:::

## Parameters

```ts
import type { PrepareHcaCallsParameters } from "@ensforge/sdk/hca";
```

### hca

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

HCA address to inspect or operate on.

### authorization

`HcaAuthorization`

Owner authorization or an enabled destination session.

### counterfactualOwner

`` `0x${string}` | undefined ``

Expected owner for counterfactual execution.

### operationId

`string | undefined`

Optional caller correlation identifier for execution tracking.

### requiredCapabilities

`readonly ("ownerExecution" | "sessionExecution" | "counterfactualDeployment" | "atomicBatching" | "sponsorship" | "crossChainFunding")[] | undefined`

Capabilities that the execution route must support.

### salt

`bigint | undefined`

Account derivation salt. Defaults to the deployment profile canonical salt.

### calls

``readonly ({ readonly to: `0x${string}`; readonly data?: `0x${string}` | undefined; readonly value?: bigint | undefined; } | EnsWriteIntent<unknown, WriteError>)[]``

Ordered raw contract calls or supported ENS .call intents.

### walletClient

`WalletClient | undefined`

Viem wallet override. Defaults to the configured wallet resolver.

### account

`` `0x${string}` | Account | undefined ``

Wallet account override for the operation.

## Return Type

```ts
import type { PreparedHcaCalls } from "@ensforge/sdk/hca";
```

| Property               | Type                                                                                                 | Description                                              |
| ---------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `operationId`          | `string \| undefined`                                                                                | Optional caller correlation identifier.                  |
| `requiredCapabilities` | `PreparedHcaCalls["requiredCapabilities"]`                                                           | Capabilities required from the execution route.          |
| `account`              | `VerifiedHcaAccount`                                                                                 | Verified account and deployment details.                 |
| `authorization`        | `HcaAuthorization`                                                                                   | Owner or session authorization selected for the calls.   |
| `session`              | `VerifiedHcaSession \| undefined`                                                                    | Verified session when session authorization is selected. |
| `calls`                | ``readonly { readonly to: `0x${string}`; readonly data: `0x${string}`; readonly value: bigint; }[]`` | Ordered calls with normalized values and calldata.       |
| `value`                | `bigint`                                                                                             | Total native token value, in wei.                        |
| `data`                 | `` `0x${string}` ``                                                                                  | Encoded account execution calldata.                      |
| `fingerprint`          | `` `0x${string}` ``                                                                                  | Hash binding execution to the prepared calls.            |
| `simulation`           | `"required"`                                                                                         | Simulation requirement for the execution adapter.        |

## Effect

Use `.effect` when composing the method in an Effect program. The success and error channels remain
fully typed.

```ts
import { Effect } from "effect";

const program = sdk.hca.prepareHcaCalls.effect({
  hca: "0x1234567890123456789012345678901234567890",
  authorization: { kind: "owner" },
  calls: [{ to: "0x2345678901234567890123456789012345678901", value: 0n, data: "0x" }],
});

type Success = Effect.Success<typeof program>;
type Failure = Effect.Error<typeof program>;

const result = await Effect.runPromise(program);
```

## Error

The method rejects with the corresponding Core action errors. Use `.effect` to keep those failures
in the typed Effect error channel.

See [Error Handling](/sdk/guides/error-handling).

## Action

* [`prepareHcaCalls`](/core/api/actions/hca/prepare-hca-calls)
* [Guide](/core/guides/hca)
