spacedustrs

This is a rust API wrapper for https://spacetraders.io V2

Many of the client functions in this project are based on, or in some cases copied directly from, the work of https://github.com/bloveless/spacetraders-rs

Quickstart

spacedustrs is currently not a published crate, however, if you'd like to use it locally in the meantime, this should get you started:

```rust use spacedustrs::client::Client;

[tokio::main]

async fn main() -> Result<(), Box> { env_logger::init();

// Setup Game Client
let http_client = spacedustrs::client::get_http_client(None);

// Register agent
let claim_agent_response = spacedustrs::client::claim_agent(
    http_client,
    "https://v2-0-0.alpha.spacetraders.io".to_string(),
    "<4-8 character string>".to_string(),
    "COMMERCE_REPUBLIC".to_string(),
)
.await.unwrap();

// Setup client using claimed agent
let client = Client::new(
    http_client,
    "https://v2-0-0.alpha.spacetraders.io".to_string(),
    claim_agent_response.data.agent.symbol,
    claim_agent_response.token,
);

// Get agent details to confirm working
match client.get_my_agent_details().await {
    Ok(res) => {
        println!("{:#?}", res);
    }
    Err(res_err) => {
        println!("{:#?}", res_err);
    }
}

Ok(())

} ```

Supported Endpoints

Public Endpoints

Agent & Account

Non-Specific Endpoints That Still Require Authentication

Systems

Agent Specific Endpoints

Agent

Contracts

Ships

Unsupported Endpoints

Notes from Roadmap

TODO