Skip to main content
Glama

zetrix_crypto_validate_key

Validate private keys, public keys, or addresses for the Zetrix blockchain to ensure proper format and security before use in transactions or account operations.

Instructions

Validate private key, public key, or address format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesType of key to validate
valueYesThe key or address to validate

Implementation Reference

  • Tool handler that validates the input key type (privateKey, publicKey, or address) by calling the corresponding validation method on ZetrixEncryption instance and returns validation result.
    case "zetrix_crypto_validate_key": { if (!args) { throw new Error("Missing arguments"); } let isValid = false; const type = args.type as string; const value = args.value as string; if (type === "privateKey") { isValid = await zetrixEncryption.isValidPrivateKey(value); } else if (type === "publicKey") { isValid = await zetrixEncryption.isValidPublicKey(value); } else if (type === "address") { isValid = await zetrixEncryption.isValidAddress(value); } return { content: [ { type: "text", text: JSON.stringify({ type, value, isValid }, null, 2), }, ], }; }
  • Input schema definition for the tool, specifying parameters 'type' (enum: privateKey/publicKey/address) and 'value'.
    { name: "zetrix_crypto_validate_key", description: "Validate private key, public key, or address format", inputSchema: { type: "object", properties: { type: { type: "string", enum: ["privateKey", "publicKey", "address"], description: "Type of key to validate", }, value: { type: "string", description: "The key or address to validate", }, }, required: ["type", "value"], }, },
  • Helper method to validate private key format using the underlying zetrix-encryption-nodejs library's KeyPair.checkEncPrivateKey.
    async isValidPrivateKey(privateKey: string): Promise<boolean> { await this.initEncryption(); try { return this.KeyPair.checkEncPrivateKey(privateKey); } catch (error) { return false; } }
  • Helper method to validate public key format using the underlying zetrix-encryption-nodejs library's KeyPair.checkEncPublicKey.
    async isValidPublicKey(publicKey: string): Promise<boolean> { await this.initEncryption(); try { return this.KeyPair.checkEncPublicKey(publicKey); } catch (error) { return false; } }
  • Helper method to validate address format using the underlying zetrix-encryption-nodejs library's KeyPair.checkAddress.
    async isValidAddress(address: string): Promise<boolean> { await this.initEncryption(); try { return this.KeyPair.checkAddress(address); } catch (error) { return false; } }

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