> **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.

# getHcaFallbackHandler

Inspect the handler for a selector.

## Import

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

## Usage

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

const result = await sdk.hca.getHcaFallbackHandler({
  hca: "0x1234567890123456789012345678901234567890",
  selector: "0xa9059cbb",
});
```

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

## Parameters

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

### hca

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

HCA address to inspect or operate on.

### selector

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

Function selector whose fallback handler is inspected.

### blockNumber

`bigint | undefined`

Block number to read. Cannot be combined with blockTag.

### blockTag

`BlockTag | undefined`

Named block state to read. Cannot be combined with blockNumber.

## Return Type

```ts
type GetHcaFallbackHandlerResult = Awaited<ReturnType<typeof sdk.hca.getHcaFallbackHandler>>;
```

| Property   | Type                | Description                                 |
| ---------- | ------------------- | ------------------------------------------- |
| `callType` | `` `0x${string}` `` | Call mode used by the fallback handler.     |
| `handler`  | `` `0x${string}` `` | Handler address for the requested selector. |

Returns ``{ readonly callType: `0x${string}`; readonly handler: `0x${string}`; }``.

## 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.getHcaFallbackHandler.effect({
  hca: "0x1234567890123456789012345678901234567890",
  selector: "0xa9059cbb",
});

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

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

## Request

Use `.request` to describe the read without executing it, then include it in a typed
[read batch](/core/guides/batching).

```ts
const request = sdk.hca.getHcaFallbackHandler.request({
  hca: "0x1234567890123456789012345678901234567890",
  selector: "0xa9059cbb",
});
```

## 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

* [`getHcaFallbackHandler`](/core/api/actions/hca/get-hca-fallback-handler)
* [Guide](/core/guides/hca)
