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

# grantTrustedHcaRoles

Grant resource roles on a trusted HCA set.

## Import

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

## Usage

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

const result = await sdk.hca.admin.grantTrustedHcaRoles({
  assignee: "0x2345678901234567890123456789012345678901",
  roles: 1n,
});
```

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

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

## Parameters

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

### assignee

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

Address whose resource roles are read, granted or revoked.

### roles

`bigint`

Role bitmask to read, grant or revoke.

### confirmation

`ConfirmationPolicy | undefined`

Receipt confirmation policy.

### walletClient

`WalletClient | undefined`

Viem wallet override. Defaults to the configured wallet resolver.

### account

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

Wallet account override for the operation.

### resource

`bigint | undefined`

Resource identifier for the role operation.

## Return Type

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

| Property  | Type                         | Description                                    |
| --------- | ---------------------------- | ---------------------------------------------- |
| `hash`    | `` `0x${string}` ``          | Submitted transaction hash.                    |
| `receipt` | `TransactionReceipt \| null` | Confirmed transaction receipt, when requested. |

## 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.admin.grantTrustedHcaRoles.effect({
  assignee: "0x2345678901234567890123456789012345678901",
  roles: 1n,
});

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

* [`grantTrustedHcaRoles`](/core/api/actions/hca/admin/grant-trusted-hca-roles)
* [Guide](/core/guides/hca)
