| Crates.io | htx-rs |
| lib.rs | htx-rs |
| version | 0.1.1 |
| created_at | 2025-06-21 08:21:08.813556+00 |
| updated_at | 2025-06-21 09:30:56.69255+00 |
| description | 火币 HTX 现货交易 Rust SDK,支持下单、撤单、查单等主要接口,签名算法兼容官方。 |
| homepage | |
| repository | https://github.com/blockchain-toolbox/htx-rs |
| max_upload_size | |
| id | 1720629 |
| size | 67,461 |
火币 HTX 现货交易 Rust SDK
本 crate 提供火币 HTX 现货交易 API 的 Rust 封装,支持下单、撤单、查单等主要接口,签名算法完全兼容官方。
use htx_rs::client::SpotTradeClient;
use htx_rs::model::spot_trade::CreateOrderRequest;
let client = SpotTradeClient::new("your_api_key", "your_secret_key", "https://api.huobi.pro");
let req = CreateOrderRequest {
account_id: "xxxxxx".to_string(),
symbol: "btcusdt".to_string(),
order_type: htx_rs::model::spot_trade::OrderType::BuyLimit,
amount: 0.01,
price: Some(30000.0),
client_order_id: None,
source: "api".to_string(),
};
let resp = client.create_order(&req).unwrap();
println!("order_id={}", resp.order_id);
cargo login # 首次需登录 crates.io token
cargo publish
MIT