breeze_icici/lib.rs
1//! Async, typed client for the ICICI Direct Breeze REST and streaming APIs.
2//!
3//! The crate preserves Breeze's exact compact-JSON signing contract, including
4//! request bodies on `GET` and `DELETE`. Trading mutations are explicit, market
5//! orders are not representable, and ambiguous mutations are never retried.
6//!
7//! # Restoring a session
8//!
9//! ```no_run
10//! use breeze_icici::{AppKey, BreezeClient, Credentials, SecretKey, SessionToken};
11//!
12//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
13//! let credentials = Credentials::new(
14//! AppKey::new(std::env::var("BREEZE_APP_KEY")?)?,
15//! SecretKey::new(std::env::var("BREEZE_SECRET_KEY")?)?,
16//! );
17//! let client = BreezeClient::builder(credentials)
18//! .session_token(SessionToken::new(std::env::var("BREEZE_SESSION_TOKEN")?)?)
19//! .build()?;
20//! let funds = client.account().funds().await?;
21//! println!("unallocated balance: {}", funds.unallocated_balance());
22//! # Ok(())
23//! # }
24//! ```
25
26#![forbid(unsafe_code)]
27#![warn(missing_debug_implementations)]
28
29pub mod account;
30pub mod auth;
31pub mod client;
32mod clock;
33pub mod domain;
34pub mod error;
35pub mod gtt;
36pub mod instruments;
37pub mod market;
38pub mod orders;
39pub mod portfolio;
40pub mod rate_limit;
41pub mod risk;
42mod signing;
43pub mod streaming;
44pub mod trades;
45
46#[cfg(feature = "test-util")]
47pub mod testing;
48
49mod request;
50mod services;
51
52pub use auth::{ApiSession, AppKey, Credentials, SecretKey, SessionToken, login_url};
53pub use client::{
54 AccountService, Authenticated, BreezeClient, BreezeClientBuilder, EndpointSet,
55 MarketDataService, OrdersService, Pending, PortfolioService, RetryPolicy, RiskService,
56 Timeouts, TradesService, TradingService,
57};
58pub use error::{Error, TimeoutPhase, ValidationError};
59pub use request::EndpointRequest;