The simplest way to fetch and display the current gas fee for blockchain networks.
import { TatumSDK, Network, ApiVersion } from "@tatumio/tatum";
// Initialize the Tatum SDK with the desired network and API version
const tatum = await TatumSDK.init({ network: Network.ETHEREUM, version: ApiVersion.V1 });
// Fetch the current gas fee
const fee = await tatum.fee.getCurrentFee();
// Display the fetched fee in console
console.log(fee.data.gasPrice.fast);
});
tatum.destroy()
Tatum's Fee Submodule does the hard work for you – fetching current fees and estimating your transaction cost in an instant.
Display real-time gas fees clearly and simply. Integrate our Fee Submodule for transparent, user-friendly fee information.
Tatum’s Fee Submodule allows you to compare gas fees across blockchain networks.
"Tatum’s blockchain APIs help us build robust product solutions in a fraction of the time. We love working with their team... always responsive and reliable!"
Zac Barron
Product Lead at Binance
A powerful SDK, lightning-fast RPC nodes, faucets and a whole lot more - for free.