Expand description
§oanda-rs
An asynchronous Rust SDK for the OANDA v20 REST and streaming API, designed for multi-threaded tokio environments.
- One shared client —
Clientis cheap to clone andSend + Sync; all clones share a connection pool and a built-in rate limiter that keeps you under OANDA’s per-IP limits (120 REST requests/s, 2 new connections/s). - Typed models — every request/response type derives
Debug,SerializeandDeserialize, with decimals asrust_decimal::Decimalnewtypes (never floats). - Streaming — pricing and transaction streams are self-managing: they detect stale connections via heartbeats, reconnect with capped exponential backoff, and back-fill missed transactions.
§Quickstart
use oanda_rs::{Client, Environment};
let client = Client::new(Environment::Practice, std::env::var("OANDA_TOKEN").unwrap());This is an unofficial SDK; use the Practice environment until you are
confident in your integration. See the repository’s docs/ directory
for guides on streaming, rate limiting and testing.
Modules§
- endpoints
- Endpoint implementations, grouped by API domain.
- models
- Data models mirroring the OANDA v20 component schemas.
- prelude
- Convenience re-exports of the types needed by almost every integration.
- streaming
- Self-managing streaming connections for the pricing and transaction streams.
Structs§
- ApiError
Body - The JSON body OANDA returns for error responses.
- Client
- An asynchronous OANDA v20 API client.
- Client
Builder - Configures and builds a
Client.
Enums§
- Environment
- The OANDA environment (host pair) a
Clienttalks to. - Error
- The unified error type returned by every SDK operation.