Official Rust SDK for the WhiteBit API — trade, query, and manage your crypto portfolio programmatically.
| Requirement | Details |
|---|---|
| Rust stable | Required runtime |
| WhiteBit account | Sign up at whitebit.com |
| WhiteBit API key | Profile → API keys → Create key (Read and/or Trade permissions) |
cargo add whitebit-sdk- Log in to whitebit.com → Profile → API keys
- Create a new key — choose Read and/or Trade permissions as needed
- Copy your API Key and Token
Public endpoints (market data, tickers, order book) work without credentials. Private endpoints (account, trading) require both.
Public endpoints only (market data, tickers, order book):
use whitebit_sdk::prelude::*;
let client = ApiClientBuilder::new("https://whitebit.com").build()?;Private endpoints (account, trading — requires HMAC signing):
use whitebit_sdk::prelude::*;
let client = ApiClientBuilder::new("https://whitebit.com")
.api_key("YOUR_API_KEY")
.hmac_secret("YOUR_API_SECRET")
.build()?;Note: WhiteBit private endpoints use HMAC-SHA512 signing (
X-TXC-PAYLOAD+X-TXC-SIGNATURE)..hmac_secret()handles this automatically — no manual signing needed.
---
## Usage Examples
```rust
// Market data (no credentials required)
let tickers = client.public_api_v4.get_market_activity(None).await?;
let depth = client.public_api_v4.get_orderbook(GetOrderbookRequest {
market: "BTC_USDT".into(), ..Default::default()
}, None).await?;
// Account
let balance = client.account_endpoints.get_trading_balance(None).await?;
// Spot trading
let order = client.spot_trading.create_limit_order(CreateLimitOrderRequest {
market: "BTC_USDT".into(),
side: "buy".into(),
amount: "0.01".into(),
price: "95000".into(),
..Default::default()
}, None).await?;
// Main account — transfer & withdraw
client.transfer.transfer(TransferRequest {
from: "main".into(), to: "spot".into(),
ticker: "USDT".into(), amount: "100".into(),
}, None).await?;
| Module | Description |
|---|---|
public_api_v4 |
Tickers, order book, trade history, klines, assets |
spot_trading |
Limit, market, stop-limit, stop-market, bulk orders |
collateral_trading |
Collateral orders, OCO, positions |
account_endpoints |
Trading balance, open orders, order history |
main_account |
Main balances, deposit addresses, fee info |
transfer |
Transfer between main and trade accounts |
withdraw |
Withdrawal requests |
codes |
WhiteBit codes — create, apply, history |
fees |
Trading fees |
sub_account |
Sub-account management |
| WhiteBIT API Documentation | Official API reference |
| API Platform Overview | REST, WebSocket, authentication, rate limits |
| Use with AI | Use API docs with Claude, Cursor, VS Code via MCP |
| GitHub Repository | Source code |
| Releases | Binaries and changelog |
| Contributing | Development setup and contribution guide |
| Report an Issue | Bug reports and feature requests |
| WhiteBIT Exchange | The exchange |