Skip to content

Commit 1ae3717

Browse files
committed
docs: replace legacy CDP wallet provider references across docs
The docs, issue template, and Python contributing guide still referenced wallet providers that were removed or renamed during the CDP Wallet API v2 migration (`CdpWalletProvider`, `SmartWalletProvider`/`CDPSmartWalletProvider`, `EthAccountWalletProvider`, `CdpV2SolanaWalletProvider`, `PrivyEvmDelegatedWalletProvider`, `cdpWalletActionProvider`). New users who copied snippets from these docs hit import errors and confusing config shapes. This sweep: - Updates `typescript/agentkit/README.md` and `python/coinbase-agentkit/README.md` to use `CdpEvmWalletProvider` / `CdpSmartWalletProvider` / `CdpSolanaWalletProvider` with the current `apiKeySecret` + `walletSecret` config surface, and drops the stale `SmartWalletProvider` and `CDPSmartWalletProvider` sections. - Adds the required `cdpWalletSecret` / `CDP_WALLET_SECRET` to the default `AgentKit.from(...)` examples in the TS core README and the Langchain, MCP, and Vercel AI SDK framework-extension READMEs. - Switches Python framework-extension setup instructions from the removed `CDP_API_KEY_PRIVATE` env var to `CDP_API_KEY_SECRET` + `CDP_WALLET_SECRET`. - Fixes the Python contributing guide's action-provider walkthrough so it uses the canonical `Erc721ActionProvider` / `EvmWalletProvider` shape with a `send_transaction` + `wait_for_transaction_receipt` flow instead of the removed `CdpWalletProvider.mint` helper. - Updates the bug-report issue template to reproduce with `CdpEvmWalletProvider` + `walletActionProvider`, and corrects the TypeScript snippet to use `//` comments instead of `#`. - Fixes the Compound action provider README test example to construct `CdpEvmWalletProvider(CdpEvmWalletProviderConfig())`. - Fixes the Across action provider README to refer to `CdpEvmWalletProvider` and the x402 README to import from `@coinbase/agentkit` (was `@coinbase/cdp-agentkit`). - Updates the generator-script README example to use `CdpEvmWalletProvider`.
1 parent 512c0e5 commit 1ae3717

14 files changed

Lines changed: 92 additions & 127 deletions

