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

# isHcaSessionEnabled

Check a permission ID on the destination validator.

## Import

```ts
import { isHcaSessionEnabled } from "@ensforge/core/hca";
```

## Usage

:::code-group
```ts [index.ts]
import { isHcaSessionEnabled } from "@ensforge/core/hca";
import { config } from "./config";
import { session } from "./session";

const result = await isHcaSessionEnabled(config, {
  hca: "0x1234567890123456789012345678901234567890",
  permissionId: session.parameters.permissionId,
});
```

```ts [config.ts]
// [!include ~/snippets/hca/config.ts]
```

```ts [session.ts]
import { execution } from "./execution";
import { config } from "./config";

export const session = await execution.extensions.sessions.prepare(config, {
  hca: "0x1234567890123456789012345678901234567890",
  resolver: "0x3456789012345678901234567890123456789012",
  validUntil: Math.floor(Date.now() / 1000) + 3600,
});
```
:::

## Parameters

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

### hca

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

HCA address to inspect or operate on.

### permissionId

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

Permission identifier of the prepared or enabled session.

### 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 IsHcaSessionEnabledResult = Awaited<ReturnType<typeof isHcaSessionEnabled>>;
```

Returns `boolean`.

## Effect

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

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

const program = isHcaSessionEnabled.effect(config, {
  hca: "0x1234567890123456789012345678901234567890",
  permissionId: session.parameters.permissionId,
});

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 = isHcaSessionEnabled.request({
  hca: "0x1234567890123456789012345678901234567890",
  permissionId: session.parameters.permissionId,
});
```

## Error

The Promise API rejects with the same typed failures exposed by the Effect error channel. Errors
have a stable `_tag`, `code`, and `message`; boundary errors retain their original `cause`.

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

## Related

* [`isHcaSessionEnabled`](/sdk/api/hca/is-hca-session-enabled)
* [Guide](/core/guides/hca)
