OrderBookResponse

@Serializable
data class OrderBookResponse(val baseAsset: Asset, val counterAsset: Asset, val asks: List<OrderBookResponse.Row>, val bids: List<OrderBookResponse.Row>) : Response

Represents an order book response from the Horizon API.

The order book shows the current state of buy and sell offers for a given asset pair. It contains lists of bids (buy offers) and asks (sell offers), each with their amounts and prices.

See also

Constructors

Link copied to clipboard
constructor(baseAsset: Asset, counterAsset: Asset, asks: List<OrderBookResponse.Row>, bids: List<OrderBookResponse.Row>)

Types

Link copied to clipboard
@Serializable
data class Row(val amount: String, val price: String, val priceR: Price)

Represents a single price level in the order book.

Properties

Link copied to clipboard
@SerialName(value = "asks")
val asks: List<OrderBookResponse.Row>

List of sell offers (asks) in the order book

Link copied to clipboard
val base: Asset

Returns the base asset as an SDK Asset object.

Link copied to clipboard
@SerialName(value = "base")
val baseAsset: Asset

The base asset of the trading pair (raw JSON object)

Link copied to clipboard
@SerialName(value = "bids")
val bids: List<OrderBookResponse.Row>

List of buy offers (bids) in the order book

Link copied to clipboard

Returns the counter asset as an SDK Asset object.

Link copied to clipboard
@SerialName(value = "counter")
val counterAsset: Asset

The counter asset of the trading pair (raw JSON object)