Last active
August 26, 2022 17:19
-
-
Save nonseodion/39f9c7a46b122131e8cec95ad4350cf0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//nodejs | |
const axios = require('axios') | |
async function getCurrentGasPrices() { | |
let response = await axios.get('https://bscgas.info/gas') | |
let prices = { | |
slow: response.data.slow, | |
standard: response.data.standard, | |
fast: response.data.fast, | |
instant: response.data.instant | |
} | |
console.log(`Current ETH Gas Prices (in GWEI):`) | |
console.log(`Slow: ${prices.slow} (transaction completes in < 30 minutes)`) | |
console.log(`Standard: ${prices.standard} (transaction completes in < 1 minute)`) | |
console.log(`Fast: ${prices.fast} (transaction completes in < 15 seconds)`) | |
console.log(`Instant: ${prices.instant} (transaction is accepted in next block, usually an overpayment)`) | |
return prices; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment