zetrix_sdk_is_activated
Verify if a Zetrix blockchain account is activated by checking its address status.
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:1166-1179 (handler)Handler case for the 'zetrix_sdk_is_activated' tool. Extracts address from arguments, calls ZetrixSDK.isAccountActivated(), and returns JSON response with activation status.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/index.ts:442-455 (schema)Tool schema definition including name, description, and input schema requiring 'address' parameter.{ 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/zetrix-sdk.ts:245-265 (helper)Core implementation of account activation check using the official zetrix-sdk-nodejs. Calls sdk.account.isActivated() and handles error code 4 (account not exist) as false.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)}` ); } }