zetrix_get_transaction_blob
Serialize Zetrix blockchain transaction data into hexadecimal format for processing and transmission.
Instructions
Serialize transaction data into hexadecimal format
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transaction | Yes | Transaction object with source_address, nonce, fee_limit, gas_price, operations |
Implementation Reference
- src/index.ts:268-281 (registration)Tool registration including name, description, and input schema definition.{ name: "zetrix_get_transaction_blob", description: "Serialize transaction data into hexadecimal format", inputSchema: { type: "object", properties: { transaction: { type: "object", description: "Transaction object with source_address, nonce, fee_limit, gas_price, operations", }, }, required: ["transaction"], }, },
- src/index.ts:987-1000 (handler)MCP server handler that receives tool call and delegates to ZetrixClient.getTransactionBlob.case "zetrix_get_transaction_blob": { if (!args) { throw new Error("Missing arguments"); } const result = await zetrixClient.getTransactionBlob(args.transaction); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/zetrix-client.ts:518-535 (handler)Core implementation: Posts transaction object to Zetrix node API /getTransactionBlob endpoint to serialize into hex blob.async getTransactionBlob(transaction: any): Promise<ZetrixTransactionBlob> { try { const response = await this.client.post("/getTransactionBlob", transaction); 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 get transaction blob: ${error.message}`); } throw error; } }