Skip to main content
Glama

zetrix_crypto_generate_keypair

Generate a new cryptographic key pair for Zetrix blockchain accounts, providing private key, public key, and wallet address for secure transactions and smart contract interactions.

Instructions

Generate a new Zetrix key pair with private key, public key, and address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:529-535 (registration)
    Tool registration in the tools array, defining the name, description, and empty input schema (no parameters required).
    name: "zetrix_crypto_generate_keypair", description: "Generate a new Zetrix key pair with private key, public key, and address", inputSchema: { type: "object", properties: {}, }, },
  • MCP tool handler in the switch statement that invokes ZetrixEncryption.generateKeyPair() and formats the response.
    case "zetrix_crypto_generate_keypair": { const keyPair = await zetrixEncryption.generateKeyPair(); return { content: [ { type: "text", text: JSON.stringify(keyPair, null, 2), }, ], }; }
  • Core implementation of key pair generation using the official zetrix-encryption-nodejs library's KeyPair class.
    async generateKeyPair(): Promise<ZetrixKeyPair> { await this.initEncryption(); try { const kp = new this.KeyPair(); return { privateKey: kp.getEncPrivateKey(), publicKey: kp.getEncPublicKey(), address: kp.getAddress(), }; } catch (error) { throw new Error( `Failed to generate key pair: ${error instanceof Error ? error.message : String(error)}` ); } }
  • Lazy initialization of the external zetrix-encryption-nodejs library used by generateKeyPair.
    private async initEncryption() { if (this.encryption) return; try { // Dynamically import the CommonJS module const module = await import("zetrix-encryption-nodejs"); this.encryption = module.default || module; this.KeyPair = this.encryption.keypair; this.signature = this.encryption.signature; this.keystore = this.encryption.keystore; } catch (error) { throw new Error( `Failed to initialize Zetrix Encryption: ${error instanceof Error ? error.message : String(error)}` ); } }

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/Zetrix-Chain/zetrix-mcp-server'

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