Transaction Result
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"}")
}Content copied to clipboard