Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Renamed CDP env vars to modern naming convention
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Renamed CDP env vars to modern naming convention
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 @@ -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
4 changes: 2 additions & 2 deletions python/examples/langchain-cdp-server-chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ uv sync

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ You'll need the following API keys:
Once you have them, rename the `.env.local` file to `.env` and make sure you set the API keys to their corresponding environment variables:

#### Required:
- `CDP_API_KEY_NAME=`
- `CDP_API_KEY_PRIVATE_KEY=`
- `CDP_API_KEY_ID=`
- `CDP_API_KEY_SECRET=`
- `OPENAI_API_KEY=`

#### Optional:
Expand Down
4 changes: 2 additions & 2 deletions python/examples/langchain-eth-account-chatbot/.env.local
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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
4 changes: 2 additions & 2 deletions python/examples/langchain-eth-account-chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ uv sync

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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
NILLION_ORG_ID= # Place your Nillion SecretVault organization did here
NILLION_SECRET_KEY= # Place your Nillion SecretVault organization private key here
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ uv sync

### Set ENV Vars
- Ensure the following ENV Vars are set:
- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"
- "CDP_API_KEY_ID"
- "CDP_API_KEY_SECRET"
- "OPENAI_API_KEY"
- "NETWORK_ID" (Defaults to `base-sepolia`)
- "NILLION_ORG_ID"
Expand Down
4 changes: 2 additions & 2 deletions python/examples/langchain-twitter-chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ make install

Rename .env.local to .env and ensure the following var are set:

- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"
- "CDP_API_KEY_ID"
- "CDP_API_KEY_SECRET"
- "OPENAI_API_KEY"
- "TWITTER_ACCESS_TOKEN"
- "TWITTER_ACCESS_TOKEN_SECRET"
Expand Down
4 changes: 2 additions & 2 deletions python/examples/openai-agents-sdk-cdp-chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ uv sync

