# `Bourse.ResponseParser`
[🔗](https://github.com/ZenHive/bourse/blob/main/lib/bourse/response_parser.ex#L1)

Applies v4 normalization field maps to exchange responses.

# `context`

```elixir
@type context() :: map() | keyword()
```

# `parse_result`

```elixir
@type parse_result() :: {:ok, struct() | [struct()]} | {:error, term()}
```

# `parser_config`

```elixir
@type parser_config() :: map()
```

# `apply_mappings`

```elixir
@spec apply_mappings(term(), parser_config(), context()) :: parse_result()
```

Applies a parser mapping to raw response data and builds the configured target struct.

# `network_code_for_row`

```elixir
@spec network_code_for_row(term(), map()) :: String.t() | nil
```

Resolves the unified network code for a raw row against an authored `network_code` rule.

Public because row *selection* (choosing which raw row answers a requested network,
in the internal unified read-parse layer) must resolve the network exactly as the
field extraction does. Two implementations would let the selected row and its
parsed `network` disagree.

The authored alias table answers first; a chain it does not know is resolved
against the loaded currency catalog and the venue's network options, so a
network listed after the last authoring pass surfaces with its unified code.
Returns `nil` when neither knows the chain id. Carve C-T421 records the ordering.

    iex> rule = %{"network_aliases" => %{"USDT-TRC20" => "TRC20"}}
    iex> Bourse.ResponseParser.network_code_for_row(%{"chain" => "USDT-TRC20", "ccy" => "USDT"}, rule)
    "TRC20"

    iex> rule = %{"network_aliases" => %{"USDT-TRC20" => "TRC20"}}
    iex> Bourse.ResponseParser.network_code_for_row(%{"chain" => "USDT-Unlisted", "ccy" => "USDT"}, rule)
    nil

---

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