Assets Request Builder
Builds requests connected to assets.
Assets represent different types of value issued on the Stellar network. This builder allows you to query assets based on their code, issuer, or retrieve all assets on the network.
Example usage:
val server = HorizonServer("https://horizon.stellar.org")
// Get all assets
val allAssets = server.assets()
.limit(20)
.execute()
// Get assets by code
val usdAssets = server.assets()
.forAssetCode("USD")
.execute()
// Get assets by issuer
val issuerAssets = server.assets()
.forAssetIssuer("GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B")
.execute()
// Get a specific asset
val asset = server.assets()
.forAssetCode("USD")
.forAssetIssuer("GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B")
.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 assets.
Link copied to clipboard
Filters assets by asset code.
Link copied to clipboard
Filters assets by asset issuer.
Link copied to clipboard
Sets the limit parameter defining maximum number of assets to return.
Link copied to clipboard
Sets the order parameter defining the order in which to return assets.
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.