Operation class

Operations contain all balance-changing information within a transaction. They are always one-sided (only affect 1 AccountIdentifier) and can succeed or fail independently from a Transaction. Operations are used both to represent on-chain data (Data API) and to construct new transactions (Construction API), creating a standard interface for reading and writing to blockchains.

Annotations
  • @immutable

Constructors

Operation(String type, OperationIdentifier operationIdentifier, List<OperationIdentifier>? relatedOperations, String? status, AccountIdentifier? account, Amount? amount, CoinChange? coinChange, Map<String, dynamic>? metadata)
const
Operation.fromJson(Map<String, dynamic> map)
factory

Properties

account AccountIdentifier?
final
amount Amount?
final
coinChange CoinChange?
final
hashCode int
The hash code for this object.
no setterinherited
metadata Map<String, dynamic>?
final
operationIdentifier OperationIdentifier
final
relatedOperations List<OperationIdentifier>?
Restrict referenced related_operations to identifier indexes < the current OperationIdentifier.index. This ensures there exists a clear DAG-structure of relations. Since operations are one-sided, one could imagine relating operations in a single transfer or linking operations in a call tree.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status String?
Status is the network-specific status of the operation. Status is not defined on the transaction object because blockchains with smart contracts may have transactions that partially apply (some operations are successful and some are not). Blockchains with atomic transactions (all operations succeed or all operations fail) will have the same status for each operation. On-chain operations (operations retrieved in the /block and /block/transaction endpoints) MUST have a populated status field (anything on-chain must have succeeded or failed). However, operations provided during transaction construction (often times called "intent" in the documentation) MUST NOT have a populated status field (operations yet to be included on-chain have not yet succeeded or failed).
final
type String
Type is the network-specific type of the operation. Ensure that any type that can be returned here is also specified in the NetworkOptionsResponse. This can be very useful to downstream consumers that parse all block data.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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