update fetcher

This commit is contained in:
Roman Storm 2020-03-13 10:51:06 -07:00
parent 4ba67e3c86
commit 211d68eeba
No known key found for this signature in database
GPG Key ID: 522F2A785F34E71F
2 changed files with 7 additions and 11 deletions

View File

@ -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)
}

View File

@ -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')
}