Shared request dispatcher for generated exchange endpoint functions.
All generated endpoint functions delegate to call/4, which handles:
- Path interpolation — replaces
{param}templates with values from params - Base URL resolution — navigates
exchange.base_urlsusing endpoint sections - Signing — authenticates private endpoint requests via
CCXT.Signing.sign/4 - HTTP delegation — calls
CCXT.HTTP.request/4orCCXT.HTTP.signed_request/4
Future phases
- Phase 5: Response parsing (field mapping to unified structs)
- Task 17: Symbol denormalization (unified → exchange-specific format)
Summary
Types
Compile-time endpoint configuration from spec
Functions
Dispatches a request to an exchange endpoint.
Replaces {param} placeholders in path with values from params, returning remaining params.
Navigates base_urls using endpoint sections to find the appropriate base URL.
Types
Functions
@spec call(CCXT.Exchange.t(), endpoint_config(), map(), keyword()) :: {:ok, CCXT.HTTP.response()} | {:error, CCXT.Error.t()}
Dispatches a request to an exchange endpoint.
Resolves the base URL from the endpoint's sections, interpolates path
templates, and delegates to CCXT.HTTP.request/4.
Parameters
exchange—%CCXT.Exchange{}runtime configurationendpoint_config— compile-time endpoint map with:name,:method,:path,:sections,:weightparams— request parameters (query for GET/HEAD/DELETE, body for POST/PUT/PATCH)opts— passed through toCCXT.HTTP.request/4(:timeout,:headers, etc.)
Examples
config = %{name: :public_get_v5_market_tickers, method: :get,
path: "v5/market/tickers", sections: ["public"], weight: 5}
CCXT.Dispatch.call(exchange, config, %{"category" => "spot"})
Replaces {param} placeholders in path with values from params, returning remaining params.
Navigates base_urls using endpoint sections to find the appropriate base URL.