pub struct SwapQuoteRequestBody {
pub amount_type: Option<AmountType>,
pub base_amount: SwapQuoteRequestBodyBaseAmount,
pub destination: SwapQuoteDestination,
pub fee_configuration: Option<TotalFeeConfigurationBps>,
pub slippage_bps: Option<i64>,
pub source: SwapSource,
}Expand description
Input for requesting a token swap quote.
JSON schema
{
"title": "SwapQuoteRequestBody",
"description": "Input for requesting a token swap quote.",
"examples": [
{
"amount_type": "exact_input",
"base_amount": "1000000000000000000",
"destination": {
"asset_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
},
"source": {
"asset_address": "native",
"caip2": "eip155:1"
}
}
],
"type": "object",
"required": [
"base_amount",
"destination",
"source"
],
"properties": {
"amount_type": {
"allOf": [
{
"$ref": "#/components/schemas/AmountType"
},
{
"description": "Whether the amount refers to the input token
(exact_input) or output token (exact_output).",
"default": "exact_input"
}
]
},
"base_amount": {
"description": "Amount in base units (e.g., wei for ETH). Must be a
non-negative integer string.",
"type": "string",
"maxLength": 78,
"minLength": 1,
"pattern": "^\\d+$"
},
"destination": {
"$ref": "#/components/schemas/SwapQuoteDestination"
},
"fee_configuration": {
"allOf": [
{
"$ref": "#/components/schemas/FeeConfiguration"
},
{
"description": "Optional fee configuration for the swap. If
omitted, cross-chain swaps will not charge additional fees."
}
]
},
"slippage_bps": {
"description": "Maximum slippage tolerance in basis points (e.g.,
50 for 0.5%). If omitted, auto-slippage is used.",
"type": "integer",
"maximum": 10000.0,
"minimum": 0.0
},
"source": {
"$ref": "#/components/schemas/SwapSource"
}
},
"x-stainless-model": "swaps.swap_quote_request_body"
}Fields§
§amount_type: Option<AmountType>§base_amount: SwapQuoteRequestBodyBaseAmountAmount in base units (e.g., wei for ETH). Must be a non-negative integer string.
destination: SwapQuoteDestination§fee_configuration: Option<TotalFeeConfigurationBps>§slippage_bps: Option<i64>Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted, auto-slippage is used.
source: SwapSourceTrait Implementations§
Source§impl Clone for SwapQuoteRequestBody
impl Clone for SwapQuoteRequestBody
Source§fn clone(&self) -> SwapQuoteRequestBody
fn clone(&self) -> SwapQuoteRequestBody
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 SwapQuoteRequestBody
impl Debug for SwapQuoteRequestBody
Source§impl<'de> Deserialize<'de> for SwapQuoteRequestBody
impl<'de> Deserialize<'de> for SwapQuoteRequestBody
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 From<&SwapQuoteRequestBody> for SwapQuoteRequestBody
impl From<&SwapQuoteRequestBody> for SwapQuoteRequestBody
Source§fn from(value: &SwapQuoteRequestBody) -> Self
fn from(value: &SwapQuoteRequestBody) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SwapQuoteRequestBody
impl RefUnwindSafe for SwapQuoteRequestBody
impl Send for SwapQuoteRequestBody
impl Sync for SwapQuoteRequestBody
impl Unpin for SwapQuoteRequestBody
impl UnsafeUnpin for SwapQuoteRequestBody
impl UnwindSafe for SwapQuoteRequestBody
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