pub struct Config {
pub rest_api_endpoint: Cow<'static, str>,
pub ws_endpoint: Cow<'static, str>,
pub recv_window: u64,
}Expand description
Configuration for the Limitless Exchange API client.
Controls the REST API endpoint, WebSocket endpoint, and receive window for HMAC-signed request validation.
Fields§
§rest_api_endpoint: Cow<'static, str>Base URL for REST API requests.
ws_endpoint: Cow<'static, str>WebSocket endpoint for real-time streams.
recv_window: u64Maximum permissible age of a request in milliseconds (default: 5000).
Implementations§
Source§impl Config
impl Config
Sourcepub const DEFAULT_REST_API_ENDPOINT: &str = "https://api.limitless.exchange"
pub const DEFAULT_REST_API_ENDPOINT: &str = "https://api.limitless.exchange"
Default mainnet REST API endpoint.
Sourcepub const DEFAULT_WS_ENDPOINT: &str = "wss://ws.limitless.exchange/markets"
pub const DEFAULT_WS_ENDPOINT: &str = "wss://ws.limitless.exchange/markets"
Default mainnet WebSocket endpoint.
Sourcepub fn new(
rest_api_endpoint: impl AsRef<str>,
ws_endpoint: impl AsRef<str>,
recv_window: impl Into<u64>,
) -> Self
pub fn new( rest_api_endpoint: impl AsRef<str>, ws_endpoint: impl AsRef<str>, recv_window: impl Into<u64>, ) -> Self
Create a new Config with custom endpoints and receive window.
Use this when you need to point to a staging environment or adjust the timing tolerance for signed requests.
Sourcepub const fn default() -> Self
pub const fn default() -> Self
Returns the default mainnet configuration.
REST: https://api.limitless.exchange
WS: wss://ws.limitless.exchange/markets
Recv window: 5000 ms
Sourcepub fn set_recv_window(self, recv_window: u64) -> Self
pub fn set_recv_window(self, recv_window: u64) -> Self
Set a custom receive window (in milliseconds).
The receive window controls how far from server time a request timestamp may deviate before being rejected.