Operation

sealed class Operation

Abstract base class for all Stellar operations.

Operations are the commands that modify the ledger. They represent actions like sending payments, creating accounts, managing offers, and more. Operations are grouped into transactions and submitted to the network.

Operation Types

This sealed class hierarchy includes all 27 operation types supported by the Stellar protocol.

Source Account

Each operation can optionally have a source account that differs from the transaction's source account. This allows operations within a single transaction to be performed by different accounts.

Usage

// Create a payment operation
val payment = PaymentOperation(
destination = "GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H",
asset = AssetTypeNative,
amount = "10.0000000"
)

// Set a custom source account
payment.sourceAccount = "GABC..."

// Convert to XDR for submission
val xdr = payment.toXdr()

See also

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Optional source account for this operation.

Functions

Link copied to clipboard

Converts this operation to its XDR operation body representation.

Link copied to clipboard

Converts this operation to its full XDR representation, including the source account.