Skip to main content
Glama

get_wallet_address_from_private_key

Retrieve a wallet address from a private key with checksum formatting, enabling secure interaction with EDUCHAIN's token and pool data.

Instructions

Get wallet address from private key with proper checksum formatting

Input Schema

NameRequiredDescriptionDefault
privateKeyYesPrivate key of the wallet

Input Schema (JSON Schema)

{ "properties": { "privateKey": { "description": "Private key of the wallet", "type": "string" } }, "required": [ "privateKey" ], "type": "object" }

Implementation Reference

  • Core handler function that creates an ethers.Wallet from the provided private key and returns the checksummed wallet address.
    export function getWalletAddressFromPrivateKey(privateKey: string): string { try { const wallet = new ethers.Wallet(privateKey); return ethers.getAddress(wallet.address); // Format to checksum address } catch (error) { console.error('Error getting wallet address from private key:', error); throw error; } }
  • Input schema definition for the 'get_wallet_address_from_private_key' tool, listed in the ListTools response.
    { name: 'get_wallet_address_from_private_key', description: 'Get wallet address from private key with proper checksum formatting', inputSchema: { type: 'object', properties: { privateKey: { type: 'string', description: 'Private key of the wallet', }, }, required: ['privateKey'], }, },
  • src/index.ts:1000-1015 (registration)
    MCP tool registration and dispatch handler in the CallToolRequestSchema switch statement. Validates input and delegates to the blockchain module handler.
    case 'get_wallet_address_from_private_key': { if (!args.privateKey || typeof args.privateKey !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Private key is required'); } const walletAddress = blockchain.getWalletAddressFromPrivateKey(args.privateKey); return { content: [ { type: 'text', text: JSON.stringify({ walletAddress }, null, 2), }, ], }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SailFish-Finance/educhain-ai-agent-kit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server