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.
This CTF-only method uses domain version 2; neg_risk selects the CTF exchange.
Use Self::sign_order_with_context for a Protocol V2 market.
§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_order_with_context(
&self,
order: &PolymarketOrder,
context: OrderSigningContext,
) -> Result<String>
pub fn sign_order_with_context( &self, order: &PolymarketOrder, context: OrderSigningContext, ) -> Result<String>
Signs an order with the validated market’s exchange and domain.
§Errors
Returns an error if signer validation or signing fails; see Self::sign_order.
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
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> ⓘ
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