pub struct Dex {
pub client: Client,
}Expand description
Provides methods for retrieving DEX candle data and related information.
Fields§
§client: ClientImplementations§
source§impl Dex
impl Dex
sourcepub fn candle<C, E, P>(
&self,
chain: C,
exchange: E,
pool: P,
options: CandleOptions,
) -> Result<CandleResponse>
pub fn candle<C, E, P>( &self, chain: C, exchange: E, pool: P, options: CandleOptions, ) -> Result<CandleResponse>
Retrieves candle data for a specified chain, exchange, and pool. Additional parameters can be provided to filter and sort the results. The response will contain an array of candle data objects, each representing a single candle with open, high, low, close, and volume values.
sourcepub fn trade<C, E, P>(
&self,
chain: C,
exchange: E,
pool: P,
options: TradeOptions,
) -> Result<TradeResponse>
pub fn trade<C, E, P>( &self, chain: C, exchange: E, pool: P, options: TradeOptions, ) -> Result<TradeResponse>
Retrieves trade data for a specified chain, exchange, and pool. Additional parameters can be provided to filter and sort the results. The response will contain an array of trade data objects, each representing a single trade with price, amount, and timestamp values.
sourcepub fn pools(&self, options: PoolsOptions) -> Result<Vec<PoolsResponse>>
pub fn pools(&self, options: PoolsOptions) -> Result<Vec<PoolsResponse>>
Retrieves information about available pools, including details about the chain, exchange, base and quote symbols, and pool address. Optional parameters can be provided to filter the results by chain and exchange.
sourcepub fn chains(&self) -> Result<Vec<String>>
pub fn chains(&self) -> Result<Vec<String>>
Retrieves a list of available chains for candle data.
Trait Implementations§
source§impl Datamaxi for Dex
impl Datamaxi for Dex
Implements the Datamaxi trait for Dex, providing methods
to create new instances of Dex with or without a custom base URL.
source§fn new(api_key: String) -> Dex
fn new(api_key: String) -> Dex
Creates a new Dex instance with the default base URL.
§Parameters
api_key: AStringrepresenting the API key used to authenticate requests.
§Returns
A new Dex instance configured with the default base URL and the provided api_key.
§Example
use crate::datamaxi::api::Datamaxi;
let dex = datamaxi::dex::Dex::new("my_api_key".to_string());source§fn new_with_base_url(api_key: String, base_url: String) -> Dex
fn new_with_base_url(api_key: String, base_url: String) -> Dex
Creates a new Dex instance with a custom base URL.
§Parameters
api_key: AStringrepresenting the API key used to authenticate requests.base_url: AStringrepresenting the custom base URL for API requests.
§Returns
A new Dex instance configured with the provided base_url and api_key.
§Example
use crate::datamaxi::api::Datamaxi;
let dex = datamaxi::dex::Dex::new_with_base_url("my_api_key".to_string(), "https://custom-api.example.com".to_string());Auto Trait Implementations§
impl Freeze for Dex
impl !RefUnwindSafe for Dex
impl Send for Dex
impl Sync for Dex
impl Unpin for Dex
impl !UnwindSafe for Dex
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)