gateio_rs/
lib.rs

1//! # Gate.io Rust SDK
2//!
3//! A comprehensive Rust SDK for the Gate.io cryptocurrency exchange API, supporting both synchronous and asynchronous HTTP clients.
4//!
5//! ## Quick Start
6//!
7//! ```rust,no_run
8//! use gateio_rs::{
9//!     api::spot::get_ticker,
10//!     http::Credentials,
11//!     ureq::GateHttpClient,
12//! };
13//!
14//! // Create client with credentials
15//! let credentials = Credentials::new("your_api_key".to_string(), "your_api_secret".to_string());
16//! let client = GateHttpClient::default().credentials(credentials);
17//!
18//! // Get ticker data
19//! let request = get_ticker().currency_pair("BTC_USDT");
20//! let response = client.send(request)?;
21//! # Ok::<(), Box<dyn std::error::Error>>(()).expect("");
22//! ```
23//!
24//! ## Features
25//!
26//! This SDK provides dual client implementations controlled by feature flags:
27//!
28//! * `enable-ureq` (default): Synchronous HTTP client powered by [`ureq`](https://docs.rs/ureq/)
29//! * `enable-hyper`: Asynchronous HTTP client powered by [`hyper`](https://docs.rs/hyper/)
30//!
31//! ## Architecture
32//!
33//! - **Spot Trading API**: Complete implementation of Gate.io Spot trading endpoints
34//! - **Authentication**: Automatic HMAC SHA-512 signing for authenticated requests
35//! - **Builder Pattern**: Ergonomic request building with optional parameters
36//! - **Type Safety**: Strong typing for all API parameters and responses
37//!
38
39#![warn(missing_docs)]
40
41mod utils;
42mod version;
43
44/// Spot trading API endpoints
45pub mod api;
46/// HTTP client abstractions and utilities
47pub mod http;
48
49#[cfg(feature = "enable-hyper")]
50pub mod hyper;
51
52#[cfg(feature = "enable-ureq")]
53pub mod ureq;