Stellar PHP SDK API Documentation

TradesResponse extends IteratorIterator

Iterable collection of trade responses

This class provides an iterable wrapper around a collection of TradeResponse objects representing executed DEX trades. It extends IteratorIterator to enable efficient traversal of trades returned from Horizon API endpoints. The collection supports iteration, counting, array conversion, and dynamic addition of trade records.

Used by TradesPageResponse to hold the trades contained in a single page of results. Each item in the collection represents an executed exchange between two assets with details about the participants, amounts, price, and timing.

Tags
see
TradeResponse

For individual trade details

see
TradesPageResponse

For paginated trade results

Table of Contents

Methods

__construct()  : mixed
Constructs a new trades collection
add()  : void
Adds a trade response to the collection
count()  : int
Gets the total number of trades in this collection
current()  : TradeResponse
Gets the current trade in the iteration
toArray()  : array<string|int, TradeResponse>

Methods

count()

Gets the total number of trades in this collection

public count() : int
Return values
int

The count of trades


        
On this page

Search results