Skip to main content
Tempo API method that returns the current gas price in wei. On Tempo, transaction fees are paid in TIP-20 stablecoins, not a native token. The gas price returned is used to calculate the USD-denominated fee.

Parameters

  • none

Response

  • result — the current gas price in wei encoded as hexadecimal

eth_gasPrice code examples

const Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);

async function getGasPrice() {
  const gasPrice = await web3.eth.getGasPrice();
  console.log(`Gas price: ${gasPrice} wei`);
}

getGasPrice()