fyers 0.2.1

Idiomatic async Rust client for the Fyers trading API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::{Fyers, FyersError};

impl Fyers {
    /// Cancel a pending order by its order ID.
    pub async fn cancel_order(&self, order_id: &str) -> Result<(), FyersError> {
        let url = format!("{}/orders/sync", self.base_urls.api_v3);
        self.delete(&url, &serde_json::json!({"id": order_id}))
            .await?;

        Ok(())
    }
}