pub struct QuoteRequest {
pub in_token_address: String,
pub out_token_address: String,
pub amount: String,
pub slippage: Option<f64>,
pub gas_price: Option<String>,
pub disabled_dex_ids: Option<String>,
}Expand description
Quote request parameters
Fields§
§in_token_address: StringInput token address
out_token_address: StringOutput token address
amount: StringAmount with decimals (e.g., “1000000000000000000” for 1 ETH)
slippage: Option<f64>Slippage in percentage (e.g., 1 for 1%)
gas_price: Option<String>Gas price in Gwei with decimals
disabled_dex_ids: Option<String>Disabled DEX IDs (comma-separated)
Implementations§
Source§impl QuoteRequest
impl QuoteRequest
Sourcepub fn new(
in_token: impl Into<String>,
out_token: impl Into<String>,
amount: impl Into<String>,
) -> Self
pub fn new( in_token: impl Into<String>, out_token: impl Into<String>, amount: impl Into<String>, ) -> Self
Create a new quote request
Sourcepub fn with_slippage(self, slippage: f64) -> Self
pub fn with_slippage(self, slippage: f64) -> Self
Set slippage tolerance (must be between 0.01 and 50.0 percent)
§Panics
Panics if slippage is outside the valid range (0.01..=50.0)
Sourcepub fn try_with_slippage(self, slippage: f64) -> Result<Self, String>
pub fn try_with_slippage(self, slippage: f64) -> Result<Self, String>
Set slippage tolerance with validation, returning an error if out of range
Slippage must be between 0.01% and 50%
Sourcepub fn with_gas_price(self, gas_price: impl Into<String>) -> Self
pub fn with_gas_price(self, gas_price: impl Into<String>) -> Self
Set gas price in Gwei
Sourcepub fn with_disabled_dexs(self, dex_ids: impl Into<String>) -> Self
pub fn with_disabled_dexs(self, dex_ids: impl Into<String>) -> Self
Disable specific DEX IDs
Trait Implementations§
Source§impl Clone for QuoteRequest
impl Clone for QuoteRequest
Source§fn clone(&self) -> QuoteRequest
fn clone(&self) -> QuoteRequest
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 moreSource§impl Debug for QuoteRequest
impl Debug for QuoteRequest
Auto Trait Implementations§
impl Freeze for QuoteRequest
impl RefUnwindSafe for QuoteRequest
impl Send for QuoteRequest
impl Sync for QuoteRequest
impl Unpin for QuoteRequest
impl UnwindSafe for QuoteRequest
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