get_recent_blockhash
Retrieve a recent blockhash to build valid transactions on the Solana blockchain, ensuring they are processed correctly by the network.
Instructions
Get recent blockhash for transaction building
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:798-806 (handler)The handler function that executes the tool logic: ensures connection and calls connection.getLatestBlockhash() to get the recent blockhash.async function handleGetRecentBlockhash() { ensureConnection(); const { blockhash } = await connection.getLatestBlockhash(); return { blockhash, network: currentNetwork }; }
- src/index.ts:240-247 (schema)Tool schema definition including name, description, and input schema (no required parameters). Part of the tools array used for listing tools.{ name: "get_recent_blockhash", description: "Get recent blockhash for transaction building", inputSchema: { type: "object", properties: {} } },
- src/index.ts:1315-1317 (registration)Dispatches the tool call to the handler function in the switch statement within the CallToolRequestSchema handler.case "get_recent_blockhash": result = await handleGetRecentBlockhash(); break;