plan.resume
Continues a saved plan after a failure or a reload. Parameters, return value, errors and examples for plan.resume in @ensforge/sdk.
Continues a saved plan after a failure or a reload. Resolves once the remaining transactions are submitted.
When to use
Use when a registration, migration or other multi-step write stopped part-way. Use
resumeSync to wait for the receipts.
Details
- Steps submitted before are confirmed, not sent again; a dropped transaction or a failed bundle is sent again.
- Each remaining step is simulated against current state right before it is sent.
- The plan id is
result.plan.id, orcontext.planIdon a write's error. - A plan for another chain (an L2 primary name) resumes on that chain's clients from the
client's
chains.
Gotchas
- Plans live in the client's
storage: passPlan.localStorage()to survive page reloads.
Signature
function resume(
client: Like,
options: resume.Options & Write.Options,
): Promise<resume.ReturnType>Call it as ens.plan.resume(options) on a client, or Actions.plan.resume(client, options).
Parameters
| Option | Type | Default | Description |
|---|---|---|---|
id (required) | string | Plan id. |
Returns
Resolves to Write.Result. Submitted transaction hashes (earlier steps included) and the plan.
| Field | Type | Description |
|---|---|---|
hash | Hex | Hash of the last transaction. |
hashes | readonly Hex[] | Every submitted transaction, in order. |
id | string | EIP-5792 bundle id when the calls were sent as one batch. |
plan | Plan | The plan the write executed: its steps, in order, as they were submitted. |
Errors
| Error | Codes | When |
|---|---|---|
NotFoundError | PLAN_NOT_FOUND | an unknown plan. |
PlanError | PLAN_CHAIN_MISMATCH, PLAN_ACCOUNT_MISMATCH, PLAN_ROUTE_REQUIRED | the plan cannot continue here. |
PlanError | PLAN_INVALID | a saved plan cannot be read. |
ContractRevertError | CONTRACT_REVERTED | , or the failing step's own error (Errors.AnyError: a plan can hold any step), with context.planId and context.step. |
It can also fail with the errors every write can (Errors.WriteError: the common errors plus InsufficientFundsError, TransactionError, UnsupportedError, UserRejectedError, WalletError).
See How errors work.
Examples
const { hash } = await ens.plan.resume({ id: planId })Wait for the receipt with resumeSync
Continues a saved plan and resolves once every receipt is in.
Use when the next step depends on the plan being finished on-chain.
plan.resumeSync takes the same options plus confirmations and timeout.
Resolves to Write.SyncResult. Receipts plus the submitted hashes and plan.
const { receipts } = await ens.plan.resumeSync({ id })See also
plan.getto read its progress first
Was this page helpful?