Tools for working with Stellar accounts. These methods can be accessed by the
account
property on a bloom instance: $bloom->account
:
Fetch the details of a single account from Horizon.
Example:
$bloom = new Bloom();
$account = $bloom->account->retrieve('GBVG2QOHHFBVHAEGNF4XRUCAPAGWDROONM2LC4BK4ECCQ5RTQOO64VBW');
It is possible to instantiate an Account object without the Horizon data.
The hasBeenLoaded()
method will tell you if the data is available:
if ($account->hasBeenLoaded()) {
// do something...
}
Name | Type |
---|---|
$addressable | Addressable,string |
Account,Error
Increment an account's sequence number. No changes will be made if the current sequence number has not been loaded from Horizon.
Example
$account = $bloom->account->incrementSequenceNumber($account);
$sequenceNumber = $account->getSequenceNumber();
$int = $sequenceNumber->toNativeInt();
$string = $sequenceNumber->toNativeString();
Name | Type | Notes |
---|---|---|
$account | Account |
|
$bump | int |
Increment amount. The default is 1. |
Account
Retrieve a paginated listing of an Account's transactions.
Example
$account = $bloom->account->retrieve('GBVG2QOHHFBVHAEGNF4XRUCAPAGWDROONM2LC4BK4ECCQ5RTQOO64VBW');
$transactions = $bloom->account->transactions(account: $account, limit: 20, order: 'desc')
foreach ($transactions as $transaction) {
// do something with the transaction resource object.
}
Name | Type | Notes |
---|---|---|
$account | Account,Addressable,string |
|
$cursor | string,null |
A number that points to a specific location in a collection of responses. |
$order | string |
The sort order for the transactions; either 'asc' or 'desc'. Defaults to ascending if no value is set. |
$limit | int |
The maximum number of records returned. Must be between 1 and 200; the default is 10. |
$includeFailed | bool |
When true, failed transactions will be included in the response. Default is false. |
TransactionResourceCollection,Error
Retrieve a paginated listing of an Account's operations.
Example
$account = $bloom->account->retrieve('GBVG2QOHHFBVHAEGNF4XRUCAPAGWDROONM2LC4BK4ECCQ5RTQOO64VBW');
$transactions = $bloom->account->operations(account: $account, limit: 20, order: 'desc')
foreach ($operations as $operation) {
// do something with the operation resource object.
}
Name | Type |
---|---|
$account | Account,Addressable,string |
$cursor | string,null |
$order | string |
$limit | int |
$includeFailed | bool |
$includeTransactions | bool |
OperationResourceCollection,Error