- Activate — free, sponsored.
- Receive XLM — the account is left with zero spendable balance, so it still can’t pay a fee.
- Add trustline — affordable only after step 2.
sodax.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
alreadyActiveis 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.
- apps/demo/src/providers.tsx — sponsoring API URL + key setup: the
sponsoringApiConfigobject readsVITE_SPONSORING_API_BASE_URL/VITE_SPONSORING_API_KEY, omits each when unset (falls back to the packaged endpoint), and is passed asapi.sponsoringApiConfigon theSodaxconfig below. Env placeholders in apps/demo/example.env. - apps/stellar-sponsor-example — full journey + offline mock (
cp example.env .env,pnpm mock-sponsoring,pnpm dev, Test lab → Run all) - swaps/SwapCard.tsx — swap gated on a Stellar destination; also swaps-api/SwapCard.tsx, LimitOrderCard.tsx, BridgeDialog.tsx
- apps/node/src/stellar-sponsor.ts — headless
- AI skill:
packages/skills/skills/sodax-sdk/sponsoring/SKILL.md