//! # asterdex-sdk
//!
//! Async Rust client for the [AsterDex](https://github.com/seltosoj/asterdex_sdk_v3_rust) Futures API v3.
//!
//! Supports REST endpoints and WebSocket market/user-data streams,
//! with EIP-712 request signing via the [alloy](https://github.com/alloy-rs/alloy) crate.
//!
//! ## Quick start
//!
//! ```rust,no_run
//! use asterdex_sdk::{Credentials, FuturesClient};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     let creds = Credentials::from_env()?;
//!     let client = FuturesClient::new("https://fapi.asterdex.com", creds)?;
//!
//!     let resp = client.get_server_time().await?;
//!     println!("Server time: {}", resp.data.server_time);
//!     Ok(())
//! }
//! ```
//!
//! ## Environment variables
//!
//! | Variable | Required | Description |
//! |---|---|---|
//! | `ASTERDEX_PRIVATE_KEY` | Yes | Hex-encoded private key for EIP-712 signing |
//! | `ASTERDEX_BASE_URL` | No | Override base URL (defaults to mainnet) |
//! | `ASTERDEX_CHAIN_ID` | No | Chain ID (defaults to `1666`) |

// US-001: SDK crate root — public re-exports

mod auth;
mod rest;
mod ws;
pub mod futures;
pub mod spot;
/// Backward-compatibility re-export of futures::models — use futures::models directly.
pub mod models;
pub(crate) mod endpoints;

pub use auth::Credentials;
pub use rest::client::RestClient;
pub use futures::FuturesClient;
pub use rest::error::AsterDexError;
pub use rest::response::ApiResponse;
pub use ws::client::{UserDataStream, WebSocketClient, WebSocketStream};

// Re-export key model types at crate root for convenience
pub use futures::models::trading::{
    CancelOrderParams, CancelOrderResponse, EmptyResponse, ListenKeyResponse, ModifyOrderParams,
    OrderResponse, PlaceOrderParams, PositionResponse,
};
pub use futures::models::market::{
    AggTrade, BookTickerResponse, BookTickerShape, DepthResponse, ExchangeInfoResponse,
    FundingInfoResponse, Kline, KlineInterval, MarkPriceResponse, MarkPriceShape, PingResponse,
    ServerTimeResponse, Ticker24hrResponse, Ticker24hrShape, TickerPriceResponse, TickerPriceShape,
};
pub use futures::models::account::{Balance, LeverageBracket, SetLeverageResponse};
pub use futures::models::websocket::WebSocketMessage;
pub use futures::models::user_data::UserDataEvent;
