get_solana_fee_for_message
Calculate transaction fees for Solana blockchain operations by providing a base64-encoded message, supporting both mainnet and testnet networks.
Instructions
Estimate fee for a serialized Solana message (base64)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | Serialized message in base64 | |
| network | No | Network type (defaults to mainnet) |
Implementation Reference
- src/handlers/solana-handlers.ts:408-423 (handler)MCP tool handler case that extracts arguments, calls solanaService.getFeeForMessage, and formats the response.case 'get_solana_fee_for_message': { const message = args?.message as string; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await solanaService.getFeeForMessage(message, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/handlers/solana-handlers.ts:170-188 (registration)Tool registration including name, description, and input schema, returned by registerSolanaHandlers.{ name: 'get_solana_fee_for_message', description: 'Estimate fee for a serialized Solana message (base64)', inputSchema: { type: 'object', properties: { message: { type: 'string', description: 'Serialized message in base64', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['message'], }, },
- Service method that resolves the Solana RPC endpoint and calls getFeeForMessage RPC method with the base64 message.async getFeeForMessage( message: string, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { const service = this.blockchainService.getServiceByBlockchain('solana', network); if (!service) { return { success: false, error: `Solana service not found for ${network}`, }; } return this.blockchainService.callRPCMethod( service.id, 'getFeeForMessage', [message] ); }