smartAccount and bundlerClient returned by
Create a modular wallet.
Batch calls in a single user operation
Pass multiplecalls to sendUserOperation. The user signs once and the smart
account executes the entire array atomically. A common pattern is to bundle an
ERC-20 approve with the call that spends the allowance, so the user never has
a granted-but-unused approval sitting onchain.
Run independent operations in parallel
Externally owned accounts process transactions sequentially because each one consumes the next integer nonce. Smart accounts use 2D nonces, anonceKey plus
a nonce value. Operations with different nonceKey values are independent and
can land in any order, so a slow operation doesn’t block a fast one.
Use parallel execution when:
- The user operations don’t depend on each other’s state.
- You want to submit multiple operations without waiting for each receipt.
- The operations are safe to land in any order.
nonceKey or passing 0.
To submit operations in parallel, sign each with a distinct
nonceKey greater
than 0, then send them concurrently. Don’t await each receipt before
sending the next, or you lose the benefit.