1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use async_trait::async_trait;
use ex3_asset_creator_detector_public_types::{
    CandidCryptoAssetCreator, CandidCryptoAssetCreatorFetchRequest,
};
use ex3_canister_client::{ActorResult, CanisterResult};
use ex3_canister_types::pager::{GetPageInput, GetPageOutput};

#[cfg(feature = "canister")]
pub mod canister_impl;
#[cfg(feature = "agent")]
pub mod client_impl;
#[cfg(feature = "mock")]
pub mod mock;

#[async_trait]
pub trait AssetCreatorDetector: Send + Sync {
    async fn accept_new_asset(
        &self,
        crypto_asset_creator_fetch_request: CandidCryptoAssetCreatorFetchRequest,
    ) -> CanisterResult<ActorResult<()>>;

    async fn get_creator_by_page(
        &self,
        pager: GetPageInput,
    ) -> CanisterResult<ActorResult<GetPageOutput<CandidCryptoAssetCreator>>>;

    #[cfg(feature = "canister")]
    async fn sync_chain_nodes(
        &self,
        chain: ex3_node_types::chain::CandidChain,
        chain_nodes: Vec<String>,
        version: u64,
    ) -> CanisterResult<ActorResult<()>>;
}