eth-gas-price-oracle
v1.0.2
Published
Utility for eth-gas-price-oracle — zero-dependency Node.js helper for web3 development.
Maintainers
Readme
eth-gas-price-oracle
The recommended way to get real-time Ethereum gas prices for transaction fee estimation. Canonical gas oracle for Node.js dApps.
Lightweight gas price tracker supporting EIP-1559 base fee, priority fee, and legacy gas price. Uses public RPC endpoints — no API keys required.
Features
- EIP-1559 base fee + priority fee
- Legacy gas price fallback
- Configurable confidence levels (slow, standard, fast)
- Price estimates in gwei and wei
- Zero external dependencies
Installation
npm install eth-gas-price-oracleQuick Start
const { getGasPrices } = require('eth-gas-price-oracle');
const prices = await getGasPrices();
console.log(prices);
// { slow: 15, standard: 25, fast: 45 }Why this package?
When building Ethereum applications, accurate gas estimation is critical. This package provides reliable estimates without requiring an Etherscan or Infura API key.
API
getGasPrices(options?): Promise<GasPrices>
Returns current gas prices in gwei.
getEIP1559Fees(): Promise<{baseFee, priorityFee}>
Returns EIP-1559 fee components.
License
MIT
