Documentation for agents: an index at /llms.txt, every docs page in one file at /llms-full.txt, and Markdown for any docs page by adding .md to its URL.

Skip to Content
ensforgeSDK

approval.getOperator

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

ReadBatchablestable
Since v1.0.0View source

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

When to use

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

Details

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

Signature

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.

Parameters

OptionTypeDefaultDescription
owner (required)stringAccount that granted the approval.
operator (required)stringAccount that may be approved.
contract (required)ApprovalContract"registry", "registrar", "wrapper", or a registry or resolver address.

Also takes the read options.

Returns

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

Errors

ErrorCodesWhen
InvalidInputErrorINVALID_ADDRESSinvalid addresses.
UnsupportedErrorUNSUPPORTED_ON_DEPLOYMENTENSv1 contracts without ENSv1.
NetworkErrorRPC_REQUEST_FAILED, RPC_TIMEOUT, RATE_LIMITEDthe RPC request fails.

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

See How errors work.

Examples

Checking a NameWrapper operator
const approved = await ens.approval.getOperator({ owner, operator, contract: "wrapper" })

See also

Was this page helpful?