Skip to main content

Classes

CdpClient

Defined in: cdp.ts:26 The main client for interacting with the CDP API.

Constructors

Constructor
new CdpClient(options?: CdpClientOptions): CdpClient;
Defined in: cdp.ts:77 The CdpClient is the main class for interacting with the CDP API. There are a few required parameters that are configured in the CDP Portal:
  • CDP Secret API Key (apiKeyId & apiKeySecret): These are used to authenticate requests to the entire suite of APIs offered on Coinbase Developer Platform. Read more about CDP API keys.
  • Wallet Secret (walletSecret): This secret is used specifically to authenticate requests to POST, and DELETE endpoints in the EVM and Solana Account APIs.
These parameters can be set as environment variables:
CDP_API_KEY_ID=your-api-key-id
CDP_API_KEY_SECRET=your-api-key-secret
CDP_WALLET_SECRET=your-wallet-secret
Or passed as options to the constructor:
const cdp = new CdpClient({
  apiKeyId: "your-api-key-id",
  apiKeySecret: "your-api-key-secret",
  walletSecret: "your-wallet-secret",
});
The CdpClient is namespaced by chain type: evm or solana. As an example, to create a new EVM account, use cdp.evm.createAccount(). To create a new Solana account, use cdp.solana.createAccount().
Parameters
options?
CdpClientOptions = {} Configuration options for the CdpClient.
Returns
CdpClient

Properties

endUser
endUser: EndUserClient;
Defined in: cdp.ts:37 Namespace containing all end user methods.
evm
evm: EvmClient;
Defined in: cdp.ts:28 Namespace containing all EVM methods.
policies
policies: PoliciesClient;
Defined in: cdp.ts:34 Namespace containing all Policies methods.
solana
solana: SolanaClient;
Defined in: cdp.ts:31 Namespace containing all Solana methods.
webhooks
webhooks: WebhooksClient;
Defined in: cdp.ts:40 Namespace containing all webhook methods.

Interfaces

CdpClientOptions

Defined in: cdp.ts:10

Properties

apiKeyId?
optional apiKeyId: string;
Defined in: cdp.ts:12 The API key ID.
apiKeySecret?
optional apiKeySecret: string;
Defined in: cdp.ts:14 The API key secret.
basePath?
optional basePath: string;
Defined in: cdp.ts:20 The host URL to connect to.
debugging?
optional debugging: boolean;
Defined in: cdp.ts:18 Whether to enable debugging.
walletSecret?
optional walletSecret: string;
Defined in: cdp.ts:16 The wallet secret.