zetrix_get_transaction_history
Retrieve completed transaction records from the Zetrix blockchain using transaction hash or block sequence number to track and verify 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)The main handler function that executes the tool logic by querying the Zetrix API endpoint /getTransactionHistory with optional hash and ledger_seq parameters.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)Defines the input schema and metadata for the tool, including optional parameters hash and ledgerSeq.{ 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 (registration)The switch case that registers the tool name and invokes the ZetrixClient handler with parsed arguments.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), }, ], }; }