# `Cartouche.Block.Withdrawal`
[🔗](https://github.com/zenhive/cartouche/blob/main/lib/cartouche/block.ex#L17)

A validator withdrawal entry from a post-Shanghai block (EIP-4895).

Embedded in `Cartouche.Block.t().withdrawals` when the block is
post-Shanghai (block ≥ 17,034,870 on mainnet).

# `t`

```elixir
@type t() :: %Cartouche.Block.Withdrawal{
  address: &lt;&lt;_::160&gt;&gt;,
  amount: integer(),
  index: integer(),
  validator_index: integer()
}
```

# `deserialize`

```elixir
@spec deserialize(map()) :: t() | no_return()
```

Deserializes a withdrawal object from JSON-RPC.

## Examples

    iex> use Cartouche.Hex
    iex> %{
    ...>   "index" => "0x4d8f7d",
    ...>   "validatorIndex" => "0xc8a5f",
    ...>   "address" => "0x1f9090aae28b8a3dceadf281b0f12828e676c326",
    ...>   "amount" => "0x111c8c2"
    ...> }
    ...> |> Cartouche.Block.Withdrawal.deserialize()
    %Cartouche.Block.Withdrawal{
      index: 0x4d8f7d,
      validator_index: 0xc8a5f,
      address: ~h[0x1f9090aae28b8a3dceadf281b0f12828e676c326],
      amount: 0x111c8c2
    }

---

*Consult [api-reference.md](api-reference.md) for complete listing*
