Bourse.RecordedResponseFixtures.LighterMarket (bourse v0.1.0)

Copy Markdown View Source

Shared Lighter market-id resolution for the recording and acceptance fixtures.

Lighter's private read and order params carry the integer market_id (and an integer account_index), which both the live-recording capture and the exchange-acceptance rebuild resolve from a loaded %Bourse.Market{} set. The lookup lives here so the two fixture paths share one definition (task 521).

Summary

Functions

Coerces a Lighter credential/market identifier to the integer the API expects.

Resolves the integer Lighter market id for symbol from a loaded market set.

Functions

credential_integer!(value)

@spec credential_integer!(integer() | String.t()) :: integer()

Coerces a Lighter credential/market identifier to the integer the API expects.

market_id(markets, symbol)

@spec market_id([Bourse.Market.t()], String.t()) ::
  {:ok, integer()} | {:error, {:unknown_lighter_market, String.t()}}

Resolves the integer Lighter market id for symbol from a loaded market set.