zetrix_sdk_create_account
Generate a new blockchain account on Zetrix using the official SDK to enable secure transactions and smart contract interactions.
Instructions
Create a new Zetrix account using the official SDK
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1139-1149 (handler)MCP server handler for the 'zetrix_sdk_create_account' tool. Dispatches the request by calling ZetrixSDK.createAccount() and returns the result as JSON.case "zetrix_sdk_create_account": { const account = await zetrixSDK.createAccount(); return { content: [ { type: "text", text: JSON.stringify(account, null, 2), }, ], }; }
- src/index.ts:420-427 (registration)Tool registration in the tools array used by ListToolsRequestHandler. Defines name, description, and empty input schema.{ name: "zetrix_sdk_create_account", description: "Create a new Zetrix account using the official SDK", inputSchema: { type: "object", properties: {}, }, },
- src/zetrix-sdk.ts:83-103 (helper)Core implementation of account creation in ZetrixSDK wrapper class. Initializes SDK and calls official zetrix-sdk-nodejs account.create() method to generate new keypair and address.async createAccount(): Promise<ZetrixSDKAccount> { await this.initSDK(); try { const result = await this.sdk.account.create(); if (result.errorCode !== 0) { throw new Error(result.errorDesc || `SDK Error: ${result.errorCode}`); } return { address: result.result.address, privateKey: result.result.privateKey, publicKey: result.result.publicKey, }; } catch (error) { throw new Error( `Failed to create account: ${error instanceof Error ? error.message : String(error)}` ); } }
- src/zetrix-sdk.ts:17-21 (schema)TypeScript interface defining the output structure of the createAccount method.export interface ZetrixSDKAccount { address: string; privateKey: string; publicKey: string; }