Skip to main content

bybit_api/
lib.rs

1//! # Bybit API
2//!
3//! A Rust SDK for the Bybit V5 API.
4//!
5//! ## Features
6//!
7//! - Async-first design with tokio
8//! - Type-safe request/response models
9//! - Zero-panic error handling
10//! - Support for REST API and WebSocket
11//!
12//! ## Quick Start
13//!
14//! ```rust,no_run
15//! use bybit_api::{BybitClient, Category};
16//!
17//! #[tokio::main]
18//! async fn main() -> bybit_api::Result<()> {
19//!     // Create a client for testnet
20//!     let client = BybitClient::testnet("your_api_key", "your_api_secret")?;
21//!
22//!     // Get tickers
23//!     let tickers = client.get_tickers(Category::Linear, Some("BTCUSDT")).await?;
24//!     println!("{:?}", tickers);
25//!
26//!     Ok(())
27//! }
28//! ```
29
30// Modules
31mod auth;
32mod client;
33mod config;
34mod constants;
35mod error;
36mod models;
37
38// API modules
39pub mod api;
40pub mod websocket;
41
42// Re-exports
43pub use client::BybitClient;
44pub use config::{ClientConfig, ClientConfigBuilder, WsConfig};
45pub use constants::*;
46pub use error::{BybitError, Result};
47pub use models::*;