ex3_balance_vault_client/
lib.rsuse async_trait::async_trait;
use candid::Nat;
use ex3_balance_vault_public_types::{
CandidBalancesWithBlockHeight, CandidBatchBalancesWithBlockHeight, CandidShardingSubReport,
ShardingReportProgressInfo,
};
use ex3_canister_client::{ActorResult, CanisterResult};
use ex3_node_types::range::CandidRange;
use ex3_node_types::{CandidBlockHeight, CandidWalletRegisterId};
#[cfg(feature = "canister")]
pub mod canister_impl;
#[cfg(feature = "agent")]
pub mod client_impl;
#[cfg(feature = "mock")]
pub mod mock;
#[async_trait]
pub trait BalanceVault: Send + Sync {
async fn get_current_block_height(&self) -> CanisterResult<CandidBlockHeight>;
async fn get_snapshot_height(&self) -> CanisterResult<Option<CandidBlockHeight>>;
async fn get_wallet_count(&self) -> CanisterResult<Nat>;
async fn apply_to_be_a_submitter(
&self,
height: CandidBlockHeight,
) -> CanisterResult<ActorResult<()>>;
async fn submit_sharding_sub_report(
&self,
block_height: CandidBlockHeight,
sharding_sub_report: CandidShardingSubReport,
) -> CanisterResult<ActorResult<()>>;
async fn commit_sharding_report(
&self,
block_height: CandidBlockHeight,
) -> CanisterResult<ActorResult<bool>>;
async fn validate_or_drop_sharding_report(
&self,
block_height: CandidBlockHeight,
) -> CanisterResult<ActorResult<()>>;
async fn get_sharding_report_progress_info(&self)
-> CanisterResult<ShardingReportProgressInfo>;
async fn get_balances(
&self,
wallet_id: CandidWalletRegisterId,
block_height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<CandidBalancesWithBlockHeight>>;
async fn get_balances_by_range(
&self,
wallet_id_range: CandidRange<CandidWalletRegisterId>,
block_height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<CandidBatchBalancesWithBlockHeight>>;
#[cfg(feature = "canister")]
async fn sync_node_provider(
&self,
full_sync_request: ex3_core_registry_public_types::NodeProviderFullSyncRequest,
) -> CanisterResult<ActorResult<()>>;
#[cfg(feature = "canister")]
async fn accept_node_provider_update(
&self,
incremental_sync_request: ex3_core_registry_public_types::NodeProviderIncrementalSyncRequest,
) -> CanisterResult<ActorResult<()>>;
}