Skip to content

wildhash/walrus-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Onchain Agent Powered by AgentKit

This is a Python chatbot project bootstrapped with create-onchain-agent.
It integrates AgentKit to provide AI-driven interactions with on-chain capabilities.

Prerequisites

Before using create-onchain-agent, ensure you have the following installed:

Getting Started

First, install dependencies:

poetry install

Then, configure your environment variables:

mv .env.local .env

Finally, run the chatbot:

poetry run python chatbot.py

You can also specify mode and interval non-interactively:

AGENT_MODE=auto AUTO_INTERVAL_SECONDS=15 poetry run python chatbot.py

Configuring Your Agent

You can modify your agent configuration in the chatbot.py file.

1. Select Your LLM

Modify the ChatOpenAI instantiation to use the model of your choice.

2. Select Your Wallet Provider

AgentKit requires a Wallet Provider to interact with blockchain networks.

3. Select Your Action Providers

Action Providers define what your agent can do. You can use built-in providers or create your own.

Demo Usage

The demo.py script walks the agent through key Wallet API operations:

  1. Retrieve the smart wallet address
  2. Check the wallet's EVM balance
  3. Generate a new smart wallet account
  4. Request testnet ETH from the faucet
  5. (Optional) Send ETH to a destination address

Environment Variables

Create a .env file in this directory with the following keys:

# OpenAI
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4o-mini
OPENAI_TEMPERATURE=0.2

# Coinbase Developer Platform (CDP)
CDP_API_KEY_NAME=your_cdp_api_key_name
CDP_API_KEY_PRIVATE_KEY=your_cdp_api_private_key

# Wallet
PRIVATE_KEY=your_ethereum_private_key
NETWORK=base-sepolia
PAYMASTER_URL=
WALLET_DATA_FILE=wallet_data.txt

# Feature toggles
ENABLE_ERC20=1
ENABLE_PYTH=1

# Agent runtime
AGENT_MODE=chat
AGENT_THREAD_ID=Smart Wallet Chatbot
AUTO_INTERVAL_SECONDS=10

# Demo script
DEMO_DEST_ADDRESS=optional_destination_address

Running the Demo

Install dependencies and run:

poetry install
poetry run python demo.py

Starting the Chat Agent

Use the provided script to launch the interactive chatbot:

poetry run start-agent

Next Steps

  • Explore the AgentKit README: AgentKit Documentation
  • Learn more about available Wallet Providers & Action Providers.
  • Experiment with custom Action Providers for your specific use case.

Learn More

Contributing

Interested in contributing to AgentKit? Follow the contribution guide:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages