# createResolver

Creates resolver for resolver discovery and Universal Resolver calls.

## Import

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

## Usage

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

const result = await createResolver(config, {
  salt: 0n,
});
```

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

## Parameters

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

### salt

`bigint`

Deterministic deployment salt.

### grants

`readonly { account: Address; roleBitmap: bigint }[] | undefined`

Initial role grants for the resolver. When provided, these replace the default grant derived from
`admin` and `roles`. For HCA session registration, grant all roles to the HCA first and its owner second.

### admin

`string | undefined`

Value used for `admin` by this action.

### roles

`bigint | undefined`

Role bitmask to read, grant, or revoke.

### setters

`ReadonlyArray<Hex> | undefined`

Encoded initial resolver setter calls.

### walletClient

`WalletClient | undefined`

Viem wallet client override for this operation. Defaults to the wallet resolved from the config.

### account

`Account | Address | undefined`

Account used to authorize this operation. Defaults to the account exposed by the resolved wallet client.

### confirmation

`ConfirmationPolicy | undefined`

Controls whether the action returns after submission or waits for one or more confirmations.

## Return Type

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

| Property         | Type                    | Description                                            |
| ---------------- | ----------------------- | ------------------------------------------------------ |
| `status`         | `"deployed"`            | Current query, transaction, batch, or workflow status. |
| `resolver`       | `&#96;0x${string}&#96;` | The resolver value returned by the operation.          |
| `implementation` | `&#96;0x${string}&#96;` | The implementation value returned by the operation.    |
| `factory`        | `&#96;0x${string}&#96;` | The factory value returned by the operation.           |
| `call`           | `CallExecutionResult`   | The call value returned by the operation.              |

## 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 = createResolver.effect(config, parameters);

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

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

## Call

Use `.call` to prepare this write for simulation, wallet batching, or a custom execution policy.

```ts
const call = createResolver.call(parameters);
```

## Error

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

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

* [`sdk.resolution.createResolver`](/sdk/api/resolution/create-resolver)
