> For the complete documentation index, see [llms.txt](https://docs.hatsprotocol.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hatsprotocol.xyz/for-developers/v1-sdk/core/claiming-hats.md).

# Claiming Hats

Hats can be made claimable by using the [Multi Claims Hatter](/hats-integrations/hatter-modules/making-hats-claimable.md) module.

The following functions support the claiming functionality enabled by this module.

### <mark style="color:purple;">accountCanClaim</mark>

Check whether an account can claim a given hat.

```typescript
const canClaim = await hatsClient.accountCanClaim({
    hatId,
    account,
});
```

***Arguments***:

```typescript
{
    hatId: bigint;
    account: Address;
}
```

* `hatId` - The hat ID to claim. &#x20;
* `account` - The claiming account's address.

***Response***:

```typescript
boolean
```

`true` if can claim, `false` otherwise.

### <mark style="color:purple;">canClaimForAccount</mark>

Check whether a hat can be claimed on behalf of a given account.

```typescript
const canClaimFor = await hatsClient.canClaimForAccount({
    hatId,
    account,
});
```

***Arguments***:

```typescript
{
    hatId: bigint;
    account: Address;
}
```

* `hatId` - The hat ID to claim-for. &#x20;
* `account` - The account address to claim on behalf of.

***Response***:

```typescript
boolean
```

`true` if can claim-for, `false` otherwise.

### <mark style="color:purple;">claimHat</mark>

Claim a hat for the calling account.

```typescript
const claimHatResult = await hatsClient.claimHat({
    account,
    hatId,
});
```

***Arguments***:

```typescript
{
    account: Account | Address;
    hatId: bigint;
}
```

* `account` - Viem account (Address for JSON-RPC accounts or Account for other types).
* `hatId` - ID of the hat to claim.

***Response***:

```typescript
{
  status: "success" | "reverted";
  transactionHash: `0x${string}`;
}
```

* `status` - "success" if transaction was successful, "reverted" if transaction reverted.
* `transactionHash` - transaction's hash.

### <mark style="color:purple;">claimHatFor</mark>

Claim a hat on behalf of a chosen account.

```typescript
const claimHatForResult = await hatsClient.claimHatFor({
    account,
    hatId,
    wearer,
});
```

***Arguments***:

```typescript
{
    account: Account | Address;
    hatId: bigint;
    wearer: Address;
}
```

* `account` - Viem account (Address for JSON-RPC accounts or Account for other types).
* `hatId` - ID of the hat to claim-for.
* `wearer` - Address for which to claim the hat for.

***Response***:

```typescript
{
  status: "success" | "reverted";
  transactionHash: `0x${string}`;
}
```

* `status` - "success" if transaction was successful, "reverted" if transaction reverted.
* `transactionHash` - transaction's hash.

### <mark style="color:purple;">multiClaimHatFor</mark>

Claim a hat on behalf of multiple accounts.

```typescript
const claimHatForResult = await hatsClient.multiClaimHatFor({
    account,
    hatId,
    wearers,
});
```

***Arguments***:

```typescript
{
    account: Account | Address;
    hatId: bigint;
    wearers: Address[];
}
```

* `account` - Viem account (Address for JSON-RPC accounts or Account for other types).
* `hatId` - ID of the hat to claim-for.
* `wearers` - Addresses for which to claim the hat for.

***Response***:

```typescript
{
  status: "success" | "reverted";
  transactionHash: `0x${string}`;
}
```

* `status` - "success" if transaction was successful, "reverted" if transaction reverted.
* `transactionHash` - transaction's hash.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hatsprotocol.xyz/for-developers/v1-sdk/core/claiming-hats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
