1use bitcoin::Address;
4use async_trait::async_trait;
5
6#[async_trait]
8pub trait ChainBackend: Send + Sync {
9 async fn is_address_used(&self, address: &Address) -> Result<bool, Box<dyn std::error::Error + Send + Sync>>;
11
12 async fn get_address_history(&self, address: &Address) -> Result<Vec<String>, Box<dyn std::error::Error + Send + Sync>>;
14}
15
16#[derive(Debug, Clone)]
18pub struct AddressUsedEvent {
19 pub hrn: String,
20 pub address: Address,
21 pub tx_id: String,
22}
23
24pub struct ChainMonitor {
26 _placeholder: (),
28}
29
30impl ChainMonitor {
31 pub fn new() -> Self {
32 Self { _placeholder: () }
33 }
34
35 pub async fn check_address_usage(&self, _address: &Address) -> Result<bool, Box<dyn std::error::Error + Send + Sync>> {
37 Ok(false)
39 }
40}