> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://sdk.railnet.org/api/mcp` to find what you need.

# useRedeemConduitCall

Resolves a redeem call and the salt its query will carry, as a TanStack Query result.

* Reads the conduit's underlying asset; sends nothing. See [Call builders](/actions/callBuilders).

## Import

```ts
import { useRedeemConduitCall } from '@railnetorg/railnet-sdk/react'
```

## Usage

```tsx
import { randomSalt } from '@railnetorg/railnet-sdk'
import { useConduitPosition, useRedeemConduitCall } from '@railnetorg/railnet-sdk/react'
import { useState } from 'react'
import { useAccount, useSimulateContract, useWriteContract } from 'wagmi'

export function RedeemAllButton({ conduit }: { conduit: Address }) {
  const { address } = useAccount()
  const [salt] = useState(() => randomSalt())
  const { data: position } = useConduitPosition({ conduit, account: address })

  const { data: redeem } = useRedeemConduitCall({
    conduit,
    shares: position?.shares ?? 0n,
    sender: address,
    salt,
    enabled: Boolean(position?.shares),
  })

  const { data: simulation } = useSimulateContract({ ...redeem?.call })
  const { writeContract } = useWriteContract()

  return (
    <button onClick={() => simulation && writeContract(simulation.request)} disabled={!simulation}>
      Redeem all
    </button>
  )
}
```

No approval is needed; the conduit burns the caller's shares.

## Returns

A TanStack Query result over `{ call, querySalt, outputAsset }`, with its `queryKey` attached.
`call` goes to wagmi's `useSimulateContract` and `useWriteContract`. See
[Sending from React](/guides/sendingFromReact).

There is no `queryId` before the transaction lands. Read it from the receipt with
[`extractQueryIds`](/utilities/receiptHelpers#extractqueryids), or join an indexer on `querySalt`.
See [`getRedeemConduitCall`](/actions/getRedeemConduitCall#returns).

## Parameters

Everything [`getRedeemConduitCall`](/actions/getRedeemConduitCall) takes, with `sender` allowed to
be `undefined` (the query is skipped until a wallet is connected), plus:

### chainId (optional)

* **Type:** `number`
* **Default:** the connected chain

### enabled (optional)

* **Type:** `boolean`
* **Default:** `true`

## Query options

[`redeemConduitCallQueryOptions`](/react/queryOptions) is this read as TanStack Query options, with
`redeemConduitCallQueryKey` and `redeemConduitCallQueryPrefix` for invalidation.

```ts
import { redeemConduitCallQueryOptions } from '@railnetorg/railnet-sdk/react'

await queryClient.prefetchQuery(redeemConduitCallQueryOptions(client, parameters))
```
