> For the complete documentation index, see [llms.txt](https://docs.yo.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yo.xyz/integrations/integration-guides/sdk/react/hooks/use-pending-redemptions.md).

# use pending redemptions

Query hook for fetching pending async redemptions for a user.

```tsx
const { pendingRedemptions, isLoading } = usePendingRedemptions({
  vault: 'yoETH',
  user: accountAddress,
})
```

## Usage

```tsx
import { usePendingRedemptions } from '@yo-protocol/react'
import { useAccount } from 'wagmi'

function PendingRedeems() {
  const { address } = useAccount()

  const { pendingRedemptions, isLoading, refetch } = usePendingRedemptions({
    vault: 'yoETH',
    user: address,
  })

  if (isLoading) return <p>Loading...</p>

  if (!pendingRedemptions?.assets && !pendingRedemptions?.shares) {
    return <p>No pending redemptions</p>
  }

  return (
    <div>
      {pendingRedemptions.assets && (
        <p>Pending assets: {pendingRedemptions.assets.formatted}</p>
      )}
      {pendingRedemptions.shares && (
        <p>Pending shares: {pendingRedemptions.shares.formatted}</p>
      )}
      <button onClick={() => refetch()}>Refresh</button>
    </div>
  )
}
```

## Options

| Option  | Type                 | Default | Description                                   |
| ------- | -------------------- | ------- | --------------------------------------------- |
| `vault` | `Address \| VaultId` | —       | **Required.** Target vault                    |
| `user`  | `Address`            | —       | User address to query pending redemptions for |

## Return Value

| Field                | Type                         | Description                                                            |
| -------------------- | ---------------------------- | ---------------------------------------------------------------------- |
| `pendingRedemptions` | `PendingRedeem \| undefined` | Pending redemption data with `assets` and `shares` as `FormattedValue` |
| `isLoading`          | `boolean`                    | `true` while the query is loading                                      |
| `isError`            | `boolean`                    | `true` if the query failed                                             |
| `error`              | `Error \| null`              | Error object                                                           |
| `refetch`            | `() => void`                 | Manually refetch pending redemptions                                   |

## Behavior

| Behavior       | Detail                                                          |
| -------------- | --------------------------------------------------------------- |
| **Stale time** | 30 seconds — pending redeems are polled relatively frequently   |
| **Enabled**    | Only runs when both the client and a user address are available |
| **Query key**  | `['yo-pending-redemptions', vaultAddress, user, chainId]`       |


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.yo.xyz/integrations/integration-guides/sdk/react/hooks/use-pending-redemptions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
