eth_maxPriorityFeePerGas - Base
Example code for the eth_maxPriorityFeePerGas JSON-RPC method. Complete guide on how to use eth_maxPriorityFeePerGas JSON-RPC in GetBlock Web3 documentation.
The eth_maxPriorityFeePerGas method returns a suggested max priority fee per gas (tip) for EIP-1559 transactions. On Base, priority fees are typically low since the sequencer processes transactions in order of receipt.
Parameters
None
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_maxPriorityFeePerGas",
"params": [],
"id": "getblock.io"
}'const axios = require('axios');
const response = await axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'eth_maxPriorityFeePerGas',
params: [],
id: 'getblock.io'
}, {
headers: { 'Content-Type': 'application/json' }
});
const priorityFee = parseInt(response.data.result, 16);
console.log('Priority Fee:', priorityFee / 1e9, 'gwei');Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": "0xf4240"
}Response Parameters
Parameter
Type
Description
jsonrpc
string
JSON-RPC protocol version ("2.0")
id
string
Request identifier matching the request
result
string
Suggested max priority fee per gas in wei (hex)
Use Cases
Error Handling
Error Code
Message
Description
-32603
Internal error
Node internal failure
Web3 Integration
Last updated
Was this helpful?