GetTransactionsResponse class

Response from the getTransactions RPC method.

GetTransactionsResponse contains a paginated list of transactions that occurred within a specified ledger range. This method allows retrieving historical transaction data including successful and failed transactions, their results, and associated events.

The response provides comprehensive transaction information with pagination support for efficient data retrieval when dealing with large result sets.

Response Structure:

  • List of TransactionInfo objects with full transaction details
  • Pagination cursor for fetching subsequent pages
  • Ledger range boundaries (oldest and latest ledgers available)
  • Timestamps for ledger close times

Use Cases:

  • Retrieve transaction history for analysis
  • Monitor contract invocations and their results
  • Audit transaction execution and events
  • Build transaction explorers and analytics tools

Fields:

Example:

final server = SorobanServer(rpcUrl);

// Query transactions from a specific ledger
final request = GetTransactionsRequest(
  startLedger: 1000000,
  paginationOptions: PaginationOptions(limit: 50),
);

final response = await server.getTransactions(request);

if (response.transactions != null) {
  for (var tx in response.transactions!) {
    print('Transaction: ${tx.txHash}');
    print('Status: ${tx.status}');
    print('Ledger: ${tx.ledger}');
    if (tx.events != null) {
      print('Contract events: ${tx.events!.contractEventsXdr?.length}');
    }
  }

  // Fetch next page if available
  if (response.cursor != null) {
    final nextRequest = GetTransactionsRequest(
      paginationOptions: PaginationOptions(cursor: response.cursor),
    );
    final nextPage = await server.getTransactions(nextRequest);
  }
}

See also:

Inheritance

Constructors

GetTransactionsResponse(Map<String, dynamic> jsonResponse)
Creates a GetTransactionsResponse from JSON-RPC response.
GetTransactionsResponse.fromJson(Map<String, dynamic> json)
factory

Properties

cursor String?
getter/setter pair
error SorobanRpcErrorResponse?
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isErrorResponse bool
no setterinherited
jsonResponse Map<String, dynamic>
getter/setter pairinherited
latestLedger int?
getter/setter pair
latestLedgerCloseTimestamp int?
getter/setter pair
oldestLedger int?
getter/setter pair
oldestLedgerCloseTimestamp int?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transactions List<TransactionInfo>?
If error is present then results will not be in the response
getter/setter pair

Methods

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

Operators

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