rango_sdk/
client.rs

1const API_URL: &str = "https://api.rango.exchange";
2
3/// Configs for your client (e.g API Key)
4struct ClientConfig {
5    #[allow(dead_code)]
6    device_id: String,
7    api_key: String,
8    api_url: String,
9}
10
11/// Client for interacting with Rango APIs
12pub struct Client {
13    config: ClientConfig,
14}
15
16impl Client {
17    /// Creating a client to send request to Rango's server using available methods.
18    pub fn new(device_id: &str, api_key: &str, api_url: Option<String>) -> Self {
19        let api_url = api_url.unwrap_or(API_URL.to_owned());
20
21        Self {
22            config: ClientConfig {
23                api_url,
24                device_id: device_id.into(),
25                api_key: api_key.into(),
26            },
27        }
28    }
29}
30
31mod check;
32mod meta;
33// mod misc;
34mod quote;
35mod swap;