pub struct TychoRouterEncoderBuilder { /* private fields */ }Expand description
Builder pattern for constructing a TychoRouterEncoder with customizable options.
This struct allows setting a chain and strategy encoder before building the final encoder.
Implementations§
Source§impl TychoRouterEncoderBuilder
impl TychoRouterEncoderBuilder
pub fn new() -> Self
pub fn chain(self, chain: Chain) -> Self
pub fn user_transfer_type(self, user_transfer_type: UserTransferType) -> Self
Sourcepub fn executors_addresses(self, executors_addresses: String) -> Self
pub fn executors_addresses(self, executors_addresses: String) -> Self
Sets the executors_addresses manually.
If it’s not set, the default value will be used (contents of config/executor_addresses.json)
Sourcepub fn router_address(self, router_address: Bytes) -> Self
pub fn router_address(self, router_address: Bytes) -> Self
Sets the router_address manually.
If it’s not set, the default router address will be used (config/router_addresses.json)
Sourcepub fn historical_trade(self) -> Self
pub fn historical_trade(self) -> Self
Sets the historical_trade manually to true.
If set to true, it means that the encoded trade will be used in an historical block (as a
test) and not in the current one. This is relevant for checking token approvals in some
protocols (like Balancer v2).
Sourcepub fn swapper_pk(self, swapper_pk: String) -> Self
👎Deprecated: This is deprecated and will be removed in the future. You should sign and create the function calldata on your own.
pub fn swapper_pk(self, swapper_pk: String) -> Self
Sets the swapper_pk for the encoder. This is used to sign permit2 objects. This is only
needed if you intend to get the full calldata for the transfer. We do not recommend
using this option, you should sign and create the function calldata entirely on your
own.
Sourcepub fn build(self) -> Result<Box<dyn TychoEncoder>, EncodingError>
pub fn build(self) -> Result<Box<dyn TychoEncoder>, EncodingError>
Builds the TychoRouterEncoder instance using the configured chain.
Returns an error if either the chain has not been set.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TychoRouterEncoderBuilder
impl RefUnwindSafe for TychoRouterEncoderBuilder
impl Send for TychoRouterEncoderBuilder
impl Sync for TychoRouterEncoderBuilder
impl Unpin for TychoRouterEncoderBuilder
impl UnwindSafe for TychoRouterEncoderBuilder
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
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>
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