Skip to content

error authenticating for trade wss endpoint #2

@sbOogway

Description

@sbOogway

let auth_msg = WsAuthRequest {
req_id: uuid::Uuid::new_v4().to_string(),
op: "auth".to_string(),
args: vec![
serde_json::Value::String(api_key.clone()),
serde_json::Value::Number(expires.into()),
serde_json::Value::String(signature),
],
};

req_id should be camelCase

if is_auth_response(&json) {
if json
.get("success")
.and_then(|v| v.as_bool())
.unwrap_or(false)
{
info!("Authentication successful");
} else {
error!("Authentication failed: {:?}", json);
}
continue;
}

authentication response for trade wss is different take a look here.

https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline#response-parameters

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions