AccountDataValueResponse
extends Response
in package
Represents a single data entry value for a specific key in an account
This response contains the value of a single data entry stored on an account ledger. The value is stored as a base64-encoded string and can be decoded to retrieve the original data. This response is returned by the account data value endpoint.
Returned by endpoint:
- GET /accounts/{account_id}/data/{key} - Single data entry value
Tags
Table of Contents
Properties
- $httpClient : Client|null
- $rateLimitLimit : int|null
- $rateLimitRemaining : int|null
- $rateLimitReset : int|null
Methods
- __construct() : mixed
- Creates a new account data value response
- fromJson() : AccountDataValueResponse
- Creates an AccountDataValueResponse instance from JSON data
- getDecodedValue() : string|false
- Gets the decoded value
- getHttpClient() : Client|null
- Gets the HTTP client used for pagination requests
- getRateLimitLimit() : int|null
- Returns X-RateLimit-Limit header from the response.
- getRateLimitRemaining() : int|null
- Returns X-RateLimit-Remaining header from the response.
- getRateLimitReset() : int|null
- Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.
- getValue() : string
- Gets the base64-encoded value
- setHeaders() : void
- Extracts and sets rate limiting information from HTTP response headers
- setHttpClient() : void
- Sets the HTTP client for making follow-up requests
- loadFromJson() : void
- Loads response data from a JSON array
Properties
$httpClient
protected
Client|null
$httpClient
= null
$rateLimitLimit
protected
int|null
$rateLimitLimit
= null
$rateLimitRemaining
protected
int|null
$rateLimitRemaining
= null
$rateLimitReset
protected
int|null
$rateLimitReset
= null
Methods
__construct()
Creates a new account data value response
public
__construct(string $value) : mixed
Parameters
- $value : string
-
The base64-encoded data value
fromJson()
Creates an AccountDataValueResponse instance from JSON data
public
static fromJson(array<string|int, mixed> $json) : AccountDataValueResponse
Parameters
- $json : array<string|int, mixed>
-
The JSON array containing data value from Horizon
Return values
AccountDataValueResponse —The parsed data value response
getDecodedValue()
Gets the decoded value
public
getDecodedValue() : string|false
Returns the data value decoded from base64 to its original form.
Return values
string|false —The decoded value, or false if decoding fails
getHttpClient()
Gets the HTTP client used for pagination requests
public
getHttpClient() : Client|null
Return values
Client|null —The HTTP client instance, or null if not set
getRateLimitLimit()
Returns X-RateLimit-Limit header from the response.
public
getRateLimitLimit() : int|null
This number represents the he maximum number of requests that the current client can make in one hour.
Tags
Return values
int|nullgetRateLimitRemaining()
Returns X-RateLimit-Remaining header from the response.
public
getRateLimitRemaining() : int|null
The number of remaining requests for the current window.
Tags
Return values
int|nullgetRateLimitReset()
Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.
public
getRateLimitReset() : int|null
Tags
Return values
int|nullgetValue()
Gets the base64-encoded value
public
getValue() : string
Returns the data value in its raw base64-encoded form as stored on the ledger.
Return values
string —The base64-encoded value
setHeaders()
Extracts and sets rate limiting information from HTTP response headers
public
setHeaders(array<string|int, mixed> $headers) : void
This method processes the X-Ratelimit-* headers from the HTTP response and stores them for client access.
Parameters
- $headers : array<string|int, mixed>
-
Associative array of HTTP headers from the response
setHttpClient()
Sets the HTTP client for making follow-up requests
public
setHttpClient([Client|null $httpClient = null ]) : void
Paginated responses contain links to next/previous pages. This HTTP client is used when following those links to fetch additional pages.
Parameters
- $httpClient : Client|null = null
-
The Guzzle HTTP client to use for pagination
loadFromJson()
Loads response data from a JSON array
protected
loadFromJson(array<string|int, mixed> $json) : void
This method is used internally to populate response objects from parsed JSON. Subclasses override this to extract their specific data fields.
Parameters
- $json : array<string|int, mixed>
-
Associative array of parsed JSON data