1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! # rpaca
//!
//! A Rust client library for the Alpaca trading API.
//!
//! This library provides a convenient interface for interacting with the Alpaca API,
//! allowing users to access market data and execute trades programmatically.
//!
//! ## Features
//!
//! - Authentication with Alpaca API keys
//! - Support for both paper trading and live trading environments
//! - Access to market data (stocks, options)
//! - Trading functionality (orders, positions, account management)
//!
//! ## Example
//!
//! ```rust,no_run
//! use rpaca::auth::{Alpaca, TradingType};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a new Alpaca client using environment variables
//! let client = Alpaca::from_env(TradingType::Paper)?;
//!
//! // Use the client to interact with the Alpaca API
//! // ...
//!
//! Ok(())
//! }
//! ```
/// Authentication module for Alpaca API
/// Market data module for accessing stock and option information
/// Internal request handling module
/// Trading module for managing orders, positions, and account information