get_sui_reference_gas_price
Retrieve the reference gas price for Sui blockchain transactions to estimate network fees. Specify network (mainnet/testnet) for accurate cost calculations.
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/handlers/sui-handlers.ts:272-285 (registration)Tool registration including name, description, and input schema for get_sui_reference_gas_price{ 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:492-506 (handler)Handler logic for executing the get_sui_reference_gas_price tool, extracts network param, calls SuiService, and formats responsecase '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/services/sui-service.ts:323-336 (helper)Core implementation in SuiService that performs the RPC call to suix_getReferenceGasPrice via blockchainServiceasync 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', []); }