helius_get_inflation_reward
Retrieve inflation rewards for Solana addresses by specifying addresses, epoch, and commitment level to analyze staking returns.
Instructions
Get inflation rewards for a list of addresses
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| addresses | Yes | ||
| epoch | No | ||
| commitment | No |
Implementation Reference
- src/handlers/helius.ts:254-270 (handler)Main handler function implementing the tool logic: validates addresses, calls Helius RPC getInflationReward, and formats response.export const getInflationRewardHandler = async (input: GetInflationRewardInput): Promise<ToolResultSchema> => { try { const addresses = []; for (const addr of input.addresses) { const result = validatePublicKey(addr); if (!(result instanceof PublicKey)) { return result; // Return the error response if any address is invalid } addresses.push(result); } const rewards = await (helius as any as Helius).connection.getInflationReward(addresses, input.epoch, input.commitment); return createSuccessResponse(`Inflation rewards: ${JSON.stringify(rewards, null, 2)}`); } catch (error) { return createErrorResponse(`Error getting inflation rewards: ${error instanceof Error ? error.message : String(error)}`); } }
- src/tools.ts:204-219 (schema)MCP tool schema definition including input validation schema for the tool.{ name: "helius_get_inflation_reward", description: "Get inflation rewards for a list of addresses", inputSchema: { type: "object", properties: { addresses: { type: "array", items: { type: "string" } }, epoch: { type: "number" }, commitment: { type: "string", enum: ["confirmed", "finalized", "processed"] } }, required: ["addresses"] } },
- src/tools.ts:565-565 (registration)Tool registration mapping the name to its handler function in the handlers dictionary."helius_get_inflation_reward": getInflationRewardHandler,
- src/handlers/helius.types.ts:124-128 (schema)TypeScript interface defining the input shape for the handler, used for type safety.export type GetInflationRewardInput = { addresses: string[]; epoch?: number; commitment?: "confirmed" | "finalized" | "processed"; }
- src/tools.ts:18-18 (registration)Import of the handler function from handlers/helius.ts.getInflationRewardHandler,