connect() calls account.ensureReady(...) to materialize a payment-ready account -
sponsored end-to-end, so the payer needs no XLM. This covers both the classic G... account
(funded reserves + USDC trustline) and the contract C... account (smart-account deployment).
Read state first
Check what the account still needs before callingconnect():
Full example
Classic onboarding (G...)
If the G... account does not exist or has no USDC trustline, the SDK:
- Fetches an unsigned sponsor-sandwich transaction from the facilitator (
relayer.buildOnboard). - The wallet signs it.
relayer.submitOnboardco-signs and submits.
Contract deploy (C...)
ensureReady deploys the OpenZeppelin Smart Account contract via
relayer.deployContract({ passkeyPublicKey }), sponsored by the facilitator. The contract
address (C...) is returned and stored in the account adapter.
connect() is idempotent - calling it again on a fully onboarded account is a no-op.
The payer needs zero XLM - not to transact, and not even to appear on-chain for the first
time. The facilitator acts as sponsor for both the fee and the on-chain reserves.
Next
Gasless modes
How sponsored and token-fee gas modes work after onboarding.
Account models
Classic G-addresses vs. passkey smart-contract accounts.

