pub struct DataClient { /* private fields */ }Expand description
Data API client
Implementations§
Source§impl DataClient
impl DataClient
Sourcepub async fn get_trades_by_event(
&self,
event_id: u64,
limit: Option<usize>,
offset: Option<usize>,
filter_type: Option<&str>,
filter_amount: Option<f64>,
) -> Result<Vec<DataTrade>>
pub async fn get_trades_by_event( &self, event_id: u64, limit: Option<usize>, offset: Option<usize>, filter_type: Option<&str>, filter_amount: Option<f64>, ) -> Result<Vec<DataTrade>>
Get trades for a specific event
Sourcepub async fn get_trades_by_event_slug(
&self,
event_slug: &str,
limit: Option<usize>,
offset: Option<usize>,
) -> Result<Vec<DataTrade>>
pub async fn get_trades_by_event_slug( &self, event_slug: &str, limit: Option<usize>, offset: Option<usize>, ) -> Result<Vec<DataTrade>>
Get trades for a specific event slug
Sourcepub async fn get_trades_by_market(
&self,
condition_id: &str,
limit: Option<usize>,
offset: Option<usize>,
) -> Result<Vec<DataTrade>>
pub async fn get_trades_by_market( &self, condition_id: &str, limit: Option<usize>, offset: Option<usize>, ) -> Result<Vec<DataTrade>>
Get trades for a specific market (condition ID)
Sourcepub async fn get_positions(&self, user_address: &str) -> Result<Vec<Position>>
pub async fn get_positions(&self, user_address: &str) -> Result<Vec<Position>>
Get user positions (requires authentication)
Sourcepub async fn get_portfolio(&self, user_address: &str) -> Result<Portfolio>
pub async fn get_portfolio(&self, user_address: &str) -> Result<Portfolio>
Get portfolio for a user (requires authentication)
Sourcepub async fn get_activity(
&self,
user_address: &str,
limit: Option<usize>,
offset: Option<usize>,
market: Option<&str>,
event_id: Option<u64>,
activity_types: Option<Vec<ActivityType>>,
start: Option<i64>,
end: Option<i64>,
sort_by: Option<ActivitySortBy>,
sort_direction: Option<SortDirection>,
side: Option<TradeSide>,
) -> Result<Vec<Activity>>
pub async fn get_activity( &self, user_address: &str, limit: Option<usize>, offset: Option<usize>, market: Option<&str>, event_id: Option<u64>, activity_types: Option<Vec<ActivityType>>, start: Option<i64>, end: Option<i64>, sort_by: Option<ActivitySortBy>, sort_direction: Option<SortDirection>, side: Option<TradeSide>, ) -> Result<Vec<Activity>>
Get user activity (trades, splits, merges, redeems, rewards, conversions)
§Arguments
user_address- The user’s wallet address (0x-prefixed)limit- Results per page (0-500, default 100)offset- Pagination offset (0-10000, default 0)market- Optional comma-separated condition IDsevent_id- Optional event ID (mutually exclusive with market)activity_types- Optional filter by activity typesstart- Optional start timestampend- Optional end timestampsort_by- Optional sort field (default: TIMESTAMP)sort_direction- Optional sort direction (default: DESC)side- Optional trade side filter
Sourcepub async fn get_trades(
&self,
user_address: Option<&str>,
market: Option<&str>,
event_id: Option<u64>,
limit: Option<usize>,
offset: Option<usize>,
taker_only: Option<bool>,
filter_type: Option<&str>,
filter_amount: Option<f64>,
side: Option<TradeSide>,
) -> Result<Vec<DataTrade>>
pub async fn get_trades( &self, user_address: Option<&str>, market: Option<&str>, event_id: Option<u64>, limit: Option<usize>, offset: Option<usize>, taker_only: Option<bool>, filter_type: Option<&str>, filter_amount: Option<f64>, side: Option<TradeSide>, ) -> Result<Vec<DataTrade>>
Get trades with enhanced filtering options
§Arguments
user_address- Optional user wallet addressmarket- Optional comma-separated condition IDsevent_id- Optional event ID (mutually exclusive with market)limit- Results per page (0-10000, default 100)offset- Pagination offset (0-10000, default 0)taker_only- Filter to taker-initiated trades (default true)filter_type- Optional filter type (CASH or TOKENS)filter_amount- Optional filter amountside- Optional trade side filter
Sourcepub async fn get_positions_filtered(
&self,
user_address: &str,
market: Option<&str>,
event_id: Option<u64>,
size_threshold: Option<f64>,
redeemable: Option<bool>,
mergeable: Option<bool>,
limit: Option<usize>,
offset: Option<usize>,
) -> Result<Vec<Position>>
pub async fn get_positions_filtered( &self, user_address: &str, market: Option<&str>, event_id: Option<u64>, size_threshold: Option<f64>, redeemable: Option<bool>, mergeable: Option<bool>, limit: Option<usize>, offset: Option<usize>, ) -> Result<Vec<Position>>
Get positions with enhanced filtering options
§Arguments
user_address- User wallet addressmarket- Optional comma-separated condition IDsevent_id- Optional event IDsize_threshold- Minimum position size (default 1)redeemable- Filter redeemable positionsmergeable- Filter mergeable positionslimit- Results per page (0-500, default 100)offset- Pagination offset (0-10000, default 0)
Trait Implementations§
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