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

# Withdrawal.toRpc

:::info
`Withdrawal.toRpc` is a re-export of ox's [`Withdrawal.toRpc`](https://oxlib.sh/api/Withdrawal/toRpc). Refer to the ox documentation for the full reference.
:::

Converts a [`Withdrawal.Withdrawal`](/docs/utilities/withdrawal/types#withdrawal) to an [`Withdrawal.Rpc`](/docs/utilities/withdrawal/types#rpc).

## Imports

```ts
import { Withdrawal } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Withdrawal } from 'viem/utils'

const withdrawal = Withdrawal.toRpc({
  address: '0x00000000219ab540356cBB839Cbe05303d7705Fa',
  amount: 6423331n,
  index: 0,
  validatorIndex: 1
})
// @log: {
// @log:   address: '0x00000000219ab540356cBB839Cbe05303d7705Fa',
// @log:   amount: '0x620323',
// @log:   index: '0x0',
// @log:   validatorIndex: '0x1',
// @log: }
```

## Definition

```ts
function toRpc(
  withdrawal: toRpc.Input,
): Rpc
```

## Parameters

### withdrawal

* **Type:** `toRpc.Input`

The Withdrawal to convert.

## Return Type

An RPC Withdrawal.

`Rpc`
