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.
Parameters
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
Use Cases
Error Handling
Error Code
Message
Description
Web3 Integration
Last updated
Was this helpful?