zetrix_submit_transaction
Submit signed transactions to the Zetrix blockchain for execution, enabling users to broadcast and process completed transactions on the network.
Instructions
Submit signed transaction to blockchain for execution
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transactionBlob | Yes | Serialized transaction blob | |
| signatures | Yes | Array of signature objects with sign_data and public_key |
Implementation Reference
- src/zetrix-client.ts:537-560 (handler)Core handler function that executes the tool logic by sending the transaction blob and signatures to the Zetrix RPC /submitTransaction endpoint via POST request.async submitTransaction( transactionBlob: string, signatures: Array<{ sign_data: string; public_key: string }> ): Promise<ZetrixSubmitResult> { try { const response = await this.client.post("/submitTransaction", { transaction_blob: transactionBlob, signatures, }); 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 submit transaction: ${error.message}`); } throw error; } }
- src/index.ts:1002-1018 (handler)MCP server switch-case handler that processes the tool call, validates arguments, invokes ZetrixClient.submitTransaction, and formats the response.case "zetrix_submit_transaction": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.submitTransaction( args.transactionBlob as string, args.signatures as Array<{ sign_data: string; public_key: string }> ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:282-299 (schema)Tool schema definition including name, description, and input validation schema for the zetrix_submit_transaction tool.{ name: "zetrix_submit_transaction", description: "Submit signed transaction to blockchain for execution", inputSchema: { type: "object", properties: { transactionBlob: { type: "string", description: "Serialized transaction blob", }, signatures: { type: "array", description: "Array of signature objects with sign_data and public_key", }, }, required: ["transactionBlob", "signatures"], }, },
- src/index.ts:768-770 (registration)Registration of the tools list handler, making the zetrix_submit_transaction tool discoverable via ListToolsRequest.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/zetrix-client.ts:114-117 (schema)TypeScript interface defining the expected output structure from submitTransaction.export interface ZetrixSubmitResult { hash: string; results: any[]; }