- Bitcoin
- Ethereum (requires API TOKEN from etherscan.io)
- Polygon (requires API TOKEN from polygonscan.com)
- BNB Chain / Binance Smart Chain (requires API TOKEN from bscscan.com)
npm i @samyan/gas-tracker
const gasTracker = new GasTracker();
gasTracker
.getBlockchain(BlockchainType.BITCOIN)
.getPrices()
.then((result: BitcoinResult) => {
console.log(result.getRegularPrice());
})
.catch((error: any) => {
console.log(error.message);
});
try {
const gasTracker = new GasTracker('YOUR_API_TOKEN');
const result = (await gasTracker
.getBlockchain(BlockchainType.ETHEREUM)
.getPrices()
) as EthereumResult;
console.log(result.getFastPrice());
} catch (error) {
console.log(error.message);
}