Skip to main content

autogen-ext-agentwallet

Non-custodial wallet extension for AutoGen agents.

Give your AutoGen agents a real wallet: check balances, send tokens, bridge across 17 chains via CCTP, handle HTTP 402 micropayments, and enforce on-chain spend limits — all without ever handing over custody of your keys.

Features

  • EVM balance checks — native ETH and any ERC-20 token
  • Token transfers — sign and broadcast transactions directly from the agent
  • 17-chain CCTP bridge — USDC bridging via Circle's Cross-Chain Transfer Protocol (Ethereum, Base, Arbitrum, Optimism, Polygon, Avalanche, and more)
  • x402 payments — automatic handling of HTTP 402 Payment Required flows
  • On-chain spend limits — query AgentAccountV2 contract limits before spending

Installation

pip install autogen-ext-agentwallet

Configuration

Set these environment variables (or pass directly to the toolkit):

WALLET_ADDRESS=0xYourAgentWalletAddress
PRIVATE_KEY=0xYourPrivateKey
RPC_URL=https://mainnet.base.org
CHAIN_ID=8453

Security: Never hardcode your private key. Use .env files or a secrets manager.

Quick Start

import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_ext_agentwallet import AgentWalletToolkit

# Initialize the toolkit
toolkit = AgentWalletToolkit(
    wallet_address="0xYourAgentWalletAddress",
    private_key="0xYourPrivateKey",
    chain_id=8453,          # Base mainnet
    rpc_url="https://mainnet.base.org",
)

tools = toolkit.get_tools()

# Create an AutoGen agent with wallet capabilities
agent = AssistantAgent(
    name="wallet_agent",
    model_client=OpenAIChatCompletionClient(model="gpt-4o"),
    tools=tools,
    system_message=(
        "You are an autonomous agent with a non-custodial wallet. "
        "You can check balances, send tokens, bridge assets, and pay for services."
    ),
)

async def main():
    result = await agent.run(task="Check my ETH balance on Base")
    print(result)

asyncio.run(main())

Available Tools

WalletBalanceTool

Check native or ERC-20 token balance.

from autogen_ext_agentwallet import WalletBalanceTool

tool = WalletBalanceTool(rpc_url="https://mainnet.base.org", wallet_address="0x...")
# Used automatically by the agent, or call directly:
# result = await tool.run(BalanceInput(address="0x...", token="0xUSDC..."))

WalletTransferTool

Sign and send ETH or ERC-20 tokens.

The agent will construct a transaction, sign it locally (non-custodial), and broadcast it.

WalletBridgeTool

Bridge USDC across chains using Circle's CCTP.

Supported chains: Ethereum (1), Base (8453), Arbitrum (42161),
Optimism (10), Polygon (137), Avalanche (43114), and more.

X402PaymentTool

Handle HTTP 402 payment flows automatically. The agent will:

  1. Detect the 402 response
  2. Parse payment requirements from headers
  3. Sign a micropayment (if within max_amount_usd)
  4. Retry the request with the payment header

GetSpendLimitsTool

Query on-chain spend limits from an AgentAccountV2 contract.

Using Individual Tools

from autogen_ext_agentwallet import WalletBalanceTool, WalletTransferTool, GetSpendLimitsTool

balance_tool = WalletBalanceTool(
    rpc_url="https://mainnet.base.org",
    wallet_address="0x...",
)

transfer_tool = WalletTransferTool(
    rpc_url="https://mainnet.base.org",
    wallet_address="0x...",
    private_key="0x...",
    chain_id=8453,
)

spend_tool = GetSpendLimitsTool(rpc_url="https://mainnet.base.org")

Supported Chains

Chain Chain ID CCTP Domain
Ethereum 1 0
Avalanche 43114 1
Optimism 10 2
Arbitrum 42161 3
Base 8453 6
Polygon 137 7

License

MIT — see LICENSE

Links

Release files for autogen-ext-agentwallet 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autogen-ext-agentwallet 1.0.0
File Size Uploaded
autogen_ext_agentwallet-1.0.0.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autogen-ext-agentwallet 1.0.0
File Interpreter ABI Platform
autogen_ext_agentwallet-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / autogen_ext_agentwallet-1.0.0.tar.gz

Download URL autogen_ext_agentwallet-1.0.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
42856adc95fd08ce1bd69f5c159c6f5b102fbf040becf1e93122bd6e2746ad42
BLAKE2b-256 checksum
How to use checksums
5c6d7b348b749091e7bd2763c9914f9dc523ea6ac4640af7d532a8412bccf1c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / autogen_ext_agentwallet-1.0.0-py3-none-any.whl

Download URL autogen_ext_agentwallet-1.0.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a556744300eb93f477e49f9a679eb4201fffedb5822df65d5abb7edd4dbf97a8
BLAKE2b-256 checksum
How to use checksums
a0aa2a3f549b3ca94456d214ae9785dc928cc1bdc482e7acb8acde44edf156f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page