Overview
The CDP Wallet Provider handles wallet creation, configuration, and persistence. Wallets are automatically created on first run and persisted to local storage for reuse.Wallet Provider Configuration
TheCdpWalletProvider manages wallet lifecycle and configuration:
Configuration Parameters
- api_key_name: Your CDP API key name
- api_key_private: Your CDP private key
- network_id: Target blockchain network (default:
base-mainnet) - wallet_data: Previously exported wallet data for persistence (optional)
Wallet Persistence
Fromchatbot.py:446-478, wallets are automatically persisted:
Wallet Export and Import
Exporting Wallet Data
Export wallet data for backup or transfer:Importing Wallet Data
Restore a wallet from previously exported data:Action Providers Integration
Wallet providers work with action providers to enable specific operations:Network Configuration
Configure the blockchain network for your wallet:Mainnet Networks
Testnet Networks
Security Best Practices
Protect Your API Keys
Store API keys securely in environment variables:python-dotenv:
Wallet Data Security
- Never commit
wallet_data.txtto version control - Add to
.gitignore: - Store backups in secure, encrypted storage
- Use different wallets for development and production
Common Wallet Operations
Check Wallet Address
Access wallet information through the provider:Multiple Wallets
Manage multiple wallets by using different data files:Troubleshooting
Wallet Not Loading
If wallet data fails to load:- Check file permissions on
wallet_data.txt - Verify JSON format is valid
- Ensure CDP credentials are correct
- Check network connectivity to CDP API
Invalid Credentials
If you see authentication errors:- Verify
CDP_API_KEY_NAMEmatches your CDP account - Check
CDP_API_KEY_PRIVATEis correctly formatted - Ensure API key has necessary permissions
- Confirm API key is active in CDP dashboard
Next Steps
- Token Operations - Learn about token transfers and operations
- Blockchain Overview - Understand the complete blockchain integration