getMaxPriorityFeePerGas - SDK
Returns a fee per gas (in wei) that is an estimate of how much you can pay as a priority fee, or \tip, to get a transaction included in the current block. This number is generally used to set the maxPriorityFeePerGas field in a transaction request.
Returns a fee per gas (in wei) that is an estimate of how much you can pay as a priority fee, or “tip”, to get a transaction included in the current block. This number is generally used to set the maxPriorityFeePerGas
field in a transaction request.
Don’t have an API key?
Start using this method in your app today. Get started for free
Description
Returns a fee per gas (in wei
) that is an estimate of how much you can pay as a priority fee, or “tip”, to get a transaction included in the current block.
This number is generally used to set the maxPriorityFeePerGas
field in a transaction request.
Response
Example Request and Response
Prerequisite: You will need to install the Alchemy SDK before making requests with it.
The commands for installing it using npm or yarn are given below:
Request
Response
Use Cases
Here are some potential use cases for the getMaxPriorityFeePerGas
method:
- Setting optimal gas fees for transactions: By using the
getMaxPriorityFeePerGas
method, developers can ensure that they set optimal gas fees for their transactions. This can help ensure that transactions are processed quickly and efficiently while minimizing user costs. - Automating gas fee calculations: Some applications may need to calculate gas fees for transactions automatically. By using the
getMaxPriorityFeePerGas
method, developers can automate this process and ensure that gas fees are always set at the optimal level. - Monitoring network congestion: The value returned by
getMaxPriorityFeePerGas
can be an indicator of network congestion. Developers can use this information to monitor the network’s health and adjust their gas fees accordingly. - Providing transparency to users: By displaying the current
getMaxPriorityFeePerGas
value to users, developers can provide transparency and help users make informed decisions about their transactions.