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

# depositConduit

Deposits assets into a conduit. Requires a `WalletClient` to sign and send the transaction.

:::info
This action automatically checks the ERC-20 allowance of the deposit token. If the current allowance is insufficient, it will send an **approval transaction** before the deposit, resulting in two transactions total.
:::

## Import

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

## Usage

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

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

const hash = await depositConduit(walletClient, {
  conduit: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
  token: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
  amount: 1000000000000000000n,
  account: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
})
```

## Returns

`Hash`

The transaction hash of the deposit transaction.

## Parameters

### conduit

* **Type:** `Address`

The address of the conduit contract.

```ts
const hash = await depositConduit(walletClient, {
  conduit: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', // [!code focus]
  token: '0x...',
  amount: 1000000000000000000n,
  account: '0x...',
})
```

### token

* **Type:** `Address`

The address of the token to deposit.

```ts
const hash = await depositConduit(walletClient, {
  conduit: '0x...',
  token: '0x6B175474E89094C44Da98b954EedeAC495271d0F', // [!code focus]
  amount: 1000000000000000000n,
  account: '0x...',
})
```

### amount

* **Type:** `bigint`

The amount of tokens to deposit.

```ts
const hash = await depositConduit(walletClient, {
  conduit: '0x...',
  token: '0x...',
  amount: 1000000000000000000n, // [!code focus]
  account: '0x...',
})
```

### account

* **Type:** `Address`

The address of the account executing the transaction.

```ts
const hash = await depositConduit(walletClient, {
  conduit: '0x...',
  token: '0x...',
  amount: 1000000000000000000n,
  account: '0xd2135CfB216b74109775236E36d4b433F1DF507B', // [!code focus]
})
```

### receiver (optional)

* **Type:** `Address`

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

```ts
const hash = await depositConduit(walletClient, {
  conduit: '0x...',
  token: '0x...',
  amount: 1000000000000000000n,
  account: '0x...',
  receiver: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', // [!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
[`prepareDepositConduit`](/actions/preparedWrites).

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