aignt-jupiter-client 0.3.0

Jupiter API Client
Documentation
use jupiter_client::client::JupiterApiClient;
use dotenvy::dotenv;
use std::env;

#[tokio::test]
async fn test_get_prices_real_api() {
    dotenv().ok();
    let api_key = env::var("JUPITER_API_KEY").expect("JUPITER_API_KEY must be set for integration tests");
    let client = JupiterApiClient::new(api_key).expect("Failed to create client");
    
    let ids = vec![
        "So11111111111111111111111111111111111111112".to_string(), // SOL
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v".to_string(), // USDC
    ];
    
    let result = client.get_prices(&ids).await;
    
    assert!(result.is_ok(), "Failed to get prices from real API: {:?}", result.err());
    let prices = result.unwrap();
    
    assert_eq!(prices.len(), 2);
    assert!(prices.contains_key("So11111111111111111111111111111111111111112"));
    assert!(prices.contains_key("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"));
    
    let sol_price = prices.get("So11111111111111111111111111111111111111112").unwrap();
    assert!(sol_price.usd_price > 0.0);
    
    let usdc_price = prices.get("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v").unwrap();
    assert!(usdc_price.usd_price > 0.0);
}

#[tokio::test]
async fn test_get_prices_empty_list() {
    dotenv().ok();
    let api_key = env::var("JUPITER_API_KEY").expect("JUPITER_API_KEY must be set for integration tests");
    let client = JupiterApiClient::new(api_key).expect("Failed to create client");
    let result = client.get_prices(&[]).await;
    assert!(result.is_ok());
    assert!(result.unwrap().is_empty());
}