xapi_binance/clients/spot/
stream.rs1use crate::{clients::spot::BnSpot, data::book_ticker::BnBookTickerStream};
2use tokio::sync::mpsc;
3use xapi_shared::{data::crypto_symbol::CryptoSymbol, ws::error::SharedWsError};
4
5impl BnSpot {
6 pub async fn subscribe_book_ticker(
10 &self,
11 symbol: &CryptoSymbol,
12 ) -> Result<mpsc::Receiver<Result<BnBookTickerStream, SharedWsError>>, SharedWsError> {
13 self.executor
14 .subscribe_stream(format!("{}@bookTicker", symbol.as_str().to_lowercase()))
15 .await
16 }
17}