nado-sdk 0.3.5

Official Rust SDK for the Nado Protocol API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub fn is_isolated_subaccount(subaccount: [u8; 32]) -> bool {
    let (a, b, c) = (
        subaccount[31] as u32,
        subaccount[30] as u32,
        subaccount[29] as u32,
    );
    let last_three_bytes = a | (b << 8) | (c << 16);
    last_three_bytes == 6910831
}

pub fn get_isolated_product_id(subaccount: [u8; 32]) -> u32 {
    if !is_isolated_subaccount(subaccount) {
        return 0;
    }
    let (a, b) = (subaccount[27] as u32, subaccount[26] as u32);
    a | (b << 8)
}