get_solana_fee_for_message
Calculate Solana transaction fees for base64-encoded messages on mainnet or testnet networks to estimate costs before execution.
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:170-188 (registration)Tool registration definition including name, description, and input schema for 'get_solana_fee_for_message'{ 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'], }, },
- src/handlers/solana-handlers.ts:408-423 (handler)Dispatcher handler case in handleSolanaTool function that calls SolanaService.getFeeForMessage with parsed argumentscase '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/services/solana-service.ts:348-366 (handler)Core implementation in SolanaService.getFeeForMessage that retrieves Solana RPC service and calls getFeeForMessage RPC methodasync 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] ); }