import { CdpClient } from "@coinbase/cdp-sdk";import dotenv from "dotenv";dotenv.config();// Initialize the CDP client, which automatically loads// the API Key and Wallet Secret from the environment// variables.const cdp = new CdpClient();
In this and in the following examples, you can run your code by running:
import { CdpClient } from "@coinbase/cdp-sdk";import dotenv from "dotenv";dotenv.config();const cdp = new CdpClient();const account = await cdp.evm.createAccount();console.log(`Created EVM account: ${account.address}`);
After running the above snippet, you should see similar output:
Copy
Ask AI
Created EVM account: 0x3c0D84055994c3062819Ce8730869D0aDeA4c3Bf
You can also create accounts with human-readable names and retrieve them later using the getOrCreateAccount method.See the Managing Accounts guide for more information.
Accounts do not have funds on creation. We provide a Faucet API to easily fund your EVM account with testnet tokens and Solana account with devnet tokens.