> For the complete documentation index, see [llms.txt](https://andrewkimjoseph.gitbook.io/celina-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andrewkimjoseph.gitbook.io/celina-sdk/services/ensservice.md).

# EnsService

[**@andrewkimjoseph/celina-sdk**](/celina-sdk/api-reference/api-reference.md)

***

[@andrewkimjoseph/celina-sdk](/celina-sdk/api-reference/api-reference.md) / [services/ens.service](https://github.com/andrewkimjoseph/celina-sdk/blob/main/docs/api-reference/services/ens.service/README.md) / EnsService

## Class: EnsService

Defined in: [src/services/ens.service.ts:29](https://github.com/andrewkimjoseph/celina-sdk/blob/970ab720c805303ead8b20406c6579ecdcf2193a/src/services/ens.service.ts#L29)

ENS name and address resolution for send/swap recipients.

### Constructors

#### Constructor

> **new EnsService**(`ensClientFactory`): `EnsService`

Defined in: [src/services/ens.service.ts:30](https://github.com/andrewkimjoseph/celina-sdk/blob/970ab720c805303ead8b20406c6579ecdcf2193a/src/services/ens.service.ts#L30)

**Parameters**

**ensClientFactory**

`EnsClientFactory`

**Returns**

`EnsService`

### Methods

#### resolveAddressOrEns()

> **resolveAddressOrEns**(`input`): `Promise`<[`ResolvedRecipient`](https://github.com/andrewkimjoseph/celina-sdk/blob/main/docs/api-reference/services/ens.service/type-aliases/ResolvedRecipient.md)>

Defined in: [src/services/ens.service.ts:104](https://github.com/andrewkimjoseph/celina-sdk/blob/970ab720c805303ead8b20406c6579ecdcf2193a/src/services/ens.service.ts#L104)

Accept a raw `0x` address or ENS name; returns address plus optional ENS metadata.

**Parameters**

**input**

`string`

Hex address or ENS name

**Returns**

`Promise`<[`ResolvedRecipient`](https://github.com/andrewkimjoseph/celina-sdk/blob/main/docs/api-reference/services/ens.service/type-aliases/ResolvedRecipient.md)>

***

#### resolveEns()

> **resolveEns**(`name`, `chain?`): `Promise`<{ `address`: `` `0x${string}` ``; `chain`: `"ethereum"`; `coinType`: `string`; `name`: `string`; `normalizedName`: `string`; `resolvedVia?`: `undefined`; } | { `address`: `` `0x${string}` ``; `chain`: `"celo"`; `coinType`: `string`; `name`: `string`; `normalizedName`: `string`; `resolvedVia`: `"celo"` | `"ethereum"`; }>

Defined in: [src/services/ens.service.ts:38](https://github.com/andrewkimjoseph/celina-sdk/blob/970ab720c805303ead8b20406c6579ecdcf2193a/src/services/ens.service.ts#L38)

Resolve an ENS name on Celo or Ethereum to an address.

**Parameters**

**name**

`string`

ENS name (e.g. `andrewkimjoseph.celo.eth`)

**chain?**

[`EnsResolveChain`](https://github.com/andrewkimjoseph/celina-sdk/blob/main/docs/api-reference/services/ens.service/type-aliases/EnsResolveChain.md) = `"celo"`

`"celo"` tries Celo coin type first, then Ethereum; `"ethereum"` uses ETH only

**Returns**

`Promise`<{ `address`: `` `0x${string}` ``; `chain`: `"ethereum"`; `coinType`: `string`; `name`: `string`; `normalizedName`: `string`; `resolvedVia?`: `undefined`; } | { `address`: `` `0x${string}` ``; `chain`: `"celo"`; `coinType`: `string`; `name`: `string`; `normalizedName`: `string`; `resolvedVia`: `"celo"` | `"ethereum"`; }>

**Throws**

When no address record exists for the name


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://andrewkimjoseph.gitbook.io/celina-sdk/services/ensservice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
