pub struct EthFlowOrderData {
pub buy_token: Address,
pub receiver: Address,
pub sell_amount: Uint<256, 4>,
pub buy_amount: Uint<256, 4>,
pub app_data: FixedBytes<32>,
pub fee_amount: Uint<256, 4>,
pub valid_to: u32,
pub partially_fillable: bool,
pub quote_id: i64,
}Expand description
Parameters for a native-currency sell order submitted through the
EthFlow contract.
Maps to the EthFlowOrder struct in the Solidity contract. The
sell token is implicitly the chain’s native currency (ETH, xDAI, …).
§Example
use alloy_primitives::{Address, B256, U256};
use cow_ethflow::{EthFlowOrderData, encode_eth_flow_create_order};
let order = EthFlowOrderData {
buy_token: Address::ZERO,
receiver: Address::ZERO,
sell_amount: U256::from(1_000_000u64),
buy_amount: U256::from(500_000u64),
app_data: B256::ZERO,
fee_amount: U256::ZERO,
valid_to: 9_999_999,
partially_fillable: false,
quote_id: 42,
};
let cd = encode_eth_flow_create_order(&order);
assert_eq!(cd.len(), 292);Fields§
§buy_token: AddressToken to buy (native currency is the sell token).
receiver: AddressAddress that receives the bought tokens.
sell_amount: Uint<256, 4>Amount of native currency to sell (in wei).
buy_amount: Uint<256, 4>Minimum amount of buy_token to receive.
app_data: FixedBytes<32>bytes32 app-data hash.
fee_amount: Uint<256, 4>Protocol fee (in wei), typically zero for EthFlow.
valid_to: u32Order expiry as Unix timestamp.
partially_fillable: boolWhether the order may be partially filled.
quote_id: i64Quote identifier from the orderbook.
Trait Implementations§
Source§impl Clone for EthFlowOrderData
impl Clone for EthFlowOrderData
Source§fn clone(&self) -> EthFlowOrderData
fn clone(&self) -> EthFlowOrderData
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 EthFlowOrderData
impl RefUnwindSafe for EthFlowOrderData
impl Send for EthFlowOrderData
impl Sync for EthFlowOrderData
impl Unpin for EthFlowOrderData
impl UnsafeUnpin for EthFlowOrderData
impl UnwindSafe for EthFlowOrderData
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