Multi-chain Gas Prices
Find out the current gas prices across multiple chains.
Getting started
Fetching the gas price
import { Sdk, NetworkNames, randomPrivateKey } from 'etherspot';
const privateKey = randomPrivateKey();
let etherspotSdkMainnetInstance: Sdk
/**
* If you want to get the gas price of another chain
* or network, simply instantiate the SDK with your
* desired `networkName`.
*/
etherspotSdkMainnetInstance = new Sdk({
privateKey,
}, {
networkName: 'mainnet' as NetworkNames,
});
// The following method returns the gas price
etherspotSdkMainnetInstance
.getGatewayGasInfo();Last updated
Was this helpful?