> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endstate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# useClaim

> Claim ownership of the tapped item in a single call - into the provisioned wallet by default - with status that drives the UI to settlement.

```ts theme={null}
function useClaim(): {
  claim: (args?: {
    to?: string;
    execution?: "endstate_relay" | "client_broadcast";
    idempotencyKey?: string;
    wait?: boolean;
  }) => Promise<Claim>;
  status: ClaimStatus;
  data: Claim | null;
  error: Error | null;
  reset: () => void;
};

type ClaimStatus =
  | "idle"
  | "claiming"
  | "settling"
  | "claimed"
  | "expired"
  | "failed"
  | "error";
```

Claiming is the first assignment of ownership out of a tap: the item has no prior owner, so Endstate signs and submits it for you and claiming is a single call. `useClaim` runs that call against the active session [`useSession`](/sdks/web/reference/react/useSession) holds. Call `claim()` with no arguments and it claims into the wallet [`EndstateProvider`](/sdks/web/reference/react/EndstateProvider) provisioned - it resolves the recipient address from the wallet for you.

`status` drives the UI from the button press to settlement: `claiming` while the request is in flight, `settling` once the claim is submitted and confirming, then the terminal `claimed`, `expired`, or `failed`. By default `claim()` polls to that terminal status before resolving.

## Example

```tsx theme={null}
"use client";
import { useSession, useClaim } from "@endstate-sdk/web/react";

export function ClaimButton() {
  const { item } = useSession();
  const { claim, status, error } = useClaim();

  if (!item) return null;
  if (status === "claimed") return <p>Yours. Enjoy {item.name}.</p>;

  return (
    <div>
      <button
        onClick={() => claim()}
        disabled={status === "claiming" || status === "settling"}
      >
        {status === "settling" ? "Finishing..." : "Claim this item"}
      </button>
      {status === "error" && <p>Could not claim: {error?.message}</p>}
    </div>
  );
}
```

`claim()` with no `to` claims into the provisioned wallet. Pass `to` to claim into an address the customer already brings:

```tsx theme={null}
await claim({ to: "0x..." });
```

## The claim call

<ParamField body="to" type="string">
  The recipient's EVM wallet address. Omit it and the hook resolves the address
  from the provider's wallet
  ([`useWallet`](/sdks/web/reference/react/useWallet)), the common path for a
  customer who brings none of their own.
</ParamField>

<ParamField body="execution" type="&#x22;endstate_relay&#x22; | &#x22;client_broadcast&#x22;" default="endstate_relay">
  How the claim is submitted. The default, `endstate_relay`, has Endstate submit
  it for you - the single-call path this page shows. `client_broadcast` returns
  a payload for you to broadcast yourself; that mode is a core concern, covered
  in [`session.claims.create`](/sdks/core/reference/session-claims/create).
</ParamField>

<ParamField body="idempotencyKey" type="string">
  Makes the claim safe to retry. Replaying the same key with the same body
  returns the original claim; omit it and core generates one.
</ParamField>

<ParamField body="wait" type="boolean" default="true">
  When `true` (the default), `claim()` polls to a terminal status before it
  resolves, so `status` and `data` land settled. Set it to `false` to resolve as
  soon as the claim is submitted and observe settlement through `status`.
</ParamField>

## Returns

<ResponseField name="claim" type="(args?) => Promise<Claim>">
  Creates the claim and, unless `wait` is `false`, polls it to settlement.
  Rejects with a typed error; throws if there is no active session yet.
</ResponseField>

<ResponseField name="status" type="ClaimStatus">
  `"idle"` before a claim, `"claiming"` while the request is in flight,
  `"settling"` once submitted and confirming, then terminal `"claimed"`,
  `"expired"`, or `"failed"`; `"error"` when the call throws. On `"expired"` or
  `"failed"`, call `claim()` again for a fresh claim.
</ResponseField>

<ResponseField name="data" type="Claim | null">
  The latest claim resource, updated as it settles, or `null` before the first
  call.
</ResponseField>

<ResponseField name="error" type="Error | null">
  The failure that moved `status` to `"error"`, or `null`. Branch on the error
  `code`; see [Errors and retries](/sdks/core/errors-and-retries).
</ResponseField>

<ResponseField name="reset" type="() => void">
  Clears `status`, `data`, and `error` back to idle and aborts an in-flight
  settlement poll. Use it to let the customer start over.
</ResponseField>

## See also

<CardGroup cols={2}>
  <Card title="Claim ownership" icon="hand" href="/sdks/web/claim">
    The claim flow, settlement, and idempotency in prose.
  </Card>

  <Card title="useTransfer" icon="repeat" href="/sdks/web/reference/react/useTransfer">
    Move an item between existing owners - the sibling action.
  </Card>

  <Card title="session.claims.create" icon="arrow-right-left" href="/sdks/core/reference/session-claims/create">
    The request body, the client\_broadcast mode, and every error code.
  </Card>

  <Card title="Claim a unit" icon="list-check" href="/guides/claim-a-unit">
    The credential-neutral walkthrough and full error matrix.
  </Card>
</CardGroup>
