Using Compass API with ZeroDev Smart Accounts
This guide demonstrates how to integrate Compass API SDK with ZeroDev to create and use smart accounts for DeFi operations. The combination enables:- Account abstraction features
- Gas fee abstraction (pay in any token)
- Simplified DeFi operations
- Enhanced security through smart account features
Prerequisites
Implementation Guide
Import dependencies and initialize clients
First, import the necessary dependencies, load your environment variables, and initialize the public client and entry point.
Create signer, validator, kernel account, and paymaster
Set up the signer, ECDSA validator, kernel account, paymaster, and kernel
client. This step prepares your smart account for batched DeFi operations.
Create and prepare batched operations
Use the Compass API SDK to create batched DeFi operations (e.g., allowance
increase and Aave supply). Convert the result to the format expected by the
kernel client.