SDK
Browse every action of @ensforge/sdk by domain, with the client, batching, utilities and indexers it exports, each with its signature and examples.
90 actions · 16 domains
Since v1.0.0View source
Every action of @ensforge/sdk, by domain. Each page lists its signature, options, result, errors and examples.
Client
Ensforge.create, the action groups, and the read, write and plan option types.
batch
Runs several reads together, in as few round trips as possible.
Utilities
Name, coin type, content hash, duration, fuse, role and error helpers.
Indexers
The indexers, query options and result types of @ensforge/sdk/indexer.
approval
| Action | Description |
|---|---|
getDelegate (batchable) | Checks whether a delegate may edit a name's records on its public resolver (isApprovedFor). |
getOperator (batchable) | Checks whether an operator may manage everything an owner holds on an ENS contract (isApprovedForAll). |
getToken (batchable) | Reads the address approved to transfer one ENSv1 name token (getApproved). |
setDelegate | Approves or revokes a delegate who may edit a name's records on its public resolver. |
setOperator | Approves or revokes an operator for everything the signer holds on an ENS contract (setApprovalForAll). |
setToken | Approves one address to transfer one ENSv1 name token, or clears the approval. |
dns
| Action | Description |
|---|---|
claim | Imports a DNS name into ENS with a DNSSEC proof of its _ens TXT record. |
getOffchainResolver (batchable) | Reads the gasless DNS resolver a DNS name sets in an ENS1 TXT record. |
getProof (batchable) | Fetches the DNSSEC proof of a DNS name's _ens TXT record. |
getRecords (batchable) | Reads DNS records and the zonehash a name stores on its resolver. |
getStatus (batchable) | Reads whether a DNS name is imported into ENS, and what it needs to be. |
setRecords | Sets DNS records or the zonehash of a name on its public resolver. |
event
| Action | Description |
|---|---|
decode (batchable) | Normalizes the ENS events in logs or transaction receipts. |
get (batchable) | Reads the ENS events of one name over a block range, across ENSv1 and ENSv2. |
watch | Watches one name's ENS events as new blocks arrive. |
indexer
| Action | Description |
|---|---|
getEvents (batchable) | Searches indexed ENS events by name, address, resolver, contract or block range. |
getHistory (batchable) | Reads the full history of a name, or of every name an address is related to. |
getName (batchable) | Reads one name from the indexer: owner, manager, expiry, resolver, records and protocol. |
getNamesByExpiry (batchable) | Lists names by when they expire or leave their grace period. |
getNamesForAddress (batchable) | Lists the names an address owns, manages, holds roles on, resolves to, or used to own. |
getNamespace (batchable) | Reads what the indexer serves for a namespace: its networks and which features are complete. |
getPermissions (batchable) | Lists who can do what over a name, a registration, an account or an ENSv2 registry. |
getPrimaryName (batchable) | Reads an address's primary name from the indexer, verified on-chain when the indexer can. |
getRecords (batchable) | Reads a name's records and its record inventory from the indexer. |
getRegistry (batchable) | Reads an ENSv2 registry: the name it serves, its parent registry, when it was created and its counts. |
getRegistryLabels (batchable) | Lists the labels of an ENSv2 registry, optionally only those an address holds or does not hold. |
getResolver (batchable) | Reads a resolver and one page of the names bound to it. |
getResolverLinks (batchable) | Lists the names linked to record sets on an ENSv2 resolver. |
getResolverRoles (batchable) | Lists the role grants on an ENSv2 resolver. |
getResolvers (batchable) | Lists the ENSv2 resolvers on which an address holds roles. |
getStatus (batchable) | Reads the indexer's health and how far each chain is indexed. |
getSubnames (batchable) | Lists the direct subnames of a name. |
lookup (batchable) | Reads up to 1,000 names and addresses in one request. |
search (batchable) | Searches names by text. |
migration
| Action | Description |
|---|---|
get (batchable) | Reads whether an ENSv1 name can migrate to ENSv2, how, and what it becomes. |
migrate | Migrates one or more ENSv1 names to ENSv2, carrying their resolver records and subnames. |
name
| Action | Description |
|---|---|
get (batchable) | Reads the full state of a name across ENSv1 and ENSv2: where it lives, who owns it, its resolver, expiry and whether it can be registered or renewed. |
getLabel (batchable) | Recovers a label from its labelhash through the ENSv2 LabelStore. |
reclaim | Resets the ENSv1 registry owner (manager) of an unwrapped .eth name, as its registrant. |
setManager | Sets the ENSv1 manager (registry owner) of a name. |
setTtl | Sets the ENSv1 registry TTL of a name. |
transfer | Sends a name to another account and resolves once the transaction is submitted. |
permission
| Action | Description |
|---|---|
check (batchable) | Checks whether an account may perform one operation on an ENS name, and lists exactly what it lacks when it may not. |
get (batchable) | Reads what an account may do with an ENS name: transfer it, change its resolver, edit records, create subnames and more, across ENSv1 ownership and ENSv2 roles. |
setRecordAccess | Lets another account edit a name's records, or takes that access back. |
plan
| Action | Description |
|---|---|
get (batchable) | Reads a saved plan and its progress. |
list (batchable) | Lists the saved plans of this client's chain and of its chains, newest first. |
reconcile (batchable) | Records a transaction sent outside ensforge as a plan step's submission. |
resume | Continues a saved plan after a failure or a reload. |
send | Sends any plan: one prepared by a write's .prepare, or several combined with Plan.merge. |
primaryName
| Action | Description |
|---|---|
get (batchable) | Reads the primary name of an address (ENSIP-19 reverse resolution), verified against the name's address record. |
set | Sets or clears the primary name (reverse record) of an address. |
signClaim | Signs a claim to a primary name on one or more L2s, with one signature and no transaction. |
record
| Action | Description |
|---|---|
get (batchable) | Reads any mix of a name's records in one request: texts, addresses, content hash, ABI, public key, name record, interface implementers and data records. |
getAddress (batchable) | Reads one address record of an ENS name, for Ethereum by default or any coin (ENSIP-9, ENSIP-11). |
getAvatar (batchable) | Reads the avatar of an ENS name and resolves it to a URL a browser can load (ENSIP-12). |
getContentHash (batchable) | Reads the content hash of an ENS name (ENSIP-7), decoded into its protocol, value and URI. |
getText (batchable) | Reads one text record of an ENS name, such as url, avatar or com.twitter. |
set | Writes records of an ENS name and resolves once the transaction is submitted. |
registration
| Action | Description |
|---|---|
commit | Commits to registering .eth names, the first half of a registration. |
getCommitmentStatus (batchable) | Reads where a registration commitment is in its window. |
getParameters (batchable) | Reads the .eth registration settings: contracts, commitment window, minimum duration, grace period and accepted payment tokens. |
getPrice (batchable) | Quotes the price of registering a .eth name, in an ERC-20 payment token. |
getRenewalPrice (batchable) | Quotes renewing one or more .eth names, in an ERC-20 payment token. |
isAvailable (batchable) | Checks whether a .eth name can be registered now. |
register | Registers one or more .eth names: approve, commit, wait, register, then records and primary name. |
renew | Renews one or more .eth names, ENSv1 or ENSv2, paying in an ERC-20 token. |
registry
| Action | Description |
|---|---|
attach | Sets or removes the subregistry of an ENSv2 name. |
deploy | Deploys an ENSv2 UserRegistry, optionally attaching it as a name's subregistry. |
get (batchable) | Reads an ENSv2 registry: its kind, implementation, parent, canonical name, URI, whether it is emancipated, and whether it can be upgraded. |
setUri | Sets the metadata URI of an ENSv2 registry. |
upgrade | Upgrades an ENSv2 registry to the deployment's latest implementation. |
resolver
| Action | Description |
|---|---|
create | Deploys an ENSv2 PermissionedResolver, optionally with records, and points a name at it. |
get (batchable) | Reads the resolver of an ENS name: its address, what kind of resolver it is, who may write to it and which record profiles it supports. |
getLink (batchable) | Reads which record set an ENS name uses on its PermissionedResolver. |
link | Links an ENS name to the records of another name on the same PermissionedResolver. |
resolve (batchable) | Calls the resolver of an ENS name with raw calldata through the Universal Resolver (ENSIP-10). |
set | Points an ENS name at a resolver. |
upgrade | Upgrades the PermissionedResolver of an ENS name to a newer implementation. |
role
| Action | Description |
|---|---|
get (batchable) | Reads the ENSv2 roles an account holds on a name, or at the root of a registry or resolver. |
grant | Grants ENSv2 roles to an account on a name, or at the root of a registry or resolver. |
revoke | Revokes ENSv2 roles from an account on a name, or at the root of a registry or resolver. |
subname
| Action | Description |
|---|---|
create | Creates a subname, routed by its parent: an ENSv2 subregistry, the ENSv1 registry or the NameWrapper. |
remove | Removes a subname. |
update | Changes a subname from its parent: owner, resolver or expiry, in one plan. |
wrapper
| Action | Description |
|---|---|
getFuses (batchable) | Reads the NameWrapper owner, fuses and expiry of an ENSv1 name. |
setChildFuses | Burns fuses on, or extends, a wrapped ENSv1 subname as its parent's owner. |
setFuses | Burns owner-controlled fuses on a wrapped ENSv1 name. |
unwrap | Unwraps an ENSv1 name from the NameWrapper. |
wrap | Wraps an ENSv1 name in the NameWrapper. |
Was this page helpful?