AssembledTransactionError
public enum AssembledTransactionError : Error, Sendable
Errors that occur during Soroban assembled transaction lifecycle operations.
-
Transaction builder has not yet assembled the transaction from provided operations.
Declaration
Swift
case notYetAssembled(message: String) -
Transaction has not yet been simulated against the Soroban network.
Declaration
Swift
case notYetSimulated(message: String) -
Transaction requires signature but has not yet been signed by required signers.
Declaration
Swift
case notYetSigned(message: String) -
Required private key for signing is missing or not available.
Declaration
Swift
case missingPrivateKey(message: String) -
Simulation against Soroban network failed with errors.
reportedContractErrorreads the contract error code the message reports.Declaration
Swift
case simulationFailed(message: String) -
Contract state needs restoration before transaction can execute successfully.
Declaration
Swift
case restoreNeeded(message: String) -
Transaction is a read-only call and cannot modify ledger state.
Declaration
Swift
case isReadCall(message: String) -
Transaction type does not match expected type for this operation.
Declaration
Swift
case unexpectedTxType(message: String) -
Transaction requires signatures from multiple parties but only one was provided.
Declaration
Swift
case multipleSignersRequired(message: String) -
Polling for transaction status was interrupted before completion.
Declaration
Swift
case pollInterrupted(message: String) -
Automatic restoration of contract state failed during transaction preparation.
Declaration
Swift
case automaticRestoreFailed(message: String) -
Transaction submission to the network failed.
Declaration
Swift
case sendFailed(message: String) -
The contract error code a
simulationFailed(message:)message reports;nilfor every other case.Reads the message
AssembledTransaction.simulate()andAssembledTransaction.getSimulationData()write: the host error that follows the SDK’s prefix, when it namesError(Contract, #N)(hostError, no contract ID), or the suffix(contract error in diagnostic events: Error(Contract, #N), contract C...)the SDK appends after anError(Context, ...)orError(Auth, ...)host error (diagnosticEvents, with the contract ID when the event has one). Only these two positions are read; a textual event log inside the message is not. A message in neither form and the messageTransaction simulation failedgivenil. A message a caller builds in the same form reads the same.The value equals
SimulateTransactionResponse.reportedContractError()of the response that failed. The raw diagnostic events are not part of this error: a caller holding the assembled transaction reads them fromsimulationResponse?.events, and the smart account kit’sSmartAccountTransactionException.SimulationFailedcarries them asdiagnosticEventsXdr.do { _ = try await client.invokeMethod(name: "transfer", args: args) } catch let error as AssembledTransactionError { if let reported = error.reportedContractError { print("Contract error \(reported.code)") } }Declaration
Swift
public var reportedContractError: ReportedContractError? { get }
View on GitHub
Install in Dash