eve-esi-api 0.0.4

This library provides an authentication to Eve-esi API and some endpoints to call.
Documentation
use std::collections::HashMap;

use crate::domain::wallet::Transaction;
use crate::ApiClient;
use crate::Result;
use crate::{Int32, Int64};

/// Get the 2000 last market transactions for a character.
/// Subsequent transactions can be fetched via transactions_from function
pub async fn transactions(client: &ApiClient, char_id: Int32) -> Result<Option<Vec<Transaction>>> {
    client
        .query_esi(format!("characters/{}/wallet/transactions", char_id))
        .await
}

/// Get the 2000 next transactions (meaning, older than) after 'from' parameters
pub async fn transactions_from(
    client: &ApiClient,
    char_id: Int32,
    from: Int64,
) -> Result<Option<Vec<Transaction>>> {
    let mut map = HashMap::new();
    map.insert("from_id".to_string(), from.to_string());
    client
        .query_esi_with_params(format!("characters/{}/wallet/transactions/", char_id), map)
        .await
}