SimulateTransactionRequest
in package
Soroban Simulate Transaction Request.
The useUpgradedAuth flag selects the credential arm of auth entries recorded during simulation: true (the default) requests ADDRESS_V2 entries (Protocol 27, CAP-71), false requests legacy ADDRESS entries. The flag is effective only in recording mode: when authMode is "record" or "record_allow_nonroot", or when authMode is unset and the transaction carries no auth entries (the RPC then defaults to recording). It is ignored under "enforce". RPCs without Protocol 27 support silently ignore the flag and return legacy ADDRESS entries — support is detected by inspecting the credential arm of returned entries, not by any error signal.
The key "useUpgradedAuth" is always present in the request params with the current flag value. Set the flag to false on a network below Protocol 27, where ADDRESS_V2 entries invalidate the transaction.
Tags
Table of Contents
Properties
- $authMode : string|null
- $resourceConfig : ResourceConfig|null
- $transaction : Transaction
- $useUpgradedAuth : bool
Methods
- __construct() : mixed
- Constructor.
- getAuthMode() : string|null
- Returns the authorization mode for transaction simulation.
- getRequestParams() : array<string, mixed>
- Builds and returns the request parameters array for the RPC API call.
- getResourceConfig() : ResourceConfig|null
- getTransaction() : Transaction
- getUseUpgradedAuth() : bool
- Returns whether ADDRESS_V2 credential entries are requested during simulation.
- setAuthMode() : void
- Sets the authorization mode for transaction simulation.
- setResourceConfig() : void
- setTransaction() : void
- setUseUpgradedAuth() : void
- Sets the useUpgradedAuth flag.
Properties
$authMode
public
string|null
$authMode
= null
$resourceConfig
public
ResourceConfig|null
$resourceConfig
= null
$transaction
public
Transaction
$transaction
$useUpgradedAuth
public
bool
$useUpgradedAuth
= true
Methods
__construct()
Constructor.
public
__construct(Transaction $transaction[, ResourceConfig|null $resourceConfig = null ][, string|null $authMode = null ][, bool $useUpgradedAuth = true ]) : mixed
Parameters
- $transaction : Transaction
-
The transaction to be submitted. In order for the RPC server to successfully simulate a Stellar transaction, the provided transaction must contain only a single operation of the type invokeHostFunction.
- $resourceConfig : ResourceConfig|null = null
-
Contains configuration for how resources will be calculated when simulating transactions.
- $authMode : string|null = null
-
Support for non-root authorization. Only available for protocol >= 23. Possible values: "enforce" | "record" | "record_allow_nonroot"
- $useUpgradedAuth : bool = true
-
When true (the default), requests ADDRESS_V2 credential entries (Protocol 27, CAP-71); when false, requests legacy ADDRESS entries. RPCs without support silently ignore the flag and return legacy entries. Set to false on a network below Protocol 27, where ADDRESS_V2 entries invalidate the transaction.
getAuthMode()
Returns the authorization mode for transaction simulation.
public
getAuthMode() : string|null
Controls how authorization is handled during simulation.
Return values
string|null —The auth mode ("enforce", "record", or "record_allow_nonroot"), or null if not set
getRequestParams()
Builds and returns the request parameters array for the RPC API call.
public
getRequestParams() : array<string, mixed>
The "useUpgradedAuth" key is always included with the current flag value.
Return values
array<string, mixed> —The request parameters formatted for Soroban RPC
getResourceConfig()
public
getResourceConfig() : ResourceConfig|null
Return values
ResourceConfig|null —Contains configuration for how resources will be calculated when simulating transactions.
getTransaction()
public
getTransaction() : Transaction
Return values
Transaction —The transaction to be submitted. In order for the RPC server to successfully simulate a Stellar transaction, the provided transaction must contain only a single operation of the type invokeHostFunction.
getUseUpgradedAuth()
Returns whether ADDRESS_V2 credential entries are requested during simulation.
public
getUseUpgradedAuth() : bool
Return values
bool —true when the useUpgradedAuth flag is set
setAuthMode()
Sets the authorization mode for transaction simulation.
public
setAuthMode(string|null $authMode) : void
Only available for protocol >= 23.
Parameters
- $authMode : string|null
-
The auth mode: "enforce" | "record" | "record_allow_nonroot"
setResourceConfig()
public
setResourceConfig(ResourceConfig|null $resourceConfig) : void
Parameters
- $resourceConfig : ResourceConfig|null
-
Contains configuration for how resources will be calculated when simulating transactions.
setTransaction()
public
setTransaction(Transaction $transaction) : void
Parameters
- $transaction : Transaction
-
The transaction to be submitted. In order for the RPC server to successfully simulate a Stellar transaction, the provided transaction must contain only a single operation of the type invokeHostFunction.
setUseUpgradedAuth()
Sets the useUpgradedAuth flag.
public
setUseUpgradedAuth(bool $useUpgradedAuth) : void
When true, ADDRESS_V2 credential entries are requested during recording-mode simulation; when false, legacy ADDRESS entries. RPCs without Protocol 27 support silently ignore the flag. Set to false on networks below Protocol 27.
Parameters
- $useUpgradedAuth : bool
-
whether to request ADDRESS_V2 credential entries