helius_get_priority_fee_estimate
Retrieve transaction priority fee estimates on the Solana blockchain using the Helius API. Specify account keys and customize options like priority level to optimize fee calculations for efficient transaction processing.
Instructions
Get priority fee estimate for a transaction
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountKeys | No | ||
| options | No |
Input Schema (JSON Schema)
{
"properties": {
"accountKeys": {
"items": {
"type": "string"
},
"type": "array"
},
"options": {
"properties": {
"includeAllPriorityFeeLevels": {
"type": "boolean"
},
"priorityLevel": {
"enum": [
"default",
"high",
"max"
],
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
Implementation Reference
- src/handlers/helius.ts:463-479 (handler)The main handler function that implements the tool logic by calling the Helius SDK's getPriorityFeeEstimate RPC method, handling input validation implicitly through types, and formatting the response.export const getPriorityFeeEstimateHandler = async (input: GetPriorityFeeEstimateInput): Promise<ToolResultSchema> => { try { // This function has parameter type mismatches const result = await (helius as any as Helius).rpc.getPriorityFeeEstimate({ accountKeys: input.accountKeys, options: { priorityLevel: input.options?.priorityLevel as PriorityLevel, includeAllPriorityFeeLevels: input.options?.includeAllPriorityFeeLevels } }); return createSuccessResponse(`Priority fee estimate: ${JSON.stringify(result.priorityFeeEstimate, null, 2)} priorityFeeLevels: ${JSON.stringify(result.priorityFeeLevels ?? [], null, 2)} `); } catch (error) { return createErrorResponse(`Error getting priority fee estimate: ${error instanceof Error ? error.message : String(error)}`); } }
- src/tools.ts:450-466 (schema)Defines the MCP tool metadata, including name, description, and input schema for validation in the tools array.{ name: 'helius_get_priority_fee_estimate', description: 'Get priority fee estimate for a transaction', inputSchema: { type: 'object', properties: { accountKeys: { type: 'array', items: { type: 'string' } }, options: { type: 'object', properties: { priorityLevel: { type: 'string', enum: ['default', 'high', 'max'] }, includeAllPriorityFeeLevels: { type: 'boolean' } } } } } },
- src/tools.ts:585-585 (registration)Registers the tool name to its handler function (helius.getPriorityFeeEstimateHandler) in the handlers dictionary."helius_get_priority_fee_estimate": helius.getPriorityFeeEstimateHandler,
- src/handlers/helius.types.ts:246-252 (schema)TypeScript interface defining the expected input shape for the handler, matching the MCP inputSchema.export type GetPriorityFeeEstimateInput = { accountKeys?: string[]; options?: { priorityLevel?: "default" | "high" | "max"; includeAllPriorityFeeLevels?: boolean; }; }