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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! Gate.io synchronous HTTP client using ureq.
//!
//! This module provides a blocking HTTP client implementation for the Gate.io API
//! using the [`ureq`] library. This is the default client and is ideal for
//! synchronous applications and simple scripts.
//!
//! # Features
//!
//! This is the default client - no additional features needed:
//!
//! ```toml
//! [dependencies]
//! gateio-rs = "0.1"
//! ```
//!
//! # Usage
//!
//! ```no_run
//! use gateio_rs::{
//! api::spot::get_ticker,
//! http::Credentials,
//! ureq::GateHttpClient,
//! };
//!
//! // Create client with credentials
//! let credentials = Credentials::new("your_api_key".to_string(), "your_api_secret".to_string());
//! let client = GateHttpClient::default().credentials(credentials);
//!
//! // Get ticker data
//! let request = get_ticker().currency_pair("BTC_USDT");
//! let response = client.send(request).expect("Failed to send request");
//! let data = response.into_body_str().expect("Failed to parse body");
//! ```
//!
//! # Custom Base URL
//!
//! You can configure a custom base URL for the Gate.io API:
//!
//! ```
//! use gateio_rs::ureq::GateHttpClient;
//!
//! let client = GateHttpClient::with_url("https://api.gateio.ws");
//! ```
//!
//! # Error Handling
//!
//! All errors emitted by the client implement the standard [`Error`] trait.
//!
//! # Custom Timeout
//!
//! Configure custom timeouts using ureq's config builder:
//!
//! ```
//! use ureq::Agent;
//! use gateio_rs::ureq::GateHttpClient;
//! use std::time::Duration;
//!
//! let agent: Agent = Agent::config_builder()
//! .timeout_request(Duration::from_secs(10))
//! .timeout_connect(Duration::from_secs(5))
//! .build()
//! .into();
//!
//! let client = GateHttpClient::with_custom_agent(agent, "https://api.gateio.ws");
//! ```
pub use *;
pub use *;
pub use *;