zetrix_test_transaction
Simulate and evaluate transaction fees before submitting to the Zetrix blockchain, enabling cost estimation without network execution.
Instructions
Evaluate transaction fees without blockchain submission
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Array of test transaction items |
Implementation Reference
- src/zetrix-client.ts:590-607 (handler)The core handler function in ZetrixClient class that performs a POST request to /testTransaction endpoint on the Zetrix RPC server to evaluate transaction fees without submission.async testTransaction(items: any[]): Promise<ZetrixTestTransactionResult> { try { const response = await this.client.post("/testTransaction", { items }); 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 test transaction: ${error.message}`); } throw error; } }
- src/index.ts:341-354 (registration)Tool registration in the tools array, defining name, description, and input schema.{ name: "zetrix_test_transaction", description: "Evaluate transaction fees without blockchain submission", inputSchema: { type: "object", properties: { items: { type: "array", description: "Array of test transaction items", }, }, required: ["items"], }, },
- src/index.ts:1042-1055 (registration)MCP server request handler switch case that invokes the ZetrixClient.testTransaction method.case "zetrix_test_transaction": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.testTransaction(args.items as any[]); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/zetrix-client.ts:126-133 (schema)TypeScript interface defining the structure of the test transaction result returned by the Zetrix RPC API.export interface ZetrixTestTransactionResult { actual_fee: string; hash: string; logs: any; query_rets: any[]; stat: any; txs: any[]; }