OrderBookRowResponse
in package
Represents a single price level in the order book
This response represents one row in the order book, aggregating all offers at a specific price level. Each row shows the total amount available and the price, provided in both decimal string format and rational fraction format for precision.
Order book rows are aggregated by price, meaning multiple individual offers at the same price are combined into a single row showing the total available amount. This provides a consolidated view of market depth at each price level.
Used within OrderBookResponse to represent individual entries in the bids or asks collections.
Tags
Table of Contents
Methods
- fromJson() : OrderBookRowResponse
- Creates an OrderBookRowResponse from JSON data
- getAmount() : string
- Gets the total amount available at this price level
- getPrice() : string
- Gets the price for this order book level
- getPriceR() : OfferPriceResponse
- Gets the rational representation of the price
- loadFromJson() : void
Methods
fromJson()
Creates an OrderBookRowResponse from JSON data
public
static fromJson(array<string|int, mixed> $json) : OrderBookRowResponse
Parameters
- $json : array<string|int, mixed>
-
Associative array of parsed JSON response
Return values
OrderBookRowResponse —The populated order book row
getAmount()
Gets the total amount available at this price level
public
getAmount() : string
Return values
string —The aggregated amount from all offers at this price
getPrice()
Gets the price for this order book level
public
getPrice() : string
Return values
string —The price as a decimal string (counter per base)
getPriceR()
Gets the rational representation of the price
public
getPriceR() : OfferPriceResponse
Return values
OfferPriceResponse —The price as a fraction (numerator/denominator)
loadFromJson()
protected
loadFromJson(array<string|int, mixed> $json) : void
Parameters
- $json : array<string|int, mixed>