polymarket 0.1.0

Rust SDK for Polymarket prediction market - CLOB trading, on-chain operations, and WebSocket streaming
Documentation
use serde::{Deserialize, Serialize};

/// EIP-712 domain constants for CLOB authentication
pub const CLOB_DOMAIN_NAME: &str = "ClobAuthDomain";
pub const CLOB_VERSION: &str = "1";
pub const MSG_TO_SIGN: &str = "This message attests that I control the given wallet";

/// CLOB authentication message structure for EIP-712 signing
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClobAuth {
    pub address: String,
    pub timestamp: String,
    pub nonce: u64,
    pub message: String,
}

impl ClobAuth {
    pub fn new(address: String, timestamp: u64, nonce: u64) -> Self {
        Self {
            address,
            timestamp: timestamp.to_string(),
            nonce,
            message: MSG_TO_SIGN.to_string(),
        }
    }
}