import { CdpClient } from "@coinbase/cdp-sdk";
import dotenv from "dotenv";
dotenv.config();
const cdp = new CdpClient();
const accountName = "my-account";
// If the account doesn't exist, it will be created.
let evmAccount = await cdp.evm.getOrCreateAccount({
name: accountName
});
console.log(`Created account with name ${evmAccount.name}.`);
// If the account already exists, it will be retrieved.
evmAccount = await cdp.evm.getOrCreateAccount({
name: accountName
});
console.log(`Retrieved account with name ${evmAccount.name}.`);