#[cfg(feature = "client")]
mod lightwalletd;
#[cfg(feature = "client")]
mod zidecar;
#[cfg(feature = "client")]
pub use lightwalletd::LightwalletdClient;
#[cfg(feature = "client")]
pub use zidecar::ZidecarClient;
pub use crate::endpoints::*;
#[cfg(feature = "client")]
pub mod zidecar_proto {
tonic::include_proto!("zidecar.v1");
}
#[cfg(feature = "client")]
pub mod lightwalletd_proto {
tonic::include_proto!("cash.z.wallet.sdk.rpc");
}
#[derive(Debug, Clone)]
pub struct SyncStatus {
pub current_height: u32,
pub current_epoch: u32,
pub blocks_in_epoch: u32,
pub complete_epochs: u32,
pub epoch_proof_ready: bool,
pub blocks_until_ready: u32,
pub last_epoch_proof_height: u32,
}
#[derive(Debug, Clone)]
pub struct TreeState {
pub height: u32,
pub hash: Vec<u8>,
pub time: u64,
pub sapling_tree: String,
pub orchard_tree: String,
}
#[derive(Debug, Clone)]
pub struct Utxo {
pub address: String,
pub txid: [u8; 32],
pub output_index: u32,
pub script: Vec<u8>,
pub value_zat: u64,
pub height: u32,
}
#[derive(Debug, Clone)]
pub struct SendResult {
pub txid: String,
pub error_code: i32,
pub error_message: String,
}
impl SendResult {
pub fn is_success(&self) -> bool {
self.error_code == 0
}
}
#[derive(Debug, Clone)]
pub struct CompactBlock {
pub height: u32,
pub hash: Vec<u8>,
pub actions: Vec<CompactAction>,
}
#[derive(Debug, Clone)]
pub struct CompactAction {
pub cmx: [u8; 32],
pub ephemeral_key: [u8; 32],
pub ciphertext: Vec<u8>,
pub nullifier: [u8; 32],
}