public class TransactionsRequestBuilder extends RequestBuilder
RequestBuilder.Order
Constructor and Description |
---|
TransactionsRequestBuilder(okhttp3.OkHttpClient httpClient,
okhttp3.HttpUrl serverURI) |
Modifier and Type | Method and Description |
---|---|
TransactionsRequestBuilder |
cursor(java.lang.String token)
Sets
cursor parameter on the request. |
Page<TransactionResponse> |
execute()
Build and execute request.
|
static Page<TransactionResponse> |
execute(okhttp3.OkHttpClient httpClient,
okhttp3.HttpUrl uri)
|
TransactionsRequestBuilder |
forAccount(@NonNull java.lang.String account)
Builds request to
GET /accounts/{account}/transactions |
TransactionsRequestBuilder |
forClaimableBalance(@NonNull java.lang.String claimableBalance)
Builds request to
GET /claimable_balances/{claimable_balance_id}/transactions |
TransactionsRequestBuilder |
forLedger(long ledgerSeq)
Builds request to
GET /ledgers/{ledgerSeq}/transactions |
TransactionsRequestBuilder |
forLiquidityPool(java.lang.String liquidityPoolId)
Builds request to
GET /liquidity_pools/{ledgerSeq}/transactions |
TransactionsRequestBuilder |
includeFailed(boolean value)
Adds a parameter defining whether to include failed transactions.
|
TransactionsRequestBuilder |
limit(int number)
Sets
limit parameter on the request. |
TransactionsRequestBuilder |
order(RequestBuilder.Order direction)
Sets
order parameter on the request. |
SSEStream<TransactionResponse> |
stream(EventListener<TransactionResponse> listener)
An overloaded version of
stream(EventListener, long) with default reconnect timeout. |
SSEStream<TransactionResponse> |
stream(EventListener<TransactionResponse> listener,
long reconnectTimeout)
Allows to stream SSE events from horizon.
|
TransactionResponse |
transaction(okhttp3.HttpUrl uri)
Requests specific
uri and returns TransactionResponse . |
TransactionResponse |
transaction(java.lang.String transactionId)
Requests
GET /transactions/{transactionId} |
setAssetParameter, setAssetsParameter
public TransactionsRequestBuilder(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl serverURI)
public TransactionResponse transaction(okhttp3.HttpUrl uri)
uri
and returns TransactionResponse
. This method is
helpful for getting the links.TransactionResponse
NetworkException
- 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 TransactionResponse transaction(java.lang.String transactionId)
GET /transactions/{transactionId}
transactionId
- Transaction to fetchTransactionResponse
NetworkException
- 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 TransactionsRequestBuilder forAccount(@NonNull @NonNull java.lang.String account)
GET /accounts/{account}/transactions
account
- Account for which to get transactionspublic TransactionsRequestBuilder forClaimableBalance(@NonNull @NonNull java.lang.String claimableBalance)
GET /claimable_balances/{claimable_balance_id}/transactions
claimableBalance
- Claimable Balance for which to get transactionspublic TransactionsRequestBuilder forLedger(long ledgerSeq)
GET /ledgers/{ledgerSeq}/transactions
ledgerSeq
- Ledger for which to get transactionspublic TransactionsRequestBuilder forLiquidityPool(java.lang.String liquidityPoolId)
GET /liquidity_pools/{ledgerSeq}/transactions
liquidityPoolId
- Liquidity pool for which to get transactionspublic TransactionsRequestBuilder includeFailed(boolean value)
value
- Set to true
to include failed transactions.public static Page<TransactionResponse> execute(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl uri)
httpClient
- OkHttpClient
to use to send the request.uri
- HttpUrl
URI to send the request to.Page
of TransactionResponse
NetworkException
- 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<TransactionResponse> stream(EventListener<TransactionResponse> listener, long reconnectTimeout)
listener
- EventListener
implementation with TransactionResponse
typereconnectTimeout
- Custom stream connection timeout in msclose()
connection when not needed anymorepublic SSEStream<TransactionResponse> stream(EventListener<TransactionResponse> listener)
stream(EventListener, long)
with default reconnect timeout.public Page<TransactionResponse> execute()
Page
of TransactionResponse
NetworkException
- 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 TransactionsRequestBuilder cursor(java.lang.String token)
RequestBuilder
cursor
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 RequestBuilder
token
- A cursor is a value that points to a specific location in a collection of
resources.public TransactionsRequestBuilder limit(int number)
RequestBuilder
limit
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 RequestBuilder
number
- maxium number of records to returnpublic TransactionsRequestBuilder order(RequestBuilder.Order direction)
RequestBuilder
order
parameter on the request.order
in class RequestBuilder
direction
- RequestBuilder.Order