pub struct Order { /* private fields */ }Expand description
A single swap intent submitted to the Fynd solver.
Addresses are raw 20-byte values (bytes::Bytes). The amount is denominated
in the smallest unit of the input token (e.g. wei for ETH, atomic units for ERC-20).
Implementations§
Source§impl Order
impl Order
Sourcepub fn new(
token_in: Bytes,
token_out: Bytes,
amount: BigUint,
side: OrderSide,
sender: Bytes,
receiver: Option<Bytes>,
) -> Self
pub fn new( token_in: Bytes, token_out: Bytes, amount: BigUint, side: OrderSide, sender: Bytes, receiver: Option<Bytes>, ) -> Self
Construct a new order.
token_in: 20-byte ERC-20 address of the token to sell.token_out: 20-byte ERC-20 address of the token to receive.amount: exact amount to sell (token units, not wei unless the token is WETH).side: must beOrderSide::Sell; buy orders are not yet supported.sender: 20-byte address of the wallet sendingtoken_in.receiver: 20-byte address that receivestoken_out. Defaults tosenderifNone.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Order
impl RefUnwindSafe for Order
impl Send for Order
impl Sync for Order
impl Unpin for Order
impl UnsafeUnpin for Order
impl UnwindSafe for Order
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> 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