entropycli 1.0.3

Entropy CLI for developing using the Entropic Labs Entropy Beacon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::network::Network;

impl Network {
    pub async fn get(&self, path: &str) -> Result<reqwest::Response, reqwest::Error> {
        let url = format!("{}/{}", self.lcd_url, path);
        reqwest::get(&url).await
    }

    pub async fn post(&self, path: &str, body: &serde_json::Value) -> Result<reqwest::Response, reqwest::Error> {
        let url = format!("{}/{}", self.lcd_url, path);
        reqwest::Client::new()
            .post(&url)
            .json(&body)
            .send()
            .await
    }
}