#![allow(clippy::disallowed_methods)]
use ccxt_core::ExchangeConfig;
use ccxt_exchanges::binance::Binance;
fn create_binance_instance() -> Binance {
let api_key = std::env::var("BINANCE_API_KEY")
.ok()
.map(ccxt_core::SecretString::new);
let secret = std::env::var("BINANCE_API_SECRET")
.ok()
.map(ccxt_core::SecretString::new);
let config = ExchangeConfig {
api_key,
secret,
..Default::default()
};
Binance::new(config).expect("Failed to create Binance instance")
}
fn has_api_credentials() -> bool {
std::env::var("BINANCE_API_KEY").is_ok() && std::env::var("BINANCE_API_SECRET").is_ok()
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_fetch_cross_borrow_rate() {
if !has_api_credentials() {
println!("⚠️ Skip test: API credentials not set");
return;
}
let _binance = create_binance_instance();
println!("⚠️ Method not yet implemented");
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_fetch_isolated_borrow_rate() {
if !has_api_credentials() {
println!("⚠️ Skip test: API credentials not set");
return;
}
let _binance = create_binance_instance();
println!("⚠️ Method not yet implemented");
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_fetch_borrow_rates() {
if !has_api_credentials() {
println!("⚠️ Skip test: API credentials not set");
return;
}
let _binance = create_binance_instance();
println!("⚠️ Method not yet implemented");
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_borrow_cross_margin() {
println!("⚠️ Warning: This performs real borrow operations");
println!("ℹ️ Run this test with --ignored flag");
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_borrow_isolated_margin() {
println!("⚠️ Warning: This performs real borrow operations");
println!("ℹ️ Run this test with --ignored flag");
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_repay_cross_margin() {
println!("⚠️ Warning: This performs real repay operations");
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_repay_isolated_margin() {
println!("⚠️ Warning: This performs real repay operations");
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_fetch_borrow_rate_history() {
if !has_api_credentials() {
println!("⚠️ Skip test: API credentials not set");
return;
}
let _binance = create_binance_instance();
println!("⚠️ Method not yet implemented");
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_fetch_borrow_interests() {
if !has_api_credentials() {
println!("⚠️ Skip test: API credentials not set");
return;
}
let _binance = create_binance_instance();
println!("⚠️ Method not yet implemented");
}
#[tokio::test]
#[ignore = "Margin methods not yet implemented"]
async fn test_fetch_margin_adjustment_history() {
if !has_api_credentials() {
println!("⚠️ Skip test: API credentials not set");
return;
}
let _binance = create_binance_instance();
println!("⚠️ Method not yet implemented");
}