newton-core 0.4.16

newton protocol core sdk
1
2
3
4
5
6
7
8
9
use std::time::{SystemTime, UNIX_EPOCH};

/// helper for getting unix time
pub fn unix_time() -> Result<u64, String> {
    Ok(SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .map_err(|e| format!("Found error getting system time: {e}"))?
        .as_secs())
}