registration.getCommitmentStatus
Reads where a registration commitment is in its window. Parameters, return value, errors and examples for registration.getCommitmentStatus in @ensforge/sdk.
Reads where a registration commitment is in its window.
When to use
Use to show a countdown between registration.commit and registration.register.
Details
pending: too new to register;ready: register now;expired: commit again.unknown: never made, or already used by a registration.
Signature
function getCommitmentStatus(
client: Like,
options: getCommitmentStatus.Options,
): Promise<getCommitmentStatus.ReturnType>Call it as ens.registration.getCommitmentStatus(options) on a client, or Actions.registration.getCommitmentStatus(client, options).
registration.getCommitmentStatus.request(options) builds a deferred read for Actions.batch. See Look up many at once.
Parameters
| Option | Type | Default | Description |
|---|---|---|---|
commitment (required) | Hex | Commitment hash returned by registration.commit. |
Also takes the read options.
Returns
Resolves to getCommitmentStatus.ReturnType. The status and the window's timestamps (null when unknown).
| Field | Type | Description |
|---|---|---|
status | "pending" | "ready" | "expired" | "unknown" | |
committedAt | bigint | null | |
readyAt | bigint | null | |
expiresAt | bigint | null |
Errors
| Error | Codes | When |
|---|---|---|
InvalidInputError | INVALID_RECORD_VALUE | the commitment is not 32 bytes. |
UnsupportedError | UNSUPPORTED_ON_DEPLOYMENT | without ENSv2. |
NetworkError | RPC_REQUEST_FAILED, RPC_TIMEOUT, 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.
Examples
const { status, readyAt } = await ens.registration.getCommitmentStatus({ commitment })See also
registration.committo make one
Was this page helpful?