const safeGoat = new GOAT({
llm: openai({ apiKey: process.env.OPENAI_API_KEY }),
safety: {
maxTransactionValue: '1000', // Max $1000 per transaction
requireConfirmation: true,
whitelist: {
contracts: ['0x...', '0x...'], // Only interact with these
tokens: ['ETH', 'USDC', 'DAI'],
},
simulateBeforeExecute: true,
},
});
// Set up confirmation handler
safeGoat.onConfirmationRequired(async (action) => {
console.log('Confirmation required for:', action);
// Implement user confirmation logic
return confirm(`Execute: ${action.description}?`);
});