You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the Websocket version of the api but I don't see any place to put the credentials
There is a lot of unclarity in the docs and I don't see anything in the examples explaining or showing how this is done for the Websocket side.
here is a trivial snippet which leads to a crash when unwrapping the connection. The error isn't clear as to what the issue is
use binance_spot_connector_rust::{
http::Credentials,
market::klines::KlineInterval, market_stream::kline::KlineStream,
tokio_tungstenite::BinanceWebSocketClient,
};
use env_logger::Builder;
use futures_util::StreamExt;
#[tokio::main]
async fn main() {
let res = BinanceWebSocketClient::connect_async("wss://testnet.binance.vision/ws-api/v3.").await;
if res.is_err() {
println!("{:?}", res.as_ref().err());
}
let (mut conn, y ) = res.unwrap();
/// use binance_spot_connector_rust::market_stream::ticker::TickerStream;
///
let individual_symbol_stream = binance_spot_connector_rust::market_stream::ticker::TickerStream::from_symbol("BTCUSDT");
conn.subscribe(vec![
&individual_symbol_stream.into()
]
).await;
println!("Hello, world!");
}
Some(Http(Response { status: 404, version: HTTP/1.1, headers: {"content-length": "48", "connection": "close", "date": "Mon, 29 Jan 2024 13:10:39 GMT", "server": "X", "x-mbx-uuid": "656dbd59-91ed-4b67-9d61-88b87ec8a82a", "x-cache": "Error from cloudfront", "via": "1.1 7d30cf029bde247eef16106ceffb39ca.cloudfront.net (CloudFront)", "x-amz-cf-pop": "TLV50-C1", "x-amz-cf-id": "83iERQTXPkgGVJNB7GqEk2X3gjH9HIN2v9hwqF22f_YuaIYmNpxBqA=="}, body: None }))
thread 'main' panicked at src/main.rs:15:30:
called `Result::unwrap()` on an `Err` value: Http(Response { status: 404, version: HTTP/1.1, headers: {"content-length": "48", "connection": "close", "date": "Mon, 29 Jan 2024 13:10:39 GMT", "server": "X", "x-mbx-uuid": "656dbd59-91ed-4b67-9d61-88b87ec8a82a", "x-cache": "Error from cloudfront", "via": "1.1 7d30cf029bde247eef16106ceffb39ca.cloudfront.net (CloudFront)", "x-amz-cf-pop": "TLV50-C1", "x-amz-cf-id": "83iERQTXPkgGVJNB7GqEk2X3gjH9HIN2v9hwqF22f_YuaIYmNpxBqA=="}, body: None })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The text was updated successfully, but these errors were encountered:
Hi, I don't think the problem is authentication here. You received a 404, implying the endpoint wasn't found. Your websocket url has a fullstop . at the end .
For future reference, all ws endpoints requiring any sort of authentication will take a listen key as an argument. E.g.
I'm trying to use the Websocket version of the api but I don't see any place to put the credentials
There is a lot of unclarity in the docs and I don't see anything in the examples explaining or showing how this is done for the Websocket side.
here is a trivial snippet which leads to a crash when unwrapping the connection. The error isn't clear as to what the issue is
The text was updated successfully, but these errors were encountered: