pub struct RelayerApiKeyConfig { /* private fields */ }Expand description
Relayer API Key credentials for authenticated relay requests.
A simpler alternative to BuilderConfig that uses static headers
instead of HMAC-signed requests. See
https://docs.polymarket.com/trading/gasless#using-relayer-api-keys.
The Debug implementation redacts all secret fields to prevent accidental
leakage in logs.
Implementations§
Source§impl RelayerApiKeyConfig
impl RelayerApiKeyConfig
Sourcepub fn new(key: String, address: String) -> Result<Self, RelayError>
pub fn new(key: String, address: String) -> Result<Self, RelayError>
Create a new relayer API key config.
Returns an error if key or address is empty or whitespace-only.
Sourcepub fn address(&self) -> &str
pub fn address(&self) -> &str
Returns the on-chain address associated with the relayer API key.
Sourcepub fn generate_headers(&self) -> Result<HeaderMap, String>
pub fn generate_headers(&self) -> Result<HeaderMap, String>
Generate static authentication headers for relayer API key requests.
Trait Implementations§
Source§impl Clone for RelayerApiKeyConfig
impl Clone for RelayerApiKeyConfig
Source§fn clone(&self) -> RelayerApiKeyConfig
fn clone(&self) -> RelayerApiKeyConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RelayerApiKeyConfig
impl RefUnwindSafe for RelayerApiKeyConfig
impl Send for RelayerApiKeyConfig
impl Sync for RelayerApiKeyConfig
impl Unpin for RelayerApiKeyConfig
impl UnsafeUnpin for RelayerApiKeyConfig
impl UnwindSafe for RelayerApiKeyConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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