Overview
This example covers:- Fetching available strategies
- Getting strategy details
- Generating transaction bytecode
- Batching and executing via EIP-7702
- Verifying the deposit
Prerequisites
- Node.js 18+
- Pods API key
- Ethereum wallet with USDC balance
- Basic understanding of async/await
Installation
Environment Variables
Create a.env file:
Step-by-Step Walkthrough
1. Initialize API Client
2. Fetch Available Strategies
3. Get Strategy Details
4. Generate Bytecode
Theamount parameter is in the token’s base units (e.g. 6 decimals for USDC: 1000000000 = 1000 USDC).
5. Execute Transactions
The standard approach sends each transaction in a loop. With EIP-7702 you encode the entire
result.bytecode array into one executeBatch call and send it as a single type-4 transaction.
All steps succeed or all revert — no partial failures.6. Verify Deposit
Error Handling
The example includes comprehensive error handling for both Pods API errors and EIP-7702 wallet errors:Running the Example
Expected Output
Next Steps
Strategy Withdrawal
Withdraw from strategies, including cross-chain withdrawals
Cross-Chain Swap
Execute cross-chain token swaps
Check Positions
Track wallet positions
API Reference
View complete API documentation