### Set ENV Vars
- Ensure the following ENV Vars are set:
- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"
- "CDP_API_KEY_ID"
- "CDP_API_KEY_SECRET"
- "OPENAI_API_KEY"
- "PRIVATE_KEY" (optional, will generate a new private key if not provided)
- "NETWORK_ID" (Defaults to `base-sepolia`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ uv install
### Set ENV Vars

- Ensure the following ENV Vars are set:
- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"
- "CDP_API_KEY_ID"
- "CDP_API_KEY_SECRET"
- "OPENAI_API_KEY"
- "NETWORK_ID" (Defaults to `base-sepolia`)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ uv sync

### Set ENV Vars
- Ensure the following ENV Vars are set:
- "CDP_API_KEY_NAME"
- "CDP_API_KEY_PRIVATE_KEY"
- "CDP_API_KEY_ID"
- "CDP_API_KEY_SECRET"
- "OPENAI_API_KEY"
- "PRIVATE_KEY" (optional, will generate a new private key if not provided)
- "NETWORK_ID" (Defaults to `base-sepolia`)
Expand Down
2 changes: 1 addition & 1 deletion python/framework-extensions/langchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Set the following environment variables:

```bash
export OPENAI_API_KEY=<your-openai-api-key>
export CDP_API_KEY_NAME=<your-cdp-api-key-name>
export CDP_API_KEY_ID=<your-cdp-api-key-id>
export CDP_API_KEY_PRIVATE=<your-cdp-api-key-private>
```

Expand Down
2 changes: 1 addition & 1 deletion python/framework-extensions/openai-agents-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Set the following environment variables:

```bash
export OPENAI_API_KEY=<your-openai-api-key>
export CDP_API_KEY_NAME=<your-cdp-api-key-name>
export CDP_API_KEY_ID=<your-cdp-api-key-id>
export CDP_API_KEY_PRIVATE=<your-cdp-api-key-private>
```

Expand Down
6 changes: 6 additions & 0 deletions typescript/.changeset/fluffy-adults-stay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"create-onchain-agent": minor
"@coinbase/agentkit": minor
---

Renamed CDP env vars to modern naming convention
40 changes: 20 additions & 20 deletions typescript/agentkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ npm install @coinbase/agentkit

```typescript
const agentKit = await AgentKit.from({
cdpApiKeyName: "CDP API KEY NAME",
cdpApiKeyPrivate: "CDP API KEY PRIVATE KEY",
cdpApiKeyId: "CDP API KEY NAME",
cdpApiKeyPrivate: "CDP API KEY SECRET",
});
```

Expand All @@ -76,8 +76,8 @@ If no wallet or action provider are specified, the agent will use the `CdpWallet

```typescript
const agentKit = await AgentKit.from({
cdpApiKeyName: "CDP API KEY NAME",
cdpApiKeyPrivate: "CDP API KEY PRIVATE KEY",
cdpApiKeyId: "CDP API KEY NAME",
cdpApiKeyPrivate: "CDP API KEY SECRET",
});
```

Expand All @@ -87,8 +87,8 @@ const agentKit = await AgentKit.from({
import { CdpWalletProvider } from "@coinbase/agentkit";

const walletProvider = await CdpWalletProvider.configureWithWallet({
apiKeyName: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY PRIVATE KEY",
apiKeyId: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY SECRET",
networkId: "base-mainnet",
});

Expand All @@ -106,8 +106,8 @@ const agentKit = await AgentKit.from({
walletProvider,
actionProviders: [
cdpApiActionProvider({
apiKeyName: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY PRIVATE KEY",
apiKeyId: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY SECRET",
}),
pythActionProvider(),
],
Expand Down Expand Up @@ -528,8 +528,8 @@ This gives your agent access to the actions defined in the action provider.

```typescript
const agentKit = new AgentKit({
cdpApiKeyName: "CDP API KEY NAME",
cdpApiKeyPrivate: "CDP API KEY PRIVATE KEY",
cdpApiKeyId: "CDP API KEY NAME",
cdpApiKeyPrivate: "CDP API KEY SECRET",
actionProviders: [myActionProvider()],
});
```
Expand Down Expand Up @@ -621,8 +621,8 @@ The `CdpWalletProvider` can be configured to use a specific network by passing t
import { CdpWalletProvider } from "@coinbase/agentkit";

const walletProvider = await CdpWalletProvider.configureWithWallet({
apiKeyName: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY PRIVATE KEY",
apiKeyId: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY SECRET",
networkId: "base-mainnet",
});
```
Expand All @@ -636,8 +636,8 @@ import { CdpWalletProvider } from "@coinbase/agentkit";
import { Wallet } from "@coinbase/coinbase-sdk";
const walletProvider = await CdpWalletProvider.configureWithWallet({
wallet,
apiKeyName: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY PRIVATE KEY",
apiKeyId: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY SECRET",
});
```

Expand Down Expand Up @@ -678,8 +678,8 @@ import { CdpWalletProvider } from "@coinbase/agentkit";

const walletProvider = await CdpWalletProvider.configureWithWallet({
cdpWalletData: "WALLET DATA JSON STRING",
apiKeyName: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY PRIVATE KEY",
apiKeyId: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY SECRET",
});
```

Expand All @@ -692,8 +692,8 @@ import { CdpWalletProvider } from "@coinbase/agentkit";

const walletProvider = await CdpWalletProvider.configureWithWallet({
cdpWalletData: "WALLET DATA JSON STRING",
apiKeyName: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY PRIVATE KEY",
apiKeyId: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY SECRET",
gas: {
gasLimitMultiplier: 2.0, // Adjusts gas limit estimation
feePerGasMultiplier: 2.0, // Adjusts max fee per gas
Expand Down Expand Up @@ -879,8 +879,8 @@ import { ZeroDevWalletProvider, CdpWalletProvider } from "@coinbase/agentkit";

// First create a CDP wallet provider as the signer
const cdpWalletProvider = await CdpWalletProvider.configureWithWallet({
apiKeyName: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY PRIVATE KEY",
apiKeyId: "CDP API KEY NAME",
apiKeyPrivate: "CDP API KEY SECRET",
networkId: "base-mainnet",
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export class CdpApiActionProvider extends ActionProvider<WalletProvider> {
constructor(config: CdpProviderConfig = {}) {
super("cdp_api", []);

if (config.apiKeyName && config.apiKeyPrivateKey) {
if (config.apiKeyId && config.apiKeySecret) {
Coinbase.configure({
apiKeyName: config.apiKeyName,
privateKey: config.apiKeyPrivateKey?.replace(/\\n/g, "\n"),
apiKeyName: config.apiKeyId,
privateKey: config.apiKeySecret?.replace(/\\n/g, "\n"),
source: "agentkit",
sourceVersion: version,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export class CdpWalletActionProvider extends ActionProvider<CdpWalletProvider> {
constructor(config: CdpProviderConfig = {}) {
super("cdp_wallet", []);

if (config.apiKeyName && config.apiKeyPrivateKey) {
if (config.apiKeyId && config.apiKeySecret) {
Coinbase.configure({
apiKeyName: config.apiKeyName,
privateKey: config.apiKeyPrivateKey?.replace(/\\n/g, "\n"),
apiKeyName: config.apiKeyId,
privateKey: config.apiKeySecret?.replace(/\\n/g, "\n"),
source: "agentkit",
sourceVersion: version,
});
Expand Down
12 changes: 6 additions & 6 deletions typescript/agentkit/src/agentkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Action, ActionProvider, walletActionProvider } from "./action-providers
* Configuration options for AgentKit
*/
export type AgentKitOptions = {
cdpApiKeyName?: string;
cdpApiKeyPrivateKey?: string;
cdpApiKeyId?: string;
cdpApiKeySecret?: string;
walletProvider?: WalletProvider;
actionProviders?: ActionProvider[];
};
Expand Down Expand Up @@ -47,15 +47,15 @@ export class AgentKit {
let walletProvider: WalletProvider | undefined = config.walletProvider;

if (!config.walletProvider) {
if (!config.cdpApiKeyName || !config.cdpApiKeyPrivateKey) {
if (!config.cdpApiKeyId || !config.cdpApiKeySecret) {
throw new Error(
"cdpApiKeyName and cdpApiKeyPrivateKey are required if not providing a walletProvider",
"cdpApiKeyId and cdpApiKeySecret are required if not providing a walletProvider",
);
}

walletProvider = await CdpWalletProvider.configureWithWallet({
apiKeyName: config.cdpApiKeyName,
apiKeyPrivateKey: config.cdpApiKeyPrivateKey,
apiKeyId: config.cdpApiKeyId,
apiKeySecret: config.cdpApiKeySecret,
});
}

Expand Down
Loading
Loading