use std::pin::Pin;
use cow_errors::CowError;
use super::types::{QuoteBridgeRequest, QuoteBridgeResponse};
#[cfg(not(target_arch = "wasm32"))]
pub type QuoteFuture<'a> =
Pin<Box<dyn std::future::Future<Output = Result<QuoteBridgeResponse, CowError>> + Send + 'a>>;
#[cfg(target_arch = "wasm32")]
pub type QuoteFuture<'a> =
Pin<Box<dyn std::future::Future<Output = Result<QuoteBridgeResponse, CowError>> + 'a>>;
#[cfg(not(target_arch = "wasm32"))]
pub trait BridgeProvider: Send + Sync {
fn name(&self) -> &str;
fn supports_route(&self, sell_chain: u64, buy_chain: u64) -> bool;
fn get_quote<'a>(&'a self, req: &'a QuoteBridgeRequest) -> QuoteFuture<'a>;
}
#[cfg(target_arch = "wasm32")]
pub trait BridgeProvider {
fn name(&self) -> &str;
fn supports_route(&self, sell_chain: u64, buy_chain: u64) -> bool;
fn get_quote<'a>(&'a self, req: &'a QuoteBridgeRequest) -> QuoteFuture<'a>;
}