From cf0d9fbc7335a1385a2eec90314336c8f7e385eb Mon Sep 17 00:00:00 2001 From: memosr Date: Thu, 4 Jun 2026 15:54:08 +0300 Subject: [PATCH] docs: align CDP config examples with actual API in typescript/agentkit README Three related corrections to typescript/agentkit/README.md, all stemming from documentation that drifted from the actual TypeScript API: 1. Default provider name was CdpWalletProvider in the README but the code at agentkit.ts:57 actually defaults to CdpSmartWalletProvider. Two adjacent lines also disagreed with each other (WalletProvider vs WalletActionProvider). Unified both to match the implementation. 2. CdpWalletProvider.configureWithWallet() examples used apiKeyPrivate in three places, but the CdpProviderConfig interface at wallet-providers/cdp/cdpShared.ts:13 defines the field as apiKeySecret. TypeScript silently drops unrecognized fields, so this silently breaks authentication. Fixed all 3 occurrences. 3. Two adjacent code blocks use different parameter naming conventions: AgentKit.from() takes cdpApiKeyId/cdpApiKeySecret, while CdpWalletProvider.configureWithWallet() takes apiKeyId/apiKeySecret. Added one-line clarifying comments before each block to prevent developers from conflating the two APIs (which is the root cause of the apiKeyPrivate typo above propagating across three locations). Doc-only changes. No code touched. --- typescript/agentkit/README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/typescript/agentkit/README.md b/typescript/agentkit/README.md index 37b14207f..a37857442 100644 --- a/typescript/agentkit/README.md +++ b/typescript/agentkit/README.md @@ -81,9 +81,10 @@ npm install @coinbase/agentkit ## Usage -### Create an AgentKit instance. If no wallet or action providers are specified, the agent will use the `CdpWalletProvider` and `WalletProvider` action provider. +### Create an AgentKit instance. If no wallet or action providers are specified, the agent will use the `CdpSmartWalletProvider` and `WalletActionProvider` action provider. ```typescript +// When using the AgentKit.from() shortcut: const agentKit = await AgentKit.from({ cdpApiKeyId: "CDP API KEY NAME", cdpApiKeySecret: "CDP API KEY SECRET", @@ -92,7 +93,7 @@ const agentKit = await AgentKit.from({ ### Create an AgentKit instance -If no wallet or action provider are specified, the agent will use the `CdpWalletProvider` and `WalletActionProvider` action provider by default. +If no wallet or action provider are specified, the agent will use the `CdpSmartWalletProvider` and `WalletActionProvider` action provider by default. ```typescript const agentKit = await AgentKit.from({ @@ -106,9 +107,10 @@ const agentKit = await AgentKit.from({ ```typescript import { CdpWalletProvider } from "@coinbase/agentkit"; +// When constructing a wallet provider manually: const walletProvider = await CdpWalletProvider.configureWithWallet({ apiKeyId: "CDP API KEY NAME", - apiKeyPrivate: "CDP API KEY SECRET", + apiKeySecret: "CDP API KEY SECRET", networkId: "base-mainnet", }); @@ -127,7 +129,7 @@ const agentKit = await AgentKit.from({ actionProviders: [ cdpApiActionProvider({ apiKeyId: "CDP API KEY NAME", - apiKeyPrivate: "CDP API KEY SECRET", + apiKeySecret: "CDP API KEY SECRET", }), pythActionProvider(), ], @@ -1355,7 +1357,7 @@ import { ZeroDevWalletProvider, CdpWalletProvider } from "@coinbase/agentkit"; // First create a CDP wallet provider as the signer const cdpWalletProvider = await CdpWalletProvider.configureWithWallet({ apiKeyId: "CDP API KEY NAME", - apiKeyPrivate: "CDP API KEY SECRET", + apiKeySecret: "CDP API KEY SECRET", networkId: "base-mainnet", });