pub struct SplitSwapStrategyEncoder { /* private fields */ }Expand description
Represents the encoder for a swap strategy which supports split swaps.
§Fields
swap_encoder_registry: SwapEncoderRegistry, containing all possible swap encodersfunction_signature: String, the signature for the swap function in the router contractnative_address: Address of the chain’s native tokenwrapped_address: Address of the chain’s wrapped tokensplit_swap_validator: SplitSwapValidator, responsible for checking validity of split swap solutionsrouter_address: Address of the router to be used to execute swapstransfer_optimization: TransferOptimization, responsible for optimizing the token transfershistorical_trade: Whether the swap is to be done in the current block or in an historical one. This is relevant for checking token approvals in some protocols (like Balancer v2).
Implementations§
Source§impl SplitSwapStrategyEncoder
impl SplitSwapStrategyEncoder
pub fn new( chain: Chain, swap_encoder_registry: SwapEncoderRegistry, user_transfer_type: UserTransferType, router_address: Bytes, historical_trade: bool, ) -> Result<Self, EncodingError>
Trait Implementations§
Source§impl Clone for SplitSwapStrategyEncoder
impl Clone for SplitSwapStrategyEncoder
Source§fn clone(&self) -> SplitSwapStrategyEncoder
fn clone(&self) -> SplitSwapStrategyEncoder
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 moreSource§impl StrategyEncoder for SplitSwapStrategyEncoder
impl StrategyEncoder for SplitSwapStrategyEncoder
Source§fn encode_strategy(
&self,
solution: &Solution,
) -> Result<EncodedSolution, EncodingError>
fn encode_strategy( &self, solution: &Solution, ) -> Result<EncodedSolution, EncodingError>
encode_strategy takes a Solution, which contains all the necessary information about
the swaps to be performed, and encodes it into a format that can be executed by the router
or executor contracts. Read moreSource§fn get_swap_encoder(
&self,
protocol_system: &str,
) -> Option<&Box<dyn SwapEncoder>>
fn get_swap_encoder( &self, protocol_system: &str, ) -> Option<&Box<dyn SwapEncoder>>
Retrieves the swap encoder for a specific protocol system. Read more
Source§fn clone_box(&self) -> Box<dyn StrategyEncoder>
fn clone_box(&self) -> Box<dyn StrategyEncoder>
Creates a cloned instance of the strategy encoder.
Auto Trait Implementations§
impl !Freeze for SplitSwapStrategyEncoder
impl !RefUnwindSafe for SplitSwapStrategyEncoder
impl Send for SplitSwapStrategyEncoder
impl Sync for SplitSwapStrategyEncoder
impl Unpin for SplitSwapStrategyEncoder
impl !UnwindSafe for SplitSwapStrategyEncoder
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