AgentKit supports multiple wallet providers, with the CDP Wallet API being the default implementation. It supports the following operations, alongside compatibility with the full suite of CDP products including Onramp, onchain reputation score, and Commerce:

Wallet Configuration

You can configure AgentKit to use a CDP wallet or a custom wallet provider.
The CDP Wallet API is the default wallet provider for AgentKit. It is configured with an API key and optional network ID. You can find a list of supported networks here.
import { CdpWalletProvider } from "@coinbase/agentkit";

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

// ...
// Initialize AgentKit
const agentkit = await AgentKit.from({
  walletProvider,
  actionProviders: [],
});

Configuring from an existing CDP API WalletIf you already have a CDP API Wallet, you can configure the CdpWalletProvider by passing the wallet parameter to the configureWithWallet method.
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",
});
Configuring from a mnemonic phraseThe CdpWalletProvider can be configured from a mnemonic phrase by passing the mnemonicPhrase parameter to the configureWithWallet method.
import { CdpWalletProvider } from "@coinbase/agentkit";

const walletProvider = await CdpWalletProvider.configureWithWallet({
    mnemonicPhrase: "MNEMONIC PHRASE",
});
Exporting a walletThe CdpWalletProvider can export a wallet by calling the exportWallet method.
import { CdpWalletProvider } from "@coinbase/agentkit";

const walletProvider = await CdpWalletProvider.configureWithWallet({
    mnemonicPhrase: "MNEMONIC PHRASE",
});

const walletData = await walletProvider.exportWallet();
Importing a wallet from WalletData JSON stringThe CdpWalletProvider can import a wallet from a WalletData JSON string by passing the cdpWalletData parameter to the configureWithWallet method.
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",
});

Default Operations

By default, AgentKit supports the following basic wallet operations:
  • get_wallet_details - Get details about the Wallet, like the address
  • transfer - Transfer assets between addresses
  • get_balance - Get the balance of an asset
You can add additional actions or action providers upon agent instantiation.