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

# Claim rZFI

rZFI rewards accrue to the user's Safe on Base and are claimed by the owner
EOA. The claim is gas-sponsored and the SDK never signs: the backend prepares
the transaction, your integration signs one hash in its own pipeline, and the
backend submits it.

Requires an authenticated user session (`connectAccount()` or `forUser()`).

## Flow

1. Call `prepareRzfiClaim(userAddress)`. It returns `userOpHashToSign` and the
   `claimableAmount` (wei, 18 decimals).
2. Sign `userOpHashToSign` with the owner EOA as a `personal_sign` of the raw
   32-byte hash.
3. Call `submitRzfiClaim(userAddress, signature)` within 5 minutes. It returns
   the on-chain `txHash` once the claim lands.

```typescript theme={null}
const prepared = await sdk.prepareRzfiClaim(userAddress);

const signature = await walletClient.signMessage({
  account: userAddress,
  message: { raw: prepared.userOpHashToSign! },
});

const { txHash } = await sdk.submitRzfiClaim(userAddress, signature);
```

## `prepareRzfiClaim`

```typescript theme={null}
prepareRzfiClaim(userAddress: string): Promise<RzfiClaimResponse>
```

Throws when there is no rZFI to claim. A conflict error means the Merkl reward
tree is being updated on-chain; retry in a few minutes.

## `submitRzfiClaim`

```typescript theme={null}
submitRzfiClaim(userAddress: string, userOpSignature: Hex): Promise<RzfiClaimResponse>
```

Rejects a signature that is not from the owner EOA (the prepared claim is kept,
so you can sign again). Prepare again if the claim expired or reverted.

## `RzfiClaimResponse`

```typescript theme={null}
interface RzfiClaimResponse {
  success: boolean;
  status: "pending" | "claimed";
  safeAddress: Address;
  claimableAmount: string; // wei, 18 decimals
  userOpHashToSign?: Hex; // when pending
  userOperation?: Record<string, unknown>; // when pending, for verification
  txHash?: Hex; // when claimed
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.