transaction-retry-tool
Version:
Tool to retry transactions on a blockchain
16 lines • 627 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const getGasCost = async (env) => {
try {
// Get current gas price
const currentGasPrice = await env.ethers.provider.getGasPrice();
console.log('\x1b[32m%s\x1b[0m', 'Connected to network: ', env.network.name);
console.log('\x1b[34m%s\x1b[0m', 'Current gas price: ', env.ethers.BigNumber.from(currentGasPrice).toNumber());
return currentGasPrice;
}
catch (err) {
console.log('\x1b[33m%s\x1b[0m', `Error: ${err}`);
}
};
exports.default = getGasCost;
//# sourceMappingURL=getGasCost.js.map