Package org.stellar.sdk.requests
Class StrictReceivePathsRequestBuilder
java.lang.Object
org.stellar.sdk.requests.RequestBuilder
org.stellar.sdk.requests.StrictReceivePathsRequestBuilder
Builds requests to the Horizon
/paths/strict-receive endpoint.
Finds payment paths where the destination amount is fixed. Specify either a source account or a set of source assets, along with the destination asset and amount, to discover available payment paths.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.stellar.sdk.requests.RequestBuilder
RequestBuilder.Order -
Constructor Summary
ConstructorsConstructorDescriptionStrictReceivePathsRequestBuilder(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl serverURI) -
Method Summary
Modifier and TypeMethodDescriptiondestinationAccount(String account) Sets the destination account for the path payment.destinationAmount(String amount) Sets the fixed destination amount the recipient should receive.destinationAsset(Asset asset) Sets the asset the recipient wants to receive.execute()Build and execute request.static Page<PathResponse> execute(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl uri) sourceAccount(String account) Sets the source account whose assets will be used as the starting point for path finding.sourceAssets(List<Asset> assets) Sets the source assets to consider as the starting point for path finding.Methods inherited from class org.stellar.sdk.requests.RequestBuilder
cursor, limit, order, setAssetParameter, setAssetsParameter
-
Constructor Details
-
StrictReceivePathsRequestBuilder
public StrictReceivePathsRequestBuilder(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl serverURI)
-
-
Method Details
-
destinationAccount
Sets the destination account for the path payment.- Parameters:
account- the destination account ID- Returns:
- this builder instance for chaining
-
sourceAccount
Sets the source account whose assets will be used as the starting point for path finding. Mutually exclusive withsourceAssets(List).- Parameters:
account- the source account ID- Returns:
- this builder instance for chaining
- Throws:
IllegalArgumentException- ifsource_assetshas already been set
-
sourceAssets
Sets the source assets to consider as the starting point for path finding. Mutually exclusive withsourceAccount(String).- Parameters:
assets- the list of source assets- Returns:
- this builder instance for chaining
- Throws:
IllegalArgumentException- ifsource_accounthas already been set
-
destinationAmount
Sets the fixed destination amount the recipient should receive.- Parameters:
amount- the destination amount- Returns:
- this builder instance for chaining
-
destinationAsset
Sets the asset the recipient wants to receive.- Parameters:
asset- the destination asset- Returns:
- this builder instance for chaining
-
execute
- Parameters:
httpClient-OkHttpClientto use to send the request.uri-HttpUrlURI to send the request to.- Returns:
PageofPathResponse- Throws:
NetworkException- All the exceptions below are subclasses of NetworkExceptionBadRequestException- 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 aTimeoutor connection timeout occurredUnknownResponseException- if the server returns an unknown status codeConnectionErrorException- When the request cannot be executed due to cancellation or connectivity problems, etc.
-
execute
Build and execute request.- Returns:
PageofPathResponse- Throws:
NetworkException- All the exceptions below are subclasses of NetworkExceptionBadRequestException- 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 aTimeoutor connection timeout occurredUnknownResponseException- if the server returns an unknown status codeConnectionErrorException- When the request cannot be executed due to cancellation or connectivity problems, etc.
-