pub struct CreateEvmSwapQuoteBody {
pub from_amount: CreateEvmSwapQuoteBodyFromAmount,
pub from_token: CreateEvmSwapQuoteBodyFromToken,
pub gas_price: Option<CreateEvmSwapQuoteBodyGasPrice>,
pub network: EvmSwapsNetwork,
pub signer_address: Option<CreateEvmSwapQuoteBodySignerAddress>,
pub slippage_bps: i64,
pub taker: CreateEvmSwapQuoteBodyTaker,
pub to_token: CreateEvmSwapQuoteBodyToToken,
}Expand description
CreateEvmSwapQuoteBody
JSON schema
{
"type": "object",
"required": [
"fromAmount",
"fromToken",
"network",
"taker",
"toToken"
],
"properties": {
"fromAmount": {
"description": "The amount of the `fromToken` to send in atomic units of the token. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc.",
"examples": [
"1000000000000000000"
],
"type": "string",
"pattern": "^\\d+$"
},
"fromToken": {
"description": "The 0x-prefixed contract address of the token to send.",
"examples": [
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
],
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"gasPrice": {
"description": "The target gas price for the swap transaction, in Wei. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. If not provided, the API will use an estimate based on the current network conditions.",
"examples": [
"1000000000"
],
"type": "string",
"pattern": "^\\d+$"
},
"network": {
"$ref": "#/components/schemas/EvmSwapsNetwork"
},
"signerAddress": {
"description": "The 0x-prefixed Externally Owned Account (EOA) address that will sign the `Permit2` EIP-712 permit message. This is only needed if `taker` is a smart contract.",
"examples": [
"0x922f49447d8a07e3bd95bd0d56f35241523fbab8"
],
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"slippageBps": {
"description": "The maximum acceptable slippage of the `toToken` in basis points. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100 bps (i.e., 1%).",
"default": 100,
"examples": [
100
],
"type": "integer",
"maximum": 10000.0,
"minimum": 0.0
},
"taker": {
"description": "The 0x-prefixed address that holds the `fromToken` balance and has the `Permit2` allowance set for the swap.",
"examples": [
"0xAc0974bec39a17e36ba4a6b4d238ff944bacb478"
],
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"toToken": {
"description": "The 0x-prefixed contract address of the token to receive.",
"examples": [
"0x7F5c764cBc14f9669B88837ca1490cCa17c31607"
],
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
}
}
}Fields§
§from_amount: CreateEvmSwapQuoteBodyFromAmountThe amount of the fromToken to send in atomic units of the token. For example, 1000000000000000000 when sending ETH equates to 1 ETH, 1000000 when sending USDC equates to 1 USDC, etc.
from_token: CreateEvmSwapQuoteBodyFromTokenThe 0x-prefixed contract address of the token to send.
gas_price: Option<CreateEvmSwapQuoteBodyGasPrice>The target gas price for the swap transaction, in Wei. For EIP-1559 transactions, this value should be seen as the maxFeePerGas value. If not provided, the API will use an estimate based on the current network conditions.
network: EvmSwapsNetwork§signer_address: Option<CreateEvmSwapQuoteBodySignerAddress>The 0x-prefixed Externally Owned Account (EOA) address that will sign the Permit2 EIP-712 permit message. This is only needed if taker is a smart contract.
slippage_bps: i64The maximum acceptable slippage of the toToken in basis points. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100 bps (i.e., 1%).
taker: CreateEvmSwapQuoteBodyTakerThe 0x-prefixed address that holds the fromToken balance and has the Permit2 allowance set for the swap.
to_token: CreateEvmSwapQuoteBodyToTokenThe 0x-prefixed contract address of the token to receive.
Implementations§
Source§impl CreateEvmSwapQuoteBody
impl CreateEvmSwapQuoteBody
pub fn builder() -> CreateEvmSwapQuoteBody
Trait Implementations§
Source§impl Clone for CreateEvmSwapQuoteBody
impl Clone for CreateEvmSwapQuoteBody
Source§fn clone(&self) -> CreateEvmSwapQuoteBody
fn clone(&self) -> CreateEvmSwapQuoteBody
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more