# approval.getOperator

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

Checks whether an operator may manage everything an owner holds on an ENS contract (isApprovedForAll). Options, errors and examples for approval.getOperator.

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

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

Checks whether an operator may manage everything an owner holds on an ENS contract
(`isApprovedForAll`).

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

Use to see whether a marketplace, manager or contract wallet is already approved.

## Details [#details]

- `contract`: the ENSv1 `"registry"`, `"registrar"` (BaseRegistrar) or `"wrapper"`
  (NameWrapper), or any ENSv2 registry or resolver by address.

## Signature [#signature]

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

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

`approval.getOperator.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 |
| --- | --- | --- | --- |
| `owner` (required) | `string` |  | Account that granted the approval. |
| `operator` (required) | `string` |  | Account that may be approved. |
| `contract` (required) | `ApprovalContract` |  | `"registry"`, `"registrar"`, `"wrapper"`, or a registry or resolver address. |

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

## Returns [#returns]

Resolves to `boolean`. Whether `operator` is approved for all of `owner`'s names on the contract.

## Errors [#errors]

| Error | Codes | When |
| --- | --- | --- |
| [`InvalidInputError`](/docs/reference/errors/invalid-input-error) | [`INVALID_ADDRESS`](/docs/reference/errors/INVALID_ADDRESS) | invalid addresses. |
| [`UnsupportedError`](/docs/reference/errors/unsupported-error) | [`UNSUPPORTED_ON_DEPLOYMENT`](/docs/reference/errors/UNSUPPORTED_ON_DEPLOYMENT) | ENSv1 contracts without ENSv1. |
| [`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="Checking a NameWrapper operator"
const approved = await ens.approval.getOperator({ owner, operator, contract: "wrapper" })
```
</Tab>

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

const approved = await Actions.approval.getOperator(publicClient, { owner, operator, contract: registry })
```
</Tab>

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

const approved = yield* Actions.approval.getOperator(ens, { owner, operator, contract: "registry" })
```
</Tab>
</Tabs>

## See also [#see-also]

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