Stellar PHP SDK API Documentation

SEP24FeeResponse extends Response
in package

Base class for all Horizon API response objects

This abstract class provides common functionality for all Horizon response types, including rate limiting information and HTTP client management. Every response from the Horizon API extends this class.

Rate Limiting: Horizon enforces rate limits on API requests. This class captures rate limit headers from responses, allowing clients to monitor their usage and implement appropriate throttling strategies.

Pagination: Many Horizon endpoints return paginated results. Paginated responses include navigation links (next, prev, self) and typically contain an array of records. Use the cursor parameter with request builders to navigate through pages.

Table of Contents

Properties

$fee  : float|null
$httpClient  : Client|null
$rateLimitLimit  : int|null
$rateLimitRemaining  : int|null
$rateLimitReset  : int|null

Methods

fromJson()  : SEP24FeeResponse
Constructs a new instance of SEP24FeeResponse by using the given data.
getFee()  : float|null
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.
setFee()  : void
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 the needed data from a json array.

Properties

$fee

public float|null $fee = null

The total fee (in units of the asset involved) that would be charged to deposit/withdraw the specified amount of asset_code.

$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

fromJson()

Constructs a new instance of SEP24FeeResponse by using the given data.

public static fromJson(array<string|int, mixed> $json) : SEP24FeeResponse
Parameters
$json : array<string|int, mixed>

the data to construct the object from.

Return values
SEP24FeeResponse

the object containing the parsed data.

getFee()

public getFee() : float|null
Return values
float|null

The total fee (in units of the asset involved) that would be charged to deposit/withdraw the specified amount of asset_code.

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
see
https://developers.stellar.org

Stellar developer docs Rate limiting documentation

Return values
int|null

getRateLimitRemaining()

Returns X-RateLimit-Remaining header from the response.

public getRateLimitRemaining() : int|null

The number of remaining requests for the current window.

Tags
see
https://developers.stellar.org

Stellar developer docs Rate limiting documentation

Return values
int|null

getRateLimitReset()

Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.

public getRateLimitReset() : int|null
Tags
see
https://developers.stellar.org

Stellar developer docs Rate limiting documentation

Return values
int|null

setFee()

public setFee(float|null $fee) : void
Parameters
$fee : float|null

The total fee (in units of the asset involved) that would be charged to deposit/withdraw the specified amount of asset_code.

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 the needed data from a json array.

protected loadFromJson(array<string|int, mixed> $json) : void
Parameters
$json : array<string|int, mixed>

the data array to read from.


        
On this page

Search results