以太坊优先费用计算器

在Etherscan交易页面显示实际的Priority Fee (小费) 计算结果,支持EIP-1559交易

作者
weiwei dai
日安装量
0
总安装量
0
评分
0 0 0
版本
1.0.0
创建于
2025-05-14
更新于
2025-05-14
大小
5.2 KB
许可证
MIT
适用于

# Etherscan Priority Fee Calculator

A Tampermonkey userscript that enhances Etherscan transaction pages by displaying actual Priority Fee (tips) calculations for EIP-1559 transactions.

## Features

- Real-time Priority Fee calculation for EIP-1559 transactions
- Displays fees in both Gwei and ETH units
- Clean and intuitive UI integration with Etherscan
- Supports all Etherscan subdomains
- Automatic calculation upon page load

## Usage

1. Visit any Ethereum transaction page on Etherscan (e.g., https://etherscan.io/tx/[transaction-hash])
2. The script will automatically calculate and display the actual Priority Fee below the transaction title
3. The fee will be shown in both Gwei and ETH units for convenience

## Technical Implementation

The script works by:
1. Fetching transaction data using JSON-RPC calls
2. Retrieving block data and transaction receipts
3. Calculating the actual Priority Fee using the formula:
```javascript
actualPriorityFee = min(maxPriorityFeePerGas, maxFeePerGas - baseFeePerGas) * gasUsed
```
4. Converting values between Wei, Gwei, and ETH units
5. Displaying results in a clean, styled container on the page

## Support

For issues, feature requests, or contributions, please visit the [GitHub repository](https://github.com/yuouiu/etherscan-priority-fee-calculator).