TradeAggregationsResponse
extends IteratorIterator
in package
Iterable collection of trade aggregation responses
This class provides an iterable wrapper around a collection of TradeAggregationResponse objects representing OHLC candlestick data. It extends IteratorIterator to enable efficient traversal of trade aggregations returned from Horizon API endpoints. The collection supports iteration, counting, array conversion, and dynamic addition of aggregation records.
Used by TradeAggregationsPageResponse to hold the aggregations contained in a single page of results. Each item represents a time bucket with open, high, low, close prices, volumes, and trade counts for a specific asset pair during that period.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs a new trade aggregations collection
- add() : void
- Adds a trade aggregation response to the collection
- count() : int
- Gets the total number of aggregations in this collection
- current() : TradeAggregationResponse
- Gets the current trade aggregation in the iteration
- toArray() : array<string|int, TradeAggregationResponse>
Methods
__construct()
Constructs a new trade aggregations collection
public
__construct(TradeAggregationResponse ...$response) : mixed
Parameters
- $response : TradeAggregationResponse
-
Variable number of aggregation responses
add()
Adds a trade aggregation response to the collection
public
add(TradeAggregationResponse $response) : void
Parameters
- $response : TradeAggregationResponse
-
The aggregation response to add
count()
Gets the total number of aggregations in this collection
public
count() : int
Return values
int —The count of trade aggregation records
current()
Gets the current trade aggregation in the iteration
public
current() : TradeAggregationResponse
Return values
TradeAggregationResponse —The current aggregation response
toArray()
public
toArray() : array<string|int, TradeAggregationResponse>