Offers Request Builder
Builds requests connected to offers.
Offers represent an intent to trade one asset for another at a pre-determined exchange rate. This builder allows you to query offers based on various criteria such as seller, sponsor, or the assets being bought and sold.
Example usage:
val server = HorizonServer("https://horizon.stellar.org")
// Get a specific offer by ID
val offer = server.offers().offer(12345)
// Get offers by seller
val sellerOffers = server.offers()
.forSeller("GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B")
.limit(20)
.execute()
// Get offers selling a specific asset
val assetOffers = server.offers()
.forSellingAsset("credit_alphanum4", "USD", "GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B")
.execute()See also
Functions
Sets the cursor parameter for pagination.
Build and execute request to get a page of offers.
Returns all offers where the given account is the seller.
Returns all offers buying an asset.
Returns all offers where the given account is the seller.
Returns all offers selling an asset.
Returns all offers sponsored by a given account.
Sets the limit parameter defining maximum number of offers to return.
Requests a specific offer by ID.
Sets the order parameter defining the order in which to return offers.
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.