Skip to main content
List Stellar tokens, request a swap quote, and verify the prepared TransactionEnvelope before signing.

Prerequisites

RequirementValue
Base URLhttps://stellar-swap.xoxno.com
AuthNone
Rate limit100 requests per second per IP
Amount formatRaw atomic unit strings
Default execution planeplatform=aggregator for Soroban routes

1. List Tokens

Read token identifiers and decimals from /api/v1/tokens.
curl "https://stellar-swap.xoxno.com/api/v1/tokens"
Use decimals to convert human-readable amounts. For example, 100 XLM with 7 decimals is 1000000000.

2. Request A Quote

Quote 100 XLM to USDC on the Soroban execution plane.
curl "https://stellar-swap.xoxno.com/api/v1/quote?\
from=XLM&\
to=USDC&\
amount_in=1000000000&\
platform=aggregator"
Inspect these fields:
FieldUse
amountOutRaw output amount.
amountOutShortDisplay output amount.
platformExecution plane used for the route.
priceImpactDecimal price impact estimate, when available.

3. Request A Prepared Envelope

Pass sender when the user is ready to sign.
curl "https://stellar-swap.xoxno.com/api/v1/quote?\
from=XLM&\
to=USDC&\
amount_in=1000000000&\
platform=aggregator&\
sender=GA..."
The response can include:
FieldMeaning
transaction.envelopeXdrBase64 XDR TransactionEnvelope.
simulatedtrue when the server prepared Soroban footprint and resource fee.
transaction.minResourceFeeSoroban resource fee attached during simulation.
When simulate=true, do not run simulateTransaction again on the returned envelope. Refresh sequence number, sign, and submit.

Verify

You have a valid quickstart result when:
  • /api/v1/tokens returns the selected token with degree > 0.
  • /api/v1/quote returns non-zero amountOut.
  • platform matches the execution plane your flow can execute.
  • transaction.envelopeXdr is present when sender is set.
  • simulated is true when your flow depends on server-prepared Soroban resources.

Common Failure

SymptomCauseFix
409 snapshot_stalefresh=true and the snapshot is more than the allowed ledger drift behind.Retry after the snapshot catches up.
No transaction fieldsender was omitted or envelope construction failed.Requote with sender; inspect 422 errors for budget or referral issues.
Contract flow receives Classic routeplatform=all selected SDEX.Use platform=aggregator for Soroban composition.

Next Steps