ex3_core_registry_client/
lib.rsuse async_trait::async_trait;
use candid::Principal;
use ex3_canister_client::{ActorResult, CanisterResult};
use ex3_canister_types::pager::{GetPageInput, GetPageOutput};
use ex3_core_registry_public_types::{
BalanceVaultInfo, CandidChainNetworkConfirmationTime, SecretVaultInfo,
ShardingReportProgressInfo, ShardingSubReport, WalletRegistryInfo,
};
use ex3_node_types::asset::CandidRegisteredCryptoAsset;
use ex3_node_types::market::{
CandidMemeMarketTradingFee, CandidMemeMarketTradingSettings, CandidRegisteredMemeMarket,
CandidRegisteredSpotMarket, CandidSpotMarketTradingFee,
};
use ex3_node_types::settings::{
CandidBalanceVaultSetting, CandidSecretVaultSetting, CandidWalletRegistrySetting,
};
use ex3_node_types::{CandidAssetId, CandidBlockHeight, CandidWalletRegisterId, CanisterId};
#[cfg(feature = "mock")]
pub mod mock;
#[cfg(feature = "canister")]
pub mod canister_impl;
#[cfg(feature = "agent")]
pub mod client_impl;
#[async_trait]
pub trait CoreRegistry: Send + Sync {
async fn get_asset_by_id(
&self,
asset_id: CandidAssetId,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<Option<CandidRegisteredCryptoAsset>>>;
async fn get_assets_by_page(
&self,
pager: GetPageInput,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<GetPageOutput<CandidRegisteredCryptoAsset>>>;
async fn get_global_withdrawal_fee_to(
&self,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<Option<CandidWalletRegisterId>>>;
async fn get_chains_confirmation_times_by_page(
&self,
pager: GetPageInput,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<GetPageOutput<CandidChainNetworkConfirmationTime>>>;
async fn get_spot_market_initial_fee_to(
&self,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<Option<CandidWalletRegisterId>>>;
async fn get_spot_market_initial_trading_fee(
&self,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<Option<CandidSpotMarketTradingFee>>>;
async fn get_spot_markets_by_page(
&self,
input: GetPageInput,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<GetPageOutput<CandidRegisteredSpotMarket>>>;
async fn get_meme_market_initial_trading_settings(
&self,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<Option<CandidMemeMarketTradingSettings>>>;
async fn get_meme_market_initial_trading_fee(
&self,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<Option<CandidMemeMarketTradingFee>>>;
async fn get_meme_market_initial_fee_to(
&self,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<Option<CandidWalletRegisterId>>>;
async fn get_meme_markets_by_page(
&self,
input: GetPageInput,
height: Option<CandidBlockHeight>,
) -> CanisterResult<ActorResult<GetPageOutput<CandidRegisteredMemeMarket>>>;
async fn get_node_providers(&self) -> CanisterResult<Vec<Principal>>;
async fn get_node_provider_count(&self) -> CanisterResult<u64>;
async fn get_wallet_registry_ids(
&self,
pager: GetPageInput,
) -> CanisterResult<GetPageOutput<CanisterId>>;
async fn get_wallet_registries(
&self,
pager: GetPageInput,
) -> CanisterResult<GetPageOutput<WalletRegistryInfo>>;
async fn get_wallet_registry_count(&self) -> CanisterResult<u64>;
async fn get_wallet_registry_setting(
&self,
wallet_registry_id: CanisterId,
) -> CanisterResult<Option<CandidWalletRegistrySetting>>;
#[cfg(feature = "canister")]
async fn register_new_wallet_registry(
&self,
wallet_registry_canister_id: CanisterId,
wallet_registry_seq_id: u64,
wallet_registry_setting: CandidWalletRegistrySetting,
) -> CanisterResult<ActorResult<()>>;
async fn get_secret_vault_count(&self) -> CanisterResult<u64>;
async fn get_secret_vault_ids(
&self,
pager: GetPageInput,
) -> CanisterResult<GetPageOutput<CanisterId>>;
async fn get_secret_vaults(
&self,
pager: GetPageInput,
) -> CanisterResult<GetPageOutput<SecretVaultInfo>>;
async fn get_secret_vault_setting(
&self,
secret_vault_id: CanisterId,
) -> CanisterResult<Option<CandidSecretVaultSetting>>;
#[cfg(feature = "canister")]
async fn register_new_secret_vault(
&self,
secret_vault_canister_id: CanisterId,
secret_vault_seq_id: u64,
secret_vault_setting: CandidWalletRegistrySetting,
) -> CanisterResult<ActorResult<()>>;
async fn get_balance_vault_count(&self) -> CanisterResult<u64>;
async fn get_balance_vault_ids(
&self,
pager: GetPageInput,
) -> CanisterResult<GetPageOutput<CanisterId>>;
async fn get_balance_vaults(
&self,
pager: GetPageInput,
) -> CanisterResult<GetPageOutput<BalanceVaultInfo>>;
async fn get_balance_vault_setting(
&self,
balance_vault_id: CanisterId,
) -> CanisterResult<Option<CandidBalanceVaultSetting>>;
#[cfg(feature = "canister")]
async fn register_new_balance_vault(
&self,
balance_vault_canister_id: CanisterId,
balance_vault_seq_id: u64,
balance_vault_setting: CandidWalletRegistrySetting,
) -> CanisterResult<ActorResult<()>>;
async fn get_current_block_height(&self) -> CanisterResult<CandidBlockHeight>;
async fn get_current_snapshot_height(&self) -> CanisterResult<Option<CandidBlockHeight>>;
async fn get_sharding_report_progress_info(&self)
-> CanisterResult<ShardingReportProgressInfo>;
async fn apply_to_be_a_submitter(
&self,
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 report_gas_price(
&self,
chain: ex3_node_types::chain::CandidChain,
gas_price: ex3_node_types::CandidAssetAmount,
) -> CanisterResult<ActorResult<()>>;
}