eth_gasPrice - Moonbase RPC Method
Get current gas price on Moonbase Alpha. Essential for transaction cost estimation for EVM dApp testing, XCM integration validation, and pre-mainnet deployment verification.
Returns the current gas price on Moonbase Alpha in wei.
Why Moonbase? Build on the Moonbeam testnet for risk-free EVM dApp development and deployment testing with free testnet tokens, full EVM compatibility, XCM testing capabilities, and identical feature set to Moonbeam mainnet.
Use Cases
The eth_gasPrice method is essential for:
- Transaction pricing - Set appropriate gas prices
- Cost estimation - Calculate transaction costs before sending
- Gas monitoring - Track network congestion
- DeFi operations - Optimize costs for EVM dApp testing, XCM integration validation, and pre-mainnet deployment verification
Code Examples
Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32603 | Internal error | Node error |
Related Methods
eth_maxPriorityFeePerGas- Get priority fee (EIP-1559)eth_feeHistory- Get historical fee dataeth_estimateGas- Estimate gas needed
eth_estimateGas
Estimate gas required for transactions on Moonbase Alpha. Essential for optimizing transaction costs for EVM dApp testing, XCM integration validation, and pre-mainnet deployment verification.
eth_maxPriorityFeePerGas
Get the suggested priority fee (tip) per gas for EIP-1559 transactions on Moonbase Alpha. Essential for gas estimation, fee optimization, and time-sensitive transaction pricing.