Expand description
Signed request builder for OKX API.
This module provides a builder pattern for creating authenticated OKX API requests, encapsulating the common signing workflow used across all authenticated endpoints.
§Overview
The OkxSignedRequestBuilder eliminates code duplication by centralizing:
- Credential validation
- ISO 8601 timestamp generation
- Parameter signing with HMAC-SHA256
- Authentication header injection
- HTTP request execution
§Example
let okx = Okx::new(ExchangeConfig::default())?;
// Simple GET request
let data = okx.signed_request("/api/v5/account/balance")
.execute()
.await?;
// POST request with parameters
let data = okx.signed_request("/api/v5/trade/order")
.method(HttpMethod::Post)
.param("instId", "BTC-USDT")
.param("tdMode", "cash")
.param("side", "buy")
.execute()
.await?;Structs§
- OkxSigned
Request Builder - Builder for creating authenticated OKX API requests.
Enums§
- Http
Method - HTTP request methods supported by the signed request builder.