Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 616 Bytes

File metadata and controls

16 lines (13 loc) · 616 Bytes

Key Pair Based Authentication

use binance_sdk::c2c;
use binance_sdk::config;

let configuration = config::ConfigurationRestApi::builder()
    .api_key("your-api-key")
    .private_key(config::PrivateKey::File("your-private-key-file-path".to_string())) // Provide the private key file path
    .private_key_passphrase("your-passphrase".to_string()) // Optional: Required if the private key is encrypted
    .build()?;

let client = c2c::C2CRestApi::production(configuration);
let params = c2c::rest_api::GetC2CTradeHistoryParams::default();
let response = client.get_c2_c_trade_history(params).await?;