pub struct GetSwapPriceResponse {
pub block_number: GetSwapPriceResponseBlockNumber,
pub fees: GetSwapPriceResponseFees,
pub from_amount: GetSwapPriceResponseFromAmount,
pub from_token: GetSwapPriceResponseFromToken,
pub gas: Option<GetSwapPriceResponseGas>,
pub gas_price: GetSwapPriceResponseGasPrice,
pub issues: GetSwapPriceResponseIssues,
pub liquidity_available: bool,
pub min_to_amount: GetSwapPriceResponseMinToAmount,
pub to_amount: GetSwapPriceResponseToAmount,
pub to_token: GetSwapPriceResponseToToken,
}Expand description
GetSwapPriceResponse
JSON schema
{
"title": "GetSwapPriceResponse",
"allOf": [
{
"$ref": "#/components/schemas/CommonSwapResponse"
},
{
"type": "object",
"required": [
"gas",
"gasPrice"
],
"properties": {
"gas": {
"description": "The estimated gas limit that should be used to send the transaction to guarantee settlement.",
"examples": [
"100000"
],
"type": [
"string",
"null"
],
"pattern": "^\\d+$"
},
"gasPrice": {
"description": "The gas price, in Wei, that should be used to send the transaction. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. The transaction should be sent with this gas price to guarantee settlement.",
"examples": [
"1000000000"
],
"type": "string",
"pattern": "^\\d+$"
}
}
}
]
}Fields§
§block_number: GetSwapPriceResponseBlockNumberThe block number at which the liquidity conditions were examined.
fees: GetSwapPriceResponseFees§from_amount: GetSwapPriceResponseFromAmountThe amount of the fromToken that will be sent in this swap, in atomic units of the fromToken. For example, 1000000000000000000 when sending ETH equates to 1 ETH, 1000000 when sending USDC equates to 1 USDC, etc.
from_token: GetSwapPriceResponseFromTokenThe 0x-prefixed contract address of the token that will be sent.
gas: Option<GetSwapPriceResponseGas>The estimated gas limit that should be used to send the transaction to guarantee settlement.
gas_price: GetSwapPriceResponseGasPriceThe gas price, in Wei, that should be used to send the transaction. For EIP-1559 transactions, this value should be seen as the maxFeePerGas value. The transaction should be sent with this gas price to guarantee settlement.
issues: GetSwapPriceResponseIssues§liquidity_available: boolWhether sufficient liquidity is available to settle the swap. All other fields in the response will be empty if this is false.
min_to_amount: GetSwapPriceResponseMinToAmountThe minimum amount of the toToken that must be received for the swap to succeed, in atomic units of the toToken. For example, 1000000000000000000 when receiving ETH equates to 1 ETH, 1000000 when receiving USDC equates to 1 USDC, etc. This value is influenced by the slippageBps parameter.
to_amount: GetSwapPriceResponseToAmountThe amount of the toToken that will be received in atomic units of the toToken. For example, 1000000000000000000 when receiving ETH equates to 1 ETH, 1000000 when receiving USDC equates to 1 USDC, etc.
to_token: GetSwapPriceResponseToTokenThe 0x-prefixed contract address of the token that will be received.
Implementations§
Source§impl GetSwapPriceResponse
impl GetSwapPriceResponse
pub fn builder() -> GetSwapPriceResponse
Trait Implementations§
Source§impl Clone for GetSwapPriceResponse
impl Clone for GetSwapPriceResponse
Source§fn clone(&self) -> GetSwapPriceResponse
fn clone(&self) -> GetSwapPriceResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more