plan.get
Reads a saved plan and its progress. Parameters, return value, errors and examples for plan.get in @ensforge/sdk. Options, errors and examples for plan.get.
Reads a saved plan and its progress.
When to use
Use to show where a registration, migration or other multi-step write stands.
Details
- Every write saves its plan to the client's
storageas it sends. nullwhen no plan has the id (memory storage forgets plans on reload).
Signature
function get(client: Like, options: get.Options): Promise<get.ReturnType>Call it as ens.plan.get(options) on a client, or Actions.plan.get(client, options).
plan.get.request(options) builds a deferred read for Actions.batch. See Look up many at once.
Parameters
| Option | Type | Default | Description |
|---|---|---|---|
id (required) | string | Plan id, from result.plan.id or a failure's context.planId. |
Returns
Resolves to Plan.Record | null. The saved plan and its progress, or null.
| Field | Type | Description |
|---|---|---|
plan | Plan | |
status | "pending" | "completed" | "failed" | pending while steps remain, completed once every step is submitted. |
submitted | Readonly<globalThis.Record<string, readonly Hex[]>> | Transaction hashes per submitted step id. |
bundles | Readonly<globalThis.Record<string, string>> | EIP-5792 bundle id per step sent in a bundle. |
references (optional) | Readonly<globalThis.Record<string, string>> | Route references per step sent through via (e.g. UserOperation hashes). |
error (optional) | string | Message of the last failure. |
updatedAt | number | Unix time in milliseconds. |
Errors
| Error | Codes | When |
|---|---|---|
InternalError | UNEXPECTED | the storage fails. |
PlanError | PLAN_INVALID | a saved plan cannot be read. |
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 record = await ens.plan.get({ id: planId })See also
plan.resumeto continue it
Was this page helpful?