Capxul Docs
Concepts

Account lane

Understand the account-readiness branch nested inside Capxul identity state.

The account lane is not a second controller. It is the account branch of the canonical IdentityState returned by useCapxulIdentity.

type Readiness =
  | { at: "unknown" }
  | { at: "deriving"; step: "wallet" | "identity" | "provision" | "deploy" }
  | { at: "counterfactual"; address: string }
  | { at: "claiming"; address: string }
  | { at: "claimed"; address: string; org: OrgLane | null }
  | { at: "failed"; step: AccountStep; failure: Failure; retryable: boolean };

The shape encodes the ordering rule: Organization work exists only inside a claimed personal account. An app cannot observe or send Organization work before that state exists.

Render the lane

import { useCapxulAuth, useCapxulIdentity } from "@capxul/sdk-react";

function AccountGate() {
  const identity = useCapxulIdentity();
  const auth = useCapxulAuth();

  if (identity.phase !== "authenticated") return <AuthGate />;

  switch (identity.account.at) {
    case "unknown":
    case "deriving":
    case "counterfactual":
    case "claiming":
      return <AccountProgress account={identity.account} />;
    case "failed":
      return (
        <AccountFailure
          failure={identity.account.failure}
          retry={identity.account.retryable ? auth.retry : undefined}
        />
      );
    case "claimed":
      return <MoneyHome address={identity.account.address} />;
  }
}

useCapxulAuth().completePersonal(...) and Organization onboarding drive this lane through the identity machine. Apps render progress and may invoke the state-directed retry; they do not chain provisioning methods themselves.

Requirement ladder

CapxulProvider receives requirement="none", "counterfactual", or "deployed". Choose the lowest level the product needs. Balance and money-movement screens should require account.at === "claimed".

Continue with Requirements & signers or Build the auth flow.

On this page