sc-api 0.1.1

A library to interact with the SC API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use sc_api::{DEMO_URL, DEMO_USER_TOKEN};

/**

* Example of using stalcraft api with user token.
*/
#[tokio::main]
async fn main() {
    let client = sc_api::ScUserClient::new_custom(DEMO_URL, DEMO_USER_TOKEN);
    // Get list of characters for user.
    let info = client.get_characters_list("RU").await.unwrap();
    println!("{:?}", info);

    // You can also use methods from ScAppClient.
    let info = client.app_client.get_clans_list("RU", None, None).await.unwrap();
    println!("{:?}", info);
}