> **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.

# redeemConduit

Redeems shares from a conduit. Requires a `WalletClient` to sign and send the transaction.

:::info
This action needs no approval and sends a single transaction. The conduit burns the caller's shares through an internal transfer, which never goes through `transferFrom`.
:::

## Import

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

## Usage

```ts
import { createWalletClient, http } from 'viem'
import { base } from 'viem/chains'
import { redeemConduit } from '@railnetorg/railnet-sdk'

const walletClient = createWalletClient({
  chain: base,
  transport: http(),
})

const hash = await redeemConduit(walletClient, {
  conduit: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
  shares: 500000000000000000n,
  account: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
})
```

## Returns

`Hash`

The transaction hash of the redeem transaction.

## Parameters

### conduit

* **Type:** `Address`

The address of the conduit contract.

```ts
const hash = await redeemConduit(walletClient, {
  conduit: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', // [!code focus]
  shares: 500000000000000000n,
  account: '0x...',
})
```

### shares

* **Type:** `bigint`

The number of shares to redeem.

```ts
const hash = await redeemConduit(walletClient, {
  conduit: '0x...',
  shares: 500000000000000000n, // [!code focus]
  account: '0x...',
})
```

### account

* **Type:** `Address`

The address of the account executing the transaction.

```ts
const hash = await redeemConduit(walletClient, {
  conduit: '0x...',
  shares: 500000000000000000n,
  account: '0xd2135CfB216b74109775236E36d4b433F1DF507B', // [!code focus]
})
```

### receiver (optional)

* **Type:** `Address`

The address to receive the output. Defaults to the account address.

```ts
const hash = await redeemConduit(walletClient, {
  conduit: '0x...',
  shares: 500000000000000000n,
  account: '0x...',
  receiver: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', // [!code focus]
})
```

### outputAsset (optional)

* **Type:** `Asset`

The expected output assets from the redemption.

```ts
const hash = await redeemConduit(walletClient, {
  conduit: '0x...',
  shares: 500000000000000000n,
  account: '0x...',
  outputAsset: { asset: '0x...', value: 100n }, // [!code focus]
})
```

### salt (optional)

* **Type:** `Hex`

Source salt for the query. Defaults to a [`randomSalt`](/utilities/randomSalt). Pass it explicitly
to log the value and replay a failed transaction. Required on
[`prepareRedeemConduit`](/actions/preparedWrites).

```ts
const hash = await redeemConduit(walletClient, {
  conduit: '0x...',
  shares: 500000000000000000n,
  account: '0x...',
  salt: '0x1234...', // [!code focus]
})
```
