Applies v4 normalization field maps to exchange responses.
Summary
Functions
Applies a parser mapping to raw response data and builds the configured target struct.
Resolves the unified network code for a raw row against an authored network_code rule.
Types
Functions
@spec apply_mappings(term(), parser_config(), context()) :: parse_result()
Applies a parser mapping to raw response data and builds the configured target struct.
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