SimulateTransactionRequest
in package
Soroban Simulate Transaction Request.
The useUpgradedAuth flag requests that the RPC node return ADDRESS_V2 credential entries (Protocol 27, CAP-71) instead of legacy ADDRESS entries during recording-mode simulation. 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 omitted from the request when the flag is false (the default), so existing call sites require no changes and pre-27 RPCs never see the key.
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
= false
Methods
__construct()
Constructor.
public
__construct(Transaction $transaction[, ResourceConfig|null $resourceConfig = null ][, string|null $authMode = null ][, bool $useUpgradedAuth = false ]) : 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 = false
-
When true, requests ADDRESS_V2 credential entries (Protocol 27, CAP-71). The key is omitted when false; RPCs without support silently ignore it and return legacy entries. Invalid on pre-27 networks: emitting ADDRESS_V2 entries on a pre-27 network invalidates 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 included only when $useUpgradedAuth is true. Omitting the key (the default) preserves compatibility with pre-27 RPCs that do not recognize it.
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, "useUpgradedAuth": true is included in the request params. RPCs without Protocol 27 support silently ignore the flag. Do not enable on pre-27 networks.
Parameters
- $useUpgradedAuth : bool
-
whether to request ADDRESS_V2 credential entries