Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9e8d171
First working version.
scheuclu Apr 3, 2025
c6f0b4c
First working version.
scheuclu Apr 9, 2025
c9de703
Apply suggestions from code review
scheuclu Apr 9, 2025
8b04faa
Added empty tests.
scheuclu Apr 9, 2025
9ab6b38
Merge branch 'langchain-compass' of https://github.com/CompassLabs/ag…
scheuclu Apr 9, 2025
da9f773
Updated to latest version of langchain-compass.
scheuclu Apr 10, 2025
32a919b
Updated to latest version of langchain-compass.
scheuclu Apr 10, 2025
eb14bd7
Update python/coinbase-agentkit/tests/action_providers/compass/test_c…
scheuclu Apr 10, 2025
3decceb
Updated to latest version of langchain-compass.
scheuclu May 27, 2025
2bad03a
Update python/coinbase-agentkit/pyproject.toml
scheuclu May 27, 2025
5f02d18
Delete python/examples/langchain-cdp-chatbot/chatbot.py
scheuclu May 27, 2025
cd044db
Renamed CDP env vars to modern convention (#732)
CarsonRoscoe May 28, 2025
8da312c
feat: improved error handling in next template of cli (#733)
CarsonRoscoe May 28, 2025
a60f29f
fix error persistance to persistence CHANGELOG.md (#729)
reject-i May 28, 2025
4600a98
feat: improved next templates message modifier (#734)
CarsonRoscoe May 28, 2025
0889e51
docs: Update agentkit link README.md (#726)
eeemmmmmm May 28, 2025
be2fce7
feat: aws bedrock python example (#735)
CarsonRoscoe May 29, 2025
efba1cd
fix: ignore templates (#744)
CarsonRoscoe May 30, 2025
50de8d3
chore: version typescript packages (#746)
CarsonRoscoe May 30, 2025
7346788
chore: version python core package (#743)
CarsonRoscoe May 30, 2025
3ce41b5
chore: bump python packages (#747)
CarsonRoscoe May 30, 2025
97408c1
fix: pin privy dependency versions (#751)
CarsonRoscoe Jun 9, 2025
eeaa3aa
chore: version typescript packages (#752)
CarsonRoscoe Jun 9, 2025
913beb0
Improve vaults.fyi provider (#700)
pawelpolak2 Jun 10, 2025
1f17aac
Merge branch 'main' into langchain-compass
scheuclu Jun 11, 2025
7508b6e
rename AWS Bedrock to Amazon (#754)
murrlincoln Jun 13, 2025
b3a93d9
Fixed issue with actions not showing up.
scheuclu Jun 13, 2025
38c49da
Merge branch 'main' into langchain-compass
scheuclu Jun 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ npm create onchain-agent@latest
# Navigate to your project directory
cd onchain-agent

# At this point, fill in your CDP API key name, OpenAI API key, and any other environment variables in the .env.local file.
# At this point, fill in your CDP API key id/secret, OpenAI API key, and any other environment variables in the .env.local file.
# Then, rename the .env.local file to .env
mv .env.local .env

Expand Down Expand Up @@ -104,7 +104,7 @@ pipx run create-onchain-agent
# Navigate to your project directory
cd onchain-agent

# At this point, fill in your CDP API key name, OpenAI API key, and any other environment variables in the .env.local file.
# At this point, fill in your CDP API key id/secret, OpenAI API key, and any other environment variables in the .env.local file.
# Then, rename the .env.local file to .env
mv .env.local .env

Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

This file was deleted.

8 changes: 8 additions & 0 deletions python/coinbase-agentkit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

<!-- towncrier release notes start -->

## [0.6.0] - 2025-05-30

### Added

- Renamed CDP env vars to modern naming convention
- Renamed CDP wallet provider & action provider interfaces for new env var names


## [0.5.1] - 2025-05-14

### Fixed
Expand Down
12 changes: 6 additions & 6 deletions python/coinbase-agentkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ from coinbase_agentkit import (
)

wallet_provider = CdpWalletProvider(CdpWalletProviderConfig(
api_key_name="CDP API KEY NAME",
api_key_private="CDP API KEY PRIVATE KEY",
api_key_id="CDP API KEY NAME",
api_key_secret="CDP API KEY SECRET",
network_id="base-mainnet"
))

Expand All @@ -94,8 +94,8 @@ agent_kit = AgentKit(AgentKitConfig(
wallet_provider=wallet_provider,
action_providers=[
cdp_api_action_provider(
api_key_name="CDP API KEY NAME",
api_key_private="CDP API KEY PRIVATE KEY"
api_key_id="CDP API KEY NAME",
api_key_secret="CDP API KEY SECRET"
),
pyth_action_provider()
]
Expand Down Expand Up @@ -206,8 +206,8 @@ class MyActionProvider(ActionProvider[WalletProvider]):

```python
agent_kit = AgentKit(AgentKitConfig(
cdp_api_key_name="CDP API KEY NAME",
cdp_api_key_private="CDP API KEY PRIVATE KEY",
cdp_api_key_id="CDP API KEY ID",
cdp_api_key_secret="CDP API KEY SECRET",
action_providers=[my_action_provider()]
))
```
Expand Down
2 changes: 2 additions & 0 deletions python/coinbase-agentkit/coinbase_agentkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
wallet_action_provider,
weth_action_provider,
wow_action_provider,
compass_action_provider,
)
from .agentkit import AgentKit, AgentKitConfig
from .wallet_providers import (
Expand Down Expand Up @@ -52,6 +53,7 @@
"allora_action_provider",
"cdp_api_action_provider",
"compound_action_provider",
"compass_action_provider",
"erc20_action_provider",
"hyperbolic_action_provider",
"morpho_action_provider",
Expand Down
2 changes: 1 addition & 1 deletion python/coinbase-agentkit/coinbase_agentkit/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.1"
__version__ = "0.6.0"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
basename_action_provider,
)
from .cdp.cdp_api_action_provider import CdpApiActionProvider, cdp_api_action_provider
from .cdp.cdp_wallet_action_provider import CdpWalletActionProvider, cdp_wallet_action_provider
from .compass.compass_action_provider import CompassActionProvider, compass_action_provider
from .compound.compound_action_provider import CompoundActionProvider, compound_action_provider
from .erc20.erc20_action_provider import ERC20ActionProvider, erc20_action_provider
from .hyperboliclabs.hyperbolic_action_provider import (
Expand Down Expand Up @@ -40,6 +42,8 @@
"cdp_api_action_provider",
"CompoundActionProvider",
"compound_action_provider",
"CompassActionProvider",
"compass_action_provider",
"ERC20ActionProvider",
"erc20_action_provider",
"HyperbolicActionProvider",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Compass action provider for lending protocol interactions."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from langchain_compass.toolkits import LangchainCompassToolkit

from coinbase_agentkit.action_providers.action_provider import (
Action,
ActionProvider,
TWalletProvider,
)
from coinbase_agentkit.network import (
CHAIN_ID_TO_NETWORK_ID,
NETWORK_ID_TO_CHAIN,
Network,
arbitrum,
base,
mainnet,
)
from coinbase_agentkit.wallet_providers import EvmWalletProvider

SUPPORTED_NETWORKS = [base, arbitrum, mainnet]


class CompassActionProvider(ActionProvider[EvmWalletProvider]):
"""Provides actions for interacting with Morpho Vaults."""

def __init__(self):
super().__init__("compass", [])

def get_actions(self, wallet_provider: TWalletProvider) -> list[Action]:
"""Get all Compass actions."""
return LangchainCompassToolkit().get_tools()

def supports_network(self, network: Network) -> bool:
"""Check if this provider supports the given network."""
if network.chain_id is None:
network.network_id = CHAIN_ID_TO_NETWORK_ID[network.chain_id]
if network.network_id:
return NETWORK_ID_TO_CHAIN[network.network_id] in [base, arbitrum, mainnet]
return False


def compass_action_provider() -> CompassActionProvider:
"""Create a new Compass action provider.

Returns:
CompassActionProvider: A new Compass action provider instance.

"""
return CompassActionProvider()
2 changes: 1 addition & 1 deletion python/coinbase-agentkit/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

project = 'Coinbase Agentkit'
author = 'Coinbase Developer Platform'
release = '0.5.1'
release = '0.6.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
4 changes: 3 additions & 1 deletion python/coinbase-agentkit/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "coinbase-agentkit"
version = "0.5.1"
version = "0.6.0"
description = "Coinbase AgentKit"
authors = [{ name = "John Peterson", email = "john.peterson@coinbase.com" }]
requires-python = "~=3.10"
Expand All @@ -27,6 +27,8 @@ dependencies = [
"ecdsa>=0.19.0,<0.20",
"pyjwt[crypto]>=2.10.1,<3",
"jsonschema>=4.23.0,<5",
"langchain-compass>=0.2.27",
"numpy>=2.2.4",
]

[tool.hatch.metadata]
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Compass Toolkit Tests

from unittest.mock import MagicMock

import pytest

from coinbase_agentkit.action_providers.compass.compass_action_provider import (
compass_action_provider,
)

mock_wallet = MagicMock()
actions = compass_action_provider().get_actions(wallet_provider=mock_wallet)


@pytest.mark.parametrize("action", actions)
def test_compass_tools(action):
"""Test calls every single tool with default args."""
action.invoke(input=action.example_args)
2 changes: 1 addition & 1 deletion python/coinbase-agentkit/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion python/create-onchain-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

<!-- towncrier release notes start -->

## [0.7.0] - 2025-05-30

### Added

- Bump coinbase-agentkit to 0.6.0 in beginner template and chatbot template
- Bump coinbase-agentkit-langchain to 0.5.0 in beginner template and chatbot template
- Bump coinbase-agentkit-openai-agents-sdk to 0.5.0 in beginner template and chatbot template
- Renamed CDP env vars to modern naming convention


## [0.6.1] - 2025-05-15

### Added
Expand Down Expand Up @@ -57,7 +67,7 @@

### Added

- Added wallet persistance to all templates (#484)
- Added wallet persistence to all templates (#484)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion python/create-onchain-agent/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "create-onchain-agent"
version = "0.6.1"
version = "0.7.0"
description = "CLI to create an onchain agent project"
authors = [{ name = "Carson Roscoe", email = "carsonroscoe7@gmail.com" }]
requires-python = ">=3.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
## Required
# Place your OpenAI API key here
OPENAI_API_KEY=
# Place your CDP API key name here
CDP_API_KEY_NAME=
# Place your CDP API private key here
CDP_API_KEY_PRIVATE_KEY=
# Place your CDP API key id here
CDP_API_KEY_ID=
# Place your CDP API key secret here
CDP_API_KEY_SECRET=

## Optional
NETWORK_ID=base-sepolia
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ package-mode = false
[tool.poetry.dependencies]
python = "^3.10"
python-dotenv = "^1.0.1"
coinbase-agentkit = "^0.5.1"
coinbase-agentkit = "^0.6.0"
{% if _framework == "langchain" %}langchain-openai = "^0.2.4"
langgraph = "^0.2.39"
coinbase-agentkit-langchain = "0.4.0"{% elif _framework == "openai_agents" %}openai-agents = "0.0.6"
coinbase-agentkit-openai-agents-sdk = "0.4.0"
coinbase-agentkit-langchain = "0.5.0"{% elif _framework == "openai_agents" %}openai-agents = "0.0.6"
coinbase-agentkit-openai-agents-sdk = "0.5.0"
openai = "1.68.0"{% endif %}
{% if _wallet_provider == "server" or _wallet_provider == "smart"%}cdp-sdk = "1.6.1"{% endif %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ OWNER_PRIVATE_KEY=

# Optional - Set PAYMASTER_URL to sponsor transactions: https://docs.cdp.coinbase.com/paymaster/docs/welcome
PAYMASTER_URL={% endif %}{% if _wallet_provider == "eth"%}# Required
CDP_API_KEY_NAME= # Place your CDP API key name here
CDP_API_KEY_PRIVATE_KEY= # Place your CDP API key private key here
CDP_API_KEY_ID= # Place your CDP API key id here
CDP_API_KEY_SECRET= # Place your CDP API key secret here
OPENAI_API_KEY= # Place your OpenAI API key here

# Optional - Set PRIVATE_KEY if you have an existing private key. Otherwise, a new account will be created.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ package-mode = false
[tool.poetry.dependencies]
python = "^3.10"
python-dotenv = "^1.0.1"
coinbase-agentkit = "^0.5.1"
coinbase-agentkit = "^0.6.0"
{% if _framework == "langchain" %}langchain-openai = "^0.2.4"
langgraph = "^0.2.39"
coinbase-agentkit-langchain = "0.4.0"{% elif _framework == "openai_agents" %}openai-agents = "0.0.6"
coinbase-agentkit-openai-agents-sdk = "0.4.0"
coinbase-agentkit-langchain = "0.5.0"{% elif _framework == "openai_agents" %}openai-agents = "0.0.6"
coinbase-agentkit-openai-agents-sdk = "0.5.0"
openai = "1.68.0"{% endif %}
{% if _wallet_provider == "server" or _wallet_provider == "smart"%}cdp-sdk = "1.6.1"{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion python/create-onchain-agent/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CDP_API_KEY_ID= # Place your CDP API key ID here
CDP_API_KEY_SECRET= # Place your CDP API key secret here
AWS_ACCESS_KEY_ID= # Place your AWS access key ID here
AWS_SECRET_ACCESS_KEY= # Place your AWS secret access key here
AWS_REGION= # Place your AWS region here. Defaults to us-east-1
29 changes: 29 additions & 0 deletions python/examples/langchain-cdp-chatbot-with-amazon-bedrock/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ifneq (,$(wildcard ./.env))
include .env
endif

export

.PHONY: install
install:
uv sync

.PHONY: run
run:
uv run chatbot.py

.PHONY: format
format:
uv run ruff format .

.PHONY: format-check
format-check:
uv run ruff format . --check

.PHONY: lint
lint:
uv run ruff check .

.PHONY: lint-fix
lint-fix:
uv run ruff check . --fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# CDP Agentkit LangChain Extension Powered by Amazon Bedrock Models

This example demonstrates an agent setup as a terminal style chatbot with access to the full set of CDP Agentkit actions, using [Amazon Bedrock](https://aws.amazon.com/bedrock/) models.

## Ask the chatbot to engage in the Web3 ecosystem!
- "Transfer a portion of your ETH to a random address"
- "What is the price of BTC?"
- "Deploy an NFT that will go super viral!"
- "Deploy an ERC-20 token with total supply 1 billion"

## Requirements
- Python 3.10+
- uv for package management and tooling
- [uv Installation Instructions](https://github.com/astral-sh/uv?tab=readme-ov-file#installation)
- [CDP API Key](https://portal.cdp.coinbase.com/access/api)
- [AWS API Keys](https://aws.amazon.com/bedrock/)

### Checking Python Version
Before using the example, ensure that you have the correct version of Python installed. The example requires Python 3.10 or higher. You can check your Python version by running:

```bash
python --version
uv --version
```

## Installation
```bash
uv sync
```

## Run the Chatbot

### Set ENV Vars
- Ensure the following ENV Vars are set:
- "CDP_API_KEY_ID"
- "CDP_API_KEY_SECRET"
- "AWS_ACCESS_KEY_ID"
- "AWS_SECRET_ACCESS_KEY"
- "NETWORK_ID" (Defaults to `base-sepolia`)

```bash
uv run chatbot.py
```
Loading
Loading