spl_elgamal_registry_interface/
lib.rs

1pub mod instruction;
2pub mod state;
3
4use solana_pubkey::Pubkey;
5
6/// Seed for the ElGamal registry program-derived address
7pub const REGISTRY_ADDRESS_SEED: &[u8] = b"elgamal-registry";
8
9/// Derives the ElGamal registry account address and seed for the given wallet
10/// address
11pub fn get_elgamal_registry_address_and_bump_seed(
12    wallet_address: &Pubkey,
13    program_id: &Pubkey,
14) -> (Pubkey, u8) {
15    Pubkey::find_program_address(
16        &[REGISTRY_ADDRESS_SEED, wallet_address.as_ref()],
17        program_id,
18    )
19}
20
21/// Derives the ElGamal registry account address for the given wallet address
22pub fn get_elgamal_registry_address(wallet_address: &Pubkey, program_id: &Pubkey) -> Pubkey {
23    get_elgamal_registry_address_and_bump_seed(wallet_address, program_id).0
24}
25
26solana_pubkey::declare_id!("regVYJW7tcT8zipN5YiBvHsvR5jXW1uLFxaHSbugABg");