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

event.get

Reads the ENS events of one name over a block range, across ENSv1 and ENSv2. Parameters, return value, errors and examples for event.get in @ensforge/sdk.

ReadBatchablestable
Since v1.0.0View source

Reads the ENS events of one name over a block range, across ENSv1 and ENSv2.

When to use

Use to show a name's recent activity, or to follow a write's effects, straight from the chain.

Details

  • Scans the name's own contracts: the ENSv1 registry, .eth registrar and controllers, NameWrapper, resolver and DNS registrar; the ENSv2 registry holding it (following token regenerations), the ETHRegistrar, its resolver (record links) and its subregistry.
  • Ranges the RPC provider rejects are split; past maxRequests requests the read fails with LOG_RANGE_TOO_LARGE instead of sending more.
  • Address-wide and full history needs an indexer (indexer.getHistory).

Signature

function get(client: Like, options: get.Options): Promise<get.ReturnType>

Call it as ens.event.get(options) on a client, or Actions.event.get(client, options).

event.get.request(options) builds a deferred read for Actions.batch. See Look up many at once.

Parameters

OptionTypeDefaultDescription
name (required)stringENS name. Normalized automatically.
fromBlock (required)bigintFirst block, inclusive.
toBlockbigint | "latest""latest"Last block, inclusive.
typesreadonly EventType[]Only these event types.
maxRequestsnumber500Most eth_getLogs requests to send.

Also takes the read options.

Returns

Resolves to readonly Event[]. The name's ENS events, in chain order.

FieldTypeDescription
typeEventType
actionEventAction
eventstringSolidity event name, e.g. LabelRegistered.
protocol"v1" | "v2" | nullProtocol of the emitting contract; null for resolvers ensforge does not know.
contractAddressEmitting contract.
namestring | nullThe name the event is about, when the event or the query reveals it.
nodeHex | nullENS node the event is keyed by, for node-keyed events.
argsReadonly<Record<string, unknown>>Decoded event arguments.
blockNumberbigint
transactionHashHex
logIndexnumber

Errors

ErrorCodesWhen
InvalidInputErrorINVALID_NAME, INVALID_RECORD_VALUEinvalid input.
NetworkErrorLOG_RANGE_TOO_LARGEthe provider's log limits make the range too expensive.
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

Reading a name's recent events
const events = await ens.event.get({ name: "nick.eth", fromBlock: 26_000_000n })

See also

Was this page helpful?