Package org.stellar.sdk.requests
Class StrictSendPathsRequestBuilder
java.lang.Object
org.stellar.sdk.requests.RequestBuilder
org.stellar.sdk.requests.StrictSendPathsRequestBuilder
Builds requests to the Horizon
/paths/strict-send endpoint.
Finds payment paths where the source amount is fixed. Specify either a destination account or a set of destination assets, along with the source 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
ConstructorsConstructorDescriptionStrictSendPathsRequestBuilder(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl serverURI) -
Method Summary
Modifier and TypeMethodDescriptiondestinationAccount(String account) Sets the destination account whose assets will be accepted as the end point for path finding.destinationAssets(List<Asset> assets) Sets the destination assets to consider as the end point for path finding.execute()Build and execute request.static Page<PathResponse> execute(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl uri) sourceAmount(String amount) Sets the fixed source amount the sender wants to spend.sourceAsset(Asset asset) Sets the asset the sender wants to send.Methods inherited from class org.stellar.sdk.requests.RequestBuilder
cursor, limit, order, setAssetParameter, setAssetsParameter
-
Constructor Details
-
StrictSendPathsRequestBuilder
public StrictSendPathsRequestBuilder(okhttp3.OkHttpClient httpClient, okhttp3.HttpUrl serverURI)
-
-
Method Details
-
destinationAccount
Sets the destination account whose assets will be accepted as the end point for path finding. Mutually exclusive withdestinationAssets(List).- Parameters:
account- the destination account ID- Returns:
- this builder instance for chaining
- Throws:
IllegalArgumentException- ifdestination_assetshas already been set
-
destinationAssets
Sets the destination assets to consider as the end point for path finding. Mutually exclusive withdestinationAccount(String).- Parameters:
assets- the list of destination assets- Returns:
- this builder instance for chaining
- Throws:
IllegalArgumentException- ifdestination_accounthas already been set
-
sourceAmount
Sets the fixed source amount the sender wants to spend.- Parameters:
amount- the source amount- Returns:
- this builder instance for chaining
-
sourceAsset
Sets the asset the sender wants to send.- Parameters:
asset- the source 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.
-