ex3_wallet_registry_client/
lib.rsuse async_trait::async_trait;
use candid::Nat;
use ex3_canister_types::pager::{GetPageInput, GetPageOutput};
use ex3_node_types::wallet_identifier::{CandidRegisteredWalletIdentifier, WalletIdentifier};
use ex3_node_types::{CandidBlockHeight, CandidWalletRegisterId};
use std::collections::HashMap;
use ex3_canister_client::{ActorResult, CanisterResult};
use ex3_node_types::range::CandidRange;
use ex3_wallet_registry_public_types::{ShardingReportProgressInfo, ShardingSubReport};
#[cfg(feature = "mock")]
pub mod mock;
#[cfg(feature = "canister")]
pub mod canister_impl;
#[cfg(feature = "agent")]
pub mod client_impl;
#[async_trait]
pub trait WalletRegistry: Send + Sync {
async fn get_current_block_height(&self) -> CanisterResult<CandidBlockHeight>;
async fn get_current_snapshot_height(&self) -> CanisterResult<Option<CandidBlockHeight>>;
async fn get_wallet_id(
&self,
wallet: WalletIdentifier,
) -> CanisterResult<Option<CandidWalletRegisterId>>;
async fn batch_get_wallets_ids(
&self,
wallets: Vec<WalletIdentifier>,
) -> CanisterResult<Vec<Option<CandidWalletRegisterId>>>;
async fn get_wallet_by_id(
&self,
wallet_register_id: CandidWalletRegisterId,
) -> CanisterResult<Option<WalletIdentifier>>;
async fn get_registered_wallets_by_page(
&self,
pager: GetPageInput,
) -> CanisterResult<GetPageOutput<CandidRegisteredWalletIdentifier>>;
async fn get_remain_wallet_count(&self) -> CanisterResult<Nat>;
async fn get_wallet_count(&self) -> CanisterResult<Nat>;
async fn get_wallet_relation_by_range(
&self,
range: CandidRange<CandidWalletRegisterId>,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<HashMap<CandidWalletRegisterId, CandidWalletRegisterId>>>;
async fn get_wallet_relation_by_page(
&self,
pager: GetPageInput,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<GetPageOutput<(CandidWalletRegisterId, CandidWalletRegisterId)>>>;
async fn apply_to_be_a_submitter(
&self,
block_height: CandidBlockHeight,
) -> CanisterResult<ActorResult<()>>;
async fn submit_sharding_sub_report(
&self,
block_height: CandidBlockHeight,
sub_report: ShardingSubReport,
) -> CanisterResult<ActorResult<()>>;
async fn validate_or_drop_sharding_report(
&self,
block_height: CandidBlockHeight,
) -> CanisterResult<ActorResult<()>>;
async fn commit_sharding_report(
&self,
block_height: CandidBlockHeight,
) -> CanisterResult<ActorResult<bool>>;
async fn get_sharding_report_progress_info(&self)
-> CanisterResult<ShardingReportProgressInfo>;
#[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<()>>;
}