zetrix_create_keypair
Generate a public-private key pair for testing purposes on the Zetrix blockchain, enabling secure account setup and transaction signing.
Instructions
Generate a new public-private key pair (for testing only)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:133-140 (registration)Tool registration including name, description, and input schema (empty object).{ name: "zetrix_create_keypair", description: "Generate a new public-private key pair (for testing only)", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:861-871 (handler)Dispatch handler case that invokes ZetrixClient.createKeyPair() and formats response.case "zetrix_create_keypair": { const result = await zetrixClient.createKeyPair(); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/zetrix-client.ts:62-67 (schema)TypeScript interface defining the output structure of the keypair.export interface ZetrixKeyPair { address: string; private_key: string; public_key: string; enc_type: string; }
- src/zetrix-client.ts:319-336 (handler)Core handler implementation in ZetrixClient: makes RPC GET request to /createKeyPair endpoint, handles errors, and returns the generated keypair.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; } }