pub struct DataClient { /* private fields */ }Expand description
Client for accessing position and portfolio data
This client provides access to user positions and portfolio values. It does not require authentication.
Implementations§
Source§impl DataClient
impl DataClient
Sourcepub fn new(host: impl Into<String>) -> Self
pub fn new(host: impl Into<String>) -> Self
Create a new DataClient
§Arguments
host- The base URL for the data API (typically different from main CLOB API)
Sourcepub async fn get_positions_value(
&self,
user: &str,
) -> Result<Vec<PositionValue>>
pub async fn get_positions_value( &self, user: &str, ) -> Result<Vec<PositionValue>>
Sourcepub async fn get_trades(
&self,
user: &str,
params: Option<TradeQueryParams>,
) -> Result<Vec<Trade>>
pub async fn get_trades( &self, user: &str, params: Option<TradeQueryParams>, ) -> Result<Vec<Trade>>
Sourcepub async fn get_activity(
&self,
user: &str,
params: Option<ActivityQueryParams>,
) -> Result<Vec<Activity>>
pub async fn get_activity( &self, user: &str, params: Option<ActivityQueryParams>, ) -> Result<Vec<Activity>>
Sourcepub async fn get_closed_positions(
&self,
user: &str,
) -> Result<Vec<ClosedPosition>>
pub async fn get_closed_positions( &self, user: &str, ) -> Result<Vec<ClosedPosition>>
Auto Trait Implementations§
impl Freeze for DataClient
impl !RefUnwindSafe for DataClient
impl Send for DataClient
impl Sync for DataClient
impl Unpin for DataClient
impl !UnwindSafe for DataClient
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more