pub struct PolymarketRelayerHttpClient { /* private fields */ }Expand description
HTTP client for Relayer nonce, submit, and transaction polling.
Implementations§
Source§impl PolymarketRelayerHttpClient
impl PolymarketRelayerHttpClient
Sourcepub fn new(
credential: RelayerApiKey,
base_url: Option<String>,
timeout_secs: u64,
) -> StdResult<Self, HttpClientError>
pub fn new( credential: RelayerApiKey, base_url: Option<String>, timeout_secs: u64, ) -> StdResult<Self, HttpClientError>
Sourcepub fn new_with_proxy(
credential: RelayerApiKey,
base_url: Option<String>,
timeout_secs: u64,
proxy_url: Option<ProxyUrl>,
) -> StdResult<Self, HttpClientError>
pub fn new_with_proxy( credential: RelayerApiKey, base_url: Option<String>, timeout_secs: u64, proxy_url: Option<ProxyUrl>, ) -> StdResult<Self, HttpClientError>
Creates a Relayer HTTP client with an optional proxy.
§Errors
Returns an error if the HTTP client cannot be created.
Sourcepub fn new_with_builder(
credential: Credential,
base_url: Option<String>,
timeout_secs: u64,
proxy_url: Option<ProxyUrl>,
) -> StdResult<Self, HttpClientError>
pub fn new_with_builder( credential: Credential, base_url: Option<String>, timeout_secs: u64, proxy_url: Option<ProxyUrl>, ) -> StdResult<Self, HttpClientError>
Creates a Relayer client authenticated by a Builder HMAC credential.
§Errors
Returns an error if the HTTP client cannot be created.
Sourcepub async fn get_wallet_nonce(&self, signer: Address) -> Result<U256>
pub async fn get_wallet_nonce(&self, signer: Address) -> Result<U256>
Fetches a fresh WALLET nonce for signer.
§Errors
Returns an error if the Relayer rejects the request or the nonce is missing.
Sourcepub async fn submit_wallet_batch(
&self,
request: RelayerWalletSubmit<'_>,
) -> Result<RelayerTransaction>
pub async fn submit_wallet_batch( &self, request: RelayerWalletSubmit<'_>, ) -> Result<RelayerTransaction>
Submits a signed Deposit Wallet batch.
This method does not retry. A lost or timed-out submit remains an explicit ambiguous outcome.
§Errors
Returns an error if the Relayer rejects the request, the HTTP client times out, or the response cannot be decoded.
Sourcepub async fn get_transaction(
&self,
transaction_id: &str,
) -> Result<RelayerTransaction>
pub async fn get_transaction( &self, transaction_id: &str, ) -> Result<RelayerTransaction>
Polls a Relayer transaction by ID.
§Errors
Returns an error if the Relayer rejects the request or the body cannot be decoded.
Trait Implementations§
Source§impl Clone for PolymarketRelayerHttpClient
impl Clone for PolymarketRelayerHttpClient
Auto Trait Implementations§
impl !RefUnwindSafe for PolymarketRelayerHttpClient
impl !UnwindSafe for PolymarketRelayerHttpClient
impl Freeze for PolymarketRelayerHttpClient
impl Send for PolymarketRelayerHttpClient
impl Sync for PolymarketRelayerHttpClient
impl Unpin for PolymarketRelayerHttpClient
impl UnsafeUnpin for PolymarketRelayerHttpClient
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