Skip to main content
Main client for interacting with Privora.
use privora_sdk_client::prelude::*;

let privora = PrivoraClient::new("http://localhost:8899").await?;

Constructor

new

pub async fn new(url: &str) -> Result<Self>
Connect to sequencer and fetch FHE public key.

Methods

encryptor

pub fn encryptor(&self) -> &FheEncryptor
Get the FHE encryptor.

user_crypto

pub fn user_crypto(&self, keypair: &Keypair) -> Result<UserCrypto>
Create UserCrypto from keypair.

submit

pub async fn submit<T>(&self, encrypted: &ClientEncrypted<T>) -> Result<[u8; 32]>
Submit encrypted data, return hash.

submit_batch

pub async fn submit_batch<T>(&self, values: &[ClientEncrypted<T>]) -> Result<Vec<[u8; 32]>>
Submit multiple values.

get_fhe_data

pub async fn get_fhe_data(&self, hash: &[u8; 32]) -> Result<Vec<u8>>
Fetch data by hash.

transaction

pub fn transaction(&self) -> TransactionBuilder
Create transaction builder.

get_balance

pub async fn get_balance(&self, pubkey: &Pubkey) -> Result<u64>

request_airdrop

pub async fn request_airdrop(&self, pubkey: &Pubkey, lamports: u64) -> Result<String>

get_latest_blockhash

pub async fn get_latest_blockhash(&self) -> Result<Hash>

get_minimum_balance_for_rent_exemption

pub async fn get_minimum_balance_for_rent_exemption(&self, data_len: usize) -> Result<u64>