InvokeHostFunctionOperationResponse
extends OperationResponse
in package
Represents an invoke host function operation response from Horizon API
This Soroban operation executes a smart contract function on the Stellar network. It can invoke contract functions, deploy new contracts, or upload contract code. The operation includes the function type (invoke, upload, or deploy), parameters passed to the function, the contract address, and tracks any asset balance changes that occurred during contract execution.
Tags
Table of Contents
Properties
- $address : string
- $assetBalanceChanges : AssetBalanceChangesResponse|null
- $function : string
- $parameters : ParametersResponse|null
- $salt : string
- $transactionSuccessful : bool
- $httpClient : Client|null
- $rateLimitLimit : int|null
- $rateLimitRemaining : int|null
- $rateLimitReset : int|null
Methods
- fromJson() : InvokeHostFunctionOperationResponse
- getAddress() : string
- Gets the contract address being invoked
- getAssetBalanceChanges() : AssetBalanceChangesResponse|null
- Gets asset balance changes caused by contract execution
- getCreatedAt() : string
- Gets the timestamp when this operation was created
- getFunction() : string
- Gets the host function type being invoked
- getHttpClient() : Client|null
- Gets the HTTP client used for pagination requests
- getHumanReadableOperationType() : string
- Gets the human-readable operation type name
- getLinks() : OperationLinksResponse
- Gets the hypermedia links to related resources
- getOperationId() : string
- Gets the unique identifier for this operation
- getOperationType() : int
- Gets the operation type as an integer code
- getPagingToken() : string
- Gets the paging token for this operation in list results
- getParameters() : ParametersResponse|null
- Gets the parameters passed to the contract function
- 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.
- getSalt() : string
- Gets the salt used for contract deployment
- getSourceAccount() : string
- Gets the source account for this operation
- getSourceAccountMuxed() : string|null
- Gets the multiplexed source account if applicable
- getSourceAccountMuxedId() : string|null
- Gets the multiplexed source account ID if applicable
- getTransaction() : TransactionResponse|null
- Gets the full transaction details if requested via join parameter
- getTransactionHash() : string
- Gets the hash of the transaction containing this operation
- isTransactionSuccessful() : bool
- Checks if the parent transaction was successful
- setAddress() : void
- Sets the contract address being invoked
- setAssetBalanceChanges() : void
- Sets asset balance changes caused by contract execution
- setFunction() : void
- Sets the host function type being invoked
- setHeaders() : void
- Extracts and sets rate limiting information from HTTP response headers
- setHttpClient() : void
- Sets the HTTP client for making follow-up requests
- setParameters() : void
- Sets the parameters passed to the contract function
- setSalt() : void
- Sets the salt used for contract deployment
- loadFromJson() : void
- Loads response data from a JSON array
Properties
$address
public
string
$address
$assetBalanceChanges
public
AssetBalanceChangesResponse|null
$assetBalanceChanges
= null
$function
public
string
$function
$parameters
public
ParametersResponse|null
$parameters
= null
$salt
public
string
$salt
$transactionSuccessful
public
bool
$transactionSuccessful
$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> $jsonData) : InvokeHostFunctionOperationResponse
Parameters
- $jsonData : array<string|int, mixed>
Return values
InvokeHostFunctionOperationResponsegetAddress()
Gets the contract address being invoked
public
getAddress() : string
Return values
string —The smart contract address
getAssetBalanceChanges()
Gets asset balance changes caused by contract execution
public
getAssetBalanceChanges() : AssetBalanceChangesResponse|null
Return values
AssetBalanceChangesResponse|null —Collection of balance changes or null
getCreatedAt()
Gets the timestamp when this operation was created
public
getCreatedAt() : string
Return values
string —The creation time in ISO 8601 format
getFunction()
Gets the host function type being invoked
public
getFunction() : string
Return values
string —Function type (InvokeContract, UploadContractWasm, or CreateContract)
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
getHumanReadableOperationType()
Gets the human-readable operation type name
public
getHumanReadableOperationType() : string
Examples: "payment", "create_account", "manage_sell_offer"
Return values
string —The operation type as a string
getLinks()
Gets the hypermedia links to related resources
public
getLinks() : OperationLinksResponse
Return values
OperationLinksResponse —Links to effects, transaction, etc.
getOperationId()
Gets the unique identifier for this operation
public
getOperationId() : string
Return values
string —The operation ID
getOperationType()
Gets the operation type as an integer code
public
getOperationType() : int
Return values
int —The operation type code matching OperationType constants
getPagingToken()
Gets the paging token for this operation in list results
public
getPagingToken() : string
Return values
string —The paging token used for cursor-based pagination
getParameters()
Gets the parameters passed to the contract function
public
getParameters() : ParametersResponse|null
Return values
ParametersResponse|null —Collection of function parameters or null
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|nullgetSalt()
Gets the salt used for contract deployment
public
getSalt() : string
Return values
string —The deployment salt value
getSourceAccount()
Gets the source account for this operation
public
getSourceAccount() : string
Return values
string —The source account ID
getSourceAccountMuxed()
Gets the multiplexed source account if applicable
public
getSourceAccountMuxed() : string|null
Return values
string|null —The muxed source account address, or null if not muxed
getSourceAccountMuxedId()
Gets the multiplexed source account ID if applicable
public
getSourceAccountMuxedId() : string|null
Return values
string|null —The muxed account ID, or null if not muxed
getTransaction()
Gets the full transaction details if requested via join parameter
public
getTransaction() : TransactionResponse|null
Return values
TransactionResponse|null —The transaction, or null if not joined
getTransactionHash()
Gets the hash of the transaction containing this operation
public
getTransactionHash() : string
Return values
string —The transaction hash
isTransactionSuccessful()
Checks if the parent transaction was successful
public
isTransactionSuccessful() : bool
Return values
bool —True if the transaction succeeded
setAddress()
Sets the contract address being invoked
public
setAddress(string $address) : void
Parameters
- $address : string
-
The smart contract address
setAssetBalanceChanges()
Sets asset balance changes caused by contract execution
public
setAssetBalanceChanges(AssetBalanceChangesResponse|null $assetBalanceChanges) : void
Parameters
- $assetBalanceChanges : AssetBalanceChangesResponse|null
-
Collection of balance changes or null
setFunction()
Sets the host function type being invoked
public
setFunction(string $function) : void
Parameters
- $function : string
-
Function type (InvokeContract, UploadContractWasm, or CreateContract)
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
setParameters()
Sets the parameters passed to the contract function
public
setParameters(ParametersResponse|null $parameters) : void
Parameters
- $parameters : ParametersResponse|null
-
Collection of function parameters or null
setSalt()
Sets the salt used for contract deployment
public
setSalt(string $salt) : void
Parameters
- $salt : string
-
The deployment salt value
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