# Withdrawal.toRpc

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

## Imports

:::code-group
```ts [Named]
import { Withdrawal } from 'ox'
```

```ts [Entrypoint]
import * as Withdrawal from 'ox/Withdrawal'
```
:::

## Examples

```ts twoslash
import { Withdrawal } from 'ox'

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
```

**Source:** [src/core/Withdrawal.ts](https://github.com/wevm/ox/blob/main/src/core/Withdrawal.ts#L92)

## Parameters

### withdrawal

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

The Withdrawal to convert.

## Return Type

An RPC Withdrawal.

`Rpc`
