zetrix_create_keypair
Generate a public-private key pair for testing blockchain applications on the Zetrix network.
Instructions
Generate a new public-private key pair (for testing only)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/zetrix-client.ts:319-336 (handler)Core handler function in ZetrixClient that executes the tool logic by calling the Zetrix RPC endpoint '/createKeyPair' to generate a new public-private key pair.async createKeyPair(): Promise<ZetrixKeyPair> { try { const response = await this.client.get("/createKeyPair"); if (response.data.error_code !== 0) { throw new Error( response.data.error_desc || `API Error: ${response.data.error_code}` ); } return response.data.result; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Failed to create key pair: ${error.message}`); } throw error; } }
- src/index.ts:861-871 (handler)MCP server handler dispatch case that invokes the ZetrixClient.createKeyPair() method and formats the response for the MCP protocol.case "zetrix_create_keypair": { const result = await zetrixClient.createKeyPair(); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:133-140 (registration)Tool registration in the MCP tools array, defining name, description, and input schema (no parameters required).{ name: "zetrix_create_keypair", description: "Generate a new public-private key pair (for testing only)", inputSchema: { type: "object", properties: {}, }, },
- src/zetrix-client.ts:62-67 (schema)TypeScript interface defining the structure of the keypair returned by the tool (output schema).export interface ZetrixKeyPair { address: string; private_key: string; public_key: string; enc_type: string; }