zetrix_sdk_is_activated
Check if a Zetrix blockchain account is activated by verifying its status with the provided address.
Instructions
Check if an account is activated on the blockchain
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The Zetrix account address |
Implementation Reference
- src/index.ts:442-455 (schema)Tool schema definition including name, description, and input validation schema.{ name: "zetrix_sdk_is_activated", description: "Check if an account is activated on the blockchain", inputSchema: { type: "object", properties: { address: { type: "string", description: "The Zetrix account address", }, }, required: ["address"], }, },
- src/index.ts:442-455 (registration)Tool registration in the tools array used by ListToolsRequestSchema handler.{ name: "zetrix_sdk_is_activated", description: "Check if an account is activated on the blockchain", inputSchema: { type: "object", properties: { address: { type: "string", description: "The Zetrix account address", }, }, required: ["address"], }, },
- src/index.ts:1166-1179 (handler)MCP dispatch handler for the tool, validates args and delegates to ZetrixSDK.isAccountActivated.case "zetrix_sdk_is_activated": { if (!args) { throw new Error("Missing arguments"); } const isActivated = await zetrixSDK.isAccountActivated(args.address as string); return { content: [ { type: "text", text: JSON.stringify({ address: args.address, isActivated }, null, 2), }, ], }; }
- src/zetrix-sdk.ts:245-265 (handler)Core implementation: Calls official Zetrix SDK's account.isActivated, handles errorCode 4 as inactive account.async isAccountActivated(address: string): Promise<boolean> { await this.initSDK(); try { const result = await this.sdk.account.isActivated(address); if (result.errorCode !== 0) { // If error code is "account not exist", return false if (result.errorCode === 4) { return false; } throw new Error(result.errorDesc || `SDK Error: ${result.errorCode}`); } return result.result.isActivated; } catch (error) { throw new Error( `Failed to check account: ${error instanceof Error ? error.message : String(error)}` ); } }