Skip to main content
@xoxno/sdk-js wraps the quote endpoint and builds the router call. It does not sign or submit. Server-prepared envelopes (transaction.simulated: true) already include the live source account sequence. When building a transaction locally with the SDK, supply sourceSequence yourself. Wallet signing and submission remain with the integrator.

Functions

The SDK has no default endpoint. Pass baseUrl explicitly (https://stellar-swap.xoxno.com for the public service).

Swap from a wallet

Pass quote.amountIn as totalIn. It is the gross input, including any input-side fee. The SDK builds this transaction itself, so you do not need to use the transaction.envelopeXdr the server can return when you pass sender. Use that envelope, or this builder, but not both.

Compose with lending

Pass swap (or quote.routeXdr) as the strategy steps argument of the lending builders. Keep the payload opaque, and simulate the complete outer transaction. See Execution models.

Known differences from the API

Use @xoxno/sdk-js 1.0.222 or later. Earlier versions typed token entries with fields the service never returned and sent an ignored router parameter.
  • Token IDs. Use canonical C… contract IDs. The service rejects XLM and CODE:ISSUER forms with invalid_request.
  • router. The service ignores a router request field and uses the router from /api/v1/config. The SDK no longer sends it.
  • alternatives. The @xoxno/types response type still declares it, but the service no longer returns it.
  • transactions[]. The SDK builds a single-swap transaction. For an LP conversion that returns transactions[], follow the ordered plan procedure.
  • simulate. Pass simulate: false to skip server-side simulation when you send a sender.
Quickstart · Error recovery