Skip to content

Commit ed0649f

Browse files
committed
feat: default to mainnet and base chains when none configured
- Use mainnet and base as fallback chains when no chains are configured - Update warning message to indicate default chains being used - Ensures plugin always has some chains to work with
1 parent 77541ee commit ed0649f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/providers/wallet.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,16 @@ const genChainsFromRuntime = (runtime: IAgentRuntime): Record<string, Chain> =>
204204
// Get chains from settings - ONLY use configured chains
205205
const configuredChains = (runtime?.character?.settings?.chains?.evm as SupportedChain[]) || [];
206206

207-
// If no chains are configured, return empty object
207+
// If no chains are configured, default to mainnet and base
208+
const chainsToUse = configuredChains.length > 0 ? configuredChains : ['mainnet', 'base'];
209+
208210
if (configuredChains.length === 0) {
209-
elizaLogger.warn('No EVM chains configured in settings');
210-
return {};
211+
elizaLogger.warn('No EVM chains configured in settings, defaulting to mainnet and base');
211212
}
212213

213214
const chains: Record<string, Chain> = {};
214215

215-
for (const chainName of configuredChains) {
216+
for (const chainName of chainsToUse) {
216217
try {
217218
// Try to get RPC URL from settings using different formats
218219
let rpcUrl = runtime.getSetting(`ETHEREUM_PROVIDER_${chainName.toUpperCase()}`);

0 commit comments

Comments
 (0)