Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 540 Bytes

File metadata and controls

17 lines (14 loc) · 540 Bytes

Connection Mode Configuration

use binance_sdk::spot;
use binance_sdk::config;

let configuration = config::ConfigurationWebsocketApi::builder()
    .api_key("your-api-key")
    .api_secret("your-api-secret")
    .mode(models::WebsocketMode::Pool(3)) // Use pool mode with a pool size of 3
    .build()?;

let client = spot::SpotWsApi::production(configuration);
let connection = client.connect().await?;
let params = spot::websocket_api::ExchangeInfoParams::default();
let response = connection.exchange_info(params).await?;