| Crates.io | gateio-rs |
| lib.rs | gateio-rs |
| version | 0.1.0 |
| created_at | 2025-07-25 07:11:40.634033+00 |
| updated_at | 2025-07-25 07:11:40.634033+00 |
| description | Comprehensive Rust SDK for Gate.io cryptocurrency exchange API with sync and async support |
| homepage | https://github.com/volkovartem77/gateio-rs |
| repository | https://github.com/volkovartem77/gateio-rs |
| max_upload_size | |
| id | 1767276 |
| size | 241,712 |
A comprehensive Rust SDK for the Gate.io cryptocurrency exchange API, supporting both synchronous and asynchronous HTTP clients.
Add this to your Cargo.toml:
# For synchronous client (default)
[dependencies]
gateio-rs = "0.1"
# For asynchronous client
[dependencies]
gateio-rs = { version = "0.1", features = ["enable-hyper"], default-features = false }
use gateio_rs::{api::spot::get_ticker, ureq::GateHttpClient};
use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = GateHttpClient::default();
// Get ticker for BTC_USDT
let request = get_ticker()
.currency_pair("BTC_USDT")
.timezone("utc8");
let response = client.send(request)?;
let body = response.into_body_str()?;
let ticker_data: Value = serde_json::from_str(&body)?;
println!("BTC_USDT Ticker: {}", serde_json::to_string_pretty(&ticker_data)?);
Ok(())
}
use gateio_rs::{
api::spot::get_account,
http::Credentials,
ureq::GateHttpClient,
};
use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Set up credentials
let credentials = Credentials::new("your_api_key", "your_api_secret");
let client = GateHttpClient::default().credentials(credentials);
// Get account information
let request = get_account();
let response = client.send(request)?;
let body = response.into_body_str()?;
let account_data: Value = serde_json::from_str(&body)?;
println!("Account: {}", serde_json::to_string_pretty(&account_data)?);
Ok(())
}
The SDK provides complete coverage of Gate.io Spot trading API endpoints:
This project is licensed under either of
at your option.