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

# getTrustedHcaRoles

Read resource roles on a trusted HCA set.

## Import

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

## Usage

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

const result = await getTrustedHcaRoles(config, {
  assignee: "0x2345678901234567890123456789012345678901",
});
```

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

This targets HCA governance contracts. It does not transfer or renounce the immutable account owner.

## Parameters

### assignee

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

Address whose resource roles are read, granted or revoked.

### resource

`bigint | undefined`

Resource identifier for the role operation.

### 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 GetTrustedHcaRolesResult = Awaited<ReturnType<typeof getTrustedHcaRoles>>;
```

Returns `bigint`.

## 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 = getTrustedHcaRoles.effect(config, {
  assignee: "0x2345678901234567890123456789012345678901",
});

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 = getTrustedHcaRoles.request({
  assignee: "0x2345678901234567890123456789012345678901",
});
```

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

* [`getTrustedHcaRoles`](/sdk/api/hca/admin/get-trusted-hca-roles)
* [Guide](/core/guides/hca)
