Ledgers Request Builder
Builds requests connected to ledgers.
Ledgers are the foundation of the Stellar network. They represent the state of the network at a particular point in time and contain all the changes (transactions) that have occurred since the previous ledger.
Example usage:
val server = HorizonServer("https://horizon.stellar.org")
// Get a specific ledger by sequence
val ledger = server.ledgers().ledger(12345)
// Get a page of ledgers
val ledgers = server.ledgers()
.limit(10)
.order(Order.DESC)
.execute()Content copied to clipboard
See also
Functions
Link copied to clipboard
Sets the cursor parameter for pagination.
Link copied to clipboard
Build and execute request to get a page of ledgers.
Link copied to clipboard
Requests a specific ledger by sequence number.
Link copied to clipboard
Sets the limit parameter defining maximum number of ledgers to return.
Link copied to clipboard
Sets the order parameter defining the order in which to return ledgers.
Link copied to clipboard
fun <T : Response> stream(serializer: KSerializer<T>, listener: EventListener<T>, reconnectTimeout: Duration = SSEStream.DEFAULT_RECONNECT_TIMEOUT): SSEStream<T>
Creates a Server-Sent Events (SSE) stream for this request. The stream will automatically reconnect on connection loss and resume from the last received event.