Overview
Cavos uses session keys for all transactions. After creating a session, users can execute unlimited transactions without any signature prompts.[!NOTE] All transactions are signed with the session key, not the user’s private key. The private key is cleared from memory after session creation.
Prerequisites
Before executing transactions, you need to be authenticated. Afterlogin(), account deployment and session registration happen automatically:
Basic Transaction
Once a session is active, transactions execute without prompts:Call Format
Each call follows the starknet.jsCall interface:
[!IMPORTANT]
The call must match a method in your session policy’s allowedMethods. Calls to unauthorized methods will fail.
Multiple Calls (Multicall)
Execute multiple calls atomically in a single transaction:- Approve + Swap
- Multi-token transfers
- Complex DeFi operations
Gasless by Default
All transactions through session keys are gasless:- User pays nothing
- Gas is sponsored by AVNU Paymaster
- No ETH balance required
Session Policy Enforcement
Transactions are validated against your session policy:Error Handling
Transaction Status
Theexecute() function returns the transaction hash immediately. To track status:
Common Patterns
ERC20 Transfer
Approve + Action
Session Lifecycle
| State | execute() Behavior |
|---|---|
| Not authenticated | Throws “Wallet not initialized” |
| Session registered | Signs with session key ✅ |
| Session not registered yet | Auto-uses JWT signature (registers + executes atomically) |
| Expired (within grace) | Auto-renews session, then executes |
| Expired (beyond grace) | Throws “SESSION_EXPIRED” — re-login required |

