public class LiquidityPoolsRequestBuilder extends RequestBuilder
RequestBuilder.Order| Constructor and Description |
|---|
LiquidityPoolsRequestBuilder(okhttp3.OkHttpClient httpClient,
okhttp3.HttpUrl serverURI) |
| Modifier and Type | Method and Description |
|---|---|
LiquidityPoolsRequestBuilder |
cursor(java.lang.String token)
Sets
cursor parameter on the request. |
Page<LiquidityPoolResponse> |
execute()
Build and execute request.
|
static Page<LiquidityPoolResponse> |
execute(okhttp3.OkHttpClient httpClient,
okhttp3.HttpUrl uri)
|
LiquidityPoolsRequestBuilder |
forAccount(java.lang.String account)
Returns all liquidity pools the specified account is participating in.
|
LiquidityPoolsRequestBuilder |
forReserves(java.lang.String... reserves)
Returns all liquidity pools that contain reserves in all specified assets.
|
LiquidityPoolsRequestBuilder |
limit(int number)
Sets
limit parameter on the request. |
LiquidityPoolResponse |
liquidityPool(okhttp3.HttpUrl uri)
Requests specific
uri and returns LiquidityPoolResponse. |
LiquidityPoolResponse |
liquidityPool(java.lang.String liquidityPoolId)
Requests
GET /liquidity_pools/{liquidity_pool_id} |
LiquidityPoolsRequestBuilder |
order(RequestBuilder.Order direction)
Sets
order parameter on the request. |
SSEStream<LiquidityPoolResponse> |
stream(EventListener<LiquidityPoolResponse> listener)
An overloaded version of
stream(EventListener, long) with default reconnect timeout. |
SSEStream<LiquidityPoolResponse> |
stream(EventListener<LiquidityPoolResponse> listener,
long reconnectTimeout)
Allows to stream SSE events from horizon.
|
setAssetParameter, setAssetsParameterpublic LiquidityPoolsRequestBuilder(okhttp3.OkHttpClient httpClient,
okhttp3.HttpUrl serverURI)
public LiquidityPoolResponse liquidityPool(okhttp3.HttpUrl uri)
uri and returns LiquidityPoolResponse. This method is
helpful for getting the links.LiquidityPoolResponseNetworkException - All the exceptions below are subclasses of
NetworkErrorBadRequestException - if the request fails due to a bad request
(4xx)BadResponseException - if the request fails due to a bad
response from the server (5xx)TooManyRequestsException - if the request fails due to too many requests sent to the
serverRequestTimeoutException - When Horizon returns a Timeout
or connection timeout occurredUnknownResponseException - if the server returns an unknown
status codeConnectionErrorException - When the request cannot be executed
due to cancellation or connectivity problems, etc.public LiquidityPoolResponse liquidityPool(java.lang.String liquidityPoolId)
GET /liquidity_pools/{liquidity_pool_id}liquidityPoolId - Liquidity Pool to fetchLiquidityPoolResponseBadRequestException - if the request fails due to a bad request
(4xx)BadResponseException - if the request fails due to a bad
response from the server (5xx)ConnectionErrorException - if the request fails due to an
IOException, including but not limited to a timeout, connection failure etc.TooManyRequestsException - when too many requests were sent to the Horizon server.public LiquidityPoolsRequestBuilder forReserves(java.lang.String... reserves)
reserves - Reserve assets to filter liquidity poolsLiquidityPoolsRequestBuilder instancepublic LiquidityPoolsRequestBuilder forAccount(java.lang.String account)
account - Account ID to filter liquidity poolsLiquidityPoolsRequestBuilder instancepublic static Page<LiquidityPoolResponse> execute(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl uri)
uri and returns Page of LiquidityPoolResponse.
This method is helpful for getting the next set of results.httpClient - OkHttpClient to use to send the request.uri - HttpUrl URI to send the request to.Page of LiquidityPoolResponseNetworkException - All the exceptions below are subclasses of
NetworkErrorBadRequestException - if the request fails due to a bad request
(4xx)BadResponseException - if the request fails due to a bad
response from the server (5xx)TooManyRequestsException - if the request fails due to too many requests sent to the
serverRequestTimeoutException - When Horizon returns a Timeout
or connection timeout occurredUnknownResponseException - if the server returns an unknown
status codeConnectionErrorException - When the request cannot be executed
due to cancellation or connectivity problems, etc.public SSEStream<LiquidityPoolResponse> stream(EventListener<LiquidityPoolResponse> listener, long reconnectTimeout)
listener - EventListener implementation with LiquidityPoolResponse typereconnectTimeout - Custom stream connection timeout in msclose() connection when not needed anymorepublic SSEStream<LiquidityPoolResponse> stream(EventListener<LiquidityPoolResponse> listener)
stream(EventListener, long) with default reconnect timeout.public Page<LiquidityPoolResponse> execute()
Page of LiquidityPoolResponseNetworkException - All the exceptions below are subclasses of
NetworkErrorBadRequestException - if the request fails due to a bad request
(4xx)BadResponseException - if the request fails due to a bad
response from the server (5xx)TooManyRequestsException - if the request fails due to too many requests sent to the
serverRequestTimeoutException - When Horizon returns a Timeout
or connection timeout occurredUnknownResponseException - if the server returns an unknown
status codeConnectionErrorException - When the request cannot be executed
due to cancellation or connectivity problems, etc.public LiquidityPoolsRequestBuilder cursor(java.lang.String token)
RequestBuildercursor parameter on the request. A cursor is a value that points to a
specific location in a collection of resources. The cursor attribute itself is an opaque value
meaning that users should not try to parse it.cursor in class RequestBuildertoken - A cursor is a value that points to a specific location in a collection of
resources.public LiquidityPoolsRequestBuilder limit(int number)
RequestBuilderlimit parameter on the request. It defines maximum number of records to
return. For range and default values check documentation of the endpoint requested.limit in class RequestBuildernumber - maxium number of records to returnpublic LiquidityPoolsRequestBuilder order(RequestBuilder.Order direction)
RequestBuilderorder parameter on the request.order in class RequestBuilderdirection - RequestBuilder.Order