Strict Receive Paths Request Builder
Builds requests connected to strict receive paths.
The strict receive path finding endpoint lists the possible payment paths that can be taken to arrive at a specific destination asset and amount. This is useful when you know how much you want to receive and want to find out what sources can provide it.
You must specify:
Either a source account OR a list of source assets (what you're sending from)
Destination asset (what you want to receive)
Destination amount (how much you want to receive)
Example usage:
val server = HorizonServer("https://horizon.stellar.org")
// Find paths to receive 50 USD from a specific account
val paths = server.strictReceivePaths()
.sourceAccount("GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B")
.destinationAsset("credit_alphanum4", "USD", "ISSUER_ID")
.destinationAmount("50.0")
.execute()
// Find paths to receive 100 EUR from accounts holding XLM or USD
val paths2 = server.strictReceivePaths()
.sourceAssets(listOf(
Triple("native", null, null),
Triple("credit_alphanum4", "USD", "ISSUER_ID")
))
.destinationAsset("credit_alphanum4", "EUR", "ISSUER_ID")
.destinationAmount("100.0")
.execute()See also
Functions
Sets the cursor parameter for pagination.
Sets the destination account for the path search. This is optional - paths can be found without specifying a destination account.
Sets the destination amount for the path search. This is the amount you want to receive.
Sets the destination asset for the path search. This is the asset you want to receive.
Build and execute request to get a page of paths.
Sets the limit parameter defining maximum number of paths to return.
Sets the order parameter defining the order in which to return paths.
Sets the source account for the path search. Cannot be used together with sourceAssets().
Sets the list of source assets for the path search. Cannot be used together with sourceAccount().
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.