AccountBalancesResponse
extends IteratorIterator
in package
Represents a collection of account balances
This iterable collection holds all asset balances for an account including native XLM and all trustline balances. The collection is included in AccountResponse and provides iterator functionality to traverse all balance entries.
Tags
Table of Contents
Methods
- __construct() : mixed
- Creates a new collection of account balances
- add() : mixed
- Adds a balance entry to the collection
- count() : int
- Gets the number of balance entries in the collection
- current() : AccountBalanceResponse
- Gets the current balance in the iteration
- toArray() : array<string|int, AccountBalanceResponse>
- Converts the collection to an array
Methods
__construct()
Creates a new collection of account balances
public
__construct(AccountBalanceResponse ...$balances) : mixed
Parameters
- $balances : AccountBalanceResponse
-
Variable number of balance entries
add()
Adds a balance entry to the collection
public
add(AccountBalanceResponse $balance) : mixed
Parameters
- $balance : AccountBalanceResponse
-
The balance entry to add
count()
Gets the number of balance entries in the collection
public
count() : int
Return values
int —The count of balance entries
current()
Gets the current balance in the iteration
public
current() : AccountBalanceResponse
Return values
AccountBalanceResponse —The current balance entry
toArray()
Converts the collection to an array
public
toArray() : array<string|int, AccountBalanceResponse>
Return values
array<string|int, AccountBalanceResponse> —Array of balance entries