Stellar PHP SDK API Documentation

ReservesResponse extends IteratorIterator

Iterable collection of liquidity pool reserve responses

This class provides an iterable wrapper around a collection of ReserveResponse objects representing the asset reserves held in a liquidity pool. Each reserve represents one asset in the pool with its amount. For constant product pools, there are typically two reserves corresponding to the two assets in the trading pair.

The collection supports iteration, counting, array conversion, and dynamic addition of reserve records. Used by LiquidityPoolResponse to represent the pool's asset holdings.

Tags
see
ReserveResponse

For individual reserve details

see
LiquidityPoolResponse

For the parent liquidity pool

Table of Contents

Methods

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

Methods

count()

Gets the total number of reserves in this collection

public count() : int
Return values
int

The count of reserves


        
On this page

Search results