Bot Wallet Architecture
Your bot has two addresses:- Gas wallet (
bot.viem.account) - Signs and pays for transactions - App address (
bot.appAddress) - Treasury wallet (SimpleAccount)
Your gas wallet needs Base ETH for transaction fees. See Getting Started for details.
Configuration
Base RPC URL
For reliable blockchain interactions, configure a custom RPC endpoint. The default public RPC has strict rate limits..env:
Bot Contract Interactions
Reading from Contracts
Read contract state without gas costs:Writing to Contracts
Useexecute from ERC-7821 for any onchain interaction:
Batch Transactions
Execute multiple operations atomically:To request users to sign transactions or messages, see Interactions. This page focuses on bot-initiated blockchain operations.
Utility Functions
getSmartAccountFromUserId
Get a user’s smart account address:null if no smart account exists.
Use cases:
- Send tokens/NFTs to users
- Airdrop rewards
- Check balances
- Verify ownership
Method Selection Guide
Next Steps
- Create interactions with buttons and forms
- Integrate external services via webhooks
- Learn about slash commands
- Explore event handlers