Skip to main content
A new Stellar account must exist on-chain before it can receive anything, and a new user has 0 XLM. SODAX’s sponsor pays the base reserve. The user’s wallet signs; the backend co-signs and submits. Mainnet only. In swaps when destination is XLM account is has to be activated to be able to receive XLM (other assets require trustline). Ordered prerequisites (a non-native destination token needs all three):
  1. Activate — free, sponsored.
  2. Receive XLM — the account is left with zero spendable balance, so it still can’t pay a fee.
  3. Add trustline — affordable only after step 2.
Surfacesodax.sponsoring: activateStellarAccount, getStellarAccountStatus, isStellarAccountActive, getStellarSponsorConfig. All return Result. Config goes in sponsoringApiConfig (own host, own x-api-key, inherits nothing). React — use useStellarGate; it sequences all three. Pieces: useActivateStellarAccount, useStellarAccountStatus, useSponsorConfig, useEstablishTrustline. Gotchas
  • alreadyActive is a success, not a no-op.
  • Branch on error.context.nextAction, not status — the two 503s want opposite handling.
  • A sequence conflict costs a second wallet prompt; wire onSignatureRequired.
  • Never hardcode the sponsor account; read it from config.
DocsSPONSORING.md · STELLAR_TRUSTLINE.md · CONFIGURE_SDK.md Examples