FeeStatsResponse
extends Response
in package
Represents fee statistics from Horizon
Contains statistical information about transaction fees including the last ledger details, base fee, capacity usage, and distributions of fees charged and max fees. This helps developers determine appropriate fee levels for transactions.
Tags
Table of Contents
Properties
- $httpClient : Client|null
- $rateLimitLimit : int|null
- $rateLimitRemaining : int|null
- $rateLimitReset : int|null
Methods
- fromJson() : FeeStatsResponse
- getFeeCharged() : FeeChargedResponse
- Gets the fee charged statistics
- getHttpClient() : Client|null
- Gets the HTTP client used for pagination requests
- getLastLedger() : string
- Gets the sequence number of the last ledger
- getLastLedgerBaseFee() : string
- Gets the base fee in stroops for the last ledger
- getLedgerCapacityUsage() : string
- Gets the capacity usage for the last ledger
- getMaxFee() : MaxFeeResponse
- Gets the max fee statistics
- 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.
- 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
fromJson()
public
static fromJson(array<string|int, mixed> $json) : FeeStatsResponse
Parameters
- $json : array<string|int, mixed>
Return values
FeeStatsResponsegetFeeCharged()
Gets the fee charged statistics
public
getFeeCharged() : FeeChargedResponse
Return values
FeeChargedResponse —The fee charged distribution
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
getLastLedger()
Gets the sequence number of the last ledger
public
getLastLedger() : string
Return values
string —The last ledger sequence number
getLastLedgerBaseFee()
Gets the base fee in stroops for the last ledger
public
getLastLedgerBaseFee() : string
Return values
string —The base fee amount
getLedgerCapacityUsage()
Gets the capacity usage for the last ledger
public
getLedgerCapacityUsage() : string
Represents the percentage of ledger capacity used.
Return values
string —The capacity usage as a string
getMaxFee()
Gets the max fee statistics
public
getMaxFee() : MaxFeeResponse
Return values
MaxFeeResponse —The max fee distribution
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|nullsetHeaders()
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