update fetcher
This commit is contained in:
parent
4ba67e3c86
commit
211d68eeba
@ -144,8 +144,8 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultGasPrice: 2,
|
||||
gasOracleUrls: ['https://ethgasstation.info/json/ethgasAPI.json', 'https://gasprice.poa.network/'],
|
||||
defaultGasPrice: 20,
|
||||
gasOracleUrls: ['https://ethgasstation.info/json/ethgasAPI.json', 'https://gas-oracle.zoltu.io/'],
|
||||
port: process.env.APP_PORT,
|
||||
relayerServiceFee: Number(process.env.RELAYER_FEE)
|
||||
}
|
@ -56,18 +56,14 @@ class Fetcher {
|
||||
throw new Error('Fetch gasPrice failed')
|
||||
}
|
||||
|
||||
if (json.slow) {
|
||||
this.gasPrices.low = Number(json.slow) / delimiter
|
||||
}
|
||||
if (json.safeLow) {
|
||||
this.gasPrices.low = Number(json.safeLow) / delimiter
|
||||
}
|
||||
if (json.standard) {
|
||||
this.gasPrices.standard = Number(json.standard) / delimiter
|
||||
}
|
||||
if (json.fast) {
|
||||
this.gasPrices.fast = Number(json.fast) / delimiter
|
||||
}
|
||||
|
||||
if (json.percentile_97) {
|
||||
this.gasPrices.fast = parseInt(json.percentile_90) + 1 / delimiter
|
||||
}
|
||||
console.log('gas price fetch', this.gasPrices)
|
||||
} else {
|
||||
throw Error('Fetch gasPrice failed')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user