lamarge 0.9.0

Client for the LaMarge API: sign-in, takes, transfers, withdrawals and market making, each request checked before it is signed.
Documentation
use super::*;
use crate::{Client, Environment, testing::http::session};

#[test]
fn page_limit_is_clamped() {
    assert_eq!(PageRequest::first(0).limit(), Some(1));
    assert_eq!(PageRequest::first(501).limit(), Some(500));
    assert_eq!(PageRequest::first(50).limit(), Some(50));
    assert_eq!(PageRequest::default().limit(), None);
    let next = PageRequest::first(10).after(PageCursor::new("c1"));
    assert_eq!(next.cursor().map(PageCursor::as_str), Some("c1"));
    assert_eq!(next.limit(), Some(10));
}

#[test]
fn handles_debug_without_the_token_and_their_futures_and_streams_are_send() {
    fn send<T: Send>(_: T) {}
    let client = Client::new(Environment::Production).unwrap();
    let debug = format!("{:?}", client.market());
    assert_eq!(debug, "Market { api: \"https://api.lamarge.trade\", authenticated: false }");
    let fills = Fills { inner: client.inner(), auth: Some(session()) };
    assert!(format!("{fills:?}").contains("authenticated: true"));
    send(client.market().venues());
    send(client.explorer().transfers_stream(10));
    send(client.events().snapshot());
    send(fills.list());
    send(fills.history_stream(10));
    send(
        Credentials { inner: client.inner(), auth: Some(session()) }
            .delete(uuid::Uuid::nil().into()),
    );
}