Stellar PHP SDK API Documentation

EffectResponse extends Response

Base class for all effect responses in the Stellar network

This response represents the changes that occur in the ledger as a result of operations. Effects are more granular than operations and show the specific state changes that occurred. The base EffectResponse class contains common fields present in all effect types, including the effect ID, account affected, timestamps, and effect type information.

The fromJson factory method automatically deserializes JSON into the appropriate specific effect subclass based on the effect type (e.g., AccountCreatedEffectResponse, TrustlineCreatedEffectResponse, TradeEffectResponse, etc.).

Key fields:

  • Effect ID and paging token
  • Account affected by the effect (with optional muxed account details)
  • Effect type (both numeric and human-readable)
  • Creation timestamp

Returned by Horizon endpoints:

  • GET /effects - All effects
  • GET /accounts/{account_id}/effects - Effects for an account
  • GET /transactions/{transaction_hash}/effects - Effects from a transaction
  • GET /operations/{operation_id}/effects - Effects from an operation
  • GET /ledgers/{sequence}/effects - Effects in a ledger
Tags
see
EffectType

For effect type constants

see
AccountCreatedEffectResponse

For account creation effects

see
TradeEffectResponse

For trade effects

see
https://developers.stellar.org

Stellar developer docs Horizon Effects API

since
1.0.0

Table of Contents

Properties

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

Methods

fromJson()  : EffectResponse
getAccount()  : string
Gets the account address affected by this effect
getAccountMuxed()  : string|null
Gets the muxed account address if the account is multiplexed
getAccountMuxedId()  : string|null
Gets the muxed account ID if the account is multiplexed
getCreatedAt()  : string
Gets the timestamp when this effect was created
getEffectId()  : string
Gets the unique identifier for this effect
getEffectType()  : int
Gets the numeric effect type identifier
getHttpClient()  : Client|null
Gets the HTTP client used for pagination requests
getHumanReadableEffectType()  : string
Gets the human-readable description of the effect type
getLinks()  : EffectLinksResponse
Gets the links to related resources for this effect
getPagingToken()  : string
Gets the paging token for this effect in list results
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

getAccount()

Gets the account address affected by this effect

public getAccount() : string
Return values
string

The account ID

getAccountMuxed()

Gets the muxed account address if the account is multiplexed

public getAccountMuxed() : string|null
Return values
string|null

The muxed account address, or null if not multiplexed

getAccountMuxedId()

Gets the muxed account ID if the account is multiplexed

public getAccountMuxedId() : string|null
Return values
string|null

The muxed account ID, or null if not multiplexed

getCreatedAt()

Gets the timestamp when this effect was created

public getCreatedAt() : string
Return values
string

The creation time in ISO 8601 format

getEffectId()

Gets the unique identifier for this effect

public getEffectId() : string
Return values
string

The effect ID

getEffectType()

Gets the numeric effect type identifier

public getEffectType() : int
Return values
int

The effect type code as defined in EffectType constants

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

getHumanReadableEffectType()

Gets the human-readable description of the effect type

public getHumanReadableEffectType() : string
Return values
string

The effect type name (e.g., "account_created", "trade")

getPagingToken()

Gets the paging token for this effect in list results

public getPagingToken() : string
Return values
string

The paging token used for cursor-based pagination

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

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


        
On this page

Search results