pub struct PredictOrderSigner { /* private fields */ }Expand description
Thin order signer wrapper backed by alloy PrivateKeySigner.
Implementations§
Source§impl PredictOrderSigner
impl PredictOrderSigner
pub fn from_private_key(private_key: &str, chain_id: u64) -> Result<Self>
pub fn address(&self) -> Address
pub fn chain_id(&self) -> u64
Sourcepub fn sign_auth_message(&self, message: &str) -> Result<String>
pub fn sign_auth_message(&self, message: &str) -> Result<String>
Sign the message used by GET /auth/message + POST /auth flow.
Sourcepub fn order_hash(
&self,
order: &PredictOrder,
is_neg_risk: bool,
is_yield_bearing: bool,
) -> Result<B256>
pub fn order_hash( &self, order: &PredictOrder, is_neg_risk: bool, is_yield_bearing: bool, ) -> Result<B256>
Compute EIP-712 signing hash for a Predict order.
Sourcepub fn sign_order(
&self,
order: &PredictOrder,
is_neg_risk: bool,
is_yield_bearing: bool,
) -> Result<SignedPredictOrder>
pub fn sign_order( &self, order: &PredictOrder, is_neg_risk: bool, is_yield_bearing: bool, ) -> Result<SignedPredictOrder>
Sign order using EIP-712 domain from Predict SDK contract map.
Trait Implementations§
Source§impl Clone for PredictOrderSigner
impl Clone for PredictOrderSigner
Source§fn clone(&self) -> PredictOrderSigner
fn clone(&self) -> PredictOrderSigner
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 PredictOrderSigner
impl RefUnwindSafe for PredictOrderSigner
impl Send for PredictOrderSigner
impl Sync for PredictOrderSigner
impl Unpin for PredictOrderSigner
impl UnsafeUnpin for PredictOrderSigner
impl UnwindSafe for PredictOrderSigner
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