ZeroXPriceRequest

data class ZeroXPriceRequest(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 price quote from ZeroX (without transaction data). All optional parameters can be used to customize the price request.

Parameters

chainId

The blockchain identifier (e.g., "eip155:1" for Ethereum Mainnet). Included in request body.

buyToken

The token to buy. Can be the address or symbol.

sellToken

The token to sell. Can be the address or symbol.

sellAmount

The amount to sell including all decimals.

txOrigin

Optional transaction origin address.

swapFeeRecipient

Optional address to receive swap fees.

swapFeeBps

Optional swap fee in basis points.

swapFeeToken

Optional token to use for swap fees.

tradeSurplusRecipient

Optional address to receive trade surplus.

gasPrice

Optional gas price to use for the transaction.

slippageBps

Optional slippage tolerance in basis points.

excludedSources

Optional comma-separated list of sources to exclude.

sellEntireBalance

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)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val excludedSources: String? = null
Link copied to clipboard
val gasPrice: String? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val slippageBps: Int? = null
Link copied to clipboard
val swapFeeBps: Int? = null
Link copied to clipboard
Link copied to clipboard
val swapFeeToken: String? = null
Link copied to clipboard
Link copied to clipboard
val txOrigin: String? = null