ic_siws 0.1.0

Integrate Solana wallet-based authentication (SIWS) with applications on the Internet Computer (ICP) platform.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[cfg(not(test))]
pub(crate) fn get_current_time() -> u64 {
    // This code is used in production, where ic_cdk::api::time() is available
    ic_cdk::api::time()
}

#[cfg(test)]
pub(crate) fn get_current_time() -> u64 {
    use std::time::{SystemTime, UNIX_EPOCH};

    let start = SystemTime::now();
    start.duration_since(UNIX_EPOCH).unwrap().as_nanos() as u64
}