Skip to main content
Glama

wallet_from_encrypted_json

Generate a wallet by decrypting an encrypted JSON file using a password. Ideal for accessing Ethereum and EVM-compatible wallets securely.

Instructions

Create a wallet by decrypting an encrypted JSON wallet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonYesThe encrypted JSON wallet
passwordYesThe password to decrypt the wallet

Implementation Reference

  • The core handler function that decrypts an encrypted JSON wallet file using ethers.Wallet.fromEncryptedJson, optionally connects it to the current provider, and returns the wallet's address, private key, and public key.
    export const fromEncryptedJsonHandler = async (input: any): Promise<ToolResultSchema> => { try { if (!input.json) { return createErrorResponse("Encrypted JSON is required"); } if (!input.password) { return createErrorResponse("Password is required"); } const wallet = await ethers.Wallet.fromEncryptedJson(input.json, input.password); const provider = getProvider() if (provider) { wallet.connect(provider); } return createSuccessResponse( `Wallet created from encrypted JSON successfully Address: ${wallet.address} Private Key: ${wallet.privateKey} Public Key: ${wallet.publicKey} `); } catch (error) { return createErrorResponse(`Failed to create wallet from encrypted JSON: ${(error as Error).message}`); } };
  • Tool definition including name, description, and input schema specifying required 'json' and 'password' parameters.
    { name: "wallet_from_encrypted_json", description: "Create a wallet by decrypting an encrypted JSON wallet", inputSchema: { type: "object", properties: { json: { type: "string", description: "The encrypted JSON wallet" }, password: { type: "string", description: "The password to decrypt the wallet" } }, required: ["json", "password"] } },
  • src/tools.ts:563-563 (registration)
    Maps the tool name 'wallet_from_encrypted_json' to its handler function in the central handlers dictionary.
    "wallet_from_encrypted_json": fromEncryptedJsonHandler,

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/dcSpark/mcp-cryptowallet-evm'

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