pub struct UsAuth { /* private fields */ }Implementations§
Source§impl UsAuth
impl UsAuth
Sourcepub fn from_env() -> Result<Self, PolymarketUsError>
pub fn from_env() -> Result<Self, PolymarketUsError>
Load credentials from the ENV_KEY_ID and ENV_SECRET_KEY
environment variables.
Sourcepub fn from_parts(
key_id: String,
secret_b64: &str,
) -> Result<Self, PolymarketUsError>
pub fn from_parts( key_id: String, secret_b64: &str, ) -> Result<Self, PolymarketUsError>
Build credentials from a key ID and a Base64-encoded Ed25519 secret.
The secret must decode to either 64 bytes (keypair — the first 32 are used as the signing seed) or 32 bytes (a raw seed).
pub fn key_id(&self) -> &str
pub fn sign(&self, method: &str, path: &str) -> (i64, String)
pub fn signed_headers( &self, method: &str, path: &str, ) -> [(&'static str, String); 3]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UsAuth
impl RefUnwindSafe for UsAuth
impl Send for UsAuth
impl Sync for UsAuth
impl Unpin for UsAuth
impl UnsafeUnpin for UsAuth
impl UnwindSafe for UsAuth
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