pub struct Client {
pub api_key: Option<String>,
pub secret_key: Option<String>,
pub host: String,
pub inner_client: Client,
}Expand description
The main HTTP/WebSocket client for the Limitless Exchange API.
Handles HMAC-SHA256 request signing using the scoped token format:
Canonical message: {ISO-8601 timestamp}\n{HTTP METHOD}\n{request path + query}\n{body}
Headers: lmts-api-key, lmts-timestamp (ISO-8601), lmts-signature (Base64).
Also supports legacy X-API-Key authentication for backward compatibility.
Fields§
§api_key: Option<String>Token ID (for scoped tokens) or legacy API key.
secret_key: Option<String>Base64-encoded secret (for scoped HMAC tokens).
Set to None to fall back to legacy X-API-Key auth.
host: StringBase URL of the Limitless Exchange API.
inner_client: ClientThe inner reqwest HTTP client with connection pooling.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(
api_key: Option<String>,
secret_key: Option<String>,
host: String,
) -> Self
pub fn new( api_key: Option<String>, secret_key: Option<String>, host: String, ) -> Self
Create a new Client.
pub async fn get<T: DeserializeOwned + Send + 'static>( &self, url_path: &str, request: Option<String>, ) -> Result<T, LimitlessError>
pub async fn get_signed<T: DeserializeOwned + Send + 'static>( &self, url_path: &str, request: Option<String>, ) -> Result<T, LimitlessError>
pub async fn post_signed<T: DeserializeOwned + Send + 'static>( &self, url_path: &str, raw_request_body: Option<String>, ) -> Result<T, LimitlessError>
pub async fn delete_signed<T: DeserializeOwned + Send + 'static>( &self, url_path: &str, ) -> Result<T, LimitlessError>
Sourcepub async fn wss_connect(
&self,
_request: Option<String>,
authenticated: bool,
_timeout_secs: Option<u64>,
) -> Result<WebSocketStream<MaybeTlsStream<TcpStream>>, LimitlessError>
pub async fn wss_connect( &self, _request: Option<String>, authenticated: bool, _timeout_secs: Option<u64>, ) -> Result<WebSocketStream<MaybeTlsStream<TcpStream>>, LimitlessError>
Establish a raw WebSocket connection to the Limitless Socket.IO endpoint.
Connects to wss://ws.limitless.exchange/socket.io/?EIO=4&transport=websocket
and returns a WebSocketStream ready for reading/writing. The caller is
responsible for the Socket.IO protocol framing (Engine.IO open, namespace
connect, event emit/receive) on top of this stream.
§Arguments
_request— Optional initial subscription payload (sent as Socket.IO frame).authenticated— Iftrue, theX-API-Keyheader is sent with the WebSocket upgrade request, enabling private channels (positions, order events) that require authentication._timeout_secs— Optional connection timeout.