# Withdrawal.fromRpc

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

## 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.fromRpc({
  address: '0x00000000219ab540356cBB839Cbe05303d7705Fa',
  amount: '0x620323',
  index: '0x0',
  validatorIndex: '0x1'
})
// @log: {
// @log:   address: '0x00000000219ab540356cBB839Cbe05303d7705Fa',
// @log:   amount: 6423331n,
// @log:   index: 0,
// @log:   validatorIndex: 1
// @log: }
```

## Definition

```ts
function fromRpc(
  withdrawal: Rpc,
): Withdrawal
```

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

## Parameters

### withdrawal

* **Type:** `Rpc`

The RPC withdrawal to convert.

## Return Type

An instantiated [`Withdrawal.Withdrawal`](/api/Withdrawal/types#withdrawal).

`Withdrawal`
