PathAssetsResponse
extends IteratorIterator
in package
Iterable collection of assets in a payment path
This class provides an iterable wrapper around a collection of Asset objects representing the sequence of intermediate assets used in a path payment. Path payments allow sending one asset while the recipient receives a different asset, with the network automatically finding the best conversion route through multiple asset pairs.
The collection holds the ordered sequence of assets that form the conversion path, excluding the source and destination assets. For example, in a path from USD to EUR through XLM, this collection would contain [XLM] as the intermediate asset.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs a new path assets collection
- add() : void
- Adds an asset to the path collection
- count() : int
- Gets the total number of assets in this path
- current() : Asset
- Gets the current asset in the iteration
- toArray() : array<string|int, Asset>
Methods
__construct()
Constructs a new path assets collection
public
__construct(Asset ...$responses) : mixed
Parameters
- $responses : Asset
-
Variable number of asset objects
add()
Adds an asset to the path collection
public
add(Asset $response) : void
Parameters
- $response : Asset
-
The asset to add
count()
Gets the total number of assets in this path
public
count() : int
Return values
int —The count of intermediate assets
current()
Gets the current asset in the iteration
public
current() : Asset
Return values
Asset —The current asset in the path
toArray()
public
toArray() : array<string|int, Asset>