# getResolverMetadata

Returns the latest indexed ENSIP-16 metadata publication for a resolver.

## Import

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

## Usage

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

const result = await getResolverMetadata(config, {
  resolver: "0x0000000000000000000000000000000000000000",
});
```

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

## Parameters

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

### resolver

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

Resolver contract whose latest metadata publication should be returned.

## Return Type

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

When supported, `value` contains the resolver, GraphQL URL, chain position, transaction hash, and source, or `null` when unpublished.

## Protocol Sources

This operation depends on the ENSv2 indexer and returns a discriminated union:

* `{ status: "supported", value }` when a V2 indexer is configured and available.
* `{ status: "unsupported", network, reason }` when V2 discovery is disabled or unavailable.

Check `status` before reading `value`. An unavailable V2 source is represented as data rather than
an exception so applications can keep supporting networks that only expose ENSv1 indexing.

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

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

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

## Error

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

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.indexer.getResolverMetadata`](/sdk/api/indexer/resolvers/get-resolver-metadata)
* [`useResolverMetadata`](/react/api/hooks/indexer/resolvers/use-resolver-metadata)
