Operation class abstract

Base class for all operations in a Stellar transaction.

Operations are the commands that mutate the ledger state. A transaction contains one or more operations that are executed atomically. Each operation can optionally specify a source account that differs from the transaction's source account.

Available operation types:

Example:

// Create a payment operation
var payment = PaymentOperationBuilder(
  destinationAccountId,
  Asset.native(),
  "100.50"
).build();

// Create a payment with custom source account
var paymentWithSource = PaymentOperationBuilder(
  destinationAccountId,
  Asset.native(),
  "100.50"
).setSourceAccount(customSourceAccount).build();

// Add operation to a transaction
var transaction = TransactionBuilder(sourceAccount)
  .addOperation(payment)
  .build();

See also:

Implementers

Constructors

Operation()
Creates a base Operation instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceAccount MuxedAccount?
Optional source account for this operation.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toOperationBody() XdrOperationBody
Converts this operation to its XDR operation body representation.
toString() String
A string representation of this object.
inherited
toXdr() XdrOperation
Converts this operation to its XDR representation.
toXdrBase64() String
Returns base64-encoded Operation XDR object from this operation.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromXdr(XdrOperation xdrOp) Operation
Returns Operation object from an Operation XDR object xdrOp.