pub struct PolymarketGammaRawHttpClient { /* private fields */ }Expand description
Provides a raw HTTP client for the Polymarket Gamma API.
Handles HTTP transport for fetching market data from the public Gamma API. No authentication is required.
Implementations§
Source§impl PolymarketGammaRawHttpClient
impl PolymarketGammaRawHttpClient
Sourcepub fn new(
base_url: Option<String>,
timeout_secs: u64,
) -> StdResult<Self, HttpClientError>
pub fn new( base_url: Option<String>, timeout_secs: u64, ) -> StdResult<Self, HttpClientError>
Creates a new PolymarketGammaRawHttpClient.
§Errors
Returns an error if the HTTP client cannot be created.
Sourcepub fn new_with_proxy(
base_url: Option<String>,
timeout_secs: u64,
proxy_url: Option<ProxyUrl>,
) -> StdResult<Self, HttpClientError>
pub fn new_with_proxy( base_url: Option<String>, timeout_secs: u64, proxy_url: Option<ProxyUrl>, ) -> StdResult<Self, HttpClientError>
Creates a new raw client with an optional validated proxy URL.
§Errors
Returns an error if the HTTP client cannot be created.
Sourcepub async fn get_gamma_markets(
&self,
params: GetGammaMarketsParams,
) -> Result<Vec<GammaMarket>>
pub async fn get_gamma_markets( &self, params: GetGammaMarketsParams, ) -> Result<Vec<GammaMarket>>
Fetches markets from the Gamma API.
Handles both bare array and {"data": [...]} response schemas.
Sourcepub async fn get_gamma_market(&self, market_id: &str) -> Result<GammaMarket>
pub async fn get_gamma_market(&self, market_id: &str) -> Result<GammaMarket>
Fetches a single market by ID from the Gamma API.
Sourcepub async fn get_gamma_market_by_slug(&self, slug: &str) -> Result<GammaMarket>
pub async fn get_gamma_market_by_slug(&self, slug: &str) -> Result<GammaMarket>
Fetches a market from the Gamma API GET /markets/slug/{slug}.
Sourcepub async fn get_gamma_events_by_slug(
&self,
slug: &str,
) -> Result<Vec<GammaEvent>>
pub async fn get_gamma_events_by_slug( &self, slug: &str, ) -> Result<Vec<GammaEvent>>
Fetches events from the Gamma API GET /events?slug=.
Sourcepub async fn get_gamma_events(
&self,
params: GetGammaEventsParams,
) -> Result<Vec<GammaEvent>>
pub async fn get_gamma_events( &self, params: GetGammaEventsParams, ) -> Result<Vec<GammaEvent>>
Fetches events from the Gamma API GET /events with full query params.
Fetches available tags from the Gamma API GET /tags.
Sourcepub async fn get_public_search(
&self,
params: GetSearchParams,
) -> Result<SearchResponse>
pub async fn get_public_search( &self, params: GetSearchParams, ) -> Result<SearchResponse>
Searches the Gamma API via GET /public-search.
Trait Implementations§
Source§impl Clone for PolymarketGammaRawHttpClient
impl Clone for PolymarketGammaRawHttpClient
Source§fn clone(&self) -> PolymarketGammaRawHttpClient
fn clone(&self) -> PolymarketGammaRawHttpClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PolymarketGammaRawHttpClient
impl !UnwindSafe for PolymarketGammaRawHttpClient
impl Freeze for PolymarketGammaRawHttpClient
impl Send for PolymarketGammaRawHttpClient
impl Sync for PolymarketGammaRawHttpClient
impl Unpin for PolymarketGammaRawHttpClient
impl UnsafeUnpin for PolymarketGammaRawHttpClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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