LedgerResponse class
Represents a ledger response from Horizon.
A ledger captures the state of the Stellar network at a specific point in time. Ledgers close approximately every 5 seconds and contain all transactions, operations, and effects that occurred during that period.
Fields:
- sequence: Ledger sequence number (incremental, starting from 1)
- hash: Unique hash of this ledger
- id: Horizon ID for this ledger
- pagingToken: Cursor for pagination
- prevHash: Hash of the previous ledger
- successfulTransactionCount: Number of successful transactions in this ledger
- failedTransactionCount: Number of failed transactions in this ledger
- operationCount: Total number of operations in successful transactions
- txSetOperationCount: Total number of operations in the transaction set
- closedAt: ISO 8601 timestamp when this ledger closed
- totalCoins: Total XLM in circulation (in lumens)
- feePool: Total XLM available in the fee pool (in lumens)
- baseFeeInStroops: Network minimum base fee in stroops (1 stroop = 0.0000001 XLM)
- baseReserveInStroops: Network minimum account reserve in stroops
- maxTxSetSize: Maximum transaction set size for this ledger
- protocolVersion: Stellar protocol version used by this ledger
- headerXdr: Base64-encoded XDR representation of the ledger header
- links: Hypermedia links to related resources
Example:
final ledger = await sdk.ledgers.ledger(12345);
print('Ledger ${ledger.sequence}');
print(' Hash: ${ledger.hash}');
print(' Transactions: ${ledger.successfulTransactionCount}');
print(' Operations: ${ledger.operationCount}');
print(' Base Fee: ${ledger.baseFeeInStroops} stroops');
See also:
- Stellar developer docs
- LedgersRequestBuilder for querying ledgers
Constructors
- LedgerResponse(int sequence, String hash, String id, String pagingToken, String? prevHash, int successfulTransactionCount, int failedTransactionCount, int operationCount, int txSetOperationCount, String closedAt, String totalCoins, String feePool, int baseFeeInStroops, int baseReserveInStroops, int maxTxSetSize, int protocolVersion, String headerXdr, LedgerResponseLinks links)
- Creates a LedgerResponse from Horizon API ledger data.
-
LedgerResponse.fromJson(Map<
String, dynamic> json) -
Creates a ledger response from Horizon API JSON.
factory
Properties
- baseFeeInStroops ↔ int
-
Network minimum base fee in stroops (1 stroop = 0.0000001 XLM)
getter/setter pair
- baseReserveInStroops ↔ int
-
Network minimum account reserve in stroops
getter/setter pair
- closedAt ↔ String
-
ISO 8601 timestamp when this ledger closed
getter/setter pair
- failedTransactionCount ↔ int
-
Number of failed transactions in this ledger
getter/setter pair
- feePool ↔ String
-
Total XLM available in the fee pool (in lumens)
getter/setter pair
- hash ↔ String
-
Unique hash of this ledger
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerXdr ↔ String
-
Base64-encoded XDR representation of the ledger header
getter/setter pair
- id ↔ String
-
Horizon ID for this ledger
getter/setter pair
- links ↔ LedgerResponseLinks
-
Hypermedia links to related resources
getter/setter pair
- maxTxSetSize ↔ int
-
Maximum transaction set size for this ledger
getter/setter pair
- operationCount ↔ int
-
Total number of operations in successful transactions
getter/setter pair
- pagingToken ↔ String
-
Cursor for pagination
getter/setter pair
- prevHash ↔ String?
-
Hash of the previous ledger
getter/setter pair
- protocolVersion ↔ int
-
Stellar protocol version used by this ledger
getter/setter pair
- rateLimitLimit ↔ int?
-
Maximum number of requests allowed in the current rate limit window.
getter/setter pairinherited
- rateLimitRemaining ↔ int?
-
Number of requests remaining in the current rate limit window.
getter/setter pairinherited
- rateLimitReset ↔ int?
-
Unix timestamp when the rate limit window will reset.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sequence ↔ int
-
Ledger sequence number (incremental, starting from 1)
getter/setter pair
- successfulTransactionCount ↔ int
-
Number of successful transactions in this ledger
getter/setter pair
- totalCoins ↔ String
-
Total XLM in circulation (in lumens)
getter/setter pair
- txSetOperationCount ↔ int
-
Total number of operations in the transaction set
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setHeaders(
Map< String, String> headers) → void -
Populates rate limit fields from HTTP response headers.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited