Privy provides embedded wallets with email, OAuth, and external wallet login. Privy exposes an EIP-1193 provider viaDocumentation Index
Fetch the complete documentation index at: https://docs.startale.com/llms.txt
Use this file to discover all available pages before exploring further.
wallet.getEthereumProvider(), which you wrap with viem’s createWalletClient and feed to toStartaleSmartAccount as a signer.
Source:
StartaleGroup/scs-aa-sdk.Install
| Package | Why |
|---|---|
@startale-scs/aa-sdk | The AA SDK itself. |
viem | Chain, transport, and createWalletClient. |
@privy-io/react-auth | Privy React provider and hooks. |
1. Wrap the app in PrivyProvider
providers.tsx
| Setting | Effect |
|---|---|
loginMethods | Which login flows are available to the user. |
embeddedWallets.createOnLogin | When set to "all-users", Privy creates an embedded wallet for every user automatically. |
embeddedWallets.showWalletUIs | Disable Privy’s own send/sign UIs so the smart account drives the UX. |
supportedChains / defaultChain | Restrict Privy to Soneium Minato (or soneium for mainnet). |
2. Build the smart account from the embedded wallet
useWallets() returns the connected wallets. Take the first one (typically the embedded wallet), pull its EIP-1193 provider, and wrap it with viem.
useStartaleFromPrivy.ts
| Symbol | Source | Role |
|---|---|---|
usePrivy | @privy-io/react-auth | Hook exposing authenticated, user, and login helpers. |
useWallets | @privy-io/react-auth | Hook returning the user’s connected wallets. |
wallet.getEthereumProvider() | Privy | Returns an EIP-1193 provider for the embedded wallet. |
createWalletClient / custom | viem | Wraps the EIP-1193 provider as a viem WalletClient. |
toStartaleSmartAccount | @startale-scs/aa-sdk | Builds the smart account from the wallet client. |
createSmartAccountClient | @startale-scs/aa-sdk | Wraps the account with bundler and paymaster for sending UserOperations. |
3. Send a sponsored UserOperation
Common adjustments
Use the EIP-1193 provider directly without a WalletClient
Use the EIP-1193 provider directly without a WalletClient
toStartaleSmartAccount accepts an EIP-1193 provider as a signer too. You can skip createWalletClient if you do not need viem’s wallet methods elsewhere:External wallets via Privy
External wallets via Privy
wallets may contain external wallets (MetaMask, Rabby) alongside the embedded wallet. Pick the one whose walletClientType matches your needs before building the signer.Pay gas in tokens
Pay gas in tokens
Replace
paymasterId with token in paymasterContext. See ERC-20 paymaster.Next steps
Dynamic integration
The same flow with Dynamic as the auth provider.
Smart account setup
Lift the smart account into a context provider.
Smart sessions
Reduce signature friction with scoped session keys.
Social recovery
Add guardian-based key rotation.