get_sui_reference_gas_price
Retrieve the reference gas price for Sui blockchain transactions to calculate accurate network fees before submitting operations.
Instructions
Get reference gas price for Sui transactions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Network type (defaults to mainnet) |
Implementation Reference
- src/services/sui-service.ts:323-336 (handler)Core handler implementation: Retrieves the Sui RPC service and calls 'suix_getReferenceGasPrice' RPC method to get the reference gas price.async getReferenceGasPrice( network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { const service = this.blockchainService.getServiceByBlockchain('sui', network); if (!service) { return { success: false, error: `Sui service not found for ${network}`, }; } return this.blockchainService.callRPCMethod(service.id, 'suix_getReferenceGasPrice', []); }
- src/handlers/sui-handlers.ts:492-506 (handler)MCP tool handler case: Extracts network from args, calls SuiService.getReferenceGasPrice, formats response as MCP content.case 'get_sui_reference_gas_price': { const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await suiService.getReferenceGasPrice(network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/handlers/sui-handlers.ts:272-285 (registration)Tool registration: Defines name, description, and input schema. Returned by registerSuiHandlers and included in server's tools list.{ name: 'get_sui_reference_gas_price', description: 'Get reference gas price for Sui transactions', inputSchema: { type: 'object', properties: { network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, }, },
- src/handlers/sui-handlers.ts:275-285 (schema)Input schema for the tool: Optional network parameter (mainnet/testnet).inputSchema: { type: 'object', properties: { network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, }, },