pub struct EthFlowOrderData {
pub buy_token: Address,
pub receiver: Address,
pub sell_amount: U256,
pub buy_amount: U256,
pub app_data: B256,
pub fee_amount: U256,
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: U256Amount of native currency to sell (in wei).
buy_amount: U256Minimum amount of buy_token to receive.
app_data: B256bytes32 app-data hash.
fee_amount: U256Protocol 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