pub struct GammaClient { /* private fields */ }Implementations§
Source§impl GammaClient
impl GammaClient
pub fn new() -> Self
Sourcepub fn with_cache<P: AsRef<Path>>(cache_dir: P) -> Result<Self>
pub fn with_cache<P: AsRef<Path>>(cache_dir: P) -> Result<Self>
Create a new GammaClient with file-based caching
Sourcepub fn set_cache_ttl(&mut self, ttl_seconds: u64) -> Result<()>
pub fn set_cache_ttl(&mut self, ttl_seconds: u64) -> Result<()>
Set cache TTL (time to live) in seconds
pub async fn get_active_events( &self, limit: Option<usize>, ) -> Result<Vec<Event>>
Sourcepub async fn get_trending_events(
&self,
order_by: Option<&str>,
ascending: Option<bool>,
limit: Option<usize>,
) -> Result<Vec<Event>>
pub async fn get_trending_events( &self, order_by: Option<&str>, ascending: Option<bool>, limit: Option<usize>, ) -> Result<Vec<Event>>
Get trending events ordered by trading volume
§Arguments
order_by- Field to order by (e.g., “volume24hr”, “volume7d”, “volume30d”)ascending- If true, sort ascending; if false, sort descendinglimit- Maximum number of events to return
pub async fn get_market_by_slug(&self, slug: &str) -> Result<Vec<Market>>
pub async fn get_all_active_asset_ids(&self) -> Result<Vec<String>>
Sourcepub async fn get_market_by_id(&self, market_id: &str) -> Result<Option<Market>>
pub async fn get_market_by_id(&self, market_id: &str) -> Result<Option<Market>>
Get market by ID
Sourcepub async fn get_markets(
&self,
active: Option<bool>,
closed: Option<bool>,
limit: Option<usize>,
) -> Result<Vec<Market>>
pub async fn get_markets( &self, active: Option<bool>, closed: Option<bool>, limit: Option<usize>, ) -> Result<Vec<Market>>
Get all markets (with optional filters)
Sourcepub async fn get_categories(&self) -> Result<Vec<Tag>>
pub async fn get_categories(&self) -> Result<Vec<Tag>>
Get categories/tags
Sourcepub async fn get_events_by_category(
&self,
category_slug: &str,
limit: Option<usize>,
) -> Result<Vec<Event>>
pub async fn get_events_by_category( &self, category_slug: &str, limit: Option<usize>, ) -> Result<Vec<Event>>
Get events by category/tag
Sourcepub async fn search_events(
&self,
query: &str,
limit: Option<usize>,
) -> Result<Vec<Event>>
pub async fn search_events( &self, query: &str, limit: Option<usize>, ) -> Result<Vec<Event>>
Search events by query string using the public-search endpoint
pub async fn get_market_info_by_asset_id( &self, asset_id: &str, ) -> Result<Option<MarketInfo>>
Sourcepub async fn get_status(&self) -> Result<StatusResponse>
pub async fn get_status(&self) -> Result<StatusResponse>
Check API health status
Get related tags for a tag ID
Sourcepub async fn get_series_by_id(&self, series_id: &str) -> Result<Option<Series>>
pub async fn get_series_by_id(&self, series_id: &str) -> Result<Option<Series>>
Get series by ID
Sourcepub async fn get_public_profile(
&self,
address: &str,
) -> Result<Option<PublicProfile>>
pub async fn get_public_profile( &self, address: &str, ) -> Result<Option<PublicProfile>>
Get public profile by wallet address
Get tags for a specific event
Get tags for a specific market
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GammaClient
impl !RefUnwindSafe for GammaClient
impl Send for GammaClient
impl Sync for GammaClient
impl Unpin for GammaClient
impl !UnwindSafe for GammaClient
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