pub struct OrderSigner { /* private fields */ }Expand description
EIP-712 order signer for the Polymarket CTF Exchange.
Implementations§
Source§impl OrderSigner
impl OrderSigner
Sourcepub fn new(private_key: &EvmPrivateKey) -> Result<Self>
pub fn new(private_key: &EvmPrivateKey) -> Result<Self>
Creates a new OrderSigner from an EVM private key.
Sourcepub fn with_signer_type(self, signer_type: PolymarketSignerType) -> Self
pub fn with_signer_type(self, signer_type: PolymarketSignerType) -> Self
Selects the signer role. Session signing requires POLY_1271 orders.
Sourcepub fn sign_order(
&self,
order: &PolymarketOrder,
neg_risk: bool,
) -> Result<String>
pub fn sign_order( &self, order: &PolymarketOrder, neg_risk: bool, ) -> Result<String>
Signs a PolymarketOrder and returns the hex-encoded ECDSA signature.
The neg_risk flag selects which exchange contract to use as the
EIP-712 verifyingContract.
§Errors
Returns an error if a non-POLY_1271 order signer does not match this
signer’s address, or if a POLY_1271 order does not use the deposit
wallet for both maker and signer.
Sourcepub fn sign_deposit_wallet_batch(
&self,
deposit_wallet: Address,
nonce: U256,
deadline: U256,
calls: &[DepositWalletCall],
) -> Result<String>
pub fn sign_deposit_wallet_batch( &self, deposit_wallet: Address, nonce: U256, deadline: U256, calls: &[DepositWalletCall], ) -> Result<String>
Signs a Deposit Wallet Batch and returns the hex-encoded ECDSA signature.
§Errors
Returns an error if calls is empty or signing fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OrderSigner
impl RefUnwindSafe for OrderSigner
impl Send for OrderSigner
impl Sync for OrderSigner
impl Unpin for OrderSigner
impl UnsafeUnpin for OrderSigner
impl UnwindSafe for OrderSigner
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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> ⓘ
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