> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://ensforge.com/api/mcp` to find what you need.

# Resumable registration

An HCA must exist before the registration workflow starts. The workflow persists the secret,
commitment, authorization route and spending limits before submission. It commits, waits for the
minimum age, checks funding and updated pricing, then reveals the registration with the required
owner role grant and optional primary-name operation.

```ts
const operation = await sdk.hca.startHcaRegistration({
  hca,
  name: "example.eth",
  duration: 31_536_000n,
  resolver,
  paymentToken,
  authorization: { kind: "owner" },
  limits: { registrationPrice: maximumPrice, fees: [] },
});

const current = await sdk.hca.getHcaRegistration({ id: operation.id });
const next = await sdk.hca.resumeHcaRegistration({ id: operation.id });
```

With config `storage`, omit `id` and the SDK matches unfinished registrations using normalized inputs
and a generated instance ID. Retrying the same start preserves the secret. Supplying a new explicit
ID starts a new registration record; duplicate explicit IDs are rejected. Once an operation is
terminal, a subsequent implicit start creates another instance and performs normal availability checks.

## Inputs

Required: `hca`, `name`, `duration`, `resolver`, `paymentToken`, `authorization`, and `limits`.
Optional: `id`, `salt`, `subregistry`, `referrer`, `primaryName`, `execution`, `signerReference`, `storage`.
Prices and amounts use token base units; durations use seconds. `fees: []` authorizes no nonzero
execution fees. Add explicit per-chain, per-token fee limits when using an unsponsored route.

For sessions use `{ kind: "session", permissionId, enableTransactionHash }` and the matching
`execution` adapter. The owner route omits `execution`, or supplies Pimlico with owner authorization.
Store a server-resolvable `signerReference` only when the application explicitly provisions signer custody.

## Progress and UI behavior

| Status                           | Next step                                                             |
| -------------------------------- | --------------------------------------------------------------------- |
| `created`                        | Advance the saved workflow                                            |
| `submitting`                     | Reconcile; broadcast may have happened even without a saved reference |
| `submitted`                      | Poll `getHcaRegistration`; do not submit again                        |
| `waiting`                        | Resume after `readyAt`, before `expiresAt`                            |
| `needs-funding`                  | Show `token`, `required`, `balance`; fund the HCA, then resume        |
| `needs-review`                   | Show the reason; explicitly accept revised limits if appropriate      |
| `needs-authorization`            | Restore or explicitly replace the session authorization               |
| `registered`                     | Show the registration transaction hash                                |
| `cancelled`, `failed`, `expired` | Inspect the reason; do not blindly retry the same submission          |

A single call can pause. Keep presenting the saved ID and current status. `getHcaRegistration` may
reconcile external status and persist a revision; it is more than a raw storage read.

## Recovery and cancellation

`resumeHcaRegistration` optionally accepts new `limits`, `authorization`, `signerReference`, or a
recovered `submission`. Core validates identity and tracking information before continuing. Adapter
submissions need the same compatible adapter configuration and its serialization codec.

`cancelHcaRegistration({ id, execution? })` cancels eligible local work. It cannot undo a mined
commitment, reclaim paid gas, stop an already broadcast transaction, or revoke a destination session.
An abort signal only stops local work/waiting. Unknown broadcasts must be reconciled; deleting the
record and starting again loses the protection against duplicate submission.

The registration record contains a secret. Do not render it in UI, analytics, logs, URLs or public API
responses. Use the [remote boundary](/hca/remote) for server-owned operations.
