Skip to main content

tradernet_sdk_rs/
lib.rs

1//! Rust SDK for the Tradernet API.
2//!
3//! This crate provides a synchronous REST client, an asynchronous WebSocket client,
4//! and helper types for working with symbols and options.
5//!
6//! # Quick start
7//! ```no_run
8//! use tradernet_sdk_rs::Tradernet;
9//!
10//! # fn main() -> Result<(), tradernet_sdk_rs::TradernetError> {
11//! let client = Tradernet::new(Some("public_key".into()), Some("private_key".into()))?;
12//! let info = client.user_info()?;
13//! println!("{info:?}");
14//! # Ok(())
15//! # }
16//! ```
17//!
18//! See [`TradernetWebsocket`] for streaming market data.
19
20/// Async REST API client built on top of [`Tradernet`].
21pub mod async_client;
22/// REST API client built on top of [`Core`].
23pub mod client;
24/// Common networking and string helpers.
25pub mod common;
26/// Core authentication and request utilities.
27pub mod core;
28/// Error types returned by the SDK.
29pub mod errors;
30/// Symbols and options helpers.
31pub mod symbols;
32/// Typed responses for get_user_data.
33pub mod user_data;
34/// WebSocket streaming client.
35pub mod ws;
36/// Typed WebSocket events and payloads.
37pub mod ws_types;
38
39pub use crate::async_client::AsyncTradernet;
40pub use crate::client::Tradernet;
41pub use crate::core::{Core, WsCredentials};
42pub use crate::errors::TradernetError;
43pub use crate::symbols::tradernet_option::TradernetOption;
44pub use crate::symbols::tradernet_symbol::TradernetSymbol;
45pub use crate::user_data::UserDataResponse;
46pub use crate::ws::{TradernetWebsocket, TradernetWsSession};
47pub use crate::ws_types::{
48    MarketDepthEvent, MarketDepthRow, MarketDepthSide, MarketDepthUpdate, MarketInfoRow,
49    MarketsEvent, MarketsUpdate, OrderDataRow, OrderTradeInfo, OrdersEvent, PortfolioAccountRow,
50    PortfolioEvent, PortfolioPositionRow, PortfolioTradeRow, PortfolioUpdate, QuoteEvent,
51    SubscribeRequest, UnsubscribeRequest, WsEvent, WsReconnectConfig,
52};