Skip to main content
This page is the bridge between Installation and the feature tutorials. By the end you will have a smart account, an account client wired to the SCS bundler and paymaster, and a place to keep them in your app’s state.
Source: StartaleGroup/scs-aa-sdk. Every symbol on this page is exported from @startale-scs/aa-sdk or viem.

What you will build

StartaleAccountClient is the object you actually call sendUserOperation and ERC-7579 module actions on. The smart account and paymaster clients are wired into it once at setup time.

Account creation

Why index matters. Smart accounts are deployed via CREATE2, so the (signer, index) pair determines the account address before deployment. Use a stable index per user (often 0n) to keep one account per signer; vary it when you intentionally want sub-accounts under the same signer.

Account client (sponsored gas)

Wrap the account, the paymaster, and the bundler transport in a single client:

Account client (ERC-20 gas)

To accept ERC-20 tokens as gas instead of sponsoring, swap the paymasterId field for a token address:
The supported tokens per network are listed in Supported networks. The full token paymaster flow, including quotes and approvals, is covered in the ERC-20 paymaster tutorial.

Persisting the client in a React app

A common pattern is to lift the smart account and clients into a context provider so they survive component remounts and are available everywhere in the tree.
StartaleProvider.tsx
Environment variables in this snippet use a framework-agnostic placeholder. The SDK does not require any specific prefix; pick whichever your framework expects (process.env.X, import.meta.env.X, runtime config, etc.).

Useful account methods

Once you have the account, you can call these without building a UserOperation first:

Next steps

Contract interactions

Send single and batched calls through sendUserOperation.

Sponsored paymaster

Send sponsored UserOperations end to end with policies.

ERC-20 paymaster

Charge users in ASTR, USDC, or other tokens.

Smart sessions

Reduce signature friction with scoped session keys.