LedgersStreamItem
public final class LedgersStreamItem : Sendable
Streams ledger data from the Horizon API using Server-Sent Events (SSE) for real-time updates.
-
Creates a new ledgers stream for the specified Horizon API endpoint.
Declaration
Swift
public init(requestUrl: String) -
Establishes the SSE connection and delivers ledger responses as they arrive from Horizon.
Declaration
Swift
public func onReceive(response: @escaping StreamResponseEnum<LedgerResponse>.ResponseClosure) -
Closes the event stream and releases resources.
Declaration
Swift
public func closeStream()
View on GitHub
Install in Dash