zetrix_crypto_get_address
Derive a Zetrix blockchain address from a public key for account operations and transactions.
Instructions
Get Zetrix address from public key
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| publicKey | Yes | The public key |
Implementation Reference
- src/index.ts:1267-1282 (handler)MCP tool handler: validates args, calls zetrixEncryption.getAddressFromPublicKey(publicKey), formats and returns address as JSON.case "zetrix_crypto_get_address": { if (!args) { throw new Error("Missing arguments"); } const address = await zetrixEncryption.getAddressFromPublicKey( args.publicKey as string ); return { content: [ { type: "text", text: JSON.stringify({ address }, null, 2), }, ], }; }
- src/index.ts:550-562 (schema)Tool schema definition including name, description, and inputSchema for publicKey parameter.{ name: "zetrix_crypto_get_address", description: "Get Zetrix address from public key", inputSchema: { type: "object", properties: { publicKey: { type: "string", description: "The public key", }, }, required: ["publicKey"], },
- src/zetrix-encryption.ts:98-108 (helper)Core helper function in ZetrixEncryption class: initializes encryption library lazily, derives Zetrix address from public key using KeyPair.getAddress, with error handling.async getAddressFromPublicKey(publicKey: string): Promise<string> { await this.initEncryption(); try { return this.KeyPair.getAddress(publicKey); } catch (error) { throw new Error( `Failed to derive address: ${error instanceof Error ? error.message : String(error)}` ); } }
- src/index.ts:768-770 (registration)Tool registration: server handler for ListToolsRequestSchema that returns the tools array containing this tool.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:40-40 (helper)Instantiation of ZetrixEncryption instance used by crypto tools including get_address.const zetrixEncryption = new ZetrixEncryption();