CDP Agentkit
toolkit contains tools that enable an LLM agent to interact with the Coinbase Developer Platform. The toolkit provides a wrapper around the CDP SDK, allowing agents to perform onchain operations like transfers, trades, and smart contract interactions.
Overview
Integration details
Class | Package | Serializable | JS support | Version |
---|---|---|---|---|
CdpToolkit | cdp-langchain | ❌ | ❌ |
Tool features
The toolkit provides the following tools:- get_wallet_details - Get details about the MPC Wallet
- get_balance - Get balance for specific assets
- request_faucet_funds - Request test tokens from faucet
- transfer - Transfer assets between addresses
- trade - Trade assets (Mainnet only)
- deploy_token - Deploy ERC-20 token contracts
- mint_nft - Mint NFTs from existing contracts
- deploy_nft - Deploy new NFT contracts
- register_basename - Register a basename for the wallet
Setup
At a high-level, we will:- Install the langchain package
- Set up your CDP API credentials
- Initialize the CDP wrapper and toolkit
- Pass the tools to your agent with
toolkit.get_tools()
Installation
This toolkit lives in thecdp-langchain
package:
Set Environment Variables
To use this toolkit, you must first set the following environment variables to access the CDP APIs to create wallets and interact onchain. You can sign up for an API key for free on the CDP Portal:Instantiation
Now we can instantiate our toolkit:Tools
View available tools:Use within an agent
We will need a LLM or chat model:CDP Toolkit Specific Features
Wallet Management
The toolkit maintains an MPC wallet. The wallet data can be exported and imported to persist between sessions:Network Support
The toolkit supports multiple networksGasless Transactions
Some operations support gasless transactions on Base Mainnet:- USDC transfers
- EURC transfers
- cbBTC transfers