get_transaction_state
Retrieve the state and details of a Solana transaction using its transaction ID to verify status and view information.
Instructions
Retrieve the state and details of a transaction using Solana trx ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trxID | No | The transaction ID |
Implementation Reference
- src/tools/payments.ts:144-152 (handler)The core handler function that fetches and returns the transaction state from the P-Link API using the provided trxID.export async function get_transaction_state(args: any) { const { trxID } = args; const fet = await fetch(BASE + '/api/trxState/' + trxID + '/' + new Date().getTime()); var dat = await fet.text(); process.stderr.write(`[caisse][info] dat2 ${dat}\n`); var result = JSON.parse(dat); return result; }
- src/tools/payments.ts:43-45 (schema)Zod input schema definition for the tool, specifying an optional trxID string parameter.export const getGetTrxStateShape = { trxID: z.string().optional().describe("The transaction ID") };
- src/solution.ts:68-73 (registration)Tool registration in the static tools array used by ListToolsRequestSchema handler, defining name, description, input schema, and annotations.{ name: "get_transaction_state", description: get_transaction_state_title, inputSchema: jsonSchema(zodToJsonSchema(z.object(getGetTrxStateShape))).jsonSchema, annotations: { title: get_transaction_state_title, readOnlyHint: true } },
- src/solution.ts:145-147 (registration)Dispatch logic in the CallToolRequestSchema switch statement that invokes the tool handler.case "get_transaction_state": result = await get_transaction_state(args); break;
- src/tools/payments.ts:193-193 (helper)Title string used in tool description and annotations.export const get_transaction_state_title = "Retrieve the state and details of a transaction using Solana trx ID";