Skip to content

Conversation

@AugustoL
Copy link
Collaborator

@AugustoL AugustoL commented Jan 21, 2026

Description

Add a Gas Tracker feature that displays real-time gas price tiers (Low/Average/High) and transaction cost estimates. Supports L2 networks like Optimism and Base that have very low gas prices by automatically switching to smaller units (Mwei/Kwei).

Related Issue

Closes #136

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • Add GasPrices type to src/types/index.ts
  • Add getGasPrices() method to NetworkAdapter using eth_feeHistory RPC
  • Add abstract getClient() method to NetworkAdapter for accessing the RPC client
  • Implement getClient() in all adapters (EVM, Optimism, Arbitrum, Base, Polygon, BNB)
  • Create dedicated Gas Tracker page (src/components/pages/gastracker/index.tsx)
  • Add gas price indicator to navbar with fuel pump icon
  • Update dashboard to show gas tiers with link to gas tracker
  • Add formatGasPrice utility to handle L2 low gas prices with appropriate units
  • Add route /:networkId/gastracker in App.tsx
  • Add CSS styles for gas tracker components

Screenshots (if applicable)

N/A - UI changes can be tested locally

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

  • Gas prices are fetched using eth_feeHistory for the last 20 blocks with 25th, 50th, and 75th percentiles
  • For L2 networks with very low gas prices (< 0.01 Gwei), the display automatically switches to Mwei or Kwei units
  • Transaction cost estimates include common operations: ETH Transfer, ERC20 Transfer/Approve, NFT Transfer, Swap, NFT Mint, and Contract Deploy

- Add GasPrices type and eth_feeHistory RPC method to NetworkAdapter
- Create dedicated gas tracker page with Low/Avg/High tiers
- Show transaction cost estimates for common tx types
- Add gas price indicator to navbar with fuel pump icon
- Update dashboard to show gas tiers with link to gas tracker
- Support L2 networks (Optimism, Base) with Mwei/Kwei units
- Extract formatGasPrice utility to reduce code duplication
@AugustoL AugustoL requested a review from MatiasOS January 21, 2026 17:55
@github-actions
Copy link

github-actions bot commented Jan 21, 2026

🚀 Preview: https://pr-175--openscan.netlify.app
📝 Commit: 28b89fdeb48f204bde739e5039f5d81b8db36ed9

Keep both extractData import for gas prices and AddressTransactionSearch
for address transaction lookup functionality.
@AugustoL AugustoL merged commit c587bd9 into openscan-explorer:dev Jan 21, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants