pub struct Eip712Signer { /* private fields */ }Expand description
An EIP-712 order signer for the Limitless Exchange.
Holds a secp256k1 signing key and the venue exchange address
(used as verifyingContract in the EIP-712 domain).
Implementations§
Source§impl Eip712Signer
impl Eip712Signer
Sourcepub fn new(private_key: &str, verifying_contract: &str) -> Result<Self, String>
pub fn new(private_key: &str, verifying_contract: &str) -> Result<Self, String>
Create a new signer from a private key and the venue exchange address.
§Arguments
private_key— 0x-prefixed hex private key (32 bytes).verifying_contract— 0x-prefixed hex address ofvenue.exchange.
Sourcepub fn wallet_address(&self) -> &str
pub fn wallet_address(&self) -> &str
Get the wallet address derived from the private key.
Sourcepub fn sign_hash(&self, order_hash: &[u8; 32]) -> Result<String, String>
pub fn sign_hash(&self, order_hash: &[u8; 32]) -> Result<String, String>
Sign an EIP-712 order hash and return the 0x-prefixed hex signature.
Returns a 65-byte ECDSA signature in r || s || v format.
Sourcepub fn build_gtc_order(
&self,
maker_address: &str,
token_id: &str,
side: OrderSide,
price: f64,
size: f64,
fee_rate_bps: i32,
) -> Result<OrderData, String>
pub fn build_gtc_order( &self, maker_address: &str, token_id: &str, side: OrderSide, price: f64, size: f64, fee_rate_bps: i32, ) -> Result<OrderData, String>
Build and sign a GTC limit order.
Validates all fields, generates a unique monotonic salt, and signs the EIP-712 typed data.
§Arguments
maker_address— 0x-prefixed wallet address (must match the signer’s key)token_id— Decimal string representation of the token IDside— BUY or SELLprice— Price between 0 and 1size— Number of contractsfee_rate_bps— Fee rate in basis points (0–10000)
Auto Trait Implementations§
impl Freeze for Eip712Signer
impl RefUnwindSafe for Eip712Signer
impl Send for Eip712Signer
impl Sync for Eip712Signer
impl Unpin for Eip712Signer
impl UnsafeUnpin for Eip712Signer
impl UnwindSafe for Eip712Signer
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