We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/xR0am/tip-md-x402-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
list-cdp-accounts.tsā¢1.76 kB
// scripts/list-cdp-accounts.ts
import { CdpClient } from "@coinbase/cdp-sdk";
import dotenv from "dotenv";
dotenv.config();
async function listCdpAccounts() {
try {
console.log('š§ Initializing CDP client...');
const cdp = new CdpClient();
console.log('š Looking for CDP accounts...');
let response = await cdp.evm.listAccounts();
let accountCount = 0;
// Paginate through all accounts
while (true) {
for (const account of response.accounts) {
accountCount++;
console.log(`\nš Account ${accountCount}:`);
console.log(` Address: ${account.address}`);
console.log(` Name: ${account.name || 'Unnamed'}`);
// Check if this matches your funded wallet
if (account.address.toLowerCase() === process.env.CDP_AGENT_ADDRESS?.toLowerCase()) {
console.log(` šÆ THIS IS YOUR FUNDED WALLET! ā `);
}
}
if (!response.nextPageToken) break;
response = await cdp.evm.listAccounts({
pageToken: response.nextPageToken
});
}
console.log(`\nš Total accounts found: ${accountCount}`);
console.log(`š Looking for: ${process.env.CDP_AGENT_ADDRESS}`);
if (accountCount === 0) {
console.log('\nš” No accounts found. This could mean:');
console.log('1. Wrong API credentials');
console.log('2. Your funded wallet was created differently');
console.log('3. Need to import existing wallet using private key');
}
} catch (error) {
console.error('ā Error listing CDP accounts:', error);
if (error instanceof Error) {
console.error('Error details:', error.message);
}
}
}
// Run the listing
listCdpAccounts();