Metadata-Version: 2.2
Name: cobo-agentic-wallet
Version: 0.1.30
Summary: Python SDK for Cobo Agent Wallet - The Programmable Bank for Autonomous Agents
Author-email: Cobo <dev@cobo.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/CoboGlobal/cobo-agentic-wallet-python-sdk
Project-URL: Documentation, https://github.com/CoboGlobal/cobo-agentic-wallet-python-sdk#readme
Project-URL: Repository, https://github.com/CoboGlobal/cobo-agentic-wallet-python-sdk
Project-URL: Issues, https://github.com/CoboGlobal/cobo-agentic-wallet-python-sdk/issues
Project-URL: Changelog, https://github.com/CoboGlobal/cobo-agentic-wallet-python-sdk/blob/main/CHANGELOG.md
Keywords: agent,wallet,crypto,cobo,mcp,llm,ai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: urllib3>=2.6.3
Requires-Dist: typing-extensions>=4.7.1
Requires-Dist: pynacl>=1.6.0
Provides-Extra: mcp
Requires-Dist: fastmcp>=3.0.0; extra == "mcp"
Provides-Extra: langchain
Requires-Dist: langchain>=1.0.0; extra == "langchain"
Provides-Extra: openai
Requires-Dist: openai-agents>=0.10.4; extra == "openai"
Provides-Extra: agno
Requires-Dist: agno>=2.4.8; extra == "agno"
Provides-Extra: all
Requires-Dist: fastmcp>=3.0.0; extra == "all"
Requires-Dist: langchain>=1.0.0; extra == "all"
Requires-Dist: openai-agents>=0.10.4; extra == "all"
Requires-Dist: agno>=2.4.8; extra == "all"
Provides-Extra: crewai
Requires-Dist: crewai>=1.9.3; extra == "crewai"
Provides-Extra: agent-frameworks
Requires-Dist: langchain>=1.0.0; extra == "agent-frameworks"
Requires-Dist: openai-agents>=0.10.4; extra == "agent-frameworks"
Requires-Dist: agno>=2.4.8; extra == "agent-frameworks"
Provides-Extra: dev
Requires-Dist: pytest>=8.3.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24.0; extra == "dev"
Requires-Dist: pytest-cov>=6.0.0; extra == "dev"
Requires-Dist: respx>=0.21.0; extra == "dev"
Requires-Dist: aioresponses>=0.7.4; extra == "dev"
Requires-Dist: ruff>=0.6.0; extra == "dev"
Requires-Dist: pyyaml>=6.0; extra == "dev"
Requires-Dist: fastmcp>=3.0.0; extra == "dev"
Requires-Dist: langchain>=1.0.0; extra == "dev"
Requires-Dist: openai-agents>=0.10.4; extra == "dev"
Requires-Dist: agno>=2.4.8; extra == "dev"

# Cobo Agentic Wallet SDK

> Don't give your agent a wallet. Give it a Budget and a Rulebook.

