Compile-time exchange lookup registry.
Maps exchange ID atoms and strings to their generated module names. Built from the spec manifest at compile time — recompiles automatically when the manifest changes.
Usage
CCXT.Registry.lookup(:bybit)
#=> {:ok, CCXT.Bybit}
CCXT.Registry.lookup!("binance")
#=> CCXT.Binance
CCXT.Registry.exchanges()
#=> ["aftermath", "alpaca", "apex", ...]
CCXT.Registry.loaded?(:bybit)
#=> true # if CCXT.Bybit module is compiled
Summary
Functions
Returns all registered exchange IDs as strings.
Checks if the exchange module is compiled and loaded.
Looks up the module for an exchange ID.
Looks up the module for an exchange ID, raising on unknown.
Returns the module for an exchange ID, or nil if unknown.
Checks if an exchange ID is registered.
Functions
@spec exchanges() :: [String.t()]
Returns all registered exchange IDs as strings.
Examples
CCXT.Registry.exchanges()
#=> ["aftermath", "alpaca", "apex", ...]
Checks if the exchange module is compiled and loaded.
Returns true only if the exchange is registered AND its module is available in the BEAM. Useful for distinguishing "known exchange" from "exchange module exists."
Examples
CCXT.Registry.loaded?(:bybit)
#=> true # if CCXT.Bybit is compiled
Looks up the module for an exchange ID.
Accepts both string and atom IDs.
Examples
CCXT.Registry.lookup("bybit")
#=> {:ok, CCXT.Bybit}
CCXT.Registry.lookup(:unknown)
#=> {:error, {:unknown_exchange, "unknown"}}
Looks up the module for an exchange ID, raising on unknown.
Examples
CCXT.Registry.lookup!(:bybit)
#=> CCXT.Bybit
Returns the module for an exchange ID, or nil if unknown.
Examples
CCXT.Registry.module_for("bybit")
#=> CCXT.Bybit
CCXT.Registry.module_for("nope")
#=> nil
Checks if an exchange ID is registered.
Examples
CCXT.Registry.registered?(:bybit)
#=> true