Zero XQuote Request
data class ZeroXQuoteRequest(val chainId: String, val buyToken: String, val sellToken: String, val sellAmount: String, val txOrigin: String? = null, val swapFeeRecipient: String? = null, val swapFeeBps: Int? = null, val swapFeeToken: String? = null, val tradeSurplusRecipient: String? = null, val gasPrice: String? = null, val slippageBps: Int? = null, val excludedSources: String? = null, val sellEntireBalance: String? = null)
Request model for getting a swap quote from ZeroX. All optional parameters can be used to customize the quote request.
Parameters
chain Id
The blockchain identifier (e.g., "eip155:1" for Ethereum Mainnet). Included in request body.
buy Token
The token to buy. Can be the address or symbol.
sell Token
The token to sell. Can be the address or symbol.
sell Amount
The amount to sell including all decimals.
tx Origin
Optional transaction origin address.
swap Fee Recipient
Optional address to receive swap fees.
swap Fee Bps
Optional swap fee in basis points.
swap Fee Token
Optional token to use for swap fees.
trade Surplus Recipient
Optional address to receive trade surplus.
gas Price
Optional gas price to use for the transaction.
slippage Bps
Optional slippage tolerance in basis points.
excluded Sources
Optional comma-separated list of sources to exclude.
sell Entire Balance
Optional flag to sell entire balance (converted to "true"/"false" string).
Constructors
Link copied to clipboard
constructor(chainId: String, buyToken: String, sellToken: String, sellAmount: String, txOrigin: String? = null, swapFeeRecipient: String? = null, swapFeeBps: Int? = null, swapFeeToken: String? = null, tradeSurplusRecipient: String? = null, gasPrice: String? = null, slippageBps: Int? = null, excludedSources: String? = null, sellEntireBalance: String? = null)