SimulateHostFunctionResult

data class SimulateHostFunctionResult(val auth: List<SorobanAuthorizationEntryXdr>?, val transactionData: SorobanTransactionDataXdr, val returnedValue: SCValXdr)

Result data from transaction simulation.

Contains all the data returned by the Soroban RPC simulation, including:

  • Authorization entries that need signing

  • Transaction resource data (footprint, resource limits)

  • The return value from the contract function

This is useful for:

  • Inspecting which accounts need to sign auth entries

  • Understanding resource consumption

  • Examining the simulated return value before submitting

Example:

val simData = tx.getSimulationData()
println("Auth entries: ${simData.auth?.size}")
println("Read footprint: ${simData.transactionData.resources.footprint.readOnly.size}")
println("Return value: ${simData.returnedValue}")

Constructors

Link copied to clipboard
constructor(auth: List<SorobanAuthorizationEntryXdr>?, transactionData: SorobanTransactionDataXdr, returnedValue: SCValXdr)

Properties

Link copied to clipboard

Authorization entries returned from simulation. Null if the contract function doesn't require authorization.

Link copied to clipboard

The return value from the simulated contract function call. This is the result you would get if the transaction were executed.

Link copied to clipboard

Transaction resource data including footprint and resource limits. This must be included in the transaction for execution.