Welcome to the technical documentation for developing additional project modules for the HeyAnon AI Chatbot.
- Introduction
- Requirements
- Architecture and Design
- Action Functions Implementation Guide
- Getter Functions Implementation Guide
- Tools Implementation Guide
- Module README Guidelines
- Conclusion
- Additional Resources
The fastest way to create a new project is using our setup script:
node scripts/create-module.js project-name "Project description"
For example:
node scripts/create-module.js uniswap-v3 "Uniswap V3 DEX integration"
After running the script:
- Navigate to your new project directory
- Install dependencies and build:
npm install -g pnpm
cd projects/project-name
pnpm install
pnpm run build
If you prefer to set up your project manually, follow these steps:
- Create a new project folder in the
projects
directory:
cd projects
mkdir project-name
- Copy the skeleton project files:
# On Unix-like systems (Linux/MacOS)
cp -r skeleton/* project-name/
# On Windows (Command Prompt)
xcopy skeleton project-name /E /I /H
# On Windows (PowerShell)
Copy-Item -Path "skeleton\*" -Destination "project-name" -Recurse
-
Update the project configuration:
- Open
project-name/package.json
- Change the name from
"@heyanon/project-skeleton"
to"@heyanon/project-your_project
- Update description and other relevant fields
- Open
-
Install dependencies and build:
cd project-name
pnpm install
pnpm run build
The skeleton project provides:
- Standard directory structure:
src/
- main source code directorysrc/abis/
- for contract ABIssrc/functions/
- for action and getter functions- Configuration files (index.ts, constants.ts, etc.)
- Basic README.md template
- Build configuration
- Package.json with correct structure
After setting up your project (either way), follow these steps:
- Add your contract ABIs to
src/abis/
- Implement your functions in
src/functions/
- Update constants and tools in respective files
- Update README.md with project-specific documentation
- Test your implementation
- Build the project using
pnpm run build
All modules must be placed in the projects directory. This ensures consistent organization and easier maintenance of the codebase.
- Fork the repository
- Create a new branch for your module:
git checkout -b feature/module-name
- Create your module using the provided script
- Implement required functionality following the guides
- Test your implementation thoroughly
- Create documentation for your module
- Do not use recipient in your functions. It's forbidden due security concerns for now.
- Quantity of arguments in you function must match with arguments in your tools. You can't omit optional arguments. See examples for this cases in Venus project, repay function.
- If you want to create an interaction involving staking a token with the symbol 'SOME', you should add the address of this token to the constants file and continue writing the necessary functions. However, when your project is merged into Anon, there might be issues because the token symbol 'SOME' is not included in our token list (https://github.com/RealWagmi/heyanon-tokenlist). Therefore, you need to add it to the token list as well. This does not apply to tokens that are not involved in user inputs and are used only as constants within your project.
- Do not use bigint as argument for functions which invoke AI via tools. Only number, strings, arrays, etc. But not bigints.
- You must understand that we are developing our product for everyone. Please create a comprehensive description of the protocol and explain how it works without using technical jargon or ambiguity. Include this description in a get function that Anon can invoke to explain the protocol flow to the user in chat.
- If you need put info in .env => You create in root project not .env, but env.ts near index.ts.
There for example
export const TEST_ENV = process.env.TEST_ENV
We edit our env. and add your TEST_ENV. And in your Readme, please write that the project supports such env
- Ensure your code follows the project's coding standards
- Update the documentation as needed
- Create a Pull Request with:
- Clear description of the module's functionality
- List of supported chains
- Any special configuration requirements
- Test results or coverage reports
- Wait for review from maintainers
- Use TypeScript for all implementations
- Follow existing code style and formatting
- Include proper error handling
- Add comprehensive comments
- Ensure type safety
- Test all functions with different input scenarios
- Verify error handling
- Test on all supported networks
Available networks for integration:
- ETHEREUM (Ethereum Mainnet, 1)
- BSC (BNB Smart Chain, 56)
- KAVA (Kava EVM, 2222)
- BASE (Base, 8453)
- IOTA (IOTA EVM, 1074)
- AVALANCHE (Avalanche C-Chain, 43114)
- ARBITRUM (Arbitrum One, 42161)
- SONIC (Sonic, 146)
- SEPOLIA (Ethereum Testnet Sepolia, 11155111)
- ONE_SEPOLIA (Arbitrum Sepolia Testnet, 421614)