Add rate limiter (50/s + 5/s historical), symbol mapper, order builders, account queries, market data subscriptions, and high-level CTraderClient that orchestrates the full connect/auth/symbol-load lifecycle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38 lines
1.3 KiB
Rust
38 lines
1.3 KiB
Rust
//! cTrader Open API client for Rust.
|
|
//!
|
|
//! Provides a production-grade async client for the cTrader Open API protocol
|
|
//! (Protobuf over TCP+TLS), targeting ICMarkets broker connectivity.
|
|
//!
|
|
//! # Architecture
|
|
//!
|
|
//! - **config** — connection configuration (environment, credentials, timeouts)
|
|
//! - **error** — error types for all failure modes
|
|
//! - **proto** — compiled protobuf message types
|
|
//! - **codec** — length-delimited protobuf wire codec
|
|
//! - **connection** — TCP+TLS transport with heartbeat
|
|
//! - **auth** — OAuth2 token exchange + protobuf auth sequence
|
|
//! - **dispatch** — request/response correlation and event broadcasting
|
|
//! - **rate_limiter** — token-bucket rate limiter (50/s + 5/s historical)
|
|
//! - **orders** — order request builders and type conversions
|
|
//! - **symbols** — symbol name → ID resolution cache
|
|
//! - **account** — account info and position reconciliation
|
|
//! - **client** — high-level `CTraderClient` API
|
|
|
|
pub mod account;
|
|
pub mod auth;
|
|
pub mod client;
|
|
pub mod codec;
|
|
pub mod config;
|
|
pub mod connection;
|
|
pub mod dispatch;
|
|
pub mod error;
|
|
pub mod market_data;
|
|
pub mod orders;
|
|
pub mod proto;
|
|
pub mod rate_limiter;
|
|
pub mod symbols;
|
|
|
|
pub use client::CTraderClient;
|
|
pub use config::{CTraderConfig, CTraderEnvironment};
|
|
pub use error::{CTraderError, Result};
|