polyte-clob 0.4.0

Rust client library for Polymarket CLOB (order book) API
Documentation
//! # polyte-clob
//!
//! Rust client library for Polymarket CLOB (Centralized Limit Order Book) API.
//!
//! ## Features
//!
//! - Order creation, signing, and posting with EIP-712
//! - Market data and order book retrieval
//! - Account balance and trade history
//! - HMAC-based L2 authentication
//! - Type-safe API with idiomatic Rust patterns
//!
//! ## Example
//!
//! ```no_run
//! use polyte_clob::{Account, Chain, ClobBuilder, CreateOrderParams, OrderSide};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     // Load account from environment variables
//!     let account = Account::from_env()?;
//!
//!     // Create CLOB client
//!     let clob = ClobBuilder::new(account)
//!         .chain(Chain::PolygonMainnet)
//!         .build()?;
//!
//!     // Place an order
//!     let params = CreateOrderParams {
//!         token_id: "token_id".to_string(),
//!         price: 0.52,
//!         size: 100.0,
//!         side: OrderSide::Buy,
//!         expiration: None,
//!     };
//!
//!     let response = clob.place_order(&params).await?;
//!     println!("Order ID: {:?}", response.order_id);
//!
//!     Ok(())
//! }
//! ```

pub mod account;
pub mod api;
pub mod client;
pub mod core;
pub mod error;
pub mod request;
pub mod types;
pub mod utils;

#[cfg(feature = "ws")]
pub mod ws;

pub use core::chain::{Chain, Contracts};

pub use account::{Account, AccountConfig, Credentials, Signer, Wallet};
pub use api::{
    account::{BalanceAllowanceResponse, Trade},
    markets::{
        ListMarketsResponse, Market, MarketToken, MidpointResponse, OrderBook, OrderLevel,
        PriceResponse,
    },
    orders::{CancelResponse, OpenOrder, OrderResponse},
};
pub use client::{Clob, ClobBuilder, CreateOrderParams};
pub use error::{ClobError, Result};
pub use types::{Order, OrderKind, OrderSide, SignatureType, SignedOrder, TickSize};