eth-gas-tracker-node is a powerful nodejs module that provides developers with an effortless way to retrieve live Ethereum gas prices, empowering them to optimize transactions and smart contracts on the Ethereum network.
- ๐ Retrieve live Ethereum gas prices with ease.
- โฝ๏ธ Obtain up-to-date and accurate gas price data.
- ๐ช Fine-tune transaction optimization based on real-time gas prices.
- ๐ค Seamless integration into existing projects.
- ๐ Comprehensive code examples for easy implementation.
npm i eth-gas-tracker-node
To retrieve live Ethereum gas prices, follow these simple steps:
const EthereumGasPrice = require('eth-gas-tracker-node');
const gasPriceTracker = new EthereumGasPrice();
// Using .then
gasPriceTracker.getGasPrices().then((gasPrices) => {
if (gasPrices) {
console.log(gasPrices);
} else {
console.error('Failed to fetch gas prices.');
}
});
// Using await
(async () => {
const gasPrices = await gasPriceTracker.getGasPrices();
if (gasPrices) {
console.log(gasPrices);
} else {
console.error('Failed to fetch gas prices.');
}
})();
Contributions are welcome! Feel free to fork the repository and submit pull requests as well.
This project is licensed under the MIT license.
Feel free to reach out to me for any project-related queries or collaborations. I'm always happy to connect and discuss ideas!