use serde::{Deserialize, Serialize};
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";
#[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(),
}
}
}