pub struct ClientFeeParams { /* private fields */ }Expand description
Client fee configuration for the Tycho Router.
When attached to EncodingOptions via EncodingOptions::with_client_fee, the router
charges a client fee on the swap output. The signature must be an EIP-712 signature by the
receiver over the ClientFee typed data — compute the hash with
ClientFeeParams::eip712_signing_hash.
Implementations§
Source§impl ClientFeeParams
impl ClientFeeParams
Sourcepub fn new(
bps: u16,
receiver: Bytes,
max_contribution: BigUint,
deadline: u64,
) -> Self
pub fn new( bps: u16, receiver: Bytes, max_contribution: BigUint, deadline: u64, ) -> Self
Create client fee params.
signature must be a 65-byte EIP-712 signature by receiver.
Sourcepub fn with_signature(self, signature: Bytes) -> Self
pub fn with_signature(self, signature: Bytes) -> Self
Set the EIP-712 signature.
Sourcepub fn eip712_signing_hash(
&self,
chain_id: u64,
router_address: &Bytes,
) -> Result<[u8; 32], FyndError>
pub fn eip712_signing_hash( &self, chain_id: u64, router_address: &Bytes, ) -> Result<[u8; 32], FyndError>
Compute the EIP-712 signing hash for the client fee params.
Pass the returned hash to the fee receiver’s signer, then supply the
65-byte result as signature when constructing ClientFeeParams.
router_address is the 20-byte address of the TychoRouter contract.
Trait Implementations§
Source§impl Clone for ClientFeeParams
impl Clone for ClientFeeParams
Source§fn clone(&self) -> ClientFeeParams
fn clone(&self) -> ClientFeeParams
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 ClientFeeParams
impl RefUnwindSafe for ClientFeeParams
impl Send for ClientFeeParams
impl Sync for ClientFeeParams
impl Unpin for ClientFeeParams
impl UnsafeUnpin for ClientFeeParams
impl UnwindSafe for ClientFeeParams
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