pub mod config;
mod rest;
mod sock;
pub mod tokens;
pub mod types;
pub use config::IndexerConfig;
pub use rest::*;
pub use sock::*;
pub use tokens::*;
pub use types::*;
#[derive(Debug)]
pub struct IndexerClient {
rest: RestClient,
sock: SockClient,
}
impl IndexerClient {
pub fn new(config: IndexerConfig) -> Self {
Self {
rest: RestClient::new(config.rest),
sock: SockClient::new(config.sock),
}
}
pub fn accounts(&self) -> rest::Accounts<'_> {
self.rest.accounts()
}
pub fn markets(&self) -> rest::Markets<'_> {
self.rest.markets()
}
pub fn utility(&self) -> rest::Utility<'_> {
self.rest.utility()
}
pub fn vaults(&self) -> rest::Vaults<'_> {
self.rest.vaults()
}
pub fn affiliates(&self) -> rest::Affiliates<'_> {
self.rest.affiliates()
}
pub fn feed(&mut self) -> Feeds<'_> {
Feeds::new(&mut self.sock)
}
}