docs: align CDP config examples with actual API in typescript/agentkit README#1270
Open
memosr wants to merge 1 commit into
Open
docs: align CDP config examples with actual API in typescript/agentkit README#1270memosr wants to merge 1 commit into
memosr wants to merge 1 commit into
Conversation
…t 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.
🟡 Heimdall Review Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three related corrections to
typescript/agentkit/README.md, all stemming from documentation that drifted from the actual TypeScript API. Each one would cause real authentication or import failures for a developer following the README.Changes
1. Default provider name —
CdpWalletProvider→CdpSmartWalletProviderLines 84 and 95. The README claims the default wallet provider is
CdpWalletProvider, buttypescript/agentkit/src/agentkit.ts:57actually defaults toCdpSmartWalletProvider.The two lines also disagreed with each other — line 84 said
WalletProvider, line 95 saidWalletActionProvider. Unified both to match the implementation:2. Wrong config field name —
apiKeyPrivate→apiKeySecretLines 111, 130, and ~1358. Three separate code examples for
CdpWalletProvider.configureWithWallet()useapiKeyPrivate:But the actual interface at
typescript/agentkit/src/wallet-providers/cdp/cdpShared.ts:13defines the field asapiKeySecret. TypeScript will silently drop the unrecognized field, so following these examples produces a working type-check but a failing runtime authentication call.Fixed all three occurrences:
3. Disambiguate adjacent code blocks with conflicting parameter names
Lines 86 and 107. Two code blocks sit right next to each other but use entirely different parameter naming conventions:
AgentKit.from()shortcut →cdpApiKeyId/cdpApiKeySecretCdpWalletProvider.configureWithWallet()→apiKeyId/apiKeySecretThis is almost certainly the root cause of how the
apiKeyPrivatetypo propagated to three separate locations in fix #2 — readers copy-paste from the wrong block.Added a one-line clarifying comment to each block:
+ // When using the AgentKit.from() shortcut: const agentKit = AgentKit.from({ ... });+ // When constructing a wallet provider manually: await CdpWalletProvider.configureWithWallet({ ... });Verification
typescript/agentkit/README.mdmodifiedCdpSmartWalletProvideragainstagentkit.ts:57apiKeySecretagainstcdpShared.ts:13