diff --git a/src/DealerClient.ts b/src/DealerClient.ts index c08952d..2e2f500 100644 --- a/src/DealerClient.ts +++ b/src/DealerClient.ts @@ -547,10 +547,15 @@ export class DealerClient { return this._call("markets", "GET"); } + // attempts to get from etherchain, on failure returns 12 private async _getGasPrice(priority: GasPriority): Promise { const gasPriceApi = "https://www.etherchain.org/api/gasPriceOracle"; - const prices = await axios(gasPriceApi); - return new BigNumber(prices.data[priority]); + try { + const prices = await axios(gasPriceApi); + return new BigNumber(prices.data[priority]); + } catch { + return new BigNumber(12); + } } private async _loadAssets(): Promise {