|
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
bybit-rust-api/src/websocket/client.rs
Lines 240 to 249 in f9deb1a
req_id should be camelCase
bybit-rust-api/src/websocket/client.rs
Lines 158 to 170 in f9deb1a
authentication response for trade wss is different take a look here.
https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline#response-parameters