@coinbase/agentkit
Version:
Coinbase AgentKit core primitives
69 lines (68 loc) • 1.82 kB
TypeScript
import { CdpClient, type EvmServerAccount } from "@coinbase/cdp-sdk";
import type { Address, LocalAccount } from "viem";
export interface CdpProviderConfig {
/**
* The CDP API Key ID.
*/
apiKeyId?: string;
/**
* The CDP API Key Secret.
*/
apiKeySecret?: string;
/**
* The CDP Wallet Secret.
*/
walletSecret?: string;
}
/**
* Configuration options for the CDP Providers.
*/
export interface CdpWalletProviderConfig extends CdpProviderConfig {
/**
* The address of the wallet.
*/
address?: Address;
/**
* The network of the wallet.
*/
networkId?: string;
/**
* The idempotency key of the wallet. Only used when creating a new account.
*/
idempotencyKey?: string;
/**
* Optional RPC URL for Viem public client HTTP transport.
* Falls back to process.env.RPC_URL when not provided.
*/
rpcUrl?: string;
}
export interface CdpSmartWalletProviderConfig extends CdpWalletProviderConfig {
/**
* The owner account of the smart wallet.
*/
owner?: EvmServerAccount | LocalAccount | Address;
/**
* The name of the smart wallet.
*/
smartAccountName?: string;
/**
* The paymaster URL for gasless transactions.
*/
paymasterUrl?: string;
}
/**
* A wallet provider that can be used to interact with the CDP.
*/
export interface WalletProviderWithClient {
/**
* Gets the CDP client.
*/
getClient(): CdpClient;
}
/**
* Type guard to check if a wallet provider implements WalletProviderWithClient interface.
*
* @param provider - The provider to check
* @returns True if the provider implements WalletProviderWithClient
*/
export declare function isWalletProviderWithClient(provider: unknown): provider is WalletProviderWithClient;