File tree

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ body:
2828
from coinbase_agentkit import (
2929
AgentKit,
3030
AgentKitConfig,
31-
CdpWalletProvider,
32-
CdpWalletProviderConfig,
31+
CdpEvmWalletProvider,
32+
CdpEvmWalletProviderConfig,
3333
erc20_action_provider
3434
)
3535
from coinbase_agentkit_langchain import get_langchain_tools
3636
3737
# A succinct reproducing example trimmed down to the essential parts:
38-
cdp_config = CdpWalletProviderConfig(
38+
cdp_config = CdpEvmWalletProviderConfig(
3939
network_id="base-sepolia"
4040
)
41-
wallet_provider = CdpWalletProvider(cdp_config)
41+
wallet_provider = CdpEvmWalletProvider(cdp_config)
4242
agentkit = AgentKit(AgentKitConfig(
4343
wallet_provider=wallet_provider,
4444
action_providers=[
@@ -49,20 +49,20 @@ body:
4949
```
5050
5151
```typescript
52-
# All necessary imports at the beginning
53-
import { AgentKit, CdpWalletProvider, cdpWalletActionProvider } from '@coinbase/agentkit';
52+
// All necessary imports at the beginning
53+
import { AgentKit, CdpEvmWalletProvider, walletActionProvider } from '@coinbase/agentkit';
5454
import { getLangChainTools } from '@coinbase/agentkit-langchain';
5555
56-
# A succinct reproducing example trimmed down to the essential parts:
56+
// A succinct reproducing example trimmed down to the essential parts:
5757
const config = {
5858
networkId: "base-sepolia"
5959
};
6060
61-
const walletProvider = await CdpWalletProvider.configureWithWallet(config);
61+
const walletProvider = await CdpEvmWalletProvider.configureWithWallet(config);
6262
const agentkit = await AgentKit.from({
6363
walletProvider,
6464
actionProviders: [
65-
cdpWalletActionProvider()
65+
walletActionProvider()
6666
]
6767
});
6868

CONTRIBUTING-PYTHON.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,14 @@ This says that the input schema has two fields: `contract_address` and `destinat
108108
### Implementing the action provider
109109

110110
```python
111-
class CdpWalletActionProvider(ActionProvider[CdpWalletProvider]):
112-
"""Provides actions for interacting with CDP wallets."""
111+
from coinbase_agentkit import ActionProvider, EvmWalletProvider
112+
from coinbase_agentkit.network import Network
113+
114+
class Erc721ActionProvider(ActionProvider[EvmWalletProvider]):
115+
"""Provides ERC-721 actions for EVM wallets."""
113116

114117
def __init__(self):
115-
super().__init__("cdp-wallet", [])
118+
super().__init__("erc721", [])
116119

117120
def supports_network(self, network: Network) -> bool:
118121
return network.protocol_family == "evm"
@@ -123,6 +126,11 @@ class CdpWalletActionProvider(ActionProvider[CdpWalletProvider]):
123126
Now we need to implement the actual function that the AI will call when using your action. Actions are defined using the `@create_action` decorator. The function receives as input the wallet provider that the Agent has access to, along with the inputs defined in the input schema, and it must return a string. Here's an example of the Mint NFT implementation:
124127

125128
```python
129+
from eth_typing import HexStr
130+
from web3 import Web3
131+
132+
from coinbase_agentkit import EvmWalletProvider, create_action
133+
126134
@create_action(
127135
name="mint",
128136
description="""
@@ -132,20 +140,27 @@ Do not use the contract address as the destination address. If you are unsure of
132140
""",
133141
schema=MintSchema,
134142
)
135-
def mint(self, wallet_provider: CdpWalletProvider, args: dict[str, Any]) -> str:
143+
def mint(self, wallet_provider: EvmWalletProvider, args: dict[str, Any]) -> str:
136144
"""Mint an NFT."""
137145
try:
138-
nft_contract = wallet_provider.mint(
139-
contract_address=args["contract_address"],
140-
destination=args["destination"]
141-
).wait()
146+
contract = Web3().eth.contract(address=args["contract_address"], abi=ERC721_ABI)
147+
data = contract.encode_abi("mint", args=[args["destination"], 1])
148+
149+
tx_hash = wallet_provider.send_transaction(
150+
{
151+
"to": HexStr(args["contract_address"]),
152+
"data": HexStr(data),
153+
}
154+
)
155+
156+
wallet_provider.wait_for_transaction_receipt(tx_hash)
142157
except Exception as e:
143-
return f"Error deploying NFT {e!s}"
158+
return f"Error minting NFT {args['contract_address']} to {args['destination']}: {e!s}"
144159

145-
return f"Minted NFT to address {args['destination']}.\nTransaction hash: {nft_contract.transaction.transaction_hash}\nTransaction link: {nft_contract.transaction.transaction_link}"
160+
return f"Successfully minted NFT {args['contract_address']} to {args['destination']}"
146161
```
147162

148-
Notice the return value contains useful information for the user, such as the transaction hash and link. It's important to include this information in the return value so that the user can easily see the result of the action.
163+
Notice the return value contains useful information for the user about the result of the action. When possible, include details such as transaction hashes so the user can inspect what happened onchain.
149164

150165
This class is then exported out of [python/coinbase-agentkit/coinbase_agentkit/\_\_init\_\_.py](https://github.com/coinbase/agentkit/blob/master/python/coinbase-agentkit/coinbase_agentkit/__init__.py) so that it is consumable by users of the `coinbase-agentkit` package.
151166

python/coinbase-agentkit/README.md

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ AgentKit is a framework for easily enabling AI agents to take actions onchain. I
3232
- [EthAccountWalletProvider](#ethaccountwalletprovider)
3333
- [Configuring gas parameters](#configuring-ethaccountwalletprovider-gas-parameters)
3434
- [Configuring `EthAccountWalletProvider` rpc url](#configuring-ethaccountwalletprovider-rpc-url)
35-
- [SmartWalletProvider](#smartwalletprovider)
3635
- [CdpSolanaWalletProvider](#cdpsolanawalletprovider)
3736
- [Configuring with API credentials](#configuring-with-api-credentials)
3837
- [Using environment variables](#using-environment-variables)
@@ -56,10 +55,10 @@ pip install coinbase-agentkit
5655

5756
### Create an AgentKit instance
5857

59-
If no wallet or action providers are specified, the agent will use the `CdpWalletProvider` and `WalletActionProvider` action provider by default.
58+
If no wallet or action providers are specified, the agent will use the `CdpEvmWalletProvider` and `WalletActionProvider` action provider by default. Make sure `CDP_API_KEY_ID`, `CDP_API_KEY_SECRET`, and `CDP_WALLET_SECRET` are set in your environment if you rely on this default.
6059

6160
```python
62-
from coinbase_agentkit import AgentKit, AgentKitConfig
61+
from coinbase_agentkit import AgentKit
6362

6463
agent_kit = AgentKit()
6564
```
@@ -70,13 +69,14 @@ agent_kit = AgentKit()
7069
from coinbase_agentkit import (
7170
AgentKit,
7271
AgentKitConfig,
73-
CdpWalletProvider,
74-
CdpWalletProviderConfig
72+
CdpEvmWalletProvider,
73+
CdpEvmWalletProviderConfig,
7574
)
7675

77-
wallet_provider = CdpWalletProvider(CdpWalletProviderConfig(
76+
wallet_provider = CdpEvmWalletProvider(CdpEvmWalletProviderConfig(
7877
api_key_id="CDP API KEY NAME",
7978
api_key_secret="CDP API KEY SECRET",
79+
wallet_secret="CDP WALLET SECRET",
8080
network_id="base-mainnet"
8181
))
8282

@@ -98,10 +98,7 @@ from coinbase_agentkit import (
9898
agent_kit = AgentKit(AgentKitConfig(
9999
wallet_provider=wallet_provider,
100100
action_providers=[
101-
cdp_api_action_provider(
102-
api_key_id="CDP API KEY NAME",
103-
api_key_secret="CDP API KEY SECRET"
104-
),
101+
cdp_api_action_provider(),
105102
pyth_action_provider()
106103
]
107104
))
@@ -958,43 +955,6 @@ agent_kit = AgentKit(AgentKitConfig(
958955
))
959956
```
960957

961-
### CDPSmartWalletProvider
962-
963-
The `CDPSmartWalletProvider` is a wallet provider that uses [CDP Smart Wallets](https://docs.cdp.coinbase.com/wallet-api/docs/smart-wallets).
964-
965-
```python
966-
import os
967-
from eth_account import Account
968-
969-
from coinbase_agentkit import (
970-
AgentKit,
971-
AgentKitConfig,
972-
SmartWalletProvider,
973-
SmartWalletProviderConfig
974-
)
975-
976-
# See here for creating a private key:
977-
# https://web3py.readthedocs.io/en/stable/web3.eth.account.html#creating-a-private-key
978-
private_key = os.environ.get("PRIVATE_KEY")
979-
assert private_key is not None, "You must set PRIVATE_KEY environment variable"
980-
assert private_key.startswith("0x"), "Private key must start with 0x hex prefix"
981-
982-
signer = Account.from_key(private_key)
983-
984-
network_id = os.getenv("NETWORK_ID", "base-sepolia")
985-
986-
wallet_provider = SmartWalletProvider(SmartWalletProviderConfig(
987-
network_id=network_id,
988-
signer=signer,
989-
smart_wallet_address=None, # If not provided, a new smart wallet will be created
990-
paymaster_url=None, # Sponsor transactions: https://docs.cdp.coinbase.com/paymaster/docs/welcome
991-
))
992-
993-
agent_kit = AgentKit(AgentKitConfig(
994-
wallet_provider=wallet_provider
995-
))
996-
```
997-
998958
### CdpSolanaWalletProvider
999959

1000960
The `CdpSolanaWalletProvider` is a wallet provider that uses the Coinbase Developer Platform (CDP) API for Solana networks. It supports SOL transfers and message signing on Solana mainnet, devnet, and testnet.

python/coinbase-agentkit/coinbase_agentkit/action_providers/compound/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ from coinbase_agentkit.action_providers.compound.compound_action_provider import
6161
CompoundActionProvider,
6262
)
6363
from coinbase_agentkit.action_providers.weth.weth_action_provider import WethActionProvider
64-
from coinbase_agentkit.wallet_providers import CdpWalletProvider
64+
from coinbase_agentkit.wallet_providers import (
65+
CdpEvmWalletProvider,
66+
CdpEvmWalletProviderConfig,
67+
)
6568

6669
# Constants
6770
USDC_ASSET = "usdc"
@@ -71,7 +74,7 @@ WAIT_TIME = 15
7174
@pytest.fixture
7275
def wallet():
7376
"""Create a real wallet instance for testing using the CDP wallet provider."""
74-
return CdpWalletProvider()
77+
return CdpEvmWalletProvider(CdpEvmWalletProviderConfig())
7578

7679
@pytest.fixture
7780
def compound_provider():

python/framework-extensions/autogen/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Set the following environment variables:
2222
```bash
2323
export OPENAI_API_KEY=<your-openai-api-key>
2424
export CDP_API_KEY_ID=<your-cdp-api-key-id>
25-
export CDP_API_KEY_PRIVATE=<your-cdp-api-key-private>
25+
export CDP_API_KEY_SECRET=<your-cdp-api-key-secret>
26+
export CDP_WALLET_SECRET=<your-cdp-wallet-secret>
2627
```
2728

2829
## Usage

python/framework-extensions/langchain/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Set the following environment variables:
2222
```bash
2323
export OPENAI_API_KEY=<your-openai-api-key>
2424
export CDP_API_KEY_ID=<your-cdp-api-key-id>
25-
export CDP_API_KEY_PRIVATE=<your-cdp-api-key-private>
25+
export CDP_API_KEY_SECRET=<your-cdp-api-key-secret>
26+
export CDP_WALLET_SECRET=<your-cdp-wallet-secret>
2627
```
2728

2829
## Usage

python/framework-extensions/openai-agents-sdk/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Set the following environment variables:
2222
```bash
2323
export OPENAI_API_KEY=<your-openai-api-key>
2424
export CDP_API_KEY_ID=<your-cdp-api-key-id>
25-
export CDP_API_KEY_PRIVATE=<your-cdp-api-key-private>
25+
export CDP_API_KEY_SECRET=<your-cdp-api-key-secret>
26+
export CDP_WALLET_SECRET=<your-cdp-wallet-secret>
2627
```
2728

2829
## Usage

0 commit comments

Comments
 (0)