Bourse.WS.Envelope (bourse v0.1.0)

Copy Markdown View Source

Builds WS message envelope config for routing inbound frames.

Reads websocket.dispatch.discriminators from the exchange spec and merges authored per-exchange envelope overrides (data field, unwrap_list, match_type).

Summary

Functions

Returns envelope config for an exchange, or nil when routing is unavailable.

Returns the match strategy for an exchange envelope.

Returns prefix channel keys that need prefix matching (e.g. OKX candle).

Types

envelope()

@type envelope() :: %{optional(String.t()) => term()}

Functions

for_exchange(exchange)

@spec for_exchange(Bourse.Exchange.t()) :: envelope() | nil

Returns envelope config for an exchange, or nil when routing is unavailable.

match_type(envelope)

@spec match_type(envelope() | nil) :: String.t()

Returns the match strategy for an exchange envelope.

prefix_channels(envelope)

@spec prefix_channels(envelope() | nil) :: [String.t()]

Returns prefix channel keys that need prefix matching (e.g. OKX candle).