polymarket 0.1.0

Rust SDK for Polymarket prediction market - CLOB trading, on-chain operations, and WebSocket streaming
Documentation
#[derive(Debug, serde::Deserialize)]
pub struct RtdsCryptoPayload {
    pub symbol: String,
    pub timestamp: i64,  // Timestamp in milliseconds
    pub value: f64,  // Price value as number
    pub full_accuracy_value: String,  // High-precision string representation
}

#[derive(Debug, serde::Deserialize)]
pub struct RtdsMessage {
    pub topic: String,
    pub r#type: String,
    pub timestamp: i64,  // Changed from String to i64 (number in TypeScript)
    pub payload: serde_json::Value,  // Generic payload to handle different message types
    pub connection_id: String,
}

impl RtdsMessage {
    /// Parse payload as crypto price data
    pub fn as_crypto_price(&self) -> Result<RtdsCryptoPayload, serde_json::Error> {
        serde_json::from_value(self.payload.clone())
    }
}