# `Cartouche.Transaction.JsonField`
[🔗](https://github.com/zenhive/cartouche/blob/main/lib/cartouche/transaction.ex#L1372)

Shared JSON-field decoders used by `from_json/1` on V1/V2/V3/V4.

Tightly mirrors the `eth_getBlockBy*` wire shape — these helpers are
cross-module callable from each envelope's `from_json/1` and apply
consistent decode rules (padding signature words, handling pre-Berlin
`v` vs post-Berlin `yParity`, defensive `nil → []` for optional-on-wire
list fields).

# `decode_access_list`

```elixir
@spec decode_access_list(list() | nil) :: [{&lt;&lt;_::160&gt;&gt;, [&lt;&lt;_::256&gt;&gt;]}]
```

Decode an EIP-2930 access list (`[{address, storage_keys}]`).

Defensive `nil → []`: although `accessList` is required on the wire
for type 2/3/4 transactions, `from_json/1` is publicly callable and
tolerates omission to stay symmetric with other optional-on-wire
fields. Pass the parsed JSON value directly.

# `decode_authorization_list`

```elixir
@spec decode_authorization_list(list() | nil) :: [
  {non_neg_integer(), &lt;&lt;_::160&gt;&gt;, non_neg_integer(), boolean(), &lt;&lt;_::256&gt;&gt;,
   &lt;&lt;_::256&gt;&gt;}
]
```

Decode an EIP-7702 authorization list into a tuple of
`{chain_id, address, nonce, y_parity, r, s}` per entry.

Defensive `nil → []` for the same reason as `decode_access_list/1`.

# `decode_blob_versioned_hashes`

```elixir
@spec decode_blob_versioned_hashes(list() | nil) :: [&lt;&lt;_::256&gt;&gt;]
```

Decode an EIP-4844 blob-versioned-hashes list into 32-byte words.

Defensive `nil → []` for the same reason as `decode_access_list/1`.

# `decode_destination`

```elixir
@spec decode_destination(String.t() | nil) :: &lt;&lt;_::160&gt;&gt; | nil
```

Decode a `to` address from JSON.

Returns `nil` for contract-creation transactions (where `to` is omitted
or `null` on the wire) and a 20-byte binary otherwise.

# `decode_signature_word`

```elixir
@spec decode_signature_word(String.t()) :: &lt;&lt;_::256&gt;&gt;
```

Decode a 256-bit signature word (`r` or `s`) from hex.

Pads short hex values to a full 32 bytes — Geth and some other nodes
strip leading zeros from signature components, so `"0x1"` is a valid
on-wire representation of a word.

# `decode_y_parity`

```elixir
@spec decode_y_parity(map()) :: boolean()
```

Decode `yParity` (post-Berlin) or fall back to `v` (pre-Berlin) into a
boolean parity bit.

Raises `Cartouche.Hex.InvalidHex` if the value decodes to anything
other than 0 or 1.

---

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