I am currently checking different approaches to get the gas fee on ETH, because from 14/Feb/2024, the infrua API has a rate limit of 10 requests per second, and previous methods may be impacted.
const getGasPrice = async () => {const body = { jsonrpc: "2.0", method: "eth_gasPrice", params: [], id: 1 }; try { const response = await fetch(MAIN_ENDPOINT, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(body), }); const data = await response.json(); const wei = parseInt(data.result, 16); // Convert hex to decimal const gwei = wei / 1e9; // Convert wei to gwei return { wei: wei, gwei: gwei, }; } catch (error) { console.error('Error fetching gas price:', error); return null; }
};
See all methods of getting ETH gas fee
From 14/Feb, the Steem2ETH may be impacted, but I'll find out how to resolve this.
Steem to the Moon🚀!
- You can swap the STEEM/SBD to ETH Ethereum via steem2eth!
- You can swap the STEEM/SBD to Tether USDT (TRC-20) via steem2usdt!
- You can swap the STEEM/SBD to TRX (TRON) via steem2trx!
- You can swap the STEEM/SBD to BTS (BitShares) via steem2bts!
- Register a free STEEM account at SteemYY!
- Steem Block Explorer
- ChatGPT/Steem Integration: You can type !ask command to invoke ChatGPT
- Steem Witness Table and API
- Other Steem Tools