TransactionResult

data class TransactionResult(val success: Boolean, val hash: String? = null, val ledger: UInt? = null, val error: String? = null)

Result of a transaction submission and polling operation.

Contains the outcome of a transaction after it has been submitted to the network and potentially confirmed on-chain. Use this to determine if a transaction succeeded and retrieve its hash and ledger number.

Example:

val result = txOps.transfer(
tokenContract = "CBCD...",
recipient = "GA7Q...",
amount = "10"
)

if (result.success) {
println("Transaction succeeded! Hash: ${result.hash ?: "unknown"}")
println("Confirmed in ledger: ${result.ledger ?: 0}")
} else {
println("Transaction failed: ${result.error ?: "unknown error"}")
}

Constructors

Link copied to clipboard
constructor(success: Boolean, hash: String? = null, ledger: UInt? = null, error: String? = null)

Properties

Link copied to clipboard

Error message if the transaction failed

Link copied to clipboard
val hash: String?

The transaction hash if submission succeeded

Link copied to clipboard
val ledger: UInt?

The ledger number where the transaction was confirmed

Link copied to clipboard

Whether the transaction was successful