mod common;

use common::{authed_client, authenticate, first_pair_id};

#[tokio::test]
#[ignore = "requires running API server"]
async fn get_balances() {
    let (token, _address, _signer) = authenticate().await;
    let authed = authed_client(&token);

    // New wallet — empty balances is fine, just confirm the call succeeds
    let resp = authed
        .get_user_balances(None, None)
        .await
        .unwrap()
        .into_inner();

    let _ = resp.balances;
}

#[tokio::test]
#[ignore = "requires running API server"]
async fn get_movements() {
    let (token, _address, _signer) = authenticate().await;
    let authed = authed_client(&token);

    let resp = authed
        .get_user_movements(None, None, None, None, None, None)
        .await
        .unwrap()
        .into_inner();

    let _ = resp.movements;
}

#[tokio::test]
#[ignore = "requires running API server"]
async fn simulate_fees() {
    let (token, _address, _signer) = authenticate().await;
    let authed = authed_client(&token);
    let pair_id = first_pair_id().await;
    let pair_uuid: uuid::Uuid = pair_id.parse().unwrap();

    let resp = authed
        .simulate_fees(
            None,
            &"100.0".parse().unwrap(),
            &"1.0".parse().unwrap(),
            monaco_sdk::types::SimulateFeesSide::Buy,
            None,
            &pair_uuid,
        )
        .await
        .unwrap()
        .into_inner();

    assert!(resp.notional.is_some());
}
