oracle legacy flag & improve fallback pricing
This commit is contained in:
parent
997ad4fd09
commit
b67665283f
7
cli.js
7
cli.js
@ -706,8 +706,9 @@ async function fetchGasPrice() {
|
|||||||
}
|
}
|
||||||
// Bump fees for Ethereum network
|
// Bump fees for Ethereum network
|
||||||
try {
|
try {
|
||||||
|
const isLegacy = true
|
||||||
const oracle = new GasPriceOracle(options);
|
const oracle = new GasPriceOracle(options);
|
||||||
const gas = await oracle.gasPrices();
|
const gas = await oracle.gasPrices({ isLegacy });
|
||||||
|
|
||||||
if (netId === 1) {
|
if (netId === 1) {
|
||||||
return gasPricesETH(gas.instant);
|
return gasPricesETH(gas.instant);
|
||||||
@ -715,8 +716,8 @@ async function fetchGasPrice() {
|
|||||||
return gasPrices(gas.instant)
|
return gasPrices(gas.instant)
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
const web3GasPrice = await web3.eth.getGasPrice();
|
const wei = await web3.eth.getGasPrice();
|
||||||
return web3GasPrice;
|
return wei / web3.utils.unitMap.gwei;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new Error(`Method fetchGasPrice has error ${err.message}`);
|
throw new Error(`Method fetchGasPrice has error ${err.message}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user