helius_get_transaction
Retrieve transaction details from the Solana blockchain using its signature. Specify commitment level (confirmed, finalized, or processed) to access accurate and up-to-date data via the Helius API.
Instructions
Get a transaction by its signature
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commitment | No | ||
| signature | Yes |
Input Schema (JSON Schema)
{
"properties": {
"commitment": {
"enum": [
"confirmed",
"finalized",
"processed"
],
"type": "string"
},
"signature": {
"type": "string"
}
},
"required": [
"signature"
],
"type": "object"
}
Implementation Reference
- src/handlers/helius.ts:159-175 (handler)The main handler function that fetches a transaction using the Helius SDK by signature and commitment level, returning JSON details or error.export const getTransactionHandler = async (input: GetTransactionInput): Promise<ToolResultSchema> => { try { // Use the newer signature with explicit config object const transaction = await (helius as any as Helius).connection.getTransaction( input.signature, { maxSupportedTransactionVersion: 0, commitment: input.commitment as any } ); if (!transaction) { return createErrorResponse(`Transaction not found for signature: ${input.signature}`); } return createSuccessResponse(`Transaction details: ${JSON.stringify(transaction, null, 2)}`); } catch (error) { return createErrorResponse(`Error getting transaction: ${error instanceof Error ? error.message : String(error)}`); } }
- src/tools.ts:125-136 (schema)Input schema definition for the helius_get_transaction tool, specifying signature as required and optional commitment.{ name: "helius_get_transaction", description: "Get a transaction by its signature", inputSchema: { type: "object", properties: { signature: { type: "string" }, commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] } }, required: ["signature"] } },
- src/tools.ts:558-558 (registration)Registration of the tool name to its handler function in the handlers dictionary."helius_get_transaction": getTransactionHandler,