# approval.getToken

> For the complete documentation index, see [llms.txt](https://ensforge.com/llms.txt).

Reads the address approved to transfer one ENSv1 name token (getApproved). Parameters, return value, errors and examples for approval.getToken in @ensforge/sdk.

Source: https://ensforge.com/docs/reference/sdk/approval/get-token

<ApiMeta kind="Read" stability="stable" since="1.0.0" source="packages/sdk/src/actions/approval/getToken/index.ts#L52" batchable />

Reads the address approved to transfer one ENSv1 name token (`getApproved`).

## When to use [#when-to-use]

Use to check a pending single-name approval, e.g. before listing a name for sale.

## Details [#details]

- Wrapped names use the NameWrapper token; unwrapped `.eth` names the BaseRegistrar token.
- ENSv2 names have no single-token approval; use operators.

## Signature [#signature]

```ts
function getToken(client: Like, options: getToken.Options): Promise<getToken.ReturnType>
```

Call it as `ens.approval.getToken(options)` on a client, or `Actions.approval.getToken(client, options)`.

`approval.getToken.request(options)` builds a deferred read for `Actions.batch`. See [Look up many at once](/docs/sdk/look-up-many-at-once).

## Parameters [#parameters]

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `name` (required) | `string` |  | ENS name. Normalized automatically. |

Also takes the [read options](/docs/reference/sdk/client#read-options).

## Returns [#returns]

Resolves to `Address | null`. The approved address, or `null`.

## Errors [#errors]

| Error | Codes | When |
| --- | --- | --- |
| [`InvalidInputError`](/docs/reference/errors/invalid-input-error) | [`INVALID_NAME`](/docs/reference/errors/INVALID_NAME) | the name cannot be normalized. |
| [`UnsupportedError`](/docs/reference/errors/unsupported-error) | [`UNSUPPORTED_PROTOCOL`](/docs/reference/errors/UNSUPPORTED_PROTOCOL) | ENSv2 names and unwrapped subnames. |
| [`NetworkError`](/docs/reference/errors/network-error) | [`RPC_REQUEST_FAILED`](/docs/reference/errors/RPC_REQUEST_FAILED), [`RPC_TIMEOUT`](/docs/reference/errors/RPC_TIMEOUT), [`RATE_LIMITED`](/docs/reference/errors/RATE_LIMITED) | the RPC request fails. |

It can also fail with the errors every read can (`Errors.CommonError`: `ConfigError`, `ContractRevertError`, `InternalError`, `NetworkError`).

See [How errors work](/docs/sdk/errors-explained).

## Examples [#examples]

<Tabs groupId="api" items={["Client","Standalone","Effect"]} persist>
<Tab>
```ts title="Reading a name's approval"
const approved = await ens.approval.getToken({ name: "alice.eth" })
```
</Tab>

<Tab>
```ts title="Reading with a standalone call"
import { Actions } from "@ensforge/sdk"

const approved = await Actions.approval.getToken(publicClient, { name: "vitalik.eth" })
```
</Tab>

<Tab>
```ts title="Reading in an Effect program"
import { Actions } from "@ensforge/sdk/effect"

const approved = yield* Actions.approval.getToken(ens, { name: "alice.eth" })
```
</Tab>
</Tabs>

## See also [#see-also]

- [`approval.setToken`](/docs/reference/sdk/approval/set-token) to change it