# getRegistrations

Lists ENS registrations across protocol versions.

## Import

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

## Usage

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

const result = await sdk.indexer.getRegistrations({
  filter: { protocols: ["v1", "v2"] },
  order: { field: "expiry", direction: "asc" },
  pageSize: 20,
});
```

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

## Parameters

```ts
import type { GetRegistrationsParametersType } from "@ensforge/sdk/indexer";
```

### filter

`RegistrationFilter | undefined`

Narrows registrations by `registrant`, `protocols`, or expiry bounds. The general registration feed
does not accept exact-name or registration-time filters because the deployed schemas cannot apply
those constraints consistently on the server. Use `getRegistrationHistory` for one name.

### order

`RegistrationOrder | undefined`

Orders by `registeredAt`, `expiry`, or `name`. Defaults to newest registration first.

### pageSize

`number | undefined`

Maximum number of items to return. It must be greater than zero and cannot exceed the
`maximumPageSize` configured for the indexer. The default is the smaller of `20` and the configured
maximum.

### cursor

`IndexerCursor | undefined`

Opaque cursor returned by the previous page. Pass it unchanged to continue the same query. A cursor
is tied to its filters, ordering, network, and enabled indexer sources; changing any of them requires
starting again without a cursor.

## Return Type

```ts
import type { GetRegistrationsResultType } from "@ensforge/sdk/indexer";
```

Each registration includes protocol, name identity, registrant, current owner, registration and expiry times, normalized cost, referrer, and source metadata.

The result is an `IndexerPage`:

| Property               | Type                                 | Description                                                         |
| ---------------------- | ------------------------------------ | ------------------------------------------------------------------- |
| `items`                | `readonly Item[]`                    | Normalized results in deterministic cross-protocol order.           |
| `pageInfo.cursor`      | `IndexerCursor \| null`              | Cursor for the next page, or `null` when no continuation is needed. |
| `pageInfo.hasNextPage` | `boolean`                            | Whether another page is available.                                  |
| `sources`              | `readonly IndexerSourcePageStatus[]` | Per-protocol participation, block metadata, and partial failures.   |

Do not inspect or construct cursors. Persist and pass the returned value as-is.

## Protocol Sources

Enabled ENSv1 and ENSv2 sources are queried concurrently. Results are normalized, deduplicated, and merged into one stable page; partial mode records source failures in the result.

## Effect

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

```ts
import { Effect } from "effect";
import { sdk } from "./client";

const program = sdk.indexer.getRegistrations.effect(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 { GetRegistrationsError } from "@ensforge/sdk/indexer";
```

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

* [`getRegistrations`](/core/api/actions/indexer/registrations/get-registrations)

## Hook

* [`useRegistrations`](/react/api/hooks/indexer/registrations/use-registrations)
