clpcpi 0.1.4

Concentrated Liquidity Provider Vault (CLP) Vault CPI struct reference and CPI examples.
Documentation
1
2
3
4
5
6
7
8
9
10
/// The function discrminator is constructed from these 8 bytes. Typically, the namespace is
/// "global" or "state"
pub fn get_function_hash(namespace: &str, name: &str) -> [u8; 8] {
    let preimage = format!("{}:{}", namespace, name);
    let mut sighash = [0u8; 8];
    sighash.copy_from_slice(
        &anchor_lang::solana_program::hash::hash(preimage.as_bytes()).to_bytes()[..8],
    );
    sighash
}