pub struct DataApiBuilder { /* private fields */ }Expand description
Builder for configuring Data API client
Implementations§
Source§impl DataApiBuilder
impl DataApiBuilder
Sourcepub fn base_url(self, url: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
Set base URL for the API
This covers every namespace except DataApi::pnl and
DataApi::rankings, which live on their own hosts and have their own
setters.
Sourcepub fn pnl_base_url(self, url: impl Into<String>) -> Self
pub fn pnl_base_url(self, url: impl Into<String>) -> Self
Set base URL for the PnL host (default:
https://user-pnl-api.polymarket.com)
Give a scheme, host, and port only — a path prefix is silently dropped,
because request paths are absolute. See
HttpClient::with_base_url.
Sourcepub fn rankings_base_url(self, url: impl Into<String>) -> Self
pub fn rankings_base_url(self, url: impl Into<String>) -> Self
Set base URL for the rankings host (default:
https://lb-api.polymarket.com)
Give a scheme, host, and port only — a path prefix is silently dropped,
because request paths are absolute. See
HttpClient::with_base_url.
Sourcepub fn timeout_ms(self, timeout: u64) -> Self
pub fn timeout_ms(self, timeout: u64) -> Self
Set request timeout in milliseconds
Sourcepub fn with_retry_config(self, config: RetryConfig) -> Self
pub fn with_retry_config(self, config: RetryConfig) -> Self
Set retry configuration for 429 responses
Sourcepub fn max_concurrent(self, max: usize) -> Self
pub fn max_concurrent(self, max: usize) -> Self
Set the maximum number of concurrent in-flight requests.
Default: 4. Prevents Cloudflare 1015 errors from request bursts.
Sourcepub fn build(self) -> Result<DataApi, DataApiError>
pub fn build(self) -> Result<DataApi, DataApiError>
Build the Data API client