CCXT.WS.URLRouting (ccxt_client v0.6.1)

Copy Markdown View Source

Pure URL resolution for WebSocket endpoints.

Given a %CCXT.Exchange{}, returns the public or private WS URL appropriate for the current sandbox flag, with {hostname} interpolated from exchange.hostname.

URLs come from CCXT.WS.Config today. When ccxt_extract starts emitting runtime.describe.urls.api.ws this module will read from the spec instead.

Summary

Functions

Private WS URL for the given exchange, or nil if the exchange has no WS config or no private endpoint.

Public WS URL for the given exchange, or nil if the exchange has no WS config.

Functions

private_url(exchange)

@spec private_url(CCXT.Exchange.t()) :: String.t() | nil

Private WS URL for the given exchange, or nil if the exchange has no WS config or no private endpoint.

public_url(exchange)

@spec public_url(CCXT.Exchange.t()) :: String.t() | nil

Public WS URL for the given exchange, or nil if the exchange has no WS config.

Honors exchange.sandbox — returns the sandbox URL when the flag is true and a sandbox URL is configured.