pub struct SwapQuoteResponse {
pub caip2: String,
pub destination_caip2: Option<String>,
pub est_output_amount: String,
pub estimated_fees: Vec<FeeLineItem>,
pub estimated_gas: Option<Gas>,
pub expires_at: Option<f64>,
pub gas_estimate: String,
pub input_amount: String,
pub input_token: String,
pub minimum_output_amount: String,
pub output_token: String,
}Expand description
Pricing data for a token swap.
JSON schema
{
"title": "SwapQuoteResponse",
"description": "Pricing data for a token swap.",
"examples": [
{
"caip2": "eip155:1",
"est_output_amount": "2000000000",
"gas_estimate": "150000",
"input_amount": "1000000000000000000",
"input_token": "native",
"minimum_output_amount": "1980000000",
"output_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}
],
"type": "object",
"required": [
"caip2",
"est_output_amount",
"gas_estimate",
"input_amount",
"input_token",
"minimum_output_amount",
"output_token"
],
"properties": {
"caip2": {
"description": "Chain identifier.",
"type": "string"
},
"destination_caip2": {
"description": "Destination chain CAIP-2 identifier for cross-chain
swaps. Only present for cross-chain swaps.",
"type": "string"
},
"est_output_amount": {
"description": "Estimated amount of output token in base units.",
"type": "string"
},
"estimated_fees": {
"description": "Estimated fees for the swap. Only present for
cross-chain swaps.",
"type": "array",
"items": {
"$ref": "#/components/schemas/FeeLineItem"
}
},
"estimated_gas": {
"allOf": [
{
"$ref": "#/components/schemas/Gas"
},
{
"description": "Estimated gas cost with full token metadata.
Only present for cross-chain swaps."
}
]
},
"expires_at": {
"description": "Quote expiry as Unix timestamp (seconds). Only
present for cross-chain quotes.",
"type": "number"
},
"gas_estimate": {
"description": "Estimated gas cost in base units of the native token. @deprecated For cross-chain swaps, use estimated_gas instead.",
"type": "string"
},
"input_amount": {
"description": "Amount of input token in base units.",
"type": "string"
},
"input_token": {
"description": "Token address being sold.",
"type": "string"
},
"minimum_output_amount": {
"description": "Minimum output amount accounting for slippage, in
base units.",
"type": "string"
},
"output_token": {
"description": "Token address being bought.",
"type": "string"
}
},
"x-stainless-model": "swaps.swap_quote_response"
}Fields§
§caip2: StringChain identifier.
destination_caip2: Option<String>Destination chain CAIP-2 identifier for cross-chain swaps. Only present for cross-chain swaps.
est_output_amount: StringEstimated amount of output token in base units.
estimated_fees: Vec<FeeLineItem>Estimated fees for the swap. Only present for cross-chain swaps.
estimated_gas: Option<Gas>§expires_at: Option<f64>§gas_estimate: StringEstimated gas cost in base units of the native token. @deprecated For cross-chain swaps, use estimated_gas instead.
input_amount: StringAmount of input token in base units.
input_token: StringToken address being sold.
minimum_output_amount: StringMinimum output amount accounting for slippage, in base units.
output_token: StringToken address being bought.
Trait Implementations§
Source§impl Clone for SwapQuoteResponse
impl Clone for SwapQuoteResponse
Source§fn clone(&self) -> SwapQuoteResponse
fn clone(&self) -> SwapQuoteResponse
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 SwapQuoteResponse
impl Debug for SwapQuoteResponse
Source§impl<'de> Deserialize<'de> for SwapQuoteResponse
impl<'de> Deserialize<'de> for SwapQuoteResponse
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<&SwapQuoteResponse> for SwapQuoteResponse
impl From<&SwapQuoteResponse> for SwapQuoteResponse
Source§fn from(value: &SwapQuoteResponse) -> Self
fn from(value: &SwapQuoteResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SwapQuoteResponse
impl RefUnwindSafe for SwapQuoteResponse
impl Send for SwapQuoteResponse
impl Sync for SwapQuoteResponse
impl Unpin for SwapQuoteResponse
impl UnsafeUnpin for SwapQuoteResponse
impl UnwindSafe for SwapQuoteResponse
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