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

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

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

## Imports

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

## Examples

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

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

## Parameters

### withdrawal

* **Type:** `Rpc`

The RPC withdrawal to convert.

## Return Type

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

`Withdrawal`
