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

# estimateConduit

Estimates the output of a conduit operation given an input asset and mode.

## Import

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

## Usage

```ts
import { createPublicClient, http } from 'viem'
import { base } from 'viem/chains'
import { estimateConduit, ConduitMode, EstimationType } from '@railnetorg/railnet-sdk'

const client = createPublicClient({
  chain: base,
  transport: http(),
})

const estimatedAsset = await estimateConduit(client, {
  conduit: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
  asset: { asset: '0x6B175474E89094C44Da98b954EedeAC495271d0F', value: 1000000000000000000n },
  mode: ConduitMode.DEPOSIT,
  estimationType: EstimationType.OUTPUT,
})
```

## Returns

[`Asset`](/types/Asset)

The estimated output asset.

```ts
type Asset = {
  asset: Address
  value: bigint
}
```

## Parameters

### conduit

* **Type:** `Address`

The address of the conduit contract.

```ts
const estimatedAsset = await estimateConduit(client, {
  conduit: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', // [!code focus]
  asset: { ... },
  mode: ConduitMode.DEPOSIT,
  estimationType: EstimationType.OUTPUT,
})
```

### asset

* **Type:** `Asset`

The input asset for the estimation. See [`Asset`](/types/Asset).

```ts
const estimatedAsset = await estimateConduit(client, {
  conduit: '0x...',
  asset: { asset: '0x...', value: 1000000000000000000n }, // [!code focus]
  mode: ConduitMode.DEPOSIT,
  estimationType: EstimationType.OUTPUT,
})
```

### mode

* **Type:** `ConduitMode`

The conduit mode for the estimation. See [`Enums`](/types/Enums).

```ts
const estimatedAsset = await estimateConduit(client, {
  conduit: '0x...',
  asset: { ... },
  mode: ConduitMode.DEPOSIT, // [!code focus]
  estimationType: EstimationType.OUTPUT,
})
```

### estimationType

* **Type:** `EstimationType`

The type of estimation to perform. See [`Enums`](/types/Enums).

```ts
const estimatedAsset = await estimateConduit(client, {
  conduit: '0x...',
  asset: { ... },
  mode: ConduitMode.DEPOSIT,
  estimationType: EstimationType.OUTPUT, // [!code focus]
})
```
