use std::fmt::Debug;
use v_exchanges_api_generics::{http, ws};
pub trait HandlerOption: Default {
type Options: HandlerOptions<OptionItem = Self>;
}
pub trait HandlerOptions: Default + Clone + Debug {
type OptionItem: HandlerOption<Options = Self>;
fn update(&mut self, option: Self::OptionItem);
fn is_authenticated(&self) -> bool;
}
pub trait HttpOption<'a, R, B>: HandlerOption {
type RequestHandler: http::RequestHandler<B>;
fn request_handler(options: Self::Options) -> Self::RequestHandler;
}
pub trait WsOption: HandlerOption {
type WsHandler: ws::WsHandler;
fn ws_handler(options: Self::Options) -> Self::WsHandler;
}
pub trait EndpointUrl {
fn url_mainnet(&self) -> url::Url;
fn url_testnet(&self) -> Option<url::Url>;
}