SimulateTransactionResponse

@Serializable
data class SimulateTransactionResponse(val error: String? = null, val transactionData: String? = null, val events: List<String>? = null, val minResourceFee: Long? = null, val results: List<SimulateTransactionResponse.SimulateHostFunctionResult>? = null, val restorePreamble: SimulateTransactionResponse.RestorePreamble? = null, val stateChanges: List<SimulateTransactionResponse.LedgerEntryChange>? = null, val latestLedger: Long? = null)

Response for JSON-RPC method simulateTransaction.

The simulation response will have different model representations with different members present or absent depending on the type of response that it is conveying. For example, the simulation response for invoke host function could be one of three types:

  • Error: Contains an error message

  • Success: Contains results, transaction data, and resource fees

  • Restore operation needed: Contains restore preamble for state archival restoration

See also

Constructors

Link copied to clipboard
constructor(error: String? = null, transactionData: String? = null, events: List<String>? = null, minResourceFee: Long? = null, results: List<SimulateTransactionResponse.SimulateHostFunctionResult>? = null, restorePreamble: SimulateTransactionResponse.RestorePreamble? = null, stateChanges: List<SimulateTransactionResponse.LedgerEntryChange>? = null, latestLedger: Long? = null)

Types

Link copied to clipboard
@Serializable
data class LedgerEntryChange(val type: String, val key: String, val before: String? = null, val after: String? = null)

Represents a change in a ledger entry during simulation.

Link copied to clipboard
@Serializable
data class RestorePreamble(val transactionData: String, val minResourceFee: Long)

Information about required state restoration before the transaction can be submitted.

Link copied to clipboard
@Serializable
data class SimulateHostFunctionResult(val auth: List<String>? = null, val xdr: String? = null)

Result of simulating a host function invocation.

Properties

Link copied to clipboard

Error message if the simulation failed

Link copied to clipboard

List of base64-encoded DiagnosticEvent XDR objects emitted during simulation

Link copied to clipboard

The latest ledger used for simulation

Link copied to clipboard

Minimum resource fee required for the transaction (in stroops)

Link copied to clipboard

Information about required state restoration (if needed)

Link copied to clipboard

List of host function invocation results (typically contains a single element)

Link copied to clipboard

List of ledger entry changes that would occur if the transaction is applied

Link copied to clipboard

Base64-encoded SorobanTransactionData XDR to be set in the transaction

Functions

Link copied to clipboard

Parses the events field from a list of base64-encoded strings to a list of DiagnosticEvent XDR objects.

Link copied to clipboard

Parses the transactionData field from a base64-encoded string to a SorobanTransactionData XDR object.