[![PyPI version](https://img.shields.io/pypi/v/cobo-agentic-wallet)](https://pypi.org/project/cobo-agentic-wallet/)
[![Python versions](https://img.shields.io/pypi/pyversions/cobo-agentic-wallet)](https://pypi.org/project/cobo-agentic-wallet/)
[![License](https://img.shields.io/github/license/CoboGlobal/cobo-agentic-wallet-sdk)](https://github.com/CoboGlobal/cobo-agentic-wallet-python-sdk/blob/main/LICENSE)

The Cobo Agentic Wallet SDK lets AI agents manage crypto wallets with built-in policy guardrails. Instead of giving your agent unrestricted access to a wallet, you define budgets, spending limits, and rules — the policy engine enforces them automatically.

## Features

- **Policy Engine** — Per-transaction limits, daily/monthly budgets, token allowlists. Denials include structured `suggestion` and `details` fields so agents can self-correct.
- **Delegation Model** — Owners define what agents can do via delegations. Agents operate within those boundaries without needing owner keys.
- **DeFi Ready** — Execute Uniswap V3 swaps, Aave V3 lending, Jupiter swaps on Solana, DCA, grid trading, and more — all through policy-enforced contract calls.
- **Framework Integrations** — Drop-in toolkits for LangChain, OpenAI Agents SDK, Agno, CrewAI, MCP, and Claude Code.
- **CLI + SDK** — Full-featured `caw` CLI (Go binary) for interactive use and async Python SDK for programmatic access.

## Install

### CLI (Go binary)

The `caw` CLI is distributed as a standalone Go binary. Use the bootstrap script to install:

```bash
# Via bootstrap script (included in skills)
bash scripts/bootstrap-env.sh
```

### Python SDK

```bash
pip install cobo-agentic-wallet
```

## Quick start

### CLI

```bash
# Set environment
export AGENT_WALLET_API_URL=https://api-agent-wallet-core.sandbox.cobo.com

# Onboard: pair agent with owner and create wallet
caw onboard --token <TOKEN> --create-wallet --env sandbox

# Transfer tokens
caw tx transfer <wallet_uuid> --to 0xABC... --token ETH_USDC --amount 10 --chain ETH

# Check balance
caw wallet balance <wallet_uuid>

# Contract call (EVM)
caw tx call <wallet_uuid> --contract 0x... --calldata 0x... --chain ETH

# Contract call (Solana)
caw tx call <wallet_uuid> --instructions '<json>' --chain SOL --src-addr <addr>
```

### Python SDK

```python
from cobo_agentic_wallet.client import WalletAPIClient

async with WalletAPIClient(
    base_url="https://api-agent-wallet-core.sandbox.cobo.com",
    api_key="your-key",
) as client:
    # List wallets
    wallets = await client.list_wallets()

    # Transfer with policy enforcement
    result = await client.transfer_tokens(
        wallet_uuid,
        dst_addr="0xABC...",
        token_id="ETH_USDC",
        amount="10",
        chain_id="ETH",
    )
```

## Framework Integrations

| Framework | Install | Import |
|-----------|---------|--------|
| LangChain | `pip install cobo-agentic-wallet[langchain]` | `from cobo_agentic_wallet.integrations.langchain import CoboAgentWalletToolkit` |
| OpenAI Agents | `pip install cobo-agentic-wallet[openai]` | `from cobo_agentic_wallet.integrations.openai import CoboOpenAIAgentContext` |
| Agno | `pip install cobo-agentic-wallet[agno]` | `from cobo_agentic_wallet.integrations.agno import CoboAgentWalletTools` |
| CrewAI | `pip install cobo-agentic-wallet[crewai]` | `from cobo_agentic_wallet.integrations.crewai import CoboAgentWalletCrewAIToolkit` |
| MCP | `pip install cobo-agentic-wallet[mcp]` | `python -m cobo_agentic_wallet.mcp` |

## MCP Server

Run the MCP server for use with Claude Desktop or other MCP clients:

```bash
AGENT_WALLET_API_URL=https://api-agent-wallet-core.sandbox.cobo.com \
AGENT_WALLET_API_KEY=your-key \
python -m cobo_agentic_wallet.mcp
```

Add to your MCP client config:

```json
{
  "mcpServers": {
    "cobo-agentic-wallet": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/sdk", "python", "-m", "cobo_agentic_wallet.mcp"],
      "env": {
        "AGENT_WALLET_API_URL": "https://api-agent-wallet-core.sandbox.cobo.com",
        "AGENT_WALLET_API_KEY": "your-api-key"
      }
    }
  }
}
```

## Claude Code Skill

A Claude Code skill is included for AI-assisted wallet operations and DeFi strategy execution:

```
Install the cobo-agentic-wallet skill from /path/to/sdk/skills/cobo-agentic-wallet/
```

See [skills/README.md](skills/README.md) for details.

## Agent Recipes

Ready-to-use examples for common use cases:

- [DCA Trader](examples/recipes/dca-trader/) — Dollar cost averaging strategy
- [Treasury Manager](examples/recipes/treasury-manager/) — Multi-wallet treasury operations
- [Discord Tip Bot](examples/recipes/discord-tip-bot/) — Tipping via Discord
- [NFT Minter](examples/recipes/nft-minter/) — Automated NFT minting
- [Crosschain Arbitrageur](examples/recipes/crosschain-arbitrageur/) — Cross-chain arbitrage
- [DeFi Yield Optimizer](examples/recipes/defi-yield-optimizer/) — Yield farming optimization
- [Trading Execution](examples/recipes/trading-execution/) — Algorithmic trading
- [API Micropayment](examples/recipes/api-micropayment/) — Pay-per-call API access
- [Agent-to-Agent](examples/recipes/agent-to-agent/) — Inter-agent payments
- [Self-Sustaining Agent](examples/recipes/self-sustaining-agent/) — Autonomous revenue agent
- [Emergency Kill Switch](examples/recipes/emergency-kill-switch/) — Emergency freeze
- [Org Payroll](examples/recipes/org-payroll/) — Payroll distribution

See [`examples/recipes/`](examples/recipes/) for full implementations.

## Why Agentic Wallet?

Giving an AI agent direct access to a crypto wallet is like giving an intern the company credit card with no spending limit. Agentic Wallet solves this with:

1. **Delegations** — Define per-transaction, daily, and monthly limits. The agent operates within these boundaries.
2. **Policy Engine** — Every transfer is checked against the delegation rules before execution. No exceptions.
3. **Structured Denials** — When a transfer is denied, the agent receives a machine-readable explanation with a `suggestion` field it can use to retry with adjusted parameters.
4. **Audit Trail** — Every transfer attempt (allowed and denied) is logged with full context.

## Development

```bash
git clone https://github.com/CoboGlobal/cobo-agentic-wallet-python-sdk.git
cd cobo-agentic-wallet-python-sdk
uv sync --extra dev
make lint
make test
```

## Documentation

- [API Reference](docs/api-reference.md)
- [Framework Guides](docs/guides/)
- [Agent Recipes](examples/recipes/)
- [Changelog](CHANGELOG.md)

## License

Apache License 2.0 — see [LICENSE](LICENSE) for details.
