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

plan.resume

Continues a saved plan after a failure or a reload. Parameters, return value, errors and examples for plan.resume in @ensforge/sdk.

Signsstable
Since v1.0.0View source

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, or context.planId on 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: pass Plan.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

OptionTypeDefaultDescription
id (required)stringPlan id.

Returns

Resolves to Write.Result. Submitted transaction hashes (earlier steps included) and the plan.

FieldTypeDescription
hashHexHash of the last transaction.
hashesreadonly Hex[]Every submitted transaction, in order.
idstringEIP-5792 bundle id when the calls were sent as one batch.
planPlanThe plan the write executed: its steps, in order, as they were submitted.

Errors

ErrorCodesWhen
NotFoundErrorPLAN_NOT_FOUNDan unknown plan.
PlanErrorPLAN_CHAIN_MISMATCH, PLAN_ACCOUNT_MISMATCH, PLAN_ROUTE_REQUIREDthe plan cannot continue here.
PlanErrorPLAN_INVALIDa saved plan cannot be read.
ContractRevertErrorCONTRACT_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

Resuming after a failure
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.

Resuming and waiting
const { receipts } = await ens.plan.resumeSync({ id })

See also

Was this page helpful?