pub struct SwapRequest {
pub chain: ChainInput,
pub from_token: String,
pub from_amount: String,
pub to_token: String,
pub signer: String,
pub recipient: Option<String>,
pub slippage_percent: Option<f64>,
pub slippage_bps: Option<u16>,
pub referral_code: Option<u32>,
pub compact: Option<bool>,
pub simple: Option<bool>,
pub disable_rfqs: Option<bool>,
}Expand description
Single-token swap request shape optimized for tool/runtime JSON boundaries.
Fields§
§chain: ChainInput§from_token: String§from_amount: String§to_token: String§signer: String§recipient: Option<String>§slippage_percent: Option<f64>§slippage_bps: Option<u16>§referral_code: Option<u32>§compact: Option<bool>§simple: Option<bool>§disable_rfqs: Option<bool>Implementations§
Source§impl SwapRequest
impl SwapRequest
Sourcepub fn validate(&self) -> Result<ValidatedSwapRequest>
pub fn validate(&self) -> Result<ValidatedSwapRequest>
Validate and normalize the request into typed Odos/alloy values.
Trait Implementations§
Source§impl Clone for SwapRequest
impl Clone for SwapRequest
Source§fn clone(&self) -> SwapRequest
fn clone(&self) -> SwapRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SwapRequest
impl Debug for SwapRequest
Source§impl<'de> Deserialize<'de> for SwapRequest
impl<'de> Deserialize<'de> for SwapRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SwapRequest
impl PartialEq for SwapRequest
Source§fn eq(&self, other: &SwapRequest) -> bool
fn eq(&self, other: &SwapRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SwapRequest
impl Serialize for SwapRequest
impl StructuralPartialEq for SwapRequest
Auto Trait Implementations§
impl Freeze for SwapRequest
impl RefUnwindSafe for SwapRequest
impl Send for SwapRequest
impl Sync for SwapRequest
impl Unpin for SwapRequest
impl UnsafeUnpin for SwapRequest
impl UnwindSafe for SwapRequest
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