tradestation-api 0.1.0

Complete TradeStation REST API v3 wrapper for Rust
Documentation
//! # tradestation-api
//!
//! A complete, typed wrapper for the [TradeStation REST API v3](https://api.tradestation.com/docs/).
//!
//! This crate provides async access to all 38 TradeStation v3 endpoints with:
//!
//! - **OAuth2 Authorization Code** flow with automatic token refresh
//! - **Market Data**: Historical bars (OHLCV), quotes, symbol info, crypto pairs, options
//! - **Brokerage**: Accounts, balances, positions, orders, wallets
//! - **Execution**: Place, replace, cancel orders; OCO/bracket groups; activation triggers; routes
//! - **Streaming**: HTTP chunked-transfer for live quotes, bars, market depth, options, orders, positions
//! - **Simulation**: Built-in support for TradeStation's sim API
//!
//! # Quickstart
//!
//! ```no_run
//! use tradestation_api::{Client, Credentials, Scope};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     let creds = Credentials::new("CLIENT_ID", "CLIENT_SECRET");
//!
//!     // 1. Direct user to authorization URL
//!     let url = creds.authorization_url(&Scope::defaults());
//!     println!("Visit: {url}");
//!
//!     // 2. Exchange the callback code for tokens
//!     let mut client = Client::new(creds);
//!     client.authenticate("AUTH_CODE").await?;
//!
//!     // 3. Fetch data
//!     let quotes = client.get_quotes(&["AAPL", "MSFT"]).await?;
//!     for q in &quotes {
//!         println!("{}: last={}", q.symbol, q.last);
//!     }
//!     Ok(())
//! }
//! ```
//!
//! # Standalone crate
//!
//! This is a standalone library with zero Cannopy dependencies. It can be used
//! independently in any Rust project that needs TradeStation API access.

pub mod auth;
pub mod brokerage;
pub mod client;
pub mod execution;
pub mod market_data;
pub mod streaming;

mod error;

pub use auth::{Credentials, Scope, Token};
pub use brokerage::{Account, Balance, BodBalance, Order, Position, Wallet};
pub use client::Client;
pub use error::Error;
pub use execution::{
    ActivationTrigger, OrderGroupRequest, OrderRequest, OrderResponse, Route, TimeInForce,
};
pub use market_data::{
    Bar, BarChartQuery, CryptoPair, OptionExpiration, OptionStrike, ParseNumeric, Quote,
    RiskRewardRequest, RiskRewardResponse, SpreadType, SymbolInfo,
};
pub use streaming::{
    BoxStream, StreamBar, StreamMarketDepthAggregate, StreamMarketDepthQuote, StreamOptionChain,
    StreamOptionQuote, StreamOrder, StreamPosition, StreamQuote,
};