zetrix_get_transaction_history
Retrieve completed transaction records from the Zetrix blockchain using transaction hash or block sequence number to verify and analyze transaction history.
Instructions
Get completed transaction records
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | No | Transaction hash (optional) | |
| ledgerSeq | No | Block sequence number (optional) |
Implementation Reference
- src/zetrix-client.ts:421-444 (handler)Core implementation of the getTransactionHistory method in ZetrixClient. Makes an HTTP GET request to the Zetrix RPC endpoint '/getTransactionHistory' with optional hash and ledgerSeq parameters, handles errors, and returns the result.async getTransactionHistory(hash?: string, ledgerSeq?: number): Promise<any> { try { const params: any = {}; if (hash) params.hash = hash; if (ledgerSeq) params.ledger_seq = ledgerSeq; const response = await this.client.get("/getTransactionHistory", { params, }); 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 history: ${error.message}`); } throw error; } }
- src/index.ts:195-211 (schema)Tool schema definition including name, description, and input schema for 'zetrix_get_transaction_history' used in MCP tools list.{ name: "zetrix_get_transaction_history", description: "Get completed transaction records", inputSchema: { type: "object", properties: { hash: { type: "string", description: "Transaction hash (optional)", }, ledgerSeq: { type: "number", description: "Block sequence number (optional)", }, }, }, },
- src/index.ts:925-938 (handler)MCP server handler case for 'zetrix_get_transaction_history' tool. Extracts arguments, calls ZetrixClient.getTransactionHistory, and formats response as MCP content.case "zetrix_get_transaction_history": { const result = await zetrixClient.getTransactionHistory( args?.hash as string | undefined, args?.ledgerSeq as number | undefined